polotno-node 2.9.21 → 2.9.23

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,277 @@
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 Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Do(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 G_={exports:{}},bt={};/**
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 tf=Symbol.for("react.element"),SE=Symbol.for("react.portal"),EE=Symbol.for("react.fragment"),OE=Symbol.for("react.strict_mode"),PE=Symbol.for("react.profiler"),xE=Symbol.for("react.provider"),CE=Symbol.for("react.context"),TE=Symbol.for("react.forward_ref"),AE=Symbol.for("react.suspense"),kE=Symbol.for("react.memo"),RE=Symbol.for("react.lazy"),g3=Symbol.iterator;function LE(e){return e===null||typeof e!="object"?null:(e=g3&&e[g3]||e["@@iterator"],typeof e=="function"?e:null)}var $_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V_=Object.assign,q_={};function pu(e,t,r){this.props=e,this.context=t,this.refs=q_,this.updater=r||$_}pu.prototype.isReactComponent={};pu.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")};pu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function W_(){}W_.prototype=pu.prototype;function Fm(e,t,r){this.props=e,this.context=t,this.refs=q_,this.updater=r||$_}var jm=Fm.prototype=new W_;jm.constructor=Fm;V_(jm,pu.prototype);jm.isPureReactComponent=!0;var v3=Array.isArray,Y_=Object.prototype.hasOwnProperty,zm={current:null},K_={key:!0,ref:!0,__self:!0,__source:!0};function X_(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)Y_.call(t,n)&&!K_.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:tf,type:e,key:a,ref:o,props:i,_owner:zm.current}}function ME(e,t){return{$$typeof:tf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Bm(e){return typeof e=="object"&&e!==null&&e.$$typeof===tf}function NE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var m3=/\/+/g;function T1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?NE(""+e.key):t.toString(36)}function Gd(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 tf:case SE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+T1(o,0):n,v3(i)?(r="",e!=null&&(r=e.replace(m3,"$&/")+"/"),Gd(i,t,r,"",function(f){return f})):i!=null&&(Bm(i)&&(i=ME(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(m3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",v3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+T1(a,l);o+=Gd(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+T1(a,l++),o+=Gd(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 gd(e,t,r){if(e==null)return e;var n=[],i=0;return Gd(e,n,"","",function(a){return t.call(r,a,i++)}),n}function IE(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 pn={current:null},$d={transition:null},DE={ReactCurrentDispatcher:pn,ReactCurrentBatchConfig:$d,ReactCurrentOwner:zm};function Z_(){throw Error("act(...) is not supported in production builds of React.")}bt.Children={map:gd,forEach:function(e,t,r){gd(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return gd(e,function(){t++}),t},toArray:function(e){return gd(e,function(t){return t})||[]},only:function(e){if(!Bm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};bt.Component=pu;bt.Fragment=EE;bt.Profiler=PE;bt.PureComponent=Fm;bt.StrictMode=OE;bt.Suspense=AE;bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DE;bt.act=Z_;bt.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=V_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=zm.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)Y_.call(t,u)&&!K_.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:tf,type:e.type,key:i,ref:a,props:n,_owner:o}};bt.createContext=function(e){return e={$$typeof:CE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:xE,_context:e},e.Consumer=e};bt.createElement=X_;bt.createFactory=function(e){var t=X_.bind(null,e);return t.type=e,t};bt.createRef=function(){return{current:null}};bt.forwardRef=function(e){return{$$typeof:TE,render:e}};bt.isValidElement=Bm;bt.lazy=function(e){return{$$typeof:RE,_payload:{_status:-1,_result:e},_init:IE}};bt.memo=function(e,t){return{$$typeof:kE,type:e,compare:t===void 0?null:t}};bt.startTransition=function(e){var t=$d.transition;$d.transition={};try{e()}finally{$d.transition=t}};bt.unstable_act=Z_;bt.useCallback=function(e,t){return pn.current.useCallback(e,t)};bt.useContext=function(e){return pn.current.useContext(e)};bt.useDebugValue=function(){};bt.useDeferredValue=function(e){return pn.current.useDeferredValue(e)};bt.useEffect=function(e,t){return pn.current.useEffect(e,t)};bt.useId=function(){return pn.current.useId()};bt.useImperativeHandle=function(e,t,r){return pn.current.useImperativeHandle(e,t,r)};bt.useInsertionEffect=function(e,t){return pn.current.useInsertionEffect(e,t)};bt.useLayoutEffect=function(e,t){return pn.current.useLayoutEffect(e,t)};bt.useMemo=function(e,t){return pn.current.useMemo(e,t)};bt.useReducer=function(e,t,r){return pn.current.useReducer(e,t,r)};bt.useRef=function(e){return pn.current.useRef(e)};bt.useState=function(e){return pn.current.useState(e)};bt.useSyncExternalStore=function(e,t,r){return pn.current.useSyncExternalStore(e,t,r)};bt.useTransition=function(){return pn.current.useTransition()};bt.version="18.3.1";G_.exports=bt;var it=G_.exports;const yt=Yh(it);var ah={},Q_={exports:{}},qn={},J_={exports:{}},e6={};/**
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(F,G){var L=F.length;F.push(G);e:for(;0<L;){var I=L-1>>>1,B=F[I];if(0<i(B,G))F[I]=G,F[L]=B,L=I;else break e}}function r(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var G=F[0],L=F.pop();if(L!==G){F[0]=L;e:for(var I=0,B=F.length,D=B>>>1;I<D;){var $=2*(I+1)-1,K=F[$],Y=$+1,H=F[Y];if(0>i(K,L))Y<B&&0>i(H,K)?(F[I]=H,F[Y]=L,I=Y):(F[I]=K,F[$]=L,I=$);else if(Y<B&&0>i(H,L))F[I]=H,F[Y]=L,I=Y;else break e}}return G}function i(F,G){var L=F.sortIndex-G.sortIndex;return L!==0?L:F.id-G.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=[],v=1,S=null,_=3,p=!1,E=!1,b=!1,m=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,h=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(F){for(var G=r(f);G!==null;){if(G.callback===null)n(f);else if(G.startTime<=F)n(f),G.sortIndex=G.expirationTime,t(u,G);else break;G=r(f)}}function y(F){if(b=!1,d(F),!E)if(r(u)!==null)E=!0,q(O);else{var G=r(f);G!==null&&z(y,G.startTime-F)}}function O(F,G){E=!1,b&&(b=!1,g(w),w=-1),p=!0;var L=_;try{for(d(G),S=r(u);S!==null&&(!(S.expirationTime>G)||F&&!A());){var I=S.callback;if(typeof I=="function"){S.callback=null,_=S.priorityLevel;var B=I(S.expirationTime<=G);G=e.unstable_now(),typeof B=="function"?S.callback=B:S===r(u)&&n(u),d(G)}else n(u);S=r(u)}if(S!==null)var D=!0;else{var $=r(f);$!==null&&z(y,$.startTime-G),D=!1}return D}finally{S=null,_=L,p=!1}}var k=!1,C=null,w=-1,P=5,x=-1;function A(){return!(e.unstable_now()-x<P)}function R(){if(C!==null){var F=e.unstable_now();x=F;var G=!0;try{G=C(!0,F)}finally{G?M():(k=!1,C=null)}}else k=!1}var M;if(typeof h=="function")M=function(){h(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=R,M=function(){V.postMessage(null)}}else M=function(){m(R,0)};function q(F){C=F,k||(k=!0,M())}function z(F,G){w=m(function(){F(e.unstable_now())},G)}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(F){F.callback=null},e.unstable_continueExecution=function(){E||p||(E=!0,q(O))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(F){switch(_){case 1:case 2:case 3:var G=3;break;default:G=_}var L=_;_=G;try{return F()}finally{_=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,G){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var L=_;_=F;try{return G()}finally{_=L}},e.unstable_scheduleCallback=function(F,G,L){var I=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?I+L:I):L=I,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=L+B,F={id:v++,callback:G,priorityLevel:F,startTime:L,expirationTime:B,sortIndex:-1},L>I?(F.sortIndex=L,t(f,F),r(u)===null&&F===r(f)&&(b?(g(w),w=-1):b=!0,z(y,L-I))):(F.sortIndex=B,t(u,F),E||p||(E=!0,q(O))),F},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(F){var G=_;return function(){var L=_;_=G;try{return F.apply(this,arguments)}finally{_=L}}}})(e6);J_.exports=e6;var hc=J_.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=it,$n=hc;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 t6=new Set,Cc={};function Rl(e,t){Vs(e,t),Vs(e+"Capture",t)}function Vs(e,t){for(Cc[e]=t,e=0;e<t.length;e++)t6.add(t[e])}var Da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_v=Object.prototype.hasOwnProperty,jE=/^[: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]*$/,y3={},b3={};function zE(e){return _v.call(b3,e)?!0:_v.call(y3,e)?!1:jE.test(e)?b3[e]=!0:(y3[e]=!0,!1)}function BE(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 UE(e,t,r,n){if(t===null||typeof t>"u"||BE(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 gn(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 Wr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Wr[e]=new gn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Wr[t]=new gn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Wr[e]=new gn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Wr[e]=new gn(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){Wr[e]=new gn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Wr[e]=new gn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Wr[e]=new gn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Wr[e]=new gn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Wr[e]=new gn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Um=/[\-:]([a-z])/g;function Hm(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(Um,Hm);Wr[t]=new gn(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(Um,Hm);Wr[t]=new gn(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(Um,Hm);Wr[t]=new gn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Wr[e]=new gn(e,1,!1,e.toLowerCase(),null,!1,!1)});Wr.xlinkHref=new gn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Wr[e]=new gn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gm(e,t,r,n){var i=Wr.hasOwnProperty(t)?Wr[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(UE(t,r,i,n)&&(r=null),n||i===null?zE(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 Ha=FE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vd=Symbol.for("react.element"),Es=Symbol.for("react.portal"),Os=Symbol.for("react.fragment"),$m=Symbol.for("react.strict_mode"),wv=Symbol.for("react.profiler"),r6=Symbol.for("react.provider"),n6=Symbol.for("react.context"),Vm=Symbol.for("react.forward_ref"),Sv=Symbol.for("react.suspense"),Ev=Symbol.for("react.suspense_list"),qm=Symbol.for("react.memo"),ho=Symbol.for("react.lazy"),i6=Symbol.for("react.offscreen"),_3=Symbol.iterator;function Xu(e){return e===null||typeof e!="object"?null:(e=_3&&e[_3]||e["@@iterator"],typeof e=="function"?e:null)}var nr=Object.assign,A1;function sc(e){if(A1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);A1=t&&t[1]||""}return`
26
+ `+A1+e}var k1=!1;function R1(e,t){if(!e||k1)return"";k1=!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{k1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?sc(e):""}function HE(e){switch(e.tag){case 5:return sc(e.type);case 16:return sc("Lazy");case 13:return sc("Suspense");case 19:return sc("SuspenseList");case 0:case 2:case 15:return e=R1(e.type,!1),e;case 11:return e=R1(e.type.render,!1),e;case 1:return e=R1(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 Os:return"Fragment";case Es:return"Portal";case wv:return"Profiler";case $m:return"StrictMode";case Sv:return"Suspense";case Ev:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n6:return(e.displayName||"Context")+".Consumer";case r6:return(e._context.displayName||"Context")+".Provider";case Vm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qm:return t=e.displayName||null,t!==null?t:Ov(e.type)||"Memo";case ho: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===$m?"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 Ro(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function a6(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $E(e){var t=a6(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 md(e){e._valueTracker||(e._valueTracker=$E(e))}function o6(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=a6(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function oh(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 Pv(e,t){var r=t.checked;return nr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function w3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ro(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 l6(e,t){t=t.checked,t!=null&&Gm(e,"checked",t,!1)}function xv(e,t){l6(e,t);var r=Ro(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")?Cv(e,t.type,r):t.hasOwnProperty("defaultValue")&&Cv(e,t.type,Ro(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function S3(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 Cv(e,t,r){(t!=="number"||oh(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var uc=Array.isArray;function js(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=""+Ro(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 Tv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ce(91));return nr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function E3(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(uc(r)){if(1<r.length)throw Error(Ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ro(r)}}function s6(e,t){var r=Ro(t.value),n=Ro(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 O3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function u6(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 Av(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?u6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var yd,c6=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(yd=yd||document.createElement("div"),yd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=yd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var pc={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},VE=["Webkit","ms","Moz","O"];Object.keys(pc).forEach(function(e){VE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pc[t]=pc[e]})});function f6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||pc.hasOwnProperty(e)&&pc[e]?(""+t).trim():t+"px"}function d6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=f6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var qE=nr({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 kv(e,t){if(t){if(qE[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 Rv(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 Lv=null;function Wm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mv=null,zs=null,Bs=null;function P3(e){if(e=af(e)){if(typeof Mv!="function")throw Error(Ce(280));var t=e.stateNode;t&&(t=Jh(t),Mv(e.stateNode,e.type,t))}}function h6(e){zs?Bs?Bs.push(e):Bs=[e]:zs=e}function p6(){if(zs){var e=zs,t=Bs;if(Bs=zs=null,P3(e),t)for(e=0;e<t.length;e++)P3(t[e])}}function g6(e,t){return e(t)}function v6(){}var L1=!1;function m6(e,t,r){if(L1)return e(t,r);L1=!0;try{return g6(e,t,r)}finally{L1=!1,(zs!==null||Bs!==null)&&(v6(),p6())}}function Ac(e,t){var r=e.stateNode;if(r===null)return null;var n=Jh(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 Nv=!1;if(Da)try{var Zu={};Object.defineProperty(Zu,"passive",{get:function(){Nv=!0}}),window.addEventListener("test",Zu,Zu),window.removeEventListener("test",Zu,Zu)}catch{Nv=!1}function WE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(v){this.onError(v)}}var gc=!1,lh=null,sh=!1,Iv=null,YE={onError:function(e){gc=!0,lh=e}};function KE(e,t,r,n,i,a,o,l,u){gc=!1,lh=null,WE.apply(YE,arguments)}function XE(e,t,r,n,i,a,o,l,u){if(KE.apply(this,arguments),gc){if(gc){var f=lh;gc=!1,lh=null}else throw Error(Ce(198));sh||(sh=!0,Iv=f)}}function Ll(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 y6(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 x3(e){if(Ll(e)!==e)throw Error(Ce(188))}function ZE(e){var t=e.alternate;if(!t){if(t=Ll(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 x3(i),e;if(a===n)return x3(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 b6(e){return e=ZE(e),e!==null?_6(e):null}function _6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_6(e);if(t!==null)return t;e=e.sibling}return null}var w6=$n.unstable_scheduleCallback,C3=$n.unstable_cancelCallback,QE=$n.unstable_shouldYield,JE=$n.unstable_requestPaint,pr=$n.unstable_now,eO=$n.unstable_getCurrentPriorityLevel,Ym=$n.unstable_ImmediatePriority,S6=$n.unstable_UserBlockingPriority,uh=$n.unstable_NormalPriority,tO=$n.unstable_LowPriority,E6=$n.unstable_IdlePriority,Kh=null,aa=null;function rO(e){if(aa&&typeof aa.onCommitFiberRoot=="function")try{aa.onCommitFiberRoot(Kh,e,void 0,(e.current.flags&128)===128)}catch{}}var Mi=Math.clz32?Math.clz32:aO,nO=Math.log,iO=Math.LN2;function aO(e){return e>>>=0,e===0?32:31-(nO(e)/iO|0)|0}var bd=64,_d=4194304;function cc(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 ch(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=cc(l):(a&=o,a!==0&&(n=cc(a)))}else o=r&~i,o!==0?n=cc(o):a!==0&&(n=cc(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-Mi(t),i=1<<r,n|=e[r],t&=~i;return n}function oO(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 lO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Mi(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=oO(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function Dv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function O6(){var e=bd;return bd<<=1,!(bd&4194240)&&(bd=64),e}function M1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function rf(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mi(t),e[t]=r}function sO(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-Mi(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Km(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Mi(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Lt=0;function P6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var x6,Xm,C6,T6,A6,Fv=!1,wd=[],wo=null,So=null,Eo=null,kc=new Map,Rc=new Map,go=[],uO="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 T3(e,t){switch(e){case"focusin":case"focusout":wo=null;break;case"dragenter":case"dragleave":So=null;break;case"mouseover":case"mouseout":Eo=null;break;case"pointerover":case"pointerout":kc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rc.delete(t.pointerId)}}function Qu(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=af(t),t!==null&&Xm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function cO(e,t,r,n,i){switch(t){case"focusin":return wo=Qu(wo,e,t,r,n,i),!0;case"dragenter":return So=Qu(So,e,t,r,n,i),!0;case"mouseover":return Eo=Qu(Eo,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return kc.set(a,Qu(kc.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Rc.set(a,Qu(Rc.get(a)||null,e,t,r,n,i)),!0}return!1}function k6(e){var t=dl(e.target);if(t!==null){var r=Ll(t);if(r!==null){if(t=r.tag,t===13){if(t=y6(r),t!==null){e.blockedOn=t,A6(e.priority,function(){C6(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 Vd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=jv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Lv=n,r.target.dispatchEvent(n),Lv=null}else return t=af(r),t!==null&&Xm(t),e.blockedOn=r,!1;t.shift()}return!0}function A3(e,t,r){Vd(e)&&r.delete(t)}function fO(){Fv=!1,wo!==null&&Vd(wo)&&(wo=null),So!==null&&Vd(So)&&(So=null),Eo!==null&&Vd(Eo)&&(Eo=null),kc.forEach(A3),Rc.forEach(A3)}function Ju(e,t){e.blockedOn===t&&(e.blockedOn=null,Fv||(Fv=!0,$n.unstable_scheduleCallback($n.unstable_NormalPriority,fO)))}function Lc(e){function t(i){return Ju(i,e)}if(0<wd.length){Ju(wd[0],e);for(var r=1;r<wd.length;r++){var n=wd[r];n.blockedOn===e&&(n.blockedOn=null)}}for(wo!==null&&Ju(wo,e),So!==null&&Ju(So,e),Eo!==null&&Ju(Eo,e),kc.forEach(t),Rc.forEach(t),r=0;r<go.length;r++)n=go[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<go.length&&(r=go[0],r.blockedOn===null);)k6(r),r.blockedOn===null&&go.shift()}var Us=Ha.ReactCurrentBatchConfig,fh=!0;function dO(e,t,r,n){var i=Lt,a=Us.transition;Us.transition=null;try{Lt=1,Zm(e,t,r,n)}finally{Lt=i,Us.transition=a}}function hO(e,t,r,n){var i=Lt,a=Us.transition;Us.transition=null;try{Lt=4,Zm(e,t,r,n)}finally{Lt=i,Us.transition=a}}function Zm(e,t,r,n){if(fh){var i=jv(e,t,r,n);if(i===null)G1(e,t,n,dh,r),T3(e,n);else if(cO(i,e,t,r,n))n.stopPropagation();else if(T3(e,n),t&4&&-1<uO.indexOf(e)){for(;i!==null;){var a=af(i);if(a!==null&&x6(a),a=jv(e,t,r,n),a===null&&G1(e,t,n,dh,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else G1(e,t,n,null,r)}}var dh=null;function jv(e,t,r,n){if(dh=null,e=Wm(n),e=dl(e),e!==null)if(t=Ll(e),t===null)e=null;else if(r=t.tag,r===13){if(e=y6(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 dh=e,null}function R6(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(eO()){case Ym:return 1;case S6:return 4;case uh:case tO:return 16;case E6:return 536870912;default:return 16}default:return 16}}var yo=null,Qm=null,qd=null;function L6(){if(qd)return qd;var e,t=Qm,r=t.length,n,i="value"in yo?yo.value:yo.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 qd=i.slice(e,1<n?1-n:void 0)}function Wd(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 Sd(){return!0}function k3(){return!1}function Wn(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)?Sd:k3,this.isPropagationStopped=k3,this}return nr(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=Sd)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Sd)},persist:function(){},isPersistent:Sd}),t}var gu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jm=Wn(gu),nf=nr({},gu,{view:0,detail:0}),pO=Wn(nf),N1,I1,ec,Xh=nr({},nf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ey,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!==ec&&(ec&&e.type==="mousemove"?(N1=e.screenX-ec.screenX,I1=e.screenY-ec.screenY):I1=N1=0,ec=e),N1)},movementY:function(e){return"movementY"in e?e.movementY:I1}}),R3=Wn(Xh),gO=nr({},Xh,{dataTransfer:0}),vO=Wn(gO),mO=nr({},nf,{relatedTarget:0}),D1=Wn(mO),yO=nr({},gu,{animationName:0,elapsedTime:0,pseudoElement:0}),bO=Wn(yO),_O=nr({},gu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wO=Wn(_O),SO=nr({},gu,{data:0}),L3=Wn(SO),EO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OO={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 xO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=PO[e])?!!t[e]:!1}function ey(){return xO}var CO=nr({},nf,{key:function(e){if(e.key){var t=EO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?OO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ey,charCode:function(e){return e.type==="keypress"?Wd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TO=Wn(CO),AO=nr({},Xh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),M3=Wn(AO),kO=nr({},nf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ey}),RO=Wn(kO),LO=nr({},gu,{propertyName:0,elapsedTime:0,pseudoElement:0}),MO=Wn(LO),NO=nr({},Xh,{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}),IO=Wn(NO),DO=[9,13,27,32],ty=Da&&"CompositionEvent"in window,vc=null;Da&&"documentMode"in document&&(vc=document.documentMode);var FO=Da&&"TextEvent"in window&&!vc,M6=Da&&(!ty||vc&&8<vc&&11>=vc),N3=" ",I3=!1;function N6(e,t){switch(e){case"keyup":return DO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function I6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ps=!1;function jO(e,t){switch(e){case"compositionend":return I6(t);case"keypress":return t.which!==32?null:(I3=!0,N3);case"textInput":return e=t.data,e===N3&&I3?null:e;default:return null}}function zO(e,t){if(Ps)return e==="compositionend"||!ty&&N6(e,t)?(e=L6(),qd=Qm=yo=null,Ps=!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 M6&&t.locale!=="ko"?null:t.data;default:return null}}var BO={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 D3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BO[e.type]:t==="textarea"}function D6(e,t,r,n){h6(n),t=hh(t,"onChange"),0<t.length&&(r=new Jm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var mc=null,Mc=null;function UO(e){W6(e,0)}function Zh(e){var t=Ts(e);if(o6(t))return e}function HO(e,t){if(e==="change")return t}var F6=!1;if(Da){var F1;if(Da){var j1="oninput"in document;if(!j1){var F3=document.createElement("div");F3.setAttribute("oninput","return;"),j1=typeof F3.oninput=="function"}F1=j1}else F1=!1;F6=F1&&(!document.documentMode||9<document.documentMode)}function j3(){mc&&(mc.detachEvent("onpropertychange",j6),Mc=mc=null)}function j6(e){if(e.propertyName==="value"&&Zh(Mc)){var t=[];D6(t,Mc,e,Wm(e)),m6(UO,t)}}function GO(e,t,r){e==="focusin"?(j3(),mc=t,Mc=r,mc.attachEvent("onpropertychange",j6)):e==="focusout"&&j3()}function $O(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zh(Mc)}function VO(e,t){if(e==="click")return Zh(t)}function qO(e,t){if(e==="input"||e==="change")return Zh(t)}function WO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zi=typeof Object.is=="function"?Object.is:WO;function Nc(e,t){if(zi(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(!_v.call(t,i)||!zi(e[i],t[i]))return!1}return!0}function z3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function B3(e,t){var r=z3(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=z3(r)}}function z6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?z6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function B6(){for(var e=window,t=oh();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=oh(e.document)}return t}function ry(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=B6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&z6(r.ownerDocument.documentElement,r)){if(n!==null&&ry(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=B3(r,a);var o=B3(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 KO=Da&&"documentMode"in document&&11>=document.documentMode,xs=null,zv=null,yc=null,Bv=!1;function U3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Bv||xs==null||xs!==oh(n)||(n=xs,"selectionStart"in n&&ry(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}),yc&&Nc(yc,n)||(yc=n,n=hh(zv,"onSelect"),0<n.length&&(t=new Jm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=xs)))}function Ed(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Cs={animationend:Ed("Animation","AnimationEnd"),animationiteration:Ed("Animation","AnimationIteration"),animationstart:Ed("Animation","AnimationStart"),transitionend:Ed("Transition","TransitionEnd")},z1={},U6={};Da&&(U6=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Qh(e){if(z1[e])return z1[e];if(!Cs[e])return e;var t=Cs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in U6)return z1[e]=t[r];return e}var H6=Qh("animationend"),G6=Qh("animationiteration"),$6=Qh("animationstart"),V6=Qh("transitionend"),q6=new Map,H3="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 Fo(e,t){q6.set(e,t),Rl(t,[e])}for(var B1=0;B1<H3.length;B1++){var U1=H3[B1],XO=U1.toLowerCase(),ZO=U1[0].toUpperCase()+U1.slice(1);Fo(XO,"on"+ZO)}Fo(H6,"onAnimationEnd");Fo(G6,"onAnimationIteration");Fo($6,"onAnimationStart");Fo("dblclick","onDoubleClick");Fo("focusin","onFocus");Fo("focusout","onBlur");Fo(V6,"onTransitionEnd");Vs("onMouseEnter",["mouseout","mouseover"]);Vs("onMouseLeave",["mouseout","mouseover"]);Vs("onPointerEnter",["pointerout","pointerover"]);Vs("onPointerLeave",["pointerout","pointerover"]);Rl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Rl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Rl("onBeforeInput",["compositionend","keypress","textInput","paste"]);Rl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Rl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Rl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fc="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(" "),QO=new Set("cancel close invalid load scroll toggle".split(" ").concat(fc));function G3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,XE(n,t,void 0,e),e.currentTarget=null}function W6(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;G3(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;G3(i,l,f),a=u}}}if(sh)throw e=Iv,sh=!1,Iv=null,e}function qt(e,t){var r=t[Vv];r===void 0&&(r=t[Vv]=new Set);var n=e+"__bubble";r.has(n)||(Y6(t,e,2,!1),r.add(n))}function H1(e,t,r){var n=0;t&&(n|=4),Y6(r,e,n,t)}var Od="_reactListening"+Math.random().toString(36).slice(2);function Ic(e){if(!e[Od]){e[Od]=!0,t6.forEach(function(r){r!=="selectionchange"&&(QO.has(r)||H1(r,!1,e),H1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Od]||(t[Od]=!0,H1("selectionchange",!1,t))}}function Y6(e,t,r,n){switch(R6(t)){case 1:var i=dO;break;case 4:i=hO;break;default:i=Zm}r=i.bind(null,t,r,e),i=void 0,!Nv||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 G1(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=dl(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}m6(function(){var f=a,v=Wm(r),S=[];e:{var _=q6.get(e);if(_!==void 0){var p=Jm,E=e;switch(e){case"keypress":if(Wd(r)===0)break e;case"keydown":case"keyup":p=TO;break;case"focusin":E="focus",p=D1;break;case"focusout":E="blur",p=D1;break;case"beforeblur":case"afterblur":p=D1;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=R3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=vO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=RO;break;case H6:case G6:case $6:p=bO;break;case V6:p=MO;break;case"scroll":p=pO;break;case"wheel":p=IO;break;case"copy":case"cut":case"paste":p=wO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=M3}var b=(t&4)!==0,m=!b&&e==="scroll",g=b?_!==null?_+"Capture":null:_;b=[];for(var h=f,d;h!==null;){d=h;var y=d.stateNode;if(d.tag===5&&y!==null&&(d=y,g!==null&&(y=Ac(h,g),y!=null&&b.push(Dc(h,y,d)))),m)break;h=h.return}0<b.length&&(_=new p(_,E,null,r,v),S.push({event:_,listeners:b}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",_&&r!==Lv&&(E=r.relatedTarget||r.fromElement)&&(dl(E)||E[Fa]))break e;if((p||_)&&(_=v.window===v?v:(_=v.ownerDocument)?_.defaultView||_.parentWindow:window,p?(E=r.relatedTarget||r.toElement,p=f,E=E?dl(E):null,E!==null&&(m=Ll(E),E!==m||E.tag!==5&&E.tag!==6)&&(E=null)):(p=null,E=f),p!==E)){if(b=R3,y="onMouseLeave",g="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(b=M3,y="onPointerLeave",g="onPointerEnter",h="pointer"),m=p==null?_:Ts(p),d=E==null?_:Ts(E),_=new b(y,h+"leave",p,r,v),_.target=m,_.relatedTarget=d,y=null,dl(v)===f&&(b=new b(g,h+"enter",E,r,v),b.target=d,b.relatedTarget=m,y=b),m=y,p&&E)t:{for(b=p,g=E,h=0,d=b;d;d=ms(d))h++;for(d=0,y=g;y;y=ms(y))d++;for(;0<h-d;)b=ms(b),h--;for(;0<d-h;)g=ms(g),d--;for(;h--;){if(b===g||g!==null&&b===g.alternate)break t;b=ms(b),g=ms(g)}b=null}else b=null;p!==null&&$3(S,_,p,b,!1),E!==null&&m!==null&&$3(S,m,E,b,!0)}}e:{if(_=f?Ts(f):window,p=_.nodeName&&_.nodeName.toLowerCase(),p==="select"||p==="input"&&_.type==="file")var O=HO;else if(D3(_))if(F6)O=qO;else{O=$O;var k=GO}else(p=_.nodeName)&&p.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(O=VO);if(O&&(O=O(e,f))){D6(S,O,r,v);break e}k&&k(e,_,f),e==="focusout"&&(k=_._wrapperState)&&k.controlled&&_.type==="number"&&Cv(_,"number",_.value)}switch(k=f?Ts(f):window,e){case"focusin":(D3(k)||k.contentEditable==="true")&&(xs=k,zv=f,yc=null);break;case"focusout":yc=zv=xs=null;break;case"mousedown":Bv=!0;break;case"contextmenu":case"mouseup":case"dragend":Bv=!1,U3(S,r,v);break;case"selectionchange":if(KO)break;case"keydown":case"keyup":U3(S,r,v)}var C;if(ty)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Ps?N6(e,r)&&(w="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(w="onCompositionStart");w&&(M6&&r.locale!=="ko"&&(Ps||w!=="onCompositionStart"?w==="onCompositionEnd"&&Ps&&(C=L6()):(yo=v,Qm="value"in yo?yo.value:yo.textContent,Ps=!0)),k=hh(f,w),0<k.length&&(w=new L3(w,e,null,r,v),S.push({event:w,listeners:k}),C?w.data=C:(C=I6(r),C!==null&&(w.data=C)))),(C=FO?jO(e,r):zO(e,r))&&(f=hh(f,"onBeforeInput"),0<f.length&&(v=new L3("onBeforeInput","beforeinput",null,r,v),S.push({event:v,listeners:f}),v.data=C))}W6(S,t)})}function Dc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hh(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ac(e,r),a!=null&&n.unshift(Dc(e,a,i)),a=Ac(e,t),a!=null&&n.push(Dc(e,a,i))),e=e.return}return n}function ms(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $3(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=Ac(r,a),u!=null&&o.unshift(Dc(r,u,l))):i||(u=Ac(r,a),u!=null&&o.push(Dc(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var JO=/\r\n?/g,eP=/\u0000|\uFFFD/g;function V3(e){return(typeof e=="string"?e:""+e).replace(JO,`
30
+ `).replace(eP,"")}function Pd(e,t,r){if(t=V3(t),V3(e)!==t&&r)throw Error(Ce(425))}function ph(){}var Uv=null,Hv=null;function Gv(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 $v=typeof setTimeout=="function"?setTimeout:void 0,tP=typeof clearTimeout=="function"?clearTimeout:void 0,q3=typeof Promise=="function"?Promise:void 0,rP=typeof queueMicrotask=="function"?queueMicrotask:typeof q3<"u"?function(e){return q3.resolve(null).then(e).catch(nP)}:$v;function nP(e){setTimeout(function(){throw e})}function $1(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),Lc(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Lc(t)}function Oo(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 W3(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 vu=Math.random().toString(36).slice(2),ta="__reactFiber$"+vu,Fc="__reactProps$"+vu,Fa="__reactContainer$"+vu,Vv="__reactEvents$"+vu,iP="__reactListeners$"+vu,aP="__reactHandles$"+vu;function dl(e){var t=e[ta];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Fa]||r[ta]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=W3(e);e!==null;){if(r=e[ta])return r;e=W3(e)}return t}e=r,r=e.parentNode}return null}function af(e){return e=e[ta]||e[Fa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ts(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ce(33))}function Jh(e){return e[Fc]||null}var qv=[],As=-1;function jo(e){return{current:e}}function Wt(e){0>As||(e.current=qv[As],qv[As]=null,As--)}function Ut(e,t){As++,qv[As]=e.current,e.current=t}var Lo={},nn=jo(Lo),Cn=jo(!1),_l=Lo;function qs(e,t){var r=e.type.contextTypes;if(!r)return Lo;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 Tn(e){return e=e.childContextTypes,e!=null}function gh(){Wt(Cn),Wt(nn)}function Y3(e,t,r){if(nn.current!==Lo)throw Error(Ce(168));Ut(nn,t),Ut(Cn,r)}function K6(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 nr({},r,n)}function vh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lo,_l=nn.current,Ut(nn,e),Ut(Cn,Cn.current),!0}function K3(e,t,r){var n=e.stateNode;if(!n)throw Error(Ce(169));r?(e=K6(e,t,_l),n.__reactInternalMemoizedMergedChildContext=e,Wt(Cn),Wt(nn),Ut(nn,e)):Wt(Cn),Ut(Cn,r)}var Ta=null,ep=!1,V1=!1;function X6(e){Ta===null?Ta=[e]:Ta.push(e)}function oP(e){ep=!0,X6(e)}function zo(){if(!V1&&Ta!==null){V1=!0;var e=0,t=Lt;try{var r=Ta;for(Lt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ta=null,ep=!1}catch(i){throw Ta!==null&&(Ta=Ta.slice(e+1)),w6(Ym,zo),i}finally{Lt=t,V1=!1}}return null}var ks=[],Rs=0,mh=null,yh=0,li=[],si=0,wl=null,Aa=1,ka="";function cl(e,t){ks[Rs++]=yh,ks[Rs++]=mh,mh=e,yh=t}function Z6(e,t,r){li[si++]=Aa,li[si++]=ka,li[si++]=wl,wl=e;var n=Aa;e=ka;var i=32-Mi(n)-1;n&=~(1<<i),r+=1;var a=32-Mi(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Aa=1<<32-Mi(t)+i|r<<i|n,ka=a+e}else Aa=1<<a|r<<i|n,ka=e}function ny(e){e.return!==null&&(cl(e,1),Z6(e,1,0))}function iy(e){for(;e===mh;)mh=ks[--Rs],ks[Rs]=null,yh=ks[--Rs],ks[Rs]=null;for(;e===wl;)wl=li[--si],li[si]=null,ka=li[--si],li[si]=null,Aa=li[--si],li[si]=null}var Gn=null,Hn=null,Zt=!1,Li=null;function Q6(e,t){var r=fi(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 X3(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,Gn=e,Hn=Oo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gn=e,Hn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=wl!==null?{id:Aa,overflow:ka}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=fi(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Gn=e,Hn=null,!0):!1;default:return!1}}function Wv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yv(e){if(Zt){var t=Hn;if(t){var r=t;if(!X3(e,t)){if(Wv(e))throw Error(Ce(418));t=Oo(r.nextSibling);var n=Gn;t&&X3(e,t)?Q6(n,r):(e.flags=e.flags&-4097|2,Zt=!1,Gn=e)}}else{if(Wv(e))throw Error(Ce(418));e.flags=e.flags&-4097|2,Zt=!1,Gn=e}}}function Z3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gn=e}function xd(e){if(e!==Gn)return!1;if(!Zt)return Z3(e),Zt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gv(e.type,e.memoizedProps)),t&&(t=Hn)){if(Wv(e))throw J6(),Error(Ce(418));for(;t;)Q6(e,t),t=Oo(t.nextSibling)}if(Z3(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){Hn=Oo(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Hn=null}}else Hn=Gn?Oo(e.stateNode.nextSibling):null;return!0}function J6(){for(var e=Hn;e;)e=Oo(e.nextSibling)}function Ws(){Hn=Gn=null,Zt=!1}function ay(e){Li===null?Li=[e]:Li.push(e)}var lP=Ha.ReactCurrentBatchConfig;function tc(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 Cd(e,t){throw e=Object.prototype.toString.call(t),Error(Ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Q3(e){var t=e._init;return t(e._payload)}function ew(e){function t(g,h){if(e){var d=g.deletions;d===null?(g.deletions=[h],g.flags|=16):d.push(h)}}function r(g,h){if(!e)return null;for(;h!==null;)t(g,h),h=h.sibling;return null}function n(g,h){for(g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function i(g,h){return g=To(g,h),g.index=0,g.sibling=null,g}function a(g,h,d){return g.index=d,e?(d=g.alternate,d!==null?(d=d.index,d<h?(g.flags|=2,h):d):(g.flags|=2,h)):(g.flags|=1048576,h)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,h,d,y){return h===null||h.tag!==6?(h=Q1(d,g.mode,y),h.return=g,h):(h=i(h,d),h.return=g,h)}function u(g,h,d,y){var O=d.type;return O===Os?v(g,h,d.props.children,y,d.key):h!==null&&(h.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ho&&Q3(O)===h.type)?(y=i(h,d.props),y.ref=tc(g,h,d),y.return=g,y):(y=eh(d.type,d.key,d.props,null,g.mode,y),y.ref=tc(g,h,d),y.return=g,y)}function f(g,h,d,y){return h===null||h.tag!==4||h.stateNode.containerInfo!==d.containerInfo||h.stateNode.implementation!==d.implementation?(h=J1(d,g.mode,y),h.return=g,h):(h=i(h,d.children||[]),h.return=g,h)}function v(g,h,d,y,O){return h===null||h.tag!==7?(h=ml(d,g.mode,y,O),h.return=g,h):(h=i(h,d),h.return=g,h)}function S(g,h,d){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Q1(""+h,g.mode,d),h.return=g,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case vd:return d=eh(h.type,h.key,h.props,null,g.mode,d),d.ref=tc(g,null,h),d.return=g,d;case Es:return h=J1(h,g.mode,d),h.return=g,h;case ho:var y=h._init;return S(g,y(h._payload),d)}if(uc(h)||Xu(h))return h=ml(h,g.mode,d,null),h.return=g,h;Cd(g,h)}return null}function _(g,h,d,y){var O=h!==null?h.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return O!==null?null:l(g,h,""+d,y);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case vd:return d.key===O?u(g,h,d,y):null;case Es:return d.key===O?f(g,h,d,y):null;case ho:return O=d._init,_(g,h,O(d._payload),y)}if(uc(d)||Xu(d))return O!==null?null:v(g,h,d,y,null);Cd(g,d)}return null}function p(g,h,d,y,O){if(typeof y=="string"&&y!==""||typeof y=="number")return g=g.get(d)||null,l(h,g,""+y,O);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case vd:return g=g.get(y.key===null?d:y.key)||null,u(h,g,y,O);case Es:return g=g.get(y.key===null?d:y.key)||null,f(h,g,y,O);case ho:var k=y._init;return p(g,h,d,k(y._payload),O)}if(uc(y)||Xu(y))return g=g.get(d)||null,v(h,g,y,O,null);Cd(h,y)}return null}function E(g,h,d,y){for(var O=null,k=null,C=h,w=h=0,P=null;C!==null&&w<d.length;w++){C.index>w?(P=C,C=null):P=C.sibling;var x=_(g,C,d[w],y);if(x===null){C===null&&(C=P);break}e&&C&&x.alternate===null&&t(g,C),h=a(x,h,w),k===null?O=x:k.sibling=x,k=x,C=P}if(w===d.length)return r(g,C),Zt&&cl(g,w),O;if(C===null){for(;w<d.length;w++)C=S(g,d[w],y),C!==null&&(h=a(C,h,w),k===null?O=C:k.sibling=C,k=C);return Zt&&cl(g,w),O}for(C=n(g,C);w<d.length;w++)P=p(C,g,w,d[w],y),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?w:P.key),h=a(P,h,w),k===null?O=P:k.sibling=P,k=P);return e&&C.forEach(function(A){return t(g,A)}),Zt&&cl(g,w),O}function b(g,h,d,y){var O=Xu(d);if(typeof O!="function")throw Error(Ce(150));if(d=O.call(d),d==null)throw Error(Ce(151));for(var k=O=null,C=h,w=h=0,P=null,x=d.next();C!==null&&!x.done;w++,x=d.next()){C.index>w?(P=C,C=null):P=C.sibling;var A=_(g,C,x.value,y);if(A===null){C===null&&(C=P);break}e&&C&&A.alternate===null&&t(g,C),h=a(A,h,w),k===null?O=A:k.sibling=A,k=A,C=P}if(x.done)return r(g,C),Zt&&cl(g,w),O;if(C===null){for(;!x.done;w++,x=d.next())x=S(g,x.value,y),x!==null&&(h=a(x,h,w),k===null?O=x:k.sibling=x,k=x);return Zt&&cl(g,w),O}for(C=n(g,C);!x.done;w++,x=d.next())x=p(C,g,w,x.value,y),x!==null&&(e&&x.alternate!==null&&C.delete(x.key===null?w:x.key),h=a(x,h,w),k===null?O=x:k.sibling=x,k=x);return e&&C.forEach(function(R){return t(g,R)}),Zt&&cl(g,w),O}function m(g,h,d,y){if(typeof d=="object"&&d!==null&&d.type===Os&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case vd:e:{for(var O=d.key,k=h;k!==null;){if(k.key===O){if(O=d.type,O===Os){if(k.tag===7){r(g,k.sibling),h=i(k,d.props.children),h.return=g,g=h;break e}}else if(k.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ho&&Q3(O)===k.type){r(g,k.sibling),h=i(k,d.props),h.ref=tc(g,k,d),h.return=g,g=h;break e}r(g,k);break}else t(g,k);k=k.sibling}d.type===Os?(h=ml(d.props.children,g.mode,y,d.key),h.return=g,g=h):(y=eh(d.type,d.key,d.props,null,g.mode,y),y.ref=tc(g,h,d),y.return=g,g=y)}return o(g);case Es:e:{for(k=d.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===d.containerInfo&&h.stateNode.implementation===d.implementation){r(g,h.sibling),h=i(h,d.children||[]),h.return=g,g=h;break e}else{r(g,h);break}else t(g,h);h=h.sibling}h=J1(d,g.mode,y),h.return=g,g=h}return o(g);case ho:return k=d._init,m(g,h,k(d._payload),y)}if(uc(d))return E(g,h,d,y);if(Xu(d))return b(g,h,d,y);Cd(g,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,h!==null&&h.tag===6?(r(g,h.sibling),h=i(h,d),h.return=g,g=h):(r(g,h),h=Q1(d,g.mode,y),h.return=g,g=h),o(g)):r(g,h)}return m}var Ys=ew(!0),tw=ew(!1),bh=jo(null),_h=null,Ls=null,oy=null;function ly(){oy=Ls=_h=null}function sy(e){var t=bh.current;Wt(bh),e._currentValue=t}function Kv(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 Hs(e,t){_h=e,oy=Ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(On=!0),e.firstContext=null)}function pi(e){var t=e._currentValue;if(oy!==e)if(e={context:e,memoizedValue:t,next:null},Ls===null){if(_h===null)throw Error(Ce(308));Ls=e,_h.dependencies={lanes:0,firstContext:e}}else Ls=Ls.next=e;return t}var hl=null;function uy(e){hl===null?hl=[e]:hl.push(e)}function rw(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,uy(t)):(r.next=i.next,i.next=r),t.interleaved=r,ja(e,n)}function ja(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 po=!1;function cy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nw(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 Ra(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Po(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ot&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ja(e,r)}return i=n.interleaved,i===null?(t.next=t,uy(n)):(t.next=i.next,i.next=t),n.interleaved=t,ja(e,r)}function Yd(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,Km(e,r)}}function J3(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 wh(e,t,r,n){var i=e.updateQueue;po=!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 v=e.alternate;v!==null&&(v=v.updateQueue,l=v.lastBaseUpdate,l!==o&&(l===null?v.firstBaseUpdate=f:l.next=f,v.lastBaseUpdate=u))}if(a!==null){var S=i.baseState;o=0,v=f=u=null,l=a;do{var _=l.lane,p=l.eventTime;if((n&_)===_){v!==null&&(v=v.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var E=e,b=l;switch(_=t,p=r,b.tag){case 1:if(E=b.payload,typeof E=="function"){S=E.call(p,S,_);break e}S=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=b.payload,_=typeof E=="function"?E.call(p,S,_):E,_==null)break e;S=nr({},S,_);break e;case 2:po=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,_=i.effects,_===null?i.effects=[l]:_.push(l))}else p={eventTime:p,lane:_,tag:l.tag,payload:l.payload,callback:l.callback,next:null},v===null?(f=v=p,u=S):v=v.next=p,o|=_;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;_=l,l=_.next,_.next=null,i.lastBaseUpdate=_,i.shared.pending=null}}while(!0);if(v===null&&(u=S),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=v,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);El|=o,e.lanes=o,e.memoizedState=S}}function e5(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 of={},oa=jo(of),jc=jo(of),zc=jo(of);function pl(e){if(e===of)throw Error(Ce(174));return e}function fy(e,t){switch(Ut(zc,t),Ut(jc,e),Ut(oa,of),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Av(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Av(t,e)}Wt(oa),Ut(oa,t)}function Ks(){Wt(oa),Wt(jc),Wt(zc)}function iw(e){pl(zc.current);var t=pl(oa.current),r=Av(t,e.type);t!==r&&(Ut(jc,e),Ut(oa,r))}function dy(e){jc.current===e&&(Wt(oa),Wt(jc))}var tr=jo(0);function Sh(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 q1=[];function hy(){for(var e=0;e<q1.length;e++)q1[e]._workInProgressVersionPrimary=null;q1.length=0}var Kd=Ha.ReactCurrentDispatcher,W1=Ha.ReactCurrentBatchConfig,Sl=0,rr=null,Pr=null,Fr=null,Eh=!1,bc=!1,Bc=0,sP=0;function en(){throw Error(Ce(321))}function py(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!zi(e[r],t[r]))return!1;return!0}function gy(e,t,r,n,i,a){if(Sl=a,rr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Kd.current=e===null||e.memoizedState===null?dP:hP,e=r(n,i),bc){a=0;do{if(bc=!1,Bc=0,25<=a)throw Error(Ce(301));a+=1,Fr=Pr=null,t.updateQueue=null,Kd.current=pP,e=r(n,i)}while(bc)}if(Kd.current=Oh,t=Pr!==null&&Pr.next!==null,Sl=0,Fr=Pr=rr=null,Eh=!1,t)throw Error(Ce(300));return e}function vy(){var e=Bc!==0;return Bc=0,e}function ea(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fr===null?rr.memoizedState=Fr=e:Fr=Fr.next=e,Fr}function gi(){if(Pr===null){var e=rr.alternate;e=e!==null?e.memoizedState:null}else e=Pr.next;var t=Fr===null?rr.memoizedState:Fr.next;if(t!==null)Fr=t,Pr=e;else{if(e===null)throw Error(Ce(310));Pr=e,e={memoizedState:Pr.memoizedState,baseState:Pr.baseState,baseQueue:Pr.baseQueue,queue:Pr.queue,next:null},Fr===null?rr.memoizedState=Fr=e:Fr=Fr.next=e}return Fr}function Uc(e,t){return typeof t=="function"?t(e):t}function Y1(e){var t=gi(),r=t.queue;if(r===null)throw Error(Ce(311));r.lastRenderedReducer=e;var n=Pr,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 v=f.lane;if((Sl&v)===v)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 S={lane:v,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=S,o=n):u=u.next=S,rr.lanes|=v,El|=v}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,zi(n,t.memoizedState)||(On=!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,rr.lanes|=a,El|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function K1(e){var t=gi(),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);zi(a,t.memoizedState)||(On=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function aw(){}function ow(e,t){var r=rr,n=gi(),i=t(),a=!zi(n.memoizedState,i);if(a&&(n.memoizedState=i,On=!0),n=n.queue,my(uw.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Fr!==null&&Fr.memoizedState.tag&1){if(r.flags|=2048,Hc(9,sw.bind(null,r,n,i,t),void 0,null),jr===null)throw Error(Ce(349));Sl&30||lw(r,t,i)}return i}function lw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=rr.updateQueue,t===null?(t={lastEffect:null,stores:null},rr.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function sw(e,t,r,n){t.value=r,t.getSnapshot=n,cw(t)&&fw(e)}function uw(e,t,r){return r(function(){cw(t)&&fw(e)})}function cw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!zi(e,r)}catch{return!0}}function fw(e){var t=ja(e,1);t!==null&&Ni(t,e,1,-1)}function t5(e){var t=ea();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Uc,lastRenderedState:e},t.queue=e,e=e.dispatch=fP.bind(null,rr,e),[t.memoizedState,e]}function Hc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=rr.updateQueue,t===null?(t={lastEffect:null,stores:null},rr.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 dw(){return gi().memoizedState}function Xd(e,t,r,n){var i=ea();rr.flags|=e,i.memoizedState=Hc(1|t,r,void 0,n===void 0?null:n)}function tp(e,t,r,n){var i=gi();n=n===void 0?null:n;var a=void 0;if(Pr!==null){var o=Pr.memoizedState;if(a=o.destroy,n!==null&&py(n,o.deps)){i.memoizedState=Hc(t,r,a,n);return}}rr.flags|=e,i.memoizedState=Hc(1|t,r,a,n)}function r5(e,t){return Xd(8390656,8,e,t)}function my(e,t){return tp(2048,8,e,t)}function hw(e,t){return tp(4,2,e,t)}function pw(e,t){return tp(4,4,e,t)}function gw(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 vw(e,t,r){return r=r!=null?r.concat([e]):null,tp(4,4,gw.bind(null,t,e),r)}function yy(){}function mw(e,t){var r=gi();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&py(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function yw(e,t){var r=gi();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&py(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function bw(e,t,r){return Sl&21?(zi(r,t)||(r=O6(),rr.lanes|=r,El|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,On=!0),e.memoizedState=r)}function uP(e,t){var r=Lt;Lt=r!==0&&4>r?r:4,e(!0);var n=W1.transition;W1.transition={};try{e(!1),t()}finally{Lt=r,W1.transition=n}}function _w(){return gi().memoizedState}function cP(e,t,r){var n=Co(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ww(e))Sw(t,r);else if(r=rw(e,t,r,n),r!==null){var i=dn();Ni(r,e,n,i),Ew(r,t,n)}}function fP(e,t,r){var n=Co(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ww(e))Sw(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,zi(l,o)){var u=t.interleaved;u===null?(i.next=i,uy(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=rw(e,t,i,n),r!==null&&(i=dn(),Ni(r,e,n,i),Ew(r,t,n))}}function ww(e){var t=e.alternate;return e===rr||t!==null&&t===rr}function Sw(e,t){bc=Eh=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ew(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Km(e,r)}}var Oh={readContext:pi,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useInsertionEffect:en,useLayoutEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useMutableSource:en,useSyncExternalStore:en,useId:en,unstable_isNewReconciler:!1},dP={readContext:pi,useCallback:function(e,t){return ea().memoizedState=[e,t===void 0?null:t],e},useContext:pi,useEffect:r5,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xd(4194308,4,gw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xd(4,2,e,t)},useMemo:function(e,t){var r=ea();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ea();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=cP.bind(null,rr,e),[n.memoizedState,e]},useRef:function(e){var t=ea();return e={current:e},t.memoizedState=e},useState:t5,useDebugValue:yy,useDeferredValue:function(e){return ea().memoizedState=e},useTransition:function(){var e=t5(!1),t=e[0];return e=uP.bind(null,e[1]),ea().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=rr,i=ea();if(Zt){if(r===void 0)throw Error(Ce(407));r=r()}else{if(r=t(),jr===null)throw Error(Ce(349));Sl&30||lw(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,r5(uw.bind(null,n,a,e),[e]),n.flags|=2048,Hc(9,sw.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ea(),t=jr.identifierPrefix;if(Zt){var r=ka,n=Aa;r=(n&~(1<<32-Mi(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Bc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=sP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hP={readContext:pi,useCallback:mw,useContext:pi,useEffect:my,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:pw,useMemo:yw,useReducer:Y1,useRef:dw,useState:function(){return Y1(Uc)},useDebugValue:yy,useDeferredValue:function(e){var t=gi();return bw(t,Pr.memoizedState,e)},useTransition:function(){var e=Y1(Uc)[0],t=gi().memoizedState;return[e,t]},useMutableSource:aw,useSyncExternalStore:ow,useId:_w,unstable_isNewReconciler:!1},pP={readContext:pi,useCallback:mw,useContext:pi,useEffect:my,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:pw,useMemo:yw,useReducer:K1,useRef:dw,useState:function(){return K1(Uc)},useDebugValue:yy,useDeferredValue:function(e){var t=gi();return Pr===null?t.memoizedState=e:bw(t,Pr.memoizedState,e)},useTransition:function(){var e=K1(Uc)[0],t=gi().memoizedState;return[e,t]},useMutableSource:aw,useSyncExternalStore:ow,useId:_w,unstable_isNewReconciler:!1};function ki(e,t){if(e&&e.defaultProps){t=nr({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Xv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:nr({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var rp={isMounted:function(e){return(e=e._reactInternals)?Ll(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=dn(),i=Co(e),a=Ra(n,i);a.payload=t,r!=null&&(a.callback=r),t=Po(e,a,i),t!==null&&(Ni(t,e,i,n),Yd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=dn(),i=Co(e),a=Ra(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Po(e,a,i),t!==null&&(Ni(t,e,i,n),Yd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=dn(),n=Co(e),i=Ra(r,n);i.tag=2,t!=null&&(i.callback=t),t=Po(e,i,n),t!==null&&(Ni(t,e,n,r),Yd(t,e,n))}};function n5(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?!Nc(r,n)||!Nc(i,a):!0}function Ow(e,t,r){var n=!1,i=Lo,a=t.contextType;return typeof a=="object"&&a!==null?a=pi(a):(i=Tn(t)?_l:nn.current,n=t.contextTypes,a=(n=n!=null)?qs(e,i):Lo),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rp,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function i5(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&&rp.enqueueReplaceState(t,t.state,null)}function Zv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},cy(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=pi(a):(a=Tn(t)?_l:nn.current,i.context=qs(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Xv(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&&rp.enqueueReplaceState(i,i.state,null),wh(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Xs(e,t){try{var r="",n=t;do r+=HE(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 X1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Qv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var gP=typeof WeakMap=="function"?WeakMap:Map;function Pw(e,t,r){r=Ra(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){xh||(xh=!0,sm=n),Qv(e,t)},r}function xw(e,t,r){r=Ra(-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(){Qv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Qv(e,t),typeof n!="function"&&(xo===null?xo=new Set([this]):xo.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function a5(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new gP;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=AP.bind(null,e,t,r),t.then(e,e))}function o5(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 l5(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=Ra(-1,1),t.tag=2,Po(r,t,1))),r.lanes|=1),e)}var vP=Ha.ReactCurrentOwner,On=!1;function fn(e,t,r,n){t.child=e===null?tw(t,null,r,n):Ys(t,e.child,r,n)}function s5(e,t,r,n,i){r=r.render;var a=t.ref;return Hs(t,i),n=gy(e,t,r,n,a,i),r=vy(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,za(e,t,i)):(Zt&&r&&ny(t),t.flags|=1,fn(e,t,n,i),t.child)}function u5(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!xy(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,Cw(e,t,a,n,i)):(e=eh(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:Nc,r(o,n)&&e.ref===t.ref)return za(e,t,i)}return t.flags|=1,e=To(a,n),e.ref=t.ref,e.return=t,t.child=e}function Cw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(Nc(a,n)&&e.ref===t.ref)if(On=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(On=!0);else return t.lanes=e.lanes,za(e,t,i)}return Jv(e,t,r,n,i)}function Tw(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},Ut(Ns,Bn),Bn|=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,Ut(Ns,Bn),Bn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ut(Ns,Bn),Bn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ut(Ns,Bn),Bn|=n;return fn(e,t,i,r),t.child}function Aw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Jv(e,t,r,n,i){var a=Tn(r)?_l:nn.current;return a=qs(t,a),Hs(t,i),r=gy(e,t,r,n,a,i),n=vy(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,za(e,t,i)):(Zt&&n&&ny(t),t.flags|=1,fn(e,t,r,i),t.child)}function c5(e,t,r,n,i){if(Tn(r)){var a=!0;vh(t)}else a=!1;if(Hs(t,i),t.stateNode===null)Zd(e,t),Ow(t,r,n),Zv(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=pi(f):(f=Tn(r)?_l:nn.current,f=qs(t,f));var v=r.getDerivedStateFromProps,S=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function";S||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&i5(t,o,n,f),po=!1;var _=t.memoizedState;o.state=_,wh(t,n,o,i),u=t.memoizedState,l!==n||_!==u||Cn.current||po?(typeof v=="function"&&(Xv(t,r,v,n),u=t.memoizedState),(l=po||n5(t,r,l,n,_,u,f))?(S||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,nw(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:ki(t.type,l),o.props=f,S=t.pendingProps,_=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=pi(u):(u=Tn(r)?_l:nn.current,u=qs(t,u));var p=r.getDerivedStateFromProps;(v=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==S||_!==u)&&i5(t,o,n,u),po=!1,_=t.memoizedState,o.state=_,wh(t,n,o,i);var E=t.memoizedState;l!==S||_!==E||Cn.current||po?(typeof p=="function"&&(Xv(t,r,p,n),E=t.memoizedState),(f=po||n5(t,r,f,n,_,E,u)||!1)?(v||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,E,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,E,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=E),o.props=n,o.state=E,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),n=!1)}return em(e,t,r,n,a,i)}function em(e,t,r,n,i,a){Aw(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&K3(t,r,!1),za(e,t,a);n=t.stateNode,vP.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Ys(t,e.child,null,a),t.child=Ys(t,null,l,a)):fn(e,t,l,a),t.memoizedState=n.state,i&&K3(t,r,!0),t.child}function kw(e){var t=e.stateNode;t.pendingContext?Y3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Y3(e,t.context,!1),fy(e,t.containerInfo)}function f5(e,t,r,n,i){return Ws(),ay(i),t.flags|=256,fn(e,t,r,n),t.child}var tm={dehydrated:null,treeContext:null,retryLane:0};function rm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rw(e,t,r){var n=t.pendingProps,i=tr.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),Ut(tr,i&1),e===null)return Yv(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=ap(o,n,0,null),e=ml(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=rm(r),t.memoizedState=tm,e):by(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return mP(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=To(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=To(l,a):(a=ml(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?rm(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=tm,n}return a=e.child,e=a.sibling,n=To(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 by(e,t){return t=ap({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Td(e,t,r,n){return n!==null&&ay(n),Ys(t,e.child,null,r),e=by(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mP(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=X1(Error(Ce(422))),Td(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=ap({mode:"visible",children:n.children},i,0,null),a=ml(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Ys(t,e.child,null,o),t.child.memoizedState=rm(o),t.memoizedState=tm,a);if(!(t.mode&1))return Td(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=X1(a,n,void 0),Td(e,t,o,n)}if(l=(o&e.childLanes)!==0,On||l){if(n=jr,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,ja(e,i),Ni(n,e,i,-1))}return Py(),n=X1(Error(Ce(421))),Td(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=kP.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Hn=Oo(i.nextSibling),Gn=t,Zt=!0,Li=null,e!==null&&(li[si++]=Aa,li[si++]=ka,li[si++]=wl,Aa=e.id,ka=e.overflow,wl=t),t=by(t,n.children),t.flags|=4096,t)}function d5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Kv(e.return,t,r)}function Z1(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 Lw(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(fn(e,t,n.children,r),n=tr.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&&d5(e,r,t);else if(e.tag===19)d5(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(Ut(tr,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&&Sh(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Z1(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&&Sh(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Z1(t,!0,r,null,a);break;case"together":Z1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function za(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),El|=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=To(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=To(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function yP(e,t,r){switch(t.tag){case 3:kw(t),Ws();break;case 5:iw(t);break;case 1:Tn(t.type)&&vh(t);break;case 4:fy(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ut(bh,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ut(tr,tr.current&1),t.flags|=128,null):r&t.child.childLanes?Rw(e,t,r):(Ut(tr,tr.current&1),e=za(e,t,r),e!==null?e.sibling:null);Ut(tr,tr.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Lw(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ut(tr,tr.current),n)break;return null;case 22:case 23:return t.lanes=0,Tw(e,t,r)}return za(e,t,r)}var Mw,nm,Nw,Iw;Mw=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}};nm=function(){};Nw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,pl(oa.current);var a=null;switch(r){case"input":i=Pv(e,i),n=Pv(e,n),a=[];break;case"select":i=nr({},i,{value:void 0}),n=nr({},n,{value:void 0}),a=[];break;case"textarea":i=Tv(e,i),n=Tv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=ph)}kv(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"&&(Cc.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"&&(Cc.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&qt("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)}};Iw=function(e,t,r,n){r!==n&&(t.flags|=4)};function rc(e,t){if(!Zt)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 tn(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 bP(e,t,r){var n=t.pendingProps;switch(iy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(t),null;case 1:return Tn(t.type)&&gh(),tn(t),null;case 3:return n=t.stateNode,Ks(),Wt(Cn),Wt(nn),hy(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li!==null&&(fm(Li),Li=null))),nm(e,t),tn(t),null;case 5:dy(t);var i=pl(zc.current);if(r=t.type,e!==null&&t.stateNode!=null)Nw(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 tn(t),null}if(e=pl(oa.current),xd(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[ta]=t,n[Fc]=a,e=(t.mode&1)!==0,r){case"dialog":qt("cancel",n),qt("close",n);break;case"iframe":case"object":case"embed":qt("load",n);break;case"video":case"audio":for(i=0;i<fc.length;i++)qt(fc[i],n);break;case"source":qt("error",n);break;case"img":case"image":case"link":qt("error",n),qt("load",n);break;case"details":qt("toggle",n);break;case"input":w3(n,a),qt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},qt("invalid",n);break;case"textarea":E3(n,a),qt("invalid",n)}kv(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&&Pd(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Pd(n.textContent,l,e),i=["children",""+l]):Cc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&qt("scroll",n)}switch(r){case"input":md(n),S3(n,a,!0);break;case"textarea":md(n),O3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=ph)}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=u6(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[ta]=t,e[Fc]=n,Mw(e,t,!1,!1),t.stateNode=e;e:{switch(o=Rv(r,n),r){case"dialog":qt("cancel",e),qt("close",e),i=n;break;case"iframe":case"object":case"embed":qt("load",e),i=n;break;case"video":case"audio":for(i=0;i<fc.length;i++)qt(fc[i],e);i=n;break;case"source":qt("error",e),i=n;break;case"img":case"image":case"link":qt("error",e),qt("load",e),i=n;break;case"details":qt("toggle",e),i=n;break;case"input":w3(e,n),i=Pv(e,n),qt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=nr({},n,{value:void 0}),qt("invalid",e);break;case"textarea":E3(e,n),i=Tv(e,n),qt("invalid",e);break;default:i=n}kv(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?d6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&c6(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Tc(e,u):typeof u=="number"&&Tc(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Cc.hasOwnProperty(a)?u!=null&&a==="onScroll"&&qt("scroll",e):u!=null&&Gm(e,a,u,o))}switch(r){case"input":md(e),S3(e,n,!1);break;case"textarea":md(e),O3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Ro(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?js(e,!!n.multiple,a,!1):n.defaultValue!=null&&js(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ph)}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 tn(t),null;case 6:if(e&&t.stateNode!=null)Iw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Ce(166));if(r=pl(zc.current),pl(oa.current),xd(t)){if(n=t.stateNode,r=t.memoizedProps,n[ta]=t,(a=n.nodeValue!==r)&&(e=Gn,e!==null))switch(e.tag){case 3:Pd(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Pd(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[ta]=t,t.stateNode=n}return tn(t),null;case 13:if(Wt(tr),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Zt&&Hn!==null&&t.mode&1&&!(t.flags&128))J6(),Ws(),t.flags|=98560,a=!1;else if(a=xd(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[ta]=t}else Ws(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tn(t),a=!1}else Li!==null&&(fm(Li),Li=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||tr.current&1?Cr===0&&(Cr=3):Py())),t.updateQueue!==null&&(t.flags|=4),tn(t),null);case 4:return Ks(),nm(e,t),e===null&&Ic(t.stateNode.containerInfo),tn(t),null;case 10:return sy(t.type._context),tn(t),null;case 17:return Tn(t.type)&&gh(),tn(t),null;case 19:if(Wt(tr),a=t.memoizedState,a===null)return tn(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)rc(a,!1);else{if(Cr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Sh(e),o!==null){for(t.flags|=128,rc(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 Ut(tr,tr.current&1|2),t.child}e=e.sibling}a.tail!==null&&pr()>Zs&&(t.flags|=128,n=!0,rc(a,!1),t.lanes=4194304)}else{if(!n)if(e=Sh(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),rc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Zt)return tn(t),null}else 2*pr()-a.renderingStartTime>Zs&&r!==1073741824&&(t.flags|=128,n=!0,rc(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=pr(),t.sibling=null,r=tr.current,Ut(tr,n?r&1|2:r&1),t):(tn(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?Bn&1073741824&&(tn(t),t.subtreeFlags&6&&(t.flags|=8192)):tn(t),null;case 24:return null;case 25:return null}throw Error(Ce(156,t.tag))}function _P(e,t){switch(iy(t),t.tag){case 1:return Tn(t.type)&&gh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ks(),Wt(Cn),Wt(nn),hy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return dy(t),null;case 13:if(Wt(tr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ce(340));Ws()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wt(tr),null;case 4:return Ks(),null;case 10:return sy(t.type._context),null;case 22:case 23:return Oy(),null;case 24:return null;default:return null}}var Ad=!1,rn=!1,wP=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Ms(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){sr(e,t,n)}else r.current=null}function im(e,t,r){try{r()}catch(n){sr(e,t,n)}}var h5=!1;function SP(e,t){if(Uv=fh,e=B6(),ry(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,v=0,S=e,_=null;t:for(;;){for(var p;S!==r||i!==0&&S.nodeType!==3||(l=o+i),S!==a||n!==0&&S.nodeType!==3||(u=o+n),S.nodeType===3&&(o+=S.nodeValue.length),(p=S.firstChild)!==null;)_=S,S=p;for(;;){if(S===e)break t;if(_===r&&++f===i&&(l=o),_===a&&++v===n&&(u=o),(p=S.nextSibling)!==null)break;S=_,_=S.parentNode}S=p}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Hv={focusedElem:e,selectionRange:r},fh=!1,$e=t;$e!==null;)if(t=$e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$e=e;else for(;$e!==null;){t=$e;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var b=E.memoizedProps,m=E.memoizedState,g=t.stateNode,h=g.getSnapshotBeforeUpdate(t.elementType===t.type?b:ki(t.type,b),m);g.__reactInternalSnapshotBeforeUpdate=h}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){sr(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,$e=e;break}$e=t.return}return E=h5,h5=!1,E}function _c(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&&im(t,r,a)}i=i.next}while(i!==n)}}function np(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 am(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 Dw(e){var t=e.alternate;t!==null&&(e.alternate=null,Dw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ta],delete t[Fc],delete t[Vv],delete t[iP],delete t[aP])),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 Fw(e){return e.tag===5||e.tag===3||e.tag===4}function p5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fw(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 om(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=ph));else if(n!==4&&(e=e.child,e!==null))for(om(e,t,r),e=e.sibling;e!==null;)om(e,t,r),e=e.sibling}function lm(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(lm(e,t,r),e=e.sibling;e!==null;)lm(e,t,r),e=e.sibling}var $r=null,Ri=!1;function uo(e,t,r){for(r=r.child;r!==null;)jw(e,t,r),r=r.sibling}function jw(e,t,r){if(aa&&typeof aa.onCommitFiberUnmount=="function")try{aa.onCommitFiberUnmount(Kh,r)}catch{}switch(r.tag){case 5:rn||Ms(r,t);case 6:var n=$r,i=Ri;$r=null,uo(e,t,r),$r=n,Ri=i,$r!==null&&(Ri?(e=$r,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):$r.removeChild(r.stateNode));break;case 18:$r!==null&&(Ri?(e=$r,r=r.stateNode,e.nodeType===8?$1(e.parentNode,r):e.nodeType===1&&$1(e,r),Lc(e)):$1($r,r.stateNode));break;case 4:n=$r,i=Ri,$r=r.stateNode.containerInfo,Ri=!0,uo(e,t,r),$r=n,Ri=i;break;case 0:case 11:case 14:case 15:if(!rn&&(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)&&im(r,t,o),i=i.next}while(i!==n)}uo(e,t,r);break;case 1:if(!rn&&(Ms(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){sr(r,t,l)}uo(e,t,r);break;case 21:uo(e,t,r);break;case 22:r.mode&1?(rn=(n=rn)||r.memoizedState!==null,uo(e,t,r),rn=n):uo(e,t,r);break;default:uo(e,t,r)}}function g5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new wP),t.forEach(function(n){var i=RP.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ci(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:$r=l.stateNode,Ri=!1;break e;case 3:$r=l.stateNode.containerInfo,Ri=!0;break e;case 4:$r=l.stateNode.containerInfo,Ri=!0;break e}l=l.return}if($r===null)throw Error(Ce(160));jw(a,o,i),$r=null,Ri=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){sr(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zw(t,e),t=t.sibling}function zw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ci(t,e),Qi(e),n&4){try{_c(3,e,e.return),np(3,e)}catch(b){sr(e,e.return,b)}try{_c(5,e,e.return)}catch(b){sr(e,e.return,b)}}break;case 1:Ci(t,e),Qi(e),n&512&&r!==null&&Ms(r,r.return);break;case 5:if(Ci(t,e),Qi(e),n&512&&r!==null&&Ms(r,r.return),e.flags&32){var i=e.stateNode;try{Tc(i,"")}catch(b){sr(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&&l6(i,a),Rv(l,o);var f=Rv(l,a);for(o=0;o<u.length;o+=2){var v=u[o],S=u[o+1];v==="style"?d6(i,S):v==="dangerouslySetInnerHTML"?c6(i,S):v==="children"?Tc(i,S):Gm(i,v,S,f)}switch(l){case"input":xv(i,a);break;case"textarea":s6(i,a);break;case"select":var _=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?js(i,!!a.multiple,p,!1):_!==!!a.multiple&&(a.defaultValue!=null?js(i,!!a.multiple,a.defaultValue,!0):js(i,!!a.multiple,a.multiple?[]:"",!1))}i[Fc]=a}catch(b){sr(e,e.return,b)}}break;case 6:if(Ci(t,e),Qi(e),n&4){if(e.stateNode===null)throw Error(Ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(b){sr(e,e.return,b)}}break;case 3:if(Ci(t,e),Qi(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Lc(t.containerInfo)}catch(b){sr(e,e.return,b)}break;case 4:Ci(t,e),Qi(e);break;case 13:Ci(t,e),Qi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Sy=pr())),n&4&&g5(e);break;case 22:if(v=r!==null&&r.memoizedState!==null,e.mode&1?(rn=(f=rn)||v,Ci(t,e),rn=f):Ci(t,e),Qi(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!v&&e.mode&1)for($e=e,v=e.child;v!==null;){for(S=$e=v;$e!==null;){switch(_=$e,p=_.child,_.tag){case 0:case 11:case 14:case 15:_c(4,_,_.return);break;case 1:Ms(_,_.return);var E=_.stateNode;if(typeof E.componentWillUnmount=="function"){n=_,r=_.return;try{t=n,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(b){sr(n,r,b)}}break;case 5:Ms(_,_.return);break;case 22:if(_.memoizedState!==null){m5(S);continue}}p!==null?(p.return=_,$e=p):m5(S)}v=v.sibling}e:for(v=null,S=e;;){if(S.tag===5){if(v===null){v=S;try{i=S.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=S.stateNode,u=S.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=f6("display",o))}catch(b){sr(e,e.return,b)}}}else if(S.tag===6){if(v===null)try{S.stateNode.nodeValue=f?"":S.memoizedProps}catch(b){sr(e,e.return,b)}}else if((S.tag!==22&&S.tag!==23||S.memoizedState===null||S===e)&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===e)break e;for(;S.sibling===null;){if(S.return===null||S.return===e)break e;v===S&&(v=null),S=S.return}v===S&&(v=null),S.sibling.return=S.return,S=S.sibling}}break;case 19:Ci(t,e),Qi(e),n&4&&g5(e);break;case 21:break;default:Ci(t,e),Qi(e)}}function Qi(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Fw(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&&(Tc(i,""),n.flags&=-33);var a=p5(e);lm(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=p5(e);om(e,l,o);break;default:throw Error(Ce(161))}}catch(u){sr(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function EP(e,t,r){$e=e,Bw(e)}function Bw(e,t,r){for(var n=(e.mode&1)!==0;$e!==null;){var i=$e,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||Ad;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||rn;l=Ad;var f=rn;if(Ad=o,(rn=u)&&!f)for($e=i;$e!==null;)o=$e,u=o.child,o.tag===22&&o.memoizedState!==null?y5(i):u!==null?(u.return=o,$e=u):y5(i);for(;a!==null;)$e=a,Bw(a),a=a.sibling;$e=i,Ad=l,rn=f}v5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,$e=a):v5(e)}}function v5(e){for(;$e!==null;){var t=$e;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rn||np(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!rn)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:ki(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&e5(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}e5(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 v=f.memoizedState;if(v!==null){var S=v.dehydrated;S!==null&&Lc(S)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ce(163))}rn||t.flags&512&&am(t)}catch(_){sr(t,t.return,_)}}if(t===e){$e=null;break}if(r=t.sibling,r!==null){r.return=t.return,$e=r;break}$e=t.return}}function m5(e){for(;$e!==null;){var t=$e;if(t===e){$e=null;break}var r=t.sibling;if(r!==null){r.return=t.return,$e=r;break}$e=t.return}}function y5(e){for(;$e!==null;){var t=$e;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{np(4,t)}catch(u){sr(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){sr(t,i,u)}}var a=t.return;try{am(t)}catch(u){sr(t,a,u)}break;case 5:var o=t.return;try{am(t)}catch(u){sr(t,o,u)}}}catch(u){sr(t,t.return,u)}if(t===e){$e=null;break}var l=t.sibling;if(l!==null){l.return=t.return,$e=l;break}$e=t.return}}var OP=Math.ceil,Ph=Ha.ReactCurrentDispatcher,_y=Ha.ReactCurrentOwner,di=Ha.ReactCurrentBatchConfig,Ot=0,jr=null,_r=null,qr=0,Bn=0,Ns=jo(0),Cr=0,Gc=null,El=0,ip=0,wy=0,wc=null,En=null,Sy=0,Zs=1/0,Ca=null,xh=!1,sm=null,xo=null,kd=!1,bo=null,Ch=0,Sc=0,um=null,Qd=-1,Jd=0;function dn(){return Ot&6?pr():Qd!==-1?Qd:Qd=pr()}function Co(e){return e.mode&1?Ot&2&&qr!==0?qr&-qr:lP.transition!==null?(Jd===0&&(Jd=O6()),Jd):(e=Lt,e!==0||(e=window.event,e=e===void 0?16:R6(e.type)),e):1}function Ni(e,t,r,n){if(50<Sc)throw Sc=0,um=null,Error(Ce(185));rf(e,r,n),(!(Ot&2)||e!==jr)&&(e===jr&&(!(Ot&2)&&(ip|=r),Cr===4&&vo(e,qr)),An(e,n),r===1&&Ot===0&&!(t.mode&1)&&(Zs=pr()+500,ep&&zo()))}function An(e,t){var r=e.callbackNode;lO(e,t);var n=ch(e,e===jr?qr:0);if(n===0)r!==null&&C3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&C3(r),t===1)e.tag===0?oP(b5.bind(null,e)):X6(b5.bind(null,e)),rP(function(){!(Ot&6)&&zo()}),r=null;else{switch(P6(n)){case 1:r=Ym;break;case 4:r=S6;break;case 16:r=uh;break;case 536870912:r=E6;break;default:r=uh}r=Yw(r,Uw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Uw(e,t){if(Qd=-1,Jd=0,Ot&6)throw Error(Ce(327));var r=e.callbackNode;if(Gs()&&e.callbackNode!==r)return null;var n=ch(e,e===jr?qr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Th(e,n);else{t=n;var i=Ot;Ot|=2;var a=Gw();(jr!==e||qr!==t)&&(Ca=null,Zs=pr()+500,vl(e,t));do try{CP();break}catch(l){Hw(e,l)}while(!0);ly(),Ph.current=a,Ot=i,_r!==null?t=0:(jr=null,qr=0,t=Cr)}if(t!==0){if(t===2&&(i=Dv(e),i!==0&&(n=i,t=cm(e,i))),t===1)throw r=Gc,vl(e,0),vo(e,n),An(e,pr()),r;if(t===6)vo(e,n);else{if(i=e.current.alternate,!(n&30)&&!PP(i)&&(t=Th(e,n),t===2&&(a=Dv(e),a!==0&&(n=a,t=cm(e,a))),t===1))throw r=Gc,vl(e,0),vo(e,n),An(e,pr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Ce(345));case 2:fl(e,En,Ca);break;case 3:if(vo(e,n),(n&130023424)===n&&(t=Sy+500-pr(),10<t)){if(ch(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){dn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=$v(fl.bind(null,e,En,Ca),t);break}fl(e,En,Ca);break;case 4:if(vo(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-Mi(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=pr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*OP(n/1960))-n,10<n){e.timeoutHandle=$v(fl.bind(null,e,En,Ca),n);break}fl(e,En,Ca);break;case 5:fl(e,En,Ca);break;default:throw Error(Ce(329))}}}return An(e,pr()),e.callbackNode===r?Uw.bind(null,e):null}function cm(e,t){var r=wc;return e.current.memoizedState.isDehydrated&&(vl(e,t).flags|=256),e=Th(e,t),e!==2&&(t=En,En=r,t!==null&&fm(t)),e}function fm(e){En===null?En=e:En.push.apply(En,e)}function PP(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(!zi(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 vo(e,t){for(t&=~wy,t&=~ip,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Mi(t),n=1<<r;e[r]=-1,t&=~n}}function b5(e){if(Ot&6)throw Error(Ce(327));Gs();var t=ch(e,0);if(!(t&1))return An(e,pr()),null;var r=Th(e,t);if(e.tag!==0&&r===2){var n=Dv(e);n!==0&&(t=n,r=cm(e,n))}if(r===1)throw r=Gc,vl(e,0),vo(e,t),An(e,pr()),r;if(r===6)throw Error(Ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fl(e,En,Ca),An(e,pr()),null}function Ey(e,t){var r=Ot;Ot|=1;try{return e(t)}finally{Ot=r,Ot===0&&(Zs=pr()+500,ep&&zo())}}function Ol(e){bo!==null&&bo.tag===0&&!(Ot&6)&&Gs();var t=Ot;Ot|=1;var r=di.transition,n=Lt;try{if(di.transition=null,Lt=1,e)return e()}finally{Lt=n,di.transition=r,Ot=t,!(Ot&6)&&zo()}}function Oy(){Bn=Ns.current,Wt(Ns)}function vl(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,tP(r)),_r!==null)for(r=_r.return;r!==null;){var n=r;switch(iy(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&gh();break;case 3:Ks(),Wt(Cn),Wt(nn),hy();break;case 5:dy(n);break;case 4:Ks();break;case 13:Wt(tr);break;case 19:Wt(tr);break;case 10:sy(n.type._context);break;case 22:case 23:Oy()}r=r.return}if(jr=e,_r=e=To(e.current,null),qr=Bn=t,Cr=0,Gc=null,wy=ip=El=0,En=wc=null,hl!==null){for(t=0;t<hl.length;t++)if(r=hl[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}hl=null}return e}function Hw(e,t){do{var r=_r;try{if(ly(),Kd.current=Oh,Eh){for(var n=rr.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Eh=!1}if(Sl=0,Fr=Pr=rr=null,bc=!1,Bc=0,_y.current=null,r===null||r.return===null){Cr=1,Gc=t,_r=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=qr,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,v=l,S=v.tag;if(!(v.mode&1)&&(S===0||S===11||S===15)){var _=v.alternate;_?(v.updateQueue=_.updateQueue,v.memoizedState=_.memoizedState,v.lanes=_.lanes):(v.updateQueue=null,v.memoizedState=null)}var p=o5(o);if(p!==null){p.flags&=-257,l5(p,o,l,a,t),p.mode&1&&a5(a,f,t),t=p,u=f;var E=t.updateQueue;if(E===null){var b=new Set;b.add(u),t.updateQueue=b}else E.add(u);break e}else{if(!(t&1)){a5(a,f,t),Py();break e}u=Error(Ce(426))}}else if(Zt&&l.mode&1){var m=o5(o);if(m!==null){!(m.flags&65536)&&(m.flags|=256),l5(m,o,l,a,t),ay(Xs(u,l));break e}}a=u=Xs(u,l),Cr!==4&&(Cr=2),wc===null?wc=[a]:wc.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=Pw(a,u,t);J3(a,g);break e;case 1:l=u;var h=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof h.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(xo===null||!xo.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var y=xw(a,l,t);J3(a,y);break e}}a=a.return}while(a!==null)}Vw(r)}catch(O){t=O,_r===r&&r!==null&&(_r=r=r.return);continue}break}while(!0)}function Gw(){var e=Ph.current;return Ph.current=Oh,e===null?Oh:e}function Py(){(Cr===0||Cr===3||Cr===2)&&(Cr=4),jr===null||!(El&268435455)&&!(ip&268435455)||vo(jr,qr)}function Th(e,t){var r=Ot;Ot|=2;var n=Gw();(jr!==e||qr!==t)&&(Ca=null,vl(e,t));do try{xP();break}catch(i){Hw(e,i)}while(!0);if(ly(),Ot=r,Ph.current=n,_r!==null)throw Error(Ce(261));return jr=null,qr=0,Cr}function xP(){for(;_r!==null;)$w(_r)}function CP(){for(;_r!==null&&!QE();)$w(_r)}function $w(e){var t=Ww(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?Vw(e):_r=t,_y.current=null}function Vw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=_P(r,t),r!==null){r.flags&=32767,_r=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Cr=6,_r=null;return}}else if(r=bP(r,t,Bn),r!==null){_r=r;return}if(t=t.sibling,t!==null){_r=t;return}_r=t=e}while(t!==null);Cr===0&&(Cr=5)}function fl(e,t,r){var n=Lt,i=di.transition;try{di.transition=null,Lt=1,TP(e,t,r,n)}finally{di.transition=i,Lt=n}return null}function TP(e,t,r,n){do Gs();while(bo!==null);if(Ot&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(sO(e,a),e===jr&&(_r=jr=null,qr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||kd||(kd=!0,Yw(uh,function(){return Gs(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=di.transition,di.transition=null;var o=Lt;Lt=1;var l=Ot;Ot|=4,_y.current=null,SP(e,r),zw(r,e),YO(Hv),fh=!!Uv,Hv=Uv=null,e.current=r,EP(r),JE(),Ot=l,Lt=o,di.transition=a}else e.current=r;if(kd&&(kd=!1,bo=e,Ch=i),a=e.pendingLanes,a===0&&(xo=null),rO(r.stateNode),An(e,pr()),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(xh)throw xh=!1,e=sm,sm=null,e;return Ch&1&&e.tag!==0&&Gs(),a=e.pendingLanes,a&1?e===um?Sc++:(Sc=0,um=e):Sc=0,zo(),null}function Gs(){if(bo!==null){var e=P6(Ch),t=di.transition,r=Lt;try{if(di.transition=null,Lt=16>e?16:e,bo===null)var n=!1;else{if(e=bo,bo=null,Ch=0,Ot&6)throw Error(Ce(331));var i=Ot;for(Ot|=4,$e=e.current;$e!==null;){var a=$e,o=a.child;if($e.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for($e=f;$e!==null;){var v=$e;switch(v.tag){case 0:case 11:case 15:_c(8,v,a)}var S=v.child;if(S!==null)S.return=v,$e=S;else for(;$e!==null;){v=$e;var _=v.sibling,p=v.return;if(Dw(v),v===f){$e=null;break}if(_!==null){_.return=p,$e=_;break}$e=p}}}var E=a.alternate;if(E!==null){var b=E.child;if(b!==null){E.child=null;do{var m=b.sibling;b.sibling=null,b=m}while(b!==null)}}$e=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,$e=o;else e:for(;$e!==null;){if(a=$e,a.flags&2048)switch(a.tag){case 0:case 11:case 15:_c(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,$e=g;break e}$e=a.return}}var h=e.current;for($e=h;$e!==null;){o=$e;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,$e=d;else e:for(o=h;$e!==null;){if(l=$e,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:np(9,l)}}catch(O){sr(l,l.return,O)}if(l===o){$e=null;break e}var y=l.sibling;if(y!==null){y.return=l.return,$e=y;break e}$e=l.return}}if(Ot=i,zo(),aa&&typeof aa.onPostCommitFiberRoot=="function")try{aa.onPostCommitFiberRoot(Kh,e)}catch{}n=!0}return n}finally{Lt=r,di.transition=t}}return!1}function _5(e,t,r){t=Xs(r,t),t=Pw(e,t,1),e=Po(e,t,1),t=dn(),e!==null&&(rf(e,1,t),An(e,t))}function sr(e,t,r){if(e.tag===3)_5(e,e,r);else for(;t!==null;){if(t.tag===3){_5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(xo===null||!xo.has(n))){e=Xs(r,e),e=xw(t,e,1),t=Po(t,e,1),e=dn(),t!==null&&(rf(t,1,e),An(t,e));break}}t=t.return}}function AP(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=dn(),e.pingedLanes|=e.suspendedLanes&r,jr===e&&(qr&r)===r&&(Cr===4||Cr===3&&(qr&130023424)===qr&&500>pr()-Sy?vl(e,0):wy|=r),An(e,t)}function qw(e,t){t===0&&(e.mode&1?(t=_d,_d<<=1,!(_d&130023424)&&(_d=4194304)):t=1);var r=dn();e=ja(e,t),e!==null&&(rf(e,t,r),An(e,r))}function kP(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),qw(e,r)}function RP(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),qw(e,r)}var Ww;Ww=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Cn.current)On=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return On=!1,yP(e,t,r);On=!!(e.flags&131072)}else On=!1,Zt&&t.flags&1048576&&Z6(t,yh,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Zd(e,t),e=t.pendingProps;var i=qs(t,nn.current);Hs(t,r),i=gy(null,t,n,e,i,r);var a=vy();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,Tn(n)?(a=!0,vh(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cy(t),i.updater=rp,t.stateNode=i,i._reactInternals=t,Zv(t,n,e,r),t=em(null,t,n,!0,a,r)):(t.tag=0,Zt&&a&&ny(t),fn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Zd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=MP(n),e=ki(n,e),i){case 0:t=Jv(null,t,n,e,r);break e;case 1:t=c5(null,t,n,e,r);break e;case 11:t=s5(null,t,n,e,r);break e;case 14:t=u5(null,t,n,ki(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:ki(n,i),Jv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ki(n,i),c5(e,t,n,i,r);case 3:e:{if(kw(t),e===null)throw Error(Ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,nw(e,t),wh(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Xs(Error(Ce(423)),t),t=f5(e,t,n,r,i);break e}else if(n!==i){i=Xs(Error(Ce(424)),t),t=f5(e,t,n,r,i);break e}else for(Hn=Oo(t.stateNode.containerInfo.firstChild),Gn=t,Zt=!0,Li=null,r=tw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ws(),n===i){t=za(e,t,r);break e}fn(e,t,n,r)}t=t.child}return t;case 5:return iw(t),e===null&&Yv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Gv(n,i)?o=null:a!==null&&Gv(n,a)&&(t.flags|=32),Aw(e,t),fn(e,t,o,r),t.child;case 6:return e===null&&Yv(t),null;case 13:return Rw(e,t,r);case 4:return fy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ys(t,null,n,r):fn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ki(n,i),s5(e,t,n,i,r);case 7:return fn(e,t,t.pendingProps,r),t.child;case 8:return fn(e,t,t.pendingProps.children,r),t.child;case 12:return fn(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,Ut(bh,n._currentValue),n._currentValue=o,a!==null)if(zi(a.value,o)){if(a.children===i.children&&!Cn.current){t=za(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=Ra(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var v=f.pending;v===null?u.next=u:(u.next=v.next,v.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Kv(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),Kv(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}fn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Hs(t,r),i=pi(i),n=n(i),t.flags|=1,fn(e,t,n,r),t.child;case 14:return n=t.type,i=ki(n,t.pendingProps),i=ki(n.type,i),u5(e,t,n,i,r);case 15:return Cw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ki(n,i),Zd(e,t),t.tag=1,Tn(n)?(e=!0,vh(t)):e=!1,Hs(t,r),Ow(t,n,i),Zv(t,n,i,r),em(null,t,n,!0,e,r);case 19:return Lw(e,t,r);case 22:return Tw(e,t,r)}throw Error(Ce(156,t.tag))};function Yw(e,t){return w6(e,t)}function LP(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 fi(e,t,r,n){return new LP(e,t,r,n)}function xy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function MP(e){if(typeof e=="function")return xy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Vm)return 11;if(e===qm)return 14}return 2}function To(e,t){var r=e.alternate;return r===null?(r=fi(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 eh(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")xy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Os:return ml(r.children,i,a,t);case $m:o=8,i|=8;break;case wv:return e=fi(12,r,t,i|2),e.elementType=wv,e.lanes=a,e;case Sv:return e=fi(13,r,t,i),e.elementType=Sv,e.lanes=a,e;case Ev:return e=fi(19,r,t,i),e.elementType=Ev,e.lanes=a,e;case i6:return ap(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case r6:o=10;break e;case n6:o=9;break e;case Vm:o=11;break e;case qm:o=14;break e;case ho:o=16,n=null;break e}throw Error(Ce(130,e==null?e:typeof e,""))}return t=fi(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function ml(e,t,r,n){return e=fi(7,e,n,t),e.lanes=r,e}function ap(e,t,r,n){return e=fi(22,e,n,t),e.elementType=i6,e.lanes=r,e.stateNode={isHidden:!1},e}function Q1(e,t,r){return e=fi(6,e,null,t),e.lanes=r,e}function J1(e,t,r){return t=fi(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function NP(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=M1(0),this.expirationTimes=M1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=M1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Cy(e,t,r,n,i,a,o,l,u){return e=new NP(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=fi(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},cy(a),e}function IP(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Es,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Kw(e){if(!e)return Lo;e=e._reactInternals;e:{if(Ll(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(Tn(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(Tn(r))return K6(e,r,t)}return t}function Xw(e,t,r,n,i,a,o,l,u){return e=Cy(r,n,!0,e,i,a,o,l,u),e.context=Kw(null),r=e.current,n=dn(),i=Co(r),a=Ra(n,i),a.callback=t??null,Po(r,a,i),e.current.lanes=i,rf(e,i,n),An(e,n),e}function op(e,t,r,n){var i=t.current,a=dn(),o=Co(i);return r=Kw(r),t.context===null?t.context=r:t.pendingContext=r,t=Ra(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Po(i,t,o),e!==null&&(Ni(e,i,o,a),Yd(e,i,o)),o}function Ah(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 w5(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ty(e,t){w5(e,t),(e=e.alternate)&&w5(e,t)}function DP(){return null}var Zw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ay(e){this._internalRoot=e}lp.prototype.render=Ay.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ce(409));op(e,t,null,null)};lp.prototype.unmount=Ay.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ol(function(){op(null,e,null,null)}),t[Fa]=null}};function lp(e){this._internalRoot=e}lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=T6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<go.length&&t!==0&&t<go[r].priority;r++);go.splice(r,0,e),r===0&&k6(e)}};function ky(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function sp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function S5(){}function FP(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=Ah(o);a.call(f)}}var o=Xw(t,n,e,0,null,!1,!1,"",S5);return e._reactRootContainer=o,e[Fa]=o.current,Ic(e.nodeType===8?e.parentNode:e),Ol(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=Ah(u);l.call(f)}}var u=Cy(e,0,!1,null,null,!1,!1,"",S5);return e._reactRootContainer=u,e[Fa]=u.current,Ic(e.nodeType===8?e.parentNode:e),Ol(function(){op(t,u,r,n)}),u}function up(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=Ah(o);l.call(u)}}op(t,o,e,i)}else o=FP(r,t,e,i,n);return Ah(o)}x6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=cc(t.pendingLanes);r!==0&&(Km(t,r|1),An(t,pr()),!(Ot&6)&&(Zs=pr()+500,zo()))}break;case 13:Ol(function(){var n=ja(e,1);if(n!==null){var i=dn();Ni(n,e,1,i)}}),Ty(e,1)}};Xm=function(e){if(e.tag===13){var t=ja(e,134217728);if(t!==null){var r=dn();Ni(t,e,134217728,r)}Ty(e,134217728)}};C6=function(e){if(e.tag===13){var t=Co(e),r=ja(e,t);if(r!==null){var n=dn();Ni(r,e,t,n)}Ty(e,t)}};T6=function(){return Lt};A6=function(e,t){var r=Lt;try{return Lt=e,t()}finally{Lt=r}};Mv=function(e,t,r){switch(t){case"input":if(xv(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=Jh(n);if(!i)throw Error(Ce(90));o6(n),xv(n,i)}}}break;case"textarea":s6(e,r);break;case"select":t=r.value,t!=null&&js(e,!!r.multiple,t,!1)}};g6=Ey;v6=Ol;var jP={usingClientEntryPoint:!1,Events:[af,Ts,Jh,h6,p6,Ey]},nc={findFiberByHostInstance:dl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zP={bundleType:nc.bundleType,version:nc.version,rendererPackageName:nc.rendererPackageName,rendererConfig:nc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ha.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=b6(e),e===null?null:e.stateNode},findFiberByHostInstance:nc.findFiberByHostInstance||DP,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 Rd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rd.isDisabled&&Rd.supportsFiber)try{Kh=Rd.inject(zP),aa=Rd}catch{}}qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jP;qn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ky(t))throw Error(Ce(200));return IP(e,t,null,r)};qn.createRoot=function(e,t){if(!ky(e))throw Error(Ce(299));var r=!1,n="",i=Zw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Cy(e,1,!1,null,null,r,!1,n,i),e[Fa]=t.current,Ic(e.nodeType===8?e.parentNode:e),new Ay(t)};qn.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=b6(t),e=e===null?null:e.stateNode,e};qn.flushSync=function(e){return Ol(e)};qn.hydrate=function(e,t,r){if(!sp(t))throw Error(Ce(200));return up(null,e,t,!0,r)};qn.hydrateRoot=function(e,t,r){if(!ky(e))throw Error(Ce(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=Zw;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Xw(t,null,e,1,r??null,i,!1,a,o),e[Fa]=t.current,Ic(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 lp(t)};qn.render=function(e,t,r){if(!sp(t))throw Error(Ce(200));return up(null,e,t,!1,r)};qn.unmountComponentAtNode=function(e){if(!sp(e))throw Error(Ce(40));return e._reactRootContainer?(Ol(function(){up(null,null,e,!1,function(){e._reactRootContainer=null,e[Fa]=null})}),!0):!1};qn.unstable_batchedUpdates=Ey;qn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!sp(r))throw Error(Ce(200));if(e==null||e._reactInternals===void 0)throw Error(Ce(38));return up(e,t,r,!1,n)};qn.version="18.3.1-next-f1338f8080-20240426";function Qw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qw)}catch(e){console.error(e)}}Qw(),Q_.exports=qn;var Jw=Q_.exports,E5=Jw;ah.createRoot=E5.createRoot,ah.hydrateRoot=E5.hydrateRoot;var e8={};function at(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 BP={};function Ry(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:BP}var t8=Object.assign,kh=Object.getOwnPropertyDescriptor,la=Object.defineProperty,lf=Object.prototype,dm=[];Object.freeze(dm);var Ly={};Object.freeze(Ly);var UP=typeof Proxy<"u",HP=Object.toString();function r8(){UP||at("Proxy not available")}function n8(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Is=function(){};function Vn(e){return typeof e=="function"}function Pl(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function cp(e){return e!==null&&typeof e=="object"}function Ba(e){if(!cp(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()===HP}function i8(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function sf(e,t,r){la(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function a8(e,t,r){la(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Bo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return cp(n)&&n[r]===!0}}function mu(e){return e instanceof Map}function uf(e){return e instanceof Set}var o8=typeof Object.getOwnPropertySymbols<"u";function GP(e){var t=Object.keys(e);if(!o8)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return lf.propertyIsEnumerable.call(e,n)})):t}var Qs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:o8?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function l8(e){return e===null?null:typeof e=="object"?""+e:e}function La(e,t){return lf.hasOwnProperty.call(e,t)}var $P=Object.getOwnPropertyDescriptors||function(t){var r={};return Qs(t).forEach(function(n){r[n]=kh(t,n)}),r};function VP(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,YP(n.key),n)}}function My(e,t,r){return t&&VP(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mo.apply(this,arguments)}function s8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,hm(e,t)}function hm(e,t){return hm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hm(e,t)}function eg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qP(e,t){if(e){if(typeof e=="string")return O5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O5(e,t)}}function O5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ds(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=qP(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 WP(e,t){if(typeof e!="object"||e===null)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 YP(e){var t=WP(e,"string");return typeof t=="symbol"?t:String(t)}var ia=Symbol("mobx-stored-annotations");function Ii(e){function t(r,n){if(cf(n))return e.decorate_20223_(r,n);yu(r,n,e)}return Object.assign(t,e)}function yu(e,t,r){La(e,ia)||sf(e,ia,Mo({},e[ia])),nx(r)||(e[ia][t]=r)}function KP(e){return La(e,ia)||sf(e,ia,Mo({},e[ia])),e[ia]}function cf(e){return typeof e=="object"&&typeof e.kind=="string"}var Ke=Symbol("mobx administration"),ff=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_=Tt.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 A8(this)},t.reportChanged=function(){Pn(),k8(this),xn()},t.toString=function(){return this.name_},e}(),Ny=Bo("Atom",ff);function $c(e,t,r){t===void 0&&(t=Is),r===void 0&&(r=Is);var n=new ff(e);return t!==Is&&z8(n,t),r!==Is&&By(n,r),n}function XP(e,t){return e===t}function ZP(e,t){return Xy(e,t)}function QP(e,t){return Xy(e,t,1)}function JP(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var xl={identity:XP,structural:ZP,default:JP,shallow:QP};function Cl(e,t,r){return yp(e)?e:Array.isArray(e)?Ft.array(e,{name:r}):Ba(e)?Ft.object(e,void 0,{name:r}):mu(e)?Ft.map(e,{name:r}):uf(e)?Ft.set(e,{name:r}):typeof e=="function"&&!hf(e)&&!nu(e)?i8(e)?Al(e):tu(r,e):e}function ex(e,t,r){if(e==null||zr(e)||vn(e)||Yr(e)||hn(e))return e;if(Array.isArray(e))return Ft.array(e,{name:r,deep:!1});if(Ba(e))return Ft.object(e,void 0,{name:r,deep:!1});if(mu(e))return Ft.map(e,{name:r,deep:!1});if(uf(e))return Ft.set(e,{name:r,deep:!1})}function fp(e){return e}function tx(e,t){return Xy(e,t)?t:e}var u8="override",rx=Ii({annotationType_:u8,make_:ix,extend_:ax,decorate_20223_:ox});function nx(e){return e.annotationType_===u8}function ix(e,t){return 0}function ax(e,t,r,n){at("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function ox(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function df(e,t){return{annotationType_:e,options_:t,make_:lx,extend_:sx,decorate_20223_:ux}}function lx(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(hf(r.value))return 1;var a=c8(e,this,t,r,!1);return la(n,t,a),2}function sx(e,t,r,n){var i=c8(e,this,t,r);return e.defineProperty_(t,i,n)}function ux(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var v,S,_,p;return No((v=(S=a.options_)==null?void 0:S.name)!=null?v:n.toString(),f,(_=(p=a.options_)==null?void 0:p.autoAction)!=null?_:!1)};if(r=="field"){i(function(){yu(this,n,a)});return}if(r=="method"){var l;return hf(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}at("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
+ '`+a.annotationType_+"' can only be used on properties with a function value."))}function cx(e,t,r,n){t.annotationType_,n.value}function c8(e,t,r,n,i){var a,o,l,u,f,v,S;i===void 0&&(i=Me.safeDescriptors),cx(e,t,r,n);var _=n.value;if((a=t.options_)!=null&&a.bound){var p;_=_.bind((p=e.proxy_)!=null?p:e.target_)}return{value:No((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),_,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(v=t.options_)!=null&&v.bound?(S=e.proxy_)!=null?S:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function f8(e,t){return{annotationType_:e,options_:t,make_:fx,extend_:dx,decorate_20223_:hx}}function fx(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&&(!La(e.target_,t)||!nu(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(nu(r.value))return 1;var a=d8(e,this,t,r,!1,!1);return la(n,t,a),2}function dx(e,t,r,n){var i,a=d8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function hx(e,t){var r,n=t.name,i=t.addInitializer;return nu(e)||(e=Al(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 px(e,t,r,n){t.annotationType_,n.value}function d8(e,t,r,n,i,a){a===void 0&&(a=Me.safeDescriptors),px(e,t,r,n);var o=n.value;if(nu(o)||(o=Al(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 Iy(e,t){return{annotationType_:e,options_:t,make_:gx,extend_:vx,decorate_20223_:mx}}function gx(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function vx(e,t,r,n){return yx(e,this,t,r),e.defineComputedProperty_(t,Mo({},this.options_,{get:r.get,set:r.set}),n)}function mx(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=Il(this)[Ke],o=Mo({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new Js(o))}),function(){return this[Ke].getObservablePropValue_(n)}}function yx(e,t,r,n){t.annotationType_,n.get}function dp(e,t){return{annotationType_:e,options_:t,make_:bx,extend_:_x,decorate_20223_:wx}}function bx(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function _x(e,t,r,n){var i,a;return Sx(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:Cl,n)}function wx(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,v,S=Il(l)[Ke],_=new Ao(u,(f=(v=r.options_)==null?void 0:v.enhancer)!=null?f:Cl,"ObservableObject."+i.toString(),!1);S.values_.set(i,_),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 Sx(e,t,r,n){t.annotationType_}var Ex="true",Ox=h8();function h8(e){return{annotationType_:Ex,options_:e,make_:Px,extend_:xx,decorate_20223_:Cx}}function Px(e,t,r,n){var i,a;if(r.get)return Ml.make_(e,t,r,n);if(r.set){var o=No(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(la(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(i8(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?Al.bound:Al;return f.make_(e,t,r,n)}var v=(l=this.options_)!=null&&l.autoBind?tu.bound:tu;return v.make_(e,t,r,n)}var S=((i=this.options_)==null?void 0:i.deep)===!1?Ft.ref:Ft;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var _;r.value=r.value.bind((_=e.proxy_)!=null?_:e.target_)}return S.make_(e,t,r,n)}function xx(e,t,r,n){var i,a;if(r.get)return Ml.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Me.safeDescriptors?e.isPlainObject_:!0,set:No(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?Ft.ref:Ft;return l.extend_(e,t,r,n)}function Cx(e,t){at("'"+this.annotationType_+"' cannot be used as a decorator")}var Tx="observable",Ax="observable.ref",kx="observable.shallow",Rx="observable.struct",p8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(p8);function Ld(e){return e||p8}var pm=dp(Tx),Lx=dp(Ax,{enhancer:fp}),Mx=dp(kx,{enhancer:ex}),Nx=dp(Rx,{enhancer:tx}),g8=Ii(pm);function Md(e){return e.deep===!0?Cl:e.deep===!1?fp:Dx(e.defaultDecorator)}function Ix(e){var t;return e?(t=e.defaultDecorator)!=null?t:h8(e):void 0}function Dx(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Cl}function v8(e,t,r){if(cf(t))return pm.decorate_20223_(e,t);if(Pl(t)){yu(e,t,pm);return}return yp(e)?e:Ba(e)?Ft.object(e,t,r):Array.isArray(e)?Ft.array(e,t):mu(e)?Ft.map(e,t):uf(e)?Ft.set(e,t):typeof e=="object"&&e!==null?e:Ft.box(e,t)}t8(v8,g8);var Fx={box:function(t,r){var n=Ld(r);return new Ao(t,Md(n),n.name,!0,n.equals)},array:function(t,r){var n=Ld(r);return(Me.useProxies===!1||n.proxy===!1?GC:MC)(t,Md(n),n.name)},map:function(t,r){var n=Ld(r);return new _p(t,Md(n),n.name)},set:function(t,r){var n=Ld(r);return new Yy(t,Md(n),n.name)},object:function(t,r,n){return Uo(function(){return Uy(Me.useProxies===!1||(n==null?void 0:n.proxy)===!1?Il({},n):AC({},n),t,r)})},ref:Ii(Lx),shallow:Ii(Mx),deep:g8,struct:Ii(Nx)},Ft=t8(v8,Fx),m8="computed",jx="computed.struct",gm=Iy(m8),zx=Iy(jx,{equals:xl.structural}),Ml=function(t,r){if(cf(r))return gm.decorate_20223_(t,r);if(Pl(r))return yu(t,r,gm);if(Ba(t))return Ii(Iy(m8,t));var n=Ba(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Js(n)};Object.assign(Ml,gm);Ml.struct=Ii(zx);var P5,x5,Rh=0,Bx=1,Ux=(P5=(x5=kh(function(){},"name"))==null?void 0:x5.configurable)!=null?P5:!1,C5={value:"action",configurable:!0,writable:!1,enumerable:!1};function No(e,t,r,n){r===void 0&&(r=!1);function i(){return y8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Ux&&(C5.value=e,la(i,"name",C5)),i}function y8(e,t,r,n,i){var a=b8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{_8(a)}}function b8(e,t,r,n){var i=!1,a=0,o=Me.trackingDerivation,l=!t||!o;Pn();var u=Me.allowStateChanges;l&&(Nl(),u=hp(!0));var f=gp(!0),v={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:Bx++,parentActionId_:Rh};return Rh=v.actionId_,v}function _8(e){Rh!==e.actionId_&&at(30),Rh=e.parentActionId_,e.error_!==void 0&&(Me.suppressReactionErrors=!0),pp(e.prevAllowStateChanges_),$s(e.prevAllowStateReads_),xn(),e.runAsAction_&&Ma(e.prevDerivation_),Me.suppressReactionErrors=!1}function Dy(e,t){var r=hp(e);try{return t()}finally{pp(r)}}function hp(e){var t=Me.allowStateChanges;return Me.allowStateChanges=e,t}function pp(e){Me.allowStateChanges=e}var w8;w8=Symbol.toPrimitive;var Ao=function(e){s8(t,e);function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=xl.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}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(ui(this)){var a=ci(this,{object:this,type:sa,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(),Di(this)&&Fi(this,{type:sa,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return pf(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:sa,newValue:this.value_,oldValue:void 0}),gf(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 l8(this.get())},r[w8]=function(){return this.valueOf()},t}(ff),Fy=Bo("ObservableValue",Ao),S8;S8=Symbol.toPrimitive;var Js=function(){function e(r){this.dependenciesState_=Tt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Tt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Mh(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Lh.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||at(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=No("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?xl.structural:xl.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Zx(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_&&at(32,this.name_,this.derivation),Me.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)vm(this)&&(this.warnAboutUntrackedRead_(),Pn(),this.value_=this.computeValue_(!1),xn());else if(A8(this),vm(this)){var n=Me.trackingContext;this.keepAlive_&&!n&&(Me.trackingContext=this),this.trackAndCompute()&&Xx(this),Me.trackingContext=n}var i=this.value_;if(th(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter_&&at(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else at(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Tt.NOT_TRACKING_,a=this.computeValue_(!0),o=i||th(n)||th(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing_=!0;var i=hp(!1),a;if(n)a=E8(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 Mh(o)}return pp(i),this.isComputing_=!1,a},t.suspend_=function(){this.keepAlive_||(mm(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return zy(function(){var u=a.get();if(!o||i){var f=Nl();n({observableKind:"computed",debugObjectName:a.name_,type:sa,object:a,newValue:u,oldValue:l}),Ma(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return l8(this.get())},t[S8]=function(){return this.valueOf()},e}(),Tl=Bo("ComputedValue",Js),Tt;(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_"})(Tt||(Tt={}));var Lh;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Lh||(Lh={}));var Mh=function(t){this.cause=void 0,this.cause=t};function th(e){return e instanceof Mh}function vm(e){switch(e.dependenciesState_){case Tt.UP_TO_DATE_:return!1;case Tt.NOT_TRACKING_:case Tt.STALE_:return!0;case Tt.POSSIBLY_STALE_:{for(var t=gp(!0),r=Nl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(Tl(o)){if(Me.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ma(r),$s(t),!0}if(e.dependenciesState_===Tt.STALE_)return Ma(r),$s(t),!0}}return O8(e),Ma(r),$s(t),!1}}}function Hx(){return Me.trackingDerivation!==null}function E8(e,t,r){var n=gp(!0);O8(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 Mh(o)}return Me.inBatch--,Me.trackingDerivation=i,Gx(e),$s(n),a}function Gx(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Tt.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&&C8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,Kx(f,e))}n!==Tt.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function mm(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)C8(t[r],e);e.dependenciesState_=Tt.NOT_TRACKING_}function jy(e){var t=Nl();try{return e()}finally{Ma(t)}}function Nl(){var e=Me.trackingDerivation;return Me.trackingDerivation=null,e}function Ma(e){Me.trackingDerivation=e}function gp(e){var t=Me.allowStateReads;return Me.allowStateReads=e,t}function $s(e){Me.allowStateReads=e}function O8(e){if(e.dependenciesState_!==Tt.UP_TO_DATE_){e.dependenciesState_=Tt.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Tt.UP_TO_DATE_}}var $x=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Ec=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},rh=!0,P8=!1,Me=function(){var e=Ry();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(rh=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Ec().version&&(rh=!1),rh?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ec):(setTimeout(function(){P8||at(35)},1),new Ec)}();function Vx(){if((Me.pendingReactions.length||Me.inBatch||Me.isRunningReactions)&&at(36),P8=!0,rh){var e=Ry();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Me=new Ec}}function x8(){return Me}function qx(){var e=new Ec;for(var t in e)$x.indexOf(t)===-1&&(Me[t]=e[t]);Me.allowStateChanges=!Me.enforceActions}function Wx(e){return e.observers_&&e.observers_.size>0}function Yx(e){return e.observers_}function Kx(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function C8(e,t){e.observers_.delete(t),e.observers_.size===0&&T8(e)}function T8(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,Me.pendingUnobservations.push(e))}function Pn(){Me.inBatch++}function xn(){if(--Me.inBatch===0){R8();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 Js&&r.suspend_())}Me.pendingUnobservations=[]}}function A8(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&&T8(e),!1)}function k8(e){e.lowestObserverState_!==Tt.STALE_&&(e.lowestObserverState_=Tt.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Tt.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Tt.STALE_}))}function Xx(e){e.lowestObserverState_!==Tt.STALE_&&(e.lowestObserverState_=Tt.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Tt.POSSIBLY_STALE_?t.dependenciesState_=Tt.STALE_:t.dependenciesState_===Tt.UP_TO_DATE_&&(e.lowestObserverState_=Tt.UP_TO_DATE_)}))}function Zx(e){e.lowestObserverState_===Tt.UP_TO_DATE_&&(e.lowestObserverState_=Tt.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Tt.UP_TO_DATE_&&(t.dependenciesState_=Tt.POSSIBLY_STALE_,t.onBecomeStale_())}))}var eu=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_=Tt.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_=Lh.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),R8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){Pn(),this.isScheduled_=!1;var n=Me.trackingContext;if(Me.trackingContext=this,vm(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Me.trackingContext=n,xn()}},t.track=function(n){if(!this.isDisposed_){Pn(),this.isRunning_=!0;var i=Me.trackingContext;Me.trackingContext=this;var a=E8(this,n,void 0);Me.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&mm(this),th(a)&&this.reportExceptionInDerivation_(a.cause),xn()}},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_||(Pn(),mm(this),xn()))},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 Qx(e){return Me.globalReactionErrorHandlers.push(e),function(){var t=Me.globalReactionErrorHandlers.indexOf(e);t>=0&&Me.globalReactionErrorHandlers.splice(t,1)}}var Jx=100,ym=function(t){return t()};function R8(){Me.inBatch>0||Me.isRunningReactions||ym(eC)}function eC(){Me.isRunningReactions=!0;for(var e=Me.pendingReactions,t=0;e.length>0;){++t===Jx&&(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 Nh=Bo("Reaction",eu);function tC(e){var t=ym;ym=function(n){return e(function(){return t(n)})}}function Oc(){return!1}function L8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var M8="action",rC="action.bound",N8="autoAction",nC="autoAction.bound",I8="<unnamed action>",bm=df(M8),iC=df(rC,{bound:!0}),_m=df(N8,{autoAction:!0}),aC=df(nC,{autoAction:!0,bound:!0});function D8(e){var t=function(n,i){if(Vn(n))return No(n.name||I8,n,e);if(Vn(i))return No(n,i,e);if(cf(i))return(e?_m:bm).decorate_20223_(n,i);if(Pl(i))return yu(n,i,e?_m:bm);if(Pl(n))return Ii(df(e?N8:M8,{name:n,autoAction:e}))};return t}var wr=D8(!1);Object.assign(wr,bm);var tu=D8(!0);Object.assign(tu,_m);wr.bound=Ii(iC);tu.bound=Ii(aC);function ru(e){return y8(e.name||I8,!1,e,this,void 0)}function hf(e){return Vn(e)&&e.isMobxAction===!0}function zy(e,t){var r,n,i,a,o;t===void 0&&(t=Ly);var l=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",u=!t.scheduler&&!t.delay,f;if(u)f=new eu(l,function(){this.track(_)},t.onError,t.requiresObservable);else{var v=F8(t),S=!1;f=new eu(l,function(){S||(S=!0,v(function(){S=!1,f.isDisposed_||f.track(_)}))},t.onError,t.requiresObservable)}function _(){e(f)}return(i=t)!=null&&(a=i.signal)!=null&&a.aborted||f.schedule_(),f.getDisposer_((o=t)==null?void 0:o.signal)}var oC=function(t){return t()};function F8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:oC}function j8(e,t,r){var n,i,a,o;r===void 0&&(r=Ly);var l=(n=r.name)!=null?n:"Reaction",u=wr(l,r.onError?lC(r.onError,t):t),f=!r.scheduler&&!r.delay,v=F8(r),S=!0,_=!1,p,E=r.compareStructural?xl.structural:r.equals||xl.default,b=new eu(l,function(){S||f?m():_||(_=!0,v(m))},r.onError,r.requiresObservable);function m(){if(_=!1,!b.isDisposed_){var g=!1,h=p;b.track(function(){var d=Dy(!1,function(){return e(b)});g=S||!E(p,d),p=d}),(S&&r.fireImmediately||!S&&g)&&u(p,h,b),S=!1}}return(i=r)!=null&&(a=i.signal)!=null&&a.aborted||b.schedule_(),b.getDisposer_((o=r)==null?void 0:o.signal)}function lC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var sC="onBO",uC="onBUO";function z8(e,t,r){return B8(sC,e,t,r)}function By(e,t,r){return B8(uC,e,t,r)}function B8(e,t,r,n){var i=typeof n=="function"?ca(t,r):ca(t),a=Vn(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 cC="never",Nd="always",fC="observed";function U8(e){e.isolateGlobalState===!0&&Vx();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Me.useProxies=t===Nd?!0:t===cC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Me.verifyProxies=!0),r!==void 0){var n=r===Nd?Nd:r===fC;Me.enforceActions=n,Me.allowStateChanges=!(n===!0||n===Nd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Me[i]=!!e[i])}),Me.allowStateReads=!Me.observableRequiresReaction,e.reactionScheduler&&tC(e.reactionScheduler)}function Uy(e,t,r,n){var i=$P(t);return Uo(function(){var a=Il(e,n)[Ke];Qs(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function H8(e,t){return G8(ca(e,t))}function G8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=hC(e.observing_).map(G8)),t}function dC(e,t){return $8(ca(e,t))}function $8(e){var t={name:e.name_};return Wx(e)&&(t.observers=Array.from(Yx(e)).map($8)),t}function hC(e){return Array.from(new Set(e))}var pC=0;function vp(){this.message="FLOW_CANCELLED"}vp.prototype=Object.create(Error.prototype);function gC(e){return e instanceof vp}var tg=f8("flow"),vC=f8("flow.bound",{bound:!0}),Al=Object.assign(function(t,r){if(cf(r))return tg.decorate_20223_(t,r);if(Pl(r))return yu(t,r,tg);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++pC,v=wr(i+" - runid: "+f+" - init",n).apply(l,u),S,_=void 0,p=new Promise(function(E,b){var m=0;S=b;function g(y){_=void 0;var O;try{O=wr(i+" - runid: "+f+" - yield "+m++,v.next).call(v,y)}catch(k){return b(k)}d(O)}function h(y){_=void 0;var O;try{O=wr(i+" - runid: "+f+" - yield "+m++,v.throw).call(v,y)}catch(k){return b(k)}d(O)}function d(y){if(Vn(y==null?void 0:y.then)){y.then(d,b);return}return y.done?E(y.value):(_=Promise.resolve(y.value),_.then(g,h))}g(void 0)});return p.cancel=wr(i+" - runid: "+f+" - cancel",function(){try{_&&T5(_);var E=v.return(void 0),b=Promise.resolve(E.value);b.then(Is,Is),T5(b),S(new vp)}catch(m){S(m)}}),p};return a.isMobXFlow=!0,a},tg);Al.bound=Ii(vC);function T5(e){Vn(e.cancel)&&e.cancel()}function mC(e){return e}function nu(e){return(e==null?void 0:e.isMobXFlow)===!0}function Hy(e,t,r){var n;return Yr(e)||vn(e)||Fy(e)?n=Bi(e):zr(e)&&(n=Bi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function mp(e,t,r){return Vn(r)?bC(e,t,r):yC(e,t)}function yC(e,t){return Bi(e).intercept_(t)}function bC(e,t,r){return Bi(e,t).intercept_(r)}function V8(e,t){if(t===void 0)return Tl(e);if(zr(e)===!1||!e[Ke].values_.has(t))return!1;var r=ca(e,t);return Tl(r)}function _C(e){return V8(e)}function q8(e,t){return V8(e,t)}function W8(e,t){return e?t!==void 0?zr(e)?e[Ke].values_.has(t):!1:zr(e)||!!e[Ke]||Ny(e)||Nh(e)||Tl(e):!1}function yp(e){return W8(e)}function Y8(e,t){return W8(e,t)}function Vc(e){if(zr(e))return e[Ke].keys_();if(Yr(e)||hn(e))return Array.from(e.keys());if(vn(e))return e.map(function(t,r){return r});at(5)}function Gy(e){if(zr(e))return Vc(e).map(function(t){return e[t]});if(Yr(e))return Vc(e).map(function(t){return e.get(t)});if(hn(e))return Array.from(e.values());if(vn(e))return e.slice();at(6)}function K8(e){if(zr(e))return Vc(e).map(function(t){return[t,e[t]]});if(Yr(e))return Vc(e).map(function(t){return[t,e.get(t)]});if(hn(e))return Array.from(e.entries());if(vn(e))return e.map(function(t,r){return[r,t]});at(7)}function $y(e,t,r){if(arguments.length===2&&!hn(e)){Pn();var n=t;try{for(var i in n)$y(e,i,n[i])}finally{xn()}return}zr(e)?e[Ke].set_(t,r):Yr(e)?e.set(t,r):hn(e)?e.add(t):vn(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&at("Invalid index: '"+t+"'"),Pn(),t>=e.length&&(e.length=t+1),e[t]=r,xn()):at(8)}function wC(e,t){zr(e)?e[Ke].delete_(t):Yr(e)||hn(e)?e.delete(t):vn(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):at(9)}function X8(e,t){if(zr(e))return e[Ke].has_(t);if(Yr(e))return e.has(t);if(hn(e))return e.has(t);if(vn(e))return t>=0&&t<e.length;at(10)}function SC(e,t){if(X8(e,t)){if(zr(e))return e[Ke].get_(t);if(Yr(e))return e.get(t);if(vn(e))return e[t];at(11)}}function Vy(e,t,r){if(zr(e))return e[Ke].defineProperty_(t,r);at(39)}function Z8(e){if(zr(e))return e[Ke].ownKeys_();at(38)}function bp(e,t,r,n){return Vn(r)?OC(e,t,r,n):EC(e,t,r)}function EC(e,t,r){return Bi(e).observe_(t,r)}function OC(e,t,r,n){return Bi(e,t).observe_(r,n)}function Id(e,t,r){return e.set(t,r),r}function Ss(e,t){if(e==null||typeof e!="object"||e instanceof Date||!yp(e))return e;if(Fy(e)||Tl(e))return Ss(e.get(),t);if(t.has(e))return t.get(e);if(vn(e)){var r=Id(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Ss(o,t)}),r}if(hn(e)){var n=Id(t,e,new Set);return e.forEach(function(o){n.add(Ss(o,t))}),n}if(Yr(e)){var i=Id(t,e,new Map);return e.forEach(function(o,l){i.set(l,Ss(o,t))}),i}else{var a=Id(t,e,{});return Z8(e).forEach(function(o){lf.propertyIsEnumerable.call(e,o)&&(a[o]=Ss(e[o],t))}),a}}function PC(e,t){return Ss(e,new Map)}function xC(){}function ra(e,t){t===void 0&&(t=void 0),Pn();try{return e.apply(t)}finally{xn()}}function wm(e,t,r){return arguments.length===1||t&&typeof t=="object"?CC(e,t):Q8(e,t,r||{})}function Q8(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=No("When-effect",t),o=zy(function(l){var u=Dy(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function CC(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=Q8(e,o,Mo({},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 ys(e){return e[Ke]}var TC={has:function(t,r){return ys(t).has_(r)},get:function(t,r){return ys(t).get_(r)},set:function(t,r,n){var i;return Pl(r)?(i=ys(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return Pl(r)?(n=ys(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=ys(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return ys(t).ownKeys_()},preventExtensions:function(t){at(13)}};function AC(e,t){var r,n;return r8(),e=Il(e,t),(n=(r=e[Ke]).proxy_)!=null?n:r.proxy_=new Proxy(e,TC)}function ui(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function pf(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),n8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function ci(e,t){var r=Nl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&at(14),!!t);i++);return t}finally{Ma(r)}}function Di(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function gf(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),n8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Fi(e,t){var r=Nl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);Ma(r)}}function qy(e,t,r){return Uo(function(){var n,i=Il(e,r)[Ke];(n=t)!=null||(t=KP(e)),Qs(t).forEach(function(a){return i.make_(a,t[a])})}),e}var rg=Symbol("mobx-keys");function kC(e,t,r){return Ba(e)?Uy(e,e,t,r):(Uo(function(){var n=Il(e,r)[Ke];if(!e[rg]){var i=Object.getPrototypeOf(e),a=new Set([].concat(Qs(e),Qs(i)));a.delete("constructor"),a.delete(Ke),sf(i,rg,a)}e[rg].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var A5="splice",sa="update",RC=1e4,LC={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)):La(Ih,r)?Ih[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(){at(15)}},Wy=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 ff(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 pf(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}),gf(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&at("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_&&at(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&l9(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=dm),ui(this)){var u=ci(this,{object:this.proxy_,type:A5,index:n,removedCount:i,added:a});if(!u)return dm;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(S){return o.enhancer_(S,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var v=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,v),this.dehanceValues_(v)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<RC){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 v=0;v<u.length;v++)this.values_[n+a.length+v]=u[v];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Oc(),l=Di(this),u=l||o?{observableKind:"array",object:this.proxy_,type:sa,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&Fi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Oc(),l=Di(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:A5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&Fi(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&&at(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(ui(this)){var l=ci(this,{type:sa,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),v=0;v<f.length-1;v++)f[v]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function MC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),r8(),Uo(function(){var i=new Wy(r,t,n,!1);a8(i.values_,Ke,i);var a=new Proxy(i.values_,LC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var Ih={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&&at(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Me.trackingDerivation&&at(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}};Ht("at",Yn);Ht("concat",Yn);Ht("flat",Yn);Ht("includes",Yn);Ht("indexOf",Yn);Ht("join",Yn);Ht("lastIndexOf",Yn);Ht("slice",Yn);Ht("toString",Yn);Ht("toLocaleString",Yn);Ht("toSorted",Yn);Ht("toSpliced",Yn);Ht("with",Yn);Ht("every",Ui);Ht("filter",Ui);Ht("find",Ui);Ht("findIndex",Ui);Ht("findLast",Ui);Ht("findLastIndex",Ui);Ht("flatMap",Ui);Ht("forEach",Ui);Ht("map",Ui);Ht("some",Ui);Ht("toReversed",Ui);Ht("reduce",J8);Ht("reduceRight",J8);function Ht(e,t){typeof Array.prototype[e]=="function"&&(Ih[e]=t(e))}function Yn(e){return function(){var t=this[Ke];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Ui(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 J8(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 NC=Bo("ObservableArrayAdministration",Wy);function vn(e){return cp(e)&&NC(e[Ke])}var e9,t9,IC={},_o="add",Dh="delete";e9=Symbol.iterator;t9=Symbol.toStringTag;var _p=function(){function e(r,n,i){var a=this;n===void 0&&(n=Cl),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ke]=IC,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,Vn(Map)||at(18),Uo(function(){a.keysAtom_=$c("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 Ao(this.has_(n),fp,"ObservableMap.key?",!1);this.hasMap_.set(n,o),By(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(ui(this)){var o=ci(this,{type:a?sa:_o,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_,ui(this)){var a=ci(this,{type:Dh,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Oc(),l=Di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Dh,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return ra(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var v=i.data_.get(n);v.setNewValue_(void 0),i.data_.delete(n)}),l&&Fi(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=Oc(),l=Di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:sa,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Fi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,ra(function(){var f,v=new Ao(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,v),i=v.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Oc(),l=Di(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:_o,object:this,name:n,newValue:i}:null;l&&Fi(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 qc({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 qc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[e9]=function(){return this.entries()},t.forEach=function(n,i){for(var a=Ds(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 Yr(n)&&(n=new Map(n)),ra(function(){Ba(n)?GP(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)}):mu(n)?(n.constructor!==Map&&at(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&at(20,n)}),this},t.clear=function(){var n=this;ra(function(){jy(function(){for(var i=Ds(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return ra(function(){for(var a=DC(n),o=new Map,l=!1,u=Ds(i.data_.keys()),f;!(f=u()).done;){var v=f.value;if(!a.has(v)){var S=i.delete(v);if(S)l=!0;else{var _=i.data_.get(v);o.set(v,_)}}}for(var p=Ds(a.entries()),E;!(E=p()).done;){var b=E.value,m=b[0],g=b[1],h=i.data_.has(m);if(i.set(m,g),i.data_.has(m)){var d=i.data_.get(m);o.set(m,d),h||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var y=i.data_.keys(),O=o.keys(),k=y.next(),C=O.next();!k.done;){if(k.value!==C.value){i.keysAtom_.reportChanged();break}k=y.next(),C=O.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return gf(this,n)},t.intercept_=function(n){return pf(this,n)},My(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:t9,get:function(){return"Map"}}]),e}(),Yr=Bo("ObservableMap",_p);function DC(e){if(mu(e)||Yr(e))return e;if(Array.isArray(e))return new Map(e);if(Ba(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return at(21,e)}var r9,n9,FC={};r9=Symbol.iterator;n9=Symbol.toStringTag;var Yy=function(){function e(r,n,i){var a=this;n===void 0&&(n=Cl),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ke]=FC,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,Vn(Set)||at(22),this.enhancer_=function(o,l){return n(o,l,i)},Uo(function(){a.atom_=$c(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;ra(function(){jy(function(){for(var i=Ds(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=Ds(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_,ui(this)){var a=ci(this,{type:_o,object:this,newValue:n});if(!a)return this}if(!this.has(n)){ra(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=Di(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:_o,object:this,newValue:n}:null;l&&Fi(this,u)}return this},t.delete=function(n){var i=this;if(ui(this)){var a=ci(this,{type:Dh,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=Di(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Dh,object:this,oldValue:n}:null;return ra(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&Fi(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 qc({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 qc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return hn(n)&&(n=new Set(n)),ra(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):uf(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&at("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return gf(this,n)},t.intercept_=function(n){return pf(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[r9]=function(){return this.values()},My(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:n9,get:function(){return"Set"}}]),e}(),hn=Bo("ObservableSet",Yy),k5=Object.create(null),R5="remove",i9=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=Ox),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 ff("ObservableObject.keys"),this.isPlainObject_=Ba(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 Js)return a.set(i),!0;if(ui(this)){var o=ci(this,{type:sa,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=Di(this),u=!1,f=l||u?{type:sa,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Fi(this,f)}return!0},t.get_=function(n){return Me.trackingDerivation&&!La(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),La(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 Ao(n in this.target_,fp,"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_[ia])!=null&&a[n])return;at(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==lf;){var l=kh(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}M5(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&&M5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Pn();var o=this.delete_(n);if(!o)return o;if(ui(this)){var l=ci(this,{object:this.proxy_||this.target_,name:n,type:_o,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=Mo({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else la(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{xn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{Pn();var l=this.delete_(n);if(!l)return l;if(ui(this)){var u=ci(this,{object:this.proxy_||this.target_,name:n,type:_o,newValue:i});if(!u)return null;i=u.newValue}var f=L5(n),v={configurable:Me.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,v))return!1}else la(this.target_,n,v);var S=new Ao(i,a,"ObservableObject.key",!1);this.values_.set(n,S),this.notifyPropertyAddition_(n,S.value_)}finally{xn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Pn();var o=this.delete_(n);if(!o)return o;if(ui(this)){var l=ci(this,{object:this.proxy_||this.target_,name:n,type:_o,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=L5(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 la(this.target_,n,f);this.values_.set(n,new Js(i)),this.notifyPropertyAddition_(n,void 0)}finally{xn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!La(this.target_,n))return!0;if(ui(this)){var a=ci(this,{object:this.proxy_||this.target_,name:n,type:R5});if(!a)return null}try{var o,l;Pn();var u=Di(this),f=!1,v=this.values_.get(n),S=void 0;if(!v&&(u||f)){var _;S=(_=kh(this.target_,n))==null?void 0:_.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(v&&(this.values_.delete(n),v instanceof Ao&&(S=v.value_),k8(v)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(l=o.get(n))==null||l.set(n in this.target_),u||f){var p={type:R5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:S,name:n};u&&Fi(this,p)}}finally{xn()}return!0},t.observe_=function(n,i){return gf(this,n)},t.intercept_=function(n){return pf(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o,l=Di(this),u=!1;if(l||u){var f=l||u?{type:_o,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;l&&Fi(this,f)}(a=this.pendingKeys_)==null||(o=a.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Qs(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Il(e,t){var r;if(La(e,Ke))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new i9(e,new Map,String(n),Ix(t));return sf(e,Ke,i),e}var jC=Bo("ObservableObjectAdministration",i9);function L5(e){return k5[e]||(k5[e]={get:function(){return this[Ke].getObservablePropValue_(e)},set:function(r){return this[Ke].setObservablePropValue_(e,r)}})}function zr(e){return cp(e)?jC(e[Ke]):!1}function M5(e,t,r){var n;(n=e.target_[ia])==null||delete n[r]}var zC=o9(0),BC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),ng=0,a9=function(){};function UC(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}UC(a9,Array.prototype);var Ky=function(e,t,r){s8(n,e);function n(a,o,l,u){var f;return l===void 0&&(l="ObservableArray"),u===void 0&&(u=!1),f=e.call(this)||this,Uo(function(){var v=new Wy(l,o,u,!0);v.proxy_=eg(f),a8(eg(f),Ke,v),a&&a.length&&f.spliceWithArray(0,0,a),BC&&Object.defineProperty(eg(f),"0",zC)}),f}var i=n.prototype;return i.concat=function(){this[Ke].atom_.reportObserved();for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];return Array.prototype.concat.apply(this.slice(),l.map(function(f){return vn(f)?f.slice():f}))},i[r]=function(){var a=this,o=0;return qc({next:function(){return o<a.length?{value:a[o++],done:!1}:{done:!0,value:void 0}}})},My(n,[{key:"length",get:function(){return this[Ke].getArrayLength_()},set:function(o){this[Ke].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(a9,Symbol.toStringTag,Symbol.iterator);Object.entries(Ih).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&sf(Ky.prototype,t,r)});function o9(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ke].get_(e)},set:function(r){this[Ke].set_(e,r)}}}function HC(e){la(Ky.prototype,""+e,o9(e))}function l9(e){if(e>ng){for(var t=ng;t<e+100;t++)HC(t);ng=e}}l9(1e3);function GC(e,t,r){return new Ky(e,t,r)}function ca(e,t){if(typeof e=="object"&&e!==null){if(vn(e))return t!==void 0&&at(23),e[Ke].atom_;if(hn(e))return e.atom_;if(Yr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||at(25,t,Fh(e)),r}if(zr(e)){if(!t)return at(26);var n=e[Ke].values_.get(t);return n||at(27,t,Fh(e)),n}if(Ny(e)||Tl(e)||Nh(e))return e}else if(Vn(e)&&Nh(e[Ke]))return e[Ke];at(28)}function Bi(e,t){if(e||at(29),t!==void 0)return Bi(ca(e,t));if(Ny(e)||Tl(e)||Nh(e)||Yr(e)||hn(e))return e;if(e[Ke])return e[Ke];at(24,e)}function Fh(e,t){var r;if(t!==void 0)r=ca(e,t);else{if(hf(e))return e.name;zr(e)||Yr(e)||hn(e)?r=Bi(e):r=ca(e)}return r.name_}function Uo(e){var t=Nl(),r=hp(!0);Pn();try{return e()}finally{xn(),pp(r),Ma(t)}}var N5=lf.toString;function Xy(e,t,r){return r===void 0&&(r=-1),Sm(e,t,r)}function Sm(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=N5.call(e);if(o!==N5.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=I5(e),t=I5(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&&!(Vn(u)&&u instanceof u&&Vn(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 v=n.length;v--;)if(n[v]===e)return i[v]===t;if(n.push(e),i.push(t),l){if(v=e.length,v!==t.length)return!1;for(;v--;)if(!Sm(e[v],t[v],r-1,n,i))return!1}else{var S=Object.keys(e),_;if(v=S.length,Object.keys(t).length!==v)return!1;for(;v--;)if(_=S[v],!(La(t,_)&&Sm(e[_],t[_],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function I5(e){return vn(e)?e.slice():mu(e)||Yr(e)||uf(e)||hn(e)?Array.from(e.entries()):e}function qc(e){return e[Symbol.iterator]=$C,e}function $C(){return this}["Symbol","Map","Set"].forEach(function(e){var t=Ry();typeof t[e]>"u"&&at("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:L8,extras:{getDebugName:Fh},$mobx:Ke});const VC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ke,FlowCancellationError:vp,ObservableMap:_p,ObservableSet:Yy,Reaction:eu,_allowStateChanges:Dy,_allowStateChangesInsideComputed:ru,_allowStateReadsEnd:$s,_allowStateReadsStart:gp,_autoAction:tu,_endAction:_8,_getAdministration:Bi,_getGlobalState:x8,_interceptReads:Hy,_isComputingDerivation:Hx,_resetGlobalState:qx,_startAction:b8,action:wr,autorun:zy,comparer:xl,computed:Ml,configure:U8,createAtom:$c,defineProperty:Vy,entries:K8,extendObservable:Uy,flow:Al,flowResult:mC,get:SC,getAtom:ca,getDebugName:Fh,getDependencyTree:H8,getObserverTree:dC,has:X8,intercept:mp,isAction:hf,isBoxedObservable:Fy,isComputed:_C,isComputedProp:q8,isFlow:nu,isFlowCancellationError:gC,isObservable:yp,isObservableArray:vn,isObservableMap:Yr,isObservableObject:zr,isObservableProp:Y8,isObservableSet:hn,keys:Vc,makeAutoObservable:kC,makeObservable:qy,observable:Ft,observe:bp,onBecomeObserved:z8,onBecomeUnobserved:By,onReactionError:Qx,override:rx,ownKeys:Z8,reaction:j8,remove:wC,runInAction:ru,set:$y,spy:L8,toJS:PC,trace:xC,transaction:ra,untracked:jy,values:Gy,when:wm},Symbol.toStringTag,{value:"Module"}));if(!it.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!qy)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function qC(e){e()}function s9(e){e||(e=qC),U8({reactionScheduler:e})}var WC=function(){return!0};function YC(e){return H8(e)}var u9=!1;function c9(e){u9=e}function Zy(){return u9}var KC=1e4,XC=1e4,ZC=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=KC),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,XC))}}),e}(),QC=typeof FinalizationRegistry<"u"?FinalizationRegistry:ZC,jh=new QC(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),f9={exports:{}},d9={};/**
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 iu=it;function JC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var eT=typeof Object.is=="function"?Object.is:JC,tT=iu.useState,rT=iu.useEffect,nT=iu.useLayoutEffect,iT=iu.useDebugValue;function aT(e,t){var r=t(),n=tT({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return nT(function(){i.value=r,i.getSnapshot=t,ig(i)&&a({inst:i})},[e,r,t]),rT(function(){return ig(i)&&a({inst:i}),e(function(){ig(i)&&a({inst:i})})},[e]),iT(r),r}function ig(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!eT(e,r)}catch{return!0}}function oT(e,t){return t()}var lT=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?oT:aT;d9.useSyncExternalStore=iu.useSyncExternalStore!==void 0?iu.useSyncExternalStore:lT;f9.exports=d9;var sT=f9.exports;function D5(e){e.reaction=new eu("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function Qy(e,t){if(t===void 0&&(t="observed"),Zy())return e();var r=yt.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return jh.unregister(n),n.onStoreChange=l,n.reaction||(D5(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||(D5(i),jh.register(r,i,i)),yt.useDebugValue(i.reaction,YC),sT.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 ag,og,h9=typeof Symbol=="function"&&Symbol.for,uT=(og=(ag=Object.getOwnPropertyDescriptor(function(){},"name"))===null||ag===void 0?void 0:ag.configurable)!==null&&og!==void 0?og:!1,F5=h9?Symbol.for("react.forward_ref"):typeof it.forwardRef=="function"&&it.forwardRef(function(e){return null}).$$typeof,j5=h9?Symbol.for("react.memo"):typeof it.memo=="function"&&it.memo(function(e){return null}).$$typeof;function cT(e,t){var r;if(j5&&e.$$typeof===j5)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(Zy())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(F5&&e.$$typeof===F5&&(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 Qy(function(){return i(l,u)},a)};return o.displayName=e.displayName,uT&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=it.forwardRef(o)),o=it.memo(o),dT(e,o),o}var fT={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function dT(e,t){Object.keys(e).forEach(function(r){fT[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function p9(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:Qy(n)}p9.displayName="Observer";function hT(e,t){return it.useState(function(){return Ft(e(),t,{autoBind:!0})})[0]}function g9(e){var t=it.useState(function(){return Ft(e,{},{deep:!1})})[0];return ru(function(){Object.assign(t,e)}),t}function pT(e,t){var r=t&&g9(t);return it.useState(function(){return Ft(e(r),void 0,{autoBind:!0})})[0]}var lg;s9(Jw.unstable_batchedUpdates);var gT=(lg=jh.finalizeAllImmediately)!==null&&lg!==void 0?lg:function(){};function vT(e,t){return t===void 0&&(t="observed"),Qy(e,t)}function mT(e){c9(e)}const yT=Object.freeze(Object.defineProperty({__proto__:null,Observer:p9,_observerFinalizationRegistry:jh,clearTimers:gT,enableStaticRendering:c9,isObserverBatched:WC,isUsingStaticRendering:Zy,observer:cT,observerBatching:s9,useAsObservableSource:g9,useLocalObservable:hT,useLocalStore:pT,useObserver:vT,useStaticRendering:mT},Symbol.toStringTag,{value:"Module"})),Hi=Do(yT);var v9={};const ha=Do(VC);var Jy={exports:{}},wp={},zh={},pt={};(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 Se<"u"?Se:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.11",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)})(pt);var ir={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=pt;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 O=this.m;return{x:O[0]*y.x+O[2]*y.y+O[4],y:O[1]*y.x+O[3]*y.y+O[5]}}translate(y,O){return this.m[4]+=this.m[0]*y+this.m[2]*O,this.m[5]+=this.m[1]*y+this.m[3]*O,this}scale(y,O){return this.m[0]*=y,this.m[1]*=y,this.m[2]*=O,this.m[3]*=O,this}rotate(y){var O=Math.cos(y),k=Math.sin(y),C=this.m[0]*O+this.m[2]*k,w=this.m[1]*O+this.m[3]*k,P=this.m[0]*-k+this.m[2]*O,x=this.m[1]*-k+this.m[3]*O;return this.m[0]=C,this.m[1]=w,this.m[2]=P,this.m[3]=x,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(y,O){var k=this.m[0]+this.m[2]*O,C=this.m[1]+this.m[3]*O,w=this.m[2]+this.m[0]*y,P=this.m[3]+this.m[1]*y;return this.m[0]=k,this.m[1]=C,this.m[2]=w,this.m[3]=P,this}multiply(y){var O=this.m[0]*y.m[0]+this.m[2]*y.m[1],k=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],w=this.m[1]*y.m[2]+this.m[3]*y.m[3],P=this.m[0]*y.m[4]+this.m[2]*y.m[5]+this.m[4],x=this.m[1]*y.m[4]+this.m[3]*y.m[5]+this.m[5];return this.m[0]=O,this.m[1]=k,this.m[2]=C,this.m[3]=w,this.m[4]=P,this.m[5]=x,this}invert(){var y=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),O=this.m[3]*y,k=-this.m[1]*y,C=-this.m[2]*y,w=this.m[0]*y,P=y*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),x=y*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=O,this.m[1]=k,this.m[2]=C,this.m[3]=w,this.m[4]=P,this.m[5]=x,this}getMatrix(){return this.m}decompose(){var y=this.m[0],O=this.m[1],k=this.m[2],C=this.m[3],w=this.m[4],P=this.m[5],x=y*C-O*k;let A={x:w,y:P,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(y!=0||O!=0){var R=Math.sqrt(y*y+O*O);A.rotation=O>0?Math.acos(y/R):-Math.acos(y/R),A.scaleX=R,A.scaleY=x/R,A.skewX=(y*k+O*C)/x,A.skewY=0}else if(k!=0||C!=0){var M=Math.sqrt(k*k+C*C);A.rotation=Math.PI/2-(C>0?Math.acos(-k/M):-Math.acos(k/M)),A.scaleX=x/M,A.scaleY=M,A.skewX=0,A.skewY=(y*k+O*C)/x}return A.rotation=e.Util._getRotation(A.rotation),A}}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="#",v="",S="0",_="Konva warning: ",p="Konva error: ",E="rgb(",b={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},m=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,g=[];const h=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){g.push(d),g.length===1&&h(function(){const y=g;g=[],y.forEach(function(O){O()})})},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 O=e.Util.createImageElement();O.onload=function(){y(O)},O.src=d},_rgbToHex(d,y,O){return((1<<24)+(d<<16)+(y<<8)+O).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,v);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=S+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)===E?(y=m.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((O,k)=>O.slice(-1)==="%"?k===3?parseInt(O)/100:parseInt(O)/100*255:Number(O));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,...O]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),k=Number(O[0])/360,C=Number(O[1])/100,w=Number(O[2])/100;let P,x,A;if(C===0)return A=w*255,{r:Math.round(A),g:Math.round(A),b:Math.round(A),a:1};w<.5?P=w*(1+C):P=w+C-w*C;const R=2*w-P,M=[0,0,0];for(let U=0;U<3;U++)x=k+1/3*-(U-1),x<0&&x++,x>1&&x--,6*x<1?A=R+(P-R)*6*x:2*x<1?A=P:3*x<2?A=R+(P-R)*(2/3-x)*6:A=R,M[U]=A*255;return{r:Math.round(M[0]),g:Math.round(M[1]),b:Math.round(M[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 O in d)this._isPlainObject(d[O])?y[O]=this.cloneObject(d[O]):this._isArray(d[O])?y[O]=this.cloneArray(d[O]):y[O]=d[O];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(p+d)},error(d){console.error(p+d)},warn(d){t.Konva.showWarnings&&console.warn(_+d)},each(d,y){for(var O in d)y(O,d[O])},_inRange(d,y,O){return y<=d&&d<O},_getProjectionToSegment(d,y,O,k,C,w){var P,x,A,R=(d-O)*(d-O)+(y-k)*(y-k);if(R==0)P=d,x=y,A=(C-O)*(C-O)+(w-k)*(w-k);else{var M=((C-d)*(O-d)+(w-y)*(k-y))/R;M<0?(P=d,x=y,A=(d-C)*(d-C)+(y-w)*(y-w)):M>1?(P=O,x=k,A=(O-C)*(O-C)+(k-w)*(k-w)):(P=d+M*(O-d),x=y+M*(k-y),A=(P-C)*(P-C)+(x-w)*(x-w))}return[P,x,A]},_getProjectionToLine(d,y,O){var k=e.Util.cloneObject(d),C=Number.MAX_VALUE;return y.forEach(function(w,P){if(!(!O&&P===y.length-1)){var x=y[(P+1)%y.length],A=e.Util._getProjectionToSegment(w.x,w.y,x.x,x.y,d.x,d.y),R=A[0],M=A[1],U=A[2];U<C&&(k.x=R,k.y=M,C=U)}}),k},_prepareArrayForTween(d,y,O){var k,C=[],w=[];if(d.length>y.length){var P=y;y=d,d=P}for(k=0;k<d.length;k+=2)C.push({x:d[k],y:d[k+1]});for(k=0;k<y.length;k+=2)w.push({x:y[k],y:y[k+1]});var x=[];return w.forEach(function(A){var R=e.Util._getProjectionToLine(A,C,O);x.push(R.x),x.push(R.y)}),x},_prepareToStringify(d){var y;d.visitedByCircularReferenceRemoval=!0;for(var O in d)if(d.hasOwnProperty(O)&&d[O]&&typeof d[O]=="object"){if(y=Object.getOwnPropertyDescriptor(d,O),d[O].visitedByCircularReferenceRemoval||e.Util._isElement(d[O]))if(y.configurable)delete d[O];else return null;else if(e.Util._prepareToStringify(d[O])===null)if(y.configurable)delete d[O];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,y){for(var O in y)d[O]=y[O];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,O,k){let C=0,w=0,P=0,x=0;typeof k=="number"?C=w=P=x=Math.min(k,y/2,O/2):(C=Math.min(k[0]||0,y/2,O/2),w=Math.min(k[1]||0,y/2,O/2),x=Math.min(k[2]||0,y/2,O/2),P=Math.min(k[3]||0,y/2,O/2)),d.moveTo(C,0),d.lineTo(y-w,0),d.arc(y-w,w,w,Math.PI*3/2,0,!1),d.lineTo(y,O-x),d.arc(y-x,O-x,x,0,Math.PI/2,!1),d.lineTo(P,O),d.arc(P,O-P,P,Math.PI/2,Math.PI,!1),d.lineTo(0,C),d.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(ir);var Qt={},vt={},We={};Object.defineProperty(We,"__esModule",{value:!0});We.getComponentValidator=We.getBooleanValidator=We.getNumberArrayValidator=We.getFunctionValidator=We.getStringOrGradientValidator=We.getStringValidator=We.getNumberOrAutoValidator=We.getNumberOrArrayOfNumbersValidator=We.getNumberValidator=We.alphaComponent=We.RGBComponent=void 0;const Ga=pt,ur=ir;function $a(e){return ur.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||ur.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function bT(e){return e>255?255:e<0?0:Math.round(e)}We.RGBComponent=bT;function _T(e){return e>1?1:e<1e-4?1e-4:e}We.alphaComponent=_T;function wT(){if(Ga.Konva.isUnminified)return function(e,t){return ur.Util._isNumber(e)||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}We.getNumberValidator=wT;function ST(e){if(Ga.Konva.isUnminified)return function(t,r){let n=ur.Util._isNumber(t),i=ur.Util._isArray(t)&&t.length==e;return!n&&!i&&ur.Util.warn($a(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}We.getNumberOrArrayOfNumbersValidator=ST;function ET(){if(Ga.Konva.isUnminified)return function(e,t){var r=ur.Util._isNumber(e),n=e==="auto";return r||n||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}We.getNumberOrAutoValidator=ET;function OT(){if(Ga.Konva.isUnminified)return function(e,t){return ur.Util._isString(e)||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}We.getStringValidator=OT;function PT(){if(Ga.Konva.isUnminified)return function(e,t){const r=ur.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}We.getStringOrGradientValidator=PT;function xT(){if(Ga.Konva.isUnminified)return function(e,t){return ur.Util._isFunction(e)||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}We.getFunctionValidator=xT;function CT(){if(Ga.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(ur.Util._isArray(e)?e.forEach(function(n){ur.Util._isNumber(n)||ur.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}We.getNumberArrayValidator=CT;function TT(){if(Ga.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||ur.Util.warn($a(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}We.getBooleanValidator=TT;function AT(e){if(Ga.Konva.isUnminified)return function(t,r){return t==null||ur.Util.isObject(t)||ur.Util.warn($a(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}We.getComponentValidator=AT;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=ir,r=We;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(v){return l&&v!==void 0&&v!==null&&(v=l.call(this,v,o)),this._setAttr(o,v),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var v=l.length,S=t.Util._capitalize,_=n+S(o),p=i+S(o),E,b;a.prototype[_]=function(){var g={};for(E=0;E<v;E++)b=l[E],g[b]=this.getAttr(o+S(b));return g};var m=(0,r.getComponentValidator)(l);a.prototype[p]=function(g){var h=this.attrs[o],d;u&&(g=u.call(this,g)),m&&m.call(this,g,o);for(d in g)g.hasOwnProperty(d)&&this._setAttr(o+S(d),g[d]);return g||l.forEach(y=>{this._setAttr(o+S(y),void 0)}),this._fireChangeEvent(o,h,g),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),v=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(v);var S=this.attrs[o];return S===void 0?l:S},e.Factory.addSetter(a,o,u,function(){t.Util.error(v)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],v=n+t.Util._capitalize(l),S=i+t.Util._capitalize(l);function _(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=_,a.prototype[v]=_,a.prototype[S]=_})},afterSetFilter(){this._filterUpToDate=!1}}})(vt);var ji={},Na={};Object.defineProperty(Na,"__esModule",{value:!0});Na.HitContext=Na.SceneContext=Na.Context=void 0;const m9=ir,kT=pt;function RT(e){var t=[],r=e.length,n=m9.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 z5=",",LT="(",MT=")",NT="([",IT="])",DT=";",FT="()",jT="=",B5=["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"],zT=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const BT=100;class Sp{constructor(t){this.canvas=t,kT.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+=FT:m9.Util._isArray(f[0])?a+=NT+f.join(z5)+IT:(r&&(f=f.map(v=>typeof v=="number"?Math.floor(v):v)),a+=LT+f.join(z5)+MT)):(a+=l.property,t||(a+=jT+l.val)),a+=DT;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=BT&&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 v=arguments,S=this._context;v.length===3?S.drawImage(t,r,n):v.length===5?S.drawImage(t,r,n,i,a):v.length===9&&S.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=B5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=RT(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(B5[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)}}Na.Context=Sp;zT.forEach(function(e){Object.defineProperty(Sp.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class UT extends Sp{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(),v=u.x*f,S=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(v),Math.abs(S))),this.setAttr("shadowOffsetX",l.x*v),this.setAttr("shadowOffsetY",l.y*S)}}Na.SceneContext=UT;class HT extends Sp{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()}}}Na.HitContext=HT;Object.defineProperty(ji,"__esModule",{value:!0});ji.HitCanvas=ji.SceneCanvas=ji.Canvas=void 0;const Bh=ir,y9=Na,b9=pt,GT=vt,$T=We;var Dd;function VT(){if(Dd)return Dd;var e=Bh.Util.createCanvasElement(),t=e.getContext("2d");return Dd=function(){var r=b9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),Bh.Util.releaseCanvas(e),Dd}class Ep{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||b9.Konva.pixelRatio||VT();this.pixelRatio=n,this._canvas=Bh.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 Bh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}ji.Canvas=Ep;GT.Factory.addGetterSetter(Ep,"pixelRatio",void 0,(0,$T.getNumberValidator)());class qT extends Ep{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new y9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}ji.SceneCanvas=qT;class WT extends Ep{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new y9.HitContext(this),this.setSize(t.width,t.height)}}ji.HitCanvas=WT;var Op={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=pt,r=ir;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(_=>_.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var v=l.dragDistance(),S=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(S<v||(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(v=>v.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))})(Op);Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Node=void 0;const _t=ir,vf=vt,ic=ji,co=pt,oi=Op,gr=We;var nh="absoluteOpacity",Fd="allEventListeners",xa="absoluteTransform",U5="absoluteScale",ll="canvas",YT="Change",KT="children",XT="konva",Em="listening",H5="mouseenter",G5="mouseleave",$5="set",V5="Shape",ih=" ",q5="stage",fo="transform",ZT="Stage",Om="visible",QT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(ih);let JT=1,ct=class Pm{constructor(t){this._id=JT++,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===fo||t===xa)&&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===fo||t===xa,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(ih);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(ll)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===xa&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ll)){const{scene:t,filter:r,hit:n}=this._cache.get(ll);_t.Util.releaseCanvas(t,r,n),this._cache.delete(ll)}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,v=r.drawBorder||!1,S=r.hitCanvasPixelRatio||1;if(!i||!a){_t.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const _=Math.abs(Math.round(n.x)-l)>.5?1:0,p=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+_,a+=f*2+p,l-=f,u-=f;var E=new ic.SceneCanvas({pixelRatio:o,width:i,height:a}),b=new ic.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),m=new ic.HitCanvas({pixelRatio:S,width:i,height:a}),g=E.getContext(),h=m.getContext();return m.isCache=!0,E.isCache=!0,this._cache.delete(ll),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(E.getContext()._context.imageSmoothingEnabled=!1,b.getContext()._context.imageSmoothingEnabled=!1),g.save(),h.save(),g.translate(-l,-u),h.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(nh),this._clearSelfAndDescendantCache(U5),this.drawScene(E,this),this.drawHit(m,this),this._isUnderCache=!1,g.restore(),h.restore(),v&&(g.save(),g.beginPath(),g.rect(0,0,i,a),g.closePath(),g.setAttr("strokeStyle","red"),g.setAttr("lineWidth",5),g.stroke(),g.restore()),this._cache.set(ll,{scene:E,filter:b,hit:m,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(ll)}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 v=u.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.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 v=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()/v,n.getHeight()/v),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){_t.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(S){_t.Util.error("Unable to apply filter. "+S.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(Fd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(ih),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(ih),i=n.length,a,o,l,u,f,v;if(this._cache&&this._cache.delete(Fd),!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],v=u[1],f)this.eventListeners[f]&&this._off(f,v,r);else for(o in this.eventListeners)this._off(o,v,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=_t.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),oi.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(xa),this._clearSelfAndDescendantCache(nh),this._clearSelfAndDescendantCache(U5),this._clearSelfAndDescendantCache(q5),this._clearSelfAndDescendantCache(Om),this._clearSelfAndDescendantCache(Em)}_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"+_t.Util._capitalize(t);return _t.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!==KT&&(n=$5+_t.Util._capitalize(r),_t.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(Em,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;oi.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!co.Konva.hitOnDragEnabled&&(i||co.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(v){for(i=[],a=v.length,o=0;o<a;o++)l=v[o],n++,l.nodeType!==V5&&(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!==ZT&&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(fo),this._clearSelfAndDescendantCache(xa)),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 _t.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(fo);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(fo),this._clearSelfAndDescendantCache(xa),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 _t.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 _t.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 _t.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 _t.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 _t.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&_t.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(nh,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=_t.Util.isObject(n)&&!_t.Util._isPlainObject(n)&&!_t.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 _t.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],_t.Util.isValidSelector(a)||(_t.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),_t.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),_t.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(q5,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(xa,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new _t.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(xa)||new _t.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(fo,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(fo)||new _t.Transform;n.reset();var i=this.x(),a=this.y(),o=co.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,v=this.attrs.skewY||0,S=this.attrs.offsetX||0,_=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||v!==0)&&n.skew(f,v),(l!==1||u!==1)&&n.scale(l,u),(S!==0||_!==0)&&n.translate(-1*S,-1*_),n.dirty=!1,n}clone(t){var r=_t.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(XT)<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 ic.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 ic.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,_t.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():co.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+YT,{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[$5+_t.Util._capitalize(t)];return _t.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(co.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!_t.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===V5&&(r.target=this);var i=(t===H5||t===G5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===H5||t===G5)&&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(Fd))!==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(Fd,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;oi.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){oi.DD._dragElements.has(this._id)||this._createDragElement(t);const n=oi.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:_t.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=oi.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),oi.DD._endDragBefore(t),oi.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=oi.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||co.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;oi.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=oi.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&oi.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 _t.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return _t.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=Pm.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),co.Konva[n]||(_t.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=co.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(Pm._createNode(i[l]));return a}};Qt.Node=ct;ct.prototype.nodeType="Node";ct.prototype._attrsAffectingSize=[];ct.prototype.eventListeners={};ct.prototype.on.call(ct.prototype,QT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(fo),this._clearSelfAndDescendantCache(xa)});ct.prototype.on.call(ct.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Om)});ct.prototype.on.call(ct.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(Em)});ct.prototype.on.call(ct.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(nh)});const zt=vf.Factory.addGetterSetter;zt(ct,"zIndex");zt(ct,"absolutePosition");zt(ct,"position");zt(ct,"x",0,(0,gr.getNumberValidator)());zt(ct,"y",0,(0,gr.getNumberValidator)());zt(ct,"globalCompositeOperation","source-over",(0,gr.getStringValidator)());zt(ct,"opacity",1,(0,gr.getNumberValidator)());zt(ct,"name","",(0,gr.getStringValidator)());zt(ct,"id","",(0,gr.getStringValidator)());zt(ct,"rotation",0,(0,gr.getNumberValidator)());vf.Factory.addComponentsGetterSetter(ct,"scale",["x","y"]);zt(ct,"scaleX",1,(0,gr.getNumberValidator)());zt(ct,"scaleY",1,(0,gr.getNumberValidator)());vf.Factory.addComponentsGetterSetter(ct,"skew",["x","y"]);zt(ct,"skewX",0,(0,gr.getNumberValidator)());zt(ct,"skewY",0,(0,gr.getNumberValidator)());vf.Factory.addComponentsGetterSetter(ct,"offset",["x","y"]);zt(ct,"offsetX",0,(0,gr.getNumberValidator)());zt(ct,"offsetY",0,(0,gr.getNumberValidator)());zt(ct,"dragDistance",null,(0,gr.getNumberValidator)());zt(ct,"width",0,(0,gr.getNumberValidator)());zt(ct,"height",0,(0,gr.getNumberValidator)());zt(ct,"listening",!0,(0,gr.getBooleanValidator)());zt(ct,"preventDefault",!0,(0,gr.getBooleanValidator)());zt(ct,"filters",null,function(e){return this._filterUpToDate=!1,e});zt(ct,"visible",!0,(0,gr.getBooleanValidator)());zt(ct,"transformsEnabled","all",(0,gr.getStringValidator)());zt(ct,"size");zt(ct,"dragBoundFunc");zt(ct,"draggable",!1,(0,gr.getBooleanValidator)());vf.Factory.backCompat(ct,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Dl={};Object.defineProperty(Dl,"__esModule",{value:!0});Dl.Container=void 0;const bu=vt,sg=Qt,Pp=We;class Fl extends sg.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=sg.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=sg.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 v=this.getAbsoluteTransform(r).getMatrix();o.transform(v[0],v[1],v[2],v[3],v[4],v[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(),v=typeof l=="number"&&typeof u=="number"||f;const S=n===this;if(v){o.save();var _=this.getAbsoluteTransform(n),p=_.getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),o.beginPath();let g;if(f)g=f.call(this,o,this);else{var E=this.clipX(),b=this.clipY();o.rect(E||0,b||0,l,u)}o.clip.apply(o,g),p=_.copy().invert().getMatrix(),o.transform(p[0],p[1],p[2],p[3],p[4],p[5])}var m=!S&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(g){g[t](r,n,i)}),m&&o.restore(),v&&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},v=this;(r=this.children)===null||r===void 0||r.forEach(function(b){if(b.visible()){var m=b.getClientRect({relativeTo:v,skipShadow:t.skipShadow,skipStroke:t.skipStroke});m.width===0&&m.height===0||(a===void 0?(a=m.x,o=m.y,l=m.x+m.width,u=m.y+m.height):(a=Math.min(a,m.x),o=Math.min(o,m.y),l=Math.max(l,m.x+m.width),u=Math.max(u,m.y+m.height)))}});for(var S=this.find("Shape"),_=!1,p=0;p<S.length;p++){var E=S[p];if(E._isVisible(this)){_=!0;break}}return _&&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)}}Dl.Container=Fl;bu.Factory.addComponentsGetterSetter(Fl,"clip",["x","y","width","height"]);bu.Factory.addGetterSetter(Fl,"clipX",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipY",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipWidth",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipHeight",void 0,(0,Pp.getNumberValidator)());bu.Factory.addGetterSetter(Fl,"clipFunc");var _9={},Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.releaseCapture=Un.setPointerCapture=Un.hasPointerCapture=Un.createEvent=Un.getCapturedShape=void 0;const eA=pt,Wc=new Map,w9=eA.Konva._global.PointerEvent!==void 0;function tA(e){return Wc.get(e)}Un.getCapturedShape=tA;function e2(e){return{evt:e,pointerId:e.pointerId}}Un.createEvent=e2;function rA(e,t){return Wc.get(e)===t}Un.hasPointerCapture=rA;function nA(e,t){S9(e),t.getStage()&&(Wc.set(e,t),w9&&t._fire("gotpointercapture",e2(new PointerEvent("gotpointercapture"))))}Un.setPointerCapture=nA;function S9(e,t){const r=Wc.get(e);if(!r)return;const n=r.getStage();n&&n.content,Wc.delete(e),w9&&r._fire("lostpointercapture",e2(new PointerEvent("lostpointercapture")))}Un.releaseCapture=S9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=ir,r=vt,n=Dl,i=pt,a=ji,o=Op,l=pt,u=Un;var f="Stage",v="string",S="px",_="mouseout",p="mouseleave",E="mouseover",b="mouseenter",m="mousemove",g="mousedown",h="mouseup",d="pointermove",y="pointerdown",O="pointerup",k="pointercancel",C="lostpointercapture",w="pointerout",P="pointerleave",x="pointerover",A="pointerenter",R="contextmenu",M="touchstart",U="touchend",V="touchmove",q="touchcancel",z="wheel",F=5,G=[[b,"_pointerenter"],[g,"_pointerdown"],[m,"_pointermove"],[h,"_pointerup"],[p,"_pointerleave"],[M,"_pointerdown"],[V,"_pointermove"],[U,"_pointerup"],[q,"_pointercancel"],[E,"_pointerover"],[z,"_wheel"],[R,"_contextmenu"],[y,"_pointerdown"],[d,"_pointermove"],[O,"_pointerup"],[k,"_pointercancel"],[C,"_lostpointercapture"]];const L={mouse:{[w]:_,[P]:p,[x]:E,[A]:b,[d]:m,[y]:g,[O]:h,[k]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[w]:"touchout",[P]:"touchleave",[x]:"touchover",[A]:"touchenter",[d]:V,[y]:M,[O]:U,[k]:q,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[w]:w,[P]:P,[x]:x,[A]:A,[d]:d,[y]:y,[O]:O,[k]:k,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},I=Y=>Y.indexOf("pointer")>=0?"pointer":Y.indexOf("touch")>=0?"touch":"mouse",B=Y=>{const H=I(Y);if(H==="pointer")return i.Konva.pointerEventsEnabled&&L.pointer;if(H==="touch")return L.touch;if(H==="mouse")return L.mouse};function D(Y={}){return(Y.clipFunc||Y.clipWidth||Y.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Y}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(H){super(D(H)),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(H){const X=H.getType()==="Layer",Z=H.getType()==="FastLayer";X||Z||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const H=this.visible()?"":"none";this.content.style.display=H}setContainer(H){if(typeof H===v){if(H.charAt(0)==="."){var X=H.slice(1);H=document.getElementsByClassName(X)[0]}else{var Z;H.charAt(0)!=="#"?Z=H:Z=H.slice(1),H=document.getElementById(Z)}if(!H)throw"Can not find container in document with id "+Z}return this._setAttr("container",H),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),H.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var H=this.children,X=H.length,Z;for(Z=0;Z<X;Z++)H[Z].clear();return this}clone(H){return H||(H={}),H.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,H)}destroy(){super.destroy();var H=this.content;H&&t.Util._isInDocument(H)&&this.container().removeChild(H);var X=e.stages.indexOf(this);return X>-1&&e.stages.splice(X,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const H=this._pointerPositions[0]||this._changedPointerPositions[0];return H?{x:H.x,y:H.y}:(t.Util.warn($),null)}_getPointerById(H){return this._pointerPositions.find(X=>X.id===H)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(H){H=H||{},H.x=H.x||0,H.y=H.y||0,H.width=H.width||this.width(),H.height=H.height||this.height();var X=new a.SceneCanvas({width:H.width,height:H.height,pixelRatio:H.pixelRatio||1}),Z=X.getContext()._context,J=this.children;return(H.x||H.y)&&Z.translate(-1*H.x,-1*H.y),J.forEach(function(ee){if(ee.isVisible()){var re=ee._toKonvaCanvas(H);Z.drawImage(re._canvas,H.x,H.y,re.getWidth()/re.getPixelRatio(),re.getHeight()/re.getPixelRatio())}}),X}getIntersection(H){if(!H)return null;var X=this.children,Z=X.length,J=Z-1,ee;for(ee=J;ee>=0;ee--){const re=X[ee].getIntersection(H);if(re)return re}return null}_resizeDOM(){var H=this.width(),X=this.height();this.content&&(this.content.style.width=H+S,this.content.style.height=X+S),this.bufferCanvas.setSize(H,X),this.bufferHitCanvas.setSize(H,X),this.children.forEach(Z=>{Z.setSize({width:H,height:X}),Z.draw()})}add(H,...X){if(arguments.length>1){for(var Z=0;Z<arguments.length;Z++)this.add(arguments[Z]);return this}super.add(H);var J=this.children.length;return J>F&&t.Util.warn("The stage has "+J+" 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."),H.setSize({width:this.width(),height:this.height()}),H.draw(),i.Konva.isBrowser&&this.content.appendChild(H.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(H){return u.hasPointerCapture(H,this)}setPointerCapture(H){u.setPointerCapture(H,this)}releaseCapture(H){u.releaseCapture(H,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&G.forEach(([H,X])=>{this.content.addEventListener(H,Z=>{this[X](Z)},{passive:!1})})}_pointerenter(H){this.setPointersPositions(H);const X=B(H.type);X&&this._fire(X.pointerenter,{evt:H,target:this,currentTarget:this})}_pointerover(H){this.setPointersPositions(H);const X=B(H.type);X&&this._fire(X.pointerover,{evt:H,target:this,currentTarget:this})}_getTargetShape(H){let X=this[H+"targetShape"];return X&&!X.getStage()&&(X=null),X}_pointerleave(H){const X=B(H.type),Z=I(H.type);if(X){this.setPointersPositions(H);var J=this._getTargetShape(Z),ee=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;J&&ee?(J._fireAndBubble(X.pointerout,{evt:H}),J._fireAndBubble(X.pointerleave,{evt:H}),this._fire(X.pointerleave,{evt:H,target:this,currentTarget:this}),this[Z+"targetShape"]=null):ee&&(this._fire(X.pointerleave,{evt:H,target:this,currentTarget:this}),this._fire(X.pointerout,{evt:H,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(H){const X=B(H.type),Z=I(H.type);if(X){this.setPointersPositions(H);var J=!1;this._changedPointerPositions.forEach(ee=>{var re=this.getIntersection(ee);if(o.DD.justDragged=!1,i.Konva["_"+Z+"ListenClick"]=!0,!re||!re.isListening()){this[Z+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&re.setPointerCapture(ee.id),this[Z+"ClickStartShape"]=re,re._fireAndBubble(X.pointerdown,{evt:H,pointerId:ee.id}),J=!0;const ae=H.type.indexOf("touch")>=0;re.preventDefault()&&H.cancelable&&ae&&H.preventDefault()}),J||this._fire(X.pointerdown,{evt:H,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(H){const X=B(H.type),Z=I(H.type);if(!X)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&H.cancelable&&H.preventDefault(),this.setPointersPositions(H);var J=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!J)return;var ee={};let re=!1;var ae=this._getTargetShape(Z);this._changedPointerPositions.forEach(le=>{const ue=u.getCapturedShape(le.id)||this.getIntersection(le),Ae=le.id,ze={evt:H,pointerId:Ae};var oe=ae!==ue;if(oe&&ae&&(ae._fireAndBubble(X.pointerout,{...ze},ue),ae._fireAndBubble(X.pointerleave,{...ze},ue)),ue){if(ee[ue._id])return;ee[ue._id]=!0}ue&&ue.isListening()?(re=!0,oe&&(ue._fireAndBubble(X.pointerover,{...ze},ae),ue._fireAndBubble(X.pointerenter,{...ze},ae),this[Z+"targetShape"]=ue),ue._fireAndBubble(X.pointermove,{...ze})):ae&&(this._fire(X.pointerover,{evt:H,target:this,currentTarget:this,pointerId:Ae}),this[Z+"targetShape"]=null)}),re||this._fire(X.pointermove,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(H){const X=B(H.type),Z=I(H.type);if(!X)return;this.setPointersPositions(H);const J=this[Z+"ClickStartShape"],ee=this[Z+"ClickEndShape"];var re={};let ae=!1;this._changedPointerPositions.forEach(le=>{const ue=u.getCapturedShape(le.id)||this.getIntersection(le);if(ue){if(ue.releaseCapture(le.id),re[ue._id])return;re[ue._id]=!0}const Ae=le.id,ze={evt:H,pointerId:Ae};let oe=!1;i.Konva["_"+Z+"InDblClickWindow"]?(oe=!0,clearTimeout(this[Z+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+Z+"InDblClickWindow"]=!0,clearTimeout(this[Z+"DblTimeout"])),this[Z+"DblTimeout"]=setTimeout(function(){i.Konva["_"+Z+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),ue&&ue.isListening()?(ae=!0,this[Z+"ClickEndShape"]=ue,ue._fireAndBubble(X.pointerup,{...ze}),i.Konva["_"+Z+"ListenClick"]&&J&&J===ue&&(ue._fireAndBubble(X.pointerclick,{...ze}),oe&&ee&&ee===ue&&ue._fireAndBubble(X.pointerdblclick,{...ze}))):(this[Z+"ClickEndShape"]=null,i.Konva["_"+Z+"ListenClick"]&&this._fire(X.pointerclick,{evt:H,target:this,currentTarget:this,pointerId:Ae}),oe&&this._fire(X.pointerdblclick,{evt:H,target:this,currentTarget:this,pointerId:Ae}))}),ae||this._fire(X.pointerup,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+Z+"ListenClick"]=!1,H.cancelable&&Z!=="touch"&&H.preventDefault()}_contextmenu(H){this.setPointersPositions(H);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(R,{evt:H}):this._fire(R,{evt:H,target:this,currentTarget:this})}_wheel(H){this.setPointersPositions(H);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(z,{evt:H}):this._fire(z,{evt:H,target:this,currentTarget:this})}_pointercancel(H){this.setPointersPositions(H);const X=u.getCapturedShape(H.pointerId)||this.getIntersection(this.getPointerPosition());X&&X._fireAndBubble(O,u.createEvent(H)),u.releaseCapture(H.pointerId)}_lostpointercapture(H){u.releaseCapture(H.pointerId)}setPointersPositions(H){var X=this._getContentPosition(),Z=null,J=null;H=H||window.event,H.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(H.touches,ee=>{this._pointerPositions.push({id:ee.identifier,x:(ee.clientX-X.left)/X.scaleX,y:(ee.clientY-X.top)/X.scaleY})}),Array.prototype.forEach.call(H.changedTouches||H.touches,ee=>{this._changedPointerPositions.push({id:ee.identifier,x:(ee.clientX-X.left)/X.scaleX,y:(ee.clientY-X.top)/X.scaleY})})):(Z=(H.clientX-X.left)/X.scaleX,J=(H.clientY-X.top)/X.scaleY,this.pointerPos={x:Z,y:J},this._pointerPositions=[{x:Z,y:J,id:t.Util._getFirstPointerId(H)}],this._changedPointerPositions=[{x:Z,y:J,id:t.Util._getFirstPointerId(H)}])}_setPointerPosition(H){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(H)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var H=this.content.getBoundingClientRect();return{top:H.top,left:H.left,scaleX:H.width/this.content.clientWidth||1,scaleY:H.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 H=this.container();if(!H)throw"Stage has no container. A container is required.";H.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"),H.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(H){H.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(Y=>{Y.batchDraw()})})})(_9);var mf={},Ar={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=pt,r=ir,n=vt,i=Qt,a=We,o=pt,l=Un;var u="hasShadow",f="shadowRGBA",v="patternImage",S="linearGradient",_="radialGradient";let p;function E(){return p||(p=r.Util.createCanvasElement().getContext("2d"),p)}e.shapes={};function b(P){const x=this.attrs.fillRule;x?P.fill(x):P.fill()}function m(P){P.stroke()}function g(P){P.fill()}function h(P){P.stroke()}function d(){this._clearCache(u)}function y(){this._clearCache(f)}function O(){this._clearCache(v)}function k(){this._clearCache(S)}function C(){this._clearCache(_)}class w extends i.Node{constructor(x){super(x);let A;for(;A=r.Util.getRandomColor(),!(A&&!(A in e.shapes)););this.colorKey=A,e.shapes[A]=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(v,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var x=E();const A=x.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(A&&A.setTransform){const R=new r.Transform;R.translate(this.fillPatternX(),this.fillPatternY()),R.rotate(t.Konva.getAngle(this.fillPatternRotation())),R.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),R.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const M=R.getMatrix(),U=typeof DOMMatrix>"u"?{a:M[0],b:M[1],c:M[2],d:M[3],e:M[4],f:M[5]}:new DOMMatrix(M);A.setTransform(U)}return A}}_getLinearGradient(){return this._getCache(S,this.__getLinearGradient)}__getLinearGradient(){var x=this.fillLinearGradientColorStops();if(x){for(var A=E(),R=this.fillLinearGradientStartPoint(),M=this.fillLinearGradientEndPoint(),U=A.createLinearGradient(R.x,R.y,M.x,M.y),V=0;V<x.length;V+=2)U.addColorStop(x[V],x[V+1]);return U}}_getRadialGradient(){return this._getCache(_,this.__getRadialGradient)}__getRadialGradient(){var x=this.fillRadialGradientColorStops();if(x){for(var A=E(),R=this.fillRadialGradientStartPoint(),M=this.fillRadialGradientEndPoint(),U=A.createRadialGradient(R.x,R.y,this.fillRadialGradientStartRadius(),M.x,M.y,this.fillRadialGradientEndRadius()),V=0;V<x.length;V+=2)U.addColorStop(x[V],x[V+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var x=r.Util.colorToRGBA(this.shadowColor());if(x)return"rgba("+x.r+","+x.g+","+x.b+","+x.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const x=this.hitStrokeWidth();return x==="auto"?this.hasStroke():this.strokeEnabled()&&!!x}intersects(x){var A=this.getStage();if(!A)return!1;const R=A.bufferHitCanvas;return R.getContext().clear(),this.drawHit(R,void 0,!0),R.context.getImageData(Math.round(x.x),Math.round(x.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(x){var A;if(!((A=this.attrs.perfectDrawEnabled)!==null&&A!==void 0?A:!0))return!1;const M=x||this.hasFill(),U=this.hasStroke(),V=this.getAbsoluteOpacity()!==1;if(M&&U&&V)return!0;const q=this.hasShadow(),z=this.shadowForStrokeEnabled();return!!(M&&U&&q&&z)}setStrokeHitEnabled(x){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),x?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var x=this.size();return{x:this._centroid?-x.width/2:0,y:this._centroid?-x.height/2:0,width:x.width,height:x.height}}getClientRect(x={}){const A=x.skipTransform,R=x.relativeTo,M=this.getSelfRect(),V=!x.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,q=M.width+V,z=M.height+V,F=!x.skipShadow&&this.hasShadow(),G=F?this.shadowOffsetX():0,L=F?this.shadowOffsetY():0,I=q+Math.abs(G),B=z+Math.abs(L),D=F&&this.shadowBlur()||0,$=I+D*2,K=B+D*2,Y={width:$,height:K,x:-(V/2+D)+Math.min(G,0)+M.x,y:-(V/2+D)+Math.min(L,0)+M.y};return A?Y:this._transformedRect(Y,R)}drawScene(x,A,R){var M=this.getLayer(),U=x||M.getCanvas(),V=U.getContext(),q=this._getCanvasCache(),z=this.getSceneFunc(),F=this.hasShadow(),G,L,I=U.isCache,B=A===this;if(!this.isVisible()&&!B)return this;if(q){V.save();var D=this.getAbsoluteTransform(A).getMatrix();return V.transform(D[0],D[1],D[2],D[3],D[4],D[5]),this._drawCachedSceneCanvas(V),V.restore(),this}if(!z)return this;if(V.save(),this._useBufferCanvas()&&!I){G=this.getStage();const Y=R||G.bufferCanvas;L=Y.getContext(),L.clear(),L.save(),L._applyLineJoin(this);var $=this.getAbsoluteTransform(A).getMatrix();L.transform($[0],$[1],$[2],$[3],$[4],$[5]),z.call(this,L,this),L.restore();var K=Y.pixelRatio;F&&V._applyShadow(this),V._applyOpacity(this),V._applyGlobalCompositeOperation(this),V.drawImage(Y._canvas,0,0,Y.width/K,Y.height/K)}else{if(V._applyLineJoin(this),!B){var $=this.getAbsoluteTransform(A).getMatrix();V.transform($[0],$[1],$[2],$[3],$[4],$[5]),V._applyOpacity(this),V._applyGlobalCompositeOperation(this)}F&&V._applyShadow(this),z.call(this,V,this)}return V.restore(),this}drawHit(x,A,R=!1){if(!this.shouldDrawHit(A,R))return this;var M=this.getLayer(),U=x||M.hitCanvas,V=U&&U.getContext(),q=this.hitFunc()||this.sceneFunc(),z=this._getCanvasCache(),F=z&&z.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()"),F){V.save();var G=this.getAbsoluteTransform(A).getMatrix();return V.transform(G[0],G[1],G[2],G[3],G[4],G[5]),this._drawCachedHitCanvas(V),V.restore(),this}if(!q)return this;if(V.save(),V._applyLineJoin(this),!(this===A)){var I=this.getAbsoluteTransform(A).getMatrix();V.transform(I[0],I[1],I[2],I[3],I[4],I[5])}return q.call(this,V,this),V.restore(),this}drawHitFromCache(x=0){var A=this._getCanvasCache(),R=this._getCachedSceneCanvas(),M=A.hit,U=M.getContext(),V=M.getWidth(),q=M.getHeight(),z,F,G,L,I,B;U.clear(),U.drawImage(R._canvas,0,0,V,q);try{for(z=U.getImageData(0,0,V,q),F=z.data,G=F.length,L=r.Util._hexToRgb(this.colorKey),I=0;I<G;I+=4)B=F[I+3],B>x?(F[I]=L.r,F[I+1]=L.g,F[I+2]=L.b,F[I+3]=255):F[I+3]=0;U.putImageData(z,0,0)}catch(D){r.Util.error("Unable to draw hit graph from cached scene canvas. "+D.message)}return this}hasPointerCapture(x){return l.hasPointerCapture(x,this)}setPointerCapture(x){l.setPointerCapture(x,this)}releaseCapture(x){l.releaseCapture(x,this)}}e.Shape=w,w.prototype._fillFunc=b,w.prototype._strokeFunc=m,w.prototype._fillFuncHit=g,w.prototype._strokeFuncHit=h,w.prototype._centroid=!1,w.prototype.nodeType="Shape",(0,o._registerNode)(w),w.prototype.eventListeners={},w.prototype.on.call(w.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),w.prototype.on.call(w.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",y),w.prototype.on.call(w.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",O),w.prototype.on.call(w.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",k),w.prototype.on.call(w.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),n.Factory.addGetterSetter(w,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(w,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(w,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(w,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(w,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(w,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(w,"lineJoin"),n.Factory.addGetterSetter(w,"lineCap"),n.Factory.addGetterSetter(w,"sceneFunc"),n.Factory.addGetterSetter(w,"hitFunc"),n.Factory.addGetterSetter(w,"dash"),n.Factory.addGetterSetter(w,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(w,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(w,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(w,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternImage"),n.Factory.addGetterSetter(w,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(w,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(w,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(w,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(w,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(w,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(w,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(w,"fillEnabled",!0),n.Factory.addGetterSetter(w,"strokeEnabled",!0),n.Factory.addGetterSetter(w,"shadowEnabled",!0),n.Factory.addGetterSetter(w,"dashEnabled",!0),n.Factory.addGetterSetter(w,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(w,"fillPriority","color"),n.Factory.addComponentsGetterSetter(w,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(w,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(w,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(w,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(w,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(w,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(w,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(w,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(w,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(w,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(w,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(w,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(w,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(w,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(w,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(w,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(w,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(w,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(w,"fillPatternRotation",0),n.Factory.addGetterSetter(w,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(w,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Ar);Object.defineProperty(mf,"__esModule",{value:!0});mf.Layer=void 0;const Pa=ir,ug=Dl,bs=Qt,t2=vt,W5=ji,iA=We,aA=Ar,oA=pt;var lA="#",sA="beforeDraw",uA="draw",E9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],cA=E9.length;let _u=class extends ug.Container{constructor(t){super(t),this.canvas=new W5.SceneCanvas,this.hitCanvas=new W5.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(){bs.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=bs.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(bs.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(bs.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 bs.Node.prototype.remove.call(this),t&&t.parentNode&&Pa.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"&&Pa.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(),bs.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(){Pa.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Pa.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Pa.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<cA;i++){const a=E9[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=Pa.Util._rgbToHex(n[0],n[1],n[2]),o=aA.shapes[lA+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(sA,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),ug.Container.prototype.drawScene.call(this,i,r),this._fire(uA,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),ug.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){Pa.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Pa.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 Pa.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};mf.Layer=_u;_u.prototype.nodeType="Layer";(0,oA._registerNode)(_u);t2.Factory.addGetterSetter(_u,"imageSmoothingEnabled",!0);t2.Factory.addGetterSetter(_u,"clearBeforeDraw",!0);t2.Factory.addGetterSetter(_u,"hitGraphEnabled",!0,(0,iA.getBooleanValidator)());var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.FastLayer=void 0;const fA=ir,dA=mf,hA=pt;let r2=class extends dA.Layer{constructor(t){super(t),this.listening(!1),fA.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};xp.FastLayer=r2;r2.prototype.nodeType="FastLayer";(0,hA._registerNode)(r2);var wu={};Object.defineProperty(wu,"__esModule",{value:!0});wu.Group=void 0;const pA=ir,gA=Dl,vA=pt;let n2=class extends gA.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&pA.Util.throw("You may only add groups and shapes to groups.")}};wu.Group=n2;n2.prototype.nodeType="Group";(0,vA._registerNode)(n2);var Su={};Object.defineProperty(Su,"__esModule",{value:!0});Su.Animation=void 0;const cg=pt,Y5=ir,fg=function(){return cg.glob.performance&&cg.glob.performance.now?function(){return cg.glob.performance.now()}:function(){return new Date().getTime()}}();class na{constructor(t,r){this.id=na.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:fg(),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=na.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=fg(),na._addAnimation(this),this}stop(){return na._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(fg());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 v=a[f];v._id!==void 0&&(t[v._id]=v)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=na;t.animations.length?(t._runFrames(),Y5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Y5.Util.requestAnimFrame(this._animationLoop))}}Su.Animation=na;na.animations=[];na.animIdCounter=0;na.animRunning=!1;var O9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=ir,r=Su,n=Qt,i=pt;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,v=["fill","stroke","shadowColor"];class S{constructor(E,b,m,g,h,d,y){this.prop=E,this.propFunc=b,this.begin=g,this._pos=g,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=m,this._change=h-this.begin,this.pause()}fire(E){var b=this[E];b&&b()}setTime(E){E>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():E<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=E,this.update())}getTime(){return this._time}setPosition(E){this.prevPos=this._pos,this.propFunc(E),this._pos=E}getPosition(E){return E===void 0&&(E=this._time),this.func(E,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(E){this.pause(),this._time=E,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 E=this.getTimer()-this._startTime;this.state===l?this.setTime(E):this.state===u&&this.setTime(this.duration-E)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class _{constructor(E){var b=this,m=E.node,g=m._id,h,d=E.easing||e.Easings.Linear,y=!!E.yoyo,O;typeof E.duration>"u"?h=.3:E.duration===0?h=.001:h=E.duration,this.node=m,this._id=f++;var k=m.getLayer()||(m instanceof i.Konva.Stage?m.getLayers():null);k||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()},k),this.tween=new S(O,function(C){b._tweenFunc(C)},d,0,1,h*1e3,y),this._addListeners(),_.attrs[g]||(_.attrs[g]={}),_.attrs[g][this._id]||(_.attrs[g][this._id]={}),_.tweens[g]||(_.tweens[g]={});for(O in E)a[O]===void 0&&this._addAttr(O,E[O]);this.reset(),this.onFinish=E.onFinish,this.onReset=E.onReset,this.onUpdate=E.onUpdate}_addAttr(E,b){var m=this.node,g=m._id,h,d,y,O,k,C,w,P;if(y=_.tweens[g][E],y&&delete _.attrs[g][y][E],h=m.getAttr(E),t.Util._isArray(b))if(d=[],k=Math.max(b.length,h.length),E==="points"&&b.length!==h.length&&(b.length>h.length?(w=h,h=t.Util._prepareArrayForTween(h,b,m.closed())):(C=b,b=t.Util._prepareArrayForTween(b,h,m.closed()))),E.indexOf("fill")===0)for(O=0;O<k;O++)if(O%2===0)d.push(b[O]-h[O]);else{var x=t.Util.colorToRGBA(h[O]);P=t.Util.colorToRGBA(b[O]),h[O]=x,d.push({r:P.r-x.r,g:P.g-x.g,b:P.b-x.b,a:P.a-x.a})}else for(O=0;O<k;O++)d.push(b[O]-h[O]);else v.indexOf(E)!==-1?(h=t.Util.colorToRGBA(h),P=t.Util.colorToRGBA(b),d={r:P.r-h.r,g:P.g-h.g,b:P.b-h.b,a:P.a-h.a}):d=b-h;_.attrs[g][this._id][E]={start:h,diff:d,end:b,trueEnd:C,trueStart:w},_.tweens[g][E]=this._id}_tweenFunc(E){var b=this.node,m=_.attrs[b._id][this._id],g,h,d,y,O,k,C,w;for(g in m){if(h=m[g],d=h.start,y=h.diff,w=h.end,t.Util._isArray(d))if(O=[],C=Math.max(d.length,w.length),g.indexOf("fill")===0)for(k=0;k<C;k++)k%2===0?O.push((d[k]||0)+y[k]*E):O.push("rgba("+Math.round(d[k].r+y[k].r*E)+","+Math.round(d[k].g+y[k].g*E)+","+Math.round(d[k].b+y[k].b*E)+","+(d[k].a+y[k].a*E)+")");else for(k=0;k<C;k++)O.push((d[k]||0)+y[k]*E);else v.indexOf(g)!==-1?O="rgba("+Math.round(d.r+y.r*E)+","+Math.round(d.g+y.g*E)+","+Math.round(d.b+y.b*E)+","+(d.a+y.a*E)+")":O=d+y*E;b.setAttr(g,O)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var E=this.node,b=_.attrs[E._id][this._id];b.points&&b.points.trueEnd&&E.setAttr("points",b.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var E=this.node,b=_.attrs[E._id][this._id];b.points&&b.points.trueStart&&E.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(E){return this.tween.seek(E*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var E=this.node._id,b=this._id,m=_.tweens[E],g;this.pause();for(g in m)delete _.tweens[E][g];delete _.attrs[E][b]}}e.Tween=_,_.attrs={},_.tweens={},n.Node.prototype.to=function(p){var E=p.onFinish;p.node=this,p.onFinish=function(){this.destroy(),E&&E()};var b=new _(p);b.play()},e.Easings={BackEaseIn(p,E,b,m){var g=1.70158;return b*(p/=m)*p*((g+1)*p-g)+E},BackEaseOut(p,E,b,m){var g=1.70158;return b*((p=p/m-1)*p*((g+1)*p+g)+1)+E},BackEaseInOut(p,E,b,m){var g=1.70158;return(p/=m/2)<1?b/2*(p*p*(((g*=1.525)+1)*p-g))+E:b/2*((p-=2)*p*(((g*=1.525)+1)*p+g)+2)+E},ElasticEaseIn(p,E,b,m,g,h){var d=0;return p===0?E:(p/=m)===1?E+b:(h||(h=m*.3),!g||g<Math.abs(b)?(g=b,d=h/4):d=h/(2*Math.PI)*Math.asin(b/g),-(g*Math.pow(2,10*(p-=1))*Math.sin((p*m-d)*(2*Math.PI)/h))+E)},ElasticEaseOut(p,E,b,m,g,h){var d=0;return p===0?E:(p/=m)===1?E+b:(h||(h=m*.3),!g||g<Math.abs(b)?(g=b,d=h/4):d=h/(2*Math.PI)*Math.asin(b/g),g*Math.pow(2,-10*p)*Math.sin((p*m-d)*(2*Math.PI)/h)+b+E)},ElasticEaseInOut(p,E,b,m,g,h){var d=0;return p===0?E:(p/=m/2)===2?E+b:(h||(h=m*(.3*1.5)),!g||g<Math.abs(b)?(g=b,d=h/4):d=h/(2*Math.PI)*Math.asin(b/g),p<1?-.5*(g*Math.pow(2,10*(p-=1))*Math.sin((p*m-d)*(2*Math.PI)/h))+E:g*Math.pow(2,-10*(p-=1))*Math.sin((p*m-d)*(2*Math.PI)/h)*.5+b+E)},BounceEaseOut(p,E,b,m){return(p/=m)<1/2.75?b*(7.5625*p*p)+E:p<2/2.75?b*(7.5625*(p-=1.5/2.75)*p+.75)+E:p<2.5/2.75?b*(7.5625*(p-=2.25/2.75)*p+.9375)+E:b*(7.5625*(p-=2.625/2.75)*p+.984375)+E},BounceEaseIn(p,E,b,m){return b-e.Easings.BounceEaseOut(m-p,0,b,m)+E},BounceEaseInOut(p,E,b,m){return p<m/2?e.Easings.BounceEaseIn(p*2,0,b,m)*.5+E:e.Easings.BounceEaseOut(p*2-m,0,b,m)*.5+b*.5+E},EaseIn(p,E,b,m){return b*(p/=m)*p+E},EaseOut(p,E,b,m){return-b*(p/=m)*(p-2)+E},EaseInOut(p,E,b,m){return(p/=m/2)<1?b/2*p*p+E:-b/2*(--p*(p-2)-1)+E},StrongEaseIn(p,E,b,m){return b*(p/=m)*p*p*p*p+E},StrongEaseOut(p,E,b,m){return b*((p=p/m-1)*p*p*p*p+1)+E},StrongEaseInOut(p,E,b,m){return(p/=m/2)<1?b/2*p*p*p*p*p+E:b/2*((p-=2)*p*p*p*p+2)+E},Linear(p,E,b,m){return b*p/m+E}}})(O9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=pt,r=ir,n=Qt,i=Dl,a=_9,o=mf,l=xp,u=wu,f=Op,v=Ar,S=Su,_=O9,p=Na,E=ji;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:v.Shape,shapes:v.shapes,Animation:S.Animation,Tween:_.Tween,Easings:_.Easings,Context:p.Context,Canvas:E.Canvas}),e.default=e.Konva})(zh);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Arc=void 0;const Tp=vt,mA=Ar,K5=pt,Ap=We,yA=pt;let Va=class extends mA.Shape{_sceneFunc(t){var r=K5.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=K5.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),v=o*r,S=l*(l>0?t:r),_=u*(u>0?r:t);return{x:f,y:n?-1*_:S,width:v-f,height:_-S}}};Cp.Arc=Va;Va.prototype._centroid=!0;Va.prototype.className="Arc";Va.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,yA._registerNode)(Va);Tp.Factory.addGetterSetter(Va,"innerRadius",0,(0,Ap.getNumberValidator)());Tp.Factory.addGetterSetter(Va,"outerRadius",0,(0,Ap.getNumberValidator)());Tp.Factory.addGetterSetter(Va,"angle",0,(0,Ap.getNumberValidator)());Tp.Factory.addGetterSetter(Va,"clockwise",!1,(0,Ap.getBooleanValidator)());var kp={},yf={};Object.defineProperty(yf,"__esModule",{value:!0});yf.Line=void 0;const Rp=vt,bA=Ar,P9=We,_A=pt;function xm(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),v=o*u/(l+u),S=r-f*(i-e),_=n-f*(a-t),p=r+v*(i-e),E=n+v*(a-t);return[S,_,p,E]}function X5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=xm(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 Ho=class extends bA.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():X5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=xm(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=xm(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=X5(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}}};yf.Line=Ho;Ho.prototype.className="Line";Ho.prototype._attrsAffectingSize=["points","bezier","tension"];(0,_A._registerNode)(Ho);Rp.Factory.addGetterSetter(Ho,"closed",!1);Rp.Factory.addGetterSetter(Ho,"bezier",!1);Rp.Factory.addGetterSetter(Ho,"tension",0,(0,P9.getNumberValidator)());Rp.Factory.addGetterSetter(Ho,"points",[],(0,P9.getNumberArrayValidator)());var Eu={},x9={};(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,v,S;f=u/2,v=0;for(let p=0;p<20;p++)S=f*e.tValues[20][p]+f,v+=e.cValues[20][p]*n(o,l,S);return f*v};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],v=l[0]-2*l[1]+l[2],S=2*o[1]-2*o[0],_=2*l[1]-2*l[0],p=4*(f*f+v*v),E=4*(f*S+v*_),b=S*S+_*_;if(p===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const m=E/(2*p),g=b/p,h=u+m,d=g-m*m,y=h*h+d>0?Math.sqrt(h*h+d):0,O=m*m+d>0?Math.sqrt(m*m+d):0,k=m+Math.sqrt(m*m+d)!==0?d*Math.log(Math.abs((h+y)/(m+O))):0;return Math.sqrt(p)/2*(h*y-m*O+k)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),v=i(1,u,l),S=f*f+v*v;return Math.sqrt(S)}const i=(o,l,u)=>{const f=u.length-1;let v,S;if(f===0)return 0;if(o===0){S=0;for(let _=0;_<=f;_++)S+=e.binomialCoefficients[f][_]*Math.pow(1-l,f-_)*Math.pow(l,_)*u[_];return S}else{v=new Array(f);for(let _=0;_<f;_++)v[_]=f*(u[_+1]-u[_]);return i(o-1,l,v)}},a=(o,l,u)=>{let f=1,v=o/l,S=(o-u(v))/l,_=0;for(;f>.001;){const p=u(v+S),E=Math.abs(o-p)/l;if(E<f)f=E,v+=S;else{const b=u(v-S),m=Math.abs(o-b)/l;m<f?(f=m,v-=S):S/=2}if(_++,_>500)break}return v};e.t2length=a})(x9);Object.defineProperty(Eu,"__esModule",{value:!0});Eu.Path=void 0;const wA=vt,SA=Ar,EA=pt,_s=x9;let bf=class Sn extends SA.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],v=o[3],S=o[4],_=o[5],p=o[6],E=o[7],b=f>v?f:v,m=f>v?1:f/v,g=f>v?v/f:1;t.translate(l,u),t.rotate(p),t.scale(m,g),t.arc(0,0,b,S,S+_,1-E),t.scale(1/m,1/g),t.rotate(-p),t.translate(-l,-u);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(f){if(f.command==="A"){var v=f.points[4],S=f.points[5],_=f.points[4]+S,p=Math.PI/180;if(Math.abs(v-_)<p&&(p=Math.abs(v-_)),S<0)for(let E=v-p;E>_;E-=p){const b=Sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(b.x,b.y)}else for(let E=v+p;E<_;E+=p){const b=Sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(b.x,b.y)}}else if(f.command==="C")for(let E=0;E<=1;E+=.01){const b=Sn.getPointOnCubicBezier(E,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,_s.t2length)(t,Sn.getPathLength(r),b=>(0,_s.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,_s.t2length)(t,Sn.getPathLength(r),b=>(0,_s.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],v=l[2],S=l[3],_=l[4],p=l[5],E=l[6];return _+=p*t/o.pathLength,Sn.getPointOnEllipticalArc(u,f,v,S,_,E)}return null}static getPointOnLine(t,r,n,i,a,o,l){o===void 0&&(o=r),l===void 0&&(l=n);var u=(a-n)/(i-r+1e-8),f=Math.sqrt(t*t/(1+u*u));i<r&&(f*=-1);var v=u*f,S;if(i===r)S={x:o,y:l+v};else if((l-n)/(o-r+1e-8)===u)S={x:o+f,y:l+v};else{var _,p,E=this.getLineLength(r,n,i,a),b=(o-r)*(i-r)+(l-n)*(a-n);b=b/(E*E),_=r+b*(i-r),p=n+b*(a-n);var m=this.getLineLength(o,l,_,p),g=Math.sqrt(t*t-m*m);f=Math.sqrt(g*g/(1+u*u)),i<r&&(f*=-1),v=u*f,S={x:_+f,y:p+v}}return S}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function v(m){return m*m*m}function S(m){return 3*m*m*(1-m)}function _(m){return 3*m*(1-m)*(1-m)}function p(m){return(1-m)*(1-m)*(1-m)}var E=u*v(t)+o*S(t)+i*_(t)+r*p(t),b=f*v(t)+l*S(t)+a*_(t)+n*p(t);return{x:E,y:b}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(p){return p*p}function f(p){return 2*p*(1-p)}function v(p){return(1-p)*(1-p)}var S=o*u(t)+i*f(t)+r*v(t),_=l*u(t)+a*f(t)+n*v(t);return{x:S,y:_}}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,v=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,S;for(i=1;i<a.length;i++){var _=a[i],p=_.charAt(0);for(_=_.slice(1),l.length=0;S=v.exec(_);)l.push(S[0]);for(var E=[],b=0,m=l.length;b<m;b++){if(l[b]==="00"){E.push(0,0);continue}var g=parseFloat(l[b]);isNaN(g)?E.push(0):E.push(g)}for(;E.length>0&&!isNaN(E[0]);){var h="",d=[],y=u,O=f,k,C,w,P,x,A,R,M,U,V;switch(p){case"l":u+=E.shift(),f+=E.shift(),h="L",d.push(u,f);break;case"L":u=E.shift(),f=E.shift(),d.push(u,f);break;case"m":var q=E.shift(),z=E.shift();if(u+=q,f+=z,h="M",o.length>2&&o[o.length-1].command==="z"){for(var F=o.length-2;F>=0;F--)if(o[F].command==="M"){u=o[F].points[0]+q,f=o[F].points[1]+z;break}}d.push(u,f),p="l";break;case"M":u=E.shift(),f=E.shift(),h="M",d.push(u,f),p="L";break;case"h":u+=E.shift(),h="L",d.push(u,f);break;case"H":u=E.shift(),h="L",d.push(u,f);break;case"v":f+=E.shift(),h="L",d.push(u,f);break;case"V":f=E.shift(),h="L",d.push(u,f);break;case"C":d.push(E.shift(),E.shift(),E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"c":d.push(u+E.shift(),f+E.shift(),u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),h="C",d.push(u,f);break;case"S":C=u,w=f,k=o[o.length-1],k.command==="C"&&(C=u+(u-k.points[2]),w=f+(f-k.points[3])),d.push(C,w,E.shift(),E.shift()),u=E.shift(),f=E.shift(),h="C",d.push(u,f);break;case"s":C=u,w=f,k=o[o.length-1],k.command==="C"&&(C=u+(u-k.points[2]),w=f+(f-k.points[3])),d.push(C,w,u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),h="C",d.push(u,f);break;case"Q":d.push(E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"q":d.push(u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),h="Q",d.push(u,f);break;case"T":C=u,w=f,k=o[o.length-1],k.command==="Q"&&(C=u+(u-k.points[0]),w=f+(f-k.points[1])),u=E.shift(),f=E.shift(),h="Q",d.push(C,w,u,f);break;case"t":C=u,w=f,k=o[o.length-1],k.command==="Q"&&(C=u+(u-k.points[0]),w=f+(f-k.points[1])),u+=E.shift(),f+=E.shift(),h="Q",d.push(C,w,u,f);break;case"A":P=E.shift(),x=E.shift(),A=E.shift(),R=E.shift(),M=E.shift(),U=u,V=f,u=E.shift(),f=E.shift(),h="A",d=this.convertEndpointToCenterParameterization(U,V,u,f,R,M,P,x,A);break;case"a":P=E.shift(),x=E.shift(),A=E.shift(),R=E.shift(),M=E.shift(),U=u,V=f,u+=E.shift(),f+=E.shift(),h="A",d=this.convertEndpointToCenterParameterization(U,V,u,f,R,M,P,x,A);break}o.push({command:h||p,points:d,start:{x:y,y:O},pathLength:this.calcLength(y,O,h||p,d)})}(p==="z"||p==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,r,n,i){var a,o,l,u,f=Sn;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,_s.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,_s.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var v=i[4],S=i[5],_=i[4]+S,p=Math.PI/180;if(Math.abs(v-_)<p&&(p=Math.abs(v-_)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),S<0)for(u=v-p;u>_;u-=p)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=v+p;u<_;u+=p)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],_,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 v=f*(Math.PI/180),S=Math.cos(v)*(t-n)/2+Math.sin(v)*(r-i)/2,_=-1*Math.sin(v)*(t-n)/2+Math.cos(v)*(r-i)/2,p=S*S/(l*l)+_*_/(u*u);p>1&&(l*=Math.sqrt(p),u*=Math.sqrt(p));var E=Math.sqrt((l*l*(u*u)-l*l*(_*_)-u*u*(S*S))/(l*l*(_*_)+u*u*(S*S)));a===o&&(E*=-1),isNaN(E)&&(E=0);var b=E*l*_/u,m=E*-u*S/l,g=(t+n)/2+Math.cos(v)*b-Math.sin(v)*m,h=(r+i)/2+Math.sin(v)*b+Math.cos(v)*m,d=function(x){return Math.sqrt(x[0]*x[0]+x[1]*x[1])},y=function(x,A){return(x[0]*A[0]+x[1]*A[1])/(d(x)*d(A))},O=function(x,A){return(x[0]*A[1]<x[1]*A[0]?-1:1)*Math.acos(y(x,A))},k=O([1,0],[(S-b)/l,(_-m)/u]),C=[(S-b)/l,(_-m)/u],w=[(-1*S-b)/l,(-1*_-m)/u],P=O(C,w);return y(C,w)<=-1&&(P=Math.PI),y(C,w)>=1&&(P=0),o===0&&P>0&&(P=P-2*Math.PI),o===1&&P<0&&(P=P+2*Math.PI),[g,h,l,u,k,P,v,o]}};Eu.Path=bf;bf.prototype.className="Path";bf.prototype._attrsAffectingSize=["data"];(0,EA._registerNode)(bf);wA.Factory.addGetterSetter(bf,"data");Object.defineProperty(kp,"__esModule",{value:!0});kp.Arrow=void 0;const Lp=vt,OA=yf,C9=We,PA=pt,Z5=Eu;let jl=class extends OA.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 _=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],p=Z5.Path.calcLength(i[i.length-4],i[i.length-3],"C",_),E=Z5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/p),_[0],_[1],_[2],_[3],_[4],_[5]);u=n[l-2]-E.x,f=n[l-1]-E.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var v=(Math.atan2(f,u)+r)%r,S=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(v),t.moveTo(0,0),t.lineTo(-o,S/2),t.lineTo(-o,-S/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,S/2),t.lineTo(-o,-S/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}}};kp.Arrow=jl;jl.prototype.className="Arrow";(0,PA._registerNode)(jl);Lp.Factory.addGetterSetter(jl,"pointerLength",10,(0,C9.getNumberValidator)());Lp.Factory.addGetterSetter(jl,"pointerWidth",10,(0,C9.getNumberValidator)());Lp.Factory.addGetterSetter(jl,"pointerAtBeginning",!1);Lp.Factory.addGetterSetter(jl,"pointerAtEnding",!0);var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Circle=void 0;const xA=vt,CA=Ar,TA=We,AA=pt;let Ou=class extends CA.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)}};Mp.Circle=Ou;Ou.prototype._centroid=!0;Ou.prototype.className="Circle";Ou.prototype._attrsAffectingSize=["radius"];(0,AA._registerNode)(Ou);xA.Factory.addGetterSetter(Ou,"radius",0,(0,TA.getNumberValidator)());var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Ellipse=void 0;const i2=vt,kA=Ar,T9=We,RA=pt;let Go=class extends kA.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)}};Np.Ellipse=Go;Go.prototype.className="Ellipse";Go.prototype._centroid=!0;Go.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,RA._registerNode)(Go);i2.Factory.addComponentsGetterSetter(Go,"radius",["x","y"]);i2.Factory.addGetterSetter(Go,"radiusX",0,(0,T9.getNumberValidator)());i2.Factory.addGetterSetter(Go,"radiusY",0,(0,T9.getNumberValidator)());var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Image=void 0;const dg=ir,zl=vt,LA=Ar,MA=pt,_f=We;let pa=class A9 extends LA.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?dg.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?dg.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=dg.Util.createImageElement();i.onload=function(){var a=new A9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};Ip.Image=pa;pa.prototype.className="Image";(0,MA._registerNode)(pa);zl.Factory.addGetterSetter(pa,"cornerRadius",0,(0,_f.getNumberOrArrayOfNumbersValidator)(4));zl.Factory.addGetterSetter(pa,"image");zl.Factory.addComponentsGetterSetter(pa,"crop",["x","y","width","height"]);zl.Factory.addGetterSetter(pa,"cropX",0,(0,_f.getNumberValidator)());zl.Factory.addGetterSetter(pa,"cropY",0,(0,_f.getNumberValidator)());zl.Factory.addGetterSetter(pa,"cropWidth",0,(0,_f.getNumberValidator)());zl.Factory.addGetterSetter(pa,"cropHeight",0,(0,_f.getNumberValidator)());var au={};Object.defineProperty(au,"__esModule",{value:!0});au.Tag=au.Label=void 0;const Dp=vt,NA=Ar,IA=wu,a2=We,k9=pt;var R9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],DA="Change.konva",FA="none",Cm="up",Tm="right",Am="down",km="left",jA=R9.length;let o2=class extends IA.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<jA;n++)t.on(R9[n]+DA,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 Cm:l=n/2,u=-1*f;break;case Tm:l=n+o,u=i/2;break;case Am:l=n/2,u=i+f;break;case km: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})}}};au.Label=o2;o2.prototype.className="Label";(0,k9._registerNode)(o2);let Bl=class extends NA.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,v=0,S=0;typeof l=="number"?u=f=v=S=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),S=Math.min(l[2]||0,r/2,n/2),v=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===Cm&&(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===Tm&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-S),t.arc(r-S,n-S,S,0,Math.PI/2,!1),i===Am&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(v,n),t.arc(v,n-v,v,Math.PI/2,Math.PI,!1),i===km&&(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===Cm?(r-=i,l+=i):a===Am?l+=i:a===km?(t-=n*1.5,o+=n):a===Tm&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};au.Tag=Bl;Bl.prototype.className="Tag";(0,k9._registerNode)(Bl);Dp.Factory.addGetterSetter(Bl,"pointerDirection",FA);Dp.Factory.addGetterSetter(Bl,"pointerWidth",0,(0,a2.getNumberValidator)());Dp.Factory.addGetterSetter(Bl,"pointerHeight",0,(0,a2.getNumberValidator)());Dp.Factory.addGetterSetter(Bl,"cornerRadius",0,(0,a2.getNumberOrArrayOfNumbersValidator)(4));var wf={};Object.defineProperty(wf,"__esModule",{value:!0});wf.Rect=void 0;const zA=vt,BA=Ar,UA=pt,HA=ir,GA=We;let Fp=class extends BA.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?HA.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};wf.Rect=Fp;Fp.prototype.className="Rect";(0,UA._registerNode)(Fp);zA.Factory.addGetterSetter(Fp,"cornerRadius",0,(0,GA.getNumberOrArrayOfNumbersValidator)(4));var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.RegularPolygon=void 0;const L9=vt,$A=Ar,M9=We,VA=pt;let Ul=class extends $A.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)}};jp.RegularPolygon=Ul;Ul.prototype.className="RegularPolygon";Ul.prototype._centroid=!0;Ul.prototype._attrsAffectingSize=["radius"];(0,VA._registerNode)(Ul);L9.Factory.addGetterSetter(Ul,"radius",0,(0,M9.getNumberValidator)());L9.Factory.addGetterSetter(Ul,"sides",0,(0,M9.getNumberValidator)());var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.Ring=void 0;const N9=vt,qA=Ar,I9=We,WA=pt;var Q5=Math.PI*2;let Hl=class extends qA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,Q5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),Q5,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)}};zp.Ring=Hl;Hl.prototype.className="Ring";Hl.prototype._centroid=!0;Hl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,WA._registerNode)(Hl);N9.Factory.addGetterSetter(Hl,"innerRadius",0,(0,I9.getNumberValidator)());N9.Factory.addGetterSetter(Hl,"outerRadius",0,(0,I9.getNumberValidator)());var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.Sprite=void 0;const Gl=vt,YA=Ar,KA=Su,D9=We,XA=pt;let ga=class extends YA.Shape{constructor(t){super(t),this._updated=!0,this.anim=new KA.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],v=a[i+3],S=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,v),t.closePath(),t.fillStrokeShape(this)),S)if(o){var _=o[r],p=n*2;t.drawImage(S,l,u,f,v,_[p+0],_[p+1],f,v)}else t.drawImage(S,l,u,f,v,0,0,f,v)}_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],v=n*2;t.rect(f[v+0],f[v+1],l,u)}else t.rect(0,0,l,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}};Bp.Sprite=ga;ga.prototype.className="Sprite";(0,XA._registerNode)(ga);Gl.Factory.addGetterSetter(ga,"animation");Gl.Factory.addGetterSetter(ga,"animations");Gl.Factory.addGetterSetter(ga,"frameOffsets");Gl.Factory.addGetterSetter(ga,"image");Gl.Factory.addGetterSetter(ga,"frameIndex",0,(0,D9.getNumberValidator)());Gl.Factory.addGetterSetter(ga,"frameRate",17,(0,D9.getNumberValidator)());Gl.Factory.backCompat(ga,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.Star=void 0;const l2=vt,ZA=Ar,s2=We,QA=pt;let $o=class extends ZA.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)}};Up.Star=$o;$o.prototype.className="Star";$o.prototype._centroid=!0;$o.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,QA._registerNode)($o);l2.Factory.addGetterSetter($o,"numPoints",5,(0,s2.getNumberValidator)());l2.Factory.addGetterSetter($o,"innerRadius",0,(0,s2.getNumberValidator)());l2.Factory.addGetterSetter($o,"outerRadius",0,(0,s2.getNumberValidator)());var kl={};Object.defineProperty(kl,"__esModule",{value:!0});kl.Text=kl.stringToArray=void 0;const Rm=ir,on=vt,JA=Ar,hg=pt,Vo=We,ek=pt;function F9(e){return Array.from(e)}kl.stringToArray=F9;var ws="auto",tk="center",j9="inherit",ac="justify",rk="Change.konva",nk="2d",J5="-",z9="left",ik="text",ak="Text",ok="top",lk="bottom",e4="middle",B9="normal",sk="px ",jd=" ",uk="right",t4="rtl",ck="word",fk="char",r4="none",pg="…",U9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],dk=U9.length;function hk(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 zd;function gg(){return zd||(zd=Rm.Util.createCanvasElement().getContext(nk),zd)}function pk(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function gk(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function vk(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let cr=class extends JA.Shape{constructor(t){super(vk(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<dk;r++)this.on(U9[r]+rk,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,v=this.align(),S=this.getWidth(),_=this.letterSpacing(),p=this.fill(),E=this.textDecoration(),b=E.indexOf("underline")!==-1,m=E.indexOf("line-through")!==-1,g;u=u===j9?t.direction:u;var h=o/2,d=e4;if(hg.Konva._fixTextRendering){var y=this.measureSize("M");d="alphabetic",h=(y.fontBoundingBoxAscent-y.fontBoundingBoxDescent)/2+o/2}var O=0,k=0;for(u===t4&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",d),t.setAttr("textAlign",z9),l===e4?f=(this.getHeight()-n*o-i*2)/2:l===lk&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),g=0;g<n;g++){var O=0,k=0,C=r[g],w=C.text,P=C.width,x=C.lastInParagraph,A,R,M;if(t.save(),v===uk?O+=S-P-i*2:v===tk&&(O+=(S-P-i*2)/2),b){t.save(),t.beginPath();let G=hg.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const L=O,I=h+k+G;t.moveTo(L,I),A=w.split(" ").length-1,R=A===0,M=v===ac&&!x?S-i*2:P,t.lineTo(L+Math.round(M),I),t.lineWidth=a/15;const B=this._getLinearGradient();t.strokeStyle=B||p,t.stroke(),t.restore()}if(m){t.save(),t.beginPath();let G=hg.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(O,h+k+G),A=w.split(" ").length-1,R=A===0,M=v===ac&&x&&!R?S-i*2:P,t.lineTo(O+Math.round(M),h+k+G),t.lineWidth=a/15;const L=this._getLinearGradient();t.strokeStyle=L||p,t.stroke(),t.restore()}if(u!==t4&&(_!==0||v===ac)){A=w.split(" ").length-1;for(var U=F9(w),V=0;V<U.length;V++){var q=U[V];q===" "&&!x&&v===ac&&(O+=(S-i*2-P)/A),this._partialTextX=O,this._partialTextY=h+k,this._partialText=q,t.fillStrokeShape(this),O+=this.measureSize(q).width+_}}else _!==0&&t.setAttr("letterSpacing",`${_}px`),this._partialTextX=O,this._partialTextY=h+k,this._partialText=w,t.fillStrokeShape(this);t.restore(),n>1&&(h+=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=Rm.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(ik,r),this}getWidth(){var t=this.attrs.width===ws||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===ws||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 Rm.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=gg(),n=this.fontSize(),i;return r.save(),r.font=this._getContextFont(),i=r.measureText(t),r.restore(),{actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,alphabeticBaseline:i.alphabeticBaseline,emHeightAscent:i.emHeightAscent,emHeightDescent:i.emHeightDescent,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent,hangingBaseline:i.hangingBaseline,ideographicBaseline:i.ideographicBaseline,width:i.width,height:n}}_getContextFont(){return this.fontStyle()+jd+this.fontVariant()+jd+(this.fontSize()+sk)+hk(this.fontFamily())}_addTextLine(t){this.align()===ac&&(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 gg().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!==ws&&a!==void 0,u=o!==ws&&o!==void 0,f=this.padding(),v=a-f*2,S=o-f*2,_=0,p=this.wrap(),E=p!==r4,b=p!==fk&&E,m=this.ellipsis();this.textArr=[],gg().font=this._getContextFont();for(var g=m?this._getTextWidth(pg):0,h=0,d=t.length;h<d;++h){var y=t[h],O=this._getTextWidth(y);if(l&&O>v)for(;y.length>0;){for(var k=0,C=y.length,w="",P=0;k<C;){var x=k+C>>>1,A=y.slice(0,x+1),R=this._getTextWidth(A)+g;R<=v?(k=x+1,w=A,P=R):C=x}if(w){if(b){var M,U=y[w.length],V=U===jd||U===J5;V&&P<=v?M=w.length:M=Math.max(w.lastIndexOf(jd),w.lastIndexOf(J5))+1,M>0&&(k=M,w=w.slice(0,k),P=this._getTextWidth(w))}w=w.trimRight(),this._addTextLine(w),n=Math.max(n,P),_+=i;var q=this._shouldHandleEllipsis(_);if(q){this._tryToAddEllipsisToLastLine();break}if(y=y.slice(k),y=y.trimLeft(),y.length>0&&(O=this._getTextWidth(y),O<=v)){this._addTextLine(y),_+=i,n=Math.max(n,O);break}}else break}else this._addTextLine(y),_+=i,n=Math.max(n,O),this._shouldHandleEllipsis(_)&&h<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&_+i>S)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==ws&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==r4;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==ws&&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+pg)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+pg)}}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()}};kl.Text=cr;cr.prototype._fillFunc=pk;cr.prototype._strokeFunc=gk;cr.prototype.className=ak;cr.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,ek._registerNode)(cr);on.Factory.overWriteSetter(cr,"width",(0,Vo.getNumberOrAutoValidator)());on.Factory.overWriteSetter(cr,"height",(0,Vo.getNumberOrAutoValidator)());on.Factory.addGetterSetter(cr,"direction",j9);on.Factory.addGetterSetter(cr,"fontFamily","Arial");on.Factory.addGetterSetter(cr,"fontSize",12,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"fontStyle",B9);on.Factory.addGetterSetter(cr,"fontVariant",B9);on.Factory.addGetterSetter(cr,"padding",0,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"align",z9);on.Factory.addGetterSetter(cr,"verticalAlign",ok);on.Factory.addGetterSetter(cr,"lineHeight",1,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"wrap",ck);on.Factory.addGetterSetter(cr,"ellipsis",!1,(0,Vo.getBooleanValidator)());on.Factory.addGetterSetter(cr,"letterSpacing",0,(0,Vo.getNumberValidator)());on.Factory.addGetterSetter(cr,"text","",(0,Vo.getStringValidator)());on.Factory.addGetterSetter(cr,"textDecoration","");var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.TextPath=void 0;const vg=ir,Gi=vt,mk=Ar,oc=Eu,mg=kl,H9=We,yk=pt;var bk="",G9="normal";function $9(e){e.fillText(this.partialText,0,0)}function V9(e){e.strokeText(this.partialText,0,0)}let kr=class extends mk.Shape{constructor(t){super(t),this.dummyCanvas=vg.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 oc.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:oc.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=oc.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 vg.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 mg.Text.prototype.setText.call(this,t)}_getContextFont(){return mg.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,mg.stringToArray)(this.text());let f=l;for(var v=0;v<u.length;v++){const S=this._getPointAtLength(f);if(!S)return;let _=this._getTextSize(u[v]).width+n;if(u[v]===" "&&i==="justify"){const h=this.text().split(" ").length-1;_+=(this.pathLength-o)/h}const p=this._getPointAtLength(f+_);if(!p)return;const E=oc.Path.getLineLength(S.x,S.y,p.x,p.y);let b=0;if(a)try{b=a(u[v-1],u[v])*this.fontSize()}catch{b=0}S.x+=b,p.x+=b,this.textWidth+=b;const m=oc.Path.getPointOnLine(b+E/2,S.x,S.y,p.x,p.y),g=Math.atan2(p.y-S.y,p.x-S.x);this.glyphInfo.push({transposeX:m.x,transposeY:m.y,text:u[v],rotation:g,p0:S,p1:p}),f+=_}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(v){t.push(v.p0.x),t.push(v.p0.y),t.push(v.p1.x),t.push(v.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 vg.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};Hp.TextPath=kr;kr.prototype._fillFunc=$9;kr.prototype._strokeFunc=V9;kr.prototype._fillFuncHit=$9;kr.prototype._strokeFuncHit=V9;kr.prototype.className="TextPath";kr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,yk._registerNode)(kr);Gi.Factory.addGetterSetter(kr,"data");Gi.Factory.addGetterSetter(kr,"fontFamily","Arial");Gi.Factory.addGetterSetter(kr,"fontSize",12,(0,H9.getNumberValidator)());Gi.Factory.addGetterSetter(kr,"fontStyle",G9);Gi.Factory.addGetterSetter(kr,"align","left");Gi.Factory.addGetterSetter(kr,"letterSpacing",0,(0,H9.getNumberValidator)());Gi.Factory.addGetterSetter(kr,"textBaseline","middle");Gi.Factory.addGetterSetter(kr,"fontVariant",G9);Gi.Factory.addGetterSetter(kr,"text",bk);Gi.Factory.addGetterSetter(kr,"textDecoration",null);Gi.Factory.addGetterSetter(kr,"kerningFunc",null);var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Transformer=void 0;const Dt=ir,At=vt,n4=Qt,_k=Ar,wk=wf,i4=wu,Ti=pt,qo=We,Sk=pt;var q9="tr-konva",Ek=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${q9}`).join(" "),a4="nodesRect",Ok=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Pk={"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 xk="ontouchstart"in Ti.Konva._global;function Ck(e,t,r){if(e==="rotater")return r;t+=Dt.Util.degToRad(Pk[e]||0);var n=(Dt.Util.radToDeg(t)%360+360)%360;return Dt.Util._inRange(n,315+22.5,360)||Dt.Util._inRange(n,0,22.5)?"ns-resize":Dt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":Dt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":Dt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":Dt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":Dt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":Dt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":Dt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Dt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var Uh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],o4=1e8;function Tk(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 W9(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 Ak(e,t){const r=Tk(e);return W9(e,t,r)}function kk(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=Ti.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 Lm=0,St=class extends i4.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(Ek,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Dt.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 q9+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const r=t.filter(i=>i.isAncestorOf(this)?(Dt.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(Ok.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(a4),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(a4,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=(Ti.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={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 W9(v,-Ti.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-o4,y:-o4,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const v=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var S=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],_=f.getAbsoluteTransform();S.forEach(function(p){var E=_.point(p);r.push(E)})});const n=new Dt.Transform;n.rotate(-Ti.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var v=n.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.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:Ti.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(),Uh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new wk.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:xk?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=Ti.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=Ck(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 _k.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()*Dt.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){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},Lm++,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 v=a.getAbsolutePosition();if(!(f.x===v.x&&f.y===v.y)){if(this._movingAnchorName==="rotater"){var S=this._getNodeRect();r=a.x()-S.width/2,n=-a.y()+S.height/2;let M=Math.atan2(-n,r)+Math.PI/2;S.height<0&&(M-=Math.PI);var _=Ti.Konva.getAngle(this.rotation());const U=_+M,V=Ti.Konva.getAngle(this.rotationSnapTolerance()),z=kk(this.rotationSnaps(),U,V)-S.rotation,F=Ak(S,z);this._fitNodesInto(F,t);return}var p=this.shiftBehavior(),E;p==="inverted"?E=this.keepRatio()&&!t.shiftKey:p==="none"?E=this.keepRatio():E=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(E){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-a.x(),2)+Math.pow(b.y-a.y(),2));var m=this.findOne(".top-left").x()>b.x?-1:1,g=this.findOne(".top-left").y()>b.y?-1:1;r=i*this.cos*m,n=i*this.sin*g,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(E){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-b.x,2)+Math.pow(b.y-a.y(),2));var m=this.findOne(".top-right").x()<b.x?-1:1,g=this.findOne(".top-right").y()>b.y?-1:1;r=i*this.cos*m,n=i*this.sin*g,this.findOne(".top-right").x(b.x+r),this.findOne(".top-right").y(b.y-n)}var h=a.position();this.findOne(".top-left").y(h.y),this.findOne(".bottom-right").x(h.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(E){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-a.x(),2)+Math.pow(a.y()-b.y,2));var m=b.x<a.x()?-1:1,g=a.y()<b.y?-1:1;r=i*this.cos*m,n=i*this.sin*g,a.x(b.x-r),a.y(b.y+n)}h=a.position(),this.findOne(".top-left").x(h.x),this.findOne(".bottom-right").y(h.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(E){var b=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-b.x,2)+Math.pow(a.y()-b.y,2));var m=this.findOne(".bottom-right").x()<b.x?-1:1,g=this.findOne(".bottom-right").y()<b.y?-1:1;r=i*this.cos*m,n=i*this.sin*g,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"),O=this.findOne(".bottom-right"),k=y.x(),C=y.y(),w=this.getWidth()-O.x(),P=this.getHeight()-O.y();O.move({x:-k,y:-C}),y.move({x:w,y:P})}var x=this.findOne(".top-left").getAbsolutePosition();r=x.x,n=x.y;var A=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),R=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:A,height:R,rotation:Ti.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();Lm--,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(Dt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(Dt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var a=new Dt.Transform;if(a.rotate(Ti.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=a.point({x:-this.padding()*2,y:0});t.x+=_.x,t.y+=_.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=a.point({x:0,y:-this.padding()*2});t.x+=_.x,t.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(n,t);_?t=_:Dt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new Dt.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new Dt.Transform,f=t.width/o,v=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(v))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,v));const S=u.multiply(l.invert());this._nodes.forEach(_=>{var p;const E=_.getParent().getAbsoluteTransform(),b=_.getTransform().copy();b.translate(_.offsetX(),_.offsetY());const m=new Dt.Transform;m.multiply(E.copy().invert()).multiply(S).multiply(E).multiply(b);const g=m.decompose();_.setAttrs(g),(p=_.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(Dt.Util._getRotation(t.rotation)),this._nodes.forEach(_=>{this._fire("transform",{evt:r,target:_}),_._fire("transform",{evt:r,target:_})}),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(Dt.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(S=>{S.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()*Dt.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 v=this.anchorStyleFunc();v&&f.forEach(S=>{v(S)}),(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=""),i4.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return n4.Node.prototype.toObject.call(this)}clone(t){var r=n4.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Gp.Transformer=St;St.isTransforming=()=>Lm>0;function Rk(e){return e instanceof Array||Dt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){Uh.indexOf(t)===-1&&Dt.Util.warn("Unknown anchor name: "+t+". Available names are: "+Uh.join(", "))}),e||[]}St.prototype.className="Transformer";(0,Sk._registerNode)(St);At.Factory.addGetterSetter(St,"enabledAnchors",Uh,Rk);At.Factory.addGetterSetter(St,"flipEnabled",!0,(0,qo.getBooleanValidator)());At.Factory.addGetterSetter(St,"resizeEnabled",!0);At.Factory.addGetterSetter(St,"anchorSize",10,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"rotateEnabled",!0);At.Factory.addGetterSetter(St,"rotateLineVisible",!0);At.Factory.addGetterSetter(St,"rotationSnaps",[]);At.Factory.addGetterSetter(St,"rotateAnchorOffset",50,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"rotateAnchorCursor","crosshair");At.Factory.addGetterSetter(St,"rotationSnapTolerance",5,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"borderEnabled",!0);At.Factory.addGetterSetter(St,"anchorStroke","rgb(0, 161, 255)");At.Factory.addGetterSetter(St,"anchorStrokeWidth",1,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"anchorFill","white");At.Factory.addGetterSetter(St,"anchorCornerRadius",0,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"borderStroke","rgb(0, 161, 255)");At.Factory.addGetterSetter(St,"borderStrokeWidth",1,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"borderDash");At.Factory.addGetterSetter(St,"keepRatio",!0);At.Factory.addGetterSetter(St,"shiftBehavior","default");At.Factory.addGetterSetter(St,"centeredScaling",!1);At.Factory.addGetterSetter(St,"ignoreStroke",!1);At.Factory.addGetterSetter(St,"padding",0,(0,qo.getNumberValidator)());At.Factory.addGetterSetter(St,"node");At.Factory.addGetterSetter(St,"nodes");At.Factory.addGetterSetter(St,"boundBoxFunc");At.Factory.addGetterSetter(St,"anchorDragBoundFunc");At.Factory.addGetterSetter(St,"anchorStyleFunc");At.Factory.addGetterSetter(St,"shouldOverdrawWholeArea",!1);At.Factory.addGetterSetter(St,"useSingleNodeRotation",!0);At.Factory.backCompat(St,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var $p={};Object.defineProperty($p,"__esModule",{value:!0});$p.Wedge=void 0;const Vp=vt,Lk=Ar,Mk=pt,Y9=We,Nk=pt;let qa=class extends Lk.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Mk.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)}};$p.Wedge=qa;qa.prototype.className="Wedge";qa.prototype._centroid=!0;qa.prototype._attrsAffectingSize=["radius"];(0,Nk._registerNode)(qa);Vp.Factory.addGetterSetter(qa,"radius",0,(0,Y9.getNumberValidator)());Vp.Factory.addGetterSetter(qa,"angle",0,(0,Y9.getNumberValidator)());Vp.Factory.addGetterSetter(qa,"clockwise",!1);Vp.Factory.backCompat(qa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var qp={};Object.defineProperty(qp,"__esModule",{value:!0});qp.Blur=void 0;const l4=vt,Ik=Qt,Dk=We;function s4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Fk=[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],jk=[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 zk(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,v,S,_,p,E,b,m,g,h,d,y,O,k,C,w,P,x,A,R,M=t+t+1,U=n-1,V=i-1,q=t+1,z=q*(q+1)/2,F=new s4,G=null,L=F,I=null,B=null,D=Fk[t],$=jk[t];for(l=1;l<M;l++)L=L.next=new s4,l===q&&(G=L);for(L.next=F,S=v=0,o=0;o<i;o++){for(y=O=k=C=_=p=E=b=0,m=q*(w=r[v]),g=q*(P=r[v+1]),h=q*(x=r[v+2]),d=q*(A=r[v+3]),_+=z*w,p+=z*P,E+=z*x,b+=z*A,L=F,l=0;l<q;l++)L.r=w,L.g=P,L.b=x,L.a=A,L=L.next;for(l=1;l<q;l++)u=v+((U<l?U:l)<<2),_+=(L.r=w=r[u])*(R=q-l),p+=(L.g=P=r[u+1])*R,E+=(L.b=x=r[u+2])*R,b+=(L.a=A=r[u+3])*R,y+=w,O+=P,k+=x,C+=A,L=L.next;for(I=F,B=G,a=0;a<n;a++)r[v+3]=A=b*D>>$,A!==0?(A=255/A,r[v]=(_*D>>$)*A,r[v+1]=(p*D>>$)*A,r[v+2]=(E*D>>$)*A):r[v]=r[v+1]=r[v+2]=0,_-=m,p-=g,E-=h,b-=d,m-=I.r,g-=I.g,h-=I.b,d-=I.a,u=S+((u=a+t+1)<U?u:U)<<2,y+=I.r=r[u],O+=I.g=r[u+1],k+=I.b=r[u+2],C+=I.a=r[u+3],_+=y,p+=O,E+=k,b+=C,I=I.next,m+=w=B.r,g+=P=B.g,h+=x=B.b,d+=A=B.a,y-=w,O-=P,k-=x,C-=A,B=B.next,v+=4;S+=n}for(a=0;a<n;a++){for(O=k=C=y=p=E=b=_=0,v=a<<2,m=q*(w=r[v]),g=q*(P=r[v+1]),h=q*(x=r[v+2]),d=q*(A=r[v+3]),_+=z*w,p+=z*P,E+=z*x,b+=z*A,L=F,l=0;l<q;l++)L.r=w,L.g=P,L.b=x,L.a=A,L=L.next;for(f=n,l=1;l<=t;l++)v=f+a<<2,_+=(L.r=w=r[v])*(R=q-l),p+=(L.g=P=r[v+1])*R,E+=(L.b=x=r[v+2])*R,b+=(L.a=A=r[v+3])*R,y+=w,O+=P,k+=x,C+=A,L=L.next,l<V&&(f+=n);for(v=a,I=F,B=G,o=0;o<i;o++)u=v<<2,r[u+3]=A=b*D>>$,A>0?(A=255/A,r[u]=(_*D>>$)*A,r[u+1]=(p*D>>$)*A,r[u+2]=(E*D>>$)*A):r[u]=r[u+1]=r[u+2]=0,_-=m,p-=g,E-=h,b-=d,m-=I.r,g-=I.g,h-=I.b,d-=I.a,u=a+((u=o+q)<V?u:V)*n<<2,_+=y+=I.r=r[u],p+=O+=I.g=r[u+1],E+=k+=I.b=r[u+2],b+=C+=I.a=r[u+3],I=I.next,m+=w=B.r,g+=P=B.g,h+=x=B.b,d+=A=B.a,y-=w,O-=P,k-=x,C-=A,B=B.next,v+=n}}const Bk=function(t){var r=Math.round(this.blurRadius());r>0&&zk(t,r)};qp.Blur=Bk;l4.Factory.addGetterSetter(Ik.Node,"blurRadius",0,(0,Dk.getNumberValidator)(),l4.Factory.afterSetFilter);var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0});Wp.Brighten=void 0;const u4=vt,Uk=Qt,Hk=We,Gk=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};Wp.Brighten=Gk;u4.Factory.addGetterSetter(Uk.Node,"brightness",0,(0,Hk.getNumberValidator)(),u4.Factory.afterSetFilter);var Yp={};Object.defineProperty(Yp,"__esModule",{value:!0});Yp.Contrast=void 0;const c4=vt,$k=Qt,Vk=We,qk=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};Yp.Contrast=qk;c4.Factory.addGetterSetter($k.Node,"contrast",0,(0,Vk.getNumberValidator)(),c4.Factory.afterSetFilter);var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});Kp.Emboss=void 0;const Io=vt,Xp=Qt,Wk=ir,K9=We,Yk=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,v=u*4,S=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:Wk.Util.error("Unknown emboss direction: "+n)}do{var _=(S-1)*v,p=a;S+p<1&&(p=0),S+p>f&&(p=0);var E=(S-1+p)*u*4,b=u;do{var m=_+(b-1)*4,g=o;b+g<1&&(g=0),b+g>u&&(g=0);var h=E+(b-1+g)*4,d=l[m]-l[h],y=l[m+1]-l[h+1],O=l[m+2]-l[h+2],k=d,C=k>0?k:-k,w=y>0?y:-y,P=O>0?O:-O;if(w>C&&(k=y),P>C&&(k=O),k*=t,i){var x=l[m]+k,A=l[m+1]+k,R=l[m+2]+k;l[m]=x>255?255:x<0?0:x,l[m+1]=A>255?255:A<0?0:A,l[m+2]=R>255?255:R<0?0:R}else{var M=r-k;M<0?M=0:M>255&&(M=255),l[m]=l[m+1]=l[m+2]=M}}while(--b)}while(--S)};Kp.Emboss=Yk;Io.Factory.addGetterSetter(Xp.Node,"embossStrength",.5,(0,K9.getNumberValidator)(),Io.Factory.afterSetFilter);Io.Factory.addGetterSetter(Xp.Node,"embossWhiteLevel",.5,(0,K9.getNumberValidator)(),Io.Factory.afterSetFilter);Io.Factory.addGetterSetter(Xp.Node,"embossDirection","top-left",null,Io.Factory.afterSetFilter);Io.Factory.addGetterSetter(Xp.Node,"embossBlend",!1,null,Io.Factory.afterSetFilter);var Zp={};Object.defineProperty(Zp,"__esModule",{value:!0});Zp.Enhance=void 0;const f4=vt,Kk=Qt,Xk=We;function yg(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 Zk=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],v=f,S,_,p=this.enhance();if(p!==0){for(_=0;_<r;_+=4)a=t[_+0],a<n?n=a:a>i&&(i=a),u=t[_+1],u<o?o=u:u>l&&(l=u),S=t[_+2],S<f?f=S:S>v&&(v=S);i===n&&(i=255,n=0),l===o&&(l=255,o=0),v===f&&(v=255,f=0);var E,b,m,g,h,d,y,O,k;for(p>0?(b=i+p*(255-i),m=n-p*(n-0),h=l+p*(255-l),d=o-p*(o-0),O=v+p*(255-v),k=f-p*(f-0)):(E=(i+n)*.5,b=i+p*(i-E),m=n+p*(n-E),g=(l+o)*.5,h=l+p*(l-g),d=o+p*(o-g),y=(v+f)*.5,O=v+p*(v-y),k=f+p*(f-y)),_=0;_<r;_+=4)t[_+0]=yg(t[_+0],n,i,m,b),t[_+1]=yg(t[_+1],o,l,d,h),t[_+2]=yg(t[_+2],f,v,k,O)}};Zp.Enhance=Zk;f4.Factory.addGetterSetter(Kk.Node,"enhance",0,(0,Xk.getNumberValidator)(),f4.Factory.afterSetFilter);var Qp={};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Grayscale=void 0;const Qk=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};Qp.Grayscale=Qk;var Jp={};Object.defineProperty(Jp,"__esModule",{value:!0});Jp.HSL=void 0;const ou=vt,u2=Qt,c2=We;ou.Factory.addGetterSetter(u2.Node,"hue",0,(0,c2.getNumberValidator)(),ou.Factory.afterSetFilter);ou.Factory.addGetterSetter(u2.Node,"saturation",0,(0,c2.getNumberValidator)(),ou.Factory.afterSetFilter);ou.Factory.addGetterSetter(u2.Node,"luminance",0,(0,c2.getNumberValidator)(),ou.Factory.afterSetFilter);const Jk=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),v=.299*n+.701*u+.167*f,S=.587*n-.587*u+.33*f,_=.114*n-.114*u-.497*f,p=.299*n-.299*u-.328*f,E=.587*n+.413*u+.035*f,b=.114*n-.114*u+.293*f,m=.299*n-.3*u+1.25*f,g=.587*n-.586*u-1.05*f,h=.114*n+.886*u-.2*f,d,y,O,k;for(l=0;l<r;l+=4)d=t[l+0],y=t[l+1],O=t[l+2],k=t[l+3],t[l+0]=v*d+S*y+_*O+o,t[l+1]=p*d+E*y+b*O+o,t[l+2]=m*d+g*y+h*O+o,t[l+3]=k};Jp.HSL=Jk;var e0={};Object.defineProperty(e0,"__esModule",{value:!0});e0.HSV=void 0;const lu=vt,f2=Qt,d2=We,eR=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,v=.587*n-.587*l+.33*u,S=.114*n-.114*l-.497*u,_=.299*n-.299*l-.328*u,p=.587*n+.413*l+.035*u,E=.114*n-.114*l+.293*u,b=.299*n-.3*l+1.25*u,m=.587*n-.586*l-1.05*u,g=.114*n+.886*l-.2*u,h,d,y,O;for(o=0;o<r;o+=4)h=t[o+0],d=t[o+1],y=t[o+2],O=t[o+3],t[o+0]=f*h+v*d+S*y,t[o+1]=_*h+p*d+E*y,t[o+2]=b*h+m*d+g*y,t[o+3]=O};e0.HSV=eR;lu.Factory.addGetterSetter(f2.Node,"hue",0,(0,d2.getNumberValidator)(),lu.Factory.afterSetFilter);lu.Factory.addGetterSetter(f2.Node,"saturation",0,(0,d2.getNumberValidator)(),lu.Factory.afterSetFilter);lu.Factory.addGetterSetter(f2.Node,"value",0,(0,d2.getNumberValidator)(),lu.Factory.afterSetFilter);var t0={};Object.defineProperty(t0,"__esModule",{value:!0});t0.Invert=void 0;const tR=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]};t0.Invert=tR;var r0={};Object.defineProperty(r0,"__esModule",{value:!0});r0.Kaleidoscope=void 0;const Hh=vt,X9=Qt,d4=ir,Z9=We;var rR=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,v,S,_=0,p=0,E=0,b=0,m,g=Math.sqrt(l*l+u*u);v=a-l,S=o-u,m=Math.sqrt(v*v+S*S),g=m>g?m:g;var h=o,d=a,y,O,k=360/d*Math.PI/180,C,w;for(O=0;O<d;O+=1)for(C=Math.sin(O*k),w=Math.cos(O*k),y=0;y<h;y+=1)v=Math.floor(l+g*y/h*w),S=Math.floor(u+g*y/h*C),f=(S*a+v)*4,_=n[f+0],p=n[f+1],E=n[f+2],b=n[f+3],f=(O+y*a)*4,i[f+0]=_,i[f+1]=p,i[f+2]=E,i[f+3]=b},nR=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,v,S,_,p,E=0,b=0,m=0,g=0,h,d=Math.sqrt(l*l+u*u);v=a-l,S=o-u,h=Math.sqrt(v*v+S*S),d=h>d?h:d;var y=o,O=a,k,C,w=0,P,x;for(v=0;v<a;v+=1)for(S=0;S<o;S+=1)_=v-l,p=S-u,k=Math.sqrt(_*_+p*p)*y/d,C=(Math.atan2(p,_)*180/Math.PI+360+w)%360,C=C*O/360,P=Math.floor(C),x=Math.floor(k),f=(x*a+P)*4,E=n[f+0],b=n[f+1],m=n[f+2],g=n[f+3],f=(S*a+v)*4,i[f+0]=E,i[f+1]=b,i[f+2]=m,i[f+3]=g};const iR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,v,S,_,p=Math.round(this.kaleidoscopePower()),E=Math.round(this.kaleidoscopeAngle()),b=Math.floor(t*(E%360)/360);if(!(p<1)){var m=d4.Util.createCanvasElement();m.width=t,m.height=r;var g=m.getContext("2d").getImageData(0,0,t,r);d4.Util.releaseCanvas(m),rR(e,g,{polarCenterX:t/2,polarCenterY:r/2});for(var h=t/Math.pow(2,p);h<=8;)h=h*2,p-=1;h=Math.ceil(h);var d=h,y=0,O=d,k=1;for(b+h>t&&(y=d,O=0,k=-1),i=0;i<r;i+=1)for(n=y;n!==O;n+=k)a=Math.round(n+b)%t,S=(t*i+a)*4,l=g.data[S+0],u=g.data[S+1],f=g.data[S+2],v=g.data[S+3],_=(t*i+n)*4,g.data[_+0]=l,g.data[_+1]=u,g.data[_+2]=f,g.data[_+3]=v;for(i=0;i<r;i+=1)for(d=Math.floor(h),o=0;o<p;o+=1){for(n=0;n<d+1;n+=1)S=(t*i+n)*4,l=g.data[S+0],u=g.data[S+1],f=g.data[S+2],v=g.data[S+3],_=(t*i+d*2-n-1)*4,g.data[_+0]=l,g.data[_+1]=u,g.data[_+2]=f,g.data[_+3]=v;d*=2}nR(g,e,{polarRotation:0})}};r0.Kaleidoscope=iR;Hh.Factory.addGetterSetter(X9.Node,"kaleidoscopePower",2,(0,Z9.getNumberValidator)(),Hh.Factory.afterSetFilter);Hh.Factory.addGetterSetter(X9.Node,"kaleidoscopeAngle",0,(0,Z9.getNumberValidator)(),Hh.Factory.afterSetFilter);var n0={};Object.defineProperty(n0,"__esModule",{value:!0});n0.Mask=void 0;const h4=vt,aR=Qt,oR=We;function Bd(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 lc(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 lR(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 sR(e,t){var r=Bd(e,0,0),n=Bd(e,e.width-1,0),i=Bd(e,0,e.height-1),a=Bd(e,e.width-1,e.height-1),o=t||10;if(lc(r,n)<o&&lc(n,a)<o&&lc(a,i)<o&&lc(i,r)<o){for(var l=lR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var v=lc(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=v<o?0:255}return u}}function uR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function cR(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,v=0,S=0;S<i;S++)for(var _=0;_<i;_++){var p=l+S-a,E=u+_-a;if(p>=0&&p<r&&E>=0&&E<t){var b=p*t+E,m=n[S*i+_];v+=e[b]*m}}o[f]=v===255*8?255:0}return o}function fR(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,v=0,S=0;S<i;S++)for(var _=0;_<i;_++){var p=l+S-a,E=u+_-a;if(p>=0&&p<r&&E>=0&&E<t){var b=p*t+E,m=n[S*i+_];v+=e[b]*m}}o[f]=v>=255*4?255:0}return o}function dR(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,v=0,S=0;S<i;S++)for(var _=0;_<i;_++){var p=l+S-a,E=u+_-a;if(p>=0&&p<r&&E>=0&&E<t){var b=p*t+E,m=n[S*i+_];v+=e[b]*m}}o[f]=v}return o}const hR=function(e){var t=this.threshold(),r=sR(e,t);return r&&(r=cR(r,e.width,e.height),r=fR(r,e.width,e.height),r=dR(r,e.width,e.height),uR(e,r)),e};n0.Mask=hR;h4.Factory.addGetterSetter(aR.Node,"threshold",0,(0,oR.getNumberValidator)(),h4.Factory.afterSetFilter);var i0={};Object.defineProperty(i0,"__esModule",{value:!0});i0.Noise=void 0;const p4=vt,pR=Qt,gR=We,vR=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()};i0.Noise=vR;p4.Factory.addGetterSetter(pR.Node,"noise",.2,(0,gR.getNumberValidator)(),p4.Factory.afterSetFilter);var a0={};Object.defineProperty(a0,"__esModule",{value:!0});a0.Pixelate=void 0;const g4=vt,mR=ir,yR=Qt,bR=We,_R=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,v,S=Math.ceil(r/t),_=Math.ceil(n/t),p,E,b,m,g,h,d,y=e.data;if(t<=0){mR.Util.error("pixelSize value can not be <= 0");return}for(g=0;g<S;g+=1)for(h=0;h<_;h+=1){for(l=0,u=0,f=0,v=0,p=g*t,E=p+t,b=h*t,m=b+t,d=0,i=p;i<E;i+=1)if(!(i>=r))for(a=b;a<m;a+=1)a>=n||(o=(r*a+i)*4,l+=y[o+0],u+=y[o+1],f+=y[o+2],v+=y[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,v=v/d,i=p;i<E;i+=1)if(!(i>=r))for(a=b;a<m;a+=1)a>=n||(o=(r*a+i)*4,y[o+0]=l,y[o+1]=u,y[o+2]=f,y[o+3]=v)}};a0.Pixelate=_R;g4.Factory.addGetterSetter(yR.Node,"pixelSize",8,(0,bR.getNumberValidator)(),g4.Factory.afterSetFilter);var o0={};Object.defineProperty(o0,"__esModule",{value:!0});o0.Posterize=void 0;const v4=vt,wR=Qt,SR=We,ER=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};o0.Posterize=ER;v4.Factory.addGetterSetter(wR.Node,"levels",.5,(0,SR.getNumberValidator)(),v4.Factory.afterSetFilter);var l0={};Object.defineProperty(l0,"__esModule",{value:!0});l0.RGB=void 0;const Gh=vt,h2=Qt,OR=We,PR=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]};l0.RGB=PR;Gh.Factory.addGetterSetter(h2.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Gh.Factory.addGetterSetter(h2.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Gh.Factory.addGetterSetter(h2.Node,"blue",0,OR.RGBComponent,Gh.Factory.afterSetFilter);var s0={};Object.defineProperty(s0,"__esModule",{value:!0});s0.RGBA=void 0;const Yc=vt,u0=Qt,xR=We,CR=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};s0.RGBA=CR;Yc.Factory.addGetterSetter(u0.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Yc.Factory.addGetterSetter(u0.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Yc.Factory.addGetterSetter(u0.Node,"blue",0,xR.RGBComponent,Yc.Factory.afterSetFilter);Yc.Factory.addGetterSetter(u0.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var c0={};Object.defineProperty(c0,"__esModule",{value:!0});c0.Sepia=void 0;const TR=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)};c0.Sepia=TR;var f0={};Object.defineProperty(f0,"__esModule",{value:!0});f0.Solarize=void 0;const AR=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],v=t[u+1],S=t[u+2];f>127&&(f=255-f),v>127&&(v=255-v),S>127&&(S=255-S),t[u]=f,t[u+1]=v,t[u+2]=S}while(--l)}while(--a)};f0.Solarize=AR;var d0={};Object.defineProperty(d0,"__esModule",{value:!0});d0.Threshold=void 0;const m4=vt,kR=Qt,RR=We,LR=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};d0.Threshold=LR;m4.Factory.addGetterSetter(kR.Node,"threshold",.5,(0,RR.getNumberValidator)(),m4.Factory.afterSetFilter);Object.defineProperty(wp,"__esModule",{value:!0});wp.Konva=void 0;const y4=zh,MR=Cp,NR=kp,IR=Mp,DR=Np,FR=Ip,b4=au,jR=yf,zR=Eu,BR=wf,UR=jp,HR=zp,GR=Bp,$R=Up,VR=kl,qR=Hp,WR=Gp,YR=$p,KR=qp,XR=Wp,ZR=Yp,QR=Kp,JR=Zp,eL=Qp,tL=Jp,rL=e0,nL=t0,iL=r0,aL=n0,oL=i0,lL=a0,sL=o0,uL=l0,cL=s0,fL=c0,dL=f0,hL=d0;wp.Konva=y4.Konva.Util._assign(y4.Konva,{Arc:MR.Arc,Arrow:NR.Arrow,Circle:IR.Circle,Ellipse:DR.Ellipse,Image:FR.Image,Label:b4.Label,Tag:b4.Tag,Line:jR.Line,Path:zR.Path,Rect:BR.Rect,RegularPolygon:UR.RegularPolygon,Ring:HR.Ring,Sprite:GR.Sprite,Star:$R.Star,Text:VR.Text,TextPath:qR.TextPath,Transformer:WR.Transformer,Wedge:YR.Wedge,Filters:{Blur:KR.Blur,Brighten:XR.Brighten,Contrast:ZR.Contrast,Emboss:QR.Emboss,Enhance:JR.Enhance,Grayscale:eL.Grayscale,HSL:tL.HSL,HSV:rL.HSV,Invert:nL.Invert,Kaleidoscope:iL.Kaleidoscope,Mask:aL.Mask,Noise:oL.Noise,Pixelate:lL.Pixelate,Posterize:sL.Posterize,RGB:uL.RGB,RGBA:cL.RGBA,Sepia:fL.Sepia,Solarize:dL.Solarize,Threshold:hL.Threshold}});var pL=Jy.exports;Object.defineProperty(pL,"__esModule",{value:!0});const gL=wp;Jy.exports=gL.Konva;var vi=Jy.exports,Mm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=zh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=zh;e.exports=n.Konva})(Mm,Mm.exports);var vL=Mm.exports;const Kc=Yh(vL);var Q9={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 mL=function(t){var r={},n=it,i=hc,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,T=1;T<arguments.length;T++)c+="&args[]="+encodeURIComponent(arguments[T]);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"),v=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),E=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),O=Symbol.iterator;function k(s){return s===null||typeof s!="object"?null:(s=O&&s[O]||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 v:return"Fragment";case f:return"Portal";case _:return"Profiler";case S:return"StrictMode";case m:return"Suspense";case g:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case E:return(s.displayName||"Context")+".Consumer";case p:return(s._context.displayName||"Context")+".Provider";case b:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case h: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 w(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===S?"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 P(s){var c=s,T=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(T=c.return),s=c.return;while(s)}return c.tag===3?T:null}function x(s){if(P(s)!==s)throw Error(o(188))}function A(s){var c=s.alternate;if(!c){if(c=P(s),c===null)throw Error(o(188));return c!==s?null:s}for(var T=s,N=c;;){var j=T.return;if(j===null)break;var W=j.alternate;if(W===null){if(N=j.return,N!==null){T=N;continue}break}if(j.child===W.child){for(W=j.child;W;){if(W===T)return x(j),s;if(W===N)return x(j),c;W=W.sibling}throw Error(o(188))}if(T.return!==N.return)T=j,N=W;else{for(var Q=!1,se=j.child;se;){if(se===T){Q=!0,T=j,N=W;break}if(se===N){Q=!0,N=j,T=W;break}se=se.sibling}if(!Q){for(se=W.child;se;){if(se===T){Q=!0,T=W,N=j;break}if(se===N){Q=!0,N=W,T=j;break}se=se.sibling}if(!Q)throw Error(o(189))}}if(T.alternate!==N)throw Error(o(190))}if(T.tag!==3)throw Error(o(188));return T.stateNode.current===T?s:c}function R(s){return s=A(s),s!==null?M(s):null}function M(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=M(s);if(c!==null)return c;s=s.sibling}return null}function U(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=U(s);if(c!==null)return c}s=s.sibling}return null}var V=Array.isArray,q=t.getPublicInstance,z=t.getRootHostContext,F=t.getChildHostContext,G=t.prepareForCommit,L=t.resetAfterCommit,I=t.createInstance,B=t.appendInitialChild,D=t.finalizeInitialChildren,$=t.prepareUpdate,K=t.shouldSetTextContent,Y=t.createTextInstance,H=t.scheduleTimeout,X=t.cancelTimeout,Z=t.noTimeout,J=t.isPrimaryRenderer,ee=t.supportsMutation,re=t.supportsPersistence,ae=t.supportsHydration,le=t.getInstanceFromNode,ue=t.preparePortalMount,Ae=t.getCurrentEventPriority,ze=t.detachDeletedInstance,oe=t.supportsMicrotasks,ie=t.scheduleMicrotask,ve=t.supportsTestSelectors,ge=t.findFiberRoot,te=t.getBoundingRect,he=t.getTextContent,de=t.isHiddenSubtree,we=t.matchAccessibilityRole,_e=t.setFocusIfFocusable,Ne=t.setupIntersectionObserver,ke=t.appendChild,tt=t.appendChildToContainer,ot=t.commitTextUpdate,gt=t.commitMount,Bt=t.commitUpdate,fe=t.insertBefore,pe=t.insertInContainerBefore,nt=t.removeChild,Oe=t.removeChildFromContainer,Fe=t.resetTextContent,Le=t.hideInstance,Ee=t.hideTextInstance,Ze=t.unhideInstance,Pe=t.unhideTextInstance,Ye=t.clearContainer,Sr=t.cloneInstance,xe=t.createContainerChildSet,He=t.appendChildToContainerChildSet,Qe=t.finalizeContainerChildren,Et=t.replaceContainerChildren,Pt=t.cloneHiddenInstance,ar=t.cloneHiddenTextInstance,Rr=t.canHydrateInstance,Lr=t.canHydrateTextInstance,ln=t.canHydrateSuspenseInstance,De=t.isSuspenseInstancePending,rt=t.isSuspenseInstanceFallback,Xe=t.getSuspenseInstanceFallbackErrorDetails,kt=t.registerSuspenseInstanceRetry,Je=t.getNextHydratableSibling,fr=t.getFirstHydratableChild,dt=t.getFirstHydratableChildWithinContainer,$t=t.getFirstHydratableChildWithinSuspenseInstance,Br=t.hydrateInstance,vr=t.hydrateTextInstance,Mr=t.hydrateSuspenseInstance,Mn=t.getNextHydratableInstanceAfterSuspenseInstance,mi=t.commitHydratedContainer,mn=t.commitHydratedSuspenseInstance,sn=t.clearSuspenseBoundary,Kn=t.clearSuspenseBoundaryFromContainer,Ka=t.shouldDeleteUnhydratedTailInstances,yi=t.didNotMatchHydratedContainerTextInstance,Kl=t.didNotMatchHydratedTextInstance,Xa;function Za(s){if(Xa===void 0)try{throw Error()}catch(T){var c=T.stack.trim().match(/\n( *(at )?)/);Xa=c&&c[1]||""}return`
52
+ `+Xa+s}var Xl=!1;function ku(s,c){if(!s||Xl)return"";Xl=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Re){var N=Re}Reflect.construct(s,[],c)}else{try{c.call()}catch(Re){N=Re}s.call(c.prototype)}else{try{throw Error()}catch(Re){N=Re}s()}}catch(Re){if(Re&&N&&typeof Re.stack=="string"){for(var j=Re.stack.split(`
53
+ `),W=N.stack.split(`
54
+ `),Q=j.length-1,se=W.length-1;1<=Q&&0<=se&&j[Q]!==W[se];)se--;for(;1<=Q&&0<=se;Q--,se--)if(j[Q]!==W[se]){if(Q!==1||se!==1)do if(Q--,se--,0>se||j[Q]!==W[se]){var ye=`
55
+ `+j[Q].replace(" at new "," at ");return s.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",s.displayName)),ye}while(1<=Q&&0<=se);break}}}finally{Xl=!1,Error.prepareStackTrace=T}return(s=s?s.displayName||s.name:"")?Za(s):""}var Ru=Object.prototype.hasOwnProperty,va=[],Nn=-1;function un(s){return{current:s}}function Nt(s){0>Nn||(s.current=va[Nn],va[Nn]=null,Nn--)}function Rt(s,c){Nn++,va[Nn]=s.current,s.current=c}var bi={},mr=un(bi),Ur=un(!1),Xn=bi;function _i(s,c){var T=s.type.contextTypes;if(!T)return bi;var N=s.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var j={},W;for(W in T)j[W]=c[W];return N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=j),j}function Yt(s){return s=s.childContextTypes,s!=null}function wi(){Nt(Ur),Nt(mr)}function Zl(s,c,T){if(mr.current!==bi)throw Error(o(168));Rt(mr,c),Rt(Ur,T)}function Ql(s,c,T){var N=s.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return T;N=N.getChildContext();for(var j in N)if(!(j in c))throw Error(o(108,w(s)||"Unknown",j));return a({},T,N)}function Jl(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||bi,Xn=mr.current,Rt(mr,s),Rt(Ur,Ur.current),!0}function ma(s,c,T){var N=s.stateNode;if(!N)throw Error(o(169));T?(s=Ql(s,c,Xn),N.__reactInternalMemoizedMergedChildContext=s,Nt(Ur),Nt(mr),Rt(mr,s)):Nt(Ur),Rt(Ur,T)}var In=Math.clz32?Math.clz32:Qa,E0=Math.log,yr=Math.LN2;function Qa(s){return s>>>=0,s===0?32:31-(E0(s)/yr|0)|0}var es=64,Xo=4194304;function ya(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 Zo(s,c){var T=s.pendingLanes;if(T===0)return 0;var N=0,j=s.suspendedLanes,W=s.pingedLanes,Q=T&268435455;if(Q!==0){var se=Q&~j;se!==0?N=ya(se):(W&=Q,W!==0&&(N=ya(W)))}else Q=T&~j,Q!==0?N=ya(Q):W!==0&&(N=ya(W));if(N===0)return 0;if(c!==0&&c!==N&&!(c&j)&&(j=N&-N,W=c&-c,j>=W||j===16&&(W&4194240)!==0))return c;if(N&4&&(N|=T&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=N;0<c;)T=31-In(c),j=1<<T,N|=s[T],c&=~j;return N}function Cf(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 O0(s,c){for(var T=s.suspendedLanes,N=s.pingedLanes,j=s.expirationTimes,W=s.pendingLanes;0<W;){var Q=31-In(W),se=1<<Q,ye=j[Q];ye===-1?(!(se&T)||se&N)&&(j[Q]=Cf(se,c)):ye<=c&&(s.expiredLanes|=se),W&=~se}}function Ja(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function ts(){var s=es;return es<<=1,!(es&4194240)&&(es=64),s}function Lu(s){for(var c=[],T=0;31>T;T++)c.push(s);return c}function Dn(s,c,T){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-In(c),s[c]=T}function Mu(s,c){var T=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<T;){var j=31-In(T),W=1<<j;c[j]=0,N[j]=-1,s[j]=-1,T&=~W}}function rs(s,c){var T=s.entangledLanes|=c;for(s=s.entanglements;T;){var N=31-In(T),j=1<<N;j&c|s[N]&c&&(s[N]|=c),T&=~j}}var wt=0;function Tf(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var eo=i.unstable_scheduleCallback,Zn=i.unstable_cancelCallback,Af=i.unstable_shouldYield,kf=i.unstable_requestPaint,dr=i.unstable_now,ns=i.unstable_ImmediatePriority,P0=i.unstable_UserBlockingPriority,ne=i.unstable_NormalPriority,Te=i.unstable_IdlePriority,Ie=null,ft=null;function or(s){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Ie,s,void 0,(s.current.flags&128)===128)}catch{}}function Kr(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var lr=typeof Object.is=="function"?Object.is:Kr,It=null,Si=!1,is=!1;function x0(s){It===null?It=[s]:It.push(s)}function GS(s){Si=!0,x0(s)}function Vi(){if(!is&&It!==null){is=!0;var s=0,c=wt;try{var T=It;for(wt=1;s<T.length;s++){var N=T[s];do N=N(!0);while(N!==null)}It=null,Si=!1}catch(j){throw It!==null&&(It=It.slice(s+1)),eo(ns,Vi),j}finally{wt=c,is=!1}}return null}var as=[],os=0,Rf=null,Lf=0,Qn=[],Jn=0,Qo=null,ba=1,_a="";function Jo(s,c){as[os++]=Lf,as[os++]=Rf,Rf=s,Lf=c}function U2(s,c,T){Qn[Jn++]=ba,Qn[Jn++]=_a,Qn[Jn++]=Qo,Qo=s;var N=ba;s=_a;var j=32-In(N)-1;N&=~(1<<j),T+=1;var W=32-In(c)+j;if(30<W){var Q=j-j%5;W=(N&(1<<Q)-1).toString(32),N>>=Q,j-=Q,ba=1<<32-In(c)+j|T<<j|N,_a=W+s}else ba=1<<W|T<<j|N,_a=s}function C0(s){s.return!==null&&(Jo(s,1),U2(s,1,0))}function T0(s){for(;s===Rf;)Rf=as[--os],as[os]=null,Lf=as[--os],as[os]=null;for(;s===Qo;)Qo=Qn[--Jn],Qn[Jn]=null,_a=Qn[--Jn],Qn[Jn]=null,ba=Qn[--Jn],Qn[Jn]=null}var Fn=null,ei=null,Kt=!1,Nu=!1,Ei=null;function H2(s,c){var T=ai(5,null,null,0);T.elementType="DELETED",T.stateNode=c,T.return=s,c=s.deletions,c===null?(s.deletions=[T],s.flags|=16):c.push(T)}function G2(s,c){switch(s.tag){case 5:return c=Rr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,Fn=s,ei=fr(c),!0):!1;case 6:return c=Lr(c,s.pendingProps),c!==null?(s.stateNode=c,Fn=s,ei=null,!0):!1;case 13:if(c=ln(c),c!==null){var T=Qo!==null?{id:ba,overflow:_a}:null;return s.memoizedState={dehydrated:c,treeContext:T,retryLane:1073741824},T=ai(18,null,null,0),T.stateNode=c,T.return=s,s.child=T,Fn=s,ei=null,!0}return!1;default:return!1}}function A0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function k0(s){if(Kt){var c=ei;if(c){var T=c;if(!G2(s,c)){if(A0(s))throw Error(o(418));c=Je(T);var N=Fn;c&&G2(s,c)?H2(N,T):(s.flags=s.flags&-4097|2,Kt=!1,Fn=s)}}else{if(A0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Kt=!1,Fn=s}}}function $2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Fn=s}function Mf(s){if(!ae||s!==Fn)return!1;if(!Kt)return $2(s),Kt=!0,!1;if(s.tag!==3&&(s.tag!==5||Ka(s.type)&&!K(s.type,s.memoizedProps))){var c=ei;if(c){if(A0(s))throw V2(),Error(o(418));for(;c;)H2(s,c),c=Je(c)}}if($2(s),s.tag===13){if(!ae)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));ei=Mn(s)}else ei=Fn?Je(s.stateNode):null;return!0}function V2(){for(var s=ei;s;)s=Je(s)}function ls(){ae&&(ei=Fn=null,Nu=Kt=!1)}function R0(s){Ei===null?Ei=[s]:Ei.push(s)}var $S=l.ReactCurrentBatchConfig;function Nf(s,c){if(lr(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var T=Object.keys(s),N=Object.keys(c);if(T.length!==N.length)return!1;for(N=0;N<T.length;N++){var j=T[N];if(!Ru.call(c,j)||!lr(s[j],c[j]))return!1}return!0}function VS(s){switch(s.tag){case 5:return Za(s.type);case 16:return Za("Lazy");case 13:return Za("Suspense");case 19:return Za("SuspenseList");case 0:case 2:case 15:return s=ku(s.type,!1),s;case 11:return s=ku(s.type.render,!1),s;case 1:return s=ku(s.type,!0),s;default:return""}}function Iu(s,c,T){if(s=T.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(T._owner){if(T=T._owner,T){if(T.tag!==1)throw Error(o(309));var N=T.stateNode}if(!N)throw Error(o(147,s));var j=N,W=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===W?c.ref:(c=function(Q){var se=j.refs;Q===null?delete se[W]:se[W]=Q},c._stringRef=W,c)}if(typeof s!="string")throw Error(o(284));if(!T._owner)throw Error(o(290,s))}return s}function If(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function q2(s){var c=s._init;return c(s._payload)}function W2(s){function c(me,ce){if(s){var be=me.deletions;be===null?(me.deletions=[ce],me.flags|=16):be.push(ce)}}function T(me,ce){if(!s)return null;for(;ce!==null;)c(me,ce),ce=ce.sibling;return null}function N(me,ce){for(me=new Map;ce!==null;)ce.key!==null?me.set(ce.key,ce):me.set(ce.index,ce),ce=ce.sibling;return me}function j(me,ce){return me=lo(me,ce),me.index=0,me.sibling=null,me}function W(me,ce,be){return me.index=be,s?(be=me.alternate,be!==null?(be=be.index,be<ce?(me.flags|=2,ce):be):(me.flags|=2,ce)):(me.flags|=1048576,ce)}function Q(me){return s&&me.alternate===null&&(me.flags|=2),me}function se(me,ce,be,Be){return ce===null||ce.tag!==6?(ce=x1(be,me.mode,Be),ce.return=me,ce):(ce=j(ce,be),ce.return=me,ce)}function ye(me,ce,be,Be){var et=be.type;return et===v?Ve(me,ce,be.props.children,Be,be.key):ce!==null&&(ce.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===d&&q2(et)===ce.type)?(Be=j(ce,be.props),Be.ref=Iu(me,ce,be),Be.return=me,Be):(Be=dd(be.type,be.key,be.props,null,me.mode,Be),Be.ref=Iu(me,ce,be),Be.return=me,Be)}function Re(me,ce,be,Be){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==be.containerInfo||ce.stateNode.implementation!==be.implementation?(ce=C1(be,me.mode,Be),ce.return=me,ce):(ce=j(ce,be.children||[]),ce.return=me,ce)}function Ve(me,ce,be,Be,et){return ce===null||ce.tag!==7?(ce=ol(be,me.mode,Be,et),ce.return=me,ce):(ce=j(ce,be),ce.return=me,ce)}function lt(me,ce,be){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return ce=x1(""+ce,me.mode,be),ce.return=me,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case u:return be=dd(ce.type,ce.key,ce.props,null,me.mode,be),be.ref=Iu(me,null,ce),be.return=me,be;case f:return ce=C1(ce,me.mode,be),ce.return=me,ce;case d:var Be=ce._init;return lt(me,Be(ce._payload),be)}if(V(ce)||k(ce))return ce=ol(ce,me.mode,be,null),ce.return=me,ce;If(me,ce)}return null}function je(me,ce,be,Be){var et=ce!==null?ce.key:null;if(typeof be=="string"&&be!==""||typeof be=="number")return et!==null?null:se(me,ce,""+be,Be);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case u:return be.key===et?ye(me,ce,be,Be):null;case f:return be.key===et?Re(me,ce,be,Be):null;case d:return et=be._init,je(me,ce,et(be._payload),Be)}if(V(be)||k(be))return et!==null?null:Ve(me,ce,be,Be,null);If(me,be)}return null}function Vt(me,ce,be,Be,et){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return me=me.get(be)||null,se(ce,me,""+Be,et);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case u:return me=me.get(Be.key===null?be:Be.key)||null,ye(ce,me,Be,et);case f:return me=me.get(Be.key===null?be:Be.key)||null,Re(ce,me,Be,et);case d:var ht=Be._init;return Vt(me,ce,be,ht(Be._payload),et)}if(V(Be)||k(Be))return me=me.get(be)||null,Ve(ce,me,Be,et,null);If(ce,Be)}return null}function jt(me,ce,be,Be){for(var et=null,ht=null,st=ce,xt=ce=0,Dr=null;st!==null&&xt<be.length;xt++){st.index>xt?(Dr=st,st=null):Dr=st.sibling;var Ct=je(me,st,be[xt],Be);if(Ct===null){st===null&&(st=Dr);break}s&&st&&Ct.alternate===null&&c(me,st),ce=W(Ct,ce,xt),ht===null?et=Ct:ht.sibling=Ct,ht=Ct,st=Dr}if(xt===be.length)return T(me,st),Kt&&Jo(me,xt),et;if(st===null){for(;xt<be.length;xt++)st=lt(me,be[xt],Be),st!==null&&(ce=W(st,ce,xt),ht===null?et=st:ht.sibling=st,ht=st);return Kt&&Jo(me,xt),et}for(st=N(me,st);xt<be.length;xt++)Dr=Vt(st,me,xt,be[xt],Be),Dr!==null&&(s&&Dr.alternate!==null&&st.delete(Dr.key===null?xt:Dr.key),ce=W(Dr,ce,xt),ht===null?et=Dr:ht.sibling=Dr,ht=Dr);return s&&st.forEach(function(so){return c(me,so)}),Kt&&Jo(me,xt),et}function wn(me,ce,be,Be){var et=k(be);if(typeof et!="function")throw Error(o(150));if(be=et.call(be),be==null)throw Error(o(151));for(var ht=et=null,st=ce,xt=ce=0,Dr=null,Ct=be.next();st!==null&&!Ct.done;xt++,Ct=be.next()){st.index>xt?(Dr=st,st=null):Dr=st.sibling;var so=je(me,st,Ct.value,Be);if(so===null){st===null&&(st=Dr);break}s&&st&&so.alternate===null&&c(me,st),ce=W(so,ce,xt),ht===null?et=so:ht.sibling=so,ht=so,st=Dr}if(Ct.done)return T(me,st),Kt&&Jo(me,xt),et;if(st===null){for(;!Ct.done;xt++,Ct=be.next())Ct=lt(me,Ct.value,Be),Ct!==null&&(ce=W(Ct,ce,xt),ht===null?et=Ct:ht.sibling=Ct,ht=Ct);return Kt&&Jo(me,xt),et}for(st=N(me,st);!Ct.done;xt++,Ct=be.next())Ct=Vt(st,me,xt,Ct.value,Be),Ct!==null&&(s&&Ct.alternate!==null&&st.delete(Ct.key===null?xt:Ct.key),ce=W(Ct,ce,xt),ht===null?et=Ct:ht.sibling=Ct,ht=Ct);return s&&st.forEach(function(wE){return c(me,wE)}),Kt&&Jo(me,xt),et}function Oa(me,ce,be,Be){if(typeof be=="object"&&be!==null&&be.type===v&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case u:e:{for(var et=be.key,ht=ce;ht!==null;){if(ht.key===et){if(et=be.type,et===v){if(ht.tag===7){T(me,ht.sibling),ce=j(ht,be.props.children),ce.return=me,me=ce;break e}}else if(ht.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===d&&q2(et)===ht.type){T(me,ht.sibling),ce=j(ht,be.props),ce.ref=Iu(me,ht,be),ce.return=me,me=ce;break e}T(me,ht);break}else c(me,ht);ht=ht.sibling}be.type===v?(ce=ol(be.props.children,me.mode,Be,be.key),ce.return=me,me=ce):(Be=dd(be.type,be.key,be.props,null,me.mode,Be),Be.ref=Iu(me,ce,be),Be.return=me,me=Be)}return Q(me);case f:e:{for(ht=be.key;ce!==null;){if(ce.key===ht)if(ce.tag===4&&ce.stateNode.containerInfo===be.containerInfo&&ce.stateNode.implementation===be.implementation){T(me,ce.sibling),ce=j(ce,be.children||[]),ce.return=me,me=ce;break e}else{T(me,ce);break}else c(me,ce);ce=ce.sibling}ce=C1(be,me.mode,Be),ce.return=me,me=ce}return Q(me);case d:return ht=be._init,Oa(me,ce,ht(be._payload),Be)}if(V(be))return jt(me,ce,be,Be);if(k(be))return wn(me,ce,be,Be);If(me,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,ce!==null&&ce.tag===6?(T(me,ce.sibling),ce=j(ce,be),ce.return=me,me=ce):(T(me,ce),ce=x1(be,me.mode,Be),ce.return=me,me=ce),Q(me)):T(me,ce)}return Oa}var ss=W2(!0),Y2=W2(!1),Df=un(null),Ff=null,us=null,L0=null;function M0(){L0=us=Ff=null}function K2(s,c,T){J?(Rt(Df,c._currentValue),c._currentValue=T):(Rt(Df,c._currentValue2),c._currentValue2=T)}function N0(s){var c=Df.current;Nt(Df),J?s._currentValue=c:s._currentValue2=c}function I0(s,c,T){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===T)break;s=s.return}}function cs(s,c){Ff=s,L0=us=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(yn=!0),s.firstContext=null)}function ti(s){var c=J?s._currentValue:s._currentValue2;if(L0!==s)if(s={context:s,memoizedValue:c,next:null},us===null){if(Ff===null)throw Error(o(308));us=s,Ff.dependencies={lanes:0,firstContext:s}}else us=us.next=s;return c}var el=null;function D0(s){el===null?el=[s]:el.push(s)}function X2(s,c,T,N){var j=c.interleaved;return j===null?(T.next=T,D0(c)):(T.next=j.next,j.next=T),c.interleaved=T,qi(s,N)}function qi(s,c){s.lanes|=c;var T=s.alternate;for(T!==null&&(T.lanes|=c),T=s,s=s.return;s!==null;)s.childLanes|=c,T=s.alternate,T!==null&&(T.childLanes|=c),T=s,s=s.return;return T.tag===3?T.stateNode:null}var to=!1;function F0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Z2(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 wa(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function ro(s,c,T){var N=s.updateQueue;if(N===null)return null;if(N=N.shared,mt&2){var j=N.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),N.pending=c,qi(s,T)}return j=N.interleaved,j===null?(c.next=c,D0(N)):(c.next=j.next,j.next=c),N.interleaved=c,qi(s,T)}function jf(s,c,T){if(c=c.updateQueue,c!==null&&(c=c.shared,(T&4194240)!==0)){var N=c.lanes;N&=s.pendingLanes,T|=N,c.lanes=T,rs(s,T)}}function Q2(s,c){var T=s.updateQueue,N=s.alternate;if(N!==null&&(N=N.updateQueue,T===N)){var j=null,W=null;if(T=T.firstBaseUpdate,T!==null){do{var Q={eventTime:T.eventTime,lane:T.lane,tag:T.tag,payload:T.payload,callback:T.callback,next:null};W===null?j=W=Q:W=W.next=Q,T=T.next}while(T!==null);W===null?j=W=c:W=W.next=c}else j=W=c;T={baseState:N.baseState,firstBaseUpdate:j,lastBaseUpdate:W,shared:N.shared,effects:N.effects},s.updateQueue=T;return}s=T.lastBaseUpdate,s===null?T.firstBaseUpdate=c:s.next=c,T.lastBaseUpdate=c}function zf(s,c,T,N){var j=s.updateQueue;to=!1;var W=j.firstBaseUpdate,Q=j.lastBaseUpdate,se=j.shared.pending;if(se!==null){j.shared.pending=null;var ye=se,Re=ye.next;ye.next=null,Q===null?W=Re:Q.next=Re,Q=ye;var Ve=s.alternate;Ve!==null&&(Ve=Ve.updateQueue,se=Ve.lastBaseUpdate,se!==Q&&(se===null?Ve.firstBaseUpdate=Re:se.next=Re,Ve.lastBaseUpdate=ye))}if(W!==null){var lt=j.baseState;Q=0,Ve=Re=ye=null,se=W;do{var je=se.lane,Vt=se.eventTime;if((N&je)===je){Ve!==null&&(Ve=Ve.next={eventTime:Vt,lane:0,tag:se.tag,payload:se.payload,callback:se.callback,next:null});e:{var jt=s,wn=se;switch(je=c,Vt=T,wn.tag){case 1:if(jt=wn.payload,typeof jt=="function"){lt=jt.call(Vt,lt,je);break e}lt=jt;break e;case 3:jt.flags=jt.flags&-65537|128;case 0:if(jt=wn.payload,je=typeof jt=="function"?jt.call(Vt,lt,je):jt,je==null)break e;lt=a({},lt,je);break e;case 2:to=!0}}se.callback!==null&&se.lane!==0&&(s.flags|=64,je=j.effects,je===null?j.effects=[se]:je.push(se))}else Vt={eventTime:Vt,lane:je,tag:se.tag,payload:se.payload,callback:se.callback,next:null},Ve===null?(Re=Ve=Vt,ye=lt):Ve=Ve.next=Vt,Q|=je;if(se=se.next,se===null){if(se=j.shared.pending,se===null)break;je=se,se=je.next,je.next=null,j.lastBaseUpdate=je,j.shared.pending=null}}while(!0);if(Ve===null&&(ye=lt),j.baseState=ye,j.firstBaseUpdate=Re,j.lastBaseUpdate=Ve,c=j.shared.interleaved,c!==null){j=c;do Q|=j.lane,j=j.next;while(j!==c)}else W===null&&(j.shared.lanes=0);rl|=Q,s.lanes=Q,s.memoizedState=lt}}function J2(s,c,T){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=T,typeof j!="function")throw Error(o(191,j));j.call(N)}}}var Du={},ri=un(Du),Fu=un(Du),fs=un(Du);function Wi(s){if(s===Du)throw Error(o(174));return s}function j0(s,c){Rt(fs,c),Rt(Fu,s),Rt(ri,Du),s=z(c),Nt(ri),Rt(ri,s)}function ds(){Nt(ri),Nt(Fu),Nt(fs)}function eb(s){var c=Wi(fs.current),T=Wi(ri.current);c=F(T,s.type,c),T!==c&&(Rt(Fu,s),Rt(ri,c))}function z0(s){Fu.current===s&&(Nt(ri),Nt(Fu))}var Jt=un(0);function Bf(s){for(var c=s;c!==null;){if(c.tag===13){var T=c.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||De(T)||rt(T)))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 B0=[];function U0(){for(var s=0;s<B0.length;s++){var c=B0[s];J?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}B0.length=0}var Uf=l.ReactCurrentDispatcher,H0=l.ReactCurrentBatchConfig,tl=0,er=null,Er=null,Nr=null,Hf=!1,ju=!1,zu=0,qS=0;function Xr(){throw Error(o(321))}function G0(s,c){if(c===null)return!1;for(var T=0;T<c.length&&T<s.length;T++)if(!lr(s[T],c[T]))return!1;return!0}function $0(s,c,T,N,j,W){if(tl=W,er=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Uf.current=s===null||s.memoizedState===null?XS:ZS,s=T(N,j),ju){W=0;do{if(ju=!1,zu=0,25<=W)throw Error(o(301));W+=1,Nr=Er=null,c.updateQueue=null,Uf.current=QS,s=T(N,j)}while(ju)}if(Uf.current=Vf,c=Er!==null&&Er.next!==null,tl=0,Nr=Er=er=null,Hf=!1,c)throw Error(o(300));return s}function V0(){var s=zu!==0;return zu=0,s}function Yi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nr===null?er.memoizedState=Nr=s:Nr=Nr.next=s,Nr}function ni(){if(Er===null){var s=er.alternate;s=s!==null?s.memoizedState:null}else s=Er.next;var c=Nr===null?er.memoizedState:Nr.next;if(c!==null)Nr=c,Er=s;else{if(s===null)throw Error(o(310));Er=s,s={memoizedState:Er.memoizedState,baseState:Er.baseState,baseQueue:Er.baseQueue,queue:Er.queue,next:null},Nr===null?er.memoizedState=Nr=s:Nr=Nr.next=s}return Nr}function Bu(s,c){return typeof c=="function"?c(s):c}function q0(s){var c=ni(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var N=Er,j=N.baseQueue,W=T.pending;if(W!==null){if(j!==null){var Q=j.next;j.next=W.next,W.next=Q}N.baseQueue=j=W,T.pending=null}if(j!==null){W=j.next,N=N.baseState;var se=Q=null,ye=null,Re=W;do{var Ve=Re.lane;if((tl&Ve)===Ve)ye!==null&&(ye=ye.next={lane:0,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),N=Re.hasEagerState?Re.eagerState:s(N,Re.action);else{var lt={lane:Ve,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null};ye===null?(se=ye=lt,Q=N):ye=ye.next=lt,er.lanes|=Ve,rl|=Ve}Re=Re.next}while(Re!==null&&Re!==W);ye===null?Q=N:ye.next=se,lr(N,c.memoizedState)||(yn=!0),c.memoizedState=N,c.baseState=Q,c.baseQueue=ye,T.lastRenderedState=N}if(s=T.interleaved,s!==null){j=s;do W=j.lane,er.lanes|=W,rl|=W,j=j.next;while(j!==s)}else j===null&&(T.lanes=0);return[c.memoizedState,T.dispatch]}function W0(s){var c=ni(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var N=T.dispatch,j=T.pending,W=c.memoizedState;if(j!==null){T.pending=null;var Q=j=j.next;do W=s(W,Q.action),Q=Q.next;while(Q!==j);lr(W,c.memoizedState)||(yn=!0),c.memoizedState=W,c.baseQueue===null&&(c.baseState=W),T.lastRenderedState=W}return[W,N]}function tb(){}function rb(s,c){var T=er,N=ni(),j=c(),W=!lr(N.memoizedState,j);if(W&&(N.memoizedState=j,yn=!0),N=N.queue,Y0(ab.bind(null,T,N,s),[s]),N.getSnapshot!==c||W||Nr!==null&&Nr.memoizedState.tag&1){if(T.flags|=2048,Uu(9,ib.bind(null,T,N,j,c),void 0,null),Ir===null)throw Error(o(349));tl&30||nb(T,c,j)}return j}function nb(s,c,T){s.flags|=16384,s={getSnapshot:c,value:T},c=er.updateQueue,c===null?(c={lastEffect:null,stores:null},er.updateQueue=c,c.stores=[s]):(T=c.stores,T===null?c.stores=[s]:T.push(s))}function ib(s,c,T,N){c.value=T,c.getSnapshot=N,ob(c)&&lb(s)}function ab(s,c,T){return T(function(){ob(c)&&lb(s)})}function ob(s){var c=s.getSnapshot;s=s.value;try{var T=c();return!lr(s,T)}catch{return!0}}function lb(s){var c=qi(s,1);c!==null&&ii(c,s,1,-1)}function sb(s){var c=Yi();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:s},c.queue=s,s=s.dispatch=KS.bind(null,er,s),[c.memoizedState,s]}function Uu(s,c,T,N){return s={tag:s,create:c,destroy:T,deps:N,next:null},c=er.updateQueue,c===null?(c={lastEffect:null,stores:null},er.updateQueue=c,c.lastEffect=s.next=s):(T=c.lastEffect,T===null?c.lastEffect=s.next=s:(N=T.next,T.next=s,s.next=N,c.lastEffect=s)),s}function ub(){return ni().memoizedState}function Gf(s,c,T,N){var j=Yi();er.flags|=s,j.memoizedState=Uu(1|c,T,void 0,N===void 0?null:N)}function $f(s,c,T,N){var j=ni();N=N===void 0?null:N;var W=void 0;if(Er!==null){var Q=Er.memoizedState;if(W=Q.destroy,N!==null&&G0(N,Q.deps)){j.memoizedState=Uu(c,T,W,N);return}}er.flags|=s,j.memoizedState=Uu(1|c,T,W,N)}function cb(s,c){return Gf(8390656,8,s,c)}function Y0(s,c){return $f(2048,8,s,c)}function fb(s,c){return $f(4,2,s,c)}function db(s,c){return $f(4,4,s,c)}function hb(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 pb(s,c,T){return T=T!=null?T.concat([s]):null,$f(4,4,hb.bind(null,c,s),T)}function K0(){}function gb(s,c){var T=ni();c=c===void 0?null:c;var N=T.memoizedState;return N!==null&&c!==null&&G0(c,N[1])?N[0]:(T.memoizedState=[s,c],s)}function vb(s,c){var T=ni();c=c===void 0?null:c;var N=T.memoizedState;return N!==null&&c!==null&&G0(c,N[1])?N[0]:(s=s(),T.memoizedState=[s,c],s)}function mb(s,c,T){return tl&21?(lr(T,c)||(T=ts(),er.lanes|=T,rl|=T,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,yn=!0),s.memoizedState=T)}function WS(s,c){var T=wt;wt=T!==0&&4>T?T:4,s(!0);var N=H0.transition;H0.transition={};try{s(!1),c()}finally{wt=T,H0.transition=N}}function yb(){return ni().memoizedState}function YS(s,c,T){var N=ao(s);if(T={lane:N,action:T,hasEagerState:!1,eagerState:null,next:null},bb(s))_b(c,T);else if(T=X2(s,c,T,N),T!==null){var j=Jr();ii(T,s,N,j),wb(T,c,N)}}function KS(s,c,T){var N=ao(s),j={lane:N,action:T,hasEagerState:!1,eagerState:null,next:null};if(bb(s))_b(c,j);else{var W=s.alternate;if(s.lanes===0&&(W===null||W.lanes===0)&&(W=c.lastRenderedReducer,W!==null))try{var Q=c.lastRenderedState,se=W(Q,T);if(j.hasEagerState=!0,j.eagerState=se,lr(se,Q)){var ye=c.interleaved;ye===null?(j.next=j,D0(c)):(j.next=ye.next,ye.next=j),c.interleaved=j;return}}catch{}finally{}T=X2(s,c,j,N),T!==null&&(j=Jr(),ii(T,s,N,j),wb(T,c,N))}}function bb(s){var c=s.alternate;return s===er||c!==null&&c===er}function _b(s,c){ju=Hf=!0;var T=s.pending;T===null?c.next=c:(c.next=T.next,T.next=c),s.pending=c}function wb(s,c,T){if(T&4194240){var N=c.lanes;N&=s.pendingLanes,T|=N,c.lanes=T,rs(s,T)}}var Vf={readContext:ti,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useInsertionEffect:Xr,useLayoutEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useMutableSource:Xr,useSyncExternalStore:Xr,useId:Xr,unstable_isNewReconciler:!1},XS={readContext:ti,useCallback:function(s,c){return Yi().memoizedState=[s,c===void 0?null:c],s},useContext:ti,useEffect:cb,useImperativeHandle:function(s,c,T){return T=T!=null?T.concat([s]):null,Gf(4194308,4,hb.bind(null,c,s),T)},useLayoutEffect:function(s,c){return Gf(4194308,4,s,c)},useInsertionEffect:function(s,c){return Gf(4,2,s,c)},useMemo:function(s,c){var T=Yi();return c=c===void 0?null:c,s=s(),T.memoizedState=[s,c],s},useReducer:function(s,c,T){var N=Yi();return c=T!==void 0?T(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,er,s),[N.memoizedState,s]},useRef:function(s){var c=Yi();return s={current:s},c.memoizedState=s},useState:sb,useDebugValue:K0,useDeferredValue:function(s){return Yi().memoizedState=s},useTransition:function(){var s=sb(!1),c=s[0];return s=WS.bind(null,s[1]),Yi().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,T){var N=er,j=Yi();if(Kt){if(T===void 0)throw Error(o(407));T=T()}else{if(T=c(),Ir===null)throw Error(o(349));tl&30||nb(N,c,T)}j.memoizedState=T;var W={value:T,getSnapshot:c};return j.queue=W,cb(ab.bind(null,N,W,s),[s]),N.flags|=2048,Uu(9,ib.bind(null,N,W,T,c),void 0,null),T},useId:function(){var s=Yi(),c=Ir.identifierPrefix;if(Kt){var T=_a,N=ba;T=(N&~(1<<32-In(N)-1)).toString(32)+T,c=":"+c+"R"+T,T=zu++,0<T&&(c+="H"+T.toString(32)),c+=":"}else T=qS++,c=":"+c+"r"+T.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},ZS={readContext:ti,useCallback:gb,useContext:ti,useEffect:Y0,useImperativeHandle:pb,useInsertionEffect:fb,useLayoutEffect:db,useMemo:vb,useReducer:q0,useRef:ub,useState:function(){return q0(Bu)},useDebugValue:K0,useDeferredValue:function(s){var c=ni();return mb(c,Er.memoizedState,s)},useTransition:function(){var s=q0(Bu)[0],c=ni().memoizedState;return[s,c]},useMutableSource:tb,useSyncExternalStore:rb,useId:yb,unstable_isNewReconciler:!1},QS={readContext:ti,useCallback:gb,useContext:ti,useEffect:Y0,useImperativeHandle:pb,useInsertionEffect:fb,useLayoutEffect:db,useMemo:vb,useReducer:W0,useRef:ub,useState:function(){return W0(Bu)},useDebugValue:K0,useDeferredValue:function(s){var c=ni();return Er===null?c.memoizedState=s:mb(c,Er.memoizedState,s)},useTransition:function(){var s=W0(Bu)[0],c=ni().memoizedState;return[s,c]},useMutableSource:tb,useSyncExternalStore:rb,useId:yb,unstable_isNewReconciler:!1};function Oi(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var T in s)c[T]===void 0&&(c[T]=s[T]);return c}return c}function X0(s,c,T,N){c=s.memoizedState,T=T(N,c),T=T==null?c:a({},c,T),s.memoizedState=T,s.lanes===0&&(s.updateQueue.baseState=T)}var qf={isMounted:function(s){return(s=s._reactInternals)?P(s)===s:!1},enqueueSetState:function(s,c,T){s=s._reactInternals;var N=Jr(),j=ao(s),W=wa(N,j);W.payload=c,T!=null&&(W.callback=T),c=ro(s,W,j),c!==null&&(ii(c,s,j,N),jf(c,s,j))},enqueueReplaceState:function(s,c,T){s=s._reactInternals;var N=Jr(),j=ao(s),W=wa(N,j);W.tag=1,W.payload=c,T!=null&&(W.callback=T),c=ro(s,W,j),c!==null&&(ii(c,s,j,N),jf(c,s,j))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var T=Jr(),N=ao(s),j=wa(T,N);j.tag=2,c!=null&&(j.callback=c),c=ro(s,j,N),c!==null&&(ii(c,s,N,T),jf(c,s,N))}};function Sb(s,c,T,N,j,W,Q){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(N,W,Q):c.prototype&&c.prototype.isPureReactComponent?!Nf(T,N)||!Nf(j,W):!0}function Eb(s,c,T){var N=!1,j=bi,W=c.contextType;return typeof W=="object"&&W!==null?W=ti(W):(j=Yt(c)?Xn:mr.current,N=c.contextTypes,W=(N=N!=null)?_i(s,j):bi),c=new c(T,W),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=qf,s.stateNode=c,c._reactInternals=s,N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=j,s.__reactInternalMemoizedMaskedChildContext=W),c}function Ob(s,c,T,N){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(T,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(T,N),c.state!==s&&qf.enqueueReplaceState(c,c.state,null)}function Z0(s,c,T,N){var j=s.stateNode;j.props=T,j.state=s.memoizedState,j.refs={},F0(s);var W=c.contextType;typeof W=="object"&&W!==null?j.context=ti(W):(W=Yt(c)?Xn:mr.current,j.context=_i(s,W)),j.state=s.memoizedState,W=c.getDerivedStateFromProps,typeof W=="function"&&(X0(s,c,W,T),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&&qf.enqueueReplaceState(j,j.state,null),zf(s,T,j,N),j.state=s.memoizedState),typeof j.componentDidMount=="function"&&(s.flags|=4194308)}function hs(s,c){try{var T="",N=c;do T+=VS(N),N=N.return;while(N);var j=T}catch(W){j=`
56
+ Error generating stack: `+W.message+`
57
+ `+W.stack}return{value:s,source:c,stack:j,digest:null}}function Q0(s,c,T){return{value:s,source:null,stack:T??null,digest:c??null}}function J0(s,c){try{console.error(c.value)}catch(T){setTimeout(function(){throw T})}}var JS=typeof WeakMap=="function"?WeakMap:Map;function Pb(s,c,T){T=wa(-1,T),T.tag=3,T.payload={element:null};var N=c.value;return T.callback=function(){od||(od=!0,b1=N),J0(s,c)},T}function xb(s,c,T){T=wa(-1,T),T.tag=3;var N=s.type.getDerivedStateFromError;if(typeof N=="function"){var j=c.value;T.payload=function(){return N(j)},T.callback=function(){J0(s,c)}}var W=s.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&(T.callback=function(){J0(s,c),typeof N!="function"&&(no===null?no=new Set([this]):no.add(this));var Q=c.stack;this.componentDidCatch(c.value,{componentStack:Q!==null?Q:""})}),T}function Cb(s,c,T){var N=s.pingCache;if(N===null){N=s.pingCache=new JS;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(T)||(j.add(T),s=hE.bind(null,s,c,T),c.then(s,s))}function Tb(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 Ab(s,c,T,N,j){return s.mode&1?(s.flags|=65536,s.lanes=j,s):(s===c?s.flags|=65536:(s.flags|=128,T.flags|=131072,T.flags&=-52805,T.tag===1&&(T.alternate===null?T.tag=17:(c=wa(-1,1),c.tag=2,ro(T,c,1))),T.lanes|=1),s)}var eE=l.ReactCurrentOwner,yn=!1;function cn(s,c,T,N){c.child=s===null?Y2(c,null,T,N):ss(c,s.child,T,N)}function kb(s,c,T,N,j){T=T.render;var W=c.ref;return cs(c,j),N=$0(s,c,T,N,W,j),T=V0(),s!==null&&!yn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,Sa(s,c,j)):(Kt&&T&&C0(c),c.flags|=1,cn(s,c,N,j),c.child)}function Rb(s,c,T,N,j){if(s===null){var W=T.type;return typeof W=="function"&&!P1(W)&&W.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(c.tag=15,c.type=W,Lb(s,c,W,N,j)):(s=dd(T.type,null,N,c,c.mode,j),s.ref=c.ref,s.return=c,c.child=s)}if(W=s.child,!(s.lanes&j)){var Q=W.memoizedProps;if(T=T.compare,T=T!==null?T:Nf,T(Q,N)&&s.ref===c.ref)return Sa(s,c,j)}return c.flags|=1,s=lo(W,N),s.ref=c.ref,s.return=c,c.child=s}function Lb(s,c,T,N,j){if(s!==null){var W=s.memoizedProps;if(Nf(W,N)&&s.ref===c.ref)if(yn=!1,c.pendingProps=N=W,(s.lanes&j)!==0)s.flags&131072&&(yn=!0);else return c.lanes=s.lanes,Sa(s,c,j)}return e1(s,c,T,N,j)}function Mb(s,c,T){var N=c.pendingProps,j=N.children,W=s!==null?s.memoizedState:null;if(N.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(gs,jn),jn|=T;else{if(!(T&1073741824))return s=W!==null?W.baseLanes|T:T,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Rt(gs,jn),jn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=W!==null?W.baseLanes:T,Rt(gs,jn),jn|=N}else W!==null?(N=W.baseLanes|T,c.memoizedState=null):N=T,Rt(gs,jn),jn|=N;return cn(s,c,j,T),c.child}function Nb(s,c){var T=c.ref;(s===null&&T!==null||s!==null&&s.ref!==T)&&(c.flags|=512,c.flags|=2097152)}function e1(s,c,T,N,j){var W=Yt(T)?Xn:mr.current;return W=_i(c,W),cs(c,j),T=$0(s,c,T,N,W,j),N=V0(),s!==null&&!yn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,Sa(s,c,j)):(Kt&&N&&C0(c),c.flags|=1,cn(s,c,T,j),c.child)}function Ib(s,c,T,N,j){if(Yt(T)){var W=!0;Jl(c)}else W=!1;if(cs(c,j),c.stateNode===null)Yf(s,c),Eb(c,T,N),Z0(c,T,N,j),N=!0;else if(s===null){var Q=c.stateNode,se=c.memoizedProps;Q.props=se;var ye=Q.context,Re=T.contextType;typeof Re=="object"&&Re!==null?Re=ti(Re):(Re=Yt(T)?Xn:mr.current,Re=_i(c,Re));var Ve=T.getDerivedStateFromProps,lt=typeof Ve=="function"||typeof Q.getSnapshotBeforeUpdate=="function";lt||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(se!==N||ye!==Re)&&Ob(c,Q,N,Re),to=!1;var je=c.memoizedState;Q.state=je,zf(c,N,Q,j),ye=c.memoizedState,se!==N||je!==ye||Ur.current||to?(typeof Ve=="function"&&(X0(c,T,Ve,N),ye=c.memoizedState),(se=to||Sb(c,T,se,N,je,ye,Re))?(lt||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount()),typeof Q.componentDidMount=="function"&&(c.flags|=4194308)):(typeof Q.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=N,c.memoizedState=ye),Q.props=N,Q.state=ye,Q.context=Re,N=se):(typeof Q.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{Q=c.stateNode,Z2(s,c),se=c.memoizedProps,Re=c.type===c.elementType?se:Oi(c.type,se),Q.props=Re,lt=c.pendingProps,je=Q.context,ye=T.contextType,typeof ye=="object"&&ye!==null?ye=ti(ye):(ye=Yt(T)?Xn:mr.current,ye=_i(c,ye));var Vt=T.getDerivedStateFromProps;(Ve=typeof Vt=="function"||typeof Q.getSnapshotBeforeUpdate=="function")||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(se!==lt||je!==ye)&&Ob(c,Q,N,ye),to=!1,je=c.memoizedState,Q.state=je,zf(c,N,Q,j);var jt=c.memoizedState;se!==lt||je!==jt||Ur.current||to?(typeof Vt=="function"&&(X0(c,T,Vt,N),jt=c.memoizedState),(Re=to||Sb(c,T,Re,N,je,jt,ye)||!1)?(Ve||typeof Q.UNSAFE_componentWillUpdate!="function"&&typeof Q.componentWillUpdate!="function"||(typeof Q.componentWillUpdate=="function"&&Q.componentWillUpdate(N,jt,ye),typeof Q.UNSAFE_componentWillUpdate=="function"&&Q.UNSAFE_componentWillUpdate(N,jt,ye)),typeof Q.componentDidUpdate=="function"&&(c.flags|=4),typeof Q.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof Q.componentDidUpdate!="function"||se===s.memoizedProps&&je===s.memoizedState||(c.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||se===s.memoizedProps&&je===s.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=jt),Q.props=N,Q.state=jt,Q.context=ye,N=Re):(typeof Q.componentDidUpdate!="function"||se===s.memoizedProps&&je===s.memoizedState||(c.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||se===s.memoizedProps&&je===s.memoizedState||(c.flags|=1024),N=!1)}return t1(s,c,T,N,W,j)}function t1(s,c,T,N,j,W){Nb(s,c);var Q=(c.flags&128)!==0;if(!N&&!Q)return j&&ma(c,T,!1),Sa(s,c,W);N=c.stateNode,eE.current=c;var se=Q&&typeof T.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,s!==null&&Q?(c.child=ss(c,s.child,null,W),c.child=ss(c,null,se,W)):cn(s,c,se,W),c.memoizedState=N.state,j&&ma(c,T,!0),c.child}function Db(s){var c=s.stateNode;c.pendingContext?Zl(s,c.pendingContext,c.pendingContext!==c.context):c.context&&Zl(s,c.context,!1),j0(s,c.containerInfo)}function Fb(s,c,T,N,j){return ls(),R0(j),c.flags|=256,cn(s,c,T,N),c.child}var r1={dehydrated:null,treeContext:null,retryLane:0};function n1(s){return{baseLanes:s,cachePool:null,transitions:null}}function jb(s,c,T){var N=c.pendingProps,j=Jt.current,W=!1,Q=(c.flags&128)!==0,se;if((se=Q)||(se=s!==null&&s.memoizedState===null?!1:(j&2)!==0),se?(W=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(j|=1),Rt(Jt,j&1),s===null)return k0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?rt(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(Q=N.children,s=N.fallback,W?(N=c.mode,W=c.child,Q={mode:"hidden",children:Q},!(N&1)&&W!==null?(W.childLanes=0,W.pendingProps=Q):W=hd(Q,N,0,null),s=ol(s,N,T,null),W.return=c,s.return=c,W.sibling=s,c.child=W,c.child.memoizedState=n1(T),c.memoizedState=r1,s):i1(c,Q));if(j=s.memoizedState,j!==null&&(se=j.dehydrated,se!==null))return tE(s,c,Q,N,se,j,T);if(W){W=N.fallback,Q=c.mode,j=s.child,se=j.sibling;var ye={mode:"hidden",children:N.children};return!(Q&1)&&c.child!==j?(N=c.child,N.childLanes=0,N.pendingProps=ye,c.deletions=null):(N=lo(j,ye),N.subtreeFlags=j.subtreeFlags&14680064),se!==null?W=lo(se,W):(W=ol(W,Q,T,null),W.flags|=2),W.return=c,N.return=c,N.sibling=W,c.child=N,N=W,W=c.child,Q=s.child.memoizedState,Q=Q===null?n1(T):{baseLanes:Q.baseLanes|T,cachePool:null,transitions:Q.transitions},W.memoizedState=Q,W.childLanes=s.childLanes&~T,c.memoizedState=r1,N}return W=s.child,s=W.sibling,N=lo(W,{mode:"visible",children:N.children}),!(c.mode&1)&&(N.lanes=T),N.return=c,N.sibling=null,s!==null&&(T=c.deletions,T===null?(c.deletions=[s],c.flags|=16):T.push(s)),c.child=N,c.memoizedState=null,N}function i1(s,c){return c=hd({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Wf(s,c,T,N){return N!==null&&R0(N),ss(c,s.child,null,T),s=i1(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function tE(s,c,T,N,j,W,Q){if(T)return c.flags&256?(c.flags&=-257,N=Q0(Error(o(422))),Wf(s,c,Q,N)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(W=N.fallback,j=c.mode,N=hd({mode:"visible",children:N.children},j,0,null),W=ol(W,j,Q,null),W.flags|=2,N.return=c,W.return=c,N.sibling=W,c.child=N,c.mode&1&&ss(c,s.child,null,Q),c.child.memoizedState=n1(Q),c.memoizedState=r1,W);if(!(c.mode&1))return Wf(s,c,Q,null);if(rt(j))return N=Xe(j).digest,W=Error(o(419)),N=Q0(W,N,void 0),Wf(s,c,Q,N);if(T=(Q&s.childLanes)!==0,yn||T){if(N=Ir,N!==null){switch(Q&-Q){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|Q)?0:j,j!==0&&j!==W.retryLane&&(W.retryLane=j,qi(s,j),ii(N,s,j,-1))}return O1(),N=Q0(Error(o(421))),Wf(s,c,Q,N)}return De(j)?(c.flags|=128,c.child=s.child,c=pE.bind(null,s),kt(j,c),null):(s=W.treeContext,ae&&(ei=$t(j),Fn=c,Kt=!0,Ei=null,Nu=!1,s!==null&&(Qn[Jn++]=ba,Qn[Jn++]=_a,Qn[Jn++]=Qo,ba=s.id,_a=s.overflow,Qo=c)),c=i1(c,N.children),c.flags|=4096,c)}function zb(s,c,T){s.lanes|=c;var N=s.alternate;N!==null&&(N.lanes|=c),I0(s.return,c,T)}function a1(s,c,T,N,j){var W=s.memoizedState;W===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:T,tailMode:j}:(W.isBackwards=c,W.rendering=null,W.renderingStartTime=0,W.last=N,W.tail=T,W.tailMode=j)}function Bb(s,c,T){var N=c.pendingProps,j=N.revealOrder,W=N.tail;if(cn(s,c,N.children,T),N=Jt.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&&zb(s,T,c);else if(s.tag===19)zb(s,T,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(Rt(Jt,N),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(T=c.child,j=null;T!==null;)s=T.alternate,s!==null&&Bf(s)===null&&(j=T),T=T.sibling;T=j,T===null?(j=c.child,c.child=null):(j=T.sibling,T.sibling=null),a1(c,!1,j,T,W);break;case"backwards":for(T=null,j=c.child,c.child=null;j!==null;){if(s=j.alternate,s!==null&&Bf(s)===null){c.child=j;break}s=j.sibling,j.sibling=T,T=j,j=s}a1(c,!0,T,null,W);break;case"together":a1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Yf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Sa(s,c,T){if(s!==null&&(c.dependencies=s.dependencies),rl|=c.lanes,!(T&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,T=lo(s,s.pendingProps),c.child=T,T.return=c;s.sibling!==null;)s=s.sibling,T=T.sibling=lo(s,s.pendingProps),T.return=c;T.sibling=null}return c.child}function rE(s,c,T){switch(c.tag){case 3:Db(c),ls();break;case 5:eb(c);break;case 1:Yt(c.type)&&Jl(c);break;case 4:j0(c,c.stateNode.containerInfo);break;case 10:K2(c,c.type._context,c.memoizedProps.value);break;case 13:var N=c.memoizedState;if(N!==null)return N.dehydrated!==null?(Rt(Jt,Jt.current&1),c.flags|=128,null):T&c.child.childLanes?jb(s,c,T):(Rt(Jt,Jt.current&1),s=Sa(s,c,T),s!==null?s.sibling:null);Rt(Jt,Jt.current&1);break;case 19:if(N=(T&c.childLanes)!==0,s.flags&128){if(N)return Bb(s,c,T);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Rt(Jt,Jt.current),N)break;return null;case 22:case 23:return c.lanes=0,Mb(s,c,T)}return Sa(s,c,T)}function Ki(s){s.flags|=4}function Ub(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 Hu,Gu,Kf,Xf;if(ee)Hu=function(s,c){for(var T=c.child;T!==null;){if(T.tag===5||T.tag===6)B(s,T.stateNode);else if(T.tag!==4&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===c)break;for(;T.sibling===null;){if(T.return===null||T.return===c)return;T=T.return}T.sibling.return=T.return,T=T.sibling}},Gu=function(){},Kf=function(s,c,T,N,j){if(s=s.memoizedProps,s!==N){var W=c.stateNode,Q=Wi(ri.current);T=$(W,T,s,N,j,Q),(c.updateQueue=T)&&Ki(c)}},Xf=function(s,c,T,N){T!==N&&Ki(c)};else if(re){Hu=function(s,c,T,N){for(var j=c.child;j!==null;){if(j.tag===5){var W=j.stateNode;T&&N&&(W=Pt(W,j.type,j.memoizedProps,j)),B(s,W)}else if(j.tag===6)W=j.stateNode,T&&N&&(W=ar(W,j.memoizedProps,j)),B(s,W);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)W=j.child,W!==null&&(W.return=j),Hu(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 Hb=function(s,c,T,N){for(var j=c.child;j!==null;){if(j.tag===5){var W=j.stateNode;T&&N&&(W=Pt(W,j.type,j.memoizedProps,j)),He(s,W)}else if(j.tag===6)W=j.stateNode,T&&N&&(W=ar(W,j.memoizedProps,j)),He(s,W);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)W=j.child,W!==null&&(W.return=j),Hb(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 T=c.stateNode;if(!Ub(s,c)){s=T.containerInfo;var N=xe(s);Hb(N,c,!1,!1),T.pendingChildren=N,Ki(c),Qe(s,N)}},Kf=function(s,c,T,N,j){var W=s.stateNode,Q=s.memoizedProps;if((s=Ub(s,c))&&Q===N)c.stateNode=W;else{var se=c.stateNode,ye=Wi(ri.current),Re=null;Q!==N&&(Re=$(se,T,Q,N,j,ye)),s&&Re===null?c.stateNode=W:(W=Sr(W,Re,T,Q,N,c,s,se),D(W,T,N,j,ye)&&Ki(c),c.stateNode=W,s?Ki(c):Hu(W,c,!1,!1))}},Xf=function(s,c,T,N){T!==N?(s=Wi(fs.current),T=Wi(ri.current),c.stateNode=Y(N,s,T,c),Ki(c)):c.stateNode=s.stateNode}}else Gu=function(){},Kf=function(){},Xf=function(){};function $u(s,c){if(!Kt)switch(s.tailMode){case"hidden":c=s.tail;for(var T=null;c!==null;)c.alternate!==null&&(T=c),c=c.sibling;T===null?s.tail=null:T.sibling=null;break;case"collapsed":T=s.tail;for(var N=null;T!==null;)T.alternate!==null&&(N=T),T=T.sibling;N===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:N.sibling=null}}function Zr(s){var c=s.alternate!==null&&s.alternate.child===s.child,T=0,N=0;if(c)for(var j=s.child;j!==null;)T|=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;)T|=j.lanes|j.childLanes,N|=j.subtreeFlags,N|=j.flags,j.return=s,j=j.sibling;return s.subtreeFlags|=N,s.childLanes=T,c}function nE(s,c,T){var N=c.pendingProps;switch(T0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zr(c),null;case 1:return Yt(c.type)&&wi(),Zr(c),null;case 3:return T=c.stateNode,ds(),Nt(Ur),Nt(mr),U0(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(s===null||s.child===null)&&(Mf(c)?Ki(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Ei!==null&&(S1(Ei),Ei=null))),Gu(s,c),Zr(c),null;case 5:z0(c),T=Wi(fs.current);var j=c.type;if(s!==null&&c.stateNode!=null)Kf(s,c,j,N,T),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(o(166));return Zr(c),null}if(s=Wi(ri.current),Mf(c)){if(!ae)throw Error(o(175));s=Br(c.stateNode,c.type,c.memoizedProps,T,s,c,!Nu),c.updateQueue=s,s!==null&&Ki(c)}else{var W=I(j,N,T,s,c);Hu(W,c,!1,!1),c.stateNode=W,D(W,j,N,T,s)&&Ki(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Zr(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=Wi(fs.current),T=Wi(ri.current),Mf(c)){if(!ae)throw Error(o(176));if(s=c.stateNode,T=c.memoizedProps,(N=vr(s,T,c,!Nu))&&(j=Fn,j!==null))switch(j.tag){case 3:yi(j.stateNode.containerInfo,s,T,(j.mode&1)!==0);break;case 5:Kl(j.type,j.memoizedProps,j.stateNode,s,T,(j.mode&1)!==0)}N&&Ki(c)}else c.stateNode=Y(N,s,T,c)}return Zr(c),null;case 13:if(Nt(Jt),N=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Kt&&ei!==null&&c.mode&1&&!(c.flags&128))V2(),ls(),c.flags|=98560,j=!1;else if(j=Mf(c),N!==null&&N.dehydrated!==null){if(s===null){if(!j)throw Error(o(318));if(!ae)throw Error(o(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));Mr(j,c)}else ls(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Zr(c),j=!1}else Ei!==null&&(S1(Ei),Ei=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=T,c):(T=N!==null,T!==(s!==null&&s.memoizedState!==null)&&T&&(c.child.flags|=8192,c.mode&1&&(s===null||Jt.current&1?Or===0&&(Or=3):O1())),c.updateQueue!==null&&(c.flags|=4),Zr(c),null);case 4:return ds(),Gu(s,c),s===null&&ue(c.stateNode.containerInfo),Zr(c),null;case 10:return N0(c.type._context),Zr(c),null;case 17:return Yt(c.type)&&wi(),Zr(c),null;case 19:if(Nt(Jt),j=c.memoizedState,j===null)return Zr(c),null;if(N=(c.flags&128)!==0,W=j.rendering,W===null)if(N)$u(j,!1);else{if(Or!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(W=Bf(s),W!==null){for(c.flags|=128,$u(j,!1),s=W.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=T,T=c.child;T!==null;)N=T,j=s,N.flags&=14680066,W=N.alternate,W===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=W.childLanes,N.lanes=W.lanes,N.child=W.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=W.memoizedProps,N.memoizedState=W.memoizedState,N.updateQueue=W.updateQueue,N.type=W.type,j=W.dependencies,N.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),T=T.sibling;return Rt(Jt,Jt.current&1|2),c.child}s=s.sibling}j.tail!==null&&dr()>y1&&(c.flags|=128,N=!0,$u(j,!1),c.lanes=4194304)}else{if(!N)if(s=Bf(W),s!==null){if(c.flags|=128,N=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),$u(j,!0),j.tail===null&&j.tailMode==="hidden"&&!W.alternate&&!Kt)return Zr(c),null}else 2*dr()-j.renderingStartTime>y1&&T!==1073741824&&(c.flags|=128,N=!0,$u(j,!1),c.lanes=4194304);j.isBackwards?(W.sibling=c.child,c.child=W):(s=j.last,s!==null?s.sibling=W:c.child=W,j.last=W)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=dr(),c.sibling=null,s=Jt.current,Rt(Jt,N?s&1|2:s&1),c):(Zr(c),null);case 22:case 23:return E1(),T=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==T&&(c.flags|=8192),T&&c.mode&1?jn&1073741824&&(Zr(c),ee&&c.subtreeFlags&6&&(c.flags|=8192)):Zr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function iE(s,c){switch(T0(c),c.tag){case 1:return Yt(c.type)&&wi(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return ds(),Nt(Ur),Nt(mr),U0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return z0(c),null;case 13:if(Nt(Jt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));ls()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Nt(Jt),null;case 4:return ds(),null;case 10:return N0(c.type._context),null;case 22:case 23:return E1(),null;case 24:return null;default:return null}}var Zf=!1,Qr=!1,aE=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function ps(s,c){var T=s.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(N){Xt(s,c,N)}else T.current=null}function o1(s,c,T){try{T()}catch(N){Xt(s,c,N)}}var Gb=!1;function oE(s,c){for(G(s.containerInfo),Ge=c;Ge!==null;)if(s=Ge,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Ge=c;else for(;Ge!==null;){s=Ge;try{var T=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var N=T.memoizedProps,j=T.memoizedState,W=s.stateNode,Q=W.getSnapshotBeforeUpdate(s.elementType===s.type?N:Oi(s.type,N),j);W.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:ee&&Ye(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(se){Xt(s,s.return,se)}if(c=s.sibling,c!==null){c.return=s.return,Ge=c;break}Ge=s.return}return T=Gb,Gb=!1,T}function Vu(s,c,T){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 W=j.destroy;j.destroy=void 0,W!==void 0&&o1(c,T,W)}j=j.next}while(j!==N)}}function Qf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var T=c=c.next;do{if((T.tag&s)===s){var N=T.create;T.destroy=N()}T=T.next}while(T!==c)}}function l1(s){var c=s.ref;if(c!==null){var T=s.stateNode;switch(s.tag){case 5:s=q(T);break;default:s=T}typeof c=="function"?c(s):c.current=s}}function $b(s){var c=s.alternate;c!==null&&(s.alternate=null,$b(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&ze(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 Vb(s){return s.tag===5||s.tag===3||s.tag===4}function qb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Vb(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 s1(s,c,T){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?pe(T,s,c):tt(T,s);else if(N!==4&&(s=s.child,s!==null))for(s1(s,c,T),s=s.sibling;s!==null;)s1(s,c,T),s=s.sibling}function u1(s,c,T){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?fe(T,s,c):ke(T,s);else if(N!==4&&(s=s.child,s!==null))for(u1(s,c,T),s=s.sibling;s!==null;)u1(s,c,T),s=s.sibling}var Hr=null,Pi=!1;function Xi(s,c,T){for(T=T.child;T!==null;)c1(s,c,T),T=T.sibling}function c1(s,c,T){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Ie,T)}catch{}switch(T.tag){case 5:Qr||ps(T,c);case 6:if(ee){var N=Hr,j=Pi;Hr=null,Xi(s,c,T),Hr=N,Pi=j,Hr!==null&&(Pi?Oe(Hr,T.stateNode):nt(Hr,T.stateNode))}else Xi(s,c,T);break;case 18:ee&&Hr!==null&&(Pi?Kn(Hr,T.stateNode):sn(Hr,T.stateNode));break;case 4:ee?(N=Hr,j=Pi,Hr=T.stateNode.containerInfo,Pi=!0,Xi(s,c,T),Hr=N,Pi=j):(re&&(N=T.stateNode.containerInfo,j=xe(N),Et(N,j)),Xi(s,c,T));break;case 0:case 11:case 14:case 15:if(!Qr&&(N=T.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){j=N=N.next;do{var W=j,Q=W.destroy;W=W.tag,Q!==void 0&&(W&2||W&4)&&o1(T,c,Q),j=j.next}while(j!==N)}Xi(s,c,T);break;case 1:if(!Qr&&(ps(T,c),N=T.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=T.memoizedProps,N.state=T.memoizedState,N.componentWillUnmount()}catch(se){Xt(T,c,se)}Xi(s,c,T);break;case 21:Xi(s,c,T);break;case 22:T.mode&1?(Qr=(N=Qr)||T.memoizedState!==null,Xi(s,c,T),Qr=N):Xi(s,c,T);break;default:Xi(s,c,T)}}function Wb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var T=s.stateNode;T===null&&(T=s.stateNode=new aE),c.forEach(function(N){var j=gE.bind(null,s,N);T.has(N)||(T.add(N),N.then(j,j))})}}function xi(s,c){var T=c.deletions;if(T!==null)for(var N=0;N<T.length;N++){var j=T[N];try{var W=s,Q=c;if(ee){var se=Q;e:for(;se!==null;){switch(se.tag){case 5:Hr=se.stateNode,Pi=!1;break e;case 3:Hr=se.stateNode.containerInfo,Pi=!0;break e;case 4:Hr=se.stateNode.containerInfo,Pi=!0;break e}se=se.return}if(Hr===null)throw Error(o(160));c1(W,Q,j),Hr=null,Pi=!1}else c1(W,Q,j);var ye=j.alternate;ye!==null&&(ye.return=null),j.return=null}catch(Re){Xt(j,c,Re)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Yb(c,s),c=c.sibling}function Yb(s,c){var T=s.alternate,N=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(xi(c,s),Zi(s),N&4){try{Vu(3,s,s.return),Qf(3,s)}catch(je){Xt(s,s.return,je)}try{Vu(5,s,s.return)}catch(je){Xt(s,s.return,je)}}break;case 1:xi(c,s),Zi(s),N&512&&T!==null&&ps(T,T.return);break;case 5:if(xi(c,s),Zi(s),N&512&&T!==null&&ps(T,T.return),ee){if(s.flags&32){var j=s.stateNode;try{Fe(j)}catch(je){Xt(s,s.return,je)}}if(N&4&&(j=s.stateNode,j!=null)){var W=s.memoizedProps;if(T=T!==null?T.memoizedProps:W,N=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Bt(j,c,N,T,W,s)}catch(je){Xt(s,s.return,je)}}}break;case 6:if(xi(c,s),Zi(s),N&4&&ee){if(s.stateNode===null)throw Error(o(162));j=s.stateNode,W=s.memoizedProps,T=T!==null?T.memoizedProps:W;try{ot(j,T,W)}catch(je){Xt(s,s.return,je)}}break;case 3:if(xi(c,s),Zi(s),N&4){if(ee&&ae&&T!==null&&T.memoizedState.isDehydrated)try{mi(c.containerInfo)}catch(je){Xt(s,s.return,je)}if(re){j=c.containerInfo,W=c.pendingChildren;try{Et(j,W)}catch(je){Xt(s,s.return,je)}}}break;case 4:if(xi(c,s),Zi(s),N&4&&re){W=s.stateNode,j=W.containerInfo,W=W.pendingChildren;try{Et(j,W)}catch(je){Xt(s,s.return,je)}}break;case 13:xi(c,s),Zi(s),j=s.child,j.flags&8192&&(W=j.memoizedState!==null,j.stateNode.isHidden=W,!W||j.alternate!==null&&j.alternate.memoizedState!==null||(m1=dr())),N&4&&Wb(s);break;case 22:var Q=T!==null&&T.memoizedState!==null;if(s.mode&1?(Qr=(T=Qr)||Q,xi(c,s),Qr=T):xi(c,s),Zi(s),N&8192){if(T=s.memoizedState!==null,(s.stateNode.isHidden=T)&&!Q&&s.mode&1)for(Ge=s,N=s.child;N!==null;){for(c=Ge=N;Ge!==null;){Q=Ge;var se=Q.child;switch(Q.tag){case 0:case 11:case 14:case 15:Vu(4,Q,Q.return);break;case 1:ps(Q,Q.return);var ye=Q.stateNode;if(typeof ye.componentWillUnmount=="function"){var Re=Q,Ve=Q.return;try{var lt=Re;ye.props=lt.memoizedProps,ye.state=lt.memoizedState,ye.componentWillUnmount()}catch(je){Xt(Re,Ve,je)}}break;case 5:ps(Q,Q.return);break;case 22:if(Q.memoizedState!==null){Zb(c);continue}}se!==null?(se.return=Q,Ge=se):Zb(c)}N=N.sibling}if(ee){e:if(N=null,ee)for(c=s;;){if(c.tag===5){if(N===null){N=c;try{j=c.stateNode,T?Le(j):Ze(c.stateNode,c.memoizedProps)}catch(je){Xt(s,s.return,je)}}}else if(c.tag===6){if(N===null)try{W=c.stateNode,T?Ee(W):Pe(W,c.memoizedProps)}catch(je){Xt(s,s.return,je)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;N===c&&(N=null),c=c.return}N===c&&(N=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:xi(c,s),Zi(s),N&4&&Wb(s);break;case 21:break;default:xi(c,s),Zi(s)}}function Zi(s){var c=s.flags;if(c&2){try{if(ee){e:{for(var T=s.return;T!==null;){if(Vb(T)){var N=T;break e}T=T.return}throw Error(o(160))}switch(N.tag){case 5:var j=N.stateNode;N.flags&32&&(Fe(j),N.flags&=-33);var W=qb(s);u1(s,W,j);break;case 3:case 4:var Q=N.stateNode.containerInfo,se=qb(s);s1(s,se,Q);break;default:throw Error(o(161))}}}catch(ye){Xt(s,s.return,ye)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function lE(s,c,T){Ge=s,Kb(s)}function Kb(s,c,T){for(var N=(s.mode&1)!==0;Ge!==null;){var j=Ge,W=j.child;if(j.tag===22&&N){var Q=j.memoizedState!==null||Zf;if(!Q){var se=j.alternate,ye=se!==null&&se.memoizedState!==null||Qr;se=Zf;var Re=Qr;if(Zf=Q,(Qr=ye)&&!Re)for(Ge=j;Ge!==null;)Q=Ge,ye=Q.child,Q.tag===22&&Q.memoizedState!==null?Qb(j):ye!==null?(ye.return=Q,Ge=ye):Qb(j);for(;W!==null;)Ge=W,Kb(W),W=W.sibling;Ge=j,Zf=se,Qr=Re}Xb(s)}else j.subtreeFlags&8772&&W!==null?(W.return=j,Ge=W):Xb(s)}}function Xb(s){for(;Ge!==null;){var c=Ge;if(c.flags&8772){var T=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Qr||Qf(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Qr)if(T===null)N.componentDidMount();else{var j=c.elementType===c.type?T.memoizedProps:Oi(c.type,T.memoizedProps);N.componentDidUpdate(j,T.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var W=c.updateQueue;W!==null&&J2(c,W,N);break;case 3:var Q=c.updateQueue;if(Q!==null){if(T=null,c.child!==null)switch(c.child.tag){case 5:T=q(c.child.stateNode);break;case 1:T=c.child.stateNode}J2(c,Q,T)}break;case 5:var se=c.stateNode;T===null&&c.flags&4&&gt(se,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ae&&c.memoizedState===null){var ye=c.alternate;if(ye!==null){var Re=ye.memoizedState;if(Re!==null){var Ve=Re.dehydrated;Ve!==null&&mn(Ve)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Qr||c.flags&512&&l1(c)}catch(lt){Xt(c,c.return,lt)}}if(c===s){Ge=null;break}if(T=c.sibling,T!==null){T.return=c.return,Ge=T;break}Ge=c.return}}function Zb(s){for(;Ge!==null;){var c=Ge;if(c===s){Ge=null;break}var T=c.sibling;if(T!==null){T.return=c.return,Ge=T;break}Ge=c.return}}function Qb(s){for(;Ge!==null;){var c=Ge;try{switch(c.tag){case 0:case 11:case 15:var T=c.return;try{Qf(4,c)}catch(ye){Xt(c,T,ye)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var j=c.return;try{N.componentDidMount()}catch(ye){Xt(c,j,ye)}}var W=c.return;try{l1(c)}catch(ye){Xt(c,W,ye)}break;case 5:var Q=c.return;try{l1(c)}catch(ye){Xt(c,Q,ye)}}}catch(ye){Xt(c,c.return,ye)}if(c===s){Ge=null;break}var se=c.sibling;if(se!==null){se.return=c.return,Ge=se;break}Ge=c.return}}var Jf=0,ed=1,td=2,rd=3,nd=4;if(typeof Symbol=="function"&&Symbol.for){var qu=Symbol.for;Jf=qu("selector.component"),ed=qu("selector.has_pseudo_class"),td=qu("selector.role"),rd=qu("selector.test_id"),nd=qu("selector.text")}function f1(s){var c=le(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 d1(s,c){switch(c.$$typeof){case Jf:if(s.type===c.value)return!0;break;case ed:e:{c=c.value,s=[s,0];for(var T=0;T<s.length;){var N=s[T++],j=s[T++],W=c[j];if(N.tag!==5||!de(N)){for(;W!=null&&d1(N,W);)j++,W=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 td:if(s.tag===5&&we(s.stateNode,c.value))return!0;break;case nd:if((s.tag===5||s.tag===6)&&(s=he(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case rd: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 h1(s){switch(s.$$typeof){case Jf:return"<"+(C(s.value)||"Unknown")+">";case ed:return":has("+(h1(s)||"")+")";case td:return'[role="'+s.value+'"]';case nd:return'"'+s.value+'"';case rd:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Jb(s,c){var T=[];s=[s,0];for(var N=0;N<s.length;){var j=s[N++],W=s[N++],Q=c[W];if(j.tag!==5||!de(j)){for(;Q!=null&&d1(j,Q);)W++,Q=c[W];if(W===c.length)T.push(j);else for(j=j.child;j!==null;)s.push(j,W),j=j.sibling}}return T}function p1(s,c){if(!ve)throw Error(o(363));s=f1(s),s=Jb(s,c),c=[],s=Array.from(s);for(var T=0;T<s.length;){var N=s[T++];if(N.tag===5)de(N)||c.push(N.stateNode);else for(N=N.child;N!==null;)s.push(N),N=N.sibling}return c}var sE=Math.ceil,id=l.ReactCurrentDispatcher,g1=l.ReactCurrentOwner,hr=l.ReactCurrentBatchConfig,mt=0,Ir=null,br=null,Gr=0,jn=0,gs=un(0),Or=0,Wu=null,rl=0,ad=0,v1=0,Yu=null,bn=null,m1=0,y1=1/0,Ea=null;function vs(){y1=dr()+500}var od=!1,b1=null,no=null,ld=!1,io=null,sd=0,Ku=0,_1=null,ud=-1,cd=0;function Jr(){return mt&6?dr():ud!==-1?ud:ud=dr()}function ao(s){return s.mode&1?mt&2&&Gr!==0?Gr&-Gr:$S.transition!==null?(cd===0&&(cd=ts()),cd):(s=wt,s!==0?s:Ae()):1}function ii(s,c,T,N){if(50<Ku)throw Ku=0,_1=null,Error(o(185));Dn(s,T,N),(!(mt&2)||s!==Ir)&&(s===Ir&&(!(mt&2)&&(ad|=T),Or===4&&oo(s,Gr)),_n(s,N),T===1&&mt===0&&!(c.mode&1)&&(vs(),Si&&Vi()))}function _n(s,c){var T=s.callbackNode;O0(s,c);var N=Zo(s,s===Ir?Gr:0);if(N===0)T!==null&&Zn(T),s.callbackNode=null,s.callbackPriority=0;else if(c=N&-N,s.callbackPriority!==c){if(T!=null&&Zn(T),c===1)s.tag===0?GS(t3.bind(null,s)):x0(t3.bind(null,s)),oe?ie(function(){!(mt&6)&&Vi()}):eo(ns,Vi),T=null;else{switch(Tf(N)){case 1:T=ns;break;case 4:T=P0;break;case 16:T=ne;break;case 536870912:T=Te;break;default:T=ne}T=c3(T,e3.bind(null,s))}s.callbackPriority=c,s.callbackNode=T}}function e3(s,c){if(ud=-1,cd=0,mt&6)throw Error(o(327));var T=s.callbackNode;if(al()&&s.callbackNode!==T)return null;var N=Zo(s,s===Ir?Gr:0);if(N===0)return null;if(N&30||N&s.expiredLanes||c)c=fd(s,N);else{c=N;var j=mt;mt|=2;var W=i3();(Ir!==s||Gr!==c)&&(Ea=null,vs(),nl(s,c));do try{fE();break}catch(se){n3(s,se)}while(!0);M0(),id.current=W,mt=j,br!==null?c=0:(Ir=null,Gr=0,c=Or)}if(c!==0){if(c===2&&(j=Ja(s),j!==0&&(N=j,c=w1(s,j))),c===1)throw T=Wu,nl(s,0),oo(s,N),_n(s,dr()),T;if(c===6)oo(s,N);else{if(j=s.current.alternate,!(N&30)&&!uE(j)&&(c=fd(s,N),c===2&&(W=Ja(s),W!==0&&(N=W,c=w1(s,W))),c===1))throw T=Wu,nl(s,0),oo(s,N),_n(s,dr()),T;switch(s.finishedWork=j,s.finishedLanes=N,c){case 0:case 1:throw Error(o(345));case 2:il(s,bn,Ea);break;case 3:if(oo(s,N),(N&130023424)===N&&(c=m1+500-dr(),10<c)){if(Zo(s,0)!==0)break;if(j=s.suspendedLanes,(j&N)!==N){Jr(),s.pingedLanes|=s.suspendedLanes&j;break}s.timeoutHandle=H(il.bind(null,s,bn,Ea),c);break}il(s,bn,Ea);break;case 4:if(oo(s,N),(N&4194240)===N)break;for(c=s.eventTimes,j=-1;0<N;){var Q=31-In(N);W=1<<Q,Q=c[Q],Q>j&&(j=Q),N&=~W}if(N=j,N=dr()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*sE(N/1960))-N,10<N){s.timeoutHandle=H(il.bind(null,s,bn,Ea),N);break}il(s,bn,Ea);break;case 5:il(s,bn,Ea);break;default:throw Error(o(329))}}}return _n(s,dr()),s.callbackNode===T?e3.bind(null,s):null}function w1(s,c){var T=Yu;return s.current.memoizedState.isDehydrated&&(nl(s,c).flags|=256),s=fd(s,c),s!==2&&(c=bn,bn=T,c!==null&&S1(c)),s}function S1(s){bn===null?bn=s:bn.push.apply(bn,s)}function uE(s){for(var c=s;;){if(c.flags&16384){var T=c.updateQueue;if(T!==null&&(T=T.stores,T!==null))for(var N=0;N<T.length;N++){var j=T[N],W=j.getSnapshot;j=j.value;try{if(!lr(W(),j))return!1}catch{return!1}}}if(T=c.child,c.subtreeFlags&16384&&T!==null)T.return=c,c=T;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 oo(s,c){for(c&=~v1,c&=~ad,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var T=31-In(c),N=1<<T;s[T]=-1,c&=~N}}function t3(s){if(mt&6)throw Error(o(327));al();var c=Zo(s,0);if(!(c&1))return _n(s,dr()),null;var T=fd(s,c);if(s.tag!==0&&T===2){var N=Ja(s);N!==0&&(c=N,T=w1(s,N))}if(T===1)throw T=Wu,nl(s,0),oo(s,c),_n(s,dr()),T;if(T===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,il(s,bn,Ea),_n(s,dr()),null}function r3(s){io!==null&&io.tag===0&&!(mt&6)&&al();var c=mt;mt|=1;var T=hr.transition,N=wt;try{if(hr.transition=null,wt=1,s)return s()}finally{wt=N,hr.transition=T,mt=c,!(mt&6)&&Vi()}}function E1(){jn=gs.current,Nt(gs)}function nl(s,c){s.finishedWork=null,s.finishedLanes=0;var T=s.timeoutHandle;if(T!==Z&&(s.timeoutHandle=Z,X(T)),br!==null)for(T=br.return;T!==null;){var N=T;switch(T0(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&wi();break;case 3:ds(),Nt(Ur),Nt(mr),U0();break;case 5:z0(N);break;case 4:ds();break;case 13:Nt(Jt);break;case 19:Nt(Jt);break;case 10:N0(N.type._context);break;case 22:case 23:E1()}T=T.return}if(Ir=s,br=s=lo(s.current,null),Gr=jn=c,Or=0,Wu=null,v1=ad=rl=0,bn=Yu=null,el!==null){for(c=0;c<el.length;c++)if(T=el[c],N=T.interleaved,N!==null){T.interleaved=null;var j=N.next,W=T.pending;if(W!==null){var Q=W.next;W.next=j,N.next=Q}T.pending=N}el=null}return s}function n3(s,c){do{var T=br;try{if(M0(),Uf.current=Vf,Hf){for(var N=er.memoizedState;N!==null;){var j=N.queue;j!==null&&(j.pending=null),N=N.next}Hf=!1}if(tl=0,Nr=Er=er=null,ju=!1,zu=0,g1.current=null,T===null||T.return===null){Or=1,Wu=c,br=null;break}e:{var W=s,Q=T.return,se=T,ye=c;if(c=Gr,se.flags|=32768,ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var Re=ye,Ve=se,lt=Ve.tag;if(!(Ve.mode&1)&&(lt===0||lt===11||lt===15)){var je=Ve.alternate;je?(Ve.updateQueue=je.updateQueue,Ve.memoizedState=je.memoizedState,Ve.lanes=je.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var Vt=Tb(Q);if(Vt!==null){Vt.flags&=-257,Ab(Vt,Q,se,W,c),Vt.mode&1&&Cb(W,Re,c),c=Vt,ye=Re;var jt=c.updateQueue;if(jt===null){var wn=new Set;wn.add(ye),c.updateQueue=wn}else jt.add(ye);break e}else{if(!(c&1)){Cb(W,Re,c),O1();break e}ye=Error(o(426))}}else if(Kt&&se.mode&1){var Oa=Tb(Q);if(Oa!==null){!(Oa.flags&65536)&&(Oa.flags|=256),Ab(Oa,Q,se,W,c),R0(hs(ye,se));break e}}W=ye=hs(ye,se),Or!==4&&(Or=2),Yu===null?Yu=[W]:Yu.push(W),W=Q;do{switch(W.tag){case 3:W.flags|=65536,c&=-c,W.lanes|=c;var me=Pb(W,ye,c);Q2(W,me);break e;case 1:se=ye;var ce=W.type,be=W.stateNode;if(!(W.flags&128)&&(typeof ce.getDerivedStateFromError=="function"||be!==null&&typeof be.componentDidCatch=="function"&&(no===null||!no.has(be)))){W.flags|=65536,c&=-c,W.lanes|=c;var Be=xb(W,se,c);Q2(W,Be);break e}}W=W.return}while(W!==null)}o3(T)}catch(et){c=et,br===T&&T!==null&&(br=T=T.return);continue}break}while(!0)}function i3(){var s=id.current;return id.current=Vf,s===null?Vf:s}function O1(){(Or===0||Or===3||Or===2)&&(Or=4),Ir===null||!(rl&268435455)&&!(ad&268435455)||oo(Ir,Gr)}function fd(s,c){var T=mt;mt|=2;var N=i3();(Ir!==s||Gr!==c)&&(Ea=null,nl(s,c));do try{cE();break}catch(j){n3(s,j)}while(!0);if(M0(),mt=T,id.current=N,br!==null)throw Error(o(261));return Ir=null,Gr=0,Or}function cE(){for(;br!==null;)a3(br)}function fE(){for(;br!==null&&!Af();)a3(br)}function a3(s){var c=u3(s.alternate,s,jn);s.memoizedProps=s.pendingProps,c===null?o3(s):br=c,g1.current=null}function o3(s){var c=s;do{var T=c.alternate;if(s=c.return,c.flags&32768){if(T=iE(T,c),T!==null){T.flags&=32767,br=T;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{Or=6,br=null;return}}else if(T=nE(T,c,jn),T!==null){br=T;return}if(c=c.sibling,c!==null){br=c;return}br=c=s}while(c!==null);Or===0&&(Or=5)}function il(s,c,T){var N=wt,j=hr.transition;try{hr.transition=null,wt=1,dE(s,c,T,N)}finally{hr.transition=j,wt=N}return null}function dE(s,c,T,N){do al();while(io!==null);if(mt&6)throw Error(o(327));T=s.finishedWork;var j=s.finishedLanes;if(T===null)return null;if(s.finishedWork=null,s.finishedLanes=0,T===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var W=T.lanes|T.childLanes;if(Mu(s,W),s===Ir&&(br=Ir=null,Gr=0),!(T.subtreeFlags&2064)&&!(T.flags&2064)||ld||(ld=!0,c3(ne,function(){return al(),null})),W=(T.flags&15990)!==0,T.subtreeFlags&15990||W){W=hr.transition,hr.transition=null;var Q=wt;wt=1;var se=mt;mt|=4,g1.current=null,oE(s,T),Yb(T,s),L(s.containerInfo),s.current=T,lE(T),kf(),mt=se,wt=Q,hr.transition=W}else s.current=T;if(ld&&(ld=!1,io=s,sd=j),W=s.pendingLanes,W===0&&(no=null),or(T.stateNode),_n(s,dr()),c!==null)for(N=s.onRecoverableError,T=0;T<c.length;T++)j=c[T],N(j.value,{componentStack:j.stack,digest:j.digest});if(od)throw od=!1,s=b1,b1=null,s;return sd&1&&s.tag!==0&&al(),W=s.pendingLanes,W&1?s===_1?Ku++:(Ku=0,_1=s):Ku=0,Vi(),null}function al(){if(io!==null){var s=Tf(sd),c=hr.transition,T=wt;try{if(hr.transition=null,wt=16>s?16:s,io===null)var N=!1;else{if(s=io,io=null,sd=0,mt&6)throw Error(o(331));var j=mt;for(mt|=4,Ge=s.current;Ge!==null;){var W=Ge,Q=W.child;if(Ge.flags&16){var se=W.deletions;if(se!==null){for(var ye=0;ye<se.length;ye++){var Re=se[ye];for(Ge=Re;Ge!==null;){var Ve=Ge;switch(Ve.tag){case 0:case 11:case 15:Vu(8,Ve,W)}var lt=Ve.child;if(lt!==null)lt.return=Ve,Ge=lt;else for(;Ge!==null;){Ve=Ge;var je=Ve.sibling,Vt=Ve.return;if($b(Ve),Ve===Re){Ge=null;break}if(je!==null){je.return=Vt,Ge=je;break}Ge=Vt}}}var jt=W.alternate;if(jt!==null){var wn=jt.child;if(wn!==null){jt.child=null;do{var Oa=wn.sibling;wn.sibling=null,wn=Oa}while(wn!==null)}}Ge=W}}if(W.subtreeFlags&2064&&Q!==null)Q.return=W,Ge=Q;else e:for(;Ge!==null;){if(W=Ge,W.flags&2048)switch(W.tag){case 0:case 11:case 15:Vu(9,W,W.return)}var me=W.sibling;if(me!==null){me.return=W.return,Ge=me;break e}Ge=W.return}}var ce=s.current;for(Ge=ce;Ge!==null;){Q=Ge;var be=Q.child;if(Q.subtreeFlags&2064&&be!==null)be.return=Q,Ge=be;else e:for(Q=ce;Ge!==null;){if(se=Ge,se.flags&2048)try{switch(se.tag){case 0:case 11:case 15:Qf(9,se)}}catch(et){Xt(se,se.return,et)}if(se===Q){Ge=null;break e}var Be=se.sibling;if(Be!==null){Be.return=se.return,Ge=Be;break e}Ge=se.return}}if(mt=j,Vi(),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Ie,s)}catch{}N=!0}return N}finally{wt=T,hr.transition=c}}return!1}function l3(s,c,T){c=hs(T,c),c=Pb(s,c,1),s=ro(s,c,1),c=Jr(),s!==null&&(Dn(s,1,c),_n(s,c))}function Xt(s,c,T){if(s.tag===3)l3(s,s,T);else for(;c!==null;){if(c.tag===3){l3(c,s,T);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(no===null||!no.has(N))){s=hs(T,s),s=xb(c,s,1),c=ro(c,s,1),s=Jr(),c!==null&&(Dn(c,1,s),_n(c,s));break}}c=c.return}}function hE(s,c,T){var N=s.pingCache;N!==null&&N.delete(c),c=Jr(),s.pingedLanes|=s.suspendedLanes&T,Ir===s&&(Gr&T)===T&&(Or===4||Or===3&&(Gr&130023424)===Gr&&500>dr()-m1?nl(s,0):v1|=T),_n(s,c)}function s3(s,c){c===0&&(s.mode&1?(c=Xo,Xo<<=1,!(Xo&130023424)&&(Xo=4194304)):c=1);var T=Jr();s=qi(s,c),s!==null&&(Dn(s,c,T),_n(s,T))}function pE(s){var c=s.memoizedState,T=0;c!==null&&(T=c.retryLane),s3(s,T)}function gE(s,c){var T=0;switch(s.tag){case 13:var N=s.stateNode,j=s.memoizedState;j!==null&&(T=j.retryLane);break;case 19:N=s.stateNode;break;default:throw Error(o(314))}N!==null&&N.delete(c),s3(s,T)}var u3;u3=function(s,c,T){if(s!==null)if(s.memoizedProps!==c.pendingProps||Ur.current)yn=!0;else{if(!(s.lanes&T)&&!(c.flags&128))return yn=!1,rE(s,c,T);yn=!!(s.flags&131072)}else yn=!1,Kt&&c.flags&1048576&&U2(c,Lf,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;Yf(s,c),s=c.pendingProps;var j=_i(c,mr.current);cs(c,T),j=$0(null,c,N,s,j,T);var W=V0();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,Yt(N)?(W=!0,Jl(c)):W=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,F0(c),j.updater=qf,c.stateNode=j,j._reactInternals=c,Z0(c,N,s,T),c=t1(null,c,N,!0,W,T)):(c.tag=0,Kt&&W&&C0(c),cn(null,c,j,T),c=c.child),c;case 16:N=c.elementType;e:{switch(Yf(s,c),s=c.pendingProps,j=N._init,N=j(N._payload),c.type=N,j=c.tag=mE(N),s=Oi(N,s),j){case 0:c=e1(null,c,N,s,T);break e;case 1:c=Ib(null,c,N,s,T);break e;case 11:c=kb(null,c,N,s,T);break e;case 14:c=Rb(null,c,N,Oi(N.type,s),T);break e}throw Error(o(306,N,""))}return c;case 0:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:Oi(N,j),e1(s,c,N,j,T);case 1:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:Oi(N,j),Ib(s,c,N,j,T);case 3:e:{if(Db(c),s===null)throw Error(o(387));N=c.pendingProps,W=c.memoizedState,j=W.element,Z2(s,c),zf(c,N,null,T);var Q=c.memoizedState;if(N=Q.element,ae&&W.isDehydrated)if(W={element:N,isDehydrated:!1,cache:Q.cache,pendingSuspenseBoundaries:Q.pendingSuspenseBoundaries,transitions:Q.transitions},c.updateQueue.baseState=W,c.memoizedState=W,c.flags&256){j=hs(Error(o(423)),c),c=Fb(s,c,N,T,j);break e}else if(N!==j){j=hs(Error(o(424)),c),c=Fb(s,c,N,T,j);break e}else for(ae&&(ei=dt(c.stateNode.containerInfo),Fn=c,Kt=!0,Ei=null,Nu=!1),T=Y2(c,null,N,T),c.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(ls(),N===j){c=Sa(s,c,T);break e}cn(s,c,N,T)}c=c.child}return c;case 5:return eb(c),s===null&&k0(c),N=c.type,j=c.pendingProps,W=s!==null?s.memoizedProps:null,Q=j.children,K(N,j)?Q=null:W!==null&&K(N,W)&&(c.flags|=32),Nb(s,c),cn(s,c,Q,T),c.child;case 6:return s===null&&k0(c),null;case 13:return jb(s,c,T);case 4:return j0(c,c.stateNode.containerInfo),N=c.pendingProps,s===null?c.child=ss(c,null,N,T):cn(s,c,N,T),c.child;case 11:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:Oi(N,j),kb(s,c,N,j,T);case 7:return cn(s,c,c.pendingProps,T),c.child;case 8:return cn(s,c,c.pendingProps.children,T),c.child;case 12:return cn(s,c,c.pendingProps.children,T),c.child;case 10:e:{if(N=c.type._context,j=c.pendingProps,W=c.memoizedProps,Q=j.value,K2(c,N,Q),W!==null)if(lr(W.value,Q)){if(W.children===j.children&&!Ur.current){c=Sa(s,c,T);break e}}else for(W=c.child,W!==null&&(W.return=c);W!==null;){var se=W.dependencies;if(se!==null){Q=W.child;for(var ye=se.firstContext;ye!==null;){if(ye.context===N){if(W.tag===1){ye=wa(-1,T&-T),ye.tag=2;var Re=W.updateQueue;if(Re!==null){Re=Re.shared;var Ve=Re.pending;Ve===null?ye.next=ye:(ye.next=Ve.next,Ve.next=ye),Re.pending=ye}}W.lanes|=T,ye=W.alternate,ye!==null&&(ye.lanes|=T),I0(W.return,T,c),se.lanes|=T;break}ye=ye.next}}else if(W.tag===10)Q=W.type===c.type?null:W.child;else if(W.tag===18){if(Q=W.return,Q===null)throw Error(o(341));Q.lanes|=T,se=Q.alternate,se!==null&&(se.lanes|=T),I0(Q,T,c),Q=W.sibling}else Q=W.child;if(Q!==null)Q.return=W;else for(Q=W;Q!==null;){if(Q===c){Q=null;break}if(W=Q.sibling,W!==null){W.return=Q.return,Q=W;break}Q=Q.return}W=Q}cn(s,c,j.children,T),c=c.child}return c;case 9:return j=c.type,N=c.pendingProps.children,cs(c,T),j=ti(j),N=N(j),c.flags|=1,cn(s,c,N,T),c.child;case 14:return N=c.type,j=Oi(N,c.pendingProps),j=Oi(N.type,j),Rb(s,c,N,j,T);case 15:return Lb(s,c,c.type,c.pendingProps,T);case 17:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:Oi(N,j),Yf(s,c),c.tag=1,Yt(N)?(s=!0,Jl(c)):s=!1,cs(c,T),Eb(c,N,j),Z0(c,N,j,T),t1(null,c,N,!0,s,T);case 19:return Bb(s,c,T);case 22:return Mb(s,c,T)}throw Error(o(156,c.tag))};function c3(s,c){return eo(s,c)}function vE(s,c,T,N){this.tag=s,this.key=T,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 ai(s,c,T,N){return new vE(s,c,T,N)}function P1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function mE(s){if(typeof s=="function")return P1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===b)return 11;if(s===h)return 14}return 2}function lo(s,c){var T=s.alternate;return T===null?(T=ai(s.tag,c,s.key,s.mode),T.elementType=s.elementType,T.type=s.type,T.stateNode=s.stateNode,T.alternate=s,s.alternate=T):(T.pendingProps=c,T.type=s.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=s.flags&14680064,T.childLanes=s.childLanes,T.lanes=s.lanes,T.child=s.child,T.memoizedProps=s.memoizedProps,T.memoizedState=s.memoizedState,T.updateQueue=s.updateQueue,c=s.dependencies,T.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},T.sibling=s.sibling,T.index=s.index,T.ref=s.ref,T}function dd(s,c,T,N,j,W){var Q=2;if(N=s,typeof s=="function")P1(s)&&(Q=1);else if(typeof s=="string")Q=5;else e:switch(s){case v:return ol(T.children,j,W,c);case S:Q=8,j|=8;break;case _:return s=ai(12,T,c,j|2),s.elementType=_,s.lanes=W,s;case m:return s=ai(13,T,c,j),s.elementType=m,s.lanes=W,s;case g:return s=ai(19,T,c,j),s.elementType=g,s.lanes=W,s;case y:return hd(T,j,W,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case p:Q=10;break e;case E:Q=9;break e;case b:Q=11;break e;case h:Q=14;break e;case d:Q=16,N=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=ai(Q,T,c,j),c.elementType=s,c.type=N,c.lanes=W,c}function ol(s,c,T,N){return s=ai(7,s,N,c),s.lanes=T,s}function hd(s,c,T,N){return s=ai(22,s,N,c),s.elementType=y,s.lanes=T,s.stateNode={isHidden:!1},s}function x1(s,c,T){return s=ai(6,s,null,c),s.lanes=T,s}function C1(s,c,T){return c=ai(4,s.children!==null?s.children:[],s.key,c),c.lanes=T,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function yE(s,c,T,N,j){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Z,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lu(0),this.expirationTimes=Lu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lu(0),this.identifierPrefix=N,this.onRecoverableError=j,ae&&(this.mutableSourceEagerHydrationData=null)}function f3(s,c,T,N,j,W,Q,se,ye){return s=new yE(s,c,T,se,ye),c===1?(c=1,W===!0&&(c|=8)):c=0,W=ai(3,null,null,c),s.current=W,W.stateNode=s,W.memoizedState={element:N,isDehydrated:T,cache:null,transitions:null,pendingSuspenseBoundaries:null},F0(W),s}function d3(s){if(!s)return bi;s=s._reactInternals;e:{if(P(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(Yt(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var T=s.type;if(Yt(T))return Ql(s,T,c)}return c}function h3(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=R(c),s===null?null:s.stateNode}function p3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var T=s.retryLane;s.retryLane=T!==0&&T<c?T:c}}function pd(s,c){p3(s,c),(s=s.alternate)&&p3(s,c)}function bE(s){return s=R(s),s===null?null:s.stateNode}function _E(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=qi(s,134217728);if(c!==null){var T=Jr();ii(c,s,134217728,T)}pd(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=qi(s,1);if(c!==null){var T=Jr();ii(c,s,1,T)}pd(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=ao(s),T=qi(s,c);if(T!==null){var N=Jr();ii(T,s,c,N)}pd(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var T=ya(c.pendingLanes);T!==0&&(rs(c,T|1),_n(c,dr()),!(mt&6)&&(vs(),Vi()))}break;case 13:r3(function(){var N=qi(s,1);if(N!==null){var j=Jr();ii(N,s,1,j)}}),pd(s,1)}},r.batchedUpdates=function(s,c){var T=mt;mt|=1;try{return s(c)}finally{mt=T,mt===0&&(vs(),Si&&Vi())}},r.createComponentSelector=function(s){return{$$typeof:Jf,value:s}},r.createContainer=function(s,c,T,N,j,W,Q){return f3(s,c,!1,null,T,N,j,W,Q)},r.createHasPseudoClassSelector=function(s){return{$$typeof:ed,value:s}},r.createHydrationContainer=function(s,c,T,N,j,W,Q,se,ye){return s=f3(T,N,!0,s,j,W,Q,se,ye),s.context=d3(null),T=s.current,N=Jr(),j=ao(T),W=wa(N,j),W.callback=c??null,ro(T,W,j),s.current.lanes=j,Dn(s,j,N),_n(s,N),s},r.createPortal=function(s,c,T){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:T}},r.createRoleSelector=function(s){return{$$typeof:td,value:s}},r.createTestNameSelector=function(s){return{$$typeof:rd,value:s}},r.createTextSelector=function(s){return{$$typeof:nd,value:s}},r.deferredUpdates=function(s){var c=wt,T=hr.transition;try{return hr.transition=null,wt=16,s()}finally{wt=c,hr.transition=T}},r.discreteUpdates=function(s,c,T,N,j){var W=wt,Q=hr.transition;try{return hr.transition=null,wt=1,s(c,T,N,j)}finally{wt=W,hr.transition=Q,mt===0&&vs()}},r.findAllNodes=p1,r.findBoundingRects=function(s,c){if(!ve)throw Error(o(363));c=p1(s,c),s=[];for(var T=0;T<c.length;T++)s.push(te(c[T]));for(c=s.length-1;0<c;c--){T=s[c];for(var N=T.x,j=N+T.width,W=T.y,Q=W+T.height,se=c-1;0<=se;se--)if(c!==se){var ye=s[se],Re=ye.x,Ve=Re+ye.width,lt=ye.y,je=lt+ye.height;if(N>=Re&&W>=lt&&j<=Ve&&Q<=je){s.splice(c,1);break}else if(N!==Re||T.width!==ye.width||je<W||lt>Q){if(!(W!==lt||T.height!==ye.height||Ve<N||Re>j)){Re>N&&(ye.width+=Re-N,ye.x=N),Ve<j&&(ye.width=j-Re),s.splice(c,1);break}}else{lt>W&&(ye.height+=lt-W,ye.y=W),je<Q&&(ye.height=Q-lt),s.splice(c,1);break}}}return s},r.findHostInstance=h3,r.findHostInstanceWithNoPortals=function(s){return s=A(s),s=s!==null?U(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return h3(s)},r.flushControlled=function(s){var c=mt;mt|=1;var T=hr.transition,N=wt;try{hr.transition=null,wt=1,s()}finally{wt=N,hr.transition=T,mt=c,mt===0&&(vs(),Vi())}},r.flushPassiveEffects=al,r.flushSync=r3,r.focusWithin=function(s,c){if(!ve)throw Error(o(363));for(s=f1(s),c=Jb(s,c),c=Array.from(c),s=0;s<c.length;){var T=c[s++];if(!de(T)){if(T.tag===5&&_e(T.stateNode))return!0;for(T=T.child;T!==null;)c.push(T),T=T.sibling}}return!1},r.getCurrentUpdatePriority=function(){return wt},r.getFindAllNodesFailureDescription=function(s,c){if(!ve)throw Error(o(363));var T=0,N=[];s=[f1(s),0];for(var j=0;j<s.length;){var W=s[j++],Q=s[j++],se=c[Q];if((W.tag!==5||!de(W))&&(d1(W,se)&&(N.push(h1(se)),Q++,Q>T&&(T=Q)),Q<c.length))for(W=W.child;W!==null;)s.push(W,Q),W=W.sibling}if(T<c.length){for(s=[];T<c.length;T++)s.push(h1(c[T]));return`findAllNodes was able to match part of the selector:
58
+ `+(N.join(" > ")+`
59
+
60
+ No matching component was found for:
61
+ `)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return q(s.child.stateNode);default:return s.child.stateNode}},r.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:bE,findFiberByHostInstance:s.findFiberByHostInstance||_E,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{Ie=c.inject(s),ft=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,T,N){if(!ve)throw Error(o(363));s=p1(s,c);var j=Ne(s,T,N).disconnect;return{disconnect:function(){j()}}},r.registerMutableSourceForHydration=function(s,c){var T=c._getVersion;T=T(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,T]:s.mutableSourceEagerHydrationData.push(c,T)},r.runWithPriority=function(s,c){var T=wt;try{return wt=s,c()}finally{wt=T}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,T,N){var j=c.current,W=Jr(),Q=ao(j);return T=d3(T),c.context===null?c.context=T:c.pendingContext=T,c=wa(W,Q),c.payload={element:s},N=N===void 0?null:N,N!==null&&(c.callback=N),s=ro(j,c,Q),s!==null&&(ii(s,j,Q,W),jf(s,j,Q)),Q},r};Q9.exports=mL;var yL=Q9.exports;const bL=Yh(yL);var J9={exports:{}},$l={};/**
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
+ */$l.ConcurrentRoot=1;$l.ContinuousEventPriority=4;$l.DefaultEventPriority=16;$l.DiscreteEventPriority=1;$l.IdleEventPriority=536870912;$l.LegacyRoot=0;J9.exports=$l;var e7=J9.exports;const _4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let w4=!1,S4=!1;const p2=".react-konva-event";let t7=!1;function _L(e){t7=e}const wL=`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
+ `,SL=`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
+ `,EL={};function h0(e,t,r=EL){if(!w4&&"zIndex"in t&&(console.warn(SL),w4=!0),!S4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(wL),S4=!0)}for(var a in r)if(!_4[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 v=t7||t._useStrictMode,S={},_=!1;const p={};for(var a in t)if(!_4[a]){var o=a.slice(0,2)==="on",E=r[a]!==t[a];if(o&&E){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(p[u]=t[a])}!o&&(t[a]!==r[a]||v&&t[a]!==e.getAttr(a))&&(_=!0,S[a]=t[a])}_&&(e.setAttrs(S),Wo(e));for(var u in p)e.on(u+p2,p[u])}function Wo(e){if(!pt.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const r7={},OL={};Kc.Node.prototype._applyProps=h0;function PL(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),Wo(e)}function xL(e,t,r){let n=Kc[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=Kc.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 h0(u,a),u}function CL(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function TL(e,t,r){return!1}function AL(e){return e}function kL(){return null}function RL(){return null}function LL(e,t,r,n){return OL}function ML(){}function NL(e){}function IL(e,t){return!1}function DL(){return r7}function FL(){return r7}const jL=setTimeout,zL=clearTimeout,BL=-1;function UL(e,t){return!1}const HL=!1,GL=!0,$L=!0;function VL(e,t){t.parent===e?t.moveToTop():e.add(t),Wo(e)}function qL(e,t){t.parent===e?t.moveToTop():e.add(t),Wo(e)}function n7(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),Wo(e)}function WL(e,t,r){n7(e,t,r)}function YL(e,t){t.destroy(),t.off(p2),Wo(e)}function KL(e,t){t.destroy(),t.off(p2),Wo(e)}function XL(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function ZL(e,t,r){}function QL(e,t,r,n,i){h0(e,i,n)}function JL(e){e.hide(),Wo(e)}function eM(e){}function tM(e,t){(t.visible==null||t.visible)&&e.show()}function rM(e,t){}function nM(e){}function iM(){}const aM=()=>e7.DefaultEventPriority,oM=Object.freeze(Object.defineProperty({__proto__:null,appendChild:VL,appendChildToContainer:qL,appendInitialChild:PL,cancelTimeout:zL,clearContainer:nM,commitMount:ZL,commitTextUpdate:XL,commitUpdate:QL,createInstance:xL,createTextInstance:CL,detachDeletedInstance:iM,finalizeInitialChildren:TL,getChildHostContext:FL,getCurrentEventPriority:aM,getPublicInstance:AL,getRootHostContext:DL,hideInstance:JL,hideTextInstance:eM,idlePriority:hc.unstable_IdlePriority,insertBefore:n7,insertInContainerBefore:WL,isPrimaryRenderer:HL,noTimeout:BL,now:hc.unstable_now,prepareForCommit:kL,preparePortalMount:RL,prepareUpdate:LL,removeChild:YL,removeChildFromContainer:KL,resetAfterCommit:ML,resetTextContent:NL,run:hc.unstable_runWithPriority,scheduleTimeout:jL,shouldDeprioritizeSubtree:IL,shouldSetTextContent:UL,supportsMutation:$L,unhideInstance:tM,unhideTextInstance:rM,warnsIfNotActing:GL},Symbol.toStringTag,{value:"Module"}));var lM=Object.defineProperty,sM=Object.defineProperties,uM=Object.getOwnPropertyDescriptors,E4=Object.getOwnPropertySymbols,cM=Object.prototype.hasOwnProperty,fM=Object.prototype.propertyIsEnumerable,O4=(e,t,r)=>t in e?lM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P4=(e,t)=>{for(var r in t||(t={}))cM.call(t,r)&&O4(e,r,t[r]);if(E4)for(var r of E4(t))fM.call(t,r)&&O4(e,r,t[r]);return e},dM=(e,t)=>sM(e,uM(t)),x4,C4;typeof window<"u"&&((x4=window.document)!=null&&x4.createElement||((C4=window.navigator)==null?void 0:C4.product)==="ReactNative")?it.useLayoutEffect:it.useEffect;function i7(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=i7(n,t,r);if(i)return i;n=n.sibling}}function a7(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const T4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=T4;return}return T4.apply(this,arguments)};const g2=a7(it.createContext(null));class o7 extends it.Component{render(){return it.createElement(g2.Provider,{value:this._reactInternals},this.props.children)}}function hM(){const e=it.useContext(g2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=it.useId();return it.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=i7(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 pM(){const e=hM(),[t]=it.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!==g2&&!t.has(i)&&t.set(i,it.useContext(a7(i)))}r=r.return}return t}function l7(){const e=pM();return it.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>it.createElement(t,null,it.createElement(r.Provider,dM(P4({},n),{value:e.get(r)}))),t=>it.createElement(o7,P4({},t))),[e])}function gM(e){const t=yt.useRef({});return yt.useLayoutEffect(()=>{t.current=e}),yt.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const vM=e=>{const t=yt.useRef(),r=yt.useRef(),n=yt.useRef(),i=gM(e),a=l7(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return yt.useLayoutEffect(()=>(r.current=new Kc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=Fs.createContainer(r.current,e7.LegacyRoot,!1,null),Fs.updateContainer(yt.createElement(a,{},e.children),n.current),()=>{Kc.isBrowser&&(o(null),Fs.updateContainer(null,n.current,null),r.current.destroy())}),[]),yt.useLayoutEffect(()=>{o(r.current),h0(r.current,e,i),Fs.updateContainer(yt.createElement(a,{},e.children),n.current,null)}),yt.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})},mM="Layer",yM="FastLayer",$h="Group",bM="Label",_M="Rect",wM="Circle",SM="Ellipse",EM="Wedge",OM="Line",PM="Sprite",xM="Image",CM="Text",TM="TextPath",AM="Star",kM="Ring",RM="Arc",LM="Tag",MM="Path",NM="RegularPolygon",IM="Arrow",DM="Shape",FM="Transformer",Fs=bL(oM);Fs.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:yt.version,rendererPackageName:"react-konva"});const jM=yt.forwardRef((e,t)=>yt.createElement(o7,{},yt.createElement(vM,{...e,forwardedRef:t}))),zM=_L,BM=Object.freeze(Object.defineProperty({__proto__:null,Arc:RM,Arrow:IM,Circle:wM,Ellipse:SM,FastLayer:yM,Group:$h,Image:xM,KonvaRenderer:Fs,Label:bM,Layer:mM,Line:OM,Path:MM,Rect:_M,RegularPolygon:NM,Ring:kM,Shape:DM,Sprite:PM,Stage:jM,Star:AM,Tag:LM,Text:CM,TextPath:TM,Transformer:FM,Wedge:EM,useStrictMode:zM},Symbol.toStringTag,{value:"Module"})),Wa=Do(BM);var sl=it,p0=function(t,r,n){const i=sl.useRef("loading"),a=sl.useRef(),[o,l]=sl.useState(0),u=sl.useRef(),f=sl.useRef(),v=sl.useRef();return(u.current!==t||f.current!==r||v.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,v.current=n),sl.useLayoutEffect(function(){if(!t)return;var S=document.createElement("img");function _(){i.current="loaded",a.current=S,l(Math.random())}function p(){i.current="failed",a.current=void 0,l(Math.random())}return S.addEventListener("load",_),S.addEventListener("error",p),r&&(S.crossOrigin=r),n&&(S.referrerPolicy=n),S.src=t,function(){S.removeEventListener("load",_),S.removeEventListener("error",p)}},[t,r,n]),[a.current,i.current]};const UM=Yh(p0);var s7={},v2={},HM=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 GM=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function u7(e=()=>{}){const t=yt.useRef(e);return t.current=e,yt.useCallback((...r)=>t.current.apply(null,r),[])}const $M=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=l7(),o=yt.useRef(null);yt.useRef();const[l]=yt.useState(()=>document.createElement("div")),u=yt.useMemo(()=>ah.createRoot(l),[l]),f=n??!0,v=u7(()=>{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 S=r||{},{style:_}=S,p=HM(S,["style"]);Object.assign(l.style,_),Object.assign(l,p)});return yt.useLayoutEffect(()=>{var S;const _=o.current;if(!_)return;const p=(S=_.getStage())===null||S===void 0?void 0:S.container();if(p)return p.appendChild(l),f&&GM(p)&&(p.style.position="relative"),_.on("absoluteTransformChange",v),v(),()=>{var E;_.off("absoluteTransformChange",v),(E=l.parentNode)===null||E===void 0||E.removeChild(l)}},[f]),yt.useLayoutEffect(()=>{v()},[r,i]),yt.useLayoutEffect(()=>{u.render(yt.createElement(a,null,e))}),yt.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),yt.createElement($h,Object.assign({ref:o},t))},VM=({selector:e,enabled:t,children:r})=>{const n=yt.useRef(null),i=yt.useRef(null),a=yt.useRef(),o=t??!0;return yt.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 v=u.getLayer();if(!v)return;v.batchDraw()}},[e,o]),yt.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),yt.createElement($h,{name:"_outer_portal",ref:n},yt.createElement($h,{name:"_inner_portal",ref:i},r))},qM=Object.freeze(Object.defineProperty({__proto__:null,Html:$M,Portal:VM,useEvent:u7,useImage:UM},Symbol.toStringTag,{value:"Module"})),Sf=Do(qM);function WM(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function c7(e,t,r){const n=t-1,i=r[d7(n,r.length)];return i.marker!=="Z"?i:c7(e,n,r)}function f7(e,t,r){const n=t+1,i=r[d7(n,r.length)];return i.marker==="Z"?f7(e,n,r):i}function YM(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 KM(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 d7(e,t){return(e%t+t)%t}function XM(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 Nm(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,Nm(e,t-1)),e[t].marker==="Z"&&Nm(e,t-1)}function ZM(e,t,r){const n=k4(e.values,r.values),i=k4(t.values,e.values);return Math.min(i,n)}function A4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function k4(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 R4(e,t){return Math.sin(e)*t}function L4(e,t){return Math.cos(e)*t}function M4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function QM(e,t){return t*Math.tan(e)}function JM(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=M4(e/2,-t):(r=M4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function eN(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 h7(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 KM(n.marker,a)}).map(YM)}function p7(e,t,r){let n=[],i=[];return r&&e.forEach(a=>WM(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(XM),Nm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const S=c7(l,u,f),_=f7(l,u,f),p=A4(l.values,S.values),E=A4(l.values,_.values),b=E-p,m=b*(180/Math.PI),g=ZM(l,S,_),h=Math.abs(QM(b/2,g/2)),d=Math.min(t,h),y=JM(b,d),O=y.offset,k=y.sweepFlag,C=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const w=[l.values.x+R4(p,O),l.values.y+L4(p,O)],P=[l.values.x+R4(E,O),l.values.y+L4(E,O)];C?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(w[0].toFixed(3)),y:parseFloat(w[1].toFixed(3))}}),!C&&(_.marker==="L"||_.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:m,largeArc:0,sweep:k,x:parseFloat(P[0].toFixed(3)),y:parseFloat(P[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:eN(i),commands:i}}function tN(e,t,r){return p7([...h7(e)],t,r)}const rN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:h7,roundCommands:p7,roundCorners:tN},Symbol.toStringTag,{value:"Module"})),nN=Do(rN);var Ef={},m2={},y2={},Vl=Vl||{};Vl.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 Vl=Vl||{};Vl.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(z){var F=new Error(t+": "+z);throw F.source=t,F}function n(){var z=i();return t.length>0&&r("Invalid input not EOF"),z}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,S)||o("repeating-radial-gradient",e.repeatingRadialGradient,S)}function o(z,F,G){return l(F,function(L){var I=G();return I&&(V(e.comma)||r("Missing comma before color stops")),{type:z,orientation:I,colorStops:d(y)}})}function l(z,F){var G=V(z);if(G){V(e.startCall)||r("Missing (");var L=F(G);return V(e.endCall)||r("Missing )"),L}}function u(){return f()||v()}function f(){return U("directional",e.sideOrCorner,1)}function v(){return U("angular",e.angleValue,1)}function S(){var z,F=_(),G;return F&&(z=[],z.push(F),G=t,V(e.comma)&&(F=_(),F?z.push(F):t=G)),z}function _(){var z=p()||E();if(z)z.at=m();else{var F=b();if(F){z=F;var G=m();G&&(z.at=G)}else{var L=g();L&&(z={type:"default-radial",at:L})}}return z}function p(){var z=U("shape",/^(circle)/i,0);return z&&(z.style=M()||b()),z}function E(){var z=U("shape",/^(ellipse)/i,0);return z&&(z.style=A()||b()),z}function b(){return U("extent-keyword",e.extentKeywords,1)}function m(){if(U("position",/^at/,0)){var z=g();return z||r("Missing positioning value"),z}}function g(){var z=h();if(z.x||z.y)return{type:"position",value:z}}function h(){return{x:A(),y:A()}}function d(z){var F=z(),G=[];if(F)for(G.push(F);V(e.comma);)F=z(),F?G.push(F):r("One extra comma");return G}function y(){var z=O();return z||r("Expected color definition"),z.length=A(),z}function O(){return C()||P()||w()||k()}function k(){return U("literal",e.literalColor,0)}function C(){return U("hex",e.hexColor,1)}function w(){return l(e.rgbColor,function(){return{type:"rgb",value:d(x)}})}function P(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(x)}})}function x(){return V(e.number)[1]}function A(){return U("%",e.percentageValue,1)||R()||M()}function R(){return U("position-keyword",e.positionKeywords,1)}function M(){return U("px",e.pixelValue,1)||U("em",e.emValue,1)}function U(z,F,G){var L=V(F);if(L)return{type:z,value:L[G]}}function V(z){var F,G;return G=/^[\n\r\t\s]+/.exec(t),G&&q(G[0].length),F=z.exec(t),F&&q(F[0].length),F}function q(z){t=t.substr(z)}return function(z){return t=z.toString(),n()}}();y2.parse=Vl.parse;y2.stringify=Vl.stringify;(function(e){var t=Se&&Se.__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(y2),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})(m2);(function(e){var t=Se&&Se.__createBinding||(Object.create?function(f,v,S,_){_===void 0&&(_=S);var p=Object.getOwnPropertyDescriptor(v,S);p&&!("get"in p?!v.__esModule:p.writable||p.configurable)||(p={enumerable:!0,get:function(){return v[S]}}),Object.defineProperty(f,_,p)}:function(f,v,S,_){_===void 0&&(_=S),f[_]=v[S]}),r=Se&&Se.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),n=Se&&Se.__importStar||function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var S in f)S!=="default"&&Object.prototype.hasOwnProperty.call(f,S)&&t(v,f,S);return r(v,f),v},i=Se&&Se.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(it),o=n(m2),l=i(vi),u=(f,v=f.fill,S="fill")=>a.default.useMemo(()=>{if(!o.isGradient(v))return{[S]:v};const{stops:_,rotation:p}=o.parseColor(v),E={x:f.a.width/2,y:f.a.height/2},b=Math.sqrt(Math.pow(E.x,2)+Math.pow(E.y,2)),m=l.default.Util.degToRad(p)-Math.PI/2,g=[];return _.forEach(({offset:h,color:d})=>{g.push(h,d)}),S==="fill"?{fillLinearGradientStartPointX:E.x-b*Math.cos(m),fillLinearGradientStartPointY:E.y-b*Math.sin(m),fillLinearGradientColorStops:g,fillLinearGradientEndPointX:E.x+b*Math.cos(m),fillLinearGradientEndPointY:E.y+b*Math.sin(m),fill:_[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:E.x-b*Math.cos(m),strokeLinearGradientStartPointY:E.y-b*Math.sin(m),strokeLinearGradientColorStops:g,strokeLinearGradientEndPointX:E.x+b*Math.cos(m),strokeLinearGradientEndPointY:E.y+b*Math.sin(m)}},[v,f.width,f.height]);e.useColor=u})(Ef);var ua={},ql={};(function(e){var t=Se&&Se.__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(it),n=t(vi);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const v=r.default.useRef();r.default.useLayoutEffect(()=>{v.current&&v.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const S=u.current.opacity();return S?(u.current.opacity(0),v.current=new n.default.Tween({node:u.current,opacity:S,onFinish:()=>{var _;(_=v.current)===null||_===void 0||_.destroy()}}),v.current.play(),()=>{var _;(_=v.current)===null||_===void 0||_.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(ql);(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=ql;let r=0,n=[],i=3e4;const a=g=>{i=g};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=g=>{l=g};e.setFontLoadTimeout=u;const f=()=>l;function v(g){r+=1;let h=!1;const d=setTimeout(()=>{h||(m(`Timeout loading asset ${g}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",g),h=!0,S())},i);return()=>{h||(clearTimeout(d),S())}}function S(){r-=1,r===0&&(n.forEach(g=>g()),n=[])}function _(g){r===0?g():n.push(g)}function p(){return new Promise(g=>_(()=>{(0,t.isAnimationUsed)()?setTimeout(g,300):g(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=v,e.decrementLoader=S,e.whenLoaded=p;let E=[];function b(g){E.push(g)}function m(g){E.forEach(h=>h(g))}e.onLoadError=b,e.triggerLoadError=m})(ua);var Pu={};(function(e){var t=Se&&Se.__createBinding||(Object.create?function(M,U,V,q){q===void 0&&(q=V);var z=Object.getOwnPropertyDescriptor(U,V);z&&!("get"in z?!U.__esModule:z.writable||z.configurable)||(z={enumerable:!0,get:function(){return U[V]}}),Object.defineProperty(M,q,z)}:function(M,U,V,q){q===void 0&&(q=V),M[q]=U[V]}),r=Se&&Se.__setModuleDefault||(Object.create?function(M,U){Object.defineProperty(M,"default",{enumerable:!0,value:U})}:function(M,U){M.default=U}),n=Se&&Se.__importStar||function(M){if(M&&M.__esModule)return M;var U={};if(M!=null)for(var V in M)V!=="default"&&Object.prototype.hasOwnProperty.call(M,V)&&t(U,M,V);return r(U,M),U};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(ha),a=ua;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(M){M!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...M)):l.value=!1}function v(){return o}function S(M){e.globalFonts.push(M)}function _(M){const U=e.globalFonts.findIndex(V=>V.fontFamily===M);U!==-1&&e.globalFonts.splice(U,1)}function p(M){e.globalFonts.replace(M)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=v,e.globalFonts=i.observable([]),e.addGlobalFont=S,e.removeGlobalFont=_,e.replaceGlobalFonts=p;var E="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",b=document.createElement("canvas");function m(){return h("Arial")}function g(){return h("Times","Times")}function h(M,U="Arial"){var V=b.getContext("2d");return V.font=`normal 40px '${M}', ${U}`,V.measureText(E).width}const d={Arial:!0},y=M=>!!d[M];async function O(M){var U;if(d[M])return;const V=!!(!((U=document.fonts)===null||U===void 0)&&U.load),q=m();if(V)try{await document.fonts.load(`16px '${M}'`);const L=h(M);if(q!==L)return void(d[M]=!0)}catch{}const z=g(),F=h(M),G=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let L=0;L<G;L++){const I=h(M,"Arial"),B=h(M,"Times");if(I!==F||I!==q||B!==z)return void(d[M]=!0);await new Promise(D=>setTimeout(D,60))}console.warn(`Timeout for loading font "${M}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${M}"`)}e.isFontLoaded=y,e.loadFont=O;const k={};let C="400,400italic,700,700italic";function w(M){C=M}function P(){return C}function x(M){if(k[M])return;const U=`https://fonts.googleapis.com/css?family=${M.replace(/ /g,"+")}:${C}`,V=document.createElement("link");V.type="text/css",V.href=U,V.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(V),k[M]=!0}e.setGoogleFontsVariants=w,e.getGoogleFontsVariants=P,e.injectGoogleFont=x;const A={};function R(M){const U=M.fontFamily;if(A[U]||!M.url&&!M.styles)return;const V=document.createElement("style");V.type="text/css";const q=M.styles||(M.url?[{src:`url("${M.url}")`}]:[]);let z="";q.forEach(F=>{z+=`
77
+ @font-face {
78
+ font-family: '${U}';
79
+ src: ${F.src};
80
+ font-style: ${F.fontStyle||"normal"};
81
+ font-weight: ${F.fontWeight||"normal"};
82
+ }
83
+ `}),V.innerHTML=z,document.getElementsByTagName("head")[0].appendChild(V),A[M.fontFamily]=!0}e.injectCustomFont=R})(Pu);var hi={};(function(e){var t=Se&&Se.__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=Se&&Se.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=Se&&Se.__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(ha);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})})(hi);var b2={};(function(e){function t(r=""){return(r=r.replace(/<\/p>/gi,`
84
+ `)).replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(b2);var Of={};(function(e){var t=Se&&Se.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(vi);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})(Of);var Wl={};(function(e){var t=Se&&Se.__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(it),n=Hi,i=Wa,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)))})(Wl);var Yo={};(function(e){var t=Se&&Se.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const r=t(it);e.MOBILE_BREAKPOINT=500;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const i=o=>`
85
+ @media (max-width: ${e.MOBILE_BREAKPOINT}px) {
86
+ ${o}
87
+ }
88
+
89
+ .polotno-mobile & {
90
+ ${o}
91
+ }
92
+ `;e.mobileStyle=i;const a=()=>{const[o,l]=r.default.useState((0,e.isMobile)());return r.default.useEffect(()=>{const u=()=>{l((0,e.isMobile)())};return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[]),o};e.useMobile=a})(Yo);var N4={},g7="warn";function v7(e){g7=e}function m7(){return g7}function iN(e){v7(e)}var xr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(xr||(xr={}));var Im=function(e,t){return Im=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])},Im(e,t)};function Gt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Im(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Tr=function(){return Tr=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},Tr.apply(this,arguments)};function aN(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 y7(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(v){return u([f,v])}}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(v){f=[6,v],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Pc(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 fa(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 da(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 Pf(e){return qe(e).type}function oN(e,t){return qe(e).getChildType(t)}function b7(e,t){return qe(e).onPatch(t)}function lN(e,t){return qe(e).onSnapshot(t)}function su(e,t){qe(e).applyPatches(C2(t))}function sN(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=b7(e,function(o,l){t&&!t(o,l,E2())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){su(o||e,r.patches)},undo:function(o){su(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function uN(e){var t=qe(e);if(!t.isRoot)throw new Ue("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function cN(e){var t=qe(e);if(!t.isRoot)throw new Ue("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function fN(e){return qe(e).isProtected}function _7(e,t){return qe(e).applySnapshot(t)}function _2(e,t){t===void 0&&(t=!0);var r=qe(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function dN(e,t){t===void 0&&(t=1);for(var r=qe(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function hN(e,t){t===void 0&&(t=1);for(var r=t,n=qe(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw new Ue("Failed to find the parent of ".concat(qe(e)," at depth ").concat(t))}function pN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function gN(e,t){for(var r=qe(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new Ue("Failed to find the parent of ".concat(qe(e)," of a given type"))}function w7(e){return qe(e).root.storedValue}function S7(e){return qe(e).path}function vN(e){return hu(qe(e).path)}function mN(e){return qe(e).isRoot}function yN(e,t){var r=B7(qe(e),t);return r?r.value:void 0}function bN(e,t,r){var n=qe(t).root.identifierCache.resolve(e,xu(r));return n==null?void 0:n.value}function E7(e){return qe(e).identifier}function _N(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Mt(r))return t?w2(r)?r:void 0:r;throw new Ue("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof T2)return;throw n}}function wN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Mt(r))return t?w2(r):!0;throw new Ue("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof T2)return!1;throw n}}function O7(e,t){var r=B7(qe(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function SN(e,t){return z7(qe(e),qe(t))}function EN(e,t){t===void 0&&(t=!0);var r=qe(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function ON(e){return qe(e).detach(),e}function PN(e){var t=qe(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function w2(e){return qe(e).observableIsAlive}function xN(e,t){var r=qe(e);return r.addDisposer(t),t}function CN(e){var t=qe(e),r=t.root.environment;if(!r)throw new Ue("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function TN(e){var t=qe(e),r=t.root.environment;return!!r}function P7(e,t){var r=qe(e);r.getChildren().forEach(function(n){Mt(n.storedValue)&&P7(n.storedValue,t)}),t(r.storedValue)}function x7(e){var t;return Mt(e)?t=Pf(e):t=e,{name:t.name,properties:Tr({},t.properties)}}function AN(e){var t=qe(e).type,r=Tr(Tr({},x7(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){q8(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):Y8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function kN(e){return e}function RN(e){return e}function LN(e){return e}function MN(e){return qe(e).nodeId}var C7=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:Vr.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 V7),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=$c("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?ko(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!==Vr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Vr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=$c("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===Vr.CREATED){if(this.parent){if(this.parent.state!==Vr.FINALIZED)return;this.fireHook(xr.afterAttach)}this.state=Vr.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=Vr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(xr.beforeDestroy)}}),e}(),Xc=function(e){Gt(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=Vr.DEAD,u}return l.state=Vr.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Ue("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===Vr.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}(C7);Xc.prototype.die=wr(Xc.prototype.die);var NN=1,Ai;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Ai||(Ai={}));var zn;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(zn||(zn={}));var IN={onError:function(e){throw e}},kn=function(e){Gt(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:++NN}),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:Ai.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=Ml(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new tI),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 Ue("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=xu(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===Ai.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=Ai.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===Ai.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=Pc(l),v=f.next();!v.done;v=f.next()){var S=v.value;S.createObservableInstanceIfNeeded(!1)}}catch(b){n={error:b}}finally{try{v&&!v.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var _=this.type;try{this.storedValue=_.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,_.finalizeNewInstance(this,this.storedValue)}catch(b){throw this.state=Vr.DEAD,b}finally{this._isRunningAction=!1}if(this._observableInstanceState=Ai.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=fu,this.state=Vr.CREATED,r){this.fireHook(xr.afterCreate),this.finalizeCreation();try{for(var p=Pc(l.reverse()),E=p.next();!E.done;E=p.next()){var S=E.value;S.fireHook(xr.afterCreate),S.finalizeCreation()}}catch(b){a={error:b}}finally{try{E&&!E.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(xr.beforeDetach);var r=this.state;this.state=Vr.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(xr.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"&&(ru?ru(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===Ai.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=m7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new Ue(i);case"warn":pI(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&&ko(r.subpath)||"",a=r.actionContext||S2();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&S7(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===Ai.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(fu),this._autoUnbox=!1;try{return this._observableInstanceState===Ai.CREATED?this.type.getChildren(this):H7(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 Ue("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=Pc(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(xr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Ue("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=Zc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=hu(i.path),o=U7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=Zc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),yl(this.storedValue,"$treenode",this),yl(this.storedValue,"toJSON",nI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Vr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Ai.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(zn.Dispose),this._internalEventsClear(zn.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(zn.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(zn.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(zn.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(zn.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=fI({},r,{path:i}),o=fa(_I(a),2),l=o[0],u=o[1];this._internalEventsEmit(zn.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(zn.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(zn.Dispose,r,!0);return}throw new Ue("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(zn.Dispose,r))throw new Ue("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(zn.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=j8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},IN);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 V7),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,da([r],fa(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}(C7);kn.prototype.createObservableInstance=wr(kn.prototype.createObservableInstance);kn.prototype.detach=wr(kn.prototype.detach);kn.prototype.die=wr(kn.prototype.die);var T7,ut;(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"})(ut||(ut={}));var A7="cannotDetermine",DN=Symbol("$type"),Ua=function(){function e(t){Object.defineProperty(this,T7,{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 Ia(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 Ue("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=j7(t);if(n){var i=Pf(t);return this.isAssignableFrom(i)?Rn():Ln(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 Ue("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 Ue("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 Ue("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 Ue("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}();T7=DN;Ua.prototype.create=wr(Ua.prototype.create);var uu=function(e){Gt(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===xu(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||Mt(n)&&qe(n)===r?!0:r.type===this&&G7(n)&&!Mt(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(),Mt(n)&&this.isAssignableFrom(Pf(n))){var l=qe(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}(Ua);uu.prototype.create=wr(uu.prototype.create);var Yl=function(e){Gt(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}(Ua);function an(e){return typeof e=="object"&&e&&e.isType===!0}var Ji=new Map;function FN(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),Ji.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Ji.get(r.id).async===!1&&(Ji.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Ji.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Ji.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Ji.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Ji.get(r.rootId);return Ji.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Ji.get(r.rootId);return Ji.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var jN=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 zN(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=Tr(Tr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new jN(u,o);t.set(n.id,f);var v=void 0;try{v=i(n)}catch(_){throw t.delete(n.id),f.finish(_),_}return f.hasFlowsPending||(t.delete(n.id),f.finish()),v}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 S=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(S))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function BN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(du(n))return n;if(Mt(n))return Ud("[MSTNode: ".concat(Pf(n).name,"]"));if(typeof n=="function")return Ud("[function]");if(typeof n=="object"&&!gl(n)&&!x2(n))return Ud("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return Ud(""+i)}}function UN(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function Ud(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function k7(e,t){ru(function(){C2(t).forEach(function(r){return HN(e,r)})})}function HN(e,t){var r=O7(e,t.path||"");if(!r)throw new Ue("Invalid action path: ".concat(t.path||""));var n=qe(r);if(t.name==="@APPLY_PATCHES")return su.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return _7.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw new Ue("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 UN(n,i)}):[])}function GN(e,t){var r=[],n=function(o){var l=t?t(o,E2()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=R7(e,n))},replay:function(o){k7(o,r)}};return a.resume(),a}function R7(e,t,r){return r===void 0&&(r=!1),N7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=qe(i.context),l={name:i.name,path:z7(qe(e),o),args:i.args.map(function(f,v){return BN(o,i.name,v,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var $N=1,xc;function S2(){return xc}function L7(){return $N++}function Dm(e,t){var r=qe(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=xc;xc=e;try{return WN(r,e,t)}finally{xc=i,r._isRunningAction=n}}function M7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Zc(e,t,r){var n=function(){var i=L7(),a=xc,o=M7(a);return Dm({type:"action",name:t,id:i,args:q7(arguments),context:e,tree:w7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?da(da([],fa(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function N7(e,t,r){r===void 0&&(r=!0);var n=qe(e);return n.addMiddleWare(t,r)}function VN(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 qN=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 WN(e,t,r){var n=new qN(e,r);if(n.isEmpty)return wr(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return wr(r).apply(null,o.args);if(!l.includeHooks&&xr[o.name])return a(o);function f(S,_){i=a(S),_&&(i=_(i))}function v(S){i=S}return u(o,f,v),i}return a(t)}function E2(){for(var e=S2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function I7(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 YN(e,t){return I7(e,t,!1)}function KN(e,t){return I7(e,t,!0)}function XN(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function D7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Mt(e)?"<".concat(e,">"):"`".concat(XN(e),"`")}function ZN(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function QN(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=Mt(t)?"value of type ".concat(qe(t).type.name,":"):du(t)?"value":"snapshot",o=r&&Mt(t)&&r.is(qe(t).snapshot);return"".concat(i).concat(a," ").concat(D7(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?aS(r)||du(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 O2(e,t,r){return e.concat([{path:t,type:r}])}function Rn(){return cu}function Ln(e,t,r){return[{context:e,value:t,message:r}]}function g0(e){return e.reduce(function(t,r){return t.concat(r)},[])}function Ia(e,t){gI()&&F7(e,t)}function F7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Ue(JN(e,t,r))}function JN(e,t,r){if(r.length!==0)return"Error while converting ".concat(ZN(D7(t))," to `").concat(e.name,`\`:
93
+
94
+ `)+r.map(QN).join(`
95
+ `)}var eI=0,tI=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:eI++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Ft.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Ft.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,Ft.array([],v0));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Ue("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;Gy(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 K8(this.cache).forEach(function(a){for(var o=fa(a,2),l=o[0],u=o[1],f=!1,v=u.length-1;v>=0;v--){var S=u[v];(S===t||S.path.indexOf(i)===0)&&(n.addNodeToCache(S,!1),u.splice(v,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 Ue("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 P2(e,t,r,n,i){var a=j7(i);if(a){if(a.parent)throw new Ue("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 kn(e,t,r,n,i)}function Ko(e,t,r,n,i){return new Xc(e,t,r,n,i)}function rI(e){return e instanceof Xc||e instanceof kn}var Vr;(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"})(Vr||(Vr={}));function Mt(e){return!!(e&&e.$treenode)}function qe(e){if(!Mt(e))throw new Ue("Value ".concat(e," is no MST Node"));return e.$treenode}function j7(e){return e&&e.$treenode||null}function nI(){return qe(this).snapshot}var iI=function(e){return".."};function z7(e,t){if(e.root!==t.root)throw new Ue("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=hu(e.path),n=hu(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(iI).join("/")+Vh(n.slice(i))}function B7(e,t,r){return r===void 0&&(r=!0),U7(e,hu(t),r)}function U7(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 Xc){var o=n.value;Mt(o)&&(n=qe(o))}if(n instanceof kn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new Ue("Could not resolve '".concat(a,"' in path '").concat(Vh(t.slice(0,i))||"/","' while resolving '").concat(Vh(t),"'"))}}catch(u){if(!r)return;throw u}return n}function H7(e){if(!e)return cu;var t=Object.keys(e);if(!t.length)return cu;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function aI(e){return W7(),Y7(e)}var oI=Object.toString(),cu=Object.freeze([]),fu=Object.freeze({}),v0=x8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(v0);var Ue=function(e){Gt(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 lI(e){return e}var sI=Number.isInteger;function uI(e){return Number(e)===e&&e%1!==0}function cI(e){return Number.isFinite(e)}function x2(e){return Array.isArray(e)||vn(e)}function C2(e){return e?x2(e)?e:[e]:cu}function fI(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 gl(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())===oI}function G7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function du(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function $7(e){return typeof e!="function"}function dI(e,t,r){zr(e)?Vy(e,t,r):Object.defineProperty(e,t,r)}function yl(e,t,r){dI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var hI=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,da([],fa(t),!1))})}}),e}(),V7=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 hI),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,da([],fa(n),!1))}}),e}();function q7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function bg(e,t){return e.indexOf(t)===0}var W7=function(e,t){};W7.ids={};function pI(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function gI(){return typeof process<"u"&&N4&&N4.ENABLE_TYPE_CHECK==="true"}function _g(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function Y7(e){return bI(e.name,e)}function vI(e){return e}function mI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return y7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,da([],fa(r),!1))];case 1:return[2,n.sent()]}})}}function yI(e){return y7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function bI(e,t){var r=function(){var i=L7(),a=S2();if(!a)throw new Ue("a mst flow must always have a parent context");var o=M7(a);if(!o)throw new Ue("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:da(da([],fa(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(v,S,_){return v.$mst_middleware=r.$mst_middleware,Dm(Tr(Tr({},l),{type:S,args:[_]}),v)}return new Promise(function(v,S){var _,p=function(){_=t.apply(null,arguments),E(void 0)};p.$mst_middleware=r.$mst_middleware,Dm(Tr(Tr({},l),{type:"flow_spawn",args:q7(u)}),p);function E(g){var h;try{var d=f(function(y){h=_.next(y)},"flow_resume",g);d instanceof Error&&(h=_.throw(d))}catch(y){_g(function(){f(function(O){S(y)},"flow_throw",y)});return}m(h)}function b(g){var h;try{f(function(d){h=_.throw(d)},"flow_resume_error",g)}catch(d){_g(function(){f(function(y){S(d)},"flow_throw",d)});return}m(h)}function m(g){if(g.done){_g(function(){f(function(h){v(h)},"flow_return",g.value)});return}if(!g.value||typeof g.value.then!="function")throw new Ue("Only promises can be yielded to `async`, got: "+g);return g.value.then(E,b)}})};return r._isFlowAction=!0,r}function _I(e){if(!("oldValue"in e))throw new Ue("Patches without `oldValue` field cannot be inversed");return[wI(e),SI(e)]}function wI(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 SI(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 EI(e){return typeof e=="number"}function ko(e){return EI(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function K7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Vh(e){if(e.length===0)return"";var t=function(r){return r.map(ko).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function hu(e){var t=e.split("/").map(K7),r=e===""||e==="."||e===".."||bg(e,"/")||bg(e,"./")||bg(e,"../");if(!r)throw new Ue("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var wg=Symbol("$preProcessorFailed"),OI=function(e){Gt(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|ut.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 wg}}}),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;PI(r.type,this,"create"),r instanceof kn&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},lS(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=Mt(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,Mt(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===wg?Ln(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=an(r)?this._subtype:Mt(r)?_2(r,!1):this.preProcessSnapshotSafe(r);return n===wg?!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 uu))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(Ua);function PI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Pc(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 xI(e,t,r){return new OI(e,t,r)}var I4="Map.put can only be used to store complex values that have an identifier type attribute";function X7(e,t){var r,n,i=e.getSubTypes();if(i===A7)return!1;if(i){var a=C2(i);try{for(var o=Pc(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!X7(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 Qc&&t.push(e),!0}var mo;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(mo||(mo={}));var CI=function(e){Gt(t,e);function t(r,n){return e.call(this,r,Ft.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 Ue("Map.put cannot be used to set empty values");if(Mt(r)){var n=qe(r);if(n.identifier===null)throw new Ue(I4);return this.set(n.identifier,r),r}else if(G7(r)){var i=qe(this),a=i.type;if(a.identifierMode!==mo.YES)throw new Ue(I4);var o=a.mapIdentifierAttribute,l=r[o];if(!A2(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(_2(u))}var f=xu(l);return this.set(f,r),this.get(f)}else throw new Ue("Map.put can only be used to store complex values")}}),t}(_p),qh=function(e){Gt(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:mo.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:ut.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(),P2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===mo.UNKNOWN){var r=[];if(X7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new Ue("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=mo.YES,this.mapIdentifierAttribute=n):this.identifierMode=mo.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 CI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Hy(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=Zc(n,l,u);yl(n,l,f)})}),mp(n,this.willChange),bp(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 Gy(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 Ue("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(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;Ia(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":Ia(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===mo.YES&&n instanceof kn){var i=n.identifier;if(i!==r)throw new Ue("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=qe(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:ko(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:ko(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:ko(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){Ia(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 gl(r)?g0(Object.keys(r).map(function(a){return i._subType.validate(r[a],O2(n,a,i._subType))})):Ln(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return fu}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(uu);qh.prototype.applySnapshot=wr(qh.prototype.applySnapshot);function TI(e){return new qh("Map<string, ".concat(e.name,">"),e)}function AI(e){return an(e)&&(e.flags&ut.Map)>0}var Wh=function(e){Gt(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:ut.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 P2(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=Tr(Tr({},v0),{name:this.name});return Ft.array(H7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Bi(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=Zc(n,l,u);yl(n,l,f)})}),mp(n,this.willChange),bp(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 Ue("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qe(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=D4(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,v=D4(n,i,a.slice(l,l+u),f,f.map(function(_,p){return l+p}));if(!v)return null;r.added=v;for(var S=l+u;S<a.length;S++)a[S].setParent(n,""+(S+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=qe(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){Ia(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 x2(r)?g0(r.map(function(a,o){return i._subType.validate(a,O2(n,""+o,i._subType))})):Ln(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return cu}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(uu);Wh.prototype.applySnapshot=wr(Wh.prototype.applySnapshot);function kI(e){return new Wh("".concat(e.name,"[]"),e)}function D4(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,v=""+i[o];if(rI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof kn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(F4(u,f))r[o]=Sg(t,e,v,f,u);else{for(var _=void 0,p=o;p<r.length;p++)if(F4(r[p],f)){_=r.splice(p,1)[0];break}a=!1;var S=Sg(t,e,v,f,_);r.splice(o,0,S)}else{if(Mt(f)&&qe(f).parent===e)throw new Ue("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(v,"', but it lives already at '").concat(qe(f).path,"'"));a=!1;var S=Sg(t,e,v,f);r.splice(o,0,S)}}return a?null:r}function Sg(e,t,r,n,i){Ia(e,n);function a(){if(Mt(n)){var l=qe(n);if(l.assertAlive(fu),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 kn&&i.createObservableInstanceIfNeeded(),i.die()),o}function F4(e,t){if(!e.isAlive)return!1;if(Mt(t)){var r=qe(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof kn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&gl(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function RI(e){return an(e)&&(e.flags&ut.Array)>0}var j4="preProcessSnapshot",z4="postProcessSnapshot";function LI(){return qe(this).toString()}var B4={name:"AnonymousModel",properties:{},initializers:cu};function MI(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Ue("".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 xr)throw new Ue("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 Ue("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new Ue("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(du(o))n[i]=bl(zI(o),o);else if(o instanceof qh)n[i]=bl(o,{});else if(o instanceof Wh)n[i]=bl(o,[]);else if(!an(o))throw new Ue("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},Tr({},e))}var Qc=function(e){Gt(t,e);function t(r){var n=e.call(this,r.name||B4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.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,B4,r),n.properties=MI(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&ut.Identifier){if(r)throw new Ue("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(!gl(n))throw new Ue("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===j4)throw new Ue("Cannot define action '".concat(j4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===z4)throw new Ue("Cannot define action '".concat(z4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in xr&&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 v=Zc(r,i,f);n[i]=v,yl(r,i,v)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Ue("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(!gl(n))throw new Ue("volatile state initializer should return a plain object containing state");$y(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,v=aN(o,["actions","views","state"]);for(var S in v)throw new Ue("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(S,"'"));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(!gl(n))throw new Ue("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)Vy(r,i,o),qy(r,(a={},a[i]=Ml,a));else if(typeof o.value=="function")yl(r,i,o.value);else throw new Ue("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=Mt(a)?a:this.applySnapshotPreProcessor(a);return P2(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=Tr(Tr({},v0),{name:this.name});return Ft.object(r,fu,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){yl(n,"toString",LI),this.forAllProps(function(i){Hy(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),mp(n,this.willChange),bp(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=qe(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(Ia(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=qe(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:ko(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 Ue("Not a value property: "+n);var a=Bi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new Ue("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=ca(r.storedValue,o);u.reportObserved()}catch{throw new Ue("".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 Ue("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){Ia(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 gl(a)?g0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],O2(n,o,i.properties[o]))})):Ln(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 fu}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(uu);Qc.prototype.applySnapshot=wr(Qc.prototype.applySnapshot);function NI(){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 Qc({name:r,properties:n})}function II(){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 Z7(e){return an(e)&&(e.flags&ut.Object)>0}var Ya=function(e){Gt(t,e);function t(r,n,i,a){a===void 0&&(a=lI);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 Ko(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(du(r)&&this.checker(r))return Rn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Ln(n,r,"Value is not a ".concat(i))}}),t}(Yl),Q7=new Ya("string",ut.String,function(e){return typeof e=="string"}),J7=new Ya("number",ut.Number,function(e){return typeof e=="number"}),DI=new Ya("integer",ut.Integer,function(e){return sI(e)}),FI=new Ya("float",ut.Float,function(e){return uI(e)}),jI=new Ya("finite",ut.Finite,function(e){return cI(e)}),eS=new Ya("boolean",ut.Boolean,function(e){return typeof e=="boolean"}),tS=new Ya("null",ut.Null,function(e){return e===null}),rS=new Ya("undefined",ut.Undefined,function(e){return e===void 0}),nS=new Ya("Date",ut.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});nS.getSnapshot=function(e){return e.storedValue.getTime()};var iS=nS;function zI(e){switch(typeof e){case"string":return Q7;case"number":return J7;case"boolean":return eS;case"object":if(e instanceof Date)return iS}throw new Ue("Cannot determine primitive type from value "+e)}function aS(e){return an(e)&&(e.flags&(ut.String|ut.Number|ut.Integer|ut.Boolean|ut.Date))>0}var BI=function(e){Gt(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:ut.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ko(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 du(r)&&r===this.value?Rn():Ln(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Yl);function oS(e){return new BI(e)}function UI(e){return an(e)&&(e.flags&ut.Literal)>0}var HI=function(e){Gt(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|ut.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=Mt(r)?qe(r).snapshot:r;return this._predicate(a)?Rn():Ln(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}(Ua);function GI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():an(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 HI(r,n,i,a)}function $I(e){return(e.flags&ut.Refinement)>0}function VI(e,t){var r=typeof e=="string"?t:e,n=m0.apply(void 0,da([],fa(r.map(function(i){return oS(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var qI=function(e){Gt(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=Tr({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=ut.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 Ue("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 Ue("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 Rn();a++}else i.push(u)}return a===1?Rn():Ln(n,r,"No type is applicable for the union").concat(g0(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Ua);function m0(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=an(e)?void 0:e,i=an(e)?da([e],fa(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new qI(a,i,n)}function lS(e){return(e.flags&ut.Union)>0}var WI=function(e){Gt(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|ut.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"&&Ia(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Rn():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}(Ua);function YI(e,t){if(typeof t!="function"&&Mt(t))throw new Ue("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function bl(e,t,r){return YI(e,t),new WI(e,t,r||KI)}var KI=[void 0];function XI(e){return an(e)&&(e.flags&ut.Optional)>0}var ZI=bl(rS,void 0),QI=bl(tS,null);function sS(e){return m0(e,ZI)}function JI(e){return m0(e,QI)}var eD=function(e){Gt(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)|ut.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 Ue("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):Rn()}}),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||A7}}),t}(Ua);function tD(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new eD(r,n)}function rD(e){return an(e)&&(e.flags&ut.Late)>0}function nD(e,t){return new iD(e,t)}var iD=function(e){Gt(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:ut.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Ft.array()}),wm(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(wr(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=Ko(this,r,n,i,a);return this.pendingNodeList.push(l),wm(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):$7(r)?Rn():Ln(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}(Yl),uS=function(e){Gt(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:ut.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 Ko(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return $7(r)?this.subType?this.subType.validate(r,n):Rn():Ln(n,r,"Value is not serializable and cannot be frozen")}}),t}(Yl),U4=new uS;function aD(e){return arguments.length===0?U4:an(e)?new uS(e):bl(U4,e)}function oD(e){return an(e)&&(e.flags&ut.Frozen)>0}function lD(e){switch(e){case xr.beforeDestroy:return"destroy";case xr.beforeDetach:return"detach";default:return}}var sD=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}),A2(t))this.identifier=t;else if(Mt(t)){var n=qe(t);if(!n.identifierAttribute)throw new Ue("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Ue("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Ue("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=xu(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 T2("[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}(),T2=function(e){Gt(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),cS=function(e){Gt(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:ut.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 A2(r)?Rn():Ln(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){su(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){Z7(o.type)?this.replaceRef(void 0):su(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=qe(a),l=function(v,S){var _=lD(S);_&&i.fireInvalidated(_,r,n,o)},u=o.registerHook(xr.beforeDetach,l),f=o.registerHook(xr.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(xr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,v=f&&f.storedValue;if(f&&f.isAlive&&v){var S=void 0;i?S=!!i.get(n,v):S=r.root.identifierCache.has(a.targetType,xu(n)),S?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Vr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(xr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(xr.afterAttach,function(){l(!1)}))}}}),t}(Yl),uD=function(e){Gt(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=Mt(a)?E7(a):a,l=new sD(a,this.targetType),u=Ko(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=Mt(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}(cS),cD=function(e){Gt(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=Mt(a)?this.options.set(a,r?r.storedValue:null):a,l=Ko(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=Mt(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}(cS);function fS(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new cD(e,{get:r.get,set:r.set},n):new uD(e,n)}function fD(e){return(e.flags&ut.Reference)>0}function dD(e,t){var r=fS(e,Tr(Tr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:sS(r)}var dS=function(e){Gt(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:ut.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 Qc))throw new Ue("Identifier types can only be instantiated as direct child of a model type");return Ko(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 Ue("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?Ln(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):Rn()}}),t}(Yl),hD=function(e){Gt(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ut.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(dS),pD=function(e){Gt(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}(dS),gD=new hD,vD=new pD;function mD(e){return an(e)&&(e.flags&ut.Identifier)>0}function xu(e){return""+e}function A2(e){return typeof e=="string"||typeof e=="number"}function yD(e){return new bD(e)}var bD=function(e){Gt(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:ut.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 Rn();var i=this.options.getValidationMessage(r);return i?Ln(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):Rn()}}),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 Ko(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}(Yl),H4={enumeration:VI,model:NI,compose:II,custom:yD,reference:fS,safeReference:dD,union:m0,optional:bl,literal:oS,maybe:sS,maybeNull:JI,refinement:GI,string:Q7,boolean:eS,number:J7,integer:DI,float:FI,finite:jI,Date:iS,map:TI,array:kI,frozen:aD,identifier:gD,identifierNumber:vD,late:tD,lazy:nD,undefined:rS,null:tS,snapshotProcessor:xI};const _D=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:xN,addMiddleware:N7,applyAction:k7,applyPatch:su,applySnapshot:_7,cast:kN,castFlowReturn:vI,castToReferenceSnapshot:LN,castToSnapshot:RN,clone:EN,createActionTrackingMiddleware:FN,createActionTrackingMiddleware2:zN,decorate:VN,destroy:PN,detach:ON,escapeJsonPath:ko,flow:Y7,getChildType:oN,getEnv:CN,getIdentifier:E7,getLivelinessChecking:m7,getMembers:AN,getNodeId:MN,getParent:hN,getParentOfType:gN,getPath:S7,getPathParts:vN,getPropertyMembers:x7,getRelativePath:SN,getRoot:w7,getRunningActionContext:E2,getSnapshot:_2,getType:Pf,hasEnv:TN,hasParent:dN,hasParentOfType:pN,isActionContextChildOf:YN,isActionContextThisOrChildOf:KN,isAlive:w2,isArrayType:RI,isFrozenType:oD,isIdentifierType:mD,isLateType:rD,isLiteralType:UI,isMapType:AI,isModelType:Z7,isOptionalType:XI,isPrimitiveType:aS,isProtected:fN,isReferenceType:fD,isRefinementType:$I,isRoot:mN,isStateTreeNode:Mt,isType:an,isUnionType:lS,isValidReference:wN,joinJsonPath:Vh,onAction:R7,onPatch:b7,onSnapshot:lN,process:aI,protect:uN,recordActions:GN,recordPatches:sN,resolveIdentifier:bN,resolvePath:yN,setLivelinessChecking:v7,setLivelynessChecking:iN,splitJsonPath:hu,t:H4,toGenerator:yI,toGeneratorFunction:mI,tryReference:_N,tryResolve:O7,typecheck:F7,types:H4,unescapeJsonPath:K7,unprotect:cN,walk:P7},Symbol.toStringTag,{value:"Module"})),$i=Do(_D);(function(e){var t=Se&&Se.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(it),n=Hi,i=Wa,a=Sf,o=ha,l=t(vi),u=nN,f=Ef,v=ua,S=Pu,_=hi,p=b2,E=Of,b=ql,m=Wl,g=Yo,h=$i;l.default._fixTextRendering=!0;const d=document.createElement("style");d.type="text/css",document.head.appendChild(d);const y={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function O(z){var F="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+F+"]*?["+F+"]").test(z)}function k(z){z=z.replace(/\s/g,"");let F=0;for(var G=0;G<z.length;G++)O(z[G])&&(F+=1);return F>z.length/2}function C(z){return k(z)?"rtl":"ltr"}e.isRTLText=k,e.getDir=C;const w=(0,n.observer)(({textNodeRef:z,element:F,onBlur:G,selectAll:L,cursorPosition:I})=>{const[B,D]=r.default.useState(y),$=z.current;r.default.useLayoutEffect(()=>{const Z={};Z.width=$.width()-2*$.padding()+"px",Z.height=$.height()-2*$.padding()+$.fontSize()*$.lineHeight()+"px",Z.fontSize=$.fontSize()+"px",Z.lineHeight=$.lineHeight()+.01,Z.fontFamily=$.fontFamily(),Z.textAlign=$.align(),Z.color=$.fill(),Z.fontWeight=F.fontWeight,Z.fontStyle=F.fontStyle,Z.letterSpacing=F.letterSpacing+"em";const J=`
96
+ .polotno-input::placeholder {
97
+ color: ${B.color};
98
+ opacity: 0.6;
99
+ }
100
+ `;d.innerHTML="",d.appendChild(document.createTextNode(J)),JSON.stringify(Z)!==JSON.stringify(B)&&D(Z)});const K=r.default.useRef(null);r.default.useEffect(()=>{const Z=setTimeout(()=>{var J;const ee=K.current;if(!ee)return;(J=K.current)===null||J===void 0||J.focus();const re=I||ee.value.length;ee.selectionStart=ee.selectionEnd=re,L&&(ee==null||ee.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(Z)}},[]),r.default.useEffect(()=>{window.addEventListener("blur",G);const Z=J=>{var ee;!((ee=K.current)===null||ee===void 0)&&ee.contains(J.target)||G()};return window.addEventListener("touchstart",Z),()=>{window.removeEventListener("blur",G),window.removeEventListener("touchstart",Z)}},[]);let Y=0;const H=$.textArr.length*$.lineHeight()*$.fontSize();F.verticalAlign==="middle"&&(Y=(F.a.height-H)/2),F.verticalAlign==="bottom"&&(Y=F.a.height-H);const X=(0,p.removeTags)(F.text);return r.default.createElement(a.Html,null,r.default.createElement("textarea",{className:"polotno-input",ref:K,dir:C(X),style:Object.assign(Object.assign(Object.assign({},y),B),{paddingTop:Y+"px"}),value:X,onChange:Z=>{F.set({text:Z.target.value})},placeholder:F.placeholder,onBlur:G}))}),P=z=>{const[F,G]=r.default.useState(!1),L=r.default.useRef(!1);return r.default.useEffect(()=>{var I=!0;return setTimeout(()=>{I&&(z._editModeEnabled&&(L.current=!0),G(!0),setTimeout(()=>{L.current=!1},50))},50),()=>{I=!1}},[]),{editorEnabled:F&&z._editModeEnabled,selectAll:L.current}},x=(z,F)=>{const[G,L]=r.default.useReducer(B=>B+1,0),I=r.default.useRef((0,S.isFontLoaded)(F));return r.default.useLayoutEffect(()=>{if(I.current=(0,S.isFontLoaded)(F),I.current)return;let B=!0;return(async()=>{I.current=!1,L();const D=(0,v.incrementLoader)(`text ${F}`);await z.loadFont(F),setTimeout(D,100),B&&(I.current=!0,L())})(),()=>{B=!1}},[F]),[I.current]};e.useFontLoader=x;const A=({fontLoaded:z,fontFamily:F,fontSize:G,lineHeight:L})=>r.default.useMemo(()=>{if(typeof L=="number")return L;const I=document.createElement("div");I.style.fontFamily=F,I.style.fontSize=G+"px",I.style.lineHeight=L,I.innerText="Test text",document.body.appendChild(I);const B=I.offsetHeight;return document.body.removeChild(I),B/G},[z,F,G,L]);function R(z){var F=z.getAbsoluteTransform().copy();F.invert();var G=z.getStage().getPointerPosition();return F.point(G)}function M(z){var F;const G=z.target,L=R(G),I=G.textArr,B=Math.floor(L.y/(G.fontSize()*G.lineHeight())),D=I.slice(0,B).reduce((Y,H)=>Y+H.text.length,B),$=(F=I[B])!==null&&F!==void 0?F:I[0];let K=0;return G.align()==="right"?K=G.width()-$.width:G.align()==="center"&&(K=G.width()/2-$.width/2),D+Math.round((L.x-K)/$.width*$.text.length)}function U(z){const F=r.default.useRef(z),G=r.default.useRef(z);return r.default.useMemo(()=>{G.current=F.current,F.current=z},[z]),G.current}function V(z,F){const G=z.fontSize(),L=z.height(),I=(0,p.removeTags)(F.text);let B=F.a.fontSize;z.height(void 0);const D=Math.round(2*F.a.fontSize)-1;for(let $=1;$<D;$++){const K=F.a.height&&z.height()>F.a.height,Y=I.split(`
101
+ `).join(" ").split(/[\s-]+/);let H=z.textArr.map(Z=>Z.text).join(";");const X=Y.find(Z=>!H.includes(Z)||(H=H.replace(Z,""),!1));if(!(K||X))break;B-=.5,z.fontSize(B)}return z.fontSize(G),z.height(L),B}function q({lines:z,lineHeight:F,width:G,align:L="left",padding:I=0,cornerRadius:B=0}){var D;z.forEach((H,X)=>{H.cx=G/2,L==="right"?H.cx=G-H.width/2:L==="left"&&(H.cx=H.width/2),L!=="justify"||H.lastInParagraph||(H.width=G),L==="justify"&&(H.cx=H.width/2)});let $=`M ${(D=z[0])===null||D===void 0?void 0:D.cx} ${-I}`;z.forEach((H,X)=>{const{cx:Z}=H,J=z[X-1];J&&J.width>H.width?$+=` L ${Z+H.width/2+I} ${X*F+I}`:$+=` L ${Z+H.width/2+I} ${X*F-I}`;const ee=z[X+1];ee&&ee.width>H.width?$+=` L ${Z+H.width/2+I} ${(X+1)*F-I}`:$+=` L ${Z+H.width/2+I} ${(X+1)*F+I}`});for(var K=z.length-1;K>=0;K--){const H=z[K],{cx:X}=H,Z=z[K+1];Z&&Z.width>H.width?$+=` L ${X-H.width/2-I} ${(K+1)*F-I}`:$+=` L ${X-H.width/2-I} ${(K+1)*F+I}`;const J=z[K-1];J&&J.width>H.width?$+=` L ${X-H.width/2-I} ${K*F+I}`:$+=` L ${X-H.width/2-I} ${K*F-I}`}$+=" Z";const Y=(0,u.parsePath)($);return(0,u.roundCommands)(Y,B).path}e.getLineHeight=A,e.usePrevious=U,e.TextElement=(0,n.observer)(({element:z,store:F})=>{const G=r.default.useRef(null),L=r.default.useRef(null),{editorEnabled:I,selectAll:B}=P(z),[D,$]=r.default.useState(!1),[K,Y]=r.default.useState(!1),H=r.default.useRef(z.a.height),X=F.selectedElements.indexOf(z)>=0,{textVerticalResizeEnabled:Z}=_.flags,J=U(z.fontFamily),[ee,re]=r.default.useState([]);r.default.useEffect(()=>{var _e,Ne;const ke=(Ne=(_e=G.current)===null||_e===void 0?void 0:_e.textArr)!==null&&Ne!==void 0?Ne:[];JSON.stringify(ke)!==JSON.stringify(ee)&&re(ke)}),r.default.useEffect(()=>{if(z.a.width)return;const _e=G.current;_e.width(600),z.set({width:1.4*_e.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const _e=G.current;(0,E.applyFilter)(_e,z)}));const[ae]=(0,e.useFontLoader)(F,z.fontFamily),le=(0,p.removeTags)(z.text),ue=()=>{const _e=G.current.clone({height:void 0}),Ne=Math.ceil(_e.fontSize()*_e.lineHeight()*_e.textArr.length+1);return _e.destroy(),Ne};r.default.useLayoutEffect(()=>{if(!ae)return;const{textOverflow:_e}=_.flags;if(z.a.height)if(_e!=="change-font-size"||K||F.isPlaying){if(_e==="resize"){const Ne=ue();Z&&z.a.height<Ne&&F.history.ignore(()=>{var ke;(0,h.isAlive)(z)&&z.set({height:Ne}),(ke=G.current)===null||ke===void 0||ke.height(Ne)},!1,!0),Z||z.a.height===Ne||F.history.ignore(()=>{var ke;(0,h.isAlive)(z)&&z.set({height:Ne}),(ke=G.current)===null||ke===void 0||ke.height(Ne)},!1,!0)}}else{const Ne=V(G.current,z);if(Ne!==z.a.fontSize)return void F.history.ignore(()=>{z.set({fontSize:Ne})},!1,!0);const ke=ue();z.a.height===ke||Z||F.history.ignore(()=>{z.set({height:ke})},!1,!0)}else{const Ne=ue();F.history.ignore(()=>{z.set({height:Ne})},!1,!0)}}),r.default.useLayoutEffect(()=>{const _e=G.current;_e&&(_e.width(_e.width()+1e-8),_e._setTextData(),(0,E.applyFilter)(_e,z))},[ae]);const Ae=r.default.useRef(null),ze=r.default.useRef(0),oe=_e=>{_e.evt.preventDefault(),F.selectedShapes.find(ke=>ke===z)&&z.contentEditable&&(ze.current=M(_e),z.toggleEditMode())},ie=!le&&z.placeholder?.6:z.a.opacity;(0,b.useFadeIn)(G,ie);const ve=(0,e.getLineHeight)({fontLoaded:ae,fontFamily:z.fontFamily,fontSize:z.a.fontSize,lineHeight:z.lineHeight}),ge=z.selectable||F.role==="admin",te=(0,f.useColor)(z),he=r.default.useMemo(()=>z.backgroundEnabled?q({lines:JSON.parse(JSON.stringify(ee)),cornerRadius:z.backgroundCornerRadius*(z.a.fontSize*ve*.5),lineHeight:ve*z.a.fontSize,padding:z.backgroundPadding*(z.a.fontSize*ve*.5),width:z.a.width,align:z.align}):"",[z.backgroundEnabled,z.backgroundCornerRadius,z.a.fontSize,ve,z.backgroundPadding,z.a.width,z.align,ee]),de=(0,g.useMobile)();let we=0;return z.verticalAlign==="middle"?we=(z.a.height-ee.length*ve*z.a.fontSize)/2:z.verticalAlign==="bottom"&&(we=z.a.height-ee.length*ve*z.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:L,x:z.a.x,y:z.a.y,rotation:z.a.rotation,hideInExport:!z.showInExport||!le,listening:!1,visible:z.backgroundEnabled,opacity:z.backgroundOpacity,data:he,fill:z.backgroundColor,offsetY:-we}),r.default.createElement(i.Text,Object.assign({ref:G,id:z.id,name:"element",hideInExport:!z.showInExport||!le,editModeEnabled:z._editModeEnabled,x:z.a.x,y:z.a.y,rotation:z.a.rotation,width:z.a.width,height:z.a.height,text:le||z.placeholder},te,{stroke:z.stroke,lineJoin:"round",strokeWidth:z.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:z.a.fontSize,fontFamily:`"${z.fontFamily}", "${J}"`,fontStyle:z.fontStyle+" "+z.fontWeight,textDecoration:z.textDecoration,align:z.align,verticalAlign:z.verticalAlign,draggable:de?z.draggable&&X:z.draggable,preventDefault:!de||X,opacity:ie,visible:!z._editModeEnabled,ellipsis:_.flags.textOverflow==="ellipsis",shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur,shadowOffsetX:z.shadowOffsetX,shadowOffsetY:z.shadowOffsetY,shadowColor:z.shadowColor,shadowOpacity:z.shadowOpacity,lineHeight:ve,letterSpacing:z.letterSpacing*z.a.fontSize,listening:ge,onDragMove:_e=>{z.set({x:_e.target.x(),y:_e.target.y()})},onDragEnd:_e=>{z.set({x:_e.target.x(),y:_e.target.y()})},onMouseEnter:()=>{$(!0)},onMouseLeave:()=>{$(!1)},onClick:oe,onTap:oe,onTransformStart:()=>{Y(!0),H.current=G.current.height()},onTransform:_e=>{var Ne,ke;const tt=_e.target;(Ne=L.current)===null||Ne===void 0||Ne.setAttrs({x:tt.x(),y:tt.y(),rotation:tt.rotation(),scale:tt.scale()});const ot=((ke=tt.getStage())===null||ke===void 0?void 0:ke.findOne("Transformer")).getActiveAnchor();if(ot==="middle-left"||ot==="middle-right"){const gt=tt.scaleX(),Bt=tt.width()*gt,fe=z.a.fontSize;let pe=Bt;Bt<fe&&(pe=fe,Ae.current&&tt.position(Ae.current)),tt.width(pe),tt.scaleX(1),tt.scaleY(1);const nt=ue();if(_.flags.textOverflow!=="ellipsis"){const Oe=Math.max(nt,H.current);tt.height(Oe),z.set({height:tt.height()})}z.set({x:tt.x(),y:tt.y(),width:tt.width(),rotation:tt.rotation()}),(0,E.applyFilter)(tt,z)}if(ot==="top-center"||ot==="bottom-center"){let gt=_.flags.textOverflow==="resize"?ue():ve*z.a.fontSize;_e.target.height(Math.max(gt,_e.target.height()*_e.target.scaleY())),_e.target.scaleY(1)}Ae.current=_e.target.position()},onTransformEnd:_e=>{var Ne;const ke=_e.target.scaleX();_e.target.scaleX(1),_e.target.scaleY(1),z.set({fontSize:Math.round(z.a.fontSize*ke),width:Math.ceil(_e.target.width()*ke),x:_e.target.x(),y:_e.target.y(),rotation:_e.target.rotation(),height:_e.target.height()*ke,shadowBlur:z.shadowBlur*ke,shadowOffsetX:z.shadowOffsetX*ke,shadowOffsetY:z.shadowOffsetY*ke,strokeWidth:z.strokeWidth*ke}),(Ne=L.current)===null||Ne===void 0||Ne.setAttrs({scaleX:1,scaleY:1}),Y(!1)}})),I&&r.default.createElement(i.Group,{x:z.a.x,y:z.a.y,rotation:z.a.rotation},r.default.createElement(w,{textNodeRef:G,element:z,selectAll:B,cursorPosition:ze.current,onBlur:()=>{z.toggleEditMode(!1)}})),!K&&(D||X)&&r.default.createElement(m.Highlighter,{element:z}))})})(v2);var k2={},Cu={};(function(e){var t=Se&&Se.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};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(vi),n=t(it),i=m2;function a(d){for(;d.parentNode;){if(d.nodeName==="defs")return!0;d=d.parentNode}return!1}function o(d){const y={fill:"",stroke:""};if(d.getAttribute("fill")&&d.getAttribute("fill")!=="none"&&(y.fill=d.getAttribute("fill")),!y.fill&&d.style.fill&&d.style.fill!=="none"&&(y.fill=d.style.fill),d.getAttribute("stroke")&&(y.stroke=d.getAttribute("stroke")),!y.stroke&&d.style.stroke&&(y.stroke=d.style.stroke),!y.stroke&&!y.fill){const O=d.ownerSVGElement,k=O&&O!==d&&o(O);(k==null?void 0:k.fill)==="currentColor"||(k==null?void 0:k.stroke)==="currentColor"||(y.fill="black")}return y}const l=["path","rect","circle"];function u(d){for(var y=[],O=d.getElementsByTagName("*"),k=0,C=O.length;k<C;k++){const w=O[k];a(w)||(w.getAttribute("fill")!==null&&y.push(w),(w.getAttribute("stroke")!==null||w.style&&w.style.fill||l.indexOf(w.nodeName)>=0)&&y.push(w))}return y}async function f(d){const y=await fetch(d);return _(await y.text())}async function v(d){return await(await fetch(d,{mode:"cors"})).text()}function S(d){const y=u(new DOMParser().parseFromString(d,"image/svg+xml")),O=[];return y.forEach(k=>{const{fill:C,stroke:w}=o(k);[C,w].forEach(P=>{P&&(P==="currentColor"&&(P="black"),r.default.Util.colorToRGBA(P)&&O.indexOf(P)===-1&&O.push(P))})}),O}function _(d){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(d)))}async function p(d){const y=await v(d),O=new DOMParser().parseFromString(y,"image/svg+xml").documentElement.getAttribute("viewBox"),[k,C,w,P]=(O==null?void 0:O.split(" "))||[];return{width:parseFloat(w),height:parseFloat(P)}}function E(d){var y=new DOMParser().parseFromString(d,"image/svg+xml");const O=y.documentElement.getAttribute("viewBox"),[k,C,w,P]=(O==null?void 0:O.split(" "))||[],x=y.documentElement.getAttribute("width");!x&&y.documentElement.setAttribute("width",w+"px");const A=y.documentElement.getAttribute("height");if((!A||A.indexOf("%")>=0)&&y.documentElement.setAttribute("height",P+"px"),x&&x.indexOf("%")>=0&&A&&A.indexOf("%")===-1){const R=parseFloat(A)/parseFloat(P);y.documentElement.setAttribute("width",R*parseFloat(w)+"px")}if(A&&A.indexOf("%")>=0&&x&&x.indexOf("%")===-1){const R=parseFloat(x)/parseFloat(w);y.documentElement.setAttribute("height",R*parseFloat(P)+"px")}return x==="100%"&&A==="100%"&&(y.documentElement.setAttribute("width",w+"px"),y.documentElement.setAttribute("height",P+"px")),new XMLSerializer().serializeToString(y)}e.urlToBase64=f,e.urlToString=v,e.getColors=S,e.svgToURL=_,e.getSvgSize=p,e.fixSize=E;const b=(d,y)=>{if(!d||!y)return!1;if(y==="currentColor"&&d==="black")return!0;const O=r.default.Util.colorToRGBA(d),k=r.default.Util.colorToRGBA(y);return O&&k?O.r===k.r&&O.g===k.g&&O.b===k.b&&O.a===k.a:void 0};function m(d,y,O,k){var C=d.namespaceURI,w=document.createElementNS(C,"linearGradient");const P=r.default.Util.degToRad(O+90),x=(Math.cos(P)+1)/2,A=(Math.sin(P)+1)/2,R=(Math.cos(P+Math.PI)+1)/2,M=(Math.sin(P+Math.PI)+1)/2;w.setAttribute("x1",100*x+"%"),w.setAttribute("y1",100*A+"%"),w.setAttribute("x2",100*R+"%"),w.setAttribute("y2",100*M+"%"),w.setAttribute("gradientUnits","userSpaceOnUse"),w.setAttribute("id",y);for(var U=0;U<k.length;U++){var V=k[U],q=document.createElementNS(C,"stop");for(var z in V)V.hasOwnProperty(z)&&q.setAttribute(z,V[z]);w.appendChild(q)}return(d.querySelector("defs")||d.insertBefore(document.createElementNS(C,"defs"),d.firstChild)).appendChild(w)}function g(d,y){var O=new DOMParser().parseFromString(d,"image/svg+xml");const k=u(O),C=Array.from(y.keys());return k.forEach(w=>{const{fill:P,stroke:x}=o(w);[{prop:"fill",color:P},{prop:"stroke",color:x}].forEach(({prop:A,color:R})=>{const M=C.find(U=>(0,e.sameColors)(U,R));if(M){const U=y.get(M);if((0,i.isGradient)(U)){const{rotation:V,stops:q}=(0,i.parseColor)(U),z=q.map(G=>({offset:100*G.offset+"%","stop-color":G.color})),F="color"+Math.round(1e8*Math.random());m(O.children[0],F,V,z),w.style[A]=null,w.setAttribute(A,`url('#${F}')`)}else w.style[A]=y.get(M)}})}),_(new XMLSerializer().serializeToString(O))}e.sameColors=b,e.replaceColors=g;const h=d=>{const[y,O]=n.default.useState([]);return n.default.useEffect(()=>{let k=!1;return(async()=>{O([]);const C=S(await v(d));k||O(C)})(),()=>{k=!0}},[d]),y};e.useSvgColors=h})(Cu);(function(e){var t=Se&&Se.__createBinding||(Object.create?function(D,$,K,Y){Y===void 0&&(Y=K);var H=Object.getOwnPropertyDescriptor($,K);H&&!("get"in H?!$.__esModule:H.writable||H.configurable)||(H={enumerable:!0,get:function(){return $[K]}}),Object.defineProperty(D,Y,H)}:function(D,$,K,Y){Y===void 0&&(Y=K),D[Y]=$[K]}),r=Se&&Se.__setModuleDefault||(Object.create?function(D,$){Object.defineProperty(D,"default",{enumerable:!0,value:$})}:function(D,$){D.default=$}),n=Se&&Se.__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=Se&&Se.__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(it),o=Hi,l=ha,u=Wa,f=i(p0),v=i(vi),S=Sf,_=Wl,p=ua,E=n(Cu),b=hi,m=Of,g=ql,h=Yo;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 E.urlToString(D),K=E.fixSize($);return E.svgToURL(K)}const O=D=>{const[$,K]=a.default.useState(D);return a.default.useEffect(()=>{(async()=>{const Y=await y(D);Y!==$&&K(Y)})()},[D]),$};function k(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 w=(D,$,K)=>{const Y=a.default.useMemo(()=>{var H,X;const{flipX:Z,flipY:J}=D,ee=D.type==="svg"||D.src.indexOf("data:image/svg+xml")>=0||D.src.indexOf(".svg")>=0,re=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&ee||D.maskSrc;if(!Z&&!J&&!re)return $;if(!$||!$.width||!$.height)return null;const ae=d();let le=1;D.type==="svg"&&(le=Math.max(D.a.width/$.width*K,D.a.height/$.height*K)),ae.width=Math.max($.width*le,1),ae.height=Math.max($.height*le,1);let ue=Z?-ae.width:0,Ae=J?-ae.height:0;return(H=ae.getContext("2d"))===null||H===void 0||H.scale(Z?-1:1,J?-1:1),(X=ae.getContext("2d"))===null||X===void 0||X.drawImage($,ue,Ae,ae.width,ae.height),ae},[D.maskSrc,D.flipX,D.flipY,$,D.a.width,D.a.height,K]);return a.default.useEffect(()=>()=>{Y&&Y.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(Y)},[Y]),Y};function P(D,$){const K=$.width/$.height;let Y,H;return K>=D.width/D.height?(Y=D.width,H=D.width/K):(Y=D.height*K,H=D.height),{x:(D.width-Y)/2,y:(D.height-H)/2,width:Y,height:H}}function x(D,$,K,Y,H,X,Z){for(var J=new ImageData($,K),ee=new Int32Array(D.data.buffer),re=D.width,ae=new Int32Array(J.data.buffer),le=J.width,ue=$/X,Ae=K/Z,ze=Math.round(1/ue),oe=Math.round(1/Ae),ie=ze*oe,ve=0;ve<J.height;ve++)for(var ge=0;ge<le;ge++){for(var te=Y+Math.round(ge/ue)+(H+Math.round(ve/Ae))*re,he=0,de=0,we=0,_e=0,Ne=0;Ne<oe;Ne++)for(var ke=0;ke<ze;ke++){var tt=ee[te+ke+Ne*re];he+=tt<<24>>>24,de+=tt<<16>>>24,we+=tt<<8>>>24,_e+=tt>>>24}he=Math.round(he/ie),de=Math.round(de/ie),we=Math.round(we/ie),_e=Math.round(_e/ie),ae[ge+ve*le]=_e<<24|we<<16|de<<8|he}return J}function A(D,$){var K,Y;const H=d();H.width=D.width,H.height=D.height;const X=Math.max(1,Math.floor(H.width*$)),Z=Math.max(1,Math.floor(H.height*$));(K=H.getContext("2d"))===null||K===void 0||K.drawImage(D,0,0,H.width,H.height);const J=x(H.getContext("2d").getImageData(0,0,H.width,H.height),X,Z,0,0,H.width,H.height);return H.width=X,H.height=Z,(Y=H.getContext("2d"))===null||Y===void 0||Y.putImageData(J,0,0),H}const R=(D,$)=>{const[K,Y]=F(D.maskSrc,"anonymous"),H=D.maskSrc?Y:"loaded";return(0,e.useImageLoader)(H,D.id+"-mask"),a.default.useMemo(()=>{if(!K||!$||!$.width||!$.height)return $;const X=d();X.width=Math.max($.width,1),X.height=Math.max($.height,1);const Z=X.getContext("2d");if(!Z)return $;Z.drawImage($,0,0),Z.globalCompositeOperation="source-in";const J=P(K,D);return Z.drawImage(K,J.x,J.y,J.width,J.height,0,0,$.width,$.height),X},[$,K,D.a.width,D.a.height])},M=(D,$,K,Y,H=0,X=!1)=>{const Z=Math.floor(Math.max(D.a.width*Y,1)),J=Math.floor(Math.max(D.a.height*Y,1)),ee=Math.min(H*Y,Z/2,J/2),re=Math.max(D.a.width/K.width,D.a.height/K.height)*Y,ae=D.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&re<1&&!X,le=K.x===0&&K.y===0&&K.width===($==null?void 0:$.width)&&K.height===($==null?void 0:$.height),ue=a.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return le&&ee===0&&!ae?void 0:d()},[$,ee,ae,le]);return a.default.useLayoutEffect(()=>{if(!ue||!$)return;ue.width=Z,ue.height=J;const Ae=ue.getContext("2d");if(!Ae)return;ee&&(Ae.beginPath(),Ae.moveTo(ee,0),Ae.lineTo(Z-ee,0),Ae.arc(Z-ee,ee,ee,3*Math.PI/2,0,!1),Ae.lineTo(Z,J-ee),Ae.arc(Z-ee,J-ee,ee,0,Math.PI/2,!1),Ae.lineTo(ee,J),Ae.arc(ee,J-ee,ee,Math.PI/2,Math.PI,!1),Ae.lineTo(0,ee),Ae.arc(ee,ee,ee,Math.PI,3*Math.PI/2,!1),Ae.clip());const ze=ae?A($,re):$,oe=ae?{x:Math.floor(K.x*re),y:Math.floor(K.y*re),width:Math.floor(K.width*re),height:Math.floor(K.height*re)}:K;Ae.drawImage(ze,oe.x,oe.y,oe.width,oe.height,0,0,ue.width,ue.height)},[ue,D.a.width,D.a.height,K.x,K.y,K.width,K.height,H,Y,X,D.page._exportingOrRendering,ae]),a.default.useEffect(()=>()=>{ue&&ue.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(ue)},[ue]),ue||$},U=(D,$,K,Y)=>{const H=O(D.clipSrc||""),[X,Z]=F(H,"anonymous"),J=D.clipSrc?Z:"loaded";(0,e.useImageLoader)(J,D.id+"-clip");const ee=a.default.useMemo(()=>{if($&&X)return d()},[$,X]);return a.default.useLayoutEffect(()=>{var re;if(!X||!$||!$.width||!$.height||!X||!X.width||!X.height||!ee)return;const ae=d(),le=Math.max(D.a.width/X.width*K,D.a.height/X.height*K);ae.width=X.width*le,ae.height=X.height*le,(re=ae.getContext("2d"))===null||re===void 0||re.drawImage(X,0,0,ae.width,ae.height),ee.width=Math.max($.width,1),ee.height=Math.max($.height,1);const ue=ee.getContext("2d");ue&&(ue.save(),ue.drawImage(ae,0,0,$.width,$.height),v.default.Util.releaseCanvas(ae),ue.globalCompositeOperation="source-in",ue.drawImage($,0,0,ee.width,ee.height),ue.restore())},[ee,$,X,D.a.width,D.a.height,K,...Y]),D.clipSrc&&X?ee:$},V=d(),q=(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 Y=K.current;if(!Y)return;const H=new v.default.Animation(X=>{Y.rotate(((X==null?void 0:X.timeDiff)||0)/2)},Y.getLayer());return H.start(),()=>{H.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}))}),z=(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 F=f.default;const G=D=>{F=D};e.setImageLoaderHook=G;const L=(D,$)=>{const K=a.default.useRef(),Y=()=>{var H;(H=K.current)===null||H===void 0||H.call(K),K.current=void 0};a.default.useEffect(()=>Y,[]),a.default.useLayoutEffect(()=>{D!=="loading"||K.current||(K.current=(0,p.incrementLoader)(`image ${$}`)),D!=="loading"&&Y(),D==="failed"&&(0,p.triggerLoadError)(`image ${$}`)},[D])};e.useImageLoader=L;const I=({image:D,status:$,type:K})=>{const Y=a.default.useRef();return a.default.useEffect(()=>{Y.current=D||Y.current},[D]),$!=="failed"||$!=="failed"&&K==="svg"?Y.current:void 0},B=D=>{const[$,K]=a.default.useReducer(Z=>Z+1,0),Y=a.default.useRef("loading"),H=a.default.useRef(D.src),X=a.default.useRef(D.src);return X.current!==D.src&&(X.current=D.src,Y.current="loading"),a.default.useEffect(()=>{if(D.type!=="svg"||!D.src)return;let Z=!1;return(async()=>{Y.current="loading",K();const J=await E.urlToString(D.src),ee=E.fixSize(J),re=E.replaceColors(ee,D.colorsReplace);Z||(H.current=re,Y.current="loaded",K())})(),()=>{Z=!0}},[D.src,JSON.stringify(D.colorsReplace)]),D.type!=="svg"?[D.src,"loaded"]:[H.current,Y.current]};e.ImageElement=(0,o.observer)(({element:D,store:$})=>{var K;const[Y,H]=a.default.useState(!1),X=a.default.useRef(null),Z=a.default.useRef(null),[J,ee]=a.default.useState(!1),re=$.selectedElements.indexOf(D)>=0,[ae,le]=B(D),[ue,Ae]=F(ae,"anonymous"),ze=D.type!=="svg"||le==="loaded"?Ae:"loading";(0,e.useImageLoader)(ze,D.id);const oe=I({image:ue,status:Ae,type:D.type}),ie=R(D,w(D,ue||oe,$._elementsPixelRatio))||V;let{cropX:ve,cropY:ge,cropWidth:te,cropHeight:he}=D;Ae!=="loaded"&&(ve=ge=0,te=he=1);const de=ie.width*te,we=ie.height*he,_e=D.a.width/D.a.height;let Ne,ke;const tt=de/we,ot=D.type==="svg";ot?(Ne=de,ke=we):_e>=tt?(Ne=de,ke=de/_e):(Ne=we*_e,ke=we);const gt={x:ie.width*ve,y:ie.height*ge,width:Ne,height:ke},Bt=(K=D.cornerRadius)!==null&&K!==void 0?K:0,fe=D.page._exportingOrRendering?1:Math.min(2,$.scale),pe=$._elementsPixelRatio*fe;let nt=U(D,M(D,ie,gt,pe,Bt,Y||D._cropModeEnabled||D.type==="svg"),pe,[gt,Bt,pe]);const Oe=Math.max(D.a.width/Ne,D.a.height/ke);a.default.useEffect(()=>{var De;if(!D._cropModeEnabled)return;const rt=(De=X.current)===null||De===void 0?void 0:De.getStage();function Xe(Je){D._cropModeEnabled&&Je.target!==Z.current&&D.toggleCropMode(!1)}function kt(Je){D._cropModeEnabled&&Je.target.parentNode!==rt.content&&D.toggleCropMode(!1)}return document.body.addEventListener("click",kt),rt==null||rt.on("click",Xe),rt==null||rt.on("tap",Xe),()=>{document.body.removeEventListener("click",kt),document.body.removeEventListener("touchstart",kt),rt==null||rt.off("click",Xe),rt==null||rt.off("click",Xe)}},[D._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(Y||D._cropModeEnabled))return(0,m.applyFilter)(X.current,D),(0,l.autorun)(()=>{(0,m.applyFilter)(X.current,D)},{delay:100})},[nt,D.page._exportingOrRendering,Y,te,he,D._cropModeEnabled]),a.default.useLayoutEffect(()=>{var De;Y||D._cropModeEnabled?(De=X.current)===null||De===void 0||De.clearCache():(0,m.applyFilter)(X.current,D)},[Y,D.a.width,D.a.height,D._cropModeEnabled]),a.default.useEffect(()=>{(0,m.applyFilter)(X.current,D)},[D.shadowEnabled,D.shadowBlur,D.cornerRadius,D.shadowColor,D.shadowOffsetX,D.shadowOffsetY,D.shadowOpacity]);const Fe=a.default.useRef(null),Le=a.default.useRef(null),Ee=a.default.useRef(null);a.default.useLayoutEffect(()=>{D._cropModeEnabled&&(Le.current.nodes([Fe.current]),Ee.current.nodes([Z.current]))},[D._cropModeEnabled]);var Ze=a.default.useRef(null),Pe=a.default.useRef(0),Ye=a.default.useRef(!1);const Sr=De=>{var rt;((rt=De.evt.touches)===null||rt===void 0?void 0:rt.length)>2&&De.target.stopDrag(),Math.round(De.target.x())>0&&(De.target.x(0),De.target.scaleX(1)),Math.round(De.target.y())>0&&(De.target.y(0),De.target.scaleY(1));const Xe=De.target.width()*De.target.scaleX(),kt=De.target.height()*De.target.scaleY(),Je=Math.min(1,Ne/Xe),fr=Math.min(1,ke/kt),dt=1-Je,$t=Math.min(dt,Math.max(0,Math.round(-De.target.x())/Xe)),Br=1-fr,vr=Math.min(Br,Math.max(0,Math.round(-De.target.y())/kt));De.target.setAttrs({x:-$t*ie.width,y:-vr*ie.height,scaleX:1,scaleY:1}),D.set({cropX:$t,cropY:vr,cropWidth:Je,cropHeight:fr})},xe=()=>{D.type!=="svg"&&D.contentEditable&&setTimeout(()=>{D.toggleCropMode(!0)})},He=D.type==="svg"&&oe,Qe=Ae==="loading"&&!He,Et=Ae==="failed",Pt=!Qe&&!Et,ar=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Rr=Pt?D.a.opacity:0;(0,g.useFadeIn)(X,Rr);const Lr=D.selectable||$.role==="admin",ln=(0,h.useMobile)();return a.default.createElement(a.default.Fragment,null,Qe&&a.default.createElement(q,{element:D}),Et&&a.default.createElement(z,{element:D}),a.default.createElement(u.Image,{ref:X,name:"element",id:D.id,image:nt,x:D.a.x,y:D.a.y,width:D.a.width||1,height:D.a.height||1,rotation:D.rotation,opacity:Rr,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur,shadowOffsetX:D.shadowOffsetX,shadowOffsetY:D.shadowOffsetY,shadowColor:D.shadowColor,shadowOpacity:D.shadowOpacity,customCrop:gt,listening:Lr,draggable:ln?D.draggable&&re:D.draggable,preventDefault:!ln||re,hideInExport:!D.showInExport,onMouseEnter:()=>{ee(!0)},onMouseLeave:()=>{ee(!1)},onDragMove:De=>{D.set({x:De.target.x(),y:De.target.y()})},onDragEnd:De=>{D.set({x:De.target.x(),y:De.target.y()})},onDblClick:xe,onDblTap:xe,onTransformStart:()=>{H(!0),ar.current={cropX:D.cropX,cropY:D.cropY,cropWidth:D.cropWidth,cropHeight:D.cropHeight}},onTransform:De=>{var rt;const Xe=De.currentTarget,kt=Math.abs(Xe.scaleX()-1)<1e-7?1:Xe.scaleX(),Je=Math.abs(Xe.scaleY()-1)<1e-7?1:Xe.scaleY();Xe.scaleX(1),Xe.scaleY(1);const fr=(rt=De.target.getStage())===null||rt===void 0?void 0:rt.findOne("Transformer"),dt=1-Ne/ie.width,$t=Math.min(dt,Math.max(0,D.cropX)),Br=1-ke/ie.height,vr=Math.min(Br,Math.max(0,D.cropY)),Mr=fr.getActiveAnchor(),Mn=!(Mr.indexOf("middle")>=0||Mr.indexOf("center")>=0),mi=!Mn&&kt<1&&ar.current.cropHeight>ke/ie.height;let mn=Mn?D.cropWidth:D.cropWidth*kt;mi&&(mn=D.cropWidth);const sn=!Mn&&Je<1&&ar.current.cropWidth>Ne/ie.width;let Kn=Mn?D.cropHeight:D.cropHeight*Je;sn&&(Kn=D.cropHeight),ot&&(mn=D.cropWidth,Kn=D.cropHeight),D.set({cropX:$t,cropY:vr,x:Xe.x(),y:Xe.y(),width:Xe.width()*kt,height:Xe.height()*Je,rotation:De.target.rotation(),cropWidth:Math.min(mn,1-$t),cropHeight:Math.min(Kn,1-vr)})},onTransformEnd:De=>{const rt=De.currentTarget;D.set({width:rt.width(),height:rt.height(),x:rt.x(),y:rt.y(),rotation:De.target.rotation(),cropWidth:Ne/ie.width,cropHeight:ke/ie.height}),H(!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:Rr,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,Bt-D.borderSize),hideInExport:!D.showInExport}),D._cropModeEnabled&&a.default.createElement(S.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:nt,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:Oe,scaleY:Oe},a.default.createElement(u.Image,{image:ie,ref:Z,opacity:.4,draggable:!0,x:-D.cropX*ie.width,y:-D.cropY*ie.height,onDragMove:Sr,onTransform:Sr,onTouchMove:De=>{De.evt.preventDefault();const rt=De.target.getStage().getPointersPositions();var Xe=rt[0],kt=rt[1];const Je=De.target;if(Xe&&!kt&&!Je.isDragging()&&Ye.current&&(Je.startDrag(),Ye.current=!1),Xe&&kt){v.default.hitOnDragEnabled=!0,Je.isDragging()&&(Ye.current=!0,Je.stopDrag());const sn=De.target.getAbsoluteTransform().copy();sn.invert();var fr={x:Xe.x,y:Xe.y},dt={x:kt.x,y:kt.y};if(!Ze.current)return void(Ze.current=C(fr,dt));var $t=C(fr,dt),Br=k(fr,dt);Pe.current||(Pe.current=Br);const Kn=Je.position();var vr={x:$t.x-Kn.x,y:$t.y-Kn.y},Mr=Br/Pe.current;Je.scaleX(Mr),Je.scaleY(Mr);const Ka=sn.point($t),yi=sn.point(Ze.current);var Mn=Ka.x-yi.x,mi=Ka.y-yi.y,mn={x:Math.min(0,$t.x-vr.x*Mr+Mn),y:Math.min(0,$t.y-vr.y*Mr+mi)};Je.position(mn),Pe.current=Br,Ze.current=$t,Sr(De)}},onTouchEnd:De=>{Pe.current=0,Ze.current=null,v.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:Ee,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,rt)=>rt.width<5||rt.height<5?De:rt,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Ne,height:ke,ref:Fe,listening:!1,onTransform:De=>{De.target.x()<-D.cropX*ie.width-1e-9&&(De.target.x(-D.cropX*ie.width),De.target.scaleX(1)),De.target.y()<-D.cropY*ie.height-1e-9&&(De.target.y(-D.cropY*ie.height),De.target.scaleY(1));const rt=Math.min(1,Math.max(0,D.cropX+De.target.x()/ie.width)),Xe=Math.min(1,Math.max(0,De.target.y()/ie.height+D.cropY)),kt=De.target.width()*De.target.scaleX(),Je=De.target.height()*De.target.scaleY(),fr=Math.min(1-rt,kt/ie.width),dt=Math.min(1-Xe,Je/ie.height),$t=De.target.getAbsolutePosition(De.target.getParent().getParent());De.target.scale({x:1,y:1}),De.target.position({x:0,y:0}),D.set({x:$t.x,y:$t.y,cropX:rt,cropY:Xe,cropWidth:fr,cropHeight:dt,width:Math.min(kt*Oe,ie.width*(1-rt)*Oe),height:Math.min(Je*Oe,ie.height*(1-Xe)*Oe)})}}),a.default.createElement(u.Transformer,{ref:Le,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,rt)=>rt.width<5||rt.height<5?De:rt,visible:D.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(J||re)&&a.default.createElement(_.Highlighter,{element:D}))})})(k2);var hS={},pS={exports:{}};/*!
102
+ * Quill Editor v1.3.7
103
+ * https://quilljs.com/
104
+ * Copyright (c) 2014, Jason Chen
105
+ * Copyright (c) 2013, salesforce.com
106
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:Se,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),v=i(47),S=i(48),_=i(49),p=i(12),E=i(32),b=i(33),m=i(31),g=i(1),h={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:S.default,Scroll:u.default,Block:v.default,Inline:f.default,Text:_.default,Attributor:{Attribute:p.default,Class:E.default,Style:b.default,Store:m.default}};n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,h){g.__proto__=h}||function(g,h){for(var d in h)h.hasOwnProperty(d)&&(g[d]=h[d])};return function(g,h){m(g,h);function d(){this.constructor=g}g.prototype=h===null?Object.create(h):(d.prototype=h.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(m){a(g,m);function g(h){var d=this;return h="[Parchment] "+h,d=m.call(this,h)||this,d.message=h,d.name=d.constructor.name,d}return g}(Error);n.ParchmentError=o;var l={},u={},f={},v={};n.DATA_KEY="__blot";var S;(function(m){m[m.TYPE=3]="TYPE",m[m.LEVEL=12]="LEVEL",m[m.ATTRIBUTE=13]="ATTRIBUTE",m[m.BLOT=14]="BLOT",m[m.INLINE=7]="INLINE",m[m.BLOCK=11]="BLOCK",m[m.BLOCK_BLOT=10]="BLOCK_BLOT",m[m.INLINE_BLOT=6]="INLINE_BLOT",m[m.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",m[m.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",m[m.ANY=15]="ANY"})(S=n.Scope||(n.Scope={}));function _(m,g){var h=E(m);if(h==null)throw new o("Unable to create "+m+" blot");var d=h,y=m instanceof Node||m.nodeType===Node.TEXT_NODE?m:d.create(g);return new d(y,g)}n.create=_;function p(m,g){return g===void 0&&(g=!1),m==null?null:m[n.DATA_KEY]!=null?m[n.DATA_KEY].blot:g?p(m.parentNode,g):null}n.find=p;function E(m,g){g===void 0&&(g=S.ANY);var h;if(typeof m=="string")h=v[m]||l[m];else if(m instanceof Text||m.nodeType===Node.TEXT_NODE)h=v.text;else if(typeof m=="number")m&S.LEVEL&S.BLOCK?h=v.block:m&S.LEVEL&S.INLINE&&(h=v.inline);else if(m instanceof HTMLElement){var d=(m.getAttribute("class")||"").split(/\s+/);for(var y in d)if(h=u[d[y]],h)break;h=h||f[m.tagName]}return h==null?null:g&S.LEVEL&h.scope&&g&S.TYPE&h.scope?h:null}n.query=E;function b(){for(var m=[],g=0;g<arguments.length;g++)m[g]=arguments[g];if(m.length>1)return m.map(function(y){return b(y)});var h=m[0];if(typeof h.blotName!="string"&&typeof h.attrName!="string")throw new o("Invalid definition");if(h.blotName==="abstract")throw new o("Cannot register abstract class");if(v[h.blotName||h.attrName]=h,typeof h.keyName=="string")l[h.keyName]=h;else if(h.className!=null&&(u[h.className]=h),h.tagName!=null){Array.isArray(h.tagName)?h.tagName=h.tagName.map(function(y){return y.toUpperCase()}):h.tagName=h.tagName.toUpperCase();var d=Array.isArray(h.tagName)?h.tagName:[h.tagName];d.forEach(function(y){(f[y]==null||h.className==null)&&(f[y]=h)})}return h}n.register=b},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",v=function(S){Array.isArray(S)?this.ops=S:S!=null&&Array.isArray(S.ops)?this.ops=S.ops:this.ops=[]};v.prototype.insert=function(S,_){var p={};return S.length===0?this:(p.insert=S,_!=null&&typeof _=="object"&&Object.keys(_).length>0&&(p.attributes=_),this.push(p))},v.prototype.delete=function(S){return S<=0?this:this.push({delete:S})},v.prototype.retain=function(S,_){if(S<=0)return this;var p={retain:S};return _!=null&&typeof _=="object"&&Object.keys(_).length>0&&(p.attributes=_),this.push(p)},v.prototype.push=function(S){var _=this.ops.length,p=this.ops[_-1];if(S=l(!0,{},S),typeof p=="object"){if(typeof S.delete=="number"&&typeof p.delete=="number")return this.ops[_-1]={delete:p.delete+S.delete},this;if(typeof p.delete=="number"&&S.insert!=null&&(_-=1,p=this.ops[_-1],typeof p!="object"))return this.ops.unshift(S),this;if(o(S.attributes,p.attributes)){if(typeof S.insert=="string"&&typeof p.insert=="string")return this.ops[_-1]={insert:p.insert+S.insert},typeof S.attributes=="object"&&(this.ops[_-1].attributes=S.attributes),this;if(typeof S.retain=="number"&&typeof p.retain=="number")return this.ops[_-1]={retain:p.retain+S.retain},typeof S.attributes=="object"&&(this.ops[_-1].attributes=S.attributes),this}}return _===this.ops.length?this.ops.push(S):this.ops.splice(_,0,S),this},v.prototype.chop=function(){var S=this.ops[this.ops.length-1];return S&&S.retain&&!S.attributes&&this.ops.pop(),this},v.prototype.filter=function(S){return this.ops.filter(S)},v.prototype.forEach=function(S){this.ops.forEach(S)},v.prototype.map=function(S){return this.ops.map(S)},v.prototype.partition=function(S){var _=[],p=[];return this.forEach(function(E){var b=S(E)?_:p;b.push(E)}),[_,p]},v.prototype.reduce=function(S,_){return this.ops.reduce(S,_)},v.prototype.changeLength=function(){return this.reduce(function(S,_){return _.insert?S+u.length(_):_.delete?S-_.delete:S},0)},v.prototype.length=function(){return this.reduce(function(S,_){return S+u.length(_)},0)},v.prototype.slice=function(S,_){S=S||0,typeof _!="number"&&(_=1/0);for(var p=[],E=u.iterator(this.ops),b=0;b<_&&E.hasNext();){var m;b<S?m=E.next(S-b):(m=E.next(_-b),p.push(m)),b+=u.length(m)}return new v(p)},v.prototype.compose=function(S){var _=u.iterator(this.ops),p=u.iterator(S.ops),E=[],b=p.peek();if(b!=null&&typeof b.retain=="number"&&b.attributes==null){for(var m=b.retain;_.peekType()==="insert"&&_.peekLength()<=m;)m-=_.peekLength(),E.push(_.next());b.retain-m>0&&p.next(b.retain-m)}for(var g=new v(E);_.hasNext()||p.hasNext();)if(p.peekType()==="insert")g.push(p.next());else if(_.peekType()==="delete")g.push(_.next());else{var h=Math.min(_.peekLength(),p.peekLength()),d=_.next(h),y=p.next(h);if(typeof y.retain=="number"){var O={};typeof d.retain=="number"?O.retain=h:O.insert=d.insert;var k=u.attributes.compose(d.attributes,y.attributes,typeof d.retain=="number");if(k&&(O.attributes=k),g.push(O),!p.hasNext()&&o(g.ops[g.ops.length-1],O)){var C=new v(_.rest());return g.concat(C).chop()}}else typeof y.delete=="number"&&typeof d.retain=="number"&&g.push(y)}return g.chop()},v.prototype.concat=function(S){var _=new v(this.ops.slice());return S.ops.length>0&&(_.push(S.ops[0]),_.ops=_.ops.concat(S.ops.slice(1))),_},v.prototype.diff=function(S,_){if(this.ops===S.ops)return new v;var p=[this,S].map(function(h){return h.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var y=h===S?"on":"with";throw new Error("diff() called "+y+" non-document")}).join("")}),E=new v,b=a(p[0],p[1],_),m=u.iterator(this.ops),g=u.iterator(S.ops);return b.forEach(function(h){for(var d=h[1].length;d>0;){var y=0;switch(h[0]){case a.INSERT:y=Math.min(g.peekLength(),d),E.push(g.next(y));break;case a.DELETE:y=Math.min(d,m.peekLength()),m.next(y),E.delete(y);break;case a.EQUAL:y=Math.min(m.peekLength(),g.peekLength(),d);var O=m.next(y),k=g.next(y);o(O.insert,k.insert)?E.retain(y,u.attributes.diff(O.attributes,k.attributes)):E.push(k).delete(y);break}d-=y}}),E.chop()},v.prototype.eachLine=function(S,_){_=_||`
107
+ `;for(var p=u.iterator(this.ops),E=new v,b=0;p.hasNext();){if(p.peekType()!=="insert")return;var m=p.peek(),g=u.length(m)-p.peekLength(),h=typeof m.insert=="string"?m.insert.indexOf(_,g)-g:-1;if(h<0)E.push(p.next());else if(h>0)E.push(p.next(h));else{if(S(E,p.next(1).attributes||{},b)===!1)return;b+=1,E=new v}}E.length()>0&&S(E,{},b)},v.prototype.transform=function(S,_){if(_=!!_,typeof S=="number")return this.transformPosition(S,_);for(var p=u.iterator(this.ops),E=u.iterator(S.ops),b=new v;p.hasNext()||E.hasNext();)if(p.peekType()==="insert"&&(_||E.peekType()!=="insert"))b.retain(u.length(p.next()));else if(E.peekType()==="insert")b.push(E.next());else{var m=Math.min(p.peekLength(),E.peekLength()),g=p.next(m),h=E.next(m);if(g.delete)continue;h.delete?b.push(h):b.retain(m,u.attributes.transform(g.attributes,h.attributes,_))}return b.chop()},v.prototype.transformPosition=function(S,_){_=!!_;for(var p=u.iterator(this.ops),E=0;p.hasNext()&&E<=S;){var b=p.peekLength(),m=p.peekType();if(p.next(),m==="delete"){S-=Math.min(b,S-E);continue}else m==="insert"&&(E<S||!_)&&(S+=b);E+=b}return S},r.exports=v},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},f=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var E=i.call(p,"constructor"),b=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!E&&!b)return!1;var m;for(m in p);return typeof m>"u"||i.call(p,m)},v=function(p,E){o&&E.name==="__proto__"?o(p,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):p[E.name]=E.newValue},S=function(p,E){if(E==="__proto__")if(i.call(p,E)){if(l)return l(p,E).value}else return;return p[E]};r.exports=function _(){var p,E,b,m,g,h,d=arguments[0],y=1,O=arguments.length,k=!1;for(typeof d=="boolean"&&(k=d,d=arguments[1]||{},y=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});y<O;++y)if(p=arguments[y],p!=null)for(E in p)b=S(d,E),m=S(p,E),d!==m&&(k&&m&&(f(m)||(g=u(m)))?(g?(g=!1,h=b&&u(b)?b:[]):h=b&&f(b)?b:{},v(d,{name:E,newValue:_(k,h,m)})):typeof m<"u"&&v(d,{name:E,newValue:m}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function A(R,M){for(var U=0;U<M.length;U++){var V=M[U];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(R,V.key,V)}}return function(R,M,U){return M&&A(R.prototype,M),U&&A(R,U),R}}(),o=function A(R,M,U){R===null&&(R=Function.prototype);var V=Object.getOwnPropertyDescriptor(R,M);if(V===void 0){var q=Object.getPrototypeOf(R);return q===null?void 0:A(q,M,U)}else{if("value"in V)return V.value;var z=V.get;return z===void 0?void 0:z.call(U)}},l=i(3),u=d(l),f=i(2),v=d(f),S=i(0),_=d(S),p=i(16),E=d(p),b=i(6),m=d(b),g=i(7),h=d(g);function d(A){return A&&A.__esModule?A:{default:A}}function y(A,R){if(!(A instanceof R))throw new TypeError("Cannot call a class as a function")}function O(A,R){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:A}function k(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(A,R):A.__proto__=R)}var C=1,w=function(A){k(R,A);function R(){return y(this,R),O(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return a(R,[{key:"attach",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"attach",this).call(this),this.attributes=new _.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new v.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(U,V){var q=_.default.query(U,_.default.Scope.BLOCK_ATTRIBUTE);q!=null&&this.attributes.attribute(q,V)}},{key:"formatAt",value:function(U,V,q,z){this.format(q,z)}},{key:"insertAt",value:function(U,V,q){if(typeof V=="string"&&V.endsWith(`
108
+ `)){var z=_.default.create(P.blotName);this.parent.insertBefore(z,U===0?this:this.next),z.insertAt(0,V.slice(0,-1))}else o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,V,q)}}]),R}(_.default.Embed);w.scope=_.default.Scope.BLOCK_BLOT;var P=function(A){k(R,A);function R(M){y(this,R);var U=O(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M));return U.cache={},U}return a(R,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(_.default.Leaf).reduce(function(U,V){return V.length()===0?U:U.insert(V.value(),x(V))},new v.default).insert(`
109
+ `,x(this))),this.cache.delta}},{key:"deleteAt",value:function(U,V){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,U,V),this.cache={}}},{key:"formatAt",value:function(U,V,q,z){V<=0||(_.default.query(q,_.default.Scope.BLOCK)?U+V===this.length()&&this.format(q,z):o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,U,Math.min(V,this.length()-U-1),q,z),this.cache={})}},{key:"insertAt",value:function(U,V,q){if(q!=null)return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,V,q);if(V.length!==0){var z=V.split(`
110
+ `),F=z.shift();F.length>0&&(U<this.length()-1||this.children.tail==null?o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,Math.min(U,this.length()-1),F):this.children.tail.insertAt(this.children.tail.length(),F),this.cache={});var G=this;z.reduce(function(L,I){return G=G.split(L,!0),G.insertAt(0,I),I.length},U+F.length)}}},{key:"insertBefore",value:function(U,V){var q=this.children.head;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,U,V),q instanceof E.default&&q.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"length",this).call(this)+C),this.cache.length}},{key:"moveChildren",value:function(U,V){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"moveChildren",this).call(this,U,V),this.cache={}}},{key:"optimize",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"removeChild",this).call(this,U),this.cache={}}},{key:"split",value:function(U){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(V&&(U===0||U>=this.length()-C)){var q=this.clone();return U===0?(this.parent.insertBefore(q,this),this):(this.parent.insertBefore(q,this.next),q)}else{var z=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"split",this).call(this,U,V);return this.cache={},z}}}]),R}(_.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[m.default,_.default.Embed,h.default];function x(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A==null||(typeof A.formats=="function"&&(R=(0,u.default)(R,A.formats())),A.parent==null||A.parent.blotName=="scroll"||A.parent.statics.scope!==A.statics.scope)?R:x(A.parent,R)}n.bubbleFormats=x,n.BlockEmbed=w,n.default=P},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(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},o=function(){function G(L,I){var B=[],D=!0,$=!1,K=void 0;try{for(var Y=L[Symbol.iterator](),H;!(D=(H=Y.next()).done)&&(B.push(H.value),!(I&&B.length===I));D=!0);}catch(X){$=!0,K=X}finally{try{!D&&Y.return&&Y.return()}finally{if($)throw K}}return B}return function(L,I){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return G(L,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function G(L,I){for(var B=0;B<I.length;B++){var D=I[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(L,D.key,D)}}return function(L,I,B){return I&&G(L.prototype,I),B&&G(L,B),L}}();i(50);var u=i(2),f=x(u),v=i(14),S=x(v),_=i(8),p=x(_),E=i(9),b=x(E),m=i(0),g=x(m),h=i(15),d=x(h),y=i(3),O=x(y),k=i(10),C=x(k),w=i(34),P=x(w);function x(G){return G&&G.__esModule?G:{default:G}}function A(G,L,I){return L in G?Object.defineProperty(G,L,{value:I,enumerable:!0,configurable:!0,writable:!0}):G[L]=I,G}function R(G,L){if(!(G instanceof L))throw new TypeError("Cannot call a class as a function")}var M=(0,C.default)("quill"),U=function(){l(G,null,[{key:"debug",value:function(I){I===!0&&(I="log"),C.default.level(I)}},{key:"find",value:function(I){return I.__quill||g.default.find(I)}},{key:"import",value:function(I){return this.imports[I]==null&&M.error("Cannot import "+I+". Are you sure it was registered?"),this.imports[I]}},{key:"register",value:function(I,B){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof I!="string"){var K=I.attrName||I.blotName;typeof K=="string"?this.register("formats/"+K,I,B):Object.keys(I).forEach(function(Y){D.register(Y,I[Y],B)})}else this.imports[I]!=null&&!$&&M.warn("Overwriting "+I+" with",B),this.imports[I]=B,(I.startsWith("blots/")||I.startsWith("formats/"))&&B.blotName!=="abstract"?g.default.register(B):I.startsWith("modules")&&typeof B.register=="function"&&B.register()}}]);function G(L){var I=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(R(this,G),this.options=V(L,B),this.container=this.options.container,this.container==null)return M.error("Invalid Quill container",L);this.options.debug&&G.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 p.default,this.scroll=g.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new S.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(K){K===p.default.events.TEXT_CHANGE&&I.root.classList.toggle("ql-blank",I.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(K,Y){var H=I.selection.lastRange,X=H&&H.length===0?H.index:void 0;q.call(I,function(){return I.editor.update(null,Y,X)},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(G,[{key:"addContainer",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof I=="string"){var D=I;I=document.createElement("div"),I.classList.add(D)}return this.container.insertBefore(I,B),I}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(I,B,D){var $=this,K=z(I,B,D),Y=o(K,4);return I=Y[0],B=Y[1],D=Y[3],q.call(this,function(){return $.editor.deleteText(I,B)},D,I,-1*B)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(I),this.container.classList.toggle("ql-disabled",!I)}},{key:"focus",value:function(){var I=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=I,this.scrollIntoView()}},{key:"format",value:function(I,B){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return q.call(this,function(){var K=D.getSelection(!0),Y=new f.default;if(K==null)return Y;if(g.default.query(I,g.default.Scope.BLOCK))Y=D.editor.formatLine(K.index,K.length,A({},I,B));else{if(K.length===0)return D.selection.format(I,B),Y;Y=D.editor.formatText(K.index,K.length,A({},I,B))}return D.setSelection(K,p.default.sources.SILENT),Y},$)}},{key:"formatLine",value:function(I,B,D,$,K){var Y=this,H=void 0,X=z(I,B,D,$,K),Z=o(X,4);return I=Z[0],B=Z[1],H=Z[2],K=Z[3],q.call(this,function(){return Y.editor.formatLine(I,B,H)},K,I,0)}},{key:"formatText",value:function(I,B,D,$,K){var Y=this,H=void 0,X=z(I,B,D,$,K),Z=o(X,4);return I=Z[0],B=Z[1],H=Z[2],K=Z[3],q.call(this,function(){return Y.editor.formatText(I,B,H)},K,I,0)}},{key:"getBounds",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=void 0;typeof I=="number"?D=this.selection.getBounds(I,B):D=this.selection.getBounds(I.index,I.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 I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,D=z(I,B),$=o(D,2);return I=$[0],B=$[1],this.editor.getContents(I,B)}},{key:"getFormat",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof I=="number"?this.editor.getFormat(I,B):this.editor.getFormat(I.index,I.length)}},{key:"getIndex",value:function(I){return I.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(I){return this.scroll.leaf(I)}},{key:"getLine",value:function(I){return this.scroll.line(I)}},{key:"getLines",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof I!="number"?this.scroll.lines(I.index,I.length):this.scroll.lines(I,B)}},{key:"getModule",value:function(I){return this.theme.modules[I]}},{key:"getSelection",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return I&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,D=z(I,B),$=o(D,2);return I=$[0],B=$[1],this.editor.getText(I,B)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(I,B,D){var $=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:G.sources.API;return q.call(this,function(){return $.editor.insertEmbed(I,B,D)},K,I)}},{key:"insertText",value:function(I,B,D,$,K){var Y=this,H=void 0,X=z(I,0,D,$,K),Z=o(X,4);return I=Z[0],H=Z[2],K=Z[3],q.call(this,function(){return Y.editor.insertText(I,B,H)},K,I,B.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(I,B,D){this.clipboard.dangerouslyPasteHTML(I,B,D)}},{key:"removeFormat",value:function(I,B,D){var $=this,K=z(I,B,D),Y=o(K,4);return I=Y[0],B=Y[1],D=Y[3],q.call(this,function(){return $.editor.removeFormat(I,B)},D,I)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(I){var B=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return q.call(this,function(){I=new f.default(I);var $=B.getLength(),K=B.editor.deleteText(0,$),Y=B.editor.applyDelta(I),H=Y.ops[Y.ops.length-1];H!=null&&typeof H.insert=="string"&&H.insert[H.insert.length-1]===`
111
+ `&&(B.editor.deleteText(B.getLength()-1,1),Y.delete(1));var X=K.compose(Y);return X},D)}},{key:"setSelection",value:function(I,B,D){if(I==null)this.selection.setRange(null,B||G.sources.API);else{var $=z(I,B,D),K=o($,4);I=K[0],B=K[1],D=K[3],this.selection.setRange(new h.Range(I,B),D),D!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,D=new f.default().insert(I);return this.setContents(D,B)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,B=this.scroll.update(I);return this.selection.update(I),B}},{key:"updateContents",value:function(I){var B=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return q.call(this,function(){return I=new f.default(I),B.editor.applyDelta(I,D)},D,!0)}}]),G}();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=p.default.events,U.sources=p.default.sources,U.version="1.3.7",U.imports={delta:f.default,parchment:g.default,"core/module":b.default,"core/theme":P.default};function V(G,L){if(L=(0,O.default)(!0,{container:G,modules:{clipboard:!0,keyboard:!0,history:!0}},L),!L.theme||L.theme===U.DEFAULTS.theme)L.theme=P.default;else if(L.theme=U.import("themes/"+L.theme),L.theme==null)throw new Error("Invalid theme "+L.theme+". Did you register it?");var I=(0,O.default)(!0,{},L.theme.DEFAULTS);[I,L].forEach(function($){$.modules=$.modules||{},Object.keys($.modules).forEach(function(K){$.modules[K]===!0&&($.modules[K]={})})});var B=Object.keys(I.modules).concat(Object.keys(L.modules)),D=B.reduce(function($,K){var Y=U.import("modules/"+K);return Y==null?M.error("Cannot load "+K+" module. Are you sure you registered it?"):$[K]=Y.DEFAULTS||{},$},{});return L.modules!=null&&L.modules.toolbar&&L.modules.toolbar.constructor!==Object&&(L.modules.toolbar={container:L.modules.toolbar}),L=(0,O.default)(!0,{},U.DEFAULTS,{modules:D},I,L),["bounds","container","scrollingContainer"].forEach(function($){typeof L[$]=="string"&&(L[$]=document.querySelector(L[$]))}),L.modules=Object.keys(L.modules).reduce(function($,K){return L.modules[K]&&($[K]=L.modules[K]),$},{}),L}function q(G,L,I,B){if(this.options.strict&&!this.isEnabled()&&L===p.default.sources.USER)return new f.default;var D=I==null?null:this.getSelection(),$=this.editor.delta,K=G();if(D!=null&&(I===!0&&(I=D.index),B==null?D=F(D,K,L):B!==0&&(D=F(D,I,B,L)),this.setSelection(D,p.default.sources.SILENT)),K.length()>0){var Y,H=[p.default.events.TEXT_CHANGE,K,$,L];if((Y=this.emitter).emit.apply(Y,[p.default.events.EDITOR_CHANGE].concat(H)),L!==p.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,H)}}return K}function z(G,L,I,B,D){var $={};return typeof G.index=="number"&&typeof G.length=="number"?typeof L!="number"?(D=B,B=I,I=L,L=G.length,G=G.index):(L=G.length,G=G.index):typeof L!="number"&&(D=B,B=I,I=L,L=0),(typeof I>"u"?"undefined":a(I))==="object"?($=I,D=B):typeof I=="string"&&(B!=null?$[I]=B:D=I),D=D||p.default.sources.API,[G,L,$,D]}function F(G,L,I,B){if(G==null)return null;var D=void 0,$=void 0;if(L instanceof f.default){var K=[G.index,G.index+G.length].map(function(Z){return L.transformPosition(Z,B!==p.default.sources.USER)}),Y=o(K,2);D=Y[0],$=Y[1]}else{var H=[G.index,G.index+G.length].map(function(Z){return Z<L||Z===L&&B===p.default.sources.USER?Z:I>=0?Z+I:Math.max(L,Z+I)}),X=o(H,2);D=X[0],$=X[1]}return new h.Range(D,$-D)}n.expandConfig=V,n.overload=z,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(g,h){for(var d=0;d<h.length;d++){var y=h[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,h,d){return h&&m(g.prototype,h),d&&m(g,d),g}}(),o=function m(g,h,d){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,h);if(y===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:m(O,h,d)}else{if("value"in y)return y.value;var k=y.get;return k===void 0?void 0:k.call(d)}},l=i(7),u=S(l),f=i(0),v=S(f);function S(m){return m&&m.__esModule?m:{default:m}}function _(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function p(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function E(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var b=function(m){E(g,m);function g(){return _(this,g),p(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"formatAt",value:function(d,y,O,k){if(g.compare(this.statics.blotName,O)<0&&v.default.query(O,v.default.Scope.BLOT)){var C=this.isolate(d,y);k&&C.wrap(O,k)}else o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"formatAt",this).call(this,d,y,O,k)}},{key:"optimize",value:function(d){if(o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"optimize",this).call(this,d),this.parent instanceof g&&g.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 O=g.order.indexOf(d),k=g.order.indexOf(y);return O>=0||k>=0?O-k:d===y?0:d<y?-1:1}}]),g}(v.default.Inline);b.allowedChildren=[b,v.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(_){return _&&_.__esModule?_:{default:_}}function u(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function f(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function v(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var S=function(_){v(p,_);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default.Text);n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function h(d,y){for(var O=0;O<y.length;O++){var k=y[O];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(d,k.key,k)}}return function(d,y,O){return y&&h(d.prototype,y),O&&h(d,O),d}}(),o=function h(d,y,O){d===null&&(d=Function.prototype);var k=Object.getOwnPropertyDescriptor(d,y);if(k===void 0){var C=Object.getPrototypeOf(d);return C===null?void 0:h(C,y,O)}else{if("value"in k)return k.value;var w=k.get;return w===void 0?void 0:w.call(O)}},l=i(54),u=S(l),f=i(10),v=S(f);function S(h){return h&&h.__esModule?h:{default:h}}function _(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")}function p(h,d){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:h}function E(h,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);h.prototype=Object.create(d&&d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(h,d):h.__proto__=d)}var b=(0,v.default)("quill:events"),m=["selectionchange","mousedown","mouseup","click"];m.forEach(function(h){document.addEventListener(h,function(){for(var d=arguments.length,y=Array(d),O=0;O<d;O++)y[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(k){if(k.__quill&&k.__quill.emitter){var C;(C=k.__quill.emitter).handleDOM.apply(C,y)}})})});var g=function(h){E(d,h);function d(){_(this,d);var y=p(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(O){for(var k=arguments.length,C=Array(k>1?k-1:0),w=1;w<k;w++)C[w-1]=arguments[w];(this.listeners[O.type]||[]).forEach(function(P){var x=P.node,A=P.handler;(O.target===x||x.contains(O.target))&&A.apply(void 0,[O].concat(C))})}},{key:"listenDOM",value:function(O,k,C){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:k,handler:C})}}]),d}(u.default);g.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"},g.sources={API:"api",SILENT:"silent",USER:"user"},n.default=g},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 v,S=arguments.length,_=Array(S>1?S-1:0),p=1;p<S;p++)_[p-1]=arguments[p];(v=console)[f].apply(v,_)}}function u(f){return a.reduce(function(v,S){return v[S]=l.bind(console,S,f),v},{})}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(_,p,E){return E||(E={}),_===p?!0:_ instanceof Date&&p instanceof Date?_.getTime()===p.getTime():!_||!p||typeof _!="object"&&typeof p!="object"?E.strict?_===p:_==p:S(_,p,E)};function f(_){return _==null}function v(_){return!(!_||typeof _!="object"||typeof _.length!="number"||typeof _.copy!="function"||typeof _.slice!="function"||_.length>0&&typeof _[0]!="number")}function S(_,p,E){var b,m;if(f(_)||f(p)||_.prototype!==p.prototype)return!1;if(l(_))return l(p)?(_=a.call(_),p=a.call(p),u(_,p,E)):!1;if(v(_)){if(!v(p)||_.length!==p.length)return!1;for(b=0;b<_.length;b++)if(_[b]!==p[b])return!1;return!0}try{var g=o(_),h=o(p)}catch{return!1}if(g.length!=h.length)return!1;for(g.sort(),h.sort(),b=g.length-1;b>=0;b--)if(g[b]!=h[b])return!1;for(b=g.length-1;b>=0;b--)if(m=g[b],!u(_[m],p[m],E))return!1;return typeof _==typeof p}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,v){v===void 0&&(v={}),this.attrName=u,this.keyName=f;var S=a.Scope.TYPE&a.Scope.ATTRIBUTE;v.scope!=null?this.scope=v.scope&a.Scope.LEVEL|S:this.scope=a.Scope.ATTRIBUTE,v.whitelist!=null&&(this.whitelist=v.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 v=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return v==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 w(P,x){var A=[],R=!0,M=!1,U=void 0;try{for(var V=P[Symbol.iterator](),q;!(R=(q=V.next()).done)&&(A.push(q.value),!(x&&A.length===x));R=!0);}catch(z){M=!0,U=z}finally{try{!R&&V.return&&V.return()}finally{if(M)throw U}}return A}return function(P,x){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return w(P,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function w(P,x){for(var A=0;A<x.length;A++){var R=x[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(P,R.key,R)}}return function(P,x,A){return x&&w(P.prototype,x),A&&w(P,A),P}}(),l=function w(P,x,A){P===null&&(P=Function.prototype);var R=Object.getOwnPropertyDescriptor(P,x);if(R===void 0){var M=Object.getPrototypeOf(P);return M===null?void 0:w(M,x,A)}else{if("value"in R)return R.value;var U=R.get;return U===void 0?void 0:U.call(A)}},u=i(2),f=h(u),v=i(0),S=h(v),_=i(4),p=h(_),E=i(6),b=h(E),m=i(7),g=h(m);function h(w){return w&&w.__esModule?w:{default:w}}function d(w,P){if(!(w instanceof P))throw new TypeError("Cannot call a class as a function")}function y(w,P){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:w}function O(w,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);w.prototype=Object.create(P&&P.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(w,P):w.__proto__=P)}var k=function(w){O(P,w);function P(){return d(this,P),y(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return P}(b.default);k.blotName="code",k.tagName="CODE";var C=function(w){O(P,w);function P(){return d(this,P),y(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return o(P,[{key:"delta",value:function(){var A=this,R=this.domNode.textContent;return R.endsWith(`
112
+ `)&&(R=R.slice(0,-1)),R.split(`
113
+ `).reduce(function(M,U){return M.insert(U).insert(`
114
+ `,A.formats())},new f.default)}},{key:"format",value:function(A,R){if(!(A===this.statics.blotName&&R)){var M=this.descendant(g.default,this.length()-1),U=a(M,1),V=U[0];V!=null&&V.deleteAt(V.length()-1,1),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,A,R)}}},{key:"formatAt",value:function(A,R,M,U){if(R!==0&&!(S.default.query(M,S.default.Scope.BLOCK)==null||M===this.statics.blotName&&U===this.statics.formats(this.domNode))){var V=this.newlineIndex(A);if(!(V<0||V>=A+R)){var q=this.newlineIndex(A,!0)+1,z=V-q+1,F=this.isolate(q,z),G=F.next;F.format(M,U),G instanceof P&&G.formatAt(0,A-q+R-z,M,U)}}}},{key:"insertAt",value:function(A,R,M){if(M==null){var U=this.descendant(g.default,A),V=a(U,2),q=V[0],z=V[1];q.insertAt(z,R)}}},{key:"length",value:function(){var A=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
115
+ `)?A:A+1}},{key:"newlineIndex",value:function(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R)return this.domNode.textContent.slice(0,A).lastIndexOf(`
116
+ `);var M=this.domNode.textContent.slice(A).indexOf(`
117
+ `);return M>-1?A+M:-1}},{key:"optimize",value:function(A){this.domNode.textContent.endsWith(`
118
+ `)||this.appendChild(S.default.create("text",`
119
+ `)),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,A);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===R.statics.formats(R.domNode)&&(R.optimize(A),R.moveChildren(this),R.remove())}},{key:"replace",value:function(A){l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,A),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(R){var M=S.default.find(R);M==null?R.parentNode.removeChild(R):M instanceof S.default.Embed?M.remove():M.unwrap()})}}],[{key:"create",value:function(A){var R=l(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,A);return R.setAttribute("spellcheck",!1),R}},{key:"formats",value:function(){return!0}}]),P}(p.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",n.Code=k,n.default=C},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(L,I){var B=[],D=!0,$=!1,K=void 0;try{for(var Y=L[Symbol.iterator](),H;!(D=(H=Y.next()).done)&&(B.push(H.value),!(I&&B.length===I));D=!0);}catch(X){$=!0,K=X}finally{try{!D&&Y.return&&Y.return()}finally{if($)throw K}}return B}return function(L,I){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return G(L,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function G(L,I){for(var B=0;B<I.length;B++){var D=I[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(L,D.key,D)}}return function(L,I,B){return I&&G(L.prototype,I),B&&G(L,B),L}}(),u=i(2),f=R(u),v=i(20),S=R(v),_=i(0),p=R(_),E=i(13),b=R(E),m=i(24),g=R(m),h=i(4),d=R(h),y=i(16),O=R(y),k=i(21),C=R(k),w=i(11),P=R(w),x=i(3),A=R(x);function R(G){return G&&G.__esModule?G:{default:G}}function M(G,L,I){return L in G?Object.defineProperty(G,L,{value:I,enumerable:!0,configurable:!0,writable:!0}):G[L]=I,G}function U(G,L){if(!(G instanceof L))throw new TypeError("Cannot call a class as a function")}var V=/^[ -~]*$/,q=function(){function G(L){U(this,G),this.scroll=L,this.delta=this.getDelta()}return l(G,[{key:"applyDelta",value:function(I){var B=this,D=!1;this.scroll.update();var $=this.scroll.length();return this.scroll.batchStart(),I=F(I),I.reduce(function(K,Y){var H=Y.retain||Y.delete||Y.insert.length||1,X=Y.attributes||{};if(Y.insert!=null){if(typeof Y.insert=="string"){var Z=Y.insert;Z.endsWith(`
120
+ `)&&D&&(D=!1,Z=Z.slice(0,-1)),K>=$&&!Z.endsWith(`
121
+ `)&&(D=!0),B.scroll.insertAt(K,Z);var J=B.scroll.line(K),ee=o(J,2),re=ee[0],ae=ee[1],le=(0,A.default)({},(0,h.bubbleFormats)(re));if(re instanceof d.default){var ue=re.descendant(p.default.Leaf,ae),Ae=o(ue,1),ze=Ae[0];le=(0,A.default)(le,(0,h.bubbleFormats)(ze))}X=S.default.attributes.diff(le,X)||{}}else if(a(Y.insert)==="object"){var oe=Object.keys(Y.insert)[0];if(oe==null)return K;B.scroll.insertAt(K,oe,Y.insert[oe])}$+=H}return Object.keys(X).forEach(function(ie){B.scroll.formatAt(K,H,ie,X[ie])}),K+H},0),I.reduce(function(K,Y){return typeof Y.delete=="number"?(B.scroll.deleteAt(K,Y.delete),K):K+(Y.retain||Y.insert.length||1)},0),this.scroll.batchEnd(),this.update(I)}},{key:"deleteText",value:function(I,B){return this.scroll.deleteAt(I,B),this.update(new f.default().retain(I).delete(B))}},{key:"formatLine",value:function(I,B){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 Y=D.scroll.lines(I,Math.max(B,1)),H=B;Y.forEach(function(X){var Z=X.length();if(!(X instanceof b.default))X.format(K,$[K]);else{var J=I-X.offset(D.scroll),ee=X.newlineIndex(J+H)-J+1;X.formatAt(J,ee,K,$[K])}H-=Z})}}),this.scroll.optimize(),this.update(new f.default().retain(I).retain(B,(0,C.default)($)))}},{key:"formatText",value:function(I,B){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys($).forEach(function(K){D.scroll.formatAt(I,B,K,$[K])}),this.update(new f.default().retain(I).retain(B,(0,C.default)($)))}},{key:"getContents",value:function(I,B){return this.delta.slice(I,I+B)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(I,B){return I.concat(B.delta())},new f.default)}},{key:"getFormat",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=[],$=[];B===0?this.scroll.path(I).forEach(function(Y){var H=o(Y,1),X=H[0];X instanceof d.default?D.push(X):X instanceof p.default.Leaf&&$.push(X)}):(D=this.scroll.lines(I,B),$=this.scroll.descendants(p.default.Leaf,I,B));var K=[D,$].map(function(Y){if(Y.length===0)return{};for(var H=(0,h.bubbleFormats)(Y.shift());Object.keys(H).length>0;){var X=Y.shift();if(X==null)return H;H=z((0,h.bubbleFormats)(X),H)}return H});return A.default.apply(A.default,K)}},{key:"getText",value:function(I,B){return this.getContents(I,B).filter(function(D){return typeof D.insert=="string"}).map(function(D){return D.insert}).join("")}},{key:"insertEmbed",value:function(I,B,D){return this.scroll.insertAt(I,B,D),this.update(new f.default().retain(I).insert(M({},B,D)))}},{key:"insertText",value:function(I,B){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B=B.replace(/\r\n/g,`
122
+ `).replace(/\r/g,`
123
+ `),this.scroll.insertAt(I,B),Object.keys($).forEach(function(K){D.scroll.formatAt(I,B.length,K,$[K])}),this.update(new f.default().retain(I).insert(B,(0,C.default)($)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var I=this.scroll.children.head;return I.statics.blotName!==d.default.blotName||I.children.length>1?!1:I.children.head instanceof O.default}},{key:"removeFormat",value:function(I,B){var D=this.getText(I,B),$=this.scroll.line(I+B),K=o($,2),Y=K[0],H=K[1],X=0,Z=new f.default;Y!=null&&(Y instanceof b.default?X=Y.newlineIndex(H)-H+1:X=Y.length()-H,Z=Y.delta().slice(H,H+X-1).insert(`
124
+ `));var J=this.getContents(I,B+X),ee=J.diff(new f.default().insert(D).concat(Z)),re=new f.default().retain(I).concat(ee);return this.applyDelta(re)}},{key:"update",value:function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,$=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match(V)&&p.default.find(B[0].target)){var K=p.default.find(B[0].target),Y=(0,h.bubbleFormats)(K),H=K.offset(this.scroll),X=B[0].oldValue.replace(g.default.CONTENTS,""),Z=new f.default().insert(X),J=new f.default().insert(K.value()),ee=new f.default().retain(H).concat(Z.diff(J,D));I=ee.reduce(function(re,ae){return ae.insert?re.insert(ae.insert,Y):re.push(ae)},new f.default),this.delta=$.compose(I)}else this.delta=this.getDelta(),(!I||!(0,P.default)($.compose(I),this.delta))&&(I=$.diff(this.delta,D));return I}}]),G}();function z(G,L){return Object.keys(L).reduce(function(I,B){return G[B]==null||(L[B]===G[B]?I[B]=L[B]:Array.isArray(L[B])?L[B].indexOf(G[B])<0&&(I[B]=L[B].concat([G[B]])):I[B]=[L[B],G[B]]),I},{})}function F(G){return G.reduce(function(L,I){if(I.insert===1){var B=(0,C.default)(I.attributes);return delete B.image,L.insert({image:I.attributes.image},B)}if(I.attributes!=null&&(I.attributes.list===!0||I.attributes.bullet===!0)&&(I=(0,C.default)(I),I.attributes.list?I.attributes.list="ordered":(I.attributes.list="bullet",delete I.attributes.bullet)),typeof I.insert=="string"){var D=I.insert.replace(/\r\n/g,`
125
+ `).replace(/\r/g,`
126
+ `);return L.insert(D,I.attributes)}return L.push(I)},new f.default)}n.default=q},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function w(P,x){var A=[],R=!0,M=!1,U=void 0;try{for(var V=P[Symbol.iterator](),q;!(R=(q=V.next()).done)&&(A.push(q.value),!(x&&A.length===x));R=!0);}catch(z){M=!0,U=z}finally{try{!R&&V.return&&V.return()}finally{if(M)throw U}}return A}return function(P,x){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return w(P,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function w(P,x){for(var A=0;A<x.length;A++){var R=x[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(P,R.key,R)}}return function(P,x,A){return x&&w(P.prototype,x),A&&w(P,A),P}}(),l=i(0),u=g(l),f=i(21),v=g(f),S=i(11),_=g(S),p=i(8),E=g(p),b=i(10),m=g(b);function g(w){return w&&w.__esModule?w:{default:w}}function h(w){if(Array.isArray(w)){for(var P=0,x=Array(w.length);P<w.length;P++)x[P]=w[P];return x}else return Array.from(w)}function d(w,P){if(!(w instanceof P))throw new TypeError("Cannot call a class as a function")}var y=(0,m.default)("quill:selection"),O=function w(P){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,w),this.index=P,this.length=x},k=function(){function w(P,x){var A=this;d(this,w),this.emitter=x,this.scroll=P,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new O(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){A.mouseDown||setTimeout(A.update.bind(A,E.default.sources.USER),1)}),this.emitter.on(E.default.events.EDITOR_CHANGE,function(R,M){R===E.default.events.TEXT_CHANGE&&M.length()>0&&A.update(E.default.sources.SILENT)}),this.emitter.on(E.default.events.SCROLL_BEFORE_UPDATE,function(){if(A.hasFocus()){var R=A.getNativeRange();R!=null&&R.start.node!==A.cursor.textNode&&A.emitter.once(E.default.events.SCROLL_UPDATE,function(){try{A.setNativeRange(R.start.node,R.start.offset,R.end.node,R.end.offset)}catch{}})}}),this.emitter.on(E.default.events.SCROLL_OPTIMIZE,function(R,M){if(M.range){var U=M.range,V=U.startNode,q=U.startOffset,z=U.endNode,F=U.endOffset;A.setNativeRange(V,q,z,F)}}),this.update(E.default.sources.SILENT)}return o(w,[{key:"handleComposition",value:function(){var x=this;this.root.addEventListener("compositionstart",function(){x.composing=!0}),this.root.addEventListener("compositionend",function(){if(x.composing=!1,x.cursor.parent){var A=x.cursor.restore();if(!A)return;setTimeout(function(){x.setNativeRange(A.startNode,A.startOffset,A.endNode,A.endOffset)},1)}})}},{key:"handleDragging",value:function(){var x=this;this.emitter.listenDOM("mousedown",document.body,function(){x.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){x.mouseDown=!1,x.update(E.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(x,A){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[x])){this.scroll.update();var R=this.getNativeRange();if(!(R==null||!R.native.collapsed||u.default.query(x,u.default.Scope.BLOCK))){if(R.start.node!==this.cursor.textNode){var M=u.default.find(R.start.node,!1);if(M==null)return;if(M instanceof u.default.Leaf){var U=M.split(R.start.offset);M.parent.insertBefore(this.cursor,U)}else M.insertBefore(this.cursor,R.start.node);this.cursor.attach()}this.cursor.format(x,A),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=this.scroll.length();x=Math.min(x,R-1),A=Math.min(x+A,R-1)-x;var M=void 0,U=this.scroll.leaf(x),V=a(U,2),q=V[0],z=V[1];if(q==null)return null;var F=q.position(z,!0),G=a(F,2);M=G[0],z=G[1];var L=document.createRange();if(A>0){L.setStart(M,z);var I=this.scroll.leaf(x+A),B=a(I,2);if(q=B[0],z=B[1],q==null)return null;var D=q.position(z,!0),$=a(D,2);return M=$[0],z=$[1],L.setEnd(M,z),L.getBoundingClientRect()}else{var K="left",Y=void 0;return M instanceof Text?(z<M.data.length?(L.setStart(M,z),L.setEnd(M,z+1)):(L.setStart(M,z-1),L.setEnd(M,z),K="right"),Y=L.getBoundingClientRect()):(Y=q.domNode.getBoundingClientRect(),z>0&&(K="right")),{bottom:Y.top+Y.height,height:Y.height,left:Y[K],right:Y[K],top:Y.top,width:0}}}},{key:"getNativeRange",value:function(){var x=document.getSelection();if(x==null||x.rangeCount<=0)return null;var A=x.getRangeAt(0);if(A==null)return null;var R=this.normalizeNative(A);return y.info("getNativeRange",R),R}},{key:"getRange",value:function(){var x=this.getNativeRange();if(x==null)return[null,null];var A=this.normalizedToRange(x);return[A,x]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(x){var A=this,R=[[x.start.node,x.start.offset]];x.native.collapsed||R.push([x.end.node,x.end.offset]);var M=R.map(function(q){var z=a(q,2),F=z[0],G=z[1],L=u.default.find(F,!0),I=L.offset(A.scroll);return G===0?I:L instanceof u.default.Container?I+L.length():I+L.index(F,G)}),U=Math.min(Math.max.apply(Math,h(M)),this.scroll.length()-1),V=Math.min.apply(Math,[U].concat(h(M)));return new O(V,U-V)}},{key:"normalizeNative",value:function(x){if(!C(this.root,x.startContainer)||!x.collapsed&&!C(this.root,x.endContainer))return null;var A={start:{node:x.startContainer,offset:x.startOffset},end:{node:x.endContainer,offset:x.endOffset},native:x};return[A.start,A.end].forEach(function(R){for(var M=R.node,U=R.offset;!(M instanceof Text)&&M.childNodes.length>0;)if(M.childNodes.length>U)M=M.childNodes[U],U=0;else if(M.childNodes.length===U)M=M.lastChild,U=M instanceof Text?M.data.length:M.childNodes.length+1;else break;R.node=M,R.offset=U}),A}},{key:"rangeToNative",value:function(x){var A=this,R=x.collapsed?[x.index]:[x.index,x.index+x.length],M=[],U=this.scroll.length();return R.forEach(function(V,q){V=Math.min(U-1,V);var z=void 0,F=A.scroll.leaf(V),G=a(F,2),L=G[0],I=G[1],B=L.position(I,q!==0),D=a(B,2);z=D[0],I=D[1],M.push(z,I)}),M.length<2&&(M=M.concat(M)),M}},{key:"scrollIntoView",value:function(x){var A=this.lastRange;if(A!=null){var R=this.getBounds(A.index,A.length);if(R!=null){var M=this.scroll.length()-1,U=this.scroll.line(Math.min(A.index,M)),V=a(U,1),q=V[0],z=q;if(A.length>0){var F=this.scroll.line(Math.min(A.index+A.length,M)),G=a(F,1);z=G[0]}if(!(q==null||z==null)){var L=x.getBoundingClientRect();R.top<L.top?x.scrollTop-=L.top-R.top:R.bottom>L.bottom&&(x.scrollTop+=R.bottom-L.bottom)}}}}},{key:"setNativeRange",value:function(x,A){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(y.info("setNativeRange",x,A,R,M),!(x!=null&&(this.root.parentNode==null||x.parentNode==null||R.parentNode==null))){var V=document.getSelection();if(V!=null)if(x!=null){this.hasFocus()||this.root.focus();var q=(this.getNativeRange()||{}).native;if(q==null||U||x!==q.startContainer||A!==q.startOffset||R!==q.endContainer||M!==q.endOffset){x.tagName=="BR"&&(A=[].indexOf.call(x.parentNode.childNodes,x),x=x.parentNode),R.tagName=="BR"&&(M=[].indexOf.call(R.parentNode.childNodes,R),R=R.parentNode);var z=document.createRange();z.setStart(x,A),z.setEnd(R,M),V.removeAllRanges(),V.addRange(z)}}else V.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof A=="string"&&(R=A,A=!1),y.info("setRange",x),x!=null){var M=this.rangeToNative(x);this.setNativeRange.apply(this,h(M).concat([A]))}else this.setNativeRange(null);this.update(R)}},{key:"update",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E.default.sources.USER,A=this.lastRange,R=this.getRange(),M=a(R,2),U=M[0],V=M[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,_.default)(A,this.lastRange)){var q;!this.composing&&V!=null&&V.native.collapsed&&V.start.node!==this.cursor.textNode&&this.cursor.restore();var z=[E.default.events.SELECTION_CHANGE,(0,v.default)(this.lastRange),(0,v.default)(A),x];if((q=this.emitter).emit.apply(q,[E.default.events.EDITOR_CHANGE].concat(z)),x!==E.default.sources.SILENT){var F;(F=this.emitter).emit.apply(F,z)}}}}]),w}();function C(w,P){try{P.parentNode}catch{return!1}return P instanceof Text&&(P=P.parentNode),w.contains(P)}n.Range=O,n.default=k},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(b,m){for(var g=0;g<m.length;g++){var h=m[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(b,h.key,h)}}return function(b,m,g){return m&&E(b.prototype,m),g&&E(b,g),b}}(),o=function E(b,m,g){b===null&&(b=Function.prototype);var h=Object.getOwnPropertyDescriptor(b,m);if(h===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:E(d,m,g)}else{if("value"in h)return h.value;var y=h.get;return y===void 0?void 0:y.call(g)}},l=i(0),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function S(E,b){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:E}function _(E,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);E.prototype=Object.create(b&&b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(E,b):E.__proto__=b)}var p=function(E){_(b,E);function b(){return v(this,b),S(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"insertInto",value:function(g,h){g.children.length===0?o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"insertInto",this).call(this,g,h):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),b}(u.default.Embed);p.blotName="break",p.tagName="BR",n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,p){_.__proto__=p}||function(_,p){for(var E in p)p.hasOwnProperty(E)&&(_[E]=p[E])};return function(_,p){S(_,p);function E(){this.constructor=_}_.prototype=p===null?Object.create(p):(E.prototype=p.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(S){a(_,S);function _(p){var E=S.call(this,p)||this;return E.build(),E}return _.prototype.appendChild=function(p){this.insertBefore(p)},_.prototype.attach=function(){S.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},_.prototype.build=function(){var p=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(E){try{var b=v(E);p.insertBefore(b,p.children.head||void 0)}catch(m){if(m instanceof u.ParchmentError)return;throw m}})},_.prototype.deleteAt=function(p,E){if(p===0&&E===this.length())return this.remove();this.children.forEachAt(p,E,function(b,m,g){b.deleteAt(m,g)})},_.prototype.descendant=function(p,E){var b=this.children.find(E),m=b[0],g=b[1];return p.blotName==null&&p(m)||p.blotName!=null&&m instanceof p?[m,g]:m instanceof _?m.descendant(p,g):[null,-1]},_.prototype.descendants=function(p,E,b){E===void 0&&(E=0),b===void 0&&(b=Number.MAX_VALUE);var m=[],g=b;return this.children.forEachAt(E,b,function(h,d,y){(p.blotName==null&&p(h)||p.blotName!=null&&h instanceof p)&&m.push(h),h instanceof _&&(m=m.concat(h.descendants(p,d,g))),g-=y}),m},_.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),S.prototype.detach.call(this)},_.prototype.formatAt=function(p,E,b,m){this.children.forEachAt(p,E,function(g,h,d){g.formatAt(h,d,b,m)})},_.prototype.insertAt=function(p,E,b){var m=this.children.find(p),g=m[0],h=m[1];if(g)g.insertAt(h,E,b);else{var d=b==null?u.create("text",E):u.create(E,b);this.appendChild(d)}},_.prototype.insertBefore=function(p,E){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(b){return p instanceof b}))throw new u.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,E)},_.prototype.length=function(){return this.children.reduce(function(p,E){return p+E.length()},0)},_.prototype.moveChildren=function(p,E){this.children.forEach(function(b){p.insertBefore(b,E)})},_.prototype.optimize=function(p){if(S.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var E=u.create(this.statics.defaultChild);this.appendChild(E),E.optimize(p)}else this.remove()},_.prototype.path=function(p,E){E===void 0&&(E=!1);var b=this.children.find(p,E),m=b[0],g=b[1],h=[[this,p]];return m instanceof _?h.concat(m.path(g,E)):(m!=null&&h.push([m,g]),h)},_.prototype.removeChild=function(p){this.children.remove(p)},_.prototype.replace=function(p){p instanceof _&&p.moveChildren(this),S.prototype.replace.call(this,p)},_.prototype.split=function(p,E){if(E===void 0&&(E=!1),!E){if(p===0)return this;if(p===this.length())return this.next}var b=this.clone();return this.parent.insertBefore(b,this.next),this.children.forEachAt(p,this.length(),function(m,g,h){m=m.split(g,E),b.appendChild(m)}),b},_.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},_.prototype.update=function(p,E){var b=this,m=[],g=[];p.forEach(function(h){h.target===b.domNode&&h.type==="childList"&&(m.push.apply(m,h.addedNodes),g.push.apply(g,h.removedNodes))}),g.forEach(function(h){if(!(h.parentNode!=null&&h.tagName!=="IFRAME"&&document.body.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(h);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===b.domNode)&&d.detach()}}),m.filter(function(h){return h.parentNode==b.domNode}).sort(function(h,d){return h===d?0:h.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(h){var d=null;h.nextSibling!=null&&(d=u.find(h.nextSibling));var y=v(h);(y.next!=d||y.next==null)&&(y.parent!=null&&y.parent.removeChild(b),b.insertBefore(y,d||void 0))})},_}(l.default);function v(S){var _=u.find(S);if(_==null)try{_=u.create(S)}catch{_=u.create(u.Scope.INLINE),[].slice.call(S.childNodes).forEach(function(E){_.domNode.appendChild(E)}),S.parentNode&&S.parentNode.replaceChild(_.domNode,S),_.attach()}return _}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,p){_.__proto__=p}||function(_,p){for(var E in p)p.hasOwnProperty(E)&&(_[E]=p[E])};return function(_,p){S(_,p);function E(){this.constructor=_}_.prototype=p===null?Object.create(p):(E.prototype=p.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),v=function(S){a(_,S);function _(p){var E=S.call(this,p)||this;return E.attributes=new l.default(E.domNode),E}return _.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},_.prototype.format=function(p,E){var b=f.query(p);b instanceof o.default?this.attributes.attribute(b,E):E&&b!=null&&(p!==this.statics.blotName||this.formats()[p]!==E)&&this.replaceWith(p,E)},_.prototype.formats=function(){var p=this.attributes.values(),E=this.statics.formats(this.domNode);return E!=null&&(p[this.statics.blotName]=E),p},_.prototype.replaceWith=function(p,E){var b=S.prototype.replaceWith.call(this,p,E);return this.attributes.copy(b),b},_.prototype.update=function(p,E){var b=this;S.prototype.update.call(this,p,E),p.some(function(m){return m.target===b.domNode&&m.type==="attributes"})&&this.attributes.build()},_.prototype.wrap=function(p,E){var b=S.prototype.wrap.call(this,p,E);return b instanceof _&&b.statics.scope===this.statics.scope&&this.attributes.move(b),b},_}(u.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.value=function(S){return!0},v.prototype.index=function(S,_){return this.domNode===S||this.domNode.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(_,1):-1},v.prototype.position=function(S,_){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return S>0&&(p+=1),[this.parent.domNode,p]},v.prototype.value=function(){var S;return S={},S[this.statics.blotName]=this.statics.value(this.domNode)||!0,S},v.scope=l.Scope.INLINE_BLOT,v}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,v,S){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var _=o(!0,{},v);S||(_=Object.keys(_).reduce(function(E,b){return _[b]!=null&&(E[b]=_[b]),E},{}));for(var p in f)f[p]!==void 0&&v[p]===void 0&&(_[p]=f[p]);return Object.keys(_).length>0?_:void 0},diff:function(f,v){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var S=Object.keys(f).concat(Object.keys(v)).reduce(function(_,p){return a(f[p],v[p])||(_[p]=v[p]===void 0?null:v[p]),_},{});return Object.keys(S).length>0?S:void 0},transform:function(f,v,S){if(typeof f!="object")return v;if(typeof v=="object"){if(!S)return v;var _=Object.keys(v).reduce(function(p,E){return f[E]===void 0&&(p[E]=v[E]),p},{});return Object.keys(_).length>0?_: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 v=this.ops[this.index];if(v){var S=this.offset,_=l.length(v);if(f>=_-S?(f=_-S,this.index+=1,this.offset=0):this.offset+=f,typeof v.delete=="number")return{delete:f};var p={};return v.attributes&&(p.attributes=v.attributes),typeof v.retain=="number"?p.retain=f:typeof v.insert=="string"?p.insert=v.insert.substr(S,f):p.insert=v.insert,p}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,v=this.index,S=this.next(),_=this.ops.slice(this.index);return this.offset=f,this.index=v,[S].concat(_)}else return[]},r.exports=l},function(r,n){var i=function(){function a(b,m){return m!=null&&b instanceof m}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function f(b,m,g,h,d){typeof m=="object"&&(g=m.depth,h=m.prototype,d=m.includeNonEnumerable,m=m.circular);var y=[],O=[],k=typeof Buffer<"u";typeof m>"u"&&(m=!0),typeof g>"u"&&(g=1/0);function C(w,P){if(w===null)return null;if(P===0)return w;var x,A;if(typeof w!="object")return w;if(a(w,o))x=new o;else if(a(w,l))x=new l;else if(a(w,u))x=new u(function(L,I){w.then(function(B){L(C(B,P-1))},function(B){I(C(B,P-1))})});else if(f.__isArray(w))x=[];else if(f.__isRegExp(w))x=new RegExp(w.source,E(w)),w.lastIndex&&(x.lastIndex=w.lastIndex);else if(f.__isDate(w))x=new Date(w.getTime());else{if(k&&Buffer.isBuffer(w))return Buffer.allocUnsafe?x=Buffer.allocUnsafe(w.length):x=new Buffer(w.length),w.copy(x),x;a(w,Error)?x=Object.create(w):typeof h>"u"?(A=Object.getPrototypeOf(w),x=Object.create(A)):(x=Object.create(h),A=h)}if(m){var R=y.indexOf(w);if(R!=-1)return O[R];y.push(w),O.push(x)}a(w,o)&&w.forEach(function(L,I){var B=C(I,P-1),D=C(L,P-1);x.set(B,D)}),a(w,l)&&w.forEach(function(L){var I=C(L,P-1);x.add(I)});for(var M in w){var U;A&&(U=Object.getOwnPropertyDescriptor(A,M)),!(U&&U.set==null)&&(x[M]=C(w[M],P-1))}if(Object.getOwnPropertySymbols)for(var V=Object.getOwnPropertySymbols(w),M=0;M<V.length;M++){var q=V[M],z=Object.getOwnPropertyDescriptor(w,q);z&&!z.enumerable&&!d||(x[q]=C(w[q],P-1),z.enumerable||Object.defineProperty(x,q,{enumerable:!1}))}if(d)for(var F=Object.getOwnPropertyNames(w),M=0;M<F.length;M++){var G=F[M],z=Object.getOwnPropertyDescriptor(w,G);z&&z.enumerable||(x[G]=C(w[G],P-1),Object.defineProperty(x,G,{enumerable:!1}))}return x}return C(b,g)}f.clonePrototype=function(m){if(m===null)return null;var g=function(){};return g.prototype=m,new g};function v(b){return Object.prototype.toString.call(b)}f.__objToStr=v;function S(b){return typeof b=="object"&&v(b)==="[object Date]"}f.__isDate=S;function _(b){return typeof b=="object"&&v(b)==="[object Array]"}f.__isArray=_;function p(b){return typeof b=="object"&&v(b)==="[object RegExp]"}f.__isRegExp=p;function E(b){var m="";return b.global&&(m+="g"),b.ignoreCase&&(m+="i"),b.multiline&&(m+="m"),m}return f.__getRegExpFlags=E,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(A,R){var M=[],U=!0,V=!1,q=void 0;try{for(var z=A[Symbol.iterator](),F;!(U=(F=z.next()).done)&&(M.push(F.value),!(R&&M.length===R));U=!0);}catch(G){V=!0,q=G}finally{try{!U&&z.return&&z.return()}finally{if(V)throw q}}return M}return function(A,R){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return x(A,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(A,R){for(var M=0;M<R.length;M++){var U=R[M];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(A,U.key,U)}}return function(A,R,M){return R&&x(A.prototype,R),M&&x(A,M),A}}(),l=function x(A,R,M){A===null&&(A=Function.prototype);var U=Object.getOwnPropertyDescriptor(A,R);if(U===void 0){var V=Object.getPrototypeOf(A);return V===null?void 0:x(V,R,M)}else{if("value"in U)return U.value;var q=U.get;return q===void 0?void 0:q.call(M)}},u=i(0),f=y(u),v=i(8),S=y(v),_=i(4),p=y(_),E=i(16),b=y(E),m=i(13),g=y(m),h=i(25),d=y(h);function y(x){return x&&x.__esModule?x:{default:x}}function O(x,A){if(!(x instanceof A))throw new TypeError("Cannot call a class as a function")}function k(x,A){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:x}function C(x,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);x.prototype=Object.create(A&&A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(x,A):x.__proto__=A)}function w(x){return x instanceof p.default||x instanceof _.BlockEmbed}var P=function(x){C(A,x);function A(R,M){O(this,A);var U=k(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R));return U.emitter=M.emitter,Array.isArray(M.whitelist)&&(U.whitelist=M.whitelist.reduce(function(V,q){return V[q]=!0,V},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return o(A,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(M,U){var V=this.line(M),q=a(V,2),z=q[0],F=q[1],G=this.line(M+U),L=a(G,1),I=L[0];if(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,M,U),I!=null&&z!==I&&F>0){if(z instanceof _.BlockEmbed||I instanceof _.BlockEmbed){this.optimize();return}if(z instanceof g.default){var B=z.newlineIndex(z.length(),!0);if(B>-1&&(z=z.split(B+1),z===I)){this.optimize();return}}else if(I instanceof g.default){var D=I.newlineIndex(0);D>-1&&I.split(D+1)}var $=I.children.head instanceof b.default?null:I.children.head;z.moveChildren(I,$),z.remove()}this.optimize()}},{key:"enable",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",M)}},{key:"formatAt",value:function(M,U,V,q){this.whitelist!=null&&!this.whitelist[V]||(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,M,U,V,q),this.optimize())}},{key:"insertAt",value:function(M,U,V){if(!(V!=null&&this.whitelist!=null&&!this.whitelist[U])){if(M>=this.length())if(V==null||f.default.query(U,f.default.Scope.BLOCK)==null){var q=f.default.create(this.statics.defaultChild);this.appendChild(q),V==null&&U.endsWith(`
127
+ `)&&(U=U.slice(0,-1)),q.insertAt(0,U,V)}else{var z=f.default.create(U,V);this.appendChild(z)}else l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,M,U,V);this.optimize()}}},{key:"insertBefore",value:function(M,U){if(M.statics.scope===f.default.Scope.INLINE_BLOT){var V=f.default.create(this.statics.defaultChild);V.appendChild(M),M=V}l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,M,U)}},{key:"leaf",value:function(M){return this.path(M).pop()||[null,-1]}},{key:"line",value:function(M){return M===this.length()?this.line(M-1):this.descendant(w,M)}},{key:"lines",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,V=function q(z,F,G){var L=[],I=G;return z.children.forEachAt(F,G,function(B,D,$){w(B)?L.push(B):B instanceof f.default.Container&&(L=L.concat(q(B,D,I))),I-=$}),L};return V(this,M,U)}},{key:"optimize",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,M,U),M.length>0&&this.emitter.emit(S.default.events.SCROLL_OPTIMIZE,M,U))}},{key:"path",value:function(M){return l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,M).slice(1)}},{key:"update",value:function(M){if(this.batch!==!0){var U=S.default.sources.USER;typeof M=="string"&&(U=M),Array.isArray(M)||(M=this.observer.takeRecords()),M.length>0&&this.emitter.emit(S.default.events.SCROLL_BEFORE_UPDATE,U,M),l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"update",this).call(this,M.concat([])),M.length>0&&this.emitter.emit(S.default.events.SCROLL_UPDATE,U,M)}}}]),A}(f.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[p.default,_.BlockEmbed,d.default],n.default=P},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(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},o=function(){function Y(H,X){var Z=[],J=!0,ee=!1,re=void 0;try{for(var ae=H[Symbol.iterator](),le;!(J=(le=ae.next()).done)&&(Z.push(le.value),!(X&&Z.length===X));J=!0);}catch(ue){ee=!0,re=ue}finally{try{!J&&ae.return&&ae.return()}finally{if(ee)throw re}}return Z}return function(H,X){if(Array.isArray(H))return H;if(Symbol.iterator in Object(H))return Y(H,X);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function Y(H,X){for(var Z=0;Z<X.length;Z++){var J=X[Z];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(H,J.key,J)}}return function(H,X,Z){return X&&Y(H.prototype,X),Z&&Y(H,Z),H}}(),u=i(21),f=x(u),v=i(11),S=x(v),_=i(3),p=x(_),E=i(2),b=x(E),m=i(20),g=x(m),h=i(0),d=x(h),y=i(5),O=x(y),k=i(10),C=x(k),w=i(9),P=x(w);function x(Y){return Y&&Y.__esModule?Y:{default:Y}}function A(Y,H,X){return H in Y?Object.defineProperty(Y,H,{value:X,enumerable:!0,configurable:!0,writable:!0}):Y[H]=X,Y}function R(Y,H){if(!(Y instanceof H))throw new TypeError("Cannot call a class as a function")}function M(Y,H){if(!Y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return H&&(typeof H=="object"||typeof H=="function")?H:Y}function U(Y,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof H);Y.prototype=Object.create(H&&H.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}),H&&(Object.setPrototypeOf?Object.setPrototypeOf(Y,H):Y.__proto__=H)}var V=(0,C.default)("quill:keyboard"),q=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",z=function(Y){U(H,Y),l(H,null,[{key:"match",value:function(Z,J){return J=K(J),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ee){return!!J[ee]!==Z[ee]&&J[ee]!==null})?!1:J.key===(Z.which||Z.keyCode)}}]);function H(X,Z){R(this,H);var J=M(this,(H.__proto__||Object.getPrototypeOf(H)).call(this,X,Z));return J.bindings={},Object.keys(J.options.bindings).forEach(function(ee){ee==="list autofill"&&X.scroll.whitelist!=null&&!X.scroll.whitelist.list||J.options.bindings[ee]&&J.addBinding(J.options.bindings[ee])}),J.addBinding({key:H.keys.ENTER,shiftKey:null},B),J.addBinding({key:H.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(J.addBinding({key:H.keys.BACKSPACE},{collapsed:!0},G),J.addBinding({key:H.keys.DELETE},{collapsed:!0},L)):(J.addBinding({key:H.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},G),J.addBinding({key:H.keys.DELETE},{collapsed:!0,suffix:/^.?$/},L)),J.addBinding({key:H.keys.BACKSPACE},{collapsed:!1},I),J.addBinding({key:H.keys.DELETE},{collapsed:!1},I),J.addBinding({key:H.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},G),J.listen(),J}return l(H,[{key:"addBinding",value:function(Z){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},re=K(Z);if(re==null||re.key==null)return V.warn("Attempted to add invalid keyboard binding",re);typeof J=="function"&&(J={handler:J}),typeof ee=="function"&&(ee={handler:ee}),re=(0,p.default)(re,J,ee),this.bindings[re.key]=this.bindings[re.key]||[],this.bindings[re.key].push(re)}},{key:"listen",value:function(){var Z=this;this.quill.root.addEventListener("keydown",function(J){if(!J.defaultPrevented){var ee=J.which||J.keyCode,re=(Z.bindings[ee]||[]).filter(function(ot){return H.match(J,ot)});if(re.length!==0){var ae=Z.quill.getSelection();if(!(ae==null||!Z.quill.hasFocus())){var le=Z.quill.getLine(ae.index),ue=o(le,2),Ae=ue[0],ze=ue[1],oe=Z.quill.getLeaf(ae.index),ie=o(oe,2),ve=ie[0],ge=ie[1],te=ae.length===0?[ve,ge]:Z.quill.getLeaf(ae.index+ae.length),he=o(te,2),de=he[0],we=he[1],_e=ve instanceof d.default.Text?ve.value().slice(0,ge):"",Ne=de instanceof d.default.Text?de.value().slice(we):"",ke={collapsed:ae.length===0,empty:ae.length===0&&Ae.length()<=1,format:Z.quill.getFormat(ae),offset:ze,prefix:_e,suffix:Ne},tt=re.some(function(ot){if(ot.collapsed!=null&&ot.collapsed!==ke.collapsed||ot.empty!=null&&ot.empty!==ke.empty||ot.offset!=null&&ot.offset!==ke.offset)return!1;if(Array.isArray(ot.format)){if(ot.format.every(function(gt){return ke.format[gt]==null}))return!1}else if(a(ot.format)==="object"&&!Object.keys(ot.format).every(function(gt){return ot.format[gt]===!0?ke.format[gt]!=null:ot.format[gt]===!1?ke.format[gt]==null:(0,S.default)(ot.format[gt],ke.format[gt])}))return!1;return ot.prefix!=null&&!ot.prefix.test(ke.prefix)||ot.suffix!=null&&!ot.suffix.test(ke.suffix)?!1:ot.handler.call(Z,ae,ke)!==!0});tt&&J.preventDefault()}}}})}}]),H}(P.default);z.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},z.DEFAULTS={bindings:{bold:$("bold"),italic:$("italic"),underline:$("underline"),indent:{key:z.keys.TAB,format:["blockquote","indent","list"],handler:function(H,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:z.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(H,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:z.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(H,X){X.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):X.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":D(!0),"outdent code-block":D(!1),"remove tab":{key:z.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(H){this.quill.deleteText(H.index-1,1,O.default.sources.USER)}},tab:{key:z.keys.TAB,handler:function(H){this.quill.history.cutoff();var X=new b.default().retain(H.index).delete(H.length).insert(" ");this.quill.updateContents(X,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(H.index+1,O.default.sources.SILENT)}},"list empty enter":{key:z.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(H,X){this.quill.format("list",!1,O.default.sources.USER),X.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:z.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(H){var X=this.quill.getLine(H.index),Z=o(X,2),J=Z[0],ee=Z[1],re=(0,p.default)({},J.formats(),{list:"checked"}),ae=new b.default().retain(H.index).insert(`
128
+ `,re).retain(J.length()-ee-1).retain(1,{list:"unchecked"});this.quill.updateContents(ae,O.default.sources.USER),this.quill.setSelection(H.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:z.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(H,X){var Z=this.quill.getLine(H.index),J=o(Z,2),ee=J[0],re=J[1],ae=new b.default().retain(H.index).insert(`
129
+ `,X.format).retain(ee.length()-re-1).retain(1,{header:null});this.quill.updateContents(ae,O.default.sources.USER),this.quill.setSelection(H.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(H,X){var Z=X.prefix.length,J=this.quill.getLine(H.index),ee=o(J,2),re=ee[0],ae=ee[1];if(ae>Z)return!0;var le=void 0;switch(X.prefix.trim()){case"[]":case"[ ]":le="unchecked";break;case"[x]":le="checked";break;case"-":case"*":le="bullet";break;default:le="ordered"}this.quill.insertText(H.index," ",O.default.sources.USER),this.quill.history.cutoff();var ue=new b.default().retain(H.index-ae).delete(Z+1).retain(re.length()-2-ae).retain(1,{list:le});this.quill.updateContents(ue,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(H.index-Z,O.default.sources.SILENT)}},"code exit":{key:z.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(H){var X=this.quill.getLine(H.index),Z=o(X,2),J=Z[0],ee=Z[1],re=new b.default().retain(H.index+J.length()-ee-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(re,O.default.sources.USER)}},"embed left":F(z.keys.LEFT,!1),"embed left shift":F(z.keys.LEFT,!0),"embed right":F(z.keys.RIGHT,!1),"embed right shift":F(z.keys.RIGHT,!0)}};function F(Y,H){var X,Z=Y===z.keys.LEFT?"prefix":"suffix";return X={key:Y,shiftKey:H,altKey:null},A(X,Z,/^$/),A(X,"handler",function(ee){var re=ee.index;Y===z.keys.RIGHT&&(re+=ee.length+1);var ae=this.quill.getLeaf(re),le=o(ae,1),ue=le[0];return ue instanceof d.default.Embed?(Y===z.keys.LEFT?H?this.quill.setSelection(ee.index-1,ee.length+1,O.default.sources.USER):this.quill.setSelection(ee.index-1,O.default.sources.USER):H?this.quill.setSelection(ee.index,ee.length+1,O.default.sources.USER):this.quill.setSelection(ee.index+ee.length+1,O.default.sources.USER),!1):!0}),X}function G(Y,H){if(!(Y.index===0||this.quill.getLength()<=1)){var X=this.quill.getLine(Y.index),Z=o(X,1),J=Z[0],ee={};if(H.offset===0){var re=this.quill.getLine(Y.index-1),ae=o(re,1),le=ae[0];if(le!=null&&le.length()>1){var ue=J.formats(),Ae=this.quill.getFormat(Y.index-1,1);ee=g.default.attributes.diff(ue,Ae)||{}}}var ze=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(H.prefix)?2:1;this.quill.deleteText(Y.index-ze,ze,O.default.sources.USER),Object.keys(ee).length>0&&this.quill.formatLine(Y.index-ze,ze,ee,O.default.sources.USER),this.quill.focus()}}function L(Y,H){var X=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(H.suffix)?2:1;if(!(Y.index>=this.quill.getLength()-X)){var Z={},J=0,ee=this.quill.getLine(Y.index),re=o(ee,1),ae=re[0];if(H.offset>=ae.length()-1){var le=this.quill.getLine(Y.index+1),ue=o(le,1),Ae=ue[0];if(Ae){var ze=ae.formats(),oe=this.quill.getFormat(Y.index,1);Z=g.default.attributes.diff(ze,oe)||{},J=Ae.length()}}this.quill.deleteText(Y.index,X,O.default.sources.USER),Object.keys(Z).length>0&&this.quill.formatLine(Y.index+J-1,X,Z,O.default.sources.USER)}}function I(Y){var H=this.quill.getLines(Y),X={};if(H.length>1){var Z=H[0].formats(),J=H[H.length-1].formats();X=g.default.attributes.diff(J,Z)||{}}this.quill.deleteText(Y,O.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(Y.index,1,X,O.default.sources.USER),this.quill.setSelection(Y.index,O.default.sources.SILENT),this.quill.focus()}function B(Y,H){var X=this;Y.length>0&&this.quill.scroll.deleteAt(Y.index,Y.length);var Z=Object.keys(H.format).reduce(function(J,ee){return d.default.query(ee,d.default.Scope.BLOCK)&&!Array.isArray(H.format[ee])&&(J[ee]=H.format[ee]),J},{});this.quill.insertText(Y.index,`
130
+ `,Z,O.default.sources.USER),this.quill.setSelection(Y.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(H.format).forEach(function(J){Z[J]==null&&(Array.isArray(H.format[J])||J!=="link"&&X.quill.format(J,H.format[J],O.default.sources.USER))})}function D(Y){return{key:z.keys.TAB,shiftKey:!Y,format:{"code-block":!0},handler:function(X){var Z=d.default.query("code-block"),J=X.index,ee=X.length,re=this.quill.scroll.descendant(Z,J),ae=o(re,2),le=ae[0],ue=ae[1];if(le!=null){var Ae=this.quill.getIndex(le),ze=le.newlineIndex(ue,!0)+1,oe=le.newlineIndex(Ae+ue+ee),ie=le.domNode.textContent.slice(ze,oe).split(`
131
+ `);ue=0,ie.forEach(function(ve,ge){Y?(le.insertAt(ze+ue,Z.TAB),ue+=Z.TAB.length,ge===0?J+=Z.TAB.length:ee+=Z.TAB.length):ve.startsWith(Z.TAB)&&(le.deleteAt(ze+ue,Z.TAB.length),ue-=Z.TAB.length,ge===0?J-=Z.TAB.length:ee-=Z.TAB.length),ue+=ve.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(J,ee,O.default.sources.SILENT)}}}}function $(Y){return{key:Y[0].toUpperCase(),shortKey:!0,handler:function(X,Z){this.quill.format(Y,!Z.format[Y],O.default.sources.USER)}}}function K(Y){if(typeof Y=="string"||typeof Y=="number")return K({key:Y});if((typeof Y>"u"?"undefined":a(Y))==="object"&&(Y=(0,f.default)(Y,!1)),typeof Y.key=="string")if(z.keys[Y.key.toUpperCase()]!=null)Y.key=z.keys[Y.key.toUpperCase()];else if(Y.key.length===1)Y.key=Y.key.toUpperCase().charCodeAt(0);else return null;return Y.shortKey&&(Y[q]=Y.shortKey,delete Y.shortKey),Y}n.default=z,n.SHORTKEY=q},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function g(h,d){var y=[],O=!0,k=!1,C=void 0;try{for(var w=h[Symbol.iterator](),P;!(O=(P=w.next()).done)&&(y.push(P.value),!(d&&y.length===d));O=!0);}catch(x){k=!0,C=x}finally{try{!O&&w.return&&w.return()}finally{if(k)throw C}}return y}return function(h,d){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return g(h,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function g(h,d,y){h===null&&(h=Function.prototype);var O=Object.getOwnPropertyDescriptor(h,d);if(O===void 0){var k=Object.getPrototypeOf(h);return k===null?void 0:g(k,d,y)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(y)}},l=function(){function g(h,d){for(var y=0;y<d.length;y++){var O=d[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(h,O.key,O)}}return function(h,d,y){return d&&g(h.prototype,d),y&&g(h,y),h}}(),u=i(0),f=_(u),v=i(7),S=_(v);function _(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 b(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){b(h,g),l(h,null,[{key:"value",value:function(){}}]);function h(d,y){p(this,h);var O=E(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,d));return O.selection=y,O.textNode=document.createTextNode(h.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return l(h,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(y,O){if(this._length!==0)return o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"format",this).call(this,y,O);for(var k=this,C=0;k!=null&&k.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=h.CONTENTS.length,k.optimize(),k.formatAt(C,h.CONTENTS.length,y,O),this._length=0)}},{key:"index",value:function(y,O){return y===this.textNode?0:o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"index",this).call(this,y,O)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var y=this.textNode,O=this.selection.getNativeRange(),k=void 0,C=void 0,w=void 0;if(O!=null&&O.start.node===y&&O.end.node===y){var P=[y,O.start.offset,O.end.offset];k=P[0],C=P[1],w=P[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==h.CONTENTS){var x=this.textNode.data.split(h.CONTENTS).join("");this.next instanceof S.default?(k=this.next.domNode,this.next.insertAt(0,x),this.textNode.data=h.CONTENTS):(this.textNode.data=x,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(h.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var A=[C,w].map(function(M){return Math.max(0,Math.min(k.data.length,M-1))}),R=a(A,2);return C=R[0],w=R[1],{startNode:k,startOffset:C,endNode:k,endOffset:w}}}}},{key:"update",value:function(y,O){var k=this;if(y.some(function(w){return w.type==="characterData"&&w.target===k.textNode})){var C=this.restore();C&&(O.range=C)}}},{key:"value",value:function(){return""}}]),h}(f.default.Embed);m.blotName="cursor",m.className="ql-cursor",m.tagName="span",m.CONTENTS="\uFEFF",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=f(a),l=i(4),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function S(E,b){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:E}function _(E,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);E.prototype=Object.create(b&&b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(E,b):E.__proto__=b)}var p=function(E){_(b,E);function b(){return v(this,b),S(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default.Container);p.allowedChildren=[u.default,l.BlockEmbed,p],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function m(g,h){for(var d=0;d<h.length;d++){var y=h[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,h,d){return h&&m(g.prototype,h),d&&m(g,d),g}}(),o=function m(g,h,d){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,h);if(y===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:m(O,h,d)}else{if("value"in y)return y.value;var k=y.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function v(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function S(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function _(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var p=function(m){_(g,m);function g(){return v(this,g),S(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"value",value:function(d){var y=o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,d);return y.startsWith("rgb(")?(y=y.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+y.split(",").map(function(O){return("00"+parseInt(O).toString(16)).slice(-2)}).join("")):y}}]),g}(u.default.Attributor.Style),E=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),b=new p("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=E,n.ColorStyle=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function b(m,g){for(var h=0;h<g.length;h++){var d=g[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}return function(m,g,h){return g&&b(m.prototype,g),h&&b(m,h),m}}(),o=function b(m,g,h){m===null&&(m=Function.prototype);var d=Object.getOwnPropertyDescriptor(m,g);if(d===void 0){var y=Object.getPrototypeOf(m);return y===null?void 0:b(y,g,h)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(h)}},l=i(6),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function v(b,m){if(!(b instanceof m))throw new TypeError("Cannot call a class as a function")}function S(b,m){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:b}function _(b,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);b.prototype=Object.create(m&&m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(b,m):b.__proto__=m)}var p=function(b){_(m,b);function m(){return v(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"format",value:function(h,d){if(h!==this.statics.blotName||!d)return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,h,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(h){var d=o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,h);return h=this.sanitize(h),d.setAttribute("href",h),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(h){return h.getAttribute("href")}},{key:"sanitize",value:function(h){return E(h,this.PROTOCOL_WHITELIST)?h:this.SANITIZED_URL}}]),m}(u.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function E(b,m){var g=document.createElement("a");g.href=b;var h=g.href.slice(0,g.href.indexOf(":"));return m.indexOf(h)>-1}n.default=p,n.sanitize=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},o=function(){function m(g,h){for(var d=0;d<h.length;d++){var y=h[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,h,d){return h&&m(g.prototype,h),d&&m(g,d),g}}(),l=i(23),u=S(l),f=i(107),v=S(f);function S(m){return m&&m.__esModule?m:{default:m}}function _(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}var p=0;function E(m,g){m.setAttribute(g,m.getAttribute(g)!=="true")}var b=function(){function m(g){var h=this;_(this,m),this.select=g,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(){h.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:h.togglePicker();break;case u.default.keys.ESCAPE:h.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(m,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),E(this.label,"aria-expanded"),E(this.options,"aria-hidden")}},{key:"buildItem",value:function(h){var d=this,y=document.createElement("span");return y.tabIndex="0",y.setAttribute("role","button"),y.classList.add("ql-picker-item"),h.hasAttribute("value")&&y.setAttribute("data-value",h.getAttribute("value")),h.textContent&&y.setAttribute("data-label",h.textContent),y.addEventListener("click",function(){d.selectItem(y,!0)}),y.addEventListener("keydown",function(O){switch(O.keyCode){case u.default.keys.ENTER:d.selectItem(y,!0),O.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),O.preventDefault();break}}),y}},{key:"buildLabel",value:function(){var h=document.createElement("span");return h.classList.add("ql-picker-label"),h.innerHTML=v.default,h.tabIndex="0",h.setAttribute("role","button"),h.setAttribute("aria-expanded","false"),this.container.appendChild(h),h}},{key:"buildOptions",value:function(){var h=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(y){var O=h.buildItem(y);d.appendChild(O),y.selected===!0&&h.selectItem(O)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var h=this;[].slice.call(this.select.attributes).forEach(function(d){h.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var h=this;this.close(),setTimeout(function(){return h.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(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y=this.container.querySelector(".ql-selected");if(h!==y&&(y!=null&&y.classList.remove("ql-selected"),h!=null&&(h.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(h.parentNode.children,h),h.hasAttribute("data-value")?this.label.setAttribute("data-value",h.getAttribute("data-value")):this.label.removeAttribute("data-value"),h.hasAttribute("data-label")?this.label.setAttribute("data-label",h.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 O=document.createEvent("Event");O.initEvent("change",!0,!0),this.select.dispatchEvent(O)}this.close()}}},{key:"update",value:function(){var h=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];h=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var y=h!=null&&h!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",y)}}]),m}();n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=V(a),l=i(5),u=V(l),f=i(4),v=V(f),S=i(16),_=V(S),p=i(25),E=V(p),b=i(24),m=V(b),g=i(35),h=V(g),d=i(6),y=V(d),O=i(22),k=V(O),C=i(7),w=V(C),P=i(55),x=V(P),A=i(42),R=V(A),M=i(23),U=V(M);function V(q){return q&&q.__esModule?q:{default:q}}u.default.register({"blots/block":v.default,"blots/block/embed":f.BlockEmbed,"blots/break":_.default,"blots/container":E.default,"blots/cursor":m.default,"blots/embed":h.default,"blots/inline":y.default,"blots/scroll":k.default,"blots/text":w.default,"modules/clipboard":x.default,"modules/history":R.default,"modules/keyboard":U.default}),o.default.register(v.default,_.default,m.default,y.default,k.default,w.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 v=this.isolate(u,f);v.remove()},l.prototype.formatAt=function(u,f,v,S){var _=this.isolate(u,f);if(a.query(v,a.Scope.BLOT)!=null&&S)_.wrap(v,S);else if(a.query(v,a.Scope.ATTRIBUTE)!=null){var p=a.create(this.statics.scope);_.wrap(p),p.format(v,S)}},l.prototype.insertAt=function(u,f,v){var S=v==null?a.create("text",f):a.create(f,v),_=this.split(u);this.parent.insertBefore(S,_)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var v=null;u.children.insertBefore(this,f),f!=null&&(v=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=v)&&u.domNode.insertBefore(this.domNode,v),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var v=this.split(u);return v.split(f),v},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 v=typeof u=="string"?a.create(u,f):u;return v.replace(this),v},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 v=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(v,this.next),v.appendChild(this),v},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 v(S){this.attributes={},this.domNode=S,this.build()}return v.prototype.attribute=function(S,_){_?S.add(this.domNode,_)&&(S.value(this.domNode)!=null?this.attributes[S.attrName]=S:delete this.attributes[S.attrName]):(S.remove(this.domNode),delete this.attributes[S.attrName])},v.prototype.build=function(){var S=this;this.attributes={};var _=a.default.keys(this.domNode),p=o.default.keys(this.domNode),E=l.default.keys(this.domNode);_.concat(p).concat(E).forEach(function(b){var m=u.query(b,u.Scope.ATTRIBUTE);m instanceof a.default&&(S.attributes[m.attrName]=m)})},v.prototype.copy=function(S){var _=this;Object.keys(this.attributes).forEach(function(p){var E=_.attributes[p].value(_.domNode);S.format(p,E)})},v.prototype.move=function(S){var _=this;this.copy(S),Object.keys(this.attributes).forEach(function(p){_.attributes[p].remove(_.domNode)}),this.attributes={}},v.prototype.values=function(){var S=this;return Object.keys(this.attributes).reduce(function(_,p){return _[p]=S.attributes[p].value(S.domNode),_},{})},v}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,v){var S=f.getAttribute("class")||"";return S.split(/\s+/).filter(function(_){return _.indexOf(v+"-")===0})}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(S){return(S.getAttribute("class")||"").split(/\s+/).map(function(_){return _.split("-").slice(0,-1).join("-")})},v.prototype.add=function(S,_){return this.canAdd(S,_)?(this.remove(S),S.classList.add(this.keyName+"-"+_),!0):!1},v.prototype.remove=function(S){var _=l(S,this.keyName);_.forEach(function(p){S.classList.remove(p)}),S.classList.length===0&&S.removeAttribute("class")},v.prototype.value=function(S){var _=l(S,this.keyName)[0]||"",p=_.slice(this.keyName.length+1);return this.canAdd(S,p)?p:""},v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var v=f.split("-"),S=v.slice(1).map(function(_){return _[0].toUpperCase()+_.slice(1)}).join("");return v[0]+S}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(S){return(S.getAttribute("style")||"").split(";").map(function(_){var p=_.split(":");return p[0].trim()})},v.prototype.add=function(S,_){return this.canAdd(S,_)?(S.style[l(this.keyName)]=_,!0):!1},v.prototype.remove=function(S){S.style[l(this.keyName)]="",S.getAttribute("style")||S.removeAttribute("style")},v.prototype.value=function(S){var _=S.style[l(this.keyName)];return this.canAdd(S,_)?_:""},v}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var S=0;S<v.length;S++){var _=v[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(f,_.key,_)}}return function(f,v,S){return v&&u(f.prototype,v),S&&u(f,S),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,v){o(this,u),this.quill=f,this.options=v,this.modules={}}return a(u,[{key:"init",value:function(){var v=this;Object.keys(this.options.modules).forEach(function(S){v.modules[S]==null&&v.addModule(S)})}},{key:"addModule",value:function(v){var S=this.quill.constructor.import("modules/"+v);return this.modules[v]=new S(this.quill,this.options.modules[v]||{}),this.modules[v]}}]),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 g(h,d){for(var y=0;y<d.length;y++){var O=d[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(h,O.key,O)}}return function(h,d,y){return d&&g(h.prototype,d),y&&g(h,y),h}}(),o=function g(h,d,y){h===null&&(h=Function.prototype);var O=Object.getOwnPropertyDescriptor(h,d);if(O===void 0){var k=Object.getPrototypeOf(h);return k===null?void 0:g(k,d,y)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(y)}},l=i(0),u=S(l),f=i(7),v=S(f);function S(g){return g&&g.__esModule?g:{default:g}}function _(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function p(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 E(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="\uFEFF",m=function(g){E(h,g);function h(d){_(this,h);var y=p(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,d));return y.contentNode=document.createElement("span"),y.contentNode.setAttribute("contenteditable",!1),[].slice.call(y.domNode.childNodes).forEach(function(O){y.contentNode.appendChild(O)}),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(h,[{key:"index",value:function(y,O){return y===this.leftGuard?0:y===this.rightGuard?1:o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"index",this).call(this,y,O)}},{key:"restore",value:function(y){var O=void 0,k=void 0,C=y.data.split(b).join("");if(y===this.leftGuard)if(this.prev instanceof v.default){var w=this.prev.length();this.prev.insertAt(w,C),O={startNode:this.prev.domNode,startOffset:w+C.length}}else k=document.createTextNode(C),this.parent.insertBefore(u.default.create(k),this),O={startNode:k,startOffset:C.length};else y===this.rightGuard&&(this.next instanceof v.default?(this.next.insertAt(0,C),O={startNode:this.next.domNode,startOffset:C.length}):(k=document.createTextNode(C),this.parent.insertBefore(u.default.create(k),this.next),O={startNode:k,startOffset:C.length}));return y.data=b,O}},{key:"update",value:function(y,O){var k=this;y.forEach(function(C){if(C.type==="characterData"&&(C.target===k.leftGuard||C.target===k.rightGuard)){var w=k.restore(C.target);w&&(O.range=w)}})}}]),h}(u.default.Embed);n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),v=new o.default.Attributor.Class("align","ql-align",u),S=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=v,n.AlignStyle=S},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(S){return S&&S.__esModule?S:{default:S}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),v=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=v},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(_){return _&&_.__esModule?_:{default:_}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),v=new o.default.Attributor.Class("direction","ql-direction",u),S=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=v,n.DirectionStyle=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function g(h,d){for(var y=0;y<d.length;y++){var O=d[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(h,O.key,O)}}return function(h,d,y){return d&&g(h.prototype,d),y&&g(h,y),h}}(),o=function g(h,d,y){h===null&&(h=Function.prototype);var O=Object.getOwnPropertyDescriptor(h,d);if(O===void 0){var k=Object.getPrototypeOf(h);return k===null?void 0:g(k,d,y)}else{if("value"in O)return O.value;var C=O.get;return C===void 0?void 0:C.call(y)}},l=i(0),u=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function v(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function S(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 _(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 p={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},E=new u.default.Attributor.Class("font","ql-font",p),b=function(g){_(h,g);function h(){return v(this,h),S(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return a(h,[{key:"value",value:function(y){return o(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this).call(this,y).replace(/["']/g,"")}}]),h}(u.default.Attributor.Style),m=new b("font","font-family",p);n.FontStyle=m,n.FontClass=E},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(v){return v&&v.__esModule?v:{default:v}}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,O){for(var k=0;k<O.length;k++){var C=O[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(y,C.key,C)}}return function(y,O,k){return O&&d(y.prototype,O),k&&d(y,k),y}}(),o=i(0),l=_(o),u=i(5),f=_(u),v=i(9),S=_(v);function _(d){return d&&d.__esModule?d:{default:d}}function p(d,y){if(!(d instanceof y))throw new TypeError("Cannot call a class as a function")}function E(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 m=function(d){b(y,d);function y(O,k){p(this,y);var C=E(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,O,k));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(w,P,x,A){w!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||A===f.default.sources.USER?C.record(P,x):C.transform(P))}),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(k,C){if(this.stack[k].length!==0){var w=this.stack[k].pop();this.stack[C].push(w),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(w[k],f.default.sources.USER),this.ignoreChange=!1;var P=h(w[k]);this.quill.setSelection(P)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(k,C){if(k.ops.length!==0){this.stack.redo=[];var w=this.quill.getContents().diff(C),P=Date.now();if(this.lastRecorded+this.options.delay>P&&this.stack.undo.length>0){var x=this.stack.undo.pop();w=w.compose(x.undo),k=x.redo.compose(k)}else this.lastRecorded=P;this.stack.undo.push({redo:k,undo:w}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(k){this.stack.undo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),y}(S.default);m.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function g(d){var y=d.ops[d.ops.length-1];return y==null?!1:y.insert!=null?typeof y.insert=="string"&&y.insert.endsWith(`
132
+ `):y.attributes!=null?Object.keys(y.attributes).some(function(O){return l.default.query(O,l.default.Scope.BLOCK)!=null}):!1}function h(d){var y=d.reduce(function(k,C){return k+=C.delete||0,k},0),O=d.length()-y;return g(d)&&(O-=1),O}n.default=m,n.getLastChangeIndex=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function B(D,$){for(var K=0;K<$.length;K++){var Y=$[K];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(D,Y.key,Y)}}return function(D,$,K){return $&&B(D.prototype,$),K&&B(D,K),D}}(),o=function B(D,$,K){D===null&&(D=Function.prototype);var Y=Object.getOwnPropertyDescriptor(D,$);if(Y===void 0){var H=Object.getPrototypeOf(D);return H===null?void 0:B(H,$,K)}else{if("value"in Y)return Y.value;var X=Y.get;return X===void 0?void 0:X.call(K)}},l=i(3),u=P(l),f=i(2),v=P(f),S=i(8),_=P(S),p=i(23),E=P(p),b=i(34),m=P(b),g=i(59),h=P(g),d=i(60),y=P(d),O=i(28),k=P(O),C=i(61),w=P(C);function P(B){return B&&B.__esModule?B:{default:B}}function x(B,D){if(!(B instanceof D))throw new TypeError("Cannot call a class as a function")}function A(B,D){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:B}function R(B,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);B.prototype=Object.create(D&&D.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(B,D):B.__proto__=D)}var M=[!1,"center","right","justify"],U=["#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"],V=[!1,"serif","monospace"],q=["1","2","3",!1],z=["small",!1,"large","huge"],F=function(B){R(D,B);function D($,K){x(this,D);var Y=A(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,$,K)),H=function X(Z){if(!document.body.contains($.root))return document.body.removeEventListener("click",X);Y.tooltip!=null&&!Y.tooltip.root.contains(Z.target)&&document.activeElement!==Y.tooltip.textbox&&!Y.quill.hasFocus()&&Y.tooltip.hide(),Y.pickers!=null&&Y.pickers.forEach(function(J){J.container.contains(Z.target)||J.close()})};return $.emitter.listenDOM("click",document.body,H),Y}return a(D,[{key:"addModule",value:function(K){var Y=o(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar(Y),Y}},{key:"buildButtons",value:function(K,Y){K.forEach(function(H){var X=H.getAttribute("class")||"";X.split(/\s+/).forEach(function(Z){if(Z.startsWith("ql-")&&(Z=Z.slice(3),Y[Z]!=null))if(Z==="direction")H.innerHTML=Y[Z][""]+Y[Z].rtl;else if(typeof Y[Z]=="string")H.innerHTML=Y[Z];else{var J=H.value||"";J!=null&&Y[Z][J]&&(H.innerHTML=Y[Z][J])}})})}},{key:"buildPickers",value:function(K,Y){var H=this;this.pickers=K.map(function(Z){if(Z.classList.contains("ql-align"))return Z.querySelector("option")==null&&I(Z,M),new y.default(Z,Y.align);if(Z.classList.contains("ql-background")||Z.classList.contains("ql-color")){var J=Z.classList.contains("ql-background")?"background":"color";return Z.querySelector("option")==null&&I(Z,U,J==="background"?"#ffffff":"#000000"),new h.default(Z,Y[J])}else return Z.querySelector("option")==null&&(Z.classList.contains("ql-font")?I(Z,V):Z.classList.contains("ql-header")?I(Z,q):Z.classList.contains("ql-size")&&I(Z,z)),new k.default(Z)});var X=function(){H.pickers.forEach(function(J){J.update()})};this.quill.on(_.default.events.EDITOR_CHANGE,X)}}]),D}(m.default);F.DEFAULTS=(0,u.default)(!0,{},m.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(Y){var H=D.quill.getSelection(!0);D.quill.updateContents(new v.default().retain(H.index).delete(H.length).insert({image:Y.target.result}),_.default.sources.USER),D.quill.setSelection(H.index+1,_.default.sources.SILENT),$.value=""},K.readAsDataURL($.files[0])}}),this.container.appendChild($)),$.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var G=function(B){R(D,B);function D($,K){x(this,D);var Y=A(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,$,K));return Y.textbox=Y.root.querySelector('input[type="text"]'),Y.listen(),Y}return a(D,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function(Y){E.default.match(Y,"enter")?(K.save(),Y.preventDefault()):E.default.match(Y,"escape")&&(K.cancel(),Y.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),Y!=null?this.textbox.value=Y: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 Y=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,_.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,_.default.sources.USER)),this.quill.root.scrollTop=Y;break}case"video":K=L(K);case"formula":{if(!K)break;var H=this.quill.getSelection(!0);if(H!=null){var X=H.index+H.length;this.quill.insertEmbed(X,this.root.getAttribute("data-mode"),K,_.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(X+1," ",_.default.sources.USER),this.quill.setSelection(X+2,_.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),D}(w.default);function L(B){var D=B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return D?(D[1]||"https")+"://www.youtube.com/embed/"+D[2]+"?showinfo=0":(D=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(D[1]||"https")+"://player.vimeo.com/video/"+D[2]+"/":B}function I(B,D){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;D.forEach(function(K){var Y=document.createElement("option");K===$?Y.setAttribute("selected","selected"):Y.setAttribute("value",K),B.appendChild(Y)})}n.BaseTooltip=G,n.default=F},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,v=this.iterator();f=v();){var S=f.length();if(l<S||u&&l===S&&(f.next==null||f.next.length()!==0))return[f,l];l-=S}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 v=this.find(l),S=v[0],_=v[1],p,E=l-_,b=this.iterator(S);(p=b())&&E<l+u;){var m=p.length();l>E?f(p,l-E,Math.min(u,E+m-l)):f(p,0,Math.min(m,l+u-E)),E+=m}},o.prototype.map=function(l){return this.reduce(function(u,f){return u.push(l(f)),u},[])},o.prototype.reduce=function(l,u){for(var f,v=this.iterator();f=v();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,p){_.__proto__=p}||function(_,p){for(var E in p)p.hasOwnProperty(E)&&(_[E]=p[E])};return function(_,p){S(_,p);function E(){this.constructor=_}_.prototype=p===null?Object.create(p):(E.prototype=p.prototype,new E)}}();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,v=function(S){a(_,S);function _(p){var E=S.call(this,p)||this;return E.scroll=E,E.observer=new MutationObserver(function(b){E.update(b)}),E.observer.observe(E.domNode,u),E.attach(),E}return _.prototype.detach=function(){S.prototype.detach.call(this),this.observer.disconnect()},_.prototype.deleteAt=function(p,E){this.update(),p===0&&E===this.length()?this.children.forEach(function(b){b.remove()}):S.prototype.deleteAt.call(this,p,E)},_.prototype.formatAt=function(p,E,b,m){this.update(),S.prototype.formatAt.call(this,p,E,b,m)},_.prototype.insertAt=function(p,E,b){this.update(),S.prototype.insertAt.call(this,p,E,b)},_.prototype.optimize=function(p,E){var b=this;p===void 0&&(p=[]),E===void 0&&(E={}),S.prototype.optimize.call(this,E);for(var m=[].slice.call(this.observer.takeRecords());m.length>0;)p.push(m.pop());for(var g=function(O,k){k===void 0&&(k=!0),!(O==null||O===b)&&O.domNode.parentNode!=null&&(O.domNode[l.DATA_KEY].mutations==null&&(O.domNode[l.DATA_KEY].mutations=[]),k&&g(O.parent))},h=function(O){O.domNode[l.DATA_KEY]==null||O.domNode[l.DATA_KEY].mutations==null||(O instanceof o.default&&O.children.forEach(h),O.optimize(E))},d=p,y=0;d.length>0;y+=1){if(y>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(O){var k=l.find(O.target,!0);k!=null&&(k.domNode===O.target&&(O.type==="childList"?(g(l.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(C){var w=l.find(C,!1);g(w,!1),w instanceof o.default&&w.children.forEach(function(P){g(P,!1)})})):O.type==="attributes"&&g(k.prev)),g(k))}),this.children.forEach(h),d=[].slice.call(this.observer.takeRecords()),m=d.slice();m.length>0;)p.push(m.pop())}},_.prototype.update=function(p,E){var b=this;E===void 0&&(E={}),p=p||this.observer.takeRecords(),p.map(function(m){var g=l.find(m.target,!0);return g==null?null:g.domNode[l.DATA_KEY].mutations==null?(g.domNode[l.DATA_KEY].mutations=[m],g):(g.domNode[l.DATA_KEY].mutations.push(m),null)}).forEach(function(m){m==null||m===b||m.domNode[l.DATA_KEY]==null||m.update(m.domNode[l.DATA_KEY].mutations||[],E)}),this.domNode[l.DATA_KEY].mutations!=null&&S.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,E),this.optimize(p,E)},_.blotName="scroll",_.defaultChild="block",_.scope=l.Scope.BLOCK_BLOT,_.tagName="DIV",_}(o.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,_){S.__proto__=_}||function(S,_){for(var p in _)_.hasOwnProperty(p)&&(S[p]=_[p])};return function(S,_){v(S,_);function p(){this.constructor=S}S.prototype=_===null?Object.create(_):(p.prototype=_.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(v,S){if(Object.keys(v).length!==Object.keys(S).length)return!1;for(var _ in v)if(v[_]!==S[_])return!1;return!0}var f=function(v){a(S,v);function S(){return v!==null&&v.apply(this,arguments)||this}return S.formats=function(_){if(_.tagName!==S.tagName)return v.formats.call(this,_)},S.prototype.format=function(_,p){var E=this;_===this.statics.blotName&&!p?(this.children.forEach(function(b){b instanceof o.default||(b=b.wrap(S.blotName,!0)),E.attributes.copy(b)}),this.unwrap()):v.prototype.format.call(this,_,p)},S.prototype.formatAt=function(_,p,E,b){if(this.formats()[E]!=null||l.query(E,l.Scope.ATTRIBUTE)){var m=this.isolate(_,p);m.format(E,b)}else v.prototype.formatAt.call(this,_,p,E,b)},S.prototype.optimize=function(_){v.prototype.optimize.call(this,_);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var E=this.next;E instanceof S&&E.prev===this&&u(p,E.formats())&&(E.moveChildren(this),E.remove())},S.blotName="inline",S.scope=l.Scope.INLINE_BLOT,S.tagName="SPAN",S}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.formats=function(S){var _=l.query(v.blotName).tagName;if(S.tagName!==_)return f.formats.call(this,S)},v.prototype.format=function(S,_){l.query(S,l.Scope.BLOCK)!=null&&(S===this.statics.blotName&&!_?this.replaceWith(v.blotName):f.prototype.format.call(this,S,_))},v.prototype.formatAt=function(S,_,p,E){l.query(p,l.Scope.BLOCK)!=null?this.format(p,E):f.prototype.formatAt.call(this,S,_,p,E)},v.prototype.insertAt=function(S,_,p){if(p==null||l.query(_,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,S,_,p);else{var E=this.split(S),b=l.create(_,p);E.parent.insertBefore(b,E)}},v.prototype.update=function(S,_){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,S,_)},v.blotName="block",v.scope=l.Scope.BLOCK_BLOT,v.tagName="P",v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var S in v)v.hasOwnProperty(S)&&(f[S]=v[S])};return function(f,v){u(f,v);function S(){this.constructor=f}f.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}}();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(v){},f.prototype.format=function(v,S){u.prototype.formatAt.call(this,0,this.length(),v,S)},f.prototype.formatAt=function(v,S,_,p){v===0&&S===this.length()?this.format(_,p):u.prototype.formatAt.call(this,v,S,_,p)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(v,f);function v(S){var _=f.call(this,S)||this;return _.text=_.statics.value(_.domNode),_}return v.create=function(S){return document.createTextNode(S)},v.value=function(S){var _=S.data;return _.normalize&&(_=_.normalize()),_},v.prototype.deleteAt=function(S,_){this.domNode.data=this.text=this.text.slice(0,S)+this.text.slice(S+_)},v.prototype.index=function(S,_){return this.domNode===S?_:-1},v.prototype.insertAt=function(S,_,p){p==null?(this.text=this.text.slice(0,S)+_+this.text.slice(S),this.domNode.data=this.text):f.prototype.insertAt.call(this,S,_,p)},v.prototype.length=function(){return this.text.length},v.prototype.optimize=function(S){f.prototype.optimize.call(this,S),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof v&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},v.prototype.position=function(S,_){return[this.domNode,S]},v.prototype.split=function(S,_){if(_===void 0&&(_=!1),!_){if(S===0)return this;if(S===this.length())return this.next}var p=l.create(this.domNode.splitText(S));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},v.prototype.update=function(S,_){var p=this;S.some(function(E){return E.type==="characterData"&&E.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},v.prototype.value=function(){return this.text},v.blotName="text",v.scope=l.Scope.INLINE_BLOT,v}(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 v=f.indexOf(l,u);return v!==-1&&v===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),v=f.length>>>0,S=arguments[1],_,p=0;p<v;p++)if(_=f[p],u.call(S,_,p,f))return _}}),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,O,k){if(y==O)return y?[[o,y]]:[];(k<0||y.length<k)&&(k=null);var C=S(y,O),w=y.substring(0,C);y=y.substring(C),O=O.substring(C),C=_(y,O);var P=y.substring(y.length-C);y=y.substring(0,y.length-C),O=O.substring(0,O.length-C);var x=u(y,O);return w&&x.unshift([o,w]),P&&x.push([o,P]),E(x),k!=null&&(x=g(x,k)),x=h(x),x}function u(y,O){var k;if(!y)return[[a,O]];if(!O)return[[i,y]];var C=y.length>O.length?y:O,w=y.length>O.length?O:y,P=C.indexOf(w);if(P!=-1)return k=[[a,C.substring(0,P)],[o,w],[a,C.substring(P+w.length)]],y.length>O.length&&(k[0][0]=k[2][0]=i),k;if(w.length==1)return[[i,y],[a,O]];var x=p(y,O);if(x){var A=x[0],R=x[1],M=x[2],U=x[3],V=x[4],q=l(A,M),z=l(R,U);return q.concat([[o,V]],z)}return f(y,O)}function f(y,O){for(var k=y.length,C=O.length,w=Math.ceil((k+C)/2),P=w,x=2*w,A=new Array(x),R=new Array(x),M=0;M<x;M++)A[M]=-1,R[M]=-1;A[P+1]=0,R[P+1]=0;for(var U=k-C,V=U%2!=0,q=0,z=0,F=0,G=0,L=0;L<w;L++){for(var I=-L+q;I<=L-z;I+=2){var B=P+I,D;I==-L||I!=L&&A[B-1]<A[B+1]?D=A[B+1]:D=A[B-1]+1;for(var $=D-I;D<k&&$<C&&y.charAt(D)==O.charAt($);)D++,$++;if(A[B]=D,D>k)z+=2;else if($>C)q+=2;else if(V){var K=P+U-I;if(K>=0&&K<x&&R[K]!=-1){var Y=k-R[K];if(D>=Y)return v(y,O,D,$)}}}for(var H=-L+F;H<=L-G;H+=2){var K=P+H,Y;H==-L||H!=L&&R[K-1]<R[K+1]?Y=R[K+1]:Y=R[K-1]+1;for(var X=Y-H;Y<k&&X<C&&y.charAt(k-Y-1)==O.charAt(C-X-1);)Y++,X++;if(R[K]=Y,Y>k)G+=2;else if(X>C)F+=2;else if(!V){var B=P+U-H;if(B>=0&&B<x&&A[B]!=-1){var D=A[B],$=P+D-B;if(Y=k-Y,D>=Y)return v(y,O,D,$)}}}}return[[i,y],[a,O]]}function v(y,O,k,C){var w=y.substring(0,k),P=O.substring(0,C),x=y.substring(k),A=O.substring(C),R=l(w,P),M=l(x,A);return R.concat(M)}function S(y,O){if(!y||!O||y.charAt(0)!=O.charAt(0))return 0;for(var k=0,C=Math.min(y.length,O.length),w=C,P=0;k<w;)y.substring(P,w)==O.substring(P,w)?(k=w,P=k):C=w,w=Math.floor((C-k)/2+k);return w}function _(y,O){if(!y||!O||y.charAt(y.length-1)!=O.charAt(O.length-1))return 0;for(var k=0,C=Math.min(y.length,O.length),w=C,P=0;k<w;)y.substring(y.length-w,y.length-P)==O.substring(O.length-w,O.length-P)?(k=w,P=k):C=w,w=Math.floor((C-k)/2+k);return w}function p(y,O){var k=y.length>O.length?y:O,C=y.length>O.length?O:y;if(k.length<4||C.length*2<k.length)return null;function w(z,F,G){for(var L=z.substring(G,G+Math.floor(z.length/4)),I=-1,B="",D,$,K,Y;(I=F.indexOf(L,I+1))!=-1;){var H=S(z.substring(G),F.substring(I)),X=_(z.substring(0,G),F.substring(0,I));B.length<X+H&&(B=F.substring(I-X,I)+F.substring(I,I+H),D=z.substring(0,G-X),$=z.substring(G+H),K=F.substring(0,I-X),Y=F.substring(I+H))}return B.length*2>=z.length?[D,$,K,Y,B]:null}var P=w(k,C,Math.ceil(k.length/4)),x=w(k,C,Math.ceil(k.length/2)),A;if(!P&&!x)return null;x?P?A=P[4].length>x[4].length?P:x:A=x:A=P;var R,M,U,V;y.length>O.length?(R=A[0],M=A[1],U=A[2],V=A[3]):(U=A[0],V=A[1],R=A[2],M=A[3]);var q=A[4];return[R,M,U,V,q]}function E(y){y.push([o,""]);for(var O=0,k=0,C=0,w="",P="",x;O<y.length;)switch(y[O][0]){case a:C++,P+=y[O][1],O++;break;case i:k++,w+=y[O][1],O++;break;case o:k+C>1?(k!==0&&C!==0&&(x=S(P,w),x!==0&&(O-k-C>0&&y[O-k-C-1][0]==o?y[O-k-C-1][1]+=P.substring(0,x):(y.splice(0,0,[o,P.substring(0,x)]),O++),P=P.substring(x),w=w.substring(x)),x=_(P,w),x!==0&&(y[O][1]=P.substring(P.length-x)+y[O][1],P=P.substring(0,P.length-x),w=w.substring(0,w.length-x))),k===0?y.splice(O-C,k+C,[a,P]):C===0?y.splice(O-k,k+C,[i,w]):y.splice(O-k-C,k+C,[i,w],[a,P]),O=O-k-C+(k?1:0)+(C?1:0)+1):O!==0&&y[O-1][0]==o?(y[O-1][1]+=y[O][1],y.splice(O,1)):O++,C=0,k=0,w="",P="";break}y[y.length-1][1]===""&&y.pop();var A=!1;for(O=1;O<y.length-1;)y[O-1][0]==o&&y[O+1][0]==o&&(y[O][1].substring(y[O][1].length-y[O-1][1].length)==y[O-1][1]?(y[O][1]=y[O-1][1]+y[O][1].substring(0,y[O][1].length-y[O-1][1].length),y[O+1][1]=y[O-1][1]+y[O+1][1],y.splice(O-1,1),A=!0):y[O][1].substring(0,y[O+1][1].length)==y[O+1][1]&&(y[O-1][1]+=y[O+1][1],y[O][1]=y[O][1].substring(y[O+1][1].length)+y[O+1][1],y.splice(O+1,1),A=!0)),O++;A&&E(y)}var b=l;b.INSERT=a,b.DELETE=i,b.EQUAL=o,r.exports=b;function m(y,O){if(O===0)return[o,y];for(var k=0,C=0;C<y.length;C++){var w=y[C];if(w[0]===i||w[0]===o){var P=k+w[1].length;if(O===P)return[C+1,y];if(O<P){y=y.slice();var x=O-k,A=[w[0],w[1].slice(0,x)],R=[w[0],w[1].slice(x)];return y.splice(C,1,A,R),[C+1,y]}else k=P}}throw new Error("cursor_pos is out of bounds!")}function g(y,O){var k=m(y,O),C=k[1],w=k[0],P=C[w],x=C[w+1];if(P==null)return y;if(P[0]!==o)return y;if(x!=null&&P[1]+x[1]===x[1]+P[1])return C.splice(w,2,x,P),d(C,w,2);if(x!=null&&x[1].indexOf(P[1])===0){C.splice(w,2,[x[0],P[1]],[0,P[1]]);var A=x[1].slice(P[1].length);return A.length>0&&C.splice(w+2,0,[x[0],A]),d(C,w,3)}else return y}function h(y){for(var O=!1,k=function(x){return x.charCodeAt(0)>=56320&&x.charCodeAt(0)<=57343},C=function(x){return x.charCodeAt(x.length-1)>=55296&&x.charCodeAt(x.length-1)<=56319},w=2;w<y.length;w+=1)y[w-2][0]===o&&C(y[w-2][1])&&y[w-1][0]===i&&k(y[w-1][1])&&y[w][0]===a&&k(y[w][1])&&(O=!0,y[w-1][1]=y[w-2][1].slice(-1)+y[w-1][1],y[w][1]=y[w-2][1].slice(-1)+y[w][1],y[w-2][1]=y[w-2][1].slice(0,-1));if(!O)return y;for(var P=[],w=0;w<y.length;w+=1)y[w][1].length>0&&P.push(y[w]);return P}function d(y,O,k){for(var C=O+k-1;C>=0&&C>=O-1;C--)if(C+1<y.length){var w=y[C],P=y[C+1];w[0]===P[1]&&y.splice(C,2,[w[0],w[1]+P[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,v,S){this.fn=f,this.context=v,this.once=S||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var v=[],S,_;if(this._eventsCount===0)return v;for(_ in S=this._events)i.call(S,_)&&v.push(a?_.slice(1):_);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(S)):v},u.prototype.listeners=function(v,S){var _=a?a+v:v,p=this._events[_];if(S)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var E=0,b=p.length,m=new Array(b);E<b;E++)m[E]=p[E].fn;return m},u.prototype.emit=function(v,S,_,p,E,b){var m=a?a+v:v;if(!this._events[m])return!1;var g=this._events[m],h=arguments.length,d,y;if(g.fn){switch(g.once&&this.removeListener(v,g.fn,void 0,!0),h){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,S),!0;case 3:return g.fn.call(g.context,S,_),!0;case 4:return g.fn.call(g.context,S,_,p),!0;case 5:return g.fn.call(g.context,S,_,p,E),!0;case 6:return g.fn.call(g.context,S,_,p,E,b),!0}for(y=1,d=new Array(h-1);y<h;y++)d[y-1]=arguments[y];g.fn.apply(g.context,d)}else{var O=g.length,k;for(y=0;y<O;y++)switch(g[y].once&&this.removeListener(v,g[y].fn,void 0,!0),h){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,S);break;case 3:g[y].fn.call(g[y].context,S,_);break;case 4:g[y].fn.call(g[y].context,S,_,p);break;default:if(!d)for(k=1,d=new Array(h-1);k<h;k++)d[k-1]=arguments[k];g[y].fn.apply(g[y].context,d)}}return!0},u.prototype.on=function(v,S,_){var p=new l(S,_||this),E=a?a+v:v;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],p]:this._events[E].push(p):(this._events[E]=p,this._eventsCount++),this},u.prototype.once=function(v,S,_){var p=new l(S,_||this,!0),E=a?a+v:v;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],p]:this._events[E].push(p):(this._events[E]=p,this._eventsCount++),this},u.prototype.removeListener=function(v,S,_,p){var E=a?a+v:v;if(!this._events[E])return this;if(!S)return--this._eventsCount===0?this._events=new o:delete this._events[E],this;var b=this._events[E];if(b.fn)b.fn===S&&(!p||b.once)&&(!_||b.context===_)&&(--this._eventsCount===0?this._events=new o:delete this._events[E]);else{for(var m=0,g=[],h=b.length;m<h;m++)(b[m].fn!==S||p&&!b[m].once||_&&b[m].context!==_)&&g.push(b[m]);g.length?this._events[E]=g.length===1?g[0]:g:--this._eventsCount===0?this._events=new o:delete this._events[E]}return this},u.prototype.removeAllListeners=function(v){var S;return v?(S=a?a+v:v,this._events[S]&&(--this._eventsCount===0?this._events=new o:delete this._events[S])):(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(oe){return typeof oe}:function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},o=function(){function oe(ie,ve){var ge=[],te=!0,he=!1,de=void 0;try{for(var we=ie[Symbol.iterator](),_e;!(te=(_e=we.next()).done)&&(ge.push(_e.value),!(ve&&ge.length===ve));te=!0);}catch(Ne){he=!0,de=Ne}finally{try{!te&&we.return&&we.return()}finally{if(he)throw de}}return ge}return function(ie,ve){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return oe(ie,ve);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function oe(ie,ve){for(var ge=0;ge<ve.length;ge++){var te=ve[ge];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ie,te.key,te)}}return function(ie,ve,ge){return ve&&oe(ie.prototype,ve),ge&&oe(ie,ge),ie}}(),u=i(3),f=R(u),v=i(2),S=R(v),_=i(0),p=R(_),E=i(5),b=R(E),m=i(10),g=R(m),h=i(9),d=R(h),y=i(36),O=i(37),k=i(13),C=R(k),w=i(26),P=i(38),x=i(39),A=i(40);function R(oe){return oe&&oe.__esModule?oe:{default:oe}}function M(oe,ie,ve){return ie in oe?Object.defineProperty(oe,ie,{value:ve,enumerable:!0,configurable:!0,writable:!0}):oe[ie]=ve,oe}function U(oe,ie){if(!(oe instanceof ie))throw new TypeError("Cannot call a class as a function")}function V(oe,ie){if(!oe)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie&&(typeof ie=="object"||typeof ie=="function")?ie:oe}function q(oe,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ie);oe.prototype=Object.create(ie&&ie.prototype,{constructor:{value:oe,enumerable:!1,writable:!0,configurable:!0}}),ie&&(Object.setPrototypeOf?Object.setPrototypeOf(oe,ie):oe.__proto__=ie)}var z=(0,g.default)("quill:clipboard"),F="__ql-matcher",G=[[Node.TEXT_NODE,ze],[Node.TEXT_NODE,le],["br",ee],[Node.ELEMENT_NODE,le],[Node.ELEMENT_NODE,J],[Node.ELEMENT_NODE,ue],[Node.ELEMENT_NODE,Z],[Node.ELEMENT_NODE,Ae],["li",ae],["b",X.bind(X,"bold")],["i",X.bind(X,"italic")],["style",re]],L=[y.AlignAttribute,P.DirectionAttribute].reduce(function(oe,ie){return oe[ie.keyName]=ie,oe},{}),I=[y.AlignStyle,O.BackgroundStyle,w.ColorStyle,P.DirectionStyle,x.FontStyle,A.SizeStyle].reduce(function(oe,ie){return oe[ie.keyName]=ie,oe},{}),B=function(oe){q(ie,oe);function ie(ve,ge){U(this,ie);var te=V(this,(ie.__proto__||Object.getPrototypeOf(ie)).call(this,ve,ge));return te.quill.root.addEventListener("paste",te.onPaste.bind(te)),te.container=te.quill.addContainer("ql-clipboard"),te.container.setAttribute("contenteditable",!0),te.container.setAttribute("tabindex",-1),te.matchers=[],G.concat(te.options.matchers).forEach(function(he){var de=o(he,2),we=de[0],_e=de[1];!ge.matchVisual&&_e===ue||te.addMatcher(we,_e)}),te}return l(ie,[{key:"addMatcher",value:function(ge,te){this.matchers.push([ge,te])}},{key:"convert",value:function(ge){if(typeof ge=="string")return this.container.innerHTML=ge.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[C.default.blotName]){var he=this.container.innerText;return this.container.innerHTML="",new S.default().insert(he,M({},C.default.blotName,te[C.default.blotName]))}var de=this.prepareMatching(),we=o(de,2),_e=we[0],Ne=we[1],ke=H(this.container,_e,Ne);return K(ke,`
133
+ `)&&ke.ops[ke.ops.length-1].attributes==null&&(ke=ke.compose(new S.default().retain(ke.length()-1).delete(1))),z.log("convert",this.container.innerHTML,ke),this.container.innerHTML="",ke}},{key:"dangerouslyPasteHTML",value:function(ge,te){var he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;if(typeof ge=="string")this.quill.setContents(this.convert(ge),te),this.quill.setSelection(0,b.default.sources.SILENT);else{var de=this.convert(te);this.quill.updateContents(new S.default().retain(ge).concat(de),he),this.quill.setSelection(ge+de.length(),b.default.sources.SILENT)}}},{key:"onPaste",value:function(ge){var te=this;if(!(ge.defaultPrevented||!this.quill.isEnabled())){var he=this.quill.getSelection(),de=new S.default().retain(he.index),we=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(b.default.sources.SILENT),setTimeout(function(){de=de.concat(te.convert()).delete(he.length),te.quill.updateContents(de,b.default.sources.USER),te.quill.setSelection(de.length()-he.length,b.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=we,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ge=this,te=[],he=[];return this.matchers.forEach(function(de){var we=o(de,2),_e=we[0],Ne=we[1];switch(_e){case Node.TEXT_NODE:he.push(Ne);break;case Node.ELEMENT_NODE:te.push(Ne);break;default:[].forEach.call(ge.container.querySelectorAll(_e),function(ke){ke[F]=ke[F]||[],ke[F].push(Ne)});break}}),[te,he]}}]),ie}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function D(oe,ie,ve){return(typeof ie>"u"?"undefined":a(ie))==="object"?Object.keys(ie).reduce(function(ge,te){return D(ge,te,ie[te])},oe):oe.reduce(function(ge,te){return te.attributes&&te.attributes[ie]?ge.push(te):ge.insert(te.insert,(0,f.default)({},M({},ie,ve),te.attributes))},new S.default)}function $(oe){if(oe.nodeType!==Node.ELEMENT_NODE)return{};var ie="__ql-computed-style";return oe[ie]||(oe[ie]=window.getComputedStyle(oe))}function K(oe,ie){for(var ve="",ge=oe.ops.length-1;ge>=0&&ve.length<ie.length;--ge){var te=oe.ops[ge];if(typeof te.insert!="string")break;ve=te.insert+ve}return ve.slice(-1*ie.length)===ie}function Y(oe){if(oe.childNodes.length===0)return!1;var ie=$(oe);return["block","list-item"].indexOf(ie.display)>-1}function H(oe,ie,ve){return oe.nodeType===oe.TEXT_NODE?ve.reduce(function(ge,te){return te(oe,ge)},new S.default):oe.nodeType===oe.ELEMENT_NODE?[].reduce.call(oe.childNodes||[],function(ge,te){var he=H(te,ie,ve);return te.nodeType===oe.ELEMENT_NODE&&(he=ie.reduce(function(de,we){return we(te,de)},he),he=(te[F]||[]).reduce(function(de,we){return we(te,de)},he)),ge.concat(he)},new S.default):new S.default}function X(oe,ie,ve){return D(ve,oe,!0)}function Z(oe,ie){var ve=p.default.Attributor.Attribute.keys(oe),ge=p.default.Attributor.Class.keys(oe),te=p.default.Attributor.Style.keys(oe),he={};return ve.concat(ge).concat(te).forEach(function(de){var we=p.default.query(de,p.default.Scope.ATTRIBUTE);we!=null&&(he[we.attrName]=we.value(oe),he[we.attrName])||(we=L[de],we!=null&&(we.attrName===de||we.keyName===de)&&(he[we.attrName]=we.value(oe)||void 0),we=I[de],we!=null&&(we.attrName===de||we.keyName===de)&&(we=I[de],he[we.attrName]=we.value(oe)||void 0))}),Object.keys(he).length>0&&(ie=D(ie,he)),ie}function J(oe,ie){var ve=p.default.query(oe);if(ve==null)return ie;if(ve.prototype instanceof p.default.Embed){var ge={},te=ve.value(oe);te!=null&&(ge[ve.blotName]=te,ie=new S.default().insert(ge,ve.formats(oe)))}else typeof ve.formats=="function"&&(ie=D(ie,ve.blotName,ve.formats(oe)));return ie}function ee(oe,ie){return K(ie,`
134
+ `)||ie.insert(`
135
+ `),ie}function re(){return new S.default}function ae(oe,ie){var ve=p.default.query(oe);if(ve==null||ve.blotName!=="list-item"||!K(ie,`
136
+ `))return ie;for(var ge=-1,te=oe.parentNode;!te.classList.contains("ql-clipboard");)(p.default.query(te)||{}).blotName==="list"&&(ge+=1),te=te.parentNode;return ge<=0?ie:ie.compose(new S.default().retain(ie.length()-1).retain(1,{indent:ge}))}function le(oe,ie){return K(ie,`
137
+ `)||(Y(oe)||ie.length()>0&&oe.nextSibling&&Y(oe.nextSibling))&&ie.insert(`
138
+ `),ie}function ue(oe,ie){if(Y(oe)&&oe.nextElementSibling!=null&&!K(ie,`
139
+
140
+ `)){var ve=oe.offsetHeight+parseFloat($(oe).marginTop)+parseFloat($(oe).marginBottom);oe.nextElementSibling.offsetTop>oe.offsetTop+ve*1.5&&ie.insert(`
141
+ `)}return ie}function Ae(oe,ie){var ve={},ge=oe.style||{};return ge.fontStyle&&$(oe).fontStyle==="italic"&&(ve.italic=!0),ge.fontWeight&&($(oe).fontWeight.startsWith("bold")||parseInt($(oe).fontWeight)>=700)&&(ve.bold=!0),Object.keys(ve).length>0&&(ie=D(ie,ve)),parseFloat(ge.textIndent||0)>0&&(ie=new S.default().insert(" ").concat(ie)),ie}function ze(oe,ie){var ve=oe.data;if(oe.parentNode.tagName==="O:P")return ie.insert(ve.trim());if(ve.trim().length===0&&oe.parentNode.classList.contains("ql-clipboard"))return ie;if(!$(oe.parentNode).whiteSpace.startsWith("pre")){var ge=function(he,de){return de=de.replace(/[^\u00a0]/g,""),de.length<1&&he?" ":de};ve=ve.replace(/\r\n/g," ").replace(/\n/g," "),ve=ve.replace(/\s\s+/g,ge.bind(ge,!0)),(oe.previousSibling==null&&Y(oe.parentNode)||oe.previousSibling!=null&&Y(oe.previousSibling))&&(ve=ve.replace(/^\s+/,ge.bind(ge,!1))),(oe.nextSibling==null&&Y(oe.parentNode)||oe.nextSibling!=null&&Y(oe.nextSibling))&&(ve=ve.replace(/\s+$/,ge.bind(ge,!1)))}return ie.insert(ve)}n.default=B,n.matchAttributor=Z,n.matchBlot=J,n.matchNewline=le,n.matchSpacing=ue,n.matchText=ze},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(b,m){for(var g=0;g<m.length;g++){var h=m[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(b,h.key,h)}}return function(b,m,g){return m&&E(b.prototype,m),g&&E(b,g),b}}(),o=function E(b,m,g){b===null&&(b=Function.prototype);var h=Object.getOwnPropertyDescriptor(b,m);if(h===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:E(d,m,g)}else{if("value"in h)return h.value;var y=h.get;return y===void 0?void 0:y.call(g)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function S(E,b){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:E}function _(E,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);E.prototype=Object.create(b&&b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(E,b):E.__proto__=b)}var p=function(E){_(b,E);function b(){return v(this,b),S(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"optimize",value:function(g){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,g),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),b}(u.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function A(R,M){var U=[],V=!0,q=!1,z=void 0;try{for(var F=R[Symbol.iterator](),G;!(V=(G=F.next()).done)&&(U.push(G.value),!(M&&U.length===M));V=!0);}catch(L){q=!0,z=L}finally{try{!V&&F.return&&F.return()}finally{if(q)throw z}}return U}return function(R,M){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return A(R,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(R,M){for(var U=0;U<M.length;U++){var V=M[U];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(R,V.key,V)}}return function(R,M,U){return M&&A(R.prototype,M),U&&A(R,U),R}}(),l=i(2),u=g(l),f=i(0),v=g(f),S=i(5),_=g(S),p=i(10),E=g(p),b=i(9),m=g(b);function g(A){return A&&A.__esModule?A:{default:A}}function h(A,R,M){return R in A?Object.defineProperty(A,R,{value:M,enumerable:!0,configurable:!0,writable:!0}):A[R]=M,A}function d(A,R){if(!(A instanceof R))throw new TypeError("Cannot call a class as a function")}function y(A,R){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:A}function O(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(A,R):A.__proto__=R)}var k=(0,E.default)("quill:toolbar"),C=function(A){O(R,A);function R(M,U){d(this,R);var V=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,M,U));if(Array.isArray(V.options.container)){var q=document.createElement("div");P(q,V.options.container),M.container.parentNode.insertBefore(q,M.container),V.container=q}else typeof V.options.container=="string"?V.container=document.querySelector(V.options.container):V.container=V.options.container;if(!(V.container instanceof HTMLElement)){var z;return z=k.error("Container required for toolbar",V.options),y(V,z)}return V.container.classList.add("ql-toolbar"),V.controls=[],V.handlers={},Object.keys(V.options.handlers).forEach(function(F){V.addHandler(F,V.options.handlers[F])}),[].forEach.call(V.container.querySelectorAll("button, select"),function(F){V.attach(F)}),V.quill.on(_.default.events.EDITOR_CHANGE,function(F,G){F===_.default.events.SELECTION_CHANGE&&V.update(G)}),V.quill.on(_.default.events.SCROLL_OPTIMIZE,function(){var F=V.quill.selection.getRange(),G=a(F,1),L=G[0];V.update(L)}),V}return o(R,[{key:"addHandler",value:function(U,V){this.handlers[U]=V}},{key:"attach",value:function(U){var V=this,q=[].find.call(U.classList,function(F){return F.indexOf("ql-")===0});if(q){if(q=q.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[q]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[q]==null){k.warn("ignoring attaching to disabled format",q,U);return}if(v.default.query(q)==null){k.warn("ignoring attaching to nonexistent format",q,U);return}}var z=U.tagName==="SELECT"?"change":"click";U.addEventListener(z,function(F){var G=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var L=U.options[U.selectedIndex];L.hasAttribute("selected")?G=!1:G=L.value||!1}else U.classList.contains("ql-active")?G=!1:G=U.value||!U.hasAttribute("value"),F.preventDefault();V.quill.focus();var I=V.quill.selection.getRange(),B=a(I,1),D=B[0];if(V.handlers[q]!=null)V.handlers[q].call(V,G);else if(v.default.query(q).prototype instanceof v.default.Embed){if(G=prompt("Enter "+q),!G)return;V.quill.updateContents(new u.default().retain(D.index).delete(D.length).insert(h({},q,G)),_.default.sources.USER)}else V.quill.format(q,G,_.default.sources.USER);V.update(D)}),this.controls.push([q,U])}}},{key:"update",value:function(U){var V=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(q){var z=a(q,2),F=z[0],G=z[1];if(G.tagName==="SELECT"){var L=void 0;if(U==null)L=null;else if(V[F]==null)L=G.querySelector("option[selected]");else if(!Array.isArray(V[F])){var I=V[F];typeof I=="string"&&(I=I.replace(/\"/g,'\\"')),L=G.querySelector('option[value="'+I+'"]')}L==null?(G.value="",G.selectedIndex=-1):L.selected=!0}else if(U==null)G.classList.remove("ql-active");else if(G.hasAttribute("value")){var B=V[F]===G.getAttribute("value")||V[F]!=null&&V[F].toString()===G.getAttribute("value")||V[F]==null&&!G.getAttribute("value");G.classList.toggle("ql-active",B)}else G.classList.toggle("ql-active",V[F]!=null)})}}]),R}(m.default);C.DEFAULTS={};function w(A,R,M){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+R),M!=null&&(U.value=M),A.appendChild(U)}function P(A,R){Array.isArray(R[0])||(R=[R]),R.forEach(function(M){var U=document.createElement("span");U.classList.add("ql-formats"),M.forEach(function(V){if(typeof V=="string")w(U,V);else{var q=Object.keys(V)[0],z=V[q];Array.isArray(z)?x(U,q,z):w(U,q,z)}}),A.appendChild(U)})}function x(A,R,M){var U=document.createElement("select");U.classList.add("ql-"+R),M.forEach(function(V){var q=document.createElement("option");V!==!1?q.setAttribute("value",V):q.setAttribute("selected","selected"),U.appendChild(q)}),A.appendChild(U)}C.DEFAULTS={container:null,handlers:{clean:function(){var R=this,M=this.quill.getSelection();if(M!=null)if(M.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function(V){v.default.query(V,v.default.Scope.INLINE)!=null&&R.quill.format(V,!1)})}else this.quill.removeFormat(M,_.default.sources.USER)},direction:function(R){var M=this.quill.getFormat().align;R==="rtl"&&M==null?this.quill.format("align","right",_.default.sources.USER):!R&&M==="right"&&this.quill.format("align",!1,_.default.sources.USER),this.quill.format("direction",R,_.default.sources.USER)},indent:function(R){var M=this.quill.getSelection(),U=this.quill.getFormat(M),V=parseInt(U.indent||0);if(R==="+1"||R==="-1"){var q=R==="+1"?1:-1;U.direction==="rtl"&&(q*=-1),this.quill.format("indent",V+q,_.default.sources.USER)}},link:function(R){R===!0&&(R=prompt("Enter link URL:")),this.quill.format("link",R,_.default.sources.USER)},list:function(R){var M=this.quill.getSelection(),U=this.quill.getFormat(M);R==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,_.default.sources.USER):this.quill.format("list","unchecked",_.default.sources.USER):this.quill.format("list",R,_.default.sources.USER)}}},n.default=C,n.addControls=P},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 E(b,m){for(var g=0;g<m.length;g++){var h=m[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(b,h.key,h)}}return function(b,m,g){return m&&E(b.prototype,m),g&&E(b,g),b}}(),o=function E(b,m,g){b===null&&(b=Function.prototype);var h=Object.getOwnPropertyDescriptor(b,m);if(h===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:E(d,m,g)}else{if("value"in h)return h.value;var y=h.get;return y===void 0?void 0:y.call(g)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function S(E,b){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:E}function _(E,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);E.prototype=Object.create(b&&b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(E,b):E.__proto__=b)}var p=function(E){_(b,E);function b(m,g){v(this,b);var h=S(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,m));return h.label.innerHTML=g,h.container.classList.add("ql-color-picker"),[].slice.call(h.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),h}return a(b,[{key:"buildItem",value:function(g){var h=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"buildItem",this).call(this,g);return h.style.backgroundColor=g.getAttribute("value")||"",h}},{key:"selectItem",value:function(g,h){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,g,h);var d=this.label.querySelector(".ql-color-label"),y=g&&g.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=y:d.style.fill=y)}}]),b}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(b,m){for(var g=0;g<m.length;g++){var h=m[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(b,h.key,h)}}return function(b,m,g){return m&&E(b.prototype,m),g&&E(b,g),b}}(),o=function E(b,m,g){b===null&&(b=Function.prototype);var h=Object.getOwnPropertyDescriptor(b,m);if(h===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:E(d,m,g)}else{if("value"in h)return h.value;var y=h.get;return y===void 0?void 0:y.call(g)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function S(E,b){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:E}function _(E,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);E.prototype=Object.create(b&&b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(E,b):E.__proto__=b)}var p=function(E){_(b,E);function b(m,g){v(this,b);var h=S(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,m));return h.container.classList.add("ql-icon-picker"),[].forEach.call(h.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=g[d.getAttribute("data-value")||""]}),h.defaultItem=h.container.querySelector(".ql-selected"),h.selectItem(h.defaultItem),h}return a(b,[{key:"selectItem",value:function(g,h){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,g,h),g=g||this.defaultItem,this.label.innerHTML=g.innerHTML}}]),b}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var S=0;S<v.length;S++){var _=v[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(f,_.key,_)}}return function(f,v,S){return v&&u(f.prototype,v),S&&u(f,S),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,v){var S=this;o(this,u),this.quill=f,this.boundsContainer=v||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(){S.root.style.marginTop=-1*S.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(v){var S=v.left+v.width/2-this.root.offsetWidth/2,_=v.bottom+this.quill.root.scrollTop;this.root.style.left=S+"px",this.root.style.top=_+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),E=this.root.getBoundingClientRect(),b=0;if(E.right>p.right&&(b=p.right-E.right,this.root.style.left=S+b+"px"),E.left<p.left&&(b=p.left-E.left,this.root.style.left=S+b+"px"),E.bottom>p.bottom){var m=E.bottom-E.top,g=v.bottom-v.top+m;this.root.style.top=_-g+"px",this.root.classList.add("ql-flip")}return b}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(A,R){var M=[],U=!0,V=!1,q=void 0;try{for(var z=A[Symbol.iterator](),F;!(U=(F=z.next()).done)&&(M.push(F.value),!(R&&M.length===R));U=!0);}catch(G){V=!0,q=G}finally{try{!U&&z.return&&z.return()}finally{if(V)throw q}}return M}return function(A,R){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return x(A,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(A,R,M){A===null&&(A=Function.prototype);var U=Object.getOwnPropertyDescriptor(A,R);if(U===void 0){var V=Object.getPrototypeOf(A);return V===null?void 0:x(V,R,M)}else{if("value"in U)return U.value;var q=U.get;return q===void 0?void 0:q.call(M)}},l=function(){function x(A,R){for(var M=0;M<R.length;M++){var U=R[M];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(A,U.key,U)}}return function(A,R,M){return R&&x(A.prototype,R),M&&x(A,M),A}}(),u=i(3),f=d(u),v=i(8),S=d(v),_=i(43),p=d(_),E=i(27),b=d(E),m=i(15),g=i(41),h=d(g);function d(x){return x&&x.__esModule?x:{default:x}}function y(x,A){if(!(x instanceof A))throw new TypeError("Cannot call a class as a function")}function O(x,A){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:x}function k(x,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);x.prototype=Object.create(A&&A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(x,A):x.__proto__=A)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],w=function(x){k(A,x);function A(R,M){y(this,A),M.modules.toolbar!=null&&M.modules.toolbar.container==null&&(M.modules.toolbar.container=C);var U=O(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R,M));return U.quill.container.classList.add("ql-snow"),U}return l(A,[{key:"extendToolbar",value:function(M){M.container.classList.add("ql-snow"),this.buildButtons([].slice.call(M.container.querySelectorAll("button")),h.default),this.buildPickers([].slice.call(M.container.querySelectorAll("select")),h.default),this.tooltip=new P(this.quill,this.options.bounds),M.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,V){M.handlers.link.call(M,!V.format.link)})}}]),A}(p.default);w.DEFAULTS=(0,f.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){if(A){var R=this.quill.getSelection();if(R==null||R.length==0)return;var M=this.quill.getText(R);/^\S+@\S+\.\S+$/.test(M)&&M.indexOf("mailto:")!==0&&(M="mailto:"+M);var U=this.quill.theme.tooltip;U.edit("link",M)}else this.quill.format("link",!1)}}}}});var P=function(x){k(A,x);function A(R,M){y(this,A);var U=O(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R,M));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(A,[{key:"listen",value:function(){var M=this;o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){M.root.classList.contains("ql-editing")?M.save():M.edit("link",M.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(M.linkRange!=null){var V=M.linkRange;M.restoreFocus(),M.quill.formatText(V,"link",!1,S.default.sources.USER),delete M.linkRange}U.preventDefault(),M.hide()}),this.quill.on(S.default.events.SELECTION_CHANGE,function(U,V,q){if(U!=null){if(U.length===0&&q===S.default.sources.USER){var z=M.quill.scroll.descendant(b.default,U.index),F=a(z,2),G=F[0],L=F[1];if(G!=null){M.linkRange=new m.Range(U.index-L,G.length());var I=b.default.formats(G.domNode);M.preview.textContent=I,M.preview.setAttribute("href",I),M.show(),M.position(M.quill.getBounds(M.linkRange));return}}else delete M.linkRange;M.hide()}})}},{key:"show",value:function(){o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),A}(_.BaseTooltip);P.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=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=te(a),l=i(36),u=i(38),f=i(64),v=i(65),S=te(v),_=i(66),p=te(_),E=i(67),b=te(E),m=i(37),g=i(26),h=i(39),d=i(40),y=i(56),O=te(y),k=i(68),C=te(k),w=i(27),P=te(w),x=i(69),A=te(x),R=i(70),M=te(R),U=i(71),V=te(U),q=i(72),z=te(q),F=i(73),G=te(F),L=i(13),I=te(L),B=i(74),D=te(B),$=i(75),K=te($),Y=i(57),H=te(Y),X=i(41),Z=te(X),J=i(28),ee=te(J),re=i(59),ae=te(re),le=i(60),ue=te(le),Ae=i(61),ze=te(Ae),oe=i(108),ie=te(oe),ve=i(62),ge=te(ve);function te(he){return he&&he.__esModule?he:{default:he}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":m.BackgroundClass,"attributors/class/color":g.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":m.BackgroundStyle,"attributors/style/color":g.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":m.BackgroundStyle,"formats/color":g.ColorStyle,"formats/font":h.FontClass,"formats/size":d.SizeClass,"formats/blockquote":S.default,"formats/code-block":I.default,"formats/header":p.default,"formats/list":b.default,"formats/bold":O.default,"formats/code":L.Code,"formats/italic":C.default,"formats/link":P.default,"formats/script":A.default,"formats/strike":M.default,"formats/underline":V.default,"formats/image":z.default,"formats/video":G.default,"formats/list/item":E.ListItem,"modules/formula":D.default,"modules/syntax":K.default,"modules/toolbar":H.default,"themes/bubble":ie.default,"themes/snow":ge.default,"ui/icons":Z.default,"ui/picker":ee.default,"ui/icon-picker":ue.default,"ui/color-picker":ae.default,"ui/tooltip":ze.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function b(m,g){for(var h=0;h<g.length;h++){var d=g[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(m,d.key,d)}}return function(m,g,h){return g&&b(m.prototype,g),h&&b(m,h),m}}(),o=function b(m,g,h){m===null&&(m=Function.prototype);var d=Object.getOwnPropertyDescriptor(m,g);if(d===void 0){var y=Object.getPrototypeOf(m);return y===null?void 0:b(y,g,h)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(h)}},l=i(0),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function v(b,m){if(!(b instanceof m))throw new TypeError("Cannot call a class as a function")}function S(b,m){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:b}function _(b,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);b.prototype=Object.create(m&&m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(b,m):b.__proto__=m)}var p=function(b){_(m,b);function m(){return v(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"add",value:function(h,d){if(d==="+1"||d==="-1"){var y=this.value(h)||0;d=d==="+1"?y+1:y-1}return d===0?(this.remove(h),!0):o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"add",this).call(this,h,d)}},{key:"canAdd",value:function(h,d){return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,h,d)||o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"canAdd",this).call(this,h,parseInt(d))}},{key:"value",value:function(h){return parseInt(o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,h))||void 0}}]),m}(u.default.Attributor.Class),E=new p("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function f(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function v(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var S=function(_){v(p,_);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);S.blotName="blockquote",S.tagName="blockquote",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(E,b){for(var m=0;m<b.length;m++){var g=b[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}return function(E,b,m){return b&&p(E.prototype,b),m&&p(E,m),E}}(),o=i(4),l=u(o);function u(p){return p&&p.__esModule?p:{default:p}}function f(p,E){if(!(p instanceof E))throw new TypeError("Cannot call a class as a function")}function v(p,E){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:p}function S(p,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);p.prototype=Object.create(E&&E.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(p,E):p.__proto__=E)}var _=function(p){S(E,p);function E(){return f(this,E),v(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"formats",value:function(m){return this.tagName.indexOf(m.tagName)+1}}]),E}(l.default);_.blotName="header",_.tagName=["H1","H2","H3","H4","H5","H6"],n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function y(O,k){for(var C=0;C<k.length;C++){var w=k[C];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(O,w.key,w)}}return function(O,k,C){return k&&y(O.prototype,k),C&&y(O,C),O}}(),o=function y(O,k,C){O===null&&(O=Function.prototype);var w=Object.getOwnPropertyDescriptor(O,k);if(w===void 0){var P=Object.getPrototypeOf(O);return P===null?void 0:y(P,k,C)}else{if("value"in w)return w.value;var x=w.get;return x===void 0?void 0:x.call(C)}},l=i(0),u=p(l),f=i(4),v=p(f),S=i(25),_=p(S);function p(y){return y&&y.__esModule?y:{default:y}}function E(y,O,k){return O in y?Object.defineProperty(y,O,{value:k,enumerable:!0,configurable:!0,writable:!0}):y[O]=k,y}function b(y,O){if(!(y instanceof O))throw new TypeError("Cannot call a class as a function")}function m(y,O){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:y}function g(y,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);y.prototype=Object.create(O&&O.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(y,O):y.__proto__=O)}var h=function(y){g(O,y);function O(){return b(this,O),m(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"format",value:function(C,w){C===d.blotName&&!w?this.replaceWith(u.default.create(this.statics.scope)):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,C,w)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,w){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,w),this):(this.parent.unwrap(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,C,w))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:o(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,C)}}]),O}(v.default);h.blotName="list-item",h.tagName="LI";var d=function(y){g(O,y),a(O,null,[{key:"create",value:function(C){var w=C==="ordered"?"OL":"UL",P=o(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,w);return(C==="checked"||C==="unchecked")&&P.setAttribute("data-checked",C==="checked"),P}},{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 O(k){b(this,O);var C=m(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,k)),w=function(x){if(x.target.parentNode===k){var A=C.statics.formats(k),R=u.default.find(x.target);A==="checked"?R.format("list","unchecked"):A==="unchecked"&&R.format("list","checked")}};return k.addEventListener("touchstart",w),k.addEventListener("mousedown",w),C}return a(O,[{key:"format",value:function(C,w){this.children.length>0&&this.children.tail.format(C,w)}},{key:"formats",value:function(){return E({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,w){if(C instanceof h)o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,C,w);else{var P=w==null?this.length():w.offset(this),x=this.split(P);x.parent.insertBefore(C,x)}}},{key:"optimize",value:function(C){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,C);var w=this.next;w!=null&&w.prev===this&&w.statics.blotName===this.statics.blotName&&w.domNode.tagName===this.domNode.tagName&&w.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(w.moveChildren(this),w.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var w=u.default.create(this.statics.defaultChild);C.moveChildren(w),this.appendChild(w)}o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,C)}}]),O}(_.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[h],n.ListItem=h,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function f(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function v(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var S=function(_){v(p,_);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);S.blotName="italic",S.tagName=["EM","I"],n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(b,m){for(var g=0;g<m.length;g++){var h=m[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(b,h.key,h)}}return function(b,m,g){return m&&E(b.prototype,m),g&&E(b,g),b}}(),o=function E(b,m,g){b===null&&(b=Function.prototype);var h=Object.getOwnPropertyDescriptor(b,m);if(h===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:E(d,m,g)}else{if("value"in h)return h.value;var y=h.get;return y===void 0?void 0:y.call(g)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function S(E,b){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:E}function _(E,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);E.prototype=Object.create(b&&b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(E,b):E.__proto__=b)}var p=function(E){_(b,E);function b(){return v(this,b),S(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"create",value:function(g){return g==="super"?document.createElement("sup"):g==="sub"?document.createElement("sub"):o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,g)}},{key:"formats",value:function(g){if(g.tagName==="SUB")return"sub";if(g.tagName==="SUP")return"super"}}]),b}(u.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function f(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function v(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var S=function(_){v(p,_);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);S.blotName="strike",S.tagName="S",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function f(_,p){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:_}function v(_,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);_.prototype=Object.create(p&&p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(_,p):_.__proto__=p)}var S=function(_){v(p,_);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);S.blotName="underline",S.tagName="U",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(g,h){for(var d=0;d<h.length;d++){var y=h[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,h,d){return h&&m(g.prototype,h),d&&m(g,d),g}}(),o=function m(g,h,d){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,h);if(y===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:m(O,h,d)}else{if("value"in y)return y.value;var k=y.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=v(l),f=i(27);function v(m){return m&&m.__esModule?m:{default:m}}function S(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function _(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function p(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var E=["alt","height","width"],b=function(m){p(g,m);function g(){return S(this,g),_(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"format",value:function(d,y){E.indexOf(d)>-1?y?this.domNode.setAttribute(d,y):this.domNode.removeAttribute(d):o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,d,y)}}],[{key:"create",value:function(d){var y=o(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,d);return typeof d=="string"&&y.setAttribute("src",this.sanitize(d)),y}},{key:"formats",value:function(d){return E.reduce(function(y,O){return d.hasAttribute(O)&&(y[O]=d.getAttribute(O)),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")}}]),g}(u.default.Embed);b.blotName="image",b.tagName="IMG",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(g,h){for(var d=0;d<h.length;d++){var y=h[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,h,d){return h&&m(g.prototype,h),d&&m(g,d),g}}(),o=function m(g,h,d){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,h);if(y===void 0){var O=Object.getPrototypeOf(g);return O===null?void 0:m(O,h,d)}else{if("value"in y)return y.value;var k=y.get;return k===void 0?void 0:k.call(d)}},l=i(4),u=i(27),f=v(u);function v(m){return m&&m.__esModule?m:{default:m}}function S(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function _(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function p(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var E=["height","width"],b=function(m){p(g,m);function g(){return S(this,g),_(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"format",value:function(d,y){E.indexOf(d)>-1?y?this.domNode.setAttribute(d,y):this.domNode.removeAttribute(d):o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,d,y)}}],[{key:"create",value:function(d){var y=o(g.__proto__||Object.getPrototypeOf(g),"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 E.reduce(function(y,O){return d.hasAttribute(O)&&(y[O]=d.getAttribute(O)),y},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),g}(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,O){for(var k=0;k<O.length;k++){var C=O[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(y,C.key,C)}}return function(y,O,k){return O&&d(y.prototype,O),k&&d(y,k),y}}(),o=function d(y,O,k){y===null&&(y=Function.prototype);var C=Object.getOwnPropertyDescriptor(y,O);if(C===void 0){var w=Object.getPrototypeOf(y);return w===null?void 0:d(w,O,k)}else{if("value"in C)return C.value;var P=C.get;return P===void 0?void 0:P.call(k)}},l=i(35),u=p(l),f=i(5),v=p(f),S=i(9),_=p(S);function p(d){return d&&d.__esModule?d:{default:d}}function E(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 m(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){m(y,d);function y(){return E(this,y),b(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"create",value:function(k){var C=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,k);return typeof k=="string"&&(window.katex.render(k,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",k)),C}},{key:"value",value:function(k){return k.getAttribute("data-value")}}]),y}(u.default);g.blotName="formula",g.className="ql-formula",g.tagName="SPAN";var h=function(d){m(y,d),a(y,null,[{key:"register",value:function(){v.default.register(g,!0)}}]);function y(){E(this,y);var O=b(this,(y.__proto__||Object.getPrototypeOf(y)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return y}(_.default);n.FormulaBlot=g,n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function k(C,w){for(var P=0;P<w.length;P++){var x=w[P];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(C,x.key,x)}}return function(C,w,P){return w&&k(C.prototype,w),P&&k(C,P),C}}(),o=function k(C,w,P){C===null&&(C=Function.prototype);var x=Object.getOwnPropertyDescriptor(C,w);if(x===void 0){var A=Object.getPrototypeOf(C);return A===null?void 0:k(A,w,P)}else{if("value"in x)return x.value;var R=x.get;return R===void 0?void 0:R.call(P)}},l=i(0),u=b(l),f=i(5),v=b(f),S=i(9),_=b(S),p=i(13),E=b(p);function b(k){return k&&k.__esModule?k:{default:k}}function m(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}function g(k,C){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:k}function h(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);k.prototype=Object.create(C&&C.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(k,C):k.__proto__=C)}var d=function(k){h(C,k);function C(){return m(this,C),g(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return a(C,[{key:"replaceWith",value:function(P){this.domNode.textContent=this.domNode.textContent,this.attach(),o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,P)}},{key:"highlight",value:function(P){var x=this.domNode.textContent;this.cachedText!==x&&((x.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=P(x),this.domNode.normalize(),this.attach()),this.cachedText=x)}}]),C}(E.default);d.className="ql-syntax";var y=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),O=function(k){h(C,k),a(C,null,[{key:"register",value:function(){v.default.register(y,!0),v.default.register(d,!0)}}]);function C(w,P){m(this,C);var x=g(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,w,P));if(typeof x.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return x.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){x.highlight(),A=null},x.options.interval)}),x.highlight(),x}return a(C,[{key:"highlight",value:function(){var P=this;if(!this.quill.selection.composing){this.quill.update(v.default.sources.USER);var x=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(A){A.highlight(P.options.highlight)}),this.quill.update(v.default.sources.SILENT),x!=null&&this.quill.setSelection(x,v.default.sources.SILENT)}}}]),C}(_.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(k){var C=window.hljs.highlightAuto(k);return C.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=y,n.default=O},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(w,P,x){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,P);if(A===void 0){var R=Object.getPrototypeOf(w);return R===null?void 0:C(R,P,x)}else{if("value"in A)return A.value;var M=A.get;return M===void 0?void 0:M.call(x)}},o=function(){function C(w,P){for(var x=0;x<P.length;x++){var A=P[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}return function(w,P,x){return P&&C(w.prototype,P),x&&C(w,x),w}}(),l=i(3),u=m(l),f=i(8),v=m(f),S=i(43),_=m(S),p=i(15),E=i(41),b=m(E);function m(C){return C&&C.__esModule?C:{default:C}}function g(C,w){if(!(C instanceof w))throw new TypeError("Cannot call a class as a function")}function h(C,w){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:C}function d(C,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);C.prototype=Object.create(w&&w.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(C,w):C.__proto__=w)}var y=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(C){d(w,C);function w(P,x){g(this,w),x.modules.toolbar!=null&&x.modules.toolbar.container==null&&(x.modules.toolbar.container=y);var A=h(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,P,x));return A.quill.container.classList.add("ql-bubble"),A}return o(w,[{key:"extendToolbar",value:function(x){this.tooltip=new k(this.quill,this.options.bounds),this.tooltip.root.appendChild(x.container),this.buildButtons([].slice.call(x.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(x.container.querySelectorAll("select")),b.default)}}]),w}(_.default);O.DEFAULTS=(0,u.default)(!0,{},_.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(w){w?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var k=function(C){d(w,C);function w(P,x){g(this,w);var A=h(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,P,x));return A.quill.on(v.default.events.EDITOR_CHANGE,function(R,M,U,V){if(R===v.default.events.SELECTION_CHANGE)if(M!=null&&M.length>0&&V===v.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var q=A.quill.getLines(M.index,M.length);if(q.length===1)A.position(A.quill.getBounds(M));else{var z=q[q.length-1],F=A.quill.getIndex(z),G=Math.min(z.length()-1,M.index+M.length-F),L=A.quill.getBounds(new p.Range(F,G));A.position(L)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return o(w,[{key:"listen",value:function(){var x=this;a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){x.root.classList.remove("ql-editing")}),this.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!x.root.classList.contains("ql-hidden")){var A=x.quill.getSelection();A!=null&&x.position(x.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(x){var A=a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"position",this).call(this,x),R=this.root.querySelector(".ql-tooltip-arrow");if(R.style.marginLeft="",A===0)return A;R.style.marginLeft=-1*A-R.offsetWidth/2+"px"}}]),w}(S.BaseTooltip);k.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=k,n.default=O},function(r,n,i){r.exports=i(63)}]).default})})(pS);var gS=pS.exports,wD={exports:{}};(function(e,t){(function(r,n){e.exports=n(gS)})(window,function(r){return function(n){var i={};function a(o){if(i[o])return i[o].exports;var l=i[o]={i:o,l:!1,exports:{}};return n[o].call(l.exports,l,l.exports,a),l.l=!0,l.exports}return a.m=n,a.c=i,a.d=function(o,l,u){a.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:u})},a.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,l){if(1&l&&(o=a(o)),8&l||4&l&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(a.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),2&l&&typeof o!="string")for(var f in o)a.d(u,f,(function(v){return o[v]}).bind(null,f));return u},a.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(l,"a",l),l},a.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},a.p="",a(a.s=2)}([function(n,i,a){/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */n.exports=function(){const{entries:o,setPrototypeOf:l,isFrozen:u,getPrototypeOf:f,getOwnPropertyDescriptor:v}=Object;let{freeze:S,seal:_,create:p}=Object,{apply:E,construct:b}=typeof Reflect<"u"&&Reflect;E||(E=function(ie,ve,ge){return ie.apply(ve,ge)}),S||(S=function(ie){return ie}),_||(_=function(ie){return ie}),b||(b=function(ie,ve){return new ie(...ve)});const m=R(Array.prototype.forEach),g=R(Array.prototype.pop),h=R(Array.prototype.push),d=R(String.prototype.toLowerCase),y=R(String.prototype.toString),O=R(String.prototype.match),k=R(String.prototype.replace),C=R(String.prototype.indexOf),w=R(String.prototype.trim),P=R(RegExp.prototype.test),x=(A=TypeError,function(){for(var ie=arguments.length,ve=new Array(ie),ge=0;ge<ie;ge++)ve[ge]=arguments[ge];return b(A,ve)});var A;function R(ie){return function(ve){for(var ge=arguments.length,te=new Array(ge>1?ge-1:0),he=1;he<ge;he++)te[he-1]=arguments[he];return E(ie,ve,te)}}function M(ie,ve,ge){var te;ge=(te=ge)!==null&&te!==void 0?te:d,l&&l(ie,null);let he=ve.length;for(;he--;){let de=ve[he];if(typeof de=="string"){const we=ge(de);we!==de&&(u(ve)||(ve[he]=we),de=we)}ie[de]=!0}return ie}function U(ie){const ve=p(null);for(const[ge,te]of o(ie))ve[ge]=te;return ve}function V(ie,ve){for(;ie!==null;){const ge=v(ie,ve);if(ge){if(ge.get)return R(ge.get);if(typeof ge.value=="function")return R(ge.value)}ie=f(ie)}return function(ge){return console.warn("fallback value for",ge),null}}const q=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),z=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),G=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),L=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=S(["#text"]),D=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),$=S(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),K=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Y=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=_(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=_(/<%[\w\W]*|[\w\W]*%>/gm),Z=_(/\${[\w\W]*}/gm),J=_(/^data-[\-\w.\u00B7-\uFFFF]/),ee=_(/^aria-[\-\w]+$/),re=_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ae=_(/^(?:\w+script|data):/i),le=_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ue=_(/^html$/i);var Ae=Object.freeze({__proto__:null,MUSTACHE_EXPR:H,ERB_EXPR:X,TMPLIT_EXPR:Z,DATA_ATTR:J,ARIA_ATTR:ee,IS_ALLOWED_URI:re,IS_SCRIPT_OR_DATA:ae,ATTR_WHITESPACE:le,DOCTYPE_NAME:ue});const ze=()=>typeof window>"u"?null:window,oe=function(ie,ve){if(typeof ie!="object"||typeof ie.createPolicy!="function")return null;let ge=null;ve&&ve.hasAttribute("data-tt-policy-suffix")&&(ge=ve.getAttribute("data-tt-policy-suffix"));const te="dompurify"+(ge?"#"+ge:"");try{return ie.createPolicy(te,{createHTML:he=>he,createScriptURL:he=>he})}catch{return console.warn("TrustedTypes policy "+te+" could not be created."),null}};return function ie(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ze();const ge=ne=>ie(ne);if(ge.version="3.0.5",ge.removed=[],!ve||!ve.document||ve.document.nodeType!==9)return ge.isSupported=!1,ge;const te=ve.document,he=te.currentScript;let{document:de}=ve;const{DocumentFragment:we,HTMLTemplateElement:_e,Node:Ne,Element:ke,NodeFilter:tt,NamedNodeMap:ot=ve.NamedNodeMap||ve.MozNamedAttrMap,HTMLFormElement:gt,DOMParser:Bt,trustedTypes:fe}=ve,pe=ke.prototype,nt=V(pe,"cloneNode"),Oe=V(pe,"nextSibling"),Fe=V(pe,"childNodes"),Le=V(pe,"parentNode");if(typeof _e=="function"){const ne=de.createElement("template");ne.content&&ne.content.ownerDocument&&(de=ne.content.ownerDocument)}let Ee,Ze="";const{implementation:Pe,createNodeIterator:Ye,createDocumentFragment:Sr,getElementsByTagName:xe}=de,{importNode:He}=te;let Qe={};ge.isSupported=typeof o=="function"&&typeof Le=="function"&&Pe&&Pe.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Et,ERB_EXPR:Pt,TMPLIT_EXPR:ar,DATA_ATTR:Rr,ARIA_ATTR:Lr,IS_SCRIPT_OR_DATA:ln,ATTR_WHITESPACE:De}=Ae;let{IS_ALLOWED_URI:rt}=Ae,Xe=null;const kt=M({},[...q,...z,...F,...L,...B]);let Je=null;const fr=M({},[...D,...$,...K,...Y]);let dt=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$t=null,Br=null,vr=!0,Mr=!0,Mn=!1,mi=!0,mn=!1,sn=!1,Kn=!1,Ka=!1,yi=!1,Kl=!1,Xa=!1,Za=!0,Xl=!1;const ku="user-content-";let Ru=!0,va=!1,Nn={},un=null;const Nt=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Rt=null;const bi=M({},["audio","video","img","source","image","track"]);let mr=null;const Ur=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xn="http://www.w3.org/1998/Math/MathML",_i="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let wi=Yt,Zl=!1,Ql=null;const Jl=M({},[Xn,_i,Yt],y);let ma;const In=["application/xhtml+xml","text/html"],E0="text/html";let yr,Qa=null;const es=de.createElement("form"),Xo=function(ne){return ne instanceof RegExp||ne instanceof Function},ya=function(ne){if(!Qa||Qa!==ne){if(ne&&typeof ne=="object"||(ne={}),ne=U(ne),ma=ma=In.indexOf(ne.PARSER_MEDIA_TYPE)===-1?E0:ne.PARSER_MEDIA_TYPE,yr=ma==="application/xhtml+xml"?y:d,Xe="ALLOWED_TAGS"in ne?M({},ne.ALLOWED_TAGS,yr):kt,Je="ALLOWED_ATTR"in ne?M({},ne.ALLOWED_ATTR,yr):fr,Ql="ALLOWED_NAMESPACES"in ne?M({},ne.ALLOWED_NAMESPACES,y):Jl,mr="ADD_URI_SAFE_ATTR"in ne?M(U(Ur),ne.ADD_URI_SAFE_ATTR,yr):Ur,Rt="ADD_DATA_URI_TAGS"in ne?M(U(bi),ne.ADD_DATA_URI_TAGS,yr):bi,un="FORBID_CONTENTS"in ne?M({},ne.FORBID_CONTENTS,yr):Nt,$t="FORBID_TAGS"in ne?M({},ne.FORBID_TAGS,yr):{},Br="FORBID_ATTR"in ne?M({},ne.FORBID_ATTR,yr):{},Nn="USE_PROFILES"in ne&&ne.USE_PROFILES,vr=ne.ALLOW_ARIA_ATTR!==!1,Mr=ne.ALLOW_DATA_ATTR!==!1,Mn=ne.ALLOW_UNKNOWN_PROTOCOLS||!1,mi=ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,mn=ne.SAFE_FOR_TEMPLATES||!1,sn=ne.WHOLE_DOCUMENT||!1,yi=ne.RETURN_DOM||!1,Kl=ne.RETURN_DOM_FRAGMENT||!1,Xa=ne.RETURN_TRUSTED_TYPE||!1,Ka=ne.FORCE_BODY||!1,Za=ne.SANITIZE_DOM!==!1,Xl=ne.SANITIZE_NAMED_PROPS||!1,Ru=ne.KEEP_CONTENT!==!1,va=ne.IN_PLACE||!1,rt=ne.ALLOWED_URI_REGEXP||re,wi=ne.NAMESPACE||Yt,dt=ne.CUSTOM_ELEMENT_HANDLING||{},ne.CUSTOM_ELEMENT_HANDLING&&Xo(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(dt.tagNameCheck=ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&Xo(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(dt.attributeNameCheck=ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(dt.allowCustomizedBuiltInElements=ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),mn&&(Mr=!1),Kl&&(yi=!0),Nn&&(Xe=M({},[...B]),Je=[],Nn.html===!0&&(M(Xe,q),M(Je,D)),Nn.svg===!0&&(M(Xe,z),M(Je,$),M(Je,Y)),Nn.svgFilters===!0&&(M(Xe,F),M(Je,$),M(Je,Y)),Nn.mathMl===!0&&(M(Xe,L),M(Je,K),M(Je,Y))),ne.ADD_TAGS&&(Xe===kt&&(Xe=U(Xe)),M(Xe,ne.ADD_TAGS,yr)),ne.ADD_ATTR&&(Je===fr&&(Je=U(Je)),M(Je,ne.ADD_ATTR,yr)),ne.ADD_URI_SAFE_ATTR&&M(mr,ne.ADD_URI_SAFE_ATTR,yr),ne.FORBID_CONTENTS&&(un===Nt&&(un=U(un)),M(un,ne.FORBID_CONTENTS,yr)),Ru&&(Xe["#text"]=!0),sn&&M(Xe,["html","head","body"]),Xe.table&&(M(Xe,["tbody"]),delete $t.tbody),ne.TRUSTED_TYPES_POLICY){if(typeof ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Ee=ne.TRUSTED_TYPES_POLICY,Ze=Ee.createHTML("")}else Ee===void 0&&(Ee=oe(fe,he)),Ee!==null&&typeof Ze=="string"&&(Ze=Ee.createHTML(""));S&&S(ne),Qa=ne}},Zo=M({},["mi","mo","mn","ms","mtext"]),Cf=M({},["foreignobject","desc","title","annotation-xml"]),O0=M({},["title","style","font","a","script"]),Ja=M({},z);M(Ja,F),M(Ja,G);const ts=M({},L);M(ts,I);const Lu=function(ne){let Te=Le(ne);Te&&Te.tagName||(Te={namespaceURI:wi,tagName:"template"});const Ie=d(ne.tagName),ft=d(Te.tagName);return!!Ql[ne.namespaceURI]&&(ne.namespaceURI===_i?Te.namespaceURI===Yt?Ie==="svg":Te.namespaceURI===Xn?Ie==="svg"&&(ft==="annotation-xml"||Zo[ft]):!!Ja[Ie]:ne.namespaceURI===Xn?Te.namespaceURI===Yt?Ie==="math":Te.namespaceURI===_i?Ie==="math"&&Cf[ft]:!!ts[Ie]:ne.namespaceURI===Yt?!(Te.namespaceURI===_i&&!Cf[ft])&&!(Te.namespaceURI===Xn&&!Zo[ft])&&!ts[Ie]&&(O0[Ie]||!Ja[Ie]):!(ma!=="application/xhtml+xml"||!Ql[ne.namespaceURI]))},Dn=function(ne){h(ge.removed,{element:ne});try{ne.parentNode.removeChild(ne)}catch{ne.remove()}},Mu=function(ne,Te){try{h(ge.removed,{attribute:Te.getAttributeNode(ne),from:Te})}catch{h(ge.removed,{attribute:null,from:Te})}if(Te.removeAttribute(ne),ne==="is"&&!Je[ne])if(yi||Kl)try{Dn(Te)}catch{}else try{Te.setAttribute(ne,"")}catch{}},rs=function(ne){let Te,Ie;if(Ka)ne="<remove></remove>"+ne;else{const Kr=O(ne,/^[\r\n\t ]+/);Ie=Kr&&Kr[0]}ma==="application/xhtml+xml"&&wi===Yt&&(ne='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ne+"</body></html>");const ft=Ee?Ee.createHTML(ne):ne;if(wi===Yt)try{Te=new Bt().parseFromString(ft,ma)}catch{}if(!Te||!Te.documentElement){Te=Pe.createDocument(wi,"template",null);try{Te.documentElement.innerHTML=Zl?Ze:ft}catch{}}const or=Te.body||Te.documentElement;return ne&&Ie&&or.insertBefore(de.createTextNode(Ie),or.childNodes[0]||null),wi===Yt?xe.call(Te,sn?"html":"body")[0]:sn?Te.documentElement:or},wt=function(ne){return Ye.call(ne.ownerDocument||ne,ne,tt.SHOW_ELEMENT|tt.SHOW_COMMENT|tt.SHOW_TEXT,null,!1)},Tf=function(ne){return ne instanceof gt&&(typeof ne.nodeName!="string"||typeof ne.textContent!="string"||typeof ne.removeChild!="function"||!(ne.attributes instanceof ot)||typeof ne.removeAttribute!="function"||typeof ne.setAttribute!="function"||typeof ne.namespaceURI!="string"||typeof ne.insertBefore!="function"||typeof ne.hasChildNodes!="function")},eo=function(ne){return typeof Ne=="object"?ne instanceof Ne:ne&&typeof ne=="object"&&typeof ne.nodeType=="number"&&typeof ne.nodeName=="string"},Zn=function(ne,Te,Ie){Qe[ne]&&m(Qe[ne],ft=>{ft.call(ge,Te,Ie,Qa)})},Af=function(ne){let Te;if(Zn("beforeSanitizeElements",ne,null),Tf(ne))return Dn(ne),!0;const Ie=yr(ne.nodeName);if(Zn("uponSanitizeElement",ne,{tagName:Ie,allowedTags:Xe}),ne.hasChildNodes()&&!eo(ne.firstElementChild)&&(!eo(ne.content)||!eo(ne.content.firstElementChild))&&P(/<[/\w]/g,ne.innerHTML)&&P(/<[/\w]/g,ne.textContent))return Dn(ne),!0;if(!Xe[Ie]||$t[Ie]){if(!$t[Ie]&&dr(Ie)&&(dt.tagNameCheck instanceof RegExp&&P(dt.tagNameCheck,Ie)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(Ie)))return!1;if(Ru&&!un[Ie]){const ft=Le(ne)||ne.parentNode,or=Fe(ne)||ne.childNodes;if(or&&ft)for(let Kr=or.length-1;Kr>=0;--Kr)ft.insertBefore(nt(or[Kr],!0),Oe(ne))}return Dn(ne),!0}return ne instanceof ke&&!Lu(ne)?(Dn(ne),!0):Ie!=="noscript"&&Ie!=="noembed"&&Ie!=="noframes"||!P(/<\/no(script|embed|frames)/i,ne.innerHTML)?(mn&&ne.nodeType===3&&(Te=ne.textContent,Te=k(Te,Et," "),Te=k(Te,Pt," "),Te=k(Te,ar," "),ne.textContent!==Te&&(h(ge.removed,{element:ne.cloneNode()}),ne.textContent=Te)),Zn("afterSanitizeElements",ne,null),!1):(Dn(ne),!0)},kf=function(ne,Te,Ie){if(Za&&(Te==="id"||Te==="name")&&(Ie in de||Ie in es))return!1;if(!(Mr&&!Br[Te]&&P(Rr,Te))){if(!(vr&&P(Lr,Te))){if(!Je[Te]||Br[Te]){if(!(dr(ne)&&(dt.tagNameCheck instanceof RegExp&&P(dt.tagNameCheck,ne)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(ne))&&(dt.attributeNameCheck instanceof RegExp&&P(dt.attributeNameCheck,Te)||dt.attributeNameCheck instanceof Function&&dt.attributeNameCheck(Te))||Te==="is"&&dt.allowCustomizedBuiltInElements&&(dt.tagNameCheck instanceof RegExp&&P(dt.tagNameCheck,Ie)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(Ie))))return!1}else if(!mr[Te]){if(!P(rt,k(Ie,De,""))){if((Te!=="src"&&Te!=="xlink:href"&&Te!=="href"||ne==="script"||C(Ie,"data:")!==0||!Rt[ne])&&!(Mn&&!P(ln,k(Ie,De,"")))){if(Ie)return!1}}}}}return!0},dr=function(ne){return ne.indexOf("-")>0},ns=function(ne){let Te,Ie,ft,or;Zn("beforeSanitizeAttributes",ne,null);const{attributes:Kr}=ne;if(!Kr)return;const lr={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Je};for(or=Kr.length;or--;){Te=Kr[or];const{name:It,namespaceURI:Si}=Te;if(Ie=It==="value"?Te.value:w(Te.value),ft=yr(It),lr.attrName=ft,lr.attrValue=Ie,lr.keepAttr=!0,lr.forceKeepAttr=void 0,Zn("uponSanitizeAttribute",ne,lr),Ie=lr.attrValue,lr.forceKeepAttr||(Mu(It,ne),!lr.keepAttr))continue;if(!mi&&P(/\/>/i,Ie)){Mu(It,ne);continue}mn&&(Ie=k(Ie,Et," "),Ie=k(Ie,Pt," "),Ie=k(Ie,ar," "));const is=yr(ne.nodeName);if(kf(is,ft,Ie)){if(!Xl||ft!=="id"&&ft!=="name"||(Mu(It,ne),Ie=ku+Ie),Ee&&typeof fe=="object"&&typeof fe.getAttributeType=="function"&&!Si)switch(fe.getAttributeType(is,ft)){case"TrustedHTML":Ie=Ee.createHTML(Ie);break;case"TrustedScriptURL":Ie=Ee.createScriptURL(Ie)}try{Si?ne.setAttributeNS(Si,It,Ie):ne.setAttribute(It,Ie),g(ge.removed)}catch{}}}Zn("afterSanitizeAttributes",ne,null)},P0=function ne(Te){let Ie;const ft=wt(Te);for(Zn("beforeSanitizeShadowDOM",Te,null);Ie=ft.nextNode();)Zn("uponSanitizeShadowNode",Ie,null),Af(Ie)||(Ie.content instanceof we&&ne(Ie.content),ns(Ie));Zn("afterSanitizeShadowDOM",Te,null)};return ge.sanitize=function(ne){let Te,Ie,ft,or,Kr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Zl=!ne,Zl&&(ne="<!-->"),typeof ne!="string"&&!eo(ne)){if(typeof ne.toString!="function")throw x("toString is not a function");if(typeof(ne=ne.toString())!="string")throw x("dirty is not a string, aborting")}if(!ge.isSupported)return ne;if(Kn||ya(Kr),ge.removed=[],typeof ne=="string"&&(va=!1),va){if(ne.nodeName){const Si=yr(ne.nodeName);if(!Xe[Si]||$t[Si])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(ne instanceof Ne)Te=rs("<!---->"),Ie=Te.ownerDocument.importNode(ne,!0),Ie.nodeType===1&&Ie.nodeName==="BODY"||Ie.nodeName==="HTML"?Te=Ie:Te.appendChild(Ie);else{if(!yi&&!mn&&!sn&&ne.indexOf("<")===-1)return Ee&&Xa?Ee.createHTML(ne):ne;if(Te=rs(ne),!Te)return yi?null:Xa?Ze:""}Te&&Ka&&Dn(Te.firstChild);const lr=wt(va?ne:Te);for(;ft=lr.nextNode();)Af(ft)||(ft.content instanceof we&&P0(ft.content),ns(ft));if(va)return ne;if(yi){if(Kl)for(or=Sr.call(Te.ownerDocument);Te.firstChild;)or.appendChild(Te.firstChild);else or=Te;return(Je.shadowroot||Je.shadowrootmode)&&(or=He.call(te,or,!0)),or}let It=sn?Te.outerHTML:Te.innerHTML;return sn&&Xe["!doctype"]&&Te.ownerDocument&&Te.ownerDocument.doctype&&Te.ownerDocument.doctype.name&&P(ue,Te.ownerDocument.doctype.name)&&(It="<!DOCTYPE "+Te.ownerDocument.doctype.name+`>
142
+ `+It),mn&&(It=k(It,Et," "),It=k(It,Pt," "),It=k(It,ar," ")),Ee&&Xa?Ee.createHTML(It):It},ge.setConfig=function(ne){ya(ne),Kn=!0},ge.clearConfig=function(){Qa=null,Kn=!1},ge.isValidAttribute=function(ne,Te,Ie){Qa||ya({});const ft=yr(ne),or=yr(Te);return kf(ft,or,Ie)},ge.addHook=function(ne,Te){typeof Te=="function"&&(Qe[ne]=Qe[ne]||[],h(Qe[ne],Te))},ge.removeHook=function(ne){if(Qe[ne])return g(Qe[ne])},ge.removeHooks=function(ne){Qe[ne]&&(Qe[ne]=[])},ge.removeAllHooks=function(){Qe={}},ge}()}()},function(n,i){n.exports=r},function(n,i,a){a.r(i);var o=a(1),l=a.n(o),u=a(0),f=a.n(u);function v(k){return(v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(k)}function S(k,C){var w=Object.keys(k);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(k);C&&(P=P.filter(function(x){return Object.getOwnPropertyDescriptor(k,x).enumerable})),w.push.apply(w,P)}return w}function _(k){for(var C=1;C<arguments.length;C++){var w=arguments[C]!=null?arguments[C]:{};C%2?S(Object(w),!0).forEach(function(P){p(k,P,w[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(w)):S(Object(w)).forEach(function(P){Object.defineProperty(k,P,Object.getOwnPropertyDescriptor(w,P))})}return k}function p(k,C,w){return C in k?Object.defineProperty(k,C,{value:w,enumerable:!0,configurable:!0,writable:!0}):k[C]=w,k}function E(k,C){for(var w=0;w<C.length;w++){var P=C[w];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(k,P.key,P)}}function b(k,C){return(b=Object.setPrototypeOf||function(w,P){return w.__proto__=P,w})(k,C)}function m(k){var C=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var w,P=h(k);if(C){var x=h(this).constructor;w=Reflect.construct(P,arguments,x)}else w=P.apply(this,arguments);return g(this,w)}}function g(k,C){return!C||v(C)!=="object"&&typeof C!="function"?function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}(k):C}function h(k){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)})(k)}var d=l.a.import("modules/clipboard"),y=l.a.import("delta"),O=function(k){(function(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),R&&b(A,R)})(x,k);var C,w,P=m(x);function x(A,R){var M;return function(U,V){if(!(U instanceof V))throw new TypeError("Cannot call a class as a function")}(this,x),(M=P.call(this,A,R)).allowed=R.allowed,M.keepSelection=R.keepSelection,M.substituteBlockElements=R.substituteBlockElements,M.magicPasteLinks=R.magicPasteLinks,M.hooks=R.hooks,M}return C=x,(w=[{key:"onPaste",value:function(A){var R=this;A.preventDefault();var M,U,V,q,z,F=this.quill.getSelection();A.clipboardData&&A.clipboardData.getData||!window.clipboardData||!window.clipboardData.getData?(M=A.clipboardData.getData("text/plain"),U=A.clipboardData.getData("text/html"),V=(q=A.clipboardData)===null||q===void 0||(z=q.items)===null||z===void 0?void 0:z[0]):M=window.clipboardData.getData("Text");var G=new y().retain(F.index).delete(F.length),L=this.getDOMPurifyOptions(),I=!1,B=M;if(!U&&L.ALLOWED_TAGS.includes("a")&&this.isURL(M)&&F.length>0&&this.magicPasteLinks)B=this.quill.getText(F.index,F.length),G=G.insert(B,{link:M});else if(!U&&L.ALLOWED_TAGS.includes("img")&&V&&V.kind==="file"&&V.type.match(/^image\//i)){var D=V.getAsFile(),$=new FileReader;$.onload=function(le){R.quill.insertEmbed(F.index,"image",le.target.result),R.keepSelection||R.quill.setSelection(F.index+1)},$.readAsDataURL(D)}else{var K,Y,H,X,Z,J,ee,re,ae;U||(I=!0,U=B),typeof((K=this.hooks)===null||K===void 0?void 0:K.beforeSanitizeElements)=="function"&&f.a.addHook("beforeSanitizeElements",this.hooks.beforeSanitizeElements),typeof((Y=this.hooks)===null||Y===void 0?void 0:Y.uponSanitizeElement)=="function"&&f.a.addHook("uponSanitizeElement",this.hooks.uponSanitizeElement),typeof((H=this.hooks)===null||H===void 0?void 0:H.afterSanitizeElements)=="function"&&f.a.addHook("afterSanitizeElements",this.hooks.afterSanitizeElements),typeof((X=this.hooks)===null||X===void 0?void 0:X.beforeSanitizeAttributes)=="function"&&f.a.addHook("beforeSanitizeAttributes",this.hooks.beforeSanitizeAttributes),typeof((Z=this.hooks)===null||Z===void 0?void 0:Z.uponSanitizeAttribute)=="function"&&f.a.addHook("uponSanitizeAttribute",this.hooks.uponSanitizeAttribute),typeof((J=this.hooks)===null||J===void 0?void 0:J.afterSanitizeAttributes)=="function"&&f.a.addHook("afterSanitizeAttributes",this.hooks.afterSanitizeAttributes),typeof((ee=this.hooks)===null||ee===void 0?void 0:ee.beforeSanitizeShadowDOM)=="function"&&f.a.addHook("beforeSanitizeShadowDOM",this.hooks.beforeSanitizeShadowDOM),typeof((re=this.hooks)===null||re===void 0?void 0:re.uponSanitizeShadowNode)=="function"&&f.a.addHook("uponSanitizeShadowNode",this.hooks.uponSanitizeShadowNode),typeof((ae=this.hooks)===null||ae===void 0?void 0:ae.afterSanitizeShadowDOM)=="function"&&f.a.addHook("afterSanitizeShadowDOM",this.hooks.afterSanitizeShadowDOM),I?(B=f.a.sanitize(U,L),G=G.insert(B)):(B=this.substituteBlockElements!==!1?(U=this.substitute(U,L)).innerHTML:f.a.sanitize(U,L),G=G.concat(this.convert(B)))}this.quill.updateContents(G,l.a.sources.USER),I||(G=this.convert(B)),this.keepSelection?this.quill.setSelection(F.index,G.length(),l.a.sources.SILENT):this.quill.setSelection(F.index+G.length(),l.a.sources.SILENT),this.quill.scrollIntoView(),f.a.removeAllHooks()}},{key:"getDOMPurifyOptions",value:function(){var A,R,M={};if((A=this.allowed)!==null&&A!==void 0&&A.tags&&(M.ALLOWED_TAGS=this.allowed.tags),(R=this.allowed)!==null&&R!==void 0&&R.attributes&&(M.ALLOWED_ATTR=this.allowed.attributes),M.ALLOWED_TAGS===void 0||M.ALLOWED_ATTR===void 0){var U,V=!1;M.ALLOWED_TAGS===void 0&&(V=!0,M.ALLOWED_TAGS=["p","br","span"]);var q=!1;M.ALLOWED_ATTR===void 0&&(q=!0,M.ALLOWED_ATTR=["class"]);var z=this.quill.getModule("toolbar");z==null||(U=z.controls)===null||U===void 0||U.forEach(function(F){switch(F[0]){case"bold":V&&(M.ALLOWED_TAGS.push("b"),M.ALLOWED_TAGS.push("strong"));break;case"italic":V&&(M.ALLOWED_TAGS.push("i"),M.ALLOWED_TAGS.push("em"));break;case"underline":V&&M.ALLOWED_TAGS.push("u");break;case"strike":V&&M.ALLOWED_TAGS.push("s");break;case"color":case"background":q&&M.ALLOWED_ATTR.push("style");break;case"script":V&&(F[1].value==="super"?M.ALLOWED_TAGS.push("sup"):F[1].value==="sub"&&M.ALLOWED_TAGS.push("sub"));break;case"header":if(V){var G=function(L){L==="1"?M.ALLOWED_TAGS.push("h1"):L==="2"?M.ALLOWED_TAGS.push("h2"):L==="3"?M.ALLOWED_TAGS.push("h3"):L==="4"?M.ALLOWED_TAGS.push("h4"):L==="5"?M.ALLOWED_TAGS.push("h5"):L==="6"&&M.ALLOWED_TAGS.push("h6")};F[1].value?G(F[1].value):F[1].options&&F[1].options.length&&[].forEach.call(F[1].options,function(L){L.value&&G(L.value)})}break;case"code-block":V&&M.ALLOWED_TAGS.push("pre"),q&&M.ALLOWED_ATTR.push("spellcheck");break;case"list":V&&(F[1].value==="ordered"?M.ALLOWED_TAGS.push("ol"):F[1].value==="bullet"&&M.ALLOWED_TAGS.push("ul"),M.ALLOWED_TAGS.push("li"));break;case"link":V&&M.ALLOWED_TAGS.push("a"),q&&(M.ALLOWED_ATTR.push("href"),M.ALLOWED_ATTR.push("target"),M.ALLOWED_ATTR.push("rel"));break;case"image":V&&M.ALLOWED_TAGS.push("img"),q&&(M.ALLOWED_ATTR.push("src"),M.ALLOWED_ATTR.push("title"),M.ALLOWED_ATTR.push("alt"));break;case"video":V&&M.ALLOWED_TAGS.push("iframe"),q&&(M.ALLOWED_ATTR.push("frameborder"),M.ALLOWED_ATTR.push("allowfullscreen"),M.ALLOWED_ATTR.push("src"));break;case"blockquote":V&&M.ALLOWED_TAGS.push(F[0])}})}return M}},{key:"substitute",value:function(A,R){var M,U=["h1","h2","h3","h4","h5","h6"],V=["p","div","section","article","fieldset","address","aside","blockquote","canvas","dl","figcaption","figure","footer","form","header","main","nav","noscript","ol","pre","table","tfoot","ul","video"],q=["li","dt","dd","hr"];f.a.addHook("uponSanitizeElement",function(I,B,D){for(var $=0;!M&&$<3;)R.ALLOWED_TAGS.includes(V[$])&&(M=V[$]),++$;if(M&&I.tagName&&!R.ALLOWED_TAGS.includes(I.tagName.toLowerCase())){var K=I.tagName.toLowerCase();U.includes(K)?I.innerHTML="<".concat(M,"><b>").concat(I.innerHTML,"</b></").concat(M,">"):V.includes(K)?I.innerHTML="<".concat(M,">").concat(I.innerHTML,"</").concat(M,">"):q.includes(K)&&(I.innerHTML="".concat(I.innerHTML,"<br>"))}}),A=f.a.sanitize(A,_(_({},R),{RETURN_DOM:!0,WHOLE_DOCUMENT:!1})),f.a.removeAllHooks();var z,F=function(I){var B=document.createElement(I.tagName.toLowerCase()),D=I.attributes;return D.length&&Array.from(D).forEach(function($){return B.setAttribute($.nodeName,$.value)}),B},G=0,L=document.createElement("body");return function I(B,D){for(D(B,G),B=G<=1?B.firstChild:void 0;B;)++G,I(B,D),B=B.nextSibling;--G}(A,function(I,B){if(B===1)if(I.tagName&&V.includes(I.tagName.toLowerCase())){z&&(z=void 0);var D=F(I);D.innerHTML=I.innerHTML,L.appendChild(D)}else if(z===void 0&&(z=document.createElement(M),L.appendChild(z)),I.tagName){var $=F(I);I.innerHTML&&($.innerHTML=I.innerHTML),z.appendChild($)}else{var K=document.createTextNode(I.textContent);z.appendChild(K)}}),L}},{key:"isURL",value:function(A){return!!/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:(?![\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])[\s\S])*)?$/i.test(A)}}])&&E(C.prototype,w),x}(d);l.a.register("modules/clipboard",O,!0),i.default=O}])})})(wD);var vS={},mS={exports:{}},ul={},dc={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */dc.exports;var G4;function SD(){return G4||(G4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof Se=="object"&&Se;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,v=26,S=38,_=700,p=72,E=128,b="-",m=/^xn--/,g=/[^\x20-\x7E]/,h=/[\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,O=Math.floor,k=String.fromCharCode,C;function w(L){throw new RangeError(d[L])}function P(L,I){for(var B=L.length,D=[];B--;)D[B]=I(L[B]);return D}function x(L,I){var B=L.split("@"),D="";B.length>1&&(D=B[0]+"@",L=B[1]),L=L.replace(h,".");var $=L.split("."),K=P($,I).join(".");return D+K}function A(L){for(var I=[],B=0,D=L.length,$,K;B<D;)$=L.charCodeAt(B++),$>=55296&&$<=56319&&B<D?(K=L.charCodeAt(B++),(K&64512)==56320?I.push((($&1023)<<10)+(K&1023)+65536):(I.push($),B--)):I.push($);return I}function R(L){return P(L,function(I){var B="";return I>65535&&(I-=65536,B+=k(I>>>10&1023|55296),I=56320|I&1023),B+=k(I),B}).join("")}function M(L){return L-48<10?L-22:L-65<26?L-65:L-97<26?L-97:u}function U(L,I){return L+22+75*(L<26)-((I!=0)<<5)}function V(L,I,B){var D=0;for(L=B?O(L/_):L>>1,L+=O(L/I);L>y*v>>1;D+=u)L=O(L/y);return O(D+(y+1)*L/(L+S))}function q(L){var I=[],B=L.length,D,$=0,K=E,Y=p,H,X,Z,J,ee,re,ae,le,ue;for(H=L.lastIndexOf(b),H<0&&(H=0),X=0;X<H;++X)L.charCodeAt(X)>=128&&w("not-basic"),I.push(L.charCodeAt(X));for(Z=H>0?H+1:0;Z<B;){for(J=$,ee=1,re=u;Z>=B&&w("invalid-input"),ae=M(L.charCodeAt(Z++)),(ae>=u||ae>O((l-$)/ee))&&w("overflow"),$+=ae*ee,le=re<=Y?f:re>=Y+v?v:re-Y,!(ae<le);re+=u)ue=u-le,ee>O(l/ue)&&w("overflow"),ee*=ue;D=I.length+1,Y=V($-J,D,J==0),O($/D)>l-K&&w("overflow"),K+=O($/D),$%=D,I.splice($++,0,K)}return R(I)}function z(L){var I,B,D,$,K,Y,H,X,Z,J,ee,re=[],ae,le,ue,Ae;for(L=A(L),ae=L.length,I=E,B=0,K=p,Y=0;Y<ae;++Y)ee=L[Y],ee<128&&re.push(k(ee));for(D=$=re.length,$&&re.push(b);D<ae;){for(H=l,Y=0;Y<ae;++Y)ee=L[Y],ee>=I&&ee<H&&(H=ee);for(le=D+1,H-I>O((l-B)/le)&&w("overflow"),B+=(H-I)*le,I=H,Y=0;Y<ae;++Y)if(ee=L[Y],ee<I&&++B>l&&w("overflow"),ee==I){for(X=B,Z=u;J=Z<=K?f:Z>=K+v?v:Z-K,!(X<J);Z+=u)Ae=X-J,ue=u-J,re.push(k(U(J+Ae%ue,0))),X=O(Ae/ue);re.push(k(U(X,0))),K=V(B,le,D==$),B=0,++D}++B,++I}return re.join("")}function F(L){return x(L,function(I){return m.test(I)?q(I.slice(4).toLowerCase()):I})}function G(L){return x(L,function(I){return g.test(I)?"xn--"+z(I):I})}if(o={version:"1.4.1",ucs2:{decode:A,encode:R},decode:q,encode:z,toASCII:G,toUnicode:F},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})(Se)}(dc,dc.exports)),dc.exports}var Eg,$4;function ED(){return $4||($4=1,Eg=Error),Eg}var Og,V4;function OD(){return V4||(V4=1,Og=EvalError),Og}var Pg,q4;function PD(){return q4||(q4=1,Pg=RangeError),Pg}var xg,W4;function xD(){return W4||(W4=1,xg=ReferenceError),xg}var Cg,Y4;function yS(){return Y4||(Y4=1,Cg=SyntaxError),Cg}var Tg,K4;function xf(){return K4||(K4=1,Tg=TypeError),Tg}var Ag,X4;function CD(){return X4||(X4=1,Ag=URIError),Ag}var kg,Z4;function TD(){return Z4||(Z4=1,kg=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}),kg}var Rg,Q4;function AD(){if(Q4)return Rg;Q4=1;var e=typeof Symbol<"u"&&Symbol,t=TD();return Rg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Rg}var Lg,J4;function kD(){if(J4)return Lg;J4=1;var e={__proto__:null,foo:{}},t=Object;return Lg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},Lg}var Mg,e_;function RD(){if(e_)return Mg;e_=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 v=[],S=0;S<u.length;S+=1)v[S]=u[S];for(var _=0;_<f.length;_+=1)v[_+u.length]=f[_];return v},a=function(u,f){for(var v=[],S=f,_=0;S<u.length;S+=1,_+=1)v[_]=u[S];return v},o=function(l,u){for(var f="",v=0;v<l.length;v+=1)f+=l[v],v+1<l.length&&(f+=u);return f};return Mg=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var v=a(arguments,1),S,_=function(){if(this instanceof S){var g=f.apply(this,i(v,arguments));return Object(g)===g?g:this}return f.apply(u,i(v,arguments))},p=r(0,f.length-v.length),E=[],b=0;b<p;b++)E[b]="$"+b;if(S=Function("binder","return function ("+o(E,",")+"){ return binder.apply(this,arguments); }")(_),f.prototype){var m=function(){};m.prototype=f.prototype,S.prototype=new m,m.prototype=null}return S},Mg}var Ng,t_;function R2(){if(t_)return Ng;t_=1;var e=RD();return Ng=Function.prototype.bind||e,Ng}var Ig,r_;function LD(){if(r_)return Ig;r_=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=R2();return Ig=r.call(e,t),Ig}var Dg,n_;function Tu(){if(n_)return Dg;n_=1;var e,t=ED(),r=OD(),n=PD(),i=xD(),a=yS(),o=xf(),l=CD(),u=Function,f=function(z){try{return u('"use strict"; return ('+z+").constructor;")()}catch{}},v=Object.getOwnPropertyDescriptor;if(v)try{v({},"")}catch{v=null}var S=function(){throw new o},_=v?function(){try{return arguments.callee,S}catch{try{return v(arguments,"callee").get}catch{return S}}}():S,p=AD()(),E=kD()(),b=Object.getPrototypeOf||(E?function(z){return z.__proto__}:null),m={},g=typeof Uint8Array>"u"||!b?e:b(Uint8Array),h={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":p&&b?b([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":m,"%AsyncGenerator%":m,"%AsyncGeneratorFunction%":m,"%AsyncIteratorPrototype%":m,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":m,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&b?b(b([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!p||!b?e:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!p||!b?e:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&b?b(""[Symbol.iterator]()):e,"%Symbol%":p?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":_,"%TypedArray%":g,"%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(z){var d=b(b(z));h["%Error.prototype%"]=d}var y=function z(F){var G;if(F==="%AsyncFunction%")G=f("async function () {}");else if(F==="%GeneratorFunction%")G=f("function* () {}");else if(F==="%AsyncGeneratorFunction%")G=f("async function* () {}");else if(F==="%AsyncGenerator%"){var L=z("%AsyncGeneratorFunction%");L&&(G=L.prototype)}else if(F==="%AsyncIteratorPrototype%"){var I=z("%AsyncGenerator%");I&&b&&(G=b(I.prototype))}return h[F]=G,G},O={__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"]},k=R2(),C=LD(),w=k.call(Function.call,Array.prototype.concat),P=k.call(Function.apply,Array.prototype.splice),x=k.call(Function.call,String.prototype.replace),A=k.call(Function.call,String.prototype.slice),R=k.call(Function.call,RegExp.prototype.exec),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,V=function(F){var G=A(F,0,1),L=A(F,-1);if(G==="%"&&L!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(L==="%"&&G!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var I=[];return x(F,M,function(B,D,$,K){I[I.length]=$?x(K,U,"$1"):D||B}),I},q=function(F,G){var L=F,I;if(C(O,L)&&(I=O[L],L="%"+I[0]+"%"),C(h,L)){var B=h[L];if(B===m&&(B=y(L)),typeof B>"u"&&!G)throw new o("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:I,name:L,value:B}}throw new a("intrinsic "+F+" does not exist!")};return Dg=function(F,G){if(typeof F!="string"||F.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof G!="boolean")throw new o('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,F)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var L=V(F),I=L.length>0?L[0]:"",B=q("%"+I+"%",G),D=B.name,$=B.value,K=!1,Y=B.alias;Y&&(I=Y[0],P(L,w([0,1],Y)));for(var H=1,X=!0;H<L.length;H+=1){var Z=L[H],J=A(Z,0,1),ee=A(Z,-1);if((J==='"'||J==="'"||J==="`"||ee==='"'||ee==="'"||ee==="`")&&J!==ee)throw new a("property names with quotes must have matching quotes");if((Z==="constructor"||!X)&&(K=!0),I+="."+Z,D="%"+I+"%",C(h,D))$=h[D];else if($!=null){if(!(Z in $)){if(!G)throw new o("base intrinsic for "+F+" exists, but the property is not available.");return}if(v&&H+1>=L.length){var re=v($,Z);X=!!re,X&&"get"in re&&!("originalValue"in re.get)?$=re.get:$=$[Z]}else X=C($,Z),$=$[Z];X&&!K&&(h[D]=$)}}return $},Dg}var Fg={exports:{}},jg,i_;function L2(){if(i_)return jg;i_=1;var e=Tu(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return jg=t,jg}var zg,a_;function bS(){if(a_)return zg;a_=1;var e=Tu(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return zg=t,zg}var Bg,o_;function MD(){if(o_)return Bg;o_=1;var e=L2(),t=yS(),r=xf(),n=bS();return Bg=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,v=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,_=!!n&&n(a,o);if(e)e(a,o,{configurable:v===null&&_?_.configurable:!v,enumerable:u===null&&_?_.enumerable:!u,value:l,writable:f===null&&_?_.writable:!f});else if(S||!u&&!f&&!v)a[o]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Bg}var Ug,l_;function ND(){if(l_)return Ug;l_=1;var e=L2(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Ug=t,Ug}var Hg,s_;function ID(){if(s_)return Hg;s_=1;var e=Tu(),t=MD(),r=ND()(),n=bS(),i=xf(),a=e("%Math.floor%");return Hg=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],v=!0,S=!0;if("length"in l&&n){var _=n(l,"length");_&&!_.configurable&&(v=!1),_&&!_.writable&&(S=!1)}return(v||S||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Hg}var u_;function DD(){return u_||(u_=1,function(e){var t=R2(),r=Tu(),n=ID(),i=xf(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=L2(),f=r("%Math.max%");e.exports=function(_){if(typeof _!="function")throw new i("a function is required");var p=l(t,o,arguments);return n(p,1+f(0,_.length-(arguments.length-1)),!0)};var v=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:v}):e.exports.apply=v}(Fg)),Fg.exports}var Gg,c_;function FD(){if(c_)return Gg;c_=1;var e=Tu(),t=DD(),r=t(e("String.prototype.indexOf"));return Gg=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},Gg}const jD={},zD=Object.freeze(Object.defineProperty({__proto__:null,default:jD},Symbol.toStringTag,{value:"Module"})),BD=Do(zD);var $g,f_;function UD(){if(f_)return $g;f_=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,v=typeof WeakSet=="function"&&WeakSet.prototype,S=v?WeakSet.prototype.has:null,_=typeof WeakRef=="function"&&WeakRef.prototype,p=_?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,b=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,h=String.prototype.slice,d=String.prototype.replace,y=String.prototype.toUpperCase,O=String.prototype.toLowerCase,k=RegExp.prototype.test,C=Array.prototype.concat,w=Array.prototype.join,P=Array.prototype.slice,x=Math.floor,A=typeof BigInt=="function"?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",V=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,q=Object.prototype.propertyIsEnumerable,z=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(fe){return fe.__proto__}:null);function F(fe,pe){if(fe===1/0||fe===-1/0||fe!==fe||fe&&fe>-1e3&&fe<1e3||k.call(/e/,pe))return pe;var nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof fe=="number"){var Oe=fe<0?-x(-fe):x(fe);if(Oe!==fe){var Fe=String(Oe),Le=h.call(pe,Fe.length+1);return d.call(Fe,nt,"$&_")+"."+d.call(d.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(pe,nt,"$&_")}var G=BD,L=G.custom,I=ee(L)?L:null;$g=function fe(pe,nt,Oe,Fe){var Le=nt||{};if(le(Le,"quoteStyle")&&Le.quoteStyle!=="single"&&Le.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(le(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ee=le(Le,"customInspect")?Le.customInspect:!0;if(typeof Ee!="boolean"&&Ee!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(le(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(le(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ze=Le.numericSeparator;if(typeof pe>"u")return"undefined";if(pe===null)return"null";if(typeof pe=="boolean")return pe?"true":"false";if(typeof pe=="string")return de(pe,Le);if(typeof pe=="number"){if(pe===0)return 1/0/pe>0?"0":"-0";var Pe=String(pe);return Ze?F(pe,Pe):Pe}if(typeof pe=="bigint"){var Ye=String(pe)+"n";return Ze?F(pe,Ye):Ye}var Sr=typeof Le.depth>"u"?5:Le.depth;if(typeof Oe>"u"&&(Oe=0),Oe>=Sr&&Sr>0&&typeof pe=="object")return $(pe)?"[Array]":"[Object]";var xe=ot(Le,Oe);if(typeof Fe>"u")Fe=[];else if(ze(Fe,pe)>=0)return"[Circular]";function He(vr,Mr,Mn){if(Mr&&(Fe=P.call(Fe),Fe.push(Mr)),Mn){var mi={depth:Le.depth};return le(Le,"quoteStyle")&&(mi.quoteStyle=Le.quoteStyle),fe(vr,mi,Oe+1,Fe)}return fe(vr,Le,Oe+1,Fe)}if(typeof pe=="function"&&!Y(pe)){var Qe=Ae(pe),Et=Bt(pe,He);return"[Function"+(Qe?": "+Qe:" (anonymous)")+"]"+(Et.length>0?" { "+w.call(Et,", ")+" }":"")}if(ee(pe)){var Pt=U?d.call(String(pe),/^(Symbol\(.*\))_[^)]*$/,"$1"):M.call(pe);return typeof pe=="object"&&!U?_e(Pt):Pt}if(he(pe)){for(var ar="<"+O.call(String(pe.nodeName)),Rr=pe.attributes||[],Lr=0;Lr<Rr.length;Lr++)ar+=" "+Rr[Lr].name+"="+B(D(Rr[Lr].value),"double",Le);return ar+=">",pe.childNodes&&pe.childNodes.length&&(ar+="..."),ar+="</"+O.call(String(pe.nodeName))+">",ar}if($(pe)){if(pe.length===0)return"[]";var ln=Bt(pe,He);return xe&&!tt(ln)?"["+gt(ln,xe)+"]":"[ "+w.call(ln,", ")+" ]"}if(H(pe)){var De=Bt(pe,He);return!("cause"in Error.prototype)&&"cause"in pe&&!q.call(pe,"cause")?"{ ["+String(pe)+"] "+w.call(C.call("[cause]: "+He(pe.cause),De),", ")+" }":De.length===0?"["+String(pe)+"]":"{ ["+String(pe)+"] "+w.call(De,", ")+" }"}if(typeof pe=="object"&&Ee){if(I&&typeof pe[I]=="function"&&G)return G(pe,{depth:Sr-Oe});if(Ee!=="symbol"&&typeof pe.inspect=="function")return pe.inspect()}if(oe(pe)){var rt=[];return n&&n.call(pe,function(vr,Mr){rt.push(He(Mr,pe,!0)+" => "+He(vr,pe))}),ke("Map",r.call(pe),rt,xe)}if(ge(pe)){var Xe=[];return l&&l.call(pe,function(vr){Xe.push(He(vr,pe))}),ke("Set",o.call(pe),Xe,xe)}if(ie(pe))return Ne("WeakMap");if(te(pe))return Ne("WeakSet");if(ve(pe))return Ne("WeakRef");if(Z(pe))return _e(He(Number(pe)));if(re(pe))return _e(He(A.call(pe)));if(J(pe))return _e(E.call(pe));if(X(pe))return _e(He(String(pe)));if(typeof window<"u"&&pe===window)return"{ [object Window] }";if(pe===Se)return"{ [object globalThis] }";if(!K(pe)&&!Y(pe)){var kt=Bt(pe,He),Je=z?z(pe)===Object.prototype:pe instanceof Object||pe.constructor===Object,fr=pe instanceof Object?"":"null prototype",dt=!Je&&V&&Object(pe)===pe&&V in pe?h.call(ue(pe),8,-1):fr?"Object":"",$t=Je||typeof pe.constructor!="function"?"":pe.constructor.name?pe.constructor.name+" ":"",Br=$t+(dt||fr?"["+w.call(C.call([],dt||[],fr||[]),": ")+"] ":"");return kt.length===0?Br+"{}":xe?Br+"{"+gt(kt,xe)+"}":Br+"{ "+w.call(kt,", ")+" }"}return String(pe)};function B(fe,pe,nt){var Oe=(nt.quoteStyle||pe)==="double"?'"':"'";return Oe+fe+Oe}function D(fe){return d.call(String(fe),/"/g,"&quot;")}function $(fe){return ue(fe)==="[object Array]"&&(!V||!(typeof fe=="object"&&V in fe))}function K(fe){return ue(fe)==="[object Date]"&&(!V||!(typeof fe=="object"&&V in fe))}function Y(fe){return ue(fe)==="[object RegExp]"&&(!V||!(typeof fe=="object"&&V in fe))}function H(fe){return ue(fe)==="[object Error]"&&(!V||!(typeof fe=="object"&&V in fe))}function X(fe){return ue(fe)==="[object String]"&&(!V||!(typeof fe=="object"&&V in fe))}function Z(fe){return ue(fe)==="[object Number]"&&(!V||!(typeof fe=="object"&&V in fe))}function J(fe){return ue(fe)==="[object Boolean]"&&(!V||!(typeof fe=="object"&&V in fe))}function ee(fe){if(U)return fe&&typeof fe=="object"&&fe instanceof Symbol;if(typeof fe=="symbol")return!0;if(!fe||typeof fe!="object"||!M)return!1;try{return M.call(fe),!0}catch{}return!1}function re(fe){if(!fe||typeof fe!="object"||!A)return!1;try{return A.call(fe),!0}catch{}return!1}var ae=Object.prototype.hasOwnProperty||function(fe){return fe in this};function le(fe,pe){return ae.call(fe,pe)}function ue(fe){return b.call(fe)}function Ae(fe){if(fe.name)return fe.name;var pe=g.call(m.call(fe),/^function\s*([\w$]+)/);return pe?pe[1]:null}function ze(fe,pe){if(fe.indexOf)return fe.indexOf(pe);for(var nt=0,Oe=fe.length;nt<Oe;nt++)if(fe[nt]===pe)return nt;return-1}function oe(fe){if(!r||!fe||typeof fe!="object")return!1;try{r.call(fe);try{o.call(fe)}catch{return!0}return fe instanceof Map}catch{}return!1}function ie(fe){if(!f||!fe||typeof fe!="object")return!1;try{f.call(fe,f);try{S.call(fe,S)}catch{return!0}return fe instanceof WeakMap}catch{}return!1}function ve(fe){if(!p||!fe||typeof fe!="object")return!1;try{return p.call(fe),!0}catch{}return!1}function ge(fe){if(!o||!fe||typeof fe!="object")return!1;try{o.call(fe);try{r.call(fe)}catch{return!0}return fe instanceof Set}catch{}return!1}function te(fe){if(!S||!fe||typeof fe!="object")return!1;try{S.call(fe,S);try{f.call(fe,f)}catch{return!0}return fe instanceof WeakSet}catch{}return!1}function he(fe){return!fe||typeof fe!="object"?!1:typeof HTMLElement<"u"&&fe instanceof HTMLElement?!0:typeof fe.nodeName=="string"&&typeof fe.getAttribute=="function"}function de(fe,pe){if(fe.length>pe.maxStringLength){var nt=fe.length-pe.maxStringLength,Oe="... "+nt+" more character"+(nt>1?"s":"");return de(h.call(fe,0,pe.maxStringLength),pe)+Oe}var Fe=d.call(d.call(fe,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,we);return B(Fe,"single",pe)}function we(fe){var pe=fe.charCodeAt(0),nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[pe];return nt?"\\"+nt:"\\x"+(pe<16?"0":"")+y.call(pe.toString(16))}function _e(fe){return"Object("+fe+")"}function Ne(fe){return fe+" { ? }"}function ke(fe,pe,nt,Oe){var Fe=Oe?gt(nt,Oe):w.call(nt,", ");return fe+" ("+pe+") {"+Fe+"}"}function tt(fe){for(var pe=0;pe<fe.length;pe++)if(ze(fe[pe],`
143
+ `)>=0)return!1;return!0}function ot(fe,pe){var nt;if(fe.indent===" ")nt=" ";else if(typeof fe.indent=="number"&&fe.indent>0)nt=w.call(Array(fe.indent+1)," ");else return null;return{base:nt,prev:w.call(Array(pe+1),nt)}}function gt(fe,pe){if(fe.length===0)return"";var nt=`
144
+ `+pe.prev+pe.base;return nt+w.call(fe,","+nt)+`
145
+ `+pe.prev}function Bt(fe,pe){var nt=$(fe),Oe=[];if(nt){Oe.length=fe.length;for(var Fe=0;Fe<fe.length;Fe++)Oe[Fe]=le(fe,Fe)?pe(fe[Fe],fe):""}var Le=typeof R=="function"?R(fe):[],Ee;if(U){Ee={};for(var Ze=0;Ze<Le.length;Ze++)Ee["$"+Le[Ze]]=Le[Ze]}for(var Pe in fe)le(fe,Pe)&&(nt&&String(Number(Pe))===Pe&&Pe<fe.length||U&&Ee["$"+Pe]instanceof Symbol||(k.call(/[^\w$]/,Pe)?Oe.push(pe(Pe,fe)+": "+pe(fe[Pe],fe)):Oe.push(Pe+": "+pe(fe[Pe],fe))));if(typeof R=="function")for(var Ye=0;Ye<Le.length;Ye++)q.call(fe,Le[Ye])&&Oe.push("["+pe(Le[Ye])+"]: "+pe(fe[Le[Ye]],fe));return Oe}return $g}var Vg,d_;function HD(){if(d_)return Vg;d_=1;var e=Tu(),t=FD(),r=UD(),n=xf(),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),v=t("Map.prototype.set",!0),S=t("Map.prototype.has",!0),_=function(m,g){for(var h=m,d;(d=h.next)!==null;h=d)if(d.key===g)return h.next=d.next,d.next=m.next,m.next=d,d},p=function(m,g){var h=_(m,g);return h&&h.value},E=function(m,g,h){var d=_(m,g);d?d.value=h:m.next={key:g,next:m.next,value:h}},b=function(m,g){return!!_(m,g)};return Vg=function(){var g,h,d,y={assert:function(O){if(!y.has(O))throw new n("Side channel does not contain "+r(O))},get:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(g)return o(g,O)}else if(a){if(h)return f(h,O)}else if(d)return p(d,O)},has:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(g)return u(g,O)}else if(a){if(h)return S(h,O)}else if(d)return b(d,O);return!1},set:function(O,k){i&&O&&(typeof O=="object"||typeof O=="function")?(g||(g=new i),l(g,O,k)):a?(h||(h=new a),v(h,O,k)):(d||(d={key:{},next:null}),E(d,O,k))}};return y},Vg}var qg,h_;function M2(){if(h_)return qg;h_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return qg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},qg}var Wg,p_;function _S(){if(p_)return Wg;p_=1;var e=M2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var m=[],g=0;g<256;++g)m.push("%"+((g<16?"0":"")+g.toString(16)).toUpperCase());return m}(),i=function(g){for(;g.length>1;){var h=g.pop(),d=h.obj[h.prop];if(r(d)){for(var y=[],O=0;O<d.length;++O)typeof d[O]<"u"&&y.push(d[O]);h.obj[h.prop]=y}}},a=function(g,h){for(var d=h&&h.plainObjects?Object.create(null):{},y=0;y<g.length;++y)typeof g[y]<"u"&&(d[y]=g[y]);return d},o=function m(g,h,d){if(!h)return g;if(typeof h!="object"){if(r(g))g.push(h);else if(g&&typeof g=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,h))&&(g[h]=!0);else return[g,h];return g}if(!g||typeof g!="object")return[g].concat(h);var y=g;return r(g)&&!r(h)&&(y=a(g,d)),r(g)&&r(h)?(h.forEach(function(O,k){if(t.call(g,k)){var C=g[k];C&&typeof C=="object"&&O&&typeof O=="object"?g[k]=m(C,O,d):g.push(O)}else g[k]=O}),g):Object.keys(h).reduce(function(O,k){var C=h[k];return t.call(O,k)?O[k]=m(O[k],C,d):O[k]=C,O},y)},l=function(g,h){return Object.keys(h).reduce(function(d,y){return d[y]=h[y],d},g)},u=function(m,g,h){var d=m.replace(/\+/g," ");if(h==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,v=function(g,h,d,y,O){if(g.length===0)return g;var k=g;if(typeof g=="symbol"?k=Symbol.prototype.toString.call(g):typeof g!="string"&&(k=String(g)),d==="iso-8859-1")return escape(k).replace(/%u[0-9a-f]{4}/gi,function(M){return"%26%23"+parseInt(M.slice(2),16)+"%3B"});for(var C="",w=0;w<k.length;w+=f){for(var P=k.length>=f?k.slice(w,w+f):k,x=[],A=0;A<P.length;++A){var R=P.charCodeAt(A);if(R===45||R===46||R===95||R===126||R>=48&&R<=57||R>=65&&R<=90||R>=97&&R<=122||O===e.RFC1738&&(R===40||R===41)){x[x.length]=P.charAt(A);continue}if(R<128){x[x.length]=n[R];continue}if(R<2048){x[x.length]=n[192|R>>6]+n[128|R&63];continue}if(R<55296||R>=57344){x[x.length]=n[224|R>>12]+n[128|R>>6&63]+n[128|R&63];continue}A+=1,R=65536+((R&1023)<<10|P.charCodeAt(A)&1023),x[x.length]=n[240|R>>18]+n[128|R>>12&63]+n[128|R>>6&63]+n[128|R&63]}C+=x.join("")}return C},S=function(g){for(var h=[{obj:{o:g},prop:"o"}],d=[],y=0;y<h.length;++y)for(var O=h[y],k=O.obj[O.prop],C=Object.keys(k),w=0;w<C.length;++w){var P=C[w],x=k[P];typeof x=="object"&&x!==null&&d.indexOf(x)===-1&&(h.push({obj:k,prop:P}),d.push(x))}return i(h),g},_=function(g){return Object.prototype.toString.call(g)==="[object RegExp]"},p=function(g){return!g||typeof g!="object"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))},E=function(g,h){return[].concat(g,h)},b=function(g,h){if(r(g)){for(var d=[],y=0;y<g.length;y+=1)d.push(h(g[y]));return d}return h(g)};return Wg={arrayToObject:a,assign:l,combine:E,compact:S,decode:u,encode:v,isBuffer:p,isRegExp:_,maybeMap:b,merge:o},Wg}var Yg,g_;function GD(){if(g_)return Yg;g_=1;var e=HD(),t=_S(),r=M2(),n=Object.prototype.hasOwnProperty,i={brackets:function(m){return m+"[]"},comma:"comma",indices:function(m,g){return m+"["+g+"]"},repeat:function(m){return m}},a=Array.isArray,o=Array.prototype.push,l=function(b,m){o.apply(b,a(m)?m:[m])},u=Date.prototype.toISOString,f=r.default,v={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(m){return u.call(m)},skipNulls:!1,strictNullHandling:!1},S=function(m){return typeof m=="string"||typeof m=="number"||typeof m=="boolean"||typeof m=="symbol"||typeof m=="bigint"},_={},p=function b(m,g,h,d,y,O,k,C,w,P,x,A,R,M,U,V,q,z){for(var F=m,G=z,L=0,I=!1;(G=G.get(_))!==void 0&&!I;){var B=G.get(m);if(L+=1,typeof B<"u"){if(B===L)throw new RangeError("Cyclic object value");I=!0}typeof G.get(_)>"u"&&(L=0)}if(typeof P=="function"?F=P(g,F):F instanceof Date?F=R(F):h==="comma"&&a(F)&&(F=t.maybeMap(F,function(ue){return ue instanceof Date?R(ue):ue})),F===null){if(O)return w&&!V?w(g,v.encoder,q,"key",M):g;F=""}if(S(F)||t.isBuffer(F)){if(w){var D=V?g:w(g,v.encoder,q,"key",M);return[U(D)+"="+U(w(F,v.encoder,q,"value",M))]}return[U(g)+"="+U(String(F))]}var $=[];if(typeof F>"u")return $;var K;if(h==="comma"&&a(F))V&&w&&(F=t.maybeMap(F,w)),K=[{value:F.length>0?F.join(",")||null:void 0}];else if(a(P))K=P;else{var Y=Object.keys(F);K=x?Y.sort(x):Y}var H=C?g.replace(/\./g,"%2E"):g,X=d&&a(F)&&F.length===1?H+"[]":H;if(y&&a(F)&&F.length===0)return X+"[]";for(var Z=0;Z<K.length;++Z){var J=K[Z],ee=typeof J=="object"&&typeof J.value<"u"?J.value:F[J];if(!(k&&ee===null)){var re=A&&C?J.replace(/\./g,"%2E"):J,ae=a(F)?typeof h=="function"?h(X,re):X:X+(A?"."+re:"["+re+"]");z.set(m,L);var le=e();le.set(_,z),l($,b(ee,ae,h,d,y,O,k,C,h==="comma"&&V&&a(F)?null:w,P,x,A,R,M,U,V,q,le))}}return $},E=function(m){if(!m)return v;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.encodeDotInKeys<"u"&&typeof m.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(m.encoder!==null&&typeof m.encoder<"u"&&typeof m.encoder!="function")throw new TypeError("Encoder has to be a function.");var g=m.charset||v.charset;if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var h=r.default;if(typeof m.format<"u"){if(!n.call(r.formatters,m.format))throw new TypeError("Unknown format option provided.");h=m.format}var d=r.formatters[h],y=v.filter;(typeof m.filter=="function"||a(m.filter))&&(y=m.filter);var O;if(m.arrayFormat in i?O=m.arrayFormat:"indices"in m?O=m.indices?"indices":"repeat":O=v.arrayFormat,"commaRoundTrip"in m&&typeof m.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var k=typeof m.allowDots>"u"?m.encodeDotInKeys===!0?!0:v.allowDots:!!m.allowDots;return{addQueryPrefix:typeof m.addQueryPrefix=="boolean"?m.addQueryPrefix:v.addQueryPrefix,allowDots:k,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:v.allowEmptyArrays,arrayFormat:O,charset:g,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:v.charsetSentinel,commaRoundTrip:m.commaRoundTrip,delimiter:typeof m.delimiter>"u"?v.delimiter:m.delimiter,encode:typeof m.encode=="boolean"?m.encode:v.encode,encodeDotInKeys:typeof m.encodeDotInKeys=="boolean"?m.encodeDotInKeys:v.encodeDotInKeys,encoder:typeof m.encoder=="function"?m.encoder:v.encoder,encodeValuesOnly:typeof m.encodeValuesOnly=="boolean"?m.encodeValuesOnly:v.encodeValuesOnly,filter:y,format:h,formatter:d,serializeDate:typeof m.serializeDate=="function"?m.serializeDate:v.serializeDate,skipNulls:typeof m.skipNulls=="boolean"?m.skipNulls:v.skipNulls,sort:typeof m.sort=="function"?m.sort:null,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:v.strictNullHandling}};return Yg=function(b,m){var g=b,h=E(m),d,y;typeof h.filter=="function"?(y=h.filter,g=y("",g)):a(h.filter)&&(y=h.filter,d=y);var O=[];if(typeof g!="object"||g===null)return"";var k=i[h.arrayFormat],C=k==="comma"&&h.commaRoundTrip;d||(d=Object.keys(g)),h.sort&&d.sort(h.sort);for(var w=e(),P=0;P<d.length;++P){var x=d[P];h.skipNulls&&g[x]===null||l(O,p(g[x],x,k,C,h.allowEmptyArrays,h.strictNullHandling,h.skipNulls,h.encodeDotInKeys,h.encode?h.encoder:null,h.filter,h.sort,h.allowDots,h.serializeDate,h.format,h.formatter,h.encodeValuesOnly,h.charset,w))}var A=O.join(h.delimiter),R=h.addQueryPrefix===!0?"?":"";return h.charsetSentinel&&(h.charset==="iso-8859-1"?R+="utf8=%26%2310003%3B&":R+="utf8=%E2%9C%93&"),A.length>0?R+A:""},Yg}var Kg,v_;function $D(){if(v_)return Kg;v_=1;var e=_S(),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(_){return _.replace(/&#(\d+);/g,function(p,E){return String.fromCharCode(parseInt(E,10))})},a=function(_,p){return _&&typeof _=="string"&&p.comma&&_.indexOf(",")>-1?_.split(","):_},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(p,E){var b={__proto__:null},m=E.ignoreQueryPrefix?p.replace(/^\?/,""):p,g=E.parameterLimit===1/0?void 0:E.parameterLimit,h=m.split(E.delimiter,g),d=-1,y,O=E.charset;if(E.charsetSentinel)for(y=0;y<h.length;++y)h[y].indexOf("utf8=")===0&&(h[y]===l?O="utf-8":h[y]===o&&(O="iso-8859-1"),d=y,y=h.length);for(y=0;y<h.length;++y)if(y!==d){var k=h[y],C=k.indexOf("]="),w=C===-1?k.indexOf("="):C+1,P,x;w===-1?(P=E.decoder(k,n.decoder,O,"key"),x=E.strictNullHandling?null:""):(P=E.decoder(k.slice(0,w),n.decoder,O,"key"),x=e.maybeMap(a(k.slice(w+1),E),function(R){return E.decoder(R,n.decoder,O,"value")})),x&&E.interpretNumericEntities&&O==="iso-8859-1"&&(x=i(x)),k.indexOf("[]=")>-1&&(x=r(x)?[x]:x);var A=t.call(b,P);A&&E.duplicates==="combine"?b[P]=e.combine(b[P],x):(!A||E.duplicates==="last")&&(b[P]=x)}return b},f=function(_,p,E,b){for(var m=b?p:a(p,E),g=_.length-1;g>=0;--g){var h,d=_[g];if(d==="[]"&&E.parseArrays)h=E.allowEmptyArrays&&m===""?[]:[].concat(m);else{h=E.plainObjects?Object.create(null):{};var y=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,O=E.decodeDotInKeys?y.replace(/%2E/g,"."):y,k=parseInt(O,10);!E.parseArrays&&O===""?h={0:m}:!isNaN(k)&&d!==O&&String(k)===O&&k>=0&&E.parseArrays&&k<=E.arrayLimit?(h=[],h[k]=m):O!=="__proto__"&&(h[O]=m)}m=h}return m},v=function(p,E,b,m){if(p){var g=b.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,h=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,y=b.depth>0&&h.exec(g),O=y?g.slice(0,y.index):g,k=[];if(O){if(!b.plainObjects&&t.call(Object.prototype,O)&&!b.allowPrototypes)return;k.push(O)}for(var C=0;b.depth>0&&(y=d.exec(g))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&t.call(Object.prototype,y[1].slice(1,-1))&&!b.allowPrototypes)return;k.push(y[1])}return y&&k.push("["+g.slice(y.index)+"]"),f(k,E,b,m)}},S=function(p){if(!p)return n;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=typeof p.charset>"u"?n.charset:p.charset,b=typeof p.duplicates>"u"?n.duplicates:p.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var m=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:n.allowDots:!!p.allowDots;return{allowDots:m,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:n.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:n.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:n.arrayLimit,charset:E,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:n.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:n.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:n.decoder,delimiter:typeof p.delimiter=="string"||e.isRegExp(p.delimiter)?p.delimiter:n.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:n.depth,duplicates:b,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:n.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:n.plainObjects,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:n.strictNullHandling}};return Kg=function(_,p){var E=S(p);if(_===""||_===null||typeof _>"u")return E.plainObjects?Object.create(null):{};for(var b=typeof _=="string"?u(_,E):_,m=E.plainObjects?Object.create(null):{},g=Object.keys(b),h=0;h<g.length;++h){var d=g[h],y=v(d,b[d],E,typeof _=="string");m=e.merge(m,y,E)}return E.allowSparse===!0?m:e.compact(m)},Kg}var Xg,m_;function VD(){if(m_)return Xg;m_=1;var e=GD(),t=$D(),r=M2();return Xg={formats:r,parse:t,stringify:e},Xg}var y_;function wS(){if(y_)return ul;y_=1;var e=SD();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",`
146
+ `," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],v=255,S=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=VD();function g(O,k,C){if(O&&typeof O=="object"&&O instanceof t)return O;var w=new t;return w.parse(O,k,C),w}t.prototype.parse=function(O,k,C){if(typeof O!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof O);var w=O.indexOf("?"),P=w!==-1&&w<O.indexOf("#")?"?":"#",x=O.split(P),A=/\\/g;x[0]=x[0].replace(A,"/"),O=x.join(P);var R=O;if(R=R.trim(),!C&&O.split("#").length===1){var M=i.exec(R);if(M)return this.path=R,this.href=R,this.pathname=M[1],M[2]?(this.search=M[2],k?this.query=m.parse(this.search.substr(1)):this.query=this.search.substr(1)):k&&(this.search="",this.query={}),this}var U=r.exec(R);if(U){U=U[0];var V=U.toLowerCase();this.protocol=V,R=R.substr(U.length)}if(C||U||R.match(/^\/\/[^@/]+@[^@/]+/)){var q=R.substr(0,2)==="//";q&&!(U&&E[U])&&(R=R.substr(2),this.slashes=!0)}if(!E[U]&&(q||U&&!b[U])){for(var z=-1,F=0;F<f.length;F++){var G=R.indexOf(f[F]);G!==-1&&(z===-1||G<z)&&(z=G)}var L,I;z===-1?I=R.lastIndexOf("@"):I=R.lastIndexOf("@",z),I!==-1&&(L=R.slice(0,I),R=R.slice(I+1),this.auth=decodeURIComponent(L)),z=-1;for(var F=0;F<u.length;F++){var G=R.indexOf(u[F]);G!==-1&&(z===-1||G<z)&&(z=G)}z===-1&&(z=R.length),this.host=R.slice(0,z),R=R.slice(z),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var D=this.hostname.split(/\./),F=0,$=D.length;F<$;F++){var K=D[F];if(K&&!K.match(S)){for(var Y="",H=0,X=K.length;H<X;H++)K.charCodeAt(H)>127?Y+="x":Y+=K[H];if(!Y.match(S)){var Z=D.slice(0,F),J=D.slice(F+1),ee=K.match(_);ee&&(Z.push(ee[1]),J.unshift(ee[2])),J.length&&(R="/"+J.join(".")+R),this.hostname=Z.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=e.toASCII(this.hostname));var re=this.port?":"+this.port:"",ae=this.hostname||"";this.host=ae+re,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!p[V])for(var F=0,$=l.length;F<$;F++){var le=l[F];if(R.indexOf(le)!==-1){var ue=encodeURIComponent(le);ue===le&&(ue=escape(le)),R=R.split(le).join(ue)}}var Ae=R.indexOf("#");Ae!==-1&&(this.hash=R.substr(Ae),R=R.slice(0,Ae));var ze=R.indexOf("?");if(ze!==-1?(this.search=R.substr(ze),this.query=R.substr(ze+1),k&&(this.query=m.parse(this.query)),R=R.slice(0,ze)):k&&(this.search="",this.query={}),R&&(this.pathname=R),b[V]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var re=this.pathname||"",oe=this.search||"";this.path=re+oe}return this.href=this.format(),this};function h(O){return typeof O=="string"&&(O=g(O)),O instanceof t?O.format():t.prototype.format.call(O)}t.prototype.format=function(){var O=this.auth||"";O&&(O=encodeURIComponent(O),O=O.replace(/%3A/i,":"),O+="@");var k=this.protocol||"",C=this.pathname||"",w=this.hash||"",P=!1,x="";this.host?P=O+this.host:this.hostname&&(P=O+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(x=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var A=this.search||x&&"?"+x||"";return k&&k.substr(-1)!==":"&&(k+=":"),this.slashes||(!k||b[k])&&P!==!1?(P="//"+(P||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):P||(P=""),w&&w.charAt(0)!=="#"&&(w="#"+w),A&&A.charAt(0)!=="?"&&(A="?"+A),C=C.replace(/[?#]/g,function(R){return encodeURIComponent(R)}),A=A.replace("#","%23"),k+P+C+A+w};function d(O,k){return g(O,!1,!0).resolve(k)}t.prototype.resolve=function(O){return this.resolveObject(g(O,!1,!0)).format()};function y(O,k){return O?g(O,!1,!0).resolveObject(k):k}return t.prototype.resolveObject=function(O){if(typeof O=="string"){var k=new t;k.parse(O,!1,!0),O=k}for(var C=new t,w=Object.keys(this),P=0;P<w.length;P++){var x=w[P];C[x]=this[x]}if(C.hash=O.hash,O.href==="")return C.href=C.format(),C;if(O.slashes&&!O.protocol){for(var A=Object.keys(O),R=0;R<A.length;R++){var M=A[R];M!=="protocol"&&(C[M]=O[M])}return b[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(O.protocol&&O.protocol!==C.protocol){if(!b[O.protocol]){for(var U=Object.keys(O),V=0;V<U.length;V++){var q=U[V];C[q]=O[q]}return C.href=C.format(),C}if(C.protocol=O.protocol,!O.host&&!E[O.protocol]){for(var $=(O.pathname||"").split("/");$.length&&!(O.host=$.shift()););O.host||(O.host=""),O.hostname||(O.hostname=""),$[0]!==""&&$.unshift(""),$.length<2&&$.unshift(""),C.pathname=$.join("/")}else C.pathname=O.pathname;if(C.search=O.search,C.query=O.query,C.host=O.host||"",C.auth=O.auth,C.hostname=O.hostname||O.host,C.port=O.port,C.pathname||C.search){var z=C.pathname||"",F=C.search||"";C.path=z+F}return C.slashes=C.slashes||O.slashes,C.href=C.format(),C}var G=C.pathname&&C.pathname.charAt(0)==="/",L=O.host||O.pathname&&O.pathname.charAt(0)==="/",I=L||G||C.host&&O.pathname,B=I,D=C.pathname&&C.pathname.split("/")||[],$=O.pathname&&O.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="",O.protocol&&(O.hostname=null,O.port=null,O.host&&($[0]===""?$[0]=O.host:$.unshift(O.host)),O.host=null),I=I&&($[0]===""||D[0]==="")),L)C.host=O.host||O.host===""?O.host:C.host,C.hostname=O.hostname||O.hostname===""?O.hostname:C.hostname,C.search=O.search,C.query=O.query,D=$;else if($.length)D||(D=[]),D.pop(),D=D.concat($),C.search=O.search,C.query=O.query;else if(O.search!=null){if(K){C.host=D.shift(),C.hostname=C.host;var Y=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;Y&&(C.auth=Y.shift(),C.hostname=Y.shift(),C.host=C.hostname)}return C.search=O.search,C.query=O.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 H=D.slice(-1)[0],X=(C.host||O.host||D.length>1)&&(H==="."||H==="..")||H==="",Z=0,J=D.length;J>=0;J--)H=D[J],H==="."?D.splice(J,1):H===".."?(D.splice(J,1),Z++):Z&&(D.splice(J,1),Z--);if(!I&&!B)for(;Z--;Z)D.unshift("..");I&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),X&&D.join("/").substr(-1)!=="/"&&D.push("");var ee=D[0]===""||D[0]&&D[0].charAt(0)==="/";if(K){C.hostname=ee?"":D.length?D.shift():"",C.host=C.hostname;var Y=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;Y&&(C.auth=Y.shift(),C.hostname=Y.shift(),C.host=C.hostname)}return I=I||C.host&&D.length,I&&!ee&&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=O.auth||C.auth,C.slashes=C.slashes||O.slashes,C.href=C.format(),C},t.prototype.parseHost=function(){var O=this.host,k=n.exec(O);k&&(k=k[0],k!==":"&&(this.port=k.substr(1)),O=O.substr(0,O.length-k.length)),O&&(this.hostname=O)},ul.parse=g,ul.resolve=d,ul.resolveObject=y,ul.format=h,ul.Url=t,ul}var Zg={exports:{}},b_;function qD(){return b_||(b_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(Se,function(){var t=function(p){return p.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(p){var E=p.value;return" "+p.name+'="'+r(E)+'"'},a=function(p){var E=p.tagName;return p.namespaceURI==="http://www.w3.org/1999/xhtml"&&(E=E.toLowerCase()),E},o=function(p,E){var b=Array.prototype.map.call(p.attributes||p.attrs,function(m){return m.name}).indexOf("xmlns")>=0;return!b&&(E||p.namespaceURI!==p.parentNode.namespaceURI)?' xmlns="'+p.namespaceURI+'"':""},l=function(p){return Array.prototype.map.call(p.childNodes,function(E){return _(E)}).join("")},u=function(p,E){var b="<"+a(p);return b+=o(p,E),Array.prototype.forEach.call(p.attributes||p.attrs,function(m){b+=i(m)}),p.childNodes.length>0?(b+=">",b+=l(p),b+="</"+a(p)+">"):b+="/>",b},f=function(p){var E=p.nodeValue||p.value||"";return n(E)},v=function(p){return"<!--"+p.data.replace(/-/g,"&#45;")+"-->"},S=function(p){return"<![CDATA["+p.nodeValue+"]]>"},_=function(p,E){var b=E&&E.rootNode;if(p.nodeName==="#document"||p.nodeName==="#document-fragment")return l(p);if(p.tagName)return u(p,b);if(p.nodeName==="#text")return f(p);if(p.nodeName==="#comment")return v(p);if(p.nodeName==="#cdata-section")return S(p)};return{serializeToString:function(p){return t(_(p,{rootNode:!0}))}}})}(Zg)),Zg.exports}var Qg={},__;function WD(){if(__)return Qg;__=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[^>]*>(.+?)
147
+ ?</div>`),new RegExp(`^(.+)
148
+ `)],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 Qg.failOnParseError=function(a){return i(a),a},Qg}var Jg={},ev={},w_;function y0(){return w_||(w_=1,function(e){var t=wS();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(v){u.push(v)})})).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,v){var S=new window.XMLHttpRequest,_=e.joinUrl(u.baseUrl,l),p,E=function(){v({msg:"Unable to load url",url:_})};p=n(_,u.cache),S.addEventListener("load",function(){S.status===200||S.status===0?f(S.response):E()},!1),S.addEventListener("error",E,!1);try{S.open("GET",p,!0),S.overrideMimeType(u.mimeType),S.send(null)}catch{E()}})},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(v){for(var S="",_=0;_<v.length;_++)S+=String.fromCharCode(v.charCodeAt(_)&255);return S})};var i=function(l){var u=function(f,v){return f.substring(0,v.length)===v};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 v=btoa(f),S=i(f);return"data:"+S+";base64,"+v})};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 v=Array.prototype.slice.call(arguments),S=u(v),_=o(l),p;return f[_]&&f[_][S]?f[_][S]:(p=l.apply(null,v),f[_]=f[_]||{},f[_][S]=p,p)}}}(ev)),ev}var tv={},S_;function YD(){if(S_)return tv;S_=1;var e=y0(),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(v){return v},function(v){throw{resourceType:"image",url:v.url,msg:"Unable to load image "+v.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 tv.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 v=r(l);return e.collectAndReportErrors(v.map(function(S){return t(S,o).then(function(_){S.attributes.src?S.attributes.src.value=_:S.attributes["xlink:href"]?S.attributes["xlink:href"].value=_:S.attributes.href&&(S.attributes.href.value=_)})}))},tv}var rv={},E_;function KD(){if(E_)return rv;E_=1;var e=y0(),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(v){throw{resourceType:"script",url:v.url,msg:"Unable to load script "+v.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 rv.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)})}))},rv}var nv={},iv={},O_;function N2(){return O_||(O_=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)}}(iv)),iv}var av={},P_;function XD(){return P_||(P_=1,function(e){var t=N2(),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*$",v=new RegExp(u,"g"),S,_=[],p=function(E){var b=new RegExp(l,"g"),m=[],g;for(g=b.exec(E);g;)m.push(g[1]),g=b.exec(E);return m};if(a.match(new RegExp(f))){for(S=v.exec(a);S;)_.push(p(S[0])),S=v.exec(a);return _}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(", ")}}(av)),av}function Hd(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 ov={exports:{}},x_;function ZD(){return x_||(x_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,v){if(!i[f]){if(!n[f]){var S=typeof Hd=="function"&&Hd;if(!v&&S)return S(f,!0);if(l)return l(f,!0);var _=new Error("Cannot find module '"+f+"'");throw _.code="MODULE_NOT_FOUND",_}var p=i[f]={exports:{}};n[f][0].call(p.exports,function(E){var b=n[f][1][E];return o(b||E)},p,p.exports,r,n,i,a)}return i[f].exports}for(var l=typeof Hd=="function"&&Hd,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function v(){this.constructor=u}v.prototype=f.prototype,u.prototype=new v}function o(u,f,v,S){this.message=u,this.expected=f,this.found=v,this.location=S,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var v={literal:function(g){return'"'+_(g.text)+'"'},class:function(g){var h="",d;for(d=0;d<g.parts.length;d++)h+=g.parts[d]instanceof Array?p(g.parts[d][0])+"-"+p(g.parts[d][1]):p(g.parts[d]);return"["+(g.inverted?"^":"")+h+"]"},any:function(g){return"any character"},end:function(g){return"end of input"},other:function(g){return g.description}};function S(g){return g.charCodeAt(0).toString(16).toUpperCase()}function _(g){return 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(h){return"\\x0"+S(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+S(h)})}function p(g){return g.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(h){return"\\x0"+S(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+S(h)})}function E(g){return v[g.type](g)}function b(g){var h=new Array(g.length),d,y;for(d=0;d<g.length;d++)h[d]=E(g[d]);if(h.sort(),h.length>0){for(d=1,y=1;d<h.length;d++)h[d-1]!==h[d]&&(h[y]=h[d],y++);h.length=y}switch(h.length){case 1:return h[0];case 2:return h[0]+" or "+h[1];default:return h.slice(0,-1).join(", ")+", or "+h[h.length-1]}}function m(g){return g?'"'+_(g)+'"':"end of input"}return"Expected "+b(u)+" but "+m(f)+" found."};function l(u,f){f=f!==void 0?f:{};var v={},S={start:re},_=re,p="",E=function(){return[]},b=",",m=K(",",!1),g=function(te,he){return[te].concat(he)},h=function(te){return[te]},d=function(te,he){return{url:te,format:he}},y=function(te){return{url:te}},O="url(",k=K("url(",!1),C=")",w=K(")",!1),P=function(te){return te},x="format(",A=K("format(",!1),R="local(",M=K("local(",!1),U=function(te){return{local:te}},V=/^[^)]/,q=Y([")"],!0,!1),z=function(te){return ge.extractValue(te.join(""))},F=/^[ \t\r\n\f]/,G=Y([" "," ","\r",`
149
+ `,"\f"],!1,!1),L=0,I=[{line:1,column:1}],B=0,D=[],$;if("startRule"in f){if(!(f.startRule in S))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');_=S[f.startRule]}function K(te,he){return{type:"literal",text:te,ignoreCase:he}}function Y(te,he,de){return{type:"class",parts:te,inverted:he,ignoreCase:de}}function H(){return{type:"end"}}function X(te){var he=I[te],de;if(he)return he;for(de=te-1;!I[de];)de--;for(he=I[de],he={line:he.line,column:he.column};de<te;)u.charCodeAt(de)===10?(he.line++,he.column=1):he.column++,de++;return I[te]=he,he}function Z(te,he){var de=X(te),we=X(he);return{start:{offset:te,line:de.line,column:de.column},end:{offset:he,line:we.line,column:we.column}}}function J(te){L<B||(L>B&&(B=L,D=[]),D.push(te))}function ee(te,he,de){return new o(o.buildMessage(te,he),te,he,de)}function re(){var te,he;return te=ae(),te===v&&(te=L,he=p,he!==v&&(he=E()),te=he),te}function ae(){var te,he,de,we,_e,Ne;if(te=L,he=le(),he!==v){for(de=[],we=ve();we!==v;)de.push(we),we=ve();if(de!==v)if(u.charCodeAt(L)===44?(we=b,L++):(we=v,J(m)),we!==v){for(_e=[],Ne=ve();Ne!==v;)_e.push(Ne),Ne=ve();_e!==v?(Ne=ae(),Ne!==v?(he=g(he,Ne),te=he):(L=te,te=v)):(L=te,te=v)}else L=te,te=v;else L=te,te=v}else L=te,te=v;return te===v&&(te=L,he=le(),he!==v&&(he=h(he)),te=he),te}function le(){var te;return te=ue(),te===v&&(te=oe()),te}function ue(){var te,he,de,we;if(te=L,he=Ae(),he!==v){if(de=[],we=ve(),we!==v)for(;we!==v;)de.push(we),we=ve();else de=v;de!==v?(we=ze(),we!==v?(he=d(he,we),te=he):(L=te,te=v)):(L=te,te=v)}else L=te,te=v;return te===v&&(te=L,he=Ae(),he!==v&&(he=y(he)),te=he),te}function Ae(){var te,he,de,we;return te=L,u.substr(L,4)===O?(he=O,L+=4):(he=v,J(k)),he!==v?(de=ie(),de!==v?(u.charCodeAt(L)===41?(we=C,L++):(we=v,J(w)),we!==v?(he=P(de),te=he):(L=te,te=v)):(L=te,te=v)):(L=te,te=v),te}function ze(){var te,he,de,we;return te=L,u.substr(L,7)===x?(he=x,L+=7):(he=v,J(A)),he!==v?(de=ie(),de!==v?(u.charCodeAt(L)===41?(we=C,L++):(we=v,J(w)),we!==v?(he=P(de),te=he):(L=te,te=v)):(L=te,te=v)):(L=te,te=v),te}function oe(){var te,he,de,we;return te=L,u.substr(L,6)===R?(he=R,L+=6):(he=v,J(M)),he!==v?(de=ie(),de!==v?(u.charCodeAt(L)===41?(we=C,L++):(we=v,J(w)),we!==v?(he=U(de),te=he):(L=te,te=v)):(L=te,te=v)):(L=te,te=v),te}function ie(){var te,he,de;if(te=L,he=[],V.test(u.charAt(L))?(de=u.charAt(L),L++):(de=v,J(q)),de!==v)for(;de!==v;)he.push(de),V.test(u.charAt(L))?(de=u.charAt(L),L++):(de=v,J(q));else he=v;return he!==v&&(he=z(he)),te=he,te}function ve(){var te;return F.test(u.charAt(L))?(te=u.charAt(L),L++):(te=v,J(G)),te}var ge=r("../util");if($=_(),$!==v&&L===u.length)return $;throw $!==v&&L<u.length&&J(H()),ee(D,B<u.length?u.charAt(B):null,B<u.length?Z(B,B+1):Z(B,B))}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)})}(ov)),ov.exports}var C_;function QD(){return C_||(C_=1,function(e){var t=y0(),r=N2(),n=XD(),i=ZD(),a=function(h,d,y){h.style.setProperty(d,y,h.style.getPropertyPriority(d))},o=function(h){return h.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(h){var d=[];return h.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(h){return h.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(h){return h.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},v=function(h){var d=[];return h.forEach(function(y,O){y.url&&!t.isDataUri(y.url)&&d.push(O)}),d},S=function(h){var d=[];return h.forEach(function(y,O){y.url&&!t.isDataUri(y.url)&&d.push(O)}),d};e.adjustPathsOfCssResources=function(h,d){var y=o(d),O=l(y),k=!1;return O.forEach(function(C){var w=n.parse(C.value),P=v(w),x;P.length>0&&(P.forEach(function(A){var R=w[A].url,M=t.joinUrl(h,R);w[A].url=M}),x=n.serialize(w),a(C.rule,C.property,x),k=!0)}),u(d).forEach(function(C){var w=C.style.getPropertyValue("src"),P,x;try{P=i.parse(w)}catch{return}x=S(P),x.length>0&&(x.forEach(function(A){var R=P[A].url,M=t.joinUrl(h,R);P[A].url=M}),r.changeFontFaceRuleSrc(d,C,i.serialize(P)),k=!0)}),f(d).forEach(function(C){var w=C.href,P=t.joinUrl(h,w);r.exchangeRule(d,C,"@import url("+P+");"),k=!0}),k};var _=function(h,d,y){var O=h.indexOf(d);h.splice(O,1),y.forEach(function(k,C){h.splice(O+C,0,k)})},p=function(h,d,y,O){var k=d.href,C;return k=r.unquoteString(k),C=t.joinUrl(O.baseUrl,k),y.indexOf(C)>=0?(_(h,d,[]),Promise.resolve([])):(y.push(C),t.ajax(k,O).then(function(w){var P=r.rulesForCssText(w);return e.loadCSSImportsForRules(P,y,O).then(function(x){return e.adjustPathsOfCssResources(k,P),_(h,d,P),x.errors})},function(w){throw{resourceType:"stylesheet",url:w.url,msg:"Unable to load stylesheet "+w.url}}))};e.loadCSSImportsForRules=function(h,d,y){var O=f(h),k=[],C=!1;return Promise.all(O.map(function(w){return p(h,w,d,y).then(function(P){k=k.concat(P),C=!0},function(P){k.push(P)})})).then(function(){return{hasChanges:C,errors:k}})};var E=function(h,d){var y=n.parse(h),O=v(y),k=!1;return t.collectAndReportErrors(O.map(function(C){var w=y[C].url;return t.getDataURIForImageURL(w,d).then(function(P){y[C].url=P,k=!0},function(P){throw{resourceType:"backgroundImage",url:P.url,msg:"Unable to load background-image "+P.url}})})).then(function(C){return{backgroundValue:n.serialize(y),hasChanges:k,errors:C}})},b=function(h,d){var y=o(h),O=l(y),k=[],C=!1;return Promise.all(O.map(function(w){return E(w.value,d).then(function(P){P.hasChanges&&(a(w.rule,w.property,P.backgroundValue),C=!0),k=k.concat(P.errors)})})).then(function(){return{hasChanges:C,errors:k}})},m=function(h,d){var y=!1,O,k;try{O=i.parse(h)}catch{O=[]}return k=S(O),t.collectAndReportErrors(k.map(function(C){var w=O[C],P=w.format||"woff";return t.binaryAjax(w.url,d).then(function(x){var A=btoa(x);w.url="data:font/"+P+";base64,"+A,y=!0},function(x){throw{resourceType:"fontFace",url:x.url,msg:"Unable to load font-face "+x.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(O),hasChanges:y,errors:C}})},g=function(h,d){var y=u(h),O=[],k=!1;return Promise.all(y.map(function(C){var w=C.style.getPropertyValue("src");return m(w,d).then(function(P){P.hasChanges&&(r.changeFontFaceRuleSrc(h,C,P.srcDeclarationValue),k=!0),O=O.concat(P.errors)})})).then(function(){return{hasChanges:k,errors:O}})};e.loadAndInlineCSSResourcesForRules=function(h,d){var y=!1,O=[];return Promise.all([b,g].map(function(k){return k(h,d).then(function(C){y=y||C.hasChanges,O=O.concat(C.errors)})})).then(function(){return{hasChanges:y,errors:O}})}}(nv)),nv}var T_;function JD(){return T_||(T_=1,function(e){var t=y0(),r=YD(),n=KD(),i=QD(),a=N2(),o=function(m){return t.joinUrl(m,".")},l=function(m){var g=m.map(function(h,d){return d===m.length-1&&(h={baseUrl:o(h.baseUrl)}),JSON.stringify(h)});return g},u=function(m,g){return g.cache!==!1&&g.cache!=="none"&&g.cacheBucket?t.memoize(m,l,g.cacheBucket):m},f=function(m,g,h){var d=a.rulesForCssText(m);return i.loadCSSImportsForRules(d,g,h).then(function(y){return i.loadAndInlineCSSResourcesForRules(d,h).then(function(O){var k=y.errors.concat(O.errors),C=y.hasChanges||O.hasChanges;return C&&(m=a.cssRulesToText(d)),{hasChanges:C,content:m,errors:k}})})},v=function(m,g,h){var d=m.textContent,y=u(f,g);return y(d,h,g).then(function(O){return O.hasChanges&&(m.childNodes[0].nodeValue=O.content),t.cloneArray(O.errors)})},S=function(m){var g=m.getElementsByTagName("style");return Array.prototype.filter.call(g,function(h){return!h.attributes.type||h.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(m,g){var h=S(m),d=[],y=[],O;return O=t.clone(g),O.baseUrl=O.baseUrl||t.getDocumentBaseUrl(m),Promise.all(h.map(function(k){return v(k,O,y).then(function(C){d=d.concat(C)})})).then(function(){return d})};var _=function(m,g){var h=m.parentNode,d;g=g.trim(),g&&(d=m.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(m.ownerDocument.createTextNode(g)),h.insertBefore(d,m)),h.removeChild(m)},p=function(m,g){return t.ajax(m,g).then(function(h){var d=a.rulesForCssText(h);return{content:h,cssRules:d}}).then(function(h){var d=i.adjustPathsOfCssResources(m,h.cssRules);return{content:h.content,cssRules:h.cssRules,hasChanges:d}}).then(function(h){return i.loadCSSImportsForRules(h.cssRules,[],g).then(function(d){return{content:h.content,cssRules:h.cssRules,hasChanges:h.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(h){return i.loadAndInlineCSSResourcesForRules(h.cssRules,g).then(function(d){return{content:h.content,cssRules:h.cssRules,hasChanges:h.hasChanges||d.hasChanges,errors:h.errors.concat(d.errors)}})}).then(function(h){var d=h.content;return h.hasChanges&&(d=a.cssRulesToText(h.cssRules)),{content:d,errors:h.errors}})},E=function(m,g){var h=m.attributes.href.value,d=t.getDocumentBaseUrl(m.ownerDocument),y=t.clone(g);!y.baseUrl&&d&&(y.baseUrl=d);var O=u(p,g);return O(h,y).then(function(k){return{content:k.content,errors:t.cloneArray(k.errors)}})},b=function(m){var g=m.getElementsByTagName("link");return Array.prototype.filter.call(g,function(h){return h.attributes.rel&&h.attributes.rel.value==="stylesheet"&&(!h.attributes.type||h.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(m,g){var h=b(m),d=[];return Promise.all(h.map(function(y){return E(y,g).then(function(O){_(y,O.content+`
150
+ `),d=d.concat(O.errors)},function(O){d.push({resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(m,g){var h=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return g.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(y){return y(m,g).then(function(O){h=h.concat(O)})})).then(function(){return h})}}(Jg)),Jg}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
151
+ * http://www.github.com/cburgmer/rasterizeHTML.js
152
+ * 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(wS(),qD(),WD(),JD()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(Se,function(t,r,n,i){var a=function(E){var b={},m=[];b.joinUrl=function(d,y){return d?E.resolve(d,y):y},b.getConstantUniqueIdFor=function(d){return m.indexOf(d)<0&&m.push(d),m.indexOf(d)},b.clone=function(d){var y={},O;for(O in d)d.hasOwnProperty(O)&&(y[O]=d[O]);return y};var g=function(d){return typeof d=="object"&&d!==null},h=function(d){return g(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||h(d[0])?(y.canvas=d[0]||null,y.options=b.clone(d[1])):y.options=b.clone(d[0]),y},b}(t),o=function(E){var b={},m=function(g,h,d){var y=g[h];return g[h]=function(){var O=Array.prototype.slice.call(arguments);return d.apply(this,[O,y])},y};return b.baseUrlRespectingXhr=function(g,h){var d=function(){var y=new g;return m(y,"open",function(O,k){var C=O.shift(),w=O.shift(),P=E.joinUrl(h,w);return k.apply(this,[C,P].concat(O))}),y};return d},b.finishNotifyingXhr=function(g){var h=0,d=0,y=!1,O,k=new Promise(function(w){O=function(){var P=h-d;P<=0&&y&&w({totalCount:h})}}),C=function(){var w=new g;return m(w,"send",function(P,x){return h+=1,x.apply(this,arguments)}),w.addEventListener("load",function(){d+=1,O()}),w};return C.waitForRequestsToFinish=function(){return y=!0,O(),k},C},b}(a),l=function(){var E={},b=function(C){return Array.prototype.slice.call(C)};E.addClassName=function(C,w){C.className+=" "+w},E.addClassNameRecursively=function(C,w){E.addClassName(C,w),C.parentNode!==C.ownerDocument&&E.addClassNameRecursively(C.parentNode,w)};var m=function(C,w){var P=C.parentStyleSheet,x=b(P.cssRules).indexOf(C);P.insertRule(w,x+1),P.deleteRule(x)},g=function(C,w){var P=C.cssText.replace(/^[^\{]+/,""),x=w+" "+P;m(C,x)},h=function(C){return b(C).reduce(function(w,P){return w+P.cssText},"")},d=function(C){C.textContent=h(C.sheet.cssRules)},y=function(C){var w=document.implementation.createHTMLDocument(""),P=document.createElement("style");P.textContent=C.textContent,w.body.appendChild(P),C.sheet=P.sheet},O=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},k=function(C,w,P){var x=O(w);b(C.querySelectorAll("style")).forEach(function(A){typeof A.sheet>"u"&&y(A);var R=b(A.sheet.cssRules).filter(function(M){return M.selectorText&&new RegExp(x,"i").test(M.selectorText)});R.length&&(R.forEach(function(M){var U=M.selectorText.replace(new RegExp(x,"gi"),function(V,q,z){return q+P(z)});U!==M.selectorText&&g(M,U)}),d(A))})};return E.rewriteCssSelectorWith=function(C,w,P){k(C,[w],function(){return P})},E.lowercaseCssTypeSelectors=function(C,w){k(C,w,function(P){return P.toLowerCase()})},E.findHtmlOnlyNodeNames=function(C){var w=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),P={},x={},A;do A=w.currentNode.tagName.toLowerCase(),w.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?P[A]=!0:x[A]=!0;while(w.nextNode());return Object.keys(P).filter(function(R){return!x[R]})},E}(),u=function(E){var b={},m=function(h){return Array.prototype.slice.call(h)},g={active:!0,hover:!0,focus:!1,target:!1};return b.fakeUserAction=function(h,d,y){var O=h.querySelector(d),k=":"+y,C="rasterizehtml"+y;O&&(g[y]?E.addClassNameRecursively(O,C):E.addClassName(O,C),E.rewriteCssSelectorWith(h,k,"."+C))},b.persistInputValues=function(h){var d=h.querySelectorAll("input"),y=h.querySelectorAll("textarea"),O=function(k){return k.type==="checkbox"||k.type==="radio"};m(d).filter(O).forEach(function(k){k.checked?k.setAttribute("checked",""):k.removeAttribute("checked")}),m(d).filter(function(k){return!O(k)}).forEach(function(k){k.setAttribute("value",k.value)}),m(y).forEach(function(k){k.textContent=k.value})},b.rewriteTagNameSelectorsToLowerCase=function(h){E.lowercaseCssTypeSelectors(h,E.findHtmlOnlyNodeNames(h))},b}(l),f=function(E,b,m,g){var h={},d=function(z,F,G,L){var I=z.createElement(F);return I.style.visibility="hidden",I.style.width=G+"px",I.style.height=L+"px",I.style.position="absolute",I.style.top=-1e4-L+"px",I.style.left=-1e4-G+"px",z.getElementsByTagName("body")[0].appendChild(I),I},y=function(z){return z>0?new Promise(function(F){setTimeout(F,z)}):Promise.resolve()};h.executeJavascript=function(z,F){return new Promise(function(G){var L=d(g.document,"iframe",F.width,F.height),I=z.outerHTML,B=[],D=F.executeJsTimeout||0,$=function(){g.document.getElementsByTagName("body")[0].removeChild(L)},K=function(){var Z=L.contentDocument;G({document:Z,errors:B,cleanUp:$})},Y=L.contentWindow.XMLHttpRequest,H=b.finishNotifyingXhr(Y),X=b.baseUrlRespectingXhr(H,F.baseUrl);L.onload=function(){y(D).then(H.waitForRequestsToFinish).then(K)},L.contentDocument.open(),L.contentWindow.XMLHttpRequest=X,L.contentWindow.onerror=function(Z){B.push({resourceType:"scriptExecution",msg:Z})},L.contentDocument.write("<!DOCTYPE html>"),L.contentDocument.write(I),L.contentDocument.close()})};var O=function(z,F,G){var L=z.createElement("iframe");return L.style.width=F+"px",L.style.height=G+"px",L.style.visibility="hidden",L.style.position="absolute",L.style.top=-1e4-G+"px",L.style.left=-1e4-F+"px",L.style.borderWidth=0,L.sandbox="allow-same-origin",L.scrolling="no",L},k=function(z,F,G){var L=Math.floor(z/G),I=Math.floor(F/G);return O(g.document,L,I)},C=function(z,F,G,L){return{width:Math.max(z.width*L,F),height:Math.max(z.height*L,G)}},w=function(z,F){var G=z.querySelector(F);if(G)return G;if(z.ownerDocument.querySelector(F)===z)return z;throw{message:"Clipping selector not found"}},P=function(z,F,G,L,I){var B=Math.max(z.scrollWidth,z.clientWidth),D=Math.max(z.scrollHeight,z.clientHeight),$,K,Y,H,X,Z,J,ee;return F?(Z=w(z,F),J=Z.getBoundingClientRect(),$=J.top,K=J.left,Y=J.width,H=J.height):($=0,K=0,Y=B,H=D),ee=C({width:Y,height:H},G,L,I),X=g.getComputedStyle(z.ownerDocument.documentElement).fontSize,{left:K,top:$,width:ee.width,height:ee.height,viewportWidth:B,viewportHeight:D,rootFontSize:X}},x=function(z,F){var G=z.tagName;return F.querySelector(G)},A=function(z){var F=z.tagName.toLowerCase();return F==="html"||F==="body"?z.outerHTML:'<body style="margin: 0;">'+z.outerHTML+"</body>"};h.calculateDocumentContentSize=function(z,F){return new Promise(function(G,L){var I=F.zoom||1,B;B=k(F.width,F.height,I),g.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var D=B.contentDocument,$;try{$=P(x(z,D),F.clip,F.width,F.height,I),G($)}catch(K){L(K)}finally{g.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(A(z)),B.contentDocument.close()})},h.parseHtmlFragment=function(z){var F=g.document.implementation.createHTMLDocument("");F.documentElement.innerHTML=z;var G=F.querySelector("body").firstChild;if(!G)throw"Invalid source";return G};var R=function(z,F){var G=/<html((?:\s+[^>]*)?)>/im.exec(F),L=g.document.implementation.createHTMLDocument(""),I,B,D,$;if(G)for(I="<div"+G[1]+"></div>",L.documentElement.innerHTML=I,D=L.querySelector("div"),B=0;B<D.attributes.length;B++)$=D.attributes[B],z.documentElement.setAttribute($.name,$.value)};h.parseHTML=function(z){var F=g.document.implementation.createHTMLDocument("");return F.documentElement.innerHTML=z,R(F,z),F};var M=function(z){try{return m.failOnParseError(z)}catch(F){throw{message:"Invalid source",originalError:F}}};h.validateXHTML=function(z){var F=new DOMParser,G=F.parseFromString(z,"application/xml");M(G)};var U=null,V=function(z,F){return F==="none"||F==="repeated"?((U===null||F!=="repeated")&&(U=Date.now()),z+"?_="+U):z},q=function(z,F){return new Promise(function(G,L){var I=new window.XMLHttpRequest,B=E.joinUrl(F.baseUrl,z),D=V(B,F.cache),$=function(K){L({message:"Unable to load page",originalError:K})};I.addEventListener("load",function(){I.status===200||I.status===0?G(I.responseXML):$(I.statusText)},!1),I.addEventListener("error",function(K){$(K)},!1);try{I.open("GET",D,!0),I.responseType="document",I.send(null)}catch(K){$(K)}})};return h.loadDocument=function(z,F){return q(z,F).then(function(G){return M(G)})},h}(a,o,n,window),v=function(E){var b={},m=function(x,A){return A?URL.createObjectURL(new Blob([x],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(x)},g=function(x){x instanceof Blob&&URL.revokeObjectURL(x)},h='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(x){return new Promise(function(A,R){var M=document.createElement("canvas"),U=new Image;U.onload=function(){var V=M.getContext("2d");try{V.drawImage(U,0,0),M.toDataURL("image/png"),A(!0)}catch{A(!1)}},U.onerror=R,U.src=x})},y=function(){var x=m(h,!0);return d(x).then(function(A){return g(x),A?!1:d(m(h,!1)).then(function(R){return R})},function(){return!1})},O=function(){if(E.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},k=function(){return new Promise(function(x,A){O()&&E.URL?y().then(function(R){x(!R)},function(){A()}):x(!1)})},C,w=function(){return C===void 0&&(C=k()),C},P=function(x){return w().then(function(A){return m(x,A)})};return b.renderSvg=function(x){return new Promise(function(A,R){var M,U,V=function(){U.onload=null,U.onerror=null},q=function(){M&&g(M)};U=new Image,U.onload=function(){V(),q(),A(U)},U.onerror=function(){q(),R()},P(x).then(function(z){M=z,U.src=M},R)})},b}(window),S=function(E,b,m,g){var h={},d=function(x,A){var R=A||1,M={width:x.width,height:x.height,"font-size":x.rootFontSize};return R!==1&&(M.style="transform:scale("+R+"); transform-origin: 0 0;"),M},y=function(x){var A,R,M,U;A=Math.round(x.viewportWidth),R=Math.round(x.viewportHeight),M=-x.left,U=-x.top;var V={x:M,y:U,width:A,height:R};return V},O=function(x){var A=x.style||"";x.style=A+"float: left;"},k=function(x){x.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},w=function(x){var A=Object.keys(x);return A.length?" "+A.map(function(R){return R+'="'+x[R]+'"'}).join(" "):""},P=function(x,A,R){var M=g.serializeToString(x);b.validateXHTML(M);var U=y(A);return O(U),k(U),'<svg xmlns="http://www.w3.org/2000/svg"'+w(d(A,R))+">"+C()+"<foreignObject"+w(U)+">"+M+"</foreignObject></svg>"};return h.getSvgForDocument=function(x,A,R){return m.rewriteTagNameSelectorsToLowerCase(x),P(x,A,R)},h.drawDocumentAsSvg=function(x,A){return["hover","active","focus","target"].forEach(function(R){A[R]&&m.fakeUserAction(x,A[R],R)}),b.calculateDocumentContentSize(x,A).then(function(R){return h.getSvgForDocument(x,R,A.zoom)})},h}(a,f,u,r),_=function(E,b,m,g,h,d){var y={},O=function(x){return{message:"Error rendering page",originalError:x}},k=function(x){return h.renderSvg(x).then(function(A){return{image:A,svg:x}},function(A){throw O(A)})},C=function(x,A){try{A.getContext("2d").drawImage(x,0,0)}catch(R){throw O(R)}},w=function(x,A,R){return g.drawDocumentAsSvg(x,R).then(k).then(function(M){return A&&C(M.image,A),M})},P=function(x,A){return b.executeJavascript(x,A).then(function(R){var M=R.document;return m.persistInputValues(M),{document:M,errors:R.errors,cleanUp:R.cleanUp}})};return y.rasterize=function(x,A,R){var M;return M=E.clone(R),M.inlineScripts=R.executeJs===!0,d.inlineReferences(x,M).then(function(U){return R.executeJs?P(x,R).then(function(V){return{element:V.document.documentElement,errors:U.concat(V.errors),cleanUp:V.cleanUp}}):{element:x,errors:U,cleanUp:function(){}}}).then(function(U){return w(U.element,A,R).then(function(V){return U.cleanUp(),{image:V.image,svg:V.svg,errors:U.errors}})})},y}(a,f,u,S,v,i),p=function(E,b,m){var g={},h=function(C,w){var P=300,x=200,A=C?C.width:P,R=C?C.height:x,M=w.width!==void 0?w.width:A,U=w.height!==void 0?w.height:R;return{width:M,height:U}},d=function(C){var w=h(C.canvas,C.options),P;return P=E.clone(C.options),P.width=w.width,P.height=w.height,P};g.drawDocument=function(){var C=arguments[0],w=Array.prototype.slice.call(arguments,1),P=E.parseOptionalParameters(w),x=C.documentElement?C.documentElement:C;return m.rasterize(x,P.canvas,d(P))};var y=function(C,w,P){var x=b.parseHTML(C);return g.drawDocument(x,w,P)};g.drawHTML=function(){var C=arguments[0],w=Array.prototype.slice.call(arguments,1),P=E.parseOptionalParameters(w);return y(C,P.canvas,P.options)};var O=function(C,w,P){var x=document.implementation.createHTMLDocument("");x.replaceChild(C.documentElement,x.documentElement);var A=P?E.clone(P):{};return P.baseUrl||(A.baseUrl=w),{document:x,options:A}},k=function(C,w,P){return b.loadDocument(C,P).then(function(x){var A=O(x,C,P);return g.drawDocument(A.document,w,A.options)})};return g.drawURL=function(){var C=arguments[0],w=Array.prototype.slice.call(arguments,1),P=E.parseOptionalParameters(w);return k(C,P.canvas,P.options)},g}(a,f,_);return p})})(mS);var eF=mS.exports;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(v,S,_,p){p===void 0&&(p=_);var E=Object.getOwnPropertyDescriptor(S,_);E&&!("get"in E?!S.__esModule:E.writable||E.configurable)||(E={enumerable:!0,get:function(){return S[_]}}),Object.defineProperty(v,p,E)}:function(v,S,_,p){p===void 0&&(p=_),v[p]=S[_]}),r=Se&&Se.__setModuleDefault||(Object.create?function(v,S){Object.defineProperty(v,"default",{enumerable:!0,value:S})}:function(v,S){v.default=S}),n=Se&&Se.__importStar||function(v){if(v&&v.__esModule)return v;var S={};if(v!=null)for(var _ in v)_!=="default"&&Object.prototype.hasOwnProperty.call(v,_)&&t(S,v,_);return r(S,v),S};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=void 0;const i=n(eF),a=Pu,o=`
153
+ <style>
154
+ html, body {
155
+ padding: 0;
156
+ margin: 0;
157
+ }
158
+ p {
159
+ margin: 0;
160
+ padding: 0
161
+ }
162
+ ul {
163
+ list-style-position: inside;
164
+ margin: 0;
165
+ }
166
+ </style>
167
+ `,l=document.createElement("div");function u(v){const S=document.createElement("div");S.innerHTML=v,S.style.display="inline-block",S.style.position="fixed",S.style.top="0px",S.style.left="0px",S.style.zIndex="1000",l.appendChild(S);const _=S.getBoundingClientRect();return l.removeChild(S),{width:_.width,height:_.height}}async function f({html:v,width:S,height:_,fontFamily:p,padding:E,font:b,pixelRatio:m}){const g=document.createElement("canvas");if(p!=="Arial"&&!b){const y=(0,a.getGoogleFontsVariants)();v+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${p}:${y}" rel="stylesheet">`}if(b){const y=b.styles||(b.url?[{src:`url("${b.url}")`}]:[]);v+="<style>",y.forEach(O=>{v+=`
168
+ @font-face {
169
+ font-family: '${p}';
170
+ src: ${O.src};
171
+ font-style: ${O.fontStyle||"normal"};
172
+ font-weight: ${O.fontWeight||"normal"};
173
+ }
174
+ `}),v+="</style>"}v+=o;const h=await i.drawHTML(`<div style="padding: ${E}px;">${v}</div>`,g,{width:S+2*E,height:_+2*E});g.width=(S+2*E)*m,g.height=(_+2*E)*m;const d=g.getContext("2d");return d==null||d.drawImage(h.image,0,0,h.image.width*m,h.image.height*m),g}l.id="polotno-hidden-do-not-touch",l.style.overflow="hidden",l.style.position="relative",document.body.appendChild(l),l.innerHTML=`<style>
175
+ #polotno-hidden-do-not-touch p {
176
+ margin: 0;
177
+ padding: 0
178
+ }
179
+ #polotno-hidden-do-not-touch ul {
180
+ list-style-position: inside;
181
+ margin: 0;
182
+ }
183
+ </style>`,e.detectSize=u,e.htmlToCanvas=f})(vS);var I2={},D2={};(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),O=y.data;return y.data="",O},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,y)=>{let O="",k="",C="";for(let w in d){let P=d[w];w[0]=="@"?w[1]=="i"?O=w+" "+P+";":k+=w[1]=="f"?o(P,w):w+"{"+o(P,w[1]=="k"?"":y)+"}":typeof P=="object"?k+=o(P,y?y.replace(/([^,])+/g,x=>w.replace(/(^:.*)|([^,])+/g,A=>/&/.test(A)?A.replace(/&/g,x):x?x+" "+A:A)):w):P!=null&&(w=w.replace(/[A-Z]/g,"-$&").toLowerCase(),C+=o.p?o.p(w,P):w+":"+P+";")}return O+(y&&C?y+"{"+C+"}":C)+k},l={},u=d=>{if(typeof d=="object"){let y="";for(let O in d)y+=O+u(d[O]);return y}return d},f=(d,y,O,k,C)=>{let w=u(d),P=l[w]||(l[w]=(x=>{let A=0,R=11;for(;A<x.length;)R=101*R+x.charCodeAt(A++)>>>0;return"go"+R})(w));if(!l[P]){let x=w!==d?d:(A=>{let R,M=[{}];for(;R=i.exec(A.replace(a,""));)R[4]?M.shift():R[3]?M.unshift(M[0][R[3]]=M[0][R[3]]||{}):M[0][R[1]]=R[2];return M[0]})(d);l[P]=o(C?{["@keyframes "+P]:x}:x,O?"":"."+P)}return((x,A,R)=>{A.data.indexOf(x)==-1&&(A.data=R?x+A.data:A.data+x)})(l[P],y,k),P},v=(d,y,O)=>d.reduce((k,C,w)=>{let P=y[w];if(P&&P.call){let x=P(O),A=x&&x.props&&x.props.className||/^go/.test(x)&&x;P=A?"."+A:x&&typeof x=="object"?x.props?"":o(x,""):x===!1?"":x}return k+C+(P??"")},"");function S(d){let y=this||{},O=d.call?d(y.p):d;return f(O.unshift?O.raw?v(O,[].slice.call(arguments,1),y.p):O.reduce((k,C)=>Object.assign(k,C&&C.call?C(y.p):C),{}):O,r(y.target),y.g,y.o,y.k)}e.extractCss=n,e.css=S;let _,p,E,b=S.bind({g:1}),m=S.bind({k:1});function g(d,y,O,k){o.p=y,_=d,p=O,E=k}function h(d,y){let O=this||{};return function(){let k=arguments;function C(w,P){let x=Object.assign({},w),A=x.className||C.className;O.p=Object.assign({theme:p&&p()},x),O.o=/ *go\d+/.test(A),x.className=S.apply(O,k)+(A?" "+A:""),y&&(x.ref=P);let R=d;return d[0]&&(R=x.as||d,delete x.as),E&&R[0]&&E(x),_(R,x)}return y?y(C):C}}e.glob=b,e.keyframes=m,e.setup=g,e.styled=h})(D2);var tF=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I2,"__esModule",{value:!0});const rF=tF(it),A_=D2;(0,A_.setup)(rF.default.createElement),I2.default=A_.styled;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(q,z,F,G){G===void 0&&(G=F);var L=Object.getOwnPropertyDescriptor(z,F);L&&!("get"in L?!z.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return z[F]}}),Object.defineProperty(q,G,L)}:function(q,z,F,G){G===void 0&&(G=F),q[G]=z[F]}),r=Se&&Se.__setModuleDefault||(Object.create?function(q,z){Object.defineProperty(q,"default",{enumerable:!0,value:z})}:function(q,z){q.default=z}),n=Se&&Se.__importStar||function(q){if(q&&q.__esModule)return q;var z={};if(q!=null)for(var F in q)F!=="default"&&Object.prototype.hasOwnProperty.call(q,F)&&t(z,q,F);return r(z,q),z},i=Se&&Se.__importDefault||function(q){return q&&q.__esModule?q:{default:q}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.quillRef=void 0;const a=i(it),o=Hi,l=Wa,u=i(gS),f=i(vi),v=n(ha),S=hi,_=Of,p=v2,E=Ef,b=vS,m=ql,g=Wl,h=Sf,d=i(I2),y=ua,O=b2,k=n(Pu),C=Yo;e.quillRef=v.observable({enabled:!1,currentFormat:{},editor:v.observable.object({instance:null},{},{deep:!1})});const w=(0,d.default)("div",a.default.forwardRef)`
184
+ .ql-editor {
185
+ outline: none;
186
+ }
187
+ ul {
188
+ list-style-position: inside;
189
+ margin: 0;
190
+ }
191
+ p {
192
+ line-height: auto;
193
+ margin: 0;
194
+ }
195
+ strong {
196
+ font-weight: 1800;
197
+ }
198
+ .ql-direction-rtl {
199
+ direction: rtl;
200
+ }
201
+ `,P=({html:q,onBlur:z,onChange:F,element:G})=>{const L=a.default.useRef(null);a.default.useEffect(()=>{if(!L.current)return;const B=new u.default(L.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["background","bold","color","font","italic","size","strike","underline","indent","align","direction"]});return e.quillRef.editor.instance=B,window.__polotnoQuill=B,B.on("text-change",()=>{B.getSelection()&&(e.quillRef.currentFormat=B.getFormat()),setTimeout(()=>{var D;F((D=L.current)===null||D===void 0?void 0:D.childNodes[0].innerHTML)},10)}),B.setSelection(0,0,"api"),B.on("selection-change",D=>{D||z(),D&&(e.quillRef.currentFormat=B.getFormat())}),L.current.childNodes[0].addEventListener("blur",D=>{var $;!(($=D.relatedTarget)===null||$===void 0)&&$.classList.contains("ql-clipboard")||z()}),()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={},delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var B;const D=e.quillRef.editor.instance;if(!D)return;const $=D.getSelection();if(((B=L.current)===null||B===void 0?void 0:B.childNodes[0].innerHTML)!==G.text){var K=D.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+q+"<p><br></p></div>");D.setContents(K),D.history.clear(),$&&(D.setSelection($.index,$.length),e.quillRef.currentFormat=D.getFormat())}},[G.text]);const I=(0,E.useColor)(G).fill;return a.default.createElement(w,{ref:L,style:{fontSize:G.fontSize,color:I,width:G.a.width,fontFamily:G.fontFamily,lineHeight:G.lineHeight,letterSpacing:G.letterSpacing+"rem",textAlign:G.align},dir:(0,p.getDir)((0,O.removeTags)(G.text))})};function x(q,z,F){return a.default.useMemo(()=>(0,b.detectSize)(q),[q,z.width,F])}function A(q){const z=q.getContext("2d").getImageData(0,0,q.width,q.height).data;for(let F=0;F<z.length;F+=4)if(z[F+3]!==0)return!0;return!1}function R(q){return!A(q)}function M(q,{fontFamily:z="",color:F="black"}={}){let G=`color: ${F||q.fill}`;return`<div style="white-space: unset; width: ${Math.round(q.width||100)}px; ${G}; font-size: ${q.fontSize}px; font-family: '${z}'; text-decoration: ${q.textDecoration}; text-align: ${q.align}; line-height: ${q.lineHeight}; letter-spacing: ${q.letterSpacing}rem; font-style: ${q.fontStyle}; font-weight: ${q.fontWeight}; -webkit-text-stroke: ${q.strokeWidth}px ${q.stroke};" contentEditable dir="${(0,p.getDir)((0,O.removeTags)(q.text))}">${q.text}</div>`}const U=q=>{let z=q.fontSize;for(let F=1;F<50;F++){const G=M(Object.assign(Object.assign({},q.toJSON()),{fontSize:z}),{fontFamily:q.fontFamily}),{height:L}=(0,b.detectSize)(G);if(!(q.height&&L>q.height))break;z-=.5}return z},V=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:q,store:z})=>{const F=a.default.useRef(null),[G,L]=a.default.useState(),[I,B]=a.default.useState(!1),[D,$]=a.default.useState(!0),[K,Y]=a.default.useState(!1),H=a.default.useRef(q.height),X=z.selectedElements.indexOf(q)>=0,Z=q.fontSize/3,{textVerticalResizeEnabled:J}=S.flags,ee=(0,p.usePrevious)(q.fontFamily),[re]=(0,p.useFontLoader)(z,q.fontFamily),ae=q._editModeEnabled;(0,m.useFadeIn)(F);const le=re?q.fontFamily:ee!==q.fontFamily?ee:"Arial",ue=(0,E.useColor)(q).fill,Ae=M(q,{fontFamily:le,color:ue}),{width:ze,height:oe}=x(Ae,q,re);a.default.useEffect(()=>{if(!re)return;if(!q.height)return void q.set({height:oe});const{textOverflow:de}=S.flags;if(de!=="change-font-size"||I)de==="resize"&&(J&&q.height<oe&&z.history.ignore(()=>{q.set({height:oe})}),J||q.height===oe||z.history.ignore(()=>{q.set({height:oe})}));else{const we=U(q);we!==q.fontSize?z.history.ignore(()=>{q.set({fontSize:we})}):q.height!==oe&&(J&&q.height<oe?z.history.ignore(()=>{q.set({height:oe})}):J||z.history.ignore(()=>{q.set({height:oe})}))}});const ie=a.default.useRef(0);a.default.useEffect(()=>{I||ae||(async()=>{ie.current++;const de=ie.current,we=(0,y.incrementLoader)(`text ${q.id}`);$(!0);let _e=null;const Ne=V?5:1;for(let ke=0;ke<Ne;ke++){if(_e=await(0,b.htmlToCanvas)({html:Ae,width:q.width||1,height:q.height||oe||1,fontFamily:le,padding:Z,pixelRatio:z._elementsPixelRatio,font:z.fonts.find(tt=>tt.fontFamily===le)||k.globalFonts.find(tt=>tt.fontFamily===le)}),de!==ie.current)return void we();R(_e)&&V&&await new Promise(tt=>setTimeout(tt,50*(ke+1)))}_e?(L(_e),$(!1),f.default.Util.requestAnimFrame(we)):we()})()},[Ae,I,oe,ae,le,q.height,z._elementsPixelRatio]);const ve=I||D;a.default.useEffect(()=>v.autorun(()=>{const de=F.current;(0,_.applyFilter)(de,q)}),[G,ve,q.shadowColor,q.shadowOffsetX,q.shadowOffsetY,q.shadowOpacity]);let ge=0;q.verticalAlign==="middle"&&(ge=(q.height-oe)/2),q.verticalAlign==="bottom"&&(ge=q.height-oe);const te=(0,p.getLineHeight)({fontLoaded:re,fontFamily:q.fontFamily,fontSize:q.fontSize,lineHeight:q.lineHeight}),he=(0,C.useMobile)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:q.a.x,y:q.a.y,offsetX:q.backgroundPadding*(q.fontSize*te*.5),offsetY:q.backgroundPadding*(q.fontSize*te*.5),rotation:q.rotation,hideInExport:!q.showInExport||!q.text,listening:!1,visible:q.backgroundEnabled,opacity:q.backgroundOpacity,fill:q.backgroundColor,width:q.a.width+q.backgroundPadding*(q.fontSize*te),height:q.a.height+q.backgroundPadding*(q.fontSize*te),cornerRadius:q.backgroundCornerRadius*(q.fontSize*te*.5)}),a.default.createElement(l.Rect,{ref:F,name:"element",x:q.a.x,y:q.a.y,listening:q.selectable,rotation:q.rotation,width:q.a.width,height:q.a.height,visible:!ve,draggable:he?q.draggable&&X:q.draggable,preventDefault:!he||X,opacity:ae?0:q.a.opacity,hideInExport:!q.showInExport,onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onDragMove:de=>{q.set({x:de.target.x(),y:de.target.y()})},onDragEnd:de=>{q.set({x:de.target.x(),y:de.target.y()})},id:q.id,onDblClick:()=>{q.contentEditable&&q.toggleEditMode(!0)},onDblTap:()=>{q.contentEditable&&q.toggleEditMode(!0)},onTransformStart:de=>{B(!0),H.current=q.height},onTransform:de=>{var we;const _e=de.target,Ne=((we=_e.getStage())===null||we===void 0?void 0:we.findOne("Transformer")).getActiveAnchor(),ke=Ne==="middle-left"||Ne==="middle-right",tt=Ne==="top-center"||Ne==="bottom-center",ot=_e.scaleX();if(ke){const gt=_e.scaleX(),Bt=Math.max(_e.width()*gt,q.fontSize);if(_e.width(Bt),_e.scaleX(1),S.flags.textVerticalResizeEnabled){const fe=Math.max(oe,H.current);q.set({height:fe})}q.set({width:Bt,x:_e.x(),y:_e.y()})}else if(tt){let gt=S.flags.textOverflow==="resize"?oe:q.lineHeight*q.fontSize;const Bt=Math.max(gt,de.target.height()*de.target.scaleY());_e.scaleY(1),q.set({x:_e.x(),y:_e.y(),height:Bt,rotation:_e.rotation()})}else _e.scaleX(1),_e.scaleY(1),q.set({fontSize:q.fontSize*ot,width:_e.width()*ot,x:_e.x(),y:_e.y(),rotation:_e.rotation(),height:_e.height()*ot})},onTransformEnd:de=>{B(!1),$(!0);const we=de.target.scaleX();de.target.scaleX(1),de.target.scaleY(1),q.set({fontSize:q.fontSize*we,width:de.target.width()*we,x:de.target.x(),y:de.target.y(),rotation:de.target.rotation(),shadowBlur:q.shadowBlur*we,shadowOffsetX:q.shadowOffsetX*we,shadowOffsetY:q.shadowOffsetY*we,strokeWidth:q.strokeWidth*we})}}),a.default.createElement(l.Image,{ref:F,image:G,x:q.a.x,y:q.a.y,offsetX:Z,offsetY:Z-ge,listening:!1,rotation:q.rotation,width:q.a.width+2*Z,height:q.a.height+2*Z,visible:!ve,opacity:ae?0:q.a.opacity,shadowEnabled:q.shadowEnabled,shadowBlur:q.shadowBlur,shadowOffsetX:q.shadowOffsetX,shadowOffsetY:q.shadowOffsetY,shadowColor:q.shadowColor,shadowOpacity:q.shadowOpacity,hideInExport:!q.showInExport}),ve&&a.default.createElement(l.Group,{x:q.a.x,y:q.a.y,rotation:q.rotation,offsetY:-ge},a.default.createElement(h.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(w,{dangerouslySetInnerHTML:{__html:Ae},style:{pointerEvents:"none",display:"inline-block"}}))),ae&&a.default.createElement(l.Group,{x:q.a.x,y:q.a.y,rotation:q.rotation,offsetY:-ge},a.default.createElement(h.Html,null,a.default.createElement(P,{html:Ae,element:q,onChange:de=>{q.set({text:de})},onBlur:de=>{q.toggleEditMode(!1)}}))),(X||K)&&a.default.createElement(g.Highlighter,{element:q}))})})(hS);var SS={},F2={},b0={};(function(e){var t=Se&&Se.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalClientRect=e.getClientRect=void 0;const r=t(vi);function n(o,l,u,f,v){const S=Math.sqrt(u*u+f*f);return v+=Math.atan2(f,u),{x:o+S*Math.cos(v),y:l+S*Math.sin(v)}}function i(o){const{x:l,y:u,width:f,height:v}=o,S=r.default.Util.degToRad(o.rotation),_=n(l,u,0,0,S),p=n(l,u,f,0,S),E=n(l,u,f,v,S),b=n(l,u,0,v,S),m=Math.min(_.x,p.x,E.x,b.x),g=Math.min(_.y,p.y,E.y,b.y),h=Math.max(_.x,p.x,E.x,b.x),d=Math.max(_.y,p.y,E.y,b.y);return{x:m,y:g,width:h-m,height:d-g,minX:m,minY:g,maxX:h,maxY:d}}function a(o){const l=o.map(_=>i(_)),u=Math.min(...l.map(_=>_.minX)),f=Math.min(...l.map(_=>_.minY)),v=Math.max(...l.map(_=>_.maxX)),S=Math.max(...l.map(_=>_.maxY));return{x:u,y:f,width:v-u,height:S-f,minX:u,minY:f,maxX:v,maxY:S}}e.getClientRect=i,e.getTotalClientRect=a})(b0);(function(e){var t=Se&&Se.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=void 0;const r=t(it),n=t(vi),i=b0;var a=5;function o(S){const _=S.__getNodeRect(),p=(0,i.getClientRect)(Object.assign(Object.assign({},_),{rotation:n.default.Util.radToDeg(_.rotation)})),E=S.getAbsolutePosition();return{vertical:[{guide:p.x,offset:E.x-p.x,snap:"start"},{guide:p.x+p.width/2,offset:E.x-p.x-p.width/2,snap:"center"},{guide:p.x+p.width,offset:E.x-p.x-p.width,snap:"end"}],horizontal:[{guide:p.y,offset:E.y-p.y,snap:"start"},{guide:p.y+p.height/2,offset:E.y-p.y-p.height/2,snap:"center"},{guide:p.y+p.height,offset:E.y-p.y-p.height,snap:"end"}]}}function l(S,_){var p=[],E=[];S.vertical.forEach(y=>{_.vertical.forEach(O=>{var k=Math.abs(y-O.guide);k<a&&p.push({lineGuide:y,diff:k,snap:O.snap,offset:O.offset})})}),S.horizontal.forEach(y=>{_.horizontal.forEach(O=>{var k=Math.abs(y-O.guide);k<a&&E.push({lineGuide:y,diff:k,snap:O.snap,offset:O.offset})})});var b=[];const m=p.sort((y,O)=>y.diff-O.diff),g=E.sort((y,O)=>y.diff-O.diff);var h=m[0],d=g[0];return h&&m.filter(y=>Math.abs(y.diff-h.diff)<.1).forEach(y=>{b.push(Object.assign({orientation:"V"},y))}),d&&g.filter(y=>Math.abs(y.diff-d.diff)<.1).forEach(y=>{b.push(Object.assign({orientation:"H"},y))}),b}function u(S){const _=h=>h.hasName("element")||h.hasName("page-background")||h.hasName("elements-area");function p(h){var d;const y=(d=S.current)===null||d===void 0?void 0:d.getStage();var O=[],k=[];return y.find(_).forEach(C=>{if(!(h.indexOf(C)>=0)){var w=C.getClientRect({skipShadow:!0,skipStroke:!0});O.push(w.x,w.x+w.width,w.x+w.width/2),k.push(w.y,w.y+w.height,w.y+w.height/2)}}),{vertical:O,horizontal:k}}function E(h){var d;const y=(d=S.current)===null||d===void 0?void 0:d.getLayer(),O=y==null?void 0:y.children.find(k=>k.name()==="line-guides");h.forEach(k=>{if(k.orientation==="H"){var C=new n.default.Line({points:[-6e3,k.lineGuide,6e3,k.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});O==null||O.add(C),y.batchDraw()}else k.orientation==="V"&&(C=new n.default.Line({points:[k.lineGuide,-6e3,k.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),O==null||O.add(C))})}const b=h=>{h.target.getLayer().children.find(w=>w.name()==="line-guides").destroyChildren();var d=l(p(h.target.nodes()),o(h.target));if(!d.length)return;E(d);const y=h.target.getAbsolutePosition(),O=Object.assign({},y);d.forEach(w=>{switch(w.snap){case"start":case"center":case"end":switch(w.orientation){case"V":O.x=w.lineGuide+w.offset;break;case"H":O.y=w.lineGuide+w.offset}}});const k=O.x-y.x,C=O.y-y.y;h.evt.ctrlKey||h.evt.metaKey||h.target.nodes().forEach(w=>{const P=w.getAbsolutePosition();w.setAbsolutePosition({x:P.x+k,y:P.y+C})})},m=(h,d,y)=>{const O=S.current,k=O.getLayer();if(k.children.find(R=>R.name()==="line-guides").destroyChildren(),O.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(d.x-h.x,2)+Math.pow(d.y-h.y,2))>50||!k)return d;var C=l(p(O.nodes()),{vertical:[{guide:d.x,offset:0,snap:"start"}],horizontal:[{guide:d.y,offset:0,snap:"start"}]});if(!C.length||(E(C),y.ctrlKey||y.metaKey))return d;let w=d.x,P=d.x;C.forEach(R=>{switch(R.orientation){case"V":w=R.lineGuide;break;case"H":P=R.lineGuide}});const x=Math.abs(d.x-w)<10,A=Math.abs(d.y-P)<10;return x&&!A?{x:w,y:h.y}:A&&!x?{x:h.x,y:P}:x&&A?{x:w,y:P}:d},g=h=>{if(!h.target)return;const d=h.target.getLayer();d.children.find(y=>y.name()==="line-guides").destroyChildren(),d.batchDraw()};r.default.useEffect(()=>{S.current&&(S.current.anchorDragBoundFunc(m),S.current.on("dragstart",()=>{setTimeout(()=>{const h=[...n.default.DD._dragElements.entries()];h.reverse(),n.default.DD._dragElements.clear(),h.forEach(([d,y])=>{n.default.DD._dragElements.set(d,y)})})}),S.current.on("dragmove",b),S.current.on("dragend",g),S.current.on("transformend",g),S.current.on("transform",h=>{var d,y;h.evt.ctrlKey||h.evt.metaKey?(d=S.current)===null||d===void 0||d.rotationSnapTolerance(0):(y=S.current)===null||y===void 0||y.rotationSnapTolerance(5)}))},[])}function f(S){return{vertical:[{guide:S.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:S.absolutePosition().y,offset:0,snap:"center"}]}}function v(S,_,p){const E=g=>g.hasName("element")||g.hasName("line-anchor")||g.hasName("page-background")||g.hasName("elements-area"),b=g=>{g.target.getLayer().children.find(C=>C.name()==="line-guides").destroyChildren();var h=l(function(C){var w;const P=(w=S.current)===null||w===void 0?void 0:w.getStage();var x=[],A=[];return P.find(E).forEach(R=>{if(!(C.indexOf(R)>=0)){var M=R.getClientRect({skipShadow:!0,skipStroke:!0});R.hasName("line-anchor")&&(M={x:R.absolutePosition().x,y:R.absolutePosition().y,width:0,height:0}),x.push(M.x,M.x+M.width,M.x+M.width/2),A.push(M.y,M.y+M.height,M.y+M.height/2)}}),{vertical:x,horizontal:A}}([g.target,..._.map(C=>C.current)]),f(g.target));if(!h.length)return;(function(C){var w;const P=(w=S.current)===null||w===void 0?void 0:w.getLayer(),x=P==null?void 0:P.children.find(A=>A.name()==="line-guides");C.forEach(A=>{if(A.orientation==="H"){var R=new n.default.Line({points:[-6e3,A.lineGuide,6e3,A.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});x==null||x.add(R),P.batchDraw()}else A.orientation==="V"&&(R=new n.default.Line({points:[A.lineGuide,-6e3,A.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),x==null||x.add(R))})})(h);const d=g.target.getAbsolutePosition(),y=Object.assign({},d);h.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 O=y.x-d.x,k=y.y-d.y;if(!(g.evt.ctrlKey||g.evt.metaKey)){const C=g.target.getAbsolutePosition();g.target.absolutePosition({x:C.x+O,y:C.y+k})}},m=g=>{if(!g.target)return;const h=g.target.getLayer();h.children.find(d=>d.name()==="line-guides").destroyChildren(),h.batchDraw()};r.default.useEffect(()=>{S.current&&(S.current.on("dragmove",b),S.current.on("dragend",m))},p)}e.useSnap=u,e.useAnchorSnap=v})(F2);(function(e){var t=Se&&Se.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(it),n=Hi,i=Wa,a=Ef,o=Sf,l=Wl,u=F2,f=Yo;function v(E){const{x:b,y:m,width:g,height:h,rotation:d}=E.a,y=d*Math.PI/180,O={x:b+h/2*Math.cos(y+Math.PI/2),y:m+h/2*Math.sin(y+Math.PI/2)};return{middleLeft:O,middleRight:{x:O.x+g*Math.cos(y),y:O.y+g*Math.sin(y)}}}function S(E,b,m){const g=Math.sqrt(Math.pow(b.x-E.x,2)+Math.pow(b.y-E.y,2)),h=Math.atan2(b.y-E.y,b.x-E.x),d=180*h/Math.PI;return{x:E.x+Math.cos(h-Math.PI/2)*m/2,y:E.y+Math.sin(h-Math.PI/2)*m/2,width:g,height:m,rotation:d}}e.getMiddlePoints=v,e.getLinePositionFromMiddlePoints=S;const _=(E,b)=>({offsetX:5/E,offsetY:5/E,width:10/E,height:10/E,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:m=>{m.target.getStage().container().style.cursor="crosshair"},onMouseLeave:m=>{m.target.getStage().container().style.cursor=""},onDragStart:m=>{b.history.startTransaction()},onDragEnd:m=>{b.history.endTransaction()}}),p=(0,n.observer)(({element:E,type:b})=>{const m=(0,a.useColor)(E,E.a.color,"fill"),g=(0,a.useColor)(E,E.a.color,"stroke"),h=Object.assign(Object.assign(Object.assign({strokeWidth:E.height,lineCap:"round",lineJoin:"round"},g),m),{opacity:E.a.opacity,hideInExport:!E.showInExport});return r.default.createElement(r.default.Fragment,null,b==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height]},h)),b==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height],closed:!0},h)),b==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,0,2*E.height],closed:!0},h)),b==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,4*E.height,2*-E.height,4*E.height,2*E.height,0,2*E.height],closed:!0},h)),b==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*E.height,y:0,radius:2*E.height},h)))});e.LineElement=(0,n.observer)(({element:E,store:b})=>{const m=r.default.useRef(null),g=r.default.useRef(null),h=r.default.useRef(null),d=E.selectable||b.role==="admin",y=(0,f.useMobile)(),[O,k]=r.default.useState(!1),C=b.selectedElements.indexOf(E)>=0&&b.selectedElements.length===1,{middleLeft:w,middleRight:P}=v(E);(0,u.useAnchorSnap)(g,[m],[C]),(0,u.useAnchorSnap)(h,[m],[C]);const x=(0,a.useColor)(E,E.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:m,name:"element",id:E.id,x:E.a.x,y:E.a.y,points:[0,0,E.a.width,0],offsetY:-E.a.height/2,strokeWidth:E.a.height,hitStrokeWidth:Math.max(E.a.height,20),dash:E.dash.map(A=>A*E.a.height)},x,{rotation:E.a.rotation,opacity:E.animated("opacity"),shadowEnabled:E.shadowEnabled,shadowBlur:E.shadowBlur,shadowOffsetX:E.shadowOffsetX,shadowOffsetY:E.shadowOffsetY,shadowColor:E.shadowColor,shadowOpacity:E.shadowOpacity,listening:d,draggable:y?E.draggable&&C:E.draggable,preventDefault:!y||C,hideInExport:!E.showInExport,onMouseEnter:()=>{k(!0)},onMouseLeave:()=>{k(!1)},onDragMove:A=>{E.set({x:A.target.x(),y:A.target.y()})},onDragEnd:A=>{E.set({x:A.target.x(),y:A.target.y()})},onTransform:A=>{const R=A.target.scaleX();A.target.scaleX(1),A.target.scaleY(1),E.set({height:E.height*R,width:E.width*R,x:A.target.x(),y:A.target.y(),rotation:A.target.rotation()})}})),r.default.createElement(i.Group,{x:w.x,y:w.y,rotation:E.rotation,hideInExport:!E.showInExport},r.default.createElement(p,{element:E,type:E.startHead})),r.default.createElement(i.Group,{x:P.x,y:P.y,rotation:E.rotation+180},r.default.createElement(p,{element:E,type:E.endHead})),O&&!C&&r.default.createElement(l.Highlighter,{element:E}),C&&E.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:w.x,y:w.y,ref:g,name:"line-anchor"},_(b.scale,b),{onDragMove:A=>{const R=S(A.target.position(),P,E.height);E.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:P.x,y:P.y,ref:h,name:"line-anchor"},_(b.scale,b),{onDragMove:A=>{const R=S(w,A.target.position(),E.height);E.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})))))})})(SS);var ES={};(function(e){var t=Se&&Se.__createBinding||(Object.create?function(L,I,B,D){D===void 0&&(D=B);var $=Object.getOwnPropertyDescriptor(I,B);$&&!("get"in $?!I.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return I[B]}}),Object.defineProperty(L,D,$)}:function(L,I,B,D){D===void 0&&(D=B),L[D]=I[B]}),r=Se&&Se.__setModuleDefault||(Object.create?function(L,I){Object.defineProperty(L,"default",{enumerable:!0,value:I})}:function(L,I){L.default=I}),n=Se&&Se.__importStar||function(L){if(L&&L.__esModule)return L;var I={};if(L!=null)for(var B in L)B!=="default"&&Object.prototype.hasOwnProperty.call(L,B)&&t(I,L,B);return r(I,L),I},i=Se&&Se.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(it),o=Hi,l=ha,u=Wa,f=i(p0),v=i(vi),S=Sf,_=Wl,p=ua,E=n(Cu),b=hi,m=Of,g=ql,h=Yo;function d(){return document.createElement("canvas")}async function y(L){if(!(L.indexOf("data:image/svg+xml")>=0||L.indexOf(".svg")>=0))return L;const I=await E.urlToString(L),B=E.fixSize(I);return E.svgToURL(B)}const O=L=>{const[I,B]=a.default.useState(L);return a.default.useEffect(()=>{(async()=>{const D=await y(L);D!==I&&B(D)})()},[L]),I},k=new window.Image;k.src=E.svgToURL(`
202
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
203
+ <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"/>
204
+ <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"/>
205
+ </svg>
206
+ `);const C=new window.Image;C.src=E.svgToURL(`
207
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
208
+ <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"/>
209
+ <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"/>
210
+ <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"/>
211
+ <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"/>
212
+ </svg>
213
+ `);function w(L,I,B,D,$,K,Y){for(var H=new ImageData(I,B),X=new Int32Array(L.data.buffer),Z=L.width,J=new Int32Array(H.data.buffer),ee=H.width,re=I/K,ae=B/Y,le=Math.round(1/re),ue=Math.round(1/ae),Ae=le*ue,ze=0;ze<H.height;ze++)for(var oe=0;oe<ee;oe++){for(var ie=D+Math.round(oe/re)+($+Math.round(ze/ae))*Z,ve=0,ge=0,te=0,he=0,de=0;de<ue;de++)for(var we=0;we<le;we++){var _e=X[ie+we+de*Z];ve+=_e<<24>>>24,ge+=_e<<16>>>24,te+=_e<<8>>>24,he+=_e>>>24}ve=Math.round(ve/Ae),ge=Math.round(ge/Ae),te=Math.round(te/Ae),he=Math.round(he/Ae),J[oe+ze*ee]=he<<24|te<<16|ge<<8|ve}return H}function P(L,I){var B,D;const $=d();$.width=L.width,$.height=L.height,(B=$.getContext("2d"))===null||B===void 0||B.drawImage(L,0,0,$.width,$.height);const K=w($.getContext("2d").getImageData(0,0,$.width,$.height),Math.floor($.width*I),Math.floor($.height*I),0,0,$.width,$.height);return $.width=Math.floor($.width*I),$.height=Math.floor($.height*I),(D=$.getContext("2d"))===null||D===void 0||D.putImageData(K,0,0),$}const x=(L,I,B,D,$=0,K=!1)=>{const Y=Math.floor(Math.max(L.width*D,1)),H=Math.floor(Math.max(L.height*D,1)),X=Math.min($*D,Y/2,H/2),Z=Math.max(L.width/B.width,L.height/B.height)*D,J=L.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&Z<1&&!K,ee=B.x===0&&B.y===0&&B.width===(I==null?void 0:I.width)&&B.height===(I==null?void 0:I.height),re=a.default.useMemo(()=>{if(!(!I||!I.width||!I.height))return ee&&X===0&&!J?void 0:d()},[I,X,J,ee]);return a.default.useLayoutEffect(()=>{if(!re||!I)return;re.width=Y,re.height=H;const ae=re.getContext("2d");if(!ae)return;X&&(ae.beginPath(),ae.moveTo(X,0),ae.lineTo(Y-X,0),ae.arc(Y-X,X,X,3*Math.PI/2,0,!1),ae.lineTo(Y,H-X),ae.arc(Y-X,H-X,X,0,Math.PI/2,!1),ae.lineTo(X,H),ae.arc(X,H-X,X,Math.PI/2,Math.PI,!1),ae.lineTo(0,X),ae.arc(X,X,X,Math.PI,3*Math.PI/2,!1),ae.clip());const le=J?P(I,Z):I,ue=J?{x:Math.floor(B.x*Z),y:Math.floor(B.y*Z),width:Math.floor(B.width*Z),height:Math.floor(B.height*Z)}:B;ae.drawImage(le,ue.x,ue.y,ue.width,ue.height,0,0,re.width,re.height)},[re,L.width,L.height,B.x,B.y,B.width,B.height,$,D,K,L.page._exportingOrRendering,J]),a.default.useEffect(()=>()=>{re&&re.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(re)},[re]),re||I},A=(L,I,B,D)=>{const $=O(L.clipSrc||""),[K,Y]=V($,"anonymous"),H=L.clipSrc?Y:"loaded";(0,e.useImageLoader)(H,L.id+"-clip");const X=a.default.useMemo(()=>{if(I&&K)return d()},[I,K]);return a.default.useLayoutEffect(()=>{var Z;if(!K||!I||!I.width||!I.height||!K||!K.width||!K.height||!X)return;const J=d(),ee=Math.max(L.width/K.width*B,L.height/K.height*B);J.width=K.width*ee,J.height=K.height*ee,(Z=J.getContext("2d"))===null||Z===void 0||Z.drawImage(K,0,0,J.width,J.height),X.width=Math.max(I.width,1),X.height=Math.max(I.height,1);const re=X.getContext("2d");re&&(re.save(),re.drawImage(J,0,0,I.width,I.height),v.default.Util.releaseCanvas(J),re.globalCompositeOperation="source-in",re.drawImage(I,0,0,X.width,X.height),re.restore())},[X,I,K,L.width,L.height,B,...D]),L.clipSrc&&K?X:I},R=d(),M=(0,o.observer)(({element:L})=>{const I=Math.min(30,L.width/4,L.height/4),B=a.default.useRef(null);return a.default.useEffect(()=>{const D=B.current;if(!D)return;const $=new v.default.Animation(K=>{D.rotate(((K==null?void 0:K.timeDiff)||0)/2)},D.getLayer());return $.start(),()=>{$.stop()}}),a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},a.default.createElement(u.Rect,{width:L.width,height:L.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:B,x:L.width/2,y:L.height/2,fill:"white",outerRadius:Math.abs(I),innerRadius:Math.max(1,I-5),angle:270}))}),U=(0,o.observer)(({element:L})=>{const I="Can not load the video...",B=Math.max(10,Math.min(30,L.width/25));return a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},a.default.createElement(u.Rect,{width:L.width,height:L.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:I,fontSize:B,width:L.width,height:L.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let V=f.default;const q=L=>{V=L};e.setImageLoaderHook=q;const z=(L,I)=>{const B=a.default.useRef(),D=()=>{var $;($=B.current)===null||$===void 0||$.call(B),B.current=void 0};a.default.useEffect(()=>D,[]),a.default.useLayoutEffect(()=>{L!=="loading"||B.current||(B.current=(0,p.incrementLoader)(`video ${I}`)),L!=="loading"&&D(),L==="failed"&&(0,p.triggerLoadError)(`video ${I}`)},[L])};e.useImageLoader=z;function F(L,I){for(var B=L.buffered,D=0;D<B.length;D++)if(I>=B.start(D)&&I<=B.end(D))return!0;return!1}function G(L,I,B){const D=a.default.useRef("loading"),$=a.default.useRef(),[K,Y]=a.default.useState(0),H=a.default.useRef(),X=a.default.useRef(),Z=a.default.useRef();return H.current===L&&X.current===I&&Z.current===B||(D.current="loading",$.current=void 0,H.current=L,X.current=I,Z.current=B),a.default.useLayoutEffect(function(){if(L){var J=document.createElement("video");return J.addEventListener("canplay",ee),J.addEventListener("error",re),J.crossOrigin=I,J.src=L,function(){J.removeEventListener("canplay",ee),J.removeEventListener("error",re)}}function ee(){D.current="loaded",$.current=J,$.current.currentTime=0,Y(Math.random()),$.current.removeEventListener("canplay",ee)}function re(ae){D.current="failed",$.current=void 0,Y(Math.random())}},[L,I,B]),[$.current,D.current]}e.VideoElement=(0,o.observer)(({element:L,store:I})=>{var B;const[D,$]=a.default.useState(!1),K=a.default.useRef(null),Y=a.default.useRef(null),[H,X]=a.default.useState(!1),Z=I.selectedElements.indexOf(L)>=0,[J,ee]=a.default.useState(!1),[re,ae]=G(L.src,"anonymous"),le=I.activePage===L.page;(0,e.useImageLoader)(ae,L.id+"-video"),re&&(re.width=re.videoWidth,re.height=re.videoHeight);const ue=re||R;a.default.useEffect(()=>{re&&I.history.ignore(()=>{L.set({duration:1e3*re.duration})})},[re]),a.default.useEffect(()=>{var xe;if(!re)return;const He=le&&(I.isPlaying||J);if(!He)return void re.pause();He&&(re.currentTime=L.startTime*re.duration,re.play());const Qe=new v.default.Animation(()=>{},(xe=K.current)===null||xe===void 0?void 0:xe.getLayer());Qe.start();const Et=()=>{ee(!1),re.currentTime=L.startTime*re.duration},Pt=()=>{re.currentTime>=L.endTime*re.duration&&(re.pause(),re.currentTime=L.startTime*re.duration,ee(!1))};return re.addEventListener("ended",Et),re.addEventListener("timeupdate",Pt),()=>{Qe.stop(),re.removeEventListener("ended",Et),re.removeEventListener("timeupdate",Pt)}},[re,J,I.isPlaying,le]);const Ae=a.default.useRef();a.default.useEffect(()=>(0,l.autorun)(()=>{var xe,He;if(re){const Qe=(I.currentTime-L.page.startTime)%L.duration;(Math.abs(1e3*re.currentTime-Qe)>500||!I.isPlaying)&&(re.currentTime=Qe/1e3,I.isPlaying||re.currentTime===0||(Ae.current=(0,p.incrementLoader)(`video ${L.id}`))),(He=(xe=K.current)===null||xe===void 0?void 0:xe.getLayer())===null||He===void 0||He.batchDraw()}}),[I,re]),a.default.useEffect(()=>{if(!re)return;let xe=null;const He=()=>{var Et,Pt;Ae.current&&((Pt=(Et=K.current)===null||Et===void 0?void 0:Et.getLayer())===null||Pt===void 0||Pt.batchDraw(),Ae.current(),Ae.current=null),F(re,re.currentTime)||(xe&&console.error("finish already exists"),xe=(0,p.incrementLoader)(`video ${L.id}`))},Qe=()=>{xe&&(xe(),xe=null)};return re.addEventListener("timeupdate",He),re.addEventListener("canplay",Qe),()=>{re.removeEventListener("timeupdate",He),re.removeEventListener("canplay",Qe)}},[re,L.id,p.incrementLoader]);let{cropX:ze,cropY:oe,cropWidth:ie,cropHeight:ve}=L;ae!=="loaded"&&(ze=oe=0,ie=ve=1);const ge=ue.width*ie,te=ue.height*ve,he=L.width/L.height;let de,we;const _e=ge/te,Ne=L.type==="svg";Ne?(de=ge,we=te):he>=_e?(de=ge,we=ge/he):(de=te*he,we=te);const ke={x:ue.width*ze,y:ue.height*oe,width:de,height:we},tt=(B=L.cornerRadius)!==null&&B!==void 0?B:0;let ot=A(L,x(L,ue,ke,I._elementsPixelRatio,tt,D||L._cropModeEnabled||L.type==="svg"),I._elementsPixelRatio,[ke,tt,I._elementsPixelRatio]);const gt=Math.max(L.width/de,L.height/we);a.default.useEffect(()=>{var xe;if(!L._cropModeEnabled)return;const He=(xe=K.current)===null||xe===void 0?void 0:xe.getStage();function Qe(Pt){L._cropModeEnabled&&Pt.target!==Y.current&&L.toggleCropMode(!1)}function Et(Pt){L._cropModeEnabled&&Pt.target.parentNode!==He.content&&L.toggleCropMode(!1)}return document.body.addEventListener("click",Et),He==null||He.on("click",Qe),He==null||He.on("tap",Qe),()=>{document.body.removeEventListener("click",Et),document.body.removeEventListener("touchstart",Et),He==null||He.off("click",Qe),He==null||He.off("click",Qe)}},[L._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(D||L._cropModeEnabled))return(0,m.applyFilter)(K.current,L),(0,l.autorun)(()=>{(0,m.applyFilter)(K.current,L)},{delay:100})},[ue,D,ie,ve,L._cropModeEnabled]),a.default.useLayoutEffect(()=>{var xe;D||L._cropModeEnabled?(xe=K.current)===null||xe===void 0||xe.clearCache():(0,m.applyFilter)(K.current,L)},[D,L.width,L.height,L._cropModeEnabled]),a.default.useEffect(()=>{(0,m.applyFilter)(K.current,L)},[L.shadowEnabled,L.shadowBlur,L.cornerRadius,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);const Bt=a.default.useRef(null),fe=a.default.useRef(null),pe=a.default.useRef(null);a.default.useLayoutEffect(()=>{L._cropModeEnabled&&(fe.current.nodes([Bt.current]),pe.current.nodes([Y.current]))},[L._cropModeEnabled]);const nt=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 He=xe.target.width()*xe.target.scaleX(),Qe=xe.target.height()*xe.target.scaleY(),Et=Math.min(1,de/He),Pt=Math.min(1,we/Qe),ar=1-Et,Rr=Math.min(ar,Math.max(0,Math.round(-xe.target.x())/He)),Lr=1-Pt,ln=Math.min(Lr,Math.max(0,Math.round(-xe.target.y())/Qe));xe.target.setAttrs({x:-Rr*ue.width,y:-ln*ue.height,scaleX:1,scaleY:1}),L.set({cropX:Rr,cropY:ln,cropWidth:Et,cropHeight:Pt})},Oe=()=>{L.type!=="svg"&&L.contentEditable&&setTimeout(()=>{L.toggleCropMode(!0)})},Fe=ae==="loading",Le=ae==="failed",Ee=!Fe&&!Le,Ze=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Pe=Ee?L.a.opacity:0;(0,g.useFadeIn)(K,Pe);const Ye=L.selectable||I.role==="admin",Sr=(0,h.useMobile)();return a.default.createElement(a.default.Fragment,null,Fe&&a.default.createElement(M,{element:L}),Le&&a.default.createElement(U,{element:L}),a.default.createElement(u.Image,{ref:K,name:"element",id:L.id,image:ue,x:L.x,y:L.y,width:L.width||1,height:L.height||1,rotation:L.rotation,opacity:Pe,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,customCrop:ke,listening:Ye,cropX:ke.x,cropY:ke.y,cropWidth:ke.width,cropHeight:ke.height,draggable:Sr?L.draggable&&Z:L.draggable,preventDefault:!Sr||Z,hideInExport:!L.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:xe=>{L.set({x:xe.target.x(),y:xe.target.y()})},onDragEnd:xe=>{L.set({x:xe.target.x(),y:xe.target.y()})},onDblClick:Oe,onDblTap:Oe,onTransformStart:()=>{$(!0),Ze.current={cropX:L.cropX,cropY:L.cropY,cropWidth:L.cropWidth,cropHeight:L.cropHeight}},onTransform:xe=>{var He;const Qe=xe.currentTarget,Et=Math.abs(Qe.scaleX()-1)<1e-7?1:Qe.scaleX(),Pt=Math.abs(Qe.scaleY()-1)<1e-7?1:Qe.scaleY();Qe.scaleX(1),Qe.scaleY(1);const ar=(He=xe.target.getStage())===null||He===void 0?void 0:He.findOne("Transformer"),Rr=1-de/ue.width,Lr=Math.min(Rr,Math.max(0,L.cropX)),ln=1-we/ue.height,De=Math.min(ln,Math.max(0,L.cropY)),rt=ar.getActiveAnchor(),Xe=!(rt.indexOf("middle")>=0||rt.indexOf("center")>=0),kt=!Xe&&Et<1&&Ze.current.cropHeight>we/ue.height;let Je=Xe?L.cropWidth:L.cropWidth*Et;kt&&(Je=L.cropWidth);const fr=!Xe&&Pt<1&&Ze.current.cropWidth>de/ue.width;let dt=Xe?L.cropHeight:L.cropHeight*Pt;fr&&(dt=L.cropHeight),Ne&&(Je=L.cropWidth,dt=L.cropHeight),L.set({cropX:Lr,cropY:De,x:Qe.x(),y:Qe.y(),width:Qe.width()*Et,height:Qe.height()*Pt,rotation:xe.target.rotation(),cropWidth:Math.min(Je,1-Lr),cropHeight:Math.min(dt,1-De)})},onTransformEnd:xe=>{const He=xe.currentTarget;L.set({width:He.width(),height:He.height(),x:He.x(),y:He.y(),rotation:xe.target.rotation(),cropWidth:de/ue.width,cropHeight:we/ue.height}),$(!1)}}),a.default.createElement(u.Rect,{x:L.x,y:L.y,width:Math.max(L.width-L.borderSize,0),height:Math.max(L.height-L.borderSize,0),opacity:Pe,offsetX:-L.borderSize/2,offsetY:-L.borderSize/2,stroke:L.borderColor,strokeWidth:L.borderSize,listening:!1,visible:!!L.borderSize,rotation:L.rotation,cornerRadius:Math.max(0,tt-L.borderSize),hideInExport:!L.showInExport}),!J&&!I.isPlaying&&a.default.createElement(u.Image,{image:k,x:L.x+L.width/2-15/I.scale,y:L.y+L.height/2-15/I.scale,width:30/I.scale,height:30/I.scale,hideInExport:!0,onClick:()=>{ee(!0)}}),J&&!I.isPlaying&&a.default.createElement(u.Image,{image:C,x:L.x+L.width/2-15/I.scale,y:L.y+L.height/2-15/I.scale,width:30/I.scale,height:30/I.scale,hideInExport:!0,onClick:()=>{ee(!1)}}),L._cropModeEnabled&&a.default.createElement(S.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/I.scale,y:-window.innerWidth/I.scale,width:window.innerWidth/I.scale*3,height:window.innerWidth/I.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:ot,x:L.x,y:L.y,width:L.width,height:L.height,rotation:L.rotation,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur}),a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,scaleX:gt,scaleY:gt},a.default.createElement(u.Image,{image:ue,ref:Y,opacity:.4,draggable:!0,x:-L.cropX*ue.width,y:-L.cropY*ue.height,onDragMove:nt,onTransform:nt}),a.default.createElement(u.Transformer,{ref:pe,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,He)=>He.width<5||He.height<5?xe:He,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:de,height:we,ref:Bt,listening:!1,onTransform:xe=>{xe.target.x()<-L.cropX*ue.width-1e-9&&(xe.target.x(-L.cropX*ue.width),xe.target.scaleX(1)),xe.target.y()<-L.cropY*ue.height-1e-9&&(xe.target.y(-L.cropY*ue.height),xe.target.scaleY(1));const He=Math.min(1,Math.max(0,L.cropX+xe.target.x()/ue.width)),Qe=Math.min(1,Math.max(0,xe.target.y()/ue.height+L.cropY)),Et=xe.target.width()*xe.target.scaleX(),Pt=xe.target.height()*xe.target.scaleY(),ar=Math.min(1-He,Et/ue.width),Rr=Math.min(1-Qe,Pt/ue.height),Lr=xe.target.getAbsolutePosition(xe.target.getParent().getParent());xe.target.scale({x:1,y:1}),xe.target.position({x:0,y:0}),L.set({x:Lr.x,y:Lr.y,cropX:He,cropY:Qe,cropWidth:ar,cropHeight:Rr,width:Math.min(Et*gt,ue.width*(1-He)*gt),height:Math.min(Pt*gt,ue.height*(1-Qe)*gt)})}}),a.default.createElement(u.Transformer,{ref:fe,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,He)=>He.width<5||He.height<5?xe:He,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(H||Z)&&a.default.createElement(_.Highlighter,{element:L}))})})(ES);var OS={},_0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.figureToSvg=e.subTypeToPathDataFunc=e.TYPES=e.crossPath=e.speechBubblePath=e.hexagonPath=e.pentagonPath=e.diamondPath=e.starPath=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0;const t=({width:b,height:m,cornerRadius:g})=>{if(g>0){const h=Math.min(g,b/2,m/2);return`M 0 ${h} A ${h} ${h} 0 0 1 ${h} 0 L ${b-h} 0 A ${h} ${h} 0 0 1 ${b} ${h} L ${b} ${m-h} A ${h} ${h} 0 0 1 ${b-h} ${m} L ${h} ${m} A ${h} ${h} 0 0 1 0 ${m-h} Z`}return`M 0 0 L ${b} 0 L ${b} ${m} L 0 ${m} Z`};e.rectData=t;const r=({width:b,height:m})=>`M ${b/2} 0 L ${b} ${m} L 0 ${m} Z`;e.triangleData=r;const n=({width:b,height:m})=>`M 0 0 L ${b} 0 L 0 ${m} Z`;e.rightTriangleData=n;const i=({width:b,height:m})=>`M ${b/2} ${m/2} m -${b/2}, 0 a ${b/2},${m/2} 0 1,0 ${b},0 a ${b/2},${m/2} 0 1,0 -${b},0`;function a({width:b,height:m}){const g=b/2,h=m/2,d=b/2,y=m/2,O=d/2,k=y/2;let C="",w=Math.PI/5;for(let P=0;P<10;P++){const x=P%2==0?y:k,A=g+(P%2==0?d:O)*Math.sin(P*w),R=h-x*Math.cos(P*w);P===0?C=`M ${A} ${R}`:C+=` L ${A} ${R}`}return C+" Z"}function o({width:b,height:m}){const g=b/2,h=m/2;return`M ${g} 0 L ${b} ${h} L ${g} ${m} L 0 ${h} Z`}function l({width:b,height:m}){const g=b/2,h=m/2,d=b/2,y=m/2;let O="",k=2*Math.PI/5;for(let C=0;C<5;C++){const w=y,P=g+d*Math.sin(C*k),x=h-w*Math.cos(C*k);C===0?O=`M ${P} ${x}`:O+=` L ${P} ${x}`}return O+" Z"}function u({width:b,height:m}){const g=b/2,h=m/2,d=b/2,y=m/2;let O="",k=2*Math.PI/6;for(let C=0;C<6;C++){const w=y,P=g+d*Math.sin(C*k),x=h-w*Math.cos(C*k);C===0?O=`M ${P} ${x}`:O+=` L ${P} ${x}`}return O+" Z"}function f({path:b,aspectRatio:m,width:g,height:h}){return{path:b,scaleX:g/m.width,scaleY:h/m.height}}function v({width:b,height:m}){const g=.1*Math.min(b,m),h=.2*b,d=.2*m,y=.5*b;let O=`M ${g},0`;return O+=" H "+(b-g),O+=` A ${g},${g} 0 0 1 ${b},${g}`,O+=" V "+(m-g-d),O+=` A ${g},${g} 0 0 1 ${b-g},${m-d}`,O+=` H ${y+h/2}`,O+=` L ${y},${m}`,O+=` L ${y-h/2},${m-d}`,O+=` H ${g}`,O+=` A ${g},${g} 0 0 1 0,${m-g-d}`,O+=` V ${g}`,O+=` A ${g},${g} 0 0 1 ${g},0`,O+=" Z",O}function S({width:b,height:m}){const g=.3*b,h=.3*m,d=b/2,y=m/2,O=d-g/2,k=d+g/2,C=y-h/2,w=y+h/2;let P=`M ${O},0 `;return P+=`H ${k} `,P+=`V ${C} `,P+=`H ${b} `,P+=`V ${w} `,P+=`H ${k} `,P+=`V ${m} `,P+=`H ${O} `,P+=`V ${w} `,P+="H 0 ",P+=`V ${C} `,P+=`H ${O} `,P+="V 0 ",P+="Z",P}function _(b){return e.TYPES[b]||e.rectData}function p(b,m){const{width:g,height:h,fill:d,stroke:y,strokeWidth:O,dash:k}=b,C=(k||[]).map(R=>R*O);let w=m(b),P=1,x=1;typeof w!="string"&&(P=w.scaleX,x=w.scaleY,w=w.path);const A=`clip-${b.id||Math.random()}`;return`
214
+ <svg xmlns="http://www.w3.org/2000/svg" width="${g}" height="${h}">
215
+ <defs>
216
+ <clipPath id="${A}">
217
+ <path d="${w}" />
218
+ </clipPath>
219
+ </defs>
220
+
221
+ <!-- Path for the fill -->
222
+ <path d="${w}" fill="${d}" transform="scale(${P}, ${x})"/>
223
+
224
+ <!-- Path for the stroke, clipped by the star path -->
225
+ <path d="${w}" fill="none" stroke="${y}" stroke-width="${2*O}" clip-path="url(#${A})" transform="scale(${P}, ${x})" stroke-dasharray="${C.join(" ")}"/>
226
+ </svg>
227
+ `}function E(b){const{subType:m}=b,g=_(m);return g?p(b,g):(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=v,e.crossPath=S,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:v,cross:S,arc:({width:b,height:m})=>f({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:b,height:m}),cloud:({width:b,height:m})=>f({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:b,height:m}),rightArrow:({width:b,height:m})=>{const g=.6*b;return`M 0 ${m/4} L ${g} ${m/4} L ${g} 0 L ${b} ${m/2} L ${g} ${m} L ${g} ${.75*m} L 0 ${.75*m} Z`},leftArrow:({width:b,height:m})=>{const g=.4*b;return`M ${b} ${m/4} L ${g} ${m/4} L ${g} 0 L 0 ${m/2} L ${g} ${m} L ${g} ${.75*m} L ${b} ${.75*m} Z`},downArrow:({width:b,height:m})=>{const g=.6*m;return`M ${b/4} 0 L ${b/4} ${g} L 0 ${g} L ${b/2} ${m} L ${b} ${g} L ${.75*b} ${g} L ${.75*b} 0 Z`},upArrow:({width:b,height:m})=>{const g=.4*m;return`M ${b/4} ${m} L ${b/4} ${g} L 0 ${g} L ${b/2} 0 L ${b} ${g} L ${.75*b} ${g} L ${.75*b} ${m} Z`},asterisk1:({width:b,height:m})=>f({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:b,height:m}),asterisk2:({width:b,height:m})=>f({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:b,height:m}),bookmark:({width:b,height:m})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:b,height:m}),butterfly:({width:b,height:m})=>f({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:b,height:m}),cylinder:({width:b,height:m})=>f({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:b,height:m}),diamond2:({width:b,height:m})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:b,height:m}),door:({width:b,height:m})=>f({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:b,height:m}),drop1:({width:b,height:m})=>f({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:b,height:m}),drop2:({width:b,height:m})=>f({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:b,height:m}),explosion:({width:b,height:m})=>f({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:b,height:m}),flag:({width:b,height:m})=>f({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:b,height:m}),flower:({width:b,height:m})=>f({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:b,height:m}),frame:({width:b,height:m})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:b,height:m}),heart1:({width:b,height:m})=>f({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:b,height:m}),home:({width:b,height:m})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:b,height:m}),home2:({width:b,height:m})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:b,height:m}),hourglass:({width:b,height:m})=>f({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:b,height:m}),house:({width:b,height:m})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:b,height:m}),keyhole:({width:b,height:m})=>f({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:b,height:m}),kiss:({width:b,height:m})=>f({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:b,height:m}),leaf:({width:b,height:m})=>f({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:b,height:m}),lightning1:({width:b,height:m})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:b,height:m}),lightning2:({width:b,height:m})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:b,height:m}),magnet:({width:b,height:m})=>f({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:b,height:m}),mithosis:({width:b,height:m})=>f({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:b,height:m}),orangeRicky:({width:b,height:m})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:b,height:m}),party:({width:b,height:m})=>f({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:b,height:m}),pillow:({width:b,height:m})=>f({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:b,height:m}),polygon:({width:b,height:m})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:b,height:m}),rainbow:({width:b,height:m})=>f({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:b,height:m}),rhodeIsland:({width:b,height:m})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:b,height:m}),shell:({width:b,height:m})=>f({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:b,height:m}),shield1:({width:b,height:m})=>f({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:b,height:m}),shield2:({width:b,height:m})=>f({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:b,height:m}),skewedRectangle:({width:b,height:m})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:b,height:m}),softFlower:({width:b,height:m})=>f({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:b,height:m}),softStar:({width:b,height:m})=>f({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:b,height:m}),stairs1:({width:b,height:m})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:b,height:m}),stairs2:({width:b,height:m})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:b,height:m}),teewee:({width:b,height:m})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:b,height:m}),blob1:({width:b,height:m})=>f({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:b,height:m}),blob10:({width:b,height:m})=>f({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:b,height:m}),blob11:({width:b,height:m})=>f({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:b,height:m}),blob12:({width:b,height:m})=>f({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:b,height:m}),blob13:({width:b,height:m})=>f({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:b,height:m}),blob14:({width:b,height:m})=>f({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:b,height:m}),blob15:({width:b,height:m})=>f({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:b,height:m}),blob16:({width:b,height:m})=>f({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:b,height:m}),blob17:({width:b,height:m})=>f({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:b,height:m}),blob18:({width:b,height:m})=>f({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:b,height:m}),blob19:({width:b,height:m})=>f({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:b,height:m}),blob2:({width:b,height:m})=>f({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:b,height:m}),blob20:({width:b,height:m})=>f({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:b,height:m}),blob21:({width:b,height:m})=>f({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:b,height:m}),blob22:({width:b,height:m})=>f({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:b,height:m}),blob23:({width:b,height:m})=>f({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:b,height:m}),blob24:({width:b,height:m})=>f({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:b,height:m}),blob25:({width:b,height:m})=>f({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:b,height:m}),blob26:({width:b,height:m})=>f({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:b,height:m}),blob27:({width:b,height:m})=>f({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:b,height:m}),blob28:({width:b,height:m})=>f({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:b,height:m}),blob29:({width:b,height:m})=>f({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:b,height:m}),blob3:({width:b,height:m})=>f({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:b,height:m}),blob30:({width:b,height:m})=>f({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:b,height:m}),blob31:({width:b,height:m})=>f({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:b,height:m}),blob32:({width:b,height:m})=>f({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:b,height:m}),blob4:({width:b,height:m})=>f({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:b,height:m}),blob5:({width:b,height:m})=>f({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:b,height:m}),blob6:({width:b,height:m})=>f({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:b,height:m}),blob7:({width:b,height:m})=>f({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:b,height:m}),blob8:({width:b,height:m})=>f({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:b,height:m}),blob9:({width:b,height:m})=>f({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:b,height:m})},e.subTypeToPathDataFunc=_,e.figureToSvg=E})(_0);(function(e){var t=Se&&Se.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(it),n=Hi,i=Wa,a=_0,o=Wl,l=Yo,u=Ef,f={};e.FigureElement=(0,n.observer)(({element:v,store:S})=>{const _=v.selectable||S.role==="admin",p=(0,l.useMobile)(),[E,b]=r.default.useState(!1),m=S.selectedElements.indexOf(v)>=0&&S.selectedElements.length===1,g=Math.min(v.strokeWidth,v.width/2,v.height/2),h=Math.max(0,Math.min(v.width/2,v.height/2,v.cornerRadius)),d=(0,u.useColor)(v,v.a.fill,"fill"),y=Object.assign(Object.assign({width:v.a.width,height:v.a.height},d),{cornerRadius:h,opacity:v.animated("opacity"),shadowEnabled:v.shadowEnabled,shadowBlur:v.shadowBlur,shadowOffsetX:v.shadowOffsetX,shadowOffsetY:v.shadowOffsetY,shadowColor:v.shadowColor,shadowOpacity:v.shadowOpacity,listening:_,preventDefault:!p||m,hideInExport:!v.showInExport}),O=(0,u.useColor)(v,v.stroke,"stroke"),k=Object.assign(Object.assign({visible:g>0,x:g/2,y:g/2,width:v.a.width-g,height:v.a.height-g},O),{strokeWidth:g,cornerRadius:Math.max(0,h-g),dash:v.dash.map(x=>x*g),opacity:v.animated("opacity"),hideInExport:!v.showInExport,listening:!1}),C=(w=v.subType,f[w]||(f[w]=(P=(0,a.subTypeToPathDataFunc)(w),(0,n.observer)(({element:x,fillProps:A,strokeProps:R})=>{let M=P({width:x.a.width,height:x.a.height,cornerRadius:x.cornerRadius}),U=1,V=1;typeof M!="string"&&(U=M.scaleX,V=M.scaleY,M=M.path);const q=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:x.width,height:x.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},A,{ref:q,data:M,scaleX:U,scaleY:V})),r.default.createElement(i.Group,{clipFunc:z=>{const F=q.current;if(F){var G=F.dataArray;z.beginPath();for(var L=0;L<G.length;L++){var I=G[L].command,B=G[L].points;switch(I){case"L":z.lineTo(B[0],B[1]);break;case"M":z.moveTo(B[0],B[1]);break;case"C":z.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case"Q":z.quadraticCurveTo(B[0],B[1],B[2],B[3]);break;case"A":var D=B[0],$=B[1],K=B[2],Y=B[3],H=B[4],X=B[5],Z=B[6],J=B[7],ee=K>Y?K:Y,re=K>Y?1:K/Y,ae=K>Y?Y/K:1;z.translate(D,$),z.rotate(Z),z.scale(re,ae),z.arc(0,0,ee,H,H+X,1-J),z.scale(1/re,1/ae),z.rotate(-Z),z.translate(-D,-$);break;case"z":z.closePath()}}}},scaleX:U,scaleY:V},r.default.createElement(i.Path,Object.assign({},R,{x:0,y:0,data:M,strokeWidth:2*R.strokeWidth,dash:R.dash.map(z=>z)}))))}))),f[w]||i.Group);var w,P;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:v.id,x:v.a.x,y:v.a.y,rotation:v.a.rotation,opacity:v.a.opacity,draggable:p?v.draggable&&m:v.draggable,name:"element",onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},onDragMove:x=>{v.set({x:x.target.x(),y:x.target.y()})},onDragEnd:x=>{v.set({x:x.target.x(),y:x.target.y()})},onTransform:x=>{const A=x.target.scale();x.target.scaleX(1),x.target.scaleY(1),v.set({width:v.width*A.x,height:v.height*A.y,x:x.target.x(),y:x.target.y(),rotation:x.target.rotation()})}},r.default.createElement(C,{element:v,fillProps:y,strokeProps:k})),E&&!m&&r.default.createElement(o.Highlighter,{element:v}))})})(OS);(function(e){var t=Se&&Se.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(it),n=Hi,i=v2,a=k2,o=hS,l=SS,u=ES,f=OS,v=Wa,S=hi,_=(0,n.observer)(m=>{const{element:g,store:h}=m,{children:d}=g,y=g.selectable||h.role==="admin";return r.default.createElement(v.Group,{opacity:g.opacity,listening:y,hideInExport:!g.showInExport},d.map(O=>r.default.createElement(b,Object.assign({},m,{key:O.id,store:h,element:O}))))}),p={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:_};function E(m,g){p[m]=g}e.registerShapeComponent=E;const b=(0,n.observer)(m=>{let g=p[m.element.type];return m.element.type==="text"&&S.flags.htmlRenderEnabled&&(g=o.HTMLElement),m.element.visible?g?r.default.createElement(g,Object.assign({},m)):(console.error("Can not find component for "+m.element.type),null):null});e.default=b})(s7);var PS={};(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})(PS);var lv={},sv={},k_;function nF(){return k_||(k_=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._dangerous=e.getAPI=e.getDomain=e.API=e.URL=void 0;const t=j2();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";let r=e.URL;const n=()=>r;e.getDomain=n;const i=()=>r+"/api";e.getAPI=i;const a=k=>{r=k};e._dangerous=a;const o={},l=(k,C)=>{o[k]||(o[k]=!0,console.error(C))},u=`API for iconscout is provided as a demonstration.
228
+ For production usage you have to use your own API endpoint.
229
+ https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
230
+ https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:k,page:C=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${k}&per_page=20&page=${C}&KEY=${(0,t.getKey)()}`,unsplashDownload:k=>`${(0,e.getAPI)()}/download-unsplash?id=${k}&KEY=${(0,t.getKey)()}`,svgapiList:({query:k,page:C=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${k}&page=${C}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:k=>`${(0,e.getAPI)()}/download-svgapi?path=${k}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:k,page:C=1})=>(l("iconscout",u),`${(0,e.getAPI)()}/get-iconscout?query=${k}&page=${C}&KEY=${(0,t.getKey)()}`),iconscoutDownload:k=>(l("iconscout",u),`${(0,e.getAPI)()}/download-iconscout?uuid=${k}&KEY=${(0,t.getKey)()}`),templateList:({query:k,page:C=1,sizeQuery:w})=>`${(0,e.getAPI)()}/get-templates?${w}&query=${k}&per_page=30&page=${C}&KEY=${(0,t.getKey)()}`};const f=()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=f;const v=k=>{return`${(0,e.getDomain)()}/google-fonts-previews/black/${C=k,w=" ",P="-",C.replace(new RegExp(w,"g"),P)}.png`;var C,w,P};e.getGoogleFontImage=v;const S=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=S;const _=()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=_;const p=k=>e.URLS.templateList(k);e.templateList=p;const E=()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=E;const b=k=>e.URLS.unsplashList(k);e.unsplashList=b;const m=k=>e.URLS.unsplashDownload(k);e.unsplashDownload=m;const g=k=>e.URLS.svgapiList(k);e.svgapiList=g;const h=k=>e.URLS.svgapiDownload(k);e.svgapiDownload=h;const d=k=>e.URLS.iconscoutList(k);e.iconscoutList=d;const y=k=>e.URLS.iconscoutDownload(k);e.iconscoutDownload=y;const O=(k,C)=>{e.URLS[k]=C};e.setAPI=O}(sv)),sv}var R_;function j2(){return R_||(R_=1,function(e){var t=Se&&Se.__createBinding||(Object.create?function(k,C,w,P){P===void 0&&(P=w);var x=Object.getOwnPropertyDescriptor(C,w);x&&!("get"in x?!C.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return C[w]}}),Object.defineProperty(k,P,x)}:function(k,C,w,P){P===void 0&&(P=w),k[P]=C[w]}),r=Se&&Se.__setModuleDefault||(Object.create?function(k,C){Object.defineProperty(k,"default",{enumerable:!0,value:C})}:function(k,C){k.default=C}),n=Se&&Se.__importStar||function(k){if(k&&k.__esModule)return k;var C={};if(k!=null)for(var w in k)w!=="default"&&Object.prototype.hasOwnProperty.call(k,w)&&t(C,k,w);return r(C,k),C};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(ha),a=nF(),o=hi;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const v=5,S=3e3,_="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",p="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",E="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let m=window.location.origin;const g=navigator.userAgent.indexOf("Headless")>-1,h=navigator.userAgent.indexOf("Electron")>-1;m==="file://"&&g&&(m="headless"),m==="file://"&&h&&(m="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${m}" here: https://polotno.com/cabinet`;async function y(k){for(let C=0;C<v;C++)try{const w=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:k,site:location.host})});if(!k)return console.warn(_),!1;if(w.status!==200){await new Promise(x=>setTimeout(x,S));continue}const P=await w.json();return P.is_valid||console.warn(p),P.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),P.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(P.remove_background_enabled),P.is_paid||!1}catch{await new Promise(P=>setTimeout(P,S))}return console.error(E),!0}async function O(k,C){u=k,await y(k)&&!C||l()}e.isKeyPaid=y,e.validateKey=O}(lv)),lv}var w0={};(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})(w0);(function(e){var t=Se&&Se.__rest||function(F,G){var L={};for(var I in F)Object.prototype.hasOwnProperty.call(F,I)&&G.indexOf(I)<0&&(L[I]=F[I]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(I=Object.getOwnPropertySymbols(F);B<I.length;B++)G.indexOf(I[B])<0&&Object.prototype.propertyIsEnumerable.call(F,I[B])&&(L[I[B]]=F[I[B]])}return L},r=Se&&Se.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(it),i=Hi,a=ha,o=Wa,l=r(p0),u=r(vi),f=r(s7),v=F2,S=k2,_=PS,p=j2(),E=b0,b=w0,m=hi,g=Yo,h=u.default.DD._drag;window.removeEventListener("mousemove",h),u.default.DD._drag=function(F){(0,a.runInAction)(()=>{h.call(this,F)})},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}),O={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:F=>{F.hasName("rotater")&&F.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"})}},k=F=>{Object.assign(O,F)};e.setTransformerStyle=k;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 w(F,G){C[F]=C[F]||G,Object.assign(C[F],G)}e.registerTransformerAttrs=w;const P=F=>n.default.createElement(o.Rect,Object.assign({},F,{preventDefault:!1})),x=F=>{var{url:G}=F,L=t(F,["url"]);const[I,B]=(0,l.default)(G,"anonymous"),D=I?(0,_.getCrop)(I,{width:L.width,height:L.height},"center-middle"):{};return(0,S.useImageLoader)(B,"background"),n.default.createElement(o.Image,Object.assign({image:I},L,D))},A=F=>n.default.createElement(o.Rect,Object.assign({},F)),R=F=>{const{background:G,scale:L,borderColor:I}=F,B=t(F,["background","scale","borderColor"]),D=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(G),[G]),$=n.default.useMemo(()=>{const K=document.createElement("canvas"),Y=30;K.width=60,K.height=60;const H=K.getContext("2d");return H&&(H.fillStyle="black",H.fillRect(Y,0,Y,Y),H.fillRect(0,Y,Y,Y)),K},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:$},B,{opacity:.1,hideInExport:!0})),D?n.default.createElement(A,Object.assign({fill:G},B)):n.default.createElement(x,Object.assign({url:G},B)))},M=(0,i.observer)(({selection:F})=>F.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(F.x1,F.x2),y:Math.min(F.y1,F.y2),width:Math.abs(F.x1-F.x2),height:Math.abs(F.y1-F.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:F,y:G,width:L,height:I,rotation:B,anchor:D,store:$})=>{const K=(0,E.getClientRect)({x:F,y:G,width:L,height:I,rotation:u.default.Util.radToDeg(B)});if(D===void 0)return null;const Y=(I/2+70)*Math.cos(B-Math.PI/2),H=(I/2+70)*Math.sin(B-Math.PI/2),X=(0,b.pxToUnitRounded)({unit:$.unit,dpi:$.dpi,px:L/$.scale,precious:$.unit==="px"?0:1})+" x "+(0,b.pxToUnitRounded)({unit:$.unit,dpi:$.dpi,px:I/$.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+Y,y:(K.minY+K.maxY)/2+H,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(B)).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:X})))}),V=(0,i.observer)(({elements:F,store:G})=>{const L=F.filter(B=>B.alwaysOnTop),I=F.filter(B=>!B.alwaysOnTop).concat(L);return n.default.createElement(n.default.Fragment,null,I.map(B=>n.default.createElement(f.default,{key:B.id,store:G,element:B,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let q=null;const z=F=>{q=F};e.registerNextDomDrop=z,e.default=(0,i.observer)(({store:F,page:G,width:L,height:I,pageControlsEnabled:B,backColor:D,pageBorderColor:$,activePageBorderColor:K,components:Y,bleedColor:H,altCloneEnabled:X})=>{const Z=F.bleedVisible?G.bleed:0,J=G.computedWidth+2*Z,ee=G.computedHeight+2*Z,re=(L-J*F.scale)/2,ae=(I-ee*F.scale)/2,le=n.default.useRef(null),ue=n.default.useRef(null),Ae=n.default.useRef(null),ze=B==null||B,[oe,ie]=n.default.useState(null),[ve,ge]=n.default.useState({}),te=F.selectedElements.find(Oe=>Oe._cropModeEnabled),he=F.selectedShapes.filter(Oe=>!Oe.resizable).length>0,de=F.selectedShapes.filter(Oe=>!Oe.draggable).length>0,we=F.selectedElements.filter(Oe=>!Oe.visible).length>0;n.default.useLayoutEffect(()=>{var Oe,Fe,Le;if(!le.current)return;const Ee=le.current.getStage(),Ze=F.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:Ee.findOne("#"+Ye.id)).filter(Ye=>Ye),Pe=F.selectedElements.length===1&&((Oe=F.selectedElements[0])===null||Oe===void 0?void 0:Oe.type)||"many";C[Pe]?(le.current.setAttrs(Object.assign(Object.assign({},O),C[Pe])),Pe!=="svg"&&Pe!=="image"||F.selectedElements[0].keepRatio||le.current.setAttrs({enabledAnchors:O.enabledAnchors}),Pe==="text"&&m.flags.textVerticalResizeEnabled&&le.current.setAttrs({enabledAnchors:(Fe=C.text.enabledAnchors)===null||Fe===void 0?void 0:Fe.concat(["bottom-center"])})):le.current.setAttrs(O),he&&le.current.enabledAnchors([]),de&&le.current.rotateEnabled(!1),Ze.find(Ye=>Ye==null?void 0:Ye.isDragging())&&Ze.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),le.current.nodes(Ze),(Le=le.current.getLayer())===null||Le===void 0||Le.batchDraw()},[F.selectedElements,te,he,we,de]);const _e=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Ne=n.default.useRef(!1),ke=(0,g.useMobile)(),tt=(0,a.action)(Oe=>{var Fe,Le;if(ke)return;Ne.current=!1;const Ee=Oe.target.findAncestor(".elements-container"),Ze=Oe.target.findAncestor("Transformer"),Pe=Oe.target.findAncestor(".page-abs-container");if(Ee||Ze||Pe)return;const Ye=(Fe=Oe.target.getStage())===null||Fe===void 0?void 0:Fe.getPointerPosition();Ye&&(_e.visible=!0,_e.x1=Ye.x,_e.y1=Ye.y,_e.x2=Ye.x,_e.y2=Ye.y,((Le=Oe.target.getStage())===null||Le===void 0?void 0:Le.getPointersPositions().length)>=2&&(_e.visible=!1))});n.default.useEffect(()=>{const Oe=(0,a.action)(Le=>{var Ee,Ze;if(!_e.visible)return;(Ee=ue.current)===null||Ee===void 0||Ee.setPointersPositions(Le);let Pe=((Ze=ue.current)===null||Ze===void 0?void 0:Ze.getPointerPosition())||{x:_e.x2,y:_e.y2};_e.x2=Pe.x,_e.y2=Pe.y}),Fe=(0,a.action)(()=>{if(!_e.visible||!ue.current)return;const Le=ue.current.findOne(".selection"),Ee=Le?Le.getClientRect():{width:0,height:0,x:0,y:0};if(Ee.width&&Ee.height){const Ze=[];ue.current.find(".element").forEach(Ye=>{const Sr=Ye.getClientRect(),xe=F.getElementById(Ye.id()),He=xe==null?void 0:xe.draggable,Qe=xe==null?void 0:xe.selectable;u.default.Util.haveIntersection(Ee,Sr)&&He&&Qe&&Ze.push(xe.top.id)});const Pe=[...new Set(Ze)];F.selectElements(Pe)}_e.visible=!1,Ne.current=!0});return window.addEventListener("mousemove",Oe),window.addEventListener("touchmove",Oe),window.addEventListener("mouseup",Fe),window.addEventListener("touchend",Fe),()=>{window.removeEventListener("mousemove",Oe),window.removeEventListener("touchmove",Oe),window.removeEventListener("mouseup",Fe),window.removeEventListener("touchend",Fe)}},[]);const ot=Oe=>{if(F.activePage!==G&&G.select(),Ne.current)return;const Fe=Oe.evt.ctrlKey||Oe.evt.metaKey||Oe.evt.shiftKey,Le=Oe.target.findAncestor(".elements-container"),Ee=Oe.target.findAncestor(".page-abs-container"),Ze=Oe.target.findAncestor("Transformer");if(!(Fe||Le||Ze||Ee))return void F.selectElements([]);const Pe=Oe.target.findAncestor(".element",!0),Ye=F.getElementById(Pe==null?void 0:Pe.id()),Sr=Ye==null?void 0:Ye.top,xe=Sr==null?void 0:Sr.id,He=F.selectedElementsIds.indexOf(xe)>=0;xe&&Fe&&!He?F.selectElements(F.selectedElementsIds.concat([xe])):xe&&Fe&&He?F.selectElements(F.selectedElementsIds.filter(Qe=>Qe!==xe)):!xe||Fe||He||F.selectElements([xe])};(0,v.useSnap)(le);const gt=F.activePage===G,Bt=Y==null?void 0:Y.PageControls,fe=Y==null?void 0:Y.Tooltip,pe=1/F.scale,nt=0/F.scale;return n.default.createElement("div",{ref:Ae,onDragOver:Oe=>Oe.preventDefault(),onDrop:Oe=>{if(Oe.preventDefault(),!ue.current)return;ue.current.setPointersPositions(Oe);const Fe=ue.current.findOne(".elements-container").getRelativePointerPosition(),Le=ue.current.getPointerPosition(),Ee=ue.current.getAllIntersections(Le).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),Ze=[...new Set(Ee.reverse())].map(Ye=>F.getElementById(Ye.id())),Pe=Ze[0];q&&(q(Fe,Pe,{elements:Ze,page:G}),q=null)},style:{position:"relative",width:L+"px"},className:"polotno-page-container"+(gt?" active-page":"")},n.default.createElement(o.Stage,{ref:ue,width:Math.min(L,4*window.innerWidth),height:Math.min(I,4*window.innerHeight),onClick:ot,onTap:ot,onMouseDown:tt,onMouseMove:Oe=>{if(!Oe.evt.altKey&&oe)return void ie(null);if(!Oe.evt.altKey)return;const Fe=Oe.target.findAncestor(".element",!0),Le=Fe==null?void 0:Fe.id();if(!F.selectedElements[0]||F.selectedElementsIds.includes(Le))return;const Ee=(0,E.getTotalClientRect)(F.selectedShapes),Ze=Le?F.getElementById(Le):{x:0,y:0,width:G.computedWidth,height:G.computedHeight,rotation:0},Pe=(0,E.getClientRect)(Ze),Ye=[];Ee.minX>Pe.maxX&&Ye.push({distance:Ee.minX-Pe.maxX,box1:Ee,box2:Pe,points:[{x:Ee.minX,y:Ee.minY+Ee.height/2},{x:Pe.maxX,y:Ee.minY+Ee.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),Ee.maxX<Pe.minX&&Ye.push({distance:Pe.minX-Ee.maxX,box1:Ee,box2:Pe,points:[{x:Ee.maxX,y:Ee.minY+Ee.height/2},{x:Pe.minX,y:Ee.minY+Ee.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),Ee.minY>Pe.maxY&&Ye.push({box1:Ee,box2:Pe,distance:Ee.minY-Pe.maxY,points:[{x:Ee.minX+Ee.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]}),Ee.maxY<Pe.minY&&Ye.push({box1:Ee,box2:Pe,distance:Pe.minY-Ee.maxY,points:[{x:Ee.minX+Ee.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),Ee.minX>=Pe.minX&&Ee.maxX<=Pe.maxX&&Ee.minY>=Pe.minY&&Ee.maxY<=Pe.maxY&&(Ye.push({distance:Ee.minX-Pe.minX,box1:Ee,box2:Pe,points:[{x:Ee.minX,y:Ee.minY+Ee.height/2},{x:Pe.minX,y:Ee.minY+Ee.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),Ye.push({distance:Pe.maxX-Ee.maxX,box1:Ee,box2:Pe,points:[{x:Ee.maxX,y:Ee.minY+Ee.height/2},{x:Pe.maxX,y:Ee.minY+Ee.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),Ye.push({box1:Ee,box2:Pe,distance:Ee.minY-Pe.minY,points:[{x:Ee.minX+Ee.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),Ye.push({box1:Ee,box2:Pe,distance:Pe.maxY-Ee.maxY,points:[{x:Ee.minX+Ee.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]})),JSON.stringify(oe)!==JSON.stringify(Ye)&&ie(Ye)},onTouchStart:tt,onDragStart:Oe=>{var Fe;const Le=Oe.target.findAncestor(".element",!0);if(Le){const Ee=F.getElementById(Le==null?void 0:Le.id()),Ze=Ee==null?void 0:Ee.top,Pe=Ze==null?void 0:Ze.id;!(F.selectedElementsIds.indexOf(Pe)>=0)&&Pe&&(F.selectElements([Pe]),Oe.target.stopDrag(),Oe.target.startDrag(Oe),(Fe=le.current)===null||Fe===void 0||Fe.startDrag(Oe))}oe&&ie(null)},pageId:G.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(P,{width:L,height:I,fill:D}),n.default.createElement(o.Group,{x:re,y:ae,scaleX:F.scale,scaleY:F.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:Z,y:Z},n.default.createElement(R,{x:-G.bleed,y:-G.bleed,width:G.computedWidth+2*G.bleed,height:G.computedHeight+2*G.bleed,background:G.background,shadowBlur:10,shadowColor:"lightgrey",name:"page-background",preventDefault:!1,scale:F.scale})),n.default.createElement(o.Group,{x:Z,y:Z,name:"elements-container",listening:!F.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:G.computedWidth,height:G.computedHeight,listening:!1}),n.default.createElement(V,{elements:G.children,store:F})),n.default.createElement(o.Rect,{stroke:H,name:"bleed",strokeWidth:G.bleed,x:G.bleed/2,y:G.bleed/2,width:G.computedWidth+G.bleed,height:G.computedHeight+G.bleed,listening:!1,visible:G.bleed>0&&F.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,L,0,L,I,0,I,0,0,re,ae,re,I-ae,L-re,I-ae,L-re,ae,re,ae],listening:!1,closed:!0,fill:D}),n.default.createElement(o.Group,{x:re,y:ae,scaleX:F.scale,scaleY:F.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-pe/2-nt,y:-pe/2-nt,width:J+pe+2*nt,height:ee+pe+2*nt,stroke:gt&&F.pages.length>1?K:$,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:re+Z*F.scale,y:ae+Z*F.scale,scaleX:F.scale,scaleY:F.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:le,onDragStart:Oe=>{var Fe;!((Fe=Oe.evt)===null||Fe===void 0)&&Fe.altKey&&X&&F.selectedElements.forEach(Le=>{const Ee=Le.clone({},{skipSelect:!0}),Ze=G.children.indexOf(Le);G.setElementZIndex(Ee.id,Ze)}),F.history.startTransaction()},onDragEnd:()=>{F.history.endTransaction()},onTransformStart:()=>{F.history.startTransaction()},boundBoxFunc:(Oe,Fe)=>{const Le=Math.abs(Fe.width)<1||Math.abs(Fe.height)<1,Ee=Math.abs(Oe.width)<1||Math.abs(Oe.height)<1;return Le&&!Ee?Oe:Fe},onTransform:Oe=>{var Fe,Le;const Ee=le.current.nodes(),Ze=Ee[Ee.length-1];if(Oe.target!==Ze)return;const Pe=(Fe=le.current)===null||Fe===void 0?void 0:Fe.__getNodeRect(),Ye=(Le=le.current)===null||Le===void 0?void 0:Le.getActiveAnchor();ge({anchor:Ye,x:Pe.x,y:Pe.y,rotation:Pe.rotation,width:Pe.width,height:Pe.height})},onTransformEnd:Oe=>{ge({}),F.history.endTransaction()},visible:!F.isPlaying}),oe&&oe.map(({points:Oe,distance:Fe,box1:Le,box2:Ee},Ze)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Ze,listening:!1},n.default.createElement(o.Rect,Object.assign({},Le,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},Ee,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[Oe[0].x,Oe[0].y,Oe[1].x,Oe[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[Oe[1].x,Oe[1].y,Oe[2].x,Oe[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(Oe[0].x+Oe[1].x)/2,y:(Oe[0].y+Oe[1].y)/2,offsetY:-10,scaleX:1/F.scale,scaleY:1/F.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:F.unit,dpi:F.dpi,px:Fe})})))),G._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:J,height:ee,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:J,height:ee,align:"center",verticalAlign:"middle"})),fe&&n.default.createElement(fe,{components:Y,store:F,page:G,stageRef:ue})),n.default.createElement(U,Object.assign({},ve,{store:F})),n.default.createElement(M,{selection:_e}),p.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:L-170,y:I-18,onMouseEnter:Oe=>{Oe.target.getStage().container().style.cursor="pointer"},onMouseLeave:Oe=>{Oe.target.getStage().container().style.cursor=""},onTouchStart:Oe=>{Oe.cancelBubble=!0},onMouseDown:Oe=>{Oe.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),ze&&gt&&Bt&&n.default.createElement(Bt,{store:F,page:G,xPadding:re,yPadding:ae}))})})(v9);var xS={};(function(e){var t=Se&&Se.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(it),n=b0,i=w0,a=Hi,o=D2,l=(0,o.styled)("div",r.default.forwardRef)`
231
+ position: absolute;
232
+ top: 0;
233
+ left: 0;
234
+ pointer-events: none;
235
+ `,u=(0,o.styled)("div",r.default.forwardRef)`
236
+ height: 14px;
237
+ position: sticky;
238
+ font-size: 8px;
239
+ line-height: 14px;
240
+ top: 0;
241
+ left: 0;
242
+ color: grey;
243
+ border-bottom: 1px solid grey;
244
+ background-color: #e8e8e8;
245
+ overflow: hidden;
246
+ `,f=(0,o.styled)("div",r.default.forwardRef)`
247
+ left: 0;
248
+ width: 14px;
249
+ position: sticky;
250
+ font-size: 8px;
251
+ line-height: 14px;
252
+ color: grey;
253
+ border-right: 1px solid grey;
254
+ background-color: #e8e8e8;
255
+ overflow: hidden;
256
+ `,v=(0,o.styled)("div",r.default.forwardRef)`
257
+ position: absolute;
258
+ border-left: 1px solid grey;
259
+ padding-left: 2px;
260
+ `,S=(0,o.styled)("div",r.default.forwardRef)`
261
+ position: absolute;
262
+ left: 14px;
263
+ border-left: 1px solid grey;
264
+ padding-left: 2px;
265
+ transform: rotate(90deg);
266
+ transform-origin: left top;
267
+ overflow: hidden;
268
+ `,_=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function p(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:E,width:b,height:m})=>{const g=r.default.useRef(null);if(!E.activePage)return null;const h=E.activePage,d=(E.bleedVisible&&h.bleed,h.computedWidth*E.scale),y=h.computedHeight*E.scale,O=(b-d)/2,k=(C=R=>(0,i.unitToPx)({unitVal:R,dpi:E.dpi,unit:E.unit})*E.scale,_.find(R=>C(R)>30)||1e4);var C;const w=(0,i.unitToPx)({unitVal:k,dpi:E.dpi,unit:E.unit})*E.scale,P=Math.round(d/w)+1,x=Math.round(y/w)+1,A=(0,n.getTotalClientRect)(E.selectedShapes);return r.default.createElement(l,{ref:g,className:"polotno-rulers"},r.default.createElement(u,{style:{width:b+"px"},className:"polotno-x-ruler"},[...Array(P)].map((R,M)=>r.default.createElement(v,{key:M,style:{left:O+M*w+"px",width:w+"px"}},E.unit==="px"||k>=1?Math.round(k*M):(k*M).toFixed(1))),!!E.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:O+A.x*E.scale+"px",height:"14px",width:A.width*E.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),E.pages.map((R,M)=>{var U;const V=R.computedHeight*E.scale,q=(m-V)/2;return r.default.createElement(f,{key:R.id,style:{height:m+"px"},className:"polotno-y-ruler"},[...Array(x)].map((z,F)=>r.default.createElement(S,{key:F,style:{top:q+F*w-14+"px",width:w+"px"}},E.unit==="px"||k>=1?Math.round(k*F):(k*F).toFixed(1))),((U=E.selectedShapes[0])===null||U===void 0?void 0:U.page)===R&&r.default.createElement("div",{style:{position:"absolute",top:q+A.y*E.scale-14+"px",width:"14px",height:A.height*E.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=p})(xS);var CS={},uv={};let iF="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",TS=e=>crypto.getRandomValues(new Uint8Array(e)),AS=(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}}},aF=(e,t=21)=>AS(e,t,TS),oF=(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 lF=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:aF,customRandom:AS,nanoid:oF,random:TS,urlAlphabet:iF},Symbol.toStringTag,{value:"Module"})),S0=Do(lF);var cv={},fv={},kS={},z2={};(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})(z2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=$i,r=z2;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 v=()=>f>0;function S(){const p=(0,t.getSnapshot)(i);return{pages:p.pages,width:p.width,height:p.height,custom:p.custom}}function _(p){const E=i.pages.map(m=>m.id),b=p.pages.map(m=>m.id);(0,r.deepEqual)(E,b)?i.pages.forEach((m,g)=>{(0,t.applySnapshot)(m,p.pages[g])}):(0,t.applySnapshot)(i.pages,p.pages),i.setSize(p.width,p.height)}return{startTransaction(){f++},endTransaction(p){f--,p||this.requestAddState(S())},async ignore(p,E=!1,b=!1){b&&await new Promise(y=>setTimeout(y,10)),u&&n.addUndoState();let m=v();n.startTransaction();let g=f;try{await p()}catch(y){setTimeout(()=>{throw y})}const h=g!==f,d=!h;n.endTransaction(d),E||m||n.replaceState(),h||(clearTimeout(u),u=0)},async transaction(p){await n.ignore(p,!0),this.addUndoState()},requestAddState(p){l=p,u||v()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),v()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const p=n.history[n.undoIdx];!(0,r.deepEqual)(l,p)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,t.resolvePath)(n,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");a=(0,t.onSnapshot)(i,()=>{this.requestAddState(S())}),n.history.length===0&&this.requestAddState(S())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(S())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,_(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,_(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=S()}}}),e.default=e.UndoManager})(kS);var RS={};(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})(RS);var LS={};(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})(LS);var MS={};(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
269
+ (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]);
270
+ `],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(MS);var NS={};(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})(NS);var IS={},Jc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=Cu;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=v=>{u(v)},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 v=document.createElement("canvas");v.width=l.width,v.height=l.height;const S=v.getContext("2d");let{cropX:_,cropY:p}=l;const E=f.width*l.cropWidth,b=f.height*l.cropHeight,m=l.width/l.height;let g,h;const d=E/b;return l.type==="svg"?(g=E,h=b):m>=d?(g=E,h=E/m):(g=b*m,h=b),S.drawImage(f,_*f.width,p*f.height,g,h,0,0,v.width,v.height),v.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,v=u/f;let S,_;v>=l.width/l.height?(S=l.width,_=l.width/v):(S=l.height*v,_=l.height);const p=(l.width-S)/2,E=(l.height-_)/2;return{cropX:p/l.width,cropY:E/l.height,cropWidth:S/l.width,cropHeight:_/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(Jc);(function(e){var t=Se&&Se.__createBinding||(Object.create?function(w,P,x,A){A===void 0&&(A=x);var R=Object.getOwnPropertyDescriptor(P,x);R&&!("get"in R?!P.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return P[x]}}),Object.defineProperty(w,A,R)}:function(w,P,x,A){A===void 0&&(A=x),w[A]=P[x]}),r=Se&&Se.__setModuleDefault||(Object.create?function(w,P){Object.defineProperty(w,"default",{enumerable:!0,value:P})}:function(w,P){w.default=P}),n=Se&&Se.__importStar||function(w){if(w&&w.__esModule)return w;var P={};if(w!=null)for(var x in w)x!=="default"&&Object.prototype.hasOwnProperty.call(w,x)&&t(P,w,x);return r(P,w),P},i=Se&&Se.__rest||function(w,P){var x={};for(var A in w)Object.prototype.hasOwnProperty.call(w,A)&&P.indexOf(A)<0&&(x[A]=w[A]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(A=Object.getOwnPropertySymbols(w);R<A.length;R++)P.indexOf(A[R])<0&&Object.prototype.propertyIsEnumerable.call(w,A[R])&&(x[A[R]]=w[A[R]])}return x};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=Jc,o=n(Cu),l=Jc,u=_0,f=(w,P,...x)=>({type:w,props:P,children:x||[]});function v(w){var P=new DOMParser().parseFromString(w,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)}e.fixRatio=v;const S=async({element:w,page:P,store:x})=>{let{src:A}=w;if(w.type==="svg"&&Object.keys(w.colorsReplace).length){const X=await o.urlToString(A);A=o.replaceColors(X,new Map(Object.entries(w.colorsReplace)))}let R="";w.flipX&&(R+="scaleX(-1)"),w.flipY&&(R+="scaleY(-1)"),R||(R="none");const M={};if(w.clipSrc){const X=await o.urlToBase64(w.clipSrc);M["clip-path"]=`url(${X})`}const U=await(0,l.loadImage)(A),V=U.width*w.cropWidth,q=U.height*w.cropHeight,z=w.width/w.height;let F,G;const L=V/q;w.type==="svg"?(F=V,G=q):z>=L?(F=V,G=V/z):(F=q*z,G=q);const I=F/U.width,B=G/U.height,D=F/G>w.width/w.height?w.height/G:w.width/F,$=F*D/I,K=G*D/B,Y=w.cropX*D*U.width,H=w.cropY*D*U.height;return f("div",{style:Object.assign(Object.assign({},M),{width:"100%",height:"100%","border-radius":w.cornerRadius+"px",border:w.borderSize?`${w.borderSize}px solid ${w.borderColor}`:"none",background:`url(${A})`,transform:R,"background-size":`${Math.round($)}px ${Math.round(K)}px`,"background-position-x":-Math.round(Y)+"px","background-position-y":-Math.round(H)+"px"})})},_=async({element:w,page:P,store:x})=>{let A={};w.fill.indexOf("gradient")>=0&&(A=Object.assign(Object.assign({},A),{"background-color":w.fill,"background-image":w.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const R=w.backgroundPadding*(w.fontSize*w.lineHeight),M=f("div",{style:{position:"absolute",top:-R/2+"px",left:-R/2+"px",display:w.backgroundEnabled?"block":"none",width:w.width+R+"px",height:w.height+R+"px","background-color":w.backgroundColor,"border-radius":w.backgroundCornerRadius*(w.fontSize*w.lineHeight*.5)+"px"}}),U=f("div",{style:Object.assign(Object.assign({},A),{position:"absolute",top:0,left:0,width:w.width+"px",color:w.fill,"white-space":"pre-wrap","font-size":w.fontSize+"px","text-align":w.align,"font-family":w.fontFamily,"text-decoration":w.textDecoration||"none","line-height":w.lineHeight,"letter-spacing":w.letterSpacing+"em","font-style":w.fontStyle,"font-weight":w.fontWeight,"-webkit-text-stroke":`${w.strokeWidth}px ${w.stroke}`,"text-stroke":`${w.strokeWidth}px ${w.stroke}`})},w.text.split(`
271
+ `).join("<br />"));return f("div",{style:{position:"relative"}},M,U)},p=({element:w,type:P})=>{const x={"stroke-width":w.height,stroke:w.color,"line-cap":"round","stroke-linejoin":"round",opacity:w.opacity};return P==="arrow"||P==="triangle"?f("polyline",Object.assign({points:`${3*w.height},${2*-w.height} 0,0 ${3*w.height},${2*w.height}`},x)):P==="bar"?f("polyline",Object.assign({points:`0,${2*-w.height} 0,${2*w.height}`},x)):P==="circle"?f("circle",Object.assign({r:w.height},x)):P==="square"?f("polyline",Object.assign({points:`${-w.height},${-w.height} ${-w.height},${w.height} ${w.height},${w.height} ${w.height},${-w.height}`},x)):null},E=async({element:w,page:P,store:x})=>f("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},f("rect",{x:0,y:0,width:w.width,height:w.height,fill:w.color}),f("g",{transform:`translate(0 ${w.height/2})`},p({element:w,type:w.startHead})),f("g",{transform:`translate(${w.width} ${w.height/2}) rotate(180)`},p({element:w,type:w.endHead}))),b=async({element:w,page:P,store:x,elementHook:A})=>{const R=await Promise.all(w.children.map(U=>h({element:U,page:P,store:x,elementHook:A}))),M=f("div",{style:{"transform-origin":"top left",opacity:w.opacity}},...R);return A&&A({dom:M,element:w})||M},m=async({element:w,page:P,store:x,elementHook:A})=>{const R=(0,u.figureToSvg)(w),M=f("div",{innerHTML:R});return A&&A({dom:M,element:w})||M},g={image:S,svg:S,text:_,line:E,figure:m,group:b};async function h({element:w,page:P,store:x,elementHook:A}){let R=await g[w.type];R||(R=()=>f("div",{}),console.error(`HTML export does not support ${w.type} type...`));const M=await R({element:w,page:P,store:x}),U=[];w.blurEnabled&&U.push(`blur(${w.blurRadius/2}px)`),w.brightnessEnabled&&U.push(`brightness(${100*w.brightness+100}%)`),w.sepiaEnabled&&U.push("sepia()"),w.grayscaleEnabled&&U.push("grayscale()"),w.shadowEnabled&&U.push(`drop-shadow(${w.shadowOffsetX}px ${w.shadowOffsetY}px ${w.shadowBlur}px ${w.shadowColor})`);const V=f("div",{style:{position:"absolute",left:w.x+"px",top:w.y+"px",width:w.width+"px",height:w.height+"px",transform:`rotate(${w.rotation}deg)`,"transform-origin":"top left",opacity:w.opacity,filter:U.join(" ")||"none"}},M);return A&&A({dom:V,element:w})||V}async function d({page:w,store:P,elementHook:x}){const A=await Promise.all(w.children.map(V=>h({element:V,page:w,store:P,elementHook:x}))),R=w.width==="auto"?P.width:w.width,M=w.height==="auto"?P.height:w.height;let U={};if(w.background.indexOf("url")>=0||w.background.indexOf("http")>=0||w.background.indexOf(".jpg")>=0||w.background.indexOf(".png")>=0||w.background.indexOf(".jpeg")>=0){const{width:V,height:q}=await(0,l.loadImage)(w.background),z=await S({element:Object.assign({x:0,y:0,width:V,height:q,src:w.background,cornerRadius:0},(0,a.getCrop)({width:V,height:q},{width:V,height:q})),page:w,store:P});A.unshift(z)}else U=Object.assign(Object.assign({},U),{"background-color":w.background});return f("div",{className:"page",style:Object.assign(Object.assign({},U),{width:R+"px",height:M+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...A)}async function y({json:w,elementHook:P}){const x=await Promise.all(w.pages.map(M=>d({page:M,store:w,elementHook:P}))),A=[];w.pages.forEach(M=>{M.children.forEach(U=>{U.type==="text"&&A.indexOf(U.fontFamily)===-1&&A.push(U.fontFamily)})});const R=A.map(M=>w.fonts.find(U=>U.fontFamily===M)?f("style",{},""):f("link",{href:`https://fonts.googleapis.com/css?family=${M}`,rel:"stylesheet"}));return f("div",{className:"design"},...R,...x)}e.jsonToDOM=y;const O=(w,P)=>typeof P=="object"?`${w}="${Object.keys(P).map(x=>`${x}:${P[x]};`).join(" ")}"`:`${w}="${P}"`,k=({dom:w})=>{if(typeof w=="string")return w;if(!w)return"";const P=w.props,{innerHTML:x}=P,A=i(P,["innerHTML"]);return`<${w.type} ${Object.keys(A).map(R=>O(R,w.props[R])).join(" ")}>${x||w.children.map(R=>k({dom:R})).join("")}</${w.type}>`};async function C({json:w,elementHook:P}){const x=await y({json:w,elementHook:P});return k({dom:x})}e.jsonToHTML=C})(IS);var DS={};(function(e){var t=Se&&Se.__createBinding||(Object.create?function(P,x,A,R){R===void 0&&(R=A);var M=Object.getOwnPropertyDescriptor(x,A);M&&!("get"in M?!x.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return x[A]}}),Object.defineProperty(P,R,M)}:function(P,x,A,R){R===void 0&&(R=A),P[R]=x[A]}),r=Se&&Se.__setModuleDefault||(Object.create?function(P,x){Object.defineProperty(P,"default",{enumerable:!0,value:x})}:function(P,x){P.default=x}),n=Se&&Se.__importStar||function(P){if(P&&P.__esModule)return P;var x={};if(P!=null)for(var A in P)A!=="default"&&Object.prototype.hasOwnProperty.call(P,A)&&t(x,P,A);return r(x,P),x},i=Se&&Se.__rest||function(P,x){var A={};for(var R in P)Object.prototype.hasOwnProperty.call(P,R)&&x.indexOf(R)<0&&(A[R]=P[R]);if(P!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(R=Object.getOwnPropertySymbols(P);M<R.length;M++)x.indexOf(R[M])<0&&Object.prototype.propertyIsEnumerable.call(P,R[M])&&(A[R[M]]=P[R[M]])}return A};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const a=Jc,o=n(Cu),l=Jc,u=_0,f=(P,x,...A)=>({type:P,props:x,children:A||[]});function v(P){var x=new DOMParser().parseFromString(P,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=v;const S=async({element:P,page:x,store:A})=>{let{src:R}=P;if(P.type==="svg"){const J=await o.urlToString(R);R=o.replaceColors(J,new Map(Object.entries(P.colorsReplace)))}let M="";P.flipX&&(M+="scaleX(-1)"),P.flipY&&(M+="scaleY(-1)"),P.clipSrc&&await o.urlToBase64(P.clipSrc);const U=await(0,l.loadImage)(R),V=U.width*P.cropWidth,q=U.height*P.cropHeight,z=P.width/P.height;let F,G;const L=V/q;P.type==="svg"?(F=V,G=q):z>=L?(F=V,G=V/z):(F=q*z,G=q);const I=F/U.width,B=G/U.height,D=F/G>P.width/P.height?P.height/G:P.width/F,$=F*D/I,K=G*D/B,Y=P.cropX*U.width*D,H=P.cropY*U.height*D,X=`clip-${P.id}`,Z=R.replace(/&/g,"&amp;");return f("g",{style:{transform:M}},f("defs",{},f("clipPath",{id:X},f("rect",{x:0,y:0,width:P.width,height:P.height}))),f("image",{"xlink:href":Z,x:-Y,y:-H,width:$,height:K,preserveAspectRatio:"none","clip-path":`url(#${X})`}))},_=async({element:P,page:x,store:A})=>{const R=(z,F,G,L,I)=>{const B=document.createElement("canvas").getContext("2d");return B.font=`${I} ${L} ${F}px ${G}`,B.measureText(z).width},M=((z,F,G,L,I,B)=>{const D=[];return z.split(`
272
+ `).forEach($=>{const K=$.split(" ");let Y="";for(let H=0;H<K.length;H++){const X=Y+K[H]+" ";R(X,G,L,I,B)>F&&H>0?(D.push(Y.trim()),Y=K[H]+" "):Y=X}D.push(Y.trim())}),D})(P.text,P.width,P.fontSize,P.fontFamily,P.fontWeight,P.fontStyle),U=P.fontSize*P.lineHeight,V=P.align==="center"?"middle":P.align==="right"?"end":"start",q=M.map((z,F)=>f("tspan",{x:P.align==="center"?P.width/2:P.align==="right"?P.width:0,dy:F===0?0:U,innerHTML:z}));return f("g",{},f("text",{fill:P.fill,y:P.fontSize,"font-size":P.fontSize+"px","text-anchor":V,"font-family":P.fontFamily,"font-style":P.fontStyle,"font-weight":P.fontWeight,"text-decoration":P.textDecoration,"line-height":P.lineHeight,"letter-spacing":P.letterSpacing+"em","stroke-width":P.strokeWidth,stroke:P.stroke},...q))},p=({element:P,type:x})=>{const A={"stroke-width":P.height,stroke:P.color,"line-cap":"round","stroke-linejoin":"round",opacity:P.opacity};return x==="arrow"||x==="triangle"?f("polyline",Object.assign({points:`${3*P.height},${2*-P.height} 0,0 ${3*P.height},${2*P.height}`},A)):x==="bar"?f("polyline",Object.assign({points:`0,${2*-P.height} 0,${2*P.height}`},A)):x==="circle"?f("circle",Object.assign({r:P.height},A)):x==="square"?f("polyline",Object.assign({points:`${-P.height},${-P.height} ${-P.height},${P.height} ${P.height},${P.height} ${P.height},${-P.height}`},A)):null},E=async({element:P,page:x,store:A})=>f("g",{},f("line",{x1:0,y1:P.height/2,x2:P.width,y2:P.height/2,stroke:P.color,"stroke-width":P.height}),f("g",{transform:`translate(0 ${P.height/2})`},p({element:P,type:P.startHead})),f("g",{transform:`translate(${P.width} ${P.height/2}) rotate(180)`},p({element:P,type:P.endHead}))),b=async({element:P,page:x,store:A,elementHook:R})=>{const M=await Promise.all(P.children.map(V=>d({element:V,page:x,store:A,elementHook:R}))),U=f("g",{opacity:P.opacity,transform:`translate(${P.x}, ${P.y}) rotate(${P.rotation})`,style:{"transform-origin":"top left"}},...M);return R&&R({dom:U,element:P})||U};function m(P){let x=P.replace(/<svg[^>]*>/,"");return x=x.replace(/<\/svg>/,""),x}const g=async({element:P,page:x,store:A,elementHook:R})=>{const M=m((0,u.figureToSvg)(P)),U=f("g",{innerHTML:M});return R&&R({dom:U,element:P})||U},h={image:S,svg:S,text:_,line:E,figure:g,group:b};async function d({element:P,page:x,store:A,elementHook:R}){let M=await h[P.type];M||(M=()=>f("g",{}),console.error(`SVG export does not support ${P.type} type...`));const U=await M({element:P,page:x,store:A}),V=[];P.blurEnabled&&V.push(`blur(${P.blurRadius/2}px)`),P.brightnessEnabled&&V.push(`brightness(${100*P.brightness+100}%)`),P.sepiaEnabled&&V.push("sepia()"),P.grayscaleEnabled&&V.push("grayscale()"),P.shadowEnabled&&V.push(`drop-shadow(${P.shadowOffsetX}px ${P.shadowOffsetY}px ${P.shadowBlur}px ${P.shadowColor})`);const q=f("g",{className:"element",id:P.id,transform:`translate(${P.x}, ${P.y}) rotate(${P.rotation})`,display:P.visible?void 0:"none",style:{"transform-origin":"top left",filter:V.join(" ")}},U);return R&&R({dom:q,element:P})||q}async function y({page:P,store:x,elementHook:A}){const R=await Promise.all(P.children.map(U=>d({element:U,page:P,store:x,elementHook:A})));let M={};if(P.background.indexOf("url")>=0||P.background.indexOf("http")>=0||P.background.indexOf(".jpg")>=0||P.background.indexOf(".png")>=0||P.background.indexOf(".jpeg")>=0){const U=await(0,l.loadImage)(P.background),V=await(0,l.cropImage)(P.background,Object.assign({width:x.width,height:x.height,x:0,y:0},(0,a.getCrop)({width:x.width,height:x.height},{width:U.width,height:U.height})));M=Object.assign(Object.assign({},M),{"background-image":`url(${V})`})}return f("g",{className:"page",style:Object.assign(Object.assign({},M),{background:P.background})},f("rect",{x:0,y:0,width:x.width,height:x.height,fill:P.background}),...R)}async function O({json:P,elementHook:x}){const A=await Promise.all(P.pages.map(U=>y({page:U,store:P,elementHook:x}))),R=[];P.pages.forEach(U=>{U.children.forEach(V=>{V.type==="text"&&R.indexOf(V.fontFamily)===-1&&R.push(V.fontFamily)})});const M=R.map(U=>P.fonts.find(V=>V.fontFamily===U)?f("style",{},""):f("defs",{},f("style",{type:"text/css",innerHTML:`@import url('https://fonts.googleapis.com/css?family=${U}: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 ${P.width} ${P.height}`},...M,...A)}e.jsonToDOM=O;const k=(P,x)=>typeof x=="object"?`${P}="${Object.keys(x).map(A=>`${A}:${x[A]};`).join(" ")}"`:x==null||x===""?"":`${P}="${x}"`,C=({dom:P,nestLevel:x=0})=>{if(typeof P=="string")return P;if(!P)return"";const A=P.props,{innerHTML:R}=A,M=i(A,["innerHTML"]),U=" ".repeat(x);return`${U}<${P.type} ${Object.keys(M).map(V=>k(V,M[V])).join(" ")}>${R||`
273
+ `+P.children.map(V=>C({dom:V,nestLevel:x+1})).join("")}${U}</${P.type}>
274
+ `};async function w({json:P,elementHook:x}){const A=await O({json:P,elementHook:x});return C({dom:A})}e.jsonToSVG=w})(DS);var dv={},L_;function FS(){return L_||(L_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=$i,r=S0,n=ef(),i=B2(),a=ef();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(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get store(){return(0,t.getParentOfType)(o,i.Store)},get startTime(){let l=0;for(const u of o.store.pages){if(u.id===o.id)return l;l+=u.duration}return l},get _exportingOrRendering(){return o._exporting||o._rendering}})).views(o=>({get computedWidth(){return o.width==="auto"?o.store.width:o.width},get computedHeight(){return o.height==="auto"?o.store.height:o.height}})).actions(o=>({toJSON:()=>JSON.parse(JSON.stringify((0,t.getSnapshot)(o))),_forEachElementUp(l,u){const f=l.map(v=>({id:v,index:o.children.findIndex(S=>S.id===v)}));f.sort((v,S)=>S.index-v.index);for(const{index:v}of f){if(v==-1)continue;const S=v<o.children.length-1&&o.children[v+1],_=l.indexOf(S==null?void 0:S.id)>=0;v===o.children.length-1||_||u(v)}},_forEachElementDown(l,u){const f=l.map(v=>({id:v,index:o.children.findIndex(S=>S.id===v)}));f.sort((v,S)=>v.index-S.index);for(const{index:v}of f){if(v==-1)continue;const S=v>0&&o.children[v-1],_=l.indexOf(S==null?void 0:S.id)>=0;v===0||_||u(v)}return!1}})).actions(o=>({clone(l={}){const u=o.toJSON();u.children.forEach(_=>{_.id=(0,r.nanoid)(10),(0,a.forEveryChild)(_,p=>{p.id=(0,r.nanoid)(10)})});const f=Object.assign(Object.assign(Object.assign({},u),{id:(0,r.nanoid)(10)}),l),v=o.store.addPage(f),S=o.store.pages.indexOf(o);v.setZIndex(S+1),v.select()},setZIndex(l){o.store.setPageZIndex(o.id,l)},set(l){Object.assign(o,l)},select(){o.store.selectPage(o.id)},addElement(l,{skipSelect:u=!1}={}){const f=a.TYPES_MAP[l.type];if(!f)return void console.error("Can not find model with type "+l.type);l.children&&l.children.forEach(S=>{S.id=(0,r.nanoid)(10)});const v=f.create(Object.assign({id:(0,r.nanoid)(10)},l));return o.children.push(v),v.selectable&&!u&&o.store.selectElements([v.id]),v},canMoveElementsUp(l){let u=!1;return o._forEachElementUp(l,()=>{u=u||!0}),u},moveElementsUp(l){o._forEachElementUp(l,u=>{const f=o.children[u];(0,t.detach)(f),o.children.splice(u+1,0,f)})},canMoveElementsTop(l){return this.canMoveElementsUp(l)},moveElementsTop(l){const u=[],f=[];o.children.forEach(v=>{l.indexOf(v.id)>=0?u.push(v):f.push(v)}),o.children.replace(f.concat(u))},canMoveElementsDown(l){let u=!1;return o._forEachElementDown(l,()=>{u=u||!0}),u},moveElementsDown(l){o._forEachElementDown(l,u=>{const f=o.children[u];(0,t.detach)(f),o.children.splice(u-1,0,f)})},canMoveElementsBottom(l){return this.canMoveElementsDown(l)},moveElementsBottom(l){const u=[],f=[];o.children.forEach(v=>{l.indexOf(v.id)>=0?u.push(v):f.push(v)}),o.children.replace(u.concat(f))},setElementZIndex(l,u){const f=o.children.find(v=>v.id===l);f&&((0,t.detach)(f),o.children.remove(f),o.children.splice(u,0,f))},setSize({width:l,height:u,useMagic:f,softChange:v}){if(f){const S=l/o.computedWidth,_=u/o.computedHeight,p=Math.min(S,_),E=Math.max(0,(l-o.computedWidth*p)/2),b=Math.max(0,(u-o.computedHeight*p)/2);(0,a.forEveryChild)(o,m=>{m.type!=="group"&&(m.type==="image"&&m.x<1&&m.y<1&&m.width>=o.computedWidth-2&&m.height>=o.computedHeight-2?m.set({x:m.x*p,y:m.y*p,width:m.width*S,height:m.height*_,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(m.set({x:E+m.x*p,y:b+m.y*p,width:m.width*p,height:m.height*p}),m.type==="text"?m.set({fontSize:m.fontSize*p}):m.type==="figure"&&m.set({strokeWidth:m.strokeWidth*p})))})}v||(o.width=l),v||(o.height=u)}})).actions(o=>({moveElementUp(l){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),o.moveElementsUp([l])},moveElementDown(l){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),o.moveElementsDown([l])},moveElementTop(l){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),o.moveElementsTop([l])},moveElementBottom(l){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),o.moveElementsBottom([l])},play(){o.store.play({startTime:o.startTime,endTime:o.startTime+o.duration})}}))}(dv)),dv}var M_;function B2(){return M_||(M_=1,function(e){var t=Se&&Se.__createBinding||(Object.create?function(w,P,x,A){A===void 0&&(A=x);var R=Object.getOwnPropertyDescriptor(P,x);R&&!("get"in R?!P.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return P[x]}}),Object.defineProperty(w,A,R)}:function(w,P,x,A){A===void 0&&(A=x),w[A]=P[x]}),r=Se&&Se.__setModuleDefault||(Object.create?function(w,P){Object.defineProperty(w,"default",{enumerable:!0,value:P})}:function(w,P){w.default=P}),n=Se&&Se.__importStar||function(w){if(w&&w.__esModule)return w;var P={};if(w!=null)for(var x in w)x!=="default"&&Object.prototype.hasOwnProperty.call(w,x)&&t(P,w,x);return r(P,w),P},i=Se&&Se.__rest||function(w,P){var x={};for(var A in w)Object.prototype.hasOwnProperty.call(w,A)&&P.indexOf(A)<0&&(x[A]=w[A]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(A=Object.getOwnPropertySymbols(w);R<A.length;R++)P.indexOf(A[R])<0&&Object.prototype.propertyIsEnumerable.call(w,A[R])&&(x[A[R]]=w[A[R]])}return x},a=Se&&Se.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=$i,l=kS,u=S0,f=a(vi),v=RS,S=LS,_=MS,p=j2(),E=n(Pu),b=ua,m=w0,g=z2,h=NS,d=IS,y=DS,O=FS(),k=ef();function C({key:w,showCredit:P}={key:"",showCredit:!1}){const x=e.Store.create();return(0,p.validateKey)(w,P),x}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(w=>Object.assign(Object.assign({},w),{fontFamily:w.fontFamily||w.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(O.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:2,_activePageId:""}).views(w=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),w.bleedVisible},get selectedElements(){return w.selectedElementsIds.map(P=>{for(const x of w.pages)for(const A of x.children)if(A.id===P)return A}).filter(P=>!!P)},get children(){return w.pages},get selectedShapes(){const P=[];return(0,k.forEveryChild)({children:w.selectedElements},x=>{x.type!=="group"&&P.push(x)}),P},get activePage(){return w.pages.slice().find(P=>P.id===w._activePageId)||(w.pages.length?w.pages[0]:null)},get duration(){let P=0;return w.pages.forEach(x=>{P+=x.duration}),P},get _hasCroppedImages(){return w.find(P=>P.type==="image"&&P._cropModeEnabled)},find(P){let x;return(0,k.forEveryChild)({children:w.pages},A=>{if(!x&&P(A))return x=A,!0}),x},getElementById:P=>w.find(x=>x.id===P)})).actions(w=>{let P=0,x=null,A=!1;return{afterCreate(){w.history.canUndo},setCurrentTime(R){w.currentTime=R},play({animatedElementsIds:R=[],startTime:M=0,currentTime:U=0,endTime:V=w.duration,repeat:q=!1}={}){U&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),M=U),w.animatedElementsIds=(0,o.cast)(R),w.currentTime=M,w.isPlaying=!0,P=Date.now(),x=V,A=q,requestAnimationFrame(w.seek)},checkActivePage(){let R=0;for(const M of w.pages){if(w.currentTime>=M.startTime&&w.currentTime<M.startTime+M.duration){w.selectPage(M.id);break}R+=M.duration}},seek(){if(!w.isPlaying)return;const R=Date.now(),M=R-P;P=R,w.currentTime+=M,w.checkActivePage();const U=x||w.duration;w.isPlaying&&w.currentTime<U?requestAnimationFrame(w.seek):w.isPlaying&&A?(w.currentTime=0,requestAnimationFrame(w.seek)):w.stop()},stop(){w.isPlaying=!1,w.currentTime=0,w.animatedElementsIds=(0,o.cast)([]),w.checkActivePage()}}}).actions(w=>({set(P){Object.assign(w,P)},setUnit({unit:P,dpi:x}){w.unit=P||w.unit,w.dpi=x||w.dpi},setRole(P){w.role=P},addPage(P){const x=O.Page.create(Object.assign({id:(0,u.nanoid)(10)},P));return w.pages.push(x),w._activePageId=x.id,x},selectPage(P){w._activePageId=P},selectElements(P){const x=P.map(A=>w.getElementById(A)).sort((A,R)=>A.page.children.indexOf(A)-A.page.children.indexOf(R)).filter(A=>!!A).map(A=>A.id);w.selectedElementsIds=(0,o.cast)(x)},toggleBleed(P){w.bleedVisible=P??!w.bleedVisible},toggleRulers(P){w.rulesVisible=P??!w.rulesVisible},openSidePanel(P){w.openedSidePanel!==P&&(w.previousOpenedSidePanel=w.openedSidePanel,w.openedSidePanel=P)},setScale(P){w.scale=P},_setScaleToFit(P){w.scaleToFit=P},setElementsPixelRatio(P){w._elementsPixelRatio=P},setSize(P,x,A){w.pages.forEach(R=>{R.setSize({width:P,height:x,useMagic:A,softChange:!0})}),w.width=P,w.height=x},setPageZIndex(P,x){const A=w.pages.find(R=>R.id===P);A&&((0,o.detach)(A),w.pages.remove(A),w.pages.splice(x,0,A))},deletePages(P){const x=w.pages.indexOf(w.activePage);P.forEach(M=>{const U=w.pages.find(V=>V.id===M);(0,o.destroy)(U)});const A=Math.min(w.pages.length-1,x),R=w.pages[A];R&&(w._activePageId=R.id),w.selectedElementsIds=(0,o.cast)(w.selectedElementsIds.filter(M=>w.getElementById(M)))},groupElements(P){const x=P.map(M=>w.getElementById(M));x.forEach(M=>{M&&(0,o.detach)(M)});const A=w.activePage,R={id:(0,u.nanoid)(10),children:x,type:"group"};return A.children.push(R),w.selectedElementsIds=(0,o.cast)([R.id]),R},ungroupElements(P){const x=P.map(R=>w.getElementById(R)),A=[];x.forEach(R=>{if(R&&R.type==="group"){const M=R.page,U=M.children.indexOf(R);R.children.forEach(V=>{A.push(V.id)}),R.children.forEach(V=>{(0,o.detach)(V),M.children.push(V)}),M.children.splice(U,1)}}),w.selectedElementsIds=(0,o.cast)(A)},deleteElements(P){const x=[];w.find(A=>(P.includes(A.id)&&x.push(A),!1)),x.forEach(A=>{(0,o.destroy)(A)}),w.selectedElementsIds=(0,o.cast)(w.selectedElementsIds.filter(A=>w.getElementById(A)))},on(P,x){if(P==="change"){let A=w.toJSON();return(0,o.onSnapshot)(w,R=>{const M=w.toJSON();!(0,g.deepEqual)(A,M)&&(A=M,x(M))})}},async _toCanvas({pixelRatio:P,ignoreBackground:x,pageId:A,mimeType:R,includeBleed:M,_skipTimeout:U}={}){var V;const q=P||1;A=A||((V=w.pages[0])===null||V===void 0?void 0:V.id);const z=w.pages.find(le=>le.id===A);if(!z)throw new Error(`No page for export with id ${A}`);z==null||z.set({_exporting:!0});const F=await(0,h.waitTillAvailable)(()=>f.default.stages.find(le=>le.getAttr("pageId")===A));if(!F)throw new Error(`Export is failed. Can not find stage for page ${A}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const G=!!F.findOne(".page-container"),L=w._elementsPixelRatio;q>w._elementsPixelRatio&&w.setElementsPixelRatio(q),await w.waitLoading({_skipTimeout:U});const I=F.findOne(".page-container");if(!I)throw w.setElementsPixelRatio(L),new Error(`Export is failed. Can't find page container. ${G}`);F.find("Transformer").forEach(le=>le.visible(!1)),I.find(".page-background").forEach(le=>le.shadowEnabled(!1)),I.find(".page-background").forEach(le=>le.strokeEnabled(!1)),I.find(".highlighter").forEach(le=>le.visible(!1));const B=I.findOne(".page-background-group"),D=B.clip();B.clip({x:null,y:null,width:null,height:null});const $=I.findOne(".elements-container"),K=$.clip();$.clip({x:null,y:null,width:null,height:null});const Y=I.find(le=>le.getAttr("hideInExport"));Y.forEach(le=>{le.setAttr("oldVisible",le.visible()),le.hide()});const H=I.find(le=>!le.visible()&&le.getAttr("editModeEnabled"));H.forEach(le=>{le.setAttr("oldVisible",le.visible()),le.show()}),x&&I.find(".page-background").forEach(le=>le.hide());const X=M?z.bleed:0;let Z=X;!w.bleedVisible&&M||(w.bleedVisible||M?w.bleedVisible&&M?Z=0:w.bleedVisible&&!M&&(Z=-z.bleed):Z=0);const J=document.createElement("canvas");J.width=Math.round((z.computedWidth+2*X)*q),J.height=Math.round((z.computedHeight+2*X)*q);const ee=J.getContext("2d");R==="image/jpeg"&&(ee.fillStyle="white",ee.fillRect(0,0,J.width,J.height));const re=I.scale();I.scale({x:1,y:1});const ae=I.toCanvas({x:I.x()-Z,y:I.y()-Z,width:z.computedWidth+2*X,height:z.computedHeight+2*X,pixelRatio:q});return I.scale(re),ee.drawImage(ae,0,0,J.width,J.height),f.default.Util.releaseCanvas(ae),x&&I.find(".page-background").forEach(le=>le.show()),Y.forEach(le=>{le.visible(le.getAttr("oldVisible"))}),H.forEach(le=>{le.visible(le.getAttr("oldVisible"))}),I.find(".page-background").forEach(le=>le.shadowEnabled(!0)),I.find(".page-background").forEach(le=>le.strokeEnabled(!0)),F.find("Transformer").forEach(le=>le.visible(!0)),I.find(".highlighter").forEach(le=>le.visible(!0)),B.clip(D),$.clip(K),w.setElementsPixelRatio(L),z==null||z.set({_exporting:!1}),J},async toDataURL(P={}){var{mimeType:x,quality:A}=P,R=i(P,["mimeType","quality"]);const M=await w._toCanvas(Object.assign({mimeType:x},R)),U=M.toDataURL(x,A);return f.default.Util.releaseCanvas(M),U},async toBlob(P={}){var{mimeType:x,quality:A}=P,R=i(P,["mimeType","quality"]);const M=await w._toCanvas(Object.assign({mimeType:x},R)),U=new Promise(V=>{M.toBlob(V,x,A)});return f.default.Util.releaseCanvas(M),U},async saveAsImage(P={}){var{fileName:x}=P,A=i(P,["fileName"]);const R=A.mimeType||"image/png",M=R.split("/")[1];(0,v.downloadFile)(await w.toDataURL(A),x||"polotno."+M,R)},async _toPDF(P){const x=P.dpi||w.dpi,A=P.parallel||1,R=P.unit||(w.unit==="px"?"mm":w.unit),M=P.pixelRatio||1,U=P.pageIds||w.pages.map(K=>K.id),V=w.pages.filter(K=>U.includes(K.id)),q=await(0,S.getJsPDF)(),z=K=>(0,m.pxToUnit)({px:K,unit:R,dpi:x}),F=z(P.cropMarkSize||0),G=V[0]||{},L=P.includeBleed?G.bleed:0,I=z(G.computedWidth+2*L)+2*F,B=z(G.computedHeight+2*L)+2*F;var D=new q({unit:R,orientation:I>B?"landscape":"portrait",format:[I,B],compress:!0,putOnlyUsedFonts:!0});D.deletePage(1);const $=((K,Y)=>{for(var H=[],X=0;X<K.length;X+=Y)H.push(K.slice(X,X+Y));return H})(V,A);for(const K of $){const Y=K.map(async H=>{const X=P.includeBleed?H.bleed:0,Z=z(H.computedWidth+2*X)+2*F,J=z(H.computedHeight+2*X)+2*F;let ee=0,re=M;for(;ee<10;){ee+=1,ee===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ae=await w.toDataURL(Object.assign(Object.assign({},P),{pageId:H.id,pixelRatio:re}));if(ae.length>20)return{url:ae,width:Z,height:J};re*=.8}});(await Promise.all(Y)).forEach(({url:H,width:X,height:Z})=>{D.addPage([X,Z],X>Z?"landscape":"portrait"),F&&(D.setLineWidth(z(1)),D.line(2*F,0,2*F,F),D.line(0,2*F,F,2*F),D.line(X-2*F,0,X-2*F,F),D.line(X,2*F,X-F,2*F),D.line(0,Z-2*F,F,Z-2*F),D.line(2*F,Z,2*F,Z-F),D.line(X,Z-2*F,X-F,Z-2*F),D.line(X-2*F,Z,X-2*F,Z-F)),D.addImage(H,F,F,X-2*F,Z-2*F,void 0,"FAST")})}return D},toPDFDataURL:async P=>(await w._toPDF(Object.assign({mimeType:"image/jpeg"},P))).output("datauristring"),async toGIFDataURL(P={}){const x=P.pixelRatio||1,A=await(0,_.createGIF)({width:w.width*x,height:w.height*x}),R=1e3/(P.fps||10),M=w.duration/R;for(let U=0;U<M-1;U++){const V=U*R||1;w.setCurrentTime(V);let q=0,z="";for(const G of w.pages)if(q+=G.duration,G.set({_rendering:q>V}),q>V){z=G.id;break}const F=await w._toCanvas({pixelRatio:x,pageId:z,_skipTimeout:!0});A.addFrame(F.getContext("2d"),{delay:R,copy:!0})}for(const U of w.pages)U.set({_rendering:!1});return w.stop(),A.render(),new Promise(U=>{A.on("finished",function(V){(function(q,z){var F=new FileReader;F.onload=function(G){z(G.target.result)},F.readAsDataURL(q)})(V,U)})})},async saveAsGIF(P={}){var{fileName:x}=P,A=i(P,["fileName"]);const R=await w.toGIFDataURL(A);(0,v.downloadFile)(R,x||"polotno.gif")},async toHTML({elementHook:P}={elementHook:void 0}){const x=w.toJSON();return(0,d.jsonToHTML)({json:x,elementHook:P})},async saveAsHTML({fileName:P}={}){const x=await w.toHTML(),A="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(x)));(0,v.downloadFile)(A,P||"polotno.html")},async toSVG({elementHook:P}={elementHook:void 0}){const x=w.toJSON();return(0,y.jsonToSVG)({json:x,elementHook:P})},async saveAsSVG({fileName:P,elementHook:x}={}){const A=await w.toSVG({elementHook:x}),R="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(A)));(0,v.downloadFile)(R,P||"polotno.svg")},async saveAsPDF(P={}){var{fileName:x}=P,A=i(P,["fileName"]);(await w._toPDF(Object.assign({mimeType:"image/jpeg"},A))).save(x||"polotno.pdf")},async waitLoading({_skipTimeout:P=!1}={}){P||await new Promise(x=>setTimeout(x,50)),await(0,b.whenLoaded)()},toJSON:()=>({width:w.width,height:w.height,fonts:(0,o.getSnapshot)(w.fonts),pages:(0,o.getSnapshot)(w.pages),unit:w.unit,dpi:w.dpi,custom:w.custom}),loadJSON(P,x=!1){var A;const R=Object.assign({},P),M=w.pages.indexOf(w.activePage);let U=(A=R.pages[M]||R.pages[0])===null||A===void 0?void 0:A.id;R._activePageId=U;const V=Object.assign({},(0,o.getSnapshot)(w));Object.assign(V,R),V.history=x?w.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(w,V)},clear({keepHistory:P=!1}={}){const x=w.pages.map(A=>A.id);w.deletePages(x),P||w.history.clear()},addFont(P){w.removeFont(P.fontFamily),w.fonts.push(P),w.loadFont(P.fontFamily)},removeFont(P){w.fonts.filter(x=>x.fontFamily===P).forEach(x=>(0,o.destroy)(x))},async loadFont(P){const x=w.fonts.find(A=>A.fontFamily===P)||E.globalFonts.find(A=>A.fontFamily===P);x?E.injectCustomFont(x):E.injectGoogleFont(P),await E.loadFont(P)},validate:P=>e.Store.validate(P,[{path:"",type:e.Store}]).map(x=>({path:"store"+x.context.map(A=>A.path).join("."),message:x.message}))})),e.createStore=C,e.default=C}(fv)),fv}var N_;function jS(){return N_||(N_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=$i,r=S0,n=B2(),i=FS(),a=ef();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,v=>{v.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(){}}))}(cv)),cv}var hv={},zS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t={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:i,element:a,animation:o})=>{const l=i/o.duration;return o.type==="enter"?{opacity:l*a.opacity}:{opacity:(1-l)*a.opacity}},move:({dTime:i,element:a,animation:o})=>{const l=t[o.data.direction]||t.right,u={};for(var f in l.from){let v=l.from[f],S=l.to[f];o.type==="exit"&&(v=l.to[f],S=-l.from[f]);const _=a[f]+v,p=a[f]+S-_;u[f]=_+i/o.duration*p}return u},zoom:({dTime:i,element:a,animation:o})=>{const l={},u={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},f={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize};for(var v in u){let S=u[v],_=f[v];if(o.type==="exit"){const E=S;S=_,_=E}const p=_-S;l[v]=S+i/o.duration*p}return l}};const r=({element:i,dTime:a,animation:o})=>{const l=e.animations[o.name];return l?l({element:i,dTime:a,animation:o}):(console.error("Can not find animation type: "+o.name),{})};e.animate=r;const n=(i,a)=>{};e.registerAnimation=n})(zS);var I_;function Au(){return I_||(I_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=$i,r=zS,n=ha,i=jS();e.Animation=t.types.model("Animation",{delay:0,duration:500,enabled:!0,type:t.types.enumeration("Type",["enter","exit"]),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}).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 v=a.store.animatedElementsIds;if(v.length&&!v.includes(a.id))return o;const S=a.animations.find(p=>p.type==="enter");if(S!=null&&S.enabled&&f<S.delay&&l({opacity:0}),S!=null&&S.enabled&&f>=S.delay&&f<=S.delay+S.duration){const p=f-S.delay,E=(0,r.animate)({element:a,animation:S,dTime:p});l(E)}const _=a.animations.find(p=>p.type==="exit");if(_!=null&&_.enabled&&f>=a.page.duration-_.duration){const p=f-(a.page.duration-_.duration),E=(0,r.animate)({element:a,animation:_,dTime:p});l(E)}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))}}))}(hv)),hv}var pv={},D_;function sF(){return D_||(D_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=$i,r=Au();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()}}))}(pv)),pv}var gv={},F_;function BS(){return F_||(F_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=Au();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()}}))}(gv)),gv}var vv={},j_;function uF(){return j_||(j_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const t=BS();e.VideoElement=t.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1})}(vv)),vv}var mv={},z_;function cF(){return z_||(z_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=$i,r=Au();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=>({}))}(mv)),mv}var yv={},B_;function fF(){return B_||(B_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=$i,r=Au();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)}}))}(yv)),yv}var bv={},U_;function dF(){return U_||(U_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=$i,r=Au();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})}(bv)),bv}var H_;function ef(){return H_||(H_=1,function(e){var t=Se&&Se.__rest||function(m,g){var h={};for(var d in m)Object.prototype.hasOwnProperty.call(m,d)&&g.indexOf(d)<0&&(h[d]=m[d]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(d=Object.getOwnPropertySymbols(m);y<d.length;y++)g.indexOf(d[y])<0&&Object.prototype.propertyIsEnumerable.call(m,d[y])&&(h[d[y]]=m[d[y]])}return h};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=$i,n=S0,i=jS(),a=Au(),o=sF(),l=BS(),u=uF(),f=cF(),v=fF(),S=dF(),_=(m,g)=>{if(m.children)for(const h of m.children){if(g(h)===!0)break;(0,e.forEveryChild)(h,g)}};e.forEveryChild=_;const p=[...new Array(20)].map((m,g)=>r.types.late(()=>E[g]));e.ElementTypes=r.types.union({dispatcher:m=>{const g=e.TYPES_MAP[m.type];if(!g)throw new Error(`Unknown element type: "${m.type}"`);return g}},v.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,S.FigureElement,r.types.late(()=>e.GroupElement),...p),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(m=>({get draggable(){let g=!0;return(0,e.forEveryChild)(m,h=>{h.draggable||(g=!1)}),g},get resizable(){let g=!0;return(0,e.forEveryChild)(m,h=>{h.resizable||(g=!1)}),g},get contentEditable(){let g=!0;return(0,e.forEveryChild)(m,h=>{h.contentEditable||(g=!1)}),g},get styleEditable(){let g=!0;return(0,e.forEveryChild)(m,h=>{h.styleEditable||(g=!1)}),g},get locked(){let g=!0;return(0,e.forEveryChild)(m,h=>{h.locked||(g=!1)}),g}})).actions(m=>({set(g){var{draggable:h,contentEditable:d,styleEditable:y,resizable:O}=g,k=t(g,["draggable","contentEditable","styleEditable","resizable"]);h!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({draggable:h})}),d!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({contentEditable:d})}),y!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({styleEditable:y})}),O!==void 0&&(0,e.forEveryChild)(m,C=>{C.set({resizable:O})}),Object.assign(m,k)},addElement(g,{skipSelect:h=!1}={}){const d=e.TYPES_MAP[g.type];if(!d)return void console.error("Can not find model with type "+g.type);g.children&&g.children.forEach(O=>{O.id=(0,n.nanoid)(10)});const y=d.create(Object.assign({id:(0,n.nanoid)(10)},g));return m.children.push(y),y.selectable&&!h&&m.store.selectElements([y.id]),y},setElementZIndex(g,h){const d=m.children.find(y=>y.id===g);d&&(console.log({zIndex:h}),(0,r.detach)(d),m.children.remove(d),m.children.splice(h,0,d))}}));const E=[];function b(m,g){const h=m.type;if(!h)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(h).props(m);g&&(d=g(d)),e.TYPES_MAP[h]=d,E.push(d)}e.TYPES_MAP={svg:v.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:f.LineElement,video:u.VideoElement,figure:S.FigureElement},e.registerShapeModel=b}(uv)),uv}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=ef();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 v,S,_,p,E,b,m,g;if(((v=document.activeElement)===null||v===void 0?void 0:v.tagName)==="INPUT"||((S=document.activeElement)===null||S===void 0?void 0:S.tagName)==="TEXTAREA"||((_=document.activeElement)===null||_===void 0?void 0:_.contentEditable)==="true")return;const h=f.selectedElements.filter(k=>k.removable),d=h.map(k=>k.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const y=u.ctrlKey||u.metaKey,O=u.shiftKey;if(y&&!O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),y&&O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),y&&u.code==="KeyA"){u.preventDefault();const k=(p=f.activePage)===null||p===void 0?void 0:p.children.filter(w=>w.selectable),C=(k==null?void 0:k.map(w=>w.id))||[];f.selectElements(C)}if(y&&u.code==="KeyC"&&(u.preventDefault(),n=(E=f.activePage)===null||E===void 0?void 0:E.id,a(f.selectedElements.map(k=>k.toJSON()))),y&&u.code==="KeyX"&&(u.preventDefault(),n=(b=f.activePage)===null||b===void 0?void 0:b.id,a(f.selectedElements.map(k=>k.toJSON())),f.deleteElements(h)),y&&u.code==="KeyV"){u.preventDefault();let k=0;n===((m=f.activePage)===null||m===void 0?void 0:m.id)&&(k=f.width/20),n=(g=f.activePage)===null||g===void 0?void 0:g.id,f.history.transaction(()=>{const C=[],w=o();(0,t.forEveryChild)({children:w},P=>{delete P.id,P.type!=="group"&&(P.x+=k,P.y+=k)}),console.log(w),w.forEach(P=>{var x;const A=(x=f.activePage)===null||x===void 0?void 0:x.addElement(P);A&&C.push(A.id)}),a(w),f.selectElements(C)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x+1})}))}e.handleHotkey=l})(CS);var US={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=ha,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",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",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(f,v){var S,_=v.split("."),p=f;for(S=0;S<_.length;++S){if(p[_[S]]==null)return;p=p[_[S]]}return p}const i=f=>f&&typeof f=="object";function a(f,v){Object.keys(v).forEach(S=>{const _=f[S],p=v[S];i(p)&&i(_)?a(_,p):f[S]=p})}e.setTranslations=(0,t.action)(f=>{a(r,f)});const o=()=>(0,t.toJS)(r);e.getTranslations=o;const l={},u=f=>{const v=n(r,f);if(v!==void 0)return v;l[f]||(l[f]=!0,console.warn(`Missing translation '${f}'`));const S=f.split("."),_=S[S.length-1]||" ";return _.charAt(0).toUpperCase()+_.slice(1)};e.t=u})(US);(function(e){var t=Se&&Se.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(it),n=Hi,i=t(v9),a=xS,o=CS,l=US,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
275
+ Width or height of parent elements is equal 0.
276
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
277
+ For simpler debugging here is the log of the parent element:`,f=(p,E,b,m,g,h)=>{const d=r.default.useRef({width:E,height:b}),y=r.default.useRef({top:0,left:0}),O=r.default.useRef(!1),k=r.default.useRef(g.pages.length);O.current=k.current!==g.pages.length,k.current=g.pages.length,r.default.useEffect(()=>{const C=p.current,w=P=>{y.current={top:C.scrollTop,left:C.scrollLeft}};return C.addEventListener("scroll",w),()=>{C.removeEventListener("scroll",w)}},[]),r.default.useLayoutEffect(()=>{if(!p.current||O.current)return;const C=p.current,w=(y.current.left+C.offsetWidth/2)/d.current.width,P=(y.current.top+C.offsetHeight/2)/d.current.height;h.current=!0,C.scrollLeft=w*E-C.offsetWidth/2,C.scrollTop=P*b-C.offsetHeight/2,d.current={width:E,height:b}},[m,E,b])},v=(p,E,b,m,g)=>{const h=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const O=p.current,k=()=>{g.current};return O.addEventListener("scroll",k),()=>{O.removeEventListener("scroll",k)}},[]);const y=b.pages.indexOf(b.activePage);return r.default.useLayoutEffect(()=>{if(!b.activePage||!p.current||h.current)return;const O=p.current,k=b.pages.indexOf(b.activePage)*E;Math.abs(k-O.scrollTop)>.5*E&&(g.current=!0,O.scrollTop=k)},[b.activePage,y]),{handleScroll:O=>{if(g.current)return void(g.current=!1);h.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{h.current=!1},300);const k=O.currentTarget.childNodes[0].offsetHeight,C=O.currentTarget.scrollTop,w=Math.floor((C+m.height/3)/k),P=b.pages[w];P&&P.select()}}},S=({store:p})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,l.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{p.addPage()}},(0,l.t)("workspace.addPage"))),_=({width:p,height:E,xPadding:b,yPadding:m,backgroundColor:g})=>r.default.createElement("div",{style:{width:p+"px",height:E+"px",backgroundColor:g,paddingLeft:b+"px",paddingRight:b+"px",paddingTop:m+"px",paddingBottom:m+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:E,backgroundColor:b,pageBorderColor:m,activePageBorderColor:g,bleedColor:h,components:d,onKeyDown:y,paddingX:O,paddingY:k,altCloneEnabled:C=!0})=>{const w=O??20,P=k??55,[x,A]=r.default.useState({width:100,height:100}),R=r.default.useRef(x),M=r.default.useRef(null),U=r.default.useRef(null),V=p.bleedVisible?Math.max(0,...p.pages.map(ee=>ee.bleed)):0,q=Math.max(...p.pages.map(ee=>ee.computedWidth)),z=Math.max(...p.pages.map(ee=>ee.computedHeight)),F=q+2*V,G=z+2*V,L=async({skipTimeout:ee}={skipTimeout:!1})=>{if(ee||await new Promise(oe=>setTimeout(oe,50)),M.current===null)return;const re=M.current.getBoundingClientRect();re.width!==0&&re.height!==0||(console.warn(u),console.log(M.current));const ae=U.current.clientWidth||re.width,le={width:ae,height:re.height};(R.current.width!==le.width||R.current.height!==le.height)&&(A(le),R.current=le);const ue=(ae-2*w)/F,Ae=(re.height-2*P)/G,ze=Math.max(Math.min(ue,Ae),.01);p.scaleToFit!==ze&&(p.setScale(ze),p._setScaleToFit(ze))};r.default.useLayoutEffect(()=>{L({skipTimeout:!0})},[]),r.default.useEffect(()=>{L()},[F,G]),r.default.useEffect(()=>{const ee=M.current;if(window.ResizeObserver){const re=new ResizeObserver(()=>{L({skipTimeout:!0})});return re.observe(ee),()=>re.unobserve(ee)}{const re=setInterval(()=>{L({skipTimeout:!0})},100);return()=>clearInterval(re)}},[F,G]);const I=Math.max(w,(x.width-F*p.scale)/2),B=G*p.scale*p.pages.length,D=Math.max(P,(x.height-B)/p.pages.length/2);r.default.useEffect(()=>{const ee=re=>{(y||o.handleHotkey)(re,p)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]),r.default.useEffect(()=>{var ee;const re=ae=>{if(ae.ctrlKey||ae.metaKey){ae.preventDefault();const ze=Math.max(3,p.scaleToFit),oe=Math.min(.1,p.scaleToFit),ie=(le=ae.deltaY<0?1.05*p.scale:p.scale/1.05,ue=oe,Ae=ze,Math.max(ue,Math.min(Ae,le)));p.setScale(ie)}else var le,ue,Ae};return(ee=U.current)===null||ee===void 0||ee.addEventListener("wheel",re),()=>{var ae;return(ae=U.current)===null||ae===void 0?void 0:ae.removeEventListener("wheel",re)}},[]);const $=r.default.useRef(!1);f(U,F*p.scale+2*I,G*p.scale+2*D,p.scale,p,$);const{handleScroll:K}=v(U,G*p.scale+2*D,p,x,$),Y=x.width>=F*p.scale+2*I,H=b||"rgba(232, 232, 232, 0.9)",X=p.pages.indexOf(p.activePage),Z=(d==null?void 0:d.NoPages)||S,J=Math.min(3,Math.max(1,Math.ceil(x.height/2/(G*p.scale))));return r.default.createElement("div",{ref:M,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:H},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:U,onScroll:K,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:Y?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((ee,re)=>Math.abs(re-X)<=J||ee._exporting?r.default.createElement(i.default,{key:ee.id,page:ee,xPadding:I,yPadding:D,width:F*p.scale+2*I,height:G*p.scale+2*D,store:p,pageControlsEnabled:E,backColor:H,pageBorderColor:m||"lightgrey",activePageBorderColor:g||"rgb(0, 161, 255)",altCloneEnabled:C,bleedColor:h||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(_,{key:ee.id,width:F*p.scale+2*I,height:G*p.scale+2*D,backgroundColor:H,xPadding:I,yPadding:D})),p.rulesVisible&&r.default.createElement(a.TopRules,{store:p,xPadding:I,yPadding:D,width:F*p.scale+2*I,height:G*p.scale+2*D}),p.pages.length===0&&r.default.createElement(Z,{store:p})))}),e.default=e.WorkspaceCanvas})(e8);var hF=B2();ql.toggleFadeInAnimation(!1);hi.setTextOverflow("change-font-size");const pF=new URLSearchParams(location.search).get("key"),HS=hF.createStore({key:pF});window.store=HS;window.config={addGlobalFont:Pu.addGlobalFont,unstable_useHtmlTextRender:hi.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:hi.setTextVerticalResizeEnabled,unstable_setTextOverflow:hi.setTextOverflow,onLoadError:ua.onLoadError,setAssetLoadTimeout:ua.setAssetLoadTimeout,setFontLoadTimeout:ua.setFontLoadTimeout};const gF=ah.createRoot(document.getElementById("root"));gF.render(yt.createElement(e8.WorkspaceCanvas,{store:HS,components:{PageControls:()=>null,Tooltip:()=>null}}));