polotno-node 2.11.4 → 2.11.5

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,321 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(o){if(o.ep)return;o.ep=!0;const l=t(o);fetch(o.href,l)}})();var ic=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xl(e){if(e.__esModule)return e;var i=e.default;if(typeof i=="function"){var t=function n(){return this instanceof n?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};t.prototype=i.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t}var Eg={exports:{}},jt={};/**
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 gv;function K4(){if(gv)return jt;gv=1;var e=Symbol.for("react.element"),i=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),E=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=E&&I[E]||I["@@iterator"],typeof I=="function"?I:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,p={};function h(I,U,$){this.props=I,this.context=U,this.refs=p,this.updater=$||m}h.prototype.isReactComponent={},h.prototype.setState=function(I,U){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,U,"setState")},h.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function P(){}P.prototype=h.prototype;function g(I,U,$){this.props=I,this.context=U,this.refs=p,this.updater=$||m}var v=g.prototype=new P;v.constructor=g,_(v,h.prototype),v.isPureReactComponent=!0;var y=Array.isArray,O=Object.prototype.hasOwnProperty,M={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function D(I,U,$){var ee,G={},Z=null,W=null;if(U!=null)for(ee in U.ref!==void 0&&(W=U.ref),U.key!==void 0&&(Z=""+U.key),U)O.call(U,ee)&&!R.hasOwnProperty(ee)&&(G[ee]=U[ee]);var te=arguments.length-2;if(te===1)G.children=$;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];G.children=re}if(I&&I.defaultProps)for(ee in te=I.defaultProps,te)G[ee]===void 0&&(G[ee]=te[ee]);return{$$typeof:e,type:I,key:Z,ref:W,props:G,_owner:M.current}}function T(I,U){return{$$typeof:e,type:I.type,key:U,ref:I.ref,props:I.props,_owner:I._owner}}function S(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function A(I){var U={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function($){return U[$]})}var N=/\/+/g;function k(I,U){return typeof I=="object"&&I!==null&&I.key!=null?A(""+I.key):U.toString(36)}function L(I,U,$,ee,G){var Z=typeof I;(Z==="undefined"||Z==="boolean")&&(I=null);var W=!1;if(I===null)W=!0;else switch(Z){case"string":case"number":W=!0;break;case"object":switch(I.$$typeof){case e:case i:W=!0}}if(W)return W=I,G=G(W),I=ee===""?"."+k(W,0):ee,y(G)?($="",I!=null&&($=I.replace(N,"$&/")+"/"),L(G,U,$,"",function(ie){return ie})):G!=null&&(S(G)&&(G=T(G,$+(!G.key||W&&W.key===G.key?"":(""+G.key).replace(N,"$&/")+"/")+I)),U.push(G)),1;if(W=0,ee=ee===""?".":ee+":",y(I))for(var te=0;te<I.length;te++){Z=I[te];var re=ee+k(Z,te);W+=L(Z,U,$,re,G)}else if(re=x(I),typeof re=="function")for(I=re.call(I),te=0;!(Z=I.next()).done;)Z=Z.value,re=ee+k(Z,te++),W+=L(Z,U,$,re,G);else if(Z==="object")throw U=String(I),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return W}function B(I,U,$){if(I==null)return I;var ee=[],G=0;return L(I,ee,"","",function(Z){return U.call($,Z,G++)}),ee}function X(I){if(I._status===-1){var U=I._result;U=U(),U.then(function($){(I._status===0||I._status===-1)&&(I._status=1,I._result=$)},function($){(I._status===0||I._status===-1)&&(I._status=2,I._result=$)}),I._status===-1&&(I._status=0,I._result=U)}if(I._status===1)return I._result.default;throw I._result}var K={current:null},Q={transition:null},H={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:Q,ReactCurrentOwner:M};function z(){throw Error("act(...) is not supported in production builds of React.")}return jt.Children={map:B,forEach:function(I,U,$){B(I,function(){U.apply(this,arguments)},$)},count:function(I){var U=0;return B(I,function(){U++}),U},toArray:function(I){return B(I,function(U){return U})||[]},only:function(I){if(!S(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},jt.Component=h,jt.Fragment=t,jt.Profiler=o,jt.PureComponent=g,jt.StrictMode=n,jt.Suspense=d,jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,jt.act=z,jt.cloneElement=function(I,U,$){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ee=_({},I.props),G=I.key,Z=I.ref,W=I._owner;if(U!=null){if(U.ref!==void 0&&(Z=U.ref,W=M.current),U.key!==void 0&&(G=""+U.key),I.type&&I.type.defaultProps)var te=I.type.defaultProps;for(re in U)O.call(U,re)&&!R.hasOwnProperty(re)&&(ee[re]=U[re]===void 0&&te!==void 0?te[re]:U[re])}var re=arguments.length-2;if(re===1)ee.children=$;else if(1<re){te=Array(re);for(var ie=0;ie<re;ie++)te[ie]=arguments[ie+2];ee.children=te}return{$$typeof:e,type:I.type,key:G,ref:Z,props:ee,_owner:W}},jt.createContext=function(I){return I={$$typeof:s,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:l,_context:I},I.Consumer=I},jt.createElement=D,jt.createFactory=function(I){var U=D.bind(null,I);return U.type=I,U},jt.createRef=function(){return{current:null}},jt.forwardRef=function(I){return{$$typeof:c,render:I}},jt.isValidElement=S,jt.lazy=function(I){return{$$typeof:w,_payload:{_status:-1,_result:I},_init:X}},jt.memo=function(I,U){return{$$typeof:b,type:I,compare:U===void 0?null:U}},jt.startTransition=function(I){var U=Q.transition;Q.transition={};try{I()}finally{Q.transition=U}},jt.unstable_act=z,jt.useCallback=function(I,U){return K.current.useCallback(I,U)},jt.useContext=function(I){return K.current.useContext(I)},jt.useDebugValue=function(){},jt.useDeferredValue=function(I){return K.current.useDeferredValue(I)},jt.useEffect=function(I,U){return K.current.useEffect(I,U)},jt.useId=function(){return K.current.useId()},jt.useImperativeHandle=function(I,U,$){return K.current.useImperativeHandle(I,U,$)},jt.useInsertionEffect=function(I,U){return K.current.useInsertionEffect(I,U)},jt.useLayoutEffect=function(I,U){return K.current.useLayoutEffect(I,U)},jt.useMemo=function(I,U){return K.current.useMemo(I,U)},jt.useReducer=function(I,U,$){return K.current.useReducer(I,U,$)},jt.useRef=function(I){return K.current.useRef(I)},jt.useState=function(I){return K.current.useState(I)},jt.useSyncExternalStore=function(I,U,$){return K.current.useSyncExternalStore(I,U,$)},jt.useTransition=function(){return K.current.useTransition()},jt.version="18.3.1",jt}var mv;function Tn(){return mv||(mv=1,Eg.exports=K4()),Eg.exports}var xn=Tn();const qt=Rd(xn);var $h={},Og={exports:{}},pi={},xg={exports:{}},Pg={};/**
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
+ */var vv;function X4(){return vv||(vv=1,function(e){function i(Q,H){var z=Q.length;Q.push(H);e:for(;0<z;){var I=z-1>>>1,U=Q[I];if(0<o(U,H))Q[I]=H,Q[z]=U,z=I;else break e}}function t(Q){return Q.length===0?null:Q[0]}function n(Q){if(Q.length===0)return null;var H=Q[0],z=Q.pop();if(z!==H){Q[0]=z;e:for(var I=0,U=Q.length,$=U>>>1;I<$;){var ee=2*(I+1)-1,G=Q[ee],Z=ee+1,W=Q[Z];if(0>o(G,z))Z<U&&0>o(W,G)?(Q[I]=W,Q[Z]=z,I=Z):(Q[I]=G,Q[ee]=z,I=ee);else if(Z<U&&0>o(W,z))Q[I]=W,Q[Z]=z,I=Z;else break e}}return H}function o(Q,H){var z=Q.sortIndex-H.sortIndex;return z!==0?z:Q.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var d=[],b=[],w=1,E=null,x=3,m=!1,_=!1,p=!1,h=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(Q){for(var H=t(b);H!==null;){if(H.callback===null)n(b);else if(H.startTime<=Q)n(b),H.sortIndex=H.expirationTime,i(d,H);else break;H=t(b)}}function y(Q){if(p=!1,v(Q),!_)if(t(d)!==null)_=!0,X(O);else{var H=t(b);H!==null&&K(y,H.startTime-Q)}}function O(Q,H){_=!1,p&&(p=!1,P(D),D=-1),m=!0;var z=x;try{for(v(H),E=t(d);E!==null&&(!(E.expirationTime>H)||Q&&!A());){var I=E.callback;if(typeof I=="function"){E.callback=null,x=E.priorityLevel;var U=I(E.expirationTime<=H);H=e.unstable_now(),typeof U=="function"?E.callback=U:E===t(d)&&n(d),v(H)}else n(d);E=t(d)}if(E!==null)var $=!0;else{var ee=t(b);ee!==null&&K(y,ee.startTime-H),$=!1}return $}finally{E=null,x=z,m=!1}}var M=!1,R=null,D=-1,T=5,S=-1;function A(){return!(e.unstable_now()-S<T)}function N(){if(R!==null){var Q=e.unstable_now();S=Q;var H=!0;try{H=R(!0,Q)}finally{H?k():(M=!1,R=null)}}else M=!1}var k;if(typeof g=="function")k=function(){g(N)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,B=L.port2;L.port1.onmessage=N,k=function(){B.postMessage(null)}}else k=function(){h(N,0)};function X(Q){R=Q,M||(M=!0,k())}function K(Q,H){D=h(function(){Q(e.unstable_now())},H)}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(Q){Q.callback=null},e.unstable_continueExecution=function(){_||m||(_=!0,X(O))},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return t(d)},e.unstable_next=function(Q){switch(x){case 1:case 2:case 3:var H=3;break;default:H=x}var z=x;x=H;try{return Q()}finally{x=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,H){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var z=x;x=Q;try{return H()}finally{x=z}},e.unstable_scheduleCallback=function(Q,H,z){var I=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?I+z:I):z=I,Q){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=z+U,Q={id:w++,callback:H,priorityLevel:Q,startTime:z,expirationTime:U,sortIndex:-1},z>I?(Q.sortIndex=z,i(b,Q),t(d)===null&&Q===t(b)&&(p?(P(D),D=-1):p=!0,K(y,z-I))):(Q.sortIndex=U,i(d,Q),_||m||(_=!0,X(O))),Q},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(Q){var H=x;return function(){var z=x;x=H;try{return Q.apply(this,arguments)}finally{x=z}}}}(Pg)),Pg}var yv;function $0(){return yv||(yv=1,xg.exports=X4()),xg.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 bv;function Z4(){if(bv)return pi;bv=1;var e=Tn(),i=$0();function t(r){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+r,C=1;C<arguments.length;C++)a+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,o={};function l(r,a){s(r,a),s(r+"Capture",a)}function s(r,a){for(o[r]=a,r=0;r<a.length;r++)n.add(a[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,b=/^[: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]*$/,w={},E={};function x(r){return d.call(E,r)?!0:d.call(w,r)?!1:b.test(r)?E[r]=!0:(w[r]=!0,!1)}function m(r,a,C,F){if(C!==null&&C.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return F?!1:C!==null?!C.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function _(r,a,C,F){if(a===null||typeof a>"u"||m(r,a,C,F))return!0;if(F)return!1;if(C!==null)switch(C.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function p(r,a,C,F,V,J,ae){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=F,this.attributeNamespace=V,this.mustUseProperty=C,this.propertyName=r,this.type=a,this.sanitizeURL=J,this.removeEmptyString=ae}var h={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){h[r]=new p(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var a=r[0];h[a]=new p(a,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){h[r]=new p(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){h[r]=new p(r,2,!1,r,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(r){h[r]=new p(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){h[r]=new p(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){h[r]=new p(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){h[r]=new p(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){h[r]=new p(r,5,!1,r.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function g(r){return r[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(r){var a=r.replace(P,g);h[a]=new p(a,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var a=r.replace(P,g);h[a]=new p(a,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var a=r.replace(P,g);h[a]=new p(a,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){h[r]=new p(r,1,!1,r.toLowerCase(),null,!1,!1)}),h.xlinkHref=new p("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){h[r]=new p(r,1,!1,r.toLowerCase(),null,!0,!0)});function v(r,a,C,F){var V=h.hasOwnProperty(a)?h[a]:null;(V!==null?V.type!==0:F||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(_(a,C,V,F)&&(C=null),F||V===null?x(a)&&(C===null?r.removeAttribute(a):r.setAttribute(a,""+C)):V.mustUseProperty?r[V.propertyName]=C===null?V.type===3?!1:"":C:(a=V.attributeName,F=V.attributeNamespace,C===null?r.removeAttribute(a):(V=V.type,C=V===3||V===4&&C===!0?"":""+C,F?r.setAttributeNS(F,a,C):r.setAttribute(a,C))))}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),M=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),A=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),Q=Symbol.iterator;function H(r){return r===null||typeof r!="object"?null:(r=Q&&r[Q]||r["@@iterator"],typeof r=="function"?r:null)}var z=Object.assign,I;function U(r){if(I===void 0)try{throw Error()}catch(C){var a=C.stack.trim().match(/\n( *(at )?)/);I=a&&a[1]||""}return`
26
+ `+I+r}var $=!1;function ee(r,a){if(!r||$)return"";$=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(Ae){var F=Ae}Reflect.construct(r,[],a)}else{try{a.call()}catch(Ae){F=Ae}r.call(a.prototype)}else{try{throw Error()}catch(Ae){F=Ae}r()}}catch(Ae){if(Ae&&F&&typeof Ae.stack=="string"){for(var V=Ae.stack.split(`
27
+ `),J=F.stack.split(`
28
+ `),ae=V.length-1,fe=J.length-1;1<=ae&&0<=fe&&V[ae]!==J[fe];)fe--;for(;1<=ae&&0<=fe;ae--,fe--)if(V[ae]!==J[fe]){if(ae!==1||fe!==1)do if(ae--,fe--,0>fe||V[ae]!==J[fe]){var ge=`
29
+ `+V[ae].replace(" at new "," at ");return r.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",r.displayName)),ge}while(1<=ae&&0<=fe);break}}}finally{$=!1,Error.prepareStackTrace=C}return(r=r?r.displayName||r.name:"")?U(r):""}function G(r){switch(r.tag){case 5:return U(r.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return r=ee(r.type,!1),r;case 11:return r=ee(r.type.render,!1),r;case 1:return r=ee(r.type,!0),r;default:return""}}function Z(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case R:return"Fragment";case M:return"Portal";case T:return"Profiler";case D:return"StrictMode";case k:return"Suspense";case L:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case A:return(r.displayName||"Context")+".Consumer";case S:return(r._context.displayName||"Context")+".Provider";case N:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case B:return a=r.displayName||null,a!==null?a:Z(r.type)||"Memo";case X:a=r._payload,r=r._init;try{return Z(r(a))}catch{}}return null}function W(r){var a=r.type;switch(r.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=a.render,r=r.displayName||r.name||"",a.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(a);case 8:return a===D?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function te(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function re(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ie(r){var a=re(r)?"checked":"value",C=Object.getOwnPropertyDescriptor(r.constructor.prototype,a),F=""+r[a];if(!r.hasOwnProperty(a)&&typeof C<"u"&&typeof C.get=="function"&&typeof C.set=="function"){var V=C.get,J=C.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return V.call(this)},set:function(ae){F=""+ae,J.call(this,ae)}}),Object.defineProperty(r,a,{enumerable:C.enumerable}),{getValue:function(){return F},setValue:function(ae){F=""+ae},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function oe(r){r._valueTracker||(r._valueTracker=ie(r))}function se(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var C=a.getValue(),F="";return r&&(F=re(r)?r.checked?"true":"false":r.value),r=F,r!==C?(a.setValue(r),!0):!1}function de(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function pe(r,a){var C=a.checked;return z({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:C??r._wrapperState.initialChecked})}function Oe(r,a){var C=a.defaultValue==null?"":a.defaultValue,F=a.checked!=null?a.checked:a.defaultChecked;C=te(a.value!=null?a.value:C),r._wrapperState={initialChecked:F,initialValue:C,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function _e(r,a){a=a.checked,a!=null&&v(r,"checked",a,!1)}function Te(r,a){_e(r,a);var C=te(a.value),F=a.type;if(C!=null)F==="number"?(C===0&&r.value===""||r.value!=C)&&(r.value=""+C):r.value!==""+C&&(r.value=""+C);else if(F==="submit"||F==="reset"){r.removeAttribute("value");return}a.hasOwnProperty("value")?he(r,a.type,C):a.hasOwnProperty("defaultValue")&&he(r,a.type,te(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(r.defaultChecked=!!a.defaultChecked)}function ce(r,a,C){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var F=a.type;if(!(F!=="submit"&&F!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+r._wrapperState.initialValue,C||a===r.value||(r.value=a),r.defaultValue=a}C=r.name,C!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,C!==""&&(r.name=C)}function he(r,a,C){(a!=="number"||de(r.ownerDocument)!==r)&&(C==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+C&&(r.defaultValue=""+C))}var Ce=Array.isArray;function Le(r,a,C,F){if(r=r.options,a){a={};for(var V=0;V<C.length;V++)a["$"+C[V]]=!0;for(C=0;C<r.length;C++)V=a.hasOwnProperty("$"+r[C].value),r[C].selected!==V&&(r[C].selected=V),V&&F&&(r[C].defaultSelected=!0)}else{for(C=""+te(C),a=null,V=0;V<r.length;V++){if(r[V].value===C){r[V].selected=!0,F&&(r[V].defaultSelected=!0);return}a!==null||r[V].disabled||(a=r[V])}a!==null&&(a.selected=!0)}}function ue(r,a){if(a.dangerouslySetInnerHTML!=null)throw Error(t(91));return z({},a,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function me(r,a){var C=a.value;if(C==null){if(C=a.children,a=a.defaultValue,C!=null){if(a!=null)throw Error(t(92));if(Ce(C)){if(1<C.length)throw Error(t(93));C=C[0]}a=C}a==null&&(a=""),C=a}r._wrapperState={initialValue:te(C)}}function xe(r,a){var C=te(a.value),F=te(a.defaultValue);C!=null&&(C=""+C,C!==r.value&&(r.value=C),a.defaultValue==null&&r.defaultValue!==C&&(r.defaultValue=C)),F!=null&&(r.defaultValue=""+F)}function je(r){var a=r.textContent;a===r._wrapperState.initialValue&&a!==""&&a!==null&&(r.value=a)}function ot(r){switch(r){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 ht(r,a){return r==null||r==="http://www.w3.org/1999/xhtml"?ot(a):r==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var et,Ke=function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,C,F,V){MSApp.execUnsafeLocalFunction(function(){return r(a,C,F,V)})}:r}(function(r,a){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=a;else{for(et=et||document.createElement("div"),et.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=et.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;a.firstChild;)r.appendChild(a.firstChild)}});function ze(r,a){if(a){var C=r.firstChild;if(C&&C===r.lastChild&&C.nodeType===3){C.nodeValue=a;return}}r.textContent=a}var Be={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(Be).forEach(function(r){Ve.forEach(function(a){a=a+r.charAt(0).toUpperCase()+r.substring(1),Be[a]=Be[r]})});function bt(r,a,C){return a==null||typeof a=="boolean"||a===""?"":C||typeof a!="number"||a===0||Be.hasOwnProperty(r)&&Be[r]?(""+a).trim():a+"px"}function Ct(r,a){r=r.style;for(var C in a)if(a.hasOwnProperty(C)){var F=C.indexOf("--")===0,V=bt(C,a[C],F);C==="float"&&(C="cssFloat"),F?r.setProperty(C,V):r[C]=V}}var we=z({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 Se(r,a){if(a){if(we[r]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(t(137,r));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(t(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(t(61))}if(a.style!=null&&typeof a.style!="object")throw Error(t(62))}}function gt(r,a){if(r.indexOf("-")===-1)return typeof a.is=="string";switch(r){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 wt=null;function Pt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var mt=null,Wt=null,pn=null;function Fe(r){if(r=_s(r)){if(typeof mt!="function")throw Error(t(280));var a=r.stateNode;a&&(a=Yn(a),mt(r.stateNode,r.type,a))}}function rt(r){Wt?pn?pn.push(r):pn=[r]:Wt=r}function ft(){if(Wt){var r=Wt,a=pn;if(pn=Wt=null,Fe(r),a)for(r=0;r<a.length;r++)Fe(a[r])}}function De(r,a){return r(a)}function Ie(){}var Me=!1;function Ye(r,a,C){if(Me)return r(a,C);Me=!0;try{return De(r,a,C)}finally{Me=!1,(Wt!==null||pn!==null)&&(Ie(),ft())}}function Mt(r,a){var C=r.stateNode;if(C===null)return null;var F=Yn(C);if(F===null)return null;C=F[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(F=!F.disabled)||(r=r.type,F=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!F;break e;default:r=!1}if(r)return null;if(C&&typeof C!="function")throw Error(t(231,a,typeof C));return C}var _t=!1;if(c)try{var Yt={};Object.defineProperty(Yt,"passive",{get:function(){_t=!0}}),window.addEventListener("test",Yt,Yt),window.removeEventListener("test",Yt,Yt)}catch{_t=!1}function wn(r,a,C,F,V,J,ae,fe,ge){var Ae=Array.prototype.slice.call(arguments,3);try{a.apply(C,Ae)}catch(qe){this.onError(qe)}}var Sn=!1,Qn=null,ii=!1,Sr=null,Ze={onError:function(r){Sn=!0,Qn=r}};function Et(r,a,C,F,V,J,ae,fe,ge){Sn=!1,Qn=null,wn.apply(Ze,arguments)}function Lt(r,a,C,F,V,J,ae,fe,ge){if(Et.apply(this,arguments),Sn){if(Sn){var Ae=Qn;Sn=!1,Qn=null}else throw Error(t(198));ii||(ii=!0,Sr=Ae)}}function Gt(r){var a=r,C=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,a.flags&4098&&(C=a.return),r=a.return;while(r)}return a.tag===3?C:null}function Vt(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function Jn(r){if(Gt(r)!==r)throw Error(t(188))}function Gn(r){var a=r.alternate;if(!a){if(a=Gt(r),a===null)throw Error(t(188));return a!==r?null:r}for(var C=r,F=a;;){var V=C.return;if(V===null)break;var J=V.alternate;if(J===null){if(F=V.return,F!==null){C=F;continue}break}if(V.child===J.child){for(J=V.child;J;){if(J===C)return Jn(V),r;if(J===F)return Jn(V),a;J=J.sibling}throw Error(t(188))}if(C.return!==F.return)C=V,F=J;else{for(var ae=!1,fe=V.child;fe;){if(fe===C){ae=!0,C=V,F=J;break}if(fe===F){ae=!0,F=V,C=J;break}fe=fe.sibling}if(!ae){for(fe=J.child;fe;){if(fe===C){ae=!0,C=J,F=V;break}if(fe===F){ae=!0,F=J,C=V;break}fe=fe.sibling}if(!ae)throw Error(t(189))}}if(C.alternate!==F)throw Error(t(190))}if(C.tag!==3)throw Error(t(188));return C.stateNode.current===C?r:a}function En(r){return r=Gn(r),r!==null?ai(r):null}function ai(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var a=ai(r);if(a!==null)return a;r=r.sibling}return null}var Ir=i.unstable_scheduleCallback,Ii=i.unstable_cancelCallback,Na=i.unstable_shouldYield,rs=i.unstable_requestPaint,en=i.unstable_now,ta=i.unstable_getCurrentPriorityLevel,Dr=i.unstable_ImmediatePriority,ho=i.unstable_UserBlockingPriority,na=i.unstable_NormalPriority,Vp=i.unstable_LowPriority,Qs=i.unstable_IdlePriority,ra=null,er=null;function cn(r){if(er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(ra,r,void 0,(r.current.flags&128)===128)}catch{}}var It=Math.clz32?Math.clz32:jr,Ia=Math.log,fr=Math.LN2;function jr(r){return r>>>=0,r===0?32:31-(Ia(r)/fr|0)|0}var Di=64,ia=4194304;function Vn(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function po(r,a){var C=r.pendingLanes;if(C===0)return 0;var F=0,V=r.suspendedLanes,J=r.pingedLanes,ae=C&268435455;if(ae!==0){var fe=ae&~V;fe!==0?F=Vn(fe):(J&=ae,J!==0&&(F=Vn(J)))}else ae=C&~V,ae!==0?F=Vn(ae):J!==0&&(F=Vn(J));if(F===0)return 0;if(a!==0&&a!==F&&!(a&V)&&(V=F&-F,J=a&-a,V>=J||V===16&&(J&4194240)!==0))return a;if(F&4&&(F|=C&16),a=r.entangledLanes,a!==0)for(r=r.entanglements,a&=F;0<a;)C=31-It(a),V=1<<C,F|=r[C],a&=~V;return F}function Gd(r,a){switch(r){case 1:case 2:case 4:return a+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 a+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 Vd(r,a){for(var C=r.suspendedLanes,F=r.pingedLanes,V=r.expirationTimes,J=r.pendingLanes;0<J;){var ae=31-It(J),fe=1<<ae,ge=V[ae];ge===-1?(!(fe&C)||fe&F)&&(V[ae]=Gd(fe,a)):ge<=a&&(r.expiredLanes|=fe),J&=~fe}}function tl(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Oc(){var r=Di;return Di<<=1,!(Di&4194240)&&(Di=64),r}function Gr(r){for(var a=[],C=0;31>C;C++)a.push(r);return a}function is(r,a,C){r.pendingLanes|=a,a!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,a=31-It(a),r[a]=C}function $p(r,a){var C=r.pendingLanes&~a;r.pendingLanes=a,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=a,r.mutableReadLanes&=a,r.entangledLanes&=a,a=r.entanglements;var F=r.eventTimes;for(r=r.expirationTimes;0<C;){var V=31-It(C),J=1<<V;a[V]=0,F[V]=-1,r[V]=-1,C&=~J}}function xc(r,a){var C=r.entangledLanes|=a;for(r=r.entanglements;C;){var F=31-It(C),V=1<<F;V&a|r[F]&a&&(r[F]|=a),C&=~V}}var Ht=0;function as(r){return r&=-r,1<r?4<r?r&268435455?16:536870912:4:1}var nl,rl,$d,Wd,Js,eu=!1,il=[],oi=null,Da=null,ji=null,Dt=new Map,al=new Map,Fi=[],Yd="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 Kd(r,a){switch(r){case"focusin":case"focusout":oi=null;break;case"dragenter":case"dragleave":Da=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":Dt.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(a.pointerId)}}function os(r,a,C,F,V,J){return r===null||r.nativeEvent!==J?(r={blockedOn:a,domEventName:C,eventSystemFlags:F,nativeEvent:J,targetContainers:[V]},a!==null&&(a=_s(a),a!==null&&rl(a)),r):(r.eventSystemFlags|=F,a=r.targetContainers,V!==null&&a.indexOf(V)===-1&&a.push(V),r)}function $n(r,a,C,F,V){switch(a){case"focusin":return oi=os(oi,r,a,C,F,V),!0;case"dragenter":return Da=os(Da,r,a,C,F,V),!0;case"mouseover":return ji=os(ji,r,a,C,F,V),!0;case"pointerover":var J=V.pointerId;return Dt.set(J,os(Dt.get(J)||null,r,a,C,F,V)),!0;case"gotpointercapture":return J=V.pointerId,al.set(J,os(al.get(J)||null,r,a,C,F,V)),!0}return!1}function tu(r){var a=$a(r.target);if(a!==null){var C=Gt(a);if(C!==null){if(a=C.tag,a===13){if(a=Vt(C),a!==null){r.blockedOn=a,Js(r.priority,function(){$d(C)});return}}else if(a===3&&C.stateNode.current.memoizedState.isDehydrated){r.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}r.blockedOn=null}function nu(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var C=au(r.domEventName,r.eventSystemFlags,a[0],r.nativeEvent);if(C===null){C=r.nativeEvent;var F=new C.constructor(C.type,C);wt=F,C.target.dispatchEvent(F),wt=null}else return a=_s(C),a!==null&&rl(a),r.blockedOn=C,!1;a.shift()}return!0}function ru(r,a,C){nu(r)&&C.delete(a)}function Wp(){eu=!1,oi!==null&&nu(oi)&&(oi=null),Da!==null&&nu(Da)&&(Da=null),ji!==null&&nu(ji)&&(ji=null),Dt.forEach(ru),al.forEach(ru)}function ja(r,a){r.blockedOn===a&&(r.blockedOn=null,eu||(eu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Wp)))}function Fr(r){function a(V){return ja(V,r)}if(0<il.length){ja(il[0],r);for(var C=1;C<il.length;C++){var F=il[C];F.blockedOn===r&&(F.blockedOn=null)}}for(oi!==null&&ja(oi,r),Da!==null&&ja(Da,r),ji!==null&&ja(ji,r),Dt.forEach(a),al.forEach(a),C=0;C<Fi.length;C++)F=Fi[C],F.blockedOn===r&&(F.blockedOn=null);for(;0<Fi.length&&(C=Fi[0],C.blockedOn===null);)tu(C),C.blockedOn===null&&Fi.shift()}var ol=y.ReactCurrentBatchConfig,iu=!0;function wi(r,a,C,F){var V=Ht,J=ol.transition;ol.transition=null;try{Ht=1,ll(r,a,C,F)}finally{Ht=V,ol.transition=J}}function aa(r,a,C,F){var V=Ht,J=ol.transition;ol.transition=null;try{Ht=4,ll(r,a,C,F)}finally{Ht=V,ol.transition=J}}function ll(r,a,C,F){if(iu){var V=au(r,a,C,F);if(V===null)wu(r,a,F,sl,C),Kd(r,F);else if($n(V,r,a,C,F))F.stopPropagation();else if(Kd(r,F),a&4&&-1<Yd.indexOf(r)){for(;V!==null;){var J=_s(V);if(J!==null&&nl(J),J=au(r,a,C,F),J===null&&wu(r,a,F,sl,C),J===V)break;V=J}V!==null&&F.stopPropagation()}else wu(r,a,F,null,C)}}var sl=null;function au(r,a,C,F){if(sl=null,r=Pt(F),r=$a(r),r!==null)if(a=Gt(r),a===null)r=null;else if(C=a.tag,C===13){if(r=Vt(a),r!==null)return r;r=null}else if(C===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null);return sl=r,null}function Xd(r){switch(r){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(ta()){case Dr:return 1;case ho:return 4;case na:case Vp:return 16;case Qs:return 536870912;default:return 16}default:return 16}}var tr=null,Fa=null,oa=null;function ls(){if(oa)return oa;var r,a=Fa,C=a.length,F,V="value"in tr?tr.value:tr.textContent,J=V.length;for(r=0;r<C&&a[r]===V[r];r++);var ae=C-r;for(F=1;F<=ae&&a[C-F]===V[J-F];F++);return oa=V.slice(r,1<F?1-F:void 0)}function go(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function Er(){return!0}function Vr(){return!1}function Dn(r){function a(C,F,V,J,ae){this._reactName=C,this._targetInst=V,this.type=F,this.nativeEvent=J,this.target=ae,this.currentTarget=null;for(var fe in r)r.hasOwnProperty(fe)&&(C=r[fe],this[fe]=C?C(J):J[fe]);return this.isDefaultPrevented=(J.defaultPrevented!=null?J.defaultPrevented:J.returnValue===!1)?Er:Vr,this.isPropagationStopped=Vr,this}return z(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=Er)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=Er)},persist:function(){},isPersistent:Er}),a}var zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Si=Dn(zr),Ei=z({},zr,{view:0,detail:0}),Zd=Dn(Ei),ss,us,nr,Or=z({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vo,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==nr&&(nr&&r.type==="mousemove"?(ss=r.screenX-nr.screenX,us=r.screenY-nr.screenY):us=ss=0,nr=r),ss)},movementY:function(r){return"movementY"in r?r.movementY:us}}),fn=Dn(Or),cs=z({},Or,{dataTransfer:0}),Oi=Dn(cs),Qd=z({},Ei,{relatedTarget:0}),ou=Dn(Qd),Pc=z({},zr,{animationName:0,elapsedTime:0,pseudoElement:0}),Cc=Dn(Pc),Jd=z({},zr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),lu=Dn(Jd),eh=z({},zr,{data:0}),mo=Dn(eh),kc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yp={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"},su={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kp(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=su[r])?!!a[r]:!1}function vo(){return Kp}var uu=z({},Ei,{key:function(r){if(r.key){var a=kc[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=go(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Yp[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vo,charCode:function(r){return r.type==="keypress"?go(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?go(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),th=Dn(uu),nh=z({},Or,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yo=Dn(nh),rh=z({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vo}),cu=Dn(rh),fu=z({},zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ul=Dn(fu),Ac=z({},Or,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Tc=Dn(Ac),ih=[9,13,27,32],fs=c&&"CompositionEvent"in window,bo=null;c&&"documentMode"in document&&(bo=document.documentMode);var cl=c&&"TextEvent"in window&&!bo,$r=c&&(!fs||bo&&8<bo&&11>=bo),za=" ",du=!1;function Rc(r,a){switch(r){case"keyup":return ih.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xi(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Wr=!1;function Mc(r,a){switch(r){case"compositionend":return xi(a);case"keypress":return a.which!==32?null:(du=!0,za);case"textInput":return r=a.data,r===za&&du?null:r;default:return null}}function ah(r,a){if(Wr)return r==="compositionend"||!fs&&Rc(r,a)?(r=ls(),oa=Fa=tr=null,Wr=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return $r&&a.locale!=="ko"?null:a.data;default:return null}}var la={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 sa(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!la[r.type]:a==="textarea"}function ds(r,a,C,F){rt(F),a=Su(a,"onChange"),0<a.length&&(C=new Si("onChange","change",null,C,F),r.push({event:C,listeners:a}))}var fl=null,Ba=null;function oh(r){Hc(r,0)}function Ua(r){var a=Fn(r);if(se(a))return r}function li(r,a){if(r==="change")return a}var dl=!1;if(c){var qa;if(c){var si="oninput"in document;if(!si){var hu=document.createElement("div");hu.setAttribute("oninput","return;"),si=typeof hu.oninput=="function"}qa=si}else qa=!1;dl=qa&&(!document.documentMode||9<document.documentMode)}function _o(){fl&&(fl.detachEvent("onpropertychange",Lc),Ba=fl=null)}function Lc(r){if(r.propertyName==="value"&&Ua(Ba)){var a=[];ds(a,Ba,r,Pt(r)),Ye(oh,a)}}function Nc(r,a,C){r==="focusin"?(_o(),fl=a,Ba=C,fl.attachEvent("onpropertychange",Lc)):r==="focusout"&&_o()}function On(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ua(Ba)}function pu(r,a){if(r==="click")return Ua(a)}function Ic(r,a){if(r==="input"||r==="change")return Ua(a)}function Dc(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var Br=typeof Object.is=="function"?Object.is:Dc;function wo(r,a){if(Br(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var C=Object.keys(r),F=Object.keys(a);if(C.length!==F.length)return!1;for(F=0;F<C.length;F++){var V=C[F];if(!d.call(a,V)||!Br(r[V],a[V]))return!1}return!0}function Ha(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function gn(r,a){var C=Ha(r);r=0;for(var F;C;){if(C.nodeType===3){if(F=r+C.textContent.length,r<=a&&F>=a)return{node:C,offset:a-r};r=F}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=Ha(C)}}function Rn(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?Rn(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function jn(){for(var r=window,a=de();a instanceof r.HTMLIFrameElement;){try{var C=typeof a.contentWindow.location.href=="string"}catch{C=!1}if(C)r=a.contentWindow;else break;a=de(r.document)}return a}function hl(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}function hs(r){var a=jn(),C=r.focusedElem,F=r.selectionRange;if(a!==C&&C&&C.ownerDocument&&Rn(C.ownerDocument.documentElement,C)){if(F!==null&&hl(C)){if(a=F.start,r=F.end,r===void 0&&(r=a),"selectionStart"in C)C.selectionStart=a,C.selectionEnd=Math.min(r,C.value.length);else if(r=(a=C.ownerDocument||document)&&a.defaultView||window,r.getSelection){r=r.getSelection();var V=C.textContent.length,J=Math.min(F.start,V);F=F.end===void 0?J:Math.min(F.end,V),!r.extend&&J>F&&(V=F,F=J,J=V),V=gn(C,J);var ae=gn(C,F);V&&ae&&(r.rangeCount!==1||r.anchorNode!==V.node||r.anchorOffset!==V.offset||r.focusNode!==ae.node||r.focusOffset!==ae.offset)&&(a=a.createRange(),a.setStart(V.node,V.offset),r.removeAllRanges(),J>F?(r.addRange(a),r.extend(ae.node,ae.offset)):(a.setEnd(ae.node,ae.offset),r.addRange(a)))}}for(a=[],r=C;r=r.parentNode;)r.nodeType===1&&a.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<a.length;C++)r=a[C],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var ps=c&&"documentMode"in document&&11>=document.documentMode,pl=null,Wn=null,So=null,gs=!1;function gu(r,a,C){var F=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;gs||pl==null||pl!==de(F)||(F=pl,"selectionStart"in F&&hl(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),So&&wo(So,F)||(So=F,F=Su(Wn,"onSelect"),0<F.length&&(a=new Si("onSelect","select",null,a,C),r.push({event:a,listeners:F}),a.target=pl)))}function Yr(r,a){var C={};return C[r.toLowerCase()]=a.toLowerCase(),C["Webkit"+r]="webkit"+a,C["Moz"+r]="moz"+a,C}var rr={animationend:Yr("Animation","AnimationEnd"),animationiteration:Yr("Animation","AnimationIteration"),animationstart:Yr("Animation","AnimationStart"),transitionend:Yr("Transition","TransitionEnd")},Eo={},mu={};c&&(mu=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function gl(r){if(Eo[r])return Eo[r];if(!rr[r])return r;var a=rr[r],C;for(C in a)if(a.hasOwnProperty(C)&&C in mu)return Eo[r]=a[C];return r}var jc=gl("animationend"),Fc=gl("animationiteration"),zc=gl("animationstart"),Bc=gl("transitionend"),Uc=new Map,qc="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 ua(r,a){Uc.set(r,a),l(a,[r])}for(var vu=0;vu<qc.length;vu++){var Oo=qc[vu],lh=Oo.toLowerCase(),yu=Oo[0].toUpperCase()+Oo.slice(1);ua(lh,"on"+yu)}ua(jc,"onAnimationEnd"),ua(Fc,"onAnimationIteration"),ua(zc,"onAnimationStart"),ua("dblclick","onDoubleClick"),ua("focusin","onFocus"),ua("focusout","onBlur"),ua(Bc,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ga="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(" "),sh=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ga));function bu(r,a,C){var F=r.type||"unknown-event";r.currentTarget=C,Lt(F,a,void 0,r),r.currentTarget=null}function Hc(r,a){a=(a&4)!==0;for(var C=0;C<r.length;C++){var F=r[C],V=F.event;F=F.listeners;e:{var J=void 0;if(a)for(var ae=F.length-1;0<=ae;ae--){var fe=F[ae],ge=fe.instance,Ae=fe.currentTarget;if(fe=fe.listener,ge!==J&&V.isPropagationStopped())break e;bu(V,fe,Ae),J=ge}else for(ae=0;ae<F.length;ae++){if(fe=F[ae],ge=fe.instance,Ae=fe.currentTarget,fe=fe.listener,ge!==J&&V.isPropagationStopped())break e;bu(V,fe,Ae),J=ge}}}if(ii)throw r=Sr,ii=!1,Sr=null,r}function an(r,a){var C=a[Ou];C===void 0&&(C=a[Ou]=new Set);var F=r+"__bubble";C.has(F)||(Gc(a,r,2,!1),C.add(F))}function _u(r,a,C){var F=0;a&&(F|=4),Gc(C,r,F,a)}var ms="_reactListening"+Math.random().toString(36).slice(2);function xo(r){if(!r[ms]){r[ms]=!0,n.forEach(function(C){C!=="selectionchange"&&(sh.has(C)||_u(C,!1,r),_u(C,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[ms]||(a[ms]=!0,_u("selectionchange",!1,a))}}function Gc(r,a,C,F){switch(Xd(a)){case 1:var V=wi;break;case 4:V=aa;break;default:V=ll}C=V.bind(null,a,C,r),V=void 0,!_t||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(V=!0),F?V!==void 0?r.addEventListener(a,C,{capture:!0,passive:V}):r.addEventListener(a,C,!0):V!==void 0?r.addEventListener(a,C,{passive:V}):r.addEventListener(a,C,!1)}function wu(r,a,C,F,V){var J=F;if(!(a&1)&&!(a&2)&&F!==null)e:for(;;){if(F===null)return;var ae=F.tag;if(ae===3||ae===4){var fe=F.stateNode.containerInfo;if(fe===V||fe.nodeType===8&&fe.parentNode===V)break;if(ae===4)for(ae=F.return;ae!==null;){var ge=ae.tag;if((ge===3||ge===4)&&(ge=ae.stateNode.containerInfo,ge===V||ge.nodeType===8&&ge.parentNode===V))return;ae=ae.return}for(;fe!==null;){if(ae=$a(fe),ae===null)return;if(ge=ae.tag,ge===5||ge===6){F=J=ae;continue e}fe=fe.parentNode}}F=F.return}Ye(function(){var Ae=J,qe=Pt(C),He=[];e:{var Ue=Uc.get(r);if(Ue!==void 0){var tt=Si,lt=r;switch(r){case"keypress":if(go(C)===0)break e;case"keydown":case"keyup":tt=th;break;case"focusin":lt="focus",tt=ou;break;case"focusout":lt="blur",tt=ou;break;case"beforeblur":case"afterblur":tt=ou;break;case"click":if(C.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":tt=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":tt=Oi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":tt=cu;break;case jc:case Fc:case zc:tt=Cc;break;case Bc:tt=ul;break;case"scroll":tt=Zd;break;case"wheel":tt=Tc;break;case"copy":case"cut":case"paste":tt=lu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":tt=yo}var ut=(a&4)!==0,qn=!ut&&r==="scroll",Ee=ut?Ue!==null?Ue+"Capture":null:Ue;ut=[];for(var ve=Ae,Pe;ve!==null;){Pe=ve;var $e=Pe.stateNode;if(Pe.tag===5&&$e!==null&&(Pe=$e,Ee!==null&&($e=Mt(ve,Ee),$e!=null&&ut.push(ml(ve,$e,Pe)))),qn)break;ve=ve.return}0<ut.length&&(Ue=new tt(Ue,lt,null,C,qe),He.push({event:Ue,listeners:ut}))}}if(!(a&7)){e:{if(Ue=r==="mouseover"||r==="pointerover",tt=r==="mouseout"||r==="pointerout",Ue&&C!==wt&&(lt=C.relatedTarget||C.fromElement)&&($a(lt)||lt[Bi]))break e;if((tt||Ue)&&(Ue=qe.window===qe?qe:(Ue=qe.ownerDocument)?Ue.defaultView||Ue.parentWindow:window,tt?(lt=C.relatedTarget||C.toElement,tt=Ae,lt=lt?$a(lt):null,lt!==null&&(qn=Gt(lt),lt!==qn||lt.tag!==5&&lt.tag!==6)&&(lt=null)):(tt=null,lt=Ae),tt!==lt)){if(ut=fn,$e="onMouseLeave",Ee="onMouseEnter",ve="mouse",(r==="pointerout"||r==="pointerover")&&(ut=yo,$e="onPointerLeave",Ee="onPointerEnter",ve="pointer"),qn=tt==null?Ue:Fn(tt),Pe=lt==null?Ue:Fn(lt),Ue=new ut($e,ve+"leave",tt,C,qe),Ue.target=qn,Ue.relatedTarget=Pe,$e=null,$a(qe)===Ae&&(ut=new ut(Ee,ve+"enter",lt,C,qe),ut.target=Pe,ut.relatedTarget=qn,$e=ut),qn=$e,tt&&lt)t:{for(ut=tt,Ee=lt,ve=0,Pe=ut;Pe;Pe=Po(Pe))ve++;for(Pe=0,$e=Ee;$e;$e=Po($e))Pe++;for(;0<ve-Pe;)ut=Po(ut),ve--;for(;0<Pe-ve;)Ee=Po(Ee),Pe--;for(;ve--;){if(ut===Ee||Ee!==null&&ut===Ee.alternate)break t;ut=Po(ut),Ee=Po(Ee)}ut=null}else ut=null;tt!==null&&uh(He,Ue,tt,ut,!1),lt!==null&&qn!==null&&uh(He,qn,lt,ut,!0)}}e:{if(Ue=Ae?Fn(Ae):window,tt=Ue.nodeName&&Ue.nodeName.toLowerCase(),tt==="select"||tt==="input"&&Ue.type==="file")var ct=li;else if(sa(Ue))if(dl)ct=Ic;else{ct=On;var vt=Nc}else(tt=Ue.nodeName)&&tt.toLowerCase()==="input"&&(Ue.type==="checkbox"||Ue.type==="radio")&&(ct=pu);if(ct&&(ct=ct(r,Ae))){ds(He,ct,C,qe);break e}vt&&vt(r,Ue,Ae),r==="focusout"&&(vt=Ue._wrapperState)&&vt.controlled&&Ue.type==="number"&&he(Ue,"number",Ue.value)}switch(vt=Ae?Fn(Ae):window,r){case"focusin":(sa(vt)||vt.contentEditable==="true")&&(pl=vt,Wn=Ae,So=null);break;case"focusout":So=Wn=pl=null;break;case"mousedown":gs=!0;break;case"contextmenu":case"mouseup":case"dragend":gs=!1,gu(He,C,qe);break;case"selectionchange":if(ps)break;case"keydown":case"keyup":gu(He,C,qe)}var yt;if(fs)e:{switch(r){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else Wr?Rc(r,C)&&(St="onCompositionEnd"):r==="keydown"&&C.keyCode===229&&(St="onCompositionStart");St&&($r&&C.locale!=="ko"&&(Wr||St!=="onCompositionStart"?St==="onCompositionEnd"&&Wr&&(yt=ls()):(tr=qe,Fa="value"in tr?tr.value:tr.textContent,Wr=!0)),vt=Su(Ae,St),0<vt.length&&(St=new mo(St,r,null,C,qe),He.push({event:St,listeners:vt}),yt?St.data=yt:(yt=xi(C),yt!==null&&(St.data=yt)))),(yt=cl?Mc(r,C):ah(r,C))&&(Ae=Su(Ae,"onBeforeInput"),0<Ae.length&&(qe=new mo("onBeforeInput","beforeinput",null,C,qe),He.push({event:qe,listeners:Ae}),qe.data=yt))}Hc(He,a)})}function ml(r,a,C){return{instance:r,listener:a,currentTarget:C}}function Su(r,a){for(var C=a+"Capture",F=[];r!==null;){var V=r,J=V.stateNode;V.tag===5&&J!==null&&(V=J,J=Mt(r,C),J!=null&&F.unshift(ml(r,J,V)),J=Mt(r,a),J!=null&&F.push(ml(r,J,V))),r=r.return}return F}function Po(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function uh(r,a,C,F,V){for(var J=a._reactName,ae=[];C!==null&&C!==F;){var fe=C,ge=fe.alternate,Ae=fe.stateNode;if(ge!==null&&ge===F)break;fe.tag===5&&Ae!==null&&(fe=Ae,V?(ge=Mt(C,J),ge!=null&&ae.unshift(ml(C,ge,fe))):V||(ge=Mt(C,J),ge!=null&&ae.push(ml(C,ge,fe)))),C=C.return}ae.length!==0&&r.push({event:a,listeners:ae})}var Xp=/\r\n?/g,ch=/\u0000|\uFFFD/g;function Vc(r){return(typeof r=="string"?r:""+r).replace(Xp,`
30
+ `).replace(ch,"")}function vs(r,a,C){if(a=Vc(a),Vc(r)!==a&&C)throw Error(t(425))}function Co(){}var $c=null,Wc=null;function Yc(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Kr=typeof setTimeout=="function"?setTimeout:void 0,Kc=typeof clearTimeout=="function"?clearTimeout:void 0,ys=typeof Promise=="function"?Promise:void 0,fh=typeof queueMicrotask=="function"?queueMicrotask:typeof ys<"u"?function(r){return ys.resolve(null).then(r).catch(dh)}:Kr;function dh(r){setTimeout(function(){throw r})}function Eu(r,a){var C=a,F=0;do{var V=C.nextSibling;if(r.removeChild(C),V&&V.nodeType===8)if(C=V.data,C==="/$"){if(F===0){r.removeChild(V),Fr(a);return}F--}else C!=="$"&&C!=="$?"&&C!=="$!"||F++;C=V}while(C);Fr(a)}function zi(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return r}function ko(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var C=r.data;if(C==="$"||C==="$!"||C==="$?"){if(a===0)return r;a--}else C==="/$"&&a++}r=r.previousSibling}return null}var Va=Math.random().toString(36).slice(2),ui="__reactFiber$"+Va,bs="__reactProps$"+Va,Bi="__reactContainer$"+Va,Ou="__reactEvents$"+Va,hh="__reactListeners$"+Va,ph="__reactHandles$"+Va;function $a(r){var a=r[ui];if(a)return a;for(var C=r.parentNode;C;){if(a=C[Bi]||C[ui]){if(C=a.alternate,a.child!==null||C!==null&&C.child!==null)for(r=ko(r);r!==null;){if(C=r[ui])return C;r=ko(r)}return a}r=C,C=r.parentNode}return null}function _s(r){return r=r[ui]||r[Bi],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Fn(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(t(33))}function Yn(r){return r[bs]||null}var xu=[],Ao=-1;function ca(r){return{current:r}}function on(r){0>Ao||(r.current=xu[Ao],xu[Ao]=null,Ao--)}function tn(r,a){Ao++,xu[Ao]=r.current,r.current=a}var Ui={},ir=ca(Ui),dr=ca(!1),Wa=Ui;function To(r,a){var C=r.type.contextTypes;if(!C)return Ui;var F=r.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===a)return F.__reactInternalMemoizedMaskedChildContext;var V={},J;for(J in C)V[J]=a[J];return F&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=a,r.__reactInternalMemoizedMaskedChildContext=V),V}function hr(r){return r=r.childContextTypes,r!=null}function vl(){on(dr),on(ir)}function Xc(r,a,C){if(ir.current!==Ui)throw Error(t(168));tn(ir,a),tn(dr,C)}function Pu(r,a,C){var F=r.stateNode;if(a=a.childContextTypes,typeof F.getChildContext!="function")return C;F=F.getChildContext();for(var V in F)if(!(V in a))throw Error(t(108,W(r)||"Unknown",V));return z({},C,F)}function Ro(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Ui,Wa=ir.current,tn(ir,r),tn(dr,dr.current),!0}function gh(r,a,C){var F=r.stateNode;if(!F)throw Error(t(169));C?(r=Pu(r,a,Wa),F.__reactInternalMemoizedMergedChildContext=r,on(dr),on(ir),tn(ir,r)):on(dr),tn(dr,C)}var qi=null,yl=!1,Cu=!1;function ws(r){qi===null?qi=[r]:qi.push(r)}function fa(r){yl=!0,ws(r)}function Ya(){if(!Cu&&qi!==null){Cu=!0;var r=0,a=Ht;try{var C=qi;for(Ht=1;r<C.length;r++){var F=C[r];do F=F(!0);while(F!==null)}qi=null,yl=!1}catch(V){throw qi!==null&&(qi=qi.slice(r+1)),Ir(Dr,Ya),V}finally{Ht=a,Cu=!1}}return null}var xr=[],Mo=0,Ka=null,Xa=0,Pr=[],Cr=0,Za=null,Xr=1,mn="";function Lo(r,a){xr[Mo++]=Xa,xr[Mo++]=Ka,Ka=r,Xa=a}function mh(r,a,C){Pr[Cr++]=Xr,Pr[Cr++]=mn,Pr[Cr++]=Za,Za=r;var F=Xr;r=mn;var V=32-It(F)-1;F&=~(1<<V),C+=1;var J=32-It(a)+V;if(30<J){var ae=V-V%5;J=(F&(1<<ae)-1).toString(32),F>>=ae,V-=ae,Xr=1<<32-It(a)+V|C<<V|F,mn=J+r}else Xr=1<<J|C<<V|F,mn=r}function bl(r){r.return!==null&&(Lo(r,1),mh(r,1,0))}function Kn(r){for(;r===Ka;)Ka=xr[--Mo],xr[Mo]=null,Xa=xr[--Mo],xr[Mo]=null;for(;r===Za;)Za=Pr[--Cr],Pr[Cr]=null,mn=Pr[--Cr],Pr[Cr]=null,Xr=Pr[--Cr],Pr[Cr]=null}var Zr=null,Xe=null,Zt=!1,Qr=null;function Zc(r,a){var C=Ki(5,null,null,0);C.elementType="DELETED",C.stateNode=a,C.return=r,a=r.deletions,a===null?(r.deletions=[C],r.flags|=16):a.push(C)}function vh(r,a){switch(r.tag){case 5:var C=r.type;return a=a.nodeType!==1||C.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(r.stateNode=a,Zr=r,Xe=zi(a.firstChild),!0):!1;case 6:return a=r.pendingProps===""||a.nodeType!==3?null:a,a!==null?(r.stateNode=a,Zr=r,Xe=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(C=Za!==null?{id:Xr,overflow:mn}:null,r.memoizedState={dehydrated:a,treeContext:C,retryLane:1073741824},C=Ki(18,null,null,0),C.stateNode=a,C.return=r,r.child=C,Zr=r,Xe=null,!0):!1;default:return!1}}function No(r){return(r.mode&1)!==0&&(r.flags&128)===0}function _l(r){if(Zt){var a=Xe;if(a){var C=a;if(!vh(r,a)){if(No(r))throw Error(t(418));a=zi(C.nextSibling);var F=Zr;a&&vh(r,a)?Zc(F,C):(r.flags=r.flags&-4097|2,Zt=!1,Zr=r)}}else{if(No(r))throw Error(t(418));r.flags=r.flags&-4097|2,Zt=!1,Zr=r}}}function ku(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Zr=r}function Ss(r){if(r!==Zr)return!1;if(!Zt)return ku(r),Zt=!0,!1;var a;if((a=r.tag!==3)&&!(a=r.tag!==5)&&(a=r.type,a=a!=="head"&&a!=="body"&&!Yc(r.type,r.memoizedProps)),a&&(a=Xe)){if(No(r))throw Qc(),Error(t(418));for(;a;)Zc(r,a),a=zi(a.nextSibling)}if(ku(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(t(317));e:{for(r=r.nextSibling,a=0;r;){if(r.nodeType===8){var C=r.data;if(C==="/$"){if(a===0){Xe=zi(r.nextSibling);break e}a--}else C!=="$"&&C!=="$!"&&C!=="$?"||a++}r=r.nextSibling}Xe=null}}else Xe=Zr?zi(r.stateNode.nextSibling):null;return!0}function Qc(){for(var r=Xe;r;)r=zi(r.nextSibling)}function Io(){Xe=Zr=null,Zt=!1}function Es(r){Qr===null?Qr=[r]:Qr.push(r)}var Jc=y.ReactCurrentBatchConfig;function kn(r,a,C){if(r=C.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(t(309));var F=C.stateNode}if(!F)throw Error(t(147,r));var V=F,J=""+r;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===J?a.ref:(a=function(ae){var fe=V.refs;ae===null?delete fe[J]:fe[J]=ae},a._stringRef=J,a)}if(typeof r!="string")throw Error(t(284));if(!C._owner)throw Error(t(290,r))}return r}function Ur(r,a){throw r=Object.prototype.toString.call(a),Error(t(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r))}function Pi(r){var a=r._init;return a(r._payload)}function Au(r){function a(Ee,ve){if(r){var Pe=Ee.deletions;Pe===null?(Ee.deletions=[ve],Ee.flags|=16):Pe.push(ve)}}function C(Ee,ve){if(!r)return null;for(;ve!==null;)a(Ee,ve),ve=ve.sibling;return null}function F(Ee,ve){for(Ee=new Map;ve!==null;)ve.key!==null?Ee.set(ve.key,ve):Ee.set(ve.index,ve),ve=ve.sibling;return Ee}function V(Ee,ve){return Ee=Bl(Ee,ve),Ee.index=0,Ee.sibling=null,Ee}function J(Ee,ve,Pe){return Ee.index=Pe,r?(Pe=Ee.alternate,Pe!==null?(Pe=Pe.index,Pe<ve?(Ee.flags|=2,ve):Pe):(Ee.flags|=2,ve)):(Ee.flags|=1048576,ve)}function ae(Ee){return r&&Ee.alternate===null&&(Ee.flags|=2),Ee}function fe(Ee,ve,Pe,$e){return ve===null||ve.tag!==6?(ve=vg(Pe,Ee.mode,$e),ve.return=Ee,ve):(ve=V(ve,Pe),ve.return=Ee,ve)}function ge(Ee,ve,Pe,$e){var ct=Pe.type;return ct===R?qe(Ee,ve,Pe.props.children,$e,Pe.key):ve!==null&&(ve.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===X&&Pi(ct)===ve.type)?($e=V(ve,Pe.props),$e.ref=kn(Ee,ve,Pe),$e.return=Ee,$e):($e=Fh(Pe.type,Pe.key,Pe.props,null,Ee.mode,$e),$e.ref=kn(Ee,ve,Pe),$e.return=Ee,$e)}function Ae(Ee,ve,Pe,$e){return ve===null||ve.tag!==4||ve.stateNode.containerInfo!==Pe.containerInfo||ve.stateNode.implementation!==Pe.implementation?(ve=yg(Pe,Ee.mode,$e),ve.return=Ee,ve):(ve=V(ve,Pe.children||[]),ve.return=Ee,ve)}function qe(Ee,ve,Pe,$e,ct){return ve===null||ve.tag!==7?(ve=Ns(Pe,Ee.mode,$e,ct),ve.return=Ee,ve):(ve=V(ve,Pe),ve.return=Ee,ve)}function He(Ee,ve,Pe){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return ve=vg(""+ve,Ee.mode,Pe),ve.return=Ee,ve;if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case O:return Pe=Fh(ve.type,ve.key,ve.props,null,Ee.mode,Pe),Pe.ref=kn(Ee,null,ve),Pe.return=Ee,Pe;case M:return ve=yg(ve,Ee.mode,Pe),ve.return=Ee,ve;case X:var $e=ve._init;return He(Ee,$e(ve._payload),Pe)}if(Ce(ve)||H(ve))return ve=Ns(ve,Ee.mode,Pe,null),ve.return=Ee,ve;Ur(Ee,ve)}return null}function Ue(Ee,ve,Pe,$e){var ct=ve!==null?ve.key:null;if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number")return ct!==null?null:fe(Ee,ve,""+Pe,$e);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case O:return Pe.key===ct?ge(Ee,ve,Pe,$e):null;case M:return Pe.key===ct?Ae(Ee,ve,Pe,$e):null;case X:return ct=Pe._init,Ue(Ee,ve,ct(Pe._payload),$e)}if(Ce(Pe)||H(Pe))return ct!==null?null:qe(Ee,ve,Pe,$e,null);Ur(Ee,Pe)}return null}function tt(Ee,ve,Pe,$e,ct){if(typeof $e=="string"&&$e!==""||typeof $e=="number")return Ee=Ee.get(Pe)||null,fe(ve,Ee,""+$e,ct);if(typeof $e=="object"&&$e!==null){switch($e.$$typeof){case O:return Ee=Ee.get($e.key===null?Pe:$e.key)||null,ge(ve,Ee,$e,ct);case M:return Ee=Ee.get($e.key===null?Pe:$e.key)||null,Ae(ve,Ee,$e,ct);case X:var vt=$e._init;return tt(Ee,ve,Pe,vt($e._payload),ct)}if(Ce($e)||H($e))return Ee=Ee.get(Pe)||null,qe(ve,Ee,$e,ct,null);Ur(ve,$e)}return null}function lt(Ee,ve,Pe,$e){for(var ct=null,vt=null,yt=ve,St=ve=0,br=null;yt!==null&&St<Pe.length;St++){yt.index>St?(br=yt,yt=null):br=yt.sibling;var Kt=Ue(Ee,yt,Pe[St],$e);if(Kt===null){yt===null&&(yt=br);break}r&&yt&&Kt.alternate===null&&a(Ee,yt),ve=J(Kt,ve,St),vt===null?ct=Kt:vt.sibling=Kt,vt=Kt,yt=br}if(St===Pe.length)return C(Ee,yt),Zt&&Lo(Ee,St),ct;if(yt===null){for(;St<Pe.length;St++)yt=He(Ee,Pe[St],$e),yt!==null&&(ve=J(yt,ve,St),vt===null?ct=yt:vt.sibling=yt,vt=yt);return Zt&&Lo(Ee,St),ct}for(yt=F(Ee,yt);St<Pe.length;St++)br=tt(yt,Ee,St,Pe[St],$e),br!==null&&(r&&br.alternate!==null&&yt.delete(br.key===null?St:br.key),ve=J(br,ve,St),vt===null?ct=br:vt.sibling=br,vt=br);return r&&yt.forEach(function(Ul){return a(Ee,Ul)}),Zt&&Lo(Ee,St),ct}function ut(Ee,ve,Pe,$e){var ct=H(Pe);if(typeof ct!="function")throw Error(t(150));if(Pe=ct.call(Pe),Pe==null)throw Error(t(151));for(var vt=ct=null,yt=ve,St=ve=0,br=null,Kt=Pe.next();yt!==null&&!Kt.done;St++,Kt=Pe.next()){yt.index>St?(br=yt,yt=null):br=yt.sibling;var Ul=Ue(Ee,yt,Kt.value,$e);if(Ul===null){yt===null&&(yt=br);break}r&&yt&&Ul.alternate===null&&a(Ee,yt),ve=J(Ul,ve,St),vt===null?ct=Ul:vt.sibling=Ul,vt=Ul,yt=br}if(Kt.done)return C(Ee,yt),Zt&&Lo(Ee,St),ct;if(yt===null){for(;!Kt.done;St++,Kt=Pe.next())Kt=He(Ee,Kt.value,$e),Kt!==null&&(ve=J(Kt,ve,St),vt===null?ct=Kt:vt.sibling=Kt,vt=Kt);return Zt&&Lo(Ee,St),ct}for(yt=F(Ee,yt);!Kt.done;St++,Kt=Pe.next())Kt=tt(yt,Ee,St,Kt.value,$e),Kt!==null&&(r&&Kt.alternate!==null&&yt.delete(Kt.key===null?St:Kt.key),ve=J(Kt,ve,St),vt===null?ct=Kt:vt.sibling=Kt,vt=Kt);return r&&yt.forEach(function(Y4){return a(Ee,Y4)}),Zt&&Lo(Ee,St),ct}function qn(Ee,ve,Pe,$e){if(typeof Pe=="object"&&Pe!==null&&Pe.type===R&&Pe.key===null&&(Pe=Pe.props.children),typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case O:e:{for(var ct=Pe.key,vt=ve;vt!==null;){if(vt.key===ct){if(ct=Pe.type,ct===R){if(vt.tag===7){C(Ee,vt.sibling),ve=V(vt,Pe.props.children),ve.return=Ee,Ee=ve;break e}}else if(vt.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===X&&Pi(ct)===vt.type){C(Ee,vt.sibling),ve=V(vt,Pe.props),ve.ref=kn(Ee,vt,Pe),ve.return=Ee,Ee=ve;break e}C(Ee,vt);break}else a(Ee,vt);vt=vt.sibling}Pe.type===R?(ve=Ns(Pe.props.children,Ee.mode,$e,Pe.key),ve.return=Ee,Ee=ve):($e=Fh(Pe.type,Pe.key,Pe.props,null,Ee.mode,$e),$e.ref=kn(Ee,ve,Pe),$e.return=Ee,Ee=$e)}return ae(Ee);case M:e:{for(vt=Pe.key;ve!==null;){if(ve.key===vt)if(ve.tag===4&&ve.stateNode.containerInfo===Pe.containerInfo&&ve.stateNode.implementation===Pe.implementation){C(Ee,ve.sibling),ve=V(ve,Pe.children||[]),ve.return=Ee,Ee=ve;break e}else{C(Ee,ve);break}else a(Ee,ve);ve=ve.sibling}ve=yg(Pe,Ee.mode,$e),ve.return=Ee,Ee=ve}return ae(Ee);case X:return vt=Pe._init,qn(Ee,ve,vt(Pe._payload),$e)}if(Ce(Pe))return lt(Ee,ve,Pe,$e);if(H(Pe))return ut(Ee,ve,Pe,$e);Ur(Ee,Pe)}return typeof Pe=="string"&&Pe!==""||typeof Pe=="number"?(Pe=""+Pe,ve!==null&&ve.tag===6?(C(Ee,ve.sibling),ve=V(ve,Pe),ve.return=Ee,Ee=ve):(C(Ee,ve),ve=vg(Pe,Ee.mode,$e),ve.return=Ee,Ee=ve),ae(Ee)):C(Ee,ve)}return qn}var Do=Au(!0),ci=Au(!1),Os=ca(null),Jr=null,wl=null,Tu=null;function Ru(){Tu=wl=Jr=null}function Mu(r){var a=Os.current;on(Os),r._currentValue=a}function Lu(r,a,C){for(;r!==null;){var F=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,F!==null&&(F.childLanes|=a)):F!==null&&(F.childLanes&a)!==a&&(F.childLanes|=a),r===C)break;r=r.return}}function da(r,a){Jr=r,Tu=wl=null,r=r.dependencies,r!==null&&r.firstContext!==null&&(r.lanes&a&&(ne=!0),r.firstContext=null)}function kr(r){var a=r._currentValue;if(Tu!==r)if(r={context:r,memoizedValue:a,next:null},wl===null){if(Jr===null)throw Error(t(308));wl=r,Jr.dependencies={lanes:0,firstContext:r}}else wl=wl.next=r;return a}var Hi=null;function Sl(r){Hi===null?Hi=[r]:Hi.push(r)}function xs(r,a,C,F){var V=a.interleaved;return V===null?(C.next=C,Sl(a)):(C.next=V.next,V.next=C),a.interleaved=C,ei(r,F)}function ei(r,a){r.lanes|=a;var C=r.alternate;for(C!==null&&(C.lanes|=a),C=r,r=r.return;r!==null;)r.childLanes|=a,C=r.alternate,C!==null&&(C.childLanes|=a),C=r,r=r.return;return C.tag===3?C.stateNode:null}var Gi=!1;function Ps(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nu(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Vi(r,a){return{eventTime:r,lane:a,tag:0,payload:null,callback:null,next:null}}function $i(r,a,C){var F=r.updateQueue;if(F===null)return null;if(F=F.shared,$t&2){var V=F.pending;return V===null?a.next=a:(a.next=V.next,V.next=a),F.pending=a,ei(r,C)}return V=F.interleaved,V===null?(a.next=a,Sl(F)):(a.next=V.next,V.next=a),F.interleaved=a,ei(r,C)}function Iu(r,a,C){if(a=a.updateQueue,a!==null&&(a=a.shared,(C&4194240)!==0)){var F=a.lanes;F&=r.pendingLanes,C|=F,a.lanes=C,xc(r,C)}}function Cs(r,a){var C=r.updateQueue,F=r.alternate;if(F!==null&&(F=F.updateQueue,C===F)){var V=null,J=null;if(C=C.firstBaseUpdate,C!==null){do{var ae={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};J===null?V=J=ae:J=J.next=ae,C=C.next}while(C!==null);J===null?V=J=a:J=J.next=a}else V=J=a;C={baseState:F.baseState,firstBaseUpdate:V,lastBaseUpdate:J,shared:F.shared,effects:F.effects},r.updateQueue=C;return}r=C.lastBaseUpdate,r===null?C.firstBaseUpdate=a:r.next=a,C.lastBaseUpdate=a}function El(r,a,C,F){var V=r.updateQueue;Gi=!1;var J=V.firstBaseUpdate,ae=V.lastBaseUpdate,fe=V.shared.pending;if(fe!==null){V.shared.pending=null;var ge=fe,Ae=ge.next;ge.next=null,ae===null?J=Ae:ae.next=Ae,ae=ge;var qe=r.alternate;qe!==null&&(qe=qe.updateQueue,fe=qe.lastBaseUpdate,fe!==ae&&(fe===null?qe.firstBaseUpdate=Ae:fe.next=Ae,qe.lastBaseUpdate=ge))}if(J!==null){var He=V.baseState;ae=0,qe=Ae=ge=null,fe=J;do{var Ue=fe.lane,tt=fe.eventTime;if((F&Ue)===Ue){qe!==null&&(qe=qe.next={eventTime:tt,lane:0,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null});e:{var lt=r,ut=fe;switch(Ue=a,tt=C,ut.tag){case 1:if(lt=ut.payload,typeof lt=="function"){He=lt.call(tt,He,Ue);break e}He=lt;break e;case 3:lt.flags=lt.flags&-65537|128;case 0:if(lt=ut.payload,Ue=typeof lt=="function"?lt.call(tt,He,Ue):lt,Ue==null)break e;He=z({},He,Ue);break e;case 2:Gi=!0}}fe.callback!==null&&fe.lane!==0&&(r.flags|=64,Ue=V.effects,Ue===null?V.effects=[fe]:Ue.push(fe))}else tt={eventTime:tt,lane:Ue,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null},qe===null?(Ae=qe=tt,ge=He):qe=qe.next=tt,ae|=Ue;if(fe=fe.next,fe===null){if(fe=V.shared.pending,fe===null)break;Ue=fe,fe=Ue.next,Ue.next=null,V.lastBaseUpdate=Ue,V.shared.pending=null}}while(!0);if(qe===null&&(ge=He),V.baseState=ge,V.firstBaseUpdate=Ae,V.lastBaseUpdate=qe,a=V.shared.interleaved,a!==null){V=a;do ae|=V.lane,V=V.next;while(V!==a)}else J===null&&(V.shared.lanes=0);Ts|=ae,r.lanes=ae,r.memoizedState=He}}function Pn(r,a,C){if(r=a.effects,a.effects=null,r!==null)for(a=0;a<r.length;a++){var F=r[a],V=F.callback;if(V!==null){if(F.callback=null,F=C,typeof V!="function")throw Error(t(191,V));V.call(F)}}}var kt={},nn=ca(kt),vn=ca(kt),An=ca(kt);function zn(r){if(r===kt)throw Error(t(174));return r}function Qa(r,a){switch(tn(An,a),tn(vn,r),tn(nn,kt),r=a.nodeType,r){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:ht(null,"");break;default:r=r===8?a.parentNode:a,a=r.namespaceURI||null,r=r.tagName,a=ht(a,r)}on(nn),tn(nn,a)}function yn(){on(nn),on(vn),on(An)}function Ol(r){zn(An.current);var a=zn(nn.current),C=ht(a,r.type);a!==C&&(tn(vn,r),tn(nn,C))}function ha(r){vn.current===r&&(on(nn),on(vn))}var ln=ca(0);function xl(r){for(var a=r;a!==null;){if(a.tag===13){var C=a.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||C.data==="$?"||C.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var jo=[];function pr(){for(var r=0;r<jo.length;r++)jo[r]._workInProgressVersionPrimary=null;jo.length=0}var Pl=y.ReactCurrentDispatcher,ks=y.ReactCurrentBatchConfig,Ar=0,Jt=null,Cn=null,Mn=null,Ci=!1,Ja=!1,fi=0,Du=0;function Ln(){throw Error(t(321))}function As(r,a){if(a===null)return!1;for(var C=0;C<a.length&&C<r.length;C++)if(!Br(r[C],a[C]))return!1;return!0}function Cl(r,a,C,F,V,J){if(Ar=J,Jt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Pl.current=r===null||r.memoizedState===null?Qp:no,r=C(F,V),Ja){J=0;do{if(Ja=!1,fi=0,25<=J)throw Error(t(301));J+=1,Mn=Cn=null,a.updateQueue=null,Pl.current=Uu,r=C(F,V)}while(Ja)}if(Pl.current=Rl,a=Cn!==null&&Cn.next!==null,Ar=0,Mn=Cn=Jt=null,Ci=!1,a)throw Error(t(300));return r}function kl(){var r=fi!==0;return fi=0,r}function dn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?Jt.memoizedState=Mn=r:Mn=Mn.next=r,Mn}function Bn(){if(Cn===null){var r=Jt.alternate;r=r!==null?r.memoizedState:null}else r=Cn.next;var a=Mn===null?Jt.memoizedState:Mn.next;if(a!==null)Mn=a,Cn=r;else{if(r===null)throw Error(t(310));Cn=r,r={memoizedState:Cn.memoizedState,baseState:Cn.baseState,baseQueue:Cn.baseQueue,queue:Cn.queue,next:null},Mn===null?Jt.memoizedState=Mn=r:Mn=Mn.next=r}return Mn}function gr(r,a){return typeof a=="function"?a(r):a}function mr(r){var a=Bn(),C=a.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=r;var F=Cn,V=F.baseQueue,J=C.pending;if(J!==null){if(V!==null){var ae=V.next;V.next=J.next,J.next=ae}F.baseQueue=V=J,C.pending=null}if(V!==null){J=V.next,F=F.baseState;var fe=ae=null,ge=null,Ae=J;do{var qe=Ae.lane;if((Ar&qe)===qe)ge!==null&&(ge=ge.next={lane:0,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null}),F=Ae.hasEagerState?Ae.eagerState:r(F,Ae.action);else{var He={lane:qe,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null};ge===null?(fe=ge=He,ae=F):ge=ge.next=He,Jt.lanes|=qe,Ts|=qe}Ae=Ae.next}while(Ae!==null&&Ae!==J);ge===null?ae=F:ge.next=fe,Br(F,a.memoizedState)||(ne=!0),a.memoizedState=F,a.baseState=ae,a.baseQueue=ge,C.lastRenderedState=F}if(r=C.interleaved,r!==null){V=r;do J=V.lane,Jt.lanes|=J,Ts|=J,V=V.next;while(V!==r)}else V===null&&(C.lanes=0);return[a.memoizedState,C.dispatch]}function ju(r){var a=Bn(),C=a.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=r;var F=C.dispatch,V=C.pending,J=a.memoizedState;if(V!==null){C.pending=null;var ae=V=V.next;do J=r(J,ae.action),ae=ae.next;while(ae!==V);Br(J,a.memoizedState)||(ne=!0),a.memoizedState=J,a.baseQueue===null&&(a.baseState=J),C.lastRenderedState=J}return[J,F]}function Fu(){}function zu(r,a){var C=Jt,F=Bn(),V=a(),J=!Br(F.memoizedState,V);if(J&&(F.memoizedState=V,ne=!0),F=F.queue,rf(ef.bind(null,C,F,r),[r]),F.getSnapshot!==a||J||Mn!==null&&Mn.memoizedState.tag&1){if(C.flags|=2048,Al(9,pa.bind(null,C,F,V,a),void 0,null),yr===null)throw Error(t(349));Ar&30||yh(C,a,V)}return V}function yh(r,a,C){r.flags|=16384,r={getSnapshot:a,value:C},a=Jt.updateQueue,a===null?(a={lastEffect:null,stores:null},Jt.updateQueue=a,a.stores=[r]):(C=a.stores,C===null?a.stores=[r]:C.push(r))}function pa(r,a,C,F){a.value=C,a.getSnapshot=F,tf(a)&&Bu(r)}function ef(r,a,C){return C(function(){tf(a)&&Bu(r)})}function tf(r){var a=r.getSnapshot;r=r.value;try{var C=a();return!Br(r,C)}catch{return!0}}function Bu(r){var a=ei(r,1);a!==null&&ya(a,r,1,-1)}function eo(r){var a=dn();return typeof r=="function"&&(r=r()),a.memoizedState=a.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:r},a.queue=r,r=r.dispatch=Oh.bind(null,Jt,r),[a.memoizedState,r]}function Al(r,a,C,F){return r={tag:r,create:a,destroy:C,deps:F,next:null},a=Jt.updateQueue,a===null?(a={lastEffect:null,stores:null},Jt.updateQueue=a,a.lastEffect=r.next=r):(C=a.lastEffect,C===null?a.lastEffect=r.next=r:(F=C.next,C.next=r,r.next=F,a.lastEffect=r)),r}function nf(){return Bn().memoizedState}function Tl(r,a,C,F){var V=dn();Jt.flags|=r,V.memoizedState=Al(1|a,C,void 0,F===void 0?null:F)}function Fo(r,a,C,F){var V=Bn();F=F===void 0?null:F;var J=void 0;if(Cn!==null){var ae=Cn.memoizedState;if(J=ae.destroy,F!==null&&As(F,ae.deps)){V.memoizedState=Al(a,C,J,F);return}}Jt.flags|=r,V.memoizedState=Al(1|a,C,J,F)}function bh(r,a){return Tl(8390656,8,r,a)}function rf(r,a){return Fo(2048,8,r,a)}function af(r,a){return Fo(4,2,r,a)}function of(r,a){return Fo(4,4,r,a)}function to(r,a){if(typeof a=="function")return r=r(),a(r),function(){a(null)};if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function _h(r,a,C){return C=C!=null?C.concat([r]):null,Fo(4,4,to.bind(null,a,r),C)}function ga(){}function lf(r,a){var C=Bn();a=a===void 0?null:a;var F=C.memoizedState;return F!==null&&a!==null&&As(a,F[1])?F[0]:(C.memoizedState=[r,a],r)}function hn(r,a){var C=Bn();a=a===void 0?null:a;var F=C.memoizedState;return F!==null&&a!==null&&As(a,F[1])?F[0]:(r=r(),C.memoizedState=[r,a],r)}function wh(r,a,C){return Ar&21?(Br(C,a)||(C=Oc(),Jt.lanes|=C,Ts|=C,r.baseState=!0),a):(r.baseState&&(r.baseState=!1,ne=!0),r.memoizedState=C)}function Sh(r,a){var C=Ht;Ht=C!==0&&4>C?C:4,r(!0);var F=ks.transition;ks.transition={};try{r(!1),a()}finally{Ht=C,ks.transition=F}}function Eh(){return Bn().memoizedState}function Zp(r,a,C){var F=Fl(r);if(C={lane:F,action:C,hasEagerState:!1,eagerState:null,next:null},sf(r))xh(a,C);else if(C=xs(r,a,C,F),C!==null){var V=ni();ya(C,r,F,V),ti(C,a,F)}}function Oh(r,a,C){var F=Fl(r),V={lane:F,action:C,hasEagerState:!1,eagerState:null,next:null};if(sf(r))xh(a,V);else{var J=r.alternate;if(r.lanes===0&&(J===null||J.lanes===0)&&(J=a.lastRenderedReducer,J!==null))try{var ae=a.lastRenderedState,fe=J(ae,C);if(V.hasEagerState=!0,V.eagerState=fe,Br(fe,ae)){var ge=a.interleaved;ge===null?(V.next=V,Sl(a)):(V.next=ge.next,ge.next=V),a.interleaved=V;return}}catch{}finally{}C=xs(r,a,V,F),C!==null&&(V=ni(),ya(C,r,F,V),ti(C,a,F))}}function sf(r){var a=r.alternate;return r===Jt||a!==null&&a===Jt}function xh(r,a){Ja=Ci=!0;var C=r.pending;C===null?a.next=a:(a.next=C.next,C.next=a),r.pending=a}function ti(r,a,C){if(C&4194240){var F=a.lanes;F&=r.pendingLanes,C|=F,a.lanes=C,xc(r,C)}}var Rl={readContext:kr,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},Qp={readContext:kr,useCallback:function(r,a){return dn().memoizedState=[r,a===void 0?null:a],r},useContext:kr,useEffect:bh,useImperativeHandle:function(r,a,C){return C=C!=null?C.concat([r]):null,Tl(4194308,4,to.bind(null,a,r),C)},useLayoutEffect:function(r,a){return Tl(4194308,4,r,a)},useInsertionEffect:function(r,a){return Tl(4,2,r,a)},useMemo:function(r,a){var C=dn();return a=a===void 0?null:a,r=r(),C.memoizedState=[r,a],r},useReducer:function(r,a,C){var F=dn();return a=C!==void 0?C(a):a,F.memoizedState=F.baseState=a,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:a},F.queue=r,r=r.dispatch=Zp.bind(null,Jt,r),[F.memoizedState,r]},useRef:function(r){var a=dn();return r={current:r},a.memoizedState=r},useState:eo,useDebugValue:ga,useDeferredValue:function(r){return dn().memoizedState=r},useTransition:function(){var r=eo(!1),a=r[0];return r=Sh.bind(null,r[1]),dn().memoizedState=r,[a,r]},useMutableSource:function(){},useSyncExternalStore:function(r,a,C){var F=Jt,V=dn();if(Zt){if(C===void 0)throw Error(t(407));C=C()}else{if(C=a(),yr===null)throw Error(t(349));Ar&30||yh(F,a,C)}V.memoizedState=C;var J={value:C,getSnapshot:a};return V.queue=J,bh(ef.bind(null,F,J,r),[r]),F.flags|=2048,Al(9,pa.bind(null,F,J,C,a),void 0,null),C},useId:function(){var r=dn(),a=yr.identifierPrefix;if(Zt){var C=mn,F=Xr;C=(F&~(1<<32-It(F)-1)).toString(32)+C,a=":"+a+"R"+C,C=fi++,0<C&&(a+="H"+C.toString(32)),a+=":"}else C=Du++,a=":"+a+"r"+C.toString(32)+":";return r.memoizedState=a},unstable_isNewReconciler:!1},no={readContext:kr,useCallback:lf,useContext:kr,useEffect:rf,useImperativeHandle:_h,useInsertionEffect:af,useLayoutEffect:of,useMemo:hn,useReducer:mr,useRef:nf,useState:function(){return mr(gr)},useDebugValue:ga,useDeferredValue:function(r){var a=Bn();return wh(a,Cn.memoizedState,r)},useTransition:function(){var r=mr(gr)[0],a=Bn().memoizedState;return[r,a]},useMutableSource:Fu,useSyncExternalStore:zu,useId:Eh,unstable_isNewReconciler:!1},Uu={readContext:kr,useCallback:lf,useContext:kr,useEffect:rf,useImperativeHandle:_h,useInsertionEffect:af,useLayoutEffect:of,useMemo:hn,useReducer:ju,useRef:nf,useState:function(){return ju(gr)},useDebugValue:ga,useDeferredValue:function(r){var a=Bn();return Cn===null?a.memoizedState=r:wh(a,Cn.memoizedState,r)},useTransition:function(){var r=ju(gr)[0],a=Bn().memoizedState;return[r,a]},useMutableSource:Fu,useSyncExternalStore:zu,useId:Eh,unstable_isNewReconciler:!1};function ar(r,a){if(r&&r.defaultProps){a=z({},a),r=r.defaultProps;for(var C in r)a[C]===void 0&&(a[C]=r[C]);return a}return a}function Ml(r,a,C,F){a=r.memoizedState,C=C(F,a),C=C==null?a:z({},a,C),r.memoizedState=C,r.lanes===0&&(r.updateQueue.baseState=C)}var Ll={isMounted:function(r){return(r=r._reactInternals)?Gt(r)===r:!1},enqueueSetState:function(r,a,C){r=r._reactInternals;var F=ni(),V=Fl(r),J=Vi(F,V);J.payload=a,C!=null&&(J.callback=C),a=$i(r,J,V),a!==null&&(ya(a,r,V,F),Iu(a,r,V))},enqueueReplaceState:function(r,a,C){r=r._reactInternals;var F=ni(),V=Fl(r),J=Vi(F,V);J.tag=1,J.payload=a,C!=null&&(J.callback=C),a=$i(r,J,V),a!==null&&(ya(a,r,V,F),Iu(a,r,V))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var C=ni(),F=Fl(r),V=Vi(C,F);V.tag=2,a!=null&&(V.callback=a),a=$i(r,V,F),a!==null&&(ya(a,r,F,C),Iu(a,r,F))}};function qu(r,a,C,F,V,J,ae){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(F,J,ae):a.prototype&&a.prototype.isPureReactComponent?!wo(C,F)||!wo(V,J):!0}function Ph(r,a,C){var F=!1,V=Ui,J=a.contextType;return typeof J=="object"&&J!==null?J=kr(J):(V=hr(a)?Wa:ir.current,F=a.contextTypes,J=(F=F!=null)?To(r,V):Ui),a=new a(C,J),r.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ll,r.stateNode=a,a._reactInternals=r,F&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=V,r.__reactInternalMemoizedMaskedChildContext=J),a}function uf(r,a,C,F){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(C,F),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(C,F),a.state!==r&&Ll.enqueueReplaceState(a,a.state,null)}function Hu(r,a,C,F){var V=r.stateNode;V.props=C,V.state=r.memoizedState,V.refs={},Ps(r);var J=a.contextType;typeof J=="object"&&J!==null?V.context=kr(J):(J=hr(a)?Wa:ir.current,V.context=To(r,J)),V.state=r.memoizedState,J=a.getDerivedStateFromProps,typeof J=="function"&&(Ml(r,a,J,C),V.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof V.getSnapshotBeforeUpdate=="function"||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(a=V.state,typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount(),a!==V.state&&Ll.enqueueReplaceState(V,V.state,null),El(r,C,V,F),V.state=r.memoizedState),typeof V.componentDidMount=="function"&&(r.flags|=4194308)}function zo(r,a){try{var C="",F=a;do C+=G(F),F=F.return;while(F);var V=C}catch(J){V=`
31
+ Error generating stack: `+J.message+`
32
+ `+J.stack}return{value:r,source:a,stack:V,digest:null}}function Gu(r,a,C){return{value:r,source:null,stack:C??null,digest:a??null}}function Nl(r,a){try{console.error(a.value)}catch(C){setTimeout(function(){throw C})}}var Jp=typeof WeakMap=="function"?WeakMap:Map;function Ch(r,a,C){C=Vi(-1,C),C.tag=3,C.payload={element:null};var F=a.value;return C.callback=function(){Mh||(Mh=!0,ug=F),Nl(r,a)},C}function u(r,a,C){C=Vi(-1,C),C.tag=3;var F=r.type.getDerivedStateFromError;if(typeof F=="function"){var V=a.value;C.payload=function(){return F(V)},C.callback=function(){Nl(r,a)}}var J=r.stateNode;return J!==null&&typeof J.componentDidCatch=="function"&&(C.callback=function(){Nl(r,a),typeof F!="function"&&(Dl===null?Dl=new Set([this]):Dl.add(this));var ae=a.stack;this.componentDidCatch(a.value,{componentStack:ae!==null?ae:""})}),C}function f(r,a,C){var F=r.pingCache;if(F===null){F=r.pingCache=new Jp;var V=new Set;F.set(a,V)}else V=F.get(a),V===void 0&&(V=new Set,F.set(a,V));V.has(C)||(V.add(C),r=j4.bind(null,r,a,C),a.then(r,r))}function j(r){do{var a;if((a=r.tag===13)&&(a=r.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return r;r=r.return}while(r!==null);return null}function q(r,a,C,F,V){return r.mode&1?(r.flags|=65536,r.lanes=V,r):(r===a?r.flags|=65536:(r.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(a=Vi(-1,1),a.tag=2,$i(C,a,1))),C.lanes|=1),r)}var Y=y.ReactCurrentOwner,ne=!1;function le(r,a,C,F){a.child=r===null?ci(a,null,C,F):Do(a,r.child,C,F)}function ye(r,a,C,F,V){C=C.render;var J=a.ref;return da(a,V),F=Cl(r,a,C,F,J,V),C=kl(),r!==null&&!ne?(a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~V,vr(r,a,V)):(Zt&&C&&bl(a),a.flags|=1,le(r,a,F,V),a.child)}function Re(r,a,C,F,V){if(r===null){var J=C.type;return typeof J=="function"&&!mg(J)&&J.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(a.tag=15,a.type=J,Ge(r,a,J,F,V)):(r=Fh(C.type,null,F,a,a.mode,V),r.ref=a.ref,r.return=a,a.child=r)}if(J=r.child,!(r.lanes&V)){var ae=J.memoizedProps;if(C=C.compare,C=C!==null?C:wo,C(ae,F)&&r.ref===a.ref)return vr(r,a,V)}return a.flags|=1,r=Bl(J,F),r.ref=a.ref,r.return=a,a.child=r}function Ge(r,a,C,F,V){if(r!==null){var J=r.memoizedProps;if(wo(J,F)&&r.ref===a.ref)if(ne=!1,a.pendingProps=F=J,(r.lanes&V)!==0)r.flags&131072&&(ne=!0);else return a.lanes=r.lanes,vr(r,a,V)}return Qe(r,a,C,F,V)}function it(r,a,C){var F=a.pendingProps,V=F.children,J=r!==null?r.memoizedState:null;if(F.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},tn($u,ki),ki|=C;else{if(!(C&1073741824))return r=J!==null?J.baseLanes|C:C,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:r,cachePool:null,transitions:null},a.updateQueue=null,tn($u,ki),ki|=r,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},F=J!==null?J.baseLanes:C,tn($u,ki),ki|=F}else J!==null?(F=J.baseLanes|C,a.memoizedState=null):F=C,tn($u,ki),ki|=F;return le(r,a,V,C),a.child}function Ot(r,a){var C=a.ref;(r===null&&C!==null||r!==null&&r.ref!==C)&&(a.flags|=512,a.flags|=2097152)}function Qe(r,a,C,F,V){var J=hr(C)?Wa:ir.current;return J=To(a,J),da(a,V),C=Cl(r,a,C,F,J,V),F=kl(),r!==null&&!ne?(a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~V,vr(r,a,V)):(Zt&&F&&bl(a),a.flags|=1,le(r,a,C,V),a.child)}function sn(r,a,C,F,V){if(hr(C)){var J=!0;Ro(a)}else J=!1;if(da(a,V),a.stateNode===null)zt(r,a),Ph(a,C,F),Hu(a,C,F,V),F=!0;else if(r===null){var ae=a.stateNode,fe=a.memoizedProps;ae.props=fe;var ge=ae.context,Ae=C.contextType;typeof Ae=="object"&&Ae!==null?Ae=kr(Ae):(Ae=hr(C)?Wa:ir.current,Ae=To(a,Ae));var qe=C.getDerivedStateFromProps,He=typeof qe=="function"||typeof ae.getSnapshotBeforeUpdate=="function";He||typeof ae.UNSAFE_componentWillReceiveProps!="function"&&typeof ae.componentWillReceiveProps!="function"||(fe!==F||ge!==Ae)&&uf(a,ae,F,Ae),Gi=!1;var Ue=a.memoizedState;ae.state=Ue,El(a,F,ae,V),ge=a.memoizedState,fe!==F||Ue!==ge||dr.current||Gi?(typeof qe=="function"&&(Ml(a,C,qe,F),ge=a.memoizedState),(fe=Gi||qu(a,C,fe,F,Ue,ge,Ae))?(He||typeof ae.UNSAFE_componentWillMount!="function"&&typeof ae.componentWillMount!="function"||(typeof ae.componentWillMount=="function"&&ae.componentWillMount(),typeof ae.UNSAFE_componentWillMount=="function"&&ae.UNSAFE_componentWillMount()),typeof ae.componentDidMount=="function"&&(a.flags|=4194308)):(typeof ae.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=F,a.memoizedState=ge),ae.props=F,ae.state=ge,ae.context=Ae,F=fe):(typeof ae.componentDidMount=="function"&&(a.flags|=4194308),F=!1)}else{ae=a.stateNode,Nu(r,a),fe=a.memoizedProps,Ae=a.type===a.elementType?fe:ar(a.type,fe),ae.props=Ae,He=a.pendingProps,Ue=ae.context,ge=C.contextType,typeof ge=="object"&&ge!==null?ge=kr(ge):(ge=hr(C)?Wa:ir.current,ge=To(a,ge));var tt=C.getDerivedStateFromProps;(qe=typeof tt=="function"||typeof ae.getSnapshotBeforeUpdate=="function")||typeof ae.UNSAFE_componentWillReceiveProps!="function"&&typeof ae.componentWillReceiveProps!="function"||(fe!==He||Ue!==ge)&&uf(a,ae,F,ge),Gi=!1,Ue=a.memoizedState,ae.state=Ue,El(a,F,ae,V);var lt=a.memoizedState;fe!==He||Ue!==lt||dr.current||Gi?(typeof tt=="function"&&(Ml(a,C,tt,F),lt=a.memoizedState),(Ae=Gi||qu(a,C,Ae,F,Ue,lt,ge)||!1)?(qe||typeof ae.UNSAFE_componentWillUpdate!="function"&&typeof ae.componentWillUpdate!="function"||(typeof ae.componentWillUpdate=="function"&&ae.componentWillUpdate(F,lt,ge),typeof ae.UNSAFE_componentWillUpdate=="function"&&ae.UNSAFE_componentWillUpdate(F,lt,ge)),typeof ae.componentDidUpdate=="function"&&(a.flags|=4),typeof ae.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof ae.componentDidUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(a.flags|=4),typeof ae.getSnapshotBeforeUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(a.flags|=1024),a.memoizedProps=F,a.memoizedState=lt),ae.props=F,ae.state=lt,ae.context=ge,F=Ae):(typeof ae.componentDidUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(a.flags|=4),typeof ae.getSnapshotBeforeUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(a.flags|=1024),F=!1)}return Qt(r,a,C,F,J,V)}function Qt(r,a,C,F,V,J){Ot(r,a);var ae=(a.flags&128)!==0;if(!F&&!ae)return V&&gh(a,C,!1),vr(r,a,J);F=a.stateNode,Y.current=a;var fe=ae&&typeof C.getDerivedStateFromError!="function"?null:F.render();return a.flags|=1,r!==null&&ae?(a.child=Do(a,r.child,null,J),a.child=Do(a,null,fe,J)):le(r,a,fe,J),a.memoizedState=F.state,V&&gh(a,C,!0),a.child}function Tr(r){var a=r.stateNode;a.pendingContext?Xc(r,a.pendingContext,a.pendingContext!==a.context):a.context&&Xc(r,a.context,!1),Qa(r,a.containerInfo)}function Wi(r,a,C,F,V){return Io(),Es(V),a.flags|=256,le(r,a,C,F),a.child}var ke={dehydrated:null,treeContext:null,retryLane:0};function be(r){return{baseLanes:r,cachePool:null,transitions:null}}function Ne(r,a,C){var F=a.pendingProps,V=ln.current,J=!1,ae=(a.flags&128)!==0,fe;if((fe=ae)||(fe=r!==null&&r.memoizedState===null?!1:(V&2)!==0),fe?(J=!0,a.flags&=-129):(r===null||r.memoizedState!==null)&&(V|=1),tn(ln,V&1),r===null)return _l(a),r=a.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?(a.mode&1?r.data==="$!"?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(ae=F.children,r=F.fallback,J?(F=a.mode,J=a.child,ae={mode:"hidden",children:ae},!(F&1)&&J!==null?(J.childLanes=0,J.pendingProps=ae):J=zh(ae,F,0,null),r=Ns(r,F,C,null),J.return=a,r.return=a,J.sibling=r,a.child=J,a.child.memoizedState=be(C),a.memoizedState=ke,r):Je(a,ae));if(V=r.memoizedState,V!==null&&(fe=V.dehydrated,fe!==null))return Rt(r,a,ae,F,fe,V,C);if(J){J=F.fallback,ae=a.mode,V=r.child,fe=V.sibling;var ge={mode:"hidden",children:F.children};return!(ae&1)&&a.child!==V?(F=a.child,F.childLanes=0,F.pendingProps=ge,a.deletions=null):(F=Bl(V,ge),F.subtreeFlags=V.subtreeFlags&14680064),fe!==null?J=Bl(fe,J):(J=Ns(J,ae,C,null),J.flags|=2),J.return=a,F.return=a,F.sibling=J,a.child=F,F=J,J=a.child,ae=r.child.memoizedState,ae=ae===null?be(C):{baseLanes:ae.baseLanes|C,cachePool:null,transitions:ae.transitions},J.memoizedState=ae,J.childLanes=r.childLanes&~C,a.memoizedState=ke,F}return J=r.child,r=J.sibling,F=Bl(J,{mode:"visible",children:F.children}),!(a.mode&1)&&(F.lanes=C),F.return=a,F.sibling=null,r!==null&&(C=a.deletions,C===null?(a.deletions=[r],a.flags|=16):C.push(r)),a.child=F,a.memoizedState=null,F}function Je(r,a){return a=zh({mode:"visible",children:a},r.mode,0,null),a.return=r,r.child=a}function pt(r,a,C,F){return F!==null&&Es(F),Do(a,r.child,null,C),r=Je(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function Rt(r,a,C,F,V,J,ae){if(C)return a.flags&256?(a.flags&=-257,F=Gu(Error(t(422))),pt(r,a,ae,F)):a.memoizedState!==null?(a.child=r.child,a.flags|=128,null):(J=F.fallback,V=a.mode,F=zh({mode:"visible",children:F.children},V,0,null),J=Ns(J,V,ae,null),J.flags|=2,F.return=a,J.return=a,F.sibling=J,a.child=F,a.mode&1&&Do(a,r.child,null,ae),a.child.memoizedState=be(ae),a.memoizedState=ke,J);if(!(a.mode&1))return pt(r,a,ae,null);if(V.data==="$!"){if(F=V.nextSibling&&V.nextSibling.dataset,F)var fe=F.dgst;return F=fe,J=Error(t(419)),F=Gu(J,F,void 0),pt(r,a,ae,F)}if(fe=(ae&r.childLanes)!==0,ne||fe){if(F=yr,F!==null){switch(ae&-ae){case 4:V=2;break;case 16:V=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:V=32;break;case 536870912:V=268435456;break;default:V=0}V=V&(F.suspendedLanes|ae)?0:V,V!==0&&V!==J.retryLane&&(J.retryLane=V,ei(r,V),ya(F,r,V,-1))}return gg(),F=Gu(Error(t(421))),pt(r,a,ae,F)}return V.data==="$?"?(a.flags|=128,a.child=r.child,a=F4.bind(null,r),V._reactRetry=a,null):(r=J.treeContext,Xe=zi(V.nextSibling),Zr=a,Zt=!0,Qr=null,r!==null&&(Pr[Cr++]=Xr,Pr[Cr++]=mn,Pr[Cr++]=Za,Xr=r.id,mn=r.overflow,Za=a),a=Je(a,F.children),a.flags|=4096,a)}function xt(r,a,C){r.lanes|=a;var F=r.alternate;F!==null&&(F.lanes|=a),Lu(r.return,a,C)}function Ut(r,a,C,F,V){var J=r.memoizedState;J===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:F,tail:C,tailMode:V}:(J.isBackwards=a,J.rendering=null,J.renderingStartTime=0,J.last=F,J.tail=C,J.tailMode=V)}function Un(r,a,C){var F=a.pendingProps,V=F.revealOrder,J=F.tail;if(le(r,a,F.children,C),F=ln.current,F&2)F=F&1|2,a.flags|=128;else{if(r!==null&&r.flags&128)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xt(r,C,a);else if(r.tag===19)xt(r,C,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}F&=1}if(tn(ln,F),!(a.mode&1))a.memoizedState=null;else switch(V){case"forwards":for(C=a.child,V=null;C!==null;)r=C.alternate,r!==null&&xl(r)===null&&(V=C),C=C.sibling;C=V,C===null?(V=a.child,a.child=null):(V=C.sibling,C.sibling=null),Ut(a,!1,V,C,J);break;case"backwards":for(C=null,V=a.child,a.child=null;V!==null;){if(r=V.alternate,r!==null&&xl(r)===null){a.child=V;break}r=V.sibling,V.sibling=C,C=V,V=r}Ut(a,!0,C,null,J);break;case"together":Ut(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function zt(r,a){!(a.mode&1)&&r!==null&&(r.alternate=null,a.alternate=null,a.flags|=2)}function vr(r,a,C){if(r!==null&&(a.dependencies=r.dependencies),Ts|=a.lanes,!(C&a.childLanes))return null;if(r!==null&&a.child!==r.child)throw Error(t(153));if(a.child!==null){for(r=a.child,C=Bl(r,r.pendingProps),a.child=C,C.return=a;r.sibling!==null;)r=r.sibling,C=C.sibling=Bl(r,r.pendingProps),C.return=a;C.sibling=null}return a.child}function eg(r,a,C){switch(a.tag){case 3:Tr(a),Io();break;case 5:Ol(a);break;case 1:hr(a.type)&&Ro(a);break;case 4:Qa(a,a.stateNode.containerInfo);break;case 10:var F=a.type._context,V=a.memoizedProps.value;tn(Os,F._currentValue),F._currentValue=V;break;case 13:if(F=a.memoizedState,F!==null)return F.dehydrated!==null?(tn(ln,ln.current&1),a.flags|=128,null):C&a.child.childLanes?Ne(r,a,C):(tn(ln,ln.current&1),r=vr(r,a,C),r!==null?r.sibling:null);tn(ln,ln.current&1);break;case 19:if(F=(C&a.childLanes)!==0,r.flags&128){if(F)return Un(r,a,C);a.flags|=128}if(V=a.memoizedState,V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),tn(ln,ln.current),F)break;return null;case 22:case 23:return a.lanes=0,it(r,a,C)}return vr(r,a,C)}var Bm,tg,Um,qm;Bm=function(r,a){for(var C=a.child;C!==null;){if(C.tag===5||C.tag===6)r.appendChild(C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===a)break;for(;C.sibling===null;){if(C.return===null||C.return===a)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},tg=function(){},Um=function(r,a,C,F){var V=r.memoizedProps;if(V!==F){r=a.stateNode,zn(nn.current);var J=null;switch(C){case"input":V=pe(r,V),F=pe(r,F),J=[];break;case"select":V=z({},V,{value:void 0}),F=z({},F,{value:void 0}),J=[];break;case"textarea":V=ue(r,V),F=ue(r,F),J=[];break;default:typeof V.onClick!="function"&&typeof F.onClick=="function"&&(r.onclick=Co)}Se(C,F);var ae;C=null;for(Ae in V)if(!F.hasOwnProperty(Ae)&&V.hasOwnProperty(Ae)&&V[Ae]!=null)if(Ae==="style"){var fe=V[Ae];for(ae in fe)fe.hasOwnProperty(ae)&&(C||(C={}),C[ae]="")}else Ae!=="dangerouslySetInnerHTML"&&Ae!=="children"&&Ae!=="suppressContentEditableWarning"&&Ae!=="suppressHydrationWarning"&&Ae!=="autoFocus"&&(o.hasOwnProperty(Ae)?J||(J=[]):(J=J||[]).push(Ae,null));for(Ae in F){var ge=F[Ae];if(fe=V!=null?V[Ae]:void 0,F.hasOwnProperty(Ae)&&ge!==fe&&(ge!=null||fe!=null))if(Ae==="style")if(fe){for(ae in fe)!fe.hasOwnProperty(ae)||ge&&ge.hasOwnProperty(ae)||(C||(C={}),C[ae]="");for(ae in ge)ge.hasOwnProperty(ae)&&fe[ae]!==ge[ae]&&(C||(C={}),C[ae]=ge[ae])}else C||(J||(J=[]),J.push(Ae,C)),C=ge;else Ae==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,fe=fe?fe.__html:void 0,ge!=null&&fe!==ge&&(J=J||[]).push(Ae,ge)):Ae==="children"?typeof ge!="string"&&typeof ge!="number"||(J=J||[]).push(Ae,""+ge):Ae!=="suppressContentEditableWarning"&&Ae!=="suppressHydrationWarning"&&(o.hasOwnProperty(Ae)?(ge!=null&&Ae==="onScroll"&&an("scroll",r),J||fe===ge||(J=[])):(J=J||[]).push(Ae,ge))}C&&(J=J||[]).push("style",C);var Ae=J;(a.updateQueue=Ae)&&(a.flags|=4)}},qm=function(r,a,C,F){C!==F&&(a.flags|=4)};function cf(r,a){if(!Zt)switch(r.tailMode){case"hidden":a=r.tail;for(var C=null;a!==null;)a.alternate!==null&&(C=a),a=a.sibling;C===null?r.tail=null:C.sibling=null;break;case"collapsed":C=r.tail;for(var F=null;C!==null;)C.alternate!==null&&(F=C),C=C.sibling;F===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:F.sibling=null}}function qr(r){var a=r.alternate!==null&&r.alternate.child===r.child,C=0,F=0;if(a)for(var V=r.child;V!==null;)C|=V.lanes|V.childLanes,F|=V.subtreeFlags&14680064,F|=V.flags&14680064,V.return=r,V=V.sibling;else for(V=r.child;V!==null;)C|=V.lanes|V.childLanes,F|=V.subtreeFlags,F|=V.flags,V.return=r,V=V.sibling;return r.subtreeFlags|=F,r.childLanes=C,a}function C4(r,a,C){var F=a.pendingProps;switch(Kn(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qr(a),null;case 1:return hr(a.type)&&vl(),qr(a),null;case 3:return F=a.stateNode,yn(),on(dr),on(ir),pr(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(r===null||r.child===null)&&(Ss(a)?a.flags|=4:r===null||r.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Qr!==null&&(dg(Qr),Qr=null))),tg(r,a),qr(a),null;case 5:ha(a);var V=zn(An.current);if(C=a.type,r!==null&&a.stateNode!=null)Um(r,a,C,F,V),r.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!F){if(a.stateNode===null)throw Error(t(166));return qr(a),null}if(r=zn(nn.current),Ss(a)){F=a.stateNode,C=a.type;var J=a.memoizedProps;switch(F[ui]=a,F[bs]=J,r=(a.mode&1)!==0,C){case"dialog":an("cancel",F),an("close",F);break;case"iframe":case"object":case"embed":an("load",F);break;case"video":case"audio":for(V=0;V<Ga.length;V++)an(Ga[V],F);break;case"source":an("error",F);break;case"img":case"image":case"link":an("error",F),an("load",F);break;case"details":an("toggle",F);break;case"input":Oe(F,J),an("invalid",F);break;case"select":F._wrapperState={wasMultiple:!!J.multiple},an("invalid",F);break;case"textarea":me(F,J),an("invalid",F)}Se(C,J),V=null;for(var ae in J)if(J.hasOwnProperty(ae)){var fe=J[ae];ae==="children"?typeof fe=="string"?F.textContent!==fe&&(J.suppressHydrationWarning!==!0&&vs(F.textContent,fe,r),V=["children",fe]):typeof fe=="number"&&F.textContent!==""+fe&&(J.suppressHydrationWarning!==!0&&vs(F.textContent,fe,r),V=["children",""+fe]):o.hasOwnProperty(ae)&&fe!=null&&ae==="onScroll"&&an("scroll",F)}switch(C){case"input":oe(F),ce(F,J,!0);break;case"textarea":oe(F),je(F);break;case"select":case"option":break;default:typeof J.onClick=="function"&&(F.onclick=Co)}F=V,a.updateQueue=F,F!==null&&(a.flags|=4)}else{ae=V.nodeType===9?V:V.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=ot(C)),r==="http://www.w3.org/1999/xhtml"?C==="script"?(r=ae.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof F.is=="string"?r=ae.createElement(C,{is:F.is}):(r=ae.createElement(C),C==="select"&&(ae=r,F.multiple?ae.multiple=!0:F.size&&(ae.size=F.size))):r=ae.createElementNS(r,C),r[ui]=a,r[bs]=F,Bm(r,a,!1,!1),a.stateNode=r;e:{switch(ae=gt(C,F),C){case"dialog":an("cancel",r),an("close",r),V=F;break;case"iframe":case"object":case"embed":an("load",r),V=F;break;case"video":case"audio":for(V=0;V<Ga.length;V++)an(Ga[V],r);V=F;break;case"source":an("error",r),V=F;break;case"img":case"image":case"link":an("error",r),an("load",r),V=F;break;case"details":an("toggle",r),V=F;break;case"input":Oe(r,F),V=pe(r,F),an("invalid",r);break;case"option":V=F;break;case"select":r._wrapperState={wasMultiple:!!F.multiple},V=z({},F,{value:void 0}),an("invalid",r);break;case"textarea":me(r,F),V=ue(r,F),an("invalid",r);break;default:V=F}Se(C,V),fe=V;for(J in fe)if(fe.hasOwnProperty(J)){var ge=fe[J];J==="style"?Ct(r,ge):J==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ge!=null&&Ke(r,ge)):J==="children"?typeof ge=="string"?(C!=="textarea"||ge!=="")&&ze(r,ge):typeof ge=="number"&&ze(r,""+ge):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(o.hasOwnProperty(J)?ge!=null&&J==="onScroll"&&an("scroll",r):ge!=null&&v(r,J,ge,ae))}switch(C){case"input":oe(r),ce(r,F,!1);break;case"textarea":oe(r),je(r);break;case"option":F.value!=null&&r.setAttribute("value",""+te(F.value));break;case"select":r.multiple=!!F.multiple,J=F.value,J!=null?Le(r,!!F.multiple,J,!1):F.defaultValue!=null&&Le(r,!!F.multiple,F.defaultValue,!0);break;default:typeof V.onClick=="function"&&(r.onclick=Co)}switch(C){case"button":case"input":case"select":case"textarea":F=!!F.autoFocus;break e;case"img":F=!0;break e;default:F=!1}}F&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return qr(a),null;case 6:if(r&&a.stateNode!=null)qm(r,a,r.memoizedProps,F);else{if(typeof F!="string"&&a.stateNode===null)throw Error(t(166));if(C=zn(An.current),zn(nn.current),Ss(a)){if(F=a.stateNode,C=a.memoizedProps,F[ui]=a,(J=F.nodeValue!==C)&&(r=Zr,r!==null))switch(r.tag){case 3:vs(F.nodeValue,C,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&vs(F.nodeValue,C,(r.mode&1)!==0)}J&&(a.flags|=4)}else F=(C.nodeType===9?C:C.ownerDocument).createTextNode(F),F[ui]=a,a.stateNode=F}return qr(a),null;case 13:if(on(ln),F=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Zt&&Xe!==null&&a.mode&1&&!(a.flags&128))Qc(),Io(),a.flags|=98560,J=!1;else if(J=Ss(a),F!==null&&F.dehydrated!==null){if(r===null){if(!J)throw Error(t(318));if(J=a.memoizedState,J=J!==null?J.dehydrated:null,!J)throw Error(t(317));J[ui]=a}else Io(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;qr(a),J=!1}else Qr!==null&&(dg(Qr),Qr=null),J=!0;if(!J)return a.flags&65536?a:null}return a.flags&128?(a.lanes=C,a):(F=F!==null,F!==(r!==null&&r.memoizedState!==null)&&F&&(a.child.flags|=8192,a.mode&1&&(r===null||ln.current&1?or===0&&(or=3):gg())),a.updateQueue!==null&&(a.flags|=4),qr(a),null);case 4:return yn(),tg(r,a),r===null&&xo(a.stateNode.containerInfo),qr(a),null;case 10:return Mu(a.type._context),qr(a),null;case 17:return hr(a.type)&&vl(),qr(a),null;case 19:if(on(ln),J=a.memoizedState,J===null)return qr(a),null;if(F=(a.flags&128)!==0,ae=J.rendering,ae===null)if(F)cf(J,!1);else{if(or!==0||r!==null&&r.flags&128)for(r=a.child;r!==null;){if(ae=xl(r),ae!==null){for(a.flags|=128,cf(J,!1),F=ae.updateQueue,F!==null&&(a.updateQueue=F,a.flags|=4),a.subtreeFlags=0,F=C,C=a.child;C!==null;)J=C,r=F,J.flags&=14680066,ae=J.alternate,ae===null?(J.childLanes=0,J.lanes=r,J.child=null,J.subtreeFlags=0,J.memoizedProps=null,J.memoizedState=null,J.updateQueue=null,J.dependencies=null,J.stateNode=null):(J.childLanes=ae.childLanes,J.lanes=ae.lanes,J.child=ae.child,J.subtreeFlags=0,J.deletions=null,J.memoizedProps=ae.memoizedProps,J.memoizedState=ae.memoizedState,J.updateQueue=ae.updateQueue,J.type=ae.type,r=ae.dependencies,J.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),C=C.sibling;return tn(ln,ln.current&1|2),a.child}r=r.sibling}J.tail!==null&&en()>Wu&&(a.flags|=128,F=!0,cf(J,!1),a.lanes=4194304)}else{if(!F)if(r=xl(ae),r!==null){if(a.flags|=128,F=!0,C=r.updateQueue,C!==null&&(a.updateQueue=C,a.flags|=4),cf(J,!0),J.tail===null&&J.tailMode==="hidden"&&!ae.alternate&&!Zt)return qr(a),null}else 2*en()-J.renderingStartTime>Wu&&C!==1073741824&&(a.flags|=128,F=!0,cf(J,!1),a.lanes=4194304);J.isBackwards?(ae.sibling=a.child,a.child=ae):(C=J.last,C!==null?C.sibling=ae:a.child=ae,J.last=ae)}return J.tail!==null?(a=J.tail,J.rendering=a,J.tail=a.sibling,J.renderingStartTime=en(),a.sibling=null,C=ln.current,tn(ln,F?C&1|2:C&1),a):(qr(a),null);case 22:case 23:return pg(),F=a.memoizedState!==null,r!==null&&r.memoizedState!==null!==F&&(a.flags|=8192),F&&a.mode&1?ki&1073741824&&(qr(a),a.subtreeFlags&6&&(a.flags|=8192)):qr(a),null;case 24:return null;case 25:return null}throw Error(t(156,a.tag))}function k4(r,a){switch(Kn(a),a.tag){case 1:return hr(a.type)&&vl(),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return yn(),on(dr),on(ir),pr(),r=a.flags,r&65536&&!(r&128)?(a.flags=r&-65537|128,a):null;case 5:return ha(a),null;case 13:if(on(ln),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(t(340));Io()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return on(ln),null;case 4:return yn(),null;case 10:return Mu(a.type._context),null;case 22:case 23:return pg(),null;case 24:return null;default:return null}}var kh=!1,Hr=!1,A4=typeof WeakSet=="function"?WeakSet:Set,at=null;function Vu(r,a){var C=r.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(F){Nn(r,a,F)}else C.current=null}function ng(r,a,C){try{C()}catch(F){Nn(r,a,F)}}var Hm=!1;function T4(r,a){if($c=iu,r=jn(),hl(r)){if("selectionStart"in r)var C={start:r.selectionStart,end:r.selectionEnd};else e:{C=(C=r.ownerDocument)&&C.defaultView||window;var F=C.getSelection&&C.getSelection();if(F&&F.rangeCount!==0){C=F.anchorNode;var V=F.anchorOffset,J=F.focusNode;F=F.focusOffset;try{C.nodeType,J.nodeType}catch{C=null;break e}var ae=0,fe=-1,ge=-1,Ae=0,qe=0,He=r,Ue=null;t:for(;;){for(var tt;He!==C||V!==0&&He.nodeType!==3||(fe=ae+V),He!==J||F!==0&&He.nodeType!==3||(ge=ae+F),He.nodeType===3&&(ae+=He.nodeValue.length),(tt=He.firstChild)!==null;)Ue=He,He=tt;for(;;){if(He===r)break t;if(Ue===C&&++Ae===V&&(fe=ae),Ue===J&&++qe===F&&(ge=ae),(tt=He.nextSibling)!==null)break;He=Ue,Ue=He.parentNode}He=tt}C=fe===-1||ge===-1?null:{start:fe,end:ge}}else C=null}C=C||{start:0,end:0}}else C=null;for(Wc={focusedElem:r,selectionRange:C},iu=!1,at=a;at!==null;)if(a=at,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,at=r;else for(;at!==null;){a=at;try{var lt=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(lt!==null){var ut=lt.memoizedProps,qn=lt.memoizedState,Ee=a.stateNode,ve=Ee.getSnapshotBeforeUpdate(a.elementType===a.type?ut:ar(a.type,ut),qn);Ee.__reactInternalSnapshotBeforeUpdate=ve}break;case 3:var Pe=a.stateNode.containerInfo;Pe.nodeType===1?Pe.textContent="":Pe.nodeType===9&&Pe.documentElement&&Pe.removeChild(Pe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch($e){Nn(a,a.return,$e)}if(r=a.sibling,r!==null){r.return=a.return,at=r;break}at=a.return}return lt=Hm,Hm=!1,lt}function ff(r,a,C){var F=a.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var V=F=F.next;do{if((V.tag&r)===r){var J=V.destroy;V.destroy=void 0,J!==void 0&&ng(a,C,J)}V=V.next}while(V!==F)}}function Ah(r,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var C=a=a.next;do{if((C.tag&r)===r){var F=C.create;C.destroy=F()}C=C.next}while(C!==a)}}function rg(r){var a=r.ref;if(a!==null){var C=r.stateNode;switch(r.tag){case 5:r=C;break;default:r=C}typeof a=="function"?a(r):a.current=r}}function Gm(r){var a=r.alternate;a!==null&&(r.alternate=null,Gm(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&(delete a[ui],delete a[bs],delete a[Ou],delete a[hh],delete a[ph])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Vm(r){return r.tag===5||r.tag===3||r.tag===4}function $m(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Vm(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function ig(r,a,C){var F=r.tag;if(F===5||F===6)r=r.stateNode,a?C.nodeType===8?C.parentNode.insertBefore(r,a):C.insertBefore(r,a):(C.nodeType===8?(a=C.parentNode,a.insertBefore(r,C)):(a=C,a.appendChild(r)),C=C._reactRootContainer,C!=null||a.onclick!==null||(a.onclick=Co));else if(F!==4&&(r=r.child,r!==null))for(ig(r,a,C),r=r.sibling;r!==null;)ig(r,a,C),r=r.sibling}function ag(r,a,C){var F=r.tag;if(F===5||F===6)r=r.stateNode,a?C.insertBefore(r,a):C.appendChild(r);else if(F!==4&&(r=r.child,r!==null))for(ag(r,a,C),r=r.sibling;r!==null;)ag(r,a,C),r=r.sibling}var Rr=null,ma=!1;function Il(r,a,C){for(C=C.child;C!==null;)Wm(r,a,C),C=C.sibling}function Wm(r,a,C){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(ra,C)}catch{}switch(C.tag){case 5:Hr||Vu(C,a);case 6:var F=Rr,V=ma;Rr=null,Il(r,a,C),Rr=F,ma=V,Rr!==null&&(ma?(r=Rr,C=C.stateNode,r.nodeType===8?r.parentNode.removeChild(C):r.removeChild(C)):Rr.removeChild(C.stateNode));break;case 18:Rr!==null&&(ma?(r=Rr,C=C.stateNode,r.nodeType===8?Eu(r.parentNode,C):r.nodeType===1&&Eu(r,C),Fr(r)):Eu(Rr,C.stateNode));break;case 4:F=Rr,V=ma,Rr=C.stateNode.containerInfo,ma=!0,Il(r,a,C),Rr=F,ma=V;break;case 0:case 11:case 14:case 15:if(!Hr&&(F=C.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){V=F=F.next;do{var J=V,ae=J.destroy;J=J.tag,ae!==void 0&&(J&2||J&4)&&ng(C,a,ae),V=V.next}while(V!==F)}Il(r,a,C);break;case 1:if(!Hr&&(Vu(C,a),F=C.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=C.memoizedProps,F.state=C.memoizedState,F.componentWillUnmount()}catch(fe){Nn(C,a,fe)}Il(r,a,C);break;case 21:Il(r,a,C);break;case 22:C.mode&1?(Hr=(F=Hr)||C.memoizedState!==null,Il(r,a,C),Hr=F):Il(r,a,C);break;default:Il(r,a,C)}}function Ym(r){var a=r.updateQueue;if(a!==null){r.updateQueue=null;var C=r.stateNode;C===null&&(C=r.stateNode=new A4),a.forEach(function(F){var V=z4.bind(null,r,F);C.has(F)||(C.add(F),F.then(V,V))})}}function va(r,a){var C=a.deletions;if(C!==null)for(var F=0;F<C.length;F++){var V=C[F];try{var J=r,ae=a,fe=ae;e:for(;fe!==null;){switch(fe.tag){case 5:Rr=fe.stateNode,ma=!1;break e;case 3:Rr=fe.stateNode.containerInfo,ma=!0;break e;case 4:Rr=fe.stateNode.containerInfo,ma=!0;break e}fe=fe.return}if(Rr===null)throw Error(t(160));Wm(J,ae,V),Rr=null,ma=!1;var ge=V.alternate;ge!==null&&(ge.return=null),V.return=null}catch(Ae){Nn(V,a,Ae)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)Km(a,r),a=a.sibling}function Km(r,a){var C=r.alternate,F=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(va(a,r),ro(r),F&4){try{ff(3,r,r.return),Ah(3,r)}catch(ut){Nn(r,r.return,ut)}try{ff(5,r,r.return)}catch(ut){Nn(r,r.return,ut)}}break;case 1:va(a,r),ro(r),F&512&&C!==null&&Vu(C,C.return);break;case 5:if(va(a,r),ro(r),F&512&&C!==null&&Vu(C,C.return),r.flags&32){var V=r.stateNode;try{ze(V,"")}catch(ut){Nn(r,r.return,ut)}}if(F&4&&(V=r.stateNode,V!=null)){var J=r.memoizedProps,ae=C!==null?C.memoizedProps:J,fe=r.type,ge=r.updateQueue;if(r.updateQueue=null,ge!==null)try{fe==="input"&&J.type==="radio"&&J.name!=null&&_e(V,J),gt(fe,ae);var Ae=gt(fe,J);for(ae=0;ae<ge.length;ae+=2){var qe=ge[ae],He=ge[ae+1];qe==="style"?Ct(V,He):qe==="dangerouslySetInnerHTML"?Ke(V,He):qe==="children"?ze(V,He):v(V,qe,He,Ae)}switch(fe){case"input":Te(V,J);break;case"textarea":xe(V,J);break;case"select":var Ue=V._wrapperState.wasMultiple;V._wrapperState.wasMultiple=!!J.multiple;var tt=J.value;tt!=null?Le(V,!!J.multiple,tt,!1):Ue!==!!J.multiple&&(J.defaultValue!=null?Le(V,!!J.multiple,J.defaultValue,!0):Le(V,!!J.multiple,J.multiple?[]:"",!1))}V[bs]=J}catch(ut){Nn(r,r.return,ut)}}break;case 6:if(va(a,r),ro(r),F&4){if(r.stateNode===null)throw Error(t(162));V=r.stateNode,J=r.memoizedProps;try{V.nodeValue=J}catch(ut){Nn(r,r.return,ut)}}break;case 3:if(va(a,r),ro(r),F&4&&C!==null&&C.memoizedState.isDehydrated)try{Fr(a.containerInfo)}catch(ut){Nn(r,r.return,ut)}break;case 4:va(a,r),ro(r);break;case 13:va(a,r),ro(r),V=r.child,V.flags&8192&&(J=V.memoizedState!==null,V.stateNode.isHidden=J,!J||V.alternate!==null&&V.alternate.memoizedState!==null||(sg=en())),F&4&&Ym(r);break;case 22:if(qe=C!==null&&C.memoizedState!==null,r.mode&1?(Hr=(Ae=Hr)||qe,va(a,r),Hr=Ae):va(a,r),ro(r),F&8192){if(Ae=r.memoizedState!==null,(r.stateNode.isHidden=Ae)&&!qe&&r.mode&1)for(at=r,qe=r.child;qe!==null;){for(He=at=qe;at!==null;){switch(Ue=at,tt=Ue.child,Ue.tag){case 0:case 11:case 14:case 15:ff(4,Ue,Ue.return);break;case 1:Vu(Ue,Ue.return);var lt=Ue.stateNode;if(typeof lt.componentWillUnmount=="function"){F=Ue,C=Ue.return;try{a=F,lt.props=a.memoizedProps,lt.state=a.memoizedState,lt.componentWillUnmount()}catch(ut){Nn(F,C,ut)}}break;case 5:Vu(Ue,Ue.return);break;case 22:if(Ue.memoizedState!==null){Qm(He);continue}}tt!==null?(tt.return=Ue,at=tt):Qm(He)}qe=qe.sibling}e:for(qe=null,He=r;;){if(He.tag===5){if(qe===null){qe=He;try{V=He.stateNode,Ae?(J=V.style,typeof J.setProperty=="function"?J.setProperty("display","none","important"):J.display="none"):(fe=He.stateNode,ge=He.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null,fe.style.display=bt("display",ae))}catch(ut){Nn(r,r.return,ut)}}}else if(He.tag===6){if(qe===null)try{He.stateNode.nodeValue=Ae?"":He.memoizedProps}catch(ut){Nn(r,r.return,ut)}}else if((He.tag!==22&&He.tag!==23||He.memoizedState===null||He===r)&&He.child!==null){He.child.return=He,He=He.child;continue}if(He===r)break e;for(;He.sibling===null;){if(He.return===null||He.return===r)break e;qe===He&&(qe=null),He=He.return}qe===He&&(qe=null),He.sibling.return=He.return,He=He.sibling}}break;case 19:va(a,r),ro(r),F&4&&Ym(r);break;case 21:break;default:va(a,r),ro(r)}}function ro(r){var a=r.flags;if(a&2){try{e:{for(var C=r.return;C!==null;){if(Vm(C)){var F=C;break e}C=C.return}throw Error(t(160))}switch(F.tag){case 5:var V=F.stateNode;F.flags&32&&(ze(V,""),F.flags&=-33);var J=$m(r);ag(r,J,V);break;case 3:case 4:var ae=F.stateNode.containerInfo,fe=$m(r);ig(r,fe,ae);break;default:throw Error(t(161))}}catch(ge){Nn(r,r.return,ge)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function R4(r,a,C){at=r,Xm(r)}function Xm(r,a,C){for(var F=(r.mode&1)!==0;at!==null;){var V=at,J=V.child;if(V.tag===22&&F){var ae=V.memoizedState!==null||kh;if(!ae){var fe=V.alternate,ge=fe!==null&&fe.memoizedState!==null||Hr;fe=kh;var Ae=Hr;if(kh=ae,(Hr=ge)&&!Ae)for(at=V;at!==null;)ae=at,ge=ae.child,ae.tag===22&&ae.memoizedState!==null?Jm(V):ge!==null?(ge.return=ae,at=ge):Jm(V);for(;J!==null;)at=J,Xm(J),J=J.sibling;at=V,kh=fe,Hr=Ae}Zm(r)}else V.subtreeFlags&8772&&J!==null?(J.return=V,at=J):Zm(r)}}function Zm(r){for(;at!==null;){var a=at;if(a.flags&8772){var C=a.alternate;try{if(a.flags&8772)switch(a.tag){case 0:case 11:case 15:Hr||Ah(5,a);break;case 1:var F=a.stateNode;if(a.flags&4&&!Hr)if(C===null)F.componentDidMount();else{var V=a.elementType===a.type?C.memoizedProps:ar(a.type,C.memoizedProps);F.componentDidUpdate(V,C.memoizedState,F.__reactInternalSnapshotBeforeUpdate)}var J=a.updateQueue;J!==null&&Pn(a,J,F);break;case 3:var ae=a.updateQueue;if(ae!==null){if(C=null,a.child!==null)switch(a.child.tag){case 5:C=a.child.stateNode;break;case 1:C=a.child.stateNode}Pn(a,ae,C)}break;case 5:var fe=a.stateNode;if(C===null&&a.flags&4){C=fe;var ge=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":ge.autoFocus&&C.focus();break;case"img":ge.src&&(C.src=ge.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var Ae=a.alternate;if(Ae!==null){var qe=Ae.memoizedState;if(qe!==null){var He=qe.dehydrated;He!==null&&Fr(He)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Hr||a.flags&512&&rg(a)}catch(Ue){Nn(a,a.return,Ue)}}if(a===r){at=null;break}if(C=a.sibling,C!==null){C.return=a.return,at=C;break}at=a.return}}function Qm(r){for(;at!==null;){var a=at;if(a===r){at=null;break}var C=a.sibling;if(C!==null){C.return=a.return,at=C;break}at=a.return}}function Jm(r){for(;at!==null;){var a=at;try{switch(a.tag){case 0:case 11:case 15:var C=a.return;try{Ah(4,a)}catch(ge){Nn(a,C,ge)}break;case 1:var F=a.stateNode;if(typeof F.componentDidMount=="function"){var V=a.return;try{F.componentDidMount()}catch(ge){Nn(a,V,ge)}}var J=a.return;try{rg(a)}catch(ge){Nn(a,J,ge)}break;case 5:var ae=a.return;try{rg(a)}catch(ge){Nn(a,ae,ge)}}}catch(ge){Nn(a,a.return,ge)}if(a===r){at=null;break}var fe=a.sibling;if(fe!==null){fe.return=a.return,at=fe;break}at=a.return}}var M4=Math.ceil,Th=y.ReactCurrentDispatcher,og=y.ReactCurrentOwner,Yi=y.ReactCurrentBatchConfig,$t=0,yr=null,Xn=null,Mr=0,ki=0,$u=ca(0),or=0,df=null,Ts=0,Rh=0,lg=0,hf=null,di=null,sg=0,Wu=1/0,Bo=null,Mh=!1,ug=null,Dl=null,Lh=!1,jl=null,Nh=0,pf=0,cg=null,Ih=-1,Dh=0;function ni(){return $t&6?en():Ih!==-1?Ih:Ih=en()}function Fl(r){return r.mode&1?$t&2&&Mr!==0?Mr&-Mr:Jc.transition!==null?(Dh===0&&(Dh=Oc()),Dh):(r=Ht,r!==0||(r=window.event,r=r===void 0?16:Xd(r.type)),r):1}function ya(r,a,C,F){if(50<pf)throw pf=0,cg=null,Error(t(185));is(r,C,F),(!($t&2)||r!==yr)&&(r===yr&&(!($t&2)&&(Rh|=C),or===4&&zl(r,Mr)),hi(r,F),C===1&&$t===0&&!(a.mode&1)&&(Wu=en()+500,yl&&Ya()))}function hi(r,a){var C=r.callbackNode;Vd(r,a);var F=po(r,r===yr?Mr:0);if(F===0)C!==null&&Ii(C),r.callbackNode=null,r.callbackPriority=0;else if(a=F&-F,r.callbackPriority!==a){if(C!=null&&Ii(C),a===1)r.tag===0?fa(tv.bind(null,r)):ws(tv.bind(null,r)),fh(function(){!($t&6)&&Ya()}),C=null;else{switch(as(F)){case 1:C=Dr;break;case 4:C=ho;break;case 16:C=na;break;case 536870912:C=Qs;break;default:C=na}C=uv(C,ev.bind(null,r))}r.callbackPriority=a,r.callbackNode=C}}function ev(r,a){if(Ih=-1,Dh=0,$t&6)throw Error(t(327));var C=r.callbackNode;if(Yu()&&r.callbackNode!==C)return null;var F=po(r,r===yr?Mr:0);if(F===0)return null;if(F&30||F&r.expiredLanes||a)a=jh(r,F);else{a=F;var V=$t;$t|=2;var J=rv();(yr!==r||Mr!==a)&&(Bo=null,Wu=en()+500,Ms(r,a));do try{I4();break}catch(fe){nv(r,fe)}while(!0);Ru(),Th.current=J,$t=V,Xn!==null?a=0:(yr=null,Mr=0,a=or)}if(a!==0){if(a===2&&(V=tl(r),V!==0&&(F=V,a=fg(r,V))),a===1)throw C=df,Ms(r,0),zl(r,F),hi(r,en()),C;if(a===6)zl(r,F);else{if(V=r.current.alternate,!(F&30)&&!L4(V)&&(a=jh(r,F),a===2&&(J=tl(r),J!==0&&(F=J,a=fg(r,J))),a===1))throw C=df,Ms(r,0),zl(r,F),hi(r,en()),C;switch(r.finishedWork=V,r.finishedLanes=F,a){case 0:case 1:throw Error(t(345));case 2:Ls(r,di,Bo);break;case 3:if(zl(r,F),(F&130023424)===F&&(a=sg+500-en(),10<a)){if(po(r,0)!==0)break;if(V=r.suspendedLanes,(V&F)!==F){ni(),r.pingedLanes|=r.suspendedLanes&V;break}r.timeoutHandle=Kr(Ls.bind(null,r,di,Bo),a);break}Ls(r,di,Bo);break;case 4:if(zl(r,F),(F&4194240)===F)break;for(a=r.eventTimes,V=-1;0<F;){var ae=31-It(F);J=1<<ae,ae=a[ae],ae>V&&(V=ae),F&=~J}if(F=V,F=en()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*M4(F/1960))-F,10<F){r.timeoutHandle=Kr(Ls.bind(null,r,di,Bo),F);break}Ls(r,di,Bo);break;case 5:Ls(r,di,Bo);break;default:throw Error(t(329))}}}return hi(r,en()),r.callbackNode===C?ev.bind(null,r):null}function fg(r,a){var C=hf;return r.current.memoizedState.isDehydrated&&(Ms(r,a).flags|=256),r=jh(r,a),r!==2&&(a=di,di=C,a!==null&&dg(a)),r}function dg(r){di===null?di=r:di.push.apply(di,r)}function L4(r){for(var a=r;;){if(a.flags&16384){var C=a.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var F=0;F<C.length;F++){var V=C[F],J=V.getSnapshot;V=V.value;try{if(!Br(J(),V))return!1}catch{return!1}}}if(C=a.child,a.subtreeFlags&16384&&C!==null)C.return=a,a=C;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function zl(r,a){for(a&=~lg,a&=~Rh,r.suspendedLanes|=a,r.pingedLanes&=~a,r=r.expirationTimes;0<a;){var C=31-It(a),F=1<<C;r[C]=-1,a&=~F}}function tv(r){if($t&6)throw Error(t(327));Yu();var a=po(r,0);if(!(a&1))return hi(r,en()),null;var C=jh(r,a);if(r.tag!==0&&C===2){var F=tl(r);F!==0&&(a=F,C=fg(r,F))}if(C===1)throw C=df,Ms(r,0),zl(r,a),hi(r,en()),C;if(C===6)throw Error(t(345));return r.finishedWork=r.current.alternate,r.finishedLanes=a,Ls(r,di,Bo),hi(r,en()),null}function hg(r,a){var C=$t;$t|=1;try{return r(a)}finally{$t=C,$t===0&&(Wu=en()+500,yl&&Ya())}}function Rs(r){jl!==null&&jl.tag===0&&!($t&6)&&Yu();var a=$t;$t|=1;var C=Yi.transition,F=Ht;try{if(Yi.transition=null,Ht=1,r)return r()}finally{Ht=F,Yi.transition=C,$t=a,!($t&6)&&Ya()}}function pg(){ki=$u.current,on($u)}function Ms(r,a){r.finishedWork=null,r.finishedLanes=0;var C=r.timeoutHandle;if(C!==-1&&(r.timeoutHandle=-1,Kc(C)),Xn!==null)for(C=Xn.return;C!==null;){var F=C;switch(Kn(F),F.tag){case 1:F=F.type.childContextTypes,F!=null&&vl();break;case 3:yn(),on(dr),on(ir),pr();break;case 5:ha(F);break;case 4:yn();break;case 13:on(ln);break;case 19:on(ln);break;case 10:Mu(F.type._context);break;case 22:case 23:pg()}C=C.return}if(yr=r,Xn=r=Bl(r.current,null),Mr=ki=a,or=0,df=null,lg=Rh=Ts=0,di=hf=null,Hi!==null){for(a=0;a<Hi.length;a++)if(C=Hi[a],F=C.interleaved,F!==null){C.interleaved=null;var V=F.next,J=C.pending;if(J!==null){var ae=J.next;J.next=V,F.next=ae}C.pending=F}Hi=null}return r}function nv(r,a){do{var C=Xn;try{if(Ru(),Pl.current=Rl,Ci){for(var F=Jt.memoizedState;F!==null;){var V=F.queue;V!==null&&(V.pending=null),F=F.next}Ci=!1}if(Ar=0,Mn=Cn=Jt=null,Ja=!1,fi=0,og.current=null,C===null||C.return===null){or=1,df=a,Xn=null;break}e:{var J=r,ae=C.return,fe=C,ge=a;if(a=Mr,fe.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Ae=ge,qe=fe,He=qe.tag;if(!(qe.mode&1)&&(He===0||He===11||He===15)){var Ue=qe.alternate;Ue?(qe.updateQueue=Ue.updateQueue,qe.memoizedState=Ue.memoizedState,qe.lanes=Ue.lanes):(qe.updateQueue=null,qe.memoizedState=null)}var tt=j(ae);if(tt!==null){tt.flags&=-257,q(tt,ae,fe,J,a),tt.mode&1&&f(J,Ae,a),a=tt,ge=Ae;var lt=a.updateQueue;if(lt===null){var ut=new Set;ut.add(ge),a.updateQueue=ut}else lt.add(ge);break e}else{if(!(a&1)){f(J,Ae,a),gg();break e}ge=Error(t(426))}}else if(Zt&&fe.mode&1){var qn=j(ae);if(qn!==null){!(qn.flags&65536)&&(qn.flags|=256),q(qn,ae,fe,J,a),Es(zo(ge,fe));break e}}J=ge=zo(ge,fe),or!==4&&(or=2),hf===null?hf=[J]:hf.push(J),J=ae;do{switch(J.tag){case 3:J.flags|=65536,a&=-a,J.lanes|=a;var Ee=Ch(J,ge,a);Cs(J,Ee);break e;case 1:fe=ge;var ve=J.type,Pe=J.stateNode;if(!(J.flags&128)&&(typeof ve.getDerivedStateFromError=="function"||Pe!==null&&typeof Pe.componentDidCatch=="function"&&(Dl===null||!Dl.has(Pe)))){J.flags|=65536,a&=-a,J.lanes|=a;var $e=u(J,fe,a);Cs(J,$e);break e}}J=J.return}while(J!==null)}av(C)}catch(ct){a=ct,Xn===C&&C!==null&&(Xn=C=C.return);continue}break}while(!0)}function rv(){var r=Th.current;return Th.current=Rl,r===null?Rl:r}function gg(){(or===0||or===3||or===2)&&(or=4),yr===null||!(Ts&268435455)&&!(Rh&268435455)||zl(yr,Mr)}function jh(r,a){var C=$t;$t|=2;var F=rv();(yr!==r||Mr!==a)&&(Bo=null,Ms(r,a));do try{N4();break}catch(V){nv(r,V)}while(!0);if(Ru(),$t=C,Th.current=F,Xn!==null)throw Error(t(261));return yr=null,Mr=0,or}function N4(){for(;Xn!==null;)iv(Xn)}function I4(){for(;Xn!==null&&!Na();)iv(Xn)}function iv(r){var a=sv(r.alternate,r,ki);r.memoizedProps=r.pendingProps,a===null?av(r):Xn=a,og.current=null}function av(r){var a=r;do{var C=a.alternate;if(r=a.return,a.flags&32768){if(C=k4(C,a),C!==null){C.flags&=32767,Xn=C;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{or=6,Xn=null;return}}else if(C=C4(C,a,ki),C!==null){Xn=C;return}if(a=a.sibling,a!==null){Xn=a;return}Xn=a=r}while(a!==null);or===0&&(or=5)}function Ls(r,a,C){var F=Ht,V=Yi.transition;try{Yi.transition=null,Ht=1,D4(r,a,C,F)}finally{Yi.transition=V,Ht=F}return null}function D4(r,a,C,F){do Yu();while(jl!==null);if($t&6)throw Error(t(327));C=r.finishedWork;var V=r.finishedLanes;if(C===null)return null;if(r.finishedWork=null,r.finishedLanes=0,C===r.current)throw Error(t(177));r.callbackNode=null,r.callbackPriority=0;var J=C.lanes|C.childLanes;if($p(r,J),r===yr&&(Xn=yr=null,Mr=0),!(C.subtreeFlags&2064)&&!(C.flags&2064)||Lh||(Lh=!0,uv(na,function(){return Yu(),null})),J=(C.flags&15990)!==0,C.subtreeFlags&15990||J){J=Yi.transition,Yi.transition=null;var ae=Ht;Ht=1;var fe=$t;$t|=4,og.current=null,T4(r,C),Km(C,r),hs(Wc),iu=!!$c,Wc=$c=null,r.current=C,R4(C),rs(),$t=fe,Ht=ae,Yi.transition=J}else r.current=C;if(Lh&&(Lh=!1,jl=r,Nh=V),J=r.pendingLanes,J===0&&(Dl=null),cn(C.stateNode),hi(r,en()),a!==null)for(F=r.onRecoverableError,C=0;C<a.length;C++)V=a[C],F(V.value,{componentStack:V.stack,digest:V.digest});if(Mh)throw Mh=!1,r=ug,ug=null,r;return Nh&1&&r.tag!==0&&Yu(),J=r.pendingLanes,J&1?r===cg?pf++:(pf=0,cg=r):pf=0,Ya(),null}function Yu(){if(jl!==null){var r=as(Nh),a=Yi.transition,C=Ht;try{if(Yi.transition=null,Ht=16>r?16:r,jl===null)var F=!1;else{if(r=jl,jl=null,Nh=0,$t&6)throw Error(t(331));var V=$t;for($t|=4,at=r.current;at!==null;){var J=at,ae=J.child;if(at.flags&16){var fe=J.deletions;if(fe!==null){for(var ge=0;ge<fe.length;ge++){var Ae=fe[ge];for(at=Ae;at!==null;){var qe=at;switch(qe.tag){case 0:case 11:case 15:ff(8,qe,J)}var He=qe.child;if(He!==null)He.return=qe,at=He;else for(;at!==null;){qe=at;var Ue=qe.sibling,tt=qe.return;if(Gm(qe),qe===Ae){at=null;break}if(Ue!==null){Ue.return=tt,at=Ue;break}at=tt}}}var lt=J.alternate;if(lt!==null){var ut=lt.child;if(ut!==null){lt.child=null;do{var qn=ut.sibling;ut.sibling=null,ut=qn}while(ut!==null)}}at=J}}if(J.subtreeFlags&2064&&ae!==null)ae.return=J,at=ae;else e:for(;at!==null;){if(J=at,J.flags&2048)switch(J.tag){case 0:case 11:case 15:ff(9,J,J.return)}var Ee=J.sibling;if(Ee!==null){Ee.return=J.return,at=Ee;break e}at=J.return}}var ve=r.current;for(at=ve;at!==null;){ae=at;var Pe=ae.child;if(ae.subtreeFlags&2064&&Pe!==null)Pe.return=ae,at=Pe;else e:for(ae=ve;at!==null;){if(fe=at,fe.flags&2048)try{switch(fe.tag){case 0:case 11:case 15:Ah(9,fe)}}catch(ct){Nn(fe,fe.return,ct)}if(fe===ae){at=null;break e}var $e=fe.sibling;if($e!==null){$e.return=fe.return,at=$e;break e}at=fe.return}}if($t=V,Ya(),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(ra,r)}catch{}F=!0}return F}finally{Ht=C,Yi.transition=a}}return!1}function ov(r,a,C){a=zo(C,a),a=Ch(r,a,1),r=$i(r,a,1),a=ni(),r!==null&&(is(r,1,a),hi(r,a))}function Nn(r,a,C){if(r.tag===3)ov(r,r,C);else for(;a!==null;){if(a.tag===3){ov(a,r,C);break}else if(a.tag===1){var F=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof F.componentDidCatch=="function"&&(Dl===null||!Dl.has(F))){r=zo(C,r),r=u(a,r,1),a=$i(a,r,1),r=ni(),a!==null&&(is(a,1,r),hi(a,r));break}}a=a.return}}function j4(r,a,C){var F=r.pingCache;F!==null&&F.delete(a),a=ni(),r.pingedLanes|=r.suspendedLanes&C,yr===r&&(Mr&C)===C&&(or===4||or===3&&(Mr&130023424)===Mr&&500>en()-sg?Ms(r,0):lg|=C),hi(r,a)}function lv(r,a){a===0&&(r.mode&1?(a=ia,ia<<=1,!(ia&130023424)&&(ia=4194304)):a=1);var C=ni();r=ei(r,a),r!==null&&(is(r,a,C),hi(r,C))}function F4(r){var a=r.memoizedState,C=0;a!==null&&(C=a.retryLane),lv(r,C)}function z4(r,a){var C=0;switch(r.tag){case 13:var F=r.stateNode,V=r.memoizedState;V!==null&&(C=V.retryLane);break;case 19:F=r.stateNode;break;default:throw Error(t(314))}F!==null&&F.delete(a),lv(r,C)}var sv;sv=function(r,a,C){if(r!==null)if(r.memoizedProps!==a.pendingProps||dr.current)ne=!0;else{if(!(r.lanes&C)&&!(a.flags&128))return ne=!1,eg(r,a,C);ne=!!(r.flags&131072)}else ne=!1,Zt&&a.flags&1048576&&mh(a,Xa,a.index);switch(a.lanes=0,a.tag){case 2:var F=a.type;zt(r,a),r=a.pendingProps;var V=To(a,ir.current);da(a,C),V=Cl(null,a,F,r,V,C);var J=kl();return a.flags|=1,typeof V=="object"&&V!==null&&typeof V.render=="function"&&V.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,hr(F)?(J=!0,Ro(a)):J=!1,a.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,Ps(a),V.updater=Ll,a.stateNode=V,V._reactInternals=a,Hu(a,F,r,C),a=Qt(null,a,F,!0,J,C)):(a.tag=0,Zt&&J&&bl(a),le(null,a,V,C),a=a.child),a;case 16:F=a.elementType;e:{switch(zt(r,a),r=a.pendingProps,V=F._init,F=V(F._payload),a.type=F,V=a.tag=U4(F),r=ar(F,r),V){case 0:a=Qe(null,a,F,r,C);break e;case 1:a=sn(null,a,F,r,C);break e;case 11:a=ye(null,a,F,r,C);break e;case 14:a=Re(null,a,F,ar(F.type,r),C);break e}throw Error(t(306,F,""))}return a;case 0:return F=a.type,V=a.pendingProps,V=a.elementType===F?V:ar(F,V),Qe(r,a,F,V,C);case 1:return F=a.type,V=a.pendingProps,V=a.elementType===F?V:ar(F,V),sn(r,a,F,V,C);case 3:e:{if(Tr(a),r===null)throw Error(t(387));F=a.pendingProps,J=a.memoizedState,V=J.element,Nu(r,a),El(a,F,null,C);var ae=a.memoizedState;if(F=ae.element,J.isDehydrated)if(J={element:F,isDehydrated:!1,cache:ae.cache,pendingSuspenseBoundaries:ae.pendingSuspenseBoundaries,transitions:ae.transitions},a.updateQueue.baseState=J,a.memoizedState=J,a.flags&256){V=zo(Error(t(423)),a),a=Wi(r,a,F,C,V);break e}else if(F!==V){V=zo(Error(t(424)),a),a=Wi(r,a,F,C,V);break e}else for(Xe=zi(a.stateNode.containerInfo.firstChild),Zr=a,Zt=!0,Qr=null,C=ci(a,null,F,C),a.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Io(),F===V){a=vr(r,a,C);break e}le(r,a,F,C)}a=a.child}return a;case 5:return Ol(a),r===null&&_l(a),F=a.type,V=a.pendingProps,J=r!==null?r.memoizedProps:null,ae=V.children,Yc(F,V)?ae=null:J!==null&&Yc(F,J)&&(a.flags|=32),Ot(r,a),le(r,a,ae,C),a.child;case 6:return r===null&&_l(a),null;case 13:return Ne(r,a,C);case 4:return Qa(a,a.stateNode.containerInfo),F=a.pendingProps,r===null?a.child=Do(a,null,F,C):le(r,a,F,C),a.child;case 11:return F=a.type,V=a.pendingProps,V=a.elementType===F?V:ar(F,V),ye(r,a,F,V,C);case 7:return le(r,a,a.pendingProps,C),a.child;case 8:return le(r,a,a.pendingProps.children,C),a.child;case 12:return le(r,a,a.pendingProps.children,C),a.child;case 10:e:{if(F=a.type._context,V=a.pendingProps,J=a.memoizedProps,ae=V.value,tn(Os,F._currentValue),F._currentValue=ae,J!==null)if(Br(J.value,ae)){if(J.children===V.children&&!dr.current){a=vr(r,a,C);break e}}else for(J=a.child,J!==null&&(J.return=a);J!==null;){var fe=J.dependencies;if(fe!==null){ae=J.child;for(var ge=fe.firstContext;ge!==null;){if(ge.context===F){if(J.tag===1){ge=Vi(-1,C&-C),ge.tag=2;var Ae=J.updateQueue;if(Ae!==null){Ae=Ae.shared;var qe=Ae.pending;qe===null?ge.next=ge:(ge.next=qe.next,qe.next=ge),Ae.pending=ge}}J.lanes|=C,ge=J.alternate,ge!==null&&(ge.lanes|=C),Lu(J.return,C,a),fe.lanes|=C;break}ge=ge.next}}else if(J.tag===10)ae=J.type===a.type?null:J.child;else if(J.tag===18){if(ae=J.return,ae===null)throw Error(t(341));ae.lanes|=C,fe=ae.alternate,fe!==null&&(fe.lanes|=C),Lu(ae,C,a),ae=J.sibling}else ae=J.child;if(ae!==null)ae.return=J;else for(ae=J;ae!==null;){if(ae===a){ae=null;break}if(J=ae.sibling,J!==null){J.return=ae.return,ae=J;break}ae=ae.return}J=ae}le(r,a,V.children,C),a=a.child}return a;case 9:return V=a.type,F=a.pendingProps.children,da(a,C),V=kr(V),F=F(V),a.flags|=1,le(r,a,F,C),a.child;case 14:return F=a.type,V=ar(F,a.pendingProps),V=ar(F.type,V),Re(r,a,F,V,C);case 15:return Ge(r,a,a.type,a.pendingProps,C);case 17:return F=a.type,V=a.pendingProps,V=a.elementType===F?V:ar(F,V),zt(r,a),a.tag=1,hr(F)?(r=!0,Ro(a)):r=!1,da(a,C),Ph(a,F,V),Hu(a,F,V,C),Qt(null,a,F,!0,r,C);case 19:return Un(r,a,C);case 22:return it(r,a,C)}throw Error(t(156,a.tag))};function uv(r,a){return Ir(r,a)}function B4(r,a,C,F){this.tag=r,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ki(r,a,C,F){return new B4(r,a,C,F)}function mg(r){return r=r.prototype,!(!r||!r.isReactComponent)}function U4(r){if(typeof r=="function")return mg(r)?1:0;if(r!=null){if(r=r.$$typeof,r===N)return 11;if(r===B)return 14}return 2}function Bl(r,a){var C=r.alternate;return C===null?(C=Ki(r.tag,a,r.key,r.mode),C.elementType=r.elementType,C.type=r.type,C.stateNode=r.stateNode,C.alternate=r,r.alternate=C):(C.pendingProps=a,C.type=r.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=r.flags&14680064,C.childLanes=r.childLanes,C.lanes=r.lanes,C.child=r.child,C.memoizedProps=r.memoizedProps,C.memoizedState=r.memoizedState,C.updateQueue=r.updateQueue,a=r.dependencies,C.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},C.sibling=r.sibling,C.index=r.index,C.ref=r.ref,C}function Fh(r,a,C,F,V,J){var ae=2;if(F=r,typeof r=="function")mg(r)&&(ae=1);else if(typeof r=="string")ae=5;else e:switch(r){case R:return Ns(C.children,V,J,a);case D:ae=8,V|=8;break;case T:return r=Ki(12,C,a,V|2),r.elementType=T,r.lanes=J,r;case k:return r=Ki(13,C,a,V),r.elementType=k,r.lanes=J,r;case L:return r=Ki(19,C,a,V),r.elementType=L,r.lanes=J,r;case K:return zh(C,V,J,a);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case S:ae=10;break e;case A:ae=9;break e;case N:ae=11;break e;case B:ae=14;break e;case X:ae=16,F=null;break e}throw Error(t(130,r==null?r:typeof r,""))}return a=Ki(ae,C,a,V),a.elementType=r,a.type=F,a.lanes=J,a}function Ns(r,a,C,F){return r=Ki(7,r,F,a),r.lanes=C,r}function zh(r,a,C,F){return r=Ki(22,r,F,a),r.elementType=K,r.lanes=C,r.stateNode={isHidden:!1},r}function vg(r,a,C){return r=Ki(6,r,null,a),r.lanes=C,r}function yg(r,a,C){return a=Ki(4,r.children!==null?r.children:[],r.key,a),a.lanes=C,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}function q4(r,a,C,F,V){this.tag=a,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gr(0),this.expirationTimes=Gr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gr(0),this.identifierPrefix=F,this.onRecoverableError=V,this.mutableSourceEagerHydrationData=null}function bg(r,a,C,F,V,J,ae,fe,ge){return r=new q4(r,a,C,fe,ge),a===1?(a=1,J===!0&&(a|=8)):a=0,J=Ki(3,null,null,a),r.current=J,J.stateNode=r,J.memoizedState={element:F,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ps(J),r}function H4(r,a,C){var F=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:F==null?null:""+F,children:r,containerInfo:a,implementation:C}}function cv(r){if(!r)return Ui;r=r._reactInternals;e:{if(Gt(r)!==r||r.tag!==1)throw Error(t(170));var a=r;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(hr(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(t(171))}if(r.tag===1){var C=r.type;if(hr(C))return Pu(r,C,a)}return a}function fv(r,a,C,F,V,J,ae,fe,ge){return r=bg(C,F,!0,r,V,J,ae,fe,ge),r.context=cv(null),C=r.current,F=ni(),V=Fl(C),J=Vi(F,V),J.callback=a??null,$i(C,J,V),r.current.lanes=V,is(r,V,F),hi(r,F),r}function Bh(r,a,C,F){var V=a.current,J=ni(),ae=Fl(V);return C=cv(C),a.context===null?a.context=C:a.pendingContext=C,a=Vi(J,ae),a.payload={element:r},F=F===void 0?null:F,F!==null&&(a.callback=F),r=$i(V,a,ae),r!==null&&(ya(r,V,ae,J),Iu(r,V,ae)),ae}function Uh(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function dv(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var C=r.retryLane;r.retryLane=C!==0&&C<a?C:a}}function _g(r,a){dv(r,a),(r=r.alternate)&&dv(r,a)}function G4(){return null}var hv=typeof reportError=="function"?reportError:function(r){console.error(r)};function wg(r){this._internalRoot=r}qh.prototype.render=wg.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(t(409));Bh(r,a,null,null)},qh.prototype.unmount=wg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;Rs(function(){Bh(null,r,null,null)}),a[Bi]=null}};function qh(r){this._internalRoot=r}qh.prototype.unstable_scheduleHydration=function(r){if(r){var a=Wd();r={blockedOn:null,target:r,priority:a};for(var C=0;C<Fi.length&&a!==0&&a<Fi[C].priority;C++);Fi.splice(C,0,r),C===0&&tu(r)}};function Sg(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Hh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function pv(){}function V4(r,a,C,F,V){if(V){if(typeof F=="function"){var J=F;F=function(){var Ae=Uh(ae);J.call(Ae)}}var ae=fv(a,F,r,0,null,!1,!1,"",pv);return r._reactRootContainer=ae,r[Bi]=ae.current,xo(r.nodeType===8?r.parentNode:r),Rs(),ae}for(;V=r.lastChild;)r.removeChild(V);if(typeof F=="function"){var fe=F;F=function(){var Ae=Uh(ge);fe.call(Ae)}}var ge=bg(r,0,!1,null,null,!1,!1,"",pv);return r._reactRootContainer=ge,r[Bi]=ge.current,xo(r.nodeType===8?r.parentNode:r),Rs(function(){Bh(a,ge,C,F)}),ge}function Gh(r,a,C,F,V){var J=C._reactRootContainer;if(J){var ae=J;if(typeof V=="function"){var fe=V;V=function(){var ge=Uh(ae);fe.call(ge)}}Bh(a,ae,r,V)}else ae=V4(C,a,r,V,F);return Uh(ae)}nl=function(r){switch(r.tag){case 3:var a=r.stateNode;if(a.current.memoizedState.isDehydrated){var C=Vn(a.pendingLanes);C!==0&&(xc(a,C|1),hi(a,en()),!($t&6)&&(Wu=en()+500,Ya()))}break;case 13:Rs(function(){var F=ei(r,1);if(F!==null){var V=ni();ya(F,r,1,V)}}),_g(r,1)}},rl=function(r){if(r.tag===13){var a=ei(r,134217728);if(a!==null){var C=ni();ya(a,r,134217728,C)}_g(r,134217728)}},$d=function(r){if(r.tag===13){var a=Fl(r),C=ei(r,a);if(C!==null){var F=ni();ya(C,r,a,F)}_g(r,a)}},Wd=function(){return Ht},Js=function(r,a){var C=Ht;try{return Ht=r,a()}finally{Ht=C}},mt=function(r,a,C){switch(a){case"input":if(Te(r,C),a=C.name,C.type==="radio"&&a!=null){for(C=r;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<C.length;a++){var F=C[a];if(F!==r&&F.form===r.form){var V=Yn(F);if(!V)throw Error(t(90));se(F),Te(F,V)}}}break;case"textarea":xe(r,C);break;case"select":a=C.value,a!=null&&Le(r,!!C.multiple,a,!1)}},De=hg,Ie=Rs;var $4={usingClientEntryPoint:!1,Events:[_s,Fn,Yn,rt,ft,hg]},gf={findFiberByHostInstance:$a,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},W4={bundleType:gf.bundleType,version:gf.version,rendererPackageName:gf.rendererPackageName,rendererConfig:gf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=En(r),r===null?null:r.stateNode},findFiberByHostInstance:gf.findFiberByHostInstance||G4,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 Vh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vh.isDisabled&&Vh.supportsFiber)try{ra=Vh.inject(W4),er=Vh}catch{}}return pi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$4,pi.createPortal=function(r,a){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Sg(a))throw Error(t(200));return H4(r,a,null,C)},pi.createRoot=function(r,a){if(!Sg(r))throw Error(t(299));var C=!1,F="",V=hv;return a!=null&&(a.unstable_strictMode===!0&&(C=!0),a.identifierPrefix!==void 0&&(F=a.identifierPrefix),a.onRecoverableError!==void 0&&(V=a.onRecoverableError)),a=bg(r,1,!1,null,null,C,!1,F,V),r[Bi]=a.current,xo(r.nodeType===8?r.parentNode:r),new wg(a)},pi.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(t(188)):(r=Object.keys(r).join(","),Error(t(268,r)));return r=En(a),r=r===null?null:r.stateNode,r},pi.flushSync=function(r){return Rs(r)},pi.hydrate=function(r,a,C){if(!Hh(a))throw Error(t(200));return Gh(null,r,a,!0,C)},pi.hydrateRoot=function(r,a,C){if(!Sg(r))throw Error(t(405));var F=C!=null&&C.hydratedSources||null,V=!1,J="",ae=hv;if(C!=null&&(C.unstable_strictMode===!0&&(V=!0),C.identifierPrefix!==void 0&&(J=C.identifierPrefix),C.onRecoverableError!==void 0&&(ae=C.onRecoverableError)),a=fv(a,null,r,1,C??null,V,!1,J,ae),r[Bi]=a.current,xo(r),F)for(r=0;r<F.length;r++)C=F[r],V=C._getVersion,V=V(C._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[C,V]:a.mutableSourceEagerHydrationData.push(C,V);return new qh(a)},pi.render=function(r,a,C){if(!Hh(a))throw Error(t(200));return Gh(null,r,a,!1,C)},pi.unmountComponentAtNode=function(r){if(!Hh(r))throw Error(t(40));return r._reactRootContainer?(Rs(function(){Gh(null,null,r,!1,function(){r._reactRootContainer=null,r[Bi]=null})}),!0):!1},pi.unstable_batchedUpdates=hg,pi.unstable_renderSubtreeIntoContainer=function(r,a,C,F){if(!Hh(C))throw Error(t(200));if(r==null||r._reactInternals===void 0)throw Error(t(38));return Gh(r,a,C,!1,F)},pi.version="18.3.1-next-f1338f8080-20240426",pi}var _v;function R3(){if(_v)return Og.exports;_v=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Og.exports=Z4(),Og.exports}var wv;function Q4(){if(wv)return $h;wv=1;var e=R3();return $h.createRoot=e.createRoot,$h.hydrateRoot=e.hydrateRoot,$h}var J4=Q4();const M3=Rd(J4);var mf={};function At(e){for(var i=arguments.length,t=new Array(i>1?i-1:0),n=1;n<i;n++)t[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var ew={};function wp(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:ew}var L3=Object.assign,lp=Object.getOwnPropertyDescriptor,lo=Object.defineProperty,Md=Object.prototype,R0=[];Object.freeze(R0);var W0={};Object.freeze(W0);var tw=typeof Proxy<"u",nw=Object.toString();function N3(){tw||At("Proxy not available")}function I3(e){var i=!1;return function(){if(!i)return i=!0,e.apply(this,arguments)}}var ec=function(){};function Li(e){return typeof e=="function"}function Us(e){var i=typeof e;switch(i){case"string":case"symbol":case"number":return!0}return!1}function Sp(e){return e!==null&&typeof e=="object"}function Zo(e){if(!Sp(e))return!1;var i=Object.getPrototypeOf(e);if(i==null)return!0;var t=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return typeof t=="function"&&t.toString()===nw}function D3(e){var i=e==null?void 0:e.constructor;return i?i.name==="GeneratorFunction"||i.displayName==="GeneratorFunction":!1}function Ld(e,i,t){lo(e,i,{enumerable:!1,writable:!0,configurable:!0,value:t})}function j3(e,i,t){lo(e,i,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Zl(e,i){var t="isMobX"+e;return i.prototype[t]=!0,function(n){return Sp(n)&&n[t]===!0}}function mc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function rw(e){var i=Object.getPrototypeOf(e),t=Object.getPrototypeOf(i),n=Object.getPrototypeOf(t);return n===null}function Wo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var F3=typeof Object.getOwnPropertySymbols<"u";function iw(e){var i=Object.keys(e);if(!F3)return i;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(i,t.filter(function(n){return Md.propertyIsEnumerable.call(e,n)})):i}var ac=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:F3?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function z3(e){return e===null?null:typeof e=="object"?""+e:e}function Yo(e,i){return Md.hasOwnProperty.call(e,i)}var aw=Object.getOwnPropertyDescriptors||function(i){var t={};return ac(i).forEach(function(n){t[n]=lp(i,n)}),t};function Ri(e,i){return!!(e&i)}function Mi(e,i,t){return t?e|=i:e&=~i,e}function Sv(e,i){(i==null||i>e.length)&&(i=e.length);for(var t=0,n=Array(i);t<i;t++)n[t]=e[t];return n}function ow(e,i){for(var t=0;t<i.length;t++){var n=i[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sw(n.key),n)}}function vc(e,i,t){return i&&ow(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function tc(e,i){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=uw(e))||i){t&&(e=t);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 Yl(){return Yl=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},Yl.apply(null,arguments)}function B3(e,i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,M0(e,i)}function M0(e,i){return M0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},M0(e,i)}function lw(e,i){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,i);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function sw(e){var i=lw(e,"string");return typeof i=="symbol"?i:i+""}function uw(e,i){if(e){if(typeof e=="string")return Sv(e,i);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Sv(e,i):void 0}}var oo=Symbol("mobx-stored-annotations");function Pa(e){function i(t,n){if(Id(n))return e.decorate_20223_(t,n);Nd(t,n,e)}return Object.assign(i,e)}function Nd(e,i,t){Yo(e,oo)||Ld(e,oo,Yl({},e[oo])),yw(t)||(e[oo][i]=t)}function cw(e){return Yo(e,oo)||Ld(e,oo,Yl({},e[oo])),e[oo]}function Id(e){return typeof e=="object"&&typeof e.kind=="string"}var dt=Symbol("mobx administration"),Ql=function(){function e(t){t===void 0&&(t="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Xt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var i=e.prototype;return i.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},i.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},i.reportObserved=function(){return a_(this)},i.reportChanged=function(){mi(),o_(this),vi()},i.toString=function(){return this.name_},vc(e,[{key:"isBeingObserved",get:function(){return Ri(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Ri(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Ri(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Mi(this.flags_,e.diffValueMask_,n===1)}}])}();Ql.isBeingObservedMask_=1;Ql.isPendingUnobservationMask_=2;Ql.diffValueMask_=4;var Y0=Zl("Atom",Ql);function Od(e,i,t){i===void 0&&(i=ec),t===void 0&&(t=ec);var n=new Ql(e);return i!==ec&&g_(n,i),t!==ec&&em(n,t),n}function fw(e,i){return e===i}function dw(e,i){return cm(e,i)}function hw(e,i){return cm(e,i,1)}function pw(e,i){return Object.is?Object.is(e,i):e===i?e!==0||1/e===1/i:e!==e&&i!==i}var qs={identity:fw,structural:dw,default:pw,shallow:hw};function Hs(e,i,t){return Tp(e)?e:Array.isArray(e)?un.array(e,{name:t}):Zo(e)?un.object(e,void 0,{name:t}):mc(e)?un.map(e,{name:t}):Wo(e)?un.set(e,{name:t}):typeof e=="function"&&!sc(e)&&!uc(e)?D3(e)?Vs(e):oc(t,e):e}function gw(e,i,t){if(e==null||_r(e)||ri(e)||Nr(e)||lr(e))return e;if(Array.isArray(e))return un.array(e,{name:t,deep:!1});if(Zo(e))return un.object(e,void 0,{name:t,deep:!1});if(mc(e))return un.map(e,{name:t,deep:!1});if(Wo(e))return un.set(e,{name:t,deep:!1})}function Ep(e){return e}function mw(e,i){return cm(e,i)?i:e}var U3="override",vw=Pa({annotationType_:U3,make_:bw,extend_:_w,decorate_20223_:ww});function yw(e){return e.annotationType_===U3}function bw(e,i){return 0}function _w(e,i,t,n){At("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function ww(e,i){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Dd(e,i){return{annotationType_:e,options_:i,make_:Sw,extend_:Ew,decorate_20223_:Ow}}function Sw(e,i,t,n){var o;if((o=this.options_)!=null&&o.bound)return this.extend_(e,i,t,!1)===null?0:1;if(n===e.target_)return this.extend_(e,i,t,!1)===null?0:2;if(sc(t.value))return 1;var l=q3(e,this,i,t,!1);return lo(n,i,l),2}function Ew(e,i,t,n){var o=q3(e,this,i,t);return e.defineProperty_(i,o,n)}function Ow(e,i){var t=i.kind,n=i.name,o=i.addInitializer,l=this,s=function(b){var w,E,x,m;return Kl((w=(E=l.options_)==null?void 0:E.name)!=null?w:n.toString(),b,(x=(m=l.options_)==null?void 0:m.autoAction)!=null?x:!1)};if(t=="field")return function(d){var b,w=d;return sc(w)||(w=s(w)),(b=l.options_)!=null&&b.bound&&(w=w.bind(this),w.isMobxAction=!0),w};if(t=="method"){var c;return sc(e)||(e=s(e)),(c=this.options_)!=null&&c.bound&&o(function(){var d=this,b=d[n].bind(d);b.isMobxAction=!0,d[n]=b}),e}At("Cannot apply '"+l.annotationType_+"' to '"+String(n)+"' (kind: "+t+"):"+(`
34
+ '`+l.annotationType_+"' can only be used on properties with a function value."))}function xw(e,i,t,n){i.annotationType_,n.value}function q3(e,i,t,n,o){var l,s,c,d,b,w,E;o===void 0&&(o=We.safeDescriptors),xw(e,i,t,n);var x=n.value;if((l=i.options_)!=null&&l.bound){var m;x=x.bind((m=e.proxy_)!=null?m:e.target_)}return{value:Kl((s=(c=i.options_)==null?void 0:c.name)!=null?s:t.toString(),x,(d=(b=i.options_)==null?void 0:b.autoAction)!=null?d:!1,(w=i.options_)!=null&&w.bound?(E=e.proxy_)!=null?E:e.target_:void 0),configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function H3(e,i){return{annotationType_:e,options_:i,make_:Pw,extend_:Cw,decorate_20223_:kw}}function Pw(e,i,t,n){var o;if(n===e.target_)return this.extend_(e,i,t,!1)===null?0:2;if((o=this.options_)!=null&&o.bound&&(!Yo(e.target_,i)||!uc(e.target_[i]))&&this.extend_(e,i,t,!1)===null)return 0;if(uc(t.value))return 1;var l=G3(e,this,i,t,!1,!1);return lo(n,i,l),2}function Cw(e,i,t,n){var o,l=G3(e,this,i,t,(o=this.options_)==null?void 0:o.bound);return e.defineProperty_(i,l,n)}function kw(e,i){var t,n=i.name,o=i.addInitializer;return uc(e)||(e=Vs(e)),(t=this.options_)!=null&&t.bound&&o(function(){var l=this,s=l[n].bind(l);s.isMobXFlow=!0,l[n]=s}),e}function Aw(e,i,t,n){i.annotationType_,n.value}function G3(e,i,t,n,o,l){l===void 0&&(l=We.safeDescriptors),Aw(e,i,t,n);var s=n.value;if(uc(s)||(s=Vs(s)),o){var c;s=s.bind((c=e.proxy_)!=null?c:e.target_),s.isMobXFlow=!0}return{value:s,configurable:l?e.isPlainObject_:!0,enumerable:!1,writable:!l}}function K0(e,i){return{annotationType_:e,options_:i,make_:Tw,extend_:Rw,decorate_20223_:Mw}}function Tw(e,i,t){return this.extend_(e,i,t,!1)===null?0:1}function Rw(e,i,t,n){return Lw(e,this,i,t),e.defineComputedProperty_(i,Yl({},this.options_,{get:t.get,set:t.set}),n)}function Mw(e,i){var t=this,n=i.name,o=i.addInitializer;return o(function(){var l=Ys(this)[dt],s=Yl({},t.options_,{get:e,context:this});s.name||(s.name="ObservableObject."+n.toString()),l.values_.set(n,new Aa(s))}),function(){return this[dt].getObservablePropValue_(n)}}function Lw(e,i,t,n){i.annotationType_,n.get}function Op(e,i){return{annotationType_:e,options_:i,make_:Nw,extend_:Iw,decorate_20223_:Dw}}function Nw(e,i,t){return this.extend_(e,i,t,!1)===null?0:1}function Iw(e,i,t,n){var o,l;return jw(e,this),e.defineObservableProperty_(i,t.value,(o=(l=this.options_)==null?void 0:l.enhancer)!=null?o:Hs,n)}function Dw(e,i){var t=this,n=i.kind,o=i.name,l=new WeakSet;function s(c,d){var b,w,E=Ys(c)[dt],x=new $l(d,(b=(w=t.options_)==null?void 0:w.enhancer)!=null?b:Hs,"ObservableObject."+o.toString(),!1);E.values_.set(o,x),l.add(c)}if(n=="accessor")return{get:function(){return l.has(this)||s(this,e.get.call(this)),this[dt].getObservablePropValue_(o)},set:function(d){return l.has(this)||s(this,d),this[dt].setObservablePropValue_(o,d)},init:function(d){return l.has(this)||s(this,d),d}}}function jw(e,i,t,n){i.annotationType_}var Fw="true",zw=V3();function V3(e){return{annotationType_:Fw,options_:e,make_:Bw,extend_:Uw,decorate_20223_:qw}}function Bw(e,i,t,n){var o,l;if(t.get)return $s.make_(e,i,t,n);if(t.set){var s=Kl(i.toString(),t.set);return n===e.target_?e.defineProperty_(i,{configurable:We.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(lo(n,i,{configurable:!0,set:s}),2)}if(n!==e.target_&&typeof t.value=="function"){var c;if(D3(t.value)){var d,b=(d=this.options_)!=null&&d.autoBind?Vs.bound:Vs;return b.make_(e,i,t,n)}var w=(c=this.options_)!=null&&c.autoBind?oc.bound:oc;return w.make_(e,i,t,n)}var E=((o=this.options_)==null?void 0:o.deep)===!1?un.ref:un;if(typeof t.value=="function"&&(l=this.options_)!=null&&l.autoBind){var x;t.value=t.value.bind((x=e.proxy_)!=null?x:e.target_)}return E.make_(e,i,t,n)}function Uw(e,i,t,n){var o,l;if(t.get)return $s.extend_(e,i,t,n);if(t.set)return e.defineProperty_(i,{configurable:We.safeDescriptors?e.isPlainObject_:!0,set:Kl(i.toString(),t.set)},n);if(typeof t.value=="function"&&(o=this.options_)!=null&&o.autoBind){var s;t.value=t.value.bind((s=e.proxy_)!=null?s:e.target_)}var c=((l=this.options_)==null?void 0:l.deep)===!1?un.ref:un;return c.extend_(e,i,t,n)}function qw(e,i){At("'"+this.annotationType_+"' cannot be used as a decorator")}var Hw="observable",Gw="observable.ref",Vw="observable.shallow",$w="observable.struct",$3={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze($3);function Wh(e){return e||$3}var L0=Op(Hw),Ww=Op(Gw,{enhancer:Ep}),Yw=Op(Vw,{enhancer:gw}),Kw=Op($w,{enhancer:mw}),W3=Pa(L0);function Yh(e){return e.deep===!0?Hs:e.deep===!1?Ep:Zw(e.defaultDecorator)}function Xw(e){var i;return e?(i=e.defaultDecorator)!=null?i:V3(e):void 0}function Zw(e){var i,t;return e&&(i=(t=e.options_)==null?void 0:t.enhancer)!=null?i:Hs}function Y3(e,i,t){if(Id(i))return L0.decorate_20223_(e,i);if(Us(i)){Nd(e,i,L0);return}return Tp(e)?e:Zo(e)?un.object(e,i,t):Array.isArray(e)?un.array(e,i):mc(e)?un.map(e,i):Wo(e)?un.set(e,i):typeof e=="object"&&e!==null?e:un.box(e,i)}L3(Y3,W3);var Qw={box:function(i,t){var n=Wh(t);return new $l(i,Yh(n),n.name,!0,n.equals)},array:function(i,t){var n=Wh(t);return(We.useProxies===!1||n.proxy===!1?i8:Y6)(i,Yh(n),n.name)},map:function(i,t){var n=Wh(t);return new Mp(i,Yh(n),n.name)},set:function(i,t){var n=Wh(t);return new sm(i,Yh(n),n.name)},object:function(i,t,n){return Jl(function(){return tm(We.useProxies===!1||(n==null?void 0:n.proxy)===!1?Ys({},n):G6({},n),i,t)})},ref:Pa(Ww),shallow:Pa(Yw),deep:W3,struct:Pa(Kw)},un=L3(Y3,Qw),K3="computed",Jw="computed.struct",N0=K0(K3),e6=K0(Jw,{equals:qs.structural}),$s=function(i,t){if(Id(t))return N0.decorate_20223_(i,t);if(Us(t))return Nd(i,t,N0);if(Zo(i))return Pa(K0(K3,i));var n=Zo(t)?t:{};return n.get=i,n.name||(n.name=i.name||""),new Aa(n)};Object.assign($s,N0);$s.struct=Pa(e6);var Ev,Ov,sp=0,t6=1,n6=(Ev=(Ov=lp(function(){},"name"))==null?void 0:Ov.configurable)!=null?Ev:!1,xv={value:"action",configurable:!0,writable:!1,enumerable:!1};function Kl(e,i,t,n){t===void 0&&(t=!1);function o(){return X3(e,t,i,n||this,arguments)}return o.isMobxAction=!0,o.toString=function(){return i.toString()},n6&&(xv.value=e,lo(o,"name",xv)),o}function X3(e,i,t,n,o){var l=Z3(e,i);try{return t.apply(n,o)}catch(s){throw l.error_=s,s}finally{Q3(l)}}function Z3(e,i,t,n){var o=!1,l=0,s=We.trackingDerivation,c=!i||!s;mi();var d=We.allowStateChanges;c&&(Ws(),d=xp(!0));var b=Cp(!0),w={runAsAction_:c,prevDerivation_:s,prevAllowStateChanges_:d,prevAllowStateReads_:b,notifySpy_:o,startTime_:l,actionId_:t6++,parentActionId_:sp};return sp=w.actionId_,w}function Q3(e){sp!==e.actionId_&&At(30),sp=e.parentActionId_,e.error_!==void 0&&(We.suppressReactionErrors=!0),Pp(e.prevAllowStateChanges_),rc(e.prevAllowStateReads_),vi(),e.runAsAction_&&Ko(e.prevDerivation_),We.suppressReactionErrors=!1}function X0(e,i){var t=xp(e);try{return i()}finally{Pp(t)}}function xp(e){var i=We.allowStateChanges;return We.allowStateChanges=e,i}function Pp(e){We.allowStateChanges=e}var $l=function(e){function i(n,o,l,s,c){var d;return l===void 0&&(l="ObservableValue"),c===void 0&&(c=qs.default),d=e.call(this,l)||this,d.enhancer=void 0,d.name_=void 0,d.equals=void 0,d.hasUnreportedChange_=!1,d.interceptors_=void 0,d.changeListeners_=void 0,d.value_=void 0,d.dehancer=void 0,d.enhancer=o,d.name_=l,d.equals=c,d.value_=o(n,void 0,l),d}B3(i,e);var t=i.prototype;return t.dehanceValue=function(o){return this.dehancer!==void 0?this.dehancer(o):o},t.set=function(o){this.value_,o=this.prepareNewValue_(o),o!==We.UNCHANGED&&this.setNewValue_(o)},t.prepareNewValue_=function(o){if(Xi(this)){var l=Zi(this,{object:this,type:so,newValue:o});if(!l)return We.UNCHANGED;o=l.newValue}return o=this.enhancer(o,this.value_,this.name_),this.equals(this.value_,o)?We.UNCHANGED:o},t.setNewValue_=function(o){var l=this.value_;this.value_=o,this.reportChanged(),Ca(this)&&ka(this,{type:so,object:this,newValue:o,oldValue:l})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(o){return jd(this,o)},t.observe_=function(o,l){return l&&o({observableKind:"value",debugObjectName:this.name_,object:this,type:so,newValue:this.value_,oldValue:void 0}),Fd(this,o)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return z3(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},i}(Ql),Z0=Zl("ObservableValue",$l),Aa=function(){function e(t){this.dependenciesState_=Xt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Xt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new cp(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=up.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,t.get||At(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Kl("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?qs.structural:qs.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var i=e.prototype;return i.onBecomeStale_=function(){d6(this)},i.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},i.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},i.get=function(){if(this.isComputing&&At(32,this.name_,this.derivation),We.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)I0(this)&&(this.warnAboutUntrackedRead_(),mi(),this.value_=this.computeValue_(!1),vi());else if(a_(this),I0(this)){var n=We.trackingContext;this.keepAlive_&&!n&&(We.trackingContext=this),this.trackAndCompute()&&f6(this),We.trackingContext=n}var o=this.value_;if(tp(o))throw o.cause;return o},i.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_)},i.trackAndCompute=function(){var n=this.value_,o=this.dependenciesState_===Xt.NOT_TRACKING_,l=this.computeValue_(!0),s=o||tp(n)||tp(l)||!this.equals_(n,l);return s&&(this.value_=l),s},i.computeValue_=function(n){this.isComputing=!0;var o=xp(!1),l;if(n)l=J3(this,this.derivation,this.scope_);else if(We.disableErrorBoundaries===!0)l=this.derivation.call(this.scope_);else try{l=this.derivation.call(this.scope_)}catch(s){l=new cp(s)}return Pp(o),this.isComputing=!1,l},i.suspend_=function(){this.keepAlive_||(D0(this),this.value_=void 0)},i.observe_=function(n,o){var l=this,s=!0,c=void 0;return J0(function(){var d=l.get();if(!s||o){var b=Ws();n({observableKind:"computed",debugObjectName:l.name_,type:so,object:l,newValue:d,oldValue:c}),Ko(b)}s=!1,c=d})},i.warnAboutUntrackedRead_=function(){},i.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},i.valueOf=function(){return z3(this.get())},i[Symbol.toPrimitive]=function(){return this.valueOf()},vc(e,[{key:"isComputing",get:function(){return Ri(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Ri(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Ri(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Ri(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Ri(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Mi(this.flags_,e.diffValueMask_,n===1)}}])}();Aa.isComputingMask_=1;Aa.isRunningSetterMask_=2;Aa.isBeingObservedMask_=4;Aa.isPendingUnobservationMask_=8;Aa.diffValueMask_=16;var Gs=Zl("ComputedValue",Aa),Xt;(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_"})(Xt||(Xt={}));var up;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(up||(up={}));var cp=function(i){this.cause=void 0,this.cause=i};function tp(e){return e instanceof cp}function I0(e){switch(e.dependenciesState_){case Xt.UP_TO_DATE_:return!1;case Xt.NOT_TRACKING_:case Xt.STALE_:return!0;case Xt.POSSIBLY_STALE_:{for(var i=Cp(!0),t=Ws(),n=e.observing_,o=n.length,l=0;l<o;l++){var s=n[l];if(Gs(s)){if(We.disableErrorBoundaries)s.get();else try{s.get()}catch{return Ko(t),rc(i),!0}if(e.dependenciesState_===Xt.STALE_)return Ko(t),rc(i),!0}}return e_(e),Ko(t),rc(i),!1}}}function r6(){return We.trackingDerivation!==null}function J3(e,i,t){var n=Cp(!0);e_(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++We.runId;var o=We.trackingDerivation;We.trackingDerivation=e,We.inBatch++;var l;if(We.disableErrorBoundaries===!0)l=i.call(t);else try{l=i.call(t)}catch(s){l=new cp(s)}return We.inBatch--,We.trackingDerivation=o,i6(e),rc(n),l}function i6(e){for(var i=e.observing_,t=e.observing_=e.newObserving_,n=Xt.UP_TO_DATE_,o=0,l=e.unboundDepsCount_,s=0;s<l;s++){var c=t[s];c.diffValue===0&&(c.diffValue=1,o!==s&&(t[o]=c),o++),c.dependenciesState_>n&&(n=c.dependenciesState_)}for(t.length=o,e.newObserving_=null,l=i.length;l--;){var d=i[l];d.diffValue===0&&r_(d,e),d.diffValue=0}for(;o--;){var b=t[o];b.diffValue===1&&(b.diffValue=0,c6(b,e))}n!==Xt.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function D0(e){var i=e.observing_;e.observing_=[];for(var t=i.length;t--;)r_(i[t],e);e.dependenciesState_=Xt.NOT_TRACKING_}function Q0(e){var i=Ws();try{return e()}finally{Ko(i)}}function Ws(){var e=We.trackingDerivation;return We.trackingDerivation=null,e}function Ko(e){We.trackingDerivation=e}function Cp(e){var i=We.allowStateReads;return We.allowStateReads=e,i}function rc(e){We.allowStateReads=e}function e_(e){if(e.dependenciesState_!==Xt.UP_TO_DATE_){e.dependenciesState_=Xt.UP_TO_DATE_;for(var i=e.observing_,t=i.length;t--;)i[t].lowestObserverState_=Xt.UP_TO_DATE_}}var a6=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],_d=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},np=!0,t_=!1,We=function(){var e=wp();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(np=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new _d().version&&(np=!1),np?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new _d):(setTimeout(function(){t_||At(35)},1),new _d)}();function o6(){if((We.pendingReactions.length||We.inBatch||We.isRunningReactions)&&At(36),t_=!0,np){var e=wp();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),We=new _d}}function n_(){return We}function l6(){var e=new _d;for(var i in e)a6.indexOf(i)===-1&&(We[i]=e[i]);We.allowStateChanges=!We.enforceActions}function s6(e){return e.observers_&&e.observers_.size>0}function u6(e){return e.observers_}function c6(e,i){e.observers_.add(i),e.lowestObserverState_>i.dependenciesState_&&(e.lowestObserverState_=i.dependenciesState_)}function r_(e,i){e.observers_.delete(i),e.observers_.size===0&&i_(e)}function i_(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,We.pendingUnobservations.push(e))}function mi(){We.inBatch++}function vi(){if(--We.inBatch===0){l_();for(var e=We.pendingUnobservations,i=0;i<e.length;i++){var t=e[i];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof Aa&&t.suspend_())}We.pendingUnobservations=[]}}function a_(e){var i=We.trackingDerivation;return i!==null?(i.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=i.runId_,i.newObserving_[i.unboundDepsCount_++]=e,!e.isBeingObserved&&We.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&We.inBatch>0&&i_(e),!1)}function o_(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(i){i.dependenciesState_===Xt.UP_TO_DATE_&&i.onBecomeStale_(),i.dependenciesState_=Xt.STALE_}))}function f6(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(i){i.dependenciesState_===Xt.POSSIBLY_STALE_?i.dependenciesState_=Xt.STALE_:i.dependenciesState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.UP_TO_DATE_)}))}function d6(e){e.lowestObserverState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.POSSIBLY_STALE_,e.observers_.forEach(function(i){i.dependenciesState_===Xt.UP_TO_DATE_&&(i.dependenciesState_=Xt.POSSIBLY_STALE_,i.onBecomeStale_())}))}var Ta=function(){function e(t,n,o,l){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Xt.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=up.NONE,this.name_=t,this.onInvalidate_=n,this.errorHandler_=o,this.requiresObservable_=l}var i=e.prototype;return i.onBecomeStale_=function(){this.schedule_()},i.schedule_=function(){this.isScheduled||(this.isScheduled=!0,We.pendingReactions.push(this),l_())},i.runReaction_=function(){if(!this.isDisposed){mi(),this.isScheduled=!1;var n=We.trackingContext;if(We.trackingContext=this,I0(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(o){this.reportExceptionInDerivation_(o)}}We.trackingContext=n,vi()}},i.track=function(n){if(!this.isDisposed){mi(),this.isRunning=!0;var o=We.trackingContext;We.trackingContext=this;var l=J3(this,n,void 0);We.trackingContext=o,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&D0(this),tp(l)&&this.reportExceptionInDerivation_(l.cause),vi()}},i.reportExceptionInDerivation_=function(n){var o=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(We.disableErrorBoundaries)throw n;var l="[mobx] uncaught error in '"+this+"'";We.suppressReactionErrors||console.error(l,n),We.globalReactionErrorHandlers.forEach(function(s){return s(n,o)})},i.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(mi(),D0(this),vi()))},i.getDisposer_=function(n){var o=this,l=function s(){o.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",s)};return n==null||n.addEventListener==null||n.addEventListener("abort",l),l[dt]=this,l},i.toString=function(){return"Reaction["+this.name_+"]"},i.trace=function(n){},vc(e,[{key:"isDisposed",get:function(){return Ri(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Ri(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Ri(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Ri(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return Ri(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Mi(this.flags_,e.diffValueMask_,n===1)}}])}();Ta.isDisposedMask_=1;Ta.isScheduledMask_=2;Ta.isTrackPendingMask_=4;Ta.isRunningMask_=8;Ta.diffValueMask_=16;function h6(e){return We.globalReactionErrorHandlers.push(e),function(){var i=We.globalReactionErrorHandlers.indexOf(e);i>=0&&We.globalReactionErrorHandlers.splice(i,1)}}var p6=100,j0=function(i){return i()};function l_(){We.inBatch>0||We.isRunningReactions||j0(g6)}function g6(){We.isRunningReactions=!0;for(var e=We.pendingReactions,i=0;e.length>0;){++i===p6&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),n=0,o=t.length;n<o;n++)t[n].runReaction_()}We.isRunningReactions=!1}var fp=Zl("Reaction",Ta);function m6(e){var i=j0;j0=function(n){return e(function(){return i(n)})}}function wd(){return!1}function s_(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var u_="action",v6="action.bound",c_="autoAction",y6="autoAction.bound",f_="<unnamed action>",F0=Dd(u_),b6=Dd(v6,{bound:!0}),z0=Dd(c_,{autoAction:!0}),_6=Dd(y6,{autoAction:!0,bound:!0});function d_(e){var i=function(n,o){if(Li(n))return Kl(n.name||f_,n,e);if(Li(o))return Kl(n,o,e);if(Id(o))return(e?z0:F0).decorate_20223_(n,o);if(Us(o))return Nd(n,o,e?z0:F0);if(Us(n))return Pa(Dd(e?c_:u_,{name:n,autoAction:e}))};return i}var Zn=d_(!1);Object.assign(Zn,F0);var oc=d_(!0);Object.assign(oc,z0);Zn.bound=Pa(b6);oc.bound=Pa(_6);function lc(e){return X3(e.name||f_,!1,e,this,void 0)}function sc(e){return Li(e)&&e.isMobxAction===!0}function J0(e,i){var t,n,o,l;i===void 0&&(i=W0);var s=(t=(n=i)==null?void 0:n.name)!=null?t:"Autorun",c=!i.scheduler&&!i.delay,d;if(c)d=new Ta(s,function(){this.track(E)},i.onError,i.requiresObservable);else{var b=h_(i),w=!1;d=new Ta(s,function(){w||(w=!0,b(function(){w=!1,d.isDisposed||d.track(E)}))},i.onError,i.requiresObservable)}function E(){e(d)}return(o=i)!=null&&(o=o.signal)!=null&&o.aborted||d.schedule_(),d.getDisposer_((l=i)==null?void 0:l.signal)}var w6=function(i){return i()};function h_(e){return e.scheduler?e.scheduler:e.delay?function(i){return setTimeout(i,e.delay)}:w6}function p_(e,i,t){var n,o,l;t===void 0&&(t=W0);var s=(n=t.name)!=null?n:"Reaction",c=Zn(s,t.onError?S6(t.onError,i):i),d=!t.scheduler&&!t.delay,b=h_(t),w=!0,E=!1,x,m=t.compareStructural?qs.structural:t.equals||qs.default,_=new Ta(s,function(){w||d?p():E||(E=!0,b(p))},t.onError,t.requiresObservable);function p(){if(E=!1,!_.isDisposed){var h=!1,P=x;_.track(function(){var g=X0(!1,function(){return e(_)});h=w||!m(x,g),x=g}),(w&&t.fireImmediately||!w&&h)&&c(x,P,_),w=!1}}return(o=t)!=null&&(o=o.signal)!=null&&o.aborted||_.schedule_(),_.getDisposer_((l=t)==null?void 0:l.signal)}function S6(e,i){return function(){try{return i.apply(this,arguments)}catch(t){e.call(this,t)}}}var E6="onBO",O6="onBUO";function g_(e,i,t){return m_(E6,e,i,t)}function em(e,i,t){return m_(O6,e,i,t)}function m_(e,i,t,n){var o=typeof n=="function"?uo(i,t):uo(i),l=Li(n)?n:t,s=e+"L";return o[s]?o[s].add(l):o[s]=new Set([l]),function(){var c=o[s];c&&(c.delete(l),c.size===0&&delete o[s])}}var x6="never",Kh="always",P6="observed";function v_(e){e.isolateGlobalState===!0&&o6();var i=e.useProxies,t=e.enforceActions;if(i!==void 0&&(We.useProxies=i===Kh?!0:i===x6?!1:typeof Proxy<"u"),i==="ifavailable"&&(We.verifyProxies=!0),t!==void 0){var n=t===Kh?Kh:t===P6;We.enforceActions=n,We.allowStateChanges=!(n===!0||n===Kh)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(o){o in e&&(We[o]=!!e[o])}),We.allowStateReads=!We.observableRequiresReaction,e.reactionScheduler&&m6(e.reactionScheduler)}function tm(e,i,t,n){var o=aw(i);return Jl(function(){var l=Ys(e,n)[dt];ac(o).forEach(function(s){l.extend_(s,o[s],t&&s in t?t[s]:!0)})}),e}function y_(e,i){return b_(uo(e,i))}function b_(e){var i={name:e.name_};return e.observing_&&e.observing_.length>0&&(i.dependencies=k6(e.observing_).map(b_)),i}function C6(e,i){return __(uo(e,i))}function __(e){var i={name:e.name_};return s6(e)&&(i.observers=Array.from(u6(e)).map(__)),i}function k6(e){return Array.from(new Set(e))}var A6=0;function kp(){this.message="FLOW_CANCELLED"}kp.prototype=Object.create(Error.prototype);function T6(e){return e instanceof kp}var Cg=H3("flow"),R6=H3("flow.bound",{bound:!0}),Vs=Object.assign(function(i,t){if(Id(t))return Cg.decorate_20223_(i,t);if(Us(t))return Nd(i,t,Cg);var n=i,o=n.name||"<unnamed flow>",l=function(){var c=this,d=arguments,b=++A6,w=Zn(o+" - runid: "+b+" - init",n).apply(c,d),E,x=void 0,m=new Promise(function(_,p){var h=0;E=p;function P(y){x=void 0;var O;try{O=Zn(o+" - runid: "+b+" - yield "+h++,w.next).call(w,y)}catch(M){return p(M)}v(O)}function g(y){x=void 0;var O;try{O=Zn(o+" - runid: "+b+" - yield "+h++,w.throw).call(w,y)}catch(M){return p(M)}v(O)}function v(y){if(Li(y==null?void 0:y.then)){y.then(v,p);return}return y.done?_(y.value):(x=Promise.resolve(y.value),x.then(P,g))}P(void 0)});return m.cancel=Zn(o+" - runid: "+b+" - cancel",function(){try{x&&Pv(x);var _=w.return(void 0),p=Promise.resolve(_.value);p.then(ec,ec),Pv(p),E(new kp)}catch(h){E(h)}}),m};return l.isMobXFlow=!0,l},Cg);Vs.bound=Pa(R6);function Pv(e){Li(e.cancel)&&e.cancel()}function M6(e){return e}function uc(e){return(e==null?void 0:e.isMobXFlow)===!0}function nm(e,i,t){var n;return Nr(e)||ri(e)||Z0(e)?n=Ra(e):_r(e)&&(n=Ra(e,i)),n.dehancer=typeof i=="function"?i:t,function(){n.dehancer=void 0}}function Ap(e,i,t){return Li(t)?N6(e,i,t):L6(e,i)}function L6(e,i){return Ra(e).intercept_(i)}function N6(e,i,t){return Ra(e,i).intercept_(t)}function w_(e,i){if(i===void 0)return Gs(e);if(_r(e)===!1||!e[dt].values_.has(i))return!1;var t=uo(e,i);return Gs(t)}function I6(e){return w_(e)}function S_(e,i){return w_(e,i)}function E_(e,i){return e?i!==void 0?_r(e)?e[dt].values_.has(i):!1:_r(e)||!!e[dt]||Y0(e)||fp(e)||Gs(e):!1}function Tp(e){return E_(e)}function O_(e,i){return E_(e,i)}function xd(e){if(_r(e))return e[dt].keys_();if(Nr(e)||lr(e))return Array.from(e.keys());if(ri(e))return e.map(function(i,t){return t});At(5)}function rm(e){if(_r(e))return xd(e).map(function(i){return e[i]});if(Nr(e))return xd(e).map(function(i){return e.get(i)});if(lr(e))return Array.from(e.values());if(ri(e))return e.slice();At(6)}function x_(e){if(_r(e))return xd(e).map(function(i){return[i,e[i]]});if(Nr(e))return xd(e).map(function(i){return[i,e.get(i)]});if(lr(e))return Array.from(e.entries());if(ri(e))return e.map(function(i,t){return[t,i]});At(7)}function im(e,i,t){if(arguments.length===2&&!lr(e)){mi();var n=i;try{for(var o in n)im(e,o,n[o])}finally{vi()}return}_r(e)?e[dt].set_(i,t):Nr(e)?e.set(i,t):lr(e)?e.add(i):ri(e)?(typeof i!="number"&&(i=parseInt(i,10)),i<0&&At("Invalid index: '"+i+"'"),mi(),i>=e.length&&(e.length=i+1),e[i]=t,vi()):At(8)}function D6(e,i){_r(e)?e[dt].delete_(i):Nr(e)||lr(e)?e.delete(i):ri(e)?(typeof i!="number"&&(i=parseInt(i,10)),e.splice(i,1)):At(9)}function P_(e,i){if(_r(e))return e[dt].has_(i);if(Nr(e))return e.has(i);if(lr(e))return e.has(i);if(ri(e))return i>=0&&i<e.length;At(10)}function j6(e,i){if(P_(e,i)){if(_r(e))return e[dt].get_(i);if(Nr(e))return e.get(i);if(ri(e))return e[i];At(11)}}function am(e,i,t){if(_r(e))return e[dt].defineProperty_(i,t);At(39)}function C_(e){if(_r(e))return e[dt].ownKeys_();At(38)}function Rp(e,i,t,n){return Li(t)?z6(e,i,t,n):F6(e,i,t)}function F6(e,i,t){return Ra(e).observe_(i,t)}function z6(e,i,t,n){return Ra(e,i).observe_(t,n)}function Xh(e,i,t){return e.set(i,t),t}function Qu(e,i){if(e==null||typeof e!="object"||e instanceof Date||!Tp(e))return e;if(Z0(e)||Gs(e))return Qu(e.get(),i);if(i.has(e))return i.get(e);if(ri(e)){var t=Xh(i,e,new Array(e.length));return e.forEach(function(s,c){t[c]=Qu(s,i)}),t}if(lr(e)){var n=Xh(i,e,new Set);return e.forEach(function(s){n.add(Qu(s,i))}),n}if(Nr(e)){var o=Xh(i,e,new Map);return e.forEach(function(s,c){o.set(c,Qu(s,i))}),o}else{var l=Xh(i,e,{});return C_(e).forEach(function(s){Md.propertyIsEnumerable.call(e,s)&&(l[s]=Qu(e[s],i))}),l}}function B6(e,i){return Qu(e,new Map)}function U6(){}function ao(e,i){i===void 0&&(i=void 0),mi();try{return e.apply(i)}finally{vi()}}function B0(e,i,t){return arguments.length===1||i&&typeof i=="object"?q6(e,i):k_(e,i,t||{})}function k_(e,i,t){var n;if(typeof t.timeout=="number"){var o=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!s[dt].isDisposed)if(s(),t.onError)t.onError(o);else throw o},t.timeout)}t.name="When";var l=Kl("When-effect",i),s=J0(function(c){var d=X0(!1,e);d&&(c.dispose(),n&&clearTimeout(n),l())},t);return s}function q6(e,i){var t;if(i!=null&&(t=i.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,o,l=new Promise(function(s,c){var d,b=k_(e,s,Yl({},i,{onError:c}));n=function(){b(),c(new Error("WHEN_CANCELLED"))},o=function(){b(),c(new Error("WHEN_ABORTED"))},i==null||(d=i.signal)==null||d.addEventListener==null||d.addEventListener("abort",o)}).finally(function(){var s;return i==null||(s=i.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",o)});return l.cancel=n,l}function Ku(e){return e[dt]}var H6={has:function(i,t){return Ku(i).has_(t)},get:function(i,t){return Ku(i).get_(t)},set:function(i,t,n){var o;return Us(t)?(o=Ku(i).set_(t,n,!0))!=null?o:!0:!1},deleteProperty:function(i,t){var n;return Us(t)?(n=Ku(i).delete_(t,!0))!=null?n:!0:!1},defineProperty:function(i,t,n){var o;return(o=Ku(i).defineProperty_(t,n))!=null?o:!0},ownKeys:function(i){return Ku(i).ownKeys_()},preventExtensions:function(i){At(13)}};function G6(e,i){var t,n;return N3(),e=Ys(e,i),(n=(t=e[dt]).proxy_)!=null?n:t.proxy_=new Proxy(e,H6)}function Xi(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function jd(e,i){var t=e.interceptors_||(e.interceptors_=[]);return t.push(i),I3(function(){var n=t.indexOf(i);n!==-1&&t.splice(n,1)})}function Zi(e,i){var t=Ws();try{for(var n=[].concat(e.interceptors_||[]),o=0,l=n.length;o<l&&(i=n[o](i),i&&!i.type&&At(14),!!i);o++);return i}finally{Ko(t)}}function Ca(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Fd(e,i){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(i),I3(function(){var n=t.indexOf(i);n!==-1&&t.splice(n,1)})}function ka(e,i){var t=Ws(),n=e.changeListeners_;if(n){n=n.slice();for(var o=0,l=n.length;o<l;o++)n[o](i);Ko(t)}}function om(e,i,t){return Jl(function(){var n,o=Ys(e,t)[dt];(n=i)!=null||(i=cw(e)),ac(i).forEach(function(l){return o.make_(l,i[l])})}),e}var kg=Symbol("mobx-keys");function V6(e,i,t){return Zo(e)?tm(e,e,i,t):(Jl(function(){var n=Ys(e,t)[dt];if(!e[kg]){var o=Object.getPrototypeOf(e),l=new Set([].concat(ac(e),ac(o)));l.delete("constructor"),l.delete(dt),Ld(o,kg,l)}e[kg].forEach(function(s){return n.make_(s,i&&s in i?i[s]:!0)})}),e)}var Cv="splice",so="update",$6=1e4,W6={get:function(i,t){var n=i[dt];return t===dt?n:t==="length"?n.getArrayLength_():typeof t=="string"&&!isNaN(t)?n.get_(parseInt(t)):Yo(dp,t)?dp[t]:i[t]},set:function(i,t,n){var o=i[dt];return t==="length"&&o.setArrayLength_(n),typeof t=="symbol"||isNaN(t)?i[t]=n:o.set_(parseInt(t),n),!0},preventExtensions:function(){At(15)}},lm=function(){function e(t,n,o,l){t===void 0&&(t="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_=o,this.legacyMode_=l,this.atom_=new Ql(t),this.enhancer_=function(s,c){return n(s,c,"ObservableArray[..]")}}var i=e.prototype;return i.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},i.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},i.intercept_=function(n){return jd(this,n)},i.observe_=function(n,o){return o===void 0&&(o=!1),o&&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}),Fd(this,n)},i.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},i.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&At("Out of range: "+n);var o=this.values_.length;if(n!==o)if(n>o){for(var l=new Array(n-o),s=0;s<n-o;s++)l[s]=void 0;this.spliceWithArray_(o,0,l)}else this.spliceWithArray_(n,o-n)},i.updateArrayLength_=function(n,o){n!==this.lastKnownLength_&&At(16),this.lastKnownLength_+=o,this.legacyMode_&&o>0&&L_(n+o+1)},i.spliceWithArray_=function(n,o,l){var s=this;this.atom_;var c=this.values_.length;if(n===void 0?n=0:n>c?n=c:n<0&&(n=Math.max(0,c+n)),arguments.length===1?o=c-n:o==null?o=0:o=Math.max(0,Math.min(o,c-n)),l===void 0&&(l=R0),Xi(this)){var d=Zi(this,{object:this.proxy_,type:Cv,index:n,removedCount:o,added:l});if(!d)return R0;o=d.removedCount,l=d.added}if(l=l.length===0?l:l.map(function(E){return s.enhancer_(E,void 0)}),this.legacyMode_){var b=l.length-o;this.updateArrayLength_(c,b)}var w=this.spliceItemsIntoValues_(n,o,l);return(o!==0||l.length!==0)&&this.notifyArraySplice_(n,l,w),this.dehanceValues_(w)},i.spliceItemsIntoValues_=function(n,o,l){if(l.length<$6){var s;return(s=this.values_).splice.apply(s,[n,o].concat(l))}else{var c=this.values_.slice(n,n+o),d=this.values_.slice(n+o);this.values_.length+=l.length-o;for(var b=0;b<l.length;b++)this.values_[n+b]=l[b];for(var w=0;w<d.length;w++)this.values_[n+l.length+w]=d[w];return c}},i.notifyArrayChildUpdate_=function(n,o,l){var s=!this.owned_&&wd(),c=Ca(this),d=c||s?{observableKind:"array",object:this.proxy_,type:so,debugObjectName:this.atom_.name_,index:n,newValue:o,oldValue:l}:null;this.atom_.reportChanged(),c&&ka(this,d)},i.notifyArraySplice_=function(n,o,l){var s=!this.owned_&&wd(),c=Ca(this),d=c||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Cv,index:n,removed:l,added:o,removedCount:l.length,addedCount:o.length}:null;this.atom_.reportChanged(),c&&ka(this,d)},i.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])},i.set_=function(n,o){var l=this.values_;if(this.legacyMode_&&n>l.length&&At(17,n,l.length),n<l.length){this.atom_;var s=l[n];if(Xi(this)){var c=Zi(this,{type:so,object:this.proxy_,index:n,newValue:o});if(!c)return;o=c.newValue}o=this.enhancer_(o,s);var d=o!==s;d&&(l[n]=o,this.notifyArrayChildUpdate_(n,o,s))}else{for(var b=new Array(n+1-l.length),w=0;w<b.length-1;w++)b[w]=void 0;b[b.length-1]=o,this.spliceWithArray_(l.length,0,b)}},e}();function Y6(e,i,t,n){return t===void 0&&(t="ObservableArray"),n===void 0&&(n=!1),N3(),Jl(function(){var o=new lm(t,i,n,!1);j3(o.values_,dt,o);var l=new Proxy(o.values_,W6);return o.proxy_=l,e&&e.length&&o.spliceWithArray_(0,0,e),l})}var dp={clear:function(){return this.splice(0)},replace:function(i){var t=this[dt];return t.spliceWithArray_(0,t.values_.length,i)},toJSON:function(){return this.slice()},splice:function(i,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),l=2;l<n;l++)o[l-2]=arguments[l];var s=this[dt];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(i);case 2:return s.spliceWithArray_(i,t)}return s.spliceWithArray_(i,t,o)},spliceWithArray:function(i,t,n){return this[dt].spliceWithArray_(i,t,n)},push:function(){for(var i=this[dt],t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return i.spliceWithArray_(i.values_.length,0,n),i.values_.length},pop:function(){return this.splice(Math.max(this[dt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var i=this[dt],t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return i.spliceWithArray_(0,0,n),i.values_.length},reverse:function(){return We.trackingDerivation&&At(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){We.trackingDerivation&&At(37,"sort");var i=this.slice();return i.sort.apply(i,arguments),this.replace(i),this},remove:function(i){var t=this[dt],n=t.dehanceValues_(t.values_).indexOf(i);return n>-1?(this.splice(n,1),!0):!1}};bn("at",Ni);bn("concat",Ni);bn("flat",Ni);bn("includes",Ni);bn("indexOf",Ni);bn("join",Ni);bn("lastIndexOf",Ni);bn("slice",Ni);bn("toString",Ni);bn("toLocaleString",Ni);bn("toSorted",Ni);bn("toSpliced",Ni);bn("with",Ni);bn("every",Ma);bn("filter",Ma);bn("find",Ma);bn("findIndex",Ma);bn("findLast",Ma);bn("findLastIndex",Ma);bn("flatMap",Ma);bn("forEach",Ma);bn("map",Ma);bn("some",Ma);bn("toReversed",Ma);bn("reduce",A_);bn("reduceRight",A_);function bn(e,i){typeof Array.prototype[e]=="function"&&(dp[e]=i(e))}function Ni(e){return function(){var i=this[dt];i.atom_.reportObserved();var t=i.dehanceValues_(i.values_);return t[e].apply(t,arguments)}}function Ma(e){return function(i,t){var n=this,o=this[dt];o.atom_.reportObserved();var l=o.dehanceValues_(o.values_);return l[e](function(s,c){return i.call(t,s,c,n)})}}function A_(e){return function(){var i=this,t=this[dt];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_),o=arguments[0];return arguments[0]=function(l,s,c){return o(l,s,c,i)},n[e].apply(n,arguments)}}var K6=Zl("ObservableArrayAdministration",lm);function ri(e){return Sp(e)&&K6(e[dt])}var X6={},Vl="add",hp="delete",Mp=function(){function e(t,n,o){var l=this;n===void 0&&(n=Hs),o===void 0&&(o="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[dt]=X6,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_=o,Li(Map)||At(18),Jl(function(){l.keysAtom_=Od("ObservableMap.keys()"),l.data_=new Map,l.hasMap_=new Map,t&&l.merge(t)})}var i=e.prototype;return i.has_=function(n){return this.data_.has(n)},i.has=function(n){var o=this;if(!We.trackingDerivation)return this.has_(n);var l=this.hasMap_.get(n);if(!l){var s=l=new $l(this.has_(n),Ep,"ObservableMap.key?",!1);this.hasMap_.set(n,s),em(s,function(){return o.hasMap_.delete(n)})}return l.get()},i.set=function(n,o){var l=this.has_(n);if(Xi(this)){var s=Zi(this,{type:l?so:Vl,object:this,newValue:o,name:n});if(!s)return this;o=s.newValue}return l?this.updateValue_(n,o):this.addValue_(n,o),this},i.delete=function(n){var o=this;if(this.keysAtom_,Xi(this)){var l=Zi(this,{type:hp,object:this,name:n});if(!l)return!1}if(this.has_(n)){var s=wd(),c=Ca(this),d=c||s?{observableKind:"map",debugObjectName:this.name_,type:hp,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return ao(function(){var b;o.keysAtom_.reportChanged(),(b=o.hasMap_.get(n))==null||b.setNewValue_(!1);var w=o.data_.get(n);w.setNewValue_(void 0),o.data_.delete(n)}),c&&ka(this,d),!0}return!1},i.updateValue_=function(n,o){var l=this.data_.get(n);if(o=l.prepareNewValue_(o),o!==We.UNCHANGED){var s=wd(),c=Ca(this),d=c||s?{observableKind:"map",debugObjectName:this.name_,type:so,object:this,oldValue:l.value_,name:n,newValue:o}:null;l.setNewValue_(o),c&&ka(this,d)}},i.addValue_=function(n,o){var l=this;this.keysAtom_,ao(function(){var b,w=new $l(o,l.enhancer_,"ObservableMap.key",!1);l.data_.set(n,w),o=w.value_,(b=l.hasMap_.get(n))==null||b.setNewValue_(!0),l.keysAtom_.reportChanged()});var s=wd(),c=Ca(this),d=c||s?{observableKind:"map",debugObjectName:this.name_,type:Vl,object:this,name:n,newValue:o}:null;c&&ka(this,d)},i.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},i.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},i.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},i.values=function(){var n=this,o=this.keys();return kv({next:function(){var s=o.next(),c=s.done,d=s.value;return{done:c,value:c?void 0:n.get(d)}}})},i.entries=function(){var n=this,o=this.keys();return kv({next:function(){var s=o.next(),c=s.done,d=s.value;return{done:c,value:c?void 0:[d,n.get(d)]}}})},i[Symbol.iterator]=function(){return this.entries()},i.forEach=function(n,o){for(var l=tc(this),s;!(s=l()).done;){var c=s.value,d=c[0],b=c[1];n.call(o,b,d,this)}},i.merge=function(n){var o=this;return Nr(n)&&(n=new Map(n)),ao(function(){Zo(n)?iw(n).forEach(function(l){return o.set(l,n[l])}):Array.isArray(n)?n.forEach(function(l){var s=l[0],c=l[1];return o.set(s,c)}):mc(n)?(rw(n)||At(19,n),n.forEach(function(l,s){return o.set(s,l)})):n!=null&&At(20,n)}),this},i.clear=function(){var n=this;ao(function(){Q0(function(){for(var o=tc(n.keys()),l;!(l=o()).done;){var s=l.value;n.delete(s)}})})},i.replace=function(n){var o=this;return ao(function(){for(var l=Z6(n),s=new Map,c=!1,d=tc(o.data_.keys()),b;!(b=d()).done;){var w=b.value;if(!l.has(w)){var E=o.delete(w);if(E)c=!0;else{var x=o.data_.get(w);s.set(w,x)}}}for(var m=tc(l.entries()),_;!(_=m()).done;){var p=_.value,h=p[0],P=p[1],g=o.data_.has(h);if(o.set(h,P),o.data_.has(h)){var v=o.data_.get(h);s.set(h,v),g||(c=!0)}}if(!c)if(o.data_.size!==s.size)o.keysAtom_.reportChanged();else for(var y=o.data_.keys(),O=s.keys(),M=y.next(),R=O.next();!M.done;){if(M.value!==R.value){o.keysAtom_.reportChanged();break}M=y.next(),R=O.next()}o.data_=s}),this},i.toString=function(){return"[object ObservableMap]"},i.toJSON=function(){return Array.from(this)},i.observe_=function(n,o){return Fd(this,n)},i.intercept_=function(n){return jd(this,n)},vc(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Nr=Zl("ObservableMap",Mp);function kv(e){return e[Symbol.toStringTag]="MapIterator",fm(e)}function Z6(e){if(mc(e)||Nr(e))return e;if(Array.isArray(e))return new Map(e);if(Zo(e)){var i=new Map;for(var t in e)i.set(t,e[t]);return i}else return At(21,e)}var Q6={},sm=function(){function e(t,n,o){var l=this;n===void 0&&(n=Hs),o===void 0&&(o="ObservableSet"),this.name_=void 0,this[dt]=Q6,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_=o,Li(Set)||At(22),this.enhancer_=function(s,c){return n(s,c,o)},Jl(function(){l.atom_=Od(l.name_),t&&l.replace(t)})}var i=e.prototype;return i.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},i.clear=function(){var n=this;ao(function(){Q0(function(){for(var o=tc(n.data_.values()),l;!(l=o()).done;){var s=l.value;n.delete(s)}})})},i.forEach=function(n,o){for(var l=tc(this),s;!(s=l()).done;){var c=s.value;n.call(o,c,c,this)}},i.add=function(n){var o=this;if(this.atom_,Xi(this)){var l=Zi(this,{type:Vl,object:this,newValue:n});if(!l)return this}if(!this.has(n)){ao(function(){o.data_.add(o.enhancer_(n,void 0)),o.atom_.reportChanged()});var s=!1,c=Ca(this),d=c||s?{observableKind:"set",debugObjectName:this.name_,type:Vl,object:this,newValue:n}:null;c&&ka(this,d)}return this},i.delete=function(n){var o=this;if(Xi(this)){var l=Zi(this,{type:hp,object:this,oldValue:n});if(!l)return!1}if(this.has(n)){var s=!1,c=Ca(this),d=c||s?{observableKind:"set",debugObjectName:this.name_,type:hp,object:this,oldValue:n}:null;return ao(function(){o.atom_.reportChanged(),o.data_.delete(n)}),c&&ka(this,d),!0}return!1},i.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},i.entries=function(){var n=0,o=Array.from(this.keys()),l=Array.from(this.values());return Av({next:function(){var c=n;return n+=1,c<l.length?{value:[o[c],l[c]],done:!1}:{value:void 0,done:!0}}})},i.keys=function(){return this.values()},i.values=function(){this.atom_.reportObserved();var n=this,o=0,l=Array.from(this.data_.values());return Av({next:function(){return o<l.length?{value:n.dehanceValue_(l[o++]),done:!1}:{value:void 0,done:!0}}})},i.intersection=function(n){if(Wo(n)&&!lr(n))return n.intersection(this);var o=new Set(this);return o.intersection(n)},i.union=function(n){if(Wo(n)&&!lr(n))return n.union(this);var o=new Set(this);return o.union(n)},i.difference=function(n){return new Set(this).difference(n)},i.symmetricDifference=function(n){if(Wo(n)&&!lr(n))return n.symmetricDifference(this);var o=new Set(this);return o.symmetricDifference(n)},i.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},i.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},i.isDisjointFrom=function(n){if(Wo(n)&&!lr(n))return n.isDisjointFrom(this);var o=new Set(this);return o.isDisjointFrom(n)},i.replace=function(n){var o=this;return lr(n)&&(n=new Set(n)),ao(function(){Array.isArray(n)?(o.clear(),n.forEach(function(l){return o.add(l)})):Wo(n)?(o.clear(),n.forEach(function(l){return o.add(l)})):n!=null&&At("Cannot initialize set from "+n)}),this},i.observe_=function(n,o){return Fd(this,n)},i.intercept_=function(n){return jd(this,n)},i.toJSON=function(){return Array.from(this)},i.toString=function(){return"[object ObservableSet]"},i[Symbol.iterator]=function(){return this.values()},vc(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),lr=Zl("ObservableSet",sm);function Av(e){return e[Symbol.toStringTag]="SetIterator",fm(e)}var Tv=Object.create(null),Rv="remove",T_=function(){function e(t,n,o,l){n===void 0&&(n=new Map),l===void 0&&(l=zw),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_=t,this.values_=n,this.name_=o,this.defaultAnnotation_=l,this.keysAtom_=new Ql("ObservableObject.keys"),this.isPlainObject_=Zo(this.target_)}var i=e.prototype;return i.getObservablePropValue_=function(n){return this.values_.get(n).get()},i.setObservablePropValue_=function(n,o){var l=this.values_.get(n);if(l instanceof Aa)return l.set(o),!0;if(Xi(this)){var s=Zi(this,{type:so,object:this.proxy_||this.target_,name:n,newValue:o});if(!s)return null;o=s.newValue}if(o=l.prepareNewValue_(o),o!==We.UNCHANGED){var c=Ca(this),d=!1,b=c||d?{type:so,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:l.value_,name:n,newValue:o}:null;l.setNewValue_(o),c&&ka(this,b)}return!0},i.get_=function(n){return We.trackingDerivation&&!Yo(this.target_,n)&&this.has_(n),this.target_[n]},i.set_=function(n,o,l){return l===void 0&&(l=!1),Yo(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,o):l?Reflect.set(this.target_,n,o):(this.target_[n]=o,!0):this.extend_(n,{value:o,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,l)},i.has_=function(n){if(!We.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var o=this.pendingKeys_.get(n);return o||(o=new $l(n in this.target_,Ep,"ObservableObject.key?",!1),this.pendingKeys_.set(n,o)),o.get()},i.make_=function(n,o){if(o===!0&&(o=this.defaultAnnotation_),o!==!1){if(!(n in this.target_)){var l;if((l=this.target_[oo])!=null&&l[n])return;At(1,o.annotationType_,this.name_+"."+n.toString())}for(var s=this.target_;s&&s!==Md;){var c=lp(s,n);if(c){var d=o.make_(this,n,c,s);if(d===0)return;if(d===1)break}s=Object.getPrototypeOf(s)}Lv(this,o,n)}},i.extend_=function(n,o,l,s){if(s===void 0&&(s=!1),l===!0&&(l=this.defaultAnnotation_),l===!1)return this.defineProperty_(n,o,s);var c=l.extend_(this,n,o,s);return c&&Lv(this,l,n),c},i.defineProperty_=function(n,o,l){l===void 0&&(l=!1),this.keysAtom_;try{mi();var s=this.delete_(n);if(!s)return s;if(Xi(this)){var c=Zi(this,{object:this.proxy_||this.target_,name:n,type:Vl,newValue:o.value});if(!c)return null;var d=c.newValue;o.value!==d&&(o=Yl({},o,{value:d}))}if(l){if(!Reflect.defineProperty(this.target_,n,o))return!1}else lo(this.target_,n,o);this.notifyPropertyAddition_(n,o.value)}finally{vi()}return!0},i.defineObservableProperty_=function(n,o,l,s){s===void 0&&(s=!1),this.keysAtom_;try{mi();var c=this.delete_(n);if(!c)return c;if(Xi(this)){var d=Zi(this,{object:this.proxy_||this.target_,name:n,type:Vl,newValue:o});if(!d)return null;o=d.newValue}var b=Mv(n),w={configurable:We.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:b.get,set:b.set};if(s){if(!Reflect.defineProperty(this.target_,n,w))return!1}else lo(this.target_,n,w);var E=new $l(o,l,"ObservableObject.key",!1);this.values_.set(n,E),this.notifyPropertyAddition_(n,E.value_)}finally{vi()}return!0},i.defineComputedProperty_=function(n,o,l){l===void 0&&(l=!1),this.keysAtom_;try{mi();var s=this.delete_(n);if(!s)return s;if(Xi(this)){var c=Zi(this,{object:this.proxy_||this.target_,name:n,type:Vl,newValue:void 0});if(!c)return null}o.name||(o.name="ObservableObject.key"),o.context=this.proxy_||this.target_;var d=Mv(n),b={configurable:We.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:d.get,set:d.set};if(l){if(!Reflect.defineProperty(this.target_,n,b))return!1}else lo(this.target_,n,b);this.values_.set(n,new Aa(o)),this.notifyPropertyAddition_(n,void 0)}finally{vi()}return!0},i.delete_=function(n,o){if(o===void 0&&(o=!1),this.keysAtom_,!Yo(this.target_,n))return!0;if(Xi(this)){var l=Zi(this,{object:this.proxy_||this.target_,name:n,type:Rv});if(!l)return null}try{var s;mi();var c=Ca(this),d=!1,b=this.values_.get(n),w=void 0;if(!b&&(c||d)){var E;w=(E=lp(this.target_,n))==null?void 0:E.value}if(o){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(b&&(this.values_.delete(n),b instanceof $l&&(w=b.value_),o_(b)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(n))==null||s.set(n in this.target_),c||d){var x={type:Rv,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:w,name:n};c&&ka(this,x)}}finally{vi()}return!0},i.observe_=function(n,o){return Fd(this,n)},i.intercept_=function(n){return jd(this,n)},i.notifyPropertyAddition_=function(n,o){var l,s=Ca(this),c=!1;if(s||c){var d=s||c?{type:Vl,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:o}:null;s&&ka(this,d)}(l=this.pendingKeys_)==null||(l=l.get(n))==null||l.set(!0),this.keysAtom_.reportChanged()},i.ownKeys_=function(){return this.keysAtom_.reportObserved(),ac(this.target_)},i.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ys(e,i){var t;if(Yo(e,dt))return e;var n=(t=i==null?void 0:i.name)!=null?t:"ObservableObject",o=new T_(e,new Map,String(n),Xw(i));return Ld(e,dt,o),e}var J6=Zl("ObservableObjectAdministration",T_);function Mv(e){return Tv[e]||(Tv[e]={get:function(){return this[dt].getObservablePropValue_(e)},set:function(t){return this[dt].setObservablePropValue_(e,t)}})}function _r(e){return Sp(e)?J6(e[dt]):!1}function Lv(e,i,t){var n;(n=e.target_[oo])==null||delete n[t]}var e8=M_(0),t8=function(){var e=!1,i={};return Object.defineProperty(i,"0",{set:function(){e=!0}}),Object.create(i)[0]=1,e===!1}(),Ag=0,R_=function(){};function n8(e,i){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,i):e.prototype.__proto__!==void 0?e.prototype.__proto__=i:e.prototype=i}n8(R_,Array.prototype);var um=function(e){function i(n,o,l,s){var c;return l===void 0&&(l="ObservableArray"),s===void 0&&(s=!1),c=e.call(this)||this,Jl(function(){var d=new lm(l,o,s,!0);d.proxy_=c,j3(c,dt,d),n&&n.length&&c.spliceWithArray(0,0,n),t8&&Object.defineProperty(c,"0",e8)}),c}B3(i,e);var t=i.prototype;return t.concat=function(){this[dt].atom_.reportObserved();for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),l.map(function(c){return ri(c)?c.slice():c}))},t[Symbol.iterator]=function(){var n=this,o=0;return fm({next:function(){return o<n.length?{value:n[o++],done:!1}:{done:!0,value:void 0}}})},vc(i,[{key:"length",get:function(){return this[dt].getArrayLength_()},set:function(o){this[dt].setArrayLength_(o)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(R_);Object.entries(dp).forEach(function(e){var i=e[0],t=e[1];i!=="concat"&&Ld(um.prototype,i,t)});function M_(e){return{enumerable:!1,configurable:!0,get:function(){return this[dt].get_(e)},set:function(t){this[dt].set_(e,t)}}}function r8(e){lo(um.prototype,""+e,M_(e))}function L_(e){if(e>Ag){for(var i=Ag;i<e+100;i++)r8(i);Ag=e}}L_(1e3);function i8(e,i,t){return new um(e,i,t)}function uo(e,i){if(typeof e=="object"&&e!==null){if(ri(e))return i!==void 0&&At(23),e[dt].atom_;if(lr(e))return e.atom_;if(Nr(e)){if(i===void 0)return e.keysAtom_;var t=e.data_.get(i)||e.hasMap_.get(i);return t||At(25,i,pp(e)),t}if(_r(e)){if(!i)return At(26);var n=e[dt].values_.get(i);return n||At(27,i,pp(e)),n}if(Y0(e)||Gs(e)||fp(e))return e}else if(Li(e)&&fp(e[dt]))return e[dt];At(28)}function Ra(e,i){if(e||At(29),i!==void 0)return Ra(uo(e,i));if(Y0(e)||Gs(e)||fp(e)||Nr(e)||lr(e))return e;if(e[dt])return e[dt];At(24,e)}function pp(e,i){var t;if(i!==void 0)t=uo(e,i);else{if(sc(e))return e.name;_r(e)||Nr(e)||lr(e)?t=Ra(e):t=uo(e)}return t.name_}function Jl(e){var i=Ws(),t=xp(!0);mi();try{return e()}finally{vi(),Pp(t),Ko(i)}}var Nv=Md.toString;function cm(e,i,t){return t===void 0&&(t=-1),U0(e,i,t)}function U0(e,i,t,n,o){if(e===i)return e!==0||1/e===1/i;if(e==null||i==null)return!1;if(e!==e)return i!==i;var l=typeof e;if(l!=="function"&&l!=="object"&&typeof i!="object")return!1;var s=Nv.call(e);if(s!==Nv.call(i))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+i;case"[object Number]":return+e!=+e?+i!=+i:+e==0?1/+e===1/i:+e==+i;case"[object Date]":case"[object Boolean]":return+e==+i;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(i);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=Iv(e),i=Iv(i);var c=s==="[object Array]";if(!c){if(typeof e!="object"||typeof i!="object")return!1;var d=e.constructor,b=i.constructor;if(d!==b&&!(Li(d)&&d instanceof d&&Li(b)&&b instanceof b)&&"constructor"in e&&"constructor"in i)return!1}if(t===0)return!1;t<0&&(t=-1),n=n||[],o=o||[];for(var w=n.length;w--;)if(n[w]===e)return o[w]===i;if(n.push(e),o.push(i),c){if(w=e.length,w!==i.length)return!1;for(;w--;)if(!U0(e[w],i[w],t-1,n,o))return!1}else{var E=Object.keys(e),x;if(w=E.length,Object.keys(i).length!==w)return!1;for(;w--;)if(x=E[w],!(Yo(i,x)&&U0(e[x],i[x],t-1,n,o)))return!1}return n.pop(),o.pop(),!0}function Iv(e){return ri(e)?e.slice():mc(e)||Nr(e)||Wo(e)||lr(e)?Array.from(e.entries()):e}var Dv,a8=((Dv=wp().Iterator)==null?void 0:Dv.prototype)||{};function fm(e){return e[Symbol.iterator]=o8,Object.assign(Object.create(a8),e)}function o8(){return this}["Symbol","Map","Set"].forEach(function(e){var i=wp();typeof i[e]>"u"&&At("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:s_,extras:{getDebugName:pp},$mobx:dt});const l8=Object.freeze(Object.defineProperty({__proto__:null,$mobx:dt,FlowCancellationError:kp,ObservableMap:Mp,ObservableSet:sm,Reaction:Ta,_allowStateChanges:X0,_allowStateChangesInsideComputed:lc,_allowStateReadsEnd:rc,_allowStateReadsStart:Cp,_autoAction:oc,_endAction:Q3,_getAdministration:Ra,_getGlobalState:n_,_interceptReads:nm,_isComputingDerivation:r6,_resetGlobalState:l6,_startAction:Z3,action:Zn,autorun:J0,comparer:qs,computed:$s,configure:v_,createAtom:Od,defineProperty:am,entries:x_,extendObservable:tm,flow:Vs,flowResult:M6,get:j6,getAtom:uo,getDebugName:pp,getDependencyTree:y_,getObserverTree:C6,has:P_,intercept:Ap,isAction:sc,isBoxedObservable:Z0,isComputed:I6,isComputedProp:S_,isFlow:uc,isFlowCancellationError:T6,isObservable:Tp,isObservableArray:ri,isObservableMap:Nr,isObservableObject:_r,isObservableProp:O_,isObservableSet:lr,keys:xd,makeAutoObservable:V6,makeObservable:om,observable:un,observe:Rp,onBecomeObserved:g_,onBecomeUnobserved:em,onReactionError:h6,override:vw,ownKeys:C_,reaction:p_,remove:D6,runInAction:lc,set:im,spy:s_,toJS:B6,trace:U6,transaction:ao,untracked:Q0,values:rm,when:B0},Symbol.toStringTag,{value:"Module"}));if(!xn.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!om)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var s8=R3();function u8(e){e()}function N_(e){e||(e=u8),v_({reactionScheduler:e})}var c8=function(){return!0};function f8(e){return y_(e)}var I_=!1;function D_(e){I_=e}function dm(){return I_}var d8=1e4,h8=1e4,p8=function(){function e(i){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:i}),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=d8),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var o=Date.now();t.registrations.forEach(function(l,s){o-l.registeredAt>=n&&(t.finalize(l.value),t.registrations.delete(s))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this.registrations.delete(i)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,h8))}}),e}(),g8=typeof FinalizationRegistry<"u"?FinalizationRegistry:p8,gp=new g8(function(e){var i;(i=e.reaction)===null||i===void 0||i.dispose(),e.reaction=null}),Tg={exports:{}},Rg={};/**
35
+ * @license React
36
+ * use-sync-external-store-shim.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and 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 jv;function m8(){if(jv)return Rg;jv=1;var e=Tn();function i(E,x){return E===x&&(E!==0||1/E===1/x)||E!==E&&x!==x}var t=typeof Object.is=="function"?Object.is:i,n=e.useState,o=e.useEffect,l=e.useLayoutEffect,s=e.useDebugValue;function c(E,x){var m=x(),_=n({inst:{value:m,getSnapshot:x}}),p=_[0].inst,h=_[1];return l(function(){p.value=m,p.getSnapshot=x,d(p)&&h({inst:p})},[E,m,x]),o(function(){return d(p)&&h({inst:p}),E(function(){d(p)&&h({inst:p})})},[E]),s(m),m}function d(E){var x=E.getSnapshot;E=E.value;try{var m=x();return!t(E,m)}catch{return!0}}function b(E,x){return x()}var w=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:c;return Rg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w,Rg}var Fv;function v8(){return Fv||(Fv=1,Tg.exports=m8()),Tg.exports}var y8=v8();function zv(e){e.reaction=new Ta("observer".concat(e.name),function(){var i;e.stateVersion=Symbol(),(i=e.onStoreChange)===null||i===void 0||i.call(e)})}function hm(e,i){if(i===void 0&&(i="observed"),dm())return e();var t=qt.useRef(null);if(!t.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:i,subscribe:function(c){return gp.unregister(n),n.onStoreChange=c,n.reaction||(zv(n),n.stateVersion=Symbol()),function(){var d;n.onStoreChange=null,(d=n.reaction)===null||d===void 0||d.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};t.current=n}var o=t.current;o.reaction||(zv(o),gp.register(t,o,o)),qt.useDebugValue(o.reaction,f8),y8.useSyncExternalStore(o.subscribe,o.getSnapshot,o.getSnapshot);var l,s;if(o.reaction.track(function(){try{l=e()}catch(c){s=c}}),s)throw s;return l}var Mg,Lg,j_=typeof Symbol=="function"&&Symbol.for,b8=(Lg=(Mg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Mg===void 0?void 0:Mg.configurable)!==null&&Lg!==void 0?Lg:!1,Bv=j_?Symbol.for("react.forward_ref"):typeof xn.forwardRef=="function"&&xn.forwardRef(function(e){return null}).$$typeof,Uv=j_?Symbol.for("react.memo"):typeof xn.memo=="function"&&xn.memo(function(e){return null}).$$typeof;function _8(e,i){var t;if(Uv&&e.$$typeof===Uv)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(dm())return e;var n=(t=i==null?void 0:i.forwardRef)!==null&&t!==void 0?t:!1,o=e,l=e.displayName||e.name;if(Bv&&e.$$typeof===Bv&&(n=!0,o=e.render,typeof o!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var s=function(c,d){return hm(function(){return o(c,d)},l)};return s.displayName=e.displayName,b8&&Object.defineProperty(s,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(s.contextTypes=e.contextTypes),n&&(s=xn.forwardRef(s)),s=xn.memo(s),S8(e,s),s}var w8={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function S8(e,i){Object.keys(e).forEach(function(t){w8[t]||Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))})}function F_(e){var i=e.children,t=e.render;i&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var n=i||t;return typeof n!="function"?null:hm(n)}F_.displayName="Observer";function E8(e,i){return xn.useState(function(){return un(e(),i,{autoBind:!0})})[0]}function z_(e){var i=xn.useState(function(){return un(e,{},{deep:!1})})[0];return lc(function(){Object.assign(i,e)}),i}function O8(e,i){var t=i&&z_(i);return xn.useState(function(){return un(e(t),void 0,{autoBind:!0})})[0]}var Ng;N_(s8.unstable_batchedUpdates);var x8=(Ng=gp.finalizeAllImmediately)!==null&&Ng!==void 0?Ng:function(){};function P8(e,i){return i===void 0&&(i="observed"),hm(e,i)}function C8(e){D_(e)}const k8=Object.freeze(Object.defineProperty({__proto__:null,Observer:F_,_observerFinalizationRegistry:gp,clearTimers:x8,enableStaticRendering:D_,isObserverBatched:c8,isUsingStaticRendering:dm,observer:_8,observerBatching:N_,useAsObservableSource:z_,useLocalObservable:E8,useLocalStore:O8,useObserver:P8,useStaticRendering:C8},Symbol.toStringTag,{value:"Module"})),Qi=Xl(k8);var Is={};const La=Xl(l8);var rp={exports:{}},vf={},Ig={},Dg={},qv;function Nt(){return qv||(qv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const i=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof ic<"u"?ic:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.18",isBrowser:t(),isUnminified:/param/.test((function(o){}).toString()),dblClickWindow:400,getAngle(o){return e.Konva.angleDeg?o*i:o},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 o;return(o=e.Konva.Transformer)===null||o===void 0?void 0:o.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(o){e.glob.Konva=o}};const n=o=>{e.Konva[o.prototype.getClassName()]=o};e._registerNode=n,e.Konva._injectGlobal(e.Konva)}(Dg)),Dg}var jg={},Hv;function In(){return Hv||(Hv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const i=Nt();class t{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 t(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){const 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){const O=Math.cos(y),M=Math.sin(y),R=this.m[0]*O+this.m[2]*M,D=this.m[1]*O+this.m[3]*M,T=this.m[0]*-M+this.m[2]*O,S=this.m[1]*-M+this.m[3]*O;return this.m[0]=R,this.m[1]=D,this.m[2]=T,this.m[3]=S,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(y,O){const M=this.m[0]+this.m[2]*O,R=this.m[1]+this.m[3]*O,D=this.m[2]+this.m[0]*y,T=this.m[3]+this.m[1]*y;return this.m[0]=M,this.m[1]=R,this.m[2]=D,this.m[3]=T,this}multiply(y){const O=this.m[0]*y.m[0]+this.m[2]*y.m[1],M=this.m[1]*y.m[0]+this.m[3]*y.m[1],R=this.m[0]*y.m[2]+this.m[2]*y.m[3],D=this.m[1]*y.m[2]+this.m[3]*y.m[3],T=this.m[0]*y.m[4]+this.m[2]*y.m[5]+this.m[4],S=this.m[1]*y.m[4]+this.m[3]*y.m[5]+this.m[5];return this.m[0]=O,this.m[1]=M,this.m[2]=R,this.m[3]=D,this.m[4]=T,this.m[5]=S,this}invert(){const y=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),O=this.m[3]*y,M=-this.m[1]*y,R=-this.m[2]*y,D=this.m[0]*y,T=y*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),S=y*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=O,this.m[1]=M,this.m[2]=R,this.m[3]=D,this.m[4]=T,this.m[5]=S,this}getMatrix(){return this.m}decompose(){const y=this.m[0],O=this.m[1],M=this.m[2],R=this.m[3],D=this.m[4],T=this.m[5],S=y*R-O*M,A={x:D,y:T,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(y!=0||O!=0){const N=Math.sqrt(y*y+O*O);A.rotation=O>0?Math.acos(y/N):-Math.acos(y/N),A.scaleX=N,A.scaleY=S/N,A.skewX=(y*M+O*R)/S,A.skewY=0}else if(M!=0||R!=0){const N=Math.sqrt(M*M+R*R);A.rotation=Math.PI/2-(R>0?Math.acos(-M/N):-Math.acos(M/N)),A.scaleX=S/N,A.scaleY=N,A.skewX=0,A.skewY=(y*M+O*R)/S}return A.rotation=e.Util._getRotation(A.rotation),A}}e.Transform=t;const n="[object Array]",o="[object Number]",l="[object String]",s="[object Boolean]",c=Math.PI/180,d=180/Math.PI,b="#",w="",E="0",x="Konva warning: ",m="Konva error: ",_="rgb(",p={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]},h=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let P=[];const g=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(v){setTimeout(v,60)};e.Util={_isElement(v){return!!(v&&v.nodeType==1)},_isFunction(v){return!!(v&&v.constructor&&v.call&&v.apply)},_isPlainObject(v){return!!v&&v.constructor===Object},_isArray(v){return Object.prototype.toString.call(v)===n},_isNumber(v){return Object.prototype.toString.call(v)===o&&!isNaN(v)&&isFinite(v)},_isString(v){return Object.prototype.toString.call(v)===l},_isBoolean(v){return Object.prototype.toString.call(v)===s},isObject(v){return v instanceof Object},isValidSelector(v){if(typeof v!="string")return!1;const y=v[0];return y==="#"||y==="."||y===y.toUpperCase()},_sign(v){return v===0||v>0?1:-1},requestAnimFrame(v){P.push(v),P.length===1&&g(function(){const y=P;P=[],y.forEach(function(O){O()})})},createCanvasElement(){const v=document.createElement("canvas");try{v.style=v.style||{}}catch{}return v},createImageElement(){return document.createElement("img")},_isInDocument(v){for(;v=v.parentNode;)if(v==document)return!0;return!1},_urlToImage(v,y){const O=e.Util.createImageElement();O.onload=function(){y(O)},O.src=v},_rgbToHex(v,y,O){return((1<<24)+(v<<16)+(y<<8)+O).toString(16).slice(1)},_hexToRgb(v){v=v.replace(b,w);const y=parseInt(v,16);return{r:y>>16&255,g:y>>8&255,b:y&255}},getRandomColor(){let v=(Math.random()*16777215<<0).toString(16);for(;v.length<6;)v=E+v;return b+v},getRGB(v){let y;return v in p?(y=p[v],{r:y[0],g:y[1],b:y[2]}):v[0]===b?this._hexToRgb(v.substring(1)):v.substr(0,4)===_?(y=h.exec(v.replace(/ /g,"")),{r:parseInt(y[1],10),g:parseInt(y[2],10),b:parseInt(y[3],10)}):{r:0,g:0,b:0}},colorToRGBA(v){return v=v||"black",e.Util._namedColorToRBA(v)||e.Util._hex3ColorToRGBA(v)||e.Util._hex4ColorToRGBA(v)||e.Util._hex6ColorToRGBA(v)||e.Util._hex8ColorToRGBA(v)||e.Util._rgbColorToRGBA(v)||e.Util._rgbaColorToRGBA(v)||e.Util._hslColorToRGBA(v)},_namedColorToRBA(v){const y=p[v.toLowerCase()];return y?{r:y[0],g:y[1],b:y[2],a:1}:null},_rgbColorToRGBA(v){if(v.indexOf("rgb(")===0){v=v.match(/rgb\(([^)]+)\)/)[1];const y=v.split(/ *, */).map(Number);return{r:y[0],g:y[1],b:y[2],a:1}}},_rgbaColorToRGBA(v){if(v.indexOf("rgba(")===0){v=v.match(/rgba\(([^)]+)\)/)[1];const y=v.split(/ *, */).map((O,M)=>O.slice(-1)==="%"?M===3?parseInt(O)/100:parseInt(O)/100*255:Number(O));return{r:y[0],g:y[1],b:y[2],a:y[3]}}},_hex8ColorToRGBA(v){if(v[0]==="#"&&v.length===9)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:parseInt(v.slice(7,9),16)/255}},_hex6ColorToRGBA(v){if(v[0]==="#"&&v.length===7)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:1}},_hex4ColorToRGBA(v){if(v[0]==="#"&&v.length===5)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:parseInt(v[4]+v[4],16)/255}},_hex3ColorToRGBA(v){if(v[0]==="#"&&v.length===4)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:1}},_hslColorToRGBA(v){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(v)){const[y,...O]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(v),M=Number(O[0])/360,R=Number(O[1])/100,D=Number(O[2])/100;let T,S,A;if(R===0)return A=D*255,{r:Math.round(A),g:Math.round(A),b:Math.round(A),a:1};D<.5?T=D*(1+R):T=D+R-D*R;const N=2*D-T,k=[0,0,0];for(let L=0;L<3;L++)S=M+1/3*-(L-1),S<0&&S++,S>1&&S--,6*S<1?A=N+(T-N)*6*S:2*S<1?A=T:3*S<2?A=N+(T-N)*(2/3-S)*6:A=N,k[L]=A*255;return{r:Math.round(k[0]),g:Math.round(k[1]),b:Math.round(k[2]),a:1}}},haveIntersection(v,y){return!(y.x>v.x+v.width||y.x+y.width<v.x||y.y>v.y+v.height||y.y+y.height<v.y)},cloneObject(v){const y={};for(const O in v)this._isPlainObject(v[O])?y[O]=this.cloneObject(v[O]):this._isArray(v[O])?y[O]=this.cloneArray(v[O]):y[O]=v[O];return y},cloneArray(v){return v.slice(0)},degToRad(v){return v*c},radToDeg(v){return v*d},_degToRad(v){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(v)},_radToDeg(v){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(v)},_getRotation(v){return i.Konva.angleDeg?e.Util.radToDeg(v):v},_capitalize(v){return v.charAt(0).toUpperCase()+v.slice(1)},throw(v){throw new Error(m+v)},error(v){console.error(m+v)},warn(v){i.Konva.showWarnings&&console.warn(x+v)},each(v,y){for(const O in v)y(O,v[O])},_inRange(v,y,O){return y<=v&&v<O},_getProjectionToSegment(v,y,O,M,R,D){let T,S,A;const N=(v-O)*(v-O)+(y-M)*(y-M);if(N==0)T=v,S=y,A=(R-O)*(R-O)+(D-M)*(D-M);else{const k=((R-v)*(O-v)+(D-y)*(M-y))/N;k<0?(T=v,S=y,A=(v-R)*(v-R)+(y-D)*(y-D)):k>1?(T=O,S=M,A=(O-R)*(O-R)+(M-D)*(M-D)):(T=v+k*(O-v),S=y+k*(M-y),A=(T-R)*(T-R)+(S-D)*(S-D))}return[T,S,A]},_getProjectionToLine(v,y,O){const M=e.Util.cloneObject(v);let R=Number.MAX_VALUE;return y.forEach(function(D,T){if(!O&&T===y.length-1)return;const S=y[(T+1)%y.length],A=e.Util._getProjectionToSegment(D.x,D.y,S.x,S.y,v.x,v.y),N=A[0],k=A[1],L=A[2];L<R&&(M.x=N,M.y=k,R=L)}),M},_prepareArrayForTween(v,y,O){const M=[],R=[];if(v.length>y.length){const T=y;y=v,v=T}for(let T=0;T<v.length;T+=2)M.push({x:v[T],y:v[T+1]});for(let T=0;T<y.length;T+=2)R.push({x:y[T],y:y[T+1]});const D=[];return R.forEach(function(T){const S=e.Util._getProjectionToLine(T,M,O);D.push(S.x),D.push(S.y)}),D},_prepareToStringify(v){let y;v.visitedByCircularReferenceRemoval=!0;for(const O in v)if(v.hasOwnProperty(O)&&v[O]&&typeof v[O]=="object"){if(y=Object.getOwnPropertyDescriptor(v,O),v[O].visitedByCircularReferenceRemoval||e.Util._isElement(v[O]))if(y.configurable)delete v[O];else return null;else if(e.Util._prepareToStringify(v[O])===null)if(y.configurable)delete v[O];else return null}return delete v.visitedByCircularReferenceRemoval,v},_assign(v,y){for(const O in y)v[O]=y[O];return v},_getFirstPointerId(v){return v.touches?v.changedTouches[0].identifier:v.pointerId||999},releaseCanvas(...v){i.Konva.releaseCanvasOnDestroy&&v.forEach(y=>{y.width=0,y.height=0})},drawRoundedRectPath(v,y,O,M){let R=0,D=0,T=0,S=0;typeof M=="number"?R=D=T=S=Math.min(M,y/2,O/2):(R=Math.min(M[0]||0,y/2,O/2),D=Math.min(M[1]||0,y/2,O/2),S=Math.min(M[2]||0,y/2,O/2),T=Math.min(M[3]||0,y/2,O/2)),v.moveTo(R,0),v.lineTo(y-D,0),v.arc(y-D,D,D,Math.PI*3/2,0,!1),v.lineTo(y,O-S),v.arc(y-S,O-S,S,0,Math.PI/2,!1),v.lineTo(T,O),v.arc(T,O-T,T,Math.PI/2,Math.PI,!1),v.lineTo(0,R),v.arc(R,R,R,Math.PI,Math.PI*3/2,!1)}}}(jg)),jg}var yf={},Fg={},gi={},Gv;function Bt(){if(Gv)return gi;Gv=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.RGBComponent=n,gi.alphaComponent=o,gi.getNumberValidator=l,gi.getNumberOrArrayOfNumbersValidator=s,gi.getNumberOrAutoValidator=c,gi.getStringValidator=d,gi.getStringOrGradientValidator=b,gi.getFunctionValidator=w,gi.getNumberArrayValidator=E,gi.getBooleanValidator=x,gi.getComponentValidator=m;const e=Nt(),i=In();function t(_){return i.Util._isString(_)?'"'+_+'"':Object.prototype.toString.call(_)==="[object Number]"||i.Util._isBoolean(_)?_:Object.prototype.toString.call(_)}function n(_){return _>255?255:_<0?0:Math.round(_)}function o(_){return _>1?1:_<1e-4?1e-4:_}function l(){if(e.Konva.isUnminified)return function(_,p){return i.Util._isNumber(_)||i.Util.warn(t(_)+' is a not valid value for "'+p+'" attribute. The value should be a number.'),_}}function s(_){if(e.Konva.isUnminified)return function(p,h){let P=i.Util._isNumber(p),g=i.Util._isArray(p)&&p.length==_;return!P&&!g&&i.Util.warn(t(p)+' is a not valid value for "'+h+'" attribute. The value should be a number or Array<number>('+_+")"),p}}function c(){if(e.Konva.isUnminified)return function(_,p){var h=i.Util._isNumber(_),P=_==="auto";return h||P||i.Util.warn(t(_)+' is a not valid value for "'+p+'" attribute. The value should be a number or "auto".'),_}}function d(){if(e.Konva.isUnminified)return function(_,p){return i.Util._isString(_)||i.Util.warn(t(_)+' is a not valid value for "'+p+'" attribute. The value should be a string.'),_}}function b(){if(e.Konva.isUnminified)return function(_,p){const h=i.Util._isString(_),P=Object.prototype.toString.call(_)==="[object CanvasGradient]"||_&&_.addColorStop;return h||P||i.Util.warn(t(_)+' is a not valid value for "'+p+'" attribute. The value should be a string or a native gradient.'),_}}function w(){if(e.Konva.isUnminified)return function(_,p){return i.Util._isFunction(_)||i.Util.warn(t(_)+' is a not valid value for "'+p+'" attribute. The value should be a function.'),_}}function E(){if(e.Konva.isUnminified)return function(_,p){const h=Int8Array?Object.getPrototypeOf(Int8Array):null;return h&&_ instanceof h||(i.Util._isArray(_)?_.forEach(function(P){i.Util._isNumber(P)||i.Util.warn('"'+p+'" attribute has non numeric element '+P+". Make sure that all elements are numbers.")}):i.Util.warn(t(_)+' is a not valid value for "'+p+'" attribute. The value should be a array of numbers.')),_}}function x(){if(e.Konva.isUnminified)return function(_,p){var h=_===!0||_===!1;return h||i.Util.warn(t(_)+' is a not valid value for "'+p+'" attribute. The value should be a boolean.'),_}}function m(_){if(e.Konva.isUnminified)return function(p,h){return p==null||i.Util.isObject(p)||i.Util.warn(t(p)+' is a not valid value for "'+h+'" attribute. The value should be an object with properties '+_),p}}return gi}var Vv;function Ft(){return Vv||(Vv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const i=In(),t=Bt(),n="get",o="set";e.Factory={addGetterSetter(l,s,c,d,b){e.Factory.addGetter(l,s,c),e.Factory.addSetter(l,s,d,b),e.Factory.addOverloadedGetterSetter(l,s)},addGetter(l,s,c){var d=n+i.Util._capitalize(s);l.prototype[d]=l.prototype[d]||function(){const b=this.attrs[s];return b===void 0?c:b}},addSetter(l,s,c,d){var b=o+i.Util._capitalize(s);l.prototype[b]||e.Factory.overWriteSetter(l,s,c,d)},overWriteSetter(l,s,c,d){var b=o+i.Util._capitalize(s);l.prototype[b]=function(w){return c&&w!==void 0&&w!==null&&(w=c.call(this,w,s)),this._setAttr(s,w),d&&d.call(this),this}},addComponentsGetterSetter(l,s,c,d,b){const w=c.length,E=i.Util._capitalize,x=n+E(s),m=o+E(s);l.prototype[x]=function(){const p={};for(let h=0;h<w;h++){const P=c[h];p[P]=this.getAttr(s+E(P))}return p};const _=(0,t.getComponentValidator)(c);l.prototype[m]=function(p){const h=this.attrs[s];d&&(p=d.call(this,p,s)),_&&_.call(this,p,s);for(const P in p)p.hasOwnProperty(P)&&this._setAttr(s+E(P),p[P]);return p||c.forEach(P=>{this._setAttr(s+E(P),void 0)}),this._fireChangeEvent(s,h,p),b&&b.call(this),this},e.Factory.addOverloadedGetterSetter(l,s)},addOverloadedGetterSetter(l,s){var c=i.Util._capitalize(s),d=o+c,b=n+c;l.prototype[s]=function(){return arguments.length?(this[d](arguments[0]),this):this[b]()}},addDeprecatedGetterSetter(l,s,c,d){i.Util.error("Adding deprecated "+s);const b=n+i.Util._capitalize(s),w=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";l.prototype[b]=function(){i.Util.error(w);const E=this.attrs[s];return E===void 0?c:E},e.Factory.addSetter(l,s,d,function(){i.Util.error(w)}),e.Factory.addOverloadedGetterSetter(l,s)},backCompat(l,s){i.Util.each(s,function(c,d){const b=l.prototype[d],w=n+i.Util._capitalize(c),E=o+i.Util._capitalize(c);function x(){b.apply(this,arguments),i.Util.error('"'+c+'" method is deprecated and will be removed soon. Use ""'+d+'" instead.')}l.prototype[c]=x,l.prototype[w]=x,l.prototype[E]=x})},afterSetFilter(){this._filterUpToDate=!1}}}(Fg)),Fg}var Uo={},qo={},$v;function B_(){if($v)return qo;$v=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.HitContext=qo.SceneContext=qo.Context=void 0;const e=In(),i=Nt();function t(P){const g=[],v=P.length,y=e.Util;for(let O=0;O<v;O++){let M=P[O];y._isNumber(M)?M=Math.round(M*1e3)/1e3:y._isString(M)||(M=M+""),g.push(M)}return g}const n=",",o="(",l=")",s="([",c="])",d=";",b="()",w="=",E=["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"],x=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],m=100;let _=class{constructor(g){this.canvas=g,i.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(g){g.fillEnabled()&&this._fill(g)}_fill(g){}strokeShape(g){g.hasStroke()&&this._stroke(g)}_stroke(g){}fillStrokeShape(g){g.attrs.fillAfterStrokeEnabled?(this.strokeShape(g),this.fillShape(g)):(this.fillShape(g),this.strokeShape(g))}getTrace(g,v){let y=this.traceArr,O=y.length,M="",R,D,T,S;for(R=0;R<O;R++)D=y[R],T=D.method,T?(S=D.args,M+=T,g?M+=b:e.Util._isArray(S[0])?M+=s+S.join(n)+c:(v&&(S=S.map(A=>typeof A=="number"?Math.floor(A):A)),M+=o+S.join(n)+l)):(M+=D.property,g||(M+=w+D.val)),M+=d;return M}clearTrace(){this.traceArr=[]}_trace(g){let v=this.traceArr,y;v.push(g),y=v.length,y>=m&&v.shift()}reset(){const g=this.getCanvas().getPixelRatio();this.setTransform(1*g,0,0,1*g,0,0)}getCanvas(){return this.canvas}clear(g){const v=this.getCanvas();g?this.clearRect(g.x||0,g.y||0,g.width||0,g.height||0):this.clearRect(0,0,v.getWidth()/v.pixelRatio,v.getHeight()/v.pixelRatio)}_applyLineCap(g){const v=g.attrs.lineCap;v&&this.setAttr("lineCap",v)}_applyOpacity(g){const v=g.getAbsoluteOpacity();v!==1&&this.setAttr("globalAlpha",v)}_applyLineJoin(g){const v=g.attrs.lineJoin;v&&this.setAttr("lineJoin",v)}setAttr(g,v){this._context[g]=v}arc(g,v,y,O,M,R){this._context.arc(g,v,y,O,M,R)}arcTo(g,v,y,O,M){this._context.arcTo(g,v,y,O,M)}beginPath(){this._context.beginPath()}bezierCurveTo(g,v,y,O,M,R){this._context.bezierCurveTo(g,v,y,O,M,R)}clearRect(g,v,y,O){this._context.clearRect(g,v,y,O)}clip(...g){this._context.clip.apply(this._context,g)}closePath(){this._context.closePath()}createImageData(g,v){const y=arguments;if(y.length===2)return this._context.createImageData(g,v);if(y.length===1)return this._context.createImageData(g)}createLinearGradient(g,v,y,O){return this._context.createLinearGradient(g,v,y,O)}createPattern(g,v){return this._context.createPattern(g,v)}createRadialGradient(g,v,y,O,M,R){return this._context.createRadialGradient(g,v,y,O,M,R)}drawImage(g,v,y,O,M,R,D,T,S){const A=arguments,N=this._context;A.length===3?N.drawImage(g,v,y):A.length===5?N.drawImage(g,v,y,O,M):A.length===9&&N.drawImage(g,v,y,O,M,R,D,T,S)}ellipse(g,v,y,O,M,R,D,T){this._context.ellipse(g,v,y,O,M,R,D,T)}isPointInPath(g,v,y,O){return y?this._context.isPointInPath(y,g,v,O):this._context.isPointInPath(g,v,O)}fill(...g){this._context.fill.apply(this._context,g)}fillRect(g,v,y,O){this._context.fillRect(g,v,y,O)}strokeRect(g,v,y,O){this._context.strokeRect(g,v,y,O)}fillText(g,v,y,O){O?this._context.fillText(g,v,y,O):this._context.fillText(g,v,y)}measureText(g){return this._context.measureText(g)}getImageData(g,v,y,O){return this._context.getImageData(g,v,y,O)}lineTo(g,v){this._context.lineTo(g,v)}moveTo(g,v){this._context.moveTo(g,v)}rect(g,v,y,O){this._context.rect(g,v,y,O)}roundRect(g,v,y,O,M){this._context.roundRect(g,v,y,O,M)}putImageData(g,v,y){this._context.putImageData(g,v,y)}quadraticCurveTo(g,v,y,O){this._context.quadraticCurveTo(g,v,y,O)}restore(){this._context.restore()}rotate(g){this._context.rotate(g)}save(){this._context.save()}scale(g,v){this._context.scale(g,v)}setLineDash(g){this._context.setLineDash?this._context.setLineDash(g):"mozDash"in this._context?this._context.mozDash=g:"webkitLineDash"in this._context&&(this._context.webkitLineDash=g)}getLineDash(){return this._context.getLineDash()}setTransform(g,v,y,O,M,R){this._context.setTransform(g,v,y,O,M,R)}stroke(g){g?this._context.stroke(g):this._context.stroke()}strokeText(g,v,y,O){this._context.strokeText(g,v,y,O)}transform(g,v,y,O,M,R){this._context.transform(g,v,y,O,M,R)}translate(g,v){this._context.translate(g,v)}_enableTrace(){let g=this,v=E.length,y=this.setAttr,O,M;const R=function(D){let T=g[D],S;g[D]=function(){return M=t(Array.prototype.slice.call(arguments,0)),S=T.apply(g,arguments),g._trace({method:D,args:M}),S}};for(O=0;O<v;O++)R(E[O]);g.setAttr=function(){y.apply(g,arguments);const D=arguments[0];let T=arguments[1];(D==="shadowOffsetX"||D==="shadowOffsetY"||D==="shadowBlur")&&(T=T/this.canvas.getPixelRatio()),g._trace({property:D,val:T})}}_applyGlobalCompositeOperation(g){const v=g.attrs.globalCompositeOperation;!v||v==="source-over"||this.setAttr("globalCompositeOperation",v)}};qo.Context=_,x.forEach(function(P){Object.defineProperty(_.prototype,P,{get(){return this._context[P]},set(g){this._context[P]=g}})});class p extends _{constructor(g,{willReadFrequently:v=!1}={}){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:v})}_fillColor(g){const v=g.fill();this.setAttr("fillStyle",v),g._fillFunc(this)}_fillPattern(g){this.setAttr("fillStyle",g._getFillPattern()),g._fillFunc(this)}_fillLinearGradient(g){const v=g._getLinearGradient();v&&(this.setAttr("fillStyle",v),g._fillFunc(this))}_fillRadialGradient(g){const v=g._getRadialGradient();v&&(this.setAttr("fillStyle",v),g._fillFunc(this))}_fill(g){const v=g.fill(),y=g.getFillPriority();if(v&&y==="color"){this._fillColor(g);return}const O=g.getFillPatternImage();if(O&&y==="pattern"){this._fillPattern(g);return}const M=g.getFillLinearGradientColorStops();if(M&&y==="linear-gradient"){this._fillLinearGradient(g);return}const R=g.getFillRadialGradientColorStops();if(R&&y==="radial-gradient"){this._fillRadialGradient(g);return}v?this._fillColor(g):O?this._fillPattern(g):M?this._fillLinearGradient(g):R&&this._fillRadialGradient(g)}_strokeLinearGradient(g){const v=g.getStrokeLinearGradientStartPoint(),y=g.getStrokeLinearGradientEndPoint(),O=g.getStrokeLinearGradientColorStops(),M=this.createLinearGradient(v.x,v.y,y.x,y.y);if(O){for(let R=0;R<O.length;R+=2)M.addColorStop(O[R],O[R+1]);this.setAttr("strokeStyle",M)}}_stroke(g){const v=g.dash(),y=g.getStrokeScaleEnabled();if(g.hasStroke()){if(!y){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g),v&&g.dashEnabled()&&(this.setLineDash(v),this.setAttr("lineDashOffset",g.dashOffset())),this.setAttr("lineWidth",g.strokeWidth()),g.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),g.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(g):this.setAttr("strokeStyle",g.stroke()),g._strokeFunc(this),y||this.restore()}}_applyShadow(g){var v,y,O;const M=(v=g.getShadowRGBA())!==null&&v!==void 0?v:"black",R=(y=g.getShadowBlur())!==null&&y!==void 0?y:5,D=(O=g.getShadowOffset())!==null&&O!==void 0?O:{x:0,y:0},T=g.getAbsoluteScale(),S=this.canvas.getPixelRatio(),A=T.x*S,N=T.y*S;this.setAttr("shadowColor",M),this.setAttr("shadowBlur",R*Math.min(Math.abs(A),Math.abs(N))),this.setAttr("shadowOffsetX",D.x*A),this.setAttr("shadowOffsetY",D.y*N)}}qo.SceneContext=p;class h extends _{constructor(g){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:!0})}_fill(g){this.save(),this.setAttr("fillStyle",g.colorKey),g._fillFuncHit(this),this.restore()}strokeShape(g){g.hasHitStroke()&&this._stroke(g)}_stroke(g){if(g.hasHitStroke()){const v=g.getStrokeScaleEnabled();if(!v){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g);const y=g.hitStrokeWidth(),O=y==="auto"?g.strokeWidth():y;this.setAttr("lineWidth",O),this.setAttr("strokeStyle",g.colorKey),g._strokeFuncHit(this),v||this.restore()}}}return qo.HitContext=h,qo}var Wv;function Lp(){if(Wv)return Uo;Wv=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.HitCanvas=Uo.SceneCanvas=Uo.Canvas=void 0;const e=In(),i=B_(),t=Nt(),n=Ft(),o=Bt();let l;function s(){if(l)return l;const w=e.Util.createCanvasElement(),E=w.getContext("2d");return l=function(){const x=t.Konva._global.devicePixelRatio||1,m=E.webkitBackingStorePixelRatio||E.mozBackingStorePixelRatio||E.msBackingStorePixelRatio||E.oBackingStorePixelRatio||E.backingStorePixelRatio||1;return x/m}(),e.Util.releaseCanvas(w),l}let c=class{constructor(E){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const m=(E||{}).pixelRatio||t.Konva.pixelRatio||s();this.pixelRatio=m,this._canvas=e.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(E){const x=this.pixelRatio;this.pixelRatio=E,this.setSize(this.getWidth()/x,this.getHeight()/x)}setWidth(E){this.width=this._canvas.width=E*this.pixelRatio,this._canvas.style.width=E+"px";const x=this.pixelRatio;this.getContext()._context.scale(x,x)}setHeight(E){this.height=this._canvas.height=E*this.pixelRatio,this._canvas.style.height=E+"px";const x=this.pixelRatio;this.getContext()._context.scale(x,x)}getWidth(){return this.width}getHeight(){return this.height}setSize(E,x){this.setWidth(E||0),this.setHeight(x||0)}toDataURL(E,x){try{return this._canvas.toDataURL(E,x)}catch{try{return this._canvas.toDataURL()}catch(_){return e.Util.error("Unable to get data URL. "+_.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};Uo.Canvas=c,n.Factory.addGetterSetter(c,"pixelRatio",void 0,(0,o.getNumberValidator)());class d extends c{constructor(E={width:0,height:0,willReadFrequently:!1}){super(E),this.context=new i.SceneContext(this,{willReadFrequently:E.willReadFrequently}),this.setSize(E.width,E.height)}}Uo.SceneCanvas=d;class b extends c{constructor(E={width:0,height:0}){super(E),this.hitCanvas=!0,this.context=new i.HitContext(this),this.setSize(E.width,E.height)}}return Uo.HitCanvas=b,Uo}var zg={},Yv;function pm(){return Yv||(Yv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const i=Nt(),t=In();e.DD={get isDragging(){let n=!1;return e.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return e.DD._dragElements.forEach(o=>{n=o.node}),n},_dragElements:new Map,_drag(n){const o=[];e.DD._dragElements.forEach((l,s)=>{const{node:c}=l,d=c.getStage();d.setPointersPositions(n),l.pointerId===void 0&&(l.pointerId=t.Util._getFirstPointerId(n));const b=d._changedPointerPositions.find(w=>w.id===l.pointerId);if(b){if(l.dragStatus!=="dragging"){const w=c.dragDistance();if(Math.max(Math.abs(b.x-l.startPointerPos.x),Math.abs(b.y-l.startPointerPos.y))<w||(c.startDrag({evt:n}),!c.isDragging()))return}c._setDragPosition(n,l),o.push(c)}}),o.forEach(l=>{l.fire("dragmove",{type:"dragmove",target:l,evt:n},!0)})},_endDragBefore(n){const o=[];e.DD._dragElements.forEach(l=>{const{node:s}=l,c=s.getStage();if(n&&c.setPointersPositions(n),!c._changedPointerPositions.find(w=>w.id===l.pointerId))return;(l.dragStatus==="dragging"||l.dragStatus==="stopped")&&(e.DD.justDragged=!0,i.Konva._mouseListenClick=!1,i.Konva._touchListenClick=!1,i.Konva._pointerListenClick=!1,l.dragStatus="stopped");const b=l.node.getLayer()||l.node instanceof i.Konva.Stage&&l.node;b&&o.indexOf(b)===-1&&o.push(b)}),o.forEach(l=>{l.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((o,l)=>{o.dragStatus==="stopped"&&o.node.fire("dragend",{type:"dragend",target:o.node,evt:n},!0),o.dragStatus!=="dragging"&&e.DD._dragElements.delete(l)})}},i.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",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),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(zg)),zg}var Kv;function Hn(){if(Kv)return yf;Kv=1,Object.defineProperty(yf,"__esModule",{value:!0}),yf.Node=void 0;const e=In(),i=Ft(),t=Lp(),n=Nt(),o=pm(),l=Bt(),s="absoluteOpacity",c="allEventListeners",d="absoluteTransform",b="absoluteScale",w="canvas",E="Change",x="children",m="konva",_="listening",p="mouseenter",h="mouseleave",P="set",g="Shape",v=" ",y="stage",O="transform",M="Stage",R="visible",D=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(v);let T=1;class S{constructor(k){this._id=T++,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(k),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(k){(k===O||k===d)&&this._cache.get(k)?this._cache.get(k).dirty=!0:k?this._cache.delete(k):this._cache.clear()}_getCache(k,L){let B=this._cache.get(k);return(B===void 0||(k===O||k===d)&&B.dirty===!0)&&(B=L.call(this),this._cache.set(k,B)),B}_calculate(k,L,B){if(!this._attachedDepsListeners.get(k)){const X=L.map(K=>K+"Change.konva").join(v);this.on(X,()=>{this._clearCache(k)}),this._attachedDepsListeners.set(k,!0)}return this._getCache(k,B)}_getCanvasCache(){return this._cache.get(w)}_clearSelfAndDescendantCache(k){this._clearCache(k),k===d&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(w)){const{scene:k,filter:L,hit:B}=this._cache.get(w);e.Util.releaseCanvas(k,L,B),this._cache.delete(w)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(k){const L=k||{};let B={};(L.x===void 0||L.y===void 0||L.width===void 0||L.height===void 0)&&(B=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let X=Math.ceil(L.width||B.width),K=Math.ceil(L.height||B.height),Q=L.pixelRatio,H=L.x===void 0?Math.floor(B.x):L.x,z=L.y===void 0?Math.floor(B.y):L.y,I=L.offset||0,U=L.drawBorder||!1,$=L.hitCanvasPixelRatio||1;if(!X||!K){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const ee=Math.abs(Math.round(B.x)-H)>.5?1:0,G=Math.abs(Math.round(B.y)-z)>.5?1:0;X+=I*2+ee,K+=I*2+G,H-=I,z-=I;const Z=new t.SceneCanvas({pixelRatio:Q,width:X,height:K}),W=new t.SceneCanvas({pixelRatio:Q,width:0,height:0,willReadFrequently:!0}),te=new t.HitCanvas({pixelRatio:$,width:X,height:K}),re=Z.getContext(),ie=te.getContext();return te.isCache=!0,Z.isCache=!0,this._cache.delete(w),this._filterUpToDate=!1,L.imageSmoothingEnabled===!1&&(Z.getContext()._context.imageSmoothingEnabled=!1,W.getContext()._context.imageSmoothingEnabled=!1),re.save(),ie.save(),re.translate(-H,-z),ie.translate(-H,-z),this._isUnderCache=!0,this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(b),this.drawScene(Z,this),this.drawHit(te,this),this._isUnderCache=!1,re.restore(),ie.restore(),U&&(re.save(),re.beginPath(),re.rect(0,0,X,K),re.closePath(),re.setAttr("strokeStyle","red"),re.setAttr("lineWidth",5),re.stroke(),re.restore()),this._cache.set(w,{scene:Z,filter:W,hit:te,x:H,y:z}),this._requestDraw(),this}isCached(){return this._cache.has(w)}getClientRect(k){throw new Error('abstract "getClientRect" method call')}_transformedRect(k,L){const B=[{x:k.x,y:k.y},{x:k.x+k.width,y:k.y},{x:k.x+k.width,y:k.y+k.height},{x:k.x,y:k.y+k.height}];let X=1/0,K=1/0,Q=-1/0,H=-1/0;const z=this.getAbsoluteTransform(L);return B.forEach(function(I){const U=z.point(I);X===void 0&&(X=Q=U.x,K=H=U.y),X=Math.min(X,U.x),K=Math.min(K,U.y),Q=Math.max(Q,U.x),H=Math.max(H,U.y)}),{x:X,y:K,width:Q-X,height:H-K}}_drawCachedSceneCanvas(k){k.save(),k._applyOpacity(this),k._applyGlobalCompositeOperation(this);const L=this._getCanvasCache();k.translate(L.x,L.y);const B=this._getCachedSceneCanvas(),X=B.pixelRatio;k.drawImage(B._canvas,0,0,B.width/X,B.height/X),k.restore()}_drawCachedHitCanvas(k){const L=this._getCanvasCache(),B=L.hit;k.save(),k.translate(L.x,L.y),k.drawImage(B._canvas,0,0,B.width/B.pixelRatio,B.height/B.pixelRatio),k.restore()}_getCachedSceneCanvas(){let k=this.filters(),L=this._getCanvasCache(),B=L.scene,X=L.filter,K=X.getContext(),Q,H,z,I;if(k){if(!this._filterUpToDate){const U=B.pixelRatio;X.setSize(B.width/B.pixelRatio,B.height/B.pixelRatio);try{for(Q=k.length,K.clear(),K.drawImage(B._canvas,0,0,B.getWidth()/U,B.getHeight()/U),H=K.getImageData(0,0,X.getWidth(),X.getHeight()),z=0;z<Q;z++){if(I=k[z],typeof I!="function"){e.Util.error("Filter should be type of function, but got "+typeof I+" instead. Please check correct filters");continue}I.call(this,H),K.putImageData(H,0,0)}}catch($){e.Util.error("Unable to apply filter. "+$.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return X}return B}on(k,L){if(this._cache&&this._cache.delete(c),arguments.length===3)return this._delegate.apply(this,arguments);let B=k.split(v),X=B.length,K,Q,H,z,I;for(K=0;K<X;K++)Q=B[K],H=Q.split("."),z=H[0],I=H[1]||"",this.eventListeners[z]||(this.eventListeners[z]=[]),this.eventListeners[z].push({name:I,handler:L});return this}off(k,L){let B=(k||"").split(v),X=B.length,K,Q,H,z,I,U;if(this._cache&&this._cache.delete(c),!k)for(Q in this.eventListeners)this._off(Q);for(K=0;K<X;K++)if(H=B[K],z=H.split("."),I=z[0],U=z[1],I)this.eventListeners[I]&&this._off(I,U,L);else for(Q in this.eventListeners)this._off(Q,U,L);return this}dispatchEvent(k){const L={target:this,type:k.type,evt:k};return this.fire(k.type,L),this}addEventListener(k,L){return this.on(k,function(B){L.call(this,B.evt)}),this}removeEventListener(k){return this.off(k),this}_delegate(k,L,B){const X=this;this.on(k,function(K){const Q=K.target.findAncestors(L,!0,X);for(let H=0;H<Q.length;H++)K=e.Util.cloneObject(K),K.currentTarget=Q[H],B.call(Q[H],K)})}remove(){return this.isDragging()&&this.stopDrag(),o.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(b),this._clearSelfAndDescendantCache(y),this._clearSelfAndDescendantCache(R),this._clearSelfAndDescendantCache(_)}_remove(){this._clearCaches();const k=this.getParent();k&&k.children&&(k.children.splice(this.index,1),k._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(k){const L="get"+e.Util._capitalize(k);return e.Util._isFunction(this[L])?this[L]():this.attrs[k]}getAncestors(){let k=this.getParent(),L=[];for(;k;)L.push(k),k=k.getParent();return L}getAttrs(){return this.attrs||{}}setAttrs(k){return this._batchTransformChanges(()=>{let L,B;if(!k)return this;for(L in k)L!==x&&(B=P+e.Util._capitalize(L),e.Util._isFunction(this[B])?this[B](k[L]):this._setAttr(L,k[L]))}),this}isListening(){return this._getCache(_,this._isListening)}_isListening(k){if(!this.listening())return!1;const B=this.getParent();return B&&B!==k&&this!==k?B._isListening(k):!0}isVisible(){return this._getCache(R,this._isVisible)}_isVisible(k){if(!this.visible())return!1;const B=this.getParent();return B&&B!==k&&this!==k?B._isVisible(k):!0}shouldDrawHit(k,L=!1){if(k)return this._isVisible(k)&&this._isListening(k);const B=this.getLayer();let X=!1;o.DD._dragElements.forEach(Q=>{Q.dragStatus==="dragging"&&(Q.node.nodeType==="Stage"||Q.node.getLayer()===B)&&(X=!0)});const K=!L&&!n.Konva.hitOnDragEnabled&&(X||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!K}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let k=this.getDepth(),L=this,B=0,X,K,Q,H;function z(U){for(X=[],K=U.length,Q=0;Q<K;Q++)H=U[Q],B++,H.nodeType!==g&&(X=X.concat(H.getChildren().slice())),H._id===L._id&&(Q=K);X.length>0&&X[0].getDepth()<=k&&z(X)}const I=this.getStage();return L.nodeType!==M&&I&&z(I.getChildren()),B}getDepth(){let k=0,L=this.parent;for(;L;)k++,L=L.parent;return k}_batchTransformChanges(k){this._batchingTransformChange=!0,k(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(O),this._clearSelfAndDescendantCache(d)),this._needClearTransformCache=!1}setPosition(k){return this._batchTransformChanges(()=>{this.x(k.x),this.y(k.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const k=this.getStage();if(!k)return null;const L=k.getPointerPosition();if(!L)return null;const B=this.getAbsoluteTransform().copy();return B.invert(),B.point(L)}getAbsolutePosition(k){let L=!1,B=this.parent;for(;B;){if(B.isCached()){L=!0;break}B=B.parent}L&&!k&&(k=!0);const X=this.getAbsoluteTransform(k).getMatrix(),K=new e.Transform,Q=this.offset();return K.m=X.slice(),K.translate(Q.x,Q.y),K.getTranslation()}setAbsolutePosition(k){const{x:L,y:B,...X}=this._clearTransform();this.attrs.x=L,this.attrs.y=B,this._clearCache(O);const K=this._getAbsoluteTransform().copy();return K.invert(),K.translate(k.x,k.y),k={x:this.attrs.x+K.getTranslation().x,y:this.attrs.y+K.getTranslation().y},this._setTransform(X),this.setPosition({x:k.x,y:k.y}),this._clearCache(O),this._clearSelfAndDescendantCache(d),this}_setTransform(k){let L;for(L in k)this.attrs[L]=k[L]}_clearTransform(){const k={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,k}move(k){let L=k.x,B=k.y,X=this.x(),K=this.y();return L!==void 0&&(X+=L),B!==void 0&&(K+=B),this.setPosition({x:X,y:K}),this}_eachAncestorReverse(k,L){let B=[],X=this.getParent(),K,Q;if(!(L&&L._id===this._id)){for(B.unshift(this);X&&(!L||X._id!==L._id);)B.unshift(X),X=X.parent;for(K=B.length,Q=0;Q<K;Q++)k(B[Q])}}rotate(k){return this.rotation(this.rotation()+k),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const k=this.index,L=this.parent.getChildren().length;return k<L-1?(this.parent.children.splice(k,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return e.Util.warn("Node has no parent. moveUp function is ignored."),!1;const k=this.index,L=this.parent.getChildren().length;return k<L-1?(this.parent.children.splice(k,1),this.parent.children.splice(k+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return e.Util.warn("Node has no parent. moveDown function is ignored."),!1;const k=this.index;return k>0?(this.parent.children.splice(k,1),this.parent.children.splice(k-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return e.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const k=this.index;return k>0?(this.parent.children.splice(k,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(k){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(k<0||k>=this.parent.children.length)&&e.Util.warn("Unexpected value "+k+" 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)+".");const L=this.index;return this.parent.children.splice(L,1),this.parent.children.splice(k,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(s,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let k=this.opacity();const L=this.getParent();return L&&!L._isUnderCache&&(k*=L.getAbsoluteOpacity()),k}moveTo(k){return this.getParent()!==k&&(this._remove(),k.add(this)),this}toObject(){let k=this.getAttrs(),L,B,X,K,Q;const H={attrs:{},className:this.getClassName()};for(L in k)B=k[L],Q=e.Util.isObject(B)&&!e.Util._isPlainObject(B)&&!e.Util._isArray(B),!Q&&(X=typeof this[L]=="function"&&this[L],delete k[L],K=X?X.call(this):null,k[L]=B,K!==B&&(H.attrs[L]=B));return e.Util._prepareToStringify(H)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(k,L,B){const X=[];L&&this._isMatch(k)&&X.push(this);let K=this.parent;for(;K;){if(K===B)return X;K._isMatch(k)&&X.push(K),K=K.parent}return X}isAncestorOf(k){return!1}findAncestor(k,L,B){return this.findAncestors(k,L,B)[0]}_isMatch(k){if(!k)return!1;if(typeof k=="function")return k(this);let L=k.replace(/ /g,"").split(","),B=L.length,X,K;for(X=0;X<B;X++)if(K=L[X],e.Util.isValidSelector(K)||(e.Util.warn('Selector "'+K+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),e.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),e.Util.warn("Konva is awesome, right?")),K.charAt(0)==="#"){if(this.id()===K.slice(1))return!0}else if(K.charAt(0)==="."){if(this.hasName(K.slice(1)))return!0}else if(this.className===K||this.nodeType===K)return!0;return!1}getLayer(){const k=this.getParent();return k?k.getLayer():null}getStage(){return this._getCache(y,this._getStage)}_getStage(){const k=this.getParent();return k?k.getStage():null}fire(k,L={},B){return L.target=L.target||this,B?this._fireAndBubble(k,L):this._fire(k,L),this}getAbsoluteTransform(k){return k?this._getAbsoluteTransform(k):this._getCache(d,this._getAbsoluteTransform)}_getAbsoluteTransform(k){let L;if(k)return L=new e.Transform,this._eachAncestorReverse(function(B){const X=B.transformsEnabled();X==="all"?L.multiply(B.getTransform()):X==="position"&&L.translate(B.x()-B.offsetX(),B.y()-B.offsetY())},k),L;{L=this._cache.get(d)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(L):L.reset();const B=this.transformsEnabled();if(B==="all")L.multiply(this.getTransform());else if(B==="position"){const X=this.attrs.x||0,K=this.attrs.y||0,Q=this.attrs.offsetX||0,H=this.attrs.offsetY||0;L.translate(X-Q,K-H)}return L.dirty=!1,L}}getAbsoluteScale(k){let L=this;for(;L;)L._isUnderCache&&(k=L),L=L.getParent();const X=this.getAbsoluteTransform(k).decompose();return{x:X.scaleX,y:X.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(O,this._getTransform)}_getTransform(){var k,L;const B=this._cache.get(O)||new e.Transform;B.reset();const X=this.x(),K=this.y(),Q=n.Konva.getAngle(this.rotation()),H=(k=this.attrs.scaleX)!==null&&k!==void 0?k:1,z=(L=this.attrs.scaleY)!==null&&L!==void 0?L:1,I=this.attrs.skewX||0,U=this.attrs.skewY||0,$=this.attrs.offsetX||0,ee=this.attrs.offsetY||0;return(X!==0||K!==0)&&B.translate(X,K),Q!==0&&B.rotate(Q),(I!==0||U!==0)&&B.skew(I,U),(H!==1||z!==1)&&B.scale(H,z),($!==0||ee!==0)&&B.translate(-1*$,-1*ee),B.dirty=!1,B}clone(k){let L=e.Util.cloneObject(this.attrs),B,X,K,Q,H;for(B in k)L[B]=k[B];const z=new this.constructor(L);for(B in this.eventListeners)for(X=this.eventListeners[B],K=X.length,Q=0;Q<K;Q++)H=X[Q],H.name.indexOf(m)<0&&(z.eventListeners[B]||(z.eventListeners[B]=[]),z.eventListeners[B].push(H));return z}_toKonvaCanvas(k){k=k||{};const L=this.getClientRect(),B=this.getStage(),X=k.x!==void 0?k.x:Math.floor(L.x),K=k.y!==void 0?k.y:Math.floor(L.y),Q=k.pixelRatio||1,H=new t.SceneCanvas({width:k.width||Math.ceil(L.width)||(B?B.width():0),height:k.height||Math.ceil(L.height)||(B?B.height():0),pixelRatio:Q}),z=H.getContext(),I=new t.SceneCanvas({width:H.width/H.pixelRatio+Math.abs(X),height:H.height/H.pixelRatio+Math.abs(K),pixelRatio:H.pixelRatio});return k.imageSmoothingEnabled===!1&&(z._context.imageSmoothingEnabled=!1),z.save(),(X||K)&&z.translate(-1*X,-1*K),this.drawScene(H,void 0,I),z.restore(),H}toCanvas(k){return this._toKonvaCanvas(k)._canvas}toDataURL(k){k=k||{};const L=k.mimeType||null,B=k.quality||null,X=this._toKonvaCanvas(k).toDataURL(L,B);return k.callback&&k.callback(X),X}toImage(k){return new Promise((L,B)=>{try{const X=k==null?void 0:k.callback;X&&delete k.callback,e.Util._urlToImage(this.toDataURL(k),function(K){L(K),X==null||X(K)})}catch(X){B(X)}})}toBlob(k){return new Promise((L,B)=>{try{const X=k==null?void 0:k.callback;X&&delete k.callback,this.toCanvas(k).toBlob(K=>{L(K),X==null||X(K)},k==null?void 0:k.mimeType,k==null?void 0:k.quality)}catch(X){B(X)}})}setSize(k){return this.width(k.width),this.height(k.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():n.Konva.dragDistance}_off(k,L,B){let X=this.eventListeners[k],K,Q,H;for(K=0;K<X.length;K++)if(Q=X[K].name,H=X[K].handler,(Q!=="konva"||L==="konva")&&(!L||Q===L)&&(!B||B===H)){if(X.splice(K,1),X.length===0){delete this.eventListeners[k];break}K--}}_fireChangeEvent(k,L,B){this._fire(k+E,{oldVal:L,newVal:B})}addName(k){if(!this.hasName(k)){const L=this.name(),B=L?L+" "+k:k;this.name(B)}return this}hasName(k){if(!k)return!1;const L=this.name();return L?(L||"").split(/\s/g).indexOf(k)!==-1:!1}removeName(k){const L=(this.name()||"").split(/\s/g),B=L.indexOf(k);return B!==-1&&(L.splice(B,1),this.name(L.join(" "))),this}setAttr(k,L){const B=this[P+e.Util._capitalize(k)];return e.Util._isFunction(B)?B.call(this,L):this._setAttr(k,L),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const k=this.getLayer()||this.getStage();k==null||k.batchDraw()}}_setAttr(k,L){const B=this.attrs[k];B===L&&!e.Util.isObject(L)||(L==null?delete this.attrs[k]:this.attrs[k]=L,this._shouldFireChangeEvents&&this._fireChangeEvent(k,B,L),this._requestDraw())}_setComponentAttr(k,L,B){let X;B!==void 0&&(X=this.attrs[k],X||(this.attrs[k]=this.getAttr(k)),this.attrs[k][L]=B,this._fireChangeEvent(k,X,B))}_fireAndBubble(k,L,B){if(L&&this.nodeType===g&&(L.target=this),!((k===p||k===h)&&(B&&(this===B||this.isAncestorOf&&this.isAncestorOf(B))||this.nodeType==="Stage"&&!B))){this._fire(k,L);const K=(k===p||k===h)&&B&&B.isAncestorOf&&B.isAncestorOf(this)&&!B.isAncestorOf(this.parent);(L&&!L.cancelBubble||!L)&&this.parent&&this.parent.isListening()&&!K&&(B&&B.parent?this._fireAndBubble.call(this.parent,k,L,B):this._fireAndBubble.call(this.parent,k,L))}}_getProtoListeners(k){var L,B,X;const K=(L=this._cache.get(c))!==null&&L!==void 0?L:{};let Q=K==null?void 0:K[k];if(Q===void 0){Q=[];let H=Object.getPrototypeOf(this);for(;H;){const z=(X=(B=H.eventListeners)===null||B===void 0?void 0:B[k])!==null&&X!==void 0?X:[];Q.push(...z),H=Object.getPrototypeOf(H)}K[k]=Q,this._cache.set(c,K)}return Q}_fire(k,L){L=L||{},L.currentTarget=this,L.type=k;const B=this._getProtoListeners(k);if(B)for(var X=0;X<B.length;X++)B[X].handler.call(this,L);const K=this.eventListeners[k];if(K)for(var X=0;X<K.length;X++)K[X].handler.call(this,L)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(k){const L=k?k.pointerId:void 0,B=this.getStage(),X=this.getAbsolutePosition();if(!B)return;const K=B._getPointerById(L)||B._changedPointerPositions[0]||X;o.DD._dragElements.set(this._id,{node:this,startPointerPos:K,offset:{x:K.x-X.x,y:K.y-X.y},dragStatus:"ready",pointerId:L})}startDrag(k,L=!0){o.DD._dragElements.has(this._id)||this._createDragElement(k);const B=o.DD._dragElements.get(this._id);B.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:k&&k.evt},L)}_setDragPosition(k,L){const B=this.getStage()._getPointerById(L.pointerId);if(!B)return;let X={x:B.x-L.offset.x,y:B.y-L.offset.y};const K=this.dragBoundFunc();if(K!==void 0){const Q=K.call(this,X,k);Q?X=Q:e.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!==X.x||this._lastPos.y!==X.y)&&(this.setAbsolutePosition(X),this._requestDraw()),this._lastPos=X}stopDrag(k){const L=o.DD._dragElements.get(this._id);L&&(L.dragStatus="stopped"),o.DD._endDragBefore(k),o.DD._endDragAfter(k)}setDraggable(k){this._setAttr("draggable",k),this._dragChange()}isDragging(){const k=o.DD._dragElements.get(this._id);return k?k.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(k){if(!(!(k.evt.button!==void 0)||n.Konva.dragButtons.indexOf(k.evt.button)>=0)||this.isDragging())return;let X=!1;o.DD._dragElements.forEach(K=>{this.isAncestorOf(K.node)&&(X=!0)}),X||this._createDragElement(k)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const L=o.DD._dragElements.get(this._id),B=L&&L.dragStatus==="dragging",X=L&&L.dragStatus==="ready";B?this.stopDrag():X&&o.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(k={x:0,y:0}){const L=this.getStage();if(!L)return!1;const B={x:-k.x,y:-k.y,width:L.width()+2*k.x,height:L.height()+2*k.y};return e.Util.haveIntersection(B,this.getClientRect())}static create(k,L){return e.Util._isString(k)&&(k=JSON.parse(k)),this._createNode(k,L)}static _createNode(k,L){let B=S.prototype.getClassName.call(k),X=k.children,K,Q,H;L&&(k.attrs.container=L),n.Konva[B]||(e.Util.warn('Can not find a node with class name "'+B+'". Fallback to "Shape".'),B="Shape");const z=n.Konva[B];if(K=new z(k.attrs),X)for(Q=X.length,H=0;H<Q;H++)K.add(S._createNode(X[H]));return K}}yf.Node=S,S.prototype.nodeType="Node",S.prototype._attrsAffectingSize=[],S.prototype.eventListeners={},S.prototype.on.call(S.prototype,D,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(O),this._clearSelfAndDescendantCache(d)}),S.prototype.on.call(S.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(R)}),S.prototype.on.call(S.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(_)}),S.prototype.on.call(S.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(s)});const A=i.Factory.addGetterSetter;return A(S,"zIndex"),A(S,"absolutePosition"),A(S,"position"),A(S,"x",0,(0,l.getNumberValidator)()),A(S,"y",0,(0,l.getNumberValidator)()),A(S,"globalCompositeOperation","source-over",(0,l.getStringValidator)()),A(S,"opacity",1,(0,l.getNumberValidator)()),A(S,"name","",(0,l.getStringValidator)()),A(S,"id","",(0,l.getStringValidator)()),A(S,"rotation",0,(0,l.getNumberValidator)()),i.Factory.addComponentsGetterSetter(S,"scale",["x","y"]),A(S,"scaleX",1,(0,l.getNumberValidator)()),A(S,"scaleY",1,(0,l.getNumberValidator)()),i.Factory.addComponentsGetterSetter(S,"skew",["x","y"]),A(S,"skewX",0,(0,l.getNumberValidator)()),A(S,"skewY",0,(0,l.getNumberValidator)()),i.Factory.addComponentsGetterSetter(S,"offset",["x","y"]),A(S,"offsetX",0,(0,l.getNumberValidator)()),A(S,"offsetY",0,(0,l.getNumberValidator)()),A(S,"dragDistance",void 0,(0,l.getNumberValidator)()),A(S,"width",0,(0,l.getNumberValidator)()),A(S,"height",0,(0,l.getNumberValidator)()),A(S,"listening",!0,(0,l.getBooleanValidator)()),A(S,"preventDefault",!0,(0,l.getBooleanValidator)()),A(S,"filters",void 0,function(N){return this._filterUpToDate=!1,N}),A(S,"visible",!0,(0,l.getBooleanValidator)()),A(S,"transformsEnabled","all",(0,l.getStringValidator)()),A(S,"size"),A(S,"dragBoundFunc"),A(S,"draggable",!1,(0,l.getBooleanValidator)()),i.Factory.backCompat(S,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),yf}var bf={},Xv;function Np(){if(Xv)return bf;Xv=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Container=void 0;const e=Ft(),i=Hn(),t=Bt();let n=class extends i.Node{constructor(){super(...arguments),this.children=[]}getChildren(l){if(!l)return this.children||[];const s=this.children||[],c=[];return s.forEach(function(d){l(d)&&c.push(d)}),c}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(l=>{l.parent=null,l.index=0,l.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(l=>{l.parent=null,l.index=0,l.destroy()}),this.children=[],this._requestDraw(),this}add(...l){if(l.length===0)return this;if(l.length>1){for(let c=0;c<l.length;c++)this.add(l[c]);return this}const s=l[0];return s.getParent()?(s.moveTo(this),this):(this._validateAdd(s),s.index=this.getChildren().length,s.parent=this,s._clearCaches(),this.getChildren().push(s),this._fire("add",{child:s}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(l){return this._generalFind(l,!1)}findOne(l){const s=this._generalFind(l,!0);return s.length>0?s[0]:void 0}_generalFind(l,s){const c=[];return this._descendants(d=>{const b=d._isMatch(l);return b&&c.push(d),!!(b&&s)}),c}_descendants(l){let s=!1;const c=this.getChildren();for(const d of c){if(s=l(d),s)return!0;if(d.hasChildren()&&(s=d._descendants(l),s))return!0}return!1}toObject(){const l=i.Node.prototype.toObject.call(this);return l.children=[],this.getChildren().forEach(s=>{l.children.push(s.toObject())}),l}isAncestorOf(l){let s=l.getParent();for(;s;){if(s._id===this._id)return!0;s=s.getParent()}return!1}clone(l){const s=i.Node.prototype.clone.call(this,l);return this.getChildren().forEach(function(c){s.add(c.clone())}),s}getAllIntersections(l){const s=[];return this.find("Shape").forEach(c=>{c.isVisible()&&c.intersects(l)&&s.push(c)}),s}_clearSelfAndDescendantCache(l){var s;super._clearSelfAndDescendantCache(l),!this.isCached()&&((s=this.children)===null||s===void 0||s.forEach(function(c){c._clearSelfAndDescendantCache(l)}))}_setChildrenIndices(){var l;(l=this.children)===null||l===void 0||l.forEach(function(s,c){s.index=c}),this._requestDraw()}drawScene(l,s,c){const d=this.getLayer(),b=l||d&&d.getCanvas(),w=b&&b.getContext(),E=this._getCanvasCache(),x=E&&E.scene,m=b&&b.isCache;if(!this.isVisible()&&!m)return this;if(x){w.save();const _=this.getAbsoluteTransform(s).getMatrix();w.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedSceneCanvas(w),w.restore()}else this._drawChildren("drawScene",b,s,c);return this}drawHit(l,s){if(!this.shouldDrawHit(s))return this;const c=this.getLayer(),d=l||c&&c.hitCanvas,b=d&&d.getContext(),w=this._getCanvasCache();if(w&&w.hit){b.save();const x=this.getAbsoluteTransform(s).getMatrix();b.transform(x[0],x[1],x[2],x[3],x[4],x[5]),this._drawCachedHitCanvas(b),b.restore()}else this._drawChildren("drawHit",d,s);return this}_drawChildren(l,s,c,d){var b;const w=s&&s.getContext(),E=this.clipWidth(),x=this.clipHeight(),m=this.clipFunc(),_=typeof E=="number"&&typeof x=="number"||m,p=c===this;if(_){w.save();const P=this.getAbsoluteTransform(c);let g=P.getMatrix();w.transform(g[0],g[1],g[2],g[3],g[4],g[5]),w.beginPath();let v;if(m)v=m.call(this,w,this);else{const y=this.clipX(),O=this.clipY();w.rect(y||0,O||0,E,x)}w.clip.apply(w,v),g=P.copy().invert().getMatrix(),w.transform(g[0],g[1],g[2],g[3],g[4],g[5])}const h=!p&&this.globalCompositeOperation()!=="source-over"&&l==="drawScene";h&&(w.save(),w._applyGlobalCompositeOperation(this)),(b=this.children)===null||b===void 0||b.forEach(function(P){P[l](s,c,d)}),h&&w.restore(),_&&w.restore()}getClientRect(l={}){var s;const c=l.skipTransform,d=l.relativeTo;let b,w,E,x,m={x:1/0,y:1/0,width:0,height:0};const _=this;(s=this.children)===null||s===void 0||s.forEach(function(P){if(!P.visible())return;const g=P.getClientRect({relativeTo:_,skipShadow:l.skipShadow,skipStroke:l.skipStroke});g.width===0&&g.height===0||(b===void 0?(b=g.x,w=g.y,E=g.x+g.width,x=g.y+g.height):(b=Math.min(b,g.x),w=Math.min(w,g.y),E=Math.max(E,g.x+g.width),x=Math.max(x,g.y+g.height)))});const p=this.find("Shape");let h=!1;for(let P=0;P<p.length;P++)if(p[P]._isVisible(this)){h=!0;break}return h&&b!==void 0?m={x:b,y:w,width:E-b,height:x-w}:m={x:0,y:0,width:0,height:0},c?m:this._transformedRect(m,d)}};return bf.Container=n,e.Factory.addComponentsGetterSetter(n,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(n,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipFunc"),bf}var Bg={},ql={},Zv;function U_(){if(Zv)return ql;Zv=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.getCapturedShape=n,ql.createEvent=o,ql.hasPointerCapture=l,ql.setPointerCapture=s,ql.releaseCapture=c;const e=Nt(),i=new Map,t=e.Konva._global.PointerEvent!==void 0;function n(d){return i.get(d)}function o(d){return{evt:d,pointerId:d.pointerId}}function l(d,b){return i.get(d)===b}function s(d,b){c(d),b.getStage()&&(i.set(d,b),t&&b._fire("gotpointercapture",o(new PointerEvent("gotpointercapture"))))}function c(d,b){const w=i.get(d);if(!w)return;const E=w.getStage();E&&E.content,i.delete(d),t&&w._fire("lostpointercapture",o(new PointerEvent("lostpointercapture")))}return ql}var Qv;function A8(){return Qv||(Qv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const i=In(),t=Ft(),n=Np(),o=Nt(),l=Lp(),s=pm(),c=Nt(),d=U_(),b="Stage",w="string",E="px",x="mouseout",m="mouseleave",_="mouseover",p="mouseenter",h="mousemove",P="mousedown",g="mouseup",v="pointermove",y="pointerdown",O="pointerup",M="pointercancel",R="lostpointercapture",D="pointerout",T="pointerleave",S="pointerover",A="pointerenter",N="contextmenu",k="touchstart",L="touchend",B="touchmove",X="touchcancel",K="wheel",Q=5,H=[[p,"_pointerenter"],[P,"_pointerdown"],[h,"_pointermove"],[g,"_pointerup"],[m,"_pointerleave"],[k,"_pointerdown"],[B,"_pointermove"],[L,"_pointerup"],[X,"_pointercancel"],[_,"_pointerover"],[K,"_wheel"],[N,"_contextmenu"],[y,"_pointerdown"],[v,"_pointermove"],[O,"_pointerup"],[M,"_pointercancel"],[R,"_lostpointercapture"]],z={mouse:{[D]:x,[T]:m,[S]:_,[A]:p,[v]:h,[y]:P,[O]:g,[M]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[D]:"touchout",[T]:"touchleave",[S]:"touchover",[A]:"touchenter",[v]:B,[y]:k,[O]:L,[M]:X,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[D]:D,[T]:T,[S]:S,[A]:A,[v]:v,[y]:y,[O]:O,[M]:M,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},I=Z=>Z.indexOf("pointer")>=0?"pointer":Z.indexOf("touch")>=0?"touch":"mouse",U=Z=>{const W=I(Z);if(W==="pointer")return o.Konva.pointerEventsEnabled&&z.pointer;if(W==="touch")return z.touch;if(W==="mouse")return z.mouse};function $(Z={}){return(Z.clipFunc||Z.clipWidth||Z.clipHeight)&&i.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Z}const ee="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 G extends n.Container{constructor(W){super($(W)),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",()=>{$(this.attrs)}),this._checkVisibility()}_validateAdd(W){const te=W.getType()==="Layer",re=W.getType()==="FastLayer";te||re||i.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const W=this.visible()?"":"none";this.content.style.display=W}setContainer(W){if(typeof W===w){if(W.charAt(0)==="."){const re=W.slice(1);W=document.getElementsByClassName(re)[0]}else{var te;W.charAt(0)!=="#"?te=W:te=W.slice(1),W=document.getElementById(te)}if(!W)throw"Can not find container in document with id "+te}return this._setAttr("container",W),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),W.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const W=this.children,te=W.length;for(let re=0;re<te;re++)W[re].clear();return this}clone(W){return W||(W={}),W.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,W)}destroy(){super.destroy();const W=this.content;W&&i.Util._isInDocument(W)&&this.container().removeChild(W);const te=e.stages.indexOf(this);return te>-1&&e.stages.splice(te,1),i.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const W=this._pointerPositions[0]||this._changedPointerPositions[0];return W?{x:W.x,y:W.y}:(i.Util.warn(ee),null)}_getPointerById(W){return this._pointerPositions.find(te=>te.id===W)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(W){W=W||{},W.x=W.x||0,W.y=W.y||0,W.width=W.width||this.width(),W.height=W.height||this.height();const te=new l.SceneCanvas({width:W.width,height:W.height,pixelRatio:W.pixelRatio||1}),re=te.getContext()._context,ie=this.children;return(W.x||W.y)&&re.translate(-1*W.x,-1*W.y),ie.forEach(function(oe){if(!oe.isVisible())return;const se=oe._toKonvaCanvas(W);re.drawImage(se._canvas,W.x,W.y,se.getWidth()/se.getPixelRatio(),se.getHeight()/se.getPixelRatio())}),te}getIntersection(W){if(!W)return null;const te=this.children,re=te.length,ie=re-1;for(let oe=ie;oe>=0;oe--){const se=te[oe].getIntersection(W);if(se)return se}return null}_resizeDOM(){const W=this.width(),te=this.height();this.content&&(this.content.style.width=W+E,this.content.style.height=te+E),this.bufferCanvas.setSize(W,te),this.bufferHitCanvas.setSize(W,te),this.children.forEach(re=>{re.setSize({width:W,height:te}),re.draw()})}add(W,...te){if(arguments.length>1){for(let ie=0;ie<arguments.length;ie++)this.add(arguments[ie]);return this}super.add(W);const re=this.children.length;return re>Q&&i.Util.warn("The stage has "+re+" 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."),W.setSize({width:this.width(),height:this.height()}),W.draw(),o.Konva.isBrowser&&this.content.appendChild(W.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(W){return d.hasPointerCapture(W,this)}setPointerCapture(W){d.setPointerCapture(W,this)}releaseCapture(W){d.releaseCapture(W,this)}getLayers(){return this.children}_bindContentEvents(){o.Konva.isBrowser&&H.forEach(([W,te])=>{this.content.addEventListener(W,re=>{this[te](re)},{passive:!1})})}_pointerenter(W){this.setPointersPositions(W);const te=U(W.type);te&&this._fire(te.pointerenter,{evt:W,target:this,currentTarget:this})}_pointerover(W){this.setPointersPositions(W);const te=U(W.type);te&&this._fire(te.pointerover,{evt:W,target:this,currentTarget:this})}_getTargetShape(W){let te=this[W+"targetShape"];return te&&!te.getStage()&&(te=null),te}_pointerleave(W){const te=U(W.type),re=I(W.type);if(!te)return;this.setPointersPositions(W);const ie=this._getTargetShape(re),oe=!(o.Konva.isDragging()||o.Konva.isTransforming())||o.Konva.hitOnDragEnabled;ie&&oe?(ie._fireAndBubble(te.pointerout,{evt:W}),ie._fireAndBubble(te.pointerleave,{evt:W}),this._fire(te.pointerleave,{evt:W,target:this,currentTarget:this}),this[re+"targetShape"]=null):oe&&(this._fire(te.pointerleave,{evt:W,target:this,currentTarget:this}),this._fire(te.pointerout,{evt:W,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(W){const te=U(W.type),re=I(W.type);if(!te)return;this.setPointersPositions(W);let ie=!1;this._changedPointerPositions.forEach(oe=>{const se=this.getIntersection(oe);if(s.DD.justDragged=!1,o.Konva["_"+re+"ListenClick"]=!0,!se||!se.isListening()){this[re+"ClickStartShape"]=void 0;return}o.Konva.capturePointerEventsEnabled&&se.setPointerCapture(oe.id),this[re+"ClickStartShape"]=se,se._fireAndBubble(te.pointerdown,{evt:W,pointerId:oe.id}),ie=!0;const de=W.type.indexOf("touch")>=0;se.preventDefault()&&W.cancelable&&de&&W.preventDefault()}),ie||this._fire(te.pointerdown,{evt:W,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(W){const te=U(W.type),re=I(W.type);if(!te||(o.Konva.isDragging()&&s.DD.node.preventDefault()&&W.cancelable&&W.preventDefault(),this.setPointersPositions(W),!(!(o.Konva.isDragging()||o.Konva.isTransforming())||o.Konva.hitOnDragEnabled)))return;const oe={};let se=!1;const de=this._getTargetShape(re);this._changedPointerPositions.forEach(pe=>{const Oe=d.getCapturedShape(pe.id)||this.getIntersection(pe),_e=pe.id,Te={evt:W,pointerId:_e},ce=de!==Oe;if(ce&&de&&(de._fireAndBubble(te.pointerout,{...Te},Oe),de._fireAndBubble(te.pointerleave,{...Te},Oe)),Oe){if(oe[Oe._id])return;oe[Oe._id]=!0}Oe&&Oe.isListening()?(se=!0,ce&&(Oe._fireAndBubble(te.pointerover,{...Te},de),Oe._fireAndBubble(te.pointerenter,{...Te},de),this[re+"targetShape"]=Oe),Oe._fireAndBubble(te.pointermove,{...Te})):de&&(this._fire(te.pointerover,{evt:W,target:this,currentTarget:this,pointerId:_e}),this[re+"targetShape"]=null)}),se||this._fire(te.pointermove,{evt:W,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(W){const te=U(W.type),re=I(W.type);if(!te)return;this.setPointersPositions(W);const ie=this[re+"ClickStartShape"],oe=this[re+"ClickEndShape"],se={};let de=!1;this._changedPointerPositions.forEach(pe=>{const Oe=d.getCapturedShape(pe.id)||this.getIntersection(pe);if(Oe){if(Oe.releaseCapture(pe.id),se[Oe._id])return;se[Oe._id]=!0}const _e=pe.id,Te={evt:W,pointerId:_e};let ce=!1;o.Konva["_"+re+"InDblClickWindow"]?(ce=!0,clearTimeout(this[re+"DblTimeout"])):s.DD.justDragged||(o.Konva["_"+re+"InDblClickWindow"]=!0,clearTimeout(this[re+"DblTimeout"])),this[re+"DblTimeout"]=setTimeout(function(){o.Konva["_"+re+"InDblClickWindow"]=!1},o.Konva.dblClickWindow),Oe&&Oe.isListening()?(de=!0,this[re+"ClickEndShape"]=Oe,Oe._fireAndBubble(te.pointerup,{...Te}),o.Konva["_"+re+"ListenClick"]&&ie&&ie===Oe&&(Oe._fireAndBubble(te.pointerclick,{...Te}),ce&&oe&&oe===Oe&&Oe._fireAndBubble(te.pointerdblclick,{...Te}))):(this[re+"ClickEndShape"]=null,o.Konva["_"+re+"ListenClick"]&&this._fire(te.pointerclick,{evt:W,target:this,currentTarget:this,pointerId:_e}),ce&&this._fire(te.pointerdblclick,{evt:W,target:this,currentTarget:this,pointerId:_e}))}),de||this._fire(te.pointerup,{evt:W,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),o.Konva["_"+re+"ListenClick"]=!1,W.cancelable&&re!=="touch"&&re!=="pointer"&&W.preventDefault()}_contextmenu(W){this.setPointersPositions(W);const te=this.getIntersection(this.getPointerPosition());te&&te.isListening()?te._fireAndBubble(N,{evt:W}):this._fire(N,{evt:W,target:this,currentTarget:this})}_wheel(W){this.setPointersPositions(W);const te=this.getIntersection(this.getPointerPosition());te&&te.isListening()?te._fireAndBubble(K,{evt:W}):this._fire(K,{evt:W,target:this,currentTarget:this})}_pointercancel(W){this.setPointersPositions(W);const te=d.getCapturedShape(W.pointerId)||this.getIntersection(this.getPointerPosition());te&&te._fireAndBubble(O,d.createEvent(W)),d.releaseCapture(W.pointerId)}_lostpointercapture(W){d.releaseCapture(W.pointerId)}setPointersPositions(W){const te=this._getContentPosition();let re=null,ie=null;W=W||window.event,W.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(W.touches,oe=>{this._pointerPositions.push({id:oe.identifier,x:(oe.clientX-te.left)/te.scaleX,y:(oe.clientY-te.top)/te.scaleY})}),Array.prototype.forEach.call(W.changedTouches||W.touches,oe=>{this._changedPointerPositions.push({id:oe.identifier,x:(oe.clientX-te.left)/te.scaleX,y:(oe.clientY-te.top)/te.scaleY})})):(re=(W.clientX-te.left)/te.scaleX,ie=(W.clientY-te.top)/te.scaleY,this.pointerPos={x:re,y:ie},this._pointerPositions=[{x:re,y:ie,id:i.Util._getFirstPointerId(W)}],this._changedPointerPositions=[{x:re,y:ie,id:i.Util._getFirstPointerId(W)}])}_setPointerPosition(W){i.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(W)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const W=this.content.getBoundingClientRect();return{top:W.top,left:W.left,scaleX:W.width/this.content.clientWidth||1,scaleY:W.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new l.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new l.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!o.Konva.isBrowser)return;const W=this.container();if(!W)throw"Stage has no container. A container is required.";W.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"),W.appendChild(this.content),this._resizeDOM()}cache(){return i.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(W){W.batchDraw()}),this}}e.Stage=G,G.prototype.nodeType=b,(0,c._registerNode)(G),t.Factory.addGetterSetter(G,"container"),o.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(Z=>{Z.batchDraw()})})}(Bg)),Bg}var _f={},Ug={},Jv;function wr(){return Jv||(Jv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const i=Nt(),t=In(),n=Ft(),o=Hn(),l=Bt(),s=Nt(),c=U_(),d="hasShadow",b="shadowRGBA",w="patternImage",E="linearGradient",x="radialGradient";let m;function _(){return m||(m=t.Util.createCanvasElement().getContext("2d"),m)}e.shapes={};function p(T){const S=this.attrs.fillRule;S?T.fill(S):T.fill()}function h(T){T.stroke()}function P(T){const S=this.attrs.fillRule;S?T.fill(S):T.fill()}function g(T){T.stroke()}function v(){this._clearCache(d)}function y(){this._clearCache(b)}function O(){this._clearCache(w)}function M(){this._clearCache(E)}function R(){this._clearCache(x)}class D extends o.Node{constructor(S){super(S);let A;for(;A=t.Util.getRandomColor(),!(A&&!(A in e.shapes)););this.colorKey=A,e.shapes[A]=this}getContext(){return t.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return t.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(d,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(w,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const A=_().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(A&&A.setTransform){const N=new t.Transform;N.translate(this.fillPatternX(),this.fillPatternY()),N.rotate(i.Konva.getAngle(this.fillPatternRotation())),N.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),N.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const k=N.getMatrix(),L=typeof DOMMatrix>"u"?{a:k[0],b:k[1],c:k[2],d:k[3],e:k[4],f:k[5]}:new DOMMatrix(k);A.setTransform(L)}return A}}_getLinearGradient(){return this._getCache(E,this.__getLinearGradient)}__getLinearGradient(){const S=this.fillLinearGradientColorStops();if(S){const A=_(),N=this.fillLinearGradientStartPoint(),k=this.fillLinearGradientEndPoint(),L=A.createLinearGradient(N.x,N.y,k.x,k.y);for(let B=0;B<S.length;B+=2)L.addColorStop(S[B],S[B+1]);return L}}_getRadialGradient(){return this._getCache(x,this.__getRadialGradient)}__getRadialGradient(){const S=this.fillRadialGradientColorStops();if(S){const A=_(),N=this.fillRadialGradientStartPoint(),k=this.fillRadialGradientEndPoint(),L=A.createRadialGradient(N.x,N.y,this.fillRadialGradientStartRadius(),k.x,k.y,this.fillRadialGradientEndRadius());for(let B=0;B<S.length;B+=2)L.addColorStop(S[B],S[B+1]);return L}}getShadowRGBA(){return this._getCache(b,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const S=t.Util.colorToRGBA(this.shadowColor());if(S)return"rgba("+S.r+","+S.g+","+S.b+","+S.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 S=this.hitStrokeWidth();return S==="auto"?this.hasStroke():this.strokeEnabled()&&!!S}intersects(S){const A=this.getStage();if(!A)return!1;const N=A.bufferHitCanvas;return N.getContext().clear(),this.drawHit(N,void 0,!0),N.context.getImageData(Math.round(S.x),Math.round(S.y),1,1).data[3]>0}destroy(){return o.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(S){var A;if(!((A=this.attrs.perfectDrawEnabled)!==null&&A!==void 0?A:!0))return!1;const k=S||this.hasFill(),L=this.hasStroke(),B=this.getAbsoluteOpacity()!==1;if(k&&L&&B)return!0;const X=this.hasShadow(),K=this.shadowForStrokeEnabled();return!!(k&&L&&X&&K)}setStrokeHitEnabled(S){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),S?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const S=this.size();return{x:this._centroid?-S.width/2:0,y:this._centroid?-S.height/2:0,width:S.width,height:S.height}}getClientRect(S={}){let A=!1,N=this.getParent();for(;N;){if(N.isCached()){A=!0;break}N=N.getParent()}const k=S.skipTransform,L=S.relativeTo||A&&this.getStage()||void 0,B=this.getSelfRect(),K=!S.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,Q=B.width+K,H=B.height+K,z=!S.skipShadow&&this.hasShadow(),I=z?this.shadowOffsetX():0,U=z?this.shadowOffsetY():0,$=Q+Math.abs(I),ee=H+Math.abs(U),G=z&&this.shadowBlur()||0,Z=$+G*2,W=ee+G*2,te={width:Z,height:W,x:-(K/2+G)+Math.min(I,0)+B.x,y:-(K/2+G)+Math.min(U,0)+B.y};return k?te:this._transformedRect(te,L)}drawScene(S,A,N){const k=this.getLayer();let L=S||k.getCanvas(),B=L.getContext(),X=this._getCanvasCache(),K=this.getSceneFunc(),Q=this.hasShadow(),H,z;const I=L.isCache,U=A===this;if(!this.isVisible()&&!U)return this;if(X){B.save();const ee=this.getAbsoluteTransform(A).getMatrix();return B.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5]),this._drawCachedSceneCanvas(B),B.restore(),this}if(!K)return this;if(B.save(),this._useBufferCanvas()&&!I){H=this.getStage();const ee=N||H.bufferCanvas;z=ee.getContext(),z.clear(),z.save(),z._applyLineJoin(this);var $=this.getAbsoluteTransform(A).getMatrix();z.transform($[0],$[1],$[2],$[3],$[4],$[5]),K.call(this,z,this),z.restore();const G=ee.pixelRatio;Q&&B._applyShadow(this),B._applyOpacity(this),B._applyGlobalCompositeOperation(this),B.drawImage(ee._canvas,0,0,ee.width/G,ee.height/G)}else{if(B._applyLineJoin(this),!U){var $=this.getAbsoluteTransform(A).getMatrix();B.transform($[0],$[1],$[2],$[3],$[4],$[5]),B._applyOpacity(this),B._applyGlobalCompositeOperation(this)}Q&&B._applyShadow(this),K.call(this,B,this)}return B.restore(),this}drawHit(S,A,N=!1){if(!this.shouldDrawHit(A,N))return this;const k=this.getLayer(),L=S||k.hitCanvas,B=L&&L.getContext(),X=this.hitFunc()||this.sceneFunc(),K=this._getCanvasCache(),Q=K&&K.hit;if(this.colorKey||t.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()"),Q){B.save();const z=this.getAbsoluteTransform(A).getMatrix();return B.transform(z[0],z[1],z[2],z[3],z[4],z[5]),this._drawCachedHitCanvas(B),B.restore(),this}if(!X)return this;if(B.save(),B._applyLineJoin(this),!(this===A)){const z=this.getAbsoluteTransform(A).getMatrix();B.transform(z[0],z[1],z[2],z[3],z[4],z[5])}return X.call(this,B,this),B.restore(),this}drawHitFromCache(S=0){const A=this._getCanvasCache(),N=this._getCachedSceneCanvas(),k=A.hit,L=k.getContext(),B=k.getWidth(),X=k.getHeight();L.clear(),L.drawImage(N._canvas,0,0,B,X);try{const K=L.getImageData(0,0,B,X),Q=K.data,H=Q.length,z=t.Util._hexToRgb(this.colorKey);for(let I=0;I<H;I+=4)Q[I+3]>S?(Q[I]=z.r,Q[I+1]=z.g,Q[I+2]=z.b,Q[I+3]=255):Q[I+3]=0;L.putImageData(K,0,0)}catch(K){t.Util.error("Unable to draw hit graph from cached scene canvas. "+K.message)}return this}hasPointerCapture(S){return c.hasPointerCapture(S,this)}setPointerCapture(S){c.setPointerCapture(S,this)}releaseCapture(S){c.releaseCapture(S,this)}}e.Shape=D,D.prototype._fillFunc=p,D.prototype._strokeFunc=h,D.prototype._fillFuncHit=P,D.prototype._strokeFuncHit=g,D.prototype._centroid=!1,D.prototype.nodeType="Shape",(0,s._registerNode)(D),D.prototype.eventListeners={},D.prototype.on.call(D.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),D.prototype.on.call(D.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",y),D.prototype.on.call(D.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",O),D.prototype.on.call(D.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),D.prototype.on.call(D.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",R),n.Factory.addGetterSetter(D,"stroke",void 0,(0,l.getStringOrGradientValidator)()),n.Factory.addGetterSetter(D,"strokeWidth",2,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(D,"hitStrokeWidth","auto",(0,l.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(D,"strokeHitEnabled",!0,(0,l.getBooleanValidator)()),n.Factory.addGetterSetter(D,"perfectDrawEnabled",!0,(0,l.getBooleanValidator)()),n.Factory.addGetterSetter(D,"shadowForStrokeEnabled",!0,(0,l.getBooleanValidator)()),n.Factory.addGetterSetter(D,"lineJoin"),n.Factory.addGetterSetter(D,"lineCap"),n.Factory.addGetterSetter(D,"sceneFunc"),n.Factory.addGetterSetter(D,"hitFunc"),n.Factory.addGetterSetter(D,"dash"),n.Factory.addGetterSetter(D,"dashOffset",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"shadowColor",void 0,(0,l.getStringValidator)()),n.Factory.addGetterSetter(D,"shadowBlur",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"shadowOpacity",1,(0,l.getNumberValidator)()),n.Factory.addComponentsGetterSetter(D,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(D,"shadowOffsetX",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"shadowOffsetY",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"fillPatternImage"),n.Factory.addGetterSetter(D,"fill",void 0,(0,l.getStringOrGradientValidator)()),n.Factory.addGetterSetter(D,"fillPatternX",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"fillPatternY",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(D,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(D,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(D,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(D,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(D,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(D,"fillEnabled",!0),n.Factory.addGetterSetter(D,"strokeEnabled",!0),n.Factory.addGetterSetter(D,"shadowEnabled",!0),n.Factory.addGetterSetter(D,"dashEnabled",!0),n.Factory.addGetterSetter(D,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(D,"fillPriority","color"),n.Factory.addComponentsGetterSetter(D,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(D,"fillPatternOffsetX",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"fillPatternOffsetY",0,(0,l.getNumberValidator)()),n.Factory.addComponentsGetterSetter(D,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(D,"fillPatternScaleX",1,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(D,"fillPatternScaleY",1,(0,l.getNumberValidator)()),n.Factory.addComponentsGetterSetter(D,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(D,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(D,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(D,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(D,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(D,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(D,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(D,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(D,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(D,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(D,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(D,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(D,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(D,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(D,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(D,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(D,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(D,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(D,"fillPatternRotation",0),n.Factory.addGetterSetter(D,"fillRule",void 0,(0,l.getStringValidator)()),n.Factory.backCompat(D,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(Ug)),Ug}var ey;function q_(){if(ey)return _f;ey=1,Object.defineProperty(_f,"__esModule",{value:!0}),_f.Layer=void 0;const e=In(),i=Np(),t=Hn(),n=Ft(),o=Lp(),l=Bt(),s=wr(),c=Nt(),d="#",b="beforeDraw",w="draw",E=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],x=E.length;class m extends i.Container{constructor(p){super(p),this.canvas=new o.SceneCanvas,this.hitCanvas=new o.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(p){return this.getContext().clear(p),this.getHitCanvas().getContext().clear(p),this}setZIndex(p){super.setZIndex(p);const h=this.getStage();return h&&h.content&&(h.content.removeChild(this.getNativeCanvasElement()),p<h.children.length-1?h.content.insertBefore(this.getNativeCanvasElement(),h.children[p+1].getCanvas()._canvas):h.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.Node.prototype.moveToTop.call(this);const p=this.getStage();return p&&p.content&&(p.content.removeChild(this.getNativeCanvasElement()),p.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!t.Node.prototype.moveUp.call(this))return!1;const h=this.getStage();return!h||!h.content?!1:(h.content.removeChild(this.getNativeCanvasElement()),this.index<h.children.length-1?h.content.insertBefore(this.getNativeCanvasElement(),h.children[this.index+1].getCanvas()._canvas):h.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const p=this.getStage();if(p){const h=p.children;p.content&&(p.content.removeChild(this.getNativeCanvasElement()),p.content.insertBefore(this.getNativeCanvasElement(),h[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const p=this.getStage();if(p){const h=p.children;p.content&&(p.content.removeChild(this.getNativeCanvasElement()),p.content.insertBefore(this.getNativeCanvasElement(),h[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const p=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),p&&p.parentNode&&e.Util._isInDocument(p)&&p.parentNode.removeChild(p),this}getStage(){return this.parent}setSize({width:p,height:h}){return this.canvas.setSize(p,h),this.hitCanvas.setSize(p,h),this._setSmoothEnabled(),this}_validateAdd(p){const h=p.getType();h!=="Group"&&h!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(p){return p=p||{},p.width=p.width||this.getWidth(),p.height=p.height||this.getHeight(),p.x=p.x!==void 0?p.x:this.x(),p.y=p.y!==void 0?p.y:this.y(),t.Node.prototype._toKonvaCanvas.call(this,p)}_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(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(p){if(!this.isListening()||!this.isVisible())return null;let h=1,P=!1;for(;;){for(let g=0;g<x;g++){const v=E[g],y=this._getIntersection({x:p.x+v.x*h,y:p.y+v.y*h}),O=y.shape;if(O)return O;if(P=!!y.antialiased,!y.antialiased)break}if(P)h+=1;else return null}}_getIntersection(p){const h=this.hitCanvas.pixelRatio,P=this.hitCanvas.context.getImageData(Math.round(p.x*h),Math.round(p.y*h),1,1).data,g=P[3];if(g===255){const v=e.Util._rgbToHex(P[0],P[1],P[2]),y=s.shapes[d+v];return y?{shape:y}:{antialiased:!0}}else if(g>0)return{antialiased:!0};return{}}drawScene(p,h){const P=this.getLayer(),g=p||P&&P.getCanvas();return this._fire(b,{node:this}),this.clearBeforeDraw()&&g.getContext().clear(),i.Container.prototype.drawScene.call(this,g,h),this._fire(w,{node:this}),this}drawHit(p,h){const P=this.getLayer(),g=p||P&&P.hitCanvas;return P&&P.clearBeforeDraw()&&P.getHitCanvas().getContext().clear(),i.Container.prototype.drawHit.call(this,g,h),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(p){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(p)}getHitGraphEnabled(p){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const p=this.parent;!!this.hitCanvas._canvas.parentNode?p.content.removeChild(this.hitCanvas._canvas):p.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return _f.Layer=m,m.prototype.nodeType="Layer",(0,c._registerNode)(m),n.Factory.addGetterSetter(m,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(m,"clearBeforeDraw",!0),n.Factory.addGetterSetter(m,"hitGraphEnabled",!0,(0,l.getBooleanValidator)()),_f}var wf={},ty;function T8(){if(ty)return wf;ty=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.FastLayer=void 0;const e=In(),i=q_(),t=Nt();class n extends i.Layer{constructor(l){super(l),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return wf.FastLayer=n,n.prototype.nodeType="FastLayer",(0,t._registerNode)(n),wf}var Sf={},ny;function gm(){if(ny)return Sf;ny=1,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.Group=void 0;const e=In(),i=Np(),t=Nt();class n extends i.Container{_validateAdd(l){const s=l.getType();s!=="Group"&&s!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return Sf.Group=n,n.prototype.nodeType="Group",(0,t._registerNode)(n),Sf}var Ef={},ry;function mm(){if(ry)return Ef;ry=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.Animation=void 0;const e=Nt(),i=In(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let n=class Ju{constructor(l,s){this.id=Ju.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=l,this.setLayers(s)}setLayers(l){let s=[];return l&&(s=Array.isArray(l)?l:[l]),this.layers=s,this}getLayers(){return this.layers}addLayer(l){const s=this.layers,c=s.length;for(let d=0;d<c;d++)if(s[d]._id===l._id)return!1;return this.layers.push(l),!0}isRunning(){const s=Ju.animations,c=s.length;for(let d=0;d<c;d++)if(s[d].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),Ju._addAnimation(this),this}stop(){return Ju._removeAnimation(this),this}_updateFrameObject(l){this.frame.timeDiff=l-this.frame.lastTime,this.frame.lastTime=l,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(l){this.animations.push(l),this._handleAnimation()}static _removeAnimation(l){const s=l.id,c=this.animations,d=c.length;for(let b=0;b<d;b++)if(c[b].id===s){this.animations.splice(b,1);break}}static _runFrames(){const l={},s=this.animations;for(let c=0;c<s.length;c++){const d=s[c],b=d.layers,w=d.func;d._updateFrameObject(t());const E=b.length;let x;if(w?x=w.call(d,d.frame)!==!1:x=!0,!!x)for(let m=0;m<E;m++){const _=b[m];_._id!==void 0&&(l[_._id]=_)}}for(const c in l)l.hasOwnProperty(c)&&l[c].batchDraw()}static _animationLoop(){const l=Ju;l.animations.length?(l._runFrames(),i.Util.requestAnimFrame(l._animationLoop)):l.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,i.Util.requestAnimFrame(this._animationLoop))}};return Ef.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,Ef}var qg={},iy;function R8(){return iy||(iy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const i=In(),t=mm(),n=Hn(),o=Nt(),l={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,c=2,d=3,b=["fill","stroke","shadowColor"];let w=0;class E{constructor(_,p,h,P,g,v,y){this.prop=_,this.propFunc=p,this.begin=P,this._pos=P,this.duration=v,this._change=0,this.prevPos=0,this.yoyo=y,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=h,this._change=g-this.begin,this.pause()}fire(_){const p=this[_];p&&p()}setTime(_){_>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():_<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=_,this.update())}getTime(){return this._time}setPosition(_){this.prevPos=this._pos,this.propFunc(_),this._pos=_}getPosition(_){return _===void 0&&(_=this._time),this.func(_,this.begin,this._change,this.duration)}play(){this.state=c,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=d,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(_){this.pause(),this._time=_,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(){const _=this.getTimer()-this._startTime;this.state===c?this.setTime(_):this.state===d&&this.setTime(this.duration-_)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}}class x{constructor(_){const p=this,h=_.node,P=h._id,g=_.easing||e.Easings.Linear,v=!!_.yoyo;let y,O;typeof _.duration>"u"?y=.3:_.duration===0?y=.001:y=_.duration,this.node=h,this._id=w++;const M=h.getLayer()||(h instanceof o.Konva.Stage?h.getLayers():null);M||i.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){p.tween.onEnterFrame()},M),this.tween=new E(O,function(R){p._tweenFunc(R)},g,0,1,y*1e3,v),this._addListeners(),x.attrs[P]||(x.attrs[P]={}),x.attrs[P][this._id]||(x.attrs[P][this._id]={}),x.tweens[P]||(x.tweens[P]={});for(O in _)l[O]===void 0&&this._addAttr(O,_[O]);this.reset(),this.onFinish=_.onFinish,this.onReset=_.onReset,this.onUpdate=_.onUpdate}_addAttr(_,p){const h=this.node,P=h._id;let g,v,y,O,M;const R=x.tweens[P][_];R&&delete x.attrs[P][R][_];let D=h.getAttr(_);if(i.Util._isArray(p))if(g=[],v=Math.max(p.length,D.length),_==="points"&&p.length!==D.length&&(p.length>D.length?(O=D,D=i.Util._prepareArrayForTween(D,p,h.closed())):(y=p,p=i.Util._prepareArrayForTween(p,D,h.closed()))),_.indexOf("fill")===0)for(let T=0;T<v;T++)if(T%2===0)g.push(p[T]-D[T]);else{const S=i.Util.colorToRGBA(D[T]);M=i.Util.colorToRGBA(p[T]),D[T]=S,g.push({r:M.r-S.r,g:M.g-S.g,b:M.b-S.b,a:M.a-S.a})}else for(let T=0;T<v;T++)g.push(p[T]-D[T]);else b.indexOf(_)!==-1?(D=i.Util.colorToRGBA(D),M=i.Util.colorToRGBA(p),g={r:M.r-D.r,g:M.g-D.g,b:M.b-D.b,a:M.a-D.a}):g=p-D;x.attrs[P][this._id][_]={start:D,diff:g,end:p,trueEnd:y,trueStart:O},x.tweens[P][_]=this._id}_tweenFunc(_){const p=this.node,h=x.attrs[p._id][this._id];let P,g,v,y,O,M,R,D;for(P in h){if(g=h[P],v=g.start,y=g.diff,D=g.end,i.Util._isArray(v))if(O=[],R=Math.max(v.length,D.length),P.indexOf("fill")===0)for(M=0;M<R;M++)M%2===0?O.push((v[M]||0)+y[M]*_):O.push("rgba("+Math.round(v[M].r+y[M].r*_)+","+Math.round(v[M].g+y[M].g*_)+","+Math.round(v[M].b+y[M].b*_)+","+(v[M].a+y[M].a*_)+")");else for(M=0;M<R;M++)O.push((v[M]||0)+y[M]*_);else b.indexOf(P)!==-1?O="rgba("+Math.round(v.r+y.r*_)+","+Math.round(v.g+y.g*_)+","+Math.round(v.b+y.b*_)+","+(v.a+y.a*_)+")":O=v+y*_;p.setAttr(P,O)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const _=this.node,p=x.attrs[_._id][this._id];p.points&&p.points.trueEnd&&_.setAttr("points",p.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const _=this.node,p=x.attrs[_._id][this._id];p.points&&p.points.trueStart&&_.points(p.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(_){return this.tween.seek(_*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const _=this.node._id,p=this._id,h=x.tweens[_];this.pause();for(const P in h)delete x.tweens[_][P];delete x.attrs[_][p]}}e.Tween=x,x.attrs={},x.tweens={},n.Node.prototype.to=function(m){const _=m.onFinish;m.node=this,m.onFinish=function(){this.destroy(),_&&_()},new x(m).play()},e.Easings={BackEaseIn(m,_,p,h){return p*(m/=h)*m*((1.70158+1)*m-1.70158)+_},BackEaseOut(m,_,p,h){return p*((m=m/h-1)*m*((1.70158+1)*m+1.70158)+1)+_},BackEaseInOut(m,_,p,h){let P=1.70158;return(m/=h/2)<1?p/2*(m*m*(((P*=1.525)+1)*m-P))+_:p/2*((m-=2)*m*(((P*=1.525)+1)*m+P)+2)+_},ElasticEaseIn(m,_,p,h,P,g){let v=0;return m===0?_:(m/=h)===1?_+p:(g||(g=h*.3),!P||P<Math.abs(p)?(P=p,v=g/4):v=g/(2*Math.PI)*Math.asin(p/P),-(P*Math.pow(2,10*(m-=1))*Math.sin((m*h-v)*(2*Math.PI)/g))+_)},ElasticEaseOut(m,_,p,h,P,g){let v=0;return m===0?_:(m/=h)===1?_+p:(g||(g=h*.3),!P||P<Math.abs(p)?(P=p,v=g/4):v=g/(2*Math.PI)*Math.asin(p/P),P*Math.pow(2,-10*m)*Math.sin((m*h-v)*(2*Math.PI)/g)+p+_)},ElasticEaseInOut(m,_,p,h,P,g){let v=0;return m===0?_:(m/=h/2)===2?_+p:(g||(g=h*(.3*1.5)),!P||P<Math.abs(p)?(P=p,v=g/4):v=g/(2*Math.PI)*Math.asin(p/P),m<1?-.5*(P*Math.pow(2,10*(m-=1))*Math.sin((m*h-v)*(2*Math.PI)/g))+_:P*Math.pow(2,-10*(m-=1))*Math.sin((m*h-v)*(2*Math.PI)/g)*.5+p+_)},BounceEaseOut(m,_,p,h){return(m/=h)<1/2.75?p*(7.5625*m*m)+_:m<2/2.75?p*(7.5625*(m-=1.5/2.75)*m+.75)+_:m<2.5/2.75?p*(7.5625*(m-=2.25/2.75)*m+.9375)+_:p*(7.5625*(m-=2.625/2.75)*m+.984375)+_},BounceEaseIn(m,_,p,h){return p-e.Easings.BounceEaseOut(h-m,0,p,h)+_},BounceEaseInOut(m,_,p,h){return m<h/2?e.Easings.BounceEaseIn(m*2,0,p,h)*.5+_:e.Easings.BounceEaseOut(m*2-h,0,p,h)*.5+p*.5+_},EaseIn(m,_,p,h){return p*(m/=h)*m+_},EaseOut(m,_,p,h){return-p*(m/=h)*(m-2)+_},EaseInOut(m,_,p,h){return(m/=h/2)<1?p/2*m*m+_:-p/2*(--m*(m-2)-1)+_},StrongEaseIn(m,_,p,h){return p*(m/=h)*m*m*m*m+_},StrongEaseOut(m,_,p,h){return p*((m=m/h-1)*m*m*m*m+1)+_},StrongEaseInOut(m,_,p,h){return(m/=h/2)<1?p/2*m*m*m*m*m+_:p/2*((m-=2)*m*m*m*m+2)+_},Linear(m,_,p,h){return p*m/h+_}}}(qg)),qg}var ay;function q0(){return ay||(ay=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const i=Nt(),t=In(),n=Hn(),o=Np(),l=A8(),s=q_(),c=T8(),d=gm(),b=pm(),w=wr(),E=mm(),x=R8(),m=B_(),_=Lp();e.Konva=t.Util._assign(i.Konva,{Util:t.Util,Transform:t.Transform,Node:n.Node,Container:o.Container,Stage:l.Stage,stages:l.stages,Layer:s.Layer,FastLayer:c.FastLayer,Group:d.Group,DD:b.DD,Shape:w.Shape,shapes:w.shapes,Animation:E.Animation,Tween:x.Tween,Easings:x.Easings,Context:m.Context,Canvas:_.Canvas}),e.default=e.Konva}(Ig)),Ig}var Of={},oy;function M8(){if(oy)return Of;oy=1,Object.defineProperty(Of,"__esModule",{value:!0}),Of.Arc=void 0;const e=Ft(),i=wr(),t=Nt(),n=Bt(),o=Nt();class l extends i.Shape{_sceneFunc(c){const d=t.Konva.getAngle(this.angle()),b=this.clockwise();c.beginPath(),c.arc(0,0,this.outerRadius(),0,d,b),c.arc(0,0,this.innerRadius(),d,0,!b),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}getSelfRect(){const c=this.innerRadius(),d=this.outerRadius(),b=this.clockwise(),w=t.Konva.getAngle(b?360-this.angle():this.angle()),E=Math.cos(Math.min(w,Math.PI)),x=1,m=Math.sin(Math.min(Math.max(Math.PI,w),3*Math.PI/2)),_=Math.sin(Math.min(w,Math.PI/2)),p=E*(E>0?c:d),h=x*d,P=m*(m>0?c:d),g=_*(_>0?d:c);return{x:p,y:b?-1*g:P,width:h-p,height:g-P}}}return Of.Arc=l,l.prototype._centroid=!0,l.prototype.className="Arc",l.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,o._registerNode)(l),e.Factory.addGetterSetter(l,"innerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"outerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"clockwise",!1,(0,n.getBooleanValidator)()),Of}var xf={},Pf={},ly;function H_(){if(ly)return Pf;ly=1,Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.Line=void 0;const e=Ft(),i=Nt(),t=wr(),n=Bt();function o(c,d,b,w,E,x,m){const _=Math.sqrt(Math.pow(b-c,2)+Math.pow(w-d,2)),p=Math.sqrt(Math.pow(E-b,2)+Math.pow(x-w,2)),h=m*_/(_+p),P=m*p/(_+p),g=b-h*(E-c),v=w-h*(x-d),y=b+P*(E-c),O=w+P*(x-d);return[g,v,y,O]}function l(c,d){const b=c.length,w=[];for(let E=2;E<b-2;E+=2){const x=o(c[E-2],c[E-1],c[E],c[E+1],c[E+2],c[E+3],d);isNaN(x[0])||(w.push(x[0]),w.push(x[1]),w.push(c[E]),w.push(c[E+1]),w.push(x[2]),w.push(x[3]))}return w}class s extends t.Shape{constructor(d){super(d),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(d){let b=this.points(),w=b.length,E=this.tension(),x=this.closed(),m=this.bezier(),_,p,h;if(w){if(d.beginPath(),d.moveTo(b[0],b[1]),E!==0&&w>4){for(_=this.getTensionPoints(),p=_.length,h=x?0:4,x||d.quadraticCurveTo(_[0],_[1],_[2],_[3]);h<p-2;)d.bezierCurveTo(_[h++],_[h++],_[h++],_[h++],_[h++],_[h++]);x||d.quadraticCurveTo(_[p-2],_[p-1],b[w-2],b[w-1])}else if(m)for(h=2;h<w;)d.bezierCurveTo(b[h++],b[h++],b[h++],b[h++],b[h++],b[h++]);else for(h=2;h<w;h+=2)d.lineTo(b[h],b[h+1]);x?(d.closePath(),d.fillStrokeShape(this)):d.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():l(this.points(),this.tension())}_getTensionPointsClosed(){const d=this.points(),b=d.length,w=this.tension(),E=o(d[b-2],d[b-1],d[0],d[1],d[2],d[3],w),x=o(d[b-4],d[b-3],d[b-2],d[b-1],d[0],d[1],w),m=l(d,w);return[E[2],E[3]].concat(m).concat([x[0],x[1],d[b-2],d[b-1],x[2],x[3],E[0],E[1],d[0],d[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let d=this.points();if(d.length<4)return{x:d[0]||0,y:d[1]||0,width:0,height:0};this.tension()!==0?d=[d[0],d[1],...this._getTensionPoints(),d[d.length-2],d[d.length-1]]:d=this.points();let b=d[0],w=d[0],E=d[1],x=d[1],m,_;for(let p=0;p<d.length/2;p++)m=d[p*2],_=d[p*2+1],b=Math.min(b,m),w=Math.max(w,m),E=Math.min(E,_),x=Math.max(x,_);return{x:b,y:E,width:w-b,height:x-E}}}return Pf.Line=s,s.prototype.className="Line",s.prototype._attrsAffectingSize=["points","bezier","tension"],(0,i._registerNode)(s),e.Factory.addGetterSetter(s,"closed",!1),e.Factory.addGetterSetter(s,"bezier",!1),e.Factory.addGetterSetter(s,"tension",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(s,"points",[],(0,n.getNumberArrayValidator)()),Pf}var Cf={},Hg={},sy;function L8(){return sy||(sy=1,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 i=(s,c,d)=>{let b,w;const x=d/2;b=0;for(let m=0;m<20;m++)w=x*e.tValues[20][m]+x,b+=e.cValues[20][m]*n(s,c,w);return x*b};e.getCubicArcLength=i;const t=(s,c,d)=>{d===void 0&&(d=1);const b=s[0]-2*s[1]+s[2],w=c[0]-2*c[1]+c[2],E=2*s[1]-2*s[0],x=2*c[1]-2*c[0],m=4*(b*b+w*w),_=4*(b*E+w*x),p=E*E+x*x;if(m===0)return d*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(c[2]-c[0],2));const h=_/(2*m),P=p/m,g=d+h,v=P-h*h,y=g*g+v>0?Math.sqrt(g*g+v):0,O=h*h+v>0?Math.sqrt(h*h+v):0,M=h+Math.sqrt(h*h+v)!==0?v*Math.log(Math.abs((g+y)/(h+O))):0;return Math.sqrt(m)/2*(g*y-h*O+M)};e.getQuadraticArcLength=t;function n(s,c,d){const b=o(1,d,s),w=o(1,d,c),E=b*b+w*w;return Math.sqrt(E)}const o=(s,c,d)=>{const b=d.length-1;let w,E;if(b===0)return 0;if(s===0){E=0;for(let x=0;x<=b;x++)E+=e.binomialCoefficients[b][x]*Math.pow(1-c,b-x)*Math.pow(c,x)*d[x];return E}else{w=new Array(b);for(let x=0;x<b;x++)w[x]=b*(d[x+1]-d[x]);return o(s-1,c,w)}},l=(s,c,d)=>{let b=1,w=s/c,E=(s-d(w))/c,x=0;for(;b>.001;){const m=d(w+E),_=Math.abs(s-m)/c;if(_<b)b=_,w+=E;else{const p=d(w-E),h=Math.abs(s-p)/c;h<b?(b=h,w-=E):E/=2}if(x++,x>500)break}return w};e.t2length=l}(Hg)),Hg}var uy;function vm(){if(uy)return Cf;uy=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.Path=void 0;const e=Ft(),i=wr(),t=Nt(),n=L8();class o extends i.Shape{constructor(s){super(s),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=o.parsePathData(this.data()),this.pathLength=o.getPathLength(this.dataArray)}_sceneFunc(s){const c=this.dataArray;s.beginPath();let d=!1;for(let y=0;y<c.length;y++){const O=c[y].command,M=c[y].points;switch(O){case"L":s.lineTo(M[0],M[1]);break;case"M":s.moveTo(M[0],M[1]);break;case"C":s.bezierCurveTo(M[0],M[1],M[2],M[3],M[4],M[5]);break;case"Q":s.quadraticCurveTo(M[0],M[1],M[2],M[3]);break;case"A":var b=M[0],w=M[1],E=M[2],x=M[3],m=M[4],_=M[5],p=M[6],h=M[7],P=E>x?E:x,g=E>x?1:E/x,v=E>x?x/E:1;s.translate(b,w),s.rotate(p),s.scale(g,v),s.arc(0,0,P,m,m+_,1-h),s.scale(1/g,1/v),s.rotate(-p),s.translate(-b,-w);break;case"z":d=!0,s.closePath();break}}!d&&!this.hasFill()?s.strokeShape(this):s.fillStrokeShape(this)}getSelfRect(){let s=[];this.dataArray.forEach(function(m){if(m.command==="A"){const _=m.points[4],p=m.points[5],h=m.points[4]+p;let P=Math.PI/180;if(Math.abs(_-h)<P&&(P=Math.abs(_-h)),p<0)for(let g=_-P;g>h;g-=P){const v=o.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],g,0);s.push(v.x,v.y)}else for(let g=_+P;g<h;g+=P){const v=o.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],g,0);s.push(v.x,v.y)}}else if(m.command==="C")for(let _=0;_<=1;_+=.01){const p=o.getPointOnCubicBezier(_,m.start.x,m.start.y,m.points[0],m.points[1],m.points[2],m.points[3],m.points[4],m.points[5]);s.push(p.x,p.y)}else s=s.concat(m.points)});let c=s[0],d=s[0],b=s[1],w=s[1],E,x;for(let m=0;m<s.length/2;m++)E=s[m*2],x=s[m*2+1],isNaN(E)||(c=Math.min(c,E),d=Math.max(d,E)),isNaN(x)||(b=Math.min(b,x),w=Math.max(w,x));return{x:c,y:b,width:d-c,height:w-b}}getLength(){return this.pathLength}getPointAtLength(s){return o.getPointAtLengthOfDataArray(s,this.dataArray)}static getLineLength(s,c,d,b){return Math.sqrt((d-s)*(d-s)+(b-c)*(b-c))}static getPathLength(s){let c=0;for(let d=0;d<s.length;++d)c+=s[d].pathLength;return c}static getPointAtLengthOfDataArray(s,c){let d,b=0,w=c.length;if(!w)return null;for(;b<w&&s>c[b].pathLength;)s-=c[b].pathLength,++b;if(b===w)return d=c[b-1].points.slice(-2),{x:d[0],y:d[1]};if(s<.01)return d=c[b].points.slice(0,2),{x:d[0],y:d[1]};const E=c[b],x=E.points;switch(E.command){case"L":return o.getPointOnLine(s,E.start.x,E.start.y,x[0],x[1]);case"C":return o.getPointOnCubicBezier((0,n.t2length)(s,o.getPathLength(c),y=>(0,n.getCubicArcLength)([E.start.x,x[0],x[2],x[4]],[E.start.y,x[1],x[3],x[5]],y)),E.start.x,E.start.y,x[0],x[1],x[2],x[3],x[4],x[5]);case"Q":return o.getPointOnQuadraticBezier((0,n.t2length)(s,o.getPathLength(c),y=>(0,n.getQuadraticArcLength)([E.start.x,x[0],x[2]],[E.start.y,x[1],x[3]],y)),E.start.x,E.start.y,x[0],x[1],x[2],x[3]);case"A":var m=x[0],_=x[1],p=x[2],h=x[3],P=x[4],g=x[5],v=x[6];return P+=g*s/E.pathLength,o.getPointOnEllipticalArc(m,_,p,h,P,v)}return null}static getPointOnLine(s,c,d,b,w,E,x){E=E??c,x=x??d;const m=this.getLineLength(c,d,b,w);if(m<1e-10)return{x:c,y:d};if(b===c)return{x:E,y:x+(w>d?s:-s)};const _=(w-d)/(b-c),p=Math.sqrt(s*s/(1+_*_))*(b<c?-1:1),h=_*p;if(Math.abs(x-d-_*(E-c))<1e-10)return{x:E+p,y:x+h};const P=((E-c)*(b-c)+(x-d)*(w-d))/(m*m),g=c+P*(b-c),v=d+P*(w-d),y=this.getLineLength(E,x,g,v),O=Math.sqrt(s*s-y*y),M=Math.sqrt(O*O/(1+_*_))*(b<c?-1:1),R=_*M;return{x:g+M,y:v+R}}static getPointOnCubicBezier(s,c,d,b,w,E,x,m,_){function p(O){return O*O*O}function h(O){return 3*O*O*(1-O)}function P(O){return 3*O*(1-O)*(1-O)}function g(O){return(1-O)*(1-O)*(1-O)}const v=m*p(s)+E*h(s)+b*P(s)+c*g(s),y=_*p(s)+x*h(s)+w*P(s)+d*g(s);return{x:v,y}}static getPointOnQuadraticBezier(s,c,d,b,w,E,x){function m(g){return g*g}function _(g){return 2*g*(1-g)}function p(g){return(1-g)*(1-g)}const h=E*m(s)+b*_(s)+c*p(s),P=x*m(s)+w*_(s)+d*p(s);return{x:h,y:P}}static getPointOnEllipticalArc(s,c,d,b,w,E){const x=Math.cos(E),m=Math.sin(E),_={x:d*Math.cos(w),y:b*Math.sin(w)};return{x:s+(_.x*x-_.y*m),y:c+(_.x*m+_.y*x)}}static parsePathData(s){if(!s)return[];let c=s;const d=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];c=c.replace(new RegExp(" ","g"),",");for(var b=0;b<d.length;b++)c=c.replace(new RegExp(d[b],"g"),"|"+d[b]);const w=c.split("|"),E=[],x=[];let m=0,_=0;const p=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let h;for(b=1;b<w.length;b++){let k=w[b],L=k.charAt(0);for(k=k.slice(1),x.length=0;h=p.exec(k);)x.push(h[0]);const B=[];for(let X=0,K=x.length;X<K;X++){if(x[X]==="00"){B.push(0,0);continue}const Q=parseFloat(x[X]);isNaN(Q)?B.push(0):B.push(Q)}for(;B.length>0&&!isNaN(B[0]);){let X="",K=[];const Q=m,H=_;var P,g,v,y,O,M,R,D,T,S;switch(L){case"l":m+=B.shift(),_+=B.shift(),X="L",K.push(m,_);break;case"L":m=B.shift(),_=B.shift(),K.push(m,_);break;case"m":var A=B.shift(),N=B.shift();if(m+=A,_+=N,X="M",E.length>2&&E[E.length-1].command==="z"){for(let z=E.length-2;z>=0;z--)if(E[z].command==="M"){m=E[z].points[0]+A,_=E[z].points[1]+N;break}}K.push(m,_),L="l";break;case"M":m=B.shift(),_=B.shift(),X="M",K.push(m,_),L="L";break;case"h":m+=B.shift(),X="L",K.push(m,_);break;case"H":m=B.shift(),X="L",K.push(m,_);break;case"v":_+=B.shift(),X="L",K.push(m,_);break;case"V":_=B.shift(),X="L",K.push(m,_);break;case"C":K.push(B.shift(),B.shift(),B.shift(),B.shift()),m=B.shift(),_=B.shift(),K.push(m,_);break;case"c":K.push(m+B.shift(),_+B.shift(),m+B.shift(),_+B.shift()),m+=B.shift(),_+=B.shift(),X="C",K.push(m,_);break;case"S":g=m,v=_,P=E[E.length-1],P.command==="C"&&(g=m+(m-P.points[2]),v=_+(_-P.points[3])),K.push(g,v,B.shift(),B.shift()),m=B.shift(),_=B.shift(),X="C",K.push(m,_);break;case"s":g=m,v=_,P=E[E.length-1],P.command==="C"&&(g=m+(m-P.points[2]),v=_+(_-P.points[3])),K.push(g,v,m+B.shift(),_+B.shift()),m+=B.shift(),_+=B.shift(),X="C",K.push(m,_);break;case"Q":K.push(B.shift(),B.shift()),m=B.shift(),_=B.shift(),K.push(m,_);break;case"q":K.push(m+B.shift(),_+B.shift()),m+=B.shift(),_+=B.shift(),X="Q",K.push(m,_);break;case"T":g=m,v=_,P=E[E.length-1],P.command==="Q"&&(g=m+(m-P.points[0]),v=_+(_-P.points[1])),m=B.shift(),_=B.shift(),X="Q",K.push(g,v,m,_);break;case"t":g=m,v=_,P=E[E.length-1],P.command==="Q"&&(g=m+(m-P.points[0]),v=_+(_-P.points[1])),m+=B.shift(),_+=B.shift(),X="Q",K.push(g,v,m,_);break;case"A":y=B.shift(),O=B.shift(),M=B.shift(),R=B.shift(),D=B.shift(),T=m,S=_,m=B.shift(),_=B.shift(),X="A",K=this.convertEndpointToCenterParameterization(T,S,m,_,R,D,y,O,M);break;case"a":y=B.shift(),O=B.shift(),M=B.shift(),R=B.shift(),D=B.shift(),T=m,S=_,m+=B.shift(),_+=B.shift(),X="A",K=this.convertEndpointToCenterParameterization(T,S,m,_,R,D,y,O,M);break}E.push({command:X||L,points:K,start:{x:Q,y:H},pathLength:this.calcLength(Q,H,X||L,K)})}(L==="z"||L==="Z")&&E.push({command:"z",points:[],start:void 0,pathLength:0})}return E}static calcLength(s,c,d,b){let w,E,x,m;const _=o;switch(d){case"L":return _.getLineLength(s,c,b[0],b[1]);case"C":return(0,n.getCubicArcLength)([s,b[0],b[2],b[4]],[c,b[1],b[3],b[5]],1);case"Q":return(0,n.getQuadraticArcLength)([s,b[0],b[2]],[c,b[1],b[3]],1);case"A":w=0;var p=b[4],h=b[5],P=b[4]+h,g=Math.PI/180;if(Math.abs(p-P)<g&&(g=Math.abs(p-P)),E=_.getPointOnEllipticalArc(b[0],b[1],b[2],b[3],p,0),h<0)for(m=p-g;m>P;m-=g)x=_.getPointOnEllipticalArc(b[0],b[1],b[2],b[3],m,0),w+=_.getLineLength(E.x,E.y,x.x,x.y),E=x;else for(m=p+g;m<P;m+=g)x=_.getPointOnEllipticalArc(b[0],b[1],b[2],b[3],m,0),w+=_.getLineLength(E.x,E.y,x.x,x.y),E=x;return x=_.getPointOnEllipticalArc(b[0],b[1],b[2],b[3],P,0),w+=_.getLineLength(E.x,E.y,x.x,x.y),w}return 0}static convertEndpointToCenterParameterization(s,c,d,b,w,E,x,m,_){const p=_*(Math.PI/180),h=Math.cos(p)*(s-d)/2+Math.sin(p)*(c-b)/2,P=-1*Math.sin(p)*(s-d)/2+Math.cos(p)*(c-b)/2,g=h*h/(x*x)+P*P/(m*m);g>1&&(x*=Math.sqrt(g),m*=Math.sqrt(g));let v=Math.sqrt((x*x*(m*m)-x*x*(P*P)-m*m*(h*h))/(x*x*(P*P)+m*m*(h*h)));w===E&&(v*=-1),isNaN(v)&&(v=0);const y=v*x*P/m,O=v*-m*h/x,M=(s+d)/2+Math.cos(p)*y-Math.sin(p)*O,R=(c+b)/2+Math.sin(p)*y+Math.cos(p)*O,D=function(B){return Math.sqrt(B[0]*B[0]+B[1]*B[1])},T=function(B,X){return(B[0]*X[0]+B[1]*X[1])/(D(B)*D(X))},S=function(B,X){return(B[0]*X[1]<B[1]*X[0]?-1:1)*Math.acos(T(B,X))},A=S([1,0],[(h-y)/x,(P-O)/m]),N=[(h-y)/x,(P-O)/m],k=[(-1*h-y)/x,(-1*P-O)/m];let L=S(N,k);return T(N,k)<=-1&&(L=Math.PI),T(N,k)>=1&&(L=0),E===0&&L>0&&(L=L-2*Math.PI),E===1&&L<0&&(L=L+2*Math.PI),[M,R,x,m,A,L,p,E]}}return Cf.Path=o,o.prototype.className="Path",o.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(o),e.Factory.addGetterSetter(o,"data"),Cf}var cy;function N8(){if(cy)return xf;cy=1,Object.defineProperty(xf,"__esModule",{value:!0}),xf.Arrow=void 0;const e=Ft(),i=H_(),t=Bt(),n=Nt(),o=vm();class l extends i.Line{_sceneFunc(c){super._sceneFunc(c);const d=Math.PI*2,b=this.points();let w=b;const E=this.tension()!==0&&b.length>4;E&&(w=this.getTensionPoints());const x=this.pointerLength(),m=b.length;let _,p;if(E){const g=[w[w.length-4],w[w.length-3],w[w.length-2],w[w.length-1],b[m-2],b[m-1]],v=o.Path.calcLength(w[w.length-4],w[w.length-3],"C",g),y=o.Path.getPointOnQuadraticBezier(Math.min(1,1-x/v),g[0],g[1],g[2],g[3],g[4],g[5]);_=b[m-2]-y.x,p=b[m-1]-y.y}else _=b[m-2]-b[m-4],p=b[m-1]-b[m-3];const h=(Math.atan2(p,_)+d)%d,P=this.pointerWidth();this.pointerAtEnding()&&(c.save(),c.beginPath(),c.translate(b[m-2],b[m-1]),c.rotate(h),c.moveTo(0,0),c.lineTo(-x,P/2),c.lineTo(-x,-P/2),c.closePath(),c.restore(),this.__fillStroke(c)),this.pointerAtBeginning()&&(c.save(),c.beginPath(),c.translate(b[0],b[1]),E?(_=(w[0]+w[2])/2-b[0],p=(w[1]+w[3])/2-b[1]):(_=b[2]-b[0],p=b[3]-b[1]),c.rotate((Math.atan2(-p,-_)+d)%d),c.moveTo(0,0),c.lineTo(-x,P/2),c.lineTo(-x,-P/2),c.closePath(),c.restore(),this.__fillStroke(c))}__fillStroke(c){const d=this.dashEnabled();d&&(this.attrs.dashEnabled=!1,c.setLineDash([])),c.fillStrokeShape(this),d&&(this.attrs.dashEnabled=!0)}getSelfRect(){const c=super.getSelfRect(),d=this.pointerWidth()/2;return{x:c.x,y:c.y-d,width:c.width,height:c.height+d*2}}}return xf.Arrow=l,l.prototype.className="Arrow",(0,n._registerNode)(l),e.Factory.addGetterSetter(l,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(l,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(l,"pointerAtBeginning",!1),e.Factory.addGetterSetter(l,"pointerAtEnding",!0),xf}var kf={},fy;function I8(){if(fy)return kf;fy=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.Circle=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class o extends i.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius()!==s/2&&this.radius(s/2)}setHeight(s){this.radius()!==s/2&&this.radius(s/2)}}return kf.Circle=o,o.prototype._centroid=!0,o.prototype.className="Circle",o.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(o),e.Factory.addGetterSetter(o,"radius",0,(0,t.getNumberValidator)()),kf}var Af={},dy;function D8(){if(dy)return Af;dy=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.Ellipse=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class o extends i.Shape{_sceneFunc(s){const c=this.radiusX(),d=this.radiusY();s.beginPath(),s.save(),c!==d&&s.scale(1,d/c),s.arc(0,0,c,0,Math.PI*2,!1),s.restore(),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(s){this.radiusX(s/2)}setHeight(s){this.radiusY(s/2)}}return Af.Ellipse=o,o.prototype.className="Ellipse",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,n._registerNode)(o),e.Factory.addComponentsGetterSetter(o,"radius",["x","y"]),e.Factory.addGetterSetter(o,"radiusX",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"radiusY",0,(0,t.getNumberValidator)()),Af}var Tf={},hy;function j8(){if(hy)return Tf;hy=1,Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.Image=void 0;const e=In(),i=Ft(),t=wr(),n=Nt(),o=Bt();class l extends t.Shape{constructor(c){super(c),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const c=this.image();c&&c.complete||c&&c.readyState===4||c&&c.addEventListener&&c.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const c=!!this.cornerRadius(),d=this.hasShadow();return c&&d?!0:super._useBufferCanvas(!0)}_sceneFunc(c){const d=this.getWidth(),b=this.getHeight(),w=this.cornerRadius(),E=this.attrs.image;let x;if(E){const m=this.attrs.cropWidth,_=this.attrs.cropHeight;m&&_?x=[E,this.cropX(),this.cropY(),m,_,0,0,d,b]:x=[E,0,0,d,b]}(this.hasFill()||this.hasStroke()||w)&&(c.beginPath(),w?e.Util.drawRoundedRectPath(c,d,b,w):c.rect(0,0,d,b),c.closePath(),c.fillStrokeShape(this)),E&&(w&&c.clip(),c.drawImage.apply(c,x))}_hitFunc(c){const d=this.width(),b=this.height(),w=this.cornerRadius();c.beginPath(),w?e.Util.drawRoundedRectPath(c,d,b,w):c.rect(0,0,d,b),c.closePath(),c.fillStrokeShape(this)}getWidth(){var c,d;return(c=this.attrs.width)!==null&&c!==void 0?c:(d=this.image())===null||d===void 0?void 0:d.width}getHeight(){var c,d;return(c=this.attrs.height)!==null&&c!==void 0?c:(d=this.image())===null||d===void 0?void 0:d.height}static fromURL(c,d,b=null){const w=e.Util.createImageElement();w.onload=function(){const E=new l({image:w});d(E)},w.onerror=b,w.crossOrigin="Anonymous",w.src=c}}return Tf.Image=l,l.prototype.className="Image",(0,n._registerNode)(l),i.Factory.addGetterSetter(l,"cornerRadius",0,(0,o.getNumberOrArrayOfNumbersValidator)(4)),i.Factory.addGetterSetter(l,"image"),i.Factory.addComponentsGetterSetter(l,"crop",["x","y","width","height"]),i.Factory.addGetterSetter(l,"cropX",0,(0,o.getNumberValidator)()),i.Factory.addGetterSetter(l,"cropY",0,(0,o.getNumberValidator)()),i.Factory.addGetterSetter(l,"cropWidth",0,(0,o.getNumberValidator)()),i.Factory.addGetterSetter(l,"cropHeight",0,(0,o.getNumberValidator)()),Tf}var Ds={},py;function F8(){if(py)return Ds;py=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.Tag=Ds.Label=void 0;const e=Ft(),i=wr(),t=gm(),n=Bt(),o=Nt(),l=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],s="Change.konva",c="none",d="up",b="right",w="down",E="left",x=l.length;class m extends t.Group{constructor(h){super(h),this.on("add.konva",function(P){this._addListeners(P.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(h){let P=this,g;const v=function(){P._sync()};for(g=0;g<x;g++)h.on(l[g]+s,v)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let h=this.getText(),P=this.getTag(),g,v,y,O,M,R,D;if(h&&P){switch(g=h.width(),v=h.height(),y=P.pointerDirection(),O=P.pointerWidth(),D=P.pointerHeight(),M=0,R=0,y){case d:M=g/2,R=-1*D;break;case b:M=g+O,R=v/2;break;case w:M=g/2,R=v+D;break;case E:M=-1*O,R=v/2;break}P.setAttrs({x:-1*M,y:-1*R,width:g,height:v}),h.setAttrs({x:-1*M,y:-1*R})}}}Ds.Label=m,m.prototype.className="Label",(0,o._registerNode)(m);class _ extends i.Shape{_sceneFunc(h){const P=this.width(),g=this.height(),v=this.pointerDirection(),y=this.pointerWidth(),O=this.pointerHeight(),M=this.cornerRadius();let R=0,D=0,T=0,S=0;typeof M=="number"?R=D=T=S=Math.min(M,P/2,g/2):(R=Math.min(M[0]||0,P/2,g/2),D=Math.min(M[1]||0,P/2,g/2),S=Math.min(M[2]||0,P/2,g/2),T=Math.min(M[3]||0,P/2,g/2)),h.beginPath(),h.moveTo(R,0),v===d&&(h.lineTo((P-y)/2,0),h.lineTo(P/2,-1*O),h.lineTo((P+y)/2,0)),h.lineTo(P-D,0),h.arc(P-D,D,D,Math.PI*3/2,0,!1),v===b&&(h.lineTo(P,(g-O)/2),h.lineTo(P+y,g/2),h.lineTo(P,(g+O)/2)),h.lineTo(P,g-S),h.arc(P-S,g-S,S,0,Math.PI/2,!1),v===w&&(h.lineTo((P+y)/2,g),h.lineTo(P/2,g+O),h.lineTo((P-y)/2,g)),h.lineTo(T,g),h.arc(T,g-T,T,Math.PI/2,Math.PI,!1),v===E&&(h.lineTo(0,(g+O)/2),h.lineTo(-1*y,g/2),h.lineTo(0,(g-O)/2)),h.lineTo(0,R),h.arc(R,R,R,Math.PI,Math.PI*3/2,!1),h.closePath(),h.fillStrokeShape(this)}getSelfRect(){let h=0,P=0,g=this.pointerWidth(),v=this.pointerHeight(),y=this.pointerDirection(),O=this.width(),M=this.height();return y===d?(P-=v,M+=v):y===w?M+=v:y===E?(h-=g*1.5,O+=g):y===b&&(O+=g*1.5),{x:h,y:P,width:O,height:M}}}return Ds.Tag=_,_.prototype.className="Tag",(0,o._registerNode)(_),e.Factory.addGetterSetter(_,"pointerDirection",c),e.Factory.addGetterSetter(_,"pointerWidth",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(_,"pointerHeight",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(_,"cornerRadius",0,(0,n.getNumberOrArrayOfNumbersValidator)(4)),Ds}var Rf={},gy;function G_(){if(gy)return Rf;gy=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.Rect=void 0;const e=Ft(),i=wr(),t=Nt(),n=In(),o=Bt();class l extends i.Shape{_sceneFunc(c){const d=this.cornerRadius(),b=this.width(),w=this.height();c.beginPath(),d?n.Util.drawRoundedRectPath(c,b,w,d):c.rect(0,0,b,w),c.closePath(),c.fillStrokeShape(this)}}return Rf.Rect=l,l.prototype.className="Rect",(0,t._registerNode)(l),e.Factory.addGetterSetter(l,"cornerRadius",0,(0,o.getNumberOrArrayOfNumbersValidator)(4)),Rf}var Mf={},my;function z8(){if(my)return Mf;my=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.RegularPolygon=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class o extends i.Shape{_sceneFunc(s){const c=this._getPoints();s.beginPath(),s.moveTo(c[0].x,c[0].y);for(let d=1;d<c.length;d++)s.lineTo(c[d].x,c[d].y);s.closePath(),s.fillStrokeShape(this)}_getPoints(){const s=this.attrs.sides,c=this.attrs.radius||0,d=[];for(let b=0;b<s;b++)d.push({x:c*Math.sin(b*2*Math.PI/s),y:-1*c*Math.cos(b*2*Math.PI/s)});return d}getSelfRect(){const s=this._getPoints();let c=s[0].x,d=s[0].y,b=s[0].x,w=s[0].y;return s.forEach(E=>{c=Math.min(c,E.x),d=Math.max(d,E.x),b=Math.min(b,E.y),w=Math.max(w,E.y)}),{x:c,y:b,width:d-c,height:w-b}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return Mf.RegularPolygon=o,o.prototype.className="RegularPolygon",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(o),e.Factory.addGetterSetter(o,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"sides",0,(0,t.getNumberValidator)()),Mf}var Lf={},vy;function B8(){if(vy)return Lf;vy=1,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.Ring=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt(),o=Math.PI*2;class l extends i.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.innerRadius(),0,o,!1),c.moveTo(this.outerRadius(),0),c.arc(0,0,this.outerRadius(),o,0,!0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}}return Lf.Ring=l,l.prototype.className="Ring",l.prototype._centroid=!0,l.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(l),e.Factory.addGetterSetter(l,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(l,"outerRadius",0,(0,t.getNumberValidator)()),Lf}var Nf={},yy;function U8(){if(yy)return Nf;yy=1,Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.Sprite=void 0;const e=Ft(),i=wr(),t=mm(),n=Bt(),o=Nt();class l extends i.Shape{constructor(c){super(c),this._updated=!0,this.anim=new t.Animation(()=>{const d=this._updated;return this._updated=!1,d}),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(c){const d=this.animation(),b=this.frameIndex(),w=b*4,E=this.animations()[d],x=this.frameOffsets(),m=E[w+0],_=E[w+1],p=E[w+2],h=E[w+3],P=this.image();if((this.hasFill()||this.hasStroke())&&(c.beginPath(),c.rect(0,0,p,h),c.closePath(),c.fillStrokeShape(this)),P)if(x){const g=x[d],v=b*2;c.drawImage(P,m,_,p,h,g[v+0],g[v+1],p,h)}else c.drawImage(P,m,_,p,h,0,0,p,h)}_hitFunc(c){const d=this.animation(),b=this.frameIndex(),w=b*4,E=this.animations()[d],x=this.frameOffsets(),m=E[w+2],_=E[w+3];if(c.beginPath(),x){const p=x[d],h=b*2;c.rect(p[h+0],p[h+1],m,_)}else c.rect(0,0,m,_);c.closePath(),c.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const c=this;this.interval=setInterval(function(){c._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const c=this.getLayer();this.anim.setLayers(c),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const c=this.frameIndex(),d=this.animation(),b=this.animations(),w=b[d],E=w.length/4;c<E-1?this.frameIndex(c+1):this.frameIndex(0)}}return Nf.Sprite=l,l.prototype.className="Sprite",(0,o._registerNode)(l),e.Factory.addGetterSetter(l,"animation"),e.Factory.addGetterSetter(l,"animations"),e.Factory.addGetterSetter(l,"frameOffsets"),e.Factory.addGetterSetter(l,"image"),e.Factory.addGetterSetter(l,"frameIndex",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"frameRate",17,(0,n.getNumberValidator)()),e.Factory.backCompat(l,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),Nf}var If={},by;function q8(){if(by)return If;by=1,Object.defineProperty(If,"__esModule",{value:!0}),If.Star=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class o extends i.Shape{_sceneFunc(s){const c=this.innerRadius(),d=this.outerRadius(),b=this.numPoints();s.beginPath(),s.moveTo(0,0-d);for(let w=1;w<b*2;w++){const E=w%2===0?d:c,x=E*Math.sin(w*Math.PI/b),m=-1*E*Math.cos(w*Math.PI/b);s.lineTo(x,m)}s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}}return If.Star=o,o.prototype.className="Star",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(o),e.Factory.addGetterSetter(o,"numPoints",5,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"outerRadius",0,(0,t.getNumberValidator)()),If}var Xu={},_y;function V_(){if(_y)return Xu;_y=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.Text=void 0,Xu.stringToArray=s;const e=In(),i=Ft(),t=wr(),n=Nt(),o=Bt(),l=Nt();function s(U){return[...U].reduce(($,ee,G,Z)=>{if(new RegExp("\\p{Emoji}","u").test(ee)){const W=Z[G+1];W&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(W)?($.push(ee+W),Z[G+1]=""):$.push(ee)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(ee+(Z[G+1]||""))?$.push(ee+Z[G+1]):G>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(ee)?$[$.length-1]+=ee:ee&&$.push(ee);return $},[])}const c="auto",d="center",b="inherit",w="justify",E="Change.konva",x="2d",m="-",_="left",p="text",h="Text",P="top",g="bottom",v="middle",y="normal",O="px ",M=" ",R="right",D="rtl",T="word",S="char",A="none",N="…",k=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],L=k.length;function B(U){return U.split(",").map($=>{$=$.trim();const ee=$.indexOf(" ")>=0,G=$.indexOf('"')>=0||$.indexOf("'")>=0;return ee&&!G&&($=`"${$}"`),$}).join(", ")}let X;function K(){return X||(X=e.Util.createCanvasElement().getContext(x),X)}function Q(U){U.fillText(this._partialText,this._partialTextX,this._partialTextY)}function H(U){U.setAttr("miterLimit",2),U.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function z(U){return U=U||{},!U.fillLinearGradientColorStops&&!U.fillRadialGradientColorStops&&!U.fillPatternImage&&(U.fill=U.fill||"black"),U}class I extends t.Shape{constructor($){super(z($)),this._partialTextX=0,this._partialTextY=0;for(let ee=0;ee<L;ee++)this.on(k[ee]+E,this._setTextData);this._setTextData()}_sceneFunc($){const ee=this.textArr,G=ee.length;if(!this.text())return;let Z=this.padding(),W=this.fontSize(),te=this.lineHeight()*W,re=this.verticalAlign(),ie=this.direction(),oe=0,se=this.align(),de=this.getWidth(),pe=this.letterSpacing(),Oe=this.fill(),_e=this.textDecoration(),Te=_e.indexOf("underline")!==-1,ce=_e.indexOf("line-through")!==-1,he;ie=ie===b?$.direction:ie;let Ce=te/2,Le=v;if(n.Konva._fixTextRendering){const ze=this.measureSize("M");Le="alphabetic",Ce=(ze.fontBoundingBoxAscent-ze.fontBoundingBoxDescent)/2+te/2}var ue=0,me=0;for(ie===D&&$.setAttr("direction",ie),$.setAttr("font",this._getContextFont()),$.setAttr("textBaseline",Le),$.setAttr("textAlign",_),re===v?oe=(this.getHeight()-G*te-Z*2)/2:re===g&&(oe=this.getHeight()-G*te-Z*2),$.translate(Z,oe+Z),he=0;he<G;he++){var ue=0,me=0,xe=ee[he],je=xe.text,ot=xe.width,ht=xe.lastInParagraph,et,Ke;if($.save(),se===R?ue+=de-ot-Z*2:se===d&&(ue+=(de-ot-Z*2)/2),Te){$.save(),$.beginPath();const Ve=n.Konva._fixTextRendering?Math.round(W/4):Math.round(W/2),bt=ue,Ct=Ce+me+Ve;$.moveTo(bt,Ct),et=je.split(" ").length-1,Ke=se===w&&!ht?de-Z*2:ot,$.lineTo(bt+Math.round(Ke),Ct),$.lineWidth=W/15;const we=this._getLinearGradient();$.strokeStyle=we||Oe,$.stroke(),$.restore()}if(ce){$.save(),$.beginPath();const Ve=n.Konva._fixTextRendering?-Math.round(W/4):0;$.moveTo(ue,Ce+me+Ve),et=je.split(" ").length-1,Ke=se===w&&!ht?de-Z*2:ot,$.lineTo(ue+Math.round(Ke),Ce+me+Ve),$.lineWidth=W/15;const bt=this._getLinearGradient();$.strokeStyle=bt||Oe,$.stroke(),$.restore()}if(ie!==D&&(pe!==0||se===w)){et=je.split(" ").length-1;const Ve=s(je);for(let bt=0;bt<Ve.length;bt++){const Ct=Ve[bt];Ct===" "&&!ht&&se===w&&(ue+=(de-Z*2-ot)/et),this._partialTextX=ue,this._partialTextY=Ce+me,this._partialText=Ct,$.fillStrokeShape(this),ue+=this.measureSize(Ct).width+pe}}else pe!==0&&$.setAttr("letterSpacing",`${pe}px`),this._partialTextX=ue,this._partialTextY=Ce+me,this._partialText=je,$.fillStrokeShape(this);$.restore(),G>1&&(Ce+=te)}}_hitFunc($){const ee=this.getWidth(),G=this.getHeight();$.beginPath(),$.rect(0,0,ee,G),$.closePath(),$.fillStrokeShape(this)}setText($){const ee=e.Util._isString($)?$:$==null?"":$+"";return this._setAttr(p,ee),this}getWidth(){return this.attrs.width===c||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===c||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize($){var ee,G,Z,W,te,re,ie,oe,se,de,pe;let Oe=K(),_e=this.fontSize(),Te;Oe.save(),Oe.font=this._getContextFont(),Te=Oe.measureText($),Oe.restore();const ce=_e/100;return{actualBoundingBoxAscent:(ee=Te.actualBoundingBoxAscent)!==null&&ee!==void 0?ee:71.58203125*ce,actualBoundingBoxDescent:(G=Te.actualBoundingBoxDescent)!==null&&G!==void 0?G:0,actualBoundingBoxLeft:(Z=Te.actualBoundingBoxLeft)!==null&&Z!==void 0?Z:-7.421875*ce,actualBoundingBoxRight:(W=Te.actualBoundingBoxRight)!==null&&W!==void 0?W:75.732421875*ce,alphabeticBaseline:(te=Te.alphabeticBaseline)!==null&&te!==void 0?te:0,emHeightAscent:(re=Te.emHeightAscent)!==null&&re!==void 0?re:100*ce,emHeightDescent:(ie=Te.emHeightDescent)!==null&&ie!==void 0?ie:-20*ce,fontBoundingBoxAscent:(oe=Te.fontBoundingBoxAscent)!==null&&oe!==void 0?oe:91*ce,fontBoundingBoxDescent:(se=Te.fontBoundingBoxDescent)!==null&&se!==void 0?se:21*ce,hangingBaseline:(de=Te.hangingBaseline)!==null&&de!==void 0?de:72.80000305175781*ce,ideographicBaseline:(pe=Te.ideographicBaseline)!==null&&pe!==void 0?pe:-21*ce,width:Te.width,height:_e}}_getContextFont(){return this.fontStyle()+M+this.fontVariant()+M+(this.fontSize()+O)+B(this.fontFamily())}_addTextLine($){this.align()===w&&($=$.trim());const G=this._getTextWidth($);return this.textArr.push({text:$,width:G,lastInParagraph:!1})}_getTextWidth($){const ee=this.letterSpacing(),G=$.length;return K().measureText($).width+ee*G}_setTextData(){let $=this.text().split(`
43
+ `),ee=+this.fontSize(),G=0,Z=this.lineHeight()*ee,W=this.attrs.width,te=this.attrs.height,re=W!==c&&W!==void 0,ie=te!==c&&te!==void 0,oe=this.padding(),se=W-oe*2,de=te-oe*2,pe=0,Oe=this.wrap(),_e=Oe!==A,Te=Oe!==S&&_e,ce=this.ellipsis();this.textArr=[],K().font=this._getContextFont();const he=ce?this._getTextWidth(N):0;for(let Ce=0,Le=$.length;Ce<Le;++Ce){let ue=$[Ce],me=this._getTextWidth(ue);if(re&&me>se)for(;ue.length>0;){let xe=0,je=s(ue).length,ot="",ht=0;for(;xe<je;){const et=xe+je>>>1,Ke=s(ue),ze=Ke.slice(0,et+1).join(""),Be=this._getTextWidth(ze)+he;Be<=se?(xe=et+1,ot=ze,ht=Be):je=et}if(ot){if(Te){const ze=s(ue),Be=s(ot),Ve=ze[Be.length],bt=Ve===M||Ve===m;let Ct;if(bt&&ht<=se)Ct=Be.length;else{const we=Be.lastIndexOf(M),Se=Be.lastIndexOf(m);Ct=Math.max(we,Se)+1}Ct>0&&(xe=Ct,ot=ze.slice(0,xe).join(""),ht=this._getTextWidth(ot))}if(ot=ot.trimRight(),this._addTextLine(ot),G=Math.max(G,ht),pe+=Z,this._shouldHandleEllipsis(pe)){this._tryToAddEllipsisToLastLine();break}if(ue=s(ue).slice(xe).join("").trimLeft(),ue.length>0&&(me=this._getTextWidth(ue),me<=se)){this._addTextLine(ue),pe+=Z,G=Math.max(G,me);break}}else break}else this._addTextLine(ue),pe+=Z,G=Math.max(G,me),this._shouldHandleEllipsis(pe)&&Ce<Le-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ie&&pe+Z>de)break}this.textHeight=ee,this.textWidth=G}_shouldHandleEllipsis($){const ee=+this.fontSize(),G=this.lineHeight()*ee,Z=this.attrs.height,W=Z!==c&&Z!==void 0,te=this.padding(),re=Z-te*2;return!(this.wrap()!==A)||W&&$+G>re}_tryToAddEllipsisToLastLine(){const $=this.attrs.width,ee=$!==c&&$!==void 0,G=this.padding(),Z=$-G*2,W=this.ellipsis(),te=this.textArr[this.textArr.length-1];!te||!W||(ee&&(this._getTextWidth(te.text+N)<Z||(te.text=te.text.slice(0,te.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(te.text+N))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const $=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,ee=this.hasShadow();return $&&ee?!0:super._useBufferCanvas()}}return Xu.Text=I,I.prototype._fillFunc=Q,I.prototype._strokeFunc=H,I.prototype.className=h,I.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,l._registerNode)(I),i.Factory.overWriteSetter(I,"width",(0,o.getNumberOrAutoValidator)()),i.Factory.overWriteSetter(I,"height",(0,o.getNumberOrAutoValidator)()),i.Factory.addGetterSetter(I,"direction",b),i.Factory.addGetterSetter(I,"fontFamily","Arial"),i.Factory.addGetterSetter(I,"fontSize",12,(0,o.getNumberValidator)()),i.Factory.addGetterSetter(I,"fontStyle",y),i.Factory.addGetterSetter(I,"fontVariant",y),i.Factory.addGetterSetter(I,"padding",0,(0,o.getNumberValidator)()),i.Factory.addGetterSetter(I,"align",_),i.Factory.addGetterSetter(I,"verticalAlign",P),i.Factory.addGetterSetter(I,"lineHeight",1,(0,o.getNumberValidator)()),i.Factory.addGetterSetter(I,"wrap",T),i.Factory.addGetterSetter(I,"ellipsis",!1,(0,o.getBooleanValidator)()),i.Factory.addGetterSetter(I,"letterSpacing",0,(0,o.getNumberValidator)()),i.Factory.addGetterSetter(I,"text","",(0,o.getStringValidator)()),i.Factory.addGetterSetter(I,"textDecoration",""),Xu}var Df={},wy;function H8(){if(wy)return Df;wy=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.TextPath=void 0;const e=In(),i=Ft(),t=wr(),n=vm(),o=V_(),l=Bt(),s=Nt(),c="",d="normal";function b(x){x.fillText(this.partialText,0,0)}function w(x){x.strokeText(this.partialText,0,0)}class E extends t.Shape{constructor(m){super(m),this.dummyCanvas=e.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 n.Path.getPathLength(this.dataArray)}_getPointAtLength(m){if(!this.attrs.data)return null;const _=this.pathLength;return m-1>_?null:n.Path.getPointAtLengthOfDataArray(m,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(m){m.setAttr("font",this._getContextFont()),m.setAttr("textBaseline",this.textBaseline()),m.setAttr("textAlign","left"),m.save();const _=this.textDecoration(),p=this.fill(),h=this.fontSize(),P=this.glyphInfo;_==="underline"&&m.beginPath();for(let g=0;g<P.length;g++){m.save();const v=P[g].p0;m.translate(v.x,v.y),m.rotate(P[g].rotation),this.partialText=P[g].text,m.fillStrokeShape(this),_==="underline"&&(g===0&&m.moveTo(0,h/2+1),m.lineTo(h,h/2+1)),m.restore()}_==="underline"&&(m.strokeStyle=p,m.lineWidth=h/20,m.stroke()),m.restore()}_hitFunc(m){m.beginPath();const _=this.glyphInfo;if(_.length>=1){const p=_[0].p0;m.moveTo(p.x,p.y)}for(let p=0;p<_.length;p++){const h=_[p].p1;m.lineTo(h.x,h.y)}m.setAttr("lineWidth",this.fontSize()),m.setAttr("strokeStyle",this.colorKey),m.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(m){return o.Text.prototype.setText.call(this,m)}_getContextFont(){return o.Text.prototype._getContextFont.call(this)}_getTextSize(m){const p=this.dummyCanvas.getContext("2d");p.save(),p.font=this._getContextFont();const h=p.measureText(m);return p.restore(),{width:h.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:m,height:_}=this._getTextSize(this.attrs.text);if(this.textWidth=m,this.textHeight=_,this.glyphInfo=[],!this.attrs.data)return null;const p=this.letterSpacing(),h=this.align(),P=this.kerningFunc(),g=Math.max(this.textWidth+((this.attrs.text||"").length-1)*p,0);let v=0;h==="center"&&(v=Math.max(0,this.pathLength/2-g/2)),h==="right"&&(v=Math.max(0,this.pathLength-g));const y=(0,o.stringToArray)(this.text());let O=v;for(let M=0;M<y.length;M++){const R=this._getPointAtLength(O);if(!R)return;let D=this._getTextSize(y[M]).width+p;if(y[M]===" "&&h==="justify"){const L=this.text().split(" ").length-1;D+=(this.pathLength-g)/L}const T=this._getPointAtLength(O+D);if(!T)return;const S=n.Path.getLineLength(R.x,R.y,T.x,T.y);let A=0;if(P)try{A=P(y[M-1],y[M])*this.fontSize()}catch{A=0}R.x+=A,T.x+=A,this.textWidth+=A;const N=n.Path.getPointOnLine(A+S/2,R.x,R.y,T.x,T.y),k=Math.atan2(T.y-R.y,T.x-R.x);this.glyphInfo.push({transposeX:N.x,transposeY:N.y,text:y[M],rotation:k,p0:R,p1:T}),O+=D}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const m=[];this.glyphInfo.forEach(function(O){m.push(O.p0.x),m.push(O.p0.y),m.push(O.p1.x),m.push(O.p1.y)});let _=m[0]||0,p=m[0]||0,h=m[1]||0,P=m[1]||0,g,v;for(let O=0;O<m.length/2;O++)g=m[O*2],v=m[O*2+1],_=Math.min(_,g),p=Math.max(p,g),h=Math.min(h,v),P=Math.max(P,v);const y=this.fontSize();return{x:_-y/2,y:h-y/2,width:p-_+y,height:P-h+y}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return Df.TextPath=E,E.prototype._fillFunc=b,E.prototype._strokeFunc=w,E.prototype._fillFuncHit=b,E.prototype._strokeFuncHit=w,E.prototype.className="TextPath",E.prototype._attrsAffectingSize=["text","fontSize","data"],(0,s._registerNode)(E),i.Factory.addGetterSetter(E,"data"),i.Factory.addGetterSetter(E,"fontFamily","Arial"),i.Factory.addGetterSetter(E,"fontSize",12,(0,l.getNumberValidator)()),i.Factory.addGetterSetter(E,"fontStyle",d),i.Factory.addGetterSetter(E,"align","left"),i.Factory.addGetterSetter(E,"letterSpacing",0,(0,l.getNumberValidator)()),i.Factory.addGetterSetter(E,"textBaseline","middle"),i.Factory.addGetterSetter(E,"fontVariant",d),i.Factory.addGetterSetter(E,"text",c),i.Factory.addGetterSetter(E,"textDecoration",""),i.Factory.addGetterSetter(E,"kerningFunc",void 0),Df}var jf={},Sy;function G8(){if(Sy)return jf;Sy=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.Transformer=void 0;const e=In(),i=Ft(),t=Hn(),n=wr(),o=G_(),l=gm(),s=Nt(),c=Bt(),d=Nt(),b="tr-konva",w=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(D=>D+`.${b}`).join(" "),E="nodesRect",x=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],m={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},_="ontouchstart"in s.Konva._global;function p(D,T,S){if(D==="rotater")return S;T+=e.Util.degToRad(m[D]||0);const A=(e.Util.radToDeg(T)%360+360)%360;return e.Util._inRange(A,315+22.5,360)||e.Util._inRange(A,0,22.5)?"ns-resize":e.Util._inRange(A,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(A,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(A,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(A,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(A,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(A,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(A,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+A),"pointer")}const h=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function P(D){return{x:D.x+D.width/2*Math.cos(D.rotation)+D.height/2*Math.sin(-D.rotation),y:D.y+D.height/2*Math.cos(D.rotation)+D.width/2*Math.sin(D.rotation)}}function g(D,T,S){const A=S.x+(D.x-S.x)*Math.cos(T)-(D.y-S.y)*Math.sin(T),N=S.y+(D.x-S.x)*Math.sin(T)+(D.y-S.y)*Math.cos(T);return{...D,rotation:D.rotation+T,x:A,y:N}}function v(D,T){const S=P(D);return g(D,T,S)}function y(D,T,S){let A=T;for(let N=0;N<D.length;N++){const k=s.Konva.getAngle(D[N]),L=Math.abs(k-T)%(Math.PI*2);Math.min(L,Math.PI*2-L)<S&&(A=k)}return A}let O=0;class M extends l.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(w,this.update),this.getNode()&&this.update()}attachTo(T){return this.setNode(T),this}setNode(T){return e.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 b+this._id}setNodes(T=[]){this._nodes&&this._nodes.length&&this.detach();const S=T.filter(N=>N.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=T=S,T.length===1&&this.useSingleNodeRotation()?this.rotation(T[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(N=>{const k=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},L=N._attrsAffectingSize.map(B=>B+"Change."+this._getEventNamespace()).join(" ");N.on(L,k),N.on(x.map(B=>B+`.${this._getEventNamespace()}`).join(" "),k),N.on(`absoluteTransformChange.${this._getEventNamespace()}`,k),this._proxyDrag(N)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(T){let S;T.on(`dragstart.${this._getEventNamespace()}`,A=>{S=T.getAbsolutePosition(),!this.isDragging()&&T!==this.findOne(".back")&&this.startDrag(A,!1)}),T.on(`dragmove.${this._getEventNamespace()}`,A=>{if(!S)return;const N=T.getAbsolutePosition(),k=N.x-S.x,L=N.y-S.y;this.nodes().forEach(B=>{if(B===T||B.isDragging())return;const X=B.getAbsolutePosition();B.setAbsolutePosition({x:X.x+k,y:X.y+L}),B.startDrag(A)}),S=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(E),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(E,this.__getNodeRect)}__getNodeShape(T,S=this.rotation(),A){const N=T.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),k=T.getAbsoluteScale(A),L=T.getAbsolutePosition(A),B=N.x*k.x-T.offsetX()*k.x,X=N.y*k.y-T.offsetY()*k.y,K=(s.Konva.getAngle(T.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),Q={x:L.x+B*Math.cos(K)+X*Math.sin(-K),y:L.y+X*Math.cos(K)+B*Math.sin(K),width:N.width*k.x,height:N.height*k.y,rotation:K};return g(Q,-s.Konva.getAngle(S),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const S=[];this.nodes().map(K=>{const Q=K.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),H=[{x:Q.x,y:Q.y},{x:Q.x+Q.width,y:Q.y},{x:Q.x+Q.width,y:Q.y+Q.height},{x:Q.x,y:Q.y+Q.height}],z=K.getAbsoluteTransform();H.forEach(function(I){const U=z.point(I);S.push(U)})});const A=new e.Transform;A.rotate(-s.Konva.getAngle(this.rotation()));let N=1/0,k=1/0,L=-1/0,B=-1/0;S.forEach(function(K){const Q=A.point(K);N===void 0&&(N=L=Q.x,k=B=Q.y),N=Math.min(N,Q.x),k=Math.min(k,Q.y),L=Math.max(L,Q.x),B=Math.max(B,Q.y)}),A.invert();const X=A.point({x:N,y:k});return{x:X.x,y:X.y,width:L-N,height:B-k,rotation:s.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(),h.forEach(T=>{this._createAnchor(T)}),this._createAnchor("rotater")}_createAnchor(T){const S=new o.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:T+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:_?10:"auto"}),A=this;S.on("mousedown touchstart",function(N){A._handleMouseDown(N)}),S.on("dragstart",N=>{S.stopDrag(),N.cancelBubble=!0}),S.on("dragend",N=>{N.cancelBubble=!0}),S.on("mouseenter",()=>{const N=s.Konva.getAngle(this.rotation()),k=this.rotateAnchorCursor(),L=p(T,N,k);S.getStage().content&&(S.getStage().content.style.cursor=L),this._cursorChange=!0}),S.on("mouseout",()=>{S.getStage().content&&(S.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(S)}_createBack(){const T=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(S,A){const N=A.getParent(),k=N.padding();S.beginPath(),S.rect(-k,-k,A.width()+k*2,A.height()+k*2),S.moveTo(A.width()/2,-k),N.rotateEnabled()&&N.rotateLineVisible()&&S.lineTo(A.width()/2,-N.rotateAnchorOffset()*e.Util._sign(A.height())-k),S.fillStrokeShape(A)},hitFunc:(S,A)=>{if(!this.shouldOverdrawWholeArea())return;const N=this.padding();S.beginPath(),S.rect(-N,-N,A.width()+N*2,A.height()+N*2),S.fillStrokeShape(A)}});this.add(T),this._proxyDrag(T),T.on("dragstart",S=>{S.cancelBubble=!0}),T.on("dragmove",S=>{S.cancelBubble=!0}),T.on("dragend",S=>{S.cancelBubble=!0}),this.on("dragmove",S=>{this.update()})}_handleMouseDown(T){if(this._transforming)return;this._movingAnchorName=T.target.name().split(" ")[0];const S=this._getNodeRect(),A=S.width,N=S.height,k=Math.sqrt(Math.pow(A,2)+Math.pow(N,2));this.sin=Math.abs(N/k),this.cos=Math.abs(A/k),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;const L=T.target.getAbsolutePosition(),B=T.target.getStage().getPointerPosition();this._anchorDragOffset={x:B.x-L.x,y:B.y-L.y},O++,this._fire("transformstart",{evt:T.evt,target:this.getNode()}),this._nodes.forEach(X=>{X._fire("transformstart",{evt:T.evt,target:X})})}_handleMouseMove(T){let S,A,N;const k=this.findOne("."+this._movingAnchorName),L=k.getStage();L.setPointersPositions(T);const B=L.getPointerPosition();let X={x:B.x-this._anchorDragOffset.x,y:B.y-this._anchorDragOffset.y};const K=k.getAbsolutePosition();this.anchorDragBoundFunc()&&(X=this.anchorDragBoundFunc()(K,X,T)),k.setAbsolutePosition(X);const Q=k.getAbsolutePosition();if(K.x===Q.x&&K.y===Q.y)return;if(this._movingAnchorName==="rotater"){const re=this._getNodeRect();S=k.x()-re.width/2,A=-k.y()+re.height/2;let ie=Math.atan2(-A,S)+Math.PI/2;re.height<0&&(ie-=Math.PI);const se=s.Konva.getAngle(this.rotation())+ie,de=s.Konva.getAngle(this.rotationSnapTolerance()),Oe=y(this.rotationSnaps(),se,de)-re.rotation,_e=v(re,Oe);this._fitNodesInto(_e,T);return}const H=this.shiftBehavior();let z;H==="inverted"?z=this.keepRatio()&&!T.shiftKey:H==="none"?z=this.keepRatio():z=this.keepRatio()||T.shiftKey;var G=this.centeredScaling()||T.altKey;if(this._movingAnchorName==="top-left"){if(z){var I=G?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};N=Math.sqrt(Math.pow(I.x-k.x(),2)+Math.pow(I.y-k.y(),2));var U=this.findOne(".top-left").x()>I.x?-1:1,$=this.findOne(".top-left").y()>I.y?-1:1;S=N*this.cos*U,A=N*this.sin*$,this.findOne(".top-left").x(I.x-S),this.findOne(".top-left").y(I.y-A)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(k.y());else if(this._movingAnchorName==="top-right"){if(z){var I=G?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};N=Math.sqrt(Math.pow(k.x()-I.x,2)+Math.pow(I.y-k.y(),2));var U=this.findOne(".top-right").x()<I.x?-1:1,$=this.findOne(".top-right").y()>I.y?-1:1;S=N*this.cos*U,A=N*this.sin*$,this.findOne(".top-right").x(I.x+S),this.findOne(".top-right").y(I.y-A)}var ee=k.position();this.findOne(".top-left").y(ee.y),this.findOne(".bottom-right").x(ee.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(k.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(k.x());else if(this._movingAnchorName==="bottom-left"){if(z){var I=G?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};N=Math.sqrt(Math.pow(I.x-k.x(),2)+Math.pow(k.y()-I.y,2));var U=I.x<k.x()?-1:1,$=k.y()<I.y?-1:1;S=N*this.cos*U,A=N*this.sin*$,k.x(I.x-S),k.y(I.y+A)}ee=k.position(),this.findOne(".top-left").x(ee.x),this.findOne(".bottom-right").y(ee.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(k.y());else if(this._movingAnchorName==="bottom-right"){if(z){var I=G?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};N=Math.sqrt(Math.pow(k.x()-I.x,2)+Math.pow(k.y()-I.y,2));var U=this.findOne(".bottom-right").x()<I.x?-1:1,$=this.findOne(".bottom-right").y()<I.y?-1:1;S=N*this.cos*U,A=N*this.sin*$,this.findOne(".bottom-right").x(I.x+S),this.findOne(".bottom-right").y(I.y+A)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var G=this.centeredScaling()||T.altKey;if(G){const re=this.findOne(".top-left"),ie=this.findOne(".bottom-right"),oe=re.x(),se=re.y(),de=this.getWidth()-ie.x(),pe=this.getHeight()-ie.y();ie.move({x:-oe,y:-se}),re.move({x:de,y:pe})}const Z=this.findOne(".top-left").getAbsolutePosition();S=Z.x,A=Z.y;const W=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),te=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:S,y:A,width:W,height:te,rotation:s.Konva.getAngle(this.rotation())},T)}_handleMouseUp(T){this._removeEvents(T)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(T){var S;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));const A=this.getNode();O--,this._fire("transformend",{evt:T,target:A}),(S=this.getLayer())===null||S===void 0||S.batchDraw(),A&&this._nodes.forEach(N=>{var k;N._fire("transformend",{evt:T,target:N}),(k=N.getLayer())===null||k===void 0||k.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(T,S){const A=this._getNodeRect(),N=1;if(e.Util._inRange(T.width,-this.padding()*2-N,N)){this.update();return}if(e.Util._inRange(T.height,-this.padding()*2-N,N)){this.update();return}const k=new e.Transform;if(k.rotate(s.Konva.getAngle(this.rotation())),this._movingAnchorName&&T.width<0&&this._movingAnchorName.indexOf("left")>=0){const z=k.point({x:-this.padding()*2,y:0});T.x+=z.x,T.y+=z.y,T.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y}else if(this._movingAnchorName&&T.width<0&&this._movingAnchorName.indexOf("right")>=0){const z=k.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y,T.width+=this.padding()*2}if(this._movingAnchorName&&T.height<0&&this._movingAnchorName.indexOf("top")>=0){const z=k.point({x:0,y:-this.padding()*2});T.x+=z.x,T.y+=z.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y,T.height+=this.padding()*2}else if(this._movingAnchorName&&T.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const z=k.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y,T.height+=this.padding()*2}if(this.boundBoxFunc()){const z=this.boundBoxFunc()(A,T);z?T=z:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const L=1e7,B=new e.Transform;B.translate(A.x,A.y),B.rotate(A.rotation),B.scale(A.width/L,A.height/L);const X=new e.Transform,K=T.width/L,Q=T.height/L;this.flipEnabled()===!1?(X.translate(T.x,T.y),X.rotate(T.rotation),X.translate(T.width<0?T.width:0,T.height<0?T.height:0),X.scale(Math.abs(K),Math.abs(Q))):(X.translate(T.x,T.y),X.rotate(T.rotation),X.scale(K,Q));const H=X.multiply(B.invert());this._nodes.forEach(z=>{var I;const U=z.getParent().getAbsoluteTransform(),$=z.getTransform().copy();$.translate(z.offsetX(),z.offsetY());const ee=new e.Transform;ee.multiply(U.copy().invert()).multiply(H).multiply(U).multiply($);const G=ee.decompose();z.setAttrs(G),(I=z.getLayer())===null||I===void 0||I.batchDraw()}),this.rotation(e.Util._getRotation(T.rotation)),this._nodes.forEach(z=>{this._fire("transform",{evt:S,target:z}),z._fire("transform",{evt:S,target:z})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(T,S){this.findOne(T).setAttrs(S)}update(){var T;const S=this._getNodeRect();this.rotation(e.Util._getRotation(S.rotation));const A=S.width,N=S.height,k=this.enabledAnchors(),L=this.resizeEnabled(),B=this.padding(),X=this.anchorSize(),K=this.find("._anchor");K.forEach(H=>{H.setAttrs({width:X,height:X,offsetX:X/2,offsetY:X/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:X/2+B,offsetY:X/2+B,visible:L&&k.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:A/2,y:0,offsetY:X/2+B,visible:L&&k.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:A,y:0,offsetX:X/2-B,offsetY:X/2+B,visible:L&&k.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:N/2,offsetX:X/2+B,visible:L&&k.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:A,y:N/2,offsetX:X/2-B,visible:L&&k.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:N,offsetX:X/2+B,offsetY:X/2-B,visible:L&&k.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:A/2,y:N,offsetY:X/2-B,visible:L&&k.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:A,y:N,offsetX:X/2-B,offsetY:X/2-B,visible:L&&k.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:A/2,y:-this.rotateAnchorOffset()*e.Util._sign(N)-B,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:A,height:N,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const Q=this.anchorStyleFunc();Q&&K.forEach(H=>{Q(H)}),(T=this.getLayer())===null||T===void 0||T.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const T=this.findOne("."+this._movingAnchorName);T&&T.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),l.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(T){return t.Node.prototype.clone.call(this,T)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}jf.Transformer=M,M.isTransforming=()=>O>0;function R(D){return D instanceof Array||e.Util.warn("enabledAnchors value should be an array"),D instanceof Array&&D.forEach(function(T){h.indexOf(T)===-1&&e.Util.warn("Unknown anchor name: "+T+". Available names are: "+h.join(", "))}),D||[]}return M.prototype.className="Transformer",(0,d._registerNode)(M),i.Factory.addGetterSetter(M,"enabledAnchors",h,R),i.Factory.addGetterSetter(M,"flipEnabled",!0,(0,c.getBooleanValidator)()),i.Factory.addGetterSetter(M,"resizeEnabled",!0),i.Factory.addGetterSetter(M,"anchorSize",10,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(M,"rotateEnabled",!0),i.Factory.addGetterSetter(M,"rotateLineVisible",!0),i.Factory.addGetterSetter(M,"rotationSnaps",[]),i.Factory.addGetterSetter(M,"rotateAnchorOffset",50,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(M,"rotateAnchorCursor","crosshair"),i.Factory.addGetterSetter(M,"rotationSnapTolerance",5,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(M,"borderEnabled",!0),i.Factory.addGetterSetter(M,"anchorStroke","rgb(0, 161, 255)"),i.Factory.addGetterSetter(M,"anchorStrokeWidth",1,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(M,"anchorFill","white"),i.Factory.addGetterSetter(M,"anchorCornerRadius",0,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(M,"borderStroke","rgb(0, 161, 255)"),i.Factory.addGetterSetter(M,"borderStrokeWidth",1,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(M,"borderDash"),i.Factory.addGetterSetter(M,"keepRatio",!0),i.Factory.addGetterSetter(M,"shiftBehavior","default"),i.Factory.addGetterSetter(M,"centeredScaling",!1),i.Factory.addGetterSetter(M,"ignoreStroke",!1),i.Factory.addGetterSetter(M,"padding",0,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(M,"nodes"),i.Factory.addGetterSetter(M,"node"),i.Factory.addGetterSetter(M,"boundBoxFunc"),i.Factory.addGetterSetter(M,"anchorDragBoundFunc"),i.Factory.addGetterSetter(M,"anchorStyleFunc"),i.Factory.addGetterSetter(M,"shouldOverdrawWholeArea",!1),i.Factory.addGetterSetter(M,"useSingleNodeRotation",!0),i.Factory.backCompat(M,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),jf}var Ff={},Ey;function V8(){if(Ey)return Ff;Ey=1,Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.Wedge=void 0;const e=Ft(),i=wr(),t=Nt(),n=Bt(),o=Nt();class l extends i.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),c.lineTo(0,0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(c){this.radius(c/2)}setHeight(c){this.radius(c/2)}}return Ff.Wedge=l,l.prototype.className="Wedge",l.prototype._centroid=!0,l.prototype._attrsAffectingSize=["radius"],(0,o._registerNode)(l),e.Factory.addGetterSetter(l,"radius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"clockwise",!1),e.Factory.backCompat(l,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),Ff}var zf={},Oy;function $8(){if(Oy)return zf;Oy=1,Object.defineProperty(zf,"__esModule",{value:!0}),zf.Blur=void 0;const e=Ft(),i=Hn(),t=Bt();function n(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const o=[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],l=[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 s(d,b){const w=d.data,E=d.width,x=d.height;let m,_,p,h,P,g,v,y,O,M,R,D,T,S,A,N,k,L,B,X,K,Q,H,z;const I=b+b+1,U=E-1,$=x-1,ee=b+1,G=ee*(ee+1)/2,Z=new n,W=o[b],te=l[b];let re=null,ie=Z,oe=null,se=null;for(p=1;p<I;p++)ie=ie.next=new n,p===ee&&(re=ie);for(ie.next=Z,v=g=0,_=0;_<x;_++){for(N=k=L=B=y=O=M=R=0,D=ee*(X=w[g]),T=ee*(K=w[g+1]),S=ee*(Q=w[g+2]),A=ee*(H=w[g+3]),y+=G*X,O+=G*K,M+=G*Q,R+=G*H,ie=Z,p=0;p<ee;p++)ie.r=X,ie.g=K,ie.b=Q,ie.a=H,ie=ie.next;for(p=1;p<ee;p++)h=g+((U<p?U:p)<<2),y+=(ie.r=X=w[h])*(z=ee-p),O+=(ie.g=K=w[h+1])*z,M+=(ie.b=Q=w[h+2])*z,R+=(ie.a=H=w[h+3])*z,N+=X,k+=K,L+=Q,B+=H,ie=ie.next;for(oe=Z,se=re,m=0;m<E;m++)w[g+3]=H=R*W>>te,H!==0?(H=255/H,w[g]=(y*W>>te)*H,w[g+1]=(O*W>>te)*H,w[g+2]=(M*W>>te)*H):w[g]=w[g+1]=w[g+2]=0,y-=D,O-=T,M-=S,R-=A,D-=oe.r,T-=oe.g,S-=oe.b,A-=oe.a,h=v+((h=m+b+1)<U?h:U)<<2,N+=oe.r=w[h],k+=oe.g=w[h+1],L+=oe.b=w[h+2],B+=oe.a=w[h+3],y+=N,O+=k,M+=L,R+=B,oe=oe.next,D+=X=se.r,T+=K=se.g,S+=Q=se.b,A+=H=se.a,N-=X,k-=K,L-=Q,B-=H,se=se.next,g+=4;v+=E}for(m=0;m<E;m++){for(k=L=B=N=O=M=R=y=0,g=m<<2,D=ee*(X=w[g]),T=ee*(K=w[g+1]),S=ee*(Q=w[g+2]),A=ee*(H=w[g+3]),y+=G*X,O+=G*K,M+=G*Q,R+=G*H,ie=Z,p=0;p<ee;p++)ie.r=X,ie.g=K,ie.b=Q,ie.a=H,ie=ie.next;for(P=E,p=1;p<=b;p++)g=P+m<<2,y+=(ie.r=X=w[g])*(z=ee-p),O+=(ie.g=K=w[g+1])*z,M+=(ie.b=Q=w[g+2])*z,R+=(ie.a=H=w[g+3])*z,N+=X,k+=K,L+=Q,B+=H,ie=ie.next,p<$&&(P+=E);for(g=m,oe=Z,se=re,_=0;_<x;_++)h=g<<2,w[h+3]=H=R*W>>te,H>0?(H=255/H,w[h]=(y*W>>te)*H,w[h+1]=(O*W>>te)*H,w[h+2]=(M*W>>te)*H):w[h]=w[h+1]=w[h+2]=0,y-=D,O-=T,M-=S,R-=A,D-=oe.r,T-=oe.g,S-=oe.b,A-=oe.a,h=m+((h=_+ee)<$?h:$)*E<<2,y+=N+=oe.r=w[h],O+=k+=oe.g=w[h+1],M+=L+=oe.b=w[h+2],R+=B+=oe.a=w[h+3],oe=oe.next,D+=X=se.r,T+=K=se.g,S+=Q=se.b,A+=H=se.a,N-=X,k-=K,L-=Q,B-=H,se=se.next,g+=E}}const c=function(b){const w=Math.round(this.blurRadius());w>0&&s(b,w)};return zf.Blur=c,e.Factory.addGetterSetter(i.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),zf}var Bf={},xy;function W8(){if(xy)return Bf;xy=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.Brighten=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=this.brightness()*255,s=o.data,c=s.length;for(let d=0;d<c;d+=4)s[d]+=l,s[d+1]+=l,s[d+2]+=l};return Bf.Brighten=n,e.Factory.addGetterSetter(i.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Bf}var Uf={},Py;function Y8(){if(Py)return Uf;Py=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.Contrast=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=Math.pow((this.contrast()+100)/100,2),s=o.data,c=s.length;let d=150,b=150,w=150;for(let E=0;E<c;E+=4)d=s[E],b=s[E+1],w=s[E+2],d/=255,d-=.5,d*=l,d+=.5,d*=255,b/=255,b-=.5,b*=l,b+=.5,b*=255,w/=255,w-=.5,w*=l,w+=.5,w*=255,d=d<0?0:d>255?255:d,b=b<0?0:b>255?255:b,w=w<0?0:w>255?255:w,s[E]=d,s[E+1]=b,s[E+2]=w};return Uf.Contrast=n,e.Factory.addGetterSetter(i.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Uf}var qf={},Cy;function K8(){if(Cy)return qf;Cy=1,Object.defineProperty(qf,"__esModule",{value:!0}),qf.Emboss=void 0;const e=Ft(),i=Hn(),t=In(),n=Bt(),o=function(l){const s=this.embossStrength()*10,c=this.embossWhiteLevel()*255,d=this.embossDirection(),b=this.embossBlend(),w=l.data,E=l.width,x=l.height,m=E*4;let _=0,p=0,h=x;switch(d){case"top-left":_=-1,p=-1;break;case"top":_=-1,p=0;break;case"top-right":_=-1,p=1;break;case"right":_=0,p=1;break;case"bottom-right":_=1,p=1;break;case"bottom":_=1,p=0;break;case"bottom-left":_=1,p=-1;break;case"left":_=0,p=-1;break;default:t.Util.error("Unknown emboss direction: "+d)}do{const P=(h-1)*m;let g=_;h+g<1&&(g=0),h+g>x&&(g=0);const v=(h-1+g)*E*4;let y=E;do{const O=P+(y-1)*4;let M=p;y+M<1&&(M=0),y+M>E&&(M=0);const R=v+(y-1+M)*4,D=w[O]-w[R],T=w[O+1]-w[R+1],S=w[O+2]-w[R+2];let A=D;const N=A>0?A:-A,k=T>0?T:-T,L=S>0?S:-S;if(k>N&&(A=T),L>N&&(A=S),A*=s,b){const B=w[O]+A,X=w[O+1]+A,K=w[O+2]+A;w[O]=B>255?255:B<0?0:B,w[O+1]=X>255?255:X<0?0:X,w[O+2]=K>255?255:K<0?0:K}else{let B=c-A;B<0?B=0:B>255&&(B=255),w[O]=w[O+1]=w[O+2]=B}}while(--y)}while(--h)};return qf.Emboss=o,e.Factory.addGetterSetter(i.Node,"embossStrength",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"embossWhiteLevel",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),qf}var Hf={},ky;function X8(){if(ky)return Hf;ky=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.Enhance=void 0;const e=Ft(),i=Hn(),t=Bt();function n(l,s,c,d,b){const w=c-s,E=b-d;if(w===0)return d+E/2;if(E===0)return d;let x=(l-s)/w;return x=E*x+d,x}const o=function(l){const s=l.data,c=s.length;let d=s[0],b=d,w,E=s[1],x=E,m,_=s[2],p=_,h;const P=this.enhance();if(P===0)return;for(let A=0;A<c;A+=4)w=s[A+0],w<d?d=w:w>b&&(b=w),m=s[A+1],m<E?E=m:m>x&&(x=m),h=s[A+2],h<_?_=h:h>p&&(p=h);b===d&&(b=255,d=0),x===E&&(x=255,E=0),p===_&&(p=255,_=0);let g,v,y,O,M,R,D,T,S;P>0?(v=b+P*(255-b),y=d-P*(d-0),M=x+P*(255-x),R=E-P*(E-0),T=p+P*(255-p),S=_-P*(_-0)):(g=(b+d)*.5,v=b+P*(b-g),y=d+P*(d-g),O=(x+E)*.5,M=x+P*(x-O),R=E+P*(E-O),D=(p+_)*.5,T=p+P*(p-D),S=_+P*(_-D));for(let A=0;A<c;A+=4)s[A+0]=n(s[A+0],d,b,y,v),s[A+1]=n(s[A+1],E,x,R,M),s[A+2]=n(s[A+2],_,p,S,T)};return Hf.Enhance=o,e.Factory.addGetterSetter(i.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Hf}var Gf={},Ay;function Z8(){if(Ay)return Gf;Ay=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.Grayscale=void 0;const e=function(i){const t=i.data,n=t.length;for(let o=0;o<n;o+=4){const l=.34*t[o]+.5*t[o+1]+.16*t[o+2];t[o]=l,t[o+1]=l,t[o+2]=l}};return Gf.Grayscale=e,Gf}var Vf={},Ty;function Q8(){if(Ty)return Vf;Ty=1,Object.defineProperty(Vf,"__esModule",{value:!0}),Vf.HSL=void 0;const e=Ft(),i=Hn(),t=Bt();e.Factory.addGetterSetter(i.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const n=function(o){const l=o.data,s=l.length,c=1,d=Math.pow(2,this.saturation()),b=Math.abs(this.hue()+360)%360,w=this.luminance()*127,E=c*d*Math.cos(b*Math.PI/180),x=c*d*Math.sin(b*Math.PI/180),m=.299*c+.701*E+.167*x,_=.587*c-.587*E+.33*x,p=.114*c-.114*E-.497*x,h=.299*c-.299*E-.328*x,P=.587*c+.413*E+.035*x,g=.114*c-.114*E+.293*x,v=.299*c-.3*E+1.25*x,y=.587*c-.586*E-1.05*x,O=.114*c+.886*E-.2*x;let M,R,D,T;for(let S=0;S<s;S+=4)M=l[S+0],R=l[S+1],D=l[S+2],T=l[S+3],l[S+0]=m*M+_*R+p*D+w,l[S+1]=h*M+P*R+g*D+w,l[S+2]=v*M+y*R+O*D+w,l[S+3]=T};return Vf.HSL=n,Vf}var $f={},Ry;function J8(){if(Ry)return $f;Ry=1,Object.defineProperty($f,"__esModule",{value:!0}),$f.HSV=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=o.data,s=l.length,c=Math.pow(2,this.value()),d=Math.pow(2,this.saturation()),b=Math.abs(this.hue()+360)%360,w=c*d*Math.cos(b*Math.PI/180),E=c*d*Math.sin(b*Math.PI/180),x=.299*c+.701*w+.167*E,m=.587*c-.587*w+.33*E,_=.114*c-.114*w-.497*E,p=.299*c-.299*w-.328*E,h=.587*c+.413*w+.035*E,P=.114*c-.114*w+.293*E,g=.299*c-.3*w+1.25*E,v=.587*c-.586*w-1.05*E,y=.114*c+.886*w-.2*E;let O,M,R,D;for(let T=0;T<s;T+=4)O=l[T+0],M=l[T+1],R=l[T+2],D=l[T+3],l[T+0]=x*O+m*M+_*R,l[T+1]=p*O+h*M+P*R,l[T+2]=g*O+v*M+y*R,l[T+3]=D};return $f.HSV=n,e.Factory.addGetterSetter(i.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),$f}var Wf={},My;function e9(){if(My)return Wf;My=1,Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.Invert=void 0;const e=function(i){const t=i.data,n=t.length;for(let o=0;o<n;o+=4)t[o]=255-t[o],t[o+1]=255-t[o+1],t[o+2]=255-t[o+2]};return Wf.Invert=e,Wf}var Yf={},Ly;function t9(){if(Ly)return Yf;Ly=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.Kaleidoscope=void 0;const e=Ft(),i=Hn(),t=In(),n=Bt(),o=function(c,d,b){const w=c.data,E=d.data,x=c.width,m=c.height,_=b.polarCenterX||x/2,p=b.polarCenterY||m/2;let h=Math.sqrt(_*_+p*p),P=x-_,g=m-p;const v=Math.sqrt(P*P+g*g);h=v>h?v:h;const y=m,O=x,M=360/O*Math.PI/180;for(let R=0;R<O;R+=1){const D=Math.sin(R*M),T=Math.cos(R*M);for(let S=0;S<y;S+=1){P=Math.floor(_+h*S/y*T),g=Math.floor(p+h*S/y*D);let A=(g*x+P)*4;const N=w[A+0],k=w[A+1],L=w[A+2],B=w[A+3];A=(R+S*x)*4,E[A+0]=N,E[A+1]=k,E[A+2]=L,E[A+3]=B}}},l=function(c,d,b){const w=c.data,E=d.data,x=c.width,m=c.height,_=b.polarCenterX||x/2,p=b.polarCenterY||m/2;let h=Math.sqrt(_*_+p*p),P=x-_,g=m-p;const v=Math.sqrt(P*P+g*g);h=v>h?v:h;const y=m,O=x,M=0;let R,D;for(P=0;P<x;P+=1)for(g=0;g<m;g+=1){const T=P-_,S=g-p,A=Math.sqrt(T*T+S*S)*y/h;let N=(Math.atan2(S,T)*180/Math.PI+360+M)%360;N=N*O/360,R=Math.floor(N),D=Math.floor(A);let k=(D*x+R)*4;const L=w[k+0],B=w[k+1],X=w[k+2],K=w[k+3];k=(g*x+P)*4,E[k+0]=L,E[k+1]=B,E[k+2]=X,E[k+3]=K}},s=function(c){const d=c.width,b=c.height;let w,E,x,m,_,p,h,P,g,v,y=Math.round(this.kaleidoscopePower());const O=Math.round(this.kaleidoscopeAngle()),M=Math.floor(d*(O%360)/360);if(y<1)return;const R=t.Util.createCanvasElement();R.width=d,R.height=b;const D=R.getContext("2d").getImageData(0,0,d,b);t.Util.releaseCanvas(R),o(c,D,{polarCenterX:d/2,polarCenterY:b/2});let T=d/Math.pow(2,y);for(;T<=8;)T=T*2,y-=1;T=Math.ceil(T);let S=T,A=0,N=S,k=1;for(M+T>d&&(A=S,N=0,k=-1),E=0;E<b;E+=1)for(w=A;w!==N;w+=k)x=Math.round(w+M)%d,g=(d*E+x)*4,_=D.data[g+0],p=D.data[g+1],h=D.data[g+2],P=D.data[g+3],v=(d*E+w)*4,D.data[v+0]=_,D.data[v+1]=p,D.data[v+2]=h,D.data[v+3]=P;for(E=0;E<b;E+=1)for(S=Math.floor(T),m=0;m<y;m+=1){for(w=0;w<S+1;w+=1)g=(d*E+w)*4,_=D.data[g+0],p=D.data[g+1],h=D.data[g+2],P=D.data[g+3],v=(d*E+S*2-w-1)*4,D.data[v+0]=_,D.data[v+1]=p,D.data[v+2]=h,D.data[v+3]=P;S*=2}l(D,c,{})};return Yf.Kaleidoscope=s,e.Factory.addGetterSetter(i.Node,"kaleidoscopePower",2,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"kaleidoscopeAngle",0,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Yf}var Kf={},Ny;function n9(){if(Ny)return Kf;Ny=1,Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.Mask=void 0;const e=Ft(),i=Hn(),t=Bt();function n(x,m,_){let p=(_*x.width+m)*4;const h=[];return h.push(x.data[p++],x.data[p++],x.data[p++],x.data[p++]),h}function o(x,m){return Math.sqrt(Math.pow(x[0]-m[0],2)+Math.pow(x[1]-m[1],2)+Math.pow(x[2]-m[2],2))}function l(x){const m=[0,0,0];for(let _=0;_<x.length;_++)m[0]+=x[_][0],m[1]+=x[_][1],m[2]+=x[_][2];return m[0]/=x.length,m[1]/=x.length,m[2]/=x.length,m}function s(x,m){const _=n(x,0,0),p=n(x,x.width-1,0),h=n(x,0,x.height-1),P=n(x,x.width-1,x.height-1),g=m||10;if(o(_,p)<g&&o(p,P)<g&&o(P,h)<g&&o(h,_)<g){const v=l([p,_,P,h]),y=[];for(let O=0;O<x.width*x.height;O++){const M=o(v,[x.data[O*4],x.data[O*4+1],x.data[O*4+2]]);y[O]=M<g?0:255}return y}}function c(x,m){for(let _=0;_<x.width*x.height;_++)x.data[4*_+3]=m[_]}function d(x,m,_){const p=[1,1,1,1,0,1,1,1,1],h=Math.round(Math.sqrt(p.length)),P=Math.floor(h/2),g=[];for(let v=0;v<_;v++)for(let y=0;y<m;y++){const O=v*m+y;let M=0;for(let R=0;R<h;R++)for(let D=0;D<h;D++){const T=v+R-P,S=y+D-P;if(T>=0&&T<_&&S>=0&&S<m){const A=T*m+S,N=p[R*h+D];M+=x[A]*N}}g[O]=M===255*8?255:0}return g}function b(x,m,_){const p=[1,1,1,1,1,1,1,1,1],h=Math.round(Math.sqrt(p.length)),P=Math.floor(h/2),g=[];for(let v=0;v<_;v++)for(let y=0;y<m;y++){const O=v*m+y;let M=0;for(let R=0;R<h;R++)for(let D=0;D<h;D++){const T=v+R-P,S=y+D-P;if(T>=0&&T<_&&S>=0&&S<m){const A=T*m+S,N=p[R*h+D];M+=x[A]*N}}g[O]=M>=255*4?255:0}return g}function w(x,m,_){const p=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],h=Math.round(Math.sqrt(p.length)),P=Math.floor(h/2),g=[];for(let v=0;v<_;v++)for(let y=0;y<m;y++){const O=v*m+y;let M=0;for(let R=0;R<h;R++)for(let D=0;D<h;D++){const T=v+R-P,S=y+D-P;if(T>=0&&T<_&&S>=0&&S<m){const A=T*m+S,N=p[R*h+D];M+=x[A]*N}}g[O]=M}return g}const E=function(x){const m=this.threshold();let _=s(x,m);return _&&(_=d(_,x.width,x.height),_=b(_,x.width,x.height),_=w(_,x.width,x.height),c(x,_)),x};return Kf.Mask=E,e.Factory.addGetterSetter(i.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Kf}var Xf={},Iy;function r9(){if(Iy)return Xf;Iy=1,Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.Noise=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=this.noise()*255,s=o.data,c=s.length,d=l/2;for(let b=0;b<c;b+=4)s[b+0]+=d-2*d*Math.random(),s[b+1]+=d-2*d*Math.random(),s[b+2]+=d-2*d*Math.random()};return Xf.Noise=n,e.Factory.addGetterSetter(i.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Xf}var Zf={},Dy;function i9(){if(Dy)return Zf;Dy=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.Pixelate=void 0;const e=Ft(),i=In(),t=Hn(),n=Bt(),o=function(l){let s=Math.ceil(this.pixelSize()),c=l.width,d=l.height,b,w,E,x,m,_,p,h=Math.ceil(c/s),P=Math.ceil(d/s),g,v,y,O,M,R,D,T=l.data;if(s<=0){i.Util.error("pixelSize value can not be <= 0");return}for(M=0;M<h;M+=1)for(R=0;R<P;R+=1){for(x=0,m=0,_=0,p=0,g=M*s,v=g+s,y=R*s,O=y+s,D=0,b=g;b<v;b+=1)if(!(b>=c))for(w=y;w<O;w+=1)w>=d||(E=(c*w+b)*4,x+=T[E+0],m+=T[E+1],_+=T[E+2],p+=T[E+3],D+=1);for(x=x/D,m=m/D,_=_/D,p=p/D,b=g;b<v;b+=1)if(!(b>=c))for(w=y;w<O;w+=1)w>=d||(E=(c*w+b)*4,T[E+0]=x,T[E+1]=m,T[E+2]=_,T[E+3]=p)}};return Zf.Pixelate=o,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Zf}var Qf={},jy;function a9(){if(jy)return Qf;jy=1,Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.Posterize=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=Math.round(this.levels()*254)+1,s=o.data,c=s.length,d=255/l;for(let b=0;b<c;b+=1)s[b]=Math.floor(s[b]/d)*d};return Qf.Posterize=n,e.Factory.addGetterSetter(i.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Qf}var Jf={},Fy;function o9(){if(Fy)return Jf;Fy=1,Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.RGB=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=o.data,s=l.length,c=this.red(),d=this.green(),b=this.blue();for(let w=0;w<s;w+=4){const E=(.34*l[w]+.5*l[w+1]+.16*l[w+2])/255;l[w]=E*c,l[w+1]=E*d,l[w+2]=E*b,l[w+3]=l[w+3]}};return Jf.RGB=n,e.Factory.addGetterSetter(i.Node,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)}),e.Factory.addGetterSetter(i.Node,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)}),e.Factory.addGetterSetter(i.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),Jf}var ed={},zy;function l9(){if(zy)return ed;zy=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.RGBA=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=o.data,s=l.length,c=this.red(),d=this.green(),b=this.blue(),w=this.alpha();for(let E=0;E<s;E+=4){const x=1-w;l[E]=c*w+l[E]*x,l[E+1]=d*w+l[E+1]*x,l[E+2]=b*w+l[E+2]*x}};return ed.RGBA=n,e.Factory.addGetterSetter(i.Node,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)}),e.Factory.addGetterSetter(i.Node,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)}),e.Factory.addGetterSetter(i.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"alpha",1,function(o){return this._filterUpToDate=!1,o>1?1:o<0?0:o}),ed}var td={},By;function s9(){if(By)return td;By=1,Object.defineProperty(td,"__esModule",{value:!0}),td.Sepia=void 0;const e=function(i){const t=i.data,n=t.length;for(let o=0;o<n;o+=4){const l=t[o+0],s=t[o+1],c=t[o+2];t[o+0]=Math.min(255,l*.393+s*.769+c*.189),t[o+1]=Math.min(255,l*.349+s*.686+c*.168),t[o+2]=Math.min(255,l*.272+s*.534+c*.131)}};return td.Sepia=e,td}var nd={},Uy;function u9(){if(Uy)return nd;Uy=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Solarize=void 0;const e=function(i){const t=i.data,n=i.width,o=i.height,l=n*4;let s=o;do{const c=(s-1)*l;let d=n;do{const b=c+(d-1)*4;let w=t[b],E=t[b+1],x=t[b+2];w>127&&(w=255-w),E>127&&(E=255-E),x>127&&(x=255-x),t[b]=w,t[b+1]=E,t[b+2]=x}while(--d)}while(--s)};return nd.Solarize=e,nd}var rd={},qy;function c9(){if(qy)return rd;qy=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Threshold=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(o){const l=this.threshold()*255,s=o.data,c=s.length;for(let d=0;d<c;d+=1)s[d]=s[d]<l?0:255};return rd.Threshold=n,e.Factory.addGetterSetter(i.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),rd}var Hy;function f9(){if(Hy)return vf;Hy=1,Object.defineProperty(vf,"__esModule",{value:!0}),vf.Konva=void 0;const e=q0(),i=M8(),t=N8(),n=I8(),o=D8(),l=j8(),s=F8(),c=H_(),d=vm(),b=G_(),w=z8(),E=B8(),x=U8(),m=q8(),_=V_(),p=H8(),h=G8(),P=V8(),g=$8(),v=W8(),y=Y8(),O=K8(),M=X8(),R=Z8(),D=Q8(),T=J8(),S=e9(),A=t9(),N=n9(),k=r9(),L=i9(),B=a9(),X=o9(),K=l9(),Q=s9(),H=u9(),z=c9();return vf.Konva=e.Konva.Util._assign(e.Konva,{Arc:i.Arc,Arrow:t.Arrow,Circle:n.Circle,Ellipse:o.Ellipse,Image:l.Image,Label:s.Label,Tag:s.Tag,Line:c.Line,Path:d.Path,Rect:b.Rect,RegularPolygon:w.RegularPolygon,Ring:E.Ring,Sprite:x.Sprite,Star:m.Star,Text:_.Text,TextPath:p.TextPath,Transformer:h.Transformer,Wedge:P.Wedge,Filters:{Blur:g.Blur,Brighten:v.Brighten,Contrast:y.Contrast,Emboss:O.Emboss,Enhance:M.Enhance,Grayscale:R.Grayscale,HSL:D.HSL,HSV:T.HSV,Invert:S.Invert,Kaleidoscope:A.Kaleidoscope,Mask:N.Mask,Noise:k.Noise,Pixelate:L.Pixelate,Posterize:B.Posterize,RGB:X.RGB,RGBA:K.RGBA,Sepia:Q.Sepia,Solarize:H.Solarize,Threshold:z.Threshold}}),vf}var d9=rp.exports,Gy;function Ji(){if(Gy)return rp.exports;Gy=1,Object.defineProperty(d9,"__esModule",{value:!0});const e=f9();return rp.exports=e.Konva,rp.exports}Ji();var Zh={exports:{}},Vy;function h9(){return Vy||(Vy=1,function(e,i){Object.defineProperty(i,"__esModule",{value:!0}),i.Konva=void 0;var t=q0();Object.defineProperty(i,"Konva",{enumerable:!0,get:function(){return t.Konva}});const n=q0();e.exports=n.Konva}(Zh,Zh.exports)),Zh.exports}var p9=h9();const Pd=Rd(p9);var Gg={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 Vg,$y;function g9(){return $y||($y=1,Vg=function(i){var t={},n=Tn(),o=$0(),l=Object.assign;function s(u){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+u,j=1;j<arguments.length;j++)f+="&args[]="+encodeURIComponent(arguments[j]);return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,d=Symbol.for("react.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),_=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),O=Symbol.iterator;function M(u){return u===null||typeof u!="object"?null:(u=O&&u[O]||u["@@iterator"],typeof u=="function"?u:null)}function R(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case w:return"Fragment";case b:return"Portal";case x:return"Profiler";case E:return"StrictMode";case h:return"Suspense";case P:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case _:return(u.displayName||"Context")+".Consumer";case m:return(u._context.displayName||"Context")+".Provider";case p:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case g:return f=u.displayName||null,f!==null?f:R(u.type)||"Memo";case v:f=u._payload,u=u._init;try{return R(u(f))}catch{}}return null}function D(u){var f=u.type;switch(u.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=f.render,u=u.displayName||u.name||"",f.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(f);case 8:return f===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function T(u){var f=u,j=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,f.flags&4098&&(j=f.return),u=f.return;while(u)}return f.tag===3?j:null}function S(u){if(T(u)!==u)throw Error(s(188))}function A(u){var f=u.alternate;if(!f){if(f=T(u),f===null)throw Error(s(188));return f!==u?null:u}for(var j=u,q=f;;){var Y=j.return;if(Y===null)break;var ne=Y.alternate;if(ne===null){if(q=Y.return,q!==null){j=q;continue}break}if(Y.child===ne.child){for(ne=Y.child;ne;){if(ne===j)return S(Y),u;if(ne===q)return S(Y),f;ne=ne.sibling}throw Error(s(188))}if(j.return!==q.return)j=Y,q=ne;else{for(var le=!1,ye=Y.child;ye;){if(ye===j){le=!0,j=Y,q=ne;break}if(ye===q){le=!0,q=Y,j=ne;break}ye=ye.sibling}if(!le){for(ye=ne.child;ye;){if(ye===j){le=!0,j=ne,q=Y;break}if(ye===q){le=!0,q=ne,j=Y;break}ye=ye.sibling}if(!le)throw Error(s(189))}}if(j.alternate!==q)throw Error(s(190))}if(j.tag!==3)throw Error(s(188));return j.stateNode.current===j?u:f}function N(u){return u=A(u),u!==null?k(u):null}function k(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var f=k(u);if(f!==null)return f;u=u.sibling}return null}function L(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){if(u.tag!==4){var f=L(u);if(f!==null)return f}u=u.sibling}return null}var B=Array.isArray,X=i.getPublicInstance,K=i.getRootHostContext,Q=i.getChildHostContext,H=i.prepareForCommit,z=i.resetAfterCommit,I=i.createInstance,U=i.appendInitialChild,$=i.finalizeInitialChildren,ee=i.prepareUpdate,G=i.shouldSetTextContent,Z=i.createTextInstance,W=i.scheduleTimeout,te=i.cancelTimeout,re=i.noTimeout,ie=i.isPrimaryRenderer,oe=i.supportsMutation,se=i.supportsPersistence,de=i.supportsHydration,pe=i.getInstanceFromNode,Oe=i.preparePortalMount,_e=i.getCurrentEventPriority,Te=i.detachDeletedInstance,ce=i.supportsMicrotasks,he=i.scheduleMicrotask,Ce=i.supportsTestSelectors,Le=i.findFiberRoot,ue=i.getBoundingRect,me=i.getTextContent,xe=i.isHiddenSubtree,je=i.matchAccessibilityRole,ot=i.setFocusIfFocusable,ht=i.setupIntersectionObserver,et=i.appendChild,Ke=i.appendChildToContainer,ze=i.commitTextUpdate,Be=i.commitMount,Ve=i.commitUpdate,bt=i.insertBefore,Ct=i.insertInContainerBefore,we=i.removeChild,Se=i.removeChildFromContainer,gt=i.resetTextContent,wt=i.hideInstance,Pt=i.hideTextInstance,mt=i.unhideInstance,Wt=i.unhideTextInstance,pn=i.clearContainer,Fe=i.cloneInstance,rt=i.createContainerChildSet,ft=i.appendChildToContainerChildSet,De=i.finalizeContainerChildren,Ie=i.replaceContainerChildren,Me=i.cloneHiddenInstance,Ye=i.cloneHiddenTextInstance,Mt=i.canHydrateInstance,_t=i.canHydrateTextInstance,Yt=i.canHydrateSuspenseInstance,wn=i.isSuspenseInstancePending,Sn=i.isSuspenseInstanceFallback,Qn=i.getSuspenseInstanceFallbackErrorDetails,ii=i.registerSuspenseInstanceRetry,Sr=i.getNextHydratableSibling,Ze=i.getFirstHydratableChild,Et=i.getFirstHydratableChildWithinContainer,Lt=i.getFirstHydratableChildWithinSuspenseInstance,Gt=i.hydrateInstance,Vt=i.hydrateTextInstance,Jn=i.hydrateSuspenseInstance,Gn=i.getNextHydratableInstanceAfterSuspenseInstance,En=i.commitHydratedContainer,ai=i.commitHydratedSuspenseInstance,Ir=i.clearSuspenseBoundary,Ii=i.clearSuspenseBoundaryFromContainer,Na=i.shouldDeleteUnhydratedTailInstances,rs=i.didNotMatchHydratedContainerTextInstance,en=i.didNotMatchHydratedTextInstance,ta;function Dr(u){if(ta===void 0)try{throw Error()}catch(j){var f=j.stack.trim().match(/\n( *(at )?)/);ta=f&&f[1]||""}return`
52
+ `+ta+u}var ho=!1;function na(u,f){if(!u||ho)return"";ho=!0;var j=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ge){var q=Ge}Reflect.construct(u,[],f)}else{try{f.call()}catch(Ge){q=Ge}u.call(f.prototype)}else{try{throw Error()}catch(Ge){q=Ge}u()}}catch(Ge){if(Ge&&q&&typeof Ge.stack=="string"){for(var Y=Ge.stack.split(`
53
+ `),ne=q.stack.split(`
54
+ `),le=Y.length-1,ye=ne.length-1;1<=le&&0<=ye&&Y[le]!==ne[ye];)ye--;for(;1<=le&&0<=ye;le--,ye--)if(Y[le]!==ne[ye]){if(le!==1||ye!==1)do if(le--,ye--,0>ye||Y[le]!==ne[ye]){var Re=`
55
+ `+Y[le].replace(" at new "," at ");return u.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",u.displayName)),Re}while(1<=le&&0<=ye);break}}}finally{ho=!1,Error.prepareStackTrace=j}return(u=u?u.displayName||u.name:"")?Dr(u):""}var Vp=Object.prototype.hasOwnProperty,Qs=[],ra=-1;function er(u){return{current:u}}function cn(u){0>ra||(u.current=Qs[ra],Qs[ra]=null,ra--)}function It(u,f){ra++,Qs[ra]=u.current,u.current=f}var Ia={},fr=er(Ia),jr=er(!1),Di=Ia;function ia(u,f){var j=u.type.contextTypes;if(!j)return Ia;var q=u.stateNode;if(q&&q.__reactInternalMemoizedUnmaskedChildContext===f)return q.__reactInternalMemoizedMaskedChildContext;var Y={},ne;for(ne in j)Y[ne]=f[ne];return q&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=f,u.__reactInternalMemoizedMaskedChildContext=Y),Y}function Vn(u){return u=u.childContextTypes,u!=null}function po(){cn(jr),cn(fr)}function Gd(u,f,j){if(fr.current!==Ia)throw Error(s(168));It(fr,f),It(jr,j)}function Vd(u,f,j){var q=u.stateNode;if(f=f.childContextTypes,typeof q.getChildContext!="function")return j;q=q.getChildContext();for(var Y in q)if(!(Y in f))throw Error(s(108,D(u)||"Unknown",Y));return l({},j,q)}function tl(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||Ia,Di=fr.current,It(fr,u),It(jr,jr.current),!0}function Oc(u,f,j){var q=u.stateNode;if(!q)throw Error(s(169));j?(u=Vd(u,f,Di),q.__reactInternalMemoizedMergedChildContext=u,cn(jr),cn(fr),It(fr,u)):cn(jr),It(jr,j)}var Gr=Math.clz32?Math.clz32:xc,is=Math.log,$p=Math.LN2;function xc(u){return u>>>=0,u===0?32:31-(is(u)/$p|0)|0}var Ht=64,as=4194304;function nl(u){switch(u&-u){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 u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function rl(u,f){var j=u.pendingLanes;if(j===0)return 0;var q=0,Y=u.suspendedLanes,ne=u.pingedLanes,le=j&268435455;if(le!==0){var ye=le&~Y;ye!==0?q=nl(ye):(ne&=le,ne!==0&&(q=nl(ne)))}else le=j&~Y,le!==0?q=nl(le):ne!==0&&(q=nl(ne));if(q===0)return 0;if(f!==0&&f!==q&&!(f&Y)&&(Y=q&-q,ne=f&-f,Y>=ne||Y===16&&(ne&4194240)!==0))return f;if(q&4&&(q|=j&16),f=u.entangledLanes,f!==0)for(u=u.entanglements,f&=q;0<f;)j=31-Gr(f),Y=1<<j,q|=u[j],f&=~Y;return q}function $d(u,f){switch(u){case 1:case 2:case 4:return f+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 f+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 Wd(u,f){for(var j=u.suspendedLanes,q=u.pingedLanes,Y=u.expirationTimes,ne=u.pendingLanes;0<ne;){var le=31-Gr(ne),ye=1<<le,Re=Y[le];Re===-1?(!(ye&j)||ye&q)&&(Y[le]=$d(ye,f)):Re<=f&&(u.expiredLanes|=ye),ne&=~ye}}function Js(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function eu(){var u=Ht;return Ht<<=1,!(Ht&4194240)&&(Ht=64),u}function il(u){for(var f=[],j=0;31>j;j++)f.push(u);return f}function oi(u,f,j){u.pendingLanes|=f,f!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,f=31-Gr(f),u[f]=j}function Da(u,f){var j=u.pendingLanes&~f;u.pendingLanes=f,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=f,u.mutableReadLanes&=f,u.entangledLanes&=f,f=u.entanglements;var q=u.eventTimes;for(u=u.expirationTimes;0<j;){var Y=31-Gr(j),ne=1<<Y;f[Y]=0,q[Y]=-1,u[Y]=-1,j&=~ne}}function ji(u,f){var j=u.entangledLanes|=f;for(u=u.entanglements;j;){var q=31-Gr(j),Y=1<<q;Y&f|u[q]&f&&(u[q]|=f),j&=~Y}}var Dt=0;function al(u){return u&=-u,1<u?4<u?u&268435455?16:536870912:4:1}var Fi=o.unstable_scheduleCallback,Yd=o.unstable_cancelCallback,Kd=o.unstable_shouldYield,os=o.unstable_requestPaint,$n=o.unstable_now,tu=o.unstable_ImmediatePriority,nu=o.unstable_UserBlockingPriority,ru=o.unstable_NormalPriority,Wp=o.unstable_IdlePriority,ja=null,Fr=null;function ol(u){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(ja,u,void 0,(u.current.flags&128)===128)}catch{}}function iu(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var wi=typeof Object.is=="function"?Object.is:iu,aa=null,ll=!1,sl=!1;function au(u){aa===null?aa=[u]:aa.push(u)}function Xd(u){ll=!0,au(u)}function tr(){if(!sl&&aa!==null){sl=!0;var u=0,f=Dt;try{var j=aa;for(Dt=1;u<j.length;u++){var q=j[u];do q=q(!0);while(q!==null)}aa=null,ll=!1}catch(Y){throw aa!==null&&(aa=aa.slice(u+1)),Fi(tu,tr),Y}finally{Dt=f,sl=!1}}return null}var Fa=[],oa=0,ls=null,go=0,Er=[],Vr=0,Dn=null,zr=1,Si="";function Ei(u,f){Fa[oa++]=go,Fa[oa++]=ls,ls=u,go=f}function Zd(u,f,j){Er[Vr++]=zr,Er[Vr++]=Si,Er[Vr++]=Dn,Dn=u;var q=zr;u=Si;var Y=32-Gr(q)-1;q&=~(1<<Y),j+=1;var ne=32-Gr(f)+Y;if(30<ne){var le=Y-Y%5;ne=(q&(1<<le)-1).toString(32),q>>=le,Y-=le,zr=1<<32-Gr(f)+Y|j<<Y|q,Si=ne+u}else zr=1<<ne|j<<Y|q,Si=u}function ss(u){u.return!==null&&(Ei(u,1),Zd(u,1,0))}function us(u){for(;u===ls;)ls=Fa[--oa],Fa[oa]=null,go=Fa[--oa],Fa[oa]=null;for(;u===Dn;)Dn=Er[--Vr],Er[Vr]=null,Si=Er[--Vr],Er[Vr]=null,zr=Er[--Vr],Er[Vr]=null}var nr=null,Or=null,fn=!1,cs=!1,Oi=null;function Qd(u,f){var j=ti(5,null,null,0);j.elementType="DELETED",j.stateNode=f,j.return=u,f=u.deletions,f===null?(u.deletions=[j],u.flags|=16):f.push(j)}function ou(u,f){switch(u.tag){case 5:return f=Mt(f,u.type,u.pendingProps),f!==null?(u.stateNode=f,nr=u,Or=Ze(f),!0):!1;case 6:return f=_t(f,u.pendingProps),f!==null?(u.stateNode=f,nr=u,Or=null,!0):!1;case 13:if(f=Yt(f),f!==null){var j=Dn!==null?{id:zr,overflow:Si}:null;return u.memoizedState={dehydrated:f,treeContext:j,retryLane:1073741824},j=ti(18,null,null,0),j.stateNode=f,j.return=u,u.child=j,nr=u,Or=null,!0}return!1;default:return!1}}function Pc(u){return(u.mode&1)!==0&&(u.flags&128)===0}function Cc(u){if(fn){var f=Or;if(f){var j=f;if(!ou(u,f)){if(Pc(u))throw Error(s(418));f=Sr(j);var q=nr;f&&ou(u,f)?Qd(q,j):(u.flags=u.flags&-4097|2,fn=!1,nr=u)}}else{if(Pc(u))throw Error(s(418));u.flags=u.flags&-4097|2,fn=!1,nr=u}}}function Jd(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;nr=u}function lu(u){if(!de||u!==nr)return!1;if(!fn)return Jd(u),fn=!0,!1;if(u.tag!==3&&(u.tag!==5||Na(u.type)&&!G(u.type,u.memoizedProps))){var f=Or;if(f){if(Pc(u))throw eh(),Error(s(418));for(;f;)Qd(u,f),f=Sr(f)}}if(Jd(u),u.tag===13){if(!de)throw Error(s(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));Or=Gn(u)}else Or=nr?Sr(u.stateNode):null;return!0}function eh(){for(var u=Or;u;)u=Sr(u)}function mo(){de&&(Or=nr=null,cs=fn=!1)}function kc(u){Oi===null?Oi=[u]:Oi.push(u)}var Yp=c.ReactCurrentBatchConfig;function su(u,f){if(wi(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var j=Object.keys(u),q=Object.keys(f);if(j.length!==q.length)return!1;for(q=0;q<j.length;q++){var Y=j[q];if(!Vp.call(f,Y)||!wi(u[Y],f[Y]))return!1}return!0}function Kp(u){switch(u.tag){case 5:return Dr(u.type);case 16:return Dr("Lazy");case 13:return Dr("Suspense");case 19:return Dr("SuspenseList");case 0:case 2:case 15:return u=na(u.type,!1),u;case 11:return u=na(u.type.render,!1),u;case 1:return u=na(u.type,!0),u;default:return""}}function vo(u,f,j){if(u=j.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(j._owner){if(j=j._owner,j){if(j.tag!==1)throw Error(s(309));var q=j.stateNode}if(!q)throw Error(s(147,u));var Y=q,ne=""+u;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===ne?f.ref:(f=function(le){var ye=Y.refs;le===null?delete ye[ne]:ye[ne]=le},f._stringRef=ne,f)}if(typeof u!="string")throw Error(s(284));if(!j._owner)throw Error(s(290,u))}return u}function uu(u,f){throw u=Object.prototype.toString.call(f),Error(s(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u))}function th(u){var f=u._init;return f(u._payload)}function nh(u){function f(ke,be){if(u){var Ne=ke.deletions;Ne===null?(ke.deletions=[be],ke.flags|=16):Ne.push(be)}}function j(ke,be){if(!u)return null;for(;be!==null;)f(ke,be),be=be.sibling;return null}function q(ke,be){for(ke=new Map;be!==null;)be.key!==null?ke.set(be.key,be):ke.set(be.index,be),be=be.sibling;return ke}function Y(ke,be){return ke=no(ke,be),ke.index=0,ke.sibling=null,ke}function ne(ke,be,Ne){return ke.index=Ne,u?(Ne=ke.alternate,Ne!==null?(Ne=Ne.index,Ne<be?(ke.flags|=2,be):Ne):(ke.flags|=2,be)):(ke.flags|=1048576,be)}function le(ke){return u&&ke.alternate===null&&(ke.flags|=2),ke}function ye(ke,be,Ne,Je){return be===null||be.tag!==6?(be=Ll(Ne,ke.mode,Je),be.return=ke,be):(be=Y(be,Ne),be.return=ke,be)}function Re(ke,be,Ne,Je){var pt=Ne.type;return pt===w?it(ke,be,Ne.props.children,Je,Ne.key):be!==null&&(be.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===v&&th(pt)===be.type)?(Je=Y(be,Ne.props),Je.ref=vo(ke,be,Ne),Je.return=ke,Je):(Je=Uu(Ne.type,Ne.key,Ne.props,null,ke.mode,Je),Je.ref=vo(ke,be,Ne),Je.return=ke,Je)}function Ge(ke,be,Ne,Je){return be===null||be.tag!==4||be.stateNode.containerInfo!==Ne.containerInfo||be.stateNode.implementation!==Ne.implementation?(be=qu(Ne,ke.mode,Je),be.return=ke,be):(be=Y(be,Ne.children||[]),be.return=ke,be)}function it(ke,be,Ne,Je,pt){return be===null||be.tag!==7?(be=ar(Ne,ke.mode,Je,pt),be.return=ke,be):(be=Y(be,Ne),be.return=ke,be)}function Ot(ke,be,Ne){if(typeof be=="string"&&be!==""||typeof be=="number")return be=Ll(""+be,ke.mode,Ne),be.return=ke,be;if(typeof be=="object"&&be!==null){switch(be.$$typeof){case d:return Ne=Uu(be.type,be.key,be.props,null,ke.mode,Ne),Ne.ref=vo(ke,null,be),Ne.return=ke,Ne;case b:return be=qu(be,ke.mode,Ne),be.return=ke,be;case v:var Je=be._init;return Ot(ke,Je(be._payload),Ne)}if(B(be)||M(be))return be=ar(be,ke.mode,Ne,null),be.return=ke,be;uu(ke,be)}return null}function Qe(ke,be,Ne,Je){var pt=be!==null?be.key:null;if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number")return pt!==null?null:ye(ke,be,""+Ne,Je);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case d:return Ne.key===pt?Re(ke,be,Ne,Je):null;case b:return Ne.key===pt?Ge(ke,be,Ne,Je):null;case v:return pt=Ne._init,Qe(ke,be,pt(Ne._payload),Je)}if(B(Ne)||M(Ne))return pt!==null?null:it(ke,be,Ne,Je,null);uu(ke,Ne)}return null}function sn(ke,be,Ne,Je,pt){if(typeof Je=="string"&&Je!==""||typeof Je=="number")return ke=ke.get(Ne)||null,ye(be,ke,""+Je,pt);if(typeof Je=="object"&&Je!==null){switch(Je.$$typeof){case d:return ke=ke.get(Je.key===null?Ne:Je.key)||null,Re(be,ke,Je,pt);case b:return ke=ke.get(Je.key===null?Ne:Je.key)||null,Ge(be,ke,Je,pt);case v:var Rt=Je._init;return sn(ke,be,Ne,Rt(Je._payload),pt)}if(B(Je)||M(Je))return ke=ke.get(Ne)||null,it(be,ke,Je,pt,null);uu(be,Je)}return null}function Qt(ke,be,Ne,Je){for(var pt=null,Rt=null,xt=be,Ut=be=0,Un=null;xt!==null&&Ut<Ne.length;Ut++){xt.index>Ut?(Un=xt,xt=null):Un=xt.sibling;var zt=Qe(ke,xt,Ne[Ut],Je);if(zt===null){xt===null&&(xt=Un);break}u&&xt&&zt.alternate===null&&f(ke,xt),be=ne(zt,be,Ut),Rt===null?pt=zt:Rt.sibling=zt,Rt=zt,xt=Un}if(Ut===Ne.length)return j(ke,xt),fn&&Ei(ke,Ut),pt;if(xt===null){for(;Ut<Ne.length;Ut++)xt=Ot(ke,Ne[Ut],Je),xt!==null&&(be=ne(xt,be,Ut),Rt===null?pt=xt:Rt.sibling=xt,Rt=xt);return fn&&Ei(ke,Ut),pt}for(xt=q(ke,xt);Ut<Ne.length;Ut++)Un=sn(xt,ke,Ut,Ne[Ut],Je),Un!==null&&(u&&Un.alternate!==null&&xt.delete(Un.key===null?Ut:Un.key),be=ne(Un,be,Ut),Rt===null?pt=Un:Rt.sibling=Un,Rt=Un);return u&&xt.forEach(function(vr){return f(ke,vr)}),fn&&Ei(ke,Ut),pt}function Tr(ke,be,Ne,Je){var pt=M(Ne);if(typeof pt!="function")throw Error(s(150));if(Ne=pt.call(Ne),Ne==null)throw Error(s(151));for(var Rt=pt=null,xt=be,Ut=be=0,Un=null,zt=Ne.next();xt!==null&&!zt.done;Ut++,zt=Ne.next()){xt.index>Ut?(Un=xt,xt=null):Un=xt.sibling;var vr=Qe(ke,xt,zt.value,Je);if(vr===null){xt===null&&(xt=Un);break}u&&xt&&vr.alternate===null&&f(ke,xt),be=ne(vr,be,Ut),Rt===null?pt=vr:Rt.sibling=vr,Rt=vr,xt=Un}if(zt.done)return j(ke,xt),fn&&Ei(ke,Ut),pt;if(xt===null){for(;!zt.done;Ut++,zt=Ne.next())zt=Ot(ke,zt.value,Je),zt!==null&&(be=ne(zt,be,Ut),Rt===null?pt=zt:Rt.sibling=zt,Rt=zt);return fn&&Ei(ke,Ut),pt}for(xt=q(ke,xt);!zt.done;Ut++,zt=Ne.next())zt=sn(xt,ke,Ut,zt.value,Je),zt!==null&&(u&&zt.alternate!==null&&xt.delete(zt.key===null?Ut:zt.key),be=ne(zt,be,Ut),Rt===null?pt=zt:Rt.sibling=zt,Rt=zt);return u&&xt.forEach(function(eg){return f(ke,eg)}),fn&&Ei(ke,Ut),pt}function Wi(ke,be,Ne,Je){if(typeof Ne=="object"&&Ne!==null&&Ne.type===w&&Ne.key===null&&(Ne=Ne.props.children),typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case d:e:{for(var pt=Ne.key,Rt=be;Rt!==null;){if(Rt.key===pt){if(pt=Ne.type,pt===w){if(Rt.tag===7){j(ke,Rt.sibling),be=Y(Rt,Ne.props.children),be.return=ke,ke=be;break e}}else if(Rt.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===v&&th(pt)===Rt.type){j(ke,Rt.sibling),be=Y(Rt,Ne.props),be.ref=vo(ke,Rt,Ne),be.return=ke,ke=be;break e}j(ke,Rt);break}else f(ke,Rt);Rt=Rt.sibling}Ne.type===w?(be=ar(Ne.props.children,ke.mode,Je,Ne.key),be.return=ke,ke=be):(Je=Uu(Ne.type,Ne.key,Ne.props,null,ke.mode,Je),Je.ref=vo(ke,be,Ne),Je.return=ke,ke=Je)}return le(ke);case b:e:{for(Rt=Ne.key;be!==null;){if(be.key===Rt)if(be.tag===4&&be.stateNode.containerInfo===Ne.containerInfo&&be.stateNode.implementation===Ne.implementation){j(ke,be.sibling),be=Y(be,Ne.children||[]),be.return=ke,ke=be;break e}else{j(ke,be);break}else f(ke,be);be=be.sibling}be=qu(Ne,ke.mode,Je),be.return=ke,ke=be}return le(ke);case v:return Rt=Ne._init,Wi(ke,be,Rt(Ne._payload),Je)}if(B(Ne))return Qt(ke,be,Ne,Je);if(M(Ne))return Tr(ke,be,Ne,Je);uu(ke,Ne)}return typeof Ne=="string"&&Ne!==""||typeof Ne=="number"?(Ne=""+Ne,be!==null&&be.tag===6?(j(ke,be.sibling),be=Y(be,Ne),be.return=ke,ke=be):(j(ke,be),be=Ll(Ne,ke.mode,Je),be.return=ke,ke=be),le(ke)):j(ke,be)}return Wi}var yo=nh(!0),rh=nh(!1),cu=er(null),fu=null,ul=null,Ac=null;function Tc(){Ac=ul=fu=null}function ih(u,f,j){ie?(It(cu,f._currentValue),f._currentValue=j):(It(cu,f._currentValue2),f._currentValue2=j)}function fs(u){var f=cu.current;cn(cu),ie?u._currentValue=f:u._currentValue2=f}function bo(u,f,j){for(;u!==null;){var q=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,q!==null&&(q.childLanes|=f)):q!==null&&(q.childLanes&f)!==f&&(q.childLanes|=f),u===j)break;u=u.return}}function cl(u,f){fu=u,Ac=ul=null,u=u.dependencies,u!==null&&u.firstContext!==null&&(u.lanes&f&&(Fn=!0),u.firstContext=null)}function $r(u){var f=ie?u._currentValue:u._currentValue2;if(Ac!==u)if(u={context:u,memoizedValue:f,next:null},ul===null){if(fu===null)throw Error(s(308));ul=u,fu.dependencies={lanes:0,firstContext:u}}else ul=ul.next=u;return f}var za=null;function du(u){za===null?za=[u]:za.push(u)}function Rc(u,f,j,q){var Y=f.interleaved;return Y===null?(j.next=j,du(f)):(j.next=Y.next,Y.next=j),f.interleaved=j,xi(u,q)}function xi(u,f){u.lanes|=f;var j=u.alternate;for(j!==null&&(j.lanes|=f),j=u,u=u.return;u!==null;)u.childLanes|=f,j=u.alternate,j!==null&&(j.childLanes|=f),j=u,u=u.return;return j.tag===3?j.stateNode:null}var Wr=!1;function Mc(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ah(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function la(u,f){return{eventTime:u,lane:f,tag:0,payload:null,callback:null,next:null}}function sa(u,f,j){var q=u.updateQueue;if(q===null)return null;if(q=q.shared,kt&2){var Y=q.pending;return Y===null?f.next=f:(f.next=Y.next,Y.next=f),q.pending=f,xi(u,j)}return Y=q.interleaved,Y===null?(f.next=f,du(q)):(f.next=Y.next,Y.next=f),q.interleaved=f,xi(u,j)}function ds(u,f,j){if(f=f.updateQueue,f!==null&&(f=f.shared,(j&4194240)!==0)){var q=f.lanes;q&=u.pendingLanes,j|=q,f.lanes=j,ji(u,j)}}function fl(u,f){var j=u.updateQueue,q=u.alternate;if(q!==null&&(q=q.updateQueue,j===q)){var Y=null,ne=null;if(j=j.firstBaseUpdate,j!==null){do{var le={eventTime:j.eventTime,lane:j.lane,tag:j.tag,payload:j.payload,callback:j.callback,next:null};ne===null?Y=ne=le:ne=ne.next=le,j=j.next}while(j!==null);ne===null?Y=ne=f:ne=ne.next=f}else Y=ne=f;j={baseState:q.baseState,firstBaseUpdate:Y,lastBaseUpdate:ne,shared:q.shared,effects:q.effects},u.updateQueue=j;return}u=j.lastBaseUpdate,u===null?j.firstBaseUpdate=f:u.next=f,j.lastBaseUpdate=f}function Ba(u,f,j,q){var Y=u.updateQueue;Wr=!1;var ne=Y.firstBaseUpdate,le=Y.lastBaseUpdate,ye=Y.shared.pending;if(ye!==null){Y.shared.pending=null;var Re=ye,Ge=Re.next;Re.next=null,le===null?ne=Ge:le.next=Ge,le=Re;var it=u.alternate;it!==null&&(it=it.updateQueue,ye=it.lastBaseUpdate,ye!==le&&(ye===null?it.firstBaseUpdate=Ge:ye.next=Ge,it.lastBaseUpdate=Re))}if(ne!==null){var Ot=Y.baseState;le=0,it=Ge=Re=null,ye=ne;do{var Qe=ye.lane,sn=ye.eventTime;if((q&Qe)===Qe){it!==null&&(it=it.next={eventTime:sn,lane:0,tag:ye.tag,payload:ye.payload,callback:ye.callback,next:null});e:{var Qt=u,Tr=ye;switch(Qe=f,sn=j,Tr.tag){case 1:if(Qt=Tr.payload,typeof Qt=="function"){Ot=Qt.call(sn,Ot,Qe);break e}Ot=Qt;break e;case 3:Qt.flags=Qt.flags&-65537|128;case 0:if(Qt=Tr.payload,Qe=typeof Qt=="function"?Qt.call(sn,Ot,Qe):Qt,Qe==null)break e;Ot=l({},Ot,Qe);break e;case 2:Wr=!0}}ye.callback!==null&&ye.lane!==0&&(u.flags|=64,Qe=Y.effects,Qe===null?Y.effects=[ye]:Qe.push(ye))}else sn={eventTime:sn,lane:Qe,tag:ye.tag,payload:ye.payload,callback:ye.callback,next:null},it===null?(Ge=it=sn,Re=Ot):it=it.next=sn,le|=Qe;if(ye=ye.next,ye===null){if(ye=Y.shared.pending,ye===null)break;Qe=ye,ye=Qe.next,Qe.next=null,Y.lastBaseUpdate=Qe,Y.shared.pending=null}}while(!0);if(it===null&&(Re=Ot),Y.baseState=Re,Y.firstBaseUpdate=Ge,Y.lastBaseUpdate=it,f=Y.shared.interleaved,f!==null){Y=f;do le|=Y.lane,Y=Y.next;while(Y!==f)}else ne===null&&(Y.shared.lanes=0);ha|=le,u.lanes=le,u.memoizedState=Ot}}function oh(u,f,j){if(u=f.effects,f.effects=null,u!==null)for(f=0;f<u.length;f++){var q=u[f],Y=q.callback;if(Y!==null){if(q.callback=null,q=j,typeof Y!="function")throw Error(s(191,Y));Y.call(q)}}}var Ua={},li=er(Ua),dl=er(Ua),qa=er(Ua);function si(u){if(u===Ua)throw Error(s(174));return u}function hu(u,f){It(qa,f),It(dl,u),It(li,Ua),u=K(f),cn(li),It(li,u)}function _o(){cn(li),cn(dl),cn(qa)}function Lc(u){var f=si(qa.current),j=si(li.current);f=Q(j,u.type,f),j!==f&&(It(dl,u),It(li,f))}function Nc(u){dl.current===u&&(cn(li),cn(dl))}var On=er(0);function pu(u){for(var f=u;f!==null;){if(f.tag===13){var j=f.memoizedState;if(j!==null&&(j=j.dehydrated,j===null||wn(j)||Sn(j)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Ic=[];function Dc(){for(var u=0;u<Ic.length;u++){var f=Ic[u];ie?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}Ic.length=0}var Br=c.ReactCurrentDispatcher,wo=c.ReactCurrentBatchConfig,Ha=0,gn=null,Rn=null,jn=null,hl=!1,hs=!1,ps=0,pl=0;function Wn(){throw Error(s(321))}function So(u,f){if(f===null)return!1;for(var j=0;j<f.length&&j<u.length;j++)if(!wi(u[j],f[j]))return!1;return!0}function gs(u,f,j,q,Y,ne){if(Ha=ne,gn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Br.current=u===null||u.memoizedState===null?$c:Wc,u=j(q,Y),hs){ne=0;do{if(hs=!1,ps=0,25<=ne)throw Error(s(301));ne+=1,jn=Rn=null,f.updateQueue=null,Br.current=Yc,u=j(q,Y)}while(hs)}if(Br.current=Co,f=Rn!==null&&Rn.next!==null,Ha=0,jn=Rn=gn=null,hl=!1,f)throw Error(s(300));return u}function gu(){var u=ps!==0;return ps=0,u}function Yr(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?gn.memoizedState=jn=u:jn=jn.next=u,jn}function rr(){if(Rn===null){var u=gn.alternate;u=u!==null?u.memoizedState:null}else u=Rn.next;var f=jn===null?gn.memoizedState:jn.next;if(f!==null)jn=f,Rn=u;else{if(u===null)throw Error(s(310));Rn=u,u={memoizedState:Rn.memoizedState,baseState:Rn.baseState,baseQueue:Rn.baseQueue,queue:Rn.queue,next:null},jn===null?gn.memoizedState=jn=u:jn=jn.next=u}return jn}function Eo(u,f){return typeof f=="function"?f(u):f}function mu(u){var f=rr(),j=f.queue;if(j===null)throw Error(s(311));j.lastRenderedReducer=u;var q=Rn,Y=q.baseQueue,ne=j.pending;if(ne!==null){if(Y!==null){var le=Y.next;Y.next=ne.next,ne.next=le}q.baseQueue=Y=ne,j.pending=null}if(Y!==null){ne=Y.next,q=q.baseState;var ye=le=null,Re=null,Ge=ne;do{var it=Ge.lane;if((Ha&it)===it)Re!==null&&(Re=Re.next={lane:0,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null}),q=Ge.hasEagerState?Ge.eagerState:u(q,Ge.action);else{var Ot={lane:it,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null};Re===null?(ye=Re=Ot,le=q):Re=Re.next=Ot,gn.lanes|=it,ha|=it}Ge=Ge.next}while(Ge!==null&&Ge!==ne);Re===null?le=q:Re.next=ye,wi(q,f.memoizedState)||(Fn=!0),f.memoizedState=q,f.baseState=le,f.baseQueue=Re,j.lastRenderedState=q}if(u=j.interleaved,u!==null){Y=u;do ne=Y.lane,gn.lanes|=ne,ha|=ne,Y=Y.next;while(Y!==u)}else Y===null&&(j.lanes=0);return[f.memoizedState,j.dispatch]}function gl(u){var f=rr(),j=f.queue;if(j===null)throw Error(s(311));j.lastRenderedReducer=u;var q=j.dispatch,Y=j.pending,ne=f.memoizedState;if(Y!==null){j.pending=null;var le=Y=Y.next;do ne=u(ne,le.action),le=le.next;while(le!==Y);wi(ne,f.memoizedState)||(Fn=!0),f.memoizedState=ne,f.baseQueue===null&&(f.baseState=ne),j.lastRenderedState=ne}return[ne,q]}function jc(){}function Fc(u,f){var j=gn,q=rr(),Y=f(),ne=!wi(q.memoizedState,Y);if(ne&&(q.memoizedState=Y,Fn=!0),q=q.queue,bu(Uc.bind(null,j,q,u),[u]),q.getSnapshot!==f||ne||jn!==null&&jn.memoizedState.tag&1){if(j.flags|=2048,Oo(9,Bc.bind(null,j,q,Y,f),void 0,null),nn===null)throw Error(s(349));Ha&30||zc(j,f,Y)}return Y}function zc(u,f,j){u.flags|=16384,u={getSnapshot:f,value:j},f=gn.updateQueue,f===null?(f={lastEffect:null,stores:null},gn.updateQueue=f,f.stores=[u]):(j=f.stores,j===null?f.stores=[u]:j.push(u))}function Bc(u,f,j,q){f.value=j,f.getSnapshot=q,qc(f)&&ua(u)}function Uc(u,f,j){return j(function(){qc(f)&&ua(u)})}function qc(u){var f=u.getSnapshot;u=u.value;try{var j=f();return!wi(u,j)}catch{return!0}}function ua(u){var f=xi(u,1);f!==null&&gr(f,u,1,-1)}function vu(u){var f=Yr();return typeof u=="function"&&(u=u()),f.memoizedState=f.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:u},f.queue=u,u=u.dispatch=Xp.bind(null,gn,u),[f.memoizedState,u]}function Oo(u,f,j,q){return u={tag:u,create:f,destroy:j,deps:q,next:null},f=gn.updateQueue,f===null?(f={lastEffect:null,stores:null},gn.updateQueue=f,f.lastEffect=u.next=u):(j=f.lastEffect,j===null?f.lastEffect=u.next=u:(q=j.next,j.next=u,u.next=q,f.lastEffect=u)),u}function lh(){return rr().memoizedState}function yu(u,f,j,q){var Y=Yr();gn.flags|=u,Y.memoizedState=Oo(1|f,j,void 0,q===void 0?null:q)}function Ga(u,f,j,q){var Y=rr();q=q===void 0?null:q;var ne=void 0;if(Rn!==null){var le=Rn.memoizedState;if(ne=le.destroy,q!==null&&So(q,le.deps)){Y.memoizedState=Oo(f,j,ne,q);return}}gn.flags|=u,Y.memoizedState=Oo(1|f,j,ne,q)}function sh(u,f){return yu(8390656,8,u,f)}function bu(u,f){return Ga(2048,8,u,f)}function Hc(u,f){return Ga(4,2,u,f)}function an(u,f){return Ga(4,4,u,f)}function _u(u,f){if(typeof f=="function")return u=u(),f(u),function(){f(null)};if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function ms(u,f,j){return j=j!=null?j.concat([u]):null,Ga(4,4,_u.bind(null,f,u),j)}function xo(){}function Gc(u,f){var j=rr();f=f===void 0?null:f;var q=j.memoizedState;return q!==null&&f!==null&&So(f,q[1])?q[0]:(j.memoizedState=[u,f],u)}function wu(u,f){var j=rr();f=f===void 0?null:f;var q=j.memoizedState;return q!==null&&f!==null&&So(f,q[1])?q[0]:(u=u(),j.memoizedState=[u,f],u)}function ml(u,f,j){return Ha&21?(wi(j,f)||(j=eu(),gn.lanes|=j,ha|=j,u.baseState=!0),f):(u.baseState&&(u.baseState=!1,Fn=!0),u.memoizedState=j)}function Su(u,f){var j=Dt;Dt=j!==0&&4>j?j:4,u(!0);var q=wo.transition;wo.transition={};try{u(!1),f()}finally{Dt=j,wo.transition=q}}function Po(){return rr().memoizedState}function uh(u,f,j){var q=Bn(u);if(j={lane:q,action:j,hasEagerState:!1,eagerState:null,next:null},ch(u))Vc(f,j);else if(j=Rc(u,f,j,q),j!==null){var Y=dn();gr(j,u,q,Y),vs(j,f,q)}}function Xp(u,f,j){var q=Bn(u),Y={lane:q,action:j,hasEagerState:!1,eagerState:null,next:null};if(ch(u))Vc(f,Y);else{var ne=u.alternate;if(u.lanes===0&&(ne===null||ne.lanes===0)&&(ne=f.lastRenderedReducer,ne!==null))try{var le=f.lastRenderedState,ye=ne(le,j);if(Y.hasEagerState=!0,Y.eagerState=ye,wi(ye,le)){var Re=f.interleaved;Re===null?(Y.next=Y,du(f)):(Y.next=Re.next,Re.next=Y),f.interleaved=Y;return}}catch{}finally{}j=Rc(u,f,Y,q),j!==null&&(Y=dn(),gr(j,u,q,Y),vs(j,f,q))}}function ch(u){var f=u.alternate;return u===gn||f!==null&&f===gn}function Vc(u,f){hs=hl=!0;var j=u.pending;j===null?f.next=f:(f.next=j.next,j.next=f),u.pending=f}function vs(u,f,j){if(j&4194240){var q=f.lanes;q&=u.pendingLanes,j|=q,f.lanes=j,ji(u,j)}}var Co={readContext:$r,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},$c={readContext:$r,useCallback:function(u,f){return Yr().memoizedState=[u,f===void 0?null:f],u},useContext:$r,useEffect:sh,useImperativeHandle:function(u,f,j){return j=j!=null?j.concat([u]):null,yu(4194308,4,_u.bind(null,f,u),j)},useLayoutEffect:function(u,f){return yu(4194308,4,u,f)},useInsertionEffect:function(u,f){return yu(4,2,u,f)},useMemo:function(u,f){var j=Yr();return f=f===void 0?null:f,u=u(),j.memoizedState=[u,f],u},useReducer:function(u,f,j){var q=Yr();return f=j!==void 0?j(f):f,q.memoizedState=q.baseState=f,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:f},q.queue=u,u=u.dispatch=uh.bind(null,gn,u),[q.memoizedState,u]},useRef:function(u){var f=Yr();return u={current:u},f.memoizedState=u},useState:vu,useDebugValue:xo,useDeferredValue:function(u){return Yr().memoizedState=u},useTransition:function(){var u=vu(!1),f=u[0];return u=Su.bind(null,u[1]),Yr().memoizedState=u,[f,u]},useMutableSource:function(){},useSyncExternalStore:function(u,f,j){var q=gn,Y=Yr();if(fn){if(j===void 0)throw Error(s(407));j=j()}else{if(j=f(),nn===null)throw Error(s(349));Ha&30||zc(q,f,j)}Y.memoizedState=j;var ne={value:j,getSnapshot:f};return Y.queue=ne,sh(Uc.bind(null,q,ne,u),[u]),q.flags|=2048,Oo(9,Bc.bind(null,q,ne,j,f),void 0,null),j},useId:function(){var u=Yr(),f=nn.identifierPrefix;if(fn){var j=Si,q=zr;j=(q&~(1<<32-Gr(q)-1)).toString(32)+j,f=":"+f+"R"+j,j=ps++,0<j&&(f+="H"+j.toString(32)),f+=":"}else j=pl++,f=":"+f+"r"+j.toString(32)+":";return u.memoizedState=f},unstable_isNewReconciler:!1},Wc={readContext:$r,useCallback:Gc,useContext:$r,useEffect:bu,useImperativeHandle:ms,useInsertionEffect:Hc,useLayoutEffect:an,useMemo:wu,useReducer:mu,useRef:lh,useState:function(){return mu(Eo)},useDebugValue:xo,useDeferredValue:function(u){var f=rr();return ml(f,Rn.memoizedState,u)},useTransition:function(){var u=mu(Eo)[0],f=rr().memoizedState;return[u,f]},useMutableSource:jc,useSyncExternalStore:Fc,useId:Po,unstable_isNewReconciler:!1},Yc={readContext:$r,useCallback:Gc,useContext:$r,useEffect:bu,useImperativeHandle:ms,useInsertionEffect:Hc,useLayoutEffect:an,useMemo:wu,useReducer:gl,useRef:lh,useState:function(){return gl(Eo)},useDebugValue:xo,useDeferredValue:function(u){var f=rr();return Rn===null?f.memoizedState=u:ml(f,Rn.memoizedState,u)},useTransition:function(){var u=gl(Eo)[0],f=rr().memoizedState;return[u,f]},useMutableSource:jc,useSyncExternalStore:Fc,useId:Po,unstable_isNewReconciler:!1};function Kr(u,f){if(u&&u.defaultProps){f=l({},f),u=u.defaultProps;for(var j in u)f[j]===void 0&&(f[j]=u[j]);return f}return f}function Kc(u,f,j,q){f=u.memoizedState,j=j(q,f),j=j==null?f:l({},f,j),u.memoizedState=j,u.lanes===0&&(u.updateQueue.baseState=j)}var ys={isMounted:function(u){return(u=u._reactInternals)?T(u)===u:!1},enqueueSetState:function(u,f,j){u=u._reactInternals;var q=dn(),Y=Bn(u),ne=la(q,Y);ne.payload=f,j!=null&&(ne.callback=j),f=sa(u,ne,Y),f!==null&&(gr(f,u,Y,q),ds(f,u,Y))},enqueueReplaceState:function(u,f,j){u=u._reactInternals;var q=dn(),Y=Bn(u),ne=la(q,Y);ne.tag=1,ne.payload=f,j!=null&&(ne.callback=j),f=sa(u,ne,Y),f!==null&&(gr(f,u,Y,q),ds(f,u,Y))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var j=dn(),q=Bn(u),Y=la(j,q);Y.tag=2,f!=null&&(Y.callback=f),f=sa(u,Y,q),f!==null&&(gr(f,u,q,j),ds(f,u,q))}};function fh(u,f,j,q,Y,ne,le){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(q,ne,le):f.prototype&&f.prototype.isPureReactComponent?!su(j,q)||!su(Y,ne):!0}function dh(u,f,j){var q=!1,Y=Ia,ne=f.contextType;return typeof ne=="object"&&ne!==null?ne=$r(ne):(Y=Vn(f)?Di:fr.current,q=f.contextTypes,ne=(q=q!=null)?ia(u,Y):Ia),f=new f(j,ne),u.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ys,u.stateNode=f,f._reactInternals=u,q&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=Y,u.__reactInternalMemoizedMaskedChildContext=ne),f}function Eu(u,f,j,q){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(j,q),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(j,q),f.state!==u&&ys.enqueueReplaceState(f,f.state,null)}function zi(u,f,j,q){var Y=u.stateNode;Y.props=j,Y.state=u.memoizedState,Y.refs={},Mc(u);var ne=f.contextType;typeof ne=="object"&&ne!==null?Y.context=$r(ne):(ne=Vn(f)?Di:fr.current,Y.context=ia(u,ne)),Y.state=u.memoizedState,ne=f.getDerivedStateFromProps,typeof ne=="function"&&(Kc(u,f,ne,j),Y.state=u.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof Y.getSnapshotBeforeUpdate=="function"||typeof Y.UNSAFE_componentWillMount!="function"&&typeof Y.componentWillMount!="function"||(f=Y.state,typeof Y.componentWillMount=="function"&&Y.componentWillMount(),typeof Y.UNSAFE_componentWillMount=="function"&&Y.UNSAFE_componentWillMount(),f!==Y.state&&ys.enqueueReplaceState(Y,Y.state,null),Ba(u,j,Y,q),Y.state=u.memoizedState),typeof Y.componentDidMount=="function"&&(u.flags|=4194308)}function ko(u,f){try{var j="",q=f;do j+=Kp(q),q=q.return;while(q);var Y=j}catch(ne){Y=`
56
+ Error generating stack: `+ne.message+`
57
+ `+ne.stack}return{value:u,source:f,stack:Y,digest:null}}function Va(u,f,j){return{value:u,source:null,stack:j??null,digest:f??null}}function ui(u,f){try{console.error(f.value)}catch(j){setTimeout(function(){throw j})}}var bs=typeof WeakMap=="function"?WeakMap:Map;function Bi(u,f,j){j=la(-1,j),j.tag=3,j.payload={element:null};var q=f.value;return j.callback=function(){Cn||(Cn=!0,Mn=q),ui(u,f)},j}function Ou(u,f,j){j=la(-1,j),j.tag=3;var q=u.type.getDerivedStateFromError;if(typeof q=="function"){var Y=f.value;j.payload=function(){return q(Y)},j.callback=function(){ui(u,f)}}var ne=u.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(j.callback=function(){ui(u,f),typeof q!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var le=f.stack;this.componentDidCatch(f.value,{componentStack:le!==null?le:""})}),j}function hh(u,f,j){var q=u.pingCache;if(q===null){q=u.pingCache=new bs;var Y=new Set;q.set(f,Y)}else Y=q.get(f),Y===void 0&&(Y=new Set,q.set(f,Y));Y.has(j)||(Y.add(j),u=wh.bind(null,u,f,j),f.then(u,u))}function ph(u){do{var f;if((f=u.tag===13)&&(f=u.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return u;u=u.return}while(u!==null);return null}function $a(u,f,j,q,Y){return u.mode&1?(u.flags|=65536,u.lanes=Y,u):(u===f?u.flags|=65536:(u.flags|=128,j.flags|=131072,j.flags&=-52805,j.tag===1&&(j.alternate===null?j.tag=17:(f=la(-1,1),f.tag=2,sa(j,f,1))),j.lanes|=1),u)}var _s=c.ReactCurrentOwner,Fn=!1;function Yn(u,f,j,q){f.child=u===null?rh(f,null,j,q):yo(f,u.child,j,q)}function xu(u,f,j,q,Y){j=j.render;var ne=f.ref;return cl(f,Y),q=gs(u,f,j,q,ne,Y),j=gu(),u!==null&&!Fn?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~Y,fa(u,f,Y)):(fn&&j&&ss(f),f.flags|=1,Yn(u,f,q,Y),f.child)}function Ao(u,f,j,q,Y){if(u===null){var ne=j.type;return typeof ne=="function"&&!Rl(ne)&&ne.defaultProps===void 0&&j.compare===null&&j.defaultProps===void 0?(f.tag=15,f.type=ne,ca(u,f,ne,q,Y)):(u=Uu(j.type,null,q,f,f.mode,Y),u.ref=f.ref,u.return=f,f.child=u)}if(ne=u.child,!(u.lanes&Y)){var le=ne.memoizedProps;if(j=j.compare,j=j!==null?j:su,j(le,q)&&u.ref===f.ref)return fa(u,f,Y)}return f.flags|=1,u=no(ne,q),u.ref=f.ref,u.return=f,f.child=u}function ca(u,f,j,q,Y){if(u!==null){var ne=u.memoizedProps;if(su(ne,q)&&u.ref===f.ref)if(Fn=!1,f.pendingProps=q=ne,(u.lanes&Y)!==0)u.flags&131072&&(Fn=!0);else return f.lanes=u.lanes,fa(u,f,Y)}return Ui(u,f,j,q,Y)}function on(u,f,j){var q=f.pendingProps,Y=q.children,ne=u!==null?u.memoizedState:null;if(q.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},It(Qa,zn),zn|=j;else{if(!(j&1073741824))return u=ne!==null?ne.baseLanes|j:j,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:u,cachePool:null,transitions:null},f.updateQueue=null,It(Qa,zn),zn|=u,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},q=ne!==null?ne.baseLanes:j,It(Qa,zn),zn|=q}else ne!==null?(q=ne.baseLanes|j,f.memoizedState=null):q=j,It(Qa,zn),zn|=q;return Yn(u,f,Y,j),f.child}function tn(u,f){var j=f.ref;(u===null&&j!==null||u!==null&&u.ref!==j)&&(f.flags|=512,f.flags|=2097152)}function Ui(u,f,j,q,Y){var ne=Vn(j)?Di:fr.current;return ne=ia(f,ne),cl(f,Y),j=gs(u,f,j,q,ne,Y),q=gu(),u!==null&&!Fn?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~Y,fa(u,f,Y)):(fn&&q&&ss(f),f.flags|=1,Yn(u,f,j,Y),f.child)}function ir(u,f,j,q,Y){if(Vn(j)){var ne=!0;tl(f)}else ne=!1;if(cl(f,Y),f.stateNode===null)ws(u,f),dh(f,j,q),zi(f,j,q,Y),q=!0;else if(u===null){var le=f.stateNode,ye=f.memoizedProps;le.props=ye;var Re=le.context,Ge=j.contextType;typeof Ge=="object"&&Ge!==null?Ge=$r(Ge):(Ge=Vn(j)?Di:fr.current,Ge=ia(f,Ge));var it=j.getDerivedStateFromProps,Ot=typeof it=="function"||typeof le.getSnapshotBeforeUpdate=="function";Ot||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(ye!==q||Re!==Ge)&&Eu(f,le,q,Ge),Wr=!1;var Qe=f.memoizedState;le.state=Qe,Ba(f,q,le,Y),Re=f.memoizedState,ye!==q||Qe!==Re||jr.current||Wr?(typeof it=="function"&&(Kc(f,j,it,q),Re=f.memoizedState),(ye=Wr||fh(f,j,ye,q,Qe,Re,Ge))?(Ot||typeof le.UNSAFE_componentWillMount!="function"&&typeof le.componentWillMount!="function"||(typeof le.componentWillMount=="function"&&le.componentWillMount(),typeof le.UNSAFE_componentWillMount=="function"&&le.UNSAFE_componentWillMount()),typeof le.componentDidMount=="function"&&(f.flags|=4194308)):(typeof le.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=q,f.memoizedState=Re),le.props=q,le.state=Re,le.context=Ge,q=ye):(typeof le.componentDidMount=="function"&&(f.flags|=4194308),q=!1)}else{le=f.stateNode,ah(u,f),ye=f.memoizedProps,Ge=f.type===f.elementType?ye:Kr(f.type,ye),le.props=Ge,Ot=f.pendingProps,Qe=le.context,Re=j.contextType,typeof Re=="object"&&Re!==null?Re=$r(Re):(Re=Vn(j)?Di:fr.current,Re=ia(f,Re));var sn=j.getDerivedStateFromProps;(it=typeof sn=="function"||typeof le.getSnapshotBeforeUpdate=="function")||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(ye!==Ot||Qe!==Re)&&Eu(f,le,q,Re),Wr=!1,Qe=f.memoizedState,le.state=Qe,Ba(f,q,le,Y);var Qt=f.memoizedState;ye!==Ot||Qe!==Qt||jr.current||Wr?(typeof sn=="function"&&(Kc(f,j,sn,q),Qt=f.memoizedState),(Ge=Wr||fh(f,j,Ge,q,Qe,Qt,Re)||!1)?(it||typeof le.UNSAFE_componentWillUpdate!="function"&&typeof le.componentWillUpdate!="function"||(typeof le.componentWillUpdate=="function"&&le.componentWillUpdate(q,Qt,Re),typeof le.UNSAFE_componentWillUpdate=="function"&&le.UNSAFE_componentWillUpdate(q,Qt,Re)),typeof le.componentDidUpdate=="function"&&(f.flags|=4),typeof le.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof le.componentDidUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=1024),f.memoizedProps=q,f.memoizedState=Qt),le.props=q,le.state=Qt,le.context=Re,q=Ge):(typeof le.componentDidUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=1024),q=!1)}return dr(u,f,j,q,ne,Y)}function dr(u,f,j,q,Y,ne){tn(u,f);var le=(f.flags&128)!==0;if(!q&&!le)return Y&&Oc(f,j,!1),fa(u,f,ne);q=f.stateNode,_s.current=f;var ye=le&&typeof j.getDerivedStateFromError!="function"?null:q.render();return f.flags|=1,u!==null&&le?(f.child=yo(f,u.child,null,ne),f.child=yo(f,null,ye,ne)):Yn(u,f,ye,ne),f.memoizedState=q.state,Y&&Oc(f,j,!0),f.child}function Wa(u){var f=u.stateNode;f.pendingContext?Gd(u,f.pendingContext,f.pendingContext!==f.context):f.context&&Gd(u,f.context,!1),hu(u,f.containerInfo)}function To(u,f,j,q,Y){return mo(),kc(Y),f.flags|=256,Yn(u,f,j,q),f.child}var hr={dehydrated:null,treeContext:null,retryLane:0};function vl(u){return{baseLanes:u,cachePool:null,transitions:null}}function Xc(u,f,j){var q=f.pendingProps,Y=On.current,ne=!1,le=(f.flags&128)!==0,ye;if((ye=le)||(ye=u!==null&&u.memoizedState===null?!1:(Y&2)!==0),ye?(ne=!0,f.flags&=-129):(u===null||u.memoizedState!==null)&&(Y|=1),It(On,Y&1),u===null)return Cc(f),u=f.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(f.mode&1?Sn(u)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(le=q.children,u=q.fallback,ne?(q=f.mode,ne=f.child,le={mode:"hidden",children:le},!(q&1)&&ne!==null?(ne.childLanes=0,ne.pendingProps=le):ne=Ml(le,q,0,null),u=ar(u,q,j,null),ne.return=f,u.return=f,ne.sibling=u,f.child=ne,f.child.memoizedState=vl(j),f.memoizedState=hr,u):Pu(f,le));if(Y=u.memoizedState,Y!==null&&(ye=Y.dehydrated,ye!==null))return gh(u,f,le,q,ye,Y,j);if(ne){ne=q.fallback,le=f.mode,Y=u.child,ye=Y.sibling;var Re={mode:"hidden",children:q.children};return!(le&1)&&f.child!==Y?(q=f.child,q.childLanes=0,q.pendingProps=Re,f.deletions=null):(q=no(Y,Re),q.subtreeFlags=Y.subtreeFlags&14680064),ye!==null?ne=no(ye,ne):(ne=ar(ne,le,j,null),ne.flags|=2),ne.return=f,q.return=f,q.sibling=ne,f.child=q,q=ne,ne=f.child,le=u.child.memoizedState,le=le===null?vl(j):{baseLanes:le.baseLanes|j,cachePool:null,transitions:le.transitions},ne.memoizedState=le,ne.childLanes=u.childLanes&~j,f.memoizedState=hr,q}return ne=u.child,u=ne.sibling,q=no(ne,{mode:"visible",children:q.children}),!(f.mode&1)&&(q.lanes=j),q.return=f,q.sibling=null,u!==null&&(j=f.deletions,j===null?(f.deletions=[u],f.flags|=16):j.push(u)),f.child=q,f.memoizedState=null,q}function Pu(u,f){return f=Ml({mode:"visible",children:f},u.mode,0,null),f.return=u,u.child=f}function Ro(u,f,j,q){return q!==null&&kc(q),yo(f,u.child,null,j),u=Pu(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function gh(u,f,j,q,Y,ne,le){if(j)return f.flags&256?(f.flags&=-257,q=Va(Error(s(422))),Ro(u,f,le,q)):f.memoizedState!==null?(f.child=u.child,f.flags|=128,null):(ne=q.fallback,Y=f.mode,q=Ml({mode:"visible",children:q.children},Y,0,null),ne=ar(ne,Y,le,null),ne.flags|=2,q.return=f,ne.return=f,q.sibling=ne,f.child=q,f.mode&1&&yo(f,u.child,null,le),f.child.memoizedState=vl(le),f.memoizedState=hr,ne);if(!(f.mode&1))return Ro(u,f,le,null);if(Sn(Y))return q=Qn(Y).digest,ne=Error(s(419)),q=Va(ne,q,void 0),Ro(u,f,le,q);if(j=(le&u.childLanes)!==0,Fn||j){if(q=nn,q!==null){switch(le&-le){case 4:Y=2;break;case 16:Y=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:Y=32;break;case 536870912:Y=268435456;break;default:Y=0}Y=Y&(q.suspendedLanes|le)?0:Y,Y!==0&&Y!==ne.retryLane&&(ne.retryLane=Y,xi(u,Y),gr(q,u,Y,-1))}return Tl(),q=Va(Error(s(421))),Ro(u,f,le,q)}return wn(Y)?(f.flags|=128,f.child=u.child,f=Eh.bind(null,u),ii(Y,f),null):(u=ne.treeContext,de&&(Or=Lt(Y),nr=f,fn=!0,Oi=null,cs=!1,u!==null&&(Er[Vr++]=zr,Er[Vr++]=Si,Er[Vr++]=Dn,zr=u.id,Si=u.overflow,Dn=f)),f=Pu(f,q.children),f.flags|=4096,f)}function qi(u,f,j){u.lanes|=f;var q=u.alternate;q!==null&&(q.lanes|=f),bo(u.return,f,j)}function yl(u,f,j,q,Y){var ne=u.memoizedState;ne===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:q,tail:j,tailMode:Y}:(ne.isBackwards=f,ne.rendering=null,ne.renderingStartTime=0,ne.last=q,ne.tail=j,ne.tailMode=Y)}function Cu(u,f,j){var q=f.pendingProps,Y=q.revealOrder,ne=q.tail;if(Yn(u,f,q.children,j),q=On.current,q&2)q=q&1|2,f.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&qi(u,j,f);else if(u.tag===19)qi(u,j,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}q&=1}if(It(On,q),!(f.mode&1))f.memoizedState=null;else switch(Y){case"forwards":for(j=f.child,Y=null;j!==null;)u=j.alternate,u!==null&&pu(u)===null&&(Y=j),j=j.sibling;j=Y,j===null?(Y=f.child,f.child=null):(Y=j.sibling,j.sibling=null),yl(f,!1,Y,j,ne);break;case"backwards":for(j=null,Y=f.child,f.child=null;Y!==null;){if(u=Y.alternate,u!==null&&pu(u)===null){f.child=Y;break}u=Y.sibling,Y.sibling=j,j=Y,Y=u}yl(f,!0,j,null,ne);break;case"together":yl(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function ws(u,f){!(f.mode&1)&&u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2)}function fa(u,f,j){if(u!==null&&(f.dependencies=u.dependencies),ha|=f.lanes,!(j&f.childLanes))return null;if(u!==null&&f.child!==u.child)throw Error(s(153));if(f.child!==null){for(u=f.child,j=no(u,u.pendingProps),f.child=j,j.return=f;u.sibling!==null;)u=u.sibling,j=j.sibling=no(u,u.pendingProps),j.return=f;j.sibling=null}return f.child}function Ya(u,f,j){switch(f.tag){case 3:Wa(f),mo();break;case 5:Lc(f);break;case 1:Vn(f.type)&&tl(f);break;case 4:hu(f,f.stateNode.containerInfo);break;case 10:ih(f,f.type._context,f.memoizedProps.value);break;case 13:var q=f.memoizedState;if(q!==null)return q.dehydrated!==null?(It(On,On.current&1),f.flags|=128,null):j&f.child.childLanes?Xc(u,f,j):(It(On,On.current&1),u=fa(u,f,j),u!==null?u.sibling:null);It(On,On.current&1);break;case 19:if(q=(j&f.childLanes)!==0,u.flags&128){if(q)return Cu(u,f,j);f.flags|=128}var Y=f.memoizedState;if(Y!==null&&(Y.rendering=null,Y.tail=null,Y.lastEffect=null),It(On,On.current),q)break;return null;case 22:case 23:return f.lanes=0,on(u,f,j)}return fa(u,f,j)}function xr(u){u.flags|=4}function Mo(u,f){if(u!==null&&u.child===f.child)return!0;if(f.flags&16)return!1;for(u=f.child;u!==null;){if(u.flags&12854||u.subtreeFlags&12854)return!1;u=u.sibling}return!0}var Ka,Xa,Pr,Cr;if(oe)Ka=function(u,f){for(var j=f.child;j!==null;){if(j.tag===5||j.tag===6)U(u,j.stateNode);else if(j.tag!==4&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===f)break;for(;j.sibling===null;){if(j.return===null||j.return===f)return;j=j.return}j.sibling.return=j.return,j=j.sibling}},Xa=function(){},Pr=function(u,f,j,q,Y){if(u=u.memoizedProps,u!==q){var ne=f.stateNode,le=si(li.current);j=ee(ne,j,u,q,Y,le),(f.updateQueue=j)&&xr(f)}},Cr=function(u,f,j,q){j!==q&&xr(f)};else if(se){Ka=function(u,f,j,q){for(var Y=f.child;Y!==null;){if(Y.tag===5){var ne=Y.stateNode;j&&q&&(ne=Me(ne,Y.type,Y.memoizedProps,Y)),U(u,ne)}else if(Y.tag===6)ne=Y.stateNode,j&&q&&(ne=Ye(ne,Y.memoizedProps,Y)),U(u,ne);else if(Y.tag!==4){if(Y.tag===22&&Y.memoizedState!==null)ne=Y.child,ne!==null&&(ne.return=Y),Ka(u,Y,!0,!0);else if(Y.child!==null){Y.child.return=Y,Y=Y.child;continue}}if(Y===f)break;for(;Y.sibling===null;){if(Y.return===null||Y.return===f)return;Y=Y.return}Y.sibling.return=Y.return,Y=Y.sibling}};var Za=function(u,f,j,q){for(var Y=f.child;Y!==null;){if(Y.tag===5){var ne=Y.stateNode;j&&q&&(ne=Me(ne,Y.type,Y.memoizedProps,Y)),ft(u,ne)}else if(Y.tag===6)ne=Y.stateNode,j&&q&&(ne=Ye(ne,Y.memoizedProps,Y)),ft(u,ne);else if(Y.tag!==4){if(Y.tag===22&&Y.memoizedState!==null)ne=Y.child,ne!==null&&(ne.return=Y),Za(u,Y,!0,!0);else if(Y.child!==null){Y.child.return=Y,Y=Y.child;continue}}if(Y===f)break;for(;Y.sibling===null;){if(Y.return===null||Y.return===f)return;Y=Y.return}Y.sibling.return=Y.return,Y=Y.sibling}};Xa=function(u,f){var j=f.stateNode;if(!Mo(u,f)){u=j.containerInfo;var q=rt(u);Za(q,f,!1,!1),j.pendingChildren=q,xr(f),De(u,q)}},Pr=function(u,f,j,q,Y){var ne=u.stateNode,le=u.memoizedProps;if((u=Mo(u,f))&&le===q)f.stateNode=ne;else{var ye=f.stateNode,Re=si(li.current),Ge=null;le!==q&&(Ge=ee(ye,j,le,q,Y,Re)),u&&Ge===null?f.stateNode=ne:(ne=Fe(ne,Ge,j,le,q,f,u,ye),$(ne,j,q,Y,Re)&&xr(f),f.stateNode=ne,u?xr(f):Ka(ne,f,!1,!1))}},Cr=function(u,f,j,q){j!==q?(u=si(qa.current),j=si(li.current),f.stateNode=Z(q,u,j,f),xr(f)):f.stateNode=u.stateNode}}else Xa=function(){},Pr=function(){},Cr=function(){};function Xr(u,f){if(!fn)switch(u.tailMode){case"hidden":f=u.tail;for(var j=null;f!==null;)f.alternate!==null&&(j=f),f=f.sibling;j===null?u.tail=null:j.sibling=null;break;case"collapsed":j=u.tail;for(var q=null;j!==null;)j.alternate!==null&&(q=j),j=j.sibling;q===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:q.sibling=null}}function mn(u){var f=u.alternate!==null&&u.alternate.child===u.child,j=0,q=0;if(f)for(var Y=u.child;Y!==null;)j|=Y.lanes|Y.childLanes,q|=Y.subtreeFlags&14680064,q|=Y.flags&14680064,Y.return=u,Y=Y.sibling;else for(Y=u.child;Y!==null;)j|=Y.lanes|Y.childLanes,q|=Y.subtreeFlags,q|=Y.flags,Y.return=u,Y=Y.sibling;return u.subtreeFlags|=q,u.childLanes=j,f}function Lo(u,f,j){var q=f.pendingProps;switch(us(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(f),null;case 1:return Vn(f.type)&&po(),mn(f),null;case 3:return j=f.stateNode,_o(),cn(jr),cn(fr),Dc(),j.pendingContext&&(j.context=j.pendingContext,j.pendingContext=null),(u===null||u.child===null)&&(lu(f)?xr(f):u===null||u.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Oi!==null&&(zu(Oi),Oi=null))),Xa(u,f),mn(f),null;case 5:Nc(f),j=si(qa.current);var Y=f.type;if(u!==null&&f.stateNode!=null)Pr(u,f,Y,q,j),u.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!q){if(f.stateNode===null)throw Error(s(166));return mn(f),null}if(u=si(li.current),lu(f)){if(!de)throw Error(s(175));u=Gt(f.stateNode,f.type,f.memoizedProps,j,u,f,!cs),f.updateQueue=u,u!==null&&xr(f)}else{var ne=I(Y,q,j,u,f);Ka(ne,f,!1,!1),f.stateNode=ne,$(ne,Y,q,j,u)&&xr(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return mn(f),null;case 6:if(u&&f.stateNode!=null)Cr(u,f,u.memoizedProps,q);else{if(typeof q!="string"&&f.stateNode===null)throw Error(s(166));if(u=si(qa.current),j=si(li.current),lu(f)){if(!de)throw Error(s(176));if(u=f.stateNode,j=f.memoizedProps,(q=Vt(u,j,f,!cs))&&(Y=nr,Y!==null))switch(Y.tag){case 3:rs(Y.stateNode.containerInfo,u,j,(Y.mode&1)!==0);break;case 5:en(Y.type,Y.memoizedProps,Y.stateNode,u,j,(Y.mode&1)!==0)}q&&xr(f)}else f.stateNode=Z(q,u,j,f)}return mn(f),null;case 13:if(cn(On),q=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(fn&&Or!==null&&f.mode&1&&!(f.flags&128))eh(),mo(),f.flags|=98560,Y=!1;else if(Y=lu(f),q!==null&&q.dehydrated!==null){if(u===null){if(!Y)throw Error(s(318));if(!de)throw Error(s(344));if(Y=f.memoizedState,Y=Y!==null?Y.dehydrated:null,!Y)throw Error(s(317));Jn(Y,f)}else mo(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;mn(f),Y=!1}else Oi!==null&&(zu(Oi),Oi=null),Y=!0;if(!Y)return f.flags&65536?f:null}return f.flags&128?(f.lanes=j,f):(j=q!==null,j!==(u!==null&&u.memoizedState!==null)&&j&&(f.child.flags|=8192,f.mode&1&&(u===null||On.current&1?yn===0&&(yn=3):Tl())),f.updateQueue!==null&&(f.flags|=4),mn(f),null);case 4:return _o(),Xa(u,f),u===null&&Oe(f.stateNode.containerInfo),mn(f),null;case 10:return fs(f.type._context),mn(f),null;case 17:return Vn(f.type)&&po(),mn(f),null;case 19:if(cn(On),Y=f.memoizedState,Y===null)return mn(f),null;if(q=(f.flags&128)!==0,ne=Y.rendering,ne===null)if(q)Xr(Y,!1);else{if(yn!==0||u!==null&&u.flags&128)for(u=f.child;u!==null;){if(ne=pu(u),ne!==null){for(f.flags|=128,Xr(Y,!1),u=ne.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),f.subtreeFlags=0,u=j,j=f.child;j!==null;)q=j,Y=u,q.flags&=14680066,ne=q.alternate,ne===null?(q.childLanes=0,q.lanes=Y,q.child=null,q.subtreeFlags=0,q.memoizedProps=null,q.memoizedState=null,q.updateQueue=null,q.dependencies=null,q.stateNode=null):(q.childLanes=ne.childLanes,q.lanes=ne.lanes,q.child=ne.child,q.subtreeFlags=0,q.deletions=null,q.memoizedProps=ne.memoizedProps,q.memoizedState=ne.memoizedState,q.updateQueue=ne.updateQueue,q.type=ne.type,Y=ne.dependencies,q.dependencies=Y===null?null:{lanes:Y.lanes,firstContext:Y.firstContext}),j=j.sibling;return It(On,On.current&1|2),f.child}u=u.sibling}Y.tail!==null&&$n()>ks&&(f.flags|=128,q=!0,Xr(Y,!1),f.lanes=4194304)}else{if(!q)if(u=pu(ne),u!==null){if(f.flags|=128,q=!0,u=u.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),Xr(Y,!0),Y.tail===null&&Y.tailMode==="hidden"&&!ne.alternate&&!fn)return mn(f),null}else 2*$n()-Y.renderingStartTime>ks&&j!==1073741824&&(f.flags|=128,q=!0,Xr(Y,!1),f.lanes=4194304);Y.isBackwards?(ne.sibling=f.child,f.child=ne):(u=Y.last,u!==null?u.sibling=ne:f.child=ne,Y.last=ne)}return Y.tail!==null?(f=Y.tail,Y.rendering=f,Y.tail=f.sibling,Y.renderingStartTime=$n(),f.sibling=null,u=On.current,It(On,q?u&1|2:u&1),f):(mn(f),null);case 22:case 23:return Bu(),j=f.memoizedState!==null,u!==null&&u.memoizedState!==null!==j&&(f.flags|=8192),j&&f.mode&1?zn&1073741824&&(mn(f),oe&&f.subtreeFlags&6&&(f.flags|=8192)):mn(f),null;case 24:return null;case 25:return null}throw Error(s(156,f.tag))}function mh(u,f){switch(us(f),f.tag){case 1:return Vn(f.type)&&po(),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return _o(),cn(jr),cn(fr),Dc(),u=f.flags,u&65536&&!(u&128)?(f.flags=u&-65537|128,f):null;case 5:return Nc(f),null;case 13:if(cn(On),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(s(340));mo()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return cn(On),null;case 4:return _o(),null;case 10:return fs(f.type._context),null;case 22:case 23:return Bu(),null;case 24:return null;default:return null}}var bl=!1,Kn=!1,Zr=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function Zt(u,f){var j=u.ref;if(j!==null)if(typeof j=="function")try{j(null)}catch(q){hn(u,f,q)}else j.current=null}function Qr(u,f,j){try{j()}catch(q){hn(u,f,q)}}var Zc=!1;function vh(u,f){for(H(u.containerInfo),Xe=f;Xe!==null;)if(u=Xe,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,Xe=f;else for(;Xe!==null;){u=Xe;try{var j=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var q=j.memoizedProps,Y=j.memoizedState,ne=u.stateNode,le=ne.getSnapshotBeforeUpdate(u.elementType===u.type?q:Kr(u.type,q),Y);ne.__reactInternalSnapshotBeforeUpdate=le}break;case 3:oe&&pn(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ye){hn(u,u.return,ye)}if(f=u.sibling,f!==null){f.return=u.return,Xe=f;break}Xe=u.return}return j=Zc,Zc=!1,j}function No(u,f,j){var q=f.updateQueue;if(q=q!==null?q.lastEffect:null,q!==null){var Y=q=q.next;do{if((Y.tag&u)===u){var ne=Y.destroy;Y.destroy=void 0,ne!==void 0&&Qr(f,j,ne)}Y=Y.next}while(Y!==q)}}function _l(u,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var j=f=f.next;do{if((j.tag&u)===u){var q=j.create;j.destroy=q()}j=j.next}while(j!==f)}}function ku(u){var f=u.ref;if(f!==null){var j=u.stateNode;switch(u.tag){case 5:u=X(j);break;default:u=j}typeof f=="function"?f(u):f.current=u}}function Ss(u){var f=u.alternate;f!==null&&(u.alternate=null,Ss(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&Te(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Qc(u){return u.tag===5||u.tag===3||u.tag===4}function Io(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Qc(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Es(u,f,j){var q=u.tag;if(q===5||q===6)u=u.stateNode,f?Ct(j,u,f):Ke(j,u);else if(q!==4&&(u=u.child,u!==null))for(Es(u,f,j),u=u.sibling;u!==null;)Es(u,f,j),u=u.sibling}function Jc(u,f,j){var q=u.tag;if(q===5||q===6)u=u.stateNode,f?bt(j,u,f):et(j,u);else if(q!==4&&(u=u.child,u!==null))for(Jc(u,f,j),u=u.sibling;u!==null;)Jc(u,f,j),u=u.sibling}var kn=null,Ur=!1;function Pi(u,f,j){for(j=j.child;j!==null;)Au(u,f,j),j=j.sibling}function Au(u,f,j){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(ja,j)}catch{}switch(j.tag){case 5:Kn||Zt(j,f);case 6:if(oe){var q=kn,Y=Ur;kn=null,Pi(u,f,j),kn=q,Ur=Y,kn!==null&&(Ur?Se(kn,j.stateNode):we(kn,j.stateNode))}else Pi(u,f,j);break;case 18:oe&&kn!==null&&(Ur?Ii(kn,j.stateNode):Ir(kn,j.stateNode));break;case 4:oe?(q=kn,Y=Ur,kn=j.stateNode.containerInfo,Ur=!0,Pi(u,f,j),kn=q,Ur=Y):(se&&(q=j.stateNode.containerInfo,Y=rt(q),Ie(q,Y)),Pi(u,f,j));break;case 0:case 11:case 14:case 15:if(!Kn&&(q=j.updateQueue,q!==null&&(q=q.lastEffect,q!==null))){Y=q=q.next;do{var ne=Y,le=ne.destroy;ne=ne.tag,le!==void 0&&(ne&2||ne&4)&&Qr(j,f,le),Y=Y.next}while(Y!==q)}Pi(u,f,j);break;case 1:if(!Kn&&(Zt(j,f),q=j.stateNode,typeof q.componentWillUnmount=="function"))try{q.props=j.memoizedProps,q.state=j.memoizedState,q.componentWillUnmount()}catch(ye){hn(j,f,ye)}Pi(u,f,j);break;case 21:Pi(u,f,j);break;case 22:j.mode&1?(Kn=(q=Kn)||j.memoizedState!==null,Pi(u,f,j),Kn=q):Pi(u,f,j);break;default:Pi(u,f,j)}}function Do(u){var f=u.updateQueue;if(f!==null){u.updateQueue=null;var j=u.stateNode;j===null&&(j=u.stateNode=new Zr),f.forEach(function(q){var Y=Zp.bind(null,u,q);j.has(q)||(j.add(q),q.then(Y,Y))})}}function ci(u,f){var j=f.deletions;if(j!==null)for(var q=0;q<j.length;q++){var Y=j[q];try{var ne=u,le=f;if(oe){var ye=le;e:for(;ye!==null;){switch(ye.tag){case 5:kn=ye.stateNode,Ur=!1;break e;case 3:kn=ye.stateNode.containerInfo,Ur=!0;break e;case 4:kn=ye.stateNode.containerInfo,Ur=!0;break e}ye=ye.return}if(kn===null)throw Error(s(160));Au(ne,le,Y),kn=null,Ur=!1}else Au(ne,le,Y);var Re=Y.alternate;Re!==null&&(Re.return=null),Y.return=null}catch(Ge){hn(Y,f,Ge)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)Os(f,u),f=f.sibling}function Os(u,f){var j=u.alternate,q=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(ci(f,u),Jr(u),q&4){try{No(3,u,u.return),_l(3,u)}catch(Qe){hn(u,u.return,Qe)}try{No(5,u,u.return)}catch(Qe){hn(u,u.return,Qe)}}break;case 1:ci(f,u),Jr(u),q&512&&j!==null&&Zt(j,j.return);break;case 5:if(ci(f,u),Jr(u),q&512&&j!==null&&Zt(j,j.return),oe){if(u.flags&32){var Y=u.stateNode;try{gt(Y)}catch(Qe){hn(u,u.return,Qe)}}if(q&4&&(Y=u.stateNode,Y!=null)){var ne=u.memoizedProps;if(j=j!==null?j.memoizedProps:ne,q=u.type,f=u.updateQueue,u.updateQueue=null,f!==null)try{Ve(Y,f,q,j,ne,u)}catch(Qe){hn(u,u.return,Qe)}}}break;case 6:if(ci(f,u),Jr(u),q&4&&oe){if(u.stateNode===null)throw Error(s(162));Y=u.stateNode,ne=u.memoizedProps,j=j!==null?j.memoizedProps:ne;try{ze(Y,j,ne)}catch(Qe){hn(u,u.return,Qe)}}break;case 3:if(ci(f,u),Jr(u),q&4){if(oe&&de&&j!==null&&j.memoizedState.isDehydrated)try{En(f.containerInfo)}catch(Qe){hn(u,u.return,Qe)}if(se){Y=f.containerInfo,ne=f.pendingChildren;try{Ie(Y,ne)}catch(Qe){hn(u,u.return,Qe)}}}break;case 4:if(ci(f,u),Jr(u),q&4&&se){ne=u.stateNode,Y=ne.containerInfo,ne=ne.pendingChildren;try{Ie(Y,ne)}catch(Qe){hn(u,u.return,Qe)}}break;case 13:ci(f,u),Jr(u),Y=u.child,Y.flags&8192&&(ne=Y.memoizedState!==null,Y.stateNode.isHidden=ne,!ne||Y.alternate!==null&&Y.alternate.memoizedState!==null||(Pl=$n())),q&4&&Do(u);break;case 22:var le=j!==null&&j.memoizedState!==null;if(u.mode&1?(Kn=(j=Kn)||le,ci(f,u),Kn=j):ci(f,u),Jr(u),q&8192){if(j=u.memoizedState!==null,(u.stateNode.isHidden=j)&&!le&&u.mode&1)for(Xe=u,q=u.child;q!==null;){for(f=Xe=q;Xe!==null;){le=Xe;var ye=le.child;switch(le.tag){case 0:case 11:case 14:case 15:No(4,le,le.return);break;case 1:Zt(le,le.return);var Re=le.stateNode;if(typeof Re.componentWillUnmount=="function"){var Ge=le,it=le.return;try{var Ot=Ge;Re.props=Ot.memoizedProps,Re.state=Ot.memoizedState,Re.componentWillUnmount()}catch(Qe){hn(Ge,it,Qe)}}break;case 5:Zt(le,le.return);break;case 22:if(le.memoizedState!==null){Mu(f);continue}}ye!==null?(ye.return=le,Xe=ye):Mu(f)}q=q.sibling}if(oe){e:if(q=null,oe)for(f=u;;){if(f.tag===5){if(q===null){q=f;try{Y=f.stateNode,j?wt(Y):mt(f.stateNode,f.memoizedProps)}catch(Qe){hn(u,u.return,Qe)}}}else if(f.tag===6){if(q===null)try{ne=f.stateNode,j?Pt(ne):Wt(ne,f.memoizedProps)}catch(Qe){hn(u,u.return,Qe)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;q===f&&(q=null),f=f.return}q===f&&(q=null),f.sibling.return=f.return,f=f.sibling}}}break;case 19:ci(f,u),Jr(u),q&4&&Do(u);break;case 21:break;default:ci(f,u),Jr(u)}}function Jr(u){var f=u.flags;if(f&2){try{if(oe){e:{for(var j=u.return;j!==null;){if(Qc(j)){var q=j;break e}j=j.return}throw Error(s(160))}switch(q.tag){case 5:var Y=q.stateNode;q.flags&32&&(gt(Y),q.flags&=-33);var ne=Io(u);Jc(u,ne,Y);break;case 3:case 4:var le=q.stateNode.containerInfo,ye=Io(u);Es(u,ye,le);break;default:throw Error(s(161))}}}catch(Re){hn(u,u.return,Re)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function wl(u,f,j){Xe=u,Tu(u)}function Tu(u,f,j){for(var q=(u.mode&1)!==0;Xe!==null;){var Y=Xe,ne=Y.child;if(Y.tag===22&&q){var le=Y.memoizedState!==null||bl;if(!le){var ye=Y.alternate,Re=ye!==null&&ye.memoizedState!==null||Kn;ye=bl;var Ge=Kn;if(bl=le,(Kn=Re)&&!Ge)for(Xe=Y;Xe!==null;)le=Xe,Re=le.child,le.tag===22&&le.memoizedState!==null?Lu(Y):Re!==null?(Re.return=le,Xe=Re):Lu(Y);for(;ne!==null;)Xe=ne,Tu(ne),ne=ne.sibling;Xe=Y,bl=ye,Kn=Ge}Ru(u)}else Y.subtreeFlags&8772&&ne!==null?(ne.return=Y,Xe=ne):Ru(u)}}function Ru(u){for(;Xe!==null;){var f=Xe;if(f.flags&8772){var j=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:Kn||_l(5,f);break;case 1:var q=f.stateNode;if(f.flags&4&&!Kn)if(j===null)q.componentDidMount();else{var Y=f.elementType===f.type?j.memoizedProps:Kr(f.type,j.memoizedProps);q.componentDidUpdate(Y,j.memoizedState,q.__reactInternalSnapshotBeforeUpdate)}var ne=f.updateQueue;ne!==null&&oh(f,ne,q);break;case 3:var le=f.updateQueue;if(le!==null){if(j=null,f.child!==null)switch(f.child.tag){case 5:j=X(f.child.stateNode);break;case 1:j=f.child.stateNode}oh(f,le,j)}break;case 5:var ye=f.stateNode;j===null&&f.flags&4&&Be(ye,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(de&&f.memoizedState===null){var Re=f.alternate;if(Re!==null){var Ge=Re.memoizedState;if(Ge!==null){var it=Ge.dehydrated;it!==null&&ai(it)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Kn||f.flags&512&&ku(f)}catch(Ot){hn(f,f.return,Ot)}}if(f===u){Xe=null;break}if(j=f.sibling,j!==null){j.return=f.return,Xe=j;break}Xe=f.return}}function Mu(u){for(;Xe!==null;){var f=Xe;if(f===u){Xe=null;break}var j=f.sibling;if(j!==null){j.return=f.return,Xe=j;break}Xe=f.return}}function Lu(u){for(;Xe!==null;){var f=Xe;try{switch(f.tag){case 0:case 11:case 15:var j=f.return;try{_l(4,f)}catch(Re){hn(f,j,Re)}break;case 1:var q=f.stateNode;if(typeof q.componentDidMount=="function"){var Y=f.return;try{q.componentDidMount()}catch(Re){hn(f,Y,Re)}}var ne=f.return;try{ku(f)}catch(Re){hn(f,ne,Re)}break;case 5:var le=f.return;try{ku(f)}catch(Re){hn(f,le,Re)}}}catch(Re){hn(f,f.return,Re)}if(f===u){Xe=null;break}var ye=f.sibling;if(ye!==null){ye.return=f.return,Xe=ye;break}Xe=f.return}}var da=0,kr=1,Hi=2,Sl=3,xs=4;if(typeof Symbol=="function"&&Symbol.for){var ei=Symbol.for;da=ei("selector.component"),kr=ei("selector.has_pseudo_class"),Hi=ei("selector.role"),Sl=ei("selector.test_id"),xs=ei("selector.text")}function Gi(u){var f=pe(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(s(364));return f}if(u=Le(u),u===null)throw Error(s(362));return u.stateNode.current}function Ps(u,f){switch(f.$$typeof){case da:if(u.type===f.value)return!0;break;case kr:e:{f=f.value,u=[u,0];for(var j=0;j<u.length;){var q=u[j++],Y=u[j++],ne=f[Y];if(q.tag!==5||!xe(q)){for(;ne!=null&&Ps(q,ne);)Y++,ne=f[Y];if(Y===f.length){f=!0;break e}else for(q=q.child;q!==null;)u.push(q,Y),q=q.sibling}}f=!1}return f;case Hi:if(u.tag===5&&je(u.stateNode,f.value))return!0;break;case xs:if((u.tag===5||u.tag===6)&&(u=me(u),u!==null&&0<=u.indexOf(f.value)))return!0;break;case Sl:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(s(365))}return!1}function Nu(u){switch(u.$$typeof){case da:return"<"+(R(u.value)||"Unknown")+">";case kr:return":has("+(Nu(u)||"")+")";case Hi:return'[role="'+u.value+'"]';case xs:return'"'+u.value+'"';case Sl:return'[data-testname="'+u.value+'"]';default:throw Error(s(365))}}function Vi(u,f){var j=[];u=[u,0];for(var q=0;q<u.length;){var Y=u[q++],ne=u[q++],le=f[ne];if(Y.tag!==5||!xe(Y)){for(;le!=null&&Ps(Y,le);)ne++,le=f[ne];if(ne===f.length)j.push(Y);else for(Y=Y.child;Y!==null;)u.push(Y,ne),Y=Y.sibling}}return j}function $i(u,f){if(!Ce)throw Error(s(363));u=Gi(u),u=Vi(u,f),f=[],u=Array.from(u);for(var j=0;j<u.length;){var q=u[j++];if(q.tag===5)xe(q)||f.push(q.stateNode);else for(q=q.child;q!==null;)u.push(q),q=q.sibling}return f}var Iu=Math.ceil,Cs=c.ReactCurrentDispatcher,El=c.ReactCurrentOwner,Pn=c.ReactCurrentBatchConfig,kt=0,nn=null,vn=null,An=0,zn=0,Qa=er(0),yn=0,Ol=null,ha=0,ln=0,xl=0,jo=null,pr=null,Pl=0,ks=1/0,Ar=null;function Jt(){ks=$n()+500}var Cn=!1,Mn=null,Ci=null,Ja=!1,fi=null,Du=0,Ln=0,As=null,Cl=-1,kl=0;function dn(){return kt&6?$n():Cl!==-1?Cl:Cl=$n()}function Bn(u){return u.mode&1?kt&2&&An!==0?An&-An:Yp.transition!==null?(kl===0&&(kl=eu()),kl):(u=Dt,u!==0?u:_e()):1}function gr(u,f,j,q){if(50<Ln)throw Ln=0,As=null,Error(s(185));oi(u,j,q),(!(kt&2)||u!==nn)&&(u===nn&&(!(kt&2)&&(ln|=j),yn===4&&pa(u,An)),mr(u,q),j===1&&kt===0&&!(f.mode&1)&&(Jt(),ll&&tr()))}function mr(u,f){var j=u.callbackNode;Wd(u,f);var q=rl(u,u===nn?An:0);if(q===0)j!==null&&Yd(j),u.callbackNode=null,u.callbackPriority=0;else if(f=q&-q,u.callbackPriority!==f){if(j!=null&&Yd(j),f===1)u.tag===0?Xd(ef.bind(null,u)):au(ef.bind(null,u)),ce?he(function(){!(kt&6)&&tr()}):Fi(tu,tr),j=null;else{switch(al(q)){case 1:j=tu;break;case 4:j=nu;break;case 16:j=ru;break;case 536870912:j=Wp;break;default:j=ru}j=sf(j,ju.bind(null,u))}u.callbackPriority=f,u.callbackNode=j}}function ju(u,f){if(Cl=-1,kl=0,kt&6)throw Error(s(327));var j=u.callbackNode;if(ga()&&u.callbackNode!==j)return null;var q=rl(u,u===nn?An:0);if(q===0)return null;if(q&30||q&u.expiredLanes||f)f=Fo(u,q);else{f=q;var Y=kt;kt|=2;var ne=nf();(nn!==u||An!==f)&&(Ar=null,Jt(),eo(u,f));do try{rf();break}catch(ye){Al(u,ye)}while(!0);Tc(),Cs.current=ne,kt=Y,vn!==null?f=0:(nn=null,An=0,f=yn)}if(f!==0){if(f===2&&(Y=Js(u),Y!==0&&(q=Y,f=Fu(u,Y))),f===1)throw j=Ol,eo(u,0),pa(u,q),mr(u,$n()),j;if(f===6)pa(u,q);else{if(Y=u.current.alternate,!(q&30)&&!yh(Y)&&(f=Fo(u,q),f===2&&(ne=Js(u),ne!==0&&(q=ne,f=Fu(u,ne))),f===1))throw j=Ol,eo(u,0),pa(u,q),mr(u,$n()),j;switch(u.finishedWork=Y,u.finishedLanes=q,f){case 0:case 1:throw Error(s(345));case 2:to(u,pr,Ar);break;case 3:if(pa(u,q),(q&130023424)===q&&(f=Pl+500-$n(),10<f)){if(rl(u,0)!==0)break;if(Y=u.suspendedLanes,(Y&q)!==q){dn(),u.pingedLanes|=u.suspendedLanes&Y;break}u.timeoutHandle=W(to.bind(null,u,pr,Ar),f);break}to(u,pr,Ar);break;case 4:if(pa(u,q),(q&4194240)===q)break;for(f=u.eventTimes,Y=-1;0<q;){var le=31-Gr(q);ne=1<<le,le=f[le],le>Y&&(Y=le),q&=~ne}if(q=Y,q=$n()-q,q=(120>q?120:480>q?480:1080>q?1080:1920>q?1920:3e3>q?3e3:4320>q?4320:1960*Iu(q/1960))-q,10<q){u.timeoutHandle=W(to.bind(null,u,pr,Ar),q);break}to(u,pr,Ar);break;case 5:to(u,pr,Ar);break;default:throw Error(s(329))}}}return mr(u,$n()),u.callbackNode===j?ju.bind(null,u):null}function Fu(u,f){var j=jo;return u.current.memoizedState.isDehydrated&&(eo(u,f).flags|=256),u=Fo(u,f),u!==2&&(f=pr,pr=j,f!==null&&zu(f)),u}function zu(u){pr===null?pr=u:pr.push.apply(pr,u)}function yh(u){for(var f=u;;){if(f.flags&16384){var j=f.updateQueue;if(j!==null&&(j=j.stores,j!==null))for(var q=0;q<j.length;q++){var Y=j[q],ne=Y.getSnapshot;Y=Y.value;try{if(!wi(ne(),Y))return!1}catch{return!1}}}if(j=f.child,f.subtreeFlags&16384&&j!==null)j.return=f,f=j;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function pa(u,f){for(f&=~xl,f&=~ln,u.suspendedLanes|=f,u.pingedLanes&=~f,u=u.expirationTimes;0<f;){var j=31-Gr(f),q=1<<j;u[j]=-1,f&=~q}}function ef(u){if(kt&6)throw Error(s(327));ga();var f=rl(u,0);if(!(f&1))return mr(u,$n()),null;var j=Fo(u,f);if(u.tag!==0&&j===2){var q=Js(u);q!==0&&(f=q,j=Fu(u,q))}if(j===1)throw j=Ol,eo(u,0),pa(u,f),mr(u,$n()),j;if(j===6)throw Error(s(345));return u.finishedWork=u.current.alternate,u.finishedLanes=f,to(u,pr,Ar),mr(u,$n()),null}function tf(u){fi!==null&&fi.tag===0&&!(kt&6)&&ga();var f=kt;kt|=1;var j=Pn.transition,q=Dt;try{if(Pn.transition=null,Dt=1,u)return u()}finally{Dt=q,Pn.transition=j,kt=f,!(kt&6)&&tr()}}function Bu(){zn=Qa.current,cn(Qa)}function eo(u,f){u.finishedWork=null,u.finishedLanes=0;var j=u.timeoutHandle;if(j!==re&&(u.timeoutHandle=re,te(j)),vn!==null)for(j=vn.return;j!==null;){var q=j;switch(us(q),q.tag){case 1:q=q.type.childContextTypes,q!=null&&po();break;case 3:_o(),cn(jr),cn(fr),Dc();break;case 5:Nc(q);break;case 4:_o();break;case 13:cn(On);break;case 19:cn(On);break;case 10:fs(q.type._context);break;case 22:case 23:Bu()}j=j.return}if(nn=u,vn=u=no(u.current,null),An=zn=f,yn=0,Ol=null,xl=ln=ha=0,pr=jo=null,za!==null){for(f=0;f<za.length;f++)if(j=za[f],q=j.interleaved,q!==null){j.interleaved=null;var Y=q.next,ne=j.pending;if(ne!==null){var le=ne.next;ne.next=Y,q.next=le}j.pending=q}za=null}return u}function Al(u,f){do{var j=vn;try{if(Tc(),Br.current=Co,hl){for(var q=gn.memoizedState;q!==null;){var Y=q.queue;Y!==null&&(Y.pending=null),q=q.next}hl=!1}if(Ha=0,jn=Rn=gn=null,hs=!1,ps=0,El.current=null,j===null||j.return===null){yn=1,Ol=f,vn=null;break}e:{var ne=u,le=j.return,ye=j,Re=f;if(f=An,ye.flags|=32768,Re!==null&&typeof Re=="object"&&typeof Re.then=="function"){var Ge=Re,it=ye,Ot=it.tag;if(!(it.mode&1)&&(Ot===0||Ot===11||Ot===15)){var Qe=it.alternate;Qe?(it.updateQueue=Qe.updateQueue,it.memoizedState=Qe.memoizedState,it.lanes=Qe.lanes):(it.updateQueue=null,it.memoizedState=null)}var sn=ph(le);if(sn!==null){sn.flags&=-257,$a(sn,le,ye,ne,f),sn.mode&1&&hh(ne,Ge,f),f=sn,Re=Ge;var Qt=f.updateQueue;if(Qt===null){var Tr=new Set;Tr.add(Re),f.updateQueue=Tr}else Qt.add(Re);break e}else{if(!(f&1)){hh(ne,Ge,f),Tl();break e}Re=Error(s(426))}}else if(fn&&ye.mode&1){var Wi=ph(le);if(Wi!==null){!(Wi.flags&65536)&&(Wi.flags|=256),$a(Wi,le,ye,ne,f),kc(ko(Re,ye));break e}}ne=Re=ko(Re,ye),yn!==4&&(yn=2),jo===null?jo=[ne]:jo.push(ne),ne=le;do{switch(ne.tag){case 3:ne.flags|=65536,f&=-f,ne.lanes|=f;var ke=Bi(ne,Re,f);fl(ne,ke);break e;case 1:ye=Re;var be=ne.type,Ne=ne.stateNode;if(!(ne.flags&128)&&(typeof be.getDerivedStateFromError=="function"||Ne!==null&&typeof Ne.componentDidCatch=="function"&&(Ci===null||!Ci.has(Ne)))){ne.flags|=65536,f&=-f,ne.lanes|=f;var Je=Ou(ne,ye,f);fl(ne,Je);break e}}ne=ne.return}while(ne!==null)}of(j)}catch(pt){f=pt,vn===j&&j!==null&&(vn=j=j.return);continue}break}while(!0)}function nf(){var u=Cs.current;return Cs.current=Co,u===null?Co:u}function Tl(){(yn===0||yn===3||yn===2)&&(yn=4),nn===null||!(ha&268435455)&&!(ln&268435455)||pa(nn,An)}function Fo(u,f){var j=kt;kt|=2;var q=nf();(nn!==u||An!==f)&&(Ar=null,eo(u,f));do try{bh();break}catch(Y){Al(u,Y)}while(!0);if(Tc(),kt=j,Cs.current=q,vn!==null)throw Error(s(261));return nn=null,An=0,yn}function bh(){for(;vn!==null;)af(vn)}function rf(){for(;vn!==null&&!Kd();)af(vn)}function af(u){var f=Oh(u.alternate,u,zn);u.memoizedProps=u.pendingProps,f===null?of(u):vn=f,El.current=null}function of(u){var f=u;do{var j=f.alternate;if(u=f.return,f.flags&32768){if(j=mh(j,f),j!==null){j.flags&=32767,vn=j;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{yn=6,vn=null;return}}else if(j=Lo(j,f,zn),j!==null){vn=j;return}if(f=f.sibling,f!==null){vn=f;return}vn=f=u}while(f!==null);yn===0&&(yn=5)}function to(u,f,j){var q=Dt,Y=Pn.transition;try{Pn.transition=null,Dt=1,_h(u,f,j,q)}finally{Pn.transition=Y,Dt=q}return null}function _h(u,f,j,q){do ga();while(fi!==null);if(kt&6)throw Error(s(327));j=u.finishedWork;var Y=u.finishedLanes;if(j===null)return null;if(u.finishedWork=null,u.finishedLanes=0,j===u.current)throw Error(s(177));u.callbackNode=null,u.callbackPriority=0;var ne=j.lanes|j.childLanes;if(Da(u,ne),u===nn&&(vn=nn=null,An=0),!(j.subtreeFlags&2064)&&!(j.flags&2064)||Ja||(Ja=!0,sf(ru,function(){return ga(),null})),ne=(j.flags&15990)!==0,j.subtreeFlags&15990||ne){ne=Pn.transition,Pn.transition=null;var le=Dt;Dt=1;var ye=kt;kt|=4,El.current=null,vh(u,j),Os(j,u),z(u.containerInfo),u.current=j,wl(j),os(),kt=ye,Dt=le,Pn.transition=ne}else u.current=j;if(Ja&&(Ja=!1,fi=u,Du=Y),ne=u.pendingLanes,ne===0&&(Ci=null),ol(j.stateNode),mr(u,$n()),f!==null)for(q=u.onRecoverableError,j=0;j<f.length;j++)Y=f[j],q(Y.value,{componentStack:Y.stack,digest:Y.digest});if(Cn)throw Cn=!1,u=Mn,Mn=null,u;return Du&1&&u.tag!==0&&ga(),ne=u.pendingLanes,ne&1?u===As?Ln++:(Ln=0,As=u):Ln=0,tr(),null}function ga(){if(fi!==null){var u=al(Du),f=Pn.transition,j=Dt;try{if(Pn.transition=null,Dt=16>u?16:u,fi===null)var q=!1;else{if(u=fi,fi=null,Du=0,kt&6)throw Error(s(331));var Y=kt;for(kt|=4,Xe=u.current;Xe!==null;){var ne=Xe,le=ne.child;if(Xe.flags&16){var ye=ne.deletions;if(ye!==null){for(var Re=0;Re<ye.length;Re++){var Ge=ye[Re];for(Xe=Ge;Xe!==null;){var it=Xe;switch(it.tag){case 0:case 11:case 15:No(8,it,ne)}var Ot=it.child;if(Ot!==null)Ot.return=it,Xe=Ot;else for(;Xe!==null;){it=Xe;var Qe=it.sibling,sn=it.return;if(Ss(it),it===Ge){Xe=null;break}if(Qe!==null){Qe.return=sn,Xe=Qe;break}Xe=sn}}}var Qt=ne.alternate;if(Qt!==null){var Tr=Qt.child;if(Tr!==null){Qt.child=null;do{var Wi=Tr.sibling;Tr.sibling=null,Tr=Wi}while(Tr!==null)}}Xe=ne}}if(ne.subtreeFlags&2064&&le!==null)le.return=ne,Xe=le;else e:for(;Xe!==null;){if(ne=Xe,ne.flags&2048)switch(ne.tag){case 0:case 11:case 15:No(9,ne,ne.return)}var ke=ne.sibling;if(ke!==null){ke.return=ne.return,Xe=ke;break e}Xe=ne.return}}var be=u.current;for(Xe=be;Xe!==null;){le=Xe;var Ne=le.child;if(le.subtreeFlags&2064&&Ne!==null)Ne.return=le,Xe=Ne;else e:for(le=be;Xe!==null;){if(ye=Xe,ye.flags&2048)try{switch(ye.tag){case 0:case 11:case 15:_l(9,ye)}}catch(pt){hn(ye,ye.return,pt)}if(ye===le){Xe=null;break e}var Je=ye.sibling;if(Je!==null){Je.return=ye.return,Xe=Je;break e}Xe=ye.return}}if(kt=Y,tr(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(ja,u)}catch{}q=!0}return q}finally{Dt=j,Pn.transition=f}}return!1}function lf(u,f,j){f=ko(j,f),f=Bi(u,f,1),u=sa(u,f,1),f=dn(),u!==null&&(oi(u,1,f),mr(u,f))}function hn(u,f,j){if(u.tag===3)lf(u,u,j);else for(;f!==null;){if(f.tag===3){lf(f,u,j);break}else if(f.tag===1){var q=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof q.componentDidCatch=="function"&&(Ci===null||!Ci.has(q))){u=ko(j,u),u=Ou(f,u,1),f=sa(f,u,1),u=dn(),f!==null&&(oi(f,1,u),mr(f,u));break}}f=f.return}}function wh(u,f,j){var q=u.pingCache;q!==null&&q.delete(f),f=dn(),u.pingedLanes|=u.suspendedLanes&j,nn===u&&(An&j)===j&&(yn===4||yn===3&&(An&130023424)===An&&500>$n()-Pl?eo(u,0):xl|=j),mr(u,f)}function Sh(u,f){f===0&&(u.mode&1?(f=as,as<<=1,!(as&130023424)&&(as=4194304)):f=1);var j=dn();u=xi(u,f),u!==null&&(oi(u,f,j),mr(u,j))}function Eh(u){var f=u.memoizedState,j=0;f!==null&&(j=f.retryLane),Sh(u,j)}function Zp(u,f){var j=0;switch(u.tag){case 13:var q=u.stateNode,Y=u.memoizedState;Y!==null&&(j=Y.retryLane);break;case 19:q=u.stateNode;break;default:throw Error(s(314))}q!==null&&q.delete(f),Sh(u,j)}var Oh;Oh=function(u,f,j){if(u!==null)if(u.memoizedProps!==f.pendingProps||jr.current)Fn=!0;else{if(!(u.lanes&j)&&!(f.flags&128))return Fn=!1,Ya(u,f,j);Fn=!!(u.flags&131072)}else Fn=!1,fn&&f.flags&1048576&&Zd(f,go,f.index);switch(f.lanes=0,f.tag){case 2:var q=f.type;ws(u,f),u=f.pendingProps;var Y=ia(f,fr.current);cl(f,j),Y=gs(null,f,q,u,Y,j);var ne=gu();return f.flags|=1,typeof Y=="object"&&Y!==null&&typeof Y.render=="function"&&Y.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Vn(q)?(ne=!0,tl(f)):ne=!1,f.memoizedState=Y.state!==null&&Y.state!==void 0?Y.state:null,Mc(f),Y.updater=ys,f.stateNode=Y,Y._reactInternals=f,zi(f,q,u,j),f=dr(null,f,q,!0,ne,j)):(f.tag=0,fn&&ne&&ss(f),Yn(null,f,Y,j),f=f.child),f;case 16:q=f.elementType;e:{switch(ws(u,f),u=f.pendingProps,Y=q._init,q=Y(q._payload),f.type=q,Y=f.tag=Qp(q),u=Kr(q,u),Y){case 0:f=Ui(null,f,q,u,j);break e;case 1:f=ir(null,f,q,u,j);break e;case 11:f=xu(null,f,q,u,j);break e;case 14:f=Ao(null,f,q,Kr(q.type,u),j);break e}throw Error(s(306,q,""))}return f;case 0:return q=f.type,Y=f.pendingProps,Y=f.elementType===q?Y:Kr(q,Y),Ui(u,f,q,Y,j);case 1:return q=f.type,Y=f.pendingProps,Y=f.elementType===q?Y:Kr(q,Y),ir(u,f,q,Y,j);case 3:e:{if(Wa(f),u===null)throw Error(s(387));q=f.pendingProps,ne=f.memoizedState,Y=ne.element,ah(u,f),Ba(f,q,null,j);var le=f.memoizedState;if(q=le.element,de&&ne.isDehydrated)if(ne={element:q,isDehydrated:!1,cache:le.cache,pendingSuspenseBoundaries:le.pendingSuspenseBoundaries,transitions:le.transitions},f.updateQueue.baseState=ne,f.memoizedState=ne,f.flags&256){Y=ko(Error(s(423)),f),f=To(u,f,q,j,Y);break e}else if(q!==Y){Y=ko(Error(s(424)),f),f=To(u,f,q,j,Y);break e}else for(de&&(Or=Et(f.stateNode.containerInfo),nr=f,fn=!0,Oi=null,cs=!1),j=rh(f,null,q,j),f.child=j;j;)j.flags=j.flags&-3|4096,j=j.sibling;else{if(mo(),q===Y){f=fa(u,f,j);break e}Yn(u,f,q,j)}f=f.child}return f;case 5:return Lc(f),u===null&&Cc(f),q=f.type,Y=f.pendingProps,ne=u!==null?u.memoizedProps:null,le=Y.children,G(q,Y)?le=null:ne!==null&&G(q,ne)&&(f.flags|=32),tn(u,f),Yn(u,f,le,j),f.child;case 6:return u===null&&Cc(f),null;case 13:return Xc(u,f,j);case 4:return hu(f,f.stateNode.containerInfo),q=f.pendingProps,u===null?f.child=yo(f,null,q,j):Yn(u,f,q,j),f.child;case 11:return q=f.type,Y=f.pendingProps,Y=f.elementType===q?Y:Kr(q,Y),xu(u,f,q,Y,j);case 7:return Yn(u,f,f.pendingProps,j),f.child;case 8:return Yn(u,f,f.pendingProps.children,j),f.child;case 12:return Yn(u,f,f.pendingProps.children,j),f.child;case 10:e:{if(q=f.type._context,Y=f.pendingProps,ne=f.memoizedProps,le=Y.value,ih(f,q,le),ne!==null)if(wi(ne.value,le)){if(ne.children===Y.children&&!jr.current){f=fa(u,f,j);break e}}else for(ne=f.child,ne!==null&&(ne.return=f);ne!==null;){var ye=ne.dependencies;if(ye!==null){le=ne.child;for(var Re=ye.firstContext;Re!==null;){if(Re.context===q){if(ne.tag===1){Re=la(-1,j&-j),Re.tag=2;var Ge=ne.updateQueue;if(Ge!==null){Ge=Ge.shared;var it=Ge.pending;it===null?Re.next=Re:(Re.next=it.next,it.next=Re),Ge.pending=Re}}ne.lanes|=j,Re=ne.alternate,Re!==null&&(Re.lanes|=j),bo(ne.return,j,f),ye.lanes|=j;break}Re=Re.next}}else if(ne.tag===10)le=ne.type===f.type?null:ne.child;else if(ne.tag===18){if(le=ne.return,le===null)throw Error(s(341));le.lanes|=j,ye=le.alternate,ye!==null&&(ye.lanes|=j),bo(le,j,f),le=ne.sibling}else le=ne.child;if(le!==null)le.return=ne;else for(le=ne;le!==null;){if(le===f){le=null;break}if(ne=le.sibling,ne!==null){ne.return=le.return,le=ne;break}le=le.return}ne=le}Yn(u,f,Y.children,j),f=f.child}return f;case 9:return Y=f.type,q=f.pendingProps.children,cl(f,j),Y=$r(Y),q=q(Y),f.flags|=1,Yn(u,f,q,j),f.child;case 14:return q=f.type,Y=Kr(q,f.pendingProps),Y=Kr(q.type,Y),Ao(u,f,q,Y,j);case 15:return ca(u,f,f.type,f.pendingProps,j);case 17:return q=f.type,Y=f.pendingProps,Y=f.elementType===q?Y:Kr(q,Y),ws(u,f),f.tag=1,Vn(q)?(u=!0,tl(f)):u=!1,cl(f,j),dh(f,q,Y),zi(f,q,Y,j),dr(null,f,q,!0,u,j);case 19:return Cu(u,f,j);case 22:return on(u,f,j)}throw Error(s(156,f.tag))};function sf(u,f){return Fi(u,f)}function xh(u,f,j,q){this.tag=u,this.key=j,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=q,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ti(u,f,j,q){return new xh(u,f,j,q)}function Rl(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Qp(u){if(typeof u=="function")return Rl(u)?1:0;if(u!=null){if(u=u.$$typeof,u===p)return 11;if(u===g)return 14}return 2}function no(u,f){var j=u.alternate;return j===null?(j=ti(u.tag,f,u.key,u.mode),j.elementType=u.elementType,j.type=u.type,j.stateNode=u.stateNode,j.alternate=u,u.alternate=j):(j.pendingProps=f,j.type=u.type,j.flags=0,j.subtreeFlags=0,j.deletions=null),j.flags=u.flags&14680064,j.childLanes=u.childLanes,j.lanes=u.lanes,j.child=u.child,j.memoizedProps=u.memoizedProps,j.memoizedState=u.memoizedState,j.updateQueue=u.updateQueue,f=u.dependencies,j.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},j.sibling=u.sibling,j.index=u.index,j.ref=u.ref,j}function Uu(u,f,j,q,Y,ne){var le=2;if(q=u,typeof u=="function")Rl(u)&&(le=1);else if(typeof u=="string")le=5;else e:switch(u){case w:return ar(j.children,Y,ne,f);case E:le=8,Y|=8;break;case x:return u=ti(12,j,f,Y|2),u.elementType=x,u.lanes=ne,u;case h:return u=ti(13,j,f,Y),u.elementType=h,u.lanes=ne,u;case P:return u=ti(19,j,f,Y),u.elementType=P,u.lanes=ne,u;case y:return Ml(j,Y,ne,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case m:le=10;break e;case _:le=9;break e;case p:le=11;break e;case g:le=14;break e;case v:le=16,q=null;break e}throw Error(s(130,u==null?u:typeof u,""))}return f=ti(le,j,f,Y),f.elementType=u,f.type=q,f.lanes=ne,f}function ar(u,f,j,q){return u=ti(7,u,q,f),u.lanes=j,u}function Ml(u,f,j,q){return u=ti(22,u,q,f),u.elementType=y,u.lanes=j,u.stateNode={isHidden:!1},u}function Ll(u,f,j){return u=ti(6,u,null,f),u.lanes=j,u}function qu(u,f,j){return f=ti(4,u.children!==null?u.children:[],u.key,f),f.lanes=j,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function Ph(u,f,j,q,Y){this.tag=f,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=re,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=il(0),this.expirationTimes=il(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=il(0),this.identifierPrefix=q,this.onRecoverableError=Y,de&&(this.mutableSourceEagerHydrationData=null)}function uf(u,f,j,q,Y,ne,le,ye,Re){return u=new Ph(u,f,j,ye,Re),f===1?(f=1,ne===!0&&(f|=8)):f=0,ne=ti(3,null,null,f),u.current=ne,ne.stateNode=u,ne.memoizedState={element:q,isDehydrated:j,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mc(ne),u}function Hu(u){if(!u)return Ia;u=u._reactInternals;e:{if(T(u)!==u||u.tag!==1)throw Error(s(170));var f=u;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Vn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(s(171))}if(u.tag===1){var j=u.type;if(Vn(j))return Vd(u,j,f)}return f}function zo(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(s(188)):(u=Object.keys(u).join(","),Error(s(268,u)));return u=N(f),u===null?null:u.stateNode}function Gu(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var j=u.retryLane;u.retryLane=j!==0&&j<f?j:f}}function Nl(u,f){Gu(u,f),(u=u.alternate)&&Gu(u,f)}function Jp(u){return u=N(u),u===null?null:u.stateNode}function Ch(){return null}return t.attemptContinuousHydration=function(u){if(u.tag===13){var f=xi(u,134217728);if(f!==null){var j=dn();gr(f,u,134217728,j)}Nl(u,134217728)}},t.attemptDiscreteHydration=function(u){if(u.tag===13){var f=xi(u,1);if(f!==null){var j=dn();gr(f,u,1,j)}Nl(u,1)}},t.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var f=Bn(u),j=xi(u,f);if(j!==null){var q=dn();gr(j,u,f,q)}Nl(u,f)}},t.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var f=u.stateNode;if(f.current.memoizedState.isDehydrated){var j=nl(f.pendingLanes);j!==0&&(ji(f,j|1),mr(f,$n()),!(kt&6)&&(Jt(),tr()))}break;case 13:tf(function(){var q=xi(u,1);if(q!==null){var Y=dn();gr(q,u,1,Y)}}),Nl(u,1)}},t.batchedUpdates=function(u,f){var j=kt;kt|=1;try{return u(f)}finally{kt=j,kt===0&&(Jt(),ll&&tr())}},t.createComponentSelector=function(u){return{$$typeof:da,value:u}},t.createContainer=function(u,f,j,q,Y,ne,le){return uf(u,f,!1,null,j,q,Y,ne,le)},t.createHasPseudoClassSelector=function(u){return{$$typeof:kr,value:u}},t.createHydrationContainer=function(u,f,j,q,Y,ne,le,ye,Re){return u=uf(j,q,!0,u,Y,ne,le,ye,Re),u.context=Hu(null),j=u.current,q=dn(),Y=Bn(j),ne=la(q,Y),ne.callback=f??null,sa(j,ne,Y),u.current.lanes=Y,oi(u,Y,q),mr(u,q),u},t.createPortal=function(u,f,j){var q=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:b,key:q==null?null:""+q,children:u,containerInfo:f,implementation:j}},t.createRoleSelector=function(u){return{$$typeof:Hi,value:u}},t.createTestNameSelector=function(u){return{$$typeof:Sl,value:u}},t.createTextSelector=function(u){return{$$typeof:xs,value:u}},t.deferredUpdates=function(u){var f=Dt,j=Pn.transition;try{return Pn.transition=null,Dt=16,u()}finally{Dt=f,Pn.transition=j}},t.discreteUpdates=function(u,f,j,q,Y){var ne=Dt,le=Pn.transition;try{return Pn.transition=null,Dt=1,u(f,j,q,Y)}finally{Dt=ne,Pn.transition=le,kt===0&&Jt()}},t.findAllNodes=$i,t.findBoundingRects=function(u,f){if(!Ce)throw Error(s(363));f=$i(u,f),u=[];for(var j=0;j<f.length;j++)u.push(ue(f[j]));for(f=u.length-1;0<f;f--){j=u[f];for(var q=j.x,Y=q+j.width,ne=j.y,le=ne+j.height,ye=f-1;0<=ye;ye--)if(f!==ye){var Re=u[ye],Ge=Re.x,it=Ge+Re.width,Ot=Re.y,Qe=Ot+Re.height;if(q>=Ge&&ne>=Ot&&Y<=it&&le<=Qe){u.splice(f,1);break}else if(q!==Ge||j.width!==Re.width||Qe<ne||Ot>le){if(!(ne!==Ot||j.height!==Re.height||it<q||Ge>Y)){Ge>q&&(Re.width+=Ge-q,Re.x=q),it<Y&&(Re.width=Y-Ge),u.splice(f,1);break}}else{Ot>ne&&(Re.height+=Ot-ne,Re.y=ne),Qe<le&&(Re.height=le-Ot),u.splice(f,1);break}}}return u},t.findHostInstance=zo,t.findHostInstanceWithNoPortals=function(u){return u=A(u),u=u!==null?L(u):null,u===null?null:u.stateNode},t.findHostInstanceWithWarning=function(u){return zo(u)},t.flushControlled=function(u){var f=kt;kt|=1;var j=Pn.transition,q=Dt;try{Pn.transition=null,Dt=1,u()}finally{Dt=q,Pn.transition=j,kt=f,kt===0&&(Jt(),tr())}},t.flushPassiveEffects=ga,t.flushSync=tf,t.focusWithin=function(u,f){if(!Ce)throw Error(s(363));for(u=Gi(u),f=Vi(u,f),f=Array.from(f),u=0;u<f.length;){var j=f[u++];if(!xe(j)){if(j.tag===5&&ot(j.stateNode))return!0;for(j=j.child;j!==null;)f.push(j),j=j.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Dt},t.getFindAllNodesFailureDescription=function(u,f){if(!Ce)throw Error(s(363));var j=0,q=[];u=[Gi(u),0];for(var Y=0;Y<u.length;){var ne=u[Y++],le=u[Y++],ye=f[le];if((ne.tag!==5||!xe(ne))&&(Ps(ne,ye)&&(q.push(Nu(ye)),le++,le>j&&(j=le)),le<f.length))for(ne=ne.child;ne!==null;)u.push(ne,le),ne=ne.sibling}if(j<f.length){for(u=[];j<f.length;j++)u.push(Nu(f[j]));return`findAllNodes was able to match part of the selector:
58
+ `+(q.join(" > ")+`
59
+
60
+ No matching component was found for:
61
+ `)+u.join(" > ")}return null},t.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return X(u.child.stateNode);default:return u.child.stateNode}},t.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:Jp,findFiberByHostInstance:u.findFiberByHostInstance||Ch,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{ja=f.inject(u),Fr=f}catch{}u=!!f.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,f,j,q){if(!Ce)throw Error(s(363));u=$i(u,f);var Y=ht(u,j,q).disconnect;return{disconnect:function(){Y()}}},t.registerMutableSourceForHydration=function(u,f){var j=f._getVersion;j=j(f._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[f,j]:u.mutableSourceEagerHydrationData.push(f,j)},t.runWithPriority=function(u,f){var j=Dt;try{return Dt=u,f()}finally{Dt=j}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,f,j,q){var Y=f.current,ne=dn(),le=Bn(Y);return j=Hu(j),f.context===null?f.context=j:f.pendingContext=j,f=la(ne,le),f.payload={element:u},q=q===void 0?null:q,q!==null&&(f.callback=q),u=sa(Y,f,le),u!==null&&(gr(u,Y,le,ne),ds(u,Y,le)),le},t}),Vg}var Wy;function m9(){return Wy||(Wy=1,Gg.exports=g9()),Gg.exports}var v9=m9();const y9=Rd(v9);var $g={exports:{}},Hl={};/**
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
+ */var Yy;function b9(){return Yy||(Yy=1,Hl.ConcurrentRoot=1,Hl.ContinuousEventPriority=4,Hl.DefaultEventPriority=16,Hl.DiscreteEventPriority=1,Hl.IdleEventPriority=536870912,Hl.LegacyRoot=0),Hl}var Ky;function _9(){return Ky||(Ky=1,$g.exports=b9()),$g.exports}var $_=_9(),w9=Nt();const Xy={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Zy=!1,Qy=!1;const ym=".react-konva-event";let W_=!1;function S9(e){W_=e}const E9=`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
+ `,O9=`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
+ `,x9={};function Ip(e,i,t=x9){if(!Zy&&"zIndex"in i&&(console.warn(O9),Zy=!0),!Qy&&i.draggable){var n=i.x!==void 0||i.y!==void 0,o=i.onDragEnd||i.onDragMove;n&&!o&&(console.warn(E9),Qy=!0)}for(var l in t)if(!Xy[l]){var s=l.slice(0,2)==="on",c=t[l]!==i[l];if(s&&c){var d=l.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),e.off(d,t[l])}var b=!i.hasOwnProperty(l);b&&e.setAttr(l,void 0)}var w=W_||i._useStrictMode,E={},x=!1;const m={};for(var l in i)if(!Xy[l]){var s=l.slice(0,2)==="on",_=t[l]!==i[l];if(s&&_){var d=l.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),i[l]&&(m[d]=i[l])}!s&&(i[l]!==t[l]||w&&i[l]!==e.getAttr(l))&&(x=!0,E[l]=i[l])}x&&(e.setAttrs(E),es(e));for(var d in m)e.on(d+ym,m[d])}function es(e){if(!w9.Konva.autoDrawEnabled){var i=e.getLayer()||e.getStage();i&&i.batchDraw()}}var Wg=$0();const Y_={},P9={};Pd.Node.prototype._applyProps=Ip;function C9(e,i){if(typeof i=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${i}`);return}e.add(i),es(e)}function k9(e,i,t){let n=Pd[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=Pd.Group);const o={},l={};for(var s in i){var c=s.slice(0,2)==="on";c?l[s]=i[s]:o[s]=i[s]}const d=new n(o);return Ip(d,l),d}function A9(e,i,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function T9(e,i,t){return!1}function R9(e){return e}function M9(){return null}function L9(){return null}function N9(e,i,t,n){return P9}function I9(){}function D9(e){}function j9(e,i){return!1}function F9(){return Y_}function z9(){return Y_}const B9=setTimeout,U9=clearTimeout,q9=-1;function H9(e,i){return!1}const G9=!1,V9=!0,$9=!0;function W9(e,i){i.parent===e?i.moveToTop():e.add(i),es(e)}function Y9(e,i){i.parent===e?i.moveToTop():e.add(i),es(e)}function K_(e,i,t){i._remove(),e.add(i),i.setZIndex(t.getZIndex()),es(e)}function K9(e,i,t){K_(e,i,t)}function X9(e,i){i.destroy(),i.off(ym),es(e)}function Z9(e,i){i.destroy(),i.off(ym),es(e)}function Q9(e,i,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function J9(e,i,t){}function e7(e,i,t,n,o){Ip(e,o,n)}function t7(e){e.hide(),es(e)}function n7(e){}function r7(e,i){(i.visible==null||i.visible)&&e.show()}function i7(e,i){}function a7(e){}function o7(){}const l7=()=>$_.DefaultEventPriority,s7=Object.freeze(Object.defineProperty({__proto__:null,appendChild:W9,appendChildToContainer:Y9,appendInitialChild:C9,cancelTimeout:U9,clearContainer:a7,commitMount:J9,commitTextUpdate:Q9,commitUpdate:e7,createInstance:k9,createTextInstance:A9,detachDeletedInstance:o7,finalizeInitialChildren:T9,getChildHostContext:z9,getCurrentEventPriority:l7,getPublicInstance:R9,getRootHostContext:F9,hideInstance:t7,hideTextInstance:n7,idlePriority:Wg.unstable_IdlePriority,insertBefore:K_,insertInContainerBefore:K9,isPrimaryRenderer:G9,noTimeout:q9,now:Wg.unstable_now,prepareForCommit:M9,preparePortalMount:L9,prepareUpdate:N9,removeChild:X9,removeChildFromContainer:Z9,resetAfterCommit:I9,resetTextContent:D9,run:Wg.unstable_runWithPriority,scheduleTimeout:B9,shouldDeprioritizeSubtree:j9,shouldSetTextContent:H9,supportsMutation:$9,unhideInstance:r7,unhideTextInstance:i7,warnsIfNotActing:V9},Symbol.toStringTag,{value:"Module"}));var u7=Object.defineProperty,c7=Object.defineProperties,f7=Object.getOwnPropertyDescriptors,Jy=Object.getOwnPropertySymbols,d7=Object.prototype.hasOwnProperty,h7=Object.prototype.propertyIsEnumerable,e2=(e,i,t)=>i in e?u7(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,t2=(e,i)=>{for(var t in i||(i={}))d7.call(i,t)&&e2(e,t,i[t]);if(Jy)for(var t of Jy(i))h7.call(i,t)&&e2(e,t,i[t]);return e},p7=(e,i)=>c7(e,f7(i)),n2,r2;typeof window<"u"&&((n2=window.document)!=null&&n2.createElement||((r2=window.navigator)==null?void 0:r2.product)==="ReactNative")?xn.useLayoutEffect:xn.useEffect;function X_(e,i,t){if(!e)return;if(t(e)===!0)return e;let n=e.child;for(;n;){const o=X_(n,i,t);if(o)return o;n=n.sibling}}function Z_(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const i2=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=i2;return}return i2.apply(this,arguments)};const bm=Z_(xn.createContext(null));class Q_ extends xn.Component{render(){return xn.createElement(bm.Provider,{value:this._reactInternals},this.props.children)}}function g7(){const e=xn.useContext(bm);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const i=xn.useId();return xn.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const o=X_(n,!1,l=>{let s=l.memoizedState;for(;s;){if(s.memoizedState===i)return!0;s=s.next}});if(o)return o}},[e,i])}function m7(){const e=g7(),[i]=xn.useState(()=>new Map);i.clear();let t=e;for(;t;){if(t.type&&typeof t.type=="object"){const o=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;o&&o!==bm&&!i.has(o)&&i.set(o,xn.useContext(Z_(o)))}t=t.return}return i}function J_(){const e=m7();return xn.useMemo(()=>Array.from(e.keys()).reduce((i,t)=>n=>xn.createElement(i,null,xn.createElement(t.Provider,p7(t2({},n),{value:e.get(t)}))),i=>xn.createElement(Q_,t2({},i))),[e])}function v7(e){const i=qt.useRef({});return qt.useLayoutEffect(()=>{i.current=e}),qt.useLayoutEffect(()=>()=>{i.current={}},[]),i.current}const y7=e=>{const i=qt.useRef(),t=qt.useRef(),n=qt.useRef(),o=v7(e),l=J_(),s=c=>{const{forwardedRef:d}=e;d&&(typeof d=="function"?d(c):d.current=c)};return qt.useLayoutEffect(()=>(t.current=new Pd.Stage({width:e.width,height:e.height,container:i.current}),s(t.current),n.current=nc.createContainer(t.current,$_.LegacyRoot,!1,null),nc.updateContainer(qt.createElement(l,{},e.children),n.current),()=>{Pd.isBrowser&&(s(null),nc.updateContainer(null,n.current,null),t.current.destroy())}),[]),qt.useLayoutEffect(()=>{s(t.current),Ip(t.current,e,o),nc.updateContainer(qt.createElement(l,{},e.children),n.current,null)}),qt.createElement("div",{ref:i,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},b7="Layer",_7="FastLayer",mp="Group",w7="Label",S7="Rect",E7="Circle",O7="Ellipse",x7="Wedge",P7="Line",C7="Sprite",k7="Image",A7="Text",T7="TextPath",R7="Star",M7="Ring",L7="Arc",N7="Tag",I7="Path",D7="RegularPolygon",j7="Arrow",F7="Shape",z7="Transformer",nc=y9(s7);nc.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:qt.version,rendererPackageName:"react-konva"});const B7=qt.forwardRef((e,i)=>qt.createElement(Q_,{},qt.createElement(y7,{...e,forwardedRef:i}))),U7=S9,q7=Object.freeze(Object.defineProperty({__proto__:null,Arc:L7,Arrow:j7,Circle:E7,Ellipse:O7,FastLayer:_7,Group:mp,Image:k7,KonvaRenderer:nc,Label:w7,Layer:b7,Line:P7,Path:I7,Rect:S7,RegularPolygon:D7,Ring:M7,Shape:F7,Sprite:C7,Stage:B7,Star:R7,Tag:N7,Text:A7,TextPath:T7,Transformer:z7,Wedge:x7,useStrictMode:U7},Symbol.toStringTag,{value:"Module"})),Jo=Xl(q7);var Yg,a2;function Dp(){if(a2)return Yg;a2=1;var e=Tn();return Yg=function(t,n,o){const l=e.useRef("loading"),s=e.useRef(),[c,d]=e.useState(0),b=e.useRef(),w=e.useRef(),E=e.useRef();return(b.current!==t||w.current!==n||E.current!==o)&&(l.current="loading",s.current=void 0,b.current=t,w.current=n,E.current=o),e.useLayoutEffect(function(){if(!t)return;var x=document.createElement("img");function m(){l.current="loaded",s.current=x,d(Math.random())}function _(){l.current="failed",s.current=void 0,d(Math.random())}return x.addEventListener("load",m),x.addEventListener("error",_),n&&(x.crossOrigin=n),o&&(x.referrerPolicy=o),x.src=t,function(){x.removeEventListener("load",m),x.removeEventListener("error",_)}},[t,n,o]),[s.current,l.current]},Yg}var id={},ad={},H7=function(e,i){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)i.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]]);return t};const G7=e=>{const i=window.getComputedStyle(e).position;return!(i==="absolute"||i==="relative")};function e5(e=()=>{}){const i=qt.useRef(e);return i.current=e,qt.useCallback((...t)=>i.current.apply(null,t),[])}const V7=({children:e,groupProps:i,divProps:t,transform:n,transformFunc:o})=>{const l=J_(),s=qt.useRef(null),[c]=qt.useState(()=>document.createElement("div")),d=qt.useMemo(()=>M3.createRoot(c),[c]),b=n??!0,w=e5(()=>{if(b&&s.current){let p=s.current.getAbsoluteTransform().decompose();o&&(p=o(p)),c.style.position="absolute",c.style.zIndex="10",c.style.top="0px",c.style.left="0px",c.style.transform=`translate(${p.x}px, ${p.y}px) rotate(${p.rotation}deg) scaleX(${p.scaleX}) scaleY(${p.scaleY})`,c.style.transformOrigin="top left"}else c.style.position="",c.style.zIndex="",c.style.top="",c.style.left="",c.style.transform="",c.style.transformOrigin="";const E=t||{},{style:x}=E,m=H7(E,["style"]);Object.assign(c.style,x),Object.assign(c,m)});return qt.useLayoutEffect(()=>{var E;const x=s.current;if(!x)return;const m=(E=x.getStage())===null||E===void 0?void 0:E.container();if(m)return m.appendChild(c),b&&G7(m)&&(m.style.position="relative"),x.on("absoluteTransformChange",w),w(),()=>{var _;x.off("absoluteTransformChange",w),(_=c.parentNode)===null||_===void 0||_.removeChild(c)}},[b]),qt.useLayoutEffect(()=>{w()},[t,o]),qt.useLayoutEffect(()=>{d.render(qt.createElement(l,null,e))}),qt.useLayoutEffect(()=>()=>{setTimeout(()=>{d.unmount()})},[]),qt.createElement(mp,Object.assign({ref:s},i))},$7=({selector:e,enabled:i,children:t})=>{const n=qt.useRef(null),o=qt.useRef(null),l=qt.useRef(null),s=i??!0;return qt.useLayoutEffect(()=>{if(!n.current||!o.current)return;l.current=o.current;const d=n.current.getStage().findOne(e);s&&d?o.current.moveTo(d):o.current.moveTo(n.current);const b=n.current.getLayer();if(b&&(b.batchDraw(),d)){const w=d.getLayer();if(!w)return;w.batchDraw()}},[e,s]),qt.useEffect(()=>()=>{var c;(c=l.current)===null||c===void 0||c.destroy()},[]),qt.createElement(mp,{name:"_outer_portal",ref:n},qt.createElement(mp,{name:"_inner_portal",ref:o},t))};var W7=Dp();const Y7=Rd(W7),K7=Object.freeze(Object.defineProperty({__proto__:null,Html:V7,Portal:$7,useEvent:e5,useImage:Y7},Symbol.toStringTag,{value:"Module"})),yc=Xl(K7);function X7(e,i){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(i))),e}function t5(e,i,t){const n=i-1,o=t[r5(n,t.length)];return o.marker!=="Z"?o:t5(e,n,t)}function n5(e,i,t){const n=i+1,o=t[r5(n,t.length)];return o.marker==="Z"?n5(e,n,t):o}function Z7(e,i,t){let n=t[i-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 l=function(c,d){return c[d].marker==="M"?c[d]:l(c,d-1)};var o=l;let s=l(t,i);e.values.x=s.values.x,e.values.y=s.values.y}return e}function Q7(e,i){const t=[];switch(e.toUpperCase()){case"M":for(let n=0;n<i.length;n+=2){let o;e===e.toUpperCase()?o=n===0?"M":"L":o=n===0?"m":"l",t.push({marker:o,values:{x:i[n],y:i[n+1]}})}break;case"L":for(let n=0;n<i.length;n+=2)t.push({marker:e,values:{x:i[n],y:i[n+1]}});break;case"H":for(let n=0;n<i.length;n++)t.push({marker:e,values:{x:i[n],y:0}});break;case"V":for(let n=0;n<i.length;n++)t.push({marker:e,values:{x:0,y:i[n]}});break;case"C":for(let n=0;n<i.length;n+=6)t.push({marker:e,values:{x1:i[n],y1:i[n+1],x2:i[n+2],y2:i[n+3],x:i[n+4],y:i[n+5]}});break;case"S":for(let n=0;n<i.length;n+=4)t.push({marker:e,values:{x2:i[n],y2:i[n+1],x:i[n+2],y:i[n+3]}});break;case"Q":for(let n=0;n<i.length;n+=4)t.push({marker:e,values:{x1:i[n],y1:i[n+1],x:i[n+2],y:i[n+3]}});break;case"T":for(let n=0;n<i.length;n+=2)t.push({marker:e,values:{x:i[n],y:i[n+1]}});break;case"A":for(let n=0;n<i.length;n+=7)t.push({marker:e,values:{radiusX:i[n],radiusY:i[n+1],rotation:i[n+2],largeArc:i[n+3],sweep:i[n+4],x:i[n+5],y:i[n+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function r5(e,i){return(e%i+i)%i}function J7(e,i,t){if(i!==0&&e.marker==="L"){let n=t[i-1];["x","y"].every(l=>Math.round(Math.abs(n.values[l]-e.values[l]))===0)&&(e.overlap=!0)}return e}function H0(e,i){const t=["x","y"].every(n=>Math.round(Math.abs(e[i].values[n]-e[0].values[n]))===0);e[i].marker==="L"&&t&&(e[i].overlap=!0,H0(e,i-1)),e[i].marker==="Z"&&H0(e,i-1)}function eS(e,i,t){const n=l2(e.values,t.values),o=l2(i.values,e.values);return Math.min(o,n)}function o2(e,i){return Math.atan2(i.x-e.x,i.y-e.y)}function l2(e,i){const t=e.x-i.x,n=e.y-i.y;return Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}function s2(e,i){return Math.sin(e)*i}function u2(e,i){return Math.cos(e)*i}function c2(e,i){const t=i/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?i:t}function tS(e,i){return i*Math.tan(e)}function nS(e,i){let t,n=0,o=e*(180/Math.PI);return o<0&&o>=-180||o>180&&o<360?t=c2(e/2,-i):(t=c2(e/2,i),n=1,t===1/0&&(t=i)),{offset:t,sweepFlag:n}}function rS(e){const i=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let n="";if(t.marker!=="Z"){const o=Object.keys(t.values);n=i.filter(l=>o.indexOf(l)!==-1).map(l=>t.values[l]).join()}return`${t.marker}${n}`}).join("").trim()}function i5(e){const i=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(i)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,o)=>{const l=e.substring(o.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:o.marker,index:o.index,chunk:l.length>0?l.substr(1,l.length-1):l}])},[]).reverse().flatMap(n=>{const o=n.chunk.match(t),l=o?o.map(parseFloat):[];return Q7(n.marker,l)}).map(Z7)}function a5(e,i,t){let n=[],o=[];return t&&e.forEach(l=>X7(l,t)),e.forEach(l=>{l.marker==="M"&&n.push([]),n[n.length-1].push(l)}),n.forEach(l=>{l.map(J7),H0(l,l.length-1);const s=l[l.length-1].marker=="Z";l.filter(c=>!c.overlap).map((c,d,b)=>{const E=t5(c,d,b),x=n5(c,d,b),m=o2(c.values,E.values),_=o2(c.values,x.values),p=_-m,h=p*(180/Math.PI),P=eS(c,E,x),g=Math.abs(tS(p/2,P/2)),v=Math.min(i,g),y=nS(p,v),O=y.offset,M=y.sweepFlag,R=(d==0||d==b.length-1)&&!s;switch(c.marker){case"M":case"L":const D=[c.values.x+s2(m,O),c.values.y+u2(m,O)],T=[c.values.x+s2(_,O),c.values.y+u2(_,O)];R?o.push({marker:c.marker,values:c.values}):o.push({marker:c.marker,values:{x:parseFloat(D[0].toFixed(3)),y:parseFloat(D[1].toFixed(3))}}),!R&&(x.marker==="L"||x.marker==="M")&&o.push({marker:"A",radius:v,values:{radiusX:parseFloat(v.toFixed(3)),radiusY:parseFloat(v.toFixed(3)),rotation:h,largeArc:0,sweep:M,x:parseFloat(T[0].toFixed(3)),y:parseFloat(T[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":o.push({marker:c.marker,values:c.values});break}})}),{path:rS(o),commands:o}}function iS(e,i,t){return a5([...i5(e)],i,t)}const aS=Object.freeze(Object.defineProperty({__proto__:null,parsePath:i5,roundCommands:a5,roundCorners:iS},Symbol.toStringTag,{value:"Module"})),oS=Xl(aS);var ba={},od={},Qh={},f2;function lS(){if(f2)return Qh;f2=1;var e=e||{};e.stringify=function(){var i={"visit_linear-gradient":function(t){return i.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return i.visit_gradient(t)},"visit_radial-gradient":function(t){return i.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return i.visit_gradient(t)},visit_gradient:function(t){var n=i.visit(t.orientation);return n&&(n+=", "),t.type+"("+n+i.visit(t.colorStops)+")"},visit_shape:function(t){var n=t.value,o=i.visit(t.at),l=i.visit(t.style);return l&&(n+=" "+l),o&&(n+=" at "+o),n},"visit_default-radial":function(t){var n="",o=i.visit(t.at);return o&&(n+=o),n},"visit_extent-keyword":function(t){var n=t.value,o=i.visit(t.at);return o&&(n+=" at "+o),n},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return i.visit(t.value.x)+" "+i.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 i.visit_color(t.value,t)},visit_hex:function(t){return i.visit_color("#"+t.value,t)},visit_rgb:function(t){return i.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return i.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,n){var o=t,l=i.visit(n.length);return l&&(o+=" "+l),o},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var n="",o=t.length;return t.forEach(function(l,s){n+=i.visit(l),s<o-1&&(n+=", ")}),n},visit:function(t){if(!t)return"";var n="";if(t instanceof Array)return i.visit_array(t,n);if(t.type){var o=i["visit_"+t.type];if(o)return o(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return i.visit(t)}}();var e=e||{};return e.parse=function(){var i={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 n(Q){var H=new Error(t+": "+Q);throw H.source=t,H}function o(){var Q=l();return t.length>0&&n("Invalid input not EOF"),Q}function l(){return y(s)}function s(){return c("linear-gradient",i.linearGradient,b)||c("repeating-linear-gradient",i.repeatingLinearGradient,b)||c("radial-gradient",i.radialGradient,x)||c("repeating-radial-gradient",i.repeatingRadialGradient,x)}function c(Q,H,z){return d(H,function(I){var U=z();return U&&(X(i.comma)||n("Missing comma before color stops")),{type:Q,orientation:U,colorStops:y(O)}})}function d(Q,H){var z=X(Q);if(z){X(i.startCall)||n("Missing (");var I=H(z);return X(i.endCall)||n("Missing )"),I}}function b(){return w()||E()}function w(){return B("directional",i.sideOrCorner,1)}function E(){return B("angular",i.angleValue,1)}function x(){var Q,H=m(),z;return H&&(Q=[],Q.push(H),z=t,X(i.comma)&&(H=m(),H?Q.push(H):t=z)),Q}function m(){var Q=_()||p();if(Q)Q.at=P();else{var H=h();if(H){Q=H;var z=P();z&&(Q.at=z)}else{var I=g();I&&(Q={type:"default-radial",at:I})}}return Q}function _(){var Q=B("shape",/^(circle)/i,0);return Q&&(Q.style=L()||h()),Q}function p(){var Q=B("shape",/^(ellipse)/i,0);return Q&&(Q.style=N()||h()),Q}function h(){return B("extent-keyword",i.extentKeywords,1)}function P(){if(B("position",/^at/,0)){var Q=g();return Q||n("Missing positioning value"),Q}}function g(){var Q=v();if(Q.x||Q.y)return{type:"position",value:Q}}function v(){return{x:N(),y:N()}}function y(Q){var H=Q(),z=[];if(H)for(z.push(H);X(i.comma);)H=Q(),H?z.push(H):n("One extra comma");return z}function O(){var Q=M();return Q||n("Expected color definition"),Q.length=N(),Q}function M(){return D()||S()||T()||R()}function R(){return B("literal",i.literalColor,0)}function D(){return B("hex",i.hexColor,1)}function T(){return d(i.rgbColor,function(){return{type:"rgb",value:y(A)}})}function S(){return d(i.rgbaColor,function(){return{type:"rgba",value:y(A)}})}function A(){return X(i.number)[1]}function N(){return B("%",i.percentageValue,1)||k()||L()}function k(){return B("position-keyword",i.positionKeywords,1)}function L(){return B("px",i.pixelValue,1)||B("em",i.emValue,1)}function B(Q,H,z){var I=X(H);if(I)return{type:Q,value:I[z]}}function X(Q){var H,z;return z=/^[\n\r\t\s]+/.exec(t),z&&K(z[0].length),H=Q.exec(t),H&&K(H[0].length),H}function K(Q){t=t.substr(Q)}return function(Q){return t=Q.toString(),o()}}(),Qh.parse=e.parse,Qh.stringify=e.stringify,Qh}var d2;function _m(){return d2||(d2=1,function(e){var i=od&&od.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=i(lS()),n=s=>s.indexOf("linear-gradient")>=0;e.isGradient=n;const o=s=>s.type==="hex"?"#"+s.value:s.type==="literal"?s.value:`${s.type}(${s.value.join(",")})`,l=s=>{if(!(0,e.isGradient)(s))return{rotation:0,stops:[{offset:0,color:s},{offset:1,color:s}]};const c=t.default.parse(s)[0];return{rotation:parseFloat(c.orientation.value),stops:c.colorStops.map((d,b)=>({color:o(d),offset:d.length?parseFloat(d.length.value)/100:b/(c.colorStops.length-1)}))}};e.parseColor=l}(od)),od}var h2;function zd(){return h2||(h2=1,function(e){var i=ba&&ba.__createBinding||(Object.create?function(b,w,E,x){x===void 0&&(x=E);var m=Object.getOwnPropertyDescriptor(w,E);m&&!("get"in m?!w.__esModule:m.writable||m.configurable)||(m={enumerable:!0,get:function(){return w[E]}}),Object.defineProperty(b,x,m)}:function(b,w,E,x){x===void 0&&(x=E),b[x]=w[E]}),t=ba&&ba.__setModuleDefault||(Object.create?function(b,w){Object.defineProperty(b,"default",{enumerable:!0,value:w})}:function(b,w){b.default=w}),n=ba&&ba.__importStar||function(){var b=function(w){return b=Object.getOwnPropertyNames||function(E){var x=[];for(var m in E)Object.prototype.hasOwnProperty.call(E,m)&&(x[x.length]=m);return x},b(w)};return function(w){if(w&&w.__esModule)return w;var E={};if(w!=null)for(var x=b(w),m=0;m<x.length;m++)x[m]!=="default"&&i(E,w,x[m]);return t(E,w),E}}(),o=ba&&ba.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const l=o(Tn()),s=n(_m()),c=o(Ji()),d=(b,w=b.fill,E="fill")=>l.default.useMemo(()=>{if(!s.isGradient(w))return{[E]:w};const{stops:x,rotation:m}=s.parseColor(w),_={x:b.a.width/2,y:b.a.height/2},p=Math.sqrt(Math.pow(_.x,2)+Math.pow(_.y,2)),h=c.default.Util.degToRad(m)-Math.PI/2,P=[];return x.forEach(({offset:g,color:v})=>{P.push(g,v)}),E==="fill"?{fillLinearGradientStartPointX:_.x-p*Math.cos(h),fillLinearGradientStartPointY:_.y-p*Math.sin(h),fillLinearGradientColorStops:P,fillLinearGradientEndPointX:_.x+p*Math.cos(h),fillLinearGradientEndPointY:_.y+p*Math.sin(h),fill:x[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:_.x-p*Math.cos(h),strokeLinearGradientStartPointY:_.y-p*Math.sin(h),strokeLinearGradientColorStops:P,strokeLinearGradientEndPointX:_.x+p*Math.cos(h),strokeLinearGradientEndPointY:_.y+p*Math.sin(h)}},[w,b.width,b.height]);e.useColor=d}(ba)),ba}var Kg={},ld={},p2;function bc(){return p2||(p2=1,function(e){var i=ld&&ld.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=c;const t=i(Tn()),n=i(Ji());let o=!1;const l=(d=!o)=>{o=d};e.toggleFadeInAnimation=l;const s=()=>o;function c(d,b){const w=t.default.useRef();t.default.useLayoutEffect(()=>{w.current&&w.current.destroy()},[b]),t.default.useLayoutEffect(()=>{if(!o)return;const E=d.current.opacity();return E?(d.current.opacity(0),w.current=new n.default.Tween({node:d.current,opacity:E,onFinish:()=>{var x;(x=w.current)===null||x===void 0||x.destroy()}}),w.current.play(),()=>{var x;(x=w.current)===null||x===void 0||x.destroy()}):void 0},[])}e.isAnimationUsed=s}(ld)),ld}var g2;function Ks(){return g2||(g2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=w,e.decrementLoader=E,e.whenLoaded=m,e.onLoadError=p,e.triggerLoadError=h;const i=bc();let t=0,n=[],o=3e4;const l=P=>{o=P};e.setAssetLoadTimeout=l;const s=()=>o;e.getAssetLoadTimeout=s;let c=6e3;const d=P=>{c=P};e.setFontLoadTimeout=d;const b=()=>c;function w(P){t+=1;let g=!1;const v=setTimeout(()=>{g||(h(`Timeout loading asset ${P}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",P),g=!0,E())},o);return()=>{g||(clearTimeout(v),E())}}function E(){t-=1,t===0&&(n.forEach(P=>P()),n=[])}function x(P){t===0?P():n.push(P)}function m(){return new Promise(P=>x(()=>{(0,i.isAnimationUsed)()?setTimeout(P,300):P(!0)}))}e.getFontLoadTimeout=b;let _=[];function p(P){_.push(P)}function h(P){_.forEach(g=>g(P))}}(Kg)),Kg}var Ho={},m2;function Bd(){return m2||(m2=1,function(e){var i=Ho&&Ho.__createBinding||(Object.create?function(A,N,k,L){L===void 0&&(L=k);var B=Object.getOwnPropertyDescriptor(N,k);B&&!("get"in B?!N.__esModule:B.writable||B.configurable)||(B={enumerable:!0,get:function(){return N[k]}}),Object.defineProperty(A,L,B)}:function(A,N,k,L){L===void 0&&(L=k),A[L]=N[k]}),t=Ho&&Ho.__setModuleDefault||(Object.create?function(A,N){Object.defineProperty(A,"default",{enumerable:!0,value:N})}:function(A,N){A.default=N}),n=Ho&&Ho.__importStar||function(){var A=function(N){return A=Object.getOwnPropertyNames||function(k){var L=[];for(var B in k)Object.prototype.hasOwnProperty.call(k,B)&&(L[L.length]=B);return L},A(N)};return function(N){if(N&&N.__esModule)return N;var k={};if(N!=null)for(var L=A(N),B=0;B<L.length;B++)L[B]!=="default"&&i(k,N,L[B]);return t(k,N),k}}();Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=d,e.setGoogleFonts=b,e.getFontsList=w,e.addGlobalFont=E,e.removeGlobalFont=x,e.replaceGlobalFonts=m,e.loadFont=v,e.setGoogleFontsVariants=M,e.getGoogleFontsVariants=R,e.injectGoogleFont=D,e.injectCustomFont=S;const o=n(La),l=Ks();let s=o.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),c=o.observable({value:!1});function d(){return c.value}function b(A){A!=="default"?(c.value=!0,s.splice(0,s.length),s.push(...A)):c.value=!1}function w(){return s}function E(A){e.globalFonts.push(A)}function x(A){const N=e.globalFonts.findIndex(k=>k.fontFamily===A);N!==-1&&e.globalFonts.splice(N,1)}function m(A){e.globalFonts.replace(A)}e.globalFonts=o.observable([]);var _="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",p=document.createElement("canvas");function h(A,N="Arial",k="normal",L="normal"){var B=p.getContext("2d");return B.font=`${k} ${L} 40px '${A}', ${N}`,B.measureText(_).width}const P={Arial:!0},g=A=>!!P[A];async function v(A,N,k){var L;if(P[A])return;const B=!!(!((L=document.fonts)===null||L===void 0)&&L.load),X=h("Arial","Arial",N,k);if(B)try{await document.fonts.load(`16px '${A}', ${N} ${k}`);const z=h(A,"Arial",N,k);if(X!==z)return void(P[A]=!0)}catch{}const K=h("Times","Times",N,k),Q=h(A,"Arial",N,k),H=Math.min(6e3,(0,l.getFontLoadTimeout)())/60;for(let z=0;z<H;z++){const I=h(A,"Arial",N,k),U=h(A,"Times",N,k);if(I!==Q||I!==X||U!==K)return void(P[A]=!0);await new Promise($=>setTimeout($,60))}console.warn(`Timeout for loading font "${A}". Looks like polotno can't load it. Is it a correct font family?`),(0,l.triggerLoadError)(`Timeout for loading font "${A}"`)}e.isFontLoaded=g;const y={};let O="400,400italic,700,700italic";function M(A){O=A}function R(){return O}function D(A){if(y[A])return;const N=`https://fonts.googleapis.com/css?family=${A.replace(/ /g,"+")}:${O}`,k=document.createElement("link");k.type="text/css",k.href=N,k.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(k),y[A]=!0}const T={};function S(A){const N=A.fontFamily;if(T[N]||!A.url&&!A.styles)return;const k=document.createElement("style");k.type="text/css";const L=A.styles||(A.url?[{src:`url("${A.url}")`}]:[]);let B="";L.forEach(X=>{B+=`
77
+ @font-face {
78
+ font-family: '${N}';
79
+ src: ${X.src};
80
+ font-style: ${X.fontStyle||"normal"};
81
+ font-weight: ${X.fontWeight||"normal"};
82
+ }
83
+ `}),k.innerHTML=B,document.getElementsByTagName("head")[0].appendChild(k),T[A.fontFamily]=!0}}(Ho)),Ho}var Go={},v2;function ts(){return v2||(v2=1,function(e){var i=Go&&Go.__createBinding||(Object.create?function(l,s,c,d){d===void 0&&(d=c);var b=Object.getOwnPropertyDescriptor(s,c);b&&!("get"in b?!s.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return s[c]}}),Object.defineProperty(l,d,b)}:function(l,s,c,d){d===void 0&&(d=c),l[d]=s[c]}),t=Go&&Go.__setModuleDefault||(Object.create?function(l,s){Object.defineProperty(l,"default",{enumerable:!0,value:s})}:function(l,s){l.default=s}),n=Go&&Go.__importStar||function(){var l=function(s){return l=Object.getOwnPropertyNames||function(c){var d=[];for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(d[d.length]=b);return d},l(s)};return function(s){if(s&&s.__esModule)return s;var c={};if(s!=null)for(var d=l(s),b=0;b<d.length;b++)d[b]!=="default"&&i(c,s,d[b]);return t(c,s),c}}();Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextSplitAllowed=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const o=n(La);e.flags=o.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=o.action(l=>{e.flags.textVerticalResizeEnabled=l}),e.useRemoveBackground=o.action(l=>{e.flags.removeBackgroundEnabled=l}),e.useHtmlTextRender=o.action(l=>{e.flags.htmlRenderEnabled=l}),e.setDownScalingEnabled=o.action(l=>{e.flags.imageDownScalingEnabled=l}),e.useDownScaling=o.action(l=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(l)}),e.setForceTextFit=o.action(l=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=o.action(l=>{e.flags.textOverflow=l}),e.setTextSplitAllowed=o.action(l=>{e.flags.textSplitAllowed=l}),e.setAnimationsEnabled=o.action(l=>{e.flags.animationsEnabled=l})}(Go)),Go}var Xg={},y2;function o5(){return y2||(y2=1,function(e){function i(t=""){return(t.match(/<\/p>/gi)||[]).length>1&&(t=t.replace(/<\/p>/gi,(n,o,l)=>(l.slice(o+n.length).match(/<\/p>/gi)||[]).length>0?`
84
+ `:n)),t.replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=i}(Xg)),Xg}var sd={},b2;function jp(){return b2||(b2=1,function(e){var i=sd&&sd.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=o;const t=i(Ji()),n={warm:l=>s=>{const c=s.data;for(let d=0;d<c.length;d+=4)c[d]=Math.min(c[d]+30*l,255),c[d+1]=Math.min(c[d+1]+15*l,255);return s},cold:l=>s=>{const c=s.data;for(let d=0;d<c.length;d+=4)c[d]=Math.min(c[d]-15*l,255),c[d+1]=Math.min(c[d+1]-10*l,255),c[d+2]=Math.min(c[d+2]+15*l,255);return s},natural:l=>s=>{const c=s.data;l=Math.max(0,Math.min(l,1));for(let d=0;d<c.length;d+=4){c[d]=Math.min(c[d]*(1+.1*l),255),c[d+1]=Math.min(c[d+1]*(1+.1*l),255),c[d+2]=Math.min(c[d+2]*(1+.1*l),255);const b=(c[d]+c[d+1]+c[d+2])/3;c[d]=Math.min((c[d]-b)*(1+.2*l)+b,255),c[d+1]=Math.min((c[d+1]-b)*(1+.2*l)+b,255),c[d+2]=Math.min((c[d+2]-b)*(1+.2*l)+b,255)}return s}};function o(l,s){var c;const d={filters:[]},b={};s.brightnessEnabled&&(d.filters.push(t.default.Filters.Brighten),d.brightness=s.brightness),s.blurEnabled&&(d.filters.push(t.default.Filters.Blur),d.blurRadius=s.blurRadius,s.type==="text"&&s.lineHeight<1&&(b.offset=s.fontSize)),s.sepiaEnabled&&d.filters.push(t.default.Filters.Sepia),s.grayscaleEnabled&&d.filters.push(t.default.Filters.Grayscale),s.filters.forEach((w,E)=>{const x=n[E];x&&d.filters.push(x(w.intensity))}),l.setAttrs(d),d.filters.length?l.cache(Object.assign(Object.assign({},b),{pixelRatio:s.store._elementsPixelRatio})):l.clearCache(),(c=l.getLayer())===null||c===void 0||c.batchDraw()}}(sd)),sd}var ud={},_2;function _c(){return _2||(_2=1,function(e){var i=ud&&ud.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const t=i(Tn()),n=Qi,o=Jo,l={stroke:"rgb(0, 161, 255)",strokeWidth:2},s=c=>{Object.assign(l,c)};e.setHighlighterStyle=s,e.Highlighter=(0,n.observer)(({element:c})=>t.default.createElement(o.Rect,Object.assign({name:"highlighter",x:c.a.x,y:c.a.y,rotation:c.a.rotation,width:c.a.width,height:c.a.height,listening:!1,strokeScaleEnabled:!1},l)))}(ud)),ud}var cd={},w2;function Xs(){return w2||(w2=1,function(e){var i=cd&&cd.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const t=i(Tn());e.MOBILE_BREAKPOINT=800;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const o=c=>`
85
+ @media (max-width: ${e.MOBILE_BREAKPOINT}px) {
86
+ ${c}
87
+ }
88
+
89
+ .polotno-mobile & {
90
+ ${c}
91
+ }
92
+ `;e.mobileStyle=o;const l=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;e.isTouchDevice=l;const s=()=>{const[c,d]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const b=()=>{d((0,e.isMobile)())};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}},[]),c};e.useMobile=s}(cd)),cd}var S2={},l5="warn";function s5(e){l5=e}function u5(){return l5}function sS(e){s5(e)}var sr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(sr||(sr={}));var G0=function(e,i){return G0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},G0(e,i)};function _n(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");G0(e,i);function t(){this.constructor=e}e.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}var ur=function(){return ur=Object.assign||function(i){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(i[l]=t[l])}return i},ur.apply(this,arguments)};function uS(e,i){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)i.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]]);return t}function c5(e,i){var t={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},n,o,l,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(b){return function(w){return d([b,w])}}function d(b){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,b[0]&&(t=0)),t;)try{if(n=1,o&&(l=b[0]&2?o.return:b[0]?o.throw||((l=o.return)&&l.call(o),0):o.next)&&!(l=l.call(o,b[1])).done)return l;switch(o=0,l&&(b=[b[0]&2,l.value]),b[0]){case 0:case 1:l=b;break;case 4:return t.label++,{value:b[1],done:!1};case 5:t.label++,o=b[1],b=[0];continue;case 7:b=t.ops.pop(),t.trys.pop();continue;default:if(l=t.trys,!(l=l.length>0&&l[l.length-1])&&(b[0]===6||b[0]===2)){t=0;continue}if(b[0]===3&&(!l||b[1]>l[0]&&b[1]<l[3])){t.label=b[1];break}if(b[0]===6&&t.label<l[1]){t.label=l[1],l=b;break}if(l&&t.label<l[2]){t.label=l[2],t.ops.push(b);break}l[2]&&t.ops.pop(),t.trys.pop();continue}b=i.call(e,t)}catch(w){b=[6,w],o=0}finally{n=l=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}}function Sd(e){var i=typeof Symbol=="function"&&Symbol.iterator,t=i&&e[i],n=0;if(t)return t.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(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function co(e,i){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),o,l=[],s;try{for(;(i===void 0||i-- >0)&&!(o=n.next()).done;)l.push(o.value)}catch(c){s={error:c}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return l}function fo(e,i,t){if(arguments.length===2)for(var n=0,o=i.length,l;n<o;n++)(l||!(n in i))&&(l||(l=Array.prototype.slice.call(i,0,n)),l[n]=i[n]);return e.concat(l||Array.prototype.slice.call(i))}function Ud(e){return st(e).type}function cS(e,i){return st(e).getChildType(i)}function f5(e,i){return st(e).onPatch(i)}function fS(e,i){return st(e).onSnapshot(i)}function cc(e,i){st(e).applyPatches(km(i))}function dS(e,i){var t={patches:[],inversePatches:[]},n={},o,l={get recording(){return!!o},get patches(){return n.patches||(n.patches=t.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=t.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=t.inversePatches.slice()),n.inversePatches},stop:function(){o&&(o(),o=void 0)},resume:function(){o||(o=f5(e,function(s,c){i&&!i(s,c,Om())||(t.patches.push(s),t.inversePatches.push(c),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(s){cc(s||e,t.patches)},undo:function(s){cc(s||e,t.inversePatches.slice().reverse())}};return l.resume(),l}function hS(e){var i=st(e);if(!i.isRoot)throw new nt("`protect` can only be invoked on root nodes");i.isProtectionEnabled=!0}function pS(e){var i=st(e);if(!i.isRoot)throw new nt("`unprotect` can only be invoked on root nodes");i.isProtectionEnabled=!1}function gS(e){return st(e).isProtected}function d5(e,i){return st(e).applySnapshot(i)}function wm(e,i){i===void 0&&(i=!0);var t=st(e);return i?t.snapshot:t.type.getSnapshot(t,!1)}function mS(e,i){i===void 0&&(i=1);for(var t=st(e).parent;t;){if(--i===0)return!0;t=t.parent}return!1}function vS(e,i){i===void 0&&(i=1);for(var t=i,n=st(e).parent;n;){if(--t===0)return n.storedValue;n=n.parent}throw new nt("Failed to find the parent of ".concat(st(e)," at depth ").concat(i))}function yS(e,i){for(var t=st(e).parent;t;){if(i.is(t.storedValue))return!0;t=t.parent}return!1}function bS(e,i){for(var t=st(e).parent;t;){if(i.is(t.storedValue))return t.storedValue;t=t.parent}throw new nt("Failed to find the parent of ".concat(st(e)," of a given type"))}function h5(e){return st(e).root.storedValue}function p5(e){return st(e).path}function _S(e){return gc(st(e).path)}function wS(e){return st(e).isRoot}function SS(e,i){var t=M5(st(e),i);return t?t.value:void 0}function ES(e,i,t){var n=st(i).root.identifierCache.resolve(e,wc(t));return n==null?void 0:n.value}function g5(e){return st(e).identifier}function OS(e,i){i===void 0&&(i=!0);try{var t=e();if(t==null)return;if(rn(t))return i?Sm(t)?t:void 0:t;throw new nt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof Am)return;throw n}}function xS(e,i){i===void 0&&(i=!0);try{var t=e();if(t==null)return!1;if(rn(t))return i?Sm(t):!0;throw new nt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof Am)return!1;throw n}}function m5(e,i){var t=M5(st(e),i,!1);if(t!==void 0)try{return t.value}catch{return}}function PS(e,i){return R5(st(e),st(i))}function CS(e,i){i===void 0&&(i=!0);var t=st(e);return t.type.create(t.snapshot,i===!0?t.root.environment:i===!1?void 0:i)}function kS(e){return st(e).detach(),e}function AS(e){var i=st(e);i.isRoot?i.die():i.parent.removeChild(i.subpath)}function Sm(e){return st(e).observableIsAlive}function TS(e,i){var t=st(e);return t.addDisposer(i),i}function RS(e){var i=st(e),t=i.root.environment;if(!t)throw new nt("Failed to find the environment of ".concat(i," ").concat(i.path));return t}function MS(e){var i=st(e),t=i.root.environment;return!!t}function v5(e,i){var t=st(e);t.getChildren().forEach(function(n){rn(n.storedValue)&&v5(n.storedValue,i)}),i(t.storedValue)}function y5(e){var i;return rn(e)?i=Ud(e):i=e,{name:i.name,properties:ur({},i.properties)}}function LS(e){var i=st(e).type,t=ur(ur({},y5(i)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(o){if(!(o in t.properties)){var l=Object.getOwnPropertyDescriptor(e,o);if(l.get){S_(e,o)?t.views.push(o):t.volatile.push(o);return}l.value._isFlowAction===!0&&t.flowActions.push(o),l.value._isMSTAction===!0?t.actions.push(o):O_(e,o)?t.volatile.push(o):t.views.push(o)}}),t}function NS(e){return e}function IS(e){return e}function DS(e){return e}function jS(e){return st(e).nodeId}var b5=function(){function e(i,t,n,o){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:o}),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:Lr.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=o,this.baseSetParent(t,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(i){var t=this.isAlive;this._state=i;var n=this.isAlive;this.aliveAtom&&t!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this._hookSubscribers&&this._hookSubscribers.emit(i,this,i)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){return this._hookSubscribers||(this._hookSubscribers=new j5),this._hookSubscribers.register(i,t)}}),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(i,t){this._parent=i,this._subpath=t,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(i){return i&&(this.pathAtom||(this.pathAtom=Od("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Wl(this._subpath):""),this.parent.getEscapedPath(i)+"/"+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!==Lr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Lr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Od("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(i){if(this.state===Lr.CREATED){if(this.parent){if(this.parent.state!==Lr.FINALIZED)return;this.fireHook(sr.afterAttach)}this.state=Lr.FINALIZED,i&&i()}}}),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=Lr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(sr.beforeDestroy)}}),e}(),Cd=function(e){_n(i,e);function i(t,n,o,l,s){var c=e.call(this,t,n,o,l)||this;try{c.storedValue=t.createNewInstance(s)}catch(d){throw c.state=Lr.DEAD,d}return c.state=Lr.CREATED,c.finalizeCreation(),c}return Object.defineProperty(i.prototype,"root",{get:function(){if(!this.parent)throw new nt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this.parent!==t,l=this.subpath!==n;!o&&!l||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(i.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(i.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(i.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Lr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(i.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(i.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(i.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(i.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),i}(b5);Cd.prototype.die=Zn(Cd.prototype.die);var FS=1,xa;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(xa||(xa={}));var Ti;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(Ti||(Ti={}));var zS={onError:function(e){throw e}},yi=function(e){_n(i,e);function i(t,n,o,l,s){var c=e.call(this,t,n,o,l)||this;if(Object.defineProperty(c,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++FS}),Object.defineProperty(c,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:xa.UNINITIALIZED}),Object.defineProperty(c,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c._snapshotComputed=$s(function(){return c.getSnapshot()}),c.unbox=c.unbox.bind(c),c._initialSnapshot=s,c.identifierAttribute=t.identifierAttribute,n||(c.identifierCache=new aE),c._childNodes=t.initializeChildNodes(c,c._initialSnapshot),c.identifier=null,c.unnormalizedIdentifier=null,c.identifierAttribute&&c._initialSnapshot){var d=c._initialSnapshot[c.identifierAttribute];if(d===void 0){var b=c._childNodes[c.identifierAttribute];b&&(d=b.value)}if(typeof d!="string"&&typeof d!="number")throw new nt("Instance identifier '".concat(c.identifierAttribute,"' for type '").concat(c.type.name,"' must be a string or a number"));c.identifier=wc(d),c.unnormalizedIdentifier=d}return n?n.root.identifierCache.addNodeToCache(c):c.identifierCache.addNodeToCache(c),c}return Object.defineProperty(i.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(i.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===xa.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(i.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n,o,l,s;t===void 0&&(t=!0),this._observableInstanceState=xa.CREATING;for(var c=[],d=this.parent;d&&d._observableInstanceState===xa.UNINITIALIZED;)c.unshift(d),d=d.parent;try{for(var b=Sd(c),w=b.next();!w.done;w=b.next()){var E=w.value;E.createObservableInstanceIfNeeded(!1)}}catch(p){n={error:p}}finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(n)throw n.error}}var x=this.type;try{this.storedValue=x.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,x.finalizeNewInstance(this,this.storedValue)}catch(p){throw this.state=Lr.DEAD,p}finally{this._isRunningAction=!1}if(this._observableInstanceState=xa.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=hc,this.state=Lr.CREATED,t){this.fireHook(sr.afterCreate),this.finalizeCreation();try{for(var m=Sd(c.reverse()),_=m.next();!_.done;_=m.next()){var E=_.value;E.fireHook(sr.afterCreate),E.finalizeCreation()}}catch(p){l={error:p}}finally{try{_&&!_.done&&(s=m.return)&&s.call(m)}finally{if(l)throw l.error}}}}}),Object.defineProperty(i.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(sr.beforeDetach);var t=this.state;this.state=Lr.DETACHING;var n=this.root,o=n.environment,l=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=o,this.identifierCache=l}finally{this.state=t}}}}),Object.defineProperty(i.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=t!==this.parent,l=n!==this.subpath;!o&&!l||(o?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,n),this.fireHook(sr.afterAttach)):l&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(i.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.fireInternalHook(t);var o=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof o=="function"&&(lc?lc(function(){o.apply(n.storedValue)}):o.apply(this.storedValue))}}),Object.defineProperty(i.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===xa.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(i.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(i.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,n=this._childNodes,o=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(n,o),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(i.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(i.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=u5();if(!this.isAlive&&n!=="ignore"){var o=this._getAssertAliveError(t);switch(n){case"error":throw new nt(o);case"warn":yE(o)}}}}),Object.defineProperty(i.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",o=t.subpath&&Wl(t.subpath)||"",l=t.actionContext||Em();l&&l.type!=="action"&&l.parentActionEvent&&(l=l.parentActionEvent);var s="";if(l&&l.name!=null){var c=l&&l.context&&p5(l.context)||n;s="".concat(c,".").concat(l.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(o,"', Action: '").concat(s,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===xa.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(hc),this._autoUnbox=!1;try{return this._observableInstanceState===xa.CREATED?this.type.getChildren(this):N5(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(i.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new nt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(i.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.assertAlive({subpath:t.subpath||t.subpathUponDeath}),this._autoUnbox?t.value:t)}}),Object.defineProperty(i.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(i.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var n,o;try{for(var l=Sd(t.getChildren()),s=l.next();!s.done;s=l.next()){var c=s.value;c.finalizeCreation()}}catch(d){n={error:d}}finally{try{s&&!s.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}t.fireInternalHook(sr.afterCreationFinalization)})}}),Object.defineProperty(i.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new nt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(i.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=kd(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(o){if(!o.path){t.type.applySnapshot(t,o.value);return}var l=gc(o.path),s=L5(t,l.slice(0,-1));s.applyPatchLocally(l[l.length-1],o)})}),this._applySnapshot=kd(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==t.snapshot)return t.type.applySnapshot(t,n)}),zs(this.storedValue,"$treenode",this),zs(this.storedValue,"toJSON",lE)}}),Object.defineProperty(i.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Lr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(i.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==xa.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Ti.Dispose),this._internalEventsClear(Ti.Dispose))}}),Object.defineProperty(i.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(i.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(Ti.Snapshot,t)}}),Object.defineProperty(i.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(Ti.Snapshot,t)}}),Object.defineProperty(i.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(Ti.Patch,t)}}),Object.defineProperty(i.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._internalEventsHasSubscribers(Ti.Patch)){var o=n.path.substr(this.path.length)+(t.path?"/"+t.path:""),l=gE({},t,{path:o}),s=co(OE(l),2),c=s[0],d=s[1];this._internalEventsEmit(Ti.Patch,c,d)}this.parent&&this.parent.emitPatch(t,n)}}),Object.defineProperty(i.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(Ti.Dispose,t)}}),Object.defineProperty(i.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(Ti.Dispose,t,!0);return}throw new nt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(i.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(Ti.Dispose,t))throw new nt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Ti.Dispose,t)}}),Object.defineProperty(i.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var n=this.middlewares.indexOf(t);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(i.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this;n===void 0&&(n=!0);var l={handler:t,includeHooks:n};return this.middlewares?this.middlewares.push(l):this.middlewares=[l],function(){o.removeMiddleware(l)}}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,n)}}),Object.defineProperty(i.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var n=p_(function(){return t.snapshot},function(o){return t.emitSnapshot(o)},zS);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(i.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(i.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o){return o===void 0&&(o=!1),this._internalEvents||(this._internalEvents=new j5),this._internalEvents.register(t,n,o)}}),Object.defineProperty(i.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!!this._internalEvents&&this._internalEvents.has(t,n)}}),Object.defineProperty(i.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._internalEvents&&this._internalEvents.unregister(t,n)}}),Object.defineProperty(i.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var n,o=[],l=1;l<arguments.length;l++)o[l-1]=arguments[l];this._internalEvents&&(n=this._internalEvents).emit.apply(n,fo([t],co(o),!1))}}),Object.defineProperty(i.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(i.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),i}(b5);yi.prototype.createObservableInstance=Zn(yi.prototype.createObservableInstance);yi.prototype.detach=Zn(yi.prototype.detach);yi.prototype.die=Zn(yi.prototype.die);var _5,Tt;(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"})(Tt||(Tt={}));var w5="cannotDetermine",BS=Symbol("$type"),Qo=function(){function e(i){Object.defineProperty(this,_5,{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=i}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){return Xo(this,i),this.instantiate(null,"",t,i).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){throw new nt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(i){return i===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=T5(i);if(n){var o=Ud(i);return this.isAssignableFrom(o)?bi():_i(t,i)}return this.isValidSnapshot(i,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(i){return this.validate(i,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new nt("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 nt("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 nt("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 nt("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}();_5=BS;Qo.prototype.create=Zn(Qo.prototype.create);var fc=function(e){_n(i,e);function i(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(i.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,n)}}),Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(i.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!t.identifierAttribute||t.identifier===wc(n[t.identifierAttribute])}}),Object.defineProperty(i.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t.isDetaching?!1:t.snapshot===n||rn(n)&&st(n)===t?!0:t.type===this&&I5(n)&&!rn(n)&&this.isMatchingSnapshotId(t,n)?(t.applySnapshot(n),!0):!1}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=this.tryToReconcileNode(t,n);if(s)return t.setParent(o,l),t;if(t.die(),rn(n)&&this.isAssignableFrom(Ud(n))){var c=st(n);return c.setParent(o,l),c}return this.instantiate(o,l,void 0,n)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),i}(Qo);fc.prototype.create=Zn(fc.prototype.create);var Zs=function(e){_n(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){if(!t.isDetaching&&t.type===this&&t.storedValue===n)return t;var s=this.instantiate(o,l,void 0,n);return t.die(),s}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),i}(Qo);function cr(e){return typeof e=="object"&&e&&e.isType===!0}var io=new Map;function US(e){return function(t,n,o){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var l=e.onStart(t);e.onResume(t,l),io.set(t.id,{call:t,context:l,async:!1});try{var s=n(t);return e.onSuspend(t,l),io.get(t.id).async===!1&&(io.delete(t.id),e.onSuccess(t,l,s)),s}catch(d){throw io.delete(t.id),e.onFail(t,l,d),d}}else return n(t);case"flow_spawn":{var c=io.get(t.rootId);return c.async=!0,n(t)}case"flow_resume":case"flow_resume_error":{var c=io.get(t.rootId);e.onResume(t,c.context);try{return n(t)}finally{e.onSuspend(t,c.context)}}case"flow_throw":{var c=io.get(t.rootId);return io.delete(t.rootId),e.onFail(t,c.context,t.args[0]),n(t)}case"flow_return":{var c=io.get(t.rootId);return io.delete(t.rootId),e.onSuccess(t,c.context,t.args[0]),n(t)}}}}var qS=function(){function e(i,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i&&i.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,i))}}),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 HS(e){var i=new Map;return function(n,o){var l=n.parentActionEvent?i.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var s=ur(ur({},n),{env:l&&l.call.env,parentCall:l&&l.call}),c=!e.filter||e.filter(s),d=c?e:void 0,b=new qS(d,s);i.set(n.id,b);var w=void 0;try{w=o(n)}catch(x){throw i.delete(n.id),b.finish(x),x}return b.hasFlowsPending||(i.delete(n.id),b.finish()),w}else{if(!l)return o(n);switch(n.type){case"flow_spawn":return l.incFlowsPending(),o(n);case"flow_resume":case"flow_resume_error":return o(n);case"flow_throw":{var E=n.args[0];try{return o(n)}finally{l.decFlowsPending(),l.hasFlowsPending||(i.delete(n.parentActionEvent.id),l.finish(E))}}case"flow_return":try{return o(n)}finally{l.decFlowsPending(),l.hasFlowsPending||(i.delete(n.parentActionEvent.id),l.finish())}}}}}function GS(e,i,t,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(pc(n))return n;if(rn(n))return Jh("[MSTNode: ".concat(Ud(n).name,"]"));if(typeof n=="function")return Jh("[function]");if(typeof n=="object"&&!Fs(n)&&!Cm(n))return Jh("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(o){return Jh(""+o)}}function VS(e,i){return i&&typeof i=="object"&&"$MST_DATE"in i?new Date(i.$MST_DATE):i}function Jh(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function S5(e,i){lc(function(){km(i).forEach(function(t){return $S(e,t)})})}function $S(e,i){var t=m5(e,i.path||"");if(!t)throw new nt("Invalid action path: ".concat(i.path||""));var n=st(t);if(i.name==="@APPLY_PATCHES")return cc.call(null,t,i.args[0]);if(i.name==="@APPLY_SNAPSHOT")return d5.call(null,t,i.args[0]);if(typeof t[i.name]!="function")throw new nt("Action '".concat(i.name,"' does not exist in '").concat(n.path,"'"));return t[i.name].apply(t,i.args?i.args.map(function(o){return VS(n,o)}):[])}function WS(e,i){var t=[],n=function(s){var c=i?i(s,Om()):!0;c&&t.push(s)},o,l={actions:t,get recording(){return!!o},stop:function(){o&&(o(),o=void 0)},resume:function(){o||(o=E5(e,n))},replay:function(s){S5(s,t)}};return l.resume(),l}function E5(e,i,t){return t===void 0&&(t=!1),P5(e,function(o,l){if(o.type==="action"&&o.id===o.rootId){var s=st(o.context),c={name:o.name,path:R5(st(e),s),args:o.args.map(function(b,w){return GS(s,o.name,w,b)})};if(t){var d=l(o);return i(c),d}else return i(c),l(o)}else return l(o)})}var YS=1,Ed;function Em(){return Ed}function O5(){return YS++}function V0(e,i){var t=st(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var n=t._isRunningAction;t._isRunningAction=!0;var o=Ed;Ed=e;try{return ZS(t,e,i)}finally{Ed=o,t._isRunningAction=n}}function x5(e){if(e)return e.type==="action"?e:e.parentActionEvent}function kd(e,i,t){var n=function(){var o=O5(),l=Ed,s=x5(l);return V0({type:"action",name:i,id:o,args:F5(arguments),context:e,tree:h5(e),rootId:l?l.rootId:o,parentId:l?l.id:0,allParentIds:l?fo(fo([],co(l.allParentIds),!1),[l.id],!1):[],parentEvent:l,parentActionEvent:s},t)};return n._isMSTAction=!0,n._isFlowAction=t._isFlowAction,n}function P5(e,i,t){t===void 0&&(t=!0);var n=st(e);return n.addMiddleWare(i,t)}function KS(e,i,t){t===void 0&&(t=!0);var n={handler:e,includeHooks:t};return i.$mst_middleware=i.$mst_middleware||[],i.$mst_middleware.push(n),i}var XS=function(){function e(i,t){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:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var n=i;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 i=this.middlewares[this.arrayIndex];if(i){var t=i[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function ZS(e,i,t){var n=new XS(e,t);if(n.isEmpty)return Zn(t).apply(null,i.args);var o=null;function l(s){var c=n.getNextMiddleware(),d=c&&c.handler;if(!d)return Zn(t).apply(null,s.args);if(!c.includeHooks&&sr[s.name])return l(s);function b(E,x){o=l(E),x&&(o=x(o))}function w(E){o=E}return d(s,b,w),o}return l(i)}function Om(){for(var e=Em();e&&e.type!=="action";)e=e.parentActionEvent;return e}function C5(e,i,t){for(var n=typeof i=="number"?i:i.id,o=t?e:e.parentActionEvent;o;){if(o.id===n)return!0;o=o.parentActionEvent}return!1}function QS(e,i){return C5(e,i,!1)}function JS(e,i){return C5(e,i,!0)}function eE(e){try{return JSON.stringify(e)}catch(i){return"<Unserializable: ".concat(i,">")}}function k5(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):rn(e)?"<".concat(e,">"):"`".concat(eE(e),"`")}function tE(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function nE(e){var i=e.value,t=e.context[e.context.length-1].type,n=e.context.map(function(c){var d=c.path;return d}).filter(function(c){return c.length>0}).join("/"),o=n.length>0?'at path "/'.concat(n,'" '):"",l=rn(i)?"value of type ".concat(st(i).type.name,":"):pc(i)?"value":"snapshot",s=t&&rn(i)&&t.is(st(i).snapshot);return"".concat(o).concat(l," ").concat(k5(i)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?X5(t)||pc(i)?".":", expected an instance of `".concat(t.name,"` or a snapshot like `").concat(t.describe(),"` instead.")+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function xm(e,i,t){return e.concat([{path:i,type:t}])}function bi(){return dc}function _i(e,i,t){return[{context:e,value:i,message:t}]}function Fp(e){return e.reduce(function(i,t){return i.concat(t)},[])}function Xo(e,i){bE()&&A5(e,i)}function A5(e,i){var t=e.validate(i,[{path:"",type:e}]);if(t.length>0)throw new nt(rE(e,i,t))}function rE(e,i,t){if(t.length!==0)return"Error while converting ".concat(tE(k5(i))," to `").concat(e.name,`\`:
93
+
94
+ `)+t.map(nE).join(`
95
+ `)}var iE=0,aE=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:iE++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:un.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:un.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this.lastCacheModificationPerId.get(i);this.lastCacheModificationPerId.set(i,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this.lastCacheModificationPerId.get(i)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){if(t===void 0&&(t=!0),i.identifierAttribute){var n=i.identifier;this.cache.has(n)||this.cache.set(n,un.array([],zp));var o=this.cache.get(n);if(o.indexOf(i)!==-1)throw new nt("Already registered");o.push(i),t&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this;rm(i.identifierCache.cache).forEach(function(n){return n.forEach(function(o){t.addNodeToCache(o)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(i){if(i.identifierAttribute){var t=i.identifier,n=this.cache.get(t);n&&(n.remove(i),n.length||this.cache.delete(t),this.updateLastCacheModificationPerId(i.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this,n=new e,o=i.path+"/";return x_(this.cache).forEach(function(l){for(var s=co(l,2),c=s[0],d=s[1],b=!1,w=d.length-1;w>=0;w--){var E=d[w];(E===i||E.path.indexOf(o)===0)&&(n.addNodeToCache(E,!1),d.splice(w,1),d.length||t.cache.delete(c),b=!0)}b&&t.updateLastCacheModificationPerId(c)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.cache.get(t);return n?n.some(function(o){return i.isAssignableFrom(o.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.cache.get(t);if(!n)return null;var o=n.filter(function(l){return i.isAssignableFrom(l.type)});switch(o.length){case 0:return null;case 1:return o[0];default:throw new nt("Cannot resolve a reference to type '".concat(i.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(o.map(function(l){return l.path}).join(", ")))}}}),e}();function Pm(e,i,t,n,o){var l=T5(o);if(l){if(l.parent)throw new nt("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(i?i.path:"","/").concat(t,"', but it lives already at '").concat(l.path,"'"));return i&&l.setParent(i,t),l}return new yi(e,i,t,n,o)}function ns(e,i,t,n,o){return new Cd(e,i,t,n,o)}function oE(e){return e instanceof Cd||e instanceof yi}var Lr;(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"})(Lr||(Lr={}));function rn(e){return!!(e&&e.$treenode)}function st(e){if(!rn(e))throw new nt("Value ".concat(e," is no MST Node"));return e.$treenode}function T5(e){return e&&e.$treenode||null}function lE(){return st(this).snapshot}var sE=function(e){return".."};function R5(e,i){if(e.root!==i.root)throw new nt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(i,"' are not part of the same object tree"));for(var t=gc(e.path),n=gc(i.path),o=0;o<t.length&&t[o]===n[o];o++);return t.slice(o).map(sE).join("/")+vp(n.slice(o))}function M5(e,i,t){return t===void 0&&(t=!0),L5(e,gc(i),t)}function L5(e,i,t){t===void 0&&(t=!0);var n=e;try{for(var o=0;o<i.length;o++){var l=i[o];if(l===".."){if(n=n.parent,n)continue}else{if(l===".")continue;if(n){if(n instanceof Cd){var s=n.value;rn(s)&&(n=st(s))}if(n instanceof yi){var c=n.getChildType(l);if(c&&(n=n.getChildNode(l),n))continue}}}throw new nt("Could not resolve '".concat(l,"' in path '").concat(vp(i.slice(0,o))||"/","' while resolving '").concat(vp(i),"'"))}}catch(d){if(!t)return;throw d}return n}function N5(e){if(!e)return dc;var i=Object.keys(e);if(!i.length)return dc;var t=new Array(i.length);return i.forEach(function(n,o){t[o]=e[n]}),t}function uE(e){return z5(e)}var cE=Object.toString(),dc=Object.freeze([]),hc=Object.freeze({}),zp=n_().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(zp);var nt=function(e){_n(i,e);function i(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return i}(Error);function fE(e){return e}var dE=Number.isInteger;function hE(e){return Number(e)===e&&e%1!==0}function pE(e){return Number.isFinite(e)}function Cm(e){return Array.isArray(e)||ri(e)}function km(e){return e?Cm(e)?e:[e]:dc}function gE(e){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];for(var n=0;n<i.length;n++){var o=i[n];for(var l in o)e[l]=o[l]}return e}function Fs(e){var i;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((i=t.constructor)===null||i===void 0?void 0:i.toString())===cE}function I5(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function pc(e,i){return i===void 0&&(i=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||i&&e instanceof Date}function D5(e){return typeof e!="function"}function mE(e,i,t){_r(e)?am(e,i,t):Object.defineProperty(e,i,t)}function zs(e,i,t){mE(e,i,{enumerable:!1,writable:!1,configurable:!0,value:t})}var vE=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(i,t){var n=this;return t===void 0&&(t=!1),t?this.handlers.unshift(i):this.handlers.push(i),function(){n.unregister(i)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(i){return this.handlers.indexOf(i)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this.handlers.indexOf(i);t>=0&&this.handlers.splice(t,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 i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];var n=this.handlers.slice();n.forEach(function(o){return o.apply(void 0,fo([],co(i),!1))})}}),e}(),j5=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(i){var t=this.eventHandlers&&this.eventHandlers[i];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var o=this.eventHandlers[i];return o||(o=this.eventHandlers[i]=new vE),o.register(t,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.eventHandlers&&this.eventHandlers[i];return!!n&&n.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.eventHandlers&&this.eventHandlers[i];n&&n.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this.eventHandlers&&delete this.eventHandlers[i]}}),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(i){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var l=this.eventHandlers&&this.eventHandlers[i];l&&(t=l).emit.apply(t,fo([],co(n),!1))}}),e}();function F5(e){for(var i=new Array(e.length),t=0;t<e.length;t++)i[t]=e[t];return i}function Zg(e,i){return e.indexOf(i)===0}function yE(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function bE(){return typeof process<"u"&&S2&&S2.ENABLE_TYPE_CHECK==="true"}function Qg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function z5(e){return EE(e.name,e)}function _E(e){return e}function wE(e){return function(){var i,t=[];for(i=0;i<arguments.length;i++)t[i]=arguments[i];return c5(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,fo([],co(t),!1))];case 1:return[2,n.sent()]}})}}function SE(e){return c5(this,function(i){switch(i.label){case 0:return[4,e];case 1:return[2,i.sent()]}})}function EE(e,i){var t=function(){var o=O5(),l=Em();if(!l)throw new nt("a mst flow must always have a parent context");var s=x5(l);if(!s)throw new nt("a mst flow must always have a parent action context");var c={name:e,id:o,tree:l.tree,context:l.context,parentId:l.id,allParentIds:fo(fo([],co(l.allParentIds),!1),[l.id],!1),rootId:l.rootId,parentEvent:l,parentActionEvent:s},d=arguments;function b(w,E,x){return w.$mst_middleware=t.$mst_middleware,V0(ur(ur({},c),{type:E,args:[x]}),w)}return new Promise(function(w,E){var x,m=function(){x=i.apply(null,arguments),_(void 0)};m.$mst_middleware=t.$mst_middleware,V0(ur(ur({},c),{type:"flow_spawn",args:F5(d)}),m);function _(P){var g;try{var v=b(function(y){g=x.next(y)},"flow_resume",P);v instanceof Error&&(g=x.throw(v))}catch(y){Qg(function(){b(function(O){E(y)},"flow_throw",y)});return}h(g)}function p(P){var g;try{b(function(v){g=x.throw(v)},"flow_resume_error",P)}catch(v){Qg(function(){b(function(y){E(v)},"flow_throw",v)});return}h(g)}function h(P){if(P.done){Qg(function(){b(function(g){w(g)},"flow_return",P.value)});return}if(!P.value||typeof P.value.then!="function")throw new nt("Only promises can be yielded to `async`, got: "+P);return P.value.then(_,p)}})};return t._isFlowAction=!0,t}function OE(e){if(!("oldValue"in e))throw new nt("Patches without `oldValue` field cannot be inversed");return[xE(e),PE(e)]}function xE(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 PE(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 CE(e){return typeof e=="number"}function Wl(e){return CE(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function B5(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function vp(e){if(e.length===0)return"";var i=function(t){return t.map(Wl).join("/")};return e[0]==="."||e[0]===".."?i(e):"/"+i(e)}function gc(e){var i=e.split("/").map(B5),t=e===""||e==="."||e===".."||Zg(e,"/")||Zg(e,"./")||Zg(e,"../");if(!t)throw new nt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return i[0]===""&&i.shift(),i}var Jg=Symbol("$preProcessorFailed"),kE=function(e){_n(i,e);function i(t,n,o){var l=e.call(this,o||t.name)||this;return Object.defineProperty(l,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(l,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),l}return Object.defineProperty(i.prototype,"flags",{get:function(){return this._subtype.flags|Tt.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(i.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(i.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return Jg}}}),Object.defineProperty(i.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,n.storedValue):t}}),Object.defineProperty(i.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;AE(t.type,this,"create"),t instanceof yi&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var o=t.getSnapshot;t.getSnapshot=function(){return n.postProcessSnapshot(o.call(t),t)},Q5(this._subtype)||(t.getReconciliationType=function(){return n})}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=rn(l)?l:this.preProcessSnapshot(l),c=this._subtype.instantiate(t,n,o,s);return this._fixNode(c),c}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=this._subtype.reconcile(t,rn(n)?n:this.preProcessSnapshot(n),o,l);return s!==t&&this._fixNode(s),s}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=!0);var o=this._subtype.getSnapshot(t);return n?this.postProcessSnapshot(o,t):o}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this.preProcessSnapshotSafe(t);return o===Jg?_i(n,t,"Failed to preprocess value"):this._subtype.validate(o,n)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(i.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=cr(t)?this._subtype:rn(t)?wm(t,!1):this.preProcessSnapshotSafe(t);return n===Jg?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!(this._subtype instanceof fc))return!1;var o=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(t,o)}}),i}(Qo);function AE(e,i){for(var t,n,o=[],l=2;l<arguments.length;l++)o[l-2]=arguments[l];try{for(var s=Sd(o),c=s.next();!c.done;c=s.next()){var d=c.value;e[d]=i[d].bind(i)}}catch(b){t={error:b}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}function TE(e,i,t){return new kE(e,i,t)}var E2="Map.put can only be used to store complex values that have an identifier type attribute";function U5(e,i){var t,n,o=e.getSubTypes();if(o===w5)return!1;if(o){var l=km(o);try{for(var s=Sd(l),c=s.next();!c.done;c=s.next()){var d=c.value;if(!U5(d,i))return!1}}catch(b){t={error:b}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}return e instanceof Ad&&i.push(e),!0}var Gl;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Gl||(Gl={}));var RE=function(e){_n(i,e);function i(t,n){return e.call(this,t,un.ref.enhancer,n)||this}return Object.defineProperty(i.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(i.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(i.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(i.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.set.call(this,""+t,n)}}),Object.defineProperty(i.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new nt("Map.put cannot be used to set empty values");if(rn(t)){var n=st(t);if(n.identifier===null)throw new nt(E2);return this.set(n.identifier,t),t}else if(I5(t)){var o=st(this),l=o.type;if(l.identifierMode!==Gl.YES)throw new nt(E2);var s=l.mapIdentifierAttribute,c=t[s];if(!Tm(c)){var d=this.put(l.getChildType().create(t,o.environment));return this.put(wm(d))}var b=wc(c);return this.set(b,t),this.get(b)}else throw new nt("Map.put can only be used to store complex values")}}),i}(Mp),yp=function(e){_n(i,e);function i(t,n,o){o===void 0&&(o=[]);var l=e.call(this,t)||this;return Object.defineProperty(l,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Gl.UNKNOWN}),Object.defineProperty(l,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Map}),Object.defineProperty(l,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),l._determineIdentifierMode(),l.hookInitializers=o,l}return Object.defineProperty(i.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new i(this.name,this._subType,n)}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return this._determineIdentifierMode(),Pm(this,t,n,o,l)}}),Object.defineProperty(i.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Gl.UNKNOWN){var t=[];if(U5(this._subType,t)){var n=t.reduce(function(o,l){if(!l.identifierAttribute)return o;if(o&&o!==l.identifierAttribute)throw new nt("The objects in a map should all have the same identifier attribute, expected '".concat(o,"', but child of type '").concat(l.name,"' declared attribute '").concat(l.identifierAttribute,"' as identifier"));return l.identifierAttribute},void 0);n?(this.identifierMode=Gl.YES,this.mapIdentifierAttribute=n):this.identifierMode=Gl.NO}}}}),Object.defineProperty(i.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var o=t.type._subType,l={};return Object.keys(n).forEach(function(s){l[s]=o.instantiate(t,s,void 0,n[s])}),l}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new RE(t,this.name)}}),Object.defineProperty(i.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){nm(n,t.unbox);var o=t.type;o.hookInitializers.forEach(function(l){var s=l(n);Object.keys(s).forEach(function(c){var d=s[c],b=kd(n,c,d);zs(n,c,b)})}),Ap(n,this.willChange),Rp(n,this.didChange)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return rm(t.storedValue)}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=t.storedValue.get(""+n);if(!o)throw new nt("Not a child "+n);return o}}),Object.defineProperty(i.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object),o=t.name;n.assertWritable({subpath:o});var l=n.type,s=l._subType;switch(t.type){case"update":{var c=t.newValue,d=t.object.get(o);if(c===d)return null;Xo(s,c),t.newValue=s.reconcile(n.getChildNode(o),t.newValue,n,o),l.processIdentifier(o,t.newValue)}break;case"add":Xo(s,t.newValue),t.newValue=s.instantiate(n,o,void 0,t.newValue),l.processIdentifier(o,t.newValue);break}return t}}),Object.defineProperty(i.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.identifierMode===Gl.YES&&n instanceof yi){var o=n.identifier;if(o!==t)throw new nt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(o,"', but expected: '").concat(t,"'"))}}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return t.getChildren().forEach(function(o){n[o.subpath]=o.snapshot}),n}}),Object.defineProperty(i.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(o){n[o]=t[o].getSnapshot()}),n}}),Object.defineProperty(i.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:Wl(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Wl(t.name),value:t.newValue.snapshot,oldValue:void 0},n);case"delete":var o=t.oldValue.snapshot;return t.oldValue.die(),void n.emitPatch({op:"remove",path:Wl(t.name),oldValue:o},n)}}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o){var l=t.storedValue;switch(o.op){case"add":case"replace":l.set(n,o.value);break;case"remove":l.delete(n);break}}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Xo(this,n);var o=t.storedValue,l={};if(Array.from(o.keys()).forEach(function(c){l[c]=!1}),n)for(var s in n)o.set(s,n[s]),l[""+s]=!0;Object.keys(l).forEach(function(c){l[c]===!1&&o.delete(c)})}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this;return Fs(t)?Fp(Object.keys(t).map(function(l){return o._subType.validate(t[l],xm(n,l,o._subType))})):_i(n,t,"Value is not a plain object")}}),Object.defineProperty(i.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return hc}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.delete(n)}}),i}(fc);yp.prototype.applySnapshot=Zn(yp.prototype.applySnapshot);function ME(e){return new yp("Map<string, ".concat(e.name,">"),e)}function LE(e){return cr(e)&&(e.flags&Tt.Map)>0}var bp=function(e){_n(i,e);function i(t,n,o){o===void 0&&(o=[]);var l=e.call(this,t)||this;return Object.defineProperty(l,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Array}),Object.defineProperty(l,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),l.hookInitializers=o,l}return Object.defineProperty(i.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new i(this.name,this._subType,n)}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return Pm(this,t,n,o,l)}}),Object.defineProperty(i.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=[]);var o=t.type._subType,l={};return n.forEach(function(s,c){var d=""+c;l[d]=o.instantiate(t,d,void 0,s)}),l}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=ur(ur({},zp),{name:this.name});return un.array(N5(t),n)}}),Object.defineProperty(i.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Ra(n).dehancer=t.unbox;var o=t.type;o.hookInitializers.forEach(function(l){var s=l(n);Object.keys(s).forEach(function(c){var d=s[c],b=kd(n,c,d);zs(n,c,b)})}),Ap(n,this.willChange),Rp(n,this.didChange)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=Number(n);if(o<t.storedValue.length)return t.storedValue[o];throw new nt("Not a child: "+n)}}),Object.defineProperty(i.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object);n.assertWritable({subpath:""+t.index});var o=n.type._subType,l=n.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var s=O2(n,o,[l[t.index]],[t.newValue],[t.index]);if(!s)return null;t.newValue=s[0]}break;case"splice":{var c=t.index,d=t.removedCount,b=t.added,w=O2(n,o,l.slice(c,c+d),b,b.map(function(x,m){return c+m}));if(!w)return null;t.added=w;for(var E=c+d;E<l.length;E++)l[E].setParent(n,""+(E+b.length-d))}break}return t}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(i.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=[];return Object.keys(t).forEach(function(o){n.push(t[o].getSnapshot())}),n}}),Object.defineProperty(i.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:t.removed.map(function(l){return l.snapshot})},n);for(var o=t.removedCount-1;o>=0;o--)n.emitPatch({op:"remove",path:""+(t.index+o),oldValue:t.removed[o].snapshot},n);for(var o=0;o<t.addedCount;o++)n.emitPatch({op:"add",path:""+(t.index+o),value:t.added[o].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o){var l=t.storedValue,s=n==="-"?l.length:Number(n);switch(o.op){case"replace":l[s]=o.value;break;case"add":l.splice(s,0,o.value);break;case"remove":l.splice(s,1);break}}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Xo(this,n);var o=t.storedValue;o.replace(n)}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this;return Cm(t)?Fp(t.map(function(l,s){return o._subType.validate(l,xm(n,""+s,o._subType))})):_i(n,t,"Value is not an array")}}),Object.defineProperty(i.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return dc}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.splice(Number(n),1)}}),i}(fc);bp.prototype.applySnapshot=Zn(bp.prototype.applySnapshot);function NE(e){return new bp("".concat(e.name,"[]"),e)}function O2(e,i,t,n,o){for(var l=!0,s=0;;s++){var c=s<=n.length-1,d=t[s],b=c?n[s]:void 0,w=""+o[s];if(oE(b)&&(b=b.storedValue),!d&&!c)break;if(!c)l=!1,t.splice(s,1),d instanceof yi&&d.createObservableInstanceIfNeeded(),d.die(),s--;else if(d)if(x2(d,b))t[s]=e1(i,e,w,b,d);else{for(var x=void 0,m=s;m<t.length;m++)if(x2(t[m],b)){x=t.splice(m,1)[0];break}l=!1;var E=e1(i,e,w,b,x);t.splice(s,0,E)}else{if(rn(b)&&st(b).parent===e)throw new nt("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(w,"', but it lives already at '").concat(st(b).path,"'"));l=!1;var E=e1(i,e,w,b);t.splice(s,0,E)}}return l?null:t}function e1(e,i,t,n,o){Xo(e,n);function l(){if(rn(n)){var c=st(n);if(c.assertAlive(hc),c.parent!==null&&c.parent===i)return c.setParent(i,t),c}return o?e.reconcile(o,n,i,t):e.instantiate(i,t,void 0,n)}var s=l();return o&&o!==s&&(o instanceof yi&&o.createObservableInstanceIfNeeded(),o.die()),s}function x2(e,i){if(!e.isAlive)return!1;if(rn(i)){var t=st(i);return t.isAlive&&t===e}if(e.snapshot===i)return!0;if(!(e instanceof yi))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Fs(i)&&n.is(i)&&n.isMatchingSnapshotId(e,i)}function IE(e){return cr(e)&&(e.flags&Tt.Array)>0}var P2="preProcessSnapshot",C2="postProcessSnapshot";function DE(){return st(this).toString()}var k2={name:"AnonymousModel",properties:{},initializers:dc};function jE(e){var i=Object.keys(e),t=new Set;return i.forEach(function(n){if(t.has(n))throw new nt("".concat(n," is declared twice in the model. Model should not contain the same keys"));t.add(n)}),i.reduce(function(n,o){if(o in sr)throw new nt("Hook '".concat(o,"' was defined as property. Hooks should be defined as part of the actions"));var l=Object.getOwnPropertyDescriptor(e,o);if("get"in l)throw new nt("Getters are not supported as properties. Please use views instead");var s=l.value;if(s==null)throw new nt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(pc(s))n[o]=Bs(HE(s),s);else if(s instanceof yp)n[o]=Bs(s,{});else if(s instanceof bp)n[o]=Bs(s,[]);else if(!cr(s))throw new nt("Invalid type definition for property '".concat(o,"', cannot infer a type from a value like '").concat(s,"' (").concat(typeof s,")"));return n},ur({},e))}var Ad=function(e){_n(i,e);function i(t){var n=e.call(this,t.name||k2.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.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(o){return n.cloneAndEnhance({name:o})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(o){return n.cloneAndEnhance({properties:o})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(o){var l=n.preProcessor;return l?n.cloneAndEnhance({preProcessor:function(s){return l(o(s))}}):n.cloneAndEnhance({preProcessor:o})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(o){var l=n.postProcessor;return l?n.cloneAndEnhance({postProcessor:function(s){return o(l(s))}}):n.cloneAndEnhance({postProcessor:o})}}),Object.assign(n,k2,t),n.properties=jE(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(i.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(n,o){if(o.flags&Tt.Identifier){if(t)throw new nt("Cannot define property '".concat(n,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=n}}),t}}),Object.defineProperty(i.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new i({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})}}),Object.defineProperty(i.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,o=function(l){return n.instantiateActions(l,t(l)),l};return this.cloneAndEnhance({initializers:[o]})}}),Object.defineProperty(i.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!Fs(n))throw new nt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(o){if(o===P2)throw new nt("Cannot define action '".concat(P2,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(o===C2)throw new nt("Cannot define action '".concat(C2,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var l=n[o],s=t[o];if(o in sr&&s){var c=l;l=function(){s.apply(null,arguments),c.apply(null,arguments)}}var d=l.$mst_middleware,b=l.bind(n);b._isFlowAction=l._isFlowAction||!1,b.$mst_middleware=d;var w=kd(t,o,b);n[o]=w,zs(t,o,w)})}}),Object.defineProperty(i.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;if(typeof t!="function")throw new nt("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var o=function(l){return n.instantiateVolatileState(l,t(l)),l};return this.cloneAndEnhance({initializers:[o]})}}),Object.defineProperty(i.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!Fs(n))throw new nt("volatile state initializer should return a plain object containing state");im(t,n)}}),Object.defineProperty(i.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,o=function(l){var s=t(l),c=s.actions,d=s.views,b=s.state,w=uS(s,["actions","views","state"]);for(var E in w)throw new nt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(E,"'"));return b&&n.instantiateVolatileState(l,b),d&&n.instantiateViews(l,d),c&&n.instantiateActions(l,c),l};return this.cloneAndEnhance({initializers:[o]})}}),Object.defineProperty(i.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,o=function(l){return n.instantiateViews(l,t(l)),l};return this.cloneAndEnhance({initializers:[o]})}}),Object.defineProperty(i.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!Fs(n))throw new nt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(o){var l,s=Object.getOwnPropertyDescriptor(n,o);if("get"in s)am(t,o,s),om(t,(l={},l[o]=$s,l));else if(typeof s.value=="function")zs(t,o,s.value);else throw new nt("A view member should either be a function or getter based property")})}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=rn(l)?l:this.applySnapshotPreProcessor(l);return Pm(this,t,n,o,s)}}),Object.defineProperty(i.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var o=t.type,l={};return o.forAllProps(function(s,c){l[s]=c.instantiate(t,s,void 0,n[s])}),l}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=ur(ur({},zp),{name:this.name});return un.object(t,hc,n)}}),Object.defineProperty(i.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){zs(n,"toString",DE),this.forAllProps(function(o){nm(n,o,t.unbox)}),this.initializers.reduce(function(o,l){return l(o)},n),Ap(n,this.willChange),Rp(n,this.didChange)}}),Object.defineProperty(i.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,o=st(n.object),l=n.name;o.assertWritable({subpath:l});var s=o.type.properties[l];return s&&(Xo(s,n.newValue),n.newValue=s.reconcile(o.getChildNode(l),n.newValue,o,l)),n}}),Object.defineProperty(i.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,o=st(n.object),l=o.type.properties[n.name];if(l){var s=n.oldValue?n.oldValue.snapshot:void 0;o.emitPatch({op:"replace",path:Wl(n.name),value:n.newValue.snapshot,oldValue:s},o)}}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,o=[];return this.forAllProps(function(l){o.push(n.getChildNode(t,l))}),o}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o;if(!(n in this.properties))throw new nt("Not a value property: "+n);var l=Ra(t.storedValue,n),s=(o=l.raw)===null||o===void 0?void 0:o.call(l);if(!s)throw new nt("Node not available for property "+n);return s}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this;n===void 0&&(n=!0);var l={};return this.forAllProps(function(s,c){try{var d=uo(t.storedValue,s);d.reportObserved()}catch{throw new nt("".concat(s," property is declared twice"))}l[s]=o.getChildNode(t,s).snapshot}),n?this.applySnapshotPostProcessor(l):l}}),Object.defineProperty(i.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(o){n[o]=t[o].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o){if(!(o.op==="replace"||o.op==="add"))throw new nt("object does not support operation ".concat(o.op));t.storedValue[n]=o.value}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Xo(this,n);var o=this.applySnapshotPreProcessor(n);this.forAllProps(function(l){t.storedValue[l]=o[l]})}}),Object.defineProperty(i.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.preProcessor;return n?n.call(null,t):t}}),Object.defineProperty(i.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.postProcessor;return n?n.call(null,t):t}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this,l=this.applySnapshotPreProcessor(t);return Fs(l)?Fp(this.propertyNames.map(function(s){return o.properties[s].validate(l[s],xm(n,s,o.properties[s]))})):_i(n,l,"Value is not a plain object")}}),Object.defineProperty(i.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.propertyNames.forEach(function(o){return t(o,n.properties[o])})}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(n){return n+": "+t.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(i.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return hc}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue[n]=void 0}}),i}(fc);Ad.prototype.applySnapshot=Zn(Ad.prototype.applySnapshot);function FE(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new Ad({name:t,properties:n})}function zE(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var t=typeof e[0]=="string",n=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(o,l){return o.cloneAndEnhance({name:o.name+"_"+l.name,properties:l.properties,initializers:l.initializers,preProcessor:function(s){return l.applySnapshotPreProcessor(o.applySnapshotPreProcessor(s))},postProcessor:function(s){return l.applySnapshotPostProcessor(o.applySnapshotPostProcessor(s))}})}).named(n)}function q5(e){return cr(e)&&(e.flags&Tt.Object)>0}var el=function(e){_n(i,e);function i(t,n,o,l){l===void 0&&(l=fE);var s=e.call(this,t)||this;return Object.defineProperty(s,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"checker",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(s,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:l}),s.flags=n,s}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return ns(this,t,n,o,l)}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(pc(t)&&this.checker(t))return bi();var o=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return _i(n,t,"Value is not a ".concat(o))}}),i}(Zs),H5=new el("string",Tt.String,function(e){return typeof e=="string"}),G5=new el("number",Tt.Number,function(e){return typeof e=="number"}),BE=new el("integer",Tt.Integer,function(e){return dE(e)}),UE=new el("float",Tt.Float,function(e){return hE(e)}),qE=new el("finite",Tt.Finite,function(e){return pE(e)}),V5=new el("boolean",Tt.Boolean,function(e){return typeof e=="boolean"}),$5=new el("null",Tt.Null,function(e){return e===null}),W5=new el("undefined",Tt.Undefined,function(e){return e===void 0}),Y5=new el("Date",Tt.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});Y5.getSnapshot=function(e){return e.storedValue.getTime()};var K5=Y5;function HE(e){switch(typeof e){case"string":return H5;case"number":return G5;case"boolean":return V5;case"object":if(e instanceof Date)return K5}throw new nt("Cannot determine primitive type from value "+e)}function X5(e){return cr(e)&&(e.flags&(Tt.String|Tt.Number|Tt.Integer|Tt.Boolean|Tt.Date))>0}var GE=function(e){_n(i,e);function i(t){var n=e.call(this,JSON.stringify(t))||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:Tt.Literal}),n.value=t,n}return Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return ns(this,t,n,o,l)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return pc(t)&&t===this.value?bi():_i(n,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),i}(Zs);function Z5(e){return new GE(e)}function VE(e){return cr(e)&&(e.flags&Tt.Literal)>0}var $E=function(e){_n(i,e);function i(t,n,o,l){var s=e.call(this,t)||this;return Object.defineProperty(s,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(s,"_message",{enumerable:!0,configurable:!0,writable:!0,value:l}),s}return Object.defineProperty(i.prototype,"flags",{get:function(){return this._subtype.flags|Tt.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return this._subtype.instantiate(t,n,o,l)}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this._subtype.validate(t,n);if(o.length>0)return o;var l=rn(t)?st(t).snapshot:t;return this._predicate(l)?bi():_i(n,t,this._message(t))}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return this._subtype.reconcile(t,n,o,l)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),i}(Qo);function WE(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var t=typeof e[0]=="string"?e.shift():cr(e[0])?e[0].name:null,n=e[0],o=e[1],l=e[2]?e[2]:function(s){return"Value does not respect the refinement predicate"};return new $E(t,n,o,l)}function YE(e){return cr(e)&&(e.flags&Tt.Refinement)>0}function KE(e,i){var t=typeof e=="string"?i:e,n=Bp.apply(void 0,fo([],co(t.map(function(o){return Z5(""+o)})),!1));return typeof e=="string"&&(n.name=e),n}var XE=function(e){_n(i,e);function i(t,n,o){var l=e.call(this,t)||this;return Object.defineProperty(l,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),o=ur({eager:!0,dispatcher:void 0},o),l._dispatcher=o.dispatcher,o.eager||(l._eager=!1),l}return Object.defineProperty(i.prototype,"flags",{get:function(){var t=Tt.Union;return this._types.forEach(function(n){t|=n.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(n){return n.isAssignableFrom(t)})}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=this.determineType(l,void 0);if(!s)throw new nt("No matching type for union "+this.describe());return s.instantiate(t,n,o,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=this.determineType(n,t.getReconciliationType());if(!s)throw new nt("No matching type for union "+this.describe());return s.reconcile(t,n,o,l)}}),Object.defineProperty(i.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._dispatcher?this._dispatcher(t):n?n.is(t)?n:this._types.filter(function(o){return o!==n}).find(function(o){return o.is(t)}):this._types.find(function(o){return o.is(t)})}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._dispatcher)return this._dispatcher(t).validate(t,n);for(var o=[],l=0,s=0;s<this._types.length;s++){var c=this._types[s],d=c.validate(t,n);if(d.length===0){if(this._eager)return bi();l++}else o.push(d)}return l===1?bi():_i(n,t,"No type is applicable for the union").concat(Fp(o))}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),i}(Qo);function Bp(e){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var n=cr(e)?void 0:e,o=cr(e)?fo([e],co(i),!1):i,l="("+o.map(function(s){return s.name}).join(" | ")+")";return new XE(l,o,n)}function Q5(e){return cr(e)&&(e.flags&Tt.Union)>0}var ZE=function(e){_n(i,e);function i(t,n,o){var l=e.call(this,t.name)||this;return Object.defineProperty(l,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(l,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:o}),l}return Object.defineProperty(i.prototype,"flags",{get:function(){return this._subtype.flags|Tt.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){if(this.optionalValues.indexOf(l)>=0){var s=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,n,o,s)}return this._subtype.instantiate(t,n,o,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return this._subtype.reconcile(t,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),o,l)}}),Object.defineProperty(i.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&Xo(this,t),t}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.optionalValues.indexOf(t)>=0?bi():this._subtype.validate(t,n)}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),i}(Qo);function QE(e,i){if(typeof i!="function"&&rn(i))throw new nt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Bs(e,i,t){return QE(e,i),new ZE(e,i,t||JE)}var JE=[void 0];function eO(e){return cr(e)&&(e.flags&Tt.Optional)>0}var tO=Bs(W5,void 0),nO=Bs($5,null);function J5(e){return Bp(e,tO)}function rO(e){return Bp(e,nO)}var iO=function(e){_n(i,e);function i(t,n){var o=e.call(this,t)||this;return Object.defineProperty(o,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o}return Object.defineProperty(i.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Tt.Late},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var n=void 0;try{n=this._definition()}catch(o){if(o instanceof ReferenceError)n=void 0;else throw o}if(t&&n===void 0)throw new nt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return this.getSubType(!0).instantiate(t,n,o,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return this.getSubType(!0).reconcile(t,n,o,l)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this.getSubType(!1);return o?o.validate(t,n):bi()}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getSubType(!1);return n?n.isAssignableFrom(t):!1}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||w5}}),i}(Qo);function aO(e,i){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?i:e;return new iO(t,n)}function oO(e){return cr(e)&&(e.flags&Tt.Late)>0}function lO(e,i){return new sO(e,i)}var sO=function(e){_n(i,e);function i(t,n){var o=e.call(this,t)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Lazy}),Object.defineProperty(o,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(o,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:un.array()}),B0(function(){return o.pendingNodeList.length>0&&o.pendingNodeList.some(function(l){return l.isAlive&&o.options.shouldLoadPredicate(l.parent?l.parent.value:null)})},function(){o.options.loadType().then(Zn(function(l){o.loadedType=l,o.pendingNodeList.forEach(function(s){s.parent&&o.loadedType&&s.parent.applyPatches([{op:"replace",path:"/".concat(s.subpath),value:s.snapshot}])})}))}),o}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=this;if(this.loadedType)return this.loadedType.instantiate(t,n,o,l);var c=ns(this,t,n,o,l);return this.pendingNodeList.push(c),B0(function(){return!c.isAlive},function(){return s.pendingNodeList.splice(s.pendingNodeList.indexOf(c),1)}),c}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.loadedType?this.loadedType.validate(t,n):D5(t)?bi():_i(n,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return this.loadedType?(t.die(),this.loadedType.instantiate(o,l,o.environment,n)):e.prototype.reconcile.call(this,t,n,o,l)}}),i}(Zs),e4=function(e){_n(i,e);function i(t){var n=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Frozen}),n}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){return ns(this,t,n,o,l)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return D5(t)?this.subType?this.subType.validate(t,n):bi():_i(n,t,"Value is not serializable and cannot be frozen")}}),i}(Zs),A2=new e4;function uO(e){return arguments.length===0?A2:cr(e)?new e4(e):Bs(A2,e)}function cO(e){return cr(e)&&(e.flags&Tt.Frozen)>0}function fO(e){switch(e){case sr.beforeDestroy:return"destroy";case sr.beforeDetach:return"detach";default:return}}var dO=function(){function e(i,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),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}),Tm(i))this.identifier=i;else if(rn(i)){var n=st(i);if(!n.identifierAttribute)throw new nt("Can only store references with a defined identifier attribute.");var o=n.unnormalizedIdentifier;if(o==null)throw new nt("Can only store references to tree nodes with a defined identifier.");this.identifier=o}else throw new nt("Can only store references to tree nodes or identifiers, got: '".concat(i,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=wc(this.identifier),n=i.root,o=n.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==o){var l=this.targetType,s=n.identifierCache.resolve(l,t);if(!s)throw new Am("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(i.path,")"));this.resolvedReference={node:s,lastCacheModification:o}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),Am=function(e){_n(i,e);function i(t){var n=e.call(this,t)||this;return Object.setPrototypeOf(n,i.prototype),n}return i}(Error),t4=function(e){_n(i,e);function i(t,n){var o=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(o,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Reference}),o}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return Tm(t)?bi():_i(n,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(i.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=n.parent;if(!(!s||!s.isAlive)){var c=s.storedValue;c&&this.onInvalidated({cause:t,parent:c,invalidTarget:l?l.storedValue:void 0,invalidId:o,replaceRef:function(d){cc(n.root.storedValue,{op:"replace",value:d,path:n.path})},removeRef:function(){q5(s.type)?this.replaceRef(void 0):cc(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(i.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var o=this,l=this.getValue(t);if(l){var s=st(l),c=function(w,E){var x=fO(E);x&&o.fireInvalidated(x,t,n,s)},d=s.registerHook(sr.beforeDetach,c),b=s.registerHook(sr.beforeDestroy,c);return function(){d(),b()}}}}),Object.defineProperty(i.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o){var l=this;if(this.onInvalidated){var s;t.registerHook(sr.beforeDestroy,function(){s&&s()});var c=function(d){s&&s();var b=t.parent,w=b&&b.storedValue;if(b&&b.isAlive&&w){var E=void 0;o?E=!!o.get(n,w):E=t.root.identifierCache.has(l.targetType,wc(n)),E?s=l.addTargetNodeWatcher(t,n):d||l.fireInvalidated("invalidSnapshotReference",t,n,null)}};t.state===Lr.FINALIZED?c(!0):(t.isRoot||t.root.registerHook(sr.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(sr.afterAttach,function(){c(!1)}))}}}),i}(Zs),hO=function(e){_n(i,e);function i(t,n){return e.call(this,t,n)||this}return Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=t.storedValue;return n.resolvedValue}}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t.storedValue;return n.identifier}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=rn(l)?g5(l):l,c=new dO(l,this.targetType),d=ns(this,t,n,o,c);return c.node=d,this.watchTargetNodeForInvalidations(d,s,void 0),d}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){if(!t.isDetaching&&t.type===this){var s=rn(n),c=t.storedValue;if(!s&&c.identifier===n||s&&c.resolvedValue===n)return t.setParent(o,l),t}var d=this.instantiate(o,l,void 0,n);return t.die(),d}}),i}(t4),pO=function(e){_n(i,e);function i(t,n,o){var l=e.call(this,t,o)||this;return Object.defineProperty(l,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),l}return Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return n}}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=rn(l)?this.options.set(l,t?t.storedValue:null):l,c=ns(this,t,n,o,s);return this.watchTargetNodeForInvalidations(c,s,this.options),c}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=rn(n)?this.options.set(n,t?t.storedValue:null):n;if(!t.isDetaching&&t.type===this&&t.storedValue===s)return t.setParent(o,l),t;var c=this.instantiate(o,l,void 0,s);return t.die(),c}}),i}(t4);function n4(e,i){var t=i||void 0,n=i?i.onInvalidated:void 0;return t&&(t.get||t.set)?new pO(e,{get:t.get,set:t.set},n):new hO(e,n)}function gO(e){return cr(e)&&(e.flags&Tt.Reference)>0}function mO(e,i){var t=n4(e,ur(ur({},i),{onInvalidated:function(n){i&&i.onInvalidated&&i.onInvalidated(n),n.removeRef()}}));return i&&i.acceptsUndefined===!1?t:J5(t)}var r4=function(e){_n(i,e);function i(t,n){var o=e.call(this,t)||this;return Object.defineProperty(o,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Identifier}),o}return Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){if(!t||!(t.type instanceof Ad))throw new nt("Identifier types can only be instantiated as direct child of a model type");return ns(this,t,n,o,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){if(t.storedValue!==n)throw new nt("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return t.setParent(o,l),t}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return typeof t!==this.validType?_i(n,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):bi()}}),i}(Zs),vO=function(e){_n(i,e);function i(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Identifier}),t}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),i}(r4),yO=function(e){_n(i,e);function i(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),i}(r4),bO=new vO,_O=new yO;function wO(e){return cr(e)&&(e.flags&Tt.Identifier)>0}function wc(e){return""+e}function Tm(e){return typeof e=="string"||typeof e=="number"}function SO(e){return new EO(e)}var EO=function(e){_n(i,e);function i(t){var n=e.call(this,t.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Custom}),n}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.options.isTargetType(t))return bi();var o=this.options.getValidationMessage(t);return o?_i(n,t,"Invalid value for type '".concat(this.name,"': ").concat(o)):bi()}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=this.options.isTargetType(l)?l:this.options.fromSnapshot(l,t&&t.root.environment);return ns(this,t,n,o,s)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,o,l){var s=!this.options.isTargetType(n);if(!t.isDetaching){var c=t.type===this&&(s?n===t.snapshot:n===t.storedValue);if(c)return t.setParent(o,l),t}var d=s?this.options.fromSnapshot(n,o.root.environment):n,b=this.instantiate(o,l,void 0,d);return t.die(),b}}),i}(Zs),T2={enumeration:KE,model:FE,compose:zE,custom:SO,reference:n4,safeReference:mO,union:Bp,optional:Bs,literal:Z5,maybe:J5,maybeNull:rO,refinement:WE,string:H5,boolean:V5,number:G5,integer:BE,float:UE,finite:qE,Date:K5,map:ME,array:NE,frozen:uO,identifier:bO,identifierNumber:_O,late:aO,lazy:lO,undefined:W5,null:$5,snapshotProcessor:TE};const OO=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:TS,addMiddleware:P5,applyAction:S5,applyPatch:cc,applySnapshot:d5,cast:NS,castFlowReturn:_E,castToReferenceSnapshot:DS,castToSnapshot:IS,clone:CS,createActionTrackingMiddleware:US,createActionTrackingMiddleware2:HS,decorate:KS,destroy:AS,detach:kS,escapeJsonPath:Wl,flow:z5,getChildType:cS,getEnv:RS,getIdentifier:g5,getLivelinessChecking:u5,getMembers:LS,getNodeId:jS,getParent:vS,getParentOfType:bS,getPath:p5,getPathParts:_S,getPropertyMembers:y5,getRelativePath:PS,getRoot:h5,getRunningActionContext:Om,getSnapshot:wm,getType:Ud,hasEnv:MS,hasParent:mS,hasParentOfType:yS,isActionContextChildOf:QS,isActionContextThisOrChildOf:JS,isAlive:Sm,isArrayType:IE,isFrozenType:cO,isIdentifierType:wO,isLateType:oO,isLiteralType:VE,isMapType:LE,isModelType:q5,isOptionalType:eO,isPrimitiveType:X5,isProtected:gS,isReferenceType:gO,isRefinementType:YE,isRoot:wS,isStateTreeNode:rn,isType:cr,isUnionType:Q5,isValidReference:xS,joinJsonPath:vp,onAction:E5,onPatch:f5,onSnapshot:fS,process:uE,protect:hS,recordActions:WS,recordPatches:dS,resolveIdentifier:ES,resolvePath:SS,setLivelinessChecking:s5,setLivelynessChecking:sS,splitJsonPath:gc,t:T2,toGenerator:SE,toGeneratorFunction:wE,tryReference:OS,tryResolve:m5,typecheck:A5,types:T2,unescapeJsonPath:B5,unprotect:pS,walk:v5},Symbol.toStringTag,{value:"Module"})),ea=Xl(OO);var t1={},R2;function i4(){return R2||(R2=1,function(e){function i({oldText:t,newText:n,element:o}){if(!(n.length/Math.max(20,t.length)>=4))return o.fontSize;const l=o.width*o.page.computedHeight/n.length,s=1.5*Math.sqrt(l),c=o.fontSize;return Math.min(c,Math.max(5,Math.round(s)))}Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=i}(t1)),t1}var M2;function a4(){return M2||(M2=1,function(e){var i=ad&&ad.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=R,e.getDir=D,e.usePrevious=X;const t=i(Tn()),n=Qi,o=Jo,l=yc,s=La,c=i(Ji()),d=oS,b=zd(),w=Ks(),E=Bd(),x=ts(),m=o5(),_=jp(),p=bc(),h=_c(),P=Xs(),g=ea,v=i4();c.default._fixTextRendering=!0;const y=document.createElement("style");y.type="text/css",document.head.appendChild(y);const O={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function M(z){var I="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+I+"]*?["+I+"]").test(z)}function R(z){z=z.replace(/\s/g,"");let I=0;for(var U=0;U<z.length;U++)M(z[U])&&(I+=1);return I>z.length/2}function D(z){return R(z)?"rtl":"ltr"}const T=(0,n.observer)(({textNodeRef:z,element:I,onBlur:U,selectAll:$,cursorPosition:ee})=>{const[G,Z]=t.default.useState(O),W=z.current;t.default.useLayoutEffect(()=>{const se={};se.width=W.width()-2*W.padding()+"px",se.height=W.height()-2*W.padding()+W.fontSize()*W.lineHeight()+"px",se.fontSize=W.fontSize()+"px",se.lineHeight=W.lineHeight()+.01,se.fontFamily=W.fontFamily(),se.textAlign=W.align(),se.color=W.fill(),se.fontWeight=I.fontWeight,se.fontStyle=I.fontStyle,se.letterSpacing=I.letterSpacing+"em";const de=`
96
+ .polotno-input::placeholder {
97
+ color: ${G.color};
98
+ opacity: 0.6;
99
+ }
100
+ `;y.innerHTML="",y.appendChild(document.createTextNode(de)),JSON.stringify(se)!==JSON.stringify(G)&&Z(se)});const te=t.default.useRef(null);t.default.useLayoutEffect(()=>{var se;const de=te.current;if(!de)return;(se=te.current)===null||se===void 0||se.focus();const pe=ee||de.value.length;de.selectionStart=de.selectionEnd=pe,$&&(de==null||de.select(),document.execCommand("selectAll",!1,null))},[]),t.default.useEffect(()=>{window.addEventListener("blur",U);const se=de=>{var pe;!((pe=te.current)===null||pe===void 0)&&pe.contains(de.target)||U()};return window.addEventListener("touchstart",se),()=>{window.removeEventListener("blur",U),window.removeEventListener("touchstart",se)}},[]);let re=0;const ie=W.textArr.length*W.lineHeight()*W.fontSize();I.verticalAlign==="middle"&&(re=(I.a.height-ie)/2),I.verticalAlign==="bottom"&&(re=I.a.height-ie);const oe=(0,m.removeTags)(I.text);return t.default.createElement("textarea",{className:"polotno-input",ref:te,dir:D(oe),style:Object.assign(Object.assign(Object.assign({},O),G),{paddingTop:re+"px"}),value:oe,onChange:se=>{const de=(0,v.getLimitedFontSize)({oldText:I.text,newText:se.target.value,element:I});I.set({text:se.target.value,fontSize:de})},placeholder:I.placeholder,onBlur:U})}),S=z=>t.default.createElement(l.Html,null,t.default.createElement(T,Object.assign({},z))),A=z=>{const[I,U]=t.default.useState(!1),$=t.default.useRef(!1);return t.default.useEffect(()=>{var ee=!0;return setTimeout(()=>{ee&&(z._editModeEnabled&&($.current=!0),U(!0),setTimeout(()=>{$.current=!1},50))},50),()=>{ee=!1}},[]),{editorEnabled:I&&z._editModeEnabled,selectAll:$.current}},N=(z,I)=>{const[U,$]=t.default.useReducer(G=>G+1,0),ee=t.default.useRef((0,E.isFontLoaded)(I));return t.default.useLayoutEffect(()=>{if(ee.current=(0,E.isFontLoaded)(I),ee.current)return;let G=!0;return(async()=>{ee.current=!1,$();const Z=(0,w.incrementLoader)(`text ${I}`);await z.loadFont(I),setTimeout(Z,100),G&&(ee.current=!0,$())})(),()=>{G=!1}},[I]),[ee.current]};e.useFontLoader=N;const k=({fontLoaded:z,fontFamily:I,fontSize:U,lineHeight:$})=>t.default.useMemo(()=>{if(typeof $=="number")return $;const ee=document.createElement("div");ee.style.fontFamily=I,ee.style.fontSize=U+"px",ee.style.lineHeight=$,ee.innerText="Test text",document.body.appendChild(ee);const G=ee.offsetHeight;return document.body.removeChild(ee),G/U},[z,I,U,$]);function L(z){var I=z.getAbsoluteTransform().copy();I.invert();var U=z.getStage().getPointerPosition();return I.point(U)}function B(z){var I;const U=z.target,$=L(U),ee=U.textArr,G=Math.floor($.y/(U.fontSize()*U.lineHeight())),Z=ee.slice(0,G).reduce((re,ie)=>re+ie.text.length,G),W=(I=ee[G])!==null&&I!==void 0?I:ee[0];let te=0;return U.align()==="right"?te=U.width()-W.width:U.align()==="center"&&(te=U.width()/2-W.width/2),Z+Math.round(($.x-te)/W.width*W.text.length)}function X(z){const I=t.default.useRef(z),U=t.default.useRef(z);return t.default.useMemo(()=>{U.current=I.current,I.current=z},[z]),U.current}function K(z){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(z)}function Q(z,I,U=!1){const $=z.fontSize(),ee=z.height(),G=(0,m.removeTags)(I.text);let Z=I.a.fontSize;z.height(void 0);const W=Math.round(2*I.a.fontSize)-1;for(let te=1;te<W;te++){const re=I.a.height&&z.height()>I.a.height;let ie=G.split(`
101
+ `).join(" ").split(/[\s-]+/).reduce((de,pe)=>K(pe)?de.concat(pe.split("")):de.concat(pe),[]),oe=z.textArr.map(de=>de.text).join(";");const se=ie.find(de=>!oe.includes(de)||(oe=oe.replace(de,""),!1));if(!(re||se&&!U))break;Z-=.5,z.fontSize(Z)}return z.fontSize($),z.height(ee),Z}function H({lines:z,lineHeight:I,width:U,align:$="left",padding:ee=0,cornerRadius:G=0}){var Z;z.forEach((ie,oe)=>{ie.cx=U/2,$==="right"?ie.cx=U-ie.width/2:$==="left"&&(ie.cx=ie.width/2),$!=="justify"||ie.lastInParagraph||(ie.width=U),$==="justify"&&(ie.cx=ie.width/2)});let W=`M ${(Z=z[0])===null||Z===void 0?void 0:Z.cx} ${-ee}`;z.forEach((ie,oe)=>{const{cx:se}=ie,de=z[oe-1];de&&de.width>ie.width?W+=` L ${se+ie.width/2+ee} ${oe*I+ee}`:W+=` L ${se+ie.width/2+ee} ${oe*I-ee}`;const pe=z[oe+1];pe&&pe.width>ie.width?W+=` L ${se+ie.width/2+ee} ${(oe+1)*I-ee}`:W+=` L ${se+ie.width/2+ee} ${(oe+1)*I+ee}`});for(var te=z.length-1;te>=0;te--){const ie=z[te],{cx:oe}=ie,se=z[te+1];se&&se.width>ie.width?W+=` L ${oe-ie.width/2-ee} ${(te+1)*I-ee}`:W+=` L ${oe-ie.width/2-ee} ${(te+1)*I+ee}`;const de=z[te-1];de&&de.width>ie.width?W+=` L ${oe-ie.width/2-ee} ${te*I+ee}`:W+=` L ${oe-ie.width/2-ee} ${te*I-ee}`}W+=" Z";const re=(0,d.parsePath)(W);return(0,d.roundCommands)(re,G).path}e.getLineHeight=k,e.TextElement=(0,n.observer)(({element:z,store:I})=>{const U=t.default.useRef(null),$=t.default.useRef(null),{editorEnabled:ee,selectAll:G}=A(z),[Z,W]=t.default.useState(!1),[te,re]=t.default.useState(!1),ie=t.default.useRef(z.a.height),oe=I.selectedShapes.indexOf(z)>=0,{textVerticalResizeEnabled:se}=x.flags,de=X(z.fontFamily),[pe,Oe]=t.default.useState([]);t.default.useEffect(()=>{var Ke,ze;const Be=(ze=(Ke=U.current)===null||Ke===void 0?void 0:Ke.textArr)!==null&&ze!==void 0?ze:[];JSON.stringify(Be)!==JSON.stringify(pe)&&Oe(Be)}),t.default.useEffect(()=>{if(z.a.width)return;const Ke=U.current;Ke.width(600),z.set({width:1.4*Ke.getTextWidth()})},[]),t.default.useLayoutEffect(()=>(0,s.autorun)(()=>{const Ke=U.current;(0,_.applyFilter)(Ke,z)}));const[_e]=(0,e.useFontLoader)(I,z.fontFamily),Te=(0,m.removeTags)(z.text),ce=()=>{const Ke=U.current.clone({height:void 0}),ze=Math.ceil(Ke.fontSize()*Ke.lineHeight()*Ke.textArr.length+1);return Ke.destroy(),ze};t.default.useLayoutEffect(()=>{if(!_e)return;const{textOverflow:Ke,textSplitAllowed:ze}=x.flags;if(z.a.height){if(!I.isPlaying)if(Ke!=="change-font-size"||te){if(Ke==="resize"){const Be=ce();se&&z.a.height<Be&&I.history.ignore(()=>{var Ve;(0,g.isAlive)(z)&&z.set({height:Be}),(Ve=U.current)===null||Ve===void 0||Ve.height(Be)},!1,!0),se||z.a.height===Be||I.history.ignore(()=>{var Ve;(0,g.isAlive)(z)&&z.set({height:Be}),(Ve=U.current)===null||Ve===void 0||Ve.height(Be)},!1,!0)}}else{const Be=Q(U.current,z,ze);if(Be!==z.a.fontSize)return void I.history.ignore(()=>{z.set({fontSize:Be})},!1,!0);const Ve=ce();z.a.height===Ve||se||I.history.ignore(()=>{z.set({height:Ve})},!1,!0)}}else{const Be=ce();I.history.ignore(()=>{z.set({height:Be})},!1,!0)}}),t.default.useLayoutEffect(()=>{const Ke=U.current;Ke&&(Ke.width(Ke.width()+1e-8),Ke._setTextData(),(0,_.applyFilter)(Ke,z))},[_e]);const he=t.default.useRef(null),Ce=t.default.useRef(0),Le=Ke=>{Ke.evt.preventDefault(),I.selectedShapes.find(Be=>Be===z)&&z.contentEditable&&(Ce.current=B(Ke),z.toggleEditMode())},ue=!Te&&z.placeholder?.6:z.a.opacity;(0,p.useFadeIn)(U,ue);const me=(0,e.getLineHeight)({fontLoaded:_e,fontFamily:z.fontFamily,fontSize:z.a.fontSize,lineHeight:z.lineHeight}),xe=z.selectable||I.role==="admin",je=(0,b.useColor)(z),ot=t.default.useMemo(()=>z.backgroundEnabled?H({lines:JSON.parse(JSON.stringify(pe)),cornerRadius:z.backgroundCornerRadius*(z.a.fontSize*me*.5),lineHeight:me*z.a.fontSize,padding:z.backgroundPadding*(z.a.fontSize*me*.5),width:z.a.width,align:z.align}):"",[z.backgroundEnabled,z.backgroundCornerRadius,z.a.fontSize,me,z.backgroundPadding,z.a.width,z.align,pe]),ht=(0,P.isTouchDevice)();let et=0;return z.verticalAlign==="middle"?et=(z.a.height-pe.length*me*z.a.fontSize)/2:z.verticalAlign==="bottom"&&(et=z.a.height-pe.length*me*z.a.fontSize),t.default.createElement(t.default.Fragment,null,t.default.createElement(o.Path,{ref:$,x:z.a.x,y:z.a.y,rotation:z.a.rotation,hideInExport:!z.showInExport,listening:!1,visible:z.backgroundEnabled,opacity:z.backgroundOpacity*ue,data:ot,fill:z.backgroundColor,offsetY:-et}),t.default.createElement(o.Text,Object.assign({ref:U,id:z.id,name:"element",hideInExport:!z.showInExport,editModeEnabled:z._editModeEnabled,x:z.a.x,y:z.a.y,rotation:z.a.rotation,width:z.a.width,height:z.a.height,text:Te||z.placeholder,direction:D(Te)},je,{stroke:z.stroke,lineJoin:"round",strokeWidth:z.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:z.a.fontSize,fontFamily:`"${z.fontFamily}", "${de}"`,fontStyle:z.fontStyle+" "+z.fontWeight,textDecoration:z.textDecoration,align:z.align,verticalAlign:z.verticalAlign,draggable:ht?z.draggable&&oe:z.draggable,preventDefault:!ht||oe,opacity:ue,visible:!z._editModeEnabled,ellipsis:x.flags.textOverflow==="ellipsis",shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur,shadowOffsetX:z.shadowOffsetX,shadowOffsetY:z.shadowOffsetY,shadowColor:z.shadowColor,shadowOpacity:z.shadowOpacity,lineHeight:me,letterSpacing:z.letterSpacing*z.a.fontSize,listening:xe,onDragMove:Ke=>{z.set({x:Ke.target.x(),y:Ke.target.y()})},onDragEnd:Ke=>{z.set({x:Ke.target.x(),y:Ke.target.y()})},onMouseEnter:()=>{W(!0)},onMouseLeave:()=>{W(!1)},onClick:Le,onTap:Le,onTransformStart:()=>{re(!0),ie.current=U.current.height()},onTransform:Ke=>{var ze,Be;const Ve=Ke.target;(ze=$.current)===null||ze===void 0||ze.setAttrs({x:Ve.x(),y:Ve.y(),rotation:Ve.rotation(),scale:Ve.scale()});const bt=((Be=Ve.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer")).getActiveAnchor();if(bt==="middle-left"||bt==="middle-right"){const Ct=Ve.scaleX(),we=Ve.width()*Ct,Se=z.a.fontSize;let gt=we;we<Se&&(gt=Se,he.current&&Ve.position(he.current)),Ve.width(gt),Ve.scaleX(1),Ve.scaleY(1);const wt=ce();if(x.flags.textOverflow!=="ellipsis"){const Pt=Math.max(wt,ie.current);Ve.height(Pt),z.set({height:Ve.height()})}z.set({x:Ve.x(),y:Ve.y(),width:Ve.width(),rotation:Ve.rotation()}),(0,_.applyFilter)(Ve,z)}if(bt==="top-center"||bt==="bottom-center"){let Ct=x.flags.textOverflow==="resize"?ce():me*z.a.fontSize;Ke.target.height(Math.max(Ct,Ke.target.height()*Ke.target.scaleY())),Ke.target.scaleY(1)}he.current=Ke.target.position()},onTransformEnd:Ke=>{var ze;const Be=Ke.target.scaleX();Ke.target.scaleX(1),Ke.target.scaleY(1),z.set({fontSize:Math.round(z.a.fontSize*Be),width:Math.ceil(Ke.target.width()*Be),x:Ke.target.x(),y:Ke.target.y(),rotation:Ke.target.rotation(),height:Ke.target.height()*Be,shadowBlur:z.shadowBlur*Be,shadowOffsetX:z.shadowOffsetX*Be,shadowOffsetY:z.shadowOffsetY*Be,strokeWidth:z.strokeWidth*Be}),(ze=$.current)===null||ze===void 0||ze.setAttrs({scaleX:1,scaleY:1}),re(!1)}})),ee&&t.default.createElement(o.Group,{x:z.a.x,y:z.a.y,rotation:z.a.rotation},t.default.createElement(S,{textNodeRef:U,element:z,selectAll:G,cursorPosition:Ce.current,onBlur:()=>{z.toggleEditMode(!1)}})),!te&&(Z||oe)&&t.default.createElement(h.Highlighter,{element:z}))})}(ad)),ad}var _a={},fd={},n1={exports:{}},r1={exports:{}},L2;function Rm(){return L2||(L2=1,function(e,i){e.exports=t;function t(o){return n.bind(null,o)}function n(o){var l=[].slice.call(arguments,1);l.unshift("["+o+"]"),process.stderr.write(l.join(" ")+`
102
+ `)}}(r1)),r1.exports}var N2;function o4(){return N2||(N2=1,function(e,i){Rm()("lex"),e.exports=t;function t(n){var o="",l,s=0,c=-1,d=0,b=1,w="before-selector",E=[w],x={},m=[],_=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function p(){return D(),n[c]}function h(K){return K?E[E.length-1-K]:w}function P(K){var Q=c+1;return K===n.slice(Q,Q+K.length)}function g(K){var Q=n.slice(c).indexOf(K);return Q>0?Q:!1}function v(K){return K===y(1)}function y(K){return n[c+(K||1)]}function O(){var K=E.pop();return w=E[E.length-1],K}function M(K){return w=K,E.push(w),E.length}function R(K){var Q=w;return E[E.length-1]=w=K,Q}function D(K){if((K||1)==1)n[c]==`
103
+ `?(b++,s=1):s++,c++;else{var Q=n.slice(c,c+K).split(`
104
+ `);Q.length>1&&(b+=Q.length-1,s=1),s+=Q[Q.length-1].length,c=c+K}}function T(){x.end={line:b,col:s},m.push(x),o="",x={}}function S(K){x={type:K,start:{line:b,col:s}}}for(;l=p();)switch(l){case" ":switch(h()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":o+=l;break}break;case`
105
+ `:case" ":case"\r":case"\f":switch(h()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":o+=l;break;case"at-value":l===`
106
+ `&&(x.value=o.trim(),T(),O());break}break;case":":switch(h()){case"name":x.name=o.trim(),o="",R("before-value");break;case"before-selector":o+=l,S("selector"),M("selector");break;case"before-value":R("value"),o+=l;break;default:o+=l;break}break;case";":switch(h()){case"name":case"before-value":case"value":o.trim().length>0&&(x.value=o.trim(),T()),R("before-name");break;case"value-paren":o+=l;break;case"at-value":x.value=o.trim(),T(),O();break;case"before-name":break;default:o+=l;break}break;case"{":switch(h()){case"selector":if(y(-1)==="\\"){o+=l;break}x.text=o.trim(),T(),R("before-name"),d=d+1;break;case"at-group":switch(x.name=o.trim(),x.type){case"font-face":case"viewport":case"page":M("before-name");break;default:M("before-selector")}T(),d=d+1;break;case"name":case"at-rule":x.name=o.trim(),T(),M("before-name"),d=d+1;break;case"comment":case"double-string":case"single-string":o+=l;break;case"before-value":R("value"),o+=l;break}break;case"}":switch(h()){case"before-name":case"name":case"before-value":case"value":o&&(x.value=o.trim()),x.name&&x.value&&T(),S("end"),T(),O(),h()==="at-group"&&(S("at-group-end"),T(),O()),d>0&&(d=d-1);break;case"at-group":case"before-selector":case"selector":if(y(-1)==="\\"){o+=l;break}d>0&&h(1)==="at-group"&&(S("at-group-end"),T()),d>1&&O(),d>0&&(d=d-1);break;case"double-string":case"single-string":case"comment":o+=l;break}break;case'"':case"'":switch(h()){case"double-string":l==='"'&&y(-1)!=="\\"&&O();break;case"single-string":l==="'"&&y(-1)!=="\\"&&O();break;case"before-at-value":R("at-value"),M(l==='"'?"double-string":"single-string");break;case"before-value":R("value"),M(l==='"'?"double-string":"single-string");break;case"comment":break;default:y(-1)!=="\\"&&M(l==='"'?"double-string":"single-string")}o+=l;break;case"/":switch(h()){case"comment":case"double-string":case"single-string":o+=l;break;case"before-value":case"selector":case"name":case"value":if(v("*")){var A=g("*/");A&&D(A+1)}else h()=="before-value"&&R("value"),o+=l;break;default:v("*")?(S("comment"),M("comment"),D()):o+=l;break}break;case"*":switch(h()){case"comment":v("/")?(x.text=o,D(),T(),O()):o+=l;break;case"before-selector":o+=l,S("selector"),M("selector");break;case"before-value":R("value"),o+=l;break;default:o+=l}break;case"@":switch(h()){case"comment":case"double-string":case"single-string":o+=l;break;case"before-value":R("value"),o+=l;break;default:for(var N=!1,k,L,B=0,X=_.length;!N&&B<X;++B)L=_[B],k=L.name||L,P(k)&&(N=!0,S(k),M(L.state||"at-group"),D(k.length),L.prefix&&(x.prefix=L.prefix),L.type&&(x.type=L.type));N||(o+=l);break}break;case"(":switch(h()){case"value":M("value-paren");break;case"before-value":R("value");break}o+=l;break;case")":switch(h()){case"value-paren":O();break;case"before-value":R("value");break}o+=l;break;default:switch(h()){case"before-selector":S("selector"),M("selector");break;case"before-name":S("property"),R("name");break;case"before-value":R("value");break;case"before-at-value":R("at-value");break}o+=l;break}return m}}(n1)),n1.exports}var i1={exports:{}},I2;function xO(){return I2||(I2=1,function(e,i){Rm()("parse");var t=o4();e.exports=c;var n,o,l,s;function c(O,M){M||(M={}),n=!!M.comments,l=!!M.position,o=0,s=Array.isArray(O)?O.slice():t(O);for(var R,D=[],T;T=b();)R=P(T),R&&D.push(R);return{type:"stylesheet",stylesheet:{rules:D}}}function d(O,M){M||(M={});for(var R,D=["type","name","value"],T={},S=0;S<D.length;++S)R=D[S],O[R]&&(T[R]=M[R]||O[R]);for(D=Object.keys(M),S=0;S<D.length;++S)R=D[S],T[R]||(T[R]=M[R]);return l&&(T.position={start:O.start,end:O.end}),T}function b(){var O=s.shift();return O}function w(O){o=o+1;var M={};switch(O.type){case"font-face":case"viewport":M.declarations=v();break;case"page":M.prefix=O.prefix,M.declarations=v();break;default:M.prefix=O.prefix,M.rules=y()}return d(O,M)}function E(O){return d(O)}function x(O){return d(O)}function m(O){return d(O,{text:O.text})}function _(O){return d(O)}function p(O){return d(O)}function h(O){function M(R){return R.trim()}return d(O,{type:"rule",selectors:O.text.split(",").map(M),declarations:v()})}function P(O){switch(O.type){case"property":return p(O);case"selector":return h(O);case"at-group-end":o=o-1;return;case"media":case"keyframes":return w(O);case"comment":if(n)return m(O);break;case"charset":return x(O);case"import":return E(O);case"namespace":return _(O);case"font-face":case"supports":case"viewport":case"document":case"page":return w(O)}}function g(O){for(var M,R=[],D;(D=b())&&O&&O(D);)M=P(D),M&&R.push(M);return D&&D.type!=="end"&&s.unshift(D),R}function v(){return g(function(O){return O.type==="property"||O.type==="comment"})}function y(){return g(function(){return o})}}(i1)),i1.exports}var a1={exports:{}},D2;function PO(){return D2||(D2=1,function(e,i){Rm()("stringify");var t,n,o,l,s,c;e.exports=d;function d(y,O){O||(O={}),o=O.indentation||"",n=!!O.compress,t=!!O.comments,l=1,n?s=c="":(s=`
107
+ `,c=" ");var M=_(y.stylesheet.rules,g).join(`
108
+ `).trim();return M}function b(y){if(y){l+=y;return}return n?"":Array(l).join(o||"")}function w(y){return"@"+y.type+" "+y.value+";"+s}function E(y){var O="",M=y.prefix||"";y.name&&(O=" "+y.name);var R=y.type!=="page";return"@"+M+y.type+O+c+p(y,R)+s}function x(y){return t?"/*"+(y.text||"")+"*/"+s:""}function m(y){var O;return y.selectors?O=y.selectors.join(","+s):(O="@"+y.type,O+=y.name?" "+y.name:""),b()+O+c+p(y)+s}function _(y,O){return y.reduce(function(M,R){var D=R.type==="comment"?x(R):O(R);return D&&M.push(D),M},[])}function p(y,O){var M=y.declarations,R=P;return y.rules&&(M=y.rules,R=m),M=h(M,R),M&&(M=s+M+(O?"":s)),"{"+M+b()+"}"}function h(y,O){if(!y)return"";b(1);var M=_(y,O);return b(-1),M.length?M.join(s):""}function P(y){if(y.type==="property")return v(y)}function g(y){switch(y.type){case"rule":return m(y);case"media":case"keyframes":return E(y);case"comment":return x(y);case"import":case"charset":case"namespace":return w(y);case"font-face":case"supports":case"viewport":case"document":case"page":return E(y)}}function v(y){var O=y.name?y.name+":"+c:"";return b()+O+y.value+";"}}(a1)),a1.exports}var o1,j2;function CO(){return j2||(j2=1,o1={lex:o4(),parse:xO(),stringify:PO()}),o1}var F2;function qd(){return F2||(F2=1,function(e){var i=fd&&fd.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.sameColors=void 0,e.urlToBase64=E,e.urlToString=x,e.getColors=m,e.svgToURL=_,e.getSvgSize=p,e.fixSize=h,e.replaceColors=v;const t=i(Ji()),n=i(Tn()),o=_m(),l=i(CO());function s(O){for(;O.parentNode;){if(O.nodeName==="defs")return!0;O=O.parentNode}return!1}function c(O){const M={};return O.querySelectorAll("style").forEach(R=>{const D=l.default.parse(R.textContent).stylesheet.rules;for(let T of D)T.selectors&&T.selectors.forEach(S=>{const A=M[S]||{};T.declarations.forEach(N=>{A[N.name]=N.value}),M[S]=A})}),M}function d(O,M){var R;const D={fill:"",stroke:""},T=((R=O.getAttribute("class"))===null||R===void 0?void 0:R.split(" "))||[],S=O.getAttribute("id");let A={};if(S&&M[`#${S}`]?A=M[`#${S}`]:T.forEach(N=>{M[`.${N}`]&&(A=Object.assign(Object.assign({},A),M[`.${N}`]))}),M[O.nodeName]&&(A=Object.assign(Object.assign({},A),M[O.nodeName])),O.getAttribute("fill")&&O.getAttribute("fill")!=="none"?D.fill=O.getAttribute("fill"):A.fill&&A.fill!=="none"&&(D.fill=A.fill),O.getAttribute("stroke")&&O.getAttribute("stroke")!=="none"?D.stroke=O.getAttribute("stroke"):A.stroke&&A.stroke!=="none"&&(D.stroke=A.stroke),!D.fill&&O.style.fill&&O.style.fill!=="none"&&(D.fill=O.style.fill),!D.stroke&&O.style.stroke&&O.style.stroke!=="none"&&(D.stroke=O.style.stroke),!D.stroke&&!D.fill){const N=O.ownerSVGElement,k=N&&N!==O&&d(N,M);(k==null?void 0:k.fill)==="currentColor"||(k==null?void 0:k.stroke)==="currentColor"||(D.fill="black")}return D}const b=["path","rect","circle","line","polygon","polyline","ellipse","text"];function w(O){for(var M=[],R=O.getElementsByTagName("*"),D=0,T=R.length;D<T;D++){const S=R[D];s(S)||(S.getAttribute("fill")!==null&&M.push(S),(S.getAttribute("stroke")!==null||S.style&&S.style.fill||b.indexOf(S.nodeName)>=0)&&M.push(S))}return M}async function E(O){const M=await fetch(O);return _(await M.text())}async function x(O){return await(await fetch(O,{mode:"cors"})).text()}function m(O){var M=new DOMParser().parseFromString(O,"image/svg+xml");const R=c(M),D=w(M),T=[];return D.forEach(S=>{const{fill:A,stroke:N}=d(S,R);[A,N].forEach(k=>{k&&(k==="currentColor"&&(k="black"),t.default.Util.colorToRGBA(k)&&T.indexOf(k)===-1&&T.push(k))})}),T}function _(O){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(O)))}async function p(O){const M=await x(O),R=new DOMParser().parseFromString(M,"image/svg+xml").documentElement.getAttribute("viewBox"),[D,T,S,A]=(R==null?void 0:R.split(" "))||[];return{width:parseFloat(S),height:parseFloat(A)}}function h(O){var M=new DOMParser().parseFromString(O,"image/svg+xml");const R=M.documentElement.getAttribute("viewBox"),[D,T,S,A]=(R==null?void 0:R.split(" "))||[],N=M.documentElement.getAttribute("width");!N&&M.documentElement.setAttribute("width",S+"px");const k=M.documentElement.getAttribute("height");if((!k||k.indexOf("%")>=0)&&M.documentElement.setAttribute("height",A+"px"),N&&N.indexOf("%")>=0&&k&&k.indexOf("%")===-1){const L=parseFloat(k)/parseFloat(A);M.documentElement.setAttribute("width",L*parseFloat(S)+"px")}if(k&&k.indexOf("%")>=0&&N&&N.indexOf("%")===-1){const L=parseFloat(N)/parseFloat(S);M.documentElement.setAttribute("height",L*parseFloat(A)+"px")}return N==="100%"&&k==="100%"&&(M.documentElement.setAttribute("width",S+"px"),M.documentElement.setAttribute("height",A+"px")),new XMLSerializer().serializeToString(M)}const P=(O,M)=>{if(!O||!M)return!1;if(M==="currentColor"&&O==="black")return!0;const R=t.default.Util.colorToRGBA(O),D=t.default.Util.colorToRGBA(M);return R&&D?R.r===D.r&&R.g===D.g&&R.b===D.b&&R.a===D.a:void 0};function g(O,M,R,D){var T=O.namespaceURI,S=document.createElementNS(T,"linearGradient");const A=t.default.Util.degToRad(R+90),N=(Math.cos(A)+1)/2,k=(Math.sin(A)+1)/2,L=(Math.cos(A+Math.PI)+1)/2,B=(Math.sin(A+Math.PI)+1)/2;S.setAttribute("x1",100*N+"%"),S.setAttribute("y1",100*k+"%"),S.setAttribute("x2",100*L+"%"),S.setAttribute("y2",100*B+"%"),S.setAttribute("gradientUnits","userSpaceOnUse"),S.setAttribute("id",M);for(var X=0;X<D.length;X++){var K=D[X],Q=document.createElementNS(T,"stop");for(var H in K)K.hasOwnProperty(H)&&Q.setAttribute(H,K[H]);S.appendChild(Q)}return(O.querySelector("defs")||O.insertBefore(document.createElementNS(T,"defs"),O.firstChild)).appendChild(S)}function v(O,M){var R=new DOMParser().parseFromString(O,"image/svg+xml");const D=w(R),T=Array.from(M.keys()),S=c(R);return D.forEach(A=>{const{fill:N,stroke:k}=d(A,S);[{prop:"fill",color:N},{prop:"stroke",color:k}].forEach(({prop:L,color:B})=>{const X=T.find(K=>(0,e.sameColors)(K,B));if(X){const K=M.get(X);if((0,o.isGradient)(K)){const{rotation:Q,stops:H}=(0,o.parseColor)(K),z=H.map(U=>({offset:100*U.offset+"%","stop-color":U.color})),I="color"+Math.round(1e8*Math.random());g(R.children[0],I,Q,z),A.style[L]=null,A.setAttribute(L,`url('#${I}')`)}else A.style[L]=M.get(X)}})}),_(new XMLSerializer().serializeToString(R))}e.sameColors=P;const y=O=>{const[M,R]=n.default.useState([]);return n.default.useEffect(()=>{let D=!1;return(async()=>{R([]);const T=m(await x(O));D||R(T)})(),()=>{D=!0}},[O]),M};e.useSvgColors=y}(fd)),fd}var l1={},z2;function l4(){return z2||(z2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0;const i=(t,n,o)=>{let l=n,s=o,c=1;for(;l>0&&s>0;){t.width=l,t.height=s;const d=t.getContext("2d");if(!d)return;if(d.fillStyle="rgba(0,0,0,0.1)",d.fillRect(0,0,1,1),d.getImageData(0,0,1,1).data[3]!==0)return void d.clearRect(0,0,t.width,t.height);if(c*=.9,l=Math.floor(n*c),s=Math.floor(o*c),l=Math.max(l,1),s=Math.max(s,1),l<=1&&s<=1)return t.width=1,void(t.height=1)}};e.trySetCanvasSize=i}(l1)),l1}var B2;function s4(){return B2||(B2=1,function(e){var i=_a&&_a.__createBinding||(Object.create?function(G,Z,W,te){te===void 0&&(te=W);var re=Object.getOwnPropertyDescriptor(Z,W);re&&!("get"in re?!Z.__esModule:re.writable||re.configurable)||(re={enumerable:!0,get:function(){return Z[W]}}),Object.defineProperty(G,te,re)}:function(G,Z,W,te){te===void 0&&(te=W),G[te]=Z[W]}),t=_a&&_a.__setModuleDefault||(Object.create?function(G,Z){Object.defineProperty(G,"default",{enumerable:!0,value:Z})}:function(G,Z){G.default=Z}),n=_a&&_a.__importStar||function(){var G=function(Z){return G=Object.getOwnPropertyNames||function(W){var te=[];for(var re in W)Object.prototype.hasOwnProperty.call(W,re)&&(te[te.length]=re);return te},G(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var W={};if(Z!=null)for(var te=G(Z),re=0;re<te.length;re++)te[re]!=="default"&&i(W,Z,te[re]);return t(W,Z),W}}(),o=_a&&_a.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=e.useSizeFixer=void 0;const l=o(Tn()),s=Qi,c=La,d=Jo,b=o(Dp()),w=o(Ji()),E=yc,x=_c(),m=Ks(),_=n(qd()),p=ts(),h=l4(),P=jp(),g=bc(),v=Xs();function y(){return document.createElement("canvas")}async function O(G){if(!(G.indexOf("data:image/svg+xml")>=0||G.indexOf(".svg")>=0))return G;const Z=await _.urlToString(G),W=_.fixSize(Z);return _.svgToURL(W)}const M=G=>{const[Z,W]=l.default.useState(G);return l.default.useEffect(()=>{(async()=>{const te=await O(G);te!==Z&&W(te)})()},[G]),Z};function R(G,Z){return Math.sqrt(Math.pow(Z.x-G.x,2)+Math.pow(Z.y-G.y,2))}function D(G,Z){return{x:(G.x+Z.x)/2,y:(G.y+Z.y)/2}}e.useSizeFixer=M;const T=(G,Z,W)=>{const te=l.default.useMemo(()=>{var re,ie;const{flipX:oe,flipY:se}=G,de=G.type==="svg"||G.src.indexOf("data:image/svg+xml")>=0||G.src.indexOf(".svg")>=0,pe=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Oe=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||pe)&&de||G.maskSrc;if(!oe&&!se&&!Oe)return Z;if(!Z||!Z.width||!Z.height)return null;const _e=y();let Te=1;G.type==="svg"&&(Te=Math.max(G.a.width/Z.width*W,G.a.height/Z.height*W)),(0,h.trySetCanvasSize)(_e,Math.max(Z.width*Te,1),Math.max(Z.height*Te,1));let ce=oe?-_e.width:0,he=se?-_e.height:0;return(re=_e.getContext("2d"))===null||re===void 0||re.scale(oe?-1:1,se?-1:1),(ie=_e.getContext("2d"))===null||ie===void 0||ie.drawImage(Z,ce,he,_e.width,_e.height),_e},[G.maskSrc,G.flipX,G.flipY,Z,G.a.width,G.a.height,W]);return l.default.useEffect(()=>()=>{te&&te.nodeName==="CANVAS"&&w.default.Util.releaseCanvas(te)},[te]),te};function S(G,Z){const W=Z.width/Z.height;let te,re;return W>=G.width/G.height?(te=G.width,re=G.width/W):(te=G.height*W,re=G.height),{x:(G.width-te)/2,y:(G.height-re)/2,width:te,height:re}}function A(G,Z,W,te,re,ie,oe){for(var se=new ImageData(Z,W),de=new Int32Array(G.data.buffer),pe=G.width,Oe=new Int32Array(se.data.buffer),_e=se.width,Te=Z/ie,ce=W/oe,he=Math.round(1/Te),Ce=Math.round(1/ce),Le=he*Ce,ue=0;ue<se.height;ue++)for(var me=0;me<_e;me++){for(var xe=te+Math.round(me/Te)+(re+Math.round(ue/ce))*pe,je=0,ot=0,ht=0,et=0,Ke=0;Ke<Ce;Ke++)for(var ze=0;ze<he;ze++){var Be=de[xe+ze+Ke*pe];je+=Be<<24>>>24,ot+=Be<<16>>>24,ht+=Be<<8>>>24,et+=Be>>>24}je=Math.round(je/Le),ot=Math.round(ot/Le),ht=Math.round(ht/Le),et=Math.round(et/Le),Oe[me+ue*_e]=et<<24|ht<<16|ot<<8|je}return se}function N(G,Z){var W,te;const re=y();re.width=G.width,re.height=G.height;const ie=Math.max(1,Math.floor(re.width*Z)),oe=Math.max(1,Math.floor(re.height*Z));(W=re.getContext("2d"))===null||W===void 0||W.drawImage(G,0,0,re.width,re.height);const se=A(re.getContext("2d").getImageData(0,0,re.width,re.height),ie,oe,0,0,re.width,re.height);return re.width=ie,re.height=oe,(te=re.getContext("2d"))===null||te===void 0||te.putImageData(se,0,0),re}const k=(G,Z)=>{const[W,te]=z(G.maskSrc,"anonymous"),re=G.maskSrc?te:"loaded";return(0,e.useImageLoader)(re,G.maskSrc||"",G.id),l.default.useMemo(()=>{if(!W||!Z||!Z.width||!Z.height)return Z;const ie=y();ie.width=Math.max(Z.width,1),ie.height=Math.max(Z.height,1);const oe=ie.getContext("2d");if(!oe)return Z;oe.drawImage(Z,0,0),oe.globalCompositeOperation="source-in";const se=S(W,G);return oe.drawImage(W,se.x,se.y,se.width,se.height,0,0,Z.width,Z.height),ie},[Z,W,G.a.width,G.a.height])},L=(G,Z,W)=>Math.max(Z,Math.min(W,G)),B=(G,Z,W,te,re=0,ie=!1,oe=!0)=>{const se=Math.floor(L(G.a.width*te,1,1e4)),de=Math.floor(L(G.a.height*te,1,1e4)),pe=Math.min(re*te,se/2,de/2),Oe=Math.max(G.a.width/W.width,G.a.height/W.height)*te,_e=G.page._exportingOrRendering&&p.flags.imageDownScalingEnabled&&Oe<1&&!ie,Te=W.x===0&&W.y===0&&W.width===(Z==null?void 0:Z.width)&&W.height===(Z==null?void 0:Z.height),ce=l.default.useMemo(()=>{if(!(!Z||!Z.width||!Z.height))return Te&&pe===0&&!_e?void 0:y()},[Z,pe,_e,Te]);return l.default.useLayoutEffect(()=>{if(!ce||!Z)return;(0,h.trySetCanvasSize)(ce,se,de);const he=ce.getContext("2d");if(!he)return;pe&&(he.beginPath(),he.moveTo(pe,0),he.lineTo(se-pe,0),he.arc(se-pe,pe,pe,3*Math.PI/2,0,!1),he.lineTo(se,de-pe),he.arc(se-pe,de-pe,pe,0,Math.PI/2,!1),he.lineTo(pe,de),he.arc(pe,de-pe,pe,Math.PI/2,Math.PI,!1),he.lineTo(0,pe),he.arc(pe,pe,pe,Math.PI,3*Math.PI/2,!1),he.clip());const Ce=_e?N(Z,Oe):Z,Le=_e?{x:Math.floor(W.x*Oe),y:Math.floor(W.y*Oe),width:Math.floor(W.width*Oe),height:Math.floor(W.height*Oe)}:W;he.drawImage(Ce,Le.x,Le.y,Le.width,Le.height,0,0,ce.width,ce.height)},[ce,G.a.width,G.a.height,W.x,W.y,W.width,W.height,re,te,ie,G.page._exportingOrRendering,_e]),l.default.useEffect(()=>()=>{ce&&ce.nodeName==="CANVAS"&&w.default.Util.releaseCanvas(ce)},[ce]),ce||Z},X=(G,Z,W,te)=>{const re=(0,e.useSizeFixer)(G.clipSrc||""),[ie,oe]=z(re,"anonymous"),se=G.clipSrc?oe:"loaded";(0,e.useImageLoader)(se,G.clipSrc,G.id);const de=l.default.useMemo(()=>{if(Z&&ie)return y()},[Z,ie]);return l.default.useLayoutEffect(()=>{var pe;if(!ie||!Z||!Z.width||!Z.height||!ie||!ie.width||!ie.height||!de)return;const Oe=y(),_e=Math.max(G.a.width/ie.width*W,G.a.height/ie.height*W);Oe.width=ie.width*_e,Oe.height=ie.height*_e,(pe=Oe.getContext("2d"))===null||pe===void 0||pe.drawImage(ie,0,0,Oe.width,Oe.height),de.width=Math.max(Z.width,1),de.height=Math.max(Z.height,1);const Te=de.getContext("2d");Te&&(Te.save(),Te.drawImage(Oe,0,0,Z.width,Z.height),w.default.Util.releaseCanvas(Oe),Te.globalCompositeOperation="source-in",Te.drawImage(Z,0,0,de.width,de.height),Te.restore())},[de,Z,ie,G.a.width,G.a.height,W,...te]),G.clipSrc&&ie?de:Z},K=y(),Q=(0,s.observer)(({element:G})=>{const Z=Math.min(30,G.a.width/4,G.a.height/4),W=l.default.useRef(null);return l.default.useEffect(()=>{const te=W.current;if(!te)return;const re=new w.default.Animation(ie=>{te.rotate(((ie==null?void 0:ie.timeDiff)||0)/2)},te.getLayer());return re.start(),()=>{re.stop()}}),l.default.createElement(d.Group,{x:G.x,y:G.y,rotation:G.rotation,listening:!1,opacity:G.a.opacity,hideInExport:!G.showInExport},l.default.createElement(d.Rect,{width:G.a.width,height:G.a.height,fill:"rgba(124, 173, 212, 0.8)"}),l.default.createElement(d.Arc,{ref:W,x:G.a.width/2,y:G.a.height/2,fill:"white",outerRadius:Math.abs(Z),innerRadius:Math.max(1,Z-5),angle:270}))}),H=(0,s.observer)(({element:G})=>{const Z="Can not load the image...",W=Math.max(10,Math.min(30,G.a.width/25));return l.default.createElement(d.Group,{x:G.x,y:G.y,rotation:G.rotation,listening:!1,opacity:G.a.opacity,hideInExport:!G.showInExport},l.default.createElement(d.Rect,{width:G.a.width,height:G.a.height,fill:"rgba(223, 102, 102, 0.8)"}),l.default.createElement(d.Text,{text:Z,fontSize:W,width:G.a.width,height:G.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let z=b.default;const I=G=>{z=G};e.setImageLoaderHook=I;const U=(G,Z="",W="")=>{const te=l.default.useRef(),re=()=>{var ie;(ie=te.current)===null||ie===void 0||ie.call(te),te.current=void 0};l.default.useEffect(()=>re,[]),l.default.useLayoutEffect(()=>{const ie=Z.slice(0,200),oe=`image with id ${W} url: ${ie}`;G!=="loading"||te.current||(te.current=(0,m.incrementLoader)(oe)),G!=="loading"&&re(),G==="failed"&&(0,m.triggerLoadError)(oe)},[G])};e.useImageLoader=U;const $=({image:G,status:Z,type:W})=>{const te=l.default.useRef();return l.default.useEffect(()=>{te.current=G||te.current},[G]),Z!=="failed"||Z!=="failed"&&W==="svg"?te.current:void 0},ee=G=>{const[Z,W]=l.default.useReducer(oe=>oe+1,0),te=l.default.useRef("loading"),re=l.default.useRef(G.src),ie=l.default.useRef(G.src);return ie.current!==G.src&&(ie.current=G.src,te.current="loading"),l.default.useEffect(()=>{if(G.type!=="svg"||!G.src)return;let oe=!1;return(async()=>{te.current="loading",W();const se=await _.urlToString(G.src),de=_.fixSize(se),pe=_.replaceColors(de,G.colorsReplace);oe||(re.current=pe,te.current="loaded",W())})(),()=>{oe=!0}},[G.src,JSON.stringify(G.colorsReplace)]),G.type!=="svg"?[G.src,"loaded"]:[re.current,te.current]};e.ImageElement=(0,s.observer)(({element:G,store:Z})=>{var W;const[te,re]=l.default.useState(!1),ie=l.default.useRef(null),oe=l.default.useRef(null),[se,de]=l.default.useState(!1),pe=Z.selectedShapes.indexOf(G)>=0,[Oe,_e]=ee(G),[Te,ce]=z(Oe,"anonymous"),he=G.type!=="svg"||_e==="loaded"?ce:"loading";(0,e.useImageLoader)(he,G.src,G.id);const Ce=G.page._exportingOrRendering?1:Math.max(1,Z.scale),Le=Z._elementsPixelRatio*Ce,ue=$({image:Te,status:ce,type:G.type}),me=T(G,Te||ue,Le),xe=k(G,me)||K;let{cropX:je,cropY:ot,cropWidth:ht,cropHeight:et}=G.a;ce!=="loaded"&&(je=ot=0,ht=et=1);const Ke=xe.width*ht,ze=xe.height*et,Be=G.a.width/G.a.height;let Ve,bt;const Ct=Ke/ze,we=G.type==="svg";we?(Ve=Ke,bt=ze):Be>=Ct?(Ve=Ke,bt=Ke/Be):(Ve=ze*Be,bt=ze);const Se={x:xe.width*je,y:xe.height*ot,width:Ve,height:bt},gt=(W=G.cornerRadius)!==null&&W!==void 0?W:0,wt=G.page._exportingOrRendering?1:Math.min(2,Z.scale),Pt=Z._elementsPixelRatio*wt;let mt=X(G,B(G,xe,Se,Pt,gt,te||G._cropModeEnabled||G.type==="svg",!0),Pt,[Se,gt,Pt]);const Wt=Math.max(G.a.width/Ve,G.a.height/bt);l.default.useEffect(()=>{var Ze;if(!G._cropModeEnabled)return;const Et=(Ze=ie.current)===null||Ze===void 0?void 0:Ze.getStage();function Lt(Vt){G._cropModeEnabled&&Vt.target!==oe.current&&G.toggleCropMode(!1)}function Gt(Vt){G._cropModeEnabled&&Vt.target.parentNode!==Et.content&&G.toggleCropMode(!1)}return document.body.addEventListener("click",Gt),Et==null||Et.on("click",Lt),Et==null||Et.on("tap",Lt),()=>{document.body.removeEventListener("click",Gt),document.body.removeEventListener("touchstart",Gt),Et==null||Et.off("click",Lt),Et==null||Et.off("click",Lt)}},[G._cropModeEnabled]),l.default.useLayoutEffect(()=>{if(!(te||G._cropModeEnabled))return(0,P.applyFilter)(ie.current,G),(0,c.autorun)(()=>{(0,P.applyFilter)(ie.current,G)},{delay:100})},[mt,G.page._exportingOrRendering,te,ht,et,G._cropModeEnabled]),l.default.useLayoutEffect(()=>{var Ze;te||G._cropModeEnabled?(Ze=ie.current)===null||Ze===void 0||Ze.clearCache():(0,P.applyFilter)(ie.current,G)},[te,G.a.width,G.a.height,G._cropModeEnabled]),l.default.useEffect(()=>{(0,P.applyFilter)(ie.current,G)},[G.shadowEnabled,G.shadowBlur,G.cornerRadius,G.shadowColor,G.shadowOffsetX,G.shadowOffsetY,G.shadowOpacity]);const pn=l.default.useRef(null),Fe=l.default.useRef(null),rt=l.default.useRef(null);l.default.useLayoutEffect(()=>{G._cropModeEnabled&&(Fe.current.nodes([pn.current]),rt.current.nodes([oe.current]))},[G._cropModeEnabled]);var ft=l.default.useRef(null),De=l.default.useRef(0),Ie=l.default.useRef(!1);const Me=Ze=>{var Et;((Et=Ze.evt.touches)===null||Et===void 0?void 0:Et.length)>2&&Ze.target.stopDrag(),Math.round(Ze.target.x())>0&&(Ze.target.x(0),Ze.target.scaleX(1)),Math.round(Ze.target.y())>0&&(Ze.target.y(0),Ze.target.scaleY(1));const Lt=Ze.target.width()*Ze.target.scaleX(),Gt=Ze.target.height()*Ze.target.scaleY(),Vt=Math.min(1,Ve/Lt),Jn=Math.min(1,bt/Gt),Gn=1-Vt,En=Math.min(Gn,Math.max(0,Math.round(-Ze.target.x())/Lt)),ai=1-Jn,Ir=Math.min(ai,Math.max(0,Math.round(-Ze.target.y())/Gt));Ze.target.setAttrs({x:-En*xe.width,y:-Ir*xe.height,scaleX:1,scaleY:1}),G.set({cropX:En,cropY:Ir,cropWidth:Vt,cropHeight:Jn})},Ye=()=>{G.type!=="svg"&&G.contentEditable&&setTimeout(()=>{G.toggleCropMode(!0)})},Mt=G.type==="svg"&&ue,_t=ce==="loading"&&!Mt,Yt=ce==="failed",wn=!_t&&!Yt,Sn=l.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Qn=wn?G.a.opacity:0;(0,g.useFadeIn)(ie,Qn);const ii=G.selectable||Z.role==="admin",Sr=(0,v.isTouchDevice)();return l.default.createElement(l.default.Fragment,null,_t&&l.default.createElement(Q,{element:G}),Yt&&l.default.createElement(H,{element:G}),l.default.createElement(d.Image,{ref:ie,name:"element",id:G.id,image:mt,x:G.a.x,y:G.a.y,width:G.a.width||1,height:G.a.height||1,rotation:G.a.rotation,opacity:Qn,shadowEnabled:G.shadowEnabled,shadowBlur:G.shadowBlur,shadowOffsetX:G.shadowOffsetX,shadowOffsetY:G.shadowOffsetY,shadowColor:G.shadowColor,shadowOpacity:G.shadowOpacity,customCrop:Se,listening:ii,draggable:Sr?G.draggable&&pe:G.draggable,preventDefault:!Sr||pe,hideInExport:!G.showInExport,onMouseEnter:()=>{de(!0)},onMouseLeave:()=>{de(!1)},onDragMove:Ze=>{G.set({x:Ze.target.x(),y:Ze.target.y()})},onDragEnd:Ze=>{G.set({x:Ze.target.x(),y:Ze.target.y()})},onDblClick:Ye,onDblTap:Ye,onTransformStart:()=>{re(!0),Sn.current={cropX:G.cropX,cropY:G.cropY,cropWidth:G.cropWidth,cropHeight:G.cropHeight}},onTransform:Ze=>{var Et;const Lt=Ze.currentTarget,Gt=Math.abs(Lt.scaleX()-1)<1e-7?1:Lt.scaleX(),Vt=Math.abs(Lt.scaleY()-1)<1e-7?1:Lt.scaleY();Lt.scaleX(1),Lt.scaleY(1);const Jn=(Et=Ze.target.getStage())===null||Et===void 0?void 0:Et.findOne("Transformer"),Gn=1-Ve/xe.width,En=Math.min(Gn,Math.max(0,G.cropX)),ai=1-bt/xe.height,Ir=Math.min(ai,Math.max(0,G.cropY)),Ii=Jn.getActiveAnchor(),Na=!(Ii.indexOf("middle")>=0||Ii.indexOf("center")>=0),rs=!Na&&Gt<1&&Sn.current.cropHeight>bt/xe.height;let en=Na?G.cropWidth:G.cropWidth*Gt;rs&&(en=G.cropWidth);const ta=!Na&&Vt<1&&Sn.current.cropWidth>Ve/xe.width;let Dr=Na?G.cropHeight:G.cropHeight*Vt;ta&&(Dr=G.cropHeight),we&&(en=G.cropWidth,Dr=G.cropHeight),G.set({cropX:En,cropY:Ir,x:Lt.x(),y:Lt.y(),width:Lt.width()*Gt,height:Lt.height()*Vt,rotation:Ze.target.rotation(),cropWidth:Math.min(en,1-En),cropHeight:Math.min(Dr,1-Ir)})},onTransformEnd:Ze=>{const Et=Ze.currentTarget;G.set({width:Et.width(),height:Et.height(),x:Et.x(),y:Et.y(),rotation:Ze.target.rotation(),cropWidth:Ve/xe.width,cropHeight:bt/xe.height}),re(!1)}}),l.default.createElement(d.Rect,{x:G.x,y:G.y,width:Math.max(G.a.width-G.borderSize,0),height:Math.max(G.a.height-G.borderSize,0),opacity:Qn,offsetX:-G.borderSize/2,offsetY:-G.borderSize/2,stroke:G.borderColor,strokeWidth:G.borderSize,listening:!1,visible:!!G.borderSize,rotation:G.rotation,cornerRadius:Math.max(0,gt-G.borderSize),hideInExport:!G.showInExport}),G._cropModeEnabled&&l.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},l.default.createElement(d.Rect,{x:-window.innerWidth/Z.scale,y:-window.innerWidth/Z.scale,width:window.innerWidth/Z.scale*3,height:window.innerWidth/Z.scale*3,fill:"rgba(0,0,0,0.3)"}),l.default.createElement(d.Image,{listening:!1,image:mt,x:G.x,y:G.y,width:G.a.width,height:G.a.height,rotation:G.rotation,shadowEnabled:G.shadowEnabled,shadowBlur:G.shadowBlur}),l.default.createElement(d.Group,{x:G.x,y:G.y,rotation:G.rotation,scaleX:Wt,scaleY:Wt},l.default.createElement(d.Image,{image:xe,ref:oe,opacity:.4,draggable:!0,x:-G.cropX*xe.width,y:-G.cropY*xe.height,onDragMove:Me,onTransform:Me,onTouchMove:Ze=>{Ze.evt.preventDefault();const Et=Ze.target.getStage().getPointersPositions();var Lt=Et[0],Gt=Et[1];const Vt=Ze.target;if(Lt&&!Gt&&!Vt.isDragging()&&Ie.current&&(Vt.startDrag(),Ie.current=!1),Lt&&Gt){w.default.hitOnDragEnabled=!0,Vt.isDragging()&&(Ie.current=!0,Vt.stopDrag());const ta=Ze.target.getAbsoluteTransform().copy();ta.invert();var Jn={x:Lt.x,y:Lt.y},Gn={x:Gt.x,y:Gt.y};if(!ft.current)return void(ft.current=D(Jn,Gn));var En=D(Jn,Gn),ai=R(Jn,Gn);De.current||(De.current=ai);const Dr=Vt.position();var Ir={x:En.x-Dr.x,y:En.y-Dr.y},Ii=ai/De.current;Vt.scaleX(Ii),Vt.scaleY(Ii);const ho=ta.point(En),na=ta.point(ft.current);var Na=ho.x-na.x,rs=ho.y-na.y,en={x:Math.min(0,En.x-Ir.x*Ii+Na),y:Math.min(0,En.y-Ir.y*Ii+rs)};Vt.position(en),De.current=ai,ft.current=En,Me(Ze)}},onTouchEnd:Ze=>{De.current=0,ft.current=null,w.default.hitOnDragEnabled=!1}}),l.default.createElement(d.Transformer,{ref:rt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ze,Et)=>Et.width<5||Et.height<5?Ze:Et,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),l.default.createElement(d.Rect,{width:Ve,height:bt,ref:pn,listening:!1,onTransform:Ze=>{Ze.target.x()<-G.cropX*xe.width-1e-9&&(Ze.target.x(-G.cropX*xe.width),Ze.target.scaleX(1)),Ze.target.y()<-G.cropY*xe.height-1e-9&&(Ze.target.y(-G.cropY*xe.height),Ze.target.scaleY(1));const Et=Math.min(1,Math.max(0,G.cropX+Ze.target.x()/xe.width)),Lt=Math.min(1,Math.max(0,Ze.target.y()/xe.height+G.cropY)),Gt=Ze.target.width()*Ze.target.scaleX(),Vt=Ze.target.height()*Ze.target.scaleY(),Jn=Math.min(1-Et,Gt/xe.width),Gn=Math.min(1-Lt,Vt/xe.height),En=Ze.target.getAbsolutePosition(Ze.target.getParent().getParent());Ze.target.scale({x:1,y:1}),Ze.target.position({x:0,y:0}),G.set({x:En.x,y:En.y,cropX:Et,cropY:Lt,cropWidth:Jn,cropHeight:Gn,width:Math.min(Gt*Wt,xe.width*(1-Et)*Wt),height:Math.min(Vt*Wt,xe.height*(1-Lt)*Wt)})}}),l.default.createElement(d.Transformer,{ref:Fe,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ze,Et)=>Et.width<5||Et.height<5?Ze:Et,visible:G.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(se||pe)&&l.default.createElement(x.Highlighter,{element:G}))})}(_a)),_a}var wa={},ip={exports:{}};/*!
109
+ * Quill Editor v1.3.7
110
+ * https://quilljs.com/
111
+ * Copyright (c) 2014, Jason Chen
112
+ * Copyright (c) 2013, salesforce.com
113
+ */var kO=ip.exports,U2;function AO(){return U2||(U2=1,function(e,i){(function(n,o){e.exports=o()})(typeof self<"u"?self:kO,function(){return function(t){var n={};function o(l){if(n[l])return n[l].exports;var s=n[l]={i:l,l:!1,exports:{}};return t[l].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=t,o.c=n,o.d=function(l,s,c){o.o(l,s)||Object.defineProperty(l,s,{configurable:!1,enumerable:!0,get:c})},o.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return o.d(s,"a",s),s},o.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)},o.p="",o(o.s=109)}([function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(17),s=o(18),c=o(19),d=o(45),b=o(46),w=o(47),E=o(48),x=o(49),m=o(12),_=o(32),p=o(33),h=o(31),P=o(1),g={Scope:P.Scope,create:P.create,find:P.find,query:P.query,register:P.register,Container:l.default,Format:s.default,Leaf:c.default,Embed:E.default,Scroll:d.default,Block:w.default,Inline:b.default,Text:x.default,Attributor:{Attribute:m.default,Class:_.default,Style:p.default,Store:h.default}};n.default=g},function(t,n,o){var l=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,g){P.__proto__=g}||function(P,g){for(var v in g)g.hasOwnProperty(v)&&(P[v]=g[v])};return function(P,g){h(P,g);function v(){this.constructor=P}P.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=function(h){l(P,h);function P(g){var v=this;return g="[Parchment] "+g,v=h.call(this,g)||this,v.message=g,v.name=v.constructor.name,v}return P}(Error);n.ParchmentError=s;var c={},d={},b={},w={};n.DATA_KEY="__blot";var E;(function(h){h[h.TYPE=3]="TYPE",h[h.LEVEL=12]="LEVEL",h[h.ATTRIBUTE=13]="ATTRIBUTE",h[h.BLOT=14]="BLOT",h[h.INLINE=7]="INLINE",h[h.BLOCK=11]="BLOCK",h[h.BLOCK_BLOT=10]="BLOCK_BLOT",h[h.INLINE_BLOT=6]="INLINE_BLOT",h[h.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",h[h.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",h[h.ANY=15]="ANY"})(E=n.Scope||(n.Scope={}));function x(h,P){var g=_(h);if(g==null)throw new s("Unable to create "+h+" blot");var v=g,y=h instanceof Node||h.nodeType===Node.TEXT_NODE?h:v.create(P);return new v(y,P)}n.create=x;function m(h,P){return P===void 0&&(P=!1),h==null?null:h[n.DATA_KEY]!=null?h[n.DATA_KEY].blot:P?m(h.parentNode,P):null}n.find=m;function _(h,P){P===void 0&&(P=E.ANY);var g;if(typeof h=="string")g=w[h]||c[h];else if(h instanceof Text||h.nodeType===Node.TEXT_NODE)g=w.text;else if(typeof h=="number")h&E.LEVEL&E.BLOCK?g=w.block:h&E.LEVEL&E.INLINE&&(g=w.inline);else if(h instanceof HTMLElement){var v=(h.getAttribute("class")||"").split(/\s+/);for(var y in v)if(g=d[v[y]],g)break;g=g||b[h.tagName]}return g==null?null:P&E.LEVEL&g.scope&&P&E.TYPE&g.scope?g:null}n.query=_;function p(){for(var h=[],P=0;P<arguments.length;P++)h[P]=arguments[P];if(h.length>1)return h.map(function(y){return p(y)});var g=h[0];if(typeof g.blotName!="string"&&typeof g.attrName!="string")throw new s("Invalid definition");if(g.blotName==="abstract")throw new s("Cannot register abstract class");if(w[g.blotName||g.attrName]=g,typeof g.keyName=="string")c[g.keyName]=g;else if(g.className!=null&&(d[g.className]=g),g.tagName!=null){Array.isArray(g.tagName)?g.tagName=g.tagName.map(function(y){return y.toUpperCase()}):g.tagName=g.tagName.toUpperCase();var v=Array.isArray(g.tagName)?g.tagName:[g.tagName];v.forEach(function(y){(b[y]==null||g.className==null)&&(b[y]=g)})}return g}n.register=p},function(t,n,o){var l=o(51),s=o(11),c=o(3),d=o(20),b="\0",w=function(E){Array.isArray(E)?this.ops=E:E!=null&&Array.isArray(E.ops)?this.ops=E.ops:this.ops=[]};w.prototype.insert=function(E,x){var m={};return E.length===0?this:(m.insert=E,x!=null&&typeof x=="object"&&Object.keys(x).length>0&&(m.attributes=x),this.push(m))},w.prototype.delete=function(E){return E<=0?this:this.push({delete:E})},w.prototype.retain=function(E,x){if(E<=0)return this;var m={retain:E};return x!=null&&typeof x=="object"&&Object.keys(x).length>0&&(m.attributes=x),this.push(m)},w.prototype.push=function(E){var x=this.ops.length,m=this.ops[x-1];if(E=c(!0,{},E),typeof m=="object"){if(typeof E.delete=="number"&&typeof m.delete=="number")return this.ops[x-1]={delete:m.delete+E.delete},this;if(typeof m.delete=="number"&&E.insert!=null&&(x-=1,m=this.ops[x-1],typeof m!="object"))return this.ops.unshift(E),this;if(s(E.attributes,m.attributes)){if(typeof E.insert=="string"&&typeof m.insert=="string")return this.ops[x-1]={insert:m.insert+E.insert},typeof E.attributes=="object"&&(this.ops[x-1].attributes=E.attributes),this;if(typeof E.retain=="number"&&typeof m.retain=="number")return this.ops[x-1]={retain:m.retain+E.retain},typeof E.attributes=="object"&&(this.ops[x-1].attributes=E.attributes),this}}return x===this.ops.length?this.ops.push(E):this.ops.splice(x,0,E),this},w.prototype.chop=function(){var E=this.ops[this.ops.length-1];return E&&E.retain&&!E.attributes&&this.ops.pop(),this},w.prototype.filter=function(E){return this.ops.filter(E)},w.prototype.forEach=function(E){this.ops.forEach(E)},w.prototype.map=function(E){return this.ops.map(E)},w.prototype.partition=function(E){var x=[],m=[];return this.forEach(function(_){var p=E(_)?x:m;p.push(_)}),[x,m]},w.prototype.reduce=function(E,x){return this.ops.reduce(E,x)},w.prototype.changeLength=function(){return this.reduce(function(E,x){return x.insert?E+d.length(x):x.delete?E-x.delete:E},0)},w.prototype.length=function(){return this.reduce(function(E,x){return E+d.length(x)},0)},w.prototype.slice=function(E,x){E=E||0,typeof x!="number"&&(x=1/0);for(var m=[],_=d.iterator(this.ops),p=0;p<x&&_.hasNext();){var h;p<E?h=_.next(E-p):(h=_.next(x-p),m.push(h)),p+=d.length(h)}return new w(m)},w.prototype.compose=function(E){var x=d.iterator(this.ops),m=d.iterator(E.ops),_=[],p=m.peek();if(p!=null&&typeof p.retain=="number"&&p.attributes==null){for(var h=p.retain;x.peekType()==="insert"&&x.peekLength()<=h;)h-=x.peekLength(),_.push(x.next());p.retain-h>0&&m.next(p.retain-h)}for(var P=new w(_);x.hasNext()||m.hasNext();)if(m.peekType()==="insert")P.push(m.next());else if(x.peekType()==="delete")P.push(x.next());else{var g=Math.min(x.peekLength(),m.peekLength()),v=x.next(g),y=m.next(g);if(typeof y.retain=="number"){var O={};typeof v.retain=="number"?O.retain=g:O.insert=v.insert;var M=d.attributes.compose(v.attributes,y.attributes,typeof v.retain=="number");if(M&&(O.attributes=M),P.push(O),!m.hasNext()&&s(P.ops[P.ops.length-1],O)){var R=new w(x.rest());return P.concat(R).chop()}}else typeof y.delete=="number"&&typeof v.retain=="number"&&P.push(y)}return P.chop()},w.prototype.concat=function(E){var x=new w(this.ops.slice());return E.ops.length>0&&(x.push(E.ops[0]),x.ops=x.ops.concat(E.ops.slice(1))),x},w.prototype.diff=function(E,x){if(this.ops===E.ops)return new w;var m=[this,E].map(function(g){return g.map(function(v){if(v.insert!=null)return typeof v.insert=="string"?v.insert:b;var y=g===E?"on":"with";throw new Error("diff() called "+y+" non-document")}).join("")}),_=new w,p=l(m[0],m[1],x),h=d.iterator(this.ops),P=d.iterator(E.ops);return p.forEach(function(g){for(var v=g[1].length;v>0;){var y=0;switch(g[0]){case l.INSERT:y=Math.min(P.peekLength(),v),_.push(P.next(y));break;case l.DELETE:y=Math.min(v,h.peekLength()),h.next(y),_.delete(y);break;case l.EQUAL:y=Math.min(h.peekLength(),P.peekLength(),v);var O=h.next(y),M=P.next(y);s(O.insert,M.insert)?_.retain(y,d.attributes.diff(O.attributes,M.attributes)):_.push(M).delete(y);break}v-=y}}),_.chop()},w.prototype.eachLine=function(E,x){x=x||`
114
+ `;for(var m=d.iterator(this.ops),_=new w,p=0;m.hasNext();){if(m.peekType()!=="insert")return;var h=m.peek(),P=d.length(h)-m.peekLength(),g=typeof h.insert=="string"?h.insert.indexOf(x,P)-P:-1;if(g<0)_.push(m.next());else if(g>0)_.push(m.next(g));else{if(E(_,m.next(1).attributes||{},p)===!1)return;p+=1,_=new w}}_.length()>0&&E(_,{},p)},w.prototype.transform=function(E,x){if(x=!!x,typeof E=="number")return this.transformPosition(E,x);for(var m=d.iterator(this.ops),_=d.iterator(E.ops),p=new w;m.hasNext()||_.hasNext();)if(m.peekType()==="insert"&&(x||_.peekType()!=="insert"))p.retain(d.length(m.next()));else if(_.peekType()==="insert")p.push(_.next());else{var h=Math.min(m.peekLength(),_.peekLength()),P=m.next(h),g=_.next(h);if(P.delete)continue;g.delete?p.push(g):p.retain(h,d.attributes.transform(P.attributes,g.attributes,x))}return p.chop()},w.prototype.transformPosition=function(E,x){x=!!x;for(var m=d.iterator(this.ops),_=0;m.hasNext()&&_<=E;){var p=m.peekLength(),h=m.peekType();if(m.next(),h==="delete"){E-=Math.min(p,E-_);continue}else h==="insert"&&(_<E||!x)&&(E+=p);_+=p}return E},t.exports=w},function(t,n){var o=Object.prototype.hasOwnProperty,l=Object.prototype.toString,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d=function(m){return typeof Array.isArray=="function"?Array.isArray(m):l.call(m)==="[object Array]"},b=function(m){if(!m||l.call(m)!=="[object Object]")return!1;var _=o.call(m,"constructor"),p=m.constructor&&m.constructor.prototype&&o.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!_&&!p)return!1;var h;for(h in m);return typeof h>"u"||o.call(m,h)},w=function(m,_){s&&_.name==="__proto__"?s(m,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):m[_.name]=_.newValue},E=function(m,_){if(_==="__proto__")if(o.call(m,_)){if(c)return c(m,_).value}else return;return m[_]};t.exports=function x(){var m,_,p,h,P,g,v=arguments[0],y=1,O=arguments.length,M=!1;for(typeof v=="boolean"&&(M=v,v=arguments[1]||{},y=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});y<O;++y)if(m=arguments[y],m!=null)for(_ in m)p=E(v,_),h=E(m,_),v!==h&&(M&&h&&(b(h)||(P=d(h)))?(P?(P=!1,g=p&&d(p)?p:[]):g=p&&b(p)?p:{},w(v,{name:_,newValue:x(M,g,h)})):typeof h<"u"&&w(v,{name:_,newValue:h}));return v}},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var l=function(){function A(N,k){for(var L=0;L<k.length;L++){var B=k[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(N,B.key,B)}}return function(N,k,L){return k&&A(N.prototype,k),L&&A(N,L),N}}(),s=function A(N,k,L){N===null&&(N=Function.prototype);var B=Object.getOwnPropertyDescriptor(N,k);if(B===void 0){var X=Object.getPrototypeOf(N);return X===null?void 0:A(X,k,L)}else{if("value"in B)return B.value;var K=B.get;return K===void 0?void 0:K.call(L)}},c=o(3),d=v(c),b=o(2),w=v(b),E=o(0),x=v(E),m=o(16),_=v(m),p=o(6),h=v(p),P=o(7),g=v(P);function v(A){return A&&A.__esModule?A:{default:A}}function y(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")}function O(A,N){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:A}function M(A,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);A.prototype=Object.create(N&&N.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(A,N):A.__proto__=N)}var R=1,D=function(A){M(N,A);function N(){return y(this,N),O(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return l(N,[{key:"attach",value:function(){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"attach",this).call(this),this.attributes=new x.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new w.default().insert(this.value(),(0,d.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(L,B){var X=x.default.query(L,x.default.Scope.BLOCK_ATTRIBUTE);X!=null&&this.attributes.attribute(X,B)}},{key:"formatAt",value:function(L,B,X,K){this.format(X,K)}},{key:"insertAt",value:function(L,B,X){if(typeof B=="string"&&B.endsWith(`
115
+ `)){var K=x.default.create(T.blotName);this.parent.insertBefore(K,L===0?this:this.next),K.insertAt(0,B.slice(0,-1))}else s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,L,B,X)}}]),N}(x.default.Embed);D.scope=x.default.Scope.BLOCK_BLOT;var T=function(A){M(N,A);function N(k){y(this,N);var L=O(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,k));return L.cache={},L}return l(N,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(x.default.Leaf).reduce(function(L,B){return B.length()===0?L:L.insert(B.value(),S(B))},new w.default).insert(`
116
+ `,S(this))),this.cache.delta}},{key:"deleteAt",value:function(L,B){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"deleteAt",this).call(this,L,B),this.cache={}}},{key:"formatAt",value:function(L,B,X,K){B<=0||(x.default.query(X,x.default.Scope.BLOCK)?L+B===this.length()&&this.format(X,K):s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"formatAt",this).call(this,L,Math.min(B,this.length()-L-1),X,K),this.cache={})}},{key:"insertAt",value:function(L,B,X){if(X!=null)return s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,L,B,X);if(B.length!==0){var K=B.split(`
117
+ `),Q=K.shift();Q.length>0&&(L<this.length()-1||this.children.tail==null?s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,Math.min(L,this.length()-1),Q):this.children.tail.insertAt(this.children.tail.length(),Q),this.cache={});var H=this;K.reduce(function(z,I){return H=H.split(z,!0),H.insertAt(0,I),I.length},L+Q.length)}}},{key:"insertBefore",value:function(L,B){var X=this.children.head;s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertBefore",this).call(this,L,B),X instanceof _.default&&X.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"length",this).call(this)+R),this.cache.length}},{key:"moveChildren",value:function(L,B){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"moveChildren",this).call(this,L,B),this.cache={}}},{key:"optimize",value:function(L){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,L),this.cache={}}},{key:"path",value:function(L){return s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"path",this).call(this,L,!0)}},{key:"removeChild",value:function(L){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"removeChild",this).call(this,L),this.cache={}}},{key:"split",value:function(L){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(B&&(L===0||L>=this.length()-R)){var X=this.clone();return L===0?(this.parent.insertBefore(X,this),this):(this.parent.insertBefore(X,this.next),X)}else{var K=s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"split",this).call(this,L,B);return this.cache={},K}}}]),N}(x.default.Block);T.blotName="block",T.tagName="P",T.defaultChild="break",T.allowedChildren=[h.default,x.default.Embed,g.default];function S(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A==null||(typeof A.formats=="function"&&(N=(0,d.default)(N,A.formats())),A.parent==null||A.parent.blotName=="scroll"||A.parent.statics.scope!==A.statics.scope)?N:S(A.parent,N)}n.bubbleFormats=S,n.BlockEmbed=D,n.default=T},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},s=function(){function H(z,I){var U=[],$=!0,ee=!1,G=void 0;try{for(var Z=z[Symbol.iterator](),W;!($=(W=Z.next()).done)&&(U.push(W.value),!(I&&U.length===I));$=!0);}catch(te){ee=!0,G=te}finally{try{!$&&Z.return&&Z.return()}finally{if(ee)throw G}}return U}return function(z,I){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return H(z,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function H(z,I){for(var U=0;U<I.length;U++){var $=I[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(z,$.key,$)}}return function(z,I,U){return I&&H(z.prototype,I),U&&H(z,U),z}}();o(50);var d=o(2),b=S(d),w=o(14),E=S(w),x=o(8),m=S(x),_=o(9),p=S(_),h=o(0),P=S(h),g=o(15),v=S(g),y=o(3),O=S(y),M=o(10),R=S(M),D=o(34),T=S(D);function S(H){return H&&H.__esModule?H:{default:H}}function A(H,z,I){return z in H?Object.defineProperty(H,z,{value:I,enumerable:!0,configurable:!0,writable:!0}):H[z]=I,H}function N(H,z){if(!(H instanceof z))throw new TypeError("Cannot call a class as a function")}var k=(0,R.default)("quill"),L=function(){c(H,null,[{key:"debug",value:function(I){I===!0&&(I="log"),R.default.level(I)}},{key:"find",value:function(I){return I.__quill||P.default.find(I)}},{key:"import",value:function(I){return this.imports[I]==null&&k.error("Cannot import "+I+". Are you sure it was registered?"),this.imports[I]}},{key:"register",value:function(I,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof I!="string"){var G=I.attrName||I.blotName;typeof G=="string"?this.register("formats/"+G,I,U):Object.keys(I).forEach(function(Z){$.register(Z,I[Z],U)})}else this.imports[I]!=null&&!ee&&k.warn("Overwriting "+I+" with",U),this.imports[I]=U,(I.startsWith("blots/")||I.startsWith("formats/"))&&U.blotName!=="abstract"?P.default.register(U):I.startsWith("modules")&&typeof U.register=="function"&&U.register()}}]);function H(z){var I=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(N(this,H),this.options=B(z,U),this.container=this.options.container,this.container==null)return k.error("Invalid Quill container",z);this.options.debug&&H.debug(this.options.debug);var $=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new m.default,this.scroll=P.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new E.default(this.scroll),this.selection=new v.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(m.default.events.EDITOR_CHANGE,function(G){G===m.default.events.TEXT_CHANGE&&I.root.classList.toggle("ql-blank",I.editor.isBlank())}),this.emitter.on(m.default.events.SCROLL_UPDATE,function(G,Z){var W=I.selection.lastRange,te=W&&W.length===0?W.index:void 0;X.call(I,function(){return I.editor.update(null,Z,te)},G)});var ee=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+$+"<p><br></p></div>");this.setContents(ee),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return c(H,[{key:"addContainer",value:function(I){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof I=="string"){var $=I;I=document.createElement("div"),I.classList.add($)}return this.container.insertBefore(I,U),I}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(I,U,$){var ee=this,G=K(I,U,$),Z=s(G,4);return I=Z[0],U=Z[1],$=Z[3],X.call(this,function(){return ee.editor.deleteText(I,U)},$,I,-1*U)}},{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,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;return X.call(this,function(){var G=$.getSelection(!0),Z=new b.default;if(G==null)return Z;if(P.default.query(I,P.default.Scope.BLOCK))Z=$.editor.formatLine(G.index,G.length,A({},I,U));else{if(G.length===0)return $.selection.format(I,U),Z;Z=$.editor.formatText(G.index,G.length,A({},I,U))}return $.setSelection(G,m.default.sources.SILENT),Z},ee)}},{key:"formatLine",value:function(I,U,$,ee,G){var Z=this,W=void 0,te=K(I,U,$,ee,G),re=s(te,4);return I=re[0],U=re[1],W=re[2],G=re[3],X.call(this,function(){return Z.editor.formatLine(I,U,W)},G,I,0)}},{key:"formatText",value:function(I,U,$,ee,G){var Z=this,W=void 0,te=K(I,U,$,ee,G),re=s(te,4);return I=re[0],U=re[1],W=re[2],G=re[3],X.call(this,function(){return Z.editor.formatText(I,U,W)},G,I,0)}},{key:"getBounds",value:function(I){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=void 0;typeof I=="number"?$=this.selection.getBounds(I,U):$=this.selection.getBounds(I.index,I.length);var ee=this.container.getBoundingClientRect();return{bottom:$.bottom-ee.top,height:$.height,left:$.left-ee.left,right:$.right-ee.left,top:$.top-ee.top,width:$.width}}},{key:"getContents",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,$=K(I,U),ee=s($,2);return I=ee[0],U=ee[1],this.editor.getContents(I,U)}},{key:"getFormat",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof I=="number"?this.editor.getFormat(I,U):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,U=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,U)}},{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,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-I,$=K(I,U),ee=s($,2);return I=ee[0],U=ee[1],this.editor.getText(I,U)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(I,U,$){var ee=this,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:H.sources.API;return X.call(this,function(){return ee.editor.insertEmbed(I,U,$)},G,I)}},{key:"insertText",value:function(I,U,$,ee,G){var Z=this,W=void 0,te=K(I,0,$,ee,G),re=s(te,4);return I=re[0],W=re[2],G=re[3],X.call(this,function(){return Z.editor.insertText(I,U,W)},G,I,U.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,U,$){this.clipboard.dangerouslyPasteHTML(I,U,$)}},{key:"removeFormat",value:function(I,U,$){var ee=this,G=K(I,U,$),Z=s(G,4);return I=Z[0],U=Z[1],$=Z[3],X.call(this,function(){return ee.editor.removeFormat(I,U)},$,I)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(I){var U=this,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API;return X.call(this,function(){I=new b.default(I);var ee=U.getLength(),G=U.editor.deleteText(0,ee),Z=U.editor.applyDelta(I),W=Z.ops[Z.ops.length-1];W!=null&&typeof W.insert=="string"&&W.insert[W.insert.length-1]===`
118
+ `&&(U.editor.deleteText(U.getLength()-1,1),Z.delete(1));var te=G.compose(Z);return te},$)}},{key:"setSelection",value:function(I,U,$){if(I==null)this.selection.setRange(null,U||H.sources.API);else{var ee=K(I,U,$),G=s(ee,4);I=G[0],U=G[1],$=G[3],this.selection.setRange(new g.Range(I,U),$),$!==m.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(I){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API,$=new b.default().insert(I);return this.setContents($,U)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m.default.sources.USER,U=this.scroll.update(I);return this.selection.update(I),U}},{key:"updateContents",value:function(I){var U=this,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m.default.sources.API;return X.call(this,function(){return I=new b.default(I),U.editor.applyDelta(I,$)},$,!0)}}]),H}();L.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},L.events=m.default.events,L.sources=m.default.sources,L.version="1.3.7",L.imports={delta:b.default,parchment:P.default,"core/module":p.default,"core/theme":T.default};function B(H,z){if(z=(0,O.default)(!0,{container:H,modules:{clipboard:!0,keyboard:!0,history:!0}},z),!z.theme||z.theme===L.DEFAULTS.theme)z.theme=T.default;else if(z.theme=L.import("themes/"+z.theme),z.theme==null)throw new Error("Invalid theme "+z.theme+". Did you register it?");var I=(0,O.default)(!0,{},z.theme.DEFAULTS);[I,z].forEach(function(ee){ee.modules=ee.modules||{},Object.keys(ee.modules).forEach(function(G){ee.modules[G]===!0&&(ee.modules[G]={})})});var U=Object.keys(I.modules).concat(Object.keys(z.modules)),$=U.reduce(function(ee,G){var Z=L.import("modules/"+G);return Z==null?k.error("Cannot load "+G+" module. Are you sure you registered it?"):ee[G]=Z.DEFAULTS||{},ee},{});return z.modules!=null&&z.modules.toolbar&&z.modules.toolbar.constructor!==Object&&(z.modules.toolbar={container:z.modules.toolbar}),z=(0,O.default)(!0,{},L.DEFAULTS,{modules:$},I,z),["bounds","container","scrollingContainer"].forEach(function(ee){typeof z[ee]=="string"&&(z[ee]=document.querySelector(z[ee]))}),z.modules=Object.keys(z.modules).reduce(function(ee,G){return z.modules[G]&&(ee[G]=z.modules[G]),ee},{}),z}function X(H,z,I,U){if(this.options.strict&&!this.isEnabled()&&z===m.default.sources.USER)return new b.default;var $=I==null?null:this.getSelection(),ee=this.editor.delta,G=H();if($!=null&&(I===!0&&(I=$.index),U==null?$=Q($,G,z):U!==0&&($=Q($,I,U,z)),this.setSelection($,m.default.sources.SILENT)),G.length()>0){var Z,W=[m.default.events.TEXT_CHANGE,G,ee,z];if((Z=this.emitter).emit.apply(Z,[m.default.events.EDITOR_CHANGE].concat(W)),z!==m.default.sources.SILENT){var te;(te=this.emitter).emit.apply(te,W)}}return G}function K(H,z,I,U,$){var ee={};return typeof H.index=="number"&&typeof H.length=="number"?typeof z!="number"?($=U,U=I,I=z,z=H.length,H=H.index):(z=H.length,H=H.index):typeof z!="number"&&($=U,U=I,I=z,z=0),(typeof I>"u"?"undefined":l(I))==="object"?(ee=I,$=U):typeof I=="string"&&(U!=null?ee[I]=U:$=I),$=$||m.default.sources.API,[H,z,ee,$]}function Q(H,z,I,U){if(H==null)return null;var $=void 0,ee=void 0;if(z instanceof b.default){var G=[H.index,H.index+H.length].map(function(re){return z.transformPosition(re,U!==m.default.sources.USER)}),Z=s(G,2);$=Z[0],ee=Z[1]}else{var W=[H.index,H.index+H.length].map(function(re){return re<z||re===z&&U===m.default.sources.USER?re:I>=0?re+I:Math.max(z,re+I)}),te=s(W,2);$=te[0],ee=te[1]}return new g.Range($,ee-$)}n.expandConfig=B,n.overload=K,n.default=L},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function h(P,g){for(var v=0;v<g.length;v++){var y=g[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(P,y.key,y)}}return function(P,g,v){return g&&h(P.prototype,g),v&&h(P,v),P}}(),s=function h(P,g,v){P===null&&(P=Function.prototype);var y=Object.getOwnPropertyDescriptor(P,g);if(y===void 0){var O=Object.getPrototypeOf(P);return O===null?void 0:h(O,g,v)}else{if("value"in y)return y.value;var M=y.get;return M===void 0?void 0:M.call(v)}},c=o(7),d=E(c),b=o(0),w=E(b);function E(h){return h&&h.__esModule?h:{default:h}}function x(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function m(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function _(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var p=function(h){_(P,h);function P(){return x(this,P),m(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"formatAt",value:function(v,y,O,M){if(P.compare(this.statics.blotName,O)<0&&w.default.query(O,w.default.Scope.BLOT)){var R=this.isolate(v,y);M&&R.wrap(O,M)}else s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"formatAt",this).call(this,v,y,O,M)}},{key:"optimize",value:function(v){if(s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,v),this.parent instanceof P&&P.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(v,y){var O=P.order.indexOf(v),M=P.order.indexOf(y);return O>=0||M>=0?O-M:v===y?0:v<y?-1:1}}]),P}(w.default.Inline);p.allowedChildren=[p,w.default.Embed,d.default],p.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=p},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(0),s=c(l);function c(x){return x&&x.__esModule?x:{default:x}}function d(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function b(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function w(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var E=function(x){w(m,x);function m(){return d(this,m),b(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(s.default.Text);n.default=E},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function g(v,y){for(var O=0;O<y.length;O++){var M=y[O];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(v,M.key,M)}}return function(v,y,O){return y&&g(v.prototype,y),O&&g(v,O),v}}(),s=function g(v,y,O){v===null&&(v=Function.prototype);var M=Object.getOwnPropertyDescriptor(v,y);if(M===void 0){var R=Object.getPrototypeOf(v);return R===null?void 0:g(R,y,O)}else{if("value"in M)return M.value;var D=M.get;return D===void 0?void 0:D.call(O)}},c=o(54),d=E(c),b=o(10),w=E(b);function E(g){return g&&g.__esModule?g:{default:g}}function x(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function m(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function _(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var p=(0,w.default)("quill:events"),h=["selectionchange","mousedown","mouseup","click"];h.forEach(function(g){document.addEventListener(g,function(){for(var v=arguments.length,y=Array(v),O=0;O<v;O++)y[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(M){if(M.__quill&&M.__quill.emitter){var R;(R=M.__quill.emitter).handleDOM.apply(R,y)}})})});var P=function(g){_(v,g);function v(){x(this,v);var y=m(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return y.listeners={},y.on("error",p.error),y}return l(v,[{key:"emit",value:function(){p.log.apply(p,arguments),s(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(O){for(var M=arguments.length,R=Array(M>1?M-1:0),D=1;D<M;D++)R[D-1]=arguments[D];(this.listeners[O.type]||[]).forEach(function(T){var S=T.node,A=T.handler;(O.target===S||S.contains(O.target))&&A.apply(void 0,[O].concat(R))})}},{key:"listenDOM",value:function(O,M,R){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:M,handler:R})}}]),v}(d.default);P.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"},P.sources={API:"api",SILENT:"silent",USER:"user"},n.default=P},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});function l(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}var s=function c(d){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,c),this.quill=d,this.options=b};s.DEFAULTS={},n.default=s},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=["error","warn","log","info"],s="warn";function c(b){if(l.indexOf(b)<=l.indexOf(s)){for(var w,E=arguments.length,x=Array(E>1?E-1:0),m=1;m<E;m++)x[m-1]=arguments[m];(w=console)[b].apply(w,x)}}function d(b){return l.reduce(function(w,E){return w[E]=c.bind(console,E,b),w},{})}c.level=d.level=function(b){s=b},n.default=d},function(t,n,o){var l=Array.prototype.slice,s=o(52),c=o(53),d=t.exports=function(x,m,_){return _||(_={}),x===m?!0:x instanceof Date&&m instanceof Date?x.getTime()===m.getTime():!x||!m||typeof x!="object"&&typeof m!="object"?_.strict?x===m:x==m:E(x,m,_)};function b(x){return x==null}function w(x){return!(!x||typeof x!="object"||typeof x.length!="number"||typeof x.copy!="function"||typeof x.slice!="function"||x.length>0&&typeof x[0]!="number")}function E(x,m,_){var p,h;if(b(x)||b(m)||x.prototype!==m.prototype)return!1;if(c(x))return c(m)?(x=l.call(x),m=l.call(m),d(x,m,_)):!1;if(w(x)){if(!w(m)||x.length!==m.length)return!1;for(p=0;p<x.length;p++)if(x[p]!==m[p])return!1;return!0}try{var P=s(x),g=s(m)}catch{return!1}if(P.length!=g.length)return!1;for(P.sort(),g.sort(),p=P.length-1;p>=0;p--)if(P[p]!=g[p])return!1;for(p=P.length-1;p>=0;p--)if(h=P[p],!d(x[h],m[h],_))return!1;return typeof x==typeof m}},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(1),s=function(){function c(d,b,w){w===void 0&&(w={}),this.attrName=d,this.keyName=b;var E=l.Scope.TYPE&l.Scope.ATTRIBUTE;w.scope!=null?this.scope=w.scope&l.Scope.LEVEL|E:this.scope=l.Scope.ATTRIBUTE,w.whitelist!=null&&(this.whitelist=w.whitelist)}return c.keys=function(d){return[].map.call(d.attributes,function(b){return b.name})},c.prototype.add=function(d,b){return this.canAdd(d,b)?(d.setAttribute(this.keyName,b),!0):!1},c.prototype.canAdd=function(d,b){var w=l.query(d,l.Scope.BLOT&(this.scope|l.Scope.TYPE));return w==null?!1:this.whitelist==null?!0:typeof b=="string"?this.whitelist.indexOf(b.replace(/["']/g,""))>-1:this.whitelist.indexOf(b)>-1},c.prototype.remove=function(d){d.removeAttribute(this.keyName)},c.prototype.value=function(d){var b=d.getAttribute(this.keyName);return this.canAdd(d,b)&&b?b:""},c}();n.default=s},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var l=function(){function D(T,S){var A=[],N=!0,k=!1,L=void 0;try{for(var B=T[Symbol.iterator](),X;!(N=(X=B.next()).done)&&(A.push(X.value),!(S&&A.length===S));N=!0);}catch(K){k=!0,L=K}finally{try{!N&&B.return&&B.return()}finally{if(k)throw L}}return A}return function(T,S){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return D(T,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function D(T,S){for(var A=0;A<S.length;A++){var N=S[A];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(T,N.key,N)}}return function(T,S,A){return S&&D(T.prototype,S),A&&D(T,A),T}}(),c=function D(T,S,A){T===null&&(T=Function.prototype);var N=Object.getOwnPropertyDescriptor(T,S);if(N===void 0){var k=Object.getPrototypeOf(T);return k===null?void 0:D(k,S,A)}else{if("value"in N)return N.value;var L=N.get;return L===void 0?void 0:L.call(A)}},d=o(2),b=g(d),w=o(0),E=g(w),x=o(4),m=g(x),_=o(6),p=g(_),h=o(7),P=g(h);function g(D){return D&&D.__esModule?D:{default:D}}function v(D,T){if(!(D instanceof T))throw new TypeError("Cannot call a class as a function")}function y(D,T){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:D}function O(D,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);D.prototype=Object.create(T&&T.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(D,T):D.__proto__=T)}var M=function(D){O(T,D);function T(){return v(this,T),y(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return T}(p.default);M.blotName="code",M.tagName="CODE";var R=function(D){O(T,D);function T(){return v(this,T),y(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return s(T,[{key:"delta",value:function(){var A=this,N=this.domNode.textContent;return N.endsWith(`
119
+ `)&&(N=N.slice(0,-1)),N.split(`
120
+ `).reduce(function(k,L){return k.insert(L).insert(`
121
+ `,A.formats())},new b.default)}},{key:"format",value:function(A,N){if(!(A===this.statics.blotName&&N)){var k=this.descendant(P.default,this.length()-1),L=l(k,1),B=L[0];B!=null&&B.deleteAt(B.length()-1,1),c(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"format",this).call(this,A,N)}}},{key:"formatAt",value:function(A,N,k,L){if(N!==0&&!(E.default.query(k,E.default.Scope.BLOCK)==null||k===this.statics.blotName&&L===this.statics.formats(this.domNode))){var B=this.newlineIndex(A);if(!(B<0||B>=A+N)){var X=this.newlineIndex(A,!0)+1,K=B-X+1,Q=this.isolate(X,K),H=Q.next;Q.format(k,L),H instanceof T&&H.formatAt(0,A-X+N-K,k,L)}}}},{key:"insertAt",value:function(A,N,k){if(k==null){var L=this.descendant(P.default,A),B=l(L,2),X=B[0],K=B[1];X.insertAt(K,N)}}},{key:"length",value:function(){var A=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
122
+ `)?A:A+1}},{key:"newlineIndex",value:function(A){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(N)return this.domNode.textContent.slice(0,A).lastIndexOf(`
123
+ `);var k=this.domNode.textContent.slice(A).indexOf(`
124
+ `);return k>-1?A+k:-1}},{key:"optimize",value:function(A){this.domNode.textContent.endsWith(`
125
+ `)||this.appendChild(E.default.create("text",`
126
+ `)),c(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,A);var N=this.next;N!=null&&N.prev===this&&N.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===N.statics.formats(N.domNode)&&(N.optimize(A),N.moveChildren(this),N.remove())}},{key:"replace",value:function(A){c(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replace",this).call(this,A),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(N){var k=E.default.find(N);k==null?N.parentNode.removeChild(N):k instanceof E.default.Embed?k.remove():k.unwrap()})}}],[{key:"create",value:function(A){var N=c(T.__proto__||Object.getPrototypeOf(T),"create",this).call(this,A);return N.setAttribute("spellcheck",!1),N}},{key:"formats",value:function(){return!0}}]),T}(m.default);R.blotName="code-block",R.tagName="PRE",R.TAB=" ",n.Code=M,n.default=R},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},s=function(){function H(z,I){var U=[],$=!0,ee=!1,G=void 0;try{for(var Z=z[Symbol.iterator](),W;!($=(W=Z.next()).done)&&(U.push(W.value),!(I&&U.length===I));$=!0);}catch(te){ee=!0,G=te}finally{try{!$&&Z.return&&Z.return()}finally{if(ee)throw G}}return U}return function(z,I){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return H(z,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function H(z,I){for(var U=0;U<I.length;U++){var $=I[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(z,$.key,$)}}return function(z,I,U){return I&&H(z.prototype,I),U&&H(z,U),z}}(),d=o(2),b=N(d),w=o(20),E=N(w),x=o(0),m=N(x),_=o(13),p=N(_),h=o(24),P=N(h),g=o(4),v=N(g),y=o(16),O=N(y),M=o(21),R=N(M),D=o(11),T=N(D),S=o(3),A=N(S);function N(H){return H&&H.__esModule?H:{default:H}}function k(H,z,I){return z in H?Object.defineProperty(H,z,{value:I,enumerable:!0,configurable:!0,writable:!0}):H[z]=I,H}function L(H,z){if(!(H instanceof z))throw new TypeError("Cannot call a class as a function")}var B=/^[ -~]*$/,X=function(){function H(z){L(this,H),this.scroll=z,this.delta=this.getDelta()}return c(H,[{key:"applyDelta",value:function(I){var U=this,$=!1;this.scroll.update();var ee=this.scroll.length();return this.scroll.batchStart(),I=Q(I),I.reduce(function(G,Z){var W=Z.retain||Z.delete||Z.insert.length||1,te=Z.attributes||{};if(Z.insert!=null){if(typeof Z.insert=="string"){var re=Z.insert;re.endsWith(`
127
+ `)&&$&&($=!1,re=re.slice(0,-1)),G>=ee&&!re.endsWith(`
128
+ `)&&($=!0),U.scroll.insertAt(G,re);var ie=U.scroll.line(G),oe=s(ie,2),se=oe[0],de=oe[1],pe=(0,A.default)({},(0,g.bubbleFormats)(se));if(se instanceof v.default){var Oe=se.descendant(m.default.Leaf,de),_e=s(Oe,1),Te=_e[0];pe=(0,A.default)(pe,(0,g.bubbleFormats)(Te))}te=E.default.attributes.diff(pe,te)||{}}else if(l(Z.insert)==="object"){var ce=Object.keys(Z.insert)[0];if(ce==null)return G;U.scroll.insertAt(G,ce,Z.insert[ce])}ee+=W}return Object.keys(te).forEach(function(he){U.scroll.formatAt(G,W,he,te[he])}),G+W},0),I.reduce(function(G,Z){return typeof Z.delete=="number"?(U.scroll.deleteAt(G,Z.delete),G):G+(Z.retain||Z.insert.length||1)},0),this.scroll.batchEnd(),this.update(I)}},{key:"deleteText",value:function(I,U){return this.scroll.deleteAt(I,U),this.update(new b.default().retain(I).delete(U))}},{key:"formatLine",value:function(I,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(ee).forEach(function(G){if(!($.scroll.whitelist!=null&&!$.scroll.whitelist[G])){var Z=$.scroll.lines(I,Math.max(U,1)),W=U;Z.forEach(function(te){var re=te.length();if(!(te instanceof p.default))te.format(G,ee[G]);else{var ie=I-te.offset($.scroll),oe=te.newlineIndex(ie+W)-ie+1;te.formatAt(ie,oe,G,ee[G])}W-=re})}}),this.scroll.optimize(),this.update(new b.default().retain(I).retain(U,(0,R.default)(ee)))}},{key:"formatText",value:function(I,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(ee).forEach(function(G){$.scroll.formatAt(I,U,G,ee[G])}),this.update(new b.default().retain(I).retain(U,(0,R.default)(ee)))}},{key:"getContents",value:function(I,U){return this.delta.slice(I,I+U)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(I,U){return I.concat(U.delta())},new b.default)}},{key:"getFormat",value:function(I){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=[],ee=[];U===0?this.scroll.path(I).forEach(function(Z){var W=s(Z,1),te=W[0];te instanceof v.default?$.push(te):te instanceof m.default.Leaf&&ee.push(te)}):($=this.scroll.lines(I,U),ee=this.scroll.descendants(m.default.Leaf,I,U));var G=[$,ee].map(function(Z){if(Z.length===0)return{};for(var W=(0,g.bubbleFormats)(Z.shift());Object.keys(W).length>0;){var te=Z.shift();if(te==null)return W;W=K((0,g.bubbleFormats)(te),W)}return W});return A.default.apply(A.default,G)}},{key:"getText",value:function(I,U){return this.getContents(I,U).filter(function($){return typeof $.insert=="string"}).map(function($){return $.insert}).join("")}},{key:"insertEmbed",value:function(I,U,$){return this.scroll.insertAt(I,U,$),this.update(new b.default().retain(I).insert(k({},U,$)))}},{key:"insertText",value:function(I,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return U=U.replace(/\r\n/g,`
129
+ `).replace(/\r/g,`
130
+ `),this.scroll.insertAt(I,U),Object.keys(ee).forEach(function(G){$.scroll.formatAt(I,U.length,G,ee[G])}),this.update(new b.default().retain(I).insert(U,(0,R.default)(ee)))}},{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!==v.default.blotName||I.children.length>1?!1:I.children.head instanceof O.default}},{key:"removeFormat",value:function(I,U){var $=this.getText(I,U),ee=this.scroll.line(I+U),G=s(ee,2),Z=G[0],W=G[1],te=0,re=new b.default;Z!=null&&(Z instanceof p.default?te=Z.newlineIndex(W)-W+1:te=Z.length()-W,re=Z.delta().slice(W,W+te-1).insert(`
131
+ `));var ie=this.getContents(I,U+te),oe=ie.diff(new b.default().insert($).concat(re)),se=new b.default().retain(I).concat(oe);return this.applyDelta(se)}},{key:"update",value:function(I){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,ee=this.delta;if(U.length===1&&U[0].type==="characterData"&&U[0].target.data.match(B)&&m.default.find(U[0].target)){var G=m.default.find(U[0].target),Z=(0,g.bubbleFormats)(G),W=G.offset(this.scroll),te=U[0].oldValue.replace(P.default.CONTENTS,""),re=new b.default().insert(te),ie=new b.default().insert(G.value()),oe=new b.default().retain(W).concat(re.diff(ie,$));I=oe.reduce(function(se,de){return de.insert?se.insert(de.insert,Z):se.push(de)},new b.default),this.delta=ee.compose(I)}else this.delta=this.getDelta(),(!I||!(0,T.default)(ee.compose(I),this.delta))&&(I=ee.diff(this.delta,$));return I}}]),H}();function K(H,z){return Object.keys(z).reduce(function(I,U){return H[U]==null||(z[U]===H[U]?I[U]=z[U]:Array.isArray(z[U])?z[U].indexOf(H[U])<0&&(I[U]=z[U].concat([H[U]])):I[U]=[z[U],H[U]]),I},{})}function Q(H){return H.reduce(function(z,I){if(I.insert===1){var U=(0,R.default)(I.attributes);return delete U.image,z.insert({image:I.attributes.image},U)}if(I.attributes!=null&&(I.attributes.list===!0||I.attributes.bullet===!0)&&(I=(0,R.default)(I),I.attributes.list?I.attributes.list="ordered":(I.attributes.list="bullet",delete I.attributes.bullet)),typeof I.insert=="string"){var $=I.insert.replace(/\r\n/g,`
132
+ `).replace(/\r/g,`
133
+ `);return z.insert($,I.attributes)}return z.push(I)},new b.default)}n.default=X},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var l=function(){function D(T,S){var A=[],N=!0,k=!1,L=void 0;try{for(var B=T[Symbol.iterator](),X;!(N=(X=B.next()).done)&&(A.push(X.value),!(S&&A.length===S));N=!0);}catch(K){k=!0,L=K}finally{try{!N&&B.return&&B.return()}finally{if(k)throw L}}return A}return function(T,S){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return D(T,S);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function D(T,S){for(var A=0;A<S.length;A++){var N=S[A];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(T,N.key,N)}}return function(T,S,A){return S&&D(T.prototype,S),A&&D(T,A),T}}(),c=o(0),d=P(c),b=o(21),w=P(b),E=o(11),x=P(E),m=o(8),_=P(m),p=o(10),h=P(p);function P(D){return D&&D.__esModule?D:{default:D}}function g(D){if(Array.isArray(D)){for(var T=0,S=Array(D.length);T<D.length;T++)S[T]=D[T];return S}else return Array.from(D)}function v(D,T){if(!(D instanceof T))throw new TypeError("Cannot call a class as a function")}var y=(0,h.default)("quill:selection"),O=function D(T){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;v(this,D),this.index=T,this.length=S},M=function(){function D(T,S){var A=this;v(this,D),this.emitter=S,this.scroll=T,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=d.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,_.default.sources.USER),1)}),this.emitter.on(_.default.events.EDITOR_CHANGE,function(N,k){N===_.default.events.TEXT_CHANGE&&k.length()>0&&A.update(_.default.sources.SILENT)}),this.emitter.on(_.default.events.SCROLL_BEFORE_UPDATE,function(){if(A.hasFocus()){var N=A.getNativeRange();N!=null&&N.start.node!==A.cursor.textNode&&A.emitter.once(_.default.events.SCROLL_UPDATE,function(){try{A.setNativeRange(N.start.node,N.start.offset,N.end.node,N.end.offset)}catch{}})}}),this.emitter.on(_.default.events.SCROLL_OPTIMIZE,function(N,k){if(k.range){var L=k.range,B=L.startNode,X=L.startOffset,K=L.endNode,Q=L.endOffset;A.setNativeRange(B,X,K,Q)}}),this.update(_.default.sources.SILENT)}return s(D,[{key:"handleComposition",value:function(){var S=this;this.root.addEventListener("compositionstart",function(){S.composing=!0}),this.root.addEventListener("compositionend",function(){if(S.composing=!1,S.cursor.parent){var A=S.cursor.restore();if(!A)return;setTimeout(function(){S.setNativeRange(A.startNode,A.startOffset,A.endNode,A.endOffset)},1)}})}},{key:"handleDragging",value:function(){var S=this;this.emitter.listenDOM("mousedown",document.body,function(){S.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){S.mouseDown=!1,S.update(_.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(S,A){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[S])){this.scroll.update();var N=this.getNativeRange();if(!(N==null||!N.native.collapsed||d.default.query(S,d.default.Scope.BLOCK))){if(N.start.node!==this.cursor.textNode){var k=d.default.find(N.start.node,!1);if(k==null)return;if(k instanceof d.default.Leaf){var L=k.split(N.start.offset);k.parent.insertBefore(this.cursor,L)}else k.insertBefore(this.cursor,N.start.node);this.cursor.attach()}this.cursor.format(S,A),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(S){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=this.scroll.length();S=Math.min(S,N-1),A=Math.min(S+A,N-1)-S;var k=void 0,L=this.scroll.leaf(S),B=l(L,2),X=B[0],K=B[1];if(X==null)return null;var Q=X.position(K,!0),H=l(Q,2);k=H[0],K=H[1];var z=document.createRange();if(A>0){z.setStart(k,K);var I=this.scroll.leaf(S+A),U=l(I,2);if(X=U[0],K=U[1],X==null)return null;var $=X.position(K,!0),ee=l($,2);return k=ee[0],K=ee[1],z.setEnd(k,K),z.getBoundingClientRect()}else{var G="left",Z=void 0;return k instanceof Text?(K<k.data.length?(z.setStart(k,K),z.setEnd(k,K+1)):(z.setStart(k,K-1),z.setEnd(k,K),G="right"),Z=z.getBoundingClientRect()):(Z=X.domNode.getBoundingClientRect(),K>0&&(G="right")),{bottom:Z.top+Z.height,height:Z.height,left:Z[G],right:Z[G],top:Z.top,width:0}}}},{key:"getNativeRange",value:function(){var S=document.getSelection();if(S==null||S.rangeCount<=0)return null;var A=S.getRangeAt(0);if(A==null)return null;var N=this.normalizeNative(A);return y.info("getNativeRange",N),N}},{key:"getRange",value:function(){var S=this.getNativeRange();if(S==null)return[null,null];var A=this.normalizedToRange(S);return[A,S]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(S){var A=this,N=[[S.start.node,S.start.offset]];S.native.collapsed||N.push([S.end.node,S.end.offset]);var k=N.map(function(X){var K=l(X,2),Q=K[0],H=K[1],z=d.default.find(Q,!0),I=z.offset(A.scroll);return H===0?I:z instanceof d.default.Container?I+z.length():I+z.index(Q,H)}),L=Math.min(Math.max.apply(Math,g(k)),this.scroll.length()-1),B=Math.min.apply(Math,[L].concat(g(k)));return new O(B,L-B)}},{key:"normalizeNative",value:function(S){if(!R(this.root,S.startContainer)||!S.collapsed&&!R(this.root,S.endContainer))return null;var A={start:{node:S.startContainer,offset:S.startOffset},end:{node:S.endContainer,offset:S.endOffset},native:S};return[A.start,A.end].forEach(function(N){for(var k=N.node,L=N.offset;!(k instanceof Text)&&k.childNodes.length>0;)if(k.childNodes.length>L)k=k.childNodes[L],L=0;else if(k.childNodes.length===L)k=k.lastChild,L=k instanceof Text?k.data.length:k.childNodes.length+1;else break;N.node=k,N.offset=L}),A}},{key:"rangeToNative",value:function(S){var A=this,N=S.collapsed?[S.index]:[S.index,S.index+S.length],k=[],L=this.scroll.length();return N.forEach(function(B,X){B=Math.min(L-1,B);var K=void 0,Q=A.scroll.leaf(B),H=l(Q,2),z=H[0],I=H[1],U=z.position(I,X!==0),$=l(U,2);K=$[0],I=$[1],k.push(K,I)}),k.length<2&&(k=k.concat(k)),k}},{key:"scrollIntoView",value:function(S){var A=this.lastRange;if(A!=null){var N=this.getBounds(A.index,A.length);if(N!=null){var k=this.scroll.length()-1,L=this.scroll.line(Math.min(A.index,k)),B=l(L,1),X=B[0],K=X;if(A.length>0){var Q=this.scroll.line(Math.min(A.index+A.length,k)),H=l(Q,1);K=H[0]}if(!(X==null||K==null)){var z=S.getBoundingClientRect();N.top<z.top?S.scrollTop-=z.top-N.top:N.bottom>z.bottom&&(S.scrollTop+=N.bottom-z.bottom)}}}}},{key:"setNativeRange",value:function(S,A){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S,k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A,L=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(y.info("setNativeRange",S,A,N,k),!(S!=null&&(this.root.parentNode==null||S.parentNode==null||N.parentNode==null))){var B=document.getSelection();if(B!=null)if(S!=null){this.hasFocus()||this.root.focus();var X=(this.getNativeRange()||{}).native;if(X==null||L||S!==X.startContainer||A!==X.startOffset||N!==X.endContainer||k!==X.endOffset){S.tagName=="BR"&&(A=[].indexOf.call(S.parentNode.childNodes,S),S=S.parentNode),N.tagName=="BR"&&(k=[].indexOf.call(N.parentNode.childNodes,N),N=N.parentNode);var K=document.createRange();K.setStart(S,A),K.setEnd(N,k),B.removeAllRanges(),B.addRange(K)}}else B.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(S){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof A=="string"&&(N=A,A=!1),y.info("setRange",S),S!=null){var k=this.rangeToNative(S);this.setNativeRange.apply(this,g(k).concat([A]))}else this.setNativeRange(null);this.update(N)}},{key:"update",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_.default.sources.USER,A=this.lastRange,N=this.getRange(),k=l(N,2),L=k[0],B=k[1];if(this.lastRange=L,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,x.default)(A,this.lastRange)){var X;!this.composing&&B!=null&&B.native.collapsed&&B.start.node!==this.cursor.textNode&&this.cursor.restore();var K=[_.default.events.SELECTION_CHANGE,(0,w.default)(this.lastRange),(0,w.default)(A),S];if((X=this.emitter).emit.apply(X,[_.default.events.EDITOR_CHANGE].concat(K)),S!==_.default.sources.SILENT){var Q;(Q=this.emitter).emit.apply(Q,K)}}}}]),D}();function R(D,T){try{T.parentNode}catch{return!1}return T instanceof Text&&(T=T.parentNode),D.contains(T)}n.Range=O,n.default=M},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function _(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&_(p.prototype,h),P&&_(p,P),p}}(),s=function _(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var v=Object.getPrototypeOf(p);return v===null?void 0:_(v,h,P)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(P)}},c=o(0),d=b(c);function b(_){return _&&_.__esModule?_:{default:_}}function w(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function E(_,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 x(_,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 m=function(_){x(p,_);function p(){return w(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return l(p,[{key:"insertInto",value:function(P,g){P.children.length===0?s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"insertInto",this).call(this,P,g):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),p}(d.default.Embed);m.blotName="break",m.tagName="BR",n.default=m},function(t,n,o){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,m){x.__proto__=m}||function(x,m){for(var _ in m)m.hasOwnProperty(_)&&(x[_]=m[_])};return function(x,m){E(x,m);function _(){this.constructor=x}x.prototype=m===null?Object.create(m):(_.prototype=m.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(44),c=o(30),d=o(1),b=function(E){l(x,E);function x(m){var _=E.call(this,m)||this;return _.build(),_}return x.prototype.appendChild=function(m){this.insertBefore(m)},x.prototype.attach=function(){E.prototype.attach.call(this),this.children.forEach(function(m){m.attach()})},x.prototype.build=function(){var m=this;this.children=new s.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(_){try{var p=w(_);m.insertBefore(p,m.children.head||void 0)}catch(h){if(h instanceof d.ParchmentError)return;throw h}})},x.prototype.deleteAt=function(m,_){if(m===0&&_===this.length())return this.remove();this.children.forEachAt(m,_,function(p,h,P){p.deleteAt(h,P)})},x.prototype.descendant=function(m,_){var p=this.children.find(_),h=p[0],P=p[1];return m.blotName==null&&m(h)||m.blotName!=null&&h instanceof m?[h,P]:h instanceof x?h.descendant(m,P):[null,-1]},x.prototype.descendants=function(m,_,p){_===void 0&&(_=0),p===void 0&&(p=Number.MAX_VALUE);var h=[],P=p;return this.children.forEachAt(_,p,function(g,v,y){(m.blotName==null&&m(g)||m.blotName!=null&&g instanceof m)&&h.push(g),g instanceof x&&(h=h.concat(g.descendants(m,v,P))),P-=y}),h},x.prototype.detach=function(){this.children.forEach(function(m){m.detach()}),E.prototype.detach.call(this)},x.prototype.formatAt=function(m,_,p,h){this.children.forEachAt(m,_,function(P,g,v){P.formatAt(g,v,p,h)})},x.prototype.insertAt=function(m,_,p){var h=this.children.find(m),P=h[0],g=h[1];if(P)P.insertAt(g,_,p);else{var v=p==null?d.create("text",_):d.create(_,p);this.appendChild(v)}},x.prototype.insertBefore=function(m,_){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(p){return m instanceof p}))throw new d.ParchmentError("Cannot insert "+m.statics.blotName+" into "+this.statics.blotName);m.insertInto(this,_)},x.prototype.length=function(){return this.children.reduce(function(m,_){return m+_.length()},0)},x.prototype.moveChildren=function(m,_){this.children.forEach(function(p){m.insertBefore(p,_)})},x.prototype.optimize=function(m){if(E.prototype.optimize.call(this,m),this.children.length===0)if(this.statics.defaultChild!=null){var _=d.create(this.statics.defaultChild);this.appendChild(_),_.optimize(m)}else this.remove()},x.prototype.path=function(m,_){_===void 0&&(_=!1);var p=this.children.find(m,_),h=p[0],P=p[1],g=[[this,m]];return h instanceof x?g.concat(h.path(P,_)):(h!=null&&g.push([h,P]),g)},x.prototype.removeChild=function(m){this.children.remove(m)},x.prototype.replace=function(m){m instanceof x&&m.moveChildren(this),E.prototype.replace.call(this,m)},x.prototype.split=function(m,_){if(_===void 0&&(_=!1),!_){if(m===0)return this;if(m===this.length())return this.next}var p=this.clone();return this.parent.insertBefore(p,this.next),this.children.forEachAt(m,this.length(),function(h,P,g){h=h.split(P,_),p.appendChild(h)}),p},x.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},x.prototype.update=function(m,_){var p=this,h=[],P=[];m.forEach(function(g){g.target===p.domNode&&g.type==="childList"&&(h.push.apply(h,g.addedNodes),P.push.apply(P,g.removedNodes))}),P.forEach(function(g){if(!(g.parentNode!=null&&g.tagName!=="IFRAME"&&document.body.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var v=d.find(g);v!=null&&(v.domNode.parentNode==null||v.domNode.parentNode===p.domNode)&&v.detach()}}),h.filter(function(g){return g.parentNode==p.domNode}).sort(function(g,v){return g===v?0:g.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(g){var v=null;g.nextSibling!=null&&(v=d.find(g.nextSibling));var y=w(g);(y.next!=v||y.next==null)&&(y.parent!=null&&y.parent.removeChild(p),p.insertBefore(y,v||void 0))})},x}(c.default);function w(E){var x=d.find(E);if(x==null)try{x=d.create(E)}catch{x=d.create(d.Scope.INLINE),[].slice.call(E.childNodes).forEach(function(_){x.domNode.appendChild(_)}),E.parentNode&&E.parentNode.replaceChild(x.domNode,E),x.attach()}return x}n.default=b},function(t,n,o){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,m){x.__proto__=m}||function(x,m){for(var _ in m)m.hasOwnProperty(_)&&(x[_]=m[_])};return function(x,m){E(x,m);function _(){this.constructor=x}x.prototype=m===null?Object.create(m):(_.prototype=m.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(12),c=o(31),d=o(17),b=o(1),w=function(E){l(x,E);function x(m){var _=E.call(this,m)||this;return _.attributes=new c.default(_.domNode),_}return x.formats=function(m){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return m.tagName.toLowerCase()},x.prototype.format=function(m,_){var p=b.query(m);p instanceof s.default?this.attributes.attribute(p,_):_&&p!=null&&(m!==this.statics.blotName||this.formats()[m]!==_)&&this.replaceWith(m,_)},x.prototype.formats=function(){var m=this.attributes.values(),_=this.statics.formats(this.domNode);return _!=null&&(m[this.statics.blotName]=_),m},x.prototype.replaceWith=function(m,_){var p=E.prototype.replaceWith.call(this,m,_);return this.attributes.copy(p),p},x.prototype.update=function(m,_){var p=this;E.prototype.update.call(this,m,_),m.some(function(h){return h.target===p.domNode&&h.type==="attributes"})&&this.attributes.build()},x.prototype.wrap=function(m,_){var p=E.prototype.wrap.call(this,m,_);return p instanceof x&&p.statics.scope===this.statics.scope&&this.attributes.move(p),p},x}(d.default);n.default=w},function(t,n,o){var l=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,E){w.__proto__=E}||function(w,E){for(var x in E)E.hasOwnProperty(x)&&(w[x]=E[x])};return function(w,E){b(w,E);function x(){this.constructor=w}w.prototype=E===null?Object.create(E):(x.prototype=E.prototype,new x)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(30),c=o(1),d=function(b){l(w,b);function w(){return b!==null&&b.apply(this,arguments)||this}return w.value=function(E){return!0},w.prototype.index=function(E,x){return this.domNode===E||this.domNode.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(x,1):-1},w.prototype.position=function(E,x){var m=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return E>0&&(m+=1),[this.parent.domNode,m]},w.prototype.value=function(){var E;return E={},E[this.statics.blotName]=this.statics.value(this.domNode)||!0,E},w.scope=c.Scope.INLINE_BLOT,w}(s.default);n.default=d},function(t,n,o){var l=o(11),s=o(3),c={attributes:{compose:function(b,w,E){typeof b!="object"&&(b={}),typeof w!="object"&&(w={});var x=s(!0,{},w);E||(x=Object.keys(x).reduce(function(_,p){return x[p]!=null&&(_[p]=x[p]),_},{}));for(var m in b)b[m]!==void 0&&w[m]===void 0&&(x[m]=b[m]);return Object.keys(x).length>0?x:void 0},diff:function(b,w){typeof b!="object"&&(b={}),typeof w!="object"&&(w={});var E=Object.keys(b).concat(Object.keys(w)).reduce(function(x,m){return l(b[m],w[m])||(x[m]=w[m]===void 0?null:w[m]),x},{});return Object.keys(E).length>0?E:void 0},transform:function(b,w,E){if(typeof b!="object")return w;if(typeof w=="object"){if(!E)return w;var x=Object.keys(w).reduce(function(m,_){return b[_]===void 0&&(m[_]=w[_]),m},{});return Object.keys(x).length>0?x:void 0}}},iterator:function(b){return new d(b)},length:function(b){return typeof b.delete=="number"?b.delete:typeof b.retain=="number"?b.retain:typeof b.insert=="string"?b.insert.length:1}};function d(b){this.ops=b,this.index=0,this.offset=0}d.prototype.hasNext=function(){return this.peekLength()<1/0},d.prototype.next=function(b){b||(b=1/0);var w=this.ops[this.index];if(w){var E=this.offset,x=c.length(w);if(b>=x-E?(b=x-E,this.index+=1,this.offset=0):this.offset+=b,typeof w.delete=="number")return{delete:b};var m={};return w.attributes&&(m.attributes=w.attributes),typeof w.retain=="number"?m.retain=b:typeof w.insert=="string"?m.insert=w.insert.substr(E,b):m.insert=w.insert,m}else return{retain:1/0}},d.prototype.peek=function(){return this.ops[this.index]},d.prototype.peekLength=function(){return this.ops[this.index]?c.length(this.ops[this.index])-this.offset:1/0},d.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"},d.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var b=this.offset,w=this.index,E=this.next(),x=this.ops.slice(this.index);return this.offset=b,this.index=w,[E].concat(x)}else return[]},t.exports=c},function(t,n){var o=function(){function l(p,h){return h!=null&&p instanceof h}var s;try{s=Map}catch{s=function(){}}var c;try{c=Set}catch{c=function(){}}var d;try{d=Promise}catch{d=function(){}}function b(p,h,P,g,v){typeof h=="object"&&(P=h.depth,g=h.prototype,v=h.includeNonEnumerable,h=h.circular);var y=[],O=[],M=typeof Buffer<"u";typeof h>"u"&&(h=!0),typeof P>"u"&&(P=1/0);function R(D,T){if(D===null)return null;if(T===0)return D;var S,A;if(typeof D!="object")return D;if(l(D,s))S=new s;else if(l(D,c))S=new c;else if(l(D,d))S=new d(function(z,I){D.then(function(U){z(R(U,T-1))},function(U){I(R(U,T-1))})});else if(b.__isArray(D))S=[];else if(b.__isRegExp(D))S=new RegExp(D.source,_(D)),D.lastIndex&&(S.lastIndex=D.lastIndex);else if(b.__isDate(D))S=new Date(D.getTime());else{if(M&&Buffer.isBuffer(D))return Buffer.allocUnsafe?S=Buffer.allocUnsafe(D.length):S=new Buffer(D.length),D.copy(S),S;l(D,Error)?S=Object.create(D):typeof g>"u"?(A=Object.getPrototypeOf(D),S=Object.create(A)):(S=Object.create(g),A=g)}if(h){var N=y.indexOf(D);if(N!=-1)return O[N];y.push(D),O.push(S)}l(D,s)&&D.forEach(function(z,I){var U=R(I,T-1),$=R(z,T-1);S.set(U,$)}),l(D,c)&&D.forEach(function(z){var I=R(z,T-1);S.add(I)});for(var k in D){var L;A&&(L=Object.getOwnPropertyDescriptor(A,k)),!(L&&L.set==null)&&(S[k]=R(D[k],T-1))}if(Object.getOwnPropertySymbols)for(var B=Object.getOwnPropertySymbols(D),k=0;k<B.length;k++){var X=B[k],K=Object.getOwnPropertyDescriptor(D,X);K&&!K.enumerable&&!v||(S[X]=R(D[X],T-1),K.enumerable||Object.defineProperty(S,X,{enumerable:!1}))}if(v)for(var Q=Object.getOwnPropertyNames(D),k=0;k<Q.length;k++){var H=Q[k],K=Object.getOwnPropertyDescriptor(D,H);K&&K.enumerable||(S[H]=R(D[H],T-1),Object.defineProperty(S,H,{enumerable:!1}))}return S}return R(p,P)}b.clonePrototype=function(h){if(h===null)return null;var P=function(){};return P.prototype=h,new P};function w(p){return Object.prototype.toString.call(p)}b.__objToStr=w;function E(p){return typeof p=="object"&&w(p)==="[object Date]"}b.__isDate=E;function x(p){return typeof p=="object"&&w(p)==="[object Array]"}b.__isArray=x;function m(p){return typeof p=="object"&&w(p)==="[object RegExp]"}b.__isRegExp=m;function _(p){var h="";return p.global&&(h+="g"),p.ignoreCase&&(h+="i"),p.multiline&&(h+="m"),h}return b.__getRegExpFlags=_,b}();typeof t=="object"&&t.exports&&(t.exports=o)},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function S(A,N){var k=[],L=!0,B=!1,X=void 0;try{for(var K=A[Symbol.iterator](),Q;!(L=(Q=K.next()).done)&&(k.push(Q.value),!(N&&k.length===N));L=!0);}catch(H){B=!0,X=H}finally{try{!L&&K.return&&K.return()}finally{if(B)throw X}}return k}return function(A,N){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return S(A,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function S(A,N){for(var k=0;k<N.length;k++){var L=N[k];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(A,L.key,L)}}return function(A,N,k){return N&&S(A.prototype,N),k&&S(A,k),A}}(),c=function S(A,N,k){A===null&&(A=Function.prototype);var L=Object.getOwnPropertyDescriptor(A,N);if(L===void 0){var B=Object.getPrototypeOf(A);return B===null?void 0:S(B,N,k)}else{if("value"in L)return L.value;var X=L.get;return X===void 0?void 0:X.call(k)}},d=o(0),b=y(d),w=o(8),E=y(w),x=o(4),m=y(x),_=o(16),p=y(_),h=o(13),P=y(h),g=o(25),v=y(g);function y(S){return S&&S.__esModule?S:{default:S}}function O(S,A){if(!(S instanceof A))throw new TypeError("Cannot call a class as a function")}function M(S,A){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:S}function R(S,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);S.prototype=Object.create(A&&A.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(S,A):S.__proto__=A)}function D(S){return S instanceof m.default||S instanceof x.BlockEmbed}var T=function(S){R(A,S);function A(N,k){O(this,A);var L=M(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,N));return L.emitter=k.emitter,Array.isArray(k.whitelist)&&(L.whitelist=k.whitelist.reduce(function(B,X){return B[X]=!0,B},{})),L.domNode.addEventListener("DOMNodeInserted",function(){}),L.optimize(),L.enable(),L}return s(A,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(k,L){var B=this.line(k),X=l(B,2),K=X[0],Q=X[1],H=this.line(k+L),z=l(H,1),I=z[0];if(c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,k,L),I!=null&&K!==I&&Q>0){if(K instanceof x.BlockEmbed||I instanceof x.BlockEmbed){this.optimize();return}if(K instanceof P.default){var U=K.newlineIndex(K.length(),!0);if(U>-1&&(K=K.split(U+1),K===I)){this.optimize();return}}else if(I instanceof P.default){var $=I.newlineIndex(0);$>-1&&I.split($+1)}var ee=I.children.head instanceof p.default?null:I.children.head;K.moveChildren(I,ee),K.remove()}this.optimize()}},{key:"enable",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",k)}},{key:"formatAt",value:function(k,L,B,X){this.whitelist!=null&&!this.whitelist[B]||(c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,k,L,B,X),this.optimize())}},{key:"insertAt",value:function(k,L,B){if(!(B!=null&&this.whitelist!=null&&!this.whitelist[L])){if(k>=this.length())if(B==null||b.default.query(L,b.default.Scope.BLOCK)==null){var X=b.default.create(this.statics.defaultChild);this.appendChild(X),B==null&&L.endsWith(`
134
+ `)&&(L=L.slice(0,-1)),X.insertAt(0,L,B)}else{var K=b.default.create(L,B);this.appendChild(K)}else c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,k,L,B);this.optimize()}}},{key:"insertBefore",value:function(k,L){if(k.statics.scope===b.default.Scope.INLINE_BLOT){var B=b.default.create(this.statics.defaultChild);B.appendChild(k),k=B}c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,k,L)}},{key:"leaf",value:function(k){return this.path(k).pop()||[null,-1]}},{key:"line",value:function(k){return k===this.length()?this.line(k-1):this.descendant(D,k)}},{key:"lines",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,B=function X(K,Q,H){var z=[],I=H;return K.children.forEachAt(Q,H,function(U,$,ee){D(U)?z.push(U):U instanceof b.default.Container&&(z=z.concat(X(U,$,I))),I-=ee}),z};return B(this,k,L)}},{key:"optimize",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,k,L),k.length>0&&this.emitter.emit(E.default.events.SCROLL_OPTIMIZE,k,L))}},{key:"path",value:function(k){return c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,k).slice(1)}},{key:"update",value:function(k){if(this.batch!==!0){var L=E.default.sources.USER;typeof k=="string"&&(L=k),Array.isArray(k)||(k=this.observer.takeRecords()),k.length>0&&this.emitter.emit(E.default.events.SCROLL_BEFORE_UPDATE,L,k),c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"update",this).call(this,k.concat([])),k.length>0&&this.emitter.emit(E.default.events.SCROLL_UPDATE,L,k)}}}]),A}(b.default.Scroll);T.blotName="scroll",T.className="ql-editor",T.tagName="DIV",T.defaultChild="block",T.allowedChildren=[m.default,x.BlockEmbed,v.default],n.default=T},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},s=function(){function Z(W,te){var re=[],ie=!0,oe=!1,se=void 0;try{for(var de=W[Symbol.iterator](),pe;!(ie=(pe=de.next()).done)&&(re.push(pe.value),!(te&&re.length===te));ie=!0);}catch(Oe){oe=!0,se=Oe}finally{try{!ie&&de.return&&de.return()}finally{if(oe)throw se}}return re}return function(W,te){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return Z(W,te);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function Z(W,te){for(var re=0;re<te.length;re++){var ie=te[re];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(W,ie.key,ie)}}return function(W,te,re){return te&&Z(W.prototype,te),re&&Z(W,re),W}}(),d=o(21),b=S(d),w=o(11),E=S(w),x=o(3),m=S(x),_=o(2),p=S(_),h=o(20),P=S(h),g=o(0),v=S(g),y=o(5),O=S(y),M=o(10),R=S(M),D=o(9),T=S(D);function S(Z){return Z&&Z.__esModule?Z:{default:Z}}function A(Z,W,te){return W in Z?Object.defineProperty(Z,W,{value:te,enumerable:!0,configurable:!0,writable:!0}):Z[W]=te,Z}function N(Z,W){if(!(Z instanceof W))throw new TypeError("Cannot call a class as a function")}function k(Z,W){if(!Z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W&&(typeof W=="object"||typeof W=="function")?W:Z}function L(Z,W){if(typeof W!="function"&&W!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof W);Z.prototype=Object.create(W&&W.prototype,{constructor:{value:Z,enumerable:!1,writable:!0,configurable:!0}}),W&&(Object.setPrototypeOf?Object.setPrototypeOf(Z,W):Z.__proto__=W)}var B=(0,R.default)("quill:keyboard"),X=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",K=function(Z){L(W,Z),c(W,null,[{key:"match",value:function(re,ie){return ie=G(ie),["altKey","ctrlKey","metaKey","shiftKey"].some(function(oe){return!!ie[oe]!==re[oe]&&ie[oe]!==null})?!1:ie.key===(re.which||re.keyCode)}}]);function W(te,re){N(this,W);var ie=k(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,te,re));return ie.bindings={},Object.keys(ie.options.bindings).forEach(function(oe){oe==="list autofill"&&te.scroll.whitelist!=null&&!te.scroll.whitelist.list||ie.options.bindings[oe]&&ie.addBinding(ie.options.bindings[oe])}),ie.addBinding({key:W.keys.ENTER,shiftKey:null},U),ie.addBinding({key:W.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ie.addBinding({key:W.keys.BACKSPACE},{collapsed:!0},H),ie.addBinding({key:W.keys.DELETE},{collapsed:!0},z)):(ie.addBinding({key:W.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},H),ie.addBinding({key:W.keys.DELETE},{collapsed:!0,suffix:/^.?$/},z)),ie.addBinding({key:W.keys.BACKSPACE},{collapsed:!1},I),ie.addBinding({key:W.keys.DELETE},{collapsed:!1},I),ie.addBinding({key:W.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},H),ie.listen(),ie}return c(W,[{key:"addBinding",value:function(re){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},se=G(re);if(se==null||se.key==null)return B.warn("Attempted to add invalid keyboard binding",se);typeof ie=="function"&&(ie={handler:ie}),typeof oe=="function"&&(oe={handler:oe}),se=(0,m.default)(se,ie,oe),this.bindings[se.key]=this.bindings[se.key]||[],this.bindings[se.key].push(se)}},{key:"listen",value:function(){var re=this;this.quill.root.addEventListener("keydown",function(ie){if(!ie.defaultPrevented){var oe=ie.which||ie.keyCode,se=(re.bindings[oe]||[]).filter(function(ze){return W.match(ie,ze)});if(se.length!==0){var de=re.quill.getSelection();if(!(de==null||!re.quill.hasFocus())){var pe=re.quill.getLine(de.index),Oe=s(pe,2),_e=Oe[0],Te=Oe[1],ce=re.quill.getLeaf(de.index),he=s(ce,2),Ce=he[0],Le=he[1],ue=de.length===0?[Ce,Le]:re.quill.getLeaf(de.index+de.length),me=s(ue,2),xe=me[0],je=me[1],ot=Ce instanceof v.default.Text?Ce.value().slice(0,Le):"",ht=xe instanceof v.default.Text?xe.value().slice(je):"",et={collapsed:de.length===0,empty:de.length===0&&_e.length()<=1,format:re.quill.getFormat(de),offset:Te,prefix:ot,suffix:ht},Ke=se.some(function(ze){if(ze.collapsed!=null&&ze.collapsed!==et.collapsed||ze.empty!=null&&ze.empty!==et.empty||ze.offset!=null&&ze.offset!==et.offset)return!1;if(Array.isArray(ze.format)){if(ze.format.every(function(Be){return et.format[Be]==null}))return!1}else if(l(ze.format)==="object"&&!Object.keys(ze.format).every(function(Be){return ze.format[Be]===!0?et.format[Be]!=null:ze.format[Be]===!1?et.format[Be]==null:(0,E.default)(ze.format[Be],et.format[Be])}))return!1;return ze.prefix!=null&&!ze.prefix.test(et.prefix)||ze.suffix!=null&&!ze.suffix.test(et.suffix)?!1:ze.handler.call(re,de,et)!==!0});Ke&&ie.preventDefault()}}}})}}]),W}(T.default);K.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},K.DEFAULTS={bindings:{bold:ee("bold"),italic:ee("italic"),underline:ee("underline"),indent:{key:K.keys.TAB,format:["blockquote","indent","list"],handler:function(W,te){if(te.collapsed&&te.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:K.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(W,te){if(te.collapsed&&te.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:K.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(W,te){te.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):te.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":$(!0),"outdent code-block":$(!1),"remove tab":{key:K.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(W){this.quill.deleteText(W.index-1,1,O.default.sources.USER)}},tab:{key:K.keys.TAB,handler:function(W){this.quill.history.cutoff();var te=new p.default().retain(W.index).delete(W.length).insert(" ");this.quill.updateContents(te,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(W.index+1,O.default.sources.SILENT)}},"list empty enter":{key:K.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(W,te){this.quill.format("list",!1,O.default.sources.USER),te.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:K.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(W){var te=this.quill.getLine(W.index),re=s(te,2),ie=re[0],oe=re[1],se=(0,m.default)({},ie.formats(),{list:"checked"}),de=new p.default().retain(W.index).insert(`
135
+ `,se).retain(ie.length()-oe-1).retain(1,{list:"unchecked"});this.quill.updateContents(de,O.default.sources.USER),this.quill.setSelection(W.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:K.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(W,te){var re=this.quill.getLine(W.index),ie=s(re,2),oe=ie[0],se=ie[1],de=new p.default().retain(W.index).insert(`
136
+ `,te.format).retain(oe.length()-se-1).retain(1,{header:null});this.quill.updateContents(de,O.default.sources.USER),this.quill.setSelection(W.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(W,te){var re=te.prefix.length,ie=this.quill.getLine(W.index),oe=s(ie,2),se=oe[0],de=oe[1];if(de>re)return!0;var pe=void 0;switch(te.prefix.trim()){case"[]":case"[ ]":pe="unchecked";break;case"[x]":pe="checked";break;case"-":case"*":pe="bullet";break;default:pe="ordered"}this.quill.insertText(W.index," ",O.default.sources.USER),this.quill.history.cutoff();var Oe=new p.default().retain(W.index-de).delete(re+1).retain(se.length()-2-de).retain(1,{list:pe});this.quill.updateContents(Oe,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(W.index-re,O.default.sources.SILENT)}},"code exit":{key:K.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(W){var te=this.quill.getLine(W.index),re=s(te,2),ie=re[0],oe=re[1],se=new p.default().retain(W.index+ie.length()-oe-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(se,O.default.sources.USER)}},"embed left":Q(K.keys.LEFT,!1),"embed left shift":Q(K.keys.LEFT,!0),"embed right":Q(K.keys.RIGHT,!1),"embed right shift":Q(K.keys.RIGHT,!0)}};function Q(Z,W){var te,re=Z===K.keys.LEFT?"prefix":"suffix";return te={key:Z,shiftKey:W,altKey:null},A(te,re,/^$/),A(te,"handler",function(oe){var se=oe.index;Z===K.keys.RIGHT&&(se+=oe.length+1);var de=this.quill.getLeaf(se),pe=s(de,1),Oe=pe[0];return Oe instanceof v.default.Embed?(Z===K.keys.LEFT?W?this.quill.setSelection(oe.index-1,oe.length+1,O.default.sources.USER):this.quill.setSelection(oe.index-1,O.default.sources.USER):W?this.quill.setSelection(oe.index,oe.length+1,O.default.sources.USER):this.quill.setSelection(oe.index+oe.length+1,O.default.sources.USER),!1):!0}),te}function H(Z,W){if(!(Z.index===0||this.quill.getLength()<=1)){var te=this.quill.getLine(Z.index),re=s(te,1),ie=re[0],oe={};if(W.offset===0){var se=this.quill.getLine(Z.index-1),de=s(se,1),pe=de[0];if(pe!=null&&pe.length()>1){var Oe=ie.formats(),_e=this.quill.getFormat(Z.index-1,1);oe=P.default.attributes.diff(Oe,_e)||{}}}var Te=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(W.prefix)?2:1;this.quill.deleteText(Z.index-Te,Te,O.default.sources.USER),Object.keys(oe).length>0&&this.quill.formatLine(Z.index-Te,Te,oe,O.default.sources.USER),this.quill.focus()}}function z(Z,W){var te=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(W.suffix)?2:1;if(!(Z.index>=this.quill.getLength()-te)){var re={},ie=0,oe=this.quill.getLine(Z.index),se=s(oe,1),de=se[0];if(W.offset>=de.length()-1){var pe=this.quill.getLine(Z.index+1),Oe=s(pe,1),_e=Oe[0];if(_e){var Te=de.formats(),ce=this.quill.getFormat(Z.index,1);re=P.default.attributes.diff(Te,ce)||{},ie=_e.length()}}this.quill.deleteText(Z.index,te,O.default.sources.USER),Object.keys(re).length>0&&this.quill.formatLine(Z.index+ie-1,te,re,O.default.sources.USER)}}function I(Z){var W=this.quill.getLines(Z),te={};if(W.length>1){var re=W[0].formats(),ie=W[W.length-1].formats();te=P.default.attributes.diff(ie,re)||{}}this.quill.deleteText(Z,O.default.sources.USER),Object.keys(te).length>0&&this.quill.formatLine(Z.index,1,te,O.default.sources.USER),this.quill.setSelection(Z.index,O.default.sources.SILENT),this.quill.focus()}function U(Z,W){var te=this;Z.length>0&&this.quill.scroll.deleteAt(Z.index,Z.length);var re=Object.keys(W.format).reduce(function(ie,oe){return v.default.query(oe,v.default.Scope.BLOCK)&&!Array.isArray(W.format[oe])&&(ie[oe]=W.format[oe]),ie},{});this.quill.insertText(Z.index,`
137
+ `,re,O.default.sources.USER),this.quill.setSelection(Z.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(W.format).forEach(function(ie){re[ie]==null&&(Array.isArray(W.format[ie])||ie!=="link"&&te.quill.format(ie,W.format[ie],O.default.sources.USER))})}function $(Z){return{key:K.keys.TAB,shiftKey:!Z,format:{"code-block":!0},handler:function(te){var re=v.default.query("code-block"),ie=te.index,oe=te.length,se=this.quill.scroll.descendant(re,ie),de=s(se,2),pe=de[0],Oe=de[1];if(pe!=null){var _e=this.quill.getIndex(pe),Te=pe.newlineIndex(Oe,!0)+1,ce=pe.newlineIndex(_e+Oe+oe),he=pe.domNode.textContent.slice(Te,ce).split(`
138
+ `);Oe=0,he.forEach(function(Ce,Le){Z?(pe.insertAt(Te+Oe,re.TAB),Oe+=re.TAB.length,Le===0?ie+=re.TAB.length:oe+=re.TAB.length):Ce.startsWith(re.TAB)&&(pe.deleteAt(Te+Oe,re.TAB.length),Oe-=re.TAB.length,Le===0?ie-=re.TAB.length:oe-=re.TAB.length),Oe+=Ce.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(ie,oe,O.default.sources.SILENT)}}}}function ee(Z){return{key:Z[0].toUpperCase(),shortKey:!0,handler:function(te,re){this.quill.format(Z,!re.format[Z],O.default.sources.USER)}}}function G(Z){if(typeof Z=="string"||typeof Z=="number")return G({key:Z});if((typeof Z>"u"?"undefined":l(Z))==="object"&&(Z=(0,b.default)(Z,!1)),typeof Z.key=="string")if(K.keys[Z.key.toUpperCase()]!=null)Z.key=K.keys[Z.key.toUpperCase()];else if(Z.key.length===1)Z.key=Z.key.toUpperCase().charCodeAt(0);else return null;return Z.shortKey&&(Z[X]=Z.shortKey,delete Z.shortKey),Z}n.default=K,n.SHORTKEY=X},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function P(g,v){var y=[],O=!0,M=!1,R=void 0;try{for(var D=g[Symbol.iterator](),T;!(O=(T=D.next()).done)&&(y.push(T.value),!(v&&y.length===v));O=!0);}catch(S){M=!0,R=S}finally{try{!O&&D.return&&D.return()}finally{if(M)throw R}}return y}return function(g,v){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return P(g,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function P(g,v,y){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,v);if(O===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:P(M,v,y)}else{if("value"in O)return O.value;var R=O.get;return R===void 0?void 0:R.call(y)}},c=function(){function P(g,v){for(var y=0;y<v.length;y++){var O=v[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,v,y){return v&&P(g.prototype,v),y&&P(g,y),g}}(),d=o(0),b=x(d),w=o(7),E=x(w);function x(P){return P&&P.__esModule?P:{default:P}}function m(P,g){if(!(P instanceof g))throw new TypeError("Cannot call a class as a function")}function _(P,g){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:P}function p(P,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);P.prototype=Object.create(g&&g.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(P,g):P.__proto__=g)}var h=function(P){p(g,P),c(g,null,[{key:"value",value:function(){}}]);function g(v,y){m(this,g);var O=_(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,v));return O.selection=y,O.textNode=document.createTextNode(g.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return c(g,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(y,O){if(this._length!==0)return s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,y,O);for(var M=this,R=0;M!=null&&M.statics.scope!==b.default.Scope.BLOCK_BLOT;)R+=M.offset(M.parent),M=M.parent;M!=null&&(this._length=g.CONTENTS.length,M.optimize(),M.formatAt(R,g.CONTENTS.length,y,O),this._length=0)}},{key:"index",value:function(y,O){return y===this.textNode?0:s(g.prototype.__proto__||Object.getPrototypeOf(g.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(){s(g.prototype.__proto__||Object.getPrototypeOf(g.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(),M=void 0,R=void 0,D=void 0;if(O!=null&&O.start.node===y&&O.end.node===y){var T=[y,O.start.offset,O.end.offset];M=T[0],R=T[1],D=T[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==g.CONTENTS){var S=this.textNode.data.split(g.CONTENTS).join("");this.next instanceof E.default?(M=this.next.domNode,this.next.insertAt(0,S),this.textNode.data=g.CONTENTS):(this.textNode.data=S,this.parent.insertBefore(b.default.create(this.textNode),this),this.textNode=document.createTextNode(g.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),R!=null){var A=[R,D].map(function(k){return Math.max(0,Math.min(M.data.length,k-1))}),N=l(A,2);return R=N[0],D=N[1],{startNode:M,startOffset:R,endNode:M,endOffset:D}}}}},{key:"update",value:function(y,O){var M=this;if(y.some(function(D){return D.type==="characterData"&&D.target===M.textNode})){var R=this.restore();R&&(O.range=R)}}},{key:"value",value:function(){return""}}]),g}(b.default.Embed);h.blotName="cursor",h.className="ql-cursor",h.tagName="span",h.CONTENTS="\uFEFF",n.default=h},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(0),s=b(l),c=o(4),d=b(c);function b(_){return _&&_.__esModule?_:{default:_}}function w(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function E(_,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 x(_,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 m=function(_){x(p,_);function p(){return w(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(s.default.Container);m.allowedChildren=[d.default,c.BlockEmbed,m],n.default=m},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var l=function(){function h(P,g){for(var v=0;v<g.length;v++){var y=g[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(P,y.key,y)}}return function(P,g,v){return g&&h(P.prototype,g),v&&h(P,v),P}}(),s=function h(P,g,v){P===null&&(P=Function.prototype);var y=Object.getOwnPropertyDescriptor(P,g);if(y===void 0){var O=Object.getPrototypeOf(P);return O===null?void 0:h(O,g,v)}else{if("value"in y)return y.value;var M=y.get;return M===void 0?void 0:M.call(v)}},c=o(0),d=b(c);function b(h){return h&&h.__esModule?h:{default:h}}function w(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function E(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function x(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var m=function(h){x(P,h);function P(){return w(this,P),E(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"value",value:function(v){var y=s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"value",this).call(this,v);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}}]),P}(d.default.Attributor.Style),_=new d.default.Attributor.Class("color","ql-color",{scope:d.default.Scope.INLINE}),p=new m("color","color",{scope:d.default.Scope.INLINE});n.ColorAttributor=m,n.ColorClass=_,n.ColorStyle=p},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var l=function(){function p(h,P){for(var g=0;g<P.length;g++){var v=P[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(h,v.key,v)}}return function(h,P,g){return P&&p(h.prototype,P),g&&p(h,g),h}}(),s=function p(h,P,g){h===null&&(h=Function.prototype);var v=Object.getOwnPropertyDescriptor(h,P);if(v===void 0){var y=Object.getPrototypeOf(h);return y===null?void 0:p(y,P,g)}else{if("value"in v)return v.value;var O=v.get;return O===void 0?void 0:O.call(g)}},c=o(6),d=b(c);function b(p){return p&&p.__esModule?p:{default:p}}function w(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}function E(p,h){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:p}function x(p,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);p.prototype=Object.create(h&&h.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(p,h):p.__proto__=h)}var m=function(p){x(h,p);function h(){return w(this,h),E(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return l(h,[{key:"format",value:function(g,v){if(g!==this.statics.blotName||!v)return s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"format",this).call(this,g,v);v=this.constructor.sanitize(v),this.domNode.setAttribute("href",v)}}],[{key:"create",value:function(g){var v=s(h.__proto__||Object.getPrototypeOf(h),"create",this).call(this,g);return g=this.sanitize(g),v.setAttribute("href",g),v.setAttribute("rel","noopener noreferrer"),v.setAttribute("target","_blank"),v}},{key:"formats",value:function(g){return g.getAttribute("href")}},{key:"sanitize",value:function(g){return _(g,this.PROTOCOL_WHITELIST)?g:this.SANITIZED_URL}}]),h}(d.default);m.blotName="link",m.tagName="A",m.SANITIZED_URL="about:blank",m.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function _(p,h){var P=document.createElement("a");P.href=p;var g=P.href.slice(0,P.href.indexOf(":"));return h.indexOf(g)>-1}n.default=m,n.sanitize=_},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},s=function(){function h(P,g){for(var v=0;v<g.length;v++){var y=g[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(P,y.key,y)}}return function(P,g,v){return g&&h(P.prototype,g),v&&h(P,v),P}}(),c=o(23),d=E(c),b=o(107),w=E(b);function E(h){return h&&h.__esModule?h:{default:h}}function x(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}var m=0;function _(h,P){h.setAttribute(P,h.getAttribute(P)!=="true")}var p=function(){function h(P){var g=this;x(this,h),this.select=P,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(){g.togglePicker()}),this.label.addEventListener("keydown",function(v){switch(v.keyCode){case d.default.keys.ENTER:g.togglePicker();break;case d.default.keys.ESCAPE:g.escape(),v.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return s(h,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),_(this.label,"aria-expanded"),_(this.options,"aria-hidden")}},{key:"buildItem",value:function(g){var v=this,y=document.createElement("span");return y.tabIndex="0",y.setAttribute("role","button"),y.classList.add("ql-picker-item"),g.hasAttribute("value")&&y.setAttribute("data-value",g.getAttribute("value")),g.textContent&&y.setAttribute("data-label",g.textContent),y.addEventListener("click",function(){v.selectItem(y,!0)}),y.addEventListener("keydown",function(O){switch(O.keyCode){case d.default.keys.ENTER:v.selectItem(y,!0),O.preventDefault();break;case d.default.keys.ESCAPE:v.escape(),O.preventDefault();break}}),y}},{key:"buildLabel",value:function(){var g=document.createElement("span");return g.classList.add("ql-picker-label"),g.innerHTML=w.default,g.tabIndex="0",g.setAttribute("role","button"),g.setAttribute("aria-expanded","false"),this.container.appendChild(g),g}},{key:"buildOptions",value:function(){var g=this,v=document.createElement("span");v.classList.add("ql-picker-options"),v.setAttribute("aria-hidden","true"),v.tabIndex="-1",v.id="ql-picker-options-"+m,m+=1,this.label.setAttribute("aria-controls",v.id),this.options=v,[].slice.call(this.select.options).forEach(function(y){var O=g.buildItem(y);v.appendChild(O),y.selected===!0&&g.selectItem(O)}),this.container.appendChild(v)}},{key:"buildPicker",value:function(){var g=this;[].slice.call(this.select.attributes).forEach(function(v){g.container.setAttribute(v.name,v.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var g=this;this.close(),setTimeout(function(){return g.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(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,y=this.container.querySelector(".ql-selected");if(g!==y&&(y!=null&&y.classList.remove("ql-selected"),g!=null&&(g.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(g.parentNode.children,g),g.hasAttribute("data-value")?this.label.setAttribute("data-value",g.getAttribute("data-value")):this.label.removeAttribute("data-value"),g.hasAttribute("data-label")?this.label.setAttribute("data-label",g.getAttribute("data-label")):this.label.removeAttribute("data-label"),v))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":l(Event))==="object"){var O=document.createEvent("Event");O.initEvent("change",!0,!0),this.select.dispatchEvent(O)}this.close()}}},{key:"update",value:function(){var g=void 0;if(this.select.selectedIndex>-1){var v=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];g=this.select.options[this.select.selectedIndex],this.selectItem(v)}else this.selectItem(null);var y=g!=null&&g!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",y)}}]),h}();n.default=p},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(0),s=B(l),c=o(5),d=B(c),b=o(4),w=B(b),E=o(16),x=B(E),m=o(25),_=B(m),p=o(24),h=B(p),P=o(35),g=B(P),v=o(6),y=B(v),O=o(22),M=B(O),R=o(7),D=B(R),T=o(55),S=B(T),A=o(42),N=B(A),k=o(23),L=B(k);function B(X){return X&&X.__esModule?X:{default:X}}d.default.register({"blots/block":w.default,"blots/block/embed":b.BlockEmbed,"blots/break":x.default,"blots/container":_.default,"blots/cursor":h.default,"blots/embed":g.default,"blots/inline":y.default,"blots/scroll":M.default,"blots/text":D.default,"modules/clipboard":S.default,"modules/history":N.default,"modules/keyboard":L.default}),s.default.register(w.default,x.default,h.default,y.default,M.default,D.default),n.default=d.default},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(1),s=function(){function c(d){this.domNode=d,this.domNode[l.DATA_KEY]={blot:this}}return Object.defineProperty(c.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),c.create=function(d){if(this.tagName==null)throw new l.ParchmentError("Blot definition missing tagName");var b;return Array.isArray(this.tagName)?(typeof d=="string"&&(d=d.toUpperCase(),parseInt(d).toString()===d&&(d=parseInt(d))),typeof d=="number"?b=document.createElement(this.tagName[d-1]):this.tagName.indexOf(d)>-1?b=document.createElement(d):b=document.createElement(this.tagName[0])):b=document.createElement(this.tagName),this.className&&b.classList.add(this.className),b},c.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},c.prototype.clone=function(){var d=this.domNode.cloneNode(!1);return l.create(d)},c.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[l.DATA_KEY]},c.prototype.deleteAt=function(d,b){var w=this.isolate(d,b);w.remove()},c.prototype.formatAt=function(d,b,w,E){var x=this.isolate(d,b);if(l.query(w,l.Scope.BLOT)!=null&&E)x.wrap(w,E);else if(l.query(w,l.Scope.ATTRIBUTE)!=null){var m=l.create(this.statics.scope);x.wrap(m),m.format(w,E)}},c.prototype.insertAt=function(d,b,w){var E=w==null?l.create("text",b):l.create(b,w),x=this.split(d);this.parent.insertBefore(E,x)},c.prototype.insertInto=function(d,b){b===void 0&&(b=null),this.parent!=null&&this.parent.children.remove(this);var w=null;d.children.insertBefore(this,b),b!=null&&(w=b.domNode),(this.domNode.parentNode!=d.domNode||this.domNode.nextSibling!=w)&&d.domNode.insertBefore(this.domNode,w),this.parent=d,this.attach()},c.prototype.isolate=function(d,b){var w=this.split(d);return w.split(b),w},c.prototype.length=function(){return 1},c.prototype.offset=function(d){return d===void 0&&(d=this.parent),this.parent==null||this==d?0:this.parent.children.offset(this)+this.parent.offset(d)},c.prototype.optimize=function(d){this.domNode[l.DATA_KEY]!=null&&delete this.domNode[l.DATA_KEY].mutations},c.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},c.prototype.replace=function(d){d.parent!=null&&(d.parent.insertBefore(this,d.next),d.remove())},c.prototype.replaceWith=function(d,b){var w=typeof d=="string"?l.create(d,b):d;return w.replace(this),w},c.prototype.split=function(d,b){return d===0?this:this.next},c.prototype.update=function(d,b){},c.prototype.wrap=function(d,b){var w=typeof d=="string"?l.create(d,b):d;return this.parent!=null&&this.parent.insertBefore(w,this.next),w.appendChild(this),w},c.blotName="abstract",c}();n.default=s},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(12),s=o(32),c=o(33),d=o(1),b=function(){function w(E){this.attributes={},this.domNode=E,this.build()}return w.prototype.attribute=function(E,x){x?E.add(this.domNode,x)&&(E.value(this.domNode)!=null?this.attributes[E.attrName]=E:delete this.attributes[E.attrName]):(E.remove(this.domNode),delete this.attributes[E.attrName])},w.prototype.build=function(){var E=this;this.attributes={};var x=l.default.keys(this.domNode),m=s.default.keys(this.domNode),_=c.default.keys(this.domNode);x.concat(m).concat(_).forEach(function(p){var h=d.query(p,d.Scope.ATTRIBUTE);h instanceof l.default&&(E.attributes[h.attrName]=h)})},w.prototype.copy=function(E){var x=this;Object.keys(this.attributes).forEach(function(m){var _=x.attributes[m].value(x.domNode);E.format(m,_)})},w.prototype.move=function(E){var x=this;this.copy(E),Object.keys(this.attributes).forEach(function(m){x.attributes[m].remove(x.domNode)}),this.attributes={}},w.prototype.values=function(){var E=this;return Object.keys(this.attributes).reduce(function(x,m){return x[m]=E.attributes[m].value(E.domNode),x},{})},w}();n.default=b},function(t,n,o){var l=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,E){w.__proto__=E}||function(w,E){for(var x in E)E.hasOwnProperty(x)&&(w[x]=E[x])};return function(w,E){b(w,E);function x(){this.constructor=w}w.prototype=E===null?Object.create(E):(x.prototype=E.prototype,new x)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(12);function c(b,w){var E=b.getAttribute("class")||"";return E.split(/\s+/).filter(function(x){return x.indexOf(w+"-")===0})}var d=function(b){l(w,b);function w(){return b!==null&&b.apply(this,arguments)||this}return w.keys=function(E){return(E.getAttribute("class")||"").split(/\s+/).map(function(x){return x.split("-").slice(0,-1).join("-")})},w.prototype.add=function(E,x){return this.canAdd(E,x)?(this.remove(E),E.classList.add(this.keyName+"-"+x),!0):!1},w.prototype.remove=function(E){var x=c(E,this.keyName);x.forEach(function(m){E.classList.remove(m)}),E.classList.length===0&&E.removeAttribute("class")},w.prototype.value=function(E){var x=c(E,this.keyName)[0]||"",m=x.slice(this.keyName.length+1);return this.canAdd(E,m)?m:""},w}(s.default);n.default=d},function(t,n,o){var l=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,E){w.__proto__=E}||function(w,E){for(var x in E)E.hasOwnProperty(x)&&(w[x]=E[x])};return function(w,E){b(w,E);function x(){this.constructor=w}w.prototype=E===null?Object.create(E):(x.prototype=E.prototype,new x)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(12);function c(b){var w=b.split("-"),E=w.slice(1).map(function(x){return x[0].toUpperCase()+x.slice(1)}).join("");return w[0]+E}var d=function(b){l(w,b);function w(){return b!==null&&b.apply(this,arguments)||this}return w.keys=function(E){return(E.getAttribute("style")||"").split(";").map(function(x){var m=x.split(":");return m[0].trim()})},w.prototype.add=function(E,x){return this.canAdd(E,x)?(E.style[c(this.keyName)]=x,!0):!1},w.prototype.remove=function(E){E.style[c(this.keyName)]="",E.getAttribute("style")||E.removeAttribute("style")},w.prototype.value=function(E){var x=E.style[c(this.keyName)];return this.canAdd(E,x)?x:""},w}(s.default);n.default=d},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function d(b,w){for(var E=0;E<w.length;E++){var x=w[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,w,E){return w&&d(b.prototype,w),E&&d(b,E),b}}();function s(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function d(b,w){s(this,d),this.quill=b,this.options=w,this.modules={}}return l(d,[{key:"init",value:function(){var w=this;Object.keys(this.options.modules).forEach(function(E){w.modules[E]==null&&w.addModule(E)})}},{key:"addModule",value:function(w){var E=this.quill.constructor.import("modules/"+w);return this.modules[w]=new E(this.quill,this.options.modules[w]||{}),this.modules[w]}}]),d}();c.DEFAULTS={modules:{}},c.themes={default:c},n.default=c},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function P(g,v){for(var y=0;y<v.length;y++){var O=v[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,v,y){return v&&P(g.prototype,v),y&&P(g,y),g}}(),s=function P(g,v,y){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,v);if(O===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:P(M,v,y)}else{if("value"in O)return O.value;var R=O.get;return R===void 0?void 0:R.call(y)}},c=o(0),d=E(c),b=o(7),w=E(b);function E(P){return P&&P.__esModule?P:{default:P}}function x(P,g){if(!(P instanceof g))throw new TypeError("Cannot call a class as a function")}function m(P,g){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:P}function _(P,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);P.prototype=Object.create(g&&g.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(P,g):P.__proto__=g)}var p="\uFEFF",h=function(P){_(g,P);function g(v){x(this,g);var y=m(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,v));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(p),y.rightGuard=document.createTextNode(p),y.domNode.appendChild(y.leftGuard),y.domNode.appendChild(y.contentNode),y.domNode.appendChild(y.rightGuard),y}return l(g,[{key:"index",value:function(y,O){return y===this.leftGuard?0:y===this.rightGuard?1:s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,y,O)}},{key:"restore",value:function(y){var O=void 0,M=void 0,R=y.data.split(p).join("");if(y===this.leftGuard)if(this.prev instanceof w.default){var D=this.prev.length();this.prev.insertAt(D,R),O={startNode:this.prev.domNode,startOffset:D+R.length}}else M=document.createTextNode(R),this.parent.insertBefore(d.default.create(M),this),O={startNode:M,startOffset:R.length};else y===this.rightGuard&&(this.next instanceof w.default?(this.next.insertAt(0,R),O={startNode:this.next.domNode,startOffset:R.length}):(M=document.createTextNode(R),this.parent.insertBefore(d.default.create(M),this.next),O={startNode:M,startOffset:R.length}));return y.data=p,O}},{key:"update",value:function(y,O){var M=this;y.forEach(function(R){if(R.type==="characterData"&&(R.target===M.leftGuard||R.target===M.rightGuard)){var D=M.restore(R.target);D&&(O.range=D)}})}}]),g}(d.default.Embed);n.default=h},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var l=o(0),s=c(l);function c(x){return x&&x.__esModule?x:{default:x}}var d={scope:s.default.Scope.BLOCK,whitelist:["right","center","justify"]},b=new s.default.Attributor.Attribute("align","align",d),w=new s.default.Attributor.Class("align","ql-align",d),E=new s.default.Attributor.Style("align","text-align",d);n.AlignAttribute=b,n.AlignClass=w,n.AlignStyle=E},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var l=o(0),s=d(l),c=o(26);function d(E){return E&&E.__esModule?E:{default:E}}var b=new s.default.Attributor.Class("background","ql-bg",{scope:s.default.Scope.INLINE}),w=new c.ColorAttributor("background","background-color",{scope:s.default.Scope.INLINE});n.BackgroundClass=b,n.BackgroundStyle=w},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var l=o(0),s=c(l);function c(x){return x&&x.__esModule?x:{default:x}}var d={scope:s.default.Scope.BLOCK,whitelist:["rtl"]},b=new s.default.Attributor.Attribute("direction","dir",d),w=new s.default.Attributor.Class("direction","ql-direction",d),E=new s.default.Attributor.Style("direction","direction",d);n.DirectionAttribute=b,n.DirectionClass=w,n.DirectionStyle=E},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var l=function(){function P(g,v){for(var y=0;y<v.length;y++){var O=v[y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,v,y){return v&&P(g.prototype,v),y&&P(g,y),g}}(),s=function P(g,v,y){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,v);if(O===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:P(M,v,y)}else{if("value"in O)return O.value;var R=O.get;return R===void 0?void 0:R.call(y)}},c=o(0),d=b(c);function b(P){return P&&P.__esModule?P:{default:P}}function w(P,g){if(!(P instanceof g))throw new TypeError("Cannot call a class as a function")}function E(P,g){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:P}function x(P,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);P.prototype=Object.create(g&&g.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(P,g):P.__proto__=g)}var m={scope:d.default.Scope.INLINE,whitelist:["serif","monospace"]},_=new d.default.Attributor.Class("font","ql-font",m),p=function(P){x(g,P);function g(){return w(this,g),E(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return l(g,[{key:"value",value:function(y){return s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,y).replace(/["']/g,"")}}]),g}(d.default.Attributor.Style),h=new p("font","font-family",m);n.FontStyle=h,n.FontClass=_},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var l=o(0),s=c(l);function c(w){return w&&w.__esModule?w:{default:w}}var d=new s.default.Attributor.Class("size","ql-size",{scope:s.default.Scope.INLINE,whitelist:["small","large","huge"]}),b=new s.default.Attributor.Style("size","font-size",{scope:s.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=d,n.SizeStyle=b},function(t,n,o){t.exports={align:{"":o(76),center:o(77),right:o(78),justify:o(79)},background:o(80),blockquote:o(81),bold:o(82),clean:o(83),code:o(58),"code-block":o(58),color:o(84),direction:{"":o(85),rtl:o(86)},float:{center:o(87),full:o(88),left:o(89),right:o(90)},formula:o(91),header:{1:o(92),2:o(93)},italic:o(94),image:o(95),indent:{"+1":o(96),"-1":o(97)},link:o(98),list:{ordered:o(99),bullet:o(100),check:o(101)},script:{sub:o(102),super:o(103)},strike:o(104),underline:o(105),video:o(106)}},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var l=function(){function v(y,O){for(var M=0;M<O.length;M++){var R=O[M];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(y,R.key,R)}}return function(y,O,M){return O&&v(y.prototype,O),M&&v(y,M),y}}(),s=o(0),c=x(s),d=o(5),b=x(d),w=o(9),E=x(w);function x(v){return v&&v.__esModule?v:{default:v}}function m(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function _(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function p(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var h=function(v){p(y,v);function y(O,M){m(this,y);var R=_(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,O,M));return R.lastRecorded=0,R.ignoreChange=!1,R.clear(),R.quill.on(b.default.events.EDITOR_CHANGE,function(D,T,S,A){D!==b.default.events.TEXT_CHANGE||R.ignoreChange||(!R.options.userOnly||A===b.default.sources.USER?R.record(T,S):R.transform(T))}),R.quill.keyboard.addBinding({key:"Z",shortKey:!0},R.undo.bind(R)),R.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},R.redo.bind(R)),/Win/i.test(navigator.platform)&&R.quill.keyboard.addBinding({key:"Y",shortKey:!0},R.redo.bind(R)),R}return l(y,[{key:"change",value:function(M,R){if(this.stack[M].length!==0){var D=this.stack[M].pop();this.stack[R].push(D),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(D[M],b.default.sources.USER),this.ignoreChange=!1;var T=g(D[M]);this.quill.setSelection(T)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(M,R){if(M.ops.length!==0){this.stack.redo=[];var D=this.quill.getContents().diff(R),T=Date.now();if(this.lastRecorded+this.options.delay>T&&this.stack.undo.length>0){var S=this.stack.undo.pop();D=D.compose(S.undo),M=S.redo.compose(M)}else this.lastRecorded=T;this.stack.undo.push({redo:M,undo:D}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(M){this.stack.undo.forEach(function(R){R.undo=M.transform(R.undo,!0),R.redo=M.transform(R.redo,!0)}),this.stack.redo.forEach(function(R){R.undo=M.transform(R.undo,!0),R.redo=M.transform(R.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),y}(E.default);h.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function P(v){var y=v.ops[v.ops.length-1];return y==null?!1:y.insert!=null?typeof y.insert=="string"&&y.insert.endsWith(`
139
+ `):y.attributes!=null?Object.keys(y.attributes).some(function(O){return c.default.query(O,c.default.Scope.BLOCK)!=null}):!1}function g(v){var y=v.reduce(function(M,R){return M+=R.delete||0,M},0),O=v.length()-y;return P(v)&&(O-=1),O}n.default=h,n.getLastChangeIndex=g},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var l=function(){function U($,ee){for(var G=0;G<ee.length;G++){var Z=ee[G];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty($,Z.key,Z)}}return function($,ee,G){return ee&&U($.prototype,ee),G&&U($,G),$}}(),s=function U($,ee,G){$===null&&($=Function.prototype);var Z=Object.getOwnPropertyDescriptor($,ee);if(Z===void 0){var W=Object.getPrototypeOf($);return W===null?void 0:U(W,ee,G)}else{if("value"in Z)return Z.value;var te=Z.get;return te===void 0?void 0:te.call(G)}},c=o(3),d=T(c),b=o(2),w=T(b),E=o(8),x=T(E),m=o(23),_=T(m),p=o(34),h=T(p),P=o(59),g=T(P),v=o(60),y=T(v),O=o(28),M=T(O),R=o(61),D=T(R);function T(U){return U&&U.__esModule?U:{default:U}}function S(U,$){if(!(U instanceof $))throw new TypeError("Cannot call a class as a function")}function A(U,$){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:U}function N(U,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);U.prototype=Object.create($&&$.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(U,$):U.__proto__=$)}var k=[!1,"center","right","justify"],L=["#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"],B=[!1,"serif","monospace"],X=["1","2","3",!1],K=["small",!1,"large","huge"],Q=function(U){N($,U);function $(ee,G){S(this,$);var Z=A(this,($.__proto__||Object.getPrototypeOf($)).call(this,ee,G)),W=function te(re){if(!document.body.contains(ee.root))return document.body.removeEventListener("click",te);Z.tooltip!=null&&!Z.tooltip.root.contains(re.target)&&document.activeElement!==Z.tooltip.textbox&&!Z.quill.hasFocus()&&Z.tooltip.hide(),Z.pickers!=null&&Z.pickers.forEach(function(ie){ie.container.contains(re.target)||ie.close()})};return ee.emitter.listenDOM("click",document.body,W),Z}return l($,[{key:"addModule",value:function(G){var Z=s($.prototype.__proto__||Object.getPrototypeOf($.prototype),"addModule",this).call(this,G);return G==="toolbar"&&this.extendToolbar(Z),Z}},{key:"buildButtons",value:function(G,Z){G.forEach(function(W){var te=W.getAttribute("class")||"";te.split(/\s+/).forEach(function(re){if(re.startsWith("ql-")&&(re=re.slice(3),Z[re]!=null))if(re==="direction")W.innerHTML=Z[re][""]+Z[re].rtl;else if(typeof Z[re]=="string")W.innerHTML=Z[re];else{var ie=W.value||"";ie!=null&&Z[re][ie]&&(W.innerHTML=Z[re][ie])}})})}},{key:"buildPickers",value:function(G,Z){var W=this;this.pickers=G.map(function(re){if(re.classList.contains("ql-align"))return re.querySelector("option")==null&&I(re,k),new y.default(re,Z.align);if(re.classList.contains("ql-background")||re.classList.contains("ql-color")){var ie=re.classList.contains("ql-background")?"background":"color";return re.querySelector("option")==null&&I(re,L,ie==="background"?"#ffffff":"#000000"),new g.default(re,Z[ie])}else return re.querySelector("option")==null&&(re.classList.contains("ql-font")?I(re,B):re.classList.contains("ql-header")?I(re,X):re.classList.contains("ql-size")&&I(re,K)),new M.default(re)});var te=function(){W.pickers.forEach(function(ie){ie.update()})};this.quill.on(x.default.events.EDITOR_CHANGE,te)}}]),$}(h.default);Q.DEFAULTS=(0,d.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var $=this,ee=this.container.querySelector("input.ql-image[type=file]");ee==null&&(ee=document.createElement("input"),ee.setAttribute("type","file"),ee.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),ee.classList.add("ql-image"),ee.addEventListener("change",function(){if(ee.files!=null&&ee.files[0]!=null){var G=new FileReader;G.onload=function(Z){var W=$.quill.getSelection(!0);$.quill.updateContents(new w.default().retain(W.index).delete(W.length).insert({image:Z.target.result}),x.default.sources.USER),$.quill.setSelection(W.index+1,x.default.sources.SILENT),ee.value=""},G.readAsDataURL(ee.files[0])}}),this.container.appendChild(ee)),ee.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var H=function(U){N($,U);function $(ee,G){S(this,$);var Z=A(this,($.__proto__||Object.getPrototypeOf($)).call(this,ee,G));return Z.textbox=Z.root.querySelector('input[type="text"]'),Z.listen(),Z}return l($,[{key:"listen",value:function(){var G=this;this.textbox.addEventListener("keydown",function(Z){_.default.match(Z,"enter")?(G.save(),Z.preventDefault()):_.default.match(Z,"escape")&&(G.cancel(),Z.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),Z!=null?this.textbox.value=Z:G!==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-"+G)||""),this.root.setAttribute("data-mode",G)}},{key:"restoreFocus",value:function(){var G=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=G}},{key:"save",value:function(){var G=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var Z=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",G,x.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",G,x.default.sources.USER)),this.quill.root.scrollTop=Z;break}case"video":G=z(G);case"formula":{if(!G)break;var W=this.quill.getSelection(!0);if(W!=null){var te=W.index+W.length;this.quill.insertEmbed(te,this.root.getAttribute("data-mode"),G,x.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(te+1," ",x.default.sources.USER),this.quill.setSelection(te+2,x.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),$}(D.default);function z(U){var $=U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return $?($[1]||"https")+"://www.youtube.com/embed/"+$[2]+"?showinfo=0":($=U.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?($[1]||"https")+"://player.vimeo.com/video/"+$[2]+"/":U}function I(U,$){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;$.forEach(function(G){var Z=document.createElement("option");G===ee?Z.setAttribute("selected","selected"):Z.setAttribute("value",G),U.appendChild(Z)})}n.BaseTooltip=H,n.default=Q},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function s(){this.head=this.tail=null,this.length=0}return s.prototype.append=function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];this.insertBefore(c[0],null),c.length>1&&this.append.apply(this,c.slice(1))},s.prototype.contains=function(c){for(var d,b=this.iterator();d=b();)if(d===c)return!0;return!1},s.prototype.insertBefore=function(c,d){c&&(c.next=d,d!=null?(c.prev=d.prev,d.prev!=null&&(d.prev.next=c),d.prev=c,d===this.head&&(this.head=c)):this.tail!=null?(this.tail.next=c,c.prev=this.tail,this.tail=c):(c.prev=null,this.head=this.tail=c),this.length+=1)},s.prototype.offset=function(c){for(var d=0,b=this.head;b!=null;){if(b===c)return d;d+=b.length(),b=b.next}return-1},s.prototype.remove=function(c){this.contains(c)&&(c.prev!=null&&(c.prev.next=c.next),c.next!=null&&(c.next.prev=c.prev),c===this.head&&(this.head=c.next),c===this.tail&&(this.tail=c.prev),this.length-=1)},s.prototype.iterator=function(c){return c===void 0&&(c=this.head),function(){var d=c;return c!=null&&(c=c.next),d}},s.prototype.find=function(c,d){d===void 0&&(d=!1);for(var b,w=this.iterator();b=w();){var E=b.length();if(c<E||d&&c===E&&(b.next==null||b.next.length()!==0))return[b,c];c-=E}return[null,0]},s.prototype.forEach=function(c){for(var d,b=this.iterator();d=b();)c(d)},s.prototype.forEachAt=function(c,d,b){if(!(d<=0))for(var w=this.find(c),E=w[0],x=w[1],m,_=c-x,p=this.iterator(E);(m=p())&&_<c+d;){var h=m.length();c>_?b(m,c-_,Math.min(d,_+h-c)):b(m,0,Math.min(h,c+d-_)),_+=h}},s.prototype.map=function(c){return this.reduce(function(d,b){return d.push(c(b)),d},[])},s.prototype.reduce=function(c,d){for(var b,w=this.iterator();b=w();)d=c(d,b);return d},s}();n.default=l},function(t,n,o){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,m){x.__proto__=m}||function(x,m){for(var _ in m)m.hasOwnProperty(_)&&(x[_]=m[_])};return function(x,m){E(x,m);function _(){this.constructor=x}x.prototype=m===null?Object.create(m):(_.prototype=m.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(17),c=o(1),d={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},b=100,w=function(E){l(x,E);function x(m){var _=E.call(this,m)||this;return _.scroll=_,_.observer=new MutationObserver(function(p){_.update(p)}),_.observer.observe(_.domNode,d),_.attach(),_}return x.prototype.detach=function(){E.prototype.detach.call(this),this.observer.disconnect()},x.prototype.deleteAt=function(m,_){this.update(),m===0&&_===this.length()?this.children.forEach(function(p){p.remove()}):E.prototype.deleteAt.call(this,m,_)},x.prototype.formatAt=function(m,_,p,h){this.update(),E.prototype.formatAt.call(this,m,_,p,h)},x.prototype.insertAt=function(m,_,p){this.update(),E.prototype.insertAt.call(this,m,_,p)},x.prototype.optimize=function(m,_){var p=this;m===void 0&&(m=[]),_===void 0&&(_={}),E.prototype.optimize.call(this,_);for(var h=[].slice.call(this.observer.takeRecords());h.length>0;)m.push(h.pop());for(var P=function(O,M){M===void 0&&(M=!0),!(O==null||O===p)&&O.domNode.parentNode!=null&&(O.domNode[c.DATA_KEY].mutations==null&&(O.domNode[c.DATA_KEY].mutations=[]),M&&P(O.parent))},g=function(O){O.domNode[c.DATA_KEY]==null||O.domNode[c.DATA_KEY].mutations==null||(O instanceof s.default&&O.children.forEach(g),O.optimize(_))},v=m,y=0;v.length>0;y+=1){if(y>=b)throw new Error("[Parchment] Maximum optimize iterations reached");for(v.forEach(function(O){var M=c.find(O.target,!0);M!=null&&(M.domNode===O.target&&(O.type==="childList"?(P(c.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(R){var D=c.find(R,!1);P(D,!1),D instanceof s.default&&D.children.forEach(function(T){P(T,!1)})})):O.type==="attributes"&&P(M.prev)),P(M))}),this.children.forEach(g),v=[].slice.call(this.observer.takeRecords()),h=v.slice();h.length>0;)m.push(h.pop())}},x.prototype.update=function(m,_){var p=this;_===void 0&&(_={}),m=m||this.observer.takeRecords(),m.map(function(h){var P=c.find(h.target,!0);return P==null?null:P.domNode[c.DATA_KEY].mutations==null?(P.domNode[c.DATA_KEY].mutations=[h],P):(P.domNode[c.DATA_KEY].mutations.push(h),null)}).forEach(function(h){h==null||h===p||h.domNode[c.DATA_KEY]==null||h.update(h.domNode[c.DATA_KEY].mutations||[],_)}),this.domNode[c.DATA_KEY].mutations!=null&&E.prototype.update.call(this,this.domNode[c.DATA_KEY].mutations,_),this.optimize(m,_)},x.blotName="scroll",x.defaultChild="block",x.scope=c.Scope.BLOCK_BLOT,x.tagName="DIV",x}(s.default);n.default=w},function(t,n,o){var l=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,x){E.__proto__=x}||function(E,x){for(var m in x)x.hasOwnProperty(m)&&(E[m]=x[m])};return function(E,x){w(E,x);function m(){this.constructor=E}E.prototype=x===null?Object.create(x):(m.prototype=x.prototype,new m)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(18),c=o(1);function d(w,E){if(Object.keys(w).length!==Object.keys(E).length)return!1;for(var x in w)if(w[x]!==E[x])return!1;return!0}var b=function(w){l(E,w);function E(){return w!==null&&w.apply(this,arguments)||this}return E.formats=function(x){if(x.tagName!==E.tagName)return w.formats.call(this,x)},E.prototype.format=function(x,m){var _=this;x===this.statics.blotName&&!m?(this.children.forEach(function(p){p instanceof s.default||(p=p.wrap(E.blotName,!0)),_.attributes.copy(p)}),this.unwrap()):w.prototype.format.call(this,x,m)},E.prototype.formatAt=function(x,m,_,p){if(this.formats()[_]!=null||c.query(_,c.Scope.ATTRIBUTE)){var h=this.isolate(x,m);h.format(_,p)}else w.prototype.formatAt.call(this,x,m,_,p)},E.prototype.optimize=function(x){w.prototype.optimize.call(this,x);var m=this.formats();if(Object.keys(m).length===0)return this.unwrap();var _=this.next;_ instanceof E&&_.prev===this&&d(m,_.formats())&&(_.moveChildren(this),_.remove())},E.blotName="inline",E.scope=c.Scope.INLINE_BLOT,E.tagName="SPAN",E}(s.default);n.default=b},function(t,n,o){var l=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,E){w.__proto__=E}||function(w,E){for(var x in E)E.hasOwnProperty(x)&&(w[x]=E[x])};return function(w,E){b(w,E);function x(){this.constructor=w}w.prototype=E===null?Object.create(E):(x.prototype=E.prototype,new x)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(18),c=o(1),d=function(b){l(w,b);function w(){return b!==null&&b.apply(this,arguments)||this}return w.formats=function(E){var x=c.query(w.blotName).tagName;if(E.tagName!==x)return b.formats.call(this,E)},w.prototype.format=function(E,x){c.query(E,c.Scope.BLOCK)!=null&&(E===this.statics.blotName&&!x?this.replaceWith(w.blotName):b.prototype.format.call(this,E,x))},w.prototype.formatAt=function(E,x,m,_){c.query(m,c.Scope.BLOCK)!=null?this.format(m,_):b.prototype.formatAt.call(this,E,x,m,_)},w.prototype.insertAt=function(E,x,m){if(m==null||c.query(x,c.Scope.INLINE)!=null)b.prototype.insertAt.call(this,E,x,m);else{var _=this.split(E),p=c.create(x,m);_.parent.insertBefore(p,_)}},w.prototype.update=function(E,x){navigator.userAgent.match(/Trident/)?this.build():b.prototype.update.call(this,E,x)},w.blotName="block",w.scope=c.Scope.BLOCK_BLOT,w.tagName="P",w}(s.default);n.default=d},function(t,n,o){var l=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var E in w)w.hasOwnProperty(E)&&(b[E]=w[E])};return function(b,w){d(b,w);function E(){this.constructor=b}b.prototype=w===null?Object.create(w):(E.prototype=w.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(19),c=function(d){l(b,d);function b(){return d!==null&&d.apply(this,arguments)||this}return b.formats=function(w){},b.prototype.format=function(w,E){d.prototype.formatAt.call(this,0,this.length(),w,E)},b.prototype.formatAt=function(w,E,x,m){w===0&&E===this.length()?this.format(x,m):d.prototype.formatAt.call(this,w,E,x,m)},b.prototype.formats=function(){return this.statics.formats(this.domNode)},b}(s.default);n.default=c},function(t,n,o){var l=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,E){w.__proto__=E}||function(w,E){for(var x in E)E.hasOwnProperty(x)&&(w[x]=E[x])};return function(w,E){b(w,E);function x(){this.constructor=w}w.prototype=E===null?Object.create(E):(x.prototype=E.prototype,new x)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=o(19),c=o(1),d=function(b){l(w,b);function w(E){var x=b.call(this,E)||this;return x.text=x.statics.value(x.domNode),x}return w.create=function(E){return document.createTextNode(E)},w.value=function(E){var x=E.data;return x.normalize&&(x=x.normalize()),x},w.prototype.deleteAt=function(E,x){this.domNode.data=this.text=this.text.slice(0,E)+this.text.slice(E+x)},w.prototype.index=function(E,x){return this.domNode===E?x:-1},w.prototype.insertAt=function(E,x,m){m==null?(this.text=this.text.slice(0,E)+x+this.text.slice(E),this.domNode.data=this.text):b.prototype.insertAt.call(this,E,x,m)},w.prototype.length=function(){return this.text.length},w.prototype.optimize=function(E){b.prototype.optimize.call(this,E),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof w&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},w.prototype.position=function(E,x){return[this.domNode,E]},w.prototype.split=function(E,x){if(x===void 0&&(x=!1),!x){if(E===0)return this;if(E===this.length())return this.next}var m=c.create(this.domNode.splitText(E));return this.parent.insertBefore(m,this.next),this.text=this.statics.value(this.domNode),m},w.prototype.update=function(E,x){var m=this;E.some(function(_){return _.type==="characterData"&&_.target===m.domNode})&&(this.text=this.statics.value(this.domNode))},w.prototype.value=function(){return this.text},w.blotName="text",w.scope=c.Scope.INLINE_BLOT,w}(s.default);n.default=d},function(t,n,o){var l=document.createElement("div");if(l.classList.toggle("test-class",!1),l.classList.contains("test-class")){var s=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(c,d){return arguments.length>1&&!this.contains(c)==!d?d:s.call(this,c)}}String.prototype.startsWith||(String.prototype.startsWith=function(c,d){return d=d||0,this.substr(d,c.length)===c}),String.prototype.endsWith||(String.prototype.endsWith=function(c,d){var b=this.toString();(typeof d!="number"||!isFinite(d)||Math.floor(d)!==d||d>b.length)&&(d=b.length),d-=c.length;var w=b.indexOf(c,d);return w!==-1&&w===d}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(d){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof d!="function")throw new TypeError("predicate must be a function");for(var b=Object(this),w=b.length>>>0,E=arguments[1],x,m=0;m<w;m++)if(x=b[m],d.call(E,x,m,b))return x}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,n){var o=-1,l=1,s=0;function c(y,O,M){if(y==O)return y?[[s,y]]:[];(M<0||y.length<M)&&(M=null);var R=E(y,O),D=y.substring(0,R);y=y.substring(R),O=O.substring(R),R=x(y,O);var T=y.substring(y.length-R);y=y.substring(0,y.length-R),O=O.substring(0,O.length-R);var S=d(y,O);return D&&S.unshift([s,D]),T&&S.push([s,T]),_(S),M!=null&&(S=P(S,M)),S=g(S),S}function d(y,O){var M;if(!y)return[[l,O]];if(!O)return[[o,y]];var R=y.length>O.length?y:O,D=y.length>O.length?O:y,T=R.indexOf(D);if(T!=-1)return M=[[l,R.substring(0,T)],[s,D],[l,R.substring(T+D.length)]],y.length>O.length&&(M[0][0]=M[2][0]=o),M;if(D.length==1)return[[o,y],[l,O]];var S=m(y,O);if(S){var A=S[0],N=S[1],k=S[2],L=S[3],B=S[4],X=c(A,k),K=c(N,L);return X.concat([[s,B]],K)}return b(y,O)}function b(y,O){for(var M=y.length,R=O.length,D=Math.ceil((M+R)/2),T=D,S=2*D,A=new Array(S),N=new Array(S),k=0;k<S;k++)A[k]=-1,N[k]=-1;A[T+1]=0,N[T+1]=0;for(var L=M-R,B=L%2!=0,X=0,K=0,Q=0,H=0,z=0;z<D;z++){for(var I=-z+X;I<=z-K;I+=2){var U=T+I,$;I==-z||I!=z&&A[U-1]<A[U+1]?$=A[U+1]:$=A[U-1]+1;for(var ee=$-I;$<M&&ee<R&&y.charAt($)==O.charAt(ee);)$++,ee++;if(A[U]=$,$>M)K+=2;else if(ee>R)X+=2;else if(B){var G=T+L-I;if(G>=0&&G<S&&N[G]!=-1){var Z=M-N[G];if($>=Z)return w(y,O,$,ee)}}}for(var W=-z+Q;W<=z-H;W+=2){var G=T+W,Z;W==-z||W!=z&&N[G-1]<N[G+1]?Z=N[G+1]:Z=N[G-1]+1;for(var te=Z-W;Z<M&&te<R&&y.charAt(M-Z-1)==O.charAt(R-te-1);)Z++,te++;if(N[G]=Z,Z>M)H+=2;else if(te>R)Q+=2;else if(!B){var U=T+L-W;if(U>=0&&U<S&&A[U]!=-1){var $=A[U],ee=T+$-U;if(Z=M-Z,$>=Z)return w(y,O,$,ee)}}}}return[[o,y],[l,O]]}function w(y,O,M,R){var D=y.substring(0,M),T=O.substring(0,R),S=y.substring(M),A=O.substring(R),N=c(D,T),k=c(S,A);return N.concat(k)}function E(y,O){if(!y||!O||y.charAt(0)!=O.charAt(0))return 0;for(var M=0,R=Math.min(y.length,O.length),D=R,T=0;M<D;)y.substring(T,D)==O.substring(T,D)?(M=D,T=M):R=D,D=Math.floor((R-M)/2+M);return D}function x(y,O){if(!y||!O||y.charAt(y.length-1)!=O.charAt(O.length-1))return 0;for(var M=0,R=Math.min(y.length,O.length),D=R,T=0;M<D;)y.substring(y.length-D,y.length-T)==O.substring(O.length-D,O.length-T)?(M=D,T=M):R=D,D=Math.floor((R-M)/2+M);return D}function m(y,O){var M=y.length>O.length?y:O,R=y.length>O.length?O:y;if(M.length<4||R.length*2<M.length)return null;function D(K,Q,H){for(var z=K.substring(H,H+Math.floor(K.length/4)),I=-1,U="",$,ee,G,Z;(I=Q.indexOf(z,I+1))!=-1;){var W=E(K.substring(H),Q.substring(I)),te=x(K.substring(0,H),Q.substring(0,I));U.length<te+W&&(U=Q.substring(I-te,I)+Q.substring(I,I+W),$=K.substring(0,H-te),ee=K.substring(H+W),G=Q.substring(0,I-te),Z=Q.substring(I+W))}return U.length*2>=K.length?[$,ee,G,Z,U]:null}var T=D(M,R,Math.ceil(M.length/4)),S=D(M,R,Math.ceil(M.length/2)),A;if(!T&&!S)return null;S?T?A=T[4].length>S[4].length?T:S:A=S:A=T;var N,k,L,B;y.length>O.length?(N=A[0],k=A[1],L=A[2],B=A[3]):(L=A[0],B=A[1],N=A[2],k=A[3]);var X=A[4];return[N,k,L,B,X]}function _(y){y.push([s,""]);for(var O=0,M=0,R=0,D="",T="",S;O<y.length;)switch(y[O][0]){case l:R++,T+=y[O][1],O++;break;case o:M++,D+=y[O][1],O++;break;case s:M+R>1?(M!==0&&R!==0&&(S=E(T,D),S!==0&&(O-M-R>0&&y[O-M-R-1][0]==s?y[O-M-R-1][1]+=T.substring(0,S):(y.splice(0,0,[s,T.substring(0,S)]),O++),T=T.substring(S),D=D.substring(S)),S=x(T,D),S!==0&&(y[O][1]=T.substring(T.length-S)+y[O][1],T=T.substring(0,T.length-S),D=D.substring(0,D.length-S))),M===0?y.splice(O-R,M+R,[l,T]):R===0?y.splice(O-M,M+R,[o,D]):y.splice(O-M-R,M+R,[o,D],[l,T]),O=O-M-R+(M?1:0)+(R?1:0)+1):O!==0&&y[O-1][0]==s?(y[O-1][1]+=y[O][1],y.splice(O,1)):O++,R=0,M=0,D="",T="";break}y[y.length-1][1]===""&&y.pop();var A=!1;for(O=1;O<y.length-1;)y[O-1][0]==s&&y[O+1][0]==s&&(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&&_(y)}var p=c;p.INSERT=l,p.DELETE=o,p.EQUAL=s,t.exports=p;function h(y,O){if(O===0)return[s,y];for(var M=0,R=0;R<y.length;R++){var D=y[R];if(D[0]===o||D[0]===s){var T=M+D[1].length;if(O===T)return[R+1,y];if(O<T){y=y.slice();var S=O-M,A=[D[0],D[1].slice(0,S)],N=[D[0],D[1].slice(S)];return y.splice(R,1,A,N),[R+1,y]}else M=T}}throw new Error("cursor_pos is out of bounds!")}function P(y,O){var M=h(y,O),R=M[1],D=M[0],T=R[D],S=R[D+1];if(T==null)return y;if(T[0]!==s)return y;if(S!=null&&T[1]+S[1]===S[1]+T[1])return R.splice(D,2,S,T),v(R,D,2);if(S!=null&&S[1].indexOf(T[1])===0){R.splice(D,2,[S[0],T[1]],[0,T[1]]);var A=S[1].slice(T[1].length);return A.length>0&&R.splice(D+2,0,[S[0],A]),v(R,D,3)}else return y}function g(y){for(var O=!1,M=function(S){return S.charCodeAt(0)>=56320&&S.charCodeAt(0)<=57343},R=function(S){return S.charCodeAt(S.length-1)>=55296&&S.charCodeAt(S.length-1)<=56319},D=2;D<y.length;D+=1)y[D-2][0]===s&&R(y[D-2][1])&&y[D-1][0]===o&&M(y[D-1][1])&&y[D][0]===l&&M(y[D][1])&&(O=!0,y[D-1][1]=y[D-2][1].slice(-1)+y[D-1][1],y[D][1]=y[D-2][1].slice(-1)+y[D][1],y[D-2][1]=y[D-2][1].slice(0,-1));if(!O)return y;for(var T=[],D=0;D<y.length;D+=1)y[D][1].length>0&&T.push(y[D]);return T}function v(y,O,M){for(var R=O+M-1;R>=0&&R>=O-1;R--)if(R+1<y.length){var D=y[R],T=y[R+1];D[0]===T[1]&&y.splice(R,2,[D[0],D[1]+T[1]])}return y}},function(t,n){n=t.exports=typeof Object.keys=="function"?Object.keys:o,n.shim=o;function o(l){var s=[];for(var c in l)s.push(c);return s}},function(t,n){var o=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=t.exports=o?l:s,n.supported=l;function l(c){return Object.prototype.toString.call(c)=="[object Arguments]"}n.unsupported=s;function s(c){return c&&typeof c=="object"&&typeof c.length=="number"&&Object.prototype.hasOwnProperty.call(c,"callee")&&!Object.prototype.propertyIsEnumerable.call(c,"callee")||!1}},function(t,n){var o=Object.prototype.hasOwnProperty,l="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(l=!1));function c(b,w,E){this.fn=b,this.context=w,this.once=E||!1}function d(){this._events=new s,this._eventsCount=0}d.prototype.eventNames=function(){var w=[],E,x;if(this._eventsCount===0)return w;for(x in E=this._events)o.call(E,x)&&w.push(l?x.slice(1):x);return Object.getOwnPropertySymbols?w.concat(Object.getOwnPropertySymbols(E)):w},d.prototype.listeners=function(w,E){var x=l?l+w:w,m=this._events[x];if(E)return!!m;if(!m)return[];if(m.fn)return[m.fn];for(var _=0,p=m.length,h=new Array(p);_<p;_++)h[_]=m[_].fn;return h},d.prototype.emit=function(w,E,x,m,_,p){var h=l?l+w:w;if(!this._events[h])return!1;var P=this._events[h],g=arguments.length,v,y;if(P.fn){switch(P.once&&this.removeListener(w,P.fn,void 0,!0),g){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,E),!0;case 3:return P.fn.call(P.context,E,x),!0;case 4:return P.fn.call(P.context,E,x,m),!0;case 5:return P.fn.call(P.context,E,x,m,_),!0;case 6:return P.fn.call(P.context,E,x,m,_,p),!0}for(y=1,v=new Array(g-1);y<g;y++)v[y-1]=arguments[y];P.fn.apply(P.context,v)}else{var O=P.length,M;for(y=0;y<O;y++)switch(P[y].once&&this.removeListener(w,P[y].fn,void 0,!0),g){case 1:P[y].fn.call(P[y].context);break;case 2:P[y].fn.call(P[y].context,E);break;case 3:P[y].fn.call(P[y].context,E,x);break;case 4:P[y].fn.call(P[y].context,E,x,m);break;default:if(!v)for(M=1,v=new Array(g-1);M<g;M++)v[M-1]=arguments[M];P[y].fn.apply(P[y].context,v)}}return!0},d.prototype.on=function(w,E,x){var m=new c(E,x||this),_=l?l+w:w;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],m]:this._events[_].push(m):(this._events[_]=m,this._eventsCount++),this},d.prototype.once=function(w,E,x){var m=new c(E,x||this,!0),_=l?l+w:w;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],m]:this._events[_].push(m):(this._events[_]=m,this._eventsCount++),this},d.prototype.removeListener=function(w,E,x,m){var _=l?l+w:w;if(!this._events[_])return this;if(!E)return--this._eventsCount===0?this._events=new s:delete this._events[_],this;var p=this._events[_];if(p.fn)p.fn===E&&(!m||p.once)&&(!x||p.context===x)&&(--this._eventsCount===0?this._events=new s:delete this._events[_]);else{for(var h=0,P=[],g=p.length;h<g;h++)(p[h].fn!==E||m&&!p[h].once||x&&p[h].context!==x)&&P.push(p[h]);P.length?this._events[_]=P.length===1?P[0]:P:--this._eventsCount===0?this._events=new s:delete this._events[_]}return this},d.prototype.removeAllListeners=function(w){var E;return w?(E=l?l+w:w,this._events[E]&&(--this._eventsCount===0?this._events=new s:delete this._events[E])):(this._events=new s,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prototype.setMaxListeners=function(){return this},d.prefixed=l,d.EventEmitter=d,typeof t<"u"&&(t.exports=d)},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ce){return typeof ce}:function(ce){return ce&&typeof Symbol=="function"&&ce.constructor===Symbol&&ce!==Symbol.prototype?"symbol":typeof ce},s=function(){function ce(he,Ce){var Le=[],ue=!0,me=!1,xe=void 0;try{for(var je=he[Symbol.iterator](),ot;!(ue=(ot=je.next()).done)&&(Le.push(ot.value),!(Ce&&Le.length===Ce));ue=!0);}catch(ht){me=!0,xe=ht}finally{try{!ue&&je.return&&je.return()}finally{if(me)throw xe}}return Le}return function(he,Ce){if(Array.isArray(he))return he;if(Symbol.iterator in Object(he))return ce(he,Ce);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function ce(he,Ce){for(var Le=0;Le<Ce.length;Le++){var ue=Ce[Le];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(he,ue.key,ue)}}return function(he,Ce,Le){return Ce&&ce(he.prototype,Ce),Le&&ce(he,Le),he}}(),d=o(3),b=N(d),w=o(2),E=N(w),x=o(0),m=N(x),_=o(5),p=N(_),h=o(10),P=N(h),g=o(9),v=N(g),y=o(36),O=o(37),M=o(13),R=N(M),D=o(26),T=o(38),S=o(39),A=o(40);function N(ce){return ce&&ce.__esModule?ce:{default:ce}}function k(ce,he,Ce){return he in ce?Object.defineProperty(ce,he,{value:Ce,enumerable:!0,configurable:!0,writable:!0}):ce[he]=Ce,ce}function L(ce,he){if(!(ce instanceof he))throw new TypeError("Cannot call a class as a function")}function B(ce,he){if(!ce)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return he&&(typeof he=="object"||typeof he=="function")?he:ce}function X(ce,he){if(typeof he!="function"&&he!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof he);ce.prototype=Object.create(he&&he.prototype,{constructor:{value:ce,enumerable:!1,writable:!0,configurable:!0}}),he&&(Object.setPrototypeOf?Object.setPrototypeOf(ce,he):ce.__proto__=he)}var K=(0,P.default)("quill:clipboard"),Q="__ql-matcher",H=[[Node.TEXT_NODE,Te],[Node.TEXT_NODE,pe],["br",oe],[Node.ELEMENT_NODE,pe],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,Oe],[Node.ELEMENT_NODE,re],[Node.ELEMENT_NODE,_e],["li",de],["b",te.bind(te,"bold")],["i",te.bind(te,"italic")],["style",se]],z=[y.AlignAttribute,T.DirectionAttribute].reduce(function(ce,he){return ce[he.keyName]=he,ce},{}),I=[y.AlignStyle,O.BackgroundStyle,D.ColorStyle,T.DirectionStyle,S.FontStyle,A.SizeStyle].reduce(function(ce,he){return ce[he.keyName]=he,ce},{}),U=function(ce){X(he,ce);function he(Ce,Le){L(this,he);var ue=B(this,(he.__proto__||Object.getPrototypeOf(he)).call(this,Ce,Le));return ue.quill.root.addEventListener("paste",ue.onPaste.bind(ue)),ue.container=ue.quill.addContainer("ql-clipboard"),ue.container.setAttribute("contenteditable",!0),ue.container.setAttribute("tabindex",-1),ue.matchers=[],H.concat(ue.options.matchers).forEach(function(me){var xe=s(me,2),je=xe[0],ot=xe[1];!Le.matchVisual&&ot===Oe||ue.addMatcher(je,ot)}),ue}return c(he,[{key:"addMatcher",value:function(Le,ue){this.matchers.push([Le,ue])}},{key:"convert",value:function(Le){if(typeof Le=="string")return this.container.innerHTML=Le.replace(/\>\r?\n +\</g,"><"),this.convert();var ue=this.quill.getFormat(this.quill.selection.savedRange.index);if(ue[R.default.blotName]){var me=this.container.innerText;return this.container.innerHTML="",new E.default().insert(me,k({},R.default.blotName,ue[R.default.blotName]))}var xe=this.prepareMatching(),je=s(xe,2),ot=je[0],ht=je[1],et=W(this.container,ot,ht);return G(et,`
140
+ `)&&et.ops[et.ops.length-1].attributes==null&&(et=et.compose(new E.default().retain(et.length()-1).delete(1))),K.log("convert",this.container.innerHTML,et),this.container.innerHTML="",et}},{key:"dangerouslyPasteHTML",value:function(Le,ue){var me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;if(typeof Le=="string")this.quill.setContents(this.convert(Le),ue),this.quill.setSelection(0,p.default.sources.SILENT);else{var xe=this.convert(ue);this.quill.updateContents(new E.default().retain(Le).concat(xe),me),this.quill.setSelection(Le+xe.length(),p.default.sources.SILENT)}}},{key:"onPaste",value:function(Le){var ue=this;if(!(Le.defaultPrevented||!this.quill.isEnabled())){var me=this.quill.getSelection(),xe=new E.default().retain(me.index),je=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(p.default.sources.SILENT),setTimeout(function(){xe=xe.concat(ue.convert()).delete(me.length),ue.quill.updateContents(xe,p.default.sources.USER),ue.quill.setSelection(xe.length()-me.length,p.default.sources.SILENT),ue.quill.scrollingContainer.scrollTop=je,ue.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Le=this,ue=[],me=[];return this.matchers.forEach(function(xe){var je=s(xe,2),ot=je[0],ht=je[1];switch(ot){case Node.TEXT_NODE:me.push(ht);break;case Node.ELEMENT_NODE:ue.push(ht);break;default:[].forEach.call(Le.container.querySelectorAll(ot),function(et){et[Q]=et[Q]||[],et[Q].push(ht)});break}}),[ue,me]}}]),he}(v.default);U.DEFAULTS={matchers:[],matchVisual:!0};function $(ce,he,Ce){return(typeof he>"u"?"undefined":l(he))==="object"?Object.keys(he).reduce(function(Le,ue){return $(Le,ue,he[ue])},ce):ce.reduce(function(Le,ue){return ue.attributes&&ue.attributes[he]?Le.push(ue):Le.insert(ue.insert,(0,b.default)({},k({},he,Ce),ue.attributes))},new E.default)}function ee(ce){if(ce.nodeType!==Node.ELEMENT_NODE)return{};var he="__ql-computed-style";return ce[he]||(ce[he]=window.getComputedStyle(ce))}function G(ce,he){for(var Ce="",Le=ce.ops.length-1;Le>=0&&Ce.length<he.length;--Le){var ue=ce.ops[Le];if(typeof ue.insert!="string")break;Ce=ue.insert+Ce}return Ce.slice(-1*he.length)===he}function Z(ce){if(ce.childNodes.length===0)return!1;var he=ee(ce);return["block","list-item"].indexOf(he.display)>-1}function W(ce,he,Ce){return ce.nodeType===ce.TEXT_NODE?Ce.reduce(function(Le,ue){return ue(ce,Le)},new E.default):ce.nodeType===ce.ELEMENT_NODE?[].reduce.call(ce.childNodes||[],function(Le,ue){var me=W(ue,he,Ce);return ue.nodeType===ce.ELEMENT_NODE&&(me=he.reduce(function(xe,je){return je(ue,xe)},me),me=(ue[Q]||[]).reduce(function(xe,je){return je(ue,xe)},me)),Le.concat(me)},new E.default):new E.default}function te(ce,he,Ce){return $(Ce,ce,!0)}function re(ce,he){var Ce=m.default.Attributor.Attribute.keys(ce),Le=m.default.Attributor.Class.keys(ce),ue=m.default.Attributor.Style.keys(ce),me={};return Ce.concat(Le).concat(ue).forEach(function(xe){var je=m.default.query(xe,m.default.Scope.ATTRIBUTE);je!=null&&(me[je.attrName]=je.value(ce),me[je.attrName])||(je=z[xe],je!=null&&(je.attrName===xe||je.keyName===xe)&&(me[je.attrName]=je.value(ce)||void 0),je=I[xe],je!=null&&(je.attrName===xe||je.keyName===xe)&&(je=I[xe],me[je.attrName]=je.value(ce)||void 0))}),Object.keys(me).length>0&&(he=$(he,me)),he}function ie(ce,he){var Ce=m.default.query(ce);if(Ce==null)return he;if(Ce.prototype instanceof m.default.Embed){var Le={},ue=Ce.value(ce);ue!=null&&(Le[Ce.blotName]=ue,he=new E.default().insert(Le,Ce.formats(ce)))}else typeof Ce.formats=="function"&&(he=$(he,Ce.blotName,Ce.formats(ce)));return he}function oe(ce,he){return G(he,`
141
+ `)||he.insert(`
142
+ `),he}function se(){return new E.default}function de(ce,he){var Ce=m.default.query(ce);if(Ce==null||Ce.blotName!=="list-item"||!G(he,`
143
+ `))return he;for(var Le=-1,ue=ce.parentNode;!ue.classList.contains("ql-clipboard");)(m.default.query(ue)||{}).blotName==="list"&&(Le+=1),ue=ue.parentNode;return Le<=0?he:he.compose(new E.default().retain(he.length()-1).retain(1,{indent:Le}))}function pe(ce,he){return G(he,`
144
+ `)||(Z(ce)||he.length()>0&&ce.nextSibling&&Z(ce.nextSibling))&&he.insert(`
145
+ `),he}function Oe(ce,he){if(Z(ce)&&ce.nextElementSibling!=null&&!G(he,`
146
+
147
+ `)){var Ce=ce.offsetHeight+parseFloat(ee(ce).marginTop)+parseFloat(ee(ce).marginBottom);ce.nextElementSibling.offsetTop>ce.offsetTop+Ce*1.5&&he.insert(`
148
+ `)}return he}function _e(ce,he){var Ce={},Le=ce.style||{};return Le.fontStyle&&ee(ce).fontStyle==="italic"&&(Ce.italic=!0),Le.fontWeight&&(ee(ce).fontWeight.startsWith("bold")||parseInt(ee(ce).fontWeight)>=700)&&(Ce.bold=!0),Object.keys(Ce).length>0&&(he=$(he,Ce)),parseFloat(Le.textIndent||0)>0&&(he=new E.default().insert(" ").concat(he)),he}function Te(ce,he){var Ce=ce.data;if(ce.parentNode.tagName==="O:P")return he.insert(Ce.trim());if(Ce.trim().length===0&&ce.parentNode.classList.contains("ql-clipboard"))return he;if(!ee(ce.parentNode).whiteSpace.startsWith("pre")){var Le=function(me,xe){return xe=xe.replace(/[^\u00a0]/g,""),xe.length<1&&me?" ":xe};Ce=Ce.replace(/\r\n/g," ").replace(/\n/g," "),Ce=Ce.replace(/\s\s+/g,Le.bind(Le,!0)),(ce.previousSibling==null&&Z(ce.parentNode)||ce.previousSibling!=null&&Z(ce.previousSibling))&&(Ce=Ce.replace(/^\s+/,Le.bind(Le,!1))),(ce.nextSibling==null&&Z(ce.parentNode)||ce.nextSibling!=null&&Z(ce.nextSibling))&&(Ce=Ce.replace(/\s+$/,Le.bind(Le,!1)))}return he.insert(Ce)}n.default=U,n.matchAttributor=re,n.matchBlot=ie,n.matchNewline=pe,n.matchSpacing=Oe,n.matchText=Te},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function _(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&_(p.prototype,h),P&&_(p,P),p}}(),s=function _(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var v=Object.getPrototypeOf(p);return v===null?void 0:_(v,h,P)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(P)}},c=o(6),d=b(c);function b(_){return _&&_.__esModule?_:{default:_}}function w(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function E(_,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 x(_,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 m=function(_){x(p,_);function p(){return w(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return l(p,[{key:"optimize",value:function(P){s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"optimize",this).call(this,P),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return s(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),p}(d.default);m.blotName="bold",m.tagName=["STRONG","B"],n.default=m},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var l=function(){function A(N,k){var L=[],B=!0,X=!1,K=void 0;try{for(var Q=N[Symbol.iterator](),H;!(B=(H=Q.next()).done)&&(L.push(H.value),!(k&&L.length===k));B=!0);}catch(z){X=!0,K=z}finally{try{!B&&Q.return&&Q.return()}finally{if(X)throw K}}return L}return function(N,k){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return A(N,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function A(N,k){for(var L=0;L<k.length;L++){var B=k[L];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(N,B.key,B)}}return function(N,k,L){return k&&A(N.prototype,k),L&&A(N,L),N}}(),c=o(2),d=P(c),b=o(0),w=P(b),E=o(5),x=P(E),m=o(10),_=P(m),p=o(9),h=P(p);function P(A){return A&&A.__esModule?A:{default:A}}function g(A,N,k){return N in A?Object.defineProperty(A,N,{value:k,enumerable:!0,configurable:!0,writable:!0}):A[N]=k,A}function v(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")}function y(A,N){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:A}function O(A,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);A.prototype=Object.create(N&&N.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(A,N):A.__proto__=N)}var M=(0,_.default)("quill:toolbar"),R=function(A){O(N,A);function N(k,L){v(this,N);var B=y(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,k,L));if(Array.isArray(B.options.container)){var X=document.createElement("div");T(X,B.options.container),k.container.parentNode.insertBefore(X,k.container),B.container=X}else typeof B.options.container=="string"?B.container=document.querySelector(B.options.container):B.container=B.options.container;if(!(B.container instanceof HTMLElement)){var K;return K=M.error("Container required for toolbar",B.options),y(B,K)}return B.container.classList.add("ql-toolbar"),B.controls=[],B.handlers={},Object.keys(B.options.handlers).forEach(function(Q){B.addHandler(Q,B.options.handlers[Q])}),[].forEach.call(B.container.querySelectorAll("button, select"),function(Q){B.attach(Q)}),B.quill.on(x.default.events.EDITOR_CHANGE,function(Q,H){Q===x.default.events.SELECTION_CHANGE&&B.update(H)}),B.quill.on(x.default.events.SCROLL_OPTIMIZE,function(){var Q=B.quill.selection.getRange(),H=l(Q,1),z=H[0];B.update(z)}),B}return s(N,[{key:"addHandler",value:function(L,B){this.handlers[L]=B}},{key:"attach",value:function(L){var B=this,X=[].find.call(L.classList,function(Q){return Q.indexOf("ql-")===0});if(X){if(X=X.slice(3),L.tagName==="BUTTON"&&L.setAttribute("type","button"),this.handlers[X]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[X]==null){M.warn("ignoring attaching to disabled format",X,L);return}if(w.default.query(X)==null){M.warn("ignoring attaching to nonexistent format",X,L);return}}var K=L.tagName==="SELECT"?"change":"click";L.addEventListener(K,function(Q){var H=void 0;if(L.tagName==="SELECT"){if(L.selectedIndex<0)return;var z=L.options[L.selectedIndex];z.hasAttribute("selected")?H=!1:H=z.value||!1}else L.classList.contains("ql-active")?H=!1:H=L.value||!L.hasAttribute("value"),Q.preventDefault();B.quill.focus();var I=B.quill.selection.getRange(),U=l(I,1),$=U[0];if(B.handlers[X]!=null)B.handlers[X].call(B,H);else if(w.default.query(X).prototype instanceof w.default.Embed){if(H=prompt("Enter "+X),!H)return;B.quill.updateContents(new d.default().retain($.index).delete($.length).insert(g({},X,H)),x.default.sources.USER)}else B.quill.format(X,H,x.default.sources.USER);B.update($)}),this.controls.push([X,L])}}},{key:"update",value:function(L){var B=L==null?{}:this.quill.getFormat(L);this.controls.forEach(function(X){var K=l(X,2),Q=K[0],H=K[1];if(H.tagName==="SELECT"){var z=void 0;if(L==null)z=null;else if(B[Q]==null)z=H.querySelector("option[selected]");else if(!Array.isArray(B[Q])){var I=B[Q];typeof I=="string"&&(I=I.replace(/\"/g,'\\"')),z=H.querySelector('option[value="'+I+'"]')}z==null?(H.value="",H.selectedIndex=-1):z.selected=!0}else if(L==null)H.classList.remove("ql-active");else if(H.hasAttribute("value")){var U=B[Q]===H.getAttribute("value")||B[Q]!=null&&B[Q].toString()===H.getAttribute("value")||B[Q]==null&&!H.getAttribute("value");H.classList.toggle("ql-active",U)}else H.classList.toggle("ql-active",B[Q]!=null)})}}]),N}(h.default);R.DEFAULTS={};function D(A,N,k){var L=document.createElement("button");L.setAttribute("type","button"),L.classList.add("ql-"+N),k!=null&&(L.value=k),A.appendChild(L)}function T(A,N){Array.isArray(N[0])||(N=[N]),N.forEach(function(k){var L=document.createElement("span");L.classList.add("ql-formats"),k.forEach(function(B){if(typeof B=="string")D(L,B);else{var X=Object.keys(B)[0],K=B[X];Array.isArray(K)?S(L,X,K):D(L,X,K)}}),A.appendChild(L)})}function S(A,N,k){var L=document.createElement("select");L.classList.add("ql-"+N),k.forEach(function(B){var X=document.createElement("option");B!==!1?X.setAttribute("value",B):X.setAttribute("selected","selected"),L.appendChild(X)}),A.appendChild(L)}R.DEFAULTS={container:null,handlers:{clean:function(){var N=this,k=this.quill.getSelection();if(k!=null)if(k.length==0){var L=this.quill.getFormat();Object.keys(L).forEach(function(B){w.default.query(B,w.default.Scope.INLINE)!=null&&N.quill.format(B,!1)})}else this.quill.removeFormat(k,x.default.sources.USER)},direction:function(N){var k=this.quill.getFormat().align;N==="rtl"&&k==null?this.quill.format("align","right",x.default.sources.USER):!N&&k==="right"&&this.quill.format("align",!1,x.default.sources.USER),this.quill.format("direction",N,x.default.sources.USER)},indent:function(N){var k=this.quill.getSelection(),L=this.quill.getFormat(k),B=parseInt(L.indent||0);if(N==="+1"||N==="-1"){var X=N==="+1"?1:-1;L.direction==="rtl"&&(X*=-1),this.quill.format("indent",B+X,x.default.sources.USER)}},link:function(N){N===!0&&(N=prompt("Enter link URL:")),this.quill.format("link",N,x.default.sources.USER)},list:function(N){var k=this.quill.getSelection(),L=this.quill.getFormat(k);N==="check"?L.list==="checked"||L.list==="unchecked"?this.quill.format("list",!1,x.default.sources.USER):this.quill.format("list","unchecked",x.default.sources.USER):this.quill.format("list",N,x.default.sources.USER)}}},n.default=R,n.addControls=T},function(t,n){t.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(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function _(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&_(p.prototype,h),P&&_(p,P),p}}(),s=function _(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var v=Object.getPrototypeOf(p);return v===null?void 0:_(v,h,P)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(P)}},c=o(28),d=b(c);function b(_){return _&&_.__esModule?_:{default:_}}function w(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function E(_,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 x(_,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 m=function(_){x(p,_);function p(h,P){w(this,p);var g=E(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,h));return g.label.innerHTML=P,g.container.classList.add("ql-color-picker"),[].slice.call(g.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(v){v.classList.add("ql-primary")}),g}return l(p,[{key:"buildItem",value:function(P){var g=s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"buildItem",this).call(this,P);return g.style.backgroundColor=P.getAttribute("value")||"",g}},{key:"selectItem",value:function(P,g){s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"selectItem",this).call(this,P,g);var v=this.label.querySelector(".ql-color-label"),y=P&&P.getAttribute("data-value")||"";v&&(v.tagName==="line"?v.style.stroke=y:v.style.fill=y)}}]),p}(d.default);n.default=m},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function _(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&_(p.prototype,h),P&&_(p,P),p}}(),s=function _(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var v=Object.getPrototypeOf(p);return v===null?void 0:_(v,h,P)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(P)}},c=o(28),d=b(c);function b(_){return _&&_.__esModule?_:{default:_}}function w(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function E(_,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 x(_,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 m=function(_){x(p,_);function p(h,P){w(this,p);var g=E(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,h));return g.container.classList.add("ql-icon-picker"),[].forEach.call(g.container.querySelectorAll(".ql-picker-item"),function(v){v.innerHTML=P[v.getAttribute("data-value")||""]}),g.defaultItem=g.container.querySelector(".ql-selected"),g.selectItem(g.defaultItem),g}return l(p,[{key:"selectItem",value:function(P,g){s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"selectItem",this).call(this,P,g),P=P||this.defaultItem,this.label.innerHTML=P.innerHTML}}]),p}(d.default);n.default=m},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function d(b,w){for(var E=0;E<w.length;E++){var x=w[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,w,E){return w&&d(b.prototype,w),E&&d(b,E),b}}();function s(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function d(b,w){var E=this;s(this,d),this.quill=b,this.boundsContainer=w||document.body,this.root=b.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){E.root.style.marginTop=-1*E.quill.root.scrollTop+"px"}),this.hide()}return l(d,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(w){var E=w.left+w.width/2-this.root.offsetWidth/2,x=w.bottom+this.quill.root.scrollTop;this.root.style.left=E+"px",this.root.style.top=x+"px",this.root.classList.remove("ql-flip");var m=this.boundsContainer.getBoundingClientRect(),_=this.root.getBoundingClientRect(),p=0;if(_.right>m.right&&(p=m.right-_.right,this.root.style.left=E+p+"px"),_.left<m.left&&(p=m.left-_.left,this.root.style.left=E+p+"px"),_.bottom>m.bottom){var h=_.bottom-_.top,P=w.bottom-w.top+h;this.root.style.top=x-P+"px",this.root.classList.add("ql-flip")}return p}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),d}();n.default=c},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function S(A,N){var k=[],L=!0,B=!1,X=void 0;try{for(var K=A[Symbol.iterator](),Q;!(L=(Q=K.next()).done)&&(k.push(Q.value),!(N&&k.length===N));L=!0);}catch(H){B=!0,X=H}finally{try{!L&&K.return&&K.return()}finally{if(B)throw X}}return k}return function(A,N){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return S(A,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function S(A,N,k){A===null&&(A=Function.prototype);var L=Object.getOwnPropertyDescriptor(A,N);if(L===void 0){var B=Object.getPrototypeOf(A);return B===null?void 0:S(B,N,k)}else{if("value"in L)return L.value;var X=L.get;return X===void 0?void 0:X.call(k)}},c=function(){function S(A,N){for(var k=0;k<N.length;k++){var L=N[k];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(A,L.key,L)}}return function(A,N,k){return N&&S(A.prototype,N),k&&S(A,k),A}}(),d=o(3),b=v(d),w=o(8),E=v(w),x=o(43),m=v(x),_=o(27),p=v(_),h=o(15),P=o(41),g=v(P);function v(S){return S&&S.__esModule?S:{default:S}}function y(S,A){if(!(S instanceof A))throw new TypeError("Cannot call a class as a function")}function O(S,A){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:S}function M(S,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);S.prototype=Object.create(A&&A.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(S,A):S.__proto__=A)}var R=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],D=function(S){M(A,S);function A(N,k){y(this,A),k.modules.toolbar!=null&&k.modules.toolbar.container==null&&(k.modules.toolbar.container=R);var L=O(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,N,k));return L.quill.container.classList.add("ql-snow"),L}return c(A,[{key:"extendToolbar",value:function(k){k.container.classList.add("ql-snow"),this.buildButtons([].slice.call(k.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(k.container.querySelectorAll("select")),g.default),this.tooltip=new T(this.quill,this.options.bounds),k.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(L,B){k.handlers.link.call(k,!B.format.link)})}}]),A}(m.default);D.DEFAULTS=(0,b.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){if(A){var N=this.quill.getSelection();if(N==null||N.length==0)return;var k=this.quill.getText(N);/^\S+@\S+\.\S+$/.test(k)&&k.indexOf("mailto:")!==0&&(k="mailto:"+k);var L=this.quill.theme.tooltip;L.edit("link",k)}else this.quill.format("link",!1)}}}}});var T=function(S){M(A,S);function A(N,k){y(this,A);var L=O(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,N,k));return L.preview=L.root.querySelector("a.ql-preview"),L}return c(A,[{key:"listen",value:function(){var k=this;s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(L){k.root.classList.contains("ql-editing")?k.save():k.edit("link",k.preview.textContent),L.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(L){if(k.linkRange!=null){var B=k.linkRange;k.restoreFocus(),k.quill.formatText(B,"link",!1,E.default.sources.USER),delete k.linkRange}L.preventDefault(),k.hide()}),this.quill.on(E.default.events.SELECTION_CHANGE,function(L,B,X){if(L!=null){if(L.length===0&&X===E.default.sources.USER){var K=k.quill.scroll.descendant(p.default,L.index),Q=l(K,2),H=Q[0],z=Q[1];if(H!=null){k.linkRange=new h.Range(L.index-z,H.length());var I=p.default.formats(H.domNode);k.preview.textContent=I,k.preview.setAttribute("href",I),k.show(),k.position(k.quill.getBounds(k.linkRange));return}}else delete k.linkRange;k.hide()}})}},{key:"show",value:function(){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),A}(x.BaseTooltip);T.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=D},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(29),s=ue(l),c=o(36),d=o(38),b=o(64),w=o(65),E=ue(w),x=o(66),m=ue(x),_=o(67),p=ue(_),h=o(37),P=o(26),g=o(39),v=o(40),y=o(56),O=ue(y),M=o(68),R=ue(M),D=o(27),T=ue(D),S=o(69),A=ue(S),N=o(70),k=ue(N),L=o(71),B=ue(L),X=o(72),K=ue(X),Q=o(73),H=ue(Q),z=o(13),I=ue(z),U=o(74),$=ue(U),ee=o(75),G=ue(ee),Z=o(57),W=ue(Z),te=o(41),re=ue(te),ie=o(28),oe=ue(ie),se=o(59),de=ue(se),pe=o(60),Oe=ue(pe),_e=o(61),Te=ue(_e),ce=o(108),he=ue(ce),Ce=o(62),Le=ue(Ce);function ue(me){return me&&me.__esModule?me:{default:me}}s.default.register({"attributors/attribute/direction":d.DirectionAttribute,"attributors/class/align":c.AlignClass,"attributors/class/background":h.BackgroundClass,"attributors/class/color":P.ColorClass,"attributors/class/direction":d.DirectionClass,"attributors/class/font":g.FontClass,"attributors/class/size":v.SizeClass,"attributors/style/align":c.AlignStyle,"attributors/style/background":h.BackgroundStyle,"attributors/style/color":P.ColorStyle,"attributors/style/direction":d.DirectionStyle,"attributors/style/font":g.FontStyle,"attributors/style/size":v.SizeStyle},!0),s.default.register({"formats/align":c.AlignClass,"formats/direction":d.DirectionClass,"formats/indent":b.IndentClass,"formats/background":h.BackgroundStyle,"formats/color":P.ColorStyle,"formats/font":g.FontClass,"formats/size":v.SizeClass,"formats/blockquote":E.default,"formats/code-block":I.default,"formats/header":m.default,"formats/list":p.default,"formats/bold":O.default,"formats/code":z.Code,"formats/italic":R.default,"formats/link":T.default,"formats/script":A.default,"formats/strike":k.default,"formats/underline":B.default,"formats/image":K.default,"formats/video":H.default,"formats/list/item":_.ListItem,"modules/formula":$.default,"modules/syntax":G.default,"modules/toolbar":W.default,"themes/bubble":he.default,"themes/snow":Le.default,"ui/icons":re.default,"ui/picker":oe.default,"ui/icon-picker":Oe.default,"ui/color-picker":de.default,"ui/tooltip":Te.default},!0),n.default=s.default},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var l=function(){function p(h,P){for(var g=0;g<P.length;g++){var v=P[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(h,v.key,v)}}return function(h,P,g){return P&&p(h.prototype,P),g&&p(h,g),h}}(),s=function p(h,P,g){h===null&&(h=Function.prototype);var v=Object.getOwnPropertyDescriptor(h,P);if(v===void 0){var y=Object.getPrototypeOf(h);return y===null?void 0:p(y,P,g)}else{if("value"in v)return v.value;var O=v.get;return O===void 0?void 0:O.call(g)}},c=o(0),d=b(c);function b(p){return p&&p.__esModule?p:{default:p}}function w(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}function E(p,h){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:p}function x(p,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);p.prototype=Object.create(h&&h.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(p,h):p.__proto__=h)}var m=function(p){x(h,p);function h(){return w(this,h),E(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return l(h,[{key:"add",value:function(g,v){if(v==="+1"||v==="-1"){var y=this.value(g)||0;v=v==="+1"?y+1:y-1}return v===0?(this.remove(g),!0):s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"add",this).call(this,g,v)}},{key:"canAdd",value:function(g,v){return s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"canAdd",this).call(this,g,v)||s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"canAdd",this).call(this,g,parseInt(v))}},{key:"value",value:function(g){return parseInt(s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this).call(this,g))||void 0}}]),h}(d.default.Attributor.Class),_=new m("indent","ql-indent",{scope:d.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=_},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(4),s=c(l);function c(x){return x&&x.__esModule?x:{default:x}}function d(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function b(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function w(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var E=function(x){w(m,x);function m(){return d(this,m),b(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(s.default);E.blotName="blockquote",E.tagName="blockquote",n.default=E},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function m(_,p){for(var h=0;h<p.length;h++){var P=p[h];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(_,P.key,P)}}return function(_,p,h){return p&&m(_.prototype,p),h&&m(_,h),_}}(),s=o(4),c=d(s);function d(m){return m&&m.__esModule?m:{default:m}}function b(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function w(m,_){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:m}function E(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(m,_):m.__proto__=_)}var x=function(m){E(_,m);function _(){return b(this,_),w(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return l(_,null,[{key:"formats",value:function(h){return this.tagName.indexOf(h.tagName)+1}}]),_}(c.default);x.blotName="header",x.tagName=["H1","H2","H3","H4","H5","H6"],n.default=x},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var l=function(){function y(O,M){for(var R=0;R<M.length;R++){var D=M[R];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,M,R){return M&&y(O.prototype,M),R&&y(O,R),O}}(),s=function y(O,M,R){O===null&&(O=Function.prototype);var D=Object.getOwnPropertyDescriptor(O,M);if(D===void 0){var T=Object.getPrototypeOf(O);return T===null?void 0:y(T,M,R)}else{if("value"in D)return D.value;var S=D.get;return S===void 0?void 0:S.call(R)}},c=o(0),d=m(c),b=o(4),w=m(b),E=o(25),x=m(E);function m(y){return y&&y.__esModule?y:{default:y}}function _(y,O,M){return O in y?Object.defineProperty(y,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):y[O]=M,y}function p(y,O){if(!(y instanceof O))throw new TypeError("Cannot call a class as a function")}function h(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 P(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 g=function(y){P(O,y);function O(){return p(this,O),h(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return l(O,[{key:"format",value:function(R,D){R===v.blotName&&!D?this.replaceWith(d.default.create(this.statics.scope)):s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,R,D)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(R,D){return this.parent.isolate(this.offset(this.parent),this.length()),R===this.parent.statics.blotName?(this.parent.replaceWith(R,D),this):(this.parent.unwrap(),s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,R,D))}}],[{key:"formats",value:function(R){return R.tagName===this.tagName?void 0:s(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,R)}}]),O}(w.default);g.blotName="list-item",g.tagName="LI";var v=function(y){P(O,y),l(O,null,[{key:"create",value:function(R){var D=R==="ordered"?"OL":"UL",T=s(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,D);return(R==="checked"||R==="unchecked")&&T.setAttribute("data-checked",R==="checked"),T}},{key:"formats",value:function(R){if(R.tagName==="OL")return"ordered";if(R.tagName==="UL")return R.hasAttribute("data-checked")?R.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function O(M){p(this,O);var R=h(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,M)),D=function(S){if(S.target.parentNode===M){var A=R.statics.formats(M),N=d.default.find(S.target);A==="checked"?N.format("list","unchecked"):A==="unchecked"&&N.format("list","checked")}};return M.addEventListener("touchstart",D),M.addEventListener("mousedown",D),R}return l(O,[{key:"format",value:function(R,D){this.children.length>0&&this.children.tail.format(R,D)}},{key:"formats",value:function(){return _({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(R,D){if(R instanceof g)s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,R,D);else{var T=D==null?this.length():D.offset(this),S=this.split(T);S.parent.insertBefore(R,S)}}},{key:"optimize",value:function(R){s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,R);var D=this.next;D!=null&&D.prev===this&&D.statics.blotName===this.statics.blotName&&D.domNode.tagName===this.domNode.tagName&&D.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(D.moveChildren(this),D.remove())}},{key:"replace",value:function(R){if(R.statics.blotName!==this.statics.blotName){var D=d.default.create(this.statics.defaultChild);R.moveChildren(D),this.appendChild(D)}s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,R)}}]),O}(x.default);v.blotName="list",v.scope=d.default.Scope.BLOCK_BLOT,v.tagName=["OL","UL"],v.defaultChild="list-item",v.allowedChildren=[g],n.ListItem=g,n.default=v},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(56),s=c(l);function c(x){return x&&x.__esModule?x:{default:x}}function d(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function b(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function w(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var E=function(x){w(m,x);function m(){return d(this,m),b(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(s.default);E.blotName="italic",E.tagName=["EM","I"],n.default=E},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function _(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&_(p.prototype,h),P&&_(p,P),p}}(),s=function _(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var v=Object.getPrototypeOf(p);return v===null?void 0:_(v,h,P)}else{if("value"in g)return g.value;var y=g.get;return y===void 0?void 0:y.call(P)}},c=o(6),d=b(c);function b(_){return _&&_.__esModule?_:{default:_}}function w(_,p){if(!(_ instanceof p))throw new TypeError("Cannot call a class as a function")}function E(_,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 x(_,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 m=function(_){x(p,_);function p(){return w(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return l(p,null,[{key:"create",value:function(P){return P==="super"?document.createElement("sup"):P==="sub"?document.createElement("sub"):s(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,P)}},{key:"formats",value:function(P){if(P.tagName==="SUB")return"sub";if(P.tagName==="SUP")return"super"}}]),p}(d.default);m.blotName="script",m.tagName=["SUB","SUP"],n.default=m},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(6),s=c(l);function c(x){return x&&x.__esModule?x:{default:x}}function d(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function b(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function w(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var E=function(x){w(m,x);function m(){return d(this,m),b(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(s.default);E.blotName="strike",E.tagName="S",n.default=E},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=o(6),s=c(l);function c(x){return x&&x.__esModule?x:{default:x}}function d(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function b(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function w(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var E=function(x){w(m,x);function m(){return d(this,m),b(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(s.default);E.blotName="underline",E.tagName="U",n.default=E},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function h(P,g){for(var v=0;v<g.length;v++){var y=g[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(P,y.key,y)}}return function(P,g,v){return g&&h(P.prototype,g),v&&h(P,v),P}}(),s=function h(P,g,v){P===null&&(P=Function.prototype);var y=Object.getOwnPropertyDescriptor(P,g);if(y===void 0){var O=Object.getPrototypeOf(P);return O===null?void 0:h(O,g,v)}else{if("value"in y)return y.value;var M=y.get;return M===void 0?void 0:M.call(v)}},c=o(0),d=w(c),b=o(27);function w(h){return h&&h.__esModule?h:{default:h}}function E(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function x(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function m(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var _=["alt","height","width"],p=function(h){m(P,h);function P(){return E(this,P),x(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"format",value:function(v,y){_.indexOf(v)>-1?y?this.domNode.setAttribute(v,y):this.domNode.removeAttribute(v):s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,v,y)}}],[{key:"create",value:function(v){var y=s(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,v);return typeof v=="string"&&y.setAttribute("src",this.sanitize(v)),y}},{key:"formats",value:function(v){return _.reduce(function(y,O){return v.hasAttribute(O)&&(y[O]=v.getAttribute(O)),y},{})}},{key:"match",value:function(v){return/\.(jpe?g|gif|png)$/.test(v)||/^data:image\/.+;base64/.test(v)}},{key:"sanitize",value:function(v){return(0,b.sanitize)(v,["http","https","data"])?v:"//:0"}},{key:"value",value:function(v){return v.getAttribute("src")}}]),P}(d.default.Embed);p.blotName="image",p.tagName="IMG",n.default=p},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function h(P,g){for(var v=0;v<g.length;v++){var y=g[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(P,y.key,y)}}return function(P,g,v){return g&&h(P.prototype,g),v&&h(P,v),P}}(),s=function h(P,g,v){P===null&&(P=Function.prototype);var y=Object.getOwnPropertyDescriptor(P,g);if(y===void 0){var O=Object.getPrototypeOf(P);return O===null?void 0:h(O,g,v)}else{if("value"in y)return y.value;var M=y.get;return M===void 0?void 0:M.call(v)}},c=o(4),d=o(27),b=w(d);function w(h){return h&&h.__esModule?h:{default:h}}function E(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function x(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function m(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var _=["height","width"],p=function(h){m(P,h);function P(){return E(this,P),x(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"format",value:function(v,y){_.indexOf(v)>-1?y?this.domNode.setAttribute(v,y):this.domNode.removeAttribute(v):s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,v,y)}}],[{key:"create",value:function(v){var y=s(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,v);return y.setAttribute("frameborder","0"),y.setAttribute("allowfullscreen",!0),y.setAttribute("src",this.sanitize(v)),y}},{key:"formats",value:function(v){return _.reduce(function(y,O){return v.hasAttribute(O)&&(y[O]=v.getAttribute(O)),y},{})}},{key:"sanitize",value:function(v){return b.default.sanitize(v)}},{key:"value",value:function(v){return v.getAttribute("src")}}]),P}(c.BlockEmbed);p.blotName="video",p.className="ql-video",p.tagName="IFRAME",n.default=p},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var l=function(){function v(y,O){for(var M=0;M<O.length;M++){var R=O[M];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(y,R.key,R)}}return function(y,O,M){return O&&v(y.prototype,O),M&&v(y,M),y}}(),s=function v(y,O,M){y===null&&(y=Function.prototype);var R=Object.getOwnPropertyDescriptor(y,O);if(R===void 0){var D=Object.getPrototypeOf(y);return D===null?void 0:v(D,O,M)}else{if("value"in R)return R.value;var T=R.get;return T===void 0?void 0:T.call(M)}},c=o(35),d=m(c),b=o(5),w=m(b),E=o(9),x=m(E);function m(v){return v&&v.__esModule?v:{default:v}}function _(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function p(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:v}function h(v,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);v.prototype=Object.create(y&&y.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(v,y):v.__proto__=y)}var P=function(v){h(y,v);function y(){return _(this,y),p(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return l(y,null,[{key:"create",value:function(M){var R=s(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,M);return typeof M=="string"&&(window.katex.render(M,R,{throwOnError:!1,errorColor:"#f00"}),R.setAttribute("data-value",M)),R}},{key:"value",value:function(M){return M.getAttribute("data-value")}}]),y}(d.default);P.blotName="formula",P.className="ql-formula",P.tagName="SPAN";var g=function(v){h(y,v),l(y,null,[{key:"register",value:function(){w.default.register(P,!0)}}]);function y(){_(this,y);var O=p(this,(y.__proto__||Object.getPrototypeOf(y)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return y}(x.default);n.FormulaBlot=P,n.default=g},function(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var l=function(){function M(R,D){for(var T=0;T<D.length;T++){var S=D[T];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(R,S.key,S)}}return function(R,D,T){return D&&M(R.prototype,D),T&&M(R,T),R}}(),s=function M(R,D,T){R===null&&(R=Function.prototype);var S=Object.getOwnPropertyDescriptor(R,D);if(S===void 0){var A=Object.getPrototypeOf(R);return A===null?void 0:M(A,D,T)}else{if("value"in S)return S.value;var N=S.get;return N===void 0?void 0:N.call(T)}},c=o(0),d=p(c),b=o(5),w=p(b),E=o(9),x=p(E),m=o(13),_=p(m);function p(M){return M&&M.__esModule?M:{default:M}}function h(M,R){if(!(M instanceof R))throw new TypeError("Cannot call a class as a function")}function P(M,R){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:M}function g(M,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);M.prototype=Object.create(R&&R.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(M,R):M.__proto__=R)}var v=function(M){g(R,M);function R(){return h(this,R),P(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return l(R,[{key:"replaceWith",value:function(T){this.domNode.textContent=this.domNode.textContent,this.attach(),s(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"replaceWith",this).call(this,T)}},{key:"highlight",value:function(T){var S=this.domNode.textContent;this.cachedText!==S&&((S.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=T(S),this.domNode.normalize(),this.attach()),this.cachedText=S)}}]),R}(_.default);v.className="ql-syntax";var y=new d.default.Attributor.Class("token","hljs",{scope:d.default.Scope.INLINE}),O=function(M){g(R,M),l(R,null,[{key:"register",value:function(){w.default.register(y,!0),w.default.register(v,!0)}}]);function R(D,T){h(this,R);var S=P(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,D,T));if(typeof S.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return S.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){S.highlight(),A=null},S.options.interval)}),S.highlight(),S}return l(R,[{key:"highlight",value:function(){var T=this;if(!this.quill.selection.composing){this.quill.update(w.default.sources.USER);var S=this.quill.getSelection();this.quill.scroll.descendants(v).forEach(function(A){A.highlight(T.options.highlight)}),this.quill.update(w.default.sources.SILENT),S!=null&&this.quill.setSelection(S,w.default.sources.SILENT)}}}]),R}(x.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(M){var R=window.hljs.highlightAuto(M);return R.value}}(),interval:1e3},n.CodeBlock=v,n.CodeToken=y,n.default=O},function(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var l=function R(D,T,S){D===null&&(D=Function.prototype);var A=Object.getOwnPropertyDescriptor(D,T);if(A===void 0){var N=Object.getPrototypeOf(D);return N===null?void 0:R(N,T,S)}else{if("value"in A)return A.value;var k=A.get;return k===void 0?void 0:k.call(S)}},s=function(){function R(D,T){for(var S=0;S<T.length;S++){var A=T[S];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(D,A.key,A)}}return function(D,T,S){return T&&R(D.prototype,T),S&&R(D,S),D}}(),c=o(3),d=h(c),b=o(8),w=h(b),E=o(43),x=h(E),m=o(15),_=o(41),p=h(_);function h(R){return R&&R.__esModule?R:{default:R}}function P(R,D){if(!(R instanceof D))throw new TypeError("Cannot call a class as a function")}function g(R,D){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:R}function v(R,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);R.prototype=Object.create(D&&D.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(R,D):R.__proto__=D)}var y=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(R){v(D,R);function D(T,S){P(this,D),S.modules.toolbar!=null&&S.modules.toolbar.container==null&&(S.modules.toolbar.container=y);var A=g(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,T,S));return A.quill.container.classList.add("ql-bubble"),A}return s(D,[{key:"extendToolbar",value:function(S){this.tooltip=new M(this.quill,this.options.bounds),this.tooltip.root.appendChild(S.container),this.buildButtons([].slice.call(S.container.querySelectorAll("button")),p.default),this.buildPickers([].slice.call(S.container.querySelectorAll("select")),p.default)}}]),D}(x.default);O.DEFAULTS=(0,d.default)(!0,{},x.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(D){D?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var M=function(R){v(D,R);function D(T,S){P(this,D);var A=g(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,T,S));return A.quill.on(w.default.events.EDITOR_CHANGE,function(N,k,L,B){if(N===w.default.events.SELECTION_CHANGE)if(k!=null&&k.length>0&&B===w.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var X=A.quill.getLines(k.index,k.length);if(X.length===1)A.position(A.quill.getBounds(k));else{var K=X[X.length-1],Q=A.quill.getIndex(K),H=Math.min(K.length()-1,k.index+k.length-Q),z=A.quill.getBounds(new m.Range(Q,H));A.position(z)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return s(D,[{key:"listen",value:function(){var S=this;l(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){S.root.classList.remove("ql-editing")}),this.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!S.root.classList.contains("ql-hidden")){var A=S.quill.getSelection();A!=null&&S.position(S.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(S){var A=l(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"position",this).call(this,S),N=this.root.querySelector(".ql-tooltip-arrow");if(N.style.marginLeft="",A===0)return A;N.style.marginLeft=-1*A-N.offsetWidth/2+"px"}}]),D}(E.BaseTooltip);M.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=M,n.default=O},function(t,n,o){t.exports=o(63)}]).default})}(ip)),ip.exports}var Vo={},ap={exports:{}},js={},yd={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var TO=yd.exports,q2;function RO(){return q2||(q2=1,function(e,i){(function(t){var n=i&&!i.nodeType&&i,o=e&&!e.nodeType&&e,l=typeof ic=="object"&&ic;(l.global===l||l.window===l||l.self===l)&&(t=l);var s,c=2147483647,d=36,b=1,w=26,E=38,x=700,m=72,_=128,p="-",h=/^xn--/,P=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=d-b,O=Math.floor,M=String.fromCharCode,R;function D(z){throw new RangeError(v[z])}function T(z,I){for(var U=z.length,$=[];U--;)$[U]=I(z[U]);return $}function S(z,I){var U=z.split("@"),$="";U.length>1&&($=U[0]+"@",z=U[1]),z=z.replace(g,".");var ee=z.split("."),G=T(ee,I).join(".");return $+G}function A(z){for(var I=[],U=0,$=z.length,ee,G;U<$;)ee=z.charCodeAt(U++),ee>=55296&&ee<=56319&&U<$?(G=z.charCodeAt(U++),(G&64512)==56320?I.push(((ee&1023)<<10)+(G&1023)+65536):(I.push(ee),U--)):I.push(ee);return I}function N(z){return T(z,function(I){var U="";return I>65535&&(I-=65536,U+=M(I>>>10&1023|55296),I=56320|I&1023),U+=M(I),U}).join("")}function k(z){return z-48<10?z-22:z-65<26?z-65:z-97<26?z-97:d}function L(z,I){return z+22+75*(z<26)-((I!=0)<<5)}function B(z,I,U){var $=0;for(z=U?O(z/x):z>>1,z+=O(z/I);z>y*w>>1;$+=d)z=O(z/y);return O($+(y+1)*z/(z+E))}function X(z){var I=[],U=z.length,$,ee=0,G=_,Z=m,W,te,re,ie,oe,se,de,pe,Oe;for(W=z.lastIndexOf(p),W<0&&(W=0),te=0;te<W;++te)z.charCodeAt(te)>=128&&D("not-basic"),I.push(z.charCodeAt(te));for(re=W>0?W+1:0;re<U;){for(ie=ee,oe=1,se=d;re>=U&&D("invalid-input"),de=k(z.charCodeAt(re++)),(de>=d||de>O((c-ee)/oe))&&D("overflow"),ee+=de*oe,pe=se<=Z?b:se>=Z+w?w:se-Z,!(de<pe);se+=d)Oe=d-pe,oe>O(c/Oe)&&D("overflow"),oe*=Oe;$=I.length+1,Z=B(ee-ie,$,ie==0),O(ee/$)>c-G&&D("overflow"),G+=O(ee/$),ee%=$,I.splice(ee++,0,G)}return N(I)}function K(z){var I,U,$,ee,G,Z,W,te,re,ie,oe,se=[],de,pe,Oe,_e;for(z=A(z),de=z.length,I=_,U=0,G=m,Z=0;Z<de;++Z)oe=z[Z],oe<128&&se.push(M(oe));for($=ee=se.length,ee&&se.push(p);$<de;){for(W=c,Z=0;Z<de;++Z)oe=z[Z],oe>=I&&oe<W&&(W=oe);for(pe=$+1,W-I>O((c-U)/pe)&&D("overflow"),U+=(W-I)*pe,I=W,Z=0;Z<de;++Z)if(oe=z[Z],oe<I&&++U>c&&D("overflow"),oe==I){for(te=U,re=d;ie=re<=G?b:re>=G+w?w:re-G,!(te<ie);re+=d)_e=te-ie,Oe=d-ie,se.push(M(L(ie+_e%Oe,0))),te=O(_e/Oe);se.push(M(L(te,0))),G=B(U,pe,$==ee),U=0,++$}++U,++I}return se.join("")}function Q(z){return S(z,function(I){return h.test(I)?X(I.slice(4).toLowerCase()):I})}function H(z){return S(z,function(I){return P.test(I)?"xn--"+K(I):I})}if(s={version:"1.4.1",ucs2:{decode:A,encode:N},decode:X,encode:K,toASCII:H,toUnicode:Q},n&&o)if(e.exports==n)o.exports=s;else for(R in s)s.hasOwnProperty(R)&&(n[R]=s[R]);else t.punycode=s})(TO)}(yd,yd.exports)),yd.exports}var s1,H2;function Sc(){return H2||(H2=1,s1=TypeError),s1}const MO={},LO=Object.freeze(Object.defineProperty({__proto__:null,default:MO},Symbol.toStringTag,{value:"Module"})),NO=Xl(LO);var u1,G2;function Up(){if(G2)return u1;G2=1;var e=typeof Map=="function"&&Map.prototype,i=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=e&&i&&typeof i.get=="function"?i.get:null,n=e&&Map.prototype.forEach,o=typeof Set=="function"&&Set.prototype,l=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=o&&l&&typeof l.get=="function"?l.get:null,c=o&&Set.prototype.forEach,d=typeof WeakMap=="function"&&WeakMap.prototype,b=d?WeakMap.prototype.has:null,w=typeof WeakSet=="function"&&WeakSet.prototype,E=w?WeakSet.prototype.has:null,x=typeof WeakRef=="function"&&WeakRef.prototype,m=x?WeakRef.prototype.deref:null,_=Boolean.prototype.valueOf,p=Object.prototype.toString,h=Function.prototype.toString,P=String.prototype.match,g=String.prototype.slice,v=String.prototype.replace,y=String.prototype.toUpperCase,O=String.prototype.toLowerCase,M=RegExp.prototype.test,R=Array.prototype.concat,D=Array.prototype.join,T=Array.prototype.slice,S=Math.floor,A=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,L=typeof Symbol=="function"&&typeof Symbol.iterator=="object",B=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===L||!0)?Symbol.toStringTag:null,X=Object.prototype.propertyIsEnumerable,K=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(we){return we.__proto__}:null);function Q(we,Se){if(we===1/0||we===-1/0||we!==we||we&&we>-1e3&&we<1e3||M.call(/e/,Se))return Se;var gt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof we=="number"){var wt=we<0?-S(-we):S(we);if(wt!==we){var Pt=String(wt),mt=g.call(Se,Pt.length+1);return v.call(Pt,gt,"$&_")+"."+v.call(v.call(mt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(Se,gt,"$&_")}var H=NO,z=H.custom,I=de(z)?z:null,U={__proto__:null,double:'"',single:"'"},$={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};u1=function we(Se,gt,wt,Pt){var mt=gt||{};if(_e(mt,"quoteStyle")&&!_e(U,mt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_e(mt,"maxStringLength")&&(typeof mt.maxStringLength=="number"?mt.maxStringLength<0&&mt.maxStringLength!==1/0:mt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Wt=_e(mt,"customInspect")?mt.customInspect:!0;if(typeof Wt!="boolean"&&Wt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_e(mt,"indent")&&mt.indent!==null&&mt.indent!==" "&&!(parseInt(mt.indent,10)===mt.indent&&mt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(_e(mt,"numericSeparator")&&typeof mt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var pn=mt.numericSeparator;if(typeof Se>"u")return"undefined";if(Se===null)return"null";if(typeof Se=="boolean")return Se?"true":"false";if(typeof Se=="string")return ot(Se,mt);if(typeof Se=="number"){if(Se===0)return 1/0/Se>0?"0":"-0";var Fe=String(Se);return pn?Q(Se,Fe):Fe}if(typeof Se=="bigint"){var rt=String(Se)+"n";return pn?Q(Se,rt):rt}var ft=typeof mt.depth>"u"?5:mt.depth;if(typeof wt>"u"&&(wt=0),wt>=ft&&ft>0&&typeof Se=="object")return Z(Se)?"[Array]":"[Object]";var De=Ve(mt,wt);if(typeof Pt>"u")Pt=[];else if(he(Pt,Se)>=0)return"[Circular]";function Ie(Gn,En,ai){if(En&&(Pt=T.call(Pt),Pt.push(En)),ai){var Ir={depth:mt.depth};return _e(mt,"quoteStyle")&&(Ir.quoteStyle=mt.quoteStyle),we(Gn,Ir,wt+1,Pt)}return we(Gn,mt,wt+1,Pt)}if(typeof Se=="function"&&!te(Se)){var Me=ce(Se),Ye=Ct(Se,Ie);return"[Function"+(Me?": "+Me:" (anonymous)")+"]"+(Ye.length>0?" { "+D.call(Ye,", ")+" }":"")}if(de(Se)){var Mt=L?v.call(String(Se),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(Se);return typeof Se=="object"&&!L?et(Mt):Mt}if(je(Se)){for(var _t="<"+O.call(String(Se.nodeName)),Yt=Se.attributes||[],wn=0;wn<Yt.length;wn++)_t+=" "+Yt[wn].name+"="+ee(G(Yt[wn].value),"double",mt);return _t+=">",Se.childNodes&&Se.childNodes.length&&(_t+="..."),_t+="</"+O.call(String(Se.nodeName))+">",_t}if(Z(Se)){if(Se.length===0)return"[]";var Sn=Ct(Se,Ie);return De&&!Be(Sn)?"["+bt(Sn,De)+"]":"[ "+D.call(Sn,", ")+" ]"}if(re(Se)){var Qn=Ct(Se,Ie);return!("cause"in Error.prototype)&&"cause"in Se&&!X.call(Se,"cause")?"{ ["+String(Se)+"] "+D.call(R.call("[cause]: "+Ie(Se.cause),Qn),", ")+" }":Qn.length===0?"["+String(Se)+"]":"{ ["+String(Se)+"] "+D.call(Qn,", ")+" }"}if(typeof Se=="object"&&Wt){if(I&&typeof Se[I]=="function"&&H)return H(Se,{depth:ft-wt});if(Wt!=="symbol"&&typeof Se.inspect=="function")return Se.inspect()}if(Ce(Se)){var ii=[];return n&&n.call(Se,function(Gn,En){ii.push(Ie(En,Se,!0)+" => "+Ie(Gn,Se))}),ze("Map",t.call(Se),ii,De)}if(me(Se)){var Sr=[];return c&&c.call(Se,function(Gn){Sr.push(Ie(Gn,Se))}),ze("Set",s.call(Se),Sr,De)}if(Le(Se))return Ke("WeakMap");if(xe(Se))return Ke("WeakSet");if(ue(Se))return Ke("WeakRef");if(oe(Se))return et(Ie(Number(Se)));if(pe(Se))return et(Ie(A.call(Se)));if(se(Se))return et(_.call(Se));if(ie(Se))return et(Ie(String(Se)));if(typeof window<"u"&&Se===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Se===globalThis||typeof ic<"u"&&Se===ic)return"{ [object globalThis] }";if(!W(Se)&&!te(Se)){var Ze=Ct(Se,Ie),Et=K?K(Se)===Object.prototype:Se instanceof Object||Se.constructor===Object,Lt=Se instanceof Object?"":"null prototype",Gt=!Et&&B&&Object(Se)===Se&&B in Se?g.call(Te(Se),8,-1):Lt?"Object":"",Vt=Et||typeof Se.constructor!="function"?"":Se.constructor.name?Se.constructor.name+" ":"",Jn=Vt+(Gt||Lt?"["+D.call(R.call([],Gt||[],Lt||[]),": ")+"] ":"");return Ze.length===0?Jn+"{}":De?Jn+"{"+bt(Ze,De)+"}":Jn+"{ "+D.call(Ze,", ")+" }"}return String(Se)};function ee(we,Se,gt){var wt=gt.quoteStyle||Se,Pt=U[wt];return Pt+we+Pt}function G(we){return v.call(String(we),/"/g,"&quot;")}function Z(we){return Te(we)==="[object Array]"&&(!B||!(typeof we=="object"&&B in we))}function W(we){return Te(we)==="[object Date]"&&(!B||!(typeof we=="object"&&B in we))}function te(we){return Te(we)==="[object RegExp]"&&(!B||!(typeof we=="object"&&B in we))}function re(we){return Te(we)==="[object Error]"&&(!B||!(typeof we=="object"&&B in we))}function ie(we){return Te(we)==="[object String]"&&(!B||!(typeof we=="object"&&B in we))}function oe(we){return Te(we)==="[object Number]"&&(!B||!(typeof we=="object"&&B in we))}function se(we){return Te(we)==="[object Boolean]"&&(!B||!(typeof we=="object"&&B in we))}function de(we){if(L)return we&&typeof we=="object"&&we instanceof Symbol;if(typeof we=="symbol")return!0;if(!we||typeof we!="object"||!k)return!1;try{return k.call(we),!0}catch{}return!1}function pe(we){if(!we||typeof we!="object"||!A)return!1;try{return A.call(we),!0}catch{}return!1}var Oe=Object.prototype.hasOwnProperty||function(we){return we in this};function _e(we,Se){return Oe.call(we,Se)}function Te(we){return p.call(we)}function ce(we){if(we.name)return we.name;var Se=P.call(h.call(we),/^function\s*([\w$]+)/);return Se?Se[1]:null}function he(we,Se){if(we.indexOf)return we.indexOf(Se);for(var gt=0,wt=we.length;gt<wt;gt++)if(we[gt]===Se)return gt;return-1}function Ce(we){if(!t||!we||typeof we!="object")return!1;try{t.call(we);try{s.call(we)}catch{return!0}return we instanceof Map}catch{}return!1}function Le(we){if(!b||!we||typeof we!="object")return!1;try{b.call(we,b);try{E.call(we,E)}catch{return!0}return we instanceof WeakMap}catch{}return!1}function ue(we){if(!m||!we||typeof we!="object")return!1;try{return m.call(we),!0}catch{}return!1}function me(we){if(!s||!we||typeof we!="object")return!1;try{s.call(we);try{t.call(we)}catch{return!0}return we instanceof Set}catch{}return!1}function xe(we){if(!E||!we||typeof we!="object")return!1;try{E.call(we,E);try{b.call(we,b)}catch{return!0}return we instanceof WeakSet}catch{}return!1}function je(we){return!we||typeof we!="object"?!1:typeof HTMLElement<"u"&&we instanceof HTMLElement?!0:typeof we.nodeName=="string"&&typeof we.getAttribute=="function"}function ot(we,Se){if(we.length>Se.maxStringLength){var gt=we.length-Se.maxStringLength,wt="... "+gt+" more character"+(gt>1?"s":"");return ot(g.call(we,0,Se.maxStringLength),Se)+wt}var Pt=$[Se.quoteStyle||"single"];Pt.lastIndex=0;var mt=v.call(v.call(we,Pt,"\\$1"),/[\x00-\x1f]/g,ht);return ee(mt,"single",Se)}function ht(we){var Se=we.charCodeAt(0),gt={8:"b",9:"t",10:"n",12:"f",13:"r"}[Se];return gt?"\\"+gt:"\\x"+(Se<16?"0":"")+y.call(Se.toString(16))}function et(we){return"Object("+we+")"}function Ke(we){return we+" { ? }"}function ze(we,Se,gt,wt){var Pt=wt?bt(gt,wt):D.call(gt,", ");return we+" ("+Se+") {"+Pt+"}"}function Be(we){for(var Se=0;Se<we.length;Se++)if(he(we[Se],`
149
+ `)>=0)return!1;return!0}function Ve(we,Se){var gt;if(we.indent===" ")gt=" ";else if(typeof we.indent=="number"&&we.indent>0)gt=D.call(Array(we.indent+1)," ");else return null;return{base:gt,prev:D.call(Array(Se+1),gt)}}function bt(we,Se){if(we.length===0)return"";var gt=`
150
+ `+Se.prev+Se.base;return gt+D.call(we,","+gt)+`
151
+ `+Se.prev}function Ct(we,Se){var gt=Z(we),wt=[];if(gt){wt.length=we.length;for(var Pt=0;Pt<we.length;Pt++)wt[Pt]=_e(we,Pt)?Se(we[Pt],we):""}var mt=typeof N=="function"?N(we):[],Wt;if(L){Wt={};for(var pn=0;pn<mt.length;pn++)Wt["$"+mt[pn]]=mt[pn]}for(var Fe in we)_e(we,Fe)&&(gt&&String(Number(Fe))===Fe&&Fe<we.length||L&&Wt["$"+Fe]instanceof Symbol||(M.call(/[^\w$]/,Fe)?wt.push(Se(Fe,we)+": "+Se(we[Fe],we)):wt.push(Fe+": "+Se(we[Fe],we))));if(typeof N=="function")for(var rt=0;rt<mt.length;rt++)X.call(we,mt[rt])&&wt.push("["+Se(mt[rt])+"]: "+Se(we[mt[rt]],we));return wt}return u1}var c1,V2;function IO(){if(V2)return c1;V2=1;var e=Up(),i=Sc(),t=function(c,d,b){for(var w=c,E;(E=w.next)!=null;w=E)if(E.key===d)return w.next=E.next,b||(E.next=c.next,c.next=E),E},n=function(c,d){if(c){var b=t(c,d);return b&&b.value}},o=function(c,d,b){var w=t(c,d);w?w.value=b:c.next={key:d,next:c.next,value:b}},l=function(c,d){return c?!!t(c,d):!1},s=function(c,d){if(c)return t(c,d,!0)};return c1=function(){var d,b={assert:function(w){if(!b.has(w))throw new i("Side channel does not contain "+e(w))},delete:function(w){var E=d&&d.next,x=s(d,w);return x&&E&&E===x&&(d=void 0),!!x},get:function(w){return n(d,w)},has:function(w){return l(d,w)},set:function(w,E){d||(d={next:void 0}),o(d,w,E)}};return b},c1}var f1,$2;function DO(){return $2||($2=1,f1=Object),f1}var d1,W2;function jO(){return W2||(W2=1,d1=Error),d1}var h1,Y2;function FO(){return Y2||(Y2=1,h1=EvalError),h1}var p1,K2;function zO(){return K2||(K2=1,p1=RangeError),p1}var g1,X2;function BO(){return X2||(X2=1,g1=ReferenceError),g1}var m1,Z2;function UO(){return Z2||(Z2=1,m1=SyntaxError),m1}var v1,Q2;function qO(){return Q2||(Q2=1,v1=URIError),v1}var y1,J2;function HO(){return J2||(J2=1,y1=Math.abs),y1}var b1,eb;function GO(){return eb||(eb=1,b1=Math.floor),b1}var _1,tb;function VO(){return tb||(tb=1,_1=Math.max),_1}var w1,nb;function $O(){return nb||(nb=1,w1=Math.min),w1}var S1,rb;function WO(){return rb||(rb=1,S1=Math.pow),S1}var E1,ib;function YO(){return ib||(ib=1,E1=Object.getOwnPropertyDescriptor),E1}var O1,ab;function u4(){if(ab)return O1;ab=1;var e=YO();if(e)try{e([],"length")}catch{e=null}return O1=e,O1}var x1,ob;function KO(){if(ob)return x1;ob=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return x1=e,x1}var P1,lb;function XO(){return lb||(lb=1,P1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[t]=o;for(var l in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var s=Object.getOwnPropertySymbols(i);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(i,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(i,t);if(c.value!==o||c.enumerable!==!0)return!1}return!0}),P1}var C1,sb;function ZO(){if(sb)return C1;sb=1;var e=typeof Symbol<"u"&&Symbol,i=XO();return C1=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},C1}var k1,ub;function QO(){if(ub)return k1;ub=1;var e="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,t=Math.max,n="[object Function]",o=function(d,b){for(var w=[],E=0;E<d.length;E+=1)w[E]=d[E];for(var x=0;x<b.length;x+=1)w[x+d.length]=b[x];return w},l=function(d,b){for(var w=[],E=b,x=0;E<d.length;E+=1,x+=1)w[x]=d[E];return w},s=function(c,d){for(var b="",w=0;w<c.length;w+=1)b+=c[w],w+1<c.length&&(b+=d);return b};return k1=function(d){var b=this;if(typeof b!="function"||i.apply(b)!==n)throw new TypeError(e+b);for(var w=l(arguments,1),E,x=function(){if(this instanceof E){var P=b.apply(this,o(w,arguments));return Object(P)===P?P:this}return b.apply(d,o(w,arguments))},m=t(0,b.length-w.length),_=[],p=0;p<m;p++)_[p]="$"+p;if(E=Function("binder","return function ("+s(_,",")+"){ return binder.apply(this,arguments); }")(x),b.prototype){var h=function(){};h.prototype=b.prototype,E.prototype=new h,h.prototype=null}return E},k1}var A1,cb;function qp(){if(cb)return A1;cb=1;var e=QO();return A1=Function.prototype.bind||e,A1}var T1,fb;function Mm(){return fb||(fb=1,T1=Function.prototype.call),T1}var R1,db;function c4(){return db||(db=1,R1=Function.prototype.apply),R1}var M1,hb;function JO(){return hb||(hb=1,M1=typeof Reflect<"u"&&Reflect&&Reflect.apply),M1}var L1,pb;function ex(){if(pb)return L1;pb=1;var e=qp(),i=c4(),t=Mm(),n=JO();return L1=n||e.call(t,i),L1}var N1,gb;function f4(){if(gb)return N1;gb=1;var e=qp(),i=Sc(),t=Mm(),n=ex();return N1=function(l){if(l.length<1||typeof l[0]!="function")throw new i("a function is required");return n(e,t,l)},N1}var I1,mb;function tx(){if(mb)return I1;mb=1;var e=f4(),i=u4(),t=[].__proto__===Array.prototype,n=t&&i&&i(Object.prototype,"__proto__"),o=Object,l=o.getPrototypeOf;return I1=n&&typeof n.get=="function"?e([n.get]):typeof l=="function"?function(c){return l(c==null?c:o(c))}:!1,I1}var D1,vb;function nx(){if(vb)return D1;vb=1;var e=Function.prototype.call,i=Object.prototype.hasOwnProperty,t=qp();return D1=t.call(e,i),D1}var j1,yb;function Lm(){if(yb)return j1;yb=1;var e,i=DO(),t=jO(),n=FO(),o=zO(),l=BO(),s=UO(),c=Sc(),d=qO(),b=HO(),w=GO(),E=VO(),x=$O(),m=WO(),_=Function,p=function(Z){try{return _('"use strict"; return ('+Z+").constructor;")()}catch{}},h=u4(),P=KO(),g=function(){throw new c},v=h?function(){try{return arguments.callee,g}catch{try{return h(arguments,"callee").get}catch{return g}}}():g,y=ZO()(),O=tx(),M=typeof Reflect=="function"&&Reflect.getPrototypeOf||i.getPrototypeOf||O,R=c4(),D=Mm(),T={},S=typeof Uint8Array>"u"||!M?e:M(Uint8Array),A={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":y&&M?M([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%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%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&M?M(M([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!M?e:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":h,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!M?e:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&M?M(""[Symbol.iterator]()):e,"%Symbol%":y?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":v,"%TypedArray%":S,"%TypeError%":c,"%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%":d,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":D,"%Function.prototype.apply%":R,"%Object.defineProperty%":P,"%Math.abs%":b,"%Math.floor%":w,"%Math.max%":E,"%Math.min%":x,"%Math.pow%":m};if(M)try{null.error}catch(Z){var N=M(M(Z));A["%Error.prototype%"]=N}var k=function Z(W){var te;if(W==="%AsyncFunction%")te=p("async function () {}");else if(W==="%GeneratorFunction%")te=p("function* () {}");else if(W==="%AsyncGeneratorFunction%")te=p("async function* () {}");else if(W==="%AsyncGenerator%"){var re=Z("%AsyncGeneratorFunction%");re&&(te=re.prototype)}else if(W==="%AsyncIteratorPrototype%"){var ie=Z("%AsyncGenerator%");ie&&M&&(te=M(ie.prototype))}return A[W]=te,te},L={__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"]},B=qp(),X=nx(),K=B.call(D,Array.prototype.concat),Q=B.call(R,Array.prototype.splice),H=B.call(D,String.prototype.replace),z=B.call(D,String.prototype.slice),I=B.call(D,RegExp.prototype.exec),U=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$=/\\(\\)?/g,ee=function(W){var te=z(W,0,1),re=z(W,-1);if(te==="%"&&re!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(re==="%"&&te!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ie=[];return H(W,U,function(oe,se,de,pe){ie[ie.length]=de?H(pe,$,"$1"):se||oe}),ie},G=function(W,te){var re=W,ie;if(X(L,re)&&(ie=L[re],re="%"+ie[0]+"%"),X(A,re)){var oe=A[re];if(oe===T&&(oe=k(re)),typeof oe>"u"&&!te)throw new c("intrinsic "+W+" exists, but is not available. Please file an issue!");return{alias:ie,name:re,value:oe}}throw new s("intrinsic "+W+" does not exist!")};return j1=function(W,te){if(typeof W!="string"||W.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new c('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,W)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var re=ee(W),ie=re.length>0?re[0]:"",oe=G("%"+ie+"%",te),se=oe.name,de=oe.value,pe=!1,Oe=oe.alias;Oe&&(ie=Oe[0],Q(re,K([0,1],Oe)));for(var _e=1,Te=!0;_e<re.length;_e+=1){var ce=re[_e],he=z(ce,0,1),Ce=z(ce,-1);if((he==='"'||he==="'"||he==="`"||Ce==='"'||Ce==="'"||Ce==="`")&&he!==Ce)throw new s("property names with quotes must have matching quotes");if((ce==="constructor"||!Te)&&(pe=!0),ie+="."+ce,se="%"+ie+"%",X(A,se))de=A[se];else if(de!=null){if(!(ce in de)){if(!te)throw new c("base intrinsic for "+W+" exists, but the property is not available.");return}if(h&&_e+1>=re.length){var Le=h(de,ce);Te=!!Le,Te&&"get"in Le&&!("originalValue"in Le.get)?de=Le.get:de=de[ce]}else Te=X(de,ce),de=de[ce];Te&&!pe&&(A[se]=de)}}return de},j1}var F1,bb;function d4(){if(bb)return F1;bb=1;var e=Lm(),i=f4(),t=i([e("%String.prototype.indexOf%")]);return F1=function(o,l){var s=e(o,!!l);return typeof s=="function"&&t(o,".prototype.")>-1?i([s]):s},F1}var z1,_b;function h4(){if(_b)return z1;_b=1;var e=Lm(),i=d4(),t=Up(),n=Sc(),o=e("%Map%",!0),l=i("Map.prototype.get",!0),s=i("Map.prototype.set",!0),c=i("Map.prototype.has",!0),d=i("Map.prototype.delete",!0),b=i("Map.prototype.size",!0);return z1=!!o&&function(){var E,x={assert:function(m){if(!x.has(m))throw new n("Side channel does not contain "+t(m))},delete:function(m){if(E){var _=d(E,m);return b(E)===0&&(E=void 0),_}return!1},get:function(m){if(E)return l(E,m)},has:function(m){return E?c(E,m):!1},set:function(m,_){E||(E=new o),s(E,m,_)}};return x},z1}var B1,wb;function rx(){if(wb)return B1;wb=1;var e=Lm(),i=d4(),t=Up(),n=h4(),o=Sc(),l=e("%WeakMap%",!0),s=i("WeakMap.prototype.get",!0),c=i("WeakMap.prototype.set",!0),d=i("WeakMap.prototype.has",!0),b=i("WeakMap.prototype.delete",!0);return B1=l?function(){var E,x,m={assert:function(_){if(!m.has(_))throw new o("Side channel does not contain "+t(_))},delete:function(_){if(l&&_&&(typeof _=="object"||typeof _=="function")){if(E)return b(E,_)}else if(n&&x)return x.delete(_);return!1},get:function(_){return l&&_&&(typeof _=="object"||typeof _=="function")&&E?s(E,_):x&&x.get(_)},has:function(_){return l&&_&&(typeof _=="object"||typeof _=="function")&&E?d(E,_):!!x&&x.has(_)},set:function(_,p){l&&_&&(typeof _=="object"||typeof _=="function")?(E||(E=new l),c(E,_,p)):n&&(x||(x=n()),x.set(_,p))}};return m}:n,B1}var U1,Sb;function ix(){if(Sb)return U1;Sb=1;var e=Sc(),i=Up(),t=IO(),n=h4(),o=rx(),l=o||n||t;return U1=function(){var c,d={assert:function(b){if(!d.has(b))throw new e("Side channel does not contain "+i(b))},delete:function(b){return!!c&&c.delete(b)},get:function(b){return c&&c.get(b)},has:function(b){return!!c&&c.has(b)},set:function(b,w){c||(c=l()),c.set(b,w)}};return d},U1}var q1,Eb;function Nm(){if(Eb)return q1;Eb=1;var e=String.prototype.replace,i=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return q1={default:t.RFC3986,formatters:{RFC1738:function(n){return e.call(n,i,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},q1}var H1,Ob;function p4(){if(Ob)return H1;Ob=1;var e=Nm(),i=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var h=[],P=0;P<256;++P)h.push("%"+((P<16?"0":"")+P.toString(16)).toUpperCase());return h}(),o=function(P){for(;P.length>1;){var g=P.pop(),v=g.obj[g.prop];if(t(v)){for(var y=[],O=0;O<v.length;++O)typeof v[O]<"u"&&y.push(v[O]);g.obj[g.prop]=y}}},l=function(P,g){for(var v=g&&g.plainObjects?{__proto__:null}:{},y=0;y<P.length;++y)typeof P[y]<"u"&&(v[y]=P[y]);return v},s=function h(P,g,v){if(!g)return P;if(typeof g!="object"&&typeof g!="function"){if(t(P))P.push(g);else if(P&&typeof P=="object")(v&&(v.plainObjects||v.allowPrototypes)||!i.call(Object.prototype,g))&&(P[g]=!0);else return[P,g];return P}if(!P||typeof P!="object")return[P].concat(g);var y=P;return t(P)&&!t(g)&&(y=l(P,v)),t(P)&&t(g)?(g.forEach(function(O,M){if(i.call(P,M)){var R=P[M];R&&typeof R=="object"&&O&&typeof O=="object"?P[M]=h(R,O,v):P.push(O)}else P[M]=O}),P):Object.keys(g).reduce(function(O,M){var R=g[M];return i.call(O,M)?O[M]=h(O[M],R,v):O[M]=R,O},y)},c=function(P,g){return Object.keys(g).reduce(function(v,y){return v[y]=g[y],v},P)},d=function(h,P,g){var v=h.replace(/\+/g," ");if(g==="iso-8859-1")return v.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(v)}catch{return v}},b=1024,w=function(P,g,v,y,O){if(P.length===0)return P;var M=P;if(typeof P=="symbol"?M=Symbol.prototype.toString.call(P):typeof P!="string"&&(M=String(P)),v==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function(k){return"%26%23"+parseInt(k.slice(2),16)+"%3B"});for(var R="",D=0;D<M.length;D+=b){for(var T=M.length>=b?M.slice(D,D+b):M,S=[],A=0;A<T.length;++A){var N=T.charCodeAt(A);if(N===45||N===46||N===95||N===126||N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122||O===e.RFC1738&&(N===40||N===41)){S[S.length]=T.charAt(A);continue}if(N<128){S[S.length]=n[N];continue}if(N<2048){S[S.length]=n[192|N>>6]+n[128|N&63];continue}if(N<55296||N>=57344){S[S.length]=n[224|N>>12]+n[128|N>>6&63]+n[128|N&63];continue}A+=1,N=65536+((N&1023)<<10|T.charCodeAt(A)&1023),S[S.length]=n[240|N>>18]+n[128|N>>12&63]+n[128|N>>6&63]+n[128|N&63]}R+=S.join("")}return R},E=function(P){for(var g=[{obj:{o:P},prop:"o"}],v=[],y=0;y<g.length;++y)for(var O=g[y],M=O.obj[O.prop],R=Object.keys(M),D=0;D<R.length;++D){var T=R[D],S=M[T];typeof S=="object"&&S!==null&&v.indexOf(S)===-1&&(g.push({obj:M,prop:T}),v.push(S))}return o(g),P},x=function(P){return Object.prototype.toString.call(P)==="[object RegExp]"},m=function(P){return!P||typeof P!="object"?!1:!!(P.constructor&&P.constructor.isBuffer&&P.constructor.isBuffer(P))},_=function(P,g){return[].concat(P,g)},p=function(P,g){if(t(P)){for(var v=[],y=0;y<P.length;y+=1)v.push(g(P[y]));return v}return g(P)};return H1={arrayToObject:l,assign:c,combine:_,compact:E,decode:d,encode:w,isBuffer:m,isRegExp:x,maybeMap:p,merge:s},H1}var G1,xb;function ax(){if(xb)return G1;xb=1;var e=ix(),i=p4(),t=Nm(),n=Object.prototype.hasOwnProperty,o={brackets:function(h){return h+"[]"},comma:"comma",indices:function(h,P){return h+"["+P+"]"},repeat:function(h){return h}},l=Array.isArray,s=Array.prototype.push,c=function(p,h){s.apply(p,l(h)?h:[h])},d=Date.prototype.toISOString,b=t.default,w={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:i.encode,encodeValuesOnly:!1,filter:void 0,format:b,formatter:t.formatters[b],indices:!1,serializeDate:function(h){return d.call(h)},skipNulls:!1,strictNullHandling:!1},E=function(h){return typeof h=="string"||typeof h=="number"||typeof h=="boolean"||typeof h=="symbol"||typeof h=="bigint"},x={},m=function p(h,P,g,v,y,O,M,R,D,T,S,A,N,k,L,B,X,K){for(var Q=h,H=K,z=0,I=!1;(H=H.get(x))!==void 0&&!I;){var U=H.get(h);if(z+=1,typeof U<"u"){if(U===z)throw new RangeError("Cyclic object value");I=!0}typeof H.get(x)>"u"&&(z=0)}if(typeof T=="function"?Q=T(P,Q):Q instanceof Date?Q=N(Q):g==="comma"&&l(Q)&&(Q=i.maybeMap(Q,function(Oe){return Oe instanceof Date?N(Oe):Oe})),Q===null){if(O)return D&&!B?D(P,w.encoder,X,"key",k):P;Q=""}if(E(Q)||i.isBuffer(Q)){if(D){var $=B?P:D(P,w.encoder,X,"key",k);return[L($)+"="+L(D(Q,w.encoder,X,"value",k))]}return[L(P)+"="+L(String(Q))]}var ee=[];if(typeof Q>"u")return ee;var G;if(g==="comma"&&l(Q))B&&D&&(Q=i.maybeMap(Q,D)),G=[{value:Q.length>0?Q.join(",")||null:void 0}];else if(l(T))G=T;else{var Z=Object.keys(Q);G=S?Z.sort(S):Z}var W=R?String(P).replace(/\./g,"%2E"):String(P),te=v&&l(Q)&&Q.length===1?W+"[]":W;if(y&&l(Q)&&Q.length===0)return te+"[]";for(var re=0;re<G.length;++re){var ie=G[re],oe=typeof ie=="object"&&ie&&typeof ie.value<"u"?ie.value:Q[ie];if(!(M&&oe===null)){var se=A&&R?String(ie).replace(/\./g,"%2E"):String(ie),de=l(Q)?typeof g=="function"?g(te,se):te:te+(A?"."+se:"["+se+"]");K.set(h,z);var pe=e();pe.set(x,K),c(ee,p(oe,de,g,v,y,O,M,R,g==="comma"&&B&&l(Q)?null:D,T,S,A,N,k,L,B,X,pe))}}return ee},_=function(h){if(!h)return w;if(typeof h.allowEmptyArrays<"u"&&typeof h.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof h.encodeDotInKeys<"u"&&typeof h.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(h.encoder!==null&&typeof h.encoder<"u"&&typeof h.encoder!="function")throw new TypeError("Encoder has to be a function.");var P=h.charset||w.charset;if(typeof h.charset<"u"&&h.charset!=="utf-8"&&h.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var g=t.default;if(typeof h.format<"u"){if(!n.call(t.formatters,h.format))throw new TypeError("Unknown format option provided.");g=h.format}var v=t.formatters[g],y=w.filter;(typeof h.filter=="function"||l(h.filter))&&(y=h.filter);var O;if(h.arrayFormat in o?O=h.arrayFormat:"indices"in h?O=h.indices?"indices":"repeat":O=w.arrayFormat,"commaRoundTrip"in h&&typeof h.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var M=typeof h.allowDots>"u"?h.encodeDotInKeys===!0?!0:w.allowDots:!!h.allowDots;return{addQueryPrefix:typeof h.addQueryPrefix=="boolean"?h.addQueryPrefix:w.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof h.allowEmptyArrays=="boolean"?!!h.allowEmptyArrays:w.allowEmptyArrays,arrayFormat:O,charset:P,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:w.charsetSentinel,commaRoundTrip:!!h.commaRoundTrip,delimiter:typeof h.delimiter>"u"?w.delimiter:h.delimiter,encode:typeof h.encode=="boolean"?h.encode:w.encode,encodeDotInKeys:typeof h.encodeDotInKeys=="boolean"?h.encodeDotInKeys:w.encodeDotInKeys,encoder:typeof h.encoder=="function"?h.encoder:w.encoder,encodeValuesOnly:typeof h.encodeValuesOnly=="boolean"?h.encodeValuesOnly:w.encodeValuesOnly,filter:y,format:g,formatter:v,serializeDate:typeof h.serializeDate=="function"?h.serializeDate:w.serializeDate,skipNulls:typeof h.skipNulls=="boolean"?h.skipNulls:w.skipNulls,sort:typeof h.sort=="function"?h.sort:null,strictNullHandling:typeof h.strictNullHandling=="boolean"?h.strictNullHandling:w.strictNullHandling}};return G1=function(p,h){var P=p,g=_(h),v,y;typeof g.filter=="function"?(y=g.filter,P=y("",P)):l(g.filter)&&(y=g.filter,v=y);var O=[];if(typeof P!="object"||P===null)return"";var M=o[g.arrayFormat],R=M==="comma"&&g.commaRoundTrip;v||(v=Object.keys(P)),g.sort&&v.sort(g.sort);for(var D=e(),T=0;T<v.length;++T){var S=v[T],A=P[S];g.skipNulls&&A===null||c(O,m(A,S,M,R,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,D))}var N=O.join(g.delimiter),k=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?k+="utf8=%26%2310003%3B&":k+="utf8=%E2%9C%93&"),N.length>0?k+N:""},G1}var V1,Pb;function ox(){if(Pb)return V1;Pb=1;var e=p4(),i=Object.prototype.hasOwnProperty,t=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,strictDepth:!1,strictNullHandling:!1},o=function(x){return x.replace(/&#(\d+);/g,function(m,_){return String.fromCharCode(parseInt(_,10))})},l=function(x,m){return x&&typeof x=="string"&&m.comma&&x.indexOf(",")>-1?x.split(","):x},s="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",d=function(m,_){var p={__proto__:null},h=_.ignoreQueryPrefix?m.replace(/^\?/,""):m;h=h.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var P=_.parameterLimit===1/0?void 0:_.parameterLimit,g=h.split(_.delimiter,P),v=-1,y,O=_.charset;if(_.charsetSentinel)for(y=0;y<g.length;++y)g[y].indexOf("utf8=")===0&&(g[y]===c?O="utf-8":g[y]===s&&(O="iso-8859-1"),v=y,y=g.length);for(y=0;y<g.length;++y)if(y!==v){var M=g[y],R=M.indexOf("]="),D=R===-1?M.indexOf("="):R+1,T,S;D===-1?(T=_.decoder(M,n.decoder,O,"key"),S=_.strictNullHandling?null:""):(T=_.decoder(M.slice(0,D),n.decoder,O,"key"),S=e.maybeMap(l(M.slice(D+1),_),function(N){return _.decoder(N,n.decoder,O,"value")})),S&&_.interpretNumericEntities&&O==="iso-8859-1"&&(S=o(String(S))),M.indexOf("[]=")>-1&&(S=t(S)?[S]:S);var A=i.call(p,T);A&&_.duplicates==="combine"?p[T]=e.combine(p[T],S):(!A||_.duplicates==="last")&&(p[T]=S)}return p},b=function(x,m,_,p){for(var h=p?m:l(m,_),P=x.length-1;P>=0;--P){var g,v=x[P];if(v==="[]"&&_.parseArrays)g=_.allowEmptyArrays&&(h===""||_.strictNullHandling&&h===null)?[]:[].concat(h);else{g=_.plainObjects?{__proto__:null}:{};var y=v.charAt(0)==="["&&v.charAt(v.length-1)==="]"?v.slice(1,-1):v,O=_.decodeDotInKeys?y.replace(/%2E/g,"."):y,M=parseInt(O,10);!_.parseArrays&&O===""?g={0:h}:!isNaN(M)&&v!==O&&String(M)===O&&M>=0&&_.parseArrays&&M<=_.arrayLimit?(g=[],g[M]=h):O!=="__proto__"&&(g[O]=h)}h=g}return h},w=function(m,_,p,h){if(m){var P=p.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,g=/(\[[^[\]]*])/,v=/(\[[^[\]]*])/g,y=p.depth>0&&g.exec(P),O=y?P.slice(0,y.index):P,M=[];if(O){if(!p.plainObjects&&i.call(Object.prototype,O)&&!p.allowPrototypes)return;M.push(O)}for(var R=0;p.depth>0&&(y=v.exec(P))!==null&&R<p.depth;){if(R+=1,!p.plainObjects&&i.call(Object.prototype,y[1].slice(1,-1))&&!p.allowPrototypes)return;M.push(y[1])}if(y){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");M.push("["+P.slice(y.index)+"]")}return b(M,_,p,h)}},E=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var _=typeof m.charset>"u"?n.charset:m.charset,p=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(p!=="combine"&&p!=="first"&&p!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var h=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:h,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:_,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||e.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:p,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return V1=function(x,m){var _=E(m);if(x===""||x===null||typeof x>"u")return _.plainObjects?{__proto__:null}:{};for(var p=typeof x=="string"?d(x,_):x,h=_.plainObjects?{__proto__:null}:{},P=Object.keys(p),g=0;g<P.length;++g){var v=P[g],y=w(v,p[v],_,typeof x=="string");h=e.merge(h,y,_)}return _.allowSparse===!0?h:e.compact(h)},V1}var $1,Cb;function lx(){if(Cb)return $1;Cb=1;var e=ax(),i=ox(),t=Nm();return $1={formats:t,parse:i,stringify:e},$1}var kb;function g4(){if(kb)return js;kb=1;var e=RO();function i(){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 t=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["<",">",'"',"`"," ","\r",`
152
+ `," "],s=["{","}","|","\\","^","`"].concat(l),c=["'"].concat(s),d=["%","/","?",";","#"].concat(c),b=["/","?","#"],w=255,E=/^[+a-z0-9A-Z_-]{0,63}$/,x=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},h=lx();function P(O,M,R){if(O&&typeof O=="object"&&O instanceof i)return O;var D=new i;return D.parse(O,M,R),D}i.prototype.parse=function(O,M,R){if(typeof O!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof O);var D=O.indexOf("?"),T=D!==-1&&D<O.indexOf("#")?"?":"#",S=O.split(T),A=/\\/g;S[0]=S[0].replace(A,"/"),O=S.join(T);var N=O;if(N=N.trim(),!R&&O.split("#").length===1){var k=o.exec(N);if(k)return this.path=N,this.href=N,this.pathname=k[1],k[2]?(this.search=k[2],M?this.query=h.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var L=t.exec(N);if(L){L=L[0];var B=L.toLowerCase();this.protocol=B,N=N.substr(L.length)}if(R||L||N.match(/^\/\/[^@/]+@[^@/]+/)){var X=N.substr(0,2)==="//";X&&!(L&&_[L])&&(N=N.substr(2),this.slashes=!0)}if(!_[L]&&(X||L&&!p[L])){for(var K=-1,Q=0;Q<b.length;Q++){var H=N.indexOf(b[Q]);H!==-1&&(K===-1||H<K)&&(K=H)}var z,I;K===-1?I=N.lastIndexOf("@"):I=N.lastIndexOf("@",K),I!==-1&&(z=N.slice(0,I),N=N.slice(I+1),this.auth=decodeURIComponent(z)),K=-1;for(var Q=0;Q<d.length;Q++){var H=N.indexOf(d[Q]);H!==-1&&(K===-1||H<K)&&(K=H)}K===-1&&(K=N.length),this.host=N.slice(0,K),N=N.slice(K),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U)for(var $=this.hostname.split(/\./),Q=0,ee=$.length;Q<ee;Q++){var G=$[Q];if(G&&!G.match(E)){for(var Z="",W=0,te=G.length;W<te;W++)G.charCodeAt(W)>127?Z+="x":Z+=G[W];if(!Z.match(E)){var re=$.slice(0,Q),ie=$.slice(Q+1),oe=G.match(x);oe&&(re.push(oe[1]),ie.unshift(oe[2])),ie.length&&(N="/"+ie.join(".")+N),this.hostname=re.join(".");break}}}this.hostname.length>w?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=e.toASCII(this.hostname));var se=this.port?":"+this.port:"",de=this.hostname||"";this.host=de+se,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),N[0]!=="/"&&(N="/"+N))}if(!m[B])for(var Q=0,ee=c.length;Q<ee;Q++){var pe=c[Q];if(N.indexOf(pe)!==-1){var Oe=encodeURIComponent(pe);Oe===pe&&(Oe=escape(pe)),N=N.split(pe).join(Oe)}}var _e=N.indexOf("#");_e!==-1&&(this.hash=N.substr(_e),N=N.slice(0,_e));var Te=N.indexOf("?");if(Te!==-1?(this.search=N.substr(Te),this.query=N.substr(Te+1),M&&(this.query=h.parse(this.query)),N=N.slice(0,Te)):M&&(this.search="",this.query={}),N&&(this.pathname=N),p[B]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var se=this.pathname||"",ce=this.search||"";this.path=se+ce}return this.href=this.format(),this};function g(O){return typeof O=="string"&&(O=P(O)),O instanceof i?O.format():i.prototype.format.call(O)}i.prototype.format=function(){var O=this.auth||"";O&&(O=encodeURIComponent(O),O=O.replace(/%3A/i,":"),O+="@");var M=this.protocol||"",R=this.pathname||"",D=this.hash||"",T=!1,S="";this.host?T=O+this.host:this.hostname&&(T=O+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(T+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(S=h.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var A=this.search||S&&"?"+S||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||p[M])&&T!==!1?(T="//"+(T||""),R&&R.charAt(0)!=="/"&&(R="/"+R)):T||(T=""),D&&D.charAt(0)!=="#"&&(D="#"+D),A&&A.charAt(0)!=="?"&&(A="?"+A),R=R.replace(/[?#]/g,function(N){return encodeURIComponent(N)}),A=A.replace("#","%23"),M+T+R+A+D};function v(O,M){return P(O,!1,!0).resolve(M)}i.prototype.resolve=function(O){return this.resolveObject(P(O,!1,!0)).format()};function y(O,M){return O?P(O,!1,!0).resolveObject(M):M}return i.prototype.resolveObject=function(O){if(typeof O=="string"){var M=new i;M.parse(O,!1,!0),O=M}for(var R=new i,D=Object.keys(this),T=0;T<D.length;T++){var S=D[T];R[S]=this[S]}if(R.hash=O.hash,O.href==="")return R.href=R.format(),R;if(O.slashes&&!O.protocol){for(var A=Object.keys(O),N=0;N<A.length;N++){var k=A[N];k!=="protocol"&&(R[k]=O[k])}return p[R.protocol]&&R.hostname&&!R.pathname&&(R.pathname="/",R.path=R.pathname),R.href=R.format(),R}if(O.protocol&&O.protocol!==R.protocol){if(!p[O.protocol]){for(var L=Object.keys(O),B=0;B<L.length;B++){var X=L[B];R[X]=O[X]}return R.href=R.format(),R}if(R.protocol=O.protocol,!O.host&&!_[O.protocol]){for(var ee=(O.pathname||"").split("/");ee.length&&!(O.host=ee.shift()););O.host||(O.host=""),O.hostname||(O.hostname=""),ee[0]!==""&&ee.unshift(""),ee.length<2&&ee.unshift(""),R.pathname=ee.join("/")}else R.pathname=O.pathname;if(R.search=O.search,R.query=O.query,R.host=O.host||"",R.auth=O.auth,R.hostname=O.hostname||O.host,R.port=O.port,R.pathname||R.search){var K=R.pathname||"",Q=R.search||"";R.path=K+Q}return R.slashes=R.slashes||O.slashes,R.href=R.format(),R}var H=R.pathname&&R.pathname.charAt(0)==="/",z=O.host||O.pathname&&O.pathname.charAt(0)==="/",I=z||H||R.host&&O.pathname,U=I,$=R.pathname&&R.pathname.split("/")||[],ee=O.pathname&&O.pathname.split("/")||[],G=R.protocol&&!p[R.protocol];if(G&&(R.hostname="",R.port=null,R.host&&($[0]===""?$[0]=R.host:$.unshift(R.host)),R.host="",O.protocol&&(O.hostname=null,O.port=null,O.host&&(ee[0]===""?ee[0]=O.host:ee.unshift(O.host)),O.host=null),I=I&&(ee[0]===""||$[0]==="")),z)R.host=O.host||O.host===""?O.host:R.host,R.hostname=O.hostname||O.hostname===""?O.hostname:R.hostname,R.search=O.search,R.query=O.query,$=ee;else if(ee.length)$||($=[]),$.pop(),$=$.concat(ee),R.search=O.search,R.query=O.query;else if(O.search!=null){if(G){R.host=$.shift(),R.hostname=R.host;var Z=R.host&&R.host.indexOf("@")>0?R.host.split("@"):!1;Z&&(R.auth=Z.shift(),R.hostname=Z.shift(),R.host=R.hostname)}return R.search=O.search,R.query=O.query,(R.pathname!==null||R.search!==null)&&(R.path=(R.pathname?R.pathname:"")+(R.search?R.search:"")),R.href=R.format(),R}if(!$.length)return R.pathname=null,R.search?R.path="/"+R.search:R.path=null,R.href=R.format(),R;for(var W=$.slice(-1)[0],te=(R.host||O.host||$.length>1)&&(W==="."||W==="..")||W==="",re=0,ie=$.length;ie>=0;ie--)W=$[ie],W==="."?$.splice(ie,1):W===".."?($.splice(ie,1),re++):re&&($.splice(ie,1),re--);if(!I&&!U)for(;re--;re)$.unshift("..");I&&$[0]!==""&&(!$[0]||$[0].charAt(0)!=="/")&&$.unshift(""),te&&$.join("/").substr(-1)!=="/"&&$.push("");var oe=$[0]===""||$[0]&&$[0].charAt(0)==="/";if(G){R.hostname=oe?"":$.length?$.shift():"",R.host=R.hostname;var Z=R.host&&R.host.indexOf("@")>0?R.host.split("@"):!1;Z&&(R.auth=Z.shift(),R.hostname=Z.shift(),R.host=R.hostname)}return I=I||R.host&&$.length,I&&!oe&&$.unshift(""),$.length>0?R.pathname=$.join("/"):(R.pathname=null,R.path=null),(R.pathname!==null||R.search!==null)&&(R.path=(R.pathname?R.pathname:"")+(R.search?R.search:"")),R.auth=O.auth||R.auth,R.slashes=R.slashes||O.slashes,R.href=R.format(),R},i.prototype.parseHost=function(){var O=this.host,M=n.exec(O);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),O=O.substr(0,O.length-M.length)),O&&(this.hostname=O)},js.parse=P,js.resolve=v,js.resolveObject=y,js.format=g,js.Url=i,js}var op={exports:{}},sx=op.exports,Ab;function ux(){return Ab||(Ab=1,function(e){(function(i,t){e.exports?e.exports=t():i.xmlserializer=t()})(sx,function(){var i=function(m){return m.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},t=function(m){return m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(m){return m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},o=function(m){var _=m.value;return" "+m.name+'="'+t(_)+'"'},l=function(m){var _=m.tagName;return m.namespaceURI==="http://www.w3.org/1999/xhtml"&&(_=_.toLowerCase()),_},s=function(m,_){var p=Array.prototype.map.call(m.attributes||m.attrs,function(h){return h.name}).indexOf("xmlns")>=0;return!p&&(_||m.namespaceURI!==m.parentNode.namespaceURI)?' xmlns="'+m.namespaceURI+'"':""},c=function(m){return Array.prototype.map.call(m.childNodes,function(_){return x(_)}).join("")},d=function(m,_){var p="<"+l(m);return p+=s(m,_),Array.prototype.forEach.call(m.attributes||m.attrs,function(h){p+=o(h)}),m.childNodes.length>0?(p+=">",p+=c(m),p+="</"+l(m)+">"):p+="/>",p},b=function(m){var _=m.nodeValue||m.value||"";return n(_)},w=function(m){return"<!--"+m.data.replace(/-/g,"&#45;")+"-->"},E=function(m){return"<![CDATA["+m.nodeValue+"]]>"},x=function(m,_){var p=_&&_.rootNode;if(m.nodeName==="#document"||m.nodeName==="#document-fragment")return c(m);if(m.tagName)return d(m,p);if(m.nodeName==="#text")return b(m);if(m.nodeName==="#comment")return w(m);if(m.nodeName==="#cdata-section")return E(m)};return{serializeToString:function(m){return i(x(m,{rootNode:!0}))}}})}(op)),op.exports}var W1={},Tb;function cx(){if(Tb)return W1;Tb=1;var e=function(l){var s=new XMLSerializer;return Array.prototype.map.call(l.childNodes,function(c){return s.serializeToString(c)}).join("")},i=function(l){if(l.documentElement.tagName==="parsererror"&&l.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return l.documentElement;if((l.documentElement.tagName==="xml"||l.documentElement.tagName==="html")&&l.documentElement.childNodes&&l.documentElement.childNodes.length>0&&l.documentElement.childNodes[0].nodeName==="parsererror")return l.documentElement.childNodes[0];if(l.documentElement.tagName==="html"&&l.documentElement.childNodes&&l.documentElement.childNodes.length>0&&l.documentElement.childNodes[0].nodeName==="body"&&l.documentElement.childNodes[0].childNodes&&l.documentElement.childNodes[0].childNodes.length&&l.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return l.documentElement.childNodes[0].childNodes[0]},t=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
153
+ ?</div>`),new RegExp(`^(.+)
154
+ `)],n=function(l){var s=e(l),c,d;for(c=0;c<t.length;c++)if(d=t[c].exec(s),d)return d[1]},o=function(l){var s;if(l===null)throw new Error("Parse error");var c=i(l);if(c!==void 0)throw s=n(c)||"Parse error",new Error(s)};return W1.failOnParseError=function(l){return o(l),l},W1}var Y1={},K1={},Rb;function Hp(){return Rb||(Rb=1,function(e){var i=g4();e.getDocumentBaseUrl=function(c){return c.baseURI!=="about:blank"?c.baseURI:null},e.clone=function(c){var d={},b;for(b in c)c.hasOwnProperty(b)&&(d[b]=c[b]);return d},e.cloneArray=function(c){return Array.prototype.slice.apply(c,[0])},e.joinUrl=function(c,d){return c?i.resolve(c,d):d},e.isDataUri=function(c){return/^data:/.test(c)},e.collectAndReportErrors=function(c){var d=[];return Promise.all(c.map(function(b){return b.catch(function(w){d.push(w)})})).then(function(){return d})};var t=null,n=function(c,d){return d===!1||d==="none"||d==="repeated"?((t===null||d!=="repeated")&&(t=Date.now()),c+"?_="+t):c};e.ajax=function(c,d){return new Promise(function(b,w){var E=new window.XMLHttpRequest,x=e.joinUrl(d.baseUrl,c),m,_=function(){w({msg:"Unable to load url",url:x})};m=n(x,d.cache),E.addEventListener("load",function(){E.status===200||E.status===0?b(E.response):_()},!1),E.addEventListener("error",_,!1);try{E.open("GET",m,!0),E.overrideMimeType(d.mimeType),E.send(null)}catch{_()}})},e.binaryAjax=function(c,d){var b=e.clone(d);return b.mimeType="text/plain; charset=x-user-defined",e.ajax(c,b).then(function(w){for(var E="",x=0;x<w.length;x++)E+=String.fromCharCode(w.charCodeAt(x)&255);return E})};var o=function(c){var d=function(b,w){return b.substring(0,w.length)===w};return d(c,"<?xml")||d(c,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(c,d){return e.binaryAjax(c,d).then(function(b){var w=btoa(b),E=o(b);return"data:"+E+";base64,"+w})};var l=[],s=function(c){return l.indexOf(c)<0&&l.push(c),l.indexOf(c)};e.memoize=function(c,d,b){if(typeof b!="object")throw new Error("cacheBucket is not an object");return function(){var w=Array.prototype.slice.call(arguments),E=d(w),x=s(c),m;return b[x]&&b[x][E]?b[x][E]:(m=c.apply(null,w),b[x]=b[x]||{},b[x][E]=m,m)}}}(K1)),K1}var X1={},Mb;function fx(){if(Mb)return X1;Mb=1;var e=Hp(),i=function(l,s){var c=null;l.hasAttribute("src")?c=l.getAttribute("src"):l.hasAttributeNS("http://www.w3.org/1999/xlink","href")?c=l.getAttributeNS("http://www.w3.org/1999/xlink","href"):l.hasAttribute("href")&&(c=l.getAttribute("href"));var d=e.getDocumentBaseUrl(l.ownerDocument),b=e.clone(s);return!b.baseUrl&&d&&(b.baseUrl=d),e.getDataURIForImageURL(c,b).then(function(w){return w},function(w){throw{resourceType:"image",url:w.url,msg:"Unable to load image "+w.url}})},t=function(l){return l.filter(function(s){var c=null;return s.hasAttribute("src")?c=s.getAttribute("src"):s.hasAttributeNS("http://www.w3.org/1999/xlink","href")?c=s.getAttributeNS("http://www.w3.org/1999/xlink","href"):s.hasAttribute("href")&&(c=s.getAttribute("href")),c!==null&&!e.isDataUri(c)})},n=function(l){return Array.prototype.filter.call(l,function(s){return s.type==="image"})},o=function(l){return Array.prototype.slice.call(l)};return X1.inline=function(l,s){var c=o(l.getElementsByTagName("img")),d=o(l.getElementsByTagName("image")),b=n(l.getElementsByTagName("input"));c=c.concat(d),c=c.concat(b);var w=t(c);return e.collectAndReportErrors(w.map(function(E){return i(E,s).then(function(x){E.attributes.src?E.attributes.src.value=x:E.attributes["xlink:href"]?E.attributes["xlink:href"].value=x:E.attributes.href&&(E.attributes.href.value=x)})}))},X1}var Z1={},Lb;function dx(){if(Lb)return Z1;Lb=1;var e=Hp(),i=function(l,s){var c=l.attributes.src.value,d=e.getDocumentBaseUrl(l.ownerDocument),b=e.clone(s);return!b.baseUrl&&d&&(b.baseUrl=d),e.ajax(c,b).catch(function(w){throw{resourceType:"script",url:w.url,msg:"Unable to load script "+w.url}})},t=function(l){return l.replace(/<\//g,"<\\/")},n=function(l,s){l.attributes.removeNamedItem("src"),l.textContent=t(s)},o=function(l){var s=l.getElementsByTagName("script");return Array.prototype.filter.call(s,function(c){return!!c.attributes.src})};return Z1.inline=function(l,s){var c=o(l);return e.collectAndReportErrors(c.map(function(d){return i(d,s).then(function(b){n(d,b)})}))},Z1}var Q1={},J1={},Nb;function Im(){return Nb||(Nb=1,function(e){e.unquoteString=function(i){var t=/^"(.*)"$/,n=/^'(.*)'$/;return t.test(i)?i.replace(t,"$1"):n.test(i)?i.replace(n,"$1"):i},e.rulesForCssText=function(i){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style"),o;return n.textContent=i,t.body.appendChild(n),o=n.sheet.cssRules,Array.prototype.slice.call(o)},e.cssRulesToText=function(i){return i.reduce(function(t,n){return t+n.cssText},"")},e.exchangeRule=function(i,t,n){var o=i.indexOf(t);i[o]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(i,t,n){var o="@font-face { font-family: "+t.style.getPropertyValue("font-family")+"; ";t.style.getPropertyValue("font-style")&&(o+="font-style: "+t.style.getPropertyValue("font-style")+"; "),t.style.getPropertyValue("font-weight")&&(o+="font-weight: "+t.style.getPropertyValue("font-weight")+"; "),t.style.getPropertyValue("unicode-range")&&(o+="unicode-range: "+t.style.getPropertyValue("unicode-range")+"; "),o+="src: "+n+"}",e.exchangeRule(i,t,o)}}(J1)),J1}var e0={},Ib;function hx(){return Ib||(Ib=1,function(e){var i=Im(),t=function(l){var s=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(s,"$1")};e.extractCssUrl=function(l){var s=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,c;if(!s.test(l))throw new Error("Invalid url");return c=s.exec(l)[1],i.unquoteString(t(c))};var n=function(l){var s=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,c="(url\\("+s+"\\)|[^,\\s]+)",d="(?:\\s*"+c+")+",b="^\\s*("+d+")(?:\\s*,\\s*("+d+"))*\\s*$",w=new RegExp(d,"g"),E,x=[],m=function(_){var p=new RegExp(c,"g"),h=[],P;for(P=p.exec(_);P;)h.push(P[1]),P=p.exec(_);return h};if(l.match(new RegExp(b))){for(E=w.exec(l);E;)x.push(m(E[0])),E=w.exec(l);return x}return[]},o=function(l){var s,c;for(s=0;s<l.length;s++)try{return c=e.extractCssUrl(l[s]),{url:c,idx:s}}catch{}};e.parse=function(l){var s=n(l);return s.map(function(c){var d=o(c);return d?{preUrl:c.slice(0,d.idx),url:d.url,postUrl:c.slice(d.idx+1)}:{preUrl:c}})},e.serialize=function(l){var s=l.map(function(c){var d=[].concat(c.preUrl);return c.url&&d.push('url("'+c.url+'")'),c.postUrl&&(d=d.concat(c.postUrl)),d.join(" ")});return s.join(", ")}}(e0)),e0}function ep(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 t0={exports:{}},Db;function px(){return Db||(Db=1,function(e,i){(function(t){e.exports=t()})(function(){return function t(n,o,l){function s(b,w){if(!o[b]){if(!n[b]){var E=typeof ep=="function"&&ep;if(!w&&E)return E(b,!0);if(c)return c(b,!0);var x=new Error("Cannot find module '"+b+"'");throw x.code="MODULE_NOT_FOUND",x}var m=o[b]={exports:{}};n[b][0].call(m.exports,function(_){var p=n[b][1][_];return s(p||_)},m,m.exports,t,n,o,l)}return o[b].exports}for(var c=typeof ep=="function"&&ep,d=0;d<l.length;d++)s(l[d]);return s}({1:[function(t,n,o){function l(d,b){function w(){this.constructor=d}w.prototype=b.prototype,d.prototype=new w}function s(d,b,w,E){this.message=d,this.expected=b,this.found=w,this.location=E,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,s)}l(s,Error),s.buildMessage=function(d,b){var w={literal:function(P){return'"'+x(P.text)+'"'},class:function(P){var g="",v;for(v=0;v<P.parts.length;v++)g+=P.parts[v]instanceof Array?m(P.parts[v][0])+"-"+m(P.parts[v][1]):m(P.parts[v]);return"["+(P.inverted?"^":"")+g+"]"},any:function(P){return"any character"},end:function(P){return"end of input"},other:function(P){return P.description}};function E(P){return P.charCodeAt(0).toString(16).toUpperCase()}function x(P){return P.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(g){return"\\x0"+E(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+E(g)})}function m(P){return P.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(g){return"\\x0"+E(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+E(g)})}function _(P){return w[P.type](P)}function p(P){var g=new Array(P.length),v,y;for(v=0;v<P.length;v++)g[v]=_(P[v]);if(g.sort(),g.length>0){for(v=1,y=1;v<g.length;v++)g[v-1]!==g[v]&&(g[y]=g[v],y++);g.length=y}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function h(P){return P?'"'+x(P)+'"':"end of input"}return"Expected "+p(d)+" but "+h(b)+" found."};function c(d,b){b=b!==void 0?b:{};var w={},E={start:se},x=se,m="",_=function(){return[]},p=",",h=G(",",!1),P=function(ue,me){return[ue].concat(me)},g=function(ue){return[ue]},v=function(ue,me){return{url:ue,format:me}},y=function(ue){return{url:ue}},O="url(",M=G("url(",!1),R=")",D=G(")",!1),T=function(ue){return ue},S="format(",A=G("format(",!1),N="local(",k=G("local(",!1),L=function(ue){return{local:ue}},B=/^[^)]/,X=Z([")"],!0,!1),K=function(ue){return Le.extractValue(ue.join(""))},Q=/^[ \t\r\n\f]/,H=Z([" "," ","\r",`
155
+ `,"\f"],!1,!1),z=0,I=[{line:1,column:1}],U=0,$=[],ee;if("startRule"in b){if(!(b.startRule in E))throw new Error(`Can't start parsing from rule "`+b.startRule+'".');x=E[b.startRule]}function G(ue,me){return{type:"literal",text:ue,ignoreCase:me}}function Z(ue,me,xe){return{type:"class",parts:ue,inverted:me,ignoreCase:xe}}function W(){return{type:"end"}}function te(ue){var me=I[ue],xe;if(me)return me;for(xe=ue-1;!I[xe];)xe--;for(me=I[xe],me={line:me.line,column:me.column};xe<ue;)d.charCodeAt(xe)===10?(me.line++,me.column=1):me.column++,xe++;return I[ue]=me,me}function re(ue,me){var xe=te(ue),je=te(me);return{start:{offset:ue,line:xe.line,column:xe.column},end:{offset:me,line:je.line,column:je.column}}}function ie(ue){z<U||(z>U&&(U=z,$=[]),$.push(ue))}function oe(ue,me,xe){return new s(s.buildMessage(ue,me),ue,me,xe)}function se(){var ue,me;return ue=de(),ue===w&&(ue=z,me=m,me!==w&&(me=_()),ue=me),ue}function de(){var ue,me,xe,je,ot,ht;if(ue=z,me=pe(),me!==w){for(xe=[],je=Ce();je!==w;)xe.push(je),je=Ce();if(xe!==w)if(d.charCodeAt(z)===44?(je=p,z++):(je=w,ie(h)),je!==w){for(ot=[],ht=Ce();ht!==w;)ot.push(ht),ht=Ce();ot!==w?(ht=de(),ht!==w?(me=P(me,ht),ue=me):(z=ue,ue=w)):(z=ue,ue=w)}else z=ue,ue=w;else z=ue,ue=w}else z=ue,ue=w;return ue===w&&(ue=z,me=pe(),me!==w&&(me=g(me)),ue=me),ue}function pe(){var ue;return ue=Oe(),ue===w&&(ue=ce()),ue}function Oe(){var ue,me,xe,je;if(ue=z,me=_e(),me!==w){if(xe=[],je=Ce(),je!==w)for(;je!==w;)xe.push(je),je=Ce();else xe=w;xe!==w?(je=Te(),je!==w?(me=v(me,je),ue=me):(z=ue,ue=w)):(z=ue,ue=w)}else z=ue,ue=w;return ue===w&&(ue=z,me=_e(),me!==w&&(me=y(me)),ue=me),ue}function _e(){var ue,me,xe,je;return ue=z,d.substr(z,4)===O?(me=O,z+=4):(me=w,ie(M)),me!==w?(xe=he(),xe!==w?(d.charCodeAt(z)===41?(je=R,z++):(je=w,ie(D)),je!==w?(me=T(xe),ue=me):(z=ue,ue=w)):(z=ue,ue=w)):(z=ue,ue=w),ue}function Te(){var ue,me,xe,je;return ue=z,d.substr(z,7)===S?(me=S,z+=7):(me=w,ie(A)),me!==w?(xe=he(),xe!==w?(d.charCodeAt(z)===41?(je=R,z++):(je=w,ie(D)),je!==w?(me=T(xe),ue=me):(z=ue,ue=w)):(z=ue,ue=w)):(z=ue,ue=w),ue}function ce(){var ue,me,xe,je;return ue=z,d.substr(z,6)===N?(me=N,z+=6):(me=w,ie(k)),me!==w?(xe=he(),xe!==w?(d.charCodeAt(z)===41?(je=R,z++):(je=w,ie(D)),je!==w?(me=L(xe),ue=me):(z=ue,ue=w)):(z=ue,ue=w)):(z=ue,ue=w),ue}function he(){var ue,me,xe;if(ue=z,me=[],B.test(d.charAt(z))?(xe=d.charAt(z),z++):(xe=w,ie(X)),xe!==w)for(;xe!==w;)me.push(xe),B.test(d.charAt(z))?(xe=d.charAt(z),z++):(xe=w,ie(X));else me=w;return me!==w&&(me=K(me)),ue=me,ue}function Ce(){var ue;return Q.test(d.charAt(z))?(ue=d.charAt(z),z++):(ue=w,ie(H)),ue}var Le=t("../util");if(ee=x(),ee!==w&&z===d.length)return ee;throw ee!==w&&z<d.length&&ie(W()),oe($,U<d.length?d.charAt(U):null,U<d.length?re(U,U+1):re(U,U))}n.exports={SyntaxError:s,parse:c}},{"../util":3}],2:[function(t,n,o){var l=t("./grammar");o.SyntaxError=function(s,c){this.message=s,this.offset=c},o.parse=function(s){try{return l.parse(s)}catch(c){throw new o.SyntaxError(c.message,c.offset)}},o.serialize=function(s){return s.map(function(c){var d;return c.url?(d='url("'+c.url+'")',c.format&&(d+=' format("'+c.format+'")')):d='local("'+c.local+'")',d}).join(", ")}},{"./grammar":1}],3:[function(t,n,o){var l=function(c){var d=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return c.replace(d,"$1")},s=function(c){var d=/^"(.*)"$/,b=/^'(.*)'$/;return d.test(c)?c.replace(d,"$1"):b.test(c)?c.replace(b,"$1"):c};o.extractValue=function(c){return s(l(c))}},{}]},{},[2])(2)})}(t0)),t0.exports}var jb;function gx(){return jb||(jb=1,function(e){var i=Hp(),t=Im(),n=hx(),o=px(),l=function(g,v,y){g.style.setProperty(v,y,g.style.getPropertyPriority(v))},s=function(g){return g.filter(function(v){return v.type===window.CSSRule.STYLE_RULE&&(v.style.getPropertyValue("background-image")||v.style.getPropertyValue("background"))})},c=function(g){var v=[];return g.forEach(function(y){y.style.getPropertyValue("background-image")?v.push({property:"background-image",value:y.style.getPropertyValue("background-image"),rule:y}):y.style.getPropertyValue("background")&&v.push({property:"background",value:y.style.getPropertyValue("background"),rule:y})}),v},d=function(g){return g.filter(function(v){return v.type===window.CSSRule.FONT_FACE_RULE&&v.style.getPropertyValue("src")})},b=function(g){return g.filter(function(v){return v.type===window.CSSRule.IMPORT_RULE&&v.href})},w=function(g){var v=[];return g.forEach(function(y,O){y.url&&!i.isDataUri(y.url)&&v.push(O)}),v},E=function(g){var v=[];return g.forEach(function(y,O){y.url&&!i.isDataUri(y.url)&&v.push(O)}),v};e.adjustPathsOfCssResources=function(g,v){var y=s(v),O=c(y),M=!1;return O.forEach(function(R){var D=n.parse(R.value),T=w(D),S;T.length>0&&(T.forEach(function(A){var N=D[A].url,k=i.joinUrl(g,N);D[A].url=k}),S=n.serialize(D),l(R.rule,R.property,S),M=!0)}),d(v).forEach(function(R){var D=R.style.getPropertyValue("src"),T,S;try{T=o.parse(D)}catch{return}S=E(T),S.length>0&&(S.forEach(function(A){var N=T[A].url,k=i.joinUrl(g,N);T[A].url=k}),t.changeFontFaceRuleSrc(v,R,o.serialize(T)),M=!0)}),b(v).forEach(function(R){var D=R.href,T=i.joinUrl(g,D);t.exchangeRule(v,R,"@import url("+T+");"),M=!0}),M};var x=function(g,v,y){var O=g.indexOf(v);g.splice(O,1),y.forEach(function(M,R){g.splice(O+R,0,M)})},m=function(g,v,y,O){var M=v.href,R;return M=t.unquoteString(M),R=i.joinUrl(O.baseUrl,M),y.indexOf(R)>=0?(x(g,v,[]),Promise.resolve([])):(y.push(R),i.ajax(M,O).then(function(D){var T=t.rulesForCssText(D);return e.loadCSSImportsForRules(T,y,O).then(function(S){return e.adjustPathsOfCssResources(M,T),x(g,v,T),S.errors})},function(D){throw{resourceType:"stylesheet",url:D.url,msg:"Unable to load stylesheet "+D.url}}))};e.loadCSSImportsForRules=function(g,v,y){var O=b(g),M=[],R=!1;return Promise.all(O.map(function(D){return m(g,D,v,y).then(function(T){M=M.concat(T),R=!0},function(T){M.push(T)})})).then(function(){return{hasChanges:R,errors:M}})};var _=function(g,v){var y=n.parse(g),O=w(y),M=!1;return i.collectAndReportErrors(O.map(function(R){var D=y[R].url;return i.getDataURIForImageURL(D,v).then(function(T){y[R].url=T,M=!0},function(T){throw{resourceType:"backgroundImage",url:T.url,msg:"Unable to load background-image "+T.url}})})).then(function(R){return{backgroundValue:n.serialize(y),hasChanges:M,errors:R}})},p=function(g,v){var y=s(g),O=c(y),M=[],R=!1;return Promise.all(O.map(function(D){return _(D.value,v).then(function(T){T.hasChanges&&(l(D.rule,D.property,T.backgroundValue),R=!0),M=M.concat(T.errors)})})).then(function(){return{hasChanges:R,errors:M}})},h=function(g,v){var y=!1,O,M;try{O=o.parse(g)}catch{O=[]}return M=E(O),i.collectAndReportErrors(M.map(function(R){var D=O[R],T=D.format||"woff";return i.binaryAjax(D.url,v).then(function(S){var A=btoa(S);D.url="data:font/"+T+";base64,"+A,y=!0},function(S){throw{resourceType:"fontFace",url:S.url,msg:"Unable to load font-face "+S.url}})})).then(function(R){return{srcDeclarationValue:o.serialize(O),hasChanges:y,errors:R}})},P=function(g,v){var y=d(g),O=[],M=!1;return Promise.all(y.map(function(R){var D=R.style.getPropertyValue("src");return h(D,v).then(function(T){T.hasChanges&&(t.changeFontFaceRuleSrc(g,R,T.srcDeclarationValue),M=!0),O=O.concat(T.errors)})})).then(function(){return{hasChanges:M,errors:O}})};e.loadAndInlineCSSResourcesForRules=function(g,v){var y=!1,O=[];return Promise.all([p,P].map(function(M){return M(g,v).then(function(R){y=y||R.hasChanges,O=O.concat(R.errors)})})).then(function(){return{hasChanges:y,errors:O}})}}(Q1)),Q1}var Fb;function mx(){return Fb||(Fb=1,function(e){var i=Hp(),t=fx(),n=dx(),o=gx(),l=Im(),s=function(h){return i.joinUrl(h,".")},c=function(h){var P=h.map(function(g,v){return v===h.length-1&&(g={baseUrl:s(g.baseUrl)}),JSON.stringify(g)});return P},d=function(h,P){return P.cache!==!1&&P.cache!=="none"&&P.cacheBucket?i.memoize(h,c,P.cacheBucket):h},b=function(h,P,g){var v=l.rulesForCssText(h);return o.loadCSSImportsForRules(v,P,g).then(function(y){return o.loadAndInlineCSSResourcesForRules(v,g).then(function(O){var M=y.errors.concat(O.errors),R=y.hasChanges||O.hasChanges;return R&&(h=l.cssRulesToText(v)),{hasChanges:R,content:h,errors:M}})})},w=function(h,P,g){var v=h.textContent,y=d(b,P);return y(v,g,P).then(function(O){return O.hasChanges&&(h.childNodes[0].nodeValue=O.content),i.cloneArray(O.errors)})},E=function(h){var P=h.getElementsByTagName("style");return Array.prototype.filter.call(P,function(g){return!g.attributes.type||g.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(h,P){var g=E(h),v=[],y=[],O;return O=i.clone(P),O.baseUrl=O.baseUrl||i.getDocumentBaseUrl(h),Promise.all(g.map(function(M){return w(M,O,y).then(function(R){v=v.concat(R)})})).then(function(){return v})};var x=function(h,P){var g=h.parentNode,v;P=P.trim(),P&&(v=h.ownerDocument.createElement("style"),v.type="text/css",v.appendChild(h.ownerDocument.createTextNode(P)),g.insertBefore(v,h)),g.removeChild(h)},m=function(h,P){return i.ajax(h,P).then(function(g){var v=l.rulesForCssText(g);return{content:g,cssRules:v}}).then(function(g){var v=o.adjustPathsOfCssResources(h,g.cssRules);return{content:g.content,cssRules:g.cssRules,hasChanges:v}}).then(function(g){return o.loadCSSImportsForRules(g.cssRules,[],P).then(function(v){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||v.hasChanges,errors:v.errors}})}).then(function(g){return o.loadAndInlineCSSResourcesForRules(g.cssRules,P).then(function(v){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||v.hasChanges,errors:g.errors.concat(v.errors)}})}).then(function(g){var v=g.content;return g.hasChanges&&(v=l.cssRulesToText(g.cssRules)),{content:v,errors:g.errors}})},_=function(h,P){var g=h.attributes.href.value,v=i.getDocumentBaseUrl(h.ownerDocument),y=i.clone(P);!y.baseUrl&&v&&(y.baseUrl=v);var O=d(m,P);return O(g,y).then(function(M){return{content:M.content,errors:i.cloneArray(M.errors)}})},p=function(h){var P=h.getElementsByTagName("link");return Array.prototype.filter.call(P,function(g){return g.attributes.rel&&g.attributes.rel.value==="stylesheet"&&(!g.attributes.type||g.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(h,P){var g=p(h),v=[];return Promise.all(g.map(function(y){return _(y,P).then(function(O){x(y,O.content+`
156
+ `),v=v.concat(O.errors)},function(O){v.push({resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url})})})).then(function(){return v})},e.loadAndInlineImages=t.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(h,P){var g=[],v=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return P.inlineScripts!==!1&&v.push(e.loadAndInlineScript),Promise.all(v.map(function(y){return y(h,P).then(function(O){g=g.concat(O)})})).then(function(){return g})}}(Y1)),Y1}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
157
+ * http://www.github.com/cburgmer/rasterizeHTML.js
158
+ * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var vx=ap.exports,zb;function yx(){return zb||(zb=1,function(e){(function(i,t){i===void 0&&window!==void 0&&(i=window),e.exports?e.exports=t(g4(),ux(),cx(),mx()):i.rasterizeHTML=t(i.url,i.xmlserializer,i.sanedomparsererror,i.inlineresources)})(vx,function(i,t,n,o){var l=function(_){var p={},h=[];p.joinUrl=function(v,y){return v?_.resolve(v,y):y},p.getConstantUniqueIdFor=function(v){return h.indexOf(v)<0&&h.push(v),h.indexOf(v)},p.clone=function(v){var y={},O;for(O in v)v.hasOwnProperty(O)&&(y[O]=v[O]);return y};var P=function(v){return typeof v=="object"&&v!==null},g=function(v){return P(v)&&Object.prototype.toString.apply(v).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return p.parseOptionalParameters=function(v){var y={canvas:null,options:{}};return v[0]==null||g(v[0])?(y.canvas=v[0]||null,y.options=p.clone(v[1])):y.options=p.clone(v[0]),y},p}(i),s=function(_){var p={},h=function(P,g,v){var y=P[g];return P[g]=function(){var O=Array.prototype.slice.call(arguments);return v.apply(this,[O,y])},y};return p.baseUrlRespectingXhr=function(P,g){var v=function(){var y=new P;return h(y,"open",function(O,M){var R=O.shift(),D=O.shift(),T=_.joinUrl(g,D);return M.apply(this,[R,T].concat(O))}),y};return v},p.finishNotifyingXhr=function(P){var g=0,v=0,y=!1,O,M=new Promise(function(D){O=function(){var T=g-v;T<=0&&y&&D({totalCount:g})}}),R=function(){var D=new P;return h(D,"send",function(T,S){return g+=1,S.apply(this,arguments)}),D.addEventListener("load",function(){v+=1,O()}),D};return R.waitForRequestsToFinish=function(){return y=!0,O(),M},R},p}(l),c=function(){var _={},p=function(R){return Array.prototype.slice.call(R)};_.addClassName=function(R,D){R.className+=" "+D},_.addClassNameRecursively=function(R,D){_.addClassName(R,D),R.parentNode!==R.ownerDocument&&_.addClassNameRecursively(R.parentNode,D)};var h=function(R,D){var T=R.parentStyleSheet,S=p(T.cssRules).indexOf(R);T.insertRule(D,S+1),T.deleteRule(S)},P=function(R,D){var T=R.cssText.replace(/^[^\{]+/,""),S=D+" "+T;h(R,S)},g=function(R){return p(R).reduce(function(D,T){return D+T.cssText},"")},v=function(R){R.textContent=g(R.sheet.cssRules)},y=function(R){var D=document.implementation.createHTMLDocument(""),T=document.createElement("style");T.textContent=R.textContent,D.body.appendChild(T),R.sheet=T.sheet},O=function(R){return"((?:^|[^.#:\\w])|(?=\\W))("+R.join("|")+")(?=\\W|$)"},M=function(R,D,T){var S=O(D);p(R.querySelectorAll("style")).forEach(function(A){typeof A.sheet>"u"&&y(A);var N=p(A.sheet.cssRules).filter(function(k){return k.selectorText&&new RegExp(S,"i").test(k.selectorText)});N.length&&(N.forEach(function(k){var L=k.selectorText.replace(new RegExp(S,"gi"),function(B,X,K){return X+T(K)});L!==k.selectorText&&P(k,L)}),v(A))})};return _.rewriteCssSelectorWith=function(R,D,T){M(R,[D],function(){return T})},_.lowercaseCssTypeSelectors=function(R,D){M(R,D,function(T){return T.toLowerCase()})},_.findHtmlOnlyNodeNames=function(R){var D=R.ownerDocument.createTreeWalker(R,NodeFilter.SHOW_ELEMENT),T={},S={},A;do A=D.currentNode.tagName.toLowerCase(),D.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?T[A]=!0:S[A]=!0;while(D.nextNode());return Object.keys(T).filter(function(N){return!S[N]})},_}(),d=function(_){var p={},h=function(g){return Array.prototype.slice.call(g)},P={active:!0,hover:!0,focus:!1,target:!1};return p.fakeUserAction=function(g,v,y){var O=g.querySelector(v),M=":"+y,R="rasterizehtml"+y;O&&(P[y]?_.addClassNameRecursively(O,R):_.addClassName(O,R),_.rewriteCssSelectorWith(g,M,"."+R))},p.persistInputValues=function(g){var v=g.querySelectorAll("input"),y=g.querySelectorAll("textarea"),O=function(M){return M.type==="checkbox"||M.type==="radio"};h(v).filter(O).forEach(function(M){M.checked?M.setAttribute("checked",""):M.removeAttribute("checked")}),h(v).filter(function(M){return!O(M)}).forEach(function(M){M.setAttribute("value",M.value)}),h(y).forEach(function(M){M.textContent=M.value})},p.rewriteTagNameSelectorsToLowerCase=function(g){_.lowercaseCssTypeSelectors(g,_.findHtmlOnlyNodeNames(g))},p}(c),b=function(_,p,h,P){var g={},v=function(K,Q,H,z){var I=K.createElement(Q);return I.style.visibility="hidden",I.style.width=H+"px",I.style.height=z+"px",I.style.position="absolute",I.style.top=-1e4-z+"px",I.style.left=-1e4-H+"px",K.getElementsByTagName("body")[0].appendChild(I),I},y=function(K){return K>0?new Promise(function(Q){setTimeout(Q,K)}):Promise.resolve()};g.executeJavascript=function(K,Q){return new Promise(function(H){var z=v(P.document,"iframe",Q.width,Q.height),I=K.outerHTML,U=[],$=Q.executeJsTimeout||0,ee=function(){P.document.getElementsByTagName("body")[0].removeChild(z)},G=function(){var re=z.contentDocument;H({document:re,errors:U,cleanUp:ee})},Z=z.contentWindow.XMLHttpRequest,W=p.finishNotifyingXhr(Z),te=p.baseUrlRespectingXhr(W,Q.baseUrl);z.onload=function(){y($).then(W.waitForRequestsToFinish).then(G)},z.contentDocument.open(),z.contentWindow.XMLHttpRequest=te,z.contentWindow.onerror=function(re){U.push({resourceType:"scriptExecution",msg:re})},z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(I),z.contentDocument.close()})};var O=function(K,Q,H){var z=K.createElement("iframe");return z.style.width=Q+"px",z.style.height=H+"px",z.style.visibility="hidden",z.style.position="absolute",z.style.top=-1e4-H+"px",z.style.left=-1e4-Q+"px",z.style.borderWidth=0,z.sandbox="allow-same-origin",z.scrolling="no",z},M=function(K,Q,H){var z=Math.floor(K/H),I=Math.floor(Q/H);return O(P.document,z,I)},R=function(K,Q,H,z){return{width:Math.max(K.width*z,Q),height:Math.max(K.height*z,H)}},D=function(K,Q){var H=K.querySelector(Q);if(H)return H;if(K.ownerDocument.querySelector(Q)===K)return K;throw{message:"Clipping selector not found"}},T=function(K,Q,H,z,I){var U=Math.max(K.scrollWidth,K.clientWidth),$=Math.max(K.scrollHeight,K.clientHeight),ee,G,Z,W,te,re,ie,oe;return Q?(re=D(K,Q),ie=re.getBoundingClientRect(),ee=ie.top,G=ie.left,Z=ie.width,W=ie.height):(ee=0,G=0,Z=U,W=$),oe=R({width:Z,height:W},H,z,I),te=P.getComputedStyle(K.ownerDocument.documentElement).fontSize,{left:G,top:ee,width:oe.width,height:oe.height,viewportWidth:U,viewportHeight:$,rootFontSize:te}},S=function(K,Q){var H=K.tagName;return Q.querySelector(H)},A=function(K){var Q=K.tagName.toLowerCase();return Q==="html"||Q==="body"?K.outerHTML:'<body style="margin: 0;">'+K.outerHTML+"</body>"};g.calculateDocumentContentSize=function(K,Q){return new Promise(function(H,z){var I=Q.zoom||1,U;U=M(Q.width,Q.height,I),P.document.getElementsByTagName("body")[0].appendChild(U),U.onload=function(){var $=U.contentDocument,ee;try{ee=T(S(K,$),Q.clip,Q.width,Q.height,I),H(ee)}catch(G){z(G)}finally{P.document.getElementsByTagName("body")[0].removeChild(U)}},U.contentDocument.open(),U.contentDocument.write("<!DOCTYPE html>"),U.contentDocument.write(A(K)),U.contentDocument.close()})},g.parseHtmlFragment=function(K){var Q=P.document.implementation.createHTMLDocument("");Q.documentElement.innerHTML=K;var H=Q.querySelector("body").firstChild;if(!H)throw"Invalid source";return H};var N=function(K,Q){var H=/<html((?:\s+[^>]*)?)>/im.exec(Q),z=P.document.implementation.createHTMLDocument(""),I,U,$,ee;if(H)for(I="<div"+H[1]+"></div>",z.documentElement.innerHTML=I,$=z.querySelector("div"),U=0;U<$.attributes.length;U++)ee=$.attributes[U],K.documentElement.setAttribute(ee.name,ee.value)};g.parseHTML=function(K){var Q=P.document.implementation.createHTMLDocument("");return Q.documentElement.innerHTML=K,N(Q,K),Q};var k=function(K){try{return h.failOnParseError(K)}catch(Q){throw{message:"Invalid source",originalError:Q}}};g.validateXHTML=function(K){var Q=new DOMParser,H=Q.parseFromString(K,"application/xml");k(H)};var L=null,B=function(K,Q){return Q==="none"||Q==="repeated"?((L===null||Q!=="repeated")&&(L=Date.now()),K+"?_="+L):K},X=function(K,Q){return new Promise(function(H,z){var I=new window.XMLHttpRequest,U=_.joinUrl(Q.baseUrl,K),$=B(U,Q.cache),ee=function(G){z({message:"Unable to load page",originalError:G})};I.addEventListener("load",function(){I.status===200||I.status===0?H(I.responseXML):ee(I.statusText)},!1),I.addEventListener("error",function(G){ee(G)},!1);try{I.open("GET",$,!0),I.responseType="document",I.send(null)}catch(G){ee(G)}})};return g.loadDocument=function(K,Q){return X(K,Q).then(function(H){return k(H)})},g}(l,s,n,window),w=function(_){var p={},h=function(S,A){return A?URL.createObjectURL(new Blob([S],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(S)},P=function(S){S instanceof Blob&&URL.revokeObjectURL(S)},g='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',v=function(S){return new Promise(function(A,N){var k=document.createElement("canvas"),L=new Image;L.onload=function(){var B=k.getContext("2d");try{B.drawImage(L,0,0),k.toDataURL("image/png"),A(!0)}catch{A(!1)}},L.onerror=N,L.src=S})},y=function(){var S=h(g,!0);return v(S).then(function(A){return P(S),A?!1:v(h(g,!1)).then(function(N){return N})},function(){return!1})},O=function(){if(_.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},M=function(){return new Promise(function(S,A){O()&&_.URL?y().then(function(N){S(!N)},function(){A()}):S(!1)})},R,D=function(){return R===void 0&&(R=M()),R},T=function(S){return D().then(function(A){return h(S,A)})};return p.renderSvg=function(S){return new Promise(function(A,N){var k,L,B=function(){L.onload=null,L.onerror=null},X=function(){k&&P(k)};L=new Image,L.onload=function(){B(),X(),A(L)},L.onerror=function(){X(),N()},T(S).then(function(K){k=K,L.src=k},N)})},p}(window),E=function(_,p,h,P){var g={},v=function(S,A){var N=A||1,k={width:S.width,height:S.height,"font-size":S.rootFontSize};return N!==1&&(k.style="transform:scale("+N+"); transform-origin: 0 0;"),k},y=function(S){var A,N,k,L;A=Math.round(S.viewportWidth),N=Math.round(S.viewportHeight),k=-S.left,L=-S.top;var B={x:k,y:L,width:A,height:N};return B},O=function(S){var A=S.style||"";S.style=A+"float: left;"},M=function(S){S.externalResourcesRequired=!0},R=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},D=function(S){var A=Object.keys(S);return A.length?" "+A.map(function(N){return N+'="'+S[N]+'"'}).join(" "):""},T=function(S,A,N){var k=P.serializeToString(S);p.validateXHTML(k);var L=y(A);return O(L),M(L),'<svg xmlns="http://www.w3.org/2000/svg"'+D(v(A,N))+">"+R()+"<foreignObject"+D(L)+">"+k+"</foreignObject></svg>"};return g.getSvgForDocument=function(S,A,N){return h.rewriteTagNameSelectorsToLowerCase(S),T(S,A,N)},g.drawDocumentAsSvg=function(S,A){return["hover","active","focus","target"].forEach(function(N){A[N]&&h.fakeUserAction(S,A[N],N)}),p.calculateDocumentContentSize(S,A).then(function(N){return g.getSvgForDocument(S,N,A.zoom)})},g}(l,b,d,t),x=function(_,p,h,P,g,v){var y={},O=function(S){return{message:"Error rendering page",originalError:S}},M=function(S){return g.renderSvg(S).then(function(A){return{image:A,svg:S}},function(A){throw O(A)})},R=function(S,A){try{A.getContext("2d").drawImage(S,0,0)}catch(N){throw O(N)}},D=function(S,A,N){return P.drawDocumentAsSvg(S,N).then(M).then(function(k){return A&&R(k.image,A),k})},T=function(S,A){return p.executeJavascript(S,A).then(function(N){var k=N.document;return h.persistInputValues(k),{document:k,errors:N.errors,cleanUp:N.cleanUp}})};return y.rasterize=function(S,A,N){var k;return k=_.clone(N),k.inlineScripts=N.executeJs===!0,v.inlineReferences(S,k).then(function(L){return N.executeJs?T(S,N).then(function(B){return{element:B.document.documentElement,errors:L.concat(B.errors),cleanUp:B.cleanUp}}):{element:S,errors:L,cleanUp:function(){}}}).then(function(L){return D(L.element,A,N).then(function(B){return L.cleanUp(),{image:B.image,svg:B.svg,errors:L.errors}})})},y}(l,b,d,E,w,o),m=function(_,p,h){var P={},g=function(R,D){var T=300,S=200,A=R?R.width:T,N=R?R.height:S,k=D.width!==void 0?D.width:A,L=D.height!==void 0?D.height:N;return{width:k,height:L}},v=function(R){var D=g(R.canvas,R.options),T;return T=_.clone(R.options),T.width=D.width,T.height=D.height,T};P.drawDocument=function(){var R=arguments[0],D=Array.prototype.slice.call(arguments,1),T=_.parseOptionalParameters(D),S=R.documentElement?R.documentElement:R;return h.rasterize(S,T.canvas,v(T))};var y=function(R,D,T){var S=p.parseHTML(R);return P.drawDocument(S,D,T)};P.drawHTML=function(){var R=arguments[0],D=Array.prototype.slice.call(arguments,1),T=_.parseOptionalParameters(D);return y(R,T.canvas,T.options)};var O=function(R,D,T){var S=document.implementation.createHTMLDocument("");S.replaceChild(R.documentElement,S.documentElement);var A=T?_.clone(T):{};return T.baseUrl||(A.baseUrl=D),{document:S,options:A}},M=function(R,D,T){return p.loadDocument(R,T).then(function(S){var A=O(S,R,T);return P.drawDocument(A.document,D,A.options)})};return P.drawURL=function(){var R=arguments[0],D=Array.prototype.slice.call(arguments,1),T=_.parseOptionalParameters(D);return M(R,T.canvas,T.options)},P}(l,b,x);return m})}(ap)),ap.exports}var Bb;function m4(){return Bb||(Bb=1,function(e){var i=Vo&&Vo.__createBinding||(Object.create?function(y,O,M,R){R===void 0&&(R=M);var D=Object.getOwnPropertyDescriptor(O,M);D&&!("get"in D?!O.__esModule:D.writable||D.configurable)||(D={enumerable:!0,get:function(){return O[M]}}),Object.defineProperty(y,R,D)}:function(y,O,M,R){R===void 0&&(R=M),y[R]=O[M]}),t=Vo&&Vo.__setModuleDefault||(Object.create?function(y,O){Object.defineProperty(y,"default",{enumerable:!0,value:O})}:function(y,O){y.default=O}),n=Vo&&Vo.__importStar||function(){var y=function(O){return y=Object.getOwnPropertyNames||function(M){var R=[];for(var D in M)Object.prototype.hasOwnProperty.call(M,D)&&(R[R.length]=D);return R},y(O)};return function(O){if(O&&O.__esModule)return O;var M={};if(O!=null)for(var R=y(O),D=0;D<R.length;D++)R[D]!=="default"&&i(M,O,R[D]);return t(M,O),M}}();Object.defineProperty(e,"__esModule",{value:!0}),e.prerenderFont=e.resetStyleContent=void 0,e.isContentWrapping=m,e.detectSize=_,e.htmlToCanvas=v;const o=n(yx()),l=Bd(),s=l4();e.resetStyleContent=`
159
+ p {
160
+ margin: 0;
161
+ padding: 0;
162
+ word-wrap: break-word; /* Required for Firefox */
163
+ /* a text may have several spaces, we need to preserve them */
164
+ white-space: pre-wrap;
165
+ }
166
+ ul, ol {
167
+ list-style-position: outside;
168
+ margin: 0;
169
+ padding: 0;
170
+ display: inline-block;
171
+ text-align: left;
172
+ width: 100%;
173
+ /*
174
+ * somehow display: inline-block is removing text-decoration
175
+ * let's try to restore it that way
176
+ */
177
+ text-decoration: inherit;
178
+ }
179
+ li {
180
+ margin-left: 1.7em;
181
+ padding-left: 0.5em; /* This should match the margin-left value */
182
+ }
183
+ /* Add resets */
184
+ ul {
185
+ list-style-type: disc;
186
+ }
187
+ ol {
188
+ list-style-type: decimal;
189
+ }
190
+
191
+ `;const c=`
192
+ <style>
193
+ html, body {
194
+ padding: 0;
195
+ margin: 0;
196
+ }
197
+ ${e.resetStyleContent}
198
+ </style>
199
+ `;let d;const b=()=>(d||(d=document.createElement("div"),d.id="polotno-hidden-do-not-touch",d.style.overflow="hidden",d.style.position="relative",document.body.appendChild(d),d.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),d),w=new Map,E=navigator.userAgent.includes("Firefox"),x=async y=>{if(w.has(y))return w.get(y);const O=(async()=>{const M=`<div style="font-family: ${y}; font-size: 100px;">${y}<strong>${y}</strong></div>`,R=document.createElement("div");R.innerHTML=M,R.style.visibility="hidden",R.style.position="absolute";const D=b();D.appendChild(R);const T=E?180:50;await new Promise(S=>setTimeout(S,T)),D.removeChild(R)})();return w.set(y,O),O};function m({html:y}){const O=document.createElement("div");O.innerHTML=y,O.style.display="inline-block",O.style.position="fixed",O.style.top="0px",O.style.left="0px",O.style.zIndex="1000",O.style.whiteSpace="nowrap",O.style.visibility="hidden";const M=b();M.appendChild(O);const R=O.textContent,D=O.childNodes[0],T=R.split(/\s+/);let S=!1;for(let A=0;A<T.length;A++){const N=T[A];if(D.textContent=N,S=D.scrollWidth>O.clientWidth,S)break}return M.removeChild(O),S}function _(y){y.indexOf("Avellino");const O=document.createElement("div");O.innerHTML=y,O.style.display="inline-block",O.style.position="fixed",O.style.top="0px",O.style.left="0px",O.style.zIndex="1000";const M=b();M.appendChild(O);const R=O.getBoundingClientRect();return M.removeChild(O),{width:R.width,height:R.height}}e.prerenderFont=x;const p={};function h(y){const O=[];for(const M of document.styleSheets)try{for(const R of M.cssRules)R instanceof CSSFontFaceRule&&R.style.fontFamily.replace(/['"]/g,"")===y&&O.push(R)}catch(R){console.warn(`Could not access stylesheet: ${M.href}`,R)}return O}const P={},g=y=>{if(P[y])return P[y];const O=h(y).filter(M=>M.style.fontFamily.replace(/['"]/g,"")===y).map(M=>({src:M.style.src,fontStyle:M.style.fontStyle||"normal",fontWeight:M.style.fontWeight||"normal"}));return P[y]=O,O};async function v({html:y,width:O,height:M,fontFamily:R,padding:D,font:T,pixelRatio:S}){if(R!=="Arial"&&!T){const L=(0,l.getGoogleFontsVariants)();y+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${R}:${L}" rel="stylesheet">`}if(T){const L=T.styles||(T.url?[{src:`url("${T.url}")`}]:g(R));y+="<style>",L.forEach(B=>{y+=`
200
+ @font-face {
201
+ font-family: '${R}';
202
+ src: ${B.src};
203
+ font-style: ${B.fontStyle||"normal"};
204
+ font-weight: ${B.fontWeight||"normal"};
205
+ }
206
+ `}),y+="</style>"}y+=c;const A=document.createElement("canvas"),N=await o.drawHTML(`<div style="padding: ${D}px;">${y}</div>`,A,{width:O+2*D,height:M+2*D,cacheBucket:p});(0,s.trySetCanvasSize)(A,(O+2*D)*S,(M+2*D)*S);const k=A.getContext("2d");return k==null||k.drawImage(N.image,0,0,A.width,A.height),A}}(Vo)),Vo}var Zu={},n0={},Ub;function v4(){return Ub||(Ub=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=E,e.setup=P,e.styled=g;let i={data:""},t=v=>typeof window=="object"?((v?v.querySelector("#_goober"):window._goober)||Object.assign((v||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:v||i,n=v=>{let y=t(v),O=y.data;return y.data="",O},o=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,l=/\/\*[^]*?\*\/|\s\s+|\n/g,s=(v,y)=>{let O="",M="",R="";for(let D in v){let T=v[D];D[0]=="@"?D[1]=="i"?O=D+" "+T+";":M+=D[1]=="f"?s(T,D):D+"{"+s(T,D[1]=="k"?"":y)+"}":typeof T=="object"?M+=s(T,y?y.replace(/([^,])+/g,S=>D.replace(/(^:.*)|([^,])+/g,A=>/&/.test(A)?A.replace(/&/g,S):S?S+" "+A:A)):D):T!=null&&(D=D.replace(/[A-Z]/g,"-$&").toLowerCase(),R+=s.p?s.p(D,T):D+":"+T+";")}return O+(y&&R?y+"{"+R+"}":R)+M},c={},d=v=>{if(typeof v=="object"){let y="";for(let O in v)y+=O+d(v[O]);return y}return v},b=(v,y,O,M,R)=>{let D=d(v),T=c[D]||(c[D]=(S=>{let A=0,N=11;for(;A<S.length;)N=101*N+S.charCodeAt(A++)>>>0;return"go"+N})(D));if(!c[T]){let S=D!==v?v:(A=>{let N,k=[{}];for(;N=o.exec(A.replace(l,""));)N[4]?k.shift():N[3]?k.unshift(k[0][N[3]]=k[0][N[3]]||{}):k[0][N[1]]=N[2];return k[0]})(v);c[T]=s(R?{["@keyframes "+T]:S}:S,O?"":"."+T)}return((S,A,N)=>{A.data.indexOf(S)==-1&&(A.data=N?S+A.data:A.data+S)})(c[T],y,M),T},w=(v,y,O)=>v.reduce((M,R,D)=>{let T=y[D];if(T&&T.call){let S=T(O),A=S&&S.props&&S.props.className||/^go/.test(S)&&S;T=A?"."+A:S&&typeof S=="object"?S.props?"":s(S,""):S===!1?"":S}return M+R+(T??"")},"");function E(v){let y=this||{},O=v.call?v(y.p):v;return b(O.unshift?O.raw?w(O,[].slice.call(arguments,1),y.p):O.reduce((M,R)=>Object.assign(M,R&&R.call?R(y.p):R),{}):O,t(y.target),y.g,y.o,y.k)}e.extractCss=n;let x,m,_,p=E.bind({g:1}),h=E.bind({k:1});function P(v,y,O,M){s.p=y,x=v,m=O,_=M}function g(v,y){let O=this||{};return function(){let M=arguments;function R(D,T){let S=Object.assign({},D),A=S.className||R.className;O.p=Object.assign({theme:m&&m()},S),O.o=/ *go\d+/.test(A),S.className=E.apply(O,M)+(A?" "+A:""),y&&(S.ref=T);let N=v;return v[0]&&(N=S.as||v,delete S.as),_&&N[0]&&_(S),x(N,S)}return y?y(R):R}}e.glob=p,e.keyframes=h}(n0)),n0}var qb;function bx(){if(qb)return Zu;qb=1;var e=Zu&&Zu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Zu,"__esModule",{value:!0});const i=e(Tn()),t=v4();return(0,t.setup)(i.default.createElement),Zu.default=t.styled,Zu}var Hb;function _x(){return Hb||(Hb=1,function(e){var i=wa&&wa.__createBinding||(Object.create?function(I,U,$,ee){ee===void 0&&(ee=$);var G=Object.getOwnPropertyDescriptor(U,$);G&&!("get"in G?!U.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return U[$]}}),Object.defineProperty(I,ee,G)}:function(I,U,$,ee){ee===void 0&&(ee=$),I[ee]=U[$]}),t=wa&&wa.__setModuleDefault||(Object.create?function(I,U){Object.defineProperty(I,"default",{enumerable:!0,value:U})}:function(I,U){I.default=U}),n=wa&&wa.__importStar||function(){var I=function(U){return I=Object.getOwnPropertyNames||function($){var ee=[];for(var G in $)Object.prototype.hasOwnProperty.call($,G)&&(ee[ee.length]=G);return ee},I(U)};return function(U){if(U&&U.__esModule)return U;var $={};if(U!=null)for(var ee=I(U),G=0;G<ee.length;G++)ee[G]!=="default"&&i($,U,ee[G]);return t($,U),$}}(),o=wa&&wa.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0;const l=o(Tn()),s=Qi,c=Jo,d=o(AO()),b=o(Ji()),w=n(La),E=ts(),x=jp(),m=a4(),_=zd(),p=m4(),h=bc(),P=_c(),g=yc,v=o(bx()),y=Ks(),O=o5(),M=n(Bd()),R=Xs(),D=i4();e.quillRef=w.observable({enabled:!1,currentFormat:{},editor:w.observable.object({instance:null},{},{deep:!1})});const T=(0,v.default)("div",l.default.forwardRef)`
207
+ .ql-editor {
208
+ outline: none;
209
+ }
210
+ ${p.resetStyleContent}
211
+ strong {
212
+ font-weight: 700;
213
+ }
214
+ .ql-direction-rtl {
215
+ direction: rtl;
216
+ }
217
+ `;let S=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const A=I=>{S=I};e.setQuillFormats=A;const N=I=>new d.default(I,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:S});e.createQuill=N;const k=(I,U)=>{var $=I.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+U+"<p><br></p></div>");I.setContents($),I.history.clear()};e.setQuillContent=k;const L=({html:I,onBlur:U,onChange:$,element:ee})=>{const G=l.default.useRef(null);l.default.useEffect(()=>{if(!G.current)return;const W=(0,e.createQuill)(G.current);return w.runInAction(()=>{e.quillRef.editor.instance=W}),window.__polotnoQuill=W,W.on("text-change",()=>{W.getSelection()&&w.runInAction(()=>{e.quillRef.currentFormat=W.getFormat()}),setTimeout(()=>{var te;const re=(te=G.current)===null||te===void 0?void 0:te.childNodes[0];$(re.innerHTML)},10)}),W.setSelection(0,0,"api"),W.on("selection-change",te=>{te||U(),te&&w.runInAction(()=>{e.quillRef.currentFormat=W.getFormat()})}),G.current.childNodes[0].addEventListener("blur",te=>{var re;!((re=te.relatedTarget)===null||re===void 0)&&re.classList.contains("ql-clipboard")||U()}),()=>{w.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),l.default.useEffect(()=>{var W;const te=e.quillRef.editor.instance;if(!te)return;const re=te.getSelection();((W=G.current)===null||W===void 0?void 0:W.childNodes[0].innerHTML)===ee.text||((0,e.setQuillContent)(te,I),re&&(te.setSelection(re.index,re.length),w.runInAction(()=>{e.quillRef.currentFormat=te.getFormat()})))},[ee.text]);const Z={color:ee.fill};return ee.fill.indexOf("gradient")>=0&&(Z.backgroundColor=ee.fill,Z.backgroundImage=ee.fill,Z.backgroundSize="100% 100%",Z.backgroundRepeat="repeat",Z.webkitBackgroundClip="text",Z.MozBackgroundClip="text",Z.WebkitTextFillColor="transparent",Z.MozTextFillColor="transparent"),l.default.createElement(T,{ref:G,style:Object.assign(Object.assign({},Z),{fontSize:ee.fontSize,fontWeight:ee.fontWeight,width:ee.a.width,fontFamily:ee.fontFamily,lineHeight:ee.lineHeight,letterSpacing:ee.letterSpacing+"rem",textAlign:ee.align}),dir:(0,m.getDir)((0,O.removeTags)(ee.text))})};function B(I,U,$){return l.default.useMemo(()=>(0,p.detectSize)(I),[I,U.width,$])}function X(I){const U=I.getContext("2d").getImageData(0,0,I.width,I.height).data;for(let $=0;$<U.length;$+=4)if(U[$+3]!==0)return!0;return!1}function K(I){return!X(I)}function Q(I,{fontFamily:U="",color:$="black"}={}){let ee=`color: ${$||I.fill}`;return I.fill.indexOf("gradient")>=0&&(ee=`
218
+ background-color: ${$};
219
+ background-image: ${I.fill};
220
+ background-size: 100% 100%;
221
+ background-repeat: repeat;
222
+ -webkit-background-clip: text;
223
+ -moz-background-clip: text;
224
+ -webkit-text-fill-color: transparent;
225
+ -moz-text-fill-color: transparent;
226
+ `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(I.width||100)}px`,ee,`font-size: ${I.fontSize}px`,`font-family: '${U}'`,`text-align: ${I.align}`,I.textDecoration?`text-decoration: ${I.textDecoration}`:"",I.lineHeight?`line-height: ${I.lineHeight}`:"",I.letterSpacing?`letter-spacing: ${I.letterSpacing}rem`:"",I.fontStyle?`font-style: ${I.fontStyle}`:"",I.fontWeight?`font-weight: ${I.fontWeight}`:"",I.strokeWidth?`-webkit-text-stroke: ${I.strokeWidth}px ${I.stroke}`:"",I.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,m.getDir)((0,O.removeTags)(I.text))}">${I.text.replaceAll(`
227
+ `,"</br>")}</div>`}const H=I=>{let U=I.fontSize;for(let $=1;$<50;$++){const ee=Q(Object.assign(Object.assign({},I.toJSON()),{fontSize:U}),{fontFamily:I.fontFamily}),{height:G}=(0,p.detectSize)(ee),Z=I.height&&G>I.height,W=(0,p.isContentWrapping)({html:ee});if(!(Z||W))break;U-=.5}return U},z=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,s.observer)(({element:I,store:U})=>{const $=l.default.useRef(null),[ee,G]=l.default.useState(),[Z,W]=l.default.useState(!1),[te,re]=l.default.useState(!0),[ie,oe]=l.default.useState(!1),se=l.default.useRef(I.height),de=U.selectedShapes.indexOf(I)>=0,pe=I.fontSize/3,{textVerticalResizeEnabled:Oe}=E.flags,_e=(0,m.usePrevious)(I.fontFamily),[Te]=(0,m.useFontLoader)(U,I.fontFamily),ce=I._editModeEnabled;(0,h.useFadeIn)($);const he=Te?I.fontFamily:_e!==I.fontFamily?_e:"Arial",Ce=(0,_.useColor)(I).fill,Le=Q(I,{fontFamily:he,color:Ce}),{width:ue,height:me}=B(Le,I,Te);l.default.useEffect(()=>{if(!Te)return;if(!I.height)return void I.set({height:me});const{textOverflow:ze}=E.flags;if(ze!=="change-font-size"||Z)ze==="resize"&&(Oe&&I.height<me&&U.history.ignore(()=>{I.set({height:me})}),Oe||I.height===me||U.history.ignore(()=>{I.set({height:me})}));else{const Be=H(I);Be!==I.fontSize?U.history.ignore(()=>{I.set({fontSize:Be})}):I.height!==me&&(Oe&&I.height<me?U.history.ignore(()=>{I.set({height:me})}):Oe||U.history.ignore(()=>{I.set({height:me})}))}});const xe=l.default.useRef(0),je=l.default.useMemo(()=>{const ze={lastArgs:null,lastResult:null};return async function(Be){return ze.lastArgs&&ze.lastResult&&(Ve=ze.lastArgs,bt=Be,JSON.stringify(Ve)===JSON.stringify(bt))||(ze.lastResult=await(0,p.htmlToCanvas)(Be),ze.lastArgs=Object.assign({},Be)),ze.lastResult;var Ve,bt}},[]);l.default.useEffect(()=>{Z||ce||(async()=>{xe.current++;const ze=xe.current,Be=(0,y.incrementLoader)(`text ${I.id}`);re(!0);let Ve=null;const bt=z?5:1;for(let Ct=0;Ct<bt;Ct++){if(Ve=await(Ct>0?je:p.htmlToCanvas)({skipCache:Ct>0,html:Le,width:I.width||1,height:I.height||me||1,fontFamily:he,padding:pe,pixelRatio:U._elementsPixelRatio,font:U.fonts.find(Se=>Se.fontFamily===he)||M.globalFonts.find(Se=>Se.fontFamily===he)}),ze!==xe.current)return void Be();K(Ve)&&z&&await new Promise(Se=>setTimeout(Se,50*(Ct+1)))}Ve?(G(Ve),re(!1),b.default.Util.requestAnimFrame(Be)):Be()})()},[Le,Z,me,ce,he,I.height,U._elementsPixelRatio,Te]);const ot=Z||te;l.default.useEffect(()=>w.autorun(()=>{const ze=$.current;(0,x.applyFilter)(ze,I)}),[ee,ot,I.shadowColor,I.shadowOffsetX,I.shadowOffsetY,I.shadowOpacity]);let ht=0;I.verticalAlign==="middle"&&(ht=(I.height-me)/2),I.verticalAlign==="bottom"&&(ht=I.height-me);const et=(0,m.getLineHeight)({fontLoaded:Te,fontFamily:I.fontFamily,fontSize:I.fontSize,lineHeight:I.lineHeight}),Ke=(0,R.isTouchDevice)();return l.default.createElement(l.default.Fragment,null,l.default.createElement(c.Rect,{x:I.a.x,y:I.a.y,offsetX:I.backgroundPadding*(I.fontSize*et*.5),offsetY:I.backgroundPadding*(I.fontSize*et*.5),rotation:I.a.rotation,hideInExport:!I.showInExport,listening:!1,visible:I.backgroundEnabled,opacity:I.backgroundOpacity*I.a.opacity,fill:I.backgroundColor,width:I.a.width+I.backgroundPadding*(I.fontSize*et),height:I.a.height+I.backgroundPadding*(I.fontSize*et),cornerRadius:I.backgroundCornerRadius*(I.fontSize*et*.5)}),l.default.createElement(c.Rect,{ref:$,name:"element",x:I.a.x,y:I.a.y,listening:I.selectable,rotation:I.a.rotation,width:I.a.width,height:I.a.height,visible:!ot,draggable:Ke?I.draggable&&de:I.draggable,preventDefault:!Ke||de,opacity:ce?0:I.a.opacity,hideInExport:!I.showInExport,onMouseEnter:()=>{oe(!0)},onMouseLeave:()=>{oe(!1)},onDragMove:ze=>{I.set({x:ze.target.x(),y:ze.target.y()})},onDragEnd:ze=>{I.set({x:ze.target.x(),y:ze.target.y()})},id:I.id,onDblClick:()=>{I.contentEditable&&I.toggleEditMode(!0)},onDblTap:()=>{I.contentEditable&&I.toggleEditMode(!0)},onTransformStart:ze=>{W(!0),se.current=I.height},onTransform:ze=>{var Be;const Ve=ze.target,bt=((Be=Ve.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer")).getActiveAnchor(),Ct=bt==="middle-left"||bt==="middle-right",we=bt==="top-center"||bt==="bottom-center",Se=Ve.scaleX();if(Ct){const gt=Ve.scaleX(),wt=Math.max(Ve.width()*gt,I.fontSize);if(Ve.width(wt),Ve.scaleX(1),E.flags.textVerticalResizeEnabled){const Pt=Math.max(me,se.current);I.set({height:Pt})}I.set({width:wt,x:Ve.x(),y:Ve.y()})}else if(we){let gt=E.flags.textOverflow==="resize"?me:I.lineHeight*I.fontSize;const wt=Math.max(gt,ze.target.height()*ze.target.scaleY());Ve.scaleY(1),I.set({x:Ve.x(),y:Ve.y(),height:wt,rotation:Ve.rotation()})}else Ve.scaleX(1),Ve.scaleY(1),I.set({fontSize:I.fontSize*Se,width:Ve.width()*Se,x:Ve.x(),y:Ve.y(),rotation:Ve.rotation(),height:Ve.height()*Se})},onTransformEnd:ze=>{W(!1),re(!0);const Be=ze.target.scaleX();ze.target.scaleX(1),ze.target.scaleY(1),I.set({fontSize:I.fontSize*Be,width:ze.target.width()*Be,x:ze.target.x(),y:ze.target.y(),rotation:ze.target.rotation(),shadowBlur:I.shadowBlur*Be,shadowOffsetX:I.shadowOffsetX*Be,shadowOffsetY:I.shadowOffsetY*Be,strokeWidth:I.strokeWidth*Be})}}),l.default.createElement(c.Image,{ref:$,image:ee,x:I.a.x,y:I.a.y,offsetX:pe,offsetY:pe-ht,listening:!1,rotation:I.rotation,width:I.a.width+2*pe,height:I.a.height+2*pe,visible:!ot,opacity:ce?0:I.a.opacity,shadowEnabled:I.shadowEnabled,shadowBlur:I.shadowBlur,shadowOffsetX:I.shadowOffsetX,shadowOffsetY:I.shadowOffsetY,shadowColor:I.shadowColor,shadowOpacity:I.shadowOpacity,hideInExport:!I.showInExport}),ot&&l.default.createElement(c.Group,{x:I.a.x,y:I.a.y,rotation:I.rotation,offsetY:-ht},l.default.createElement(g.Html,{divProps:{style:{pointerEvents:"none"}}},l.default.createElement(T,{dangerouslySetInnerHTML:{__html:Le},style:{pointerEvents:"none",display:"inline-block"}}))),ce&&l.default.createElement(c.Group,{x:I.a.x,y:I.a.y,rotation:I.rotation,offsetY:-ht},l.default.createElement(g.Html,null,l.default.createElement(L,{html:Le,element:I,onChange:ze=>{const Be=(0,D.getLimitedFontSize)({oldText:(0,O.removeTags)(I.text),newText:(0,O.removeTags)(ze),element:I});I.set({text:ze,fontSize:Be})},onBlur:ze=>{I.toggleEditMode(!1)}}))),(de||ie)&&l.default.createElement(P.Highlighter,{element:I}))})}(wa)),wa}var dd={},hd={},r0={},Gb;function Hd(){return Gb||(Gb=1,function(e){function i(d){return d/180*Math.PI}function t(d,b,w,E,x){const m=Math.sqrt(w*w+E*E);return x+=Math.atan2(E,w),{x:d+m*Math.cos(x),y:b+m*Math.sin(x)}}function n(d){const{x:b,y:w,width:E,height:x}=d,m=i(d.rotation),_=t(b,w,0,0,m),p=t(b,w,E,0,m),h=t(b,w,E,x,m),P=t(b,w,0,x,m),g=Math.min(_.x,p.x,h.x,P.x),v=Math.min(_.y,p.y,h.y,P.y),y=Math.max(_.x,p.x,h.x,P.x),O=Math.max(_.y,p.y,h.y,P.y);return{x:g,y:v,width:y-g,height:O-v,minX:g,minY:v,maxX:y,maxY:O}}function o(d){const b=d.map(_=>n(_)),w=Math.min(...b.map(_=>_.minX)),E=Math.min(...b.map(_=>_.minY)),x=Math.max(...b.map(_=>_.maxX)),m=Math.max(...b.map(_=>_.maxY));return{x:w,y:E,width:x-w,height:m-E,minX:w,minY:E,maxX:x,maxY:m}}function l(d){const b=i(d.rotation||0);return{x:d.x+d.width/2*Math.cos(b)+d.height/2*Math.sin(-b),y:d.y+d.height/2*Math.cos(b)+d.width/2*Math.sin(b)}}function s(d,b,w){const E=i(b),x=w.x+(d.x-w.x)*Math.cos(E)-(d.y-w.y)*Math.sin(E),m=w.y+(d.x-w.x)*Math.sin(E)+(d.y-w.y)*Math.cos(E);return Object.assign(Object.assign({},d),{rotation:d.rotation+b,x,y:m})}function c(d,b){return s(d,b,l(d))}Object.defineProperty(e,"__esModule",{value:!0}),e.degToRad=i,e.getClientRect=n,e.getTotalClientRect=o,e.getCenter=l,e.rotateAroundPoint=s,e.rotateAroundCenter=c}(r0)),r0}var Vb;function y4(){return Vb||(Vb=1,function(e){var i=hd&&hd.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.setSnapFilterFunc=void 0,e.useSnap=w,e.useAnchorSnap=x;const t=i(Tn()),n=i(Ji()),o=Hd();var l=5;let s=({targetKonvaNodes:m,guideKonvaNode:_,distance:p,snapDirection:h})=>p<l;const c=m=>{s=m};function d(m){const _=m.__getNodeRect(),p=(0,o.getClientRect)(Object.assign(Object.assign({},_),{rotation:n.default.Util.radToDeg(_.rotation)})),h=m.getAbsolutePosition();return{vertical:[{guide:p.x,offset:h.x-p.x,snap:"start",nodes:m.nodes()},{guide:p.x+p.width/2,offset:h.x-p.x-p.width/2,snap:"center",nodes:m.nodes()},{guide:p.x+p.width,offset:h.x-p.x-p.width,snap:"end",nodes:m.nodes()}],horizontal:[{guide:p.y,offset:h.y-p.y,snap:"start",nodes:m.nodes()},{guide:p.y+p.height/2,offset:h.y-p.y-p.height/2,snap:"center",nodes:m.nodes()},{guide:p.y+p.height,offset:h.y-p.y-p.height,snap:"end",nodes:m.nodes()}]}}function b(m,_){var p=[],h=[];m.vertical.forEach(M=>{_.vertical.forEach(R=>{var D=Math.abs(M.offset-R.guide);s({targetKonvaNodes:R.nodes,guideKonvaNode:M.node,distance:D,snapDirection:M.snap})&&p.push({lineGuide:M.offset,diff:D,snap:R.snap,offset:R.offset})})}),m.horizontal.forEach(M=>{_.horizontal.forEach(R=>{var D=Math.abs(M.offset-R.guide);s({targetKonvaNodes:R.nodes,guideKonvaNode:M.node,distance:D,snapDirection:M.snap})&&h.push({lineGuide:M.offset,diff:D,snap:R.snap,offset:R.offset})})});var P=[];const g=p.sort((M,R)=>M.diff-R.diff),v=h.sort((M,R)=>M.diff-R.diff);var y=g[0],O=v[0];return y&&g.filter(M=>Math.abs(M.diff-y.diff)<.1).forEach(M=>{P.push(Object.assign({orientation:"V"},M))}),O&&v.filter(M=>Math.abs(M.diff-O.diff)<.1).forEach(M=>{P.push(Object.assign({orientation:"H"},M))}),P}function w(m,_){const p=t.default.useRef(),h=M=>M.hasName("element")||M.hasName("page-background")||!p.current&&M.hasName("elements-area");function P(M){var R;const D=(R=m.current)===null||R===void 0?void 0:R.getStage(),T=[],S=[];return D.find(h).forEach(A=>{if(!(M.indexOf(A)>=0)){var N=A.getClientRect({skipShadow:!0,skipStroke:!0});T.push({offset:N.x,node:A,snap:"start"},{offset:N.x+N.width,node:A,snap:"end"},{offset:N.x+N.width/2,node:A,snap:"center"}),S.push({offset:N.y,node:A,snap:"start"},{offset:N.y+N.height,node:A,snap:"end"},{offset:N.y+N.height/2,node:A,snap:"center"})}}),{vertical:T,horizontal:S}}function g(M){var R;const D=(R=m.current)===null||R===void 0?void 0:R.getLayer(),T=D==null?void 0:D.children.find(S=>S.name()==="line-guides");M.forEach(S=>{if(S.orientation==="H"){var A=new n.default.Line({points:[-6e3,S.lineGuide,6e3,S.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});T==null||T.add(A),D.batchDraw()}else S.orientation==="V"&&(A=new n.default.Line({points:[S.lineGuide,-6e3,S.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),T==null||T.add(A))})}const v=M=>{const R=M.target.getLayer().children.find(k=>k.name()==="line-guides");R==null||R.destroyChildren();var D=b(P(M.target.nodes()),d(M.target));if(!D.length)return;g(D);const T=M.target.getAbsolutePosition(),S=(M.target.nodes().map(k=>k.getAbsolutePosition()),Object.assign({},T));D.forEach(k=>{switch(k.snap){case"start":case"center":case"end":switch(k.orientation){case"V":S.x=k.lineGuide+k.offset;break;case"H":S.y=k.lineGuide+k.offset}}});const A=S.x-T.x,N=S.y-T.y;M.evt.ctrlKey||M.evt.metaKey||M.target.nodes().forEach(k=>{const L=k.getAbsolutePosition();k.setAbsolutePosition({x:L.x+A,y:L.y+N})})},y=(M,R,D)=>{const T=m.current,S=T.getLayer(),A=S.children.find(K=>K.name()==="line-guides");if(A==null||A.destroyChildren(),T.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(R.x-M.x,2)+Math.pow(R.y-M.y,2))>50||!S)return R;var N=b(P(T.nodes()),{vertical:[{guide:R.x,offset:0,snap:"start",nodes:T.nodes()}],horizontal:[{guide:R.y,offset:0,snap:"start",nodes:T.nodes()}]});if(!N.length||(g(N),D.ctrlKey||D.metaKey))return R;let k=R.x,L=R.x;N.forEach(K=>{switch(K.orientation){case"V":k=K.lineGuide;break;case"H":L=K.lineGuide}});const B=Math.abs(R.x-k)<10,X=Math.abs(R.y-L)<10;return B&&!X?{x:k,y:M.y}:X&&!B?{x:M.x,y:L}:B&&X?{x:k,y:L}:R},O=M=>{if(!M.target)return;const R=M.target.getLayer(),D=R.children.find(T=>T.name()==="line-guides");D==null||D.destroyChildren(),R.batchDraw()};t.default.useEffect(()=>{m.current&&(m.current.anchorDragBoundFunc(y),m.current.on("dragstart",M=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const R=[...n.default.DD._dragElements.entries()],D=R.find(([T,S])=>S.node instanceof n.default.Transformer);D&&(R.splice(R.indexOf(D),1),R.unshift(D),n.default.DD._dragElements.clear(),R.forEach(([T,S])=>{n.default.DD._dragElements.set(T,S)}))})}),m.current.on("dragmove",v),m.current.on("dragend",O),m.current.on("transformend",O),m.current.on("transform",M=>{var R,D;M.evt.ctrlKey||M.evt.metaKey?(R=m.current)===null||R===void 0||R.rotationSnapTolerance(0):(D=m.current)===null||D===void 0||D.rotationSnapTolerance(5)}))},[])}function E(m){return{vertical:[{guide:m.absolutePosition().x,offset:0,snap:"center",nodes:[m]}],horizontal:[{guide:m.absolutePosition().y,offset:0,snap:"center",nodes:[m]}]}}function x(m,_,p){const h=v=>v.hasName("element")||v.hasName("line-anchor")||v.hasName("page-background")||v.hasName("elements-area"),P=v=>{const y=v.target.getLayer().children.find(S=>S.name()==="line-guides");y==null||y.destroyChildren();var O=b(function(S){var A;const N=(A=m.current)===null||A===void 0?void 0:A.getStage();var k=[],L=[];return N.find(h).forEach(B=>{if(!(S.indexOf(B)>=0)){var X=B.getClientRect({skipShadow:!0,skipStroke:!0});B.hasName("line-anchor")&&(X={x:B.absolutePosition().x,y:B.absolutePosition().y,width:0,height:0}),k.push({offset:X.x,node:B,snap:"start"},{offset:X.x+X.width,node:B,snap:"end"},{offset:X.x+X.width/2,node:B,snap:"center"}),L.push({offset:X.y,node:B,snap:"start"},{offset:X.y+X.height,node:B,snap:"end"},{offset:X.y+X.height/2,node:B,snap:"center"})}}),{vertical:k,horizontal:L}}([v.target,..._.map(S=>S.current)]),E(v.target));if(!O.length)return;(function(S){var A;const N=(A=m.current)===null||A===void 0?void 0:A.getLayer(),k=N==null?void 0:N.children.find(L=>L.name()==="line-guides");S.forEach(L=>{if(L.orientation==="H"){var B=new n.default.Line({points:[-6e3,L.lineGuide,6e3,L.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});k==null||k.add(B),N.batchDraw()}else L.orientation==="V"&&(B=new n.default.Line({points:[L.lineGuide,-6e3,L.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),k==null||k.add(B))})})(O);const M=v.target.getAbsolutePosition(),R=Object.assign({},M);O.forEach(S=>{switch(S.snap){case"start":case"center":case"end":switch(S.orientation){case"V":R.x=S.lineGuide+S.offset;break;case"H":R.y=S.lineGuide+S.offset}}});const D=R.x-M.x,T=R.y-M.y;if(!(v.evt.ctrlKey||v.evt.metaKey)){const S=v.target.getAbsolutePosition();v.target.absolutePosition({x:S.x+D,y:S.y+T})}},g=v=>{if(!v.target)return;const y=v.target.getLayer(),O=y.children.find(M=>M.name()==="line-guides");O==null||O.destroyChildren(),y.batchDraw()};t.default.useEffect(()=>{m.current&&(m.current.on("dragmove",P),m.current.on("dragend",g))},p)}e.setSnapFilterFunc=c}(hd)),hd}var $b;function wx(){return $b||($b=1,function(e){var i=dd&&dd.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0,e.getMiddlePoints=w,e.getLinePositionFromMiddlePoints=E;const t=i(Tn()),n=Qi,o=Jo,l=zd(),s=yc,c=_c(),d=y4(),b=Xs();function w(_){const{x:p,y:h,width:P,height:g,rotation:v}=_.a,y=v*Math.PI/180,O={x:p+g/2*Math.cos(y+Math.PI/2),y:h+g/2*Math.sin(y+Math.PI/2)};return{middleLeft:O,middleRight:{x:O.x+P*Math.cos(y),y:O.y+P*Math.sin(y)}}}function E(_,p,h){const P=Math.sqrt(Math.pow(p.x-_.x,2)+Math.pow(p.y-_.y,2)),g=Math.atan2(p.y-_.y,p.x-_.x),v=180*g/Math.PI;return{x:_.x+Math.cos(g-Math.PI/2)*h/2,y:_.y+Math.sin(g-Math.PI/2)*h/2,width:P,height:h,rotation:v}}const x=(_,p)=>({offsetX:5/_,offsetY:5/_,width:10/_,height:10/_,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:h=>{h.target.getStage().container().style.cursor="crosshair"},onMouseLeave:h=>{h.target.getStage().container().style.cursor=""},onDragStart:h=>{p.history.startTransaction()},onDragEnd:h=>{p.history.endTransaction()}}),m=(0,n.observer)(({element:_,type:p})=>{const h=(0,l.useColor)(_,_.a.color,"fill"),P=(0,l.useColor)(_,_.a.color,"stroke"),g=Object.assign(Object.assign(Object.assign({strokeWidth:_.height,lineCap:"round",lineJoin:"round"},P),h),{opacity:_.a.opacity,hideInExport:!_.showInExport});return t.default.createElement(t.default.Fragment,null,p==="arrow"&&t.default.createElement(o.Line,Object.assign({points:[3*_.height,2*-_.height,0,0,3*_.height,2*_.height]},g)),p==="triangle"&&t.default.createElement(o.Line,Object.assign({points:[3*_.height,2*-_.height,0,0,3*_.height,2*_.height],closed:!0},g)),p==="bar"&&t.default.createElement(o.Line,Object.assign({points:[0,2*-_.height,0,2*_.height],closed:!0},g)),p==="square"&&t.default.createElement(o.Line,Object.assign({points:[0,2*-_.height,4*_.height,2*-_.height,4*_.height,2*_.height,0,2*_.height],closed:!0},g)),p==="circle"&&t.default.createElement(o.Circle,Object.assign({x:2*_.height,y:0,radius:2*_.height},g)))});e.LineElement=(0,n.observer)(({element:_,store:p})=>{const h=t.default.useRef(null),P=t.default.useRef(null),g=t.default.useRef(null),v=_.selectable||p.role==="admin",y=(0,b.isTouchDevice)(),[O,M]=t.default.useState(!1),R=p.selectedElements.indexOf(_)>=0&&p.selectedElements.length===1,D=p.selectedShapes.indexOf(_)>=0,{middleLeft:T,middleRight:S}=w(_);(0,d.useAnchorSnap)(P,[h],[R]),(0,d.useAnchorSnap)(g,[h],[R]);const A=(0,l.useColor)(_,_.a.color,"stroke");return t.default.createElement(t.default.Fragment,null,t.default.createElement(o.Line,Object.assign({ref:h,name:"element",id:_.id,x:_.a.x,y:_.a.y,points:[0,0,_.a.width,0],offsetY:-_.a.height/2,strokeWidth:_.a.height,hitStrokeWidth:Math.max(_.a.height,20),dash:_.dash.map(N=>N*_.a.height)},A,{rotation:_.a.rotation,opacity:_.animated("opacity"),shadowEnabled:_.shadowEnabled,shadowBlur:_.shadowBlur,shadowOffsetX:_.shadowOffsetX,shadowOffsetY:_.shadowOffsetY,shadowColor:_.shadowColor,shadowOpacity:_.shadowOpacity,listening:v,draggable:y?_.draggable&&D:_.draggable,preventDefault:!y||D,hideInExport:!_.showInExport,onMouseEnter:()=>{M(!0)},onMouseLeave:()=>{M(!1)},onDragMove:N=>{_.set({x:N.target.x(),y:N.target.y()})},onDragEnd:N=>{_.set({x:N.target.x(),y:N.target.y()})},onTransform:N=>{const k=N.target.scaleX();N.target.scaleX(1),N.target.scaleY(1),_.set({height:_.height*k,width:_.width*k,x:N.target.x(),y:N.target.y(),rotation:N.target.rotation()})}})),t.default.createElement(o.Group,{x:T.x,y:T.y,rotation:_.rotation,hideInExport:!_.showInExport},t.default.createElement(m,{element:_,type:_.startHead})),t.default.createElement(o.Group,{x:S.x,y:S.y,rotation:_.rotation+180},t.default.createElement(m,{element:_,type:_.endHead})),(O||D&&!R)&&t.default.createElement(c.Highlighter,{element:_}),R&&_.resizable&&t.default.createElement(s.Portal,{selector:".page-abs-container",enabled:!0},t.default.createElement(o.Group,{visible:R},t.default.createElement(o.Rect,Object.assign({x:T.x,y:T.y,ref:P,name:"line-anchor"},x(p.scale,p),{onDragMove:N=>{const k=E(N.target.position(),S,_.height);_.set({x:k.x,y:k.y,width:k.width,rotation:k.rotation})}})),t.default.createElement(o.Rect,Object.assign({x:S.x,y:S.y,ref:g,name:"line-anchor"},x(p.scale,p),{onDragMove:N=>{const k=E(T,N.target.position(),_.height);_.set({x:k.x,y:k.y,width:k.width,rotation:k.rotation})}})))))})}(dd)),dd}var Sa={},Wb;function Sx(){return Wb||(Wb=1,function(e){var i=Sa&&Sa.__createBinding||(Object.create?function(H,z,I,U){U===void 0&&(U=I);var $=Object.getOwnPropertyDescriptor(z,I);$&&!("get"in $?!z.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return z[I]}}),Object.defineProperty(H,U,$)}:function(H,z,I,U){U===void 0&&(U=I),H[U]=z[I]}),t=Sa&&Sa.__setModuleDefault||(Object.create?function(H,z){Object.defineProperty(H,"default",{enumerable:!0,value:z})}:function(H,z){H.default=z}),n=Sa&&Sa.__importStar||function(){var H=function(z){return H=Object.getOwnPropertyNames||function(I){var U=[];for(var $ in I)Object.prototype.hasOwnProperty.call(I,$)&&(U[U.length]=$);return U},H(z)};return function(z){if(z&&z.__esModule)return z;var I={};if(z!=null)for(var U=H(z),$=0;$<U.length;$++)U[$]!=="default"&&i(I,z,U[$]);return t(I,z),I}}(),o=Sa&&Sa.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useLoader=e.setVideoLoaderHook=void 0;const l=o(Tn()),s=Qi,c=La,d=Jo,b=o(Dp()),w=o(Ji()),E=yc,x=_c(),m=Ks(),_=n(qd()),p=ts(),h=jp(),P=bc(),g=Xs();function v(){return document.createElement("canvas")}async function y(H){if(!(H.indexOf("data:image/svg+xml")>=0||H.indexOf(".svg")>=0))return H;const z=await _.urlToString(H),I=_.fixSize(z);return _.svgToURL(I)}const O=H=>{const[z,I]=l.default.useState(H);return l.default.useEffect(()=>{(async()=>{const U=await y(H);U!==z&&I(U)})()},[H]),z},M=new window.Image;M.src=_.svgToURL(`
228
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
229
+ <path opacity="0.6" d="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"/>
230
+ <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"/>
231
+ </svg>
232
+ `);const R=new window.Image;R.src=_.svgToURL(`
233
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
234
+ <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"/>
235
+ <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"/>
236
+ <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"/>
237
+ <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"/>
238
+ </svg>
239
+ `);function D(H,z,I,U,$,ee,G){for(var Z=new ImageData(z,I),W=new Int32Array(H.data.buffer),te=H.width,re=new Int32Array(Z.data.buffer),ie=Z.width,oe=z/ee,se=I/G,de=Math.round(1/oe),pe=Math.round(1/se),Oe=de*pe,_e=0;_e<Z.height;_e++)for(var Te=0;Te<ie;Te++){for(var ce=U+Math.round(Te/oe)+($+Math.round(_e/se))*te,he=0,Ce=0,Le=0,ue=0,me=0;me<pe;me++)for(var xe=0;xe<de;xe++){var je=W[ce+xe+me*te];he+=je<<24>>>24,Ce+=je<<16>>>24,Le+=je<<8>>>24,ue+=je>>>24}he=Math.round(he/Oe),Ce=Math.round(Ce/Oe),Le=Math.round(Le/Oe),ue=Math.round(ue/Oe),re[Te+_e*ie]=ue<<24|Le<<16|Ce<<8|he}return Z}function T(H,z){var I,U;const $=v();$.width=H.width,$.height=H.height,(I=$.getContext("2d"))===null||I===void 0||I.drawImage(H,0,0,$.width,$.height);const ee=D($.getContext("2d").getImageData(0,0,$.width,$.height),Math.floor($.width*z),Math.floor($.height*z),0,0,$.width,$.height);return $.width=Math.floor($.width*z),$.height=Math.floor($.height*z),(U=$.getContext("2d"))===null||U===void 0||U.putImageData(ee,0,0),$}const S=(H,z,I,U,$=0,ee=!1)=>{const G=Math.floor(Math.max(H.width*U,1)),Z=Math.floor(Math.max(H.height*U,1)),W=Math.min($*U,G/2,Z/2),te=Math.max(H.width/I.width,H.height/I.height)*U,re=H.page._exportingOrRendering&&p.flags.imageDownScalingEnabled&&te<1&&!ee,ie=I.x===0&&I.y===0&&I.width===(z==null?void 0:z.width)&&I.height===(z==null?void 0:z.height),oe=l.default.useMemo(()=>{if(!(!z||!z.width||!z.height))return ie&&W===0&&!re?void 0:v()},[z,W,re,ie]),se=()=>{if(!oe||!z)return;oe.width=G,oe.height=Z;const de=oe.getContext("2d");if(!de)return;W&&(de.beginPath(),de.moveTo(W,0),de.lineTo(G-W,0),de.arc(G-W,W,W,3*Math.PI/2,0,!1),de.lineTo(G,Z-W),de.arc(G-W,Z-W,W,0,Math.PI/2,!1),de.lineTo(W,Z),de.arc(W,Z-W,W,Math.PI/2,Math.PI,!1),de.lineTo(0,W),de.arc(W,W,W,Math.PI,3*Math.PI/2,!1),de.clip());const pe=re?T(z,te):z,Oe=re?{x:Math.floor(I.x*te),y:Math.floor(I.y*te),width:Math.floor(I.width*te),height:Math.floor(I.height*te)}:I;de.drawImage(pe,Oe.x,Oe.y,Oe.width,Oe.height,0,0,oe.width,oe.height)};return l.default.useLayoutEffect(()=>{se()},[oe,H.width,H.height,I.x,I.y,I.width,I.height,$,U,ee,H.page._exportingOrRendering,re]),l.default.useEffect(()=>()=>{oe&&oe.nodeName==="CANVAS"&&w.default.Util.releaseCanvas(oe)},[oe]),[oe||z,se]},A=(H,z,I,U)=>{const $=O(H.clipSrc||""),[ee,G]=(0,b.default)($,"anonymous"),Z=H.clipSrc?G:"loaded";(0,e.useLoader)(Z,H.clipSrc,H.id);const W=l.default.useMemo(()=>{if(z&&ee)return v()},[z,ee]);function te(){var re;if(!ee||!z||!z.width||!z.height||!ee||!ee.width||!ee.height||!W)return;const ie=v(),oe=Math.max(H.width/ee.width*I,H.height/ee.height*I);ie.width=ee.width*oe,ie.height=ee.height*oe,(re=ie.getContext("2d"))===null||re===void 0||re.drawImage(ee,0,0,ie.width,ie.height),W.width=Math.max(z.width,1),W.height=Math.max(z.height,1);const se=W.getContext("2d");se&&(se.save(),se.drawImage(ie,0,0,z.width,z.height),w.default.Util.releaseCanvas(ie),se.globalCompositeOperation="source-in",se.drawImage(z,0,0,W.width,W.height),se.restore())}return l.default.useLayoutEffect(()=>{te()},[W,z,ee,H.width,H.height,I,...U]),[H.clipSrc&&ee?W:z,te]},N=v(),k=(0,s.observer)(({element:H})=>{const z=Math.min(30,H.width/4,H.height/4),I=l.default.useRef(null);return l.default.useEffect(()=>{const U=I.current;if(!U)return;const $=new w.default.Animation(ee=>{U.rotate(((ee==null?void 0:ee.timeDiff)||0)/2)},U.getLayer());return $.start(),()=>{$.stop()}}),l.default.createElement(d.Group,{x:H.a.x,y:H.a.y,rotation:H.a.rotation,listening:!1,opacity:H.a.opacity,hideInExport:!H.showInExport},l.default.createElement(d.Rect,{width:H.width,height:H.height,fill:"rgba(124, 173, 212, 0.8)"}),l.default.createElement(d.Arc,{ref:I,x:H.width/2,y:H.height/2,fill:"white",outerRadius:Math.abs(z),innerRadius:Math.max(1,z-5),angle:270}))}),L=(0,s.observer)(({element:H})=>{const z="Can not load the video...",I=Math.max(10,Math.min(30,H.width/25));return l.default.createElement(d.Group,{x:H.a.x,y:H.a.y,rotation:H.a.rotation,listening:!1,opacity:H.a.opacity,hideInExport:!H.showInExport},l.default.createElement(d.Rect,{width:H.width,height:H.height,fill:"rgba(223, 102, 102, 0.8)"}),l.default.createElement(d.Text,{text:z,fontSize:I,width:H.width,height:H.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});function B(H,z,I){const U=l.default.useRef("loading"),$=l.default.useRef(null),[ee,G]=l.default.useState(0),Z=l.default.useRef(),W=l.default.useRef(),te=l.default.useRef();return Z.current===H&&W.current===z&&te.current===I||(U.current="loading",$.current=void 0,Z.current=H,W.current=z,te.current=I),l.default.useLayoutEffect(function(){if(H){var re=document.createElement("video");return re.addEventListener("canplay",ie),re.addEventListener("error",oe),z&&(re.crossOrigin=z),I&&(re.referrerpolicy=I),re.src=H,re.load(),function(){re.removeEventListener("canplay",ie),re.removeEventListener("error",oe)}}function ie(){U.current="loaded",$.current=re,$.current.currentTime=0,G(Math.random()),$.current.removeEventListener("canplay",ie)}function oe(se){U.current="failed",$.current=void 0,G(Math.random())}},[H,z,I]),[$.current,U.current]}let X=B;const K=H=>{X=H};e.setVideoLoaderHook=K;const Q=(H,z,I)=>{const U=l.default.useRef(),$=()=>{var ee;(ee=U.current)===null||ee===void 0||ee.call(U),U.current=void 0};l.default.useEffect(()=>$,[]),l.default.useLayoutEffect(()=>{const ee=z.slice(0,200),G=`video with id ${I} url: ${ee}`;H!=="loading"||U.current||(U.current=(0,m.incrementLoader)(G)),H!=="loading"&&$(),H==="failed"&&(0,m.triggerLoadError)(G)},[H])};e.useLoader=Q,e.VideoElement=(0,s.observer)(({element:H,store:z})=>{var I;const[U,$]=l.default.useState(!1),ee=l.default.useRef(null),G=l.default.useRef(null),[Z,W]=l.default.useState(!1),te=z.selectedShapes.indexOf(H)>=0,[re,ie]=l.default.useState(!1),[oe,se]=X(H.src,"anonymous"),de=z.activePage===H.page;(0,e.useLoader)(se,H.src,H.id),oe&&(oe.width=oe.videoWidth,oe.height=oe.videoHeight,oe.playsInline=!0);const pe=oe||N;l.default.useEffect(()=>{oe&&z.history.ignore(()=>{H.set({duration:1e3*oe.duration})})},[oe]),l.default.useEffect(()=>{var Ie;if(!oe)return;const Me=z.animatedElementsIds,Ye=(!Me.length||Me.includes(H.id))&&z.isPlaying,Mt=de&&(Ye||re);if(!Mt)return void oe.pause();Mt&&(oe.currentTime=H.startTime*oe.duration,oe.play());const _t=new w.default.Animation(()=>{bt()},(Ie=ee.current)===null||Ie===void 0?void 0:Ie.getLayer());_t.start();const Yt=()=>{ie(!1),oe.currentTime=H.startTime*oe.duration},wn=()=>{oe.currentTime>=H.endTime*oe.duration&&(oe.pause(),oe.currentTime=H.startTime*oe.duration,ie(!1))};return oe.addEventListener("ended",Yt),oe.addEventListener("timeupdate",wn),()=>{oe.pause(),_t.stop(),oe.removeEventListener("ended",Yt),oe.removeEventListener("timeupdate",wn)}},[oe,re,z.isPlaying,de]),l.default.useEffect(()=>{oe&&(oe.volume=H.volume)},[oe,H.volume]);const Oe=l.default.useRef();l.default.useEffect(()=>{const Ie=(0,c.autorun)(()=>{var Me,Ye;if(oe){const Mt=z.animatedElementsIds;if(Mt.length&&!Mt.includes(H.id))return;const _t=(z.currentTime-H.page.startTime)%H.duration;if(Math.abs(1e3*oe.currentTime-_t)>500||!z.isPlaying){const Yt=_t/1e3;Yt!==oe.currentTime&&(oe.currentTime=Yt),oe.readyState!==4&&!z.isPlaying&&!Oe.current&&(Oe.current=(0,m.incrementLoader)(`video ${H.id}`))}bt(),(Ye=(Me=ee.current)===null||Me===void 0?void 0:Me.getLayer())===null||Ye===void 0||Ye.batchDraw()}});return()=>{Ie(),Oe.current&&(Oe.current(),Oe.current=null)}},[z,oe]),l.default.useEffect(()=>{if(!oe)return;const Ie=()=>{var Ye,Mt;oe.readyState!==4&&H.page._exportingOrRendering||Oe.current&&(bt(),(Mt=(Ye=ee.current)===null||Ye===void 0?void 0:Ye.getLayer())===null||Mt===void 0||Mt.batchDraw(),Oe.current(),Oe.current=null)};let Me;return H.page._exportingOrRendering&&(Me=setInterval(Ie,50)),oe.addEventListener("timeupdate",Ie),oe.addEventListener("canplay",Ie),()=>{clearInterval(Me),oe.removeEventListener("timeupdate",Ie),oe.removeEventListener("canplay",Ie)}},[H.page._exportingOrRendering,oe,H.id,m.incrementLoader]);let{cropX:_e,cropY:Te,cropWidth:ce,cropHeight:he}=H;se!=="loaded"&&(_e=Te=0,ce=he=1);const Ce=pe.width*ce,Le=pe.height*he,ue=H.width/H.height;let me,xe;const je=Ce/Le,ot=H.type==="svg";ot?(me=Ce,xe=Le):ue>=je?(me=Ce,xe=Ce/ue):(me=Le*ue,xe=Le);const ht={x:pe.width*_e,y:pe.height*Te,width:me,height:xe},et=(I=H.cornerRadius)!==null&&I!==void 0?I:0,[Ke,ze]=S(H,pe,ht,z._elementsPixelRatio,et,U||H._cropModeEnabled||H.type==="svg");let[Be,Ve]=A(H,Ke,z._elementsPixelRatio,[ht,et,z._elementsPixelRatio]);function bt(){ze(),Ve()}const Ct=Math.max(H.width/me,H.height/xe);l.default.useEffect(()=>{var Ie;if(!H._cropModeEnabled)return;const Me=(Ie=ee.current)===null||Ie===void 0?void 0:Ie.getStage();function Ye(_t){H._cropModeEnabled&&_t.target!==G.current&&H.toggleCropMode(!1)}function Mt(_t){H._cropModeEnabled&&_t.target.parentNode!==Me.content&&H.toggleCropMode(!1)}return document.body.addEventListener("click",Mt),Me==null||Me.on("click",Ye),Me==null||Me.on("tap",Ye),()=>{document.body.removeEventListener("click",Mt),document.body.removeEventListener("touchstart",Mt),Me==null||Me.off("click",Ye),Me==null||Me.off("click",Ye)}},[H._cropModeEnabled]),l.default.useLayoutEffect(()=>{if(!(U||H._cropModeEnabled))return(0,h.applyFilter)(ee.current,H),(0,c.autorun)(()=>{(0,h.applyFilter)(ee.current,H)},{delay:100})},[pe,U,ce,he,H._cropModeEnabled]),l.default.useLayoutEffect(()=>{var Ie;U||H._cropModeEnabled?(Ie=ee.current)===null||Ie===void 0||Ie.clearCache():(0,h.applyFilter)(ee.current,H)},[U,H.width,H.height,H._cropModeEnabled]),l.default.useEffect(()=>{(0,h.applyFilter)(ee.current,H)},[H.shadowEnabled,H.shadowBlur,H.cornerRadius,H.shadowColor,H.shadowOffsetX,H.shadowOffsetY,H.shadowOpacity]);const we=l.default.useRef(null),Se=l.default.useRef(null),gt=l.default.useRef(null);l.default.useLayoutEffect(()=>{H._cropModeEnabled&&(Se.current.nodes([we.current]),gt.current.nodes([G.current]))},[H._cropModeEnabled]);const wt=Ie=>{Math.round(Ie.target.x())>0&&(Ie.target.x(0),Ie.target.scaleX(1)),Math.round(Ie.target.y())>0&&(Ie.target.y(0),Ie.target.scaleY(1));const Me=Ie.target.width()*Ie.target.scaleX(),Ye=Ie.target.height()*Ie.target.scaleY(),Mt=Math.min(1,me/Me),_t=Math.min(1,xe/Ye),Yt=1-Mt,wn=Math.min(Yt,Math.max(0,Math.round(-Ie.target.x())/Me)),Sn=1-_t,Qn=Math.min(Sn,Math.max(0,Math.round(-Ie.target.y())/Ye));Ie.target.setAttrs({x:-wn*pe.width,y:-Qn*pe.height,scaleX:1,scaleY:1}),H.set({cropX:wn,cropY:Qn,cropWidth:Mt,cropHeight:_t})},Pt=()=>{H.type!=="svg"&&H.contentEditable&&setTimeout(()=>{H.toggleCropMode(!0)})},mt=se==="loading",Wt=se==="failed",pn=!mt&&!Wt,Fe=l.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),rt=pn?H.a.opacity:0;(0,P.useFadeIn)(ee,rt);const ft=H.selectable||z.role==="admin",De=(0,g.isTouchDevice)();return l.default.createElement(l.default.Fragment,null,mt&&l.default.createElement(k,{element:H}),Wt&&l.default.createElement(L,{element:H}),l.default.createElement(d.Image,{ref:ee,name:"element",id:H.id,image:Be,x:H.a.x,y:H.a.y,width:H.a.width||1,height:H.a.height||1,rotation:H.a.rotation,opacity:rt,shadowEnabled:H.shadowEnabled,shadowBlur:H.shadowBlur,shadowOffsetX:H.shadowOffsetX,shadowOffsetY:H.shadowOffsetY,shadowColor:H.shadowColor,shadowOpacity:H.shadowOpacity,customCrop:ht,listening:ft,draggable:De?H.draggable&&te:H.draggable,preventDefault:!De||te,hideInExport:!H.showInExport,onMouseEnter:()=>{W(!0)},onMouseLeave:()=>{W(!1)},onDragMove:Ie=>{H.set({x:Ie.target.x(),y:Ie.target.y()})},onDragEnd:Ie=>{H.set({x:Ie.target.x(),y:Ie.target.y()})},onDblClick:Pt,onDblTap:Pt,onTransformStart:()=>{$(!0),Fe.current={cropX:H.cropX,cropY:H.cropY,cropWidth:H.cropWidth,cropHeight:H.cropHeight}},onTransform:Ie=>{var Me;const Ye=Ie.currentTarget,Mt=Math.abs(Ye.scaleX()-1)<1e-7?1:Ye.scaleX(),_t=Math.abs(Ye.scaleY()-1)<1e-7?1:Ye.scaleY();Ye.scaleX(1),Ye.scaleY(1);const Yt=(Me=Ie.target.getStage())===null||Me===void 0?void 0:Me.findOne("Transformer"),wn=1-me/pe.width,Sn=Math.min(wn,Math.max(0,H.cropX)),Qn=1-xe/pe.height,ii=Math.min(Qn,Math.max(0,H.cropY)),Sr=Yt.getActiveAnchor(),Ze=!(Sr.indexOf("middle")>=0||Sr.indexOf("center")>=0),Et=!Ze&&Mt<1&&Fe.current.cropHeight>xe/pe.height;let Lt=Ze?H.cropWidth:H.cropWidth*Mt;Et&&(Lt=H.cropWidth);const Gt=!Ze&&_t<1&&Fe.current.cropWidth>me/pe.width;let Vt=Ze?H.cropHeight:H.cropHeight*_t;Gt&&(Vt=H.cropHeight),ot&&(Lt=H.cropWidth,Vt=H.cropHeight),H.set({cropX:Sn,cropY:ii,x:Ye.x(),y:Ye.y(),width:Ye.width()*Mt,height:Ye.height()*_t,rotation:Ie.target.rotation(),cropWidth:Math.min(Lt,1-Sn),cropHeight:Math.min(Vt,1-ii)})},onTransformEnd:Ie=>{const Me=Ie.currentTarget;H.set({width:Me.width(),height:Me.height(),x:Me.x(),y:Me.y(),rotation:Ie.target.rotation(),cropWidth:me/pe.width,cropHeight:xe/pe.height}),$(!1)}}),l.default.createElement(d.Rect,{x:H.a.x,y:H.a.y,width:Math.max(H.a.width-H.borderSize,0),height:Math.max(H.a.height-H.borderSize,0),opacity:rt,offsetX:-H.borderSize/2,offsetY:-H.borderSize/2,stroke:H.borderColor,strokeWidth:H.borderSize,listening:!1,visible:!!H.borderSize,rotation:H.rotation,cornerRadius:Math.max(0,et-H.borderSize),hideInExport:!H.showInExport}),!z.isPlaying&&l.default.createElement(d.Image,{image:re?R:M,x:H.a.x,y:H.a.y,offsetX:-H.a.width/2+15/z.scale,offsetY:-H.a.height/2+15/z.scale,rotation:H.a.rotation,width:30/z.scale,height:30/z.scale,hideInExport:!0,onClick:()=>ie(!re),onTap:()=>ie(!re)}),H._cropModeEnabled&&l.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},l.default.createElement(d.Rect,{x:-window.innerWidth/z.scale,y:-window.innerWidth/z.scale,width:window.innerWidth/z.scale*3,height:window.innerWidth/z.scale*3,fill:"rgba(0,0,0,0.3)"}),l.default.createElement(d.Image,{listening:!1,image:Be,x:H.a.x,y:H.a.y,width:H.a.width,height:H.a.height,rotation:H.a.rotation,shadowEnabled:H.shadowEnabled,shadowBlur:H.shadowBlur}),l.default.createElement(d.Group,{x:H.a.x,y:H.a.y,rotation:H.a.rotation,scaleX:Ct,scaleY:Ct},l.default.createElement(d.Image,{image:pe,ref:G,opacity:.4,draggable:!0,x:-H.cropX*pe.width,y:-H.cropY*pe.height,onDragMove:wt,onTransform:wt}),l.default.createElement(d.Transformer,{ref:gt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,Me)=>Me.width<5||Me.height<5?Ie:Me,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),l.default.createElement(d.Rect,{width:me,height:xe,ref:we,listening:!1,onTransform:Ie=>{Ie.target.x()<-H.cropX*pe.width-1e-9&&(Ie.target.x(-H.cropX*pe.width),Ie.target.scaleX(1)),Ie.target.y()<-H.cropY*pe.height-1e-9&&(Ie.target.y(-H.cropY*pe.height),Ie.target.scaleY(1));const Me=Math.min(1,Math.max(0,H.cropX+Ie.target.x()/pe.width)),Ye=Math.min(1,Math.max(0,Ie.target.y()/pe.height+H.cropY)),Mt=Ie.target.width()*Ie.target.scaleX(),_t=Ie.target.height()*Ie.target.scaleY(),Yt=Math.min(1-Me,Mt/pe.width),wn=Math.min(1-Ye,_t/pe.height),Sn=Ie.target.getAbsolutePosition(Ie.target.getParent().getParent());Ie.target.scale({x:1,y:1}),Ie.target.position({x:0,y:0}),H.set({x:Sn.x,y:Sn.y,cropX:Me,cropY:Ye,cropWidth:Yt,cropHeight:wn,width:Math.min(Mt*Ct,pe.width*(1-Me)*Ct),height:Math.min(_t*Ct,pe.height*(1-Ye)*Ct)})}}),l.default.createElement(d.Transformer,{ref:Se,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,Me)=>Me.width<5||Me.height<5?Ie:Me,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:H.resizable}))),(Z||te)&&l.default.createElement(x.Highlighter,{element:H}))})}(Sa)),Sa}var pd={},i0={},Yb;function Dm(){return Yb||(Yb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0,e.starPath=l,e.diamondPath=s,e.pentagonPath=c,e.hexagonPath=d,e.speechBubblePath=w,e.crossPath=E,e.subTypeToPathDataFunc=x,e.figureToSvg=_;const i=({width:p,height:h,cornerRadius:P})=>{if(P>0){const g=Math.min(P,p/2,h/2);return`M 0 ${g} A ${g} ${g} 0 0 1 ${g} 0 L ${p-g} 0 A ${g} ${g} 0 0 1 ${p} ${g} L ${p} ${h-g} A ${g} ${g} 0 0 1 ${p-g} ${h} L ${g} ${h} A ${g} ${g} 0 0 1 0 ${h-g} Z`}return`M 0 0 L ${p} 0 L ${p} ${h} L 0 ${h} Z`};e.rectData=i;const t=({width:p,height:h})=>`M ${p/2} 0 L ${p} ${h} L 0 ${h} Z`;e.triangleData=t;const n=({width:p,height:h})=>`M 0 0 L ${p} 0 L 0 ${h} Z`;e.rightTriangleData=n;const o=({width:p,height:h})=>`M ${p/2} ${h/2} m -${p/2}, 0 a ${p/2},${h/2} 0 1,0 ${p},0 a ${p/2},${h/2} 0 1,0 -${p},0`;function l({width:p,height:h}){const P=p/2,g=h/2,v=p/2,y=h/2,O=v/2,M=y/2;let R="",D=Math.PI/5;for(let T=0;T<10;T++){const S=T%2==0?y:M,A=P+(T%2==0?v:O)*Math.sin(T*D),N=g-S*Math.cos(T*D);T===0?R=`M ${A} ${N}`:R+=` L ${A} ${N}`}return R+" Z"}function s({width:p,height:h}){const P=p/2,g=h/2;return`M ${P} 0 L ${p} ${g} L ${P} ${h} L 0 ${g} Z`}function c({width:p,height:h}){const P=p/2,g=h/2,v=p/2,y=h/2;let O="",M=2*Math.PI/5;for(let R=0;R<5;R++){const D=y,T=P+v*Math.sin(R*M),S=g-D*Math.cos(R*M);R===0?O=`M ${T} ${S}`:O+=` L ${T} ${S}`}return O+" Z"}function d({width:p,height:h}){const P=p/2,g=h/2,v=p/2,y=h/2;let O="",M=2*Math.PI/6;for(let R=0;R<6;R++){const D=y,T=P+v*Math.sin(R*M),S=g-D*Math.cos(R*M);R===0?O=`M ${T} ${S}`:O+=` L ${T} ${S}`}return O+" Z"}function b({path:p,aspectRatio:h,width:P,height:g}){return{path:p,scaleX:P/h.width,scaleY:g/h.height}}function w({width:p,height:h}){const P=.1*Math.min(p,h),g=.2*p,v=.2*h,y=.5*p;let O=`M ${P},0`;return O+=" H "+(p-P),O+=` A ${P},${P} 0 0 1 ${p},${P}`,O+=" V "+(h-P-v),O+=` A ${P},${P} 0 0 1 ${p-P},${h-v}`,O+=` H ${y+g/2}`,O+=` L ${y},${h}`,O+=` L ${y-g/2},${h-v}`,O+=` H ${P}`,O+=` A ${P},${P} 0 0 1 0,${h-P-v}`,O+=` V ${P}`,O+=` A ${P},${P} 0 0 1 ${P},0`,O+=" Z",O}function E({width:p,height:h}){const P=.3*p,g=.3*h,v=p/2,y=h/2,O=v-P/2,M=v+P/2,R=y-g/2,D=y+g/2;let T=`M ${O},0 `;return T+=`H ${M} `,T+=`V ${R} `,T+=`H ${p} `,T+=`V ${D} `,T+=`H ${M} `,T+=`V ${h} `,T+=`H ${O} `,T+=`V ${D} `,T+="H 0 ",T+=`V ${R} `,T+=`H ${O} `,T+="V 0 ",T+="Z",T}function x(p){return e.TYPES[p]||e.rectData}function m(p,h){const{width:P,height:g,fill:v,stroke:y,strokeWidth:O,dash:M}=p,R=(M||[]).map(N=>N*O);let D=h(p),T=1,S=1;typeof D!="string"&&(T=D.scaleX,S=D.scaleY,D=D.path);const A=`clip-${p.id||Math.random()}`;return`
240
+ <svg xmlns="http://www.w3.org/2000/svg" width="${P}" height="${g}">
241
+ <defs>
242
+ <clipPath id="${A}">
243
+ <path d="${D}" />
244
+ </clipPath>
245
+ </defs>
246
+
247
+ <!-- Path for the fill -->
248
+ <path d="${D}" fill="${v}" transform="scale(${T}, ${S})"/>
249
+
250
+ <!-- Path for the stroke, clipped by the star path -->
251
+ <path d="${D}" fill="none" stroke="${y}" stroke-width="${2*O}" clip-path="url(#${A})" transform="scale(${T}, ${S})" stroke-dasharray="${R.join(" ")}"/>
252
+ </svg>
253
+ `}function _(p){const{subType:h}=p,P=x(h);return P?m(p,P):(console.error(`Polotno error: Can not convert ${p.subType} figure to svg.`),(0,e.rectData)(p))}e.circleData=o,e.TYPES={rect:e.rectData,circle:e.circleData,star:l,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:s,pentagon:c,hexagon:d,speechBubble:w,cross:E,arc:({width:p,height:h})=>b({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:p,height:h}),cloud:({width:p,height:h})=>b({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:p,height:h}),rightArrow:({width:p,height:h})=>{const P=.6*p;return`M 0 ${h/4} L ${P} ${h/4} L ${P} 0 L ${p} ${h/2} L ${P} ${h} L ${P} ${.75*h} L 0 ${.75*h} Z`},leftArrow:({width:p,height:h})=>{const P=.4*p;return`M ${p} ${h/4} L ${P} ${h/4} L ${P} 0 L 0 ${h/2} L ${P} ${h} L ${P} ${.75*h} L ${p} ${.75*h} Z`},downArrow:({width:p,height:h})=>{const P=.6*h;return`M ${p/4} 0 L ${p/4} ${P} L 0 ${P} L ${p/2} ${h} L ${p} ${P} L ${.75*p} ${P} L ${.75*p} 0 Z`},upArrow:({width:p,height:h})=>{const P=.4*h;return`M ${p/4} ${h} L ${p/4} ${P} L 0 ${P} L ${p/2} 0 L ${p} ${P} L ${.75*p} ${P} L ${.75*p} ${h} Z`},asterisk1:({width:p,height:h})=>b({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:p,height:h}),asterisk2:({width:p,height:h})=>b({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:p,height:h}),bookmark:({width:p,height:h})=>b({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:p,height:h}),butterfly:({width:p,height:h})=>b({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:p,height:h}),cylinder:({width:p,height:h})=>b({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:p,height:h}),diamond2:({width:p,height:h})=>b({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:p,height:h}),door:({width:p,height:h})=>b({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:p,height:h}),drop1:({width:p,height:h})=>b({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:p,height:h}),drop2:({width:p,height:h})=>b({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:p,height:h}),explosion:({width:p,height:h})=>b({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:p,height:h}),flag:({width:p,height:h})=>b({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:p,height:h}),flower:({width:p,height:h})=>b({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:p,height:h}),frame:({width:p,height:h})=>b({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:p,height:h}),heart1:({width:p,height:h})=>b({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:p,height:h}),home:({width:p,height:h})=>b({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:p,height:h}),home2:({width:p,height:h})=>b({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:p,height:h}),hourglass:({width:p,height:h})=>b({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:p,height:h}),house:({width:p,height:h})=>b({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:p,height:h}),keyhole:({width:p,height:h})=>b({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:p,height:h}),kiss:({width:p,height:h})=>b({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:p,height:h}),leaf:({width:p,height:h})=>b({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:p,height:h}),lightning1:({width:p,height:h})=>b({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:p,height:h}),lightning2:({width:p,height:h})=>b({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:p,height:h}),magnet:({width:p,height:h})=>b({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:p,height:h}),mithosis:({width:p,height:h})=>b({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:p,height:h}),orangeRicky:({width:p,height:h})=>b({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:p,height:h}),party:({width:p,height:h})=>b({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:p,height:h}),pillow:({width:p,height:h})=>b({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:p,height:h}),polygon:({width:p,height:h})=>b({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:p,height:h}),rainbow:({width:p,height:h})=>b({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:p,height:h}),rhodeIsland:({width:p,height:h})=>b({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:p,height:h}),shell:({width:p,height:h})=>b({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:p,height:h}),shield1:({width:p,height:h})=>b({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:p,height:h}),shield2:({width:p,height:h})=>b({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:p,height:h}),skewedRectangle:({width:p,height:h})=>b({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:p,height:h}),softFlower:({width:p,height:h})=>b({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:p,height:h}),softStar:({width:p,height:h})=>b({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:p,height:h}),stairs1:({width:p,height:h})=>b({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:p,height:h}),stairs2:({width:p,height:h})=>b({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:p,height:h}),teewee:({width:p,height:h})=>b({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:p,height:h}),blob1:({width:p,height:h})=>b({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:p,height:h}),blob10:({width:p,height:h})=>b({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:p,height:h}),blob11:({width:p,height:h})=>b({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:p,height:h}),blob12:({width:p,height:h})=>b({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:p,height:h}),blob13:({width:p,height:h})=>b({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:p,height:h}),blob14:({width:p,height:h})=>b({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:p,height:h}),blob15:({width:p,height:h})=>b({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:p,height:h}),blob16:({width:p,height:h})=>b({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:p,height:h}),blob17:({width:p,height:h})=>b({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:p,height:h}),blob18:({width:p,height:h})=>b({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:p,height:h}),blob19:({width:p,height:h})=>b({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:p,height:h}),blob2:({width:p,height:h})=>b({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:p,height:h}),blob20:({width:p,height:h})=>b({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:p,height:h}),blob21:({width:p,height:h})=>b({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:p,height:h}),blob22:({width:p,height:h})=>b({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:p,height:h}),blob23:({width:p,height:h})=>b({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:p,height:h}),blob24:({width:p,height:h})=>b({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:p,height:h}),blob25:({width:p,height:h})=>b({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:p,height:h}),blob26:({width:p,height:h})=>b({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:p,height:h}),blob27:({width:p,height:h})=>b({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:p,height:h}),blob28:({width:p,height:h})=>b({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:p,height:h}),blob29:({width:p,height:h})=>b({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:p,height:h}),blob3:({width:p,height:h})=>b({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:p,height:h}),blob30:({width:p,height:h})=>b({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:p,height:h}),blob31:({width:p,height:h})=>b({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:p,height:h}),blob32:({width:p,height:h})=>b({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:p,height:h}),blob4:({width:p,height:h})=>b({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:p,height:h}),blob5:({width:p,height:h})=>b({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:p,height:h}),blob6:({width:p,height:h})=>b({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:p,height:h}),blob7:({width:p,height:h})=>b({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:p,height:h}),blob8:({width:p,height:h})=>b({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:p,height:h}),blob9:({width:p,height:h})=>b({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:p,height:h})}}(i0)),i0}var Kb;function Ex(){return Kb||(Kb=1,function(e){var i=pd&&pd.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=i(Tn()),n=Qi,o=Jo,l=Dm(),s=_c(),c=Xs(),d=zd(),b={};e.FigureElement=(0,n.observer)(({element:w,store:E})=>{const x=w.selectable||E.role==="admin",m=(0,c.isTouchDevice)(),[_,p]=t.default.useState(!1),h=E.selectedShapes.indexOf(w)>=0,P=Math.min(w.strokeWidth,w.width/2,w.height/2),g=Math.max(0,Math.min(w.width/2,w.height/2,w.cornerRadius)),v=(0,d.useColor)(w,w.a.fill,"fill"),y=Object.assign(Object.assign({width:w.a.width,height:w.a.height},v),{cornerRadius:g,opacity:w.animated("opacity"),shadowEnabled:w.shadowEnabled,shadowBlur:w.shadowBlur,shadowOffsetX:w.shadowOffsetX,shadowOffsetY:w.shadowOffsetY,shadowColor:w.shadowColor,shadowOpacity:w.shadowOpacity,preventDefault:!m||h,hideInExport:!w.showInExport}),O=(0,d.useColor)(w,w.stroke,"stroke"),M=Object.assign(Object.assign({visible:P>0,x:P/2,y:P/2,width:w.a.width-P,height:w.a.height-P},O),{strokeWidth:P,cornerRadius:Math.max(0,g-P),dash:w.dash.map(S=>S*P),opacity:w.animated("opacity"),hideInExport:!w.showInExport,listening:!1}),R=(D=w.subType,b[D]||(b[D]=(T=(0,l.subTypeToPathDataFunc)(D),(0,n.observer)(({element:S,fillProps:A,strokeProps:N})=>{let k=T({width:S.a.width,height:S.a.height,cornerRadius:S.cornerRadius}),L=1,B=1;typeof k!="string"&&(L=k.scaleX,B=k.scaleY,k=k.path);const X=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(o.Rect,{width:S.width,height:S.height,fill:"transparent"}),t.default.createElement(o.Path,Object.assign({},A,{ref:X,data:k,scaleX:L,scaleY:B})),t.default.createElement(o.Group,{clipFunc:K=>{const Q=X.current;if(Q){var H=Q.dataArray;K.beginPath();for(var z=0;z<H.length;z++){var I=H[z].command,U=H[z].points;switch(I){case"L":K.lineTo(U[0],U[1]);break;case"M":K.moveTo(U[0],U[1]);break;case"C":K.bezierCurveTo(U[0],U[1],U[2],U[3],U[4],U[5]);break;case"Q":K.quadraticCurveTo(U[0],U[1],U[2],U[3]);break;case"A":var $=U[0],ee=U[1],G=U[2],Z=U[3],W=U[4],te=U[5],re=U[6],ie=U[7],oe=G>Z?G:Z,se=G>Z?1:G/Z,de=G>Z?Z/G:1;K.translate($,ee),K.rotate(re),K.scale(se,de),K.arc(0,0,oe,W,W+te,1-ie),K.scale(1/se,1/de),K.rotate(-re),K.translate(-$,-ee);break;case"z":K.closePath()}}}},scaleX:L,scaleY:B},t.default.createElement(o.Path,Object.assign({},N,{x:0,y:0,data:k,strokeWidth:2*N.strokeWidth,dash:N.dash.map(K=>K)}))))}))),b[D]||o.Group);var D,T;return t.default.createElement(t.default.Fragment,null,t.default.createElement(o.Group,{id:w.id,x:w.a.x,y:w.a.y,rotation:w.a.rotation,opacity:w.a.opacity,listening:x,draggable:m?w.draggable&&h:w.draggable,name:"element",onMouseEnter:()=>{p(!0)},onMouseLeave:()=>{p(!1)},onDragMove:S=>{w.set({x:S.target.x(),y:S.target.y()})},onDragEnd:S=>{w.set({x:S.target.x(),y:S.target.y()})},onTransform:S=>{const A=S.target.scale();S.target.scaleX(1),S.target.scaleY(1),w.set({width:w.width*A.x,height:w.height*A.y,x:S.target.x(),y:S.target.y(),rotation:S.target.rotation()})}},t.default.createElement(R,{element:w,fillProps:y,strokeProps:M})),(_||h)&&t.default.createElement(s.Highlighter,{element:w}))})}(pd)),pd}var Xb;function Ox(){return Xb||(Xb=1,function(e){var i=id&&id.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=_;const t=i(Tn()),n=Qi,o=a4(),l=s4(),s=_x(),c=wx(),d=Sx(),b=Ex(),w=Jo,E=ts(),x=(0,n.observer)(h=>{const{element:P,store:g}=h,{children:v}=P,y=P.selectable||g.role==="admin";return t.default.createElement(w.Group,{opacity:P.opacity,listening:y,hideInExport:!P.showInExport},v.map(O=>t.default.createElement(p,Object.assign({},h,{key:O.id,store:g,element:O}))))}),m={text:o.TextElement,image:l.ImageElement,svg:l.ImageElement,line:c.LineElement,video:d.VideoElement,figure:b.FigureElement,group:x};function _(h,P){m[h]=P}const p=(0,n.observer)(h=>{let P=m[h.element.type];return h.element.type==="text"&&E.flags.htmlRenderEnabled&&(P=s.HTMLElement),h.element.visible?P?t.default.createElement(P,Object.assign({},h)):(console.error("Can not find component for "+h.element.type),null):null});e.default=p}(id)),id}var a0={},Zb;function xx(){return Zb||(Zb=1,function(e){function i(t,n,o="scale"){const l=n.width/n.height;let s,c;l>=t.width/t.height?(s=t.width,c=t.width/l):(s=t.height*l,c=t.height);let d=0,b=0;return o==="left-top"?(d=0,b=0):o==="left-middle"?(d=0,b=(t.height-c)/2):o==="left-bottom"?(d=0,b=t.height-c):o==="center-top"?(d=(t.width-s)/2,b=0):o==="center-middle"?(d=(t.width-s)/2,b=(t.height-c)/2):o==="center-bottom"?(d=(t.width-s)/2,b=t.height-c):o==="right-top"?(d=t.width-s,b=0):o==="right-middle"?(d=t.width-s,b=(t.height-c)/2):o==="right-bottom"?(d=t.width-s,b=t.height-c):o==="scale"?(d=0,b=0,s=t.width,c=t.height):console.error(new Error("Unknown clip position property - "+o)),{cropX:d,cropY:b,cropWidth:s,cropHeight:c}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=i}(a0)),a0}var $o={},o0={},Qb;function Px(){return Qb||(Qb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const i=jm();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";const t=()=>e.URL+"/api";e.getAPI=t;const n={},o=(v,y)=>{n[v]||(n[v]=!0,console.error(y))},l=`API for iconscout is provided as a demonstration.
254
+ For production usage you have to use your own API endpoint.
255
+ https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
256
+ https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:v,page:y=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${v}&per_page=20&page=${y}&KEY=${(0,i.getKey)()}`,unsplashDownload:v=>`${(0,e.getAPI)()}/download-unsplash?id=${v}&KEY=${(0,i.getKey)()}`,svgapiList:({query:v,page:y=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${v}&page=${y}&per_page=20&KEY=${(0,i.getKey)()}`,svgapiDownload:v=>`${(0,e.getAPI)()}/download-svgapi?path=${v}&KEY=${(0,i.getKey)()}`,iconscoutList:({query:v,page:y=1})=>(o("iconscout",l),`${(0,e.getAPI)()}/get-iconscout?query=${v}&page=${y}&KEY=${(0,i.getKey)()}`),iconscoutDownload:v=>(o("iconscout",l),`${(0,e.getAPI)()}/download-iconscout?uuid=${v}&KEY=${(0,i.getKey)()}`),nounProjectList:({query:v,page:y=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${v}&page=${y}&KEY=${(0,i.getKey)()}`,nounProjectDownload:v=>`${(0,e.getAPI)()}/download-nounproject?id=${v}&KEY=${(0,i.getKey)()}`,templateList:({query:v,page:y=1,sizeQuery:O})=>`${(0,e.getAPI)()}/get-templates?${O}&query=${v}&per_page=30&page=${y}&KEY=${(0,i.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,i.getKey)()}`,googleFontImage:v=>{return`${e.URL}/google-fonts-previews/black/${y=v,O=" ",M="-",y.replace(new RegExp(O,"g"),M)}.png`;var y,O,M},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,i.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,i.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,i.getKey)()}`};const s=()=>e.URLS.googleFontsList();e.getGoogleFontsListAPI=s;const c=v=>e.URLS.googleFontImage(v);e.getGoogleFontImage=c;const d=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,i.getKey)()}`;e.polotnoShapesList=d;const b=()=>e.URLS.removeBackground();e.removeBackground=b;const w=v=>e.URLS.templateList(v);e.templateList=w;const E=()=>e.URLS.textTemplateList();e.textTemplateList=E;const x=v=>e.URLS.unsplashList(v);e.unsplashList=x;const m=v=>e.URLS.unsplashDownload(v);e.unsplashDownload=m;const _=v=>e.URLS.svgapiList(v);e.svgapiList=_;const p=v=>e.URLS.svgapiDownload(v);e.svgapiDownload=p;const h=v=>e.URLS.iconscoutList(v);e.iconscoutList=h;const P=v=>e.URLS.iconscoutDownload(v);e.iconscoutDownload=P;const g=(v,y)=>{e.URLS[v]=y};e.setAPI=g}(o0)),o0}var Jb;function jm(){return Jb||(Jb=1,function(e){var i=$o&&$o.__createBinding||(Object.create?function(S,A,N,k){k===void 0&&(k=N);var L=Object.getOwnPropertyDescriptor(A,N);L&&!("get"in L?!A.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return A[N]}}),Object.defineProperty(S,k,L)}:function(S,A,N,k){k===void 0&&(k=N),S[k]=A[N]}),t=$o&&$o.__setModuleDefault||(Object.create?function(S,A){Object.defineProperty(S,"default",{enumerable:!0,value:A})}:function(S,A){S.default=A}),n=$o&&$o.__importStar||function(){var S=function(A){return S=Object.getOwnPropertyNames||function(N){var k=[];for(var L in N)Object.prototype.hasOwnProperty.call(N,L)&&(k[k.length]=L);return k},S(A)};return function(A){if(A&&A.__esModule)return A;var N={};if(A!=null)for(var k=S(A),L=0;L<k.length;L++)k[L]!=="default"&&i(N,A,k[L]);return t(N,A),N}}();Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=void 0,e.isKeyPaid=D,e.validateKey=T;const o=n(La),l=Px(),s=ts(),c=o.observable({value:!1}),d=()=>c.value;e.isCreditVisible=d;const b=o.action(()=>{c.value=!0});let w="";const E=()=>w||"";e.getKey=E;const x=5,m=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",h="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",P="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let g=window.location.origin;const v=navigator.userAgent.indexOf("Headless")>-1,y=navigator.userAgent.indexOf("Electron")>-1;g==="file://"&&v&&(g="headless"),g==="file://"&&y&&(g="electron");const O=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${g}" here: https://polotno.com/cabinet`;let M=fetch;const R=S=>{M=S};async function D(S){for(let A=0;A<x;A++)try{const N=await M((0,l.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:S,site:location.host})});if(!S)return console.warn(_),!1;if(N.status!==200){await new Promise(L=>setTimeout(L,m));continue}const k=await N.json();return k.is_valid||console.warn(p),k.is_paid||console.log(P,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),k.is_domain_valid||console.log(O,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,s.useRemoveBackground)(k.remove_background_enabled),k.is_paid||!1}catch{await new Promise(k=>setTimeout(k,m))}return console.error(h),!0}async function T(S,A){w=S,await D(S)&&!A||b()}e.__=R}($o)),$o}var l0={},e3;function Fm(){return e3||(e3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0;const i=({px:l,unit:s="px",dpi:c})=>{switch(s){case"pt":default:return l;case"mm":return l/(c/25.4);case"cm":return l/(c/2.54);case"in":return l/c}};e.pxToUnit=i;const t=({px:l,precious:s=2,dpi:c=72,unit:d="px"})=>parseFloat((0,e.pxToUnit)({px:l,dpi:c,unit:d}).toFixed(s));e.pxToUnitRounded=t;const n=({unitVal:l,dpi:s,unit:c})=>l/(0,e.pxToUnit)({px:1,unit:c,dpi:s});e.unitToPx=n;const o=l=>{const s=parseFloat((0,e.pxToUnit)(l).toFixed(1));switch(l.unit){case"pt":return`${Math.round(s)}pt`;case"mm":return`${s}mm`;case"cm":return`${s}cm`;case"in":return`${s}in`;default:return`${Math.round(s)}px`}};e.pxToUnitString=o}(l0)),l0}var t3;function Cx(){return t3||(t3=1,function(e){var i=Is&&Is.__rest||function(U,$){var ee={};for(var G in U)Object.prototype.hasOwnProperty.call(U,G)&&$.indexOf(G)<0&&(ee[G]=U[G]);if(U!=null&&typeof Object.getOwnPropertySymbols=="function"){var Z=0;for(G=Object.getOwnPropertySymbols(U);Z<G.length;Z++)$.indexOf(G[Z])<0&&Object.prototype.propertyIsEnumerable.call(U,G[Z])&&(ee[G[Z]]=U[G[Z]])}return ee},t=Is&&Is.__importDefault||function(U){return U&&U.__esModule?U:{default:U}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.useContextMenu=e.setTransformerStyle=void 0,e.registerTransformerAttrs=A;const n=t(Tn()),o=Qi,l=La,s=Jo,c=t(Dp()),d=t(Ji()),b=t(Ox()),w=y4(),E=s4(),x=xx(),m=jm(),_=Hd(),p=Fm(),h=ts(),P=Xs(),g=zd(),v=_m(),y=yc,O=d.default.DD._drag;window.removeEventListener("mousemove",O),d.default.DD._drag=function(U){(0,l.runInAction)(()=>{O.call(this,U)})},window.addEventListener("mousemove",d.default.DD._drag);const M=new d.default.Group;M.add(new d.default.Rect({width:20,height:20,fill:"white"})),M.add(new d.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 R=M.toCanvas({pixelRatio:2,width:20,height:20}),D={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:U=>{U.hasName("rotater")&&U.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:R,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},T=U=>{Object.assign(D,U)};e.setTransformerStyle=T;const S={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 A(U,$){S[U]=S[U]||$,Object.assign(S[U],$)}const N=U=>n.default.createElement(s.Rect,Object.assign({},U,{preventDefault:!1})),k=U=>{var{url:$}=U,ee=i(U,["url"]);const[G,Z]=(0,c.default)($,"anonymous"),W=G?(0,x.getCrop)(G,{width:ee.width,height:ee.height},"center-middle"):{};return(0,E.useImageLoader)(Z,$,"page background"),n.default.createElement(s.Image,Object.assign({image:G},ee,W))},L=U=>{const $=(0,g.useColor)({fill:U.fill,a:{width:U.width,height:U.height}});return n.default.createElement(s.Rect,Object.assign({},U,$))},B=U=>{const{background:$,scale:ee,borderColor:G}=U,Z=i(U,["background","scale","borderColor"]),W=n.default.useMemo(()=>!!d.default.Util.colorToRGBA($)||(0,v.isGradient)($),[$]),te=n.default.useMemo(()=>{const re=document.createElement("canvas"),ie=30;re.width=60,re.height=60;const oe=re.getContext("2d");return oe&&(oe.fillStyle="black",oe.fillRect(ie,0,ie,ie),oe.fillRect(0,ie,ie,ie)),re},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(s.Rect,Object.assign({fillPatternImage:te},Z,{opacity:.1,hideInExport:!0})),W?n.default.createElement(L,Object.assign({fill:$},Z)):n.default.createElement(k,Object.assign({url:$},Z)))},X=(0,o.observer)(({selection:U})=>U.visible?n.default.createElement(s.Rect,{name:"selection",x:Math.min(U.x1,U.x2),y:Math.min(U.y1,U.y2),width:Math.abs(U.x1-U.x2),height:Math.abs(U.y1-U.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),K=(0,o.observer)(({x:U,y:$,width:ee,height:G,rotation:Z,anchor:W,store:te})=>{const re=(0,_.getClientRect)({x:U,y:$,width:ee,height:G,rotation:d.default.Util.radToDeg(Z)});if(W===void 0)return null;const ie=(G/2+70)*Math.cos(Z-Math.PI/2),oe=(G/2+70)*Math.sin(Z-Math.PI/2),se=(0,p.pxToUnitRounded)({unit:te.unit,dpi:te.dpi,px:ee/te.scale,precious:te.unit==="px"?0:1})+" x "+(0,p.pxToUnitRounded)({unit:te.unit,dpi:te.dpi,px:G/te.scale,precious:te.unit==="px"?0:1})+(te.unit==="px"?"":" "+te.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(s.Label,{x:(re.minX+re.maxX)/2+ie,y:(re.minY+re.maxY)/2+oe,offsetX:14,offsetY:14,visible:W==="rotater"},n.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(d.default.Util.radToDeg(Z)).toString()+"°"})),n.default.createElement(s.Label,{x:(re.minX+re.maxX)/2,y:re.maxY+20,visible:W!=="rotater"},n.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:se})))}),Q=(0,o.observer)(({elements:U,store:$})=>{const ee=U.filter(Z=>Z.alwaysOnTop),G=U.filter(Z=>!Z.alwaysOnTop).concat(ee);return n.default.createElement(n.default.Fragment,null,G.map(Z=>n.default.createElement(b.default,{key:Z.id,store:$,element:Z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),H=({store:U})=>{const[$,ee]=n.default.useState(!1),[G,Z]=n.default.useState({x:0,y:0});return{open:n.default.useCallback(te=>{ee(!0),Z(te)},[]),close:n.default.useCallback(()=>{ee(!1)},[]),props:{isOpen:$,offset:G,setIsOpen:ee}}};e.useContextMenu=H;let z=null;const I=U=>{z=U};e.registerNextDomDrop=I,e.default=(0,o.observer)(({store:U,page:$,width:ee,height:G,pageControlsEnabled:Z,backColor:W,pageBorderColor:te,activePageBorderColor:re,components:ie,bleedColor:oe,altCloneEnabled:se})=>{const de=U.bleedVisible?$.bleed:0,pe=$.computedWidth+2*de,Oe=$.computedHeight+2*de,_e=(ee-pe*U.scale)/2,Te=(G-Oe*U.scale)/2,ce=n.default.useRef(null),he=n.default.useRef(null),Ce=n.default.useRef(null),Le=Z==null||Z,[ue,me]=n.default.useState(null),[xe,je]=n.default.useState({}),ot=(0,e.useContextMenu)({store:U}),ht=U.selectedElements.find(Fe=>Fe._cropModeEnabled),et=U.selectedShapes.filter(Fe=>!Fe.resizable).length>0,Ke=U.selectedShapes.filter(Fe=>!Fe.draggable).length>0,ze=U.selectedElements.filter(Fe=>!Fe.visible).length>0;n.default.useLayoutEffect(()=>{var Fe,rt,ft;if(!ce.current)return;const De=ce.current.getStage(),Ie=U.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:De.findOne("#"+Ye.id)).filter(Ye=>Ye),Me=U.selectedElements.length===1&&((Fe=U.selectedElements[0])===null||Fe===void 0?void 0:Fe.type)||"many";S[Me]?(ce.current.setAttrs(Object.assign(Object.assign({},D),S[Me])),Me!=="svg"&&Me!=="image"||U.selectedElements[0].keepRatio||ce.current.setAttrs({enabledAnchors:D.enabledAnchors}),Me==="text"&&h.flags.textVerticalResizeEnabled&&ce.current.setAttrs({enabledAnchors:(rt=S.text.enabledAnchors)===null||rt===void 0?void 0:rt.concat(["bottom-center"])})):ce.current.setAttrs(D),et&&ce.current.enabledAnchors([]),Ke&&ce.current.rotateEnabled(!1),Ie.find(Ye=>Ye==null?void 0:Ye.isDragging())&&Ie.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),ce.current.nodes(Ie),(ft=ce.current.getLayer())===null||ft===void 0||ft.batchDraw()},[U.selectedElements,ht,et,ze,Ke]);const Be=(0,o.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Ve=n.default.useRef(!1),bt=(0,P.isTouchDevice)(),Ct=(0,l.action)(Fe=>{var rt,ft;if(bt)return;Ve.current=!1;const De=Fe.target.findAncestor(".elements-container"),Ie=Fe.target.findAncestor("Transformer"),Me=Fe.target.findAncestor(".page-abs-container");if(De||Ie||Me)return;const Ye=(rt=Fe.target.getStage())===null||rt===void 0?void 0:rt.getPointerPosition();Ye&&(Be.visible=!0,Be.x1=Ye.x,Be.y1=Ye.y,Be.x2=Ye.x,Be.y2=Ye.y,((ft=Fe.target.getStage())===null||ft===void 0?void 0:ft.getPointersPositions().length)>=2&&(Be.visible=!1))});n.default.useEffect(()=>{const Fe=(0,l.action)(ft=>{var De,Ie;if(!Be.visible)return;(De=he.current)===null||De===void 0||De.setPointersPositions(ft);let Me=((Ie=he.current)===null||Ie===void 0?void 0:Ie.getPointerPosition())||{x:Be.x2,y:Be.y2};Be.x2=Me.x,Be.y2=Me.y}),rt=(0,l.action)(()=>{if(!Be.visible||!he.current)return;const ft=he.current.findOne(".selection"),De=ft?ft.getClientRect():{width:0,height:0,x:0,y:0};if(De.width&&De.height){const Ie=[];he.current.find(".element").forEach(Ye=>{const Mt=Ye.getClientRect(),_t=U.getElementById(Ye.id()),Yt=_t==null?void 0:_t.draggable,wn=_t==null?void 0:_t.selectable;d.default.Util.haveIntersection(De,Mt)&&Yt&&wn&&Ie.push(_t.top.id)});const Me=[...new Set(Ie)];U.selectElements(Me)}Be.visible=!1,Ve.current=!0});return window.addEventListener("mousemove",Fe),window.addEventListener("touchmove",Fe),window.addEventListener("mouseup",rt),window.addEventListener("touchend",rt),()=>{window.removeEventListener("mousemove",Fe),window.removeEventListener("touchmove",Fe),window.removeEventListener("mouseup",rt),window.removeEventListener("touchend",rt)}},[]);const we=n.default.useRef(!1);n.default.useEffect(()=>{var Fe;let rt;const ft=(Fe=Ce.current)===null||Fe===void 0?void 0:Fe.closest(".polotno-workspace-inner"),De=()=>{we.current=!0,clearTimeout(rt),rt=setTimeout(()=>{we.current=!1},300)};return ft.addEventListener("scroll",De),()=>{clearTimeout(rt),ft.removeEventListener("scroll",De)}},[]);const Se=Fe=>{if(U.activePage!==$&&$.select(),we.current||Ve.current)return;const rt=Fe.evt.ctrlKey||Fe.evt.metaKey||Fe.evt.shiftKey,ft=Fe.target.findAncestor(".elements-container"),De=Fe.target.findAncestor(".page-abs-container"),Ie=Fe.target.findAncestor("Transformer");if(!(rt||ft||Ie||De))return void U.selectElements([]);const Me=Fe.target.findAncestor(".element",!0),Ye=U.getElementById(Me==null?void 0:Me.id()),Mt=Ye==null?void 0:Ye.top,_t=Mt==null?void 0:Mt.id,Yt=U.selectedElementsIds.indexOf(_t)>=0;_t&&rt&&!Yt?U.selectElements(U.selectedElementsIds.concat([_t])):_t&&rt&&Yt?U.selectElements(U.selectedElementsIds.filter(wn=>wn!==_t)):!_t||rt||Yt||U.selectElements([_t])};(0,w.useSnap)(ce,U);const gt=U.activePage===$,wt=ie==null?void 0:ie.PageControls,Pt=ie==null?void 0:ie.Tooltip,mt=ie==null?void 0:ie.ContextMenu,Wt=1/U.scale,pn=0/U.scale;return n.default.createElement("div",{ref:Ce,onDragOver:Fe=>Fe.preventDefault(),onDrop:Fe=>{if(Fe.preventDefault(),!he.current)return;he.current.setPointersPositions(Fe);const rt=he.current.findOne(".elements-container").getRelativePointerPosition(),ft=he.current.getPointerPosition(),De=he.current.getAllIntersections(ft).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),Ie=[...new Set(De.reverse())].map(Ye=>U.getElementById(Ye.id())),Me=Ie[0];z&&(z(rt,Me,{elements:Ie,page:$}),z=null)},style:{position:"relative",width:ee+"px"},className:"polotno-page-container"+(gt?" active-page":"")},n.default.createElement(s.Stage,{ref:he,width:Math.min(ee,10*window.innerWidth),height:Math.min(G,10*window.innerHeight),onClick:Se,onTap:Se,onContextMenu:Fe=>{Fe.evt.preventDefault();const rt=Fe.target.findAncestor(".element",!0),ft=U.getElementById(rt==null?void 0:rt.id()),De=ft==null?void 0:ft.top,Ie=De==null?void 0:De.id;Ie?U.selectedElementsIds.indexOf(Ie)>=0||U.selectElements([Ie]):U.selectElements([]),ot.open({x:Fe.evt.clientX,y:Fe.evt.clientY})},onMouseDown:Ct,onMouseMove:Fe=>{if(!Fe.evt.altKey&&ue)return void me(null);if(!Fe.evt.altKey)return;const rt=Fe.target.findAncestor(".element",!0),ft=rt==null?void 0:rt.id();if(!U.selectedElements[0]||U.selectedElementsIds.includes(ft))return;const De=(0,_.getTotalClientRect)(U.selectedShapes),Ie=ft?U.getElementById(ft):{x:0,y:0,width:$.computedWidth,height:$.computedHeight,rotation:0},Me=(0,_.getClientRect)(Ie),Ye=[];De.minX>Me.maxX&&Ye.push({distance:De.minX-Me.maxX,box1:De,box2:Me,points:[{x:De.minX,y:De.minY+De.height/2},{x:Me.maxX,y:De.minY+De.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),De.maxX<Me.minX&&Ye.push({distance:Me.minX-De.maxX,box1:De,box2:Me,points:[{x:De.maxX,y:De.minY+De.height/2},{x:Me.minX,y:De.minY+De.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),De.minY>Me.maxY&&Ye.push({box1:De,box2:Me,distance:De.minY-Me.maxY,points:[{x:De.minX+De.width/2,y:De.minY},{x:De.minX+De.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]}),De.maxY<Me.minY&&Ye.push({box1:De,box2:Me,distance:Me.minY-De.maxY,points:[{x:De.minX+De.width/2,y:De.maxY},{x:De.minX+De.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),De.minX>=Me.minX&&De.maxX<=Me.maxX&&De.minY>=Me.minY&&De.maxY<=Me.maxY&&(Ye.push({distance:De.minX-Me.minX,box1:De,box2:Me,points:[{x:De.minX,y:De.minY+De.height/2},{x:Me.minX,y:De.minY+De.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),Ye.push({distance:Me.maxX-De.maxX,box1:De,box2:Me,points:[{x:De.maxX,y:De.minY+De.height/2},{x:Me.maxX,y:De.minY+De.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),Ye.push({box1:De,box2:Me,distance:De.minY-Me.minY,points:[{x:De.minX+De.width/2,y:De.minY},{x:De.minX+De.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),Ye.push({box1:De,box2:Me,distance:Me.maxY-De.maxY,points:[{x:De.minX+De.width/2,y:De.maxY},{x:De.minX+De.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]})),JSON.stringify(ue)!==JSON.stringify(Ye)&&me(Ye)},onDragStart:Fe=>{var rt;const ft=Fe.target.findAncestor(".element",!0);if(ft){const De=U.getElementById(ft==null?void 0:ft.id()),Ie=De==null?void 0:De.top,Me=Ie==null?void 0:Ie.id;!(U.selectedElementsIds.indexOf(Me)>=0)&&Me&&(U.selectElements([Me]),Fe.target.stopDrag(),Fe.target.startDrag(Fe),(rt=ce.current)===null||rt===void 0||rt.startDrag(Fe))}ue&&me(null)},pageId:$.id,style:{position:"relative"}},n.default.createElement(s.Layer,null,n.default.createElement(N,{width:ee,height:G,fill:W}),n.default.createElement(s.Group,{x:_e,y:Te,scaleX:U.scale,scaleY:U.scale,name:"page-container"},n.default.createElement(s.Group,{name:"page-container-2"},n.default.createElement(s.Group,{name:"page-background-group",x:de,y:de},n.default.createElement(B,{x:-$.bleed,y:-$.bleed,width:$.computedWidth+2*$.bleed,height:$.computedHeight+2*$.bleed,background:$.background,name:"page-background",preventDefault:!1,scale:U.scale})),n.default.createElement(s.Group,{x:de,y:de,name:"elements-container",listening:!U.isPlaying},n.default.createElement(s.Rect,{name:"elements-area",width:$.computedWidth,height:$.computedHeight,listening:!1}),n.default.createElement(Q,{elements:$.children,store:U})),n.default.createElement(s.Rect,{stroke:oe,name:"bleed",strokeWidth:$.bleed,x:$.bleed/2,y:$.bleed/2,width:$.computedWidth+$.bleed,height:$.computedHeight+$.bleed,listening:!1,visible:$.bleed>0&&U.bleedVisible,hideInExport:!0}))),n.default.createElement(s.Line,{name:"workspace-background",points:[0,0,ee,0,ee,G,0,G,0,0,_e,Te,_e,G-Te,ee-_e,G-Te,ee-_e,Te,_e,Te],listening:!1,closed:!0,fill:W}),n.default.createElement(s.Group,{x:_e,y:Te,scaleX:U.scale,scaleY:U.scale},n.default.createElement(s.Rect,{name:"page-highlight",hideInExport:!0,x:-Wt/2-pn,y:-Wt/2-pn,width:pe+Wt+2*pn,height:Oe+Wt+2*pn,stroke:gt&&U.pages.length>1?re:te,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(s.Group,{x:_e+de*U.scale,y:Te+de*U.scale,scaleX:U.scale,scaleY:U.scale,name:"page-abs-container"},n.default.createElement(s.Transformer,{ref:ce,onDragStart:Fe=>{var rt;!((rt=Fe.evt)===null||rt===void 0)&&rt.altKey&&se&&U.selectedElements.forEach(ft=>{const De=ft.clone({},{skipSelect:!0}),Ie=$.children.indexOf(ft);$.setElementZIndex(De.id,Ie)}),U.history.startTransaction()},onDragEnd:()=>{U.history.endTransaction()},onTransformStart:()=>{U.history.startTransaction()},boundBoxFunc:(Fe,rt)=>{const ft=Math.abs(rt.width)<1||Math.abs(rt.height)<1,De=Math.abs(Fe.width)<1||Math.abs(Fe.height)<1;return ft&&!De?Fe:rt},onTransform:Fe=>{var rt,ft;const De=ce.current.nodes(),Ie=De[De.length-1];if(Fe.target!==Ie)return;const Me=(rt=ce.current)===null||rt===void 0?void 0:rt.__getNodeRect(),Ye=(ft=ce.current)===null||ft===void 0?void 0:ft.getActiveAnchor();je({anchor:Ye,x:Me.x,y:Me.y,rotation:Me.rotation,width:Me.width,height:Me.height})},onTransformEnd:Fe=>{je({}),U.history.endTransaction()},visible:!U.isPlaying}),ue&&ue.map(({points:Fe,distance:rt,box1:ft,box2:De},Ie)=>n.default.createElement(s.Group,{name:"distances-container",hideInExport:!0,key:Ie,listening:!1},n.default.createElement(s.Rect,Object.assign({},ft,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(s.Rect,Object.assign({},De,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(s.Line,{points:[Fe[0].x,Fe[0].y,Fe[1].x,Fe[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(s.Line,{points:[Fe[1].x,Fe[1].y,Fe[2].x,Fe[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(s.Label,{x:(Fe[0].x+Fe[1].x)/2,y:(Fe[0].y+Fe[1].y)/2,offsetY:-10,scaleX:1/U.scale,scaleY:1/U.scale},n.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,p.pxToUnitString)({unit:U.unit,dpi:U.dpi,px:rt})})))),$._rendering&&n.default.createElement(s.Group,null,n.default.createElement(s.Rect,{width:pe,height:Oe,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(s.Text,{text:"Rendering...",fontSize:60,width:pe,height:Oe,align:"center",verticalAlign:"middle"})),Pt&&n.default.createElement(Pt,{components:ie,store:U,page:$,stageRef:he}),mt&&n.default.createElement(y.Html,null,n.default.createElement(mt,Object.assign({components:ie,store:U},ot.props)))),n.default.createElement(K,Object.assign({},xe,{store:U})),n.default.createElement(X,{selection:Be}),(0,m.isCreditVisible)()&&n.default.createElement(s.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:ee-170,y:G-18,onMouseEnter:Fe=>{Fe.target.getStage().container().style.cursor="pointer"},onMouseLeave:Fe=>{Fe.target.getStage().container().style.cursor=""},onTouchStart:Fe=>{Fe.cancelBubble=!0},onMouseDown:Fe=>{Fe.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(s.Group,{name:"line-guides"}))),Le&&wt&&n.default.createElement(wt,{store:U,page:$,xPadding:_e,yPadding:Te}))})}(Is)),Is}var gd={},n3;function kx(){return n3||(n3=1,function(e){var i=gd&&gd.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=m;const t=i(Tn()),n=Hd(),o=Fm(),l=Qi,s=v4(),c=(0,s.styled)("div",t.default.forwardRef)`
257
+ position: absolute;
258
+ top: 0;
259
+ left: 0;
260
+ pointer-events: none;
261
+ `,d=(0,s.styled)("div",t.default.forwardRef)`
262
+ height: 14px;
263
+ position: sticky;
264
+ font-size: 8px;
265
+ line-height: 14px;
266
+ top: 0;
267
+ left: 0;
268
+ color: grey;
269
+ border-bottom: 1px solid grey;
270
+ background-color: #e8e8e8;
271
+ overflow: hidden;
272
+ `,b=(0,s.styled)("div",t.default.forwardRef)`
273
+ left: 0;
274
+ width: 14px;
275
+ position: sticky;
276
+ font-size: 8px;
277
+ line-height: 14px;
278
+ color: grey;
279
+ border-right: 1px solid grey;
280
+ background-color: #e8e8e8;
281
+ overflow: hidden;
282
+ `,w=(0,s.styled)("div",t.default.forwardRef)`
283
+ position: absolute;
284
+ border-left: 1px solid grey;
285
+ padding-left: 2px;
286
+ `,E=(0,s.styled)("div",t.default.forwardRef)`
287
+ position: absolute;
288
+ left: 14px;
289
+ border-left: 1px solid grey;
290
+ padding-left: 2px;
291
+ transform: rotate(90deg);
292
+ transform-origin: left top;
293
+ overflow: hidden;
294
+ `,x=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function m(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,l.observer)(({store:_,width:p,height:h})=>{const P=t.default.useRef(null);if(!_.activePage)return null;const g=_.activePage,v=(_.bleedVisible&&g.bleed,g.computedWidth*_.scale),y=g.computedHeight*_.scale,O=(p-v)/2,M=(R=N=>(0,o.unitToPx)({unitVal:N,dpi:_.dpi,unit:_.unit})*_.scale,x.find(N=>R(N)>30)||1e4);var R;const D=(0,o.unitToPx)({unitVal:M,dpi:_.dpi,unit:_.unit})*_.scale,T=Math.round(v/D)+1,S=Math.round(y/D)+1,A=(0,n.getTotalClientRect)(_.selectedShapes);return t.default.createElement(c,{ref:P,className:"polotno-rulers"},t.default.createElement(d,{style:{width:p+"px"},className:"polotno-x-ruler"},[...Array(T)].map((N,k)=>t.default.createElement(w,{key:k,style:{left:O+k*D+"px",width:D+"px"}},_.unit==="px"||M>=1?Math.round(M*k):(M*k).toFixed(1))),!!_.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:O+A.x*_.scale+"px",height:"14px",width:A.width*_.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),_.pages.map((N,k)=>{var L;const B=N.computedHeight*_.scale,X=(h-B)/2;return t.default.createElement(b,{key:N.id,style:{height:h+"px"},className:"polotno-y-ruler"},[...Array(S)].map((K,Q)=>t.default.createElement(E,{key:Q,style:{top:X+Q*D-14+"px",width:D+"px"}},_.unit==="px"||M>=1?Math.round(M*Q):(M*Q).toFixed(1))),((L=_.selectedShapes[0])===null||L===void 0?void 0:L.page)===N&&t.default.createElement("div",{style:{position:"absolute",top:X+A.y*_.scale-14+"px",width:"14px",height:A.height*_.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(gd)),gd}var md={},r3;function Ax(){return r3||(r3=1,function(e){var i=md&&md.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=i(Tn()),n=Qi,o=La;function l(s){const[c,d]=t.default.useState(null),[b,w]=t.default.useState("loading");return t.default.useEffect(()=>{const E=new Audio(s),x=()=>{w("loaded"),d(E)},m=()=>{w("failed"),d(null)};return E.addEventListener("canplay",x),E.addEventListener("error",m),()=>{E.removeEventListener("canplay",x),E.removeEventListener("error",m)}},[s]),[c,b]}e.AudioElement=(0,n.observer)(({audio:s,store:c})=>{const[d,b]=l(s.src);return t.default.useEffect(()=>{d&&c.history.ignore(()=>{s.set({duration:1e3*d.duration})})},[d,s,c.history]),t.default.useEffect(()=>{if(!d)return;const w=()=>{d.currentTime=s.startTime*s.duration/1e3},E=()=>{const m=s.endTime*s.duration/1e3;d.currentTime>=m&&(d.pause(),d.currentTime=s.startTime*s.duration/1e3)};d.addEventListener("ended",w),d.addEventListener("timeupdate",E);const x=(0,o.autorun)(()=>{const m=c.animatedElementsIds;if(m.length&&!m.includes(s.id))return;const _=c.currentTime-s.delay,p=s.duration*(s.endTime-s.startTime),h=_>=0&&_<p;if(!(c.isPlaying&&c.animatedElementsIds.length===0&&h))return void d.pause();d.volume=s.volume,d.paused&&d.play();const P=_%p/1e3+s.startTime*s.duration/1e3,g=d.currentTime;Math.abs(g-P)>.5&&P!==g&&(d.currentTime=P)});return()=>{d.pause(),d.removeEventListener("ended",w),d.removeEventListener("timeupdate",E),x()}},[c.isPlaying,s.startTime,s.endTime,s.volume,d]),null})}(md)),md}var s0={},u0={},vd={};let Tx="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",b4=e=>crypto.getRandomValues(new Uint8Array(e)),_4=(e,i,t)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*i/e.length);return(l=i)=>{let s="";for(;;){let c=t(o),d=o;for(;d--;)if(s+=e[c[d]&n]||"",s.length===l)return s}}},Rx=(e,i=21)=>_4(e,i,b4),Mx=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((i,t)=>(t&=63,t<36?i+=t.toString(36):t<62?i+=(t-26).toString(36).toUpperCase():t>62?i+="-":i+="_",i),"");const Lx=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:Rx,customRandom:_4,nanoid:Mx,random:b4,urlAlphabet:Tx},Symbol.toStringTag,{value:"Module"})),Gp=Xl(Lx);var c0={},Ai={},f0={},d0={},i3;function w4(){return i3||(i3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0;const i=function(t,n){if(t===n)return!0;if(typeof t=="object"&&t!=null&&typeof n=="object"&&n!=null){if(Object.keys(t).length!=Object.keys(n).length)return!1;for(var o in t)if(!n.hasOwnProperty(o)||!(0,e.deepEqual)(t[o],n[o]))return!1;return!0}return!1};e.deepEqual=i}(d0)),d0}var a3;function Nx(){return a3||(a3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const i=ea,t=w4();Object.assign(i.types),e.UndoManager=i.types.model("UndoManager",{history:i.types.array(i.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 o,l,s=!1,c=null,d=0,b=0;const w=()=>b>0;function E(){const m=(0,i.getSnapshot)(o);return{pages:m.pages,width:m.width,height:m.height,custom:m.custom}}function x(m){const _=o.pages.map(g=>g.id),p=m.pages.map(g=>g.id),h=!(0,t.deepEqual)(_,p),P=!(0,t.deepEqual)(o.custom,m.custom);h?(0,i.applySnapshot)(o.pages,m.pages):o.pages.forEach((g,v)=>{(0,i.applySnapshot)(g,m.pages[v])}),P&&o.set({custom:m.custom}),o.setSize(m.width,m.height)}return{startTransaction(){b++},endTransaction(m){b--,m||this.requestAddState(E())},async ignore(m,_=!1,p=!1){p&&await new Promise(y=>setTimeout(y,10)),d&&n.addUndoState();let h=w();n.startTransaction();let P=b;try{await m()}catch(y){setTimeout(()=>{throw y})}const g=P!==b,v=!g;n.endTransaction(v),_||h||n.replaceState(),g||(clearTimeout(d),d=0)},async transaction(m){await n.ignore(m,!0),this.addUndoState()},requestAddState(m){c=m,d||w()||(s?s=!1:d=setTimeout(()=>{d=0,clearTimeout(d),w()||this.addUndoState()},100))},addUndoState(){if(s)return void(s=!1);const m=n.history[n.undoIdx];!(0,t.deepEqual)(c,m)&&(clearTimeout(d),d=0,n.history.splice(n.undoIdx+1),n.history.push(c),n.undoIdx=n.history.length-1)},afterCreate(){if(o=(0,i.resolvePath)(n,".."),!o)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");l=(0,i.onSnapshot)(o,()=>{this.requestAddState(E())}),n.history.length===0&&this.requestAddState(E())},clear(){clearTimeout(d),d=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(E())},beforeDestroy(){l()},undo(){d&&this.addUndoState(),n.canUndo?(n.undoIdx--,s=!0,x(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){d&&this.addUndoState(),n.canRedo?(n.undoIdx++,s=!0,x(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=E()}}}),e.default=e.UndoManager}(f0)),f0}var h0={},o3;function Ix(){return o3||(o3=1,function(e){async function i(t,n){const o=await(await fetch(t)).blob(),l=document.createElement("a"),s=URL.createObjectURL(o);l.href=s,l.download=n,document.body.appendChild(l),l.click(),setTimeout(function(){document.body.removeChild(l),window.URL.revokeObjectURL(s)},0)}Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=i}(h0)),h0}var p0={},l3;function Dx(){return l3||(l3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=n;const i="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let t;function n(){return t?Promise.resolve(t):new Promise(o=>{var l=document.createElement("script");l.onload=function(){t=window.jspdf.jsPDF,o(t)},l.src=i,document.head.appendChild(l)})}}(p0)),p0}var g0={},s3;function jx(){return s3||(s3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getGIF=t,e.createGIF=n;const i="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function t(){return window.GIF?Promise.resolve(window.GIF):new Promise(o=>{var l=document.createElement("script");l.onload=function(){o(window.GIF)},l.src=i,document.head.appendChild(l)})}async function n({width:o,height:l}){return new(await t())({workers:4,width:o,height:l,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
295
+ (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]);
296
+ `],{type:"application/javascript"}))})}}(g0)),g0}var m0={},u3;function Fx(){return u3||(u3=1,function(e){async function i(t){for(let n=0;n<30;n++){const o=await t();if(o)return o;await new Promise(l=>setTimeout(l,50))}}Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=i}(m0)),m0}var Ea={},v0={},c3;function _p(){return c3||(c3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getImageSize=t,e.loadImage=n,e.cropImage=o,e.getCrop=l;const i=qd();function t(s){return new Promise(c=>{const d=document.createElement("img");d.onload=async()=>{d.width===0||d.height===0?c(await(0,i.getSvgSize)(s)):c({width:d.width,height:d.height})},d.crossOrigin="anonymous",d.src=s})}function n(s){return new Promise((c,d)=>{const b=document.createElement("img");b.onload=()=>{c(b)},b.onerror=w=>{d(w)},b.crossOrigin="anonymous",b.src=s})}async function o(s,c){const d=await n(s),b=document.createElement("canvas");b.width=2*d.width,b.height=2*d.height,b.getContext("2d").drawImage(d,0,0,b.width,b.height);const w=document.createElement("canvas");w.width=c.width,w.height=c.height;const E=w.getContext("2d");let{cropX:x,cropY:m}=c;const _=b.width*c.cropWidth,p=b.height*c.cropHeight,h=c.width/c.height;let P,g;const v=_/p;return c.type==="svg"?(P=_,g=p):h>=v?(P=_,g=_/h):(P=p*h,g=p),E.drawImage(b,x*b.width,m*b.height,P,g,0,0,w.width,w.height),w.toDataURL("image/png")}function l(s,c){const{width:d,height:b}=s,w=d/b;let E,x;w>=c.width/c.height?(E=c.width,x=c.width/w):(E=c.height*w,x=c.height);const m=(c.width-E)/2,_=(c.height-x)/2;return{cropX:m/c.width,cropY:_/c.height,cropWidth:E/c.width,cropHeight:x/c.height}}}(v0)),v0}var y0={},f3;function S4(){return f3||(f3=1,function(e){var i;function t(n){let o={filter:"",html:void 0};switch(n){case i.warm:return o.filter="sepia(0.5) saturate(1.5) brightness(1.1) contrast(1.1)",o;case i.cold:return o.filter="url(#blue-boost)",o.html=`
297
+ <svg style="display: none">
298
+ <filter id="blue-boost">
299
+ <feColorMatrix
300
+ type="matrix"
301
+ values="
302
+ 0.85 0 0 0 0
303
+ 0 0.9 0 0 0
304
+ 0 0 1.15 0 0
305
+ 0 0 0 1 0"
306
+ />
307
+ </filter>
308
+ </svg>`,o;case"natural":return o.filter="saturate(1.3) brightness(1.1) contrast(1.2)",o;default:return null}}Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=t,function(n){n.sepia="sepia",n.grayscale="grayscale",n.natural="natural",n.warm="warm",n.cold="cold"}(i||(e.Effects=i={}))}(y0)),y0}var d3;function zx(){return d3||(d3=1,function(e){var i=Ea&&Ea.__createBinding||(Object.create?function(S,A,N,k){k===void 0&&(k=N);var L=Object.getOwnPropertyDescriptor(A,N);L&&!("get"in L?!A.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return A[N]}}),Object.defineProperty(S,k,L)}:function(S,A,N,k){k===void 0&&(k=N),S[k]=A[N]}),t=Ea&&Ea.__setModuleDefault||(Object.create?function(S,A){Object.defineProperty(S,"default",{enumerable:!0,value:A})}:function(S,A){S.default=A}),n=Ea&&Ea.__importStar||function(){var S=function(A){return S=Object.getOwnPropertyNames||function(N){var k=[];for(var L in N)Object.prototype.hasOwnProperty.call(N,L)&&(k[k.length]=L);return k},S(A)};return function(A){if(A&&A.__esModule)return A;var N={};if(A!=null)for(var k=S(A),L=0;L<k.length;L++)k[L]!=="default"&&i(N,A,k[L]);return t(N,A),N}}(),o=Ea&&Ea.__rest||function(S,A){var N={};for(var k in S)Object.prototype.hasOwnProperty.call(S,k)&&A.indexOf(k)<0&&(N[k]=S[k]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(k=Object.getOwnPropertySymbols(S);L<k.length;L++)A.indexOf(k[L])<0&&Object.prototype.propertyIsEnumerable.call(S,k[L])&&(N[k[L]]=S[k[L]])}return N};Object.defineProperty(e,"__esModule",{value:!0}),e.fixRatio=x,e.jsonToDOM=M,e.jsonToHTML=T;const l=_p(),s=n(qd()),c=_p(),d=Dm(),b=m4(),w=S4(),E=(S,A,...N)=>({type:S,props:A,children:N||[]});function x(S){var A=new DOMParser().parseFromString(S,"image/svg+xml");return A.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(A)}const m=async({element:S,page:A,store:N})=>{let{src:k}=S;if(S.type==="svg"&&Object.keys(S.colorsReplace).length){const ie=await s.urlToString(k);k=s.replaceColors(ie,new Map(Object.entries(S.colorsReplace)))}let L="";S.flipX&&(L+="scaleX(-1)"),S.flipY&&(L+="scaleY(-1)"),L||(L="none");const B={};if(S.clipSrc){const ie=await s.urlToBase64(S.clipSrc);B["clip-path"]=`url(${ie})`}const X=await(0,c.loadImage)(k),K=X.width*S.cropWidth,Q=X.height*S.cropHeight,H=S.width/S.height;let z,I;const U=K/Q;S.type==="svg"?(z=K,I=Q):H>=U?(z=K,I=K/H):(z=Q*H,I=Q);const $=z/X.width,ee=I/X.height,G=z/I>S.width/S.height?S.height/I:S.width/z,Z=z*G/$,W=I*G/ee,te=S.cropX*G*X.width,re=S.cropY*G*X.height;return E("div",{style:Object.assign(Object.assign({},B),{width:"100%",height:"100%","border-radius":S.cornerRadius+"px",border:S.borderSize?`${S.borderSize}px solid ${S.borderColor}`:"none",background:`url(${k})`,transform:L,"background-size":`${Math.round(Z)}px ${Math.round(W)}px`,"background-position-x":-Math.round(te)+"px","background-position-y":-Math.round(re)+"px"})})},_=async({element:S,page:A,store:N})=>{let k={top:0,left:0};S.fill.indexOf("gradient")>=0&&(k=Object.assign(Object.assign({},k),{"background-color":S.fill,"background-image":S.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const L=S.backgroundPadding*(S.fontSize*S.lineHeight),B=E("div",{style:{position:"absolute",top:-L/2+"px",left:-L/2+"px",display:S.backgroundEnabled?"block":"none",width:S.width+L+"px",height:S.height+L+"px","background-color":S.backgroundColor,"border-radius":S.backgroundCornerRadius*(S.fontSize*S.lineHeight*.5)+"px"}});S.verticalAlign==="middle"?(k.top="50%",k.transform="translateY(-50%)"):S.verticalAlign==="bottom"&&(k.bottom=0);const X=/<[a-z][\s\S]*>/i.test(S.text),K=Object.assign(Object.assign({},k),{position:"absolute",width:S.width+"px",color:S.fill,"white-space":"pre-wrap","font-size":S.fontSize+"px","text-align":S.align,"font-family":S.fontFamily,"text-decoration":S.textDecoration||"none","line-height":S.lineHeight,"letter-spacing":S.letterSpacing+"em","font-style":S.fontStyle,"font-weight":S.fontWeight,"-webkit-text-stroke":`${S.strokeWidth}px ${S.stroke}`,"text-stroke":`${S.strokeWidth}px ${S.stroke}`}),Q="el-"+S.id,H=X?{id:Q}:{},z=`<style>#${Q} {${b.resetStyleContent}}</style>`,I=E("div",Object.assign(Object.assign({style:K},H),{innerHTML:X?`${z}${S.text}`:S.text.split(`
309
+ `).join("<br />")}));return E("div",{style:{position:"relative",width:"100%",height:"100%"}},B,I)},p=({element:S,type:A})=>{const N={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return A==="arrow"||A==="triangle"?E("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},N)):A==="bar"?E("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},N)):A==="circle"?E("circle",Object.assign({r:S.height},N)):A==="square"?E("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},N)):null},h=async({element:S,page:A,store:N})=>E("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},E("rect",{x:0,y:0,width:S.width,height:S.height,fill:S.color}),E("g",{transform:`translate(0 ${S.height/2})`},p({element:S,type:S.startHead})),E("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},p({element:S,type:S.endHead}))),P=async({element:S,page:A,store:N,elementHook:k})=>{const L=await Promise.all(S.children.map(X=>y({element:X,page:A,store:N,elementHook:k}))),B=E("div",{style:{"transform-origin":"top left",opacity:S.opacity}},...L);return k&&k({dom:B,element:S})||B},g=async({element:S,page:A,store:N,elementHook:k})=>{const L=(0,d.figureToSvg)(S),B=E("div",{innerHTML:L});return k&&k({dom:B,element:S})||B},v={image:m,svg:m,text:_,line:h,figure:g,group:P};async function y({element:S,page:A,store:N,elementHook:k}){let L=await v[S.type];L||(L=()=>E("div",{}),console.error(`HTML export does not support ${S.type} type...`));const B=await L({element:S,page:A,store:N}),X=[],K=[];if(S.blurEnabled&&X.push(`blur(${S.blurRadius/2}px)`),S.brightnessEnabled&&X.push(`brightness(${100*S.brightness+100}%)`),S.sepiaEnabled&&X.push("sepia()"),S.grayscaleEnabled&&X.push("grayscale()"),S.filters)for(const H of Object.keys(S.filters)){const z=(0,w.shapeFilterToCSS)(w.Effects[H]);z&&(X.push(z.filter),z.html&&K.push(z.html))}S.shadowEnabled&&X.push(`drop-shadow(${S.shadowOffsetX}px ${S.shadowOffsetY}px ${S.shadowBlur}px ${S.shadowColor})`);const Q=E("div",{id:S.id,style:{position:"absolute",left:S.x+"px",top:S.y+"px",width:S.width+"px",height:S.height+"px",transform:`rotate(${S.rotation}deg)`,"transform-origin":"top left",opacity:S.opacity,display:S.visible&&S.showInExport?"block":"none",filter:X.join(" ")||"none"}},B,...K);return k&&k({dom:Q,element:S})||Q}async function O({page:S,store:A,elementHook:N}){const k=await Promise.all(S.children.map(K=>y({element:K,page:S,store:A,elementHook:N}))),L=S.width==="auto"?A.width:S.width,B=S.height==="auto"?A.height:S.height;let X={};if(S.background.indexOf("url")>=0||S.background.indexOf("http")>=0||S.background.indexOf(".jpg")>=0||S.background.indexOf(".png")>=0||S.background.indexOf(".jpeg")>=0){const{width:K,height:Q}=await(0,c.loadImage)(S.background),H=await m({element:Object.assign({x:0,y:0,width:K,height:Q,src:S.background,cornerRadius:0},(0,l.getCrop)({width:K,height:Q},{width:K,height:Q})),page:S,store:A});k.unshift(H)}else X=Object.assign(Object.assign({},X),{"background-color":S.background});return E("div",{className:"page",id:S.id,style:Object.assign(Object.assign({},X),{width:L+"px",height:B+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...k)}async function M({json:S,elementHook:A}){const N=await Promise.all(S.pages.map(B=>O({page:B,store:S,elementHook:A}))),k=[];S.pages.forEach(B=>{B.children.forEach(X=>{X.type==="text"&&k.indexOf(X.fontFamily)===-1&&k.push(X.fontFamily)})});const L=k.map(B=>S.fonts.find(X=>X.fontFamily===B)?E("style",{},""):E("link",{href:`https://fonts.googleapis.com/css?family=${B}`,rel:"stylesheet"}));return E("div",{className:"design"},...L,...N)}const R=(S,A)=>typeof A=="object"?`${S}="${Object.keys(A).map(N=>`${N}:${A[N]};`).join(" ")}"`:`${S}="${A}"`,D=({dom:S})=>{if(typeof S=="string")return S;if(!S)return"";const A=S.props,{innerHTML:N}=A,k=o(A,["innerHTML"]);return`<${S.type} ${Object.keys(k).map(L=>R(L,S.props[L])).join(" ")}>${N||S.children.map(L=>D({dom:L})).join("")}</${S.type}>`};async function T({json:S,elementHook:A}){const N=await M({json:S,elementHook:A});return D({dom:N})}}(Ea)),Ea}var Oa={},h3;function Bx(){return h3||(h3=1,function(e){var i=Oa&&Oa.__createBinding||(Object.create?function(L,B,X,K){K===void 0&&(K=X);var Q=Object.getOwnPropertyDescriptor(B,X);Q&&!("get"in Q?!B.__esModule:Q.writable||Q.configurable)||(Q={enumerable:!0,get:function(){return B[X]}}),Object.defineProperty(L,K,Q)}:function(L,B,X,K){K===void 0&&(K=X),L[K]=B[X]}),t=Oa&&Oa.__setModuleDefault||(Object.create?function(L,B){Object.defineProperty(L,"default",{enumerable:!0,value:B})}:function(L,B){L.default=B}),n=Oa&&Oa.__importStar||function(){var L=function(B){return L=Object.getOwnPropertyNames||function(X){var K=[];for(var Q in X)Object.prototype.hasOwnProperty.call(X,Q)&&(K[K.length]=Q);return K},L(B)};return function(B){if(B&&B.__esModule)return B;var X={};if(B!=null)for(var K=L(B),Q=0;Q<K.length;Q++)K[Q]!=="default"&&i(X,B,K[Q]);return t(X,B),X}}(),o=Oa&&Oa.__rest||function(L,B){var X={};for(var K in L)Object.prototype.hasOwnProperty.call(L,K)&&B.indexOf(K)<0&&(X[K]=L[K]);if(L!=null&&typeof Object.getOwnPropertySymbols=="function"){var Q=0;for(K=Object.getOwnPropertySymbols(L);Q<K.length;Q++)B.indexOf(K[Q])<0&&Object.prototype.propertyIsEnumerable.call(L,K[Q])&&(X[K[Q]]=L[K[Q]])}return X};Object.defineProperty(e,"__esModule",{value:!0}),e.forEveryChild=void 0,e.fixRatio=x,e.jsonToDOM=S,e.jsonToSVG=k;const l=_p(),s=n(qd()),c=_p(),d=Dm(),b=S4(),w=(L,B)=>{if(L.children)for(const X of L.children){if(B(X)===!0)break;(0,e.forEveryChild)(X,B)}};e.forEveryChild=w;const E=(L,B,...X)=>({type:L,props:B,children:X||[]});function x(L){var B=new DOMParser().parseFromString(L,"image/svg+xml");return B.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(B)}const m=async L=>{try{const B=await fetch(L);if(typeof Buffer<"u"){const X=await B.arrayBuffer(),K=Buffer.from(X).toString("base64");return`data:${B.headers.get("content-type")||"image/png"};base64,${K}`}{const X=await B.blob();return new Promise((K,Q)=>{const H=new FileReader;H.onloadend=()=>K(H.result),H.onerror=Q,H.readAsDataURL(X)})}}catch(B){return console.error("Error converting URL to data URL:",B),L}},_=async({element:L,page:B,store:X})=>{let{src:K}=L;if(L.type==="svg"){const Oe=await s.urlToString(K);K=s.replaceColors(Oe,new Map(Object.entries(L.colorsReplace)))}else K=await m(K);let Q="";L.flipX&&(Q+="scaleX(-1)"),L.flipY&&(Q+="scaleY(-1)"),L.clipSrc&&await s.urlToBase64(L.clipSrc);const H=await(0,c.loadImage)(K),z=H.width*L.cropWidth,I=H.height*L.cropHeight,U=L.width/L.height;let $,ee;const G=z/I;L.type==="svg"?($=z,ee=I):U>=G?($=z,ee=z/U):($=I*U,ee=I);const Z=$/H.width,W=ee/H.height,te=$/ee>L.width/L.height?L.height/ee:L.width/$,re=$*te/Z,ie=ee*te/W,oe=L.cropX*H.width*te,se=L.cropY*H.height*te,de=`clip-${L.id}`,pe=K.replace(/&/g,"&amp;");return E("g",{style:{transform:Q}},E("defs",{},E("clipPath",{id:de},E("rect",{x:0,y:0,width:L.width,height:L.height}))),E("image",{href:pe,x:-oe,y:-se,width:re,height:ie,preserveAspectRatio:"none","clip-path":`url(#${de})`}))},p=async({element:L,page:B,store:X})=>{const K=(U,$,ee,G,Z)=>{const W=document.createElement("canvas").getContext("2d");return W.font=`${Z} ${G} ${$}px ${ee}`,W.measureText(U).width},Q=((U,$,ee,G,Z,W)=>{const te=[];return U.split(`
310
+ `).forEach(re=>{const ie=re.split(" ");let oe="";for(let se=0;se<ie.length;se++){const de=oe+ie[se]+" ";K(de,ee,G,Z,W)>$+.5&&se>0?(te.push(oe.trim()),oe=ie[se]+" "):oe=de}te.push(oe.trim())}),te})(L.text,L.width,L.fontSize,L.fontFamily,L.fontWeight,L.fontStyle),H=L.fontSize*L.lineHeight,z=L.align==="center"?"middle":L.align==="right"?"end":"start",I=Q.map((U,$)=>E("tspan",{x:L.align==="center"?L.width/2:L.align==="right"?L.width:0,dy:$===0?0:H,innerHTML:U}));return E("g",{},E("text",{fill:L.fill,y:L.fontSize,"font-size":L.fontSize+"px","text-anchor":z,"font-family":L.fontFamily,"font-style":L.fontStyle,"font-weight":L.fontWeight,"text-decoration":L.textDecoration,"line-height":L.lineHeight,"letter-spacing":L.letterSpacing+"em","stroke-width":L.strokeWidth,stroke:L.stroke},...I))},h=({element:L,type:B})=>{const X={"stroke-width":L.height,stroke:L.color,"line-cap":"round","stroke-linejoin":"round",opacity:L.opacity};return B==="arrow"||B==="triangle"?E("polyline",Object.assign({points:`${3*L.height},${2*-L.height} 0,0 ${3*L.height},${2*L.height}`},X)):B==="bar"?E("polyline",Object.assign({points:`0,${2*-L.height} 0,${2*L.height}`},X)):B==="circle"?E("circle",Object.assign({r:L.height},X)):B==="square"?E("polyline",Object.assign({points:`${-L.height},${-L.height} ${-L.height},${L.height} ${L.height},${L.height} ${L.height},${-L.height}`},X)):null},P=async({element:L,page:B,store:X})=>E("g",{},E("line",{x1:0,y1:L.height/2,x2:L.width,y2:L.height/2,stroke:L.color,"stroke-width":L.height}),E("g",{transform:`translate(0 ${L.height/2})`},h({element:L,type:L.startHead})),E("g",{transform:`translate(${L.width} ${L.height/2}) rotate(180)`},h({element:L,type:L.endHead}))),g=async({element:L,page:B,store:X,elementHook:K})=>{const Q=await Promise.all(L.children.map(z=>M({element:z,page:B,store:X,elementHook:K}))),H=E("g",{opacity:L.opacity,style:{"transform-origin":"top left"}},...Q);return K&&K({dom:H,element:L})||H};function v(L){let B=L.replace(/<svg[^>]*>/,"");return B=B.replace(/<\/svg>/,""),B}const y=async({element:L,page:B,store:X,elementHook:K})=>{const Q=v((0,d.figureToSvg)(L)),H=E("g",{innerHTML:Q});return K&&K({dom:H,element:L})||H},O={image:_,svg:_,text:p,line:P,figure:y,group:g};async function M({element:L,page:B,store:X,elementHook:K}){let Q=await O[L.type];Q||(Q=()=>E("g",{}),console.error(`SVG export does not support ${L.type} type...`));const H=await Q({element:L,page:B,store:X}),z=[],I=[];if(L.blurEnabled&&z.push(`blur(${L.blurRadius/2}px)`),L.brightnessEnabled&&z.push(`brightness(${100*L.brightness+100}%)`),L.sepiaEnabled&&z.push("sepia()"),L.grayscaleEnabled&&z.push("grayscale()"),L.shadowEnabled&&z.push(`drop-shadow(${L.shadowOffsetX}px ${L.shadowOffsetY}px ${L.shadowBlur}px ${L.shadowColor})`),L.filters)for(const $ of Object.keys(L.filters)){const ee=(0,b.shapeFilterToCSS)(b.Effects[$]);if(ee&&(z.push(ee.filter),ee.html)){const G=ee.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");I.push(G)}}const U=E("g",{className:"element",id:L.id,transform:L.type!=="group"?`translate(${L.x}, ${L.y}) rotate(${L.rotation})`:void 0,display:L.visible?void 0:"none",style:{"transform-origin":"top left",filter:z.join(" ")}},H,...I);return K&&K({dom:U,element:L})||U}async function R({page:L,store:B,elementHook:X}){const K=await Promise.all(L.children.map(z=>M({element:z,page:L,store:B,elementHook:X}))),Q=L.background.indexOf("url")>=0||L.background.indexOf("http")>=0||L.background.indexOf(".jpg")>=0||L.background.indexOf(".png")>=0||L.background.indexOf(".jpeg")>=0;let H;if(Q){const z=await(0,c.loadImage)(L.background);H=await(0,c.cropImage)(L.background,Object.assign({width:B.width,height:B.height,x:0,y:0},(0,l.getCrop)({width:B.width,height:B.height},{width:z.width,height:z.height})))}return E("g",{className:"page",style:{}},Q?E("image",{"xlink:href":H,x:0,y:0,width:B.width,height:B.height,preserveAspectRatio:"none"}):E("rect",{x:0,y:0,width:B.width,height:B.height,fill:Q?void 0:L.background}),...K)}async function D(L){try{const B=await fetch(L),X=await B.blob();return new Promise((K,Q)=>{const H=new FileReader;H.onloadend=()=>K(H.result),H.onerror=Q,H.readAsDataURL(X)})}catch(B){return console.error("Error embedding font:",B),L}}async function T(L,B){return await Promise.all(L.map(async X=>{var K,Q;const H=B.find(z=>z.fontFamily===X);if(H){const z=await D(H.url);return E("style",{},`@font-face { font-family: ${X}; src: url(${z}); }`)}{const z=`https://fonts.googleapis.com/css?family=${X}:bi,normal,i,b`;try{const I=await fetch(z),U=await I.text(),$=(Q=(K=U.match(/url\((.*?)\)/g))===null||K===void 0?void 0:K.map(G=>G.replace(/url\((.*?)\)/,"$1")))===null||Q===void 0?void 0:Q.filter(G=>G.startsWith("https"));if(!($!=null&&$.length))throw new Error("No font URLs found");const ee=await Promise.all($.map(async G=>{const Z=await D(G),W=U.match(/font-style:\s*(.*?);/),te=U.match(/font-weight:\s*(.*?);/),re=W?W[1]:"normal",ie=te?te[1]:"normal";return`@font-face {
311
+ font-family: ${X};
312
+ font-style: ${re};
313
+ font-weight: ${ie};
314
+ src: url(${Z});
315
+ }`}));return E("style",{},ee.join(`
316
+ `))}catch(I){return console.error("Error embedding Google Font:",I),E("defs",{},E("style",{type:"text/css",innerHTML:`@import url('${z}');`.replace(/&/g,"&amp;")}))}}}))}async function S({json:L,elementHook:B}){const X=await Promise.all(L.pages.map(H=>R({page:H,store:L,elementHook:B}))),K=[];(0,e.forEveryChild)({children:L.pages},H=>{H.type==="text"&&K.indexOf(H.fontFamily)===-1&&K.push(H.fontFamily)});const Q=await T(K,L.fonts);return E("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${L.width} ${L.height}`,width:L.width,height:L.height},...Q,...X)}const A=(L,B)=>typeof B=="object"?`${L}="${Object.keys(B).map(X=>`${X}:${B[X]};`).join(" ")}"`:B==null||B===""?"":`${L}="${B}"`,N=({dom:L,nestLevel:B=0})=>{if(typeof L=="string")return L;if(!L)return"";const X=L.props,{innerHTML:K}=X,Q=o(X,["innerHTML"]),H=" ".repeat(B);return`${H}<${L.type} ${Object.keys(Q).map(z=>A(z,Q[z])).join(" ")}>${K||`
317
+ `+L.children.map(z=>N({dom:z,nestLevel:B+1})).join("")}${H}</${L.type}>
318
+ `};async function k({json:L,elementHook:B}){const X=await S({json:L,elementHook:B});return N({dom:X})}}(Oa)),Oa}var b0={},p3;function E4(){return p3||(p3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const i=ea,t=Gp,n=Td(),o=zm(),l=Td(),s=Hd();e.Page=i.types.model("Page",{id:i.types.identifier,children:i.types.array(i.types.late(()=>n.ElementTypes)),width:i.types.optional(i.types.union(i.types.number,i.types.literal("auto")),"auto"),height:i.types.optional(i.types.union(i.types.number,i.types.literal("auto")),"auto"),background:"white",bleed:0,custom:i.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(c=>{const d=Object.assign({},c),b={};for(var w in d)w[0]!=="_"&&(b[w]=c[w]);return b}).views(c=>({get store(){return(0,i.getParentOfType)(c,o.Store)}})).views(c=>({get startTime(){let d=0;for(const b of c.store.pages){if(b.id===c.id)return d;d+=b.duration}return d},get _exportingOrRendering(){return c._exporting||c._rendering}})).views(c=>({get computedWidth(){return c.width==="auto"?c.store.width:c.width},get computedHeight(){return c.height==="auto"?c.store.height:c.height}})).actions(c=>({toJSON:()=>JSON.parse(JSON.stringify((0,i.getSnapshot)(c))),_forEachElementUp(d,b){const w=d.map(E=>({id:E,index:c.children.findIndex(x=>x.id===E)}));w.sort((E,x)=>x.index-E.index);for(const{index:E}of w){if(E==-1)continue;const x=E<c.children.length-1&&c.children[E+1],m=d.indexOf(x==null?void 0:x.id)>=0;E===c.children.length-1||m||b(E)}},_forEachElementDown(d,b){const w=d.map(E=>({id:E,index:c.children.findIndex(x=>x.id===E)}));w.sort((E,x)=>E.index-x.index);for(const{index:E}of w){if(E==-1)continue;const x=E>0&&c.children[E-1],m=d.indexOf(x==null?void 0:x.id)>=0;E===0||m||b(E)}return!1}})).actions(c=>({clone(d={}){const b=c.toJSON();b.children.forEach(m=>{m.id=(0,t.nanoid)(10),(0,l.forEveryChild)(m,_=>{_.id=(0,t.nanoid)(10)})});const w=Object.assign(Object.assign(Object.assign({},b),{id:(0,t.nanoid)(10)}),d),E=c.store.addPage(w),x=c.store.pages.indexOf(c);E.setZIndex(x+1),E.select()},setZIndex(d){c.store.setPageZIndex(c.id,d)},set(d){Object.assign(c,d)},select(){c.store.selectPage(c.id)},addElement(d,{skipSelect:b=!1}={}){const w=l.TYPES_MAP[d.type];if(!w)return void console.error("Can not find model with type "+d.type);"children"in d&&Array.isArray(d.children)&&d.children.forEach(x=>{x.id=(0,t.nanoid)(10)});const E=w.create(Object.assign({id:(0,t.nanoid)(10)},d));return c.children.push(E),E.selectable&&!b&&c.store.selectElements([E.id]),E},canMoveElementsUp(d){let b=!1;return c._forEachElementUp(d,()=>{b=b||!0}),b},moveElementsUp(d){c._forEachElementUp(d,b=>{const w=c.children[b];(0,i.detach)(w),c.children.splice(b+1,0,w)})},canMoveElementsTop(d){return this.canMoveElementsUp(d)},moveElementsTop(d){const b=[],w=[];c.children.forEach(E=>{d.indexOf(E.id)>=0?b.push(E):w.push(E)}),c.children.replace(w.concat(b))},canMoveElementsDown(d){let b=!1;return c._forEachElementDown(d,()=>{b=b||!0}),b},moveElementsDown(d){c._forEachElementDown(d,b=>{const w=c.children[b];(0,i.detach)(w),c.children.splice(b-1,0,w)})},canMoveElementsBottom(d){return this.canMoveElementsDown(d)},moveElementsBottom(d){const b=[],w=[];c.children.forEach(E=>{d.indexOf(E.id)>=0?b.push(E):w.push(E)}),c.children.replace(b.concat(w))},setElementZIndex(d,b){const w=c.children.find(E=>E.id===d);w&&((0,i.detach)(w),c.children.remove(w),c.children.splice(b,0,w))},setSize({width:d,height:b,useMagic:w,softChange:E}){if(w){const x=[],m=k=>k.type==="image"&&k.x<1&&k.y<1&&k.width>=c.computedWidth-2&&k.height>=c.computedHeight-2;(0,l.forEveryChild)(c,k=>{k.type!=="group"&&(m(k)||x.push(k))});const _=x.length?(0,s.getTotalClientRect)(x):{x:0,y:0,width:c.computedWidth,height:c.computedHeight},p=1/4,h=Math.max(0,Math.min(_.x,c.computedWidth-_.x-_.width)),P=c.computedWidth*p,g=Math.max(0,h-P),v=Math.max(0,Math.min(_.y,c.computedHeight-_.y-_.height)),y=c.computedHeight*p,O=Math.max(0,v-y),M=c.computedWidth-2*g,R=c.computedHeight-2*O,D=d/M,T=b/R,S=Math.min(D,T),A=(d-M*S)/2-g*S,N=(b-R*S)/2-O*S;(0,l.forEveryChild)(c,k=>{k.type!=="group"&&(m(k)?k.set({x:k.x*S,y:k.y*S,width:k.width*D,height:k.height*T,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(k.set({x:A+k.x*S,y:N+k.y*S,width:k.width*S,height:k.height*S}),k.type==="text"?k.set({fontSize:k.fontSize*S}):k.type==="figure"&&k.set({strokeWidth:k.strokeWidth*S})))})}E||(c.width=d),E||(c.height=b)}})).actions(c=>({moveElementUp(d){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),c.moveElementsUp([d])},moveElementDown(d){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),c.moveElementsDown([d])},moveElementTop(d){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),c.moveElementsTop([d])},moveElementBottom(d){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),c.moveElementsBottom([d])},play(){c.store.play({startTime:c.startTime,endTime:c.startTime+c.duration})}}))}(b0)),b0}var _0={},g3;function Ux(){return g3||(g3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const i=ea;e.Audio=i.types.model("Audio",{id:i.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,i.getSnapshot)(t))})).actions(t=>({set(n){Object.assign(t,n)}}))}(_0)),_0}var m3;function zm(){return m3||(m3=1,function(e){var i=Ai&&Ai.__createBinding||(Object.create?function(T,S,A,N){N===void 0&&(N=A);var k=Object.getOwnPropertyDescriptor(S,A);k&&!("get"in k?!S.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return S[A]}}),Object.defineProperty(T,N,k)}:function(T,S,A,N){N===void 0&&(N=A),T[N]=S[A]}),t=Ai&&Ai.__setModuleDefault||(Object.create?function(T,S){Object.defineProperty(T,"default",{enumerable:!0,value:S})}:function(T,S){T.default=S}),n=Ai&&Ai.__importStar||function(){var T=function(S){return T=Object.getOwnPropertyNames||function(A){var N=[];for(var k in A)Object.prototype.hasOwnProperty.call(A,k)&&(N[N.length]=k);return N},T(S)};return function(S){if(S&&S.__esModule)return S;var A={};if(S!=null)for(var N=T(S),k=0;k<N.length;k++)N[k]!=="default"&&i(A,S,N[k]);return t(A,S),A}}(),o=Ai&&Ai.__rest||function(T,S){var A={};for(var N in T)Object.prototype.hasOwnProperty.call(T,N)&&S.indexOf(N)<0&&(A[N]=T[N]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var k=0;for(N=Object.getOwnPropertySymbols(T);k<N.length;k++)S.indexOf(N[k])<0&&Object.prototype.propertyIsEnumerable.call(T,N[k])&&(A[N[k]]=T[N[k]])}return A},l=Ai&&Ai.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=D;const s=ea,c=Nx(),d=Gp,b=l(Ji()),w=Ix(),E=Dx(),x=jx(),m=jm(),_=n(Bd()),p=Ks(),h=Fm(),P=w4(),g=Fx(),v=zx(),y=Bx(),O=E4(),M=Td(),R=Ux();function D({key:T,showCredit:S}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:S,_key:T})}(0,s.setLivelinessChecking)("ignore"),e.Font=s.types.model("Font",{fontFamily:s.types.string,url:s.types.optional(s.types.string,""),styles:s.types.frozen()}).preProcessSnapshot(T=>Object.assign(Object.assign({},T),{fontFamily:T.fontFamily||T.name})),e.Store=s.types.model("Store",{role:"",pages:s.types.array(O.Page),fonts:s.types.array(e.Font),audios:s.types.array(R.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:s.types.frozen(),selectedElementsIds:s.types.array(s.types.string),animatedElementsIds:s.types.array(s.types.string),history:s.types.optional(c.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(T=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),T.bleedVisible},get selectedElements(){return T.selectedElementsIds.map(S=>{for(const A of T.pages)for(const N of A.children)if(N.id===S)return N}).filter(S=>!!S)},get children(){return T.pages},get selectedShapes(){const S=[];return(0,M.forEveryChild)({children:T.selectedElements},A=>{A.type!=="group"&&S.push(A)}),S},get activePage(){return T.pages.slice().find(S=>S.id===T._activePageId)||(T.pages.length?T.pages[0]:null)},get duration(){let S=0;return T.pages.forEach(A=>{S+=A.duration}),S},get _hasCroppedImages(){return T.find(S=>S.type==="image"&&S._cropModeEnabled)},find(S){let A;return(0,M.forEveryChild)({children:T.pages},N=>{if(!A&&S(N))return A=N,!0}),A},getElementById:S=>T.find(A=>A.id===S)})).actions(T=>{let S=0,A=null,N=!1;return{afterCreate(){T.history.canUndo},setCurrentTime(k){T.currentTime=k},_togglePlaying(k=!T.isPlaying){T.isPlaying=k},play({animatedElementsIds:k=[],startTime:L=0,currentTime:B=0,endTime:X=T.duration,repeat:K=!1}={}){B&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),L=B),T.animatedElementsIds=(0,s.cast)(k),T.currentTime=L,T.isPlaying=!0,S=Date.now(),A=X,N=K,requestAnimationFrame(T.seek)},checkActivePage(){let k=0;for(const L of T.pages){if(T.currentTime>=L.startTime&&T.currentTime<L.startTime+L.duration){T.selectPage(L.id);break}k+=L.duration}},seek(){if(!T.isPlaying)return;const k=Date.now(),L=k-S;S=k,T.currentTime+=L,T.checkActivePage();const B=A||T.duration;T.isPlaying&&T.currentTime<B?requestAnimationFrame(T.seek):T.isPlaying&&N?(T.currentTime=0,requestAnimationFrame(T.seek)):T.stop()},stop(){T.isPlaying=!1,T.currentTime=0,T.animatedElementsIds=(0,s.cast)([]),T.checkActivePage()}}}).actions(T=>({__(){T._validated||((0,m.validateKey)(T._key,T._forceShowCredit),T._validated=!0)},set(S){Object.assign(T,S)},setUnit({unit:S,dpi:A}){T.unit=S||T.unit,T.dpi=A||T.dpi},setRole(S){T.role=S},addPage(S){const A=O.Page.create(Object.assign({id:(0,d.nanoid)(10)},S));return T.pages.push(A),T._activePageId=A.id,A},selectPage(S){T._activePageId=S},selectElements(S){const A=S.map(N=>T.getElementById(N)).sort((N,k)=>N.page.children.indexOf(N)-N.page.children.indexOf(k)).filter(N=>!!N).map(N=>N.id);T.selectedElementsIds=(0,s.cast)(A)},toggleBleed(S){T.bleedVisible=S??!T.bleedVisible},toggleRulers(S){T.rulesVisible=S??!T.rulesVisible},openSidePanel(S){T.openedSidePanel!==S&&(T.previousOpenedSidePanel=T.openedSidePanel,T.openedSidePanel=S)},setScale(S){T.scale=S},_setScaleToFit(S){T.scaleToFit=S},setElementsPixelRatio(S){T._elementsPixelRatio=S},setSize(S,A,N){T.pages.forEach(k=>{k.setSize({width:S,height:A,useMagic:N,softChange:!0})}),T.width=S,T.height=A},setPageZIndex(S,A){const N=T.pages.find(k=>k.id===S);N&&((0,s.detach)(N),T.pages.remove(N),T.pages.splice(A,0,N))},deletePages(S){const A=T.pages.indexOf(T.activePage);S.forEach(L=>{const B=T.pages.find(X=>X.id===L);(0,s.destroy)(B)});const N=Math.min(T.pages.length-1,A),k=T.pages[N];k&&(T._activePageId=k.id),T.selectedElementsIds=(0,s.cast)(T.selectedElementsIds.filter(L=>T.getElementById(L)))},groupElements(S){const A=S.map(L=>T.getElementById(L));A.forEach(L=>{L&&(0,s.detach)(L)});const N=T.activePage,k={id:(0,d.nanoid)(10),children:A,type:"group"};return N.children.push(k),T.selectedElementsIds=(0,s.cast)([k.id]),N.children.find(L=>L.id===k.id)},ungroupElements(S){const A=S.map(k=>T.getElementById(k)),N=[];A.forEach(k=>{if(k&&k.type==="group"){const L=k.page,B=L.children.indexOf(k);k.children.forEach(X=>{N.push(X.id)}),k.children.forEach(X=>{(0,s.detach)(X),L.children.push(X)}),L.children.splice(B,1)}}),T.selectedElementsIds=(0,s.cast)(N)},deleteElements(S){const A=[];T.find(N=>(S.includes(N.id)&&A.push(N),!1)),A.forEach(N=>{(0,s.destroy)(N)}),T.selectedElementsIds=(0,s.cast)(T.selectedElementsIds.filter(N=>T.getElementById(N)))},on(S,A){if(S==="change"){let N=T.toJSON();return(0,s.onSnapshot)(T,k=>{const L=T.toJSON();!(0,P.deepEqual)(N,L)&&(N=L,A(L))})}},async _toCanvas({pixelRatio:S,ignoreBackground:A,pageId:N,mimeType:k,includeBleed:L,_skipTimeout:B,quickMode:X=!1}={}){var K;const Q=S||1;N=N||((K=T.pages[0])===null||K===void 0?void 0:K.id);const H=T.pages.find(_e=>_e.id===N);if(!H)throw new Error(`No page for export with id ${N}`);X?H==null||H.set({_forceMount:!0}):H==null||H.set({_exporting:!0});const z=await(0,g.waitTillAvailable)(()=>b.default.stages.find(_e=>_e.getAttr("pageId")===N));if(!z)throw H==null||H.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${N}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const I=!!z.findOne(".page-container"),U=T._elementsPixelRatio;Q>T._elementsPixelRatio&&T.setElementsPixelRatio(Q),await T.waitLoading({_skipTimeout:B});const $=z.findOne(".page-container");if(!$)throw T.setElementsPixelRatio(U),H==null||H.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${I}`);z.find("Transformer").forEach(_e=>_e.visible(!1)),$.find(".page-background").forEach(_e=>_e.shadowEnabled(!1)),$.find(".page-background").forEach(_e=>_e.strokeEnabled(!1)),$.find(".highlighter").forEach(_e=>_e.visible(!1));const ee=$.findOne(".page-background-group"),G=ee.clip();ee.clip({x:null,y:null,width:null,height:null});const Z=$.findOne(".elements-container"),W=Z.clip();Z.clip({x:null,y:null,width:null,height:null});const te=$.find(_e=>_e.getAttr("hideInExport"));te.forEach(_e=>{_e.setAttr("oldVisible",_e.visible()),_e.hide()});const re=$.find(_e=>!_e.visible()&&_e.getAttr("editModeEnabled"));re.forEach(_e=>{_e.setAttr("oldVisible",_e.visible()),_e.show()}),A&&$.find(".page-background").forEach(_e=>_e.hide());const ie=L?H.bleed:0;let oe=ie;!T.bleedVisible&&L||(T.bleedVisible||L?T.bleedVisible&&L?oe=0:T.bleedVisible&&!L&&(oe=-H.bleed):oe=0);const se=document.createElement("canvas");se.width=Math.round((H.computedWidth+2*ie)*Q),se.height=Math.round((H.computedHeight+2*ie)*Q);const de=se.getContext("2d");k==="image/jpeg"&&(de.fillStyle="white",de.fillRect(0,0,se.width,se.height));const pe=$.scale();$.scale({x:1,y:1});const Oe=$.toCanvas({x:$.x()-oe,y:$.y()-oe,width:H.computedWidth+2*ie,height:H.computedHeight+2*ie,pixelRatio:Q});return $.scale(pe),de.drawImage(Oe,0,0,se.width,se.height),b.default.Util.releaseCanvas(Oe),A&&$.find(".page-background").forEach(_e=>_e.show()),te.forEach(_e=>{_e.visible(_e.getAttr("oldVisible"))}),re.forEach(_e=>{_e.visible(_e.getAttr("oldVisible"))}),$.find(".page-background").forEach(_e=>_e.shadowEnabled(!0)),$.find(".page-background").forEach(_e=>_e.strokeEnabled(!0)),z.find("Transformer").forEach(_e=>_e.visible(!0)),$.find(".highlighter").forEach(_e=>_e.visible(!0)),ee.clip(G),Z.clip(W),T.setElementsPixelRatio(U),H==null||H.set({_exporting:!1,_forceMount:!1}),se},async toDataURL(S={}){var{mimeType:A,quality:N}=S,k=o(S,["mimeType","quality"]);const L=await T._toCanvas(Object.assign({mimeType:A},k)),B=L.toDataURL(A,N);return b.default.Util.releaseCanvas(L),B},async toBlob(S={}){var{mimeType:A,quality:N}=S,k=o(S,["mimeType","quality"]);const L=await T._toCanvas(Object.assign({mimeType:A},k)),B=await new Promise(X=>{L.toBlob(X,A,N)});return b.default.Util.releaseCanvas(L),B},async saveAsImage(S={}){var{fileName:A}=S,N=o(S,["fileName"]);const k=N.mimeType||"image/png",L=k.split("/")[1];(0,w.downloadFile)(await T.toDataURL(N),A||"polotno."+L,k)},async _toPDF(S){const A=S.dpi||T.dpi,N=S.parallel||1,k=S.unit||(T.unit==="px"?"mm":T.unit),L=S.pixelRatio||1,B=S.pageIds||T.pages.map(te=>te.id),X=T.pages.filter(te=>B.includes(te.id)),K=await(0,E.getJsPDF)(),Q=te=>(0,h.pxToUnit)({px:te,unit:k,dpi:A}),H=S.cropMarkSize||0,z=Q(H),I=X[0]||{},U=S.includeBleed?I.bleed:0,$=Q(I.computedWidth+2*U+2*z),ee=Q(I.computedHeight+2*U+2*z);var G=new K({unit:k,orientation:$>ee?"landscape":"portrait",format:[$,ee],compress:!0,putOnlyUsedFonts:!0});G.deletePage(1);const Z=((te,re)=>{for(var ie=[],oe=0;oe<te.length;oe+=re)ie.push(te.slice(oe,oe+re));return ie})(X,N);let W=0;for(const te of Z){const re=te.map(async ie=>{const oe=S.includeBleed?ie.bleed:0,se=ie.computedWidth+2*oe+2*H,de=ie.computedHeight+2*oe+2*H,pe=Q(se),Oe=Q(de);let _e=0,Te=L;for(;_e<10;){_e+=1,_e===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ce=await T.toDataURL(Object.assign(Object.assign({},S),{pageId:ie.id,pixelRatio:Te}));if(ce.length>20)return S.onProgress&&S.onProgress(++W/B.length*.9),{url:ce,width:pe,height:Oe,widthPx:se,heightPx:de};Te*=.8}});(await Promise.all(re)).forEach(({url:ie,width:oe,height:se,widthPx:de,heightPx:pe})=>{G.addPage([oe,se],oe>se?"landscape":"portrait");const Oe=G.getCurrentPageInfo();var _e;switch(k){case"pt":_e=1;break;case"mm":_e=72/25.4;break;case"cm":_e=72/2.54;break;case"in":_e=72;break;case"px":_e=.75;break;case"pc":case"em":_e=12;break;case"ex":_e=6;break;default:throw"Invalid unit: "+k}if(Oe.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:oe*_e,topRightY:se*_e},Oe.pageContext.artBox={bottomLeftX:Q(H+U)*_e,bottomLeftY:Q(H+U)*_e,topRightX:Q(de-H-U)*_e,topRightY:Q(pe-H-U)*_e},Oe.pageContext.bleedBox={bottomLeftX:Q(H+U)*_e,bottomLeftY:Q(H+U)*_e,topRightX:Q(de-H-U)*_e,topRightY:Q(pe-H-U)*_e},z){G.setLineWidth(Q(1));const Te=z+Q(U);G.line(Te,0,Te,z),G.line(0,Te,z,Te),G.line(oe-Te,0,oe-Te,z),G.line(oe,Te,oe-z,Te),G.line(0,se-Te,z,se-Te),G.line(Te,se,Te,se-z),G.line(oe,se-Te,oe-z,se-Te),G.line(oe-Te,se,oe-Te,se-z)}G.addImage(ie,z,z,oe-2*z,se-2*z,void 0,"FAST")})}return G},toPDFDataURL:async S=>(await T._toPDF(Object.assign({mimeType:"image/jpeg"},S))).output("datauristring"),async toGIFDataURL(S={}){const A=S.pixelRatio||1,N=await(0,x.createGIF)({width:T.width*A,height:T.height*A}),k=1e3/(S.fps||10),L=T.duration/k;for(let B=0;B<L-1;B++){const X=B*k||1;T.setCurrentTime(X);let K=0,Q="";for(const z of T.pages)if(K+=z.duration,z.set({_rendering:K>X}),K>X){Q=z.id;break}const H=await T._toCanvas({pixelRatio:A,pageId:Q,_skipTimeout:!0});N.addFrame(H.getContext("2d"),{delay:k,copy:!0})}for(const B of T.pages)B.set({_rendering:!1});return T.stop(),N.render(),new Promise(B=>{N.on("finished",function(X){(function(K,Q){var H=new FileReader;H.onload=function(z){Q(z.target.result)},H.readAsDataURL(K)})(X,B)})})},async saveAsGIF(S={}){var{fileName:A}=S,N=o(S,["fileName"]);const k=await T.toGIFDataURL(N);(0,w.downloadFile)(k,A||"polotno.gif")},async toHTML({elementHook:S}={elementHook:void 0}){const A=T.toJSON();return(0,v.jsonToHTML)({json:A,elementHook:S})},async saveAsHTML({fileName:S}={}){const A=await T.toHTML(),N="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(A)));(0,w.downloadFile)(N,S||"polotno.html")},async toSVG({elementHook:S,pageId:A}={elementHook:void 0,pageId:void 0}){var N;const k=T.toJSON();A=A||((N=k.pages[0])===null||N===void 0?void 0:N.id);const L=k.pages.find(B=>B.id===A);return(0,y.jsonToSVG)({json:Object.assign(Object.assign({},k),{pages:L?[L]:[]}),elementHook:S})},async saveAsSVG({fileName:S,elementHook:A,pageId:N}={}){const k=await T.toSVG({elementHook:A,pageId:N}),L="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,w.downloadFile)(L,S||"polotno.svg")},async saveAsPDF(S={}){var{fileName:A}=S,N=o(S,["fileName"]);(await T._toPDF(Object.assign({mimeType:"image/jpeg"},N))).save(A||"polotno.pdf")},async waitLoading({_skipTimeout:S=!1}={}){S||await new Promise(A=>setTimeout(A,50)),await(0,p.whenLoaded)()},toJSON:()=>({width:T.width,height:T.height,fonts:(0,s.getSnapshot)(T.fonts),pages:(0,s.getSnapshot)(T.pages),audios:(0,s.getSnapshot)(T.audios),unit:T.unit,dpi:T.dpi,custom:T.custom}),loadJSON(S,A=!1){var N;const k=Object.assign({},S),L=T.pages.indexOf(T.activePage);let B=(N=k.pages[L]||k.pages[0])===null||N===void 0?void 0:N.id;k._activePageId=B;const X=Object.assign({},(0,s.getSnapshot)(T));Object.assign(X,k),X.history=A?T.history.toJSON():{history:[],undoIdx:-1},(0,s.applySnapshot)(T,X)},clear({keepHistory:S=!1}={}){const A=T.pages.map(N=>N.id);T.deletePages(A),T.custom=null,S||T.history.clear()},addFont(S){T.removeFont(S.fontFamily),T.fonts.push(S),T.loadFont(S.fontFamily)},removeFont(S){T.fonts.filter(A=>A.fontFamily===S).forEach(A=>(0,s.destroy)(A))},addAudio(S){const A=R.Audio.create(Object.assign({id:(0,d.nanoid)(10)},S));T.audios.push(A)},removeAudio(S){const A=T.audios.find(N=>N.id===S);A&&T.audios.remove(A)},async loadFont(S){const A=T.fonts.find(k=>k.fontFamily===S)||_.globalFonts.find(k=>k.fontFamily===S);let N=[{fontStyle:"normal",fontWeight:"normal"}];return A?(A.styles&&(N=A.styles.map(k=>({fontStyle:k.fontStyle||"normal",fontWeight:k.fontWeight||"normal"}))),_.injectCustomFont(A)):_.injectGoogleFont(S),Promise.all(N.map(k=>_.loadFont(S,k.fontStyle,k.fontWeight)))},validate:S=>e.Store.validate(S,[{path:"",type:e.Store}]).map(A=>({path:"store"+A.context.map(N=>N.path).join("."),message:A.message}))})),e.default=D}(Ai)),Ai}var v3;function O4(){return v3||(v3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const i=ea,t=Gp,n=zm(),o=E4(),l=Td();e.Node=i.types.model("Node",{id:i.types.identifier,type:"none",name:"",opacity:1,custom:i.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(s=>{for(var c in s)s[c]===null&&(s[c]=void 0);return s}).postProcessSnapshot(s=>{const c=Object.assign({},s),d={};for(var b in c)b[0]!=="_"&&(d[b]=s[b]);return d}).views(s=>({get locked(){return!(s.draggable||s.contentEditable||s.styleEditable||s.resizable)},get page(){return(0,i.getParentOfType)(s,o.Page)},get store(){return(0,i.getParentOfType)(s,n.Store)},get top(){let c=s;for(;;){if(!(0,i.hasParentOfType)(c,l.GroupElement))return c;c=(0,i.getParentOfType)(c,l.GroupElement)}},get parent(){return(0,i.hasParentOfType)(s,l.GroupElement)?(0,i.getParentOfType)(s,l.GroupElement):(0,i.hasParentOfType)(s,o.Page)?(0,i.getParentOfType)(s,o.Page):(0,i.hasParentOfType)(s,n.Store)?(0,i.getParentOfType)(s,n.Store):null},get zIndex(){return s.parent.children.indexOf(s)}})).actions(s=>({toJSON:()=>Object.assign({},(0,i.getSnapshot)(s))})).actions(s=>({clone(c={},{skipSelect:d=!1}={}){const b=JSON.parse(JSON.stringify(s.toJSON()));return c.id=c.id||(0,t.nanoid)(10),(0,l.forEveryChild)(b,w=>{w.id=(0,t.nanoid)(10)}),Object.assign(b,c),s.page.addElement(b,{skipSelect:d})},set(c){Object.assign(s,c)},moveUp(){s.page.moveElementsUp([s.id])},moveTop(){s.page.moveElementsTop([s.id])},moveDown(){s.page.moveElementsDown([s.id])},moveBottom(){s.page.moveElementsBottom([s.id])},setZIndex(c){s.parent.setElementZIndex(s.id,c)},beforeDestroy(){}}))}(c0)),c0}var w0={},S0={},y3;function qx(){return y3||(y3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const i=Hd(),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}}},n={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}};e.animations={fade:({dTime:s,element:c,animation:d})=>{const b=s/d.duration;return d.type==="enter"?{opacity:b*c.opacity}:{opacity:(1-b)*c.opacity}},rotate:({dTime:s,element:c,animation:d})=>{const b=s/d.duration*360;return(0,i.rotateAroundCenter)({x:c.x,y:c.y,width:c.width,height:c.height,rotation:c.rotation},b)},blink:({dTime:s,element:c,animation:d})=>{const b=d.duration,w=s%b/(b/2),E=w<=1?w:2-w;return{opacity:c.opacity*E}},bounce:({dTime:s,element:c,animation:d})=>{const b=d.duration,w=b/2,E={},x={x:c.x+c.width/3,y:c.y+c.height/3,width:c.width/3,height:c.height/3,fontSize:c.fontSize/3},m={x:c.x,y:c.y,width:c.width,height:c.height,fontSize:c.fontSize},_=s%b/w,p=_<=1?_:2-_;for(let h in x){const P=x[h],g=m[h]-P;E[h]=P+p*g}return E},move:({dTime:s,element:c,animation:d})=>{const b=t[d.data.direction]||t.right,w={};for(var E in b.from){let x=b.from[E],m=b.to[E];d.type==="exit"&&(x=b.to[E],m=-b.from[E]);const _=c[E]+x,p=c[E]+m-_;w[E]=_+s/d.duration*p}return w},zoom:({dTime:s,element:c,animation:d})=>{const b={},w=((d.data.direction||"in")==="in"?1:-1)>0?.75:1.25,E=c.rotation*Math.PI/180,x=Math.cos(E),m=Math.sin(E),_=c.width*(1-w),p=c.height*(1-w),h=(_*x-p*m)/2,P=(_*m+p*x)/2,g={x:c.x+h,y:c.y+P,width:c.width*w,height:c.height*w,fontSize:c.fontSize*w},v={x:c.x,y:c.y,width:c.width,height:c.height,fontSize:c.fontSize};for(var y in g){let O=g[y],M=v[y];if(d.type==="exit"){const D=O;O=M,M=D}const R=M-O;b[y]=O+s/d.duration*R}return b},cameraZoom:({dTime:s,element:c,animation:d})=>{var b,w,E;const x={},m=d.data.direction||"right",_=n[m]||n.right,p=(b=d.data.movementStrength)!==null&&b!==void 0?b:.1,h=(w=d.data.shakeStrength)!==null&&w!==void 0?w:.015;E=d.data.strength;const P=s/d.duration,g=h*(1-P),v=Math.sin(12*P)*g*.7+Math.sin(8*P)*g*.3;d.type==="exit"&&Math.max(c.cropWidth||1,c.cropHeight||1),d.type;const y=1-Math.pow(1-P,2),O=c.cropX||0,M=c.cropY||0,R=c.cropWidth||1,D=c.cropHeight||1,T=R,S=D;let A,N,k=0,L=0;if(_.cropX){const B=_.cropX>0?1-(O+R):O;k=Math.min(B,Math.abs(p))*_.cropX}if(_.cropY){const B=_.cropY>0?1-(M+D):M;L=Math.min(B,Math.abs(p))*_.cropY}return d.type==="enter"?(A=_.cropX?O+k*(1-y):O,N=_.cropY?M+L*(1-y):M):(A=_.cropX?O+k*y:O,N=_.cropY?M+L*y:M),x.cropX=Math.max(0,Math.min(1-T,A+v*T)),x.cropY=Math.max(0,Math.min(1-S,N+v*S)),x.cropWidth=T,x.cropHeight=S,x}};const o=({element:s,dTime:c,animation:d})=>{const b=e.animations[d.name];return b?b({element:s,dTime:c,animation:d}):(console.error("Can not find animation type: "+d.name),{})};e.animate=o;const l=(s,c)=>{};e.registerAnimation=l}(S0)),S0}var b3;function Ec(){return b3||(b3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.ShapeFilter=e.getDiff=e.Animation=void 0;const i=ea,t=qx(),n=La,o=O4();e.Animation=i.types.model("Animation",{delay:0,duration:500,enabled:!0,type:i.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:i.types.frozen({})});const l=(s,c)=>{const d={};for(const b in c)if(typeof s[b]=="number"&&typeof c[b]=="number"){const w=c[b]-s[b];w!==0&&(d[b]=w)}return d};e.getDiff=l,e.ShapeFilter=i.types.model("ShapeFilter",{intensity:1}),e.Shape=o.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:i.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:i.types.map(e.ShapeFilter),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(s=>{const c=Object.assign(Object.assign({},s),{x:s.x||0,y:s.y||0,filters:Array.isArray(s.filters)?{}:s.filters});return"width"in s&&(c.width=c.width||1),"height"in s&&(c.height=c.height||1),s.locked&&(c.draggable=!1,c.contentEditable=!1,c.styleEditable=!1,c.resizable=!1,c.removable=!1),c}).views(s=>{const c=(0,n.observable)({x:s.x,y:s.y,width:s.width,height:s.height,rotation:s.rotation,opacity:s.opacity,color:s.color,fontSize:s.fontSize}),d=(0,n.action)(w=>{Object.assign(c,w)}),b=(0,n.action)(w=>{for(const E in w)typeof c[E]=="number"&&(c[E]=c[E]+w[E])});return{get a(){const{currentTime:w}=s.store;if(d({x:s.x,y:s.y,width:s.width,height:s.height,rotation:s.rotation,opacity:s.opacity,color:s.color,fontSize:s.fontSize,cropX:s.cropX,cropY:s.cropY,cropWidth:s.cropWidth,cropHeight:s.cropHeight}),w===0)return c;const E=w-s.page.startTime;if(E>s.page.duration||E<0)return c;const x=s.store.animatedElementsIds;if(x.length&&!x.includes(s.id))return c;const m=s.animations.find(g=>g.type==="enter"),_=(m==null?void 0:m.enabled)&&E<m.delay;_&&d({opacity:0});const p=(m==null?void 0:m.enabled)&&E>=m.delay&&E<=m.delay+m.duration;if(p){const g=E-m.delay,v=(0,t.animate)({element:s,animation:m,dTime:g}),y=(0,e.getDiff)(s,v);b(y)}const h=s.animations.find(g=>g.type==="exit");if(!_&&!p&&(h!=null&&h.enabled)&&E>=s.page.duration-h.duration-h.delay&&E<=s.page.duration-h.delay){const g=E-(s.page.duration-h.duration-h.delay),v=(0,t.animate)({element:s,animation:h,dTime:g}),y=(0,e.getDiff)(s,v);b(y)}h!=null&&h.enabled&&E>=s.page.duration-h.delay&&d({opacity:0});const P=s.animations.find(g=>g.type==="loop");if(P!=null&&P.enabled){const g=E,v=(0,t.animate)({element:s,animation:P,dTime:g}),y=(0,e.getDiff)(s,v);b(y)}return c},animated:w=>s.a[w]}}).actions(s=>({setAnimation(c,d){const b=s.animations.find(w=>w.type===c);b?Object.assign(b,d):s.animations.push(Object.assign({type:c},d))},setFilter(c,d){s.filters.clear(),d!==0&&s.filters.set(c,{intensity:d})}}))}(w0)),w0}var E0={},_3;function Hx(){return _3||(_3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const i=ea,t=Ec();e.TextElement=t.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:i.types.optional(i.types.union(i.types.number,i.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(o){n._editModeEnabled=o??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(E0)),E0}var O0={},w3;function x4(){return w3||(w3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const i=Ec();e.ImageElement=i.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(t=>({toggleCropMode(n){t._cropModeEnabled=n??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}(O0)),O0}var x0={},S3;function Gx(){return S3||(S3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const i=x4();e.VideoElement=i.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(x0)),x0}var P0={},E3;function Vx(){return E3||(E3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const i=ea,t=Ec();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:i.types.array(i.types.number),startHead:"",endHead:""}).actions(n=>({}))}(P0)),P0}var C0={},O3;function $x(){return O3||(O3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const i=ea,t=Ec();e.SVGElement=t.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:i.types.map(i.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource,colorsReplace:Array.isArray(n.colorsReplace)?{}:n.colorsReplace})).actions(n=>({replaceColor(o,l){n.colorsReplace.set(o,l)}}))}(C0)),C0}var k0={},x3;function Wx(){return x3||(x3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const i=ea,t=Ec();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:i.types.array(i.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(k0)),k0}var P3;function Td(){return P3||(P3=1,function(e){var i=vd&&vd.__rest||function(h,P){var g={};for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&P.indexOf(v)<0&&(g[v]=h[v]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(v=Object.getOwnPropertySymbols(h);y<v.length;y++)P.indexOf(v[y])<0&&Object.prototype.propertyIsEnumerable.call(h,v[y])&&(g[v[y]]=h[v[y]])}return g};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=p;const t=ea,n=Gp,o=O4(),l=Ec(),s=Hx(),c=x4(),d=Gx(),b=Vx(),w=$x(),E=Wx(),x=(h,P)=>{if(h.children)for(const g of h.children){if(P(g)===!0)break;(0,e.forEveryChild)(g,P)}};e.forEveryChild=x;const m=[...new Array(20)].map((h,P)=>t.types.late(()=>_[P]));e.ElementTypes=t.types.union({dispatcher:h=>{const P=e.TYPES_MAP[h.type];if(!P)throw new Error(`Unknown element type: "${h.type}"`);return P}},w.SVGElement,s.TextElement,c.ImageElement,b.LineElement,d.VideoElement,E.FigureElement,t.types.late(()=>e.GroupElement),...m),e.GroupElement=o.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(h=>({get draggable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.draggable||(P=!1)}),P},get resizable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.resizable||(P=!1)}),P},get contentEditable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.contentEditable||(P=!1)}),P},get styleEditable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.styleEditable||(P=!1)}),P},get locked(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.locked||(P=!1)}),P}})).actions(h=>({set(P){var{draggable:g,contentEditable:v,styleEditable:y,resizable:O}=P,M=i(P,["draggable","contentEditable","styleEditable","resizable"]);g!==void 0&&(0,e.forEveryChild)(h,R=>{R.set({draggable:g})}),v!==void 0&&(0,e.forEveryChild)(h,R=>{R.set({contentEditable:v})}),y!==void 0&&(0,e.forEveryChild)(h,R=>{R.set({styleEditable:y})}),O!==void 0&&(0,e.forEveryChild)(h,R=>{R.set({resizable:O})}),Object.assign(h,M)},addElement(P,{skipSelect:g=!1}={}){const v=e.TYPES_MAP[P.type];if(!v)return void console.error("Can not find model with type "+P.type);P.children&&P.children.forEach(O=>{O.id=(0,n.nanoid)(10)});const y=v.create(Object.assign({id:(0,n.nanoid)(10)},P));return h.children.push(y),y.selectable&&!g&&h.store.selectElements([y.id]),y},setElementZIndex(P,g){const v=h.children.find(y=>y.id===P);v&&((0,t.detach)(v),h.children.remove(v),h.children.splice(g,0,v))}}));const _=[];function p(h,P){const g=h.type;if(!g)throw new Error('You must pass "type" attribute to custom model.');let v=l.Shape.named(g).props(h);P&&(v=P(v)),e.TYPES_MAP[g]=v,_.push(v)}e.TYPES_MAP={svg:w.SVGElement,text:s.TextElement,image:c.ImageElement,group:e.GroupElement,line:b.LineElement,video:d.VideoElement,figure:E.FigureElement}}(vd)),vd}var C3;function Yx(){return C3||(C3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const i=Td();let t=[],n="";const o="polotno_clipboard",l=E=>{t=JSON.parse(JSON.stringify(E));try{localStorage.setItem(o,JSON.stringify(E))}catch{}},s=()=>{try{const E=localStorage.getItem(o);if(E)return JSON.parse(E)}catch{}return t},c=E=>{var x;n=(x=E.activePage)===null||x===void 0?void 0:x.id,l(E.selectedElements.map(m=>m.toJSON()))};e.copy=c;const d=E=>{var x;n=(x=E.activePage)===null||x===void 0?void 0:x.id,l(E.selectedElements.map(_=>_.toJSON()));let m=E.selectedElements.filter(_=>_.removable).map(_=>_.id);E.deleteElements(m)};e.cut=d;const b=E=>{var x,m;let _=0;n===((x=E.activePage)===null||x===void 0?void 0:x.id)&&(_=E.width/20),n=(m=E.activePage)===null||m===void 0?void 0:m.id,E.history.transaction(()=>{const p=[],h=s();(0,i.forEveryChild)({children:h},P=>{delete P.id,P.type!=="group"&&(P.x+=_,P.y+=_)}),h.forEach(P=>{var g;const v=(g=E.activePage)===null||g===void 0?void 0:g.addElement(P);v&&p.push(v.id)}),l(h),E.selectElements(p)})};e.paste=b;const w=()=>s().length===0;e.isClipboardEmpty=w}(u0)),u0}var k3;function Kx(){return k3||(k3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=t;const i=Yx();function t(n,o){var l,s,c,d;if(((l=document.activeElement)===null||l===void 0?void 0:l.tagName)==="INPUT"||((s=document.activeElement)===null||s===void 0?void 0:s.tagName)==="TEXTAREA"||((c=document.activeElement)===null||c===void 0?void 0:c.contentEditable)==="true")return;const b=o.selectedElements.filter(x=>x.removable).map(x=>x.id);n.keyCode!==46&&n.keyCode!==8||o.deleteElements(b);const w=n.ctrlKey||n.metaKey,E=n.shiftKey;if(w&&!E&&n.code==="KeyZ"&&(n.preventDefault(),o.history.undo()),w&&E&&n.code==="KeyZ"&&(n.preventDefault(),o.history.redo()),w&&n.code==="KeyA"){n.preventDefault();const x=(d=o.activePage)===null||d===void 0?void 0:d.children.filter(_=>_.selectable),m=(x==null?void 0:x.map(_=>_.id))||[];o.selectElements(m)}w&&n.code==="KeyC"&&(n.preventDefault(),(0,i.copy)(o)),w&&n.code==="KeyX"&&(n.preventDefault(),(0,i.cut)(o)),w&&n.code==="KeyV"&&(n.preventDefault(),(0,i.paste)(o)),n.code==="ArrowDown"&&(n.preventDefault(),o.selectedElements.forEach(x=>{x.draggable&&x.set({y:x.y+1})})),n.code==="ArrowUp"&&(n.preventDefault(),o.selectedElements.forEach(x=>{x.draggable&&x.set({y:x.y-1})})),n.code==="ArrowLeft"&&(n.preventDefault(),o.selectedElements.forEach(x=>{x.draggable&&x.set({x:x.x-1})})),n.code==="ArrowRight"&&(n.preventDefault(),o.selectedElements.forEach(x=>{x.draggable&&x.set({x:x.x+1})}))}}(s0)),s0}var A0={},A3;function Xx(){return A3||(A3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const i=La,t=(0,i.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}});function n(w,E){var x,m=E.split("."),_=w;for(x=0;x<m.length;++x){if(_[m[x]]==null)return;_=_[m[x]]}return _}const o=w=>w&&typeof w=="object";function l(w,E){Object.keys(E).forEach(x=>{const m=w[x],_=E[x];o(_)&&o(m)?l(m,_):w[x]=_})}function s(w,E,x=""){Object.keys(E).forEach(m=>{const _=E[m],p=x?`${x}.${m}`:m;o(_)?o(w[m])?s(w[m],_,p):console.warn(`Missing nested translation object at '${p}'`):w[m]===void 0&&console.warn(`Missing translation '${p}'`)})}e.setTranslations=(0,i.action)((w,{validate:E=!1}={})=>{E&&s(w,t),l(t,w)});const c=()=>(0,i.toJS)(t);e.getTranslations=c;const d={},b=w=>{const E=n(t,w);if(E!==void 0)return E;d[w]||(d[w]=!0,console.warn(`Missing translation '${w}'`));const x=w.split("."),m=x[x.length-1]||" ";return m.charAt(0).toUpperCase()+m.slice(1)};e.t=b}(A0)),A0}var T3;function Zx(){return T3||(T3=1,function(e){var i=mf&&mf.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=i(Tn()),n=Qi,o=i(Cx()),l=kx(),s=Ax(),c=Kx(),d=Xx(),b=`Polotno warning: <Workspace /> component can not automatically detect its size.
319
+ Width or height of parent elements is equal 0.
320
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
321
+ For simpler debugging here is the log of the parent element:`,w=(p,h,P,g,v,y)=>{const O=t.default.useRef({width:h,height:P}),M=t.default.useRef({top:0,left:0}),R=t.default.useRef(!1),D=t.default.useRef(v.pages.length);R.current=D.current!==v.pages.length,D.current=v.pages.length,t.default.useEffect(()=>{const T=p.current,S=A=>{M.current={top:T.scrollTop,left:T.scrollLeft}};return T.addEventListener("scroll",S),()=>{T.removeEventListener("scroll",S)}},[]),t.default.useLayoutEffect(()=>{if(!p.current||R.current)return;const T=p.current,S=(M.current.left+T.offsetWidth/2)/O.current.width,A=(M.current.top+T.offsetHeight/2)/O.current.height;y.current=!0,T.scrollLeft=S*h-T.offsetWidth/2,T.scrollTop=A*P-T.offsetHeight/2,O.current={width:h,height:P}},[g,h,P])},E=({element:p,scrollTop:h=0,duration:P=300,onFinish:g=()=>{}})=>{const v=p.scrollTop,y=h-v;let O=0,M=!1;if(P===0)return p.scrollTop=h,()=>{};const R=()=>{if(M)return;O+=20;const T=D(O,v,y,P);p.scrollTop=T,O<P?setTimeout(R,20):g()},D=(T,S,A,N)=>(T/=N/2)<1?A/2*T*T+S:-A/2*(--T*(T-2)-1)+S;return R(),()=>{M=!0}},x=(p,h,P,g,v,y)=>{const O=t.default.useRef(!1),M=t.default.useRef(null),R=t.default.useRef(!1);t.default.useEffect(()=>{const T=p.current,S=()=>{v.current};return T.addEventListener("scroll",S),()=>{T.removeEventListener("scroll",S)}},[]);const D=P.pages.indexOf(P.activePage);return t.default.useLayoutEffect(()=>{if(!P.activePage||!p.current||O.current)return;const T=p.current,S=P.pages.indexOf(P.activePage)*h;let A=()=>{};return(Math.abs(S-T.scrollTop)>.5*h||R.current)&&(R.current=!0,A=E({element:T,scrollTop:S,onFinish:()=>{R.current=!1},duration:P.isPlaying?0:300})),A},[P.activePage,D,P.isPlaying]),{handleScroll:T=>{if(y||R.current)return;O.current=!0,clearTimeout(M.current),M.current=setTimeout(()=>{O.current=!1},300);const S=T.currentTarget.childNodes[0].offsetHeight,A=T.currentTarget.scrollTop,N=Math.floor((A+g.height/3)/S),k=P.pages[N];k&&P.activePage!==k&&k.select()}}},m=({store:p})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,d.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{p.addPage()}},(0,d.t)("workspace.addPage"))),_=({width:p,height:h,xPadding:P,yPadding:g,backgroundColor:v})=>t.default.createElement("div",{style:{width:p+"px",height:h+"px",backgroundColor:v,paddingLeft:P+"px",paddingRight:P+"px",paddingTop:g+"px",paddingBottom:g+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:h,backgroundColor:P,pageBorderColor:g,activePageBorderColor:v,bleedColor:y,components:O,onKeyDown:M,paddingX:R,paddingY:D,altCloneEnabled:T=!0,visiblePagesOffset:S,renderOnlyActivePage:A})=>{var N;const k=R??20,L=D??55,[B,X]=t.default.useState({width:100,height:100}),K=t.default.useRef(B),Q=t.default.useRef(null),H=t.default.useRef(null),z=p.bleedVisible?Math.max(0,...p.pages.map(ce=>ce.bleed)):0,I=Math.max(...p.pages.map(ce=>ce.computedWidth)),U=Math.max(...p.pages.map(ce=>ce.computedHeight)),$=((N=p.activePage)===null||N===void 0?void 0:N.computedHeight)||0,ee=I+2*z,G=(A?$:U)+2*z,Z=async({skipTimeout:ce}={skipTimeout:!1})=>{if(ce||await new Promise(ot=>setTimeout(ot,50)),Q.current===null)return;const he=Q.current.getBoundingClientRect();he.width!==0&&he.height!==0||(console.warn(b),console.log(Q.current));const Ce=H.current.clientWidth||he.width,Le={width:Ce,height:he.height};(K.current.width!==Le.width||K.current.height!==Le.height)&&(X(Le),K.current=Le);const ue=(Ce-2*k)/ee,me=p.pages.length>1?3.1:2,xe=(he.height-L*me)/G,je=Math.max(Math.min(ue,xe),.01);p.scaleToFit!==je&&(p.setScale(je),p._setScaleToFit(je))};t.default.useLayoutEffect(()=>{Z({skipTimeout:!0})},[]),t.default.useEffect(()=>{Z()},[ee,G]),t.default.useEffect(()=>{p.__()},[]),t.default.useEffect(()=>{const ce=Q.current;if(window.ResizeObserver){const he=new ResizeObserver(()=>{Z({skipTimeout:!0})});return he.observe(ce),()=>he.unobserve(ce)}{const he=setInterval(()=>{Z({skipTimeout:!0})},100);return()=>clearInterval(he)}},[ee,G]);const W=Math.max(k,(B.width-ee*p.scale)/2),te=A?1:p.pages.length,re=G*p.scale*te,ie=Math.max(L,(B.height-re)/te/2);t.default.useEffect(()=>{const ce=he=>{(M||c.handleHotkey)(he,p)};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[]),t.default.useEffect(()=>{var ce;const he=Ce=>{if(Ce.ctrlKey||Ce.metaKey){Ce.preventDefault();const xe=Math.max(3,p.scaleToFit),je=Math.min(.1,p.scaleToFit),ot=(Le=Ce.deltaY<0?1.05*p.scale:p.scale/1.05,ue=je,me=xe,Math.max(ue,Math.min(me,Le)));p.setScale(ot)}else var Le,ue,me};return(ce=H.current)===null||ce===void 0||ce.addEventListener("wheel",he),()=>{var Ce;return(Ce=H.current)===null||Ce===void 0?void 0:Ce.removeEventListener("wheel",he)}},[]);const oe=t.default.useRef(!1);w(H,ee*p.scale+2*W,G*p.scale+2*ie,p.scale,p,oe);const{handleScroll:se}=x(H,G*p.scale+2*ie,p,B,oe,A),de=B.width>=ee*p.scale+2*W,pe=P||"rgba(232, 232, 232, 0.9)",Oe=p.pages.indexOf(p.activePage),_e=(O==null?void 0:O.NoPages)||m,Te=S??Math.min(3,Math.max(1,Math.ceil(B.height/2/(G*p.scale))));return t.default.createElement("div",{ref:Q,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:pe},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:H,onScroll:se,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:de?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((ce,he)=>{const Ce=ce===p.activePage;if(A&&!Ce&&!ce._exportingOrRendering&&!ce._forceMount)return null;if(!(Math.abs(he-Oe)<=Te||ce._exportingOrRendering||ce._forceMount))return t.default.createElement(_,{key:ce.id,width:ee*p.scale+2*W,height:G*p.scale+2*ie,backgroundColor:pe,xPadding:W,yPadding:ie});const Le=t.default.createElement(o.default,{key:ce.id,page:ce,xPadding:W,yPadding:ie,width:ee*p.scale+2*W,height:G*p.scale+2*ie,store:p,pageControlsEnabled:h,backColor:pe,pageBorderColor:g||"lightgrey",activePageBorderColor:v||"rgb(0, 161, 255)",altCloneEnabled:T,bleedColor:y||"rgba(255, 0, 0, 0.1)",components:O});return(ce._exportingOrRendering||ce._forceMount)&&!Ce&&A?t.default.createElement("div",{style:{display:"none"},key:ce.id},Le):Le}),p.rulesVisible&&t.default.createElement(l.TopRules,{store:p,xPadding:W,yPadding:ie,width:ee*p.scale+2*W,height:G*p.scale+2*ie}),p.pages.length===0&&t.default.createElement(_e,{store:p}),p.audios.map(ce=>t.default.createElement(s.AudioElement,{key:ce.id,audio:ce,store:p}))))}),e.default=e.WorkspaceCanvas}(mf)),mf}var Qx=Zx(),Jx=zm(),eP=bc(),bd=ts(),T0=Ks(),tP=Bd();eP.toggleFadeInAnimation(!1);bd.setTextOverflow("change-font-size");const nP=new URLSearchParams(location.search).get("key"),P4=Jx.createStore({key:nP});window.store=P4;window.config={addGlobalFont:tP.addGlobalFont,unstable_useHtmlTextRender:bd.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:bd.setTextVerticalResizeEnabled,unstable_setTextOverflow:bd.setTextOverflow,onLoadError:T0.onLoadError,setAssetLoadTimeout:T0.setAssetLoadTimeout,setFontLoadTimeout:T0.setFontLoadTimeout,unstable_setTextSplitAllowed:bd.setTextSplitAllowed};const rP=M3.createRoot(document.getElementById("root"));rP.render(qt.createElement(Qx.WorkspaceCanvas,{visiblePagesOffset:0,store:P4,components:{PageControls:()=>null,Tooltip:()=>null}}));