polotno-node 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-D56TTNQ-.js +298 -0
- package/dist/index.html +1 -1
- package/instance.js +33 -1
- package/package.json +7 -8
- package/video-parallel.js +49 -13
- package/dist/assets/index-BWNdW2kw.js +0 -298
- package/video.js +0 -161
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ph(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var I_={exports:{}},ht={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Tc=Symbol.for("react.element"),PE=Symbol.for("react.portal"),CE=Symbol.for("react.fragment"),kE=Symbol.for("react.strict_mode"),TE=Symbol.for("react.profiler"),AE=Symbol.for("react.provider"),RE=Symbol.for("react.context"),ME=Symbol.for("react.forward_ref"),LE=Symbol.for("react.suspense"),NE=Symbol.for("react.memo"),IE=Symbol.for("react.lazy"),l3=Symbol.iterator;function DE(e){return e===null||typeof e!="object"?null:(e=l3&&e[l3]||e["@@iterator"],typeof e=="function"?e:null)}var D_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j_=Object.assign,F_={};function Hs(e,t,r){this.props=e,this.context=t,this.refs=F_,this.updater=r||D_}Hs.prototype.isReactComponent={};Hs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Hs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function z_(){}z_.prototype=Hs.prototype;function bm(e,t,r){this.props=e,this.context=t,this.refs=F_,this.updater=r||D_}var _m=bm.prototype=new z_;_m.constructor=bm;j_(_m,Hs.prototype);_m.isPureReactComponent=!0;var s3=Array.isArray,B_=Object.prototype.hasOwnProperty,wm={current:null},U_={key:!0,ref:!0,__self:!0,__source:!0};function H_(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)B_.call(t,n)&&!U_.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];i.children=u}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Tc,type:e,key:a,ref:o,props:i,_owner:wm.current}}function jE(e,t){return{$$typeof:Tc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Sm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tc}function FE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var u3=/\/+/g;function f1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FE(""+e.key):t.toString(36)}function wd(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Tc:case PE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+f1(o,0):n,s3(i)?(r="",e!=null&&(r=e.replace(u3,"$&/")+"/"),wd(i,t,r,"",function(f){return f})):i!=null&&(Sm(i)&&(i=jE(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(u3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",s3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+f1(a,l);o+=wd(a,t,r,u,i)}else if(u=DE(e),typeof u=="function")for(e=u.call(e),l=0;!(a=e.next()).done;)a=a.value,u=n+f1(a,l++),o+=wd(a,t,r,u,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Vf(e,t,r){if(e==null)return e;var n=[],i=0;return wd(e,n,"","",function(a){return t.call(r,a,i++)}),n}function zE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Yr={current:null},Sd={transition:null},BE={ReactCurrentDispatcher:Yr,ReactCurrentBatchConfig:Sd,ReactCurrentOwner:wm};function $_(){throw Error("act(...) is not supported in production builds of React.")}ht.Children={map:Vf,forEach:function(e,t,r){Vf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Vf(e,function(){t++}),t},toArray:function(e){return Vf(e,function(t){return t})||[]},only:function(e){if(!Sm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ht.Component=Hs;ht.Fragment=CE;ht.Profiler=TE;ht.PureComponent=bm;ht.StrictMode=kE;ht.Suspense=LE;ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=BE;ht.act=$_;ht.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=j_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=wm.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)B_.call(t,u)&&!U_.hasOwnProperty(u)&&(n[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)n.children=r;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];n.children=l}return{$$typeof:Tc,type:e.type,key:i,ref:a,props:n,_owner:o}};ht.createContext=function(e){return e={$$typeof:RE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:AE,_context:e},e.Consumer=e};ht.createElement=H_;ht.createFactory=function(e){var t=H_.bind(null,e);return t.type=e,t};ht.createRef=function(){return{current:null}};ht.forwardRef=function(e){return{$$typeof:ME,render:e}};ht.isValidElement=Sm;ht.lazy=function(e){return{$$typeof:IE,_payload:{_status:-1,_result:e},_init:zE}};ht.memo=function(e,t){return{$$typeof:NE,type:e,compare:t===void 0?null:t}};ht.startTransition=function(e){var t=Sd.transition;Sd.transition={};try{e()}finally{Sd.transition=t}};ht.unstable_act=$_;ht.useCallback=function(e,t){return Yr.current.useCallback(e,t)};ht.useContext=function(e){return Yr.current.useContext(e)};ht.useDebugValue=function(){};ht.useDeferredValue=function(e){return Yr.current.useDeferredValue(e)};ht.useEffect=function(e,t){return Yr.current.useEffect(e,t)};ht.useId=function(){return Yr.current.useId()};ht.useImperativeHandle=function(e,t,r){return Yr.current.useImperativeHandle(e,t,r)};ht.useInsertionEffect=function(e,t){return Yr.current.useInsertionEffect(e,t)};ht.useLayoutEffect=function(e,t){return Yr.current.useLayoutEffect(e,t)};ht.useMemo=function(e,t){return Yr.current.useMemo(e,t)};ht.useReducer=function(e,t,r){return Yr.current.useReducer(e,t,r)};ht.useRef=function(e){return Yr.current.useRef(e)};ht.useState=function(e){return Yr.current.useState(e)};ht.useSyncExternalStore=function(e,t,r){return Yr.current.useSyncExternalStore(e,t,r)};ht.useTransition=function(){return Yr.current.useTransition()};ht.version="18.3.1";I_.exports=ht;var rt=I_.exports;const dt=Ph(rt);var jd={},G_={exports:{}},kn={},V_={exports:{}},q_={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/(function(e){function t(H,L){var M=H.length;H.push(L);e:for(;0<M;){var D=M-1>>>1,B=H[D];if(0<i(B,L))H[D]=L,H[M]=B,M=D;else break e}}function r(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var L=H[0],M=H.pop();if(M!==L){H[0]=M;e:for(var D=0,B=H.length,q=B>>>1;D<q;){var K=2*(D+1)-1,z=H[K],$=K+1,F=H[$];if(0>i(z,M))$<B&&0>i(F,z)?(H[D]=F,H[$]=M,D=$):(H[D]=z,H[K]=M,D=K);else if($<B&&0>i(F,M))H[D]=F,H[$]=M,D=$;else break e}}return L}function i(H,L){var M=H.sortIndex-L.sortIndex;return M!==0?M:H.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],f=[],h=1,O=null,S=3,b=!1,_=!1,y=!1,p=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(H){for(var L=r(f);L!==null;){if(L.callback===null)n(f);else if(L.startTime<=H)n(f),L.sortIndex=L.expirationTime,t(u,L);else break;L=r(f)}}function g(H){if(y=!1,d(H),!_)if(r(u)!==null)_=!0,Z(w);else{var L=r(f);L!==null&&W(g,L.startTime-H)}}function w(H,L){_=!1,y&&(y=!1,v(A),A=-1),b=!0;var M=S;try{for(d(L),O=r(u);O!==null&&(!(O.expirationTime>L)||H&&!C());){var D=O.callback;if(typeof D=="function"){O.callback=null,S=O.priorityLevel;var B=D(O.expirationTime<=L);L=e.unstable_now(),typeof B=="function"?O.callback=B:O===r(u)&&n(u),d(L)}else n(u);O=r(u)}if(O!==null)var q=!0;else{var K=r(f);K!==null&&W(g,K.startTime-L),q=!1}return q}finally{O=null,S=M,b=!1}}var k=!1,P=null,A=-1,E=5,x=-1;function C(){return!(e.unstable_now()-x<E)}function R(){if(P!==null){var H=e.unstable_now();x=H;var L=!0;try{L=P(!0,H)}finally{L?N():(k=!1,P=null)}}else k=!1}var N;if(typeof m=="function")N=function(){m(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,G=U.port2;U.port1.onmessage=R,N=function(){G.postMessage(null)}}else N=function(){p(R,0)};function Z(H){P=H,k||(k=!0,N())}function W(H,L){A=p(function(){H(e.unstable_now())},L)}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(H){H.callback=null},e.unstable_continueExecution=function(){_||b||(_=!0,Z(w))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(H){switch(S){case 1:case 2:case 3:var L=3;break;default:L=S}var M=S;S=L;try{return H()}finally{S=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,L){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var M=S;S=H;try{return L()}finally{S=M}},e.unstable_scheduleCallback=function(H,L,M){var D=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?D+M:D):M=D,H){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=M+B,H={id:h++,callback:L,priorityLevel:H,startTime:M,expirationTime:B,sortIndex:-1},M>D?(H.sortIndex=M,t(f,H),r(u)===null&&H===r(f)&&(y?(v(A),A=-1):y=!0,W(g,M-D))):(H.sortIndex=B,t(u,H),_||b||(_=!0,Z(w))),H},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(H){var L=S;return function(){var M=S;S=L;try{return H.apply(this,arguments)}finally{S=M}}}})(q_);V_.exports=q_;var Uu=V_.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 UE=rt,Pn=Uu;function xe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var W_=new Set,tc={};function hl(e,t){_s(e,t),_s(e+"Capture",t)}function _s(e,t){for(tc[e]=t,e=0;e<t.length;e++)W_.add(t[e])}var ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rv=Object.prototype.hasOwnProperty,HE=/^[: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]*$/,c3={},f3={};function $E(e){return rv.call(f3,e)?!0:rv.call(c3,e)?!1:HE.test(e)?f3[e]=!0:(c3[e]=!0,!1)}function GE(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function VE(e,t,r,n){if(t===null||typeof t>"u"||GE(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Ar={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ar[e]=new Xr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ar[t]=new Xr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ar[e]=new Xr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ar[e]=new Xr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ar[e]=new Xr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ar[e]=new Xr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ar[e]=new Xr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ar[e]=new Xr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ar[e]=new Xr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Em=/[\-:]([a-z])/g;function Om(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Em,Om);Ar[t]=new Xr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Em,Om);Ar[t]=new Xr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Em,Om);Ar[t]=new Xr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ar[e]=new Xr(e,1,!1,e.toLowerCase(),null,!1,!1)});Ar.xlinkHref=new Xr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ar[e]=new Xr(e,1,!1,e.toLowerCase(),null,!0,!0)});function xm(e,t,r,n){var i=Ar.hasOwnProperty(t)?Ar[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(VE(t,r,i,n)&&(r=null),n||i===null?$E(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Oa=UE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qf=Symbol.for("react.element"),Ql=Symbol.for("react.portal"),Jl=Symbol.for("react.fragment"),Pm=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),K_=Symbol.for("react.provider"),Y_=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),iv=Symbol.for("react.suspense"),av=Symbol.for("react.suspense_list"),km=Symbol.for("react.memo"),Wa=Symbol.for("react.lazy"),X_=Symbol.for("react.offscreen"),d3=Symbol.iterator;function Ou(e){return e===null||typeof e!="object"?null:(e=d3&&e[d3]||e["@@iterator"],typeof e=="function"?e:null)}var Kt=Object.assign,d1;function Du(e){if(d1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);d1=t&&t[1]||""}return`
|
|
26
|
+
`+d1+e}var h1=!1;function p1(e,t){if(!e||h1)return"";h1=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var n=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){n=f}e.call(t.prototype)}else{try{throw Error()}catch(f){n=f}e()}}catch(f){if(f&&n&&typeof f.stack=="string"){for(var i=f.stack.split(`
|
|
27
|
+
`),a=n.stack.split(`
|
|
28
|
+
`),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var u=`
|
|
29
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=l);break}}}finally{h1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Du(e):""}function qE(e){switch(e.tag){case 5:return Du(e.type);case 16:return Du("Lazy");case 13:return Du("Suspense");case 19:return Du("SuspenseList");case 0:case 2:case 15:return e=p1(e.type,!1),e;case 11:return e=p1(e.type.render,!1),e;case 1:return e=p1(e.type,!0),e;default:return""}}function ov(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jl:return"Fragment";case Ql:return"Portal";case nv:return"Profiler";case Pm:return"StrictMode";case iv:return"Suspense";case av:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Y_:return(e.displayName||"Context")+".Consumer";case K_:return(e._context.displayName||"Context")+".Provider";case Cm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case km:return t=e.displayName||null,t!==null?t:ov(e.type)||"Memo";case Wa:t=e._payload,e=e._init;try{return ov(e(t))}catch{}}return null}function WE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ov(t);case 8:return t===Pm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function KE(e){var t=Z_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wf(e){e._valueTracker||(e._valueTracker=KE(e))}function Q_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Z_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Fd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lv(e,t){var r=t.checked;return Kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function h3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=fo(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function J_(e,t){t=t.checked,t!=null&&xm(e,"checked",t,!1)}function sv(e,t){J_(e,t);var r=fo(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uv(e,t.type,r):t.hasOwnProperty("defaultValue")&&uv(e,t.type,fo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function p3(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function uv(e,t,r){(t!=="number"||Fd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ju=Array.isArray;function hs(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+fo(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function cv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(xe(91));return Kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function g3(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(xe(92));if(ju(r)){if(1<r.length)throw Error(xe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:fo(r)}}function e6(e,t){var r=fo(t.value),n=fo(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function v3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function t6(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?t6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Kf,r6=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Kf=Kf||document.createElement("div"),Kf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Kf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Hu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},YE=["Webkit","ms","Moz","O"];Object.keys(Hu).forEach(function(e){YE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hu[t]=Hu[e]})});function n6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Hu.hasOwnProperty(e)&&Hu[e]?(""+t).trim():t+"px"}function i6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=n6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var XE=Kt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dv(e,t){if(t){if(XE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(xe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(xe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(xe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(xe(62))}}function hv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pv=null;function Tm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gv=null,ps=null,gs=null;function m3(e){if(e=Mc(e)){if(typeof gv!="function")throw Error(xe(280));var t=e.stateNode;t&&(t=Rh(t),gv(e.stateNode,e.type,t))}}function a6(e){ps?gs?gs.push(e):gs=[e]:ps=e}function o6(){if(ps){var e=ps,t=gs;if(gs=ps=null,m3(e),t)for(e=0;e<t.length;e++)m3(t[e])}}function l6(e,t){return e(t)}function s6(){}var g1=!1;function u6(e,t,r){if(g1)return e(t,r);g1=!0;try{return l6(e,t,r)}finally{g1=!1,(ps!==null||gs!==null)&&(s6(),o6())}}function nc(e,t){var r=e.stateNode;if(r===null)return null;var n=Rh(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(xe(231,t,typeof r));return r}var vv=!1;if(ya)try{var xu={};Object.defineProperty(xu,"passive",{get:function(){vv=!0}}),window.addEventListener("test",xu,xu),window.removeEventListener("test",xu,xu)}catch{vv=!1}function ZE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(h){this.onError(h)}}var $u=!1,zd=null,Bd=!1,mv=null,QE={onError:function(e){$u=!0,zd=e}};function JE(e,t,r,n,i,a,o,l,u){$u=!1,zd=null,ZE.apply(QE,arguments)}function eO(e,t,r,n,i,a,o,l,u){if(JE.apply(this,arguments),$u){if($u){var f=zd;$u=!1,zd=null}else throw Error(xe(198));Bd||(Bd=!0,mv=f)}}function pl(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function c6(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y3(e){if(pl(e)!==e)throw Error(xe(188))}function tO(e){var t=e.alternate;if(!t){if(t=pl(e),t===null)throw Error(xe(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return y3(i),e;if(a===n)return y3(i),t;a=a.sibling}throw Error(xe(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(xe(189))}}if(r.alternate!==n)throw Error(xe(190))}if(r.tag!==3)throw Error(xe(188));return r.stateNode.current===r?e:t}function f6(e){return e=tO(e),e!==null?d6(e):null}function d6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=d6(e);if(t!==null)return t;e=e.sibling}return null}var h6=Pn.unstable_scheduleCallback,b3=Pn.unstable_cancelCallback,rO=Pn.unstable_shouldYield,nO=Pn.unstable_requestPaint,tr=Pn.unstable_now,iO=Pn.unstable_getCurrentPriorityLevel,Am=Pn.unstable_ImmediatePriority,p6=Pn.unstable_UserBlockingPriority,Ud=Pn.unstable_NormalPriority,aO=Pn.unstable_LowPriority,g6=Pn.unstable_IdlePriority,Ch=null,Bi=null;function oO(e){if(Bi&&typeof Bi.onCommitFiberRoot=="function")try{Bi.onCommitFiberRoot(Ch,e,void 0,(e.current.flags&128)===128)}catch{}}var fi=Math.clz32?Math.clz32:uO,lO=Math.log,sO=Math.LN2;function uO(e){return e>>>=0,e===0?32:31-(lO(e)/sO|0)|0}var Yf=64,Xf=4194304;function Fu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Fu(l):(a&=o,a!==0&&(n=Fu(a)))}else o=r&~i,o!==0?n=Fu(o):a!==0&&(n=Fu(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-fi(t),i=1<<r,n|=e[r],t&=~i;return n}function cO(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-fi(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=cO(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function yv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function v6(){var e=Yf;return Yf<<=1,!(Yf&4194240)&&(Yf=64),e}function v1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ac(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fi(t),e[t]=r}function dO(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-fi(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Rm(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-fi(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var xt=0;function m6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var y6,Mm,b6,_6,w6,bv=!1,Zf=[],to=null,ro=null,no=null,ic=new Map,ac=new Map,Ya=[],hO="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 _3(e,t){switch(e){case"focusin":case"focusout":to=null;break;case"dragenter":case"dragleave":ro=null;break;case"mouseover":case"mouseout":no=null;break;case"pointerover":case"pointerout":ic.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(t.pointerId)}}function Pu(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Mc(t),t!==null&&Mm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function pO(e,t,r,n,i){switch(t){case"focusin":return to=Pu(to,e,t,r,n,i),!0;case"dragenter":return ro=Pu(ro,e,t,r,n,i),!0;case"mouseover":return no=Pu(no,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return ic.set(a,Pu(ic.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,ac.set(a,Pu(ac.get(a)||null,e,t,r,n,i)),!0}return!1}function S6(e){var t=Ko(e.target);if(t!==null){var r=pl(t);if(r!==null){if(t=r.tag,t===13){if(t=c6(r),t!==null){e.blockedOn=t,w6(e.priority,function(){b6(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ed(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=_v(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);pv=n,r.target.dispatchEvent(n),pv=null}else return t=Mc(r),t!==null&&Mm(t),e.blockedOn=r,!1;t.shift()}return!0}function w3(e,t,r){Ed(e)&&r.delete(t)}function gO(){bv=!1,to!==null&&Ed(to)&&(to=null),ro!==null&&Ed(ro)&&(ro=null),no!==null&&Ed(no)&&(no=null),ic.forEach(w3),ac.forEach(w3)}function Cu(e,t){e.blockedOn===t&&(e.blockedOn=null,bv||(bv=!0,Pn.unstable_scheduleCallback(Pn.unstable_NormalPriority,gO)))}function oc(e){function t(i){return Cu(i,e)}if(0<Zf.length){Cu(Zf[0],e);for(var r=1;r<Zf.length;r++){var n=Zf[r];n.blockedOn===e&&(n.blockedOn=null)}}for(to!==null&&Cu(to,e),ro!==null&&Cu(ro,e),no!==null&&Cu(no,e),ic.forEach(t),ac.forEach(t),r=0;r<Ya.length;r++)n=Ya[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Ya.length&&(r=Ya[0],r.blockedOn===null);)S6(r),r.blockedOn===null&&Ya.shift()}var vs=Oa.ReactCurrentBatchConfig,$d=!0;function vO(e,t,r,n){var i=xt,a=vs.transition;vs.transition=null;try{xt=1,Lm(e,t,r,n)}finally{xt=i,vs.transition=a}}function mO(e,t,r,n){var i=xt,a=vs.transition;vs.transition=null;try{xt=4,Lm(e,t,r,n)}finally{xt=i,vs.transition=a}}function Lm(e,t,r,n){if($d){var i=_v(e,t,r,n);if(i===null)P1(e,t,n,Gd,r),_3(e,n);else if(pO(i,e,t,r,n))n.stopPropagation();else if(_3(e,n),t&4&&-1<hO.indexOf(e)){for(;i!==null;){var a=Mc(i);if(a!==null&&y6(a),a=_v(e,t,r,n),a===null&&P1(e,t,n,Gd,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else P1(e,t,n,null,r)}}var Gd=null;function _v(e,t,r,n){if(Gd=null,e=Tm(n),e=Ko(e),e!==null)if(t=pl(e),t===null)e=null;else if(r=t.tag,r===13){if(e=c6(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Gd=e,null}function E6(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(iO()){case Am:return 1;case p6:return 4;case Ud:case aO:return 16;case g6:return 536870912;default:return 16}default:return 16}}var Qa=null,Nm=null,Od=null;function O6(){if(Od)return Od;var e,t=Nm,r=t.length,n,i="value"in Qa?Qa.value:Qa.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[a-n];n++);return Od=i.slice(e,1<n?1-n:void 0)}function xd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Qf(){return!0}function S3(){return!1}function Tn(e){function t(r,n,i,a,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Qf:S3,this.isPropagationStopped=S3,this}return Kt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Qf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Qf)},persist:function(){},isPersistent:Qf}),t}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Tn($s),Rc=Kt({},$s,{view:0,detail:0}),yO=Tn(Rc),m1,y1,ku,kh=Kt({},Rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ku&&(ku&&e.type==="mousemove"?(m1=e.screenX-ku.screenX,y1=e.screenY-ku.screenY):y1=m1=0,ku=e),m1)},movementY:function(e){return"movementY"in e?e.movementY:y1}}),E3=Tn(kh),bO=Kt({},kh,{dataTransfer:0}),_O=Tn(bO),wO=Kt({},Rc,{relatedTarget:0}),b1=Tn(wO),SO=Kt({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),EO=Tn(SO),OO=Kt({},$s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xO=Tn(OO),PO=Kt({},$s,{data:0}),O3=Tn(PO),CO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kO={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"},TO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=TO[e])?!!t[e]:!1}function Dm(){return AO}var RO=Kt({},Rc,{key:function(e){if(e.key){var t=CO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(e){return e.type==="keypress"?xd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),MO=Tn(RO),LO=Kt({},kh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),x3=Tn(LO),NO=Kt({},Rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),IO=Tn(NO),DO=Kt({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),jO=Tn(DO),FO=Kt({},kh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),zO=Tn(FO),BO=[9,13,27,32],jm=ya&&"CompositionEvent"in window,Gu=null;ya&&"documentMode"in document&&(Gu=document.documentMode);var UO=ya&&"TextEvent"in window&&!Gu,x6=ya&&(!jm||Gu&&8<Gu&&11>=Gu),P3=" ",C3=!1;function P6(e,t){switch(e){case"keyup":return BO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function HO(e,t){switch(e){case"compositionend":return C6(t);case"keypress":return t.which!==32?null:(C3=!0,P3);case"textInput":return e=t.data,e===P3&&C3?null:e;default:return null}}function $O(e,t){if(es)return e==="compositionend"||!jm&&P6(e,t)?(e=O6(),Od=Nm=Qa=null,es=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return x6&&t.locale!=="ko"?null:t.data;default:return null}}var GO={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 k3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!GO[e.type]:t==="textarea"}function k6(e,t,r,n){a6(n),t=Vd(t,"onChange"),0<t.length&&(r=new Im("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Vu=null,lc=null;function VO(e){z6(e,0)}function Th(e){var t=ns(e);if(Q_(t))return e}function qO(e,t){if(e==="change")return t}var T6=!1;if(ya){var _1;if(ya){var w1="oninput"in document;if(!w1){var T3=document.createElement("div");T3.setAttribute("oninput","return;"),w1=typeof T3.oninput=="function"}_1=w1}else _1=!1;T6=_1&&(!document.documentMode||9<document.documentMode)}function A3(){Vu&&(Vu.detachEvent("onpropertychange",A6),lc=Vu=null)}function A6(e){if(e.propertyName==="value"&&Th(lc)){var t=[];k6(t,lc,e,Tm(e)),u6(VO,t)}}function WO(e,t,r){e==="focusin"?(A3(),Vu=t,lc=r,Vu.attachEvent("onpropertychange",A6)):e==="focusout"&&A3()}function KO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Th(lc)}function YO(e,t){if(e==="click")return Th(t)}function XO(e,t){if(e==="input"||e==="change")return Th(t)}function ZO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mi=typeof Object.is=="function"?Object.is:ZO;function sc(e,t){if(mi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!rv.call(t,i)||!mi(e[i],t[i]))return!1}return!0}function R3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function M3(e,t){var r=R3(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=R3(r)}}function R6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?R6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function M6(){for(var e=window,t=Fd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Fd(e.document)}return t}function Fm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function QO(e){var t=M6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&R6(r.ownerDocument.documentElement,r)){if(n!==null&&Fm(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=M3(r,a);var o=M3(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var JO=ya&&"documentMode"in document&&11>=document.documentMode,ts=null,wv=null,qu=null,Sv=!1;function L3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sv||ts==null||ts!==Fd(n)||(n=ts,"selectionStart"in n&&Fm(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qu&&sc(qu,n)||(qu=n,n=Vd(wv,"onSelect"),0<n.length&&(t=new Im("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ts)))}function Jf(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var rs={animationend:Jf("Animation","AnimationEnd"),animationiteration:Jf("Animation","AnimationIteration"),animationstart:Jf("Animation","AnimationStart"),transitionend:Jf("Transition","TransitionEnd")},S1={},L6={};ya&&(L6=document.createElement("div").style,"AnimationEvent"in window||(delete rs.animationend.animation,delete rs.animationiteration.animation,delete rs.animationstart.animation),"TransitionEvent"in window||delete rs.transitionend.transition);function Ah(e){if(S1[e])return S1[e];if(!rs[e])return e;var t=rs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in L6)return S1[e]=t[r];return e}var N6=Ah("animationend"),I6=Ah("animationiteration"),D6=Ah("animationstart"),j6=Ah("transitionend"),F6=new Map,N3="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function yo(e,t){F6.set(e,t),hl(t,[e])}for(var E1=0;E1<N3.length;E1++){var O1=N3[E1],ex=O1.toLowerCase(),tx=O1[0].toUpperCase()+O1.slice(1);yo(ex,"on"+tx)}yo(N6,"onAnimationEnd");yo(I6,"onAnimationIteration");yo(D6,"onAnimationStart");yo("dblclick","onDoubleClick");yo("focusin","onFocus");yo("focusout","onBlur");yo(j6,"onTransitionEnd");_s("onMouseEnter",["mouseout","mouseover"]);_s("onMouseLeave",["mouseout","mouseover"]);_s("onPointerEnter",["pointerout","pointerover"]);_s("onPointerLeave",["pointerout","pointerover"]);hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hl("onBeforeInput",["compositionend","keypress","textInput","paste"]);hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),rx=new Set("cancel close invalid load scroll toggle".split(" ").concat(zu));function I3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,eO(n,t,void 0,e),e.currentTarget=null}function z6(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==a&&i.isPropagationStopped())break e;I3(i,l,f),a=u}else for(o=0;o<n.length;o++){if(l=n[o],u=l.instance,f=l.currentTarget,l=l.listener,u!==a&&i.isPropagationStopped())break e;I3(i,l,f),a=u}}}if(Bd)throw e=mv,Bd=!1,mv=null,e}function Ft(e,t){var r=t[Cv];r===void 0&&(r=t[Cv]=new Set);var n=e+"__bubble";r.has(n)||(B6(t,e,2,!1),r.add(n))}function x1(e,t,r){var n=0;t&&(n|=4),B6(r,e,n,t)}var ed="_reactListening"+Math.random().toString(36).slice(2);function uc(e){if(!e[ed]){e[ed]=!0,W_.forEach(function(r){r!=="selectionchange"&&(rx.has(r)||x1(r,!1,e),x1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ed]||(t[ed]=!0,x1("selectionchange",!1,t))}}function B6(e,t,r,n){switch(E6(t)){case 1:var i=vO;break;case 4:i=mO;break;default:i=Lm}r=i.bind(null,t,r,e),i=void 0,!vv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function P1(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Ko(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}u6(function(){var f=a,h=Tm(r),O=[];e:{var S=F6.get(e);if(S!==void 0){var b=Im,_=e;switch(e){case"keypress":if(xd(r)===0)break e;case"keydown":case"keyup":b=MO;break;case"focusin":_="focus",b=b1;break;case"focusout":_="blur",b=b1;break;case"beforeblur":case"afterblur":b=b1;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=E3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=_O;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=IO;break;case N6:case I6:case D6:b=EO;break;case j6:b=jO;break;case"scroll":b=yO;break;case"wheel":b=zO;break;case"copy":case"cut":case"paste":b=xO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=x3}var y=(t&4)!==0,p=!y&&e==="scroll",v=y?S!==null?S+"Capture":null:S;y=[];for(var m=f,d;m!==null;){d=m;var g=d.stateNode;if(d.tag===5&&g!==null&&(d=g,v!==null&&(g=nc(m,v),g!=null&&y.push(cc(m,g,d)))),p)break;m=m.return}0<y.length&&(S=new b(S,_,null,r,h),O.push({event:S,listeners:y}))}}if(!(t&7)){e:{if(S=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",S&&r!==pv&&(_=r.relatedTarget||r.fromElement)&&(Ko(_)||_[ba]))break e;if((b||S)&&(S=h.window===h?h:(S=h.ownerDocument)?S.defaultView||S.parentWindow:window,b?(_=r.relatedTarget||r.toElement,b=f,_=_?Ko(_):null,_!==null&&(p=pl(_),_!==p||_.tag!==5&&_.tag!==6)&&(_=null)):(b=null,_=f),b!==_)){if(y=E3,g="onMouseLeave",v="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(y=x3,g="onPointerLeave",v="onPointerEnter",m="pointer"),p=b==null?S:ns(b),d=_==null?S:ns(_),S=new y(g,m+"leave",b,r,h),S.target=p,S.relatedTarget=d,g=null,Ko(h)===f&&(y=new y(v,m+"enter",_,r,h),y.target=d,y.relatedTarget=p,g=y),p=g,b&&_)t:{for(y=b,v=_,m=0,d=y;d;d=ql(d))m++;for(d=0,g=v;g;g=ql(g))d++;for(;0<m-d;)y=ql(y),m--;for(;0<d-m;)v=ql(v),d--;for(;m--;){if(y===v||v!==null&&y===v.alternate)break t;y=ql(y),v=ql(v)}y=null}else y=null;b!==null&&D3(O,S,b,y,!1),_!==null&&p!==null&&D3(O,p,_,y,!0)}}e:{if(S=f?ns(f):window,b=S.nodeName&&S.nodeName.toLowerCase(),b==="select"||b==="input"&&S.type==="file")var w=qO;else if(k3(S))if(T6)w=XO;else{w=KO;var k=WO}else(b=S.nodeName)&&b.toLowerCase()==="input"&&(S.type==="checkbox"||S.type==="radio")&&(w=YO);if(w&&(w=w(e,f))){k6(O,w,r,h);break e}k&&k(e,S,f),e==="focusout"&&(k=S._wrapperState)&&k.controlled&&S.type==="number"&&uv(S,"number",S.value)}switch(k=f?ns(f):window,e){case"focusin":(k3(k)||k.contentEditable==="true")&&(ts=k,wv=f,qu=null);break;case"focusout":qu=wv=ts=null;break;case"mousedown":Sv=!0;break;case"contextmenu":case"mouseup":case"dragend":Sv=!1,L3(O,r,h);break;case"selectionchange":if(JO)break;case"keydown":case"keyup":L3(O,r,h)}var P;if(jm)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else es?P6(e,r)&&(A="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(A="onCompositionStart");A&&(x6&&r.locale!=="ko"&&(es||A!=="onCompositionStart"?A==="onCompositionEnd"&&es&&(P=O6()):(Qa=h,Nm="value"in Qa?Qa.value:Qa.textContent,es=!0)),k=Vd(f,A),0<k.length&&(A=new O3(A,e,null,r,h),O.push({event:A,listeners:k}),P?A.data=P:(P=C6(r),P!==null&&(A.data=P)))),(P=UO?HO(e,r):$O(e,r))&&(f=Vd(f,"onBeforeInput"),0<f.length&&(h=new O3("onBeforeInput","beforeinput",null,r,h),O.push({event:h,listeners:f}),h.data=P))}z6(O,t)})}function cc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Vd(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=nc(e,r),a!=null&&n.unshift(cc(e,a,i)),a=nc(e,t),a!=null&&n.push(cc(e,a,i))),e=e.return}return n}function ql(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function D3(e,t,r,n,i){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,u=l.alternate,f=l.stateNode;if(u!==null&&u===n)break;l.tag===5&&f!==null&&(l=f,i?(u=nc(r,a),u!=null&&o.unshift(cc(r,u,l))):i||(u=nc(r,a),u!=null&&o.push(cc(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var nx=/\r\n?/g,ix=/\u0000|\uFFFD/g;function j3(e){return(typeof e=="string"?e:""+e).replace(nx,`
|
|
30
|
+
`).replace(ix,"")}function td(e,t,r){if(t=j3(t),j3(e)!==t&&r)throw Error(xe(425))}function qd(){}var Ev=null,Ov=null;function xv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pv=typeof setTimeout=="function"?setTimeout:void 0,ax=typeof clearTimeout=="function"?clearTimeout:void 0,F3=typeof Promise=="function"?Promise:void 0,ox=typeof queueMicrotask=="function"?queueMicrotask:typeof F3<"u"?function(e){return F3.resolve(null).then(e).catch(lx)}:Pv;function lx(e){setTimeout(function(){throw e})}function C1(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),oc(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);oc(t)}function io(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function z3(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Gs=Math.random().toString(36).slice(2),Di="__reactFiber$"+Gs,fc="__reactProps$"+Gs,ba="__reactContainer$"+Gs,Cv="__reactEvents$"+Gs,sx="__reactListeners$"+Gs,ux="__reactHandles$"+Gs;function Ko(e){var t=e[Di];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ba]||r[Di]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=z3(e);e!==null;){if(r=e[Di])return r;e=z3(e)}return t}e=r,r=e.parentNode}return null}function Mc(e){return e=e[Di]||e[ba],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ns(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(xe(33))}function Rh(e){return e[fc]||null}var kv=[],is=-1;function bo(e){return{current:e}}function zt(e){0>is||(e.current=kv[is],kv[is]=null,is--)}function Lt(e,t){is++,kv[is]=e.current,e.current=t}var ho={},Hr=bo(ho),dn=bo(!1),rl=ho;function ws(e,t){var r=e.type.contextTypes;if(!r)return ho;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function hn(e){return e=e.childContextTypes,e!=null}function Wd(){zt(dn),zt(Hr)}function B3(e,t,r){if(Hr.current!==ho)throw Error(xe(168));Lt(Hr,t),Lt(dn,r)}function U6(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(xe(108,WE(e)||"Unknown",i));return Kt({},r,n)}function Kd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ho,rl=Hr.current,Lt(Hr,e),Lt(dn,dn.current),!0}function U3(e,t,r){var n=e.stateNode;if(!n)throw Error(xe(169));r?(e=U6(e,t,rl),n.__reactInternalMemoizedMergedChildContext=e,zt(dn),zt(Hr),Lt(Hr,e)):zt(dn),Lt(dn,r)}var ua=null,Mh=!1,k1=!1;function H6(e){ua===null?ua=[e]:ua.push(e)}function cx(e){Mh=!0,H6(e)}function _o(){if(!k1&&ua!==null){k1=!0;var e=0,t=xt;try{var r=ua;for(xt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ua=null,Mh=!1}catch(i){throw ua!==null&&(ua=ua.slice(e+1)),h6(Am,_o),i}finally{xt=t,k1=!1}}return null}var as=[],os=0,Yd=null,Xd=0,Hn=[],$n=0,nl=null,fa=1,da="";function qo(e,t){as[os++]=Xd,as[os++]=Yd,Yd=e,Xd=t}function $6(e,t,r){Hn[$n++]=fa,Hn[$n++]=da,Hn[$n++]=nl,nl=e;var n=fa;e=da;var i=32-fi(n)-1;n&=~(1<<i),r+=1;var a=32-fi(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,fa=1<<32-fi(t)+i|r<<i|n,da=a+e}else fa=1<<a|r<<i|n,da=e}function zm(e){e.return!==null&&(qo(e,1),$6(e,1,0))}function Bm(e){for(;e===Yd;)Yd=as[--os],as[os]=null,Xd=as[--os],as[os]=null;for(;e===nl;)nl=Hn[--$n],Hn[$n]=null,da=Hn[--$n],Hn[$n]=null,fa=Hn[--$n],Hn[$n]=null}var xn=null,On=null,Ht=!1,ci=null;function G6(e,t){var r=qn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function H3(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xn=e,On=io(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xn=e,On=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=nl!==null?{id:fa,overflow:da}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=qn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,xn=e,On=null,!0):!1;default:return!1}}function Tv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Av(e){if(Ht){var t=On;if(t){var r=t;if(!H3(e,t)){if(Tv(e))throw Error(xe(418));t=io(r.nextSibling);var n=xn;t&&H3(e,t)?G6(n,r):(e.flags=e.flags&-4097|2,Ht=!1,xn=e)}}else{if(Tv(e))throw Error(xe(418));e.flags=e.flags&-4097|2,Ht=!1,xn=e}}}function $3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xn=e}function rd(e){if(e!==xn)return!1;if(!Ht)return $3(e),Ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xv(e.type,e.memoizedProps)),t&&(t=On)){if(Tv(e))throw V6(),Error(xe(418));for(;t;)G6(e,t),t=io(t.nextSibling)}if($3(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(xe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){On=io(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}On=null}}else On=xn?io(e.stateNode.nextSibling):null;return!0}function V6(){for(var e=On;e;)e=io(e.nextSibling)}function Ss(){On=xn=null,Ht=!1}function Um(e){ci===null?ci=[e]:ci.push(e)}var fx=Oa.ReactCurrentBatchConfig;function Tu(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(xe(309));var n=r.stateNode}if(!n)throw Error(xe(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(xe(284));if(!r._owner)throw Error(xe(290,e))}return e}function nd(e,t){throw e=Object.prototype.toString.call(t),Error(xe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function G3(e){var t=e._init;return t(e._payload)}function q6(e){function t(v,m){if(e){var d=v.deletions;d===null?(v.deletions=[m],v.flags|=16):d.push(m)}}function r(v,m){if(!e)return null;for(;m!==null;)t(v,m),m=m.sibling;return null}function n(v,m){for(v=new Map;m!==null;)m.key!==null?v.set(m.key,m):v.set(m.index,m),m=m.sibling;return v}function i(v,m){return v=so(v,m),v.index=0,v.sibling=null,v}function a(v,m,d){return v.index=d,e?(d=v.alternate,d!==null?(d=d.index,d<m?(v.flags|=2,m):d):(v.flags|=2,m)):(v.flags|=1048576,m)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,m,d,g){return m===null||m.tag!==6?(m=I1(d,v.mode,g),m.return=v,m):(m=i(m,d),m.return=v,m)}function u(v,m,d,g){var w=d.type;return w===Jl?h(v,m,d.props.children,g,d.key):m!==null&&(m.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Wa&&G3(w)===m.type)?(g=i(m,d.props),g.ref=Tu(v,m,d),g.return=v,g):(g=Md(d.type,d.key,d.props,null,v.mode,g),g.ref=Tu(v,m,d),g.return=v,g)}function f(v,m,d,g){return m===null||m.tag!==4||m.stateNode.containerInfo!==d.containerInfo||m.stateNode.implementation!==d.implementation?(m=D1(d,v.mode,g),m.return=v,m):(m=i(m,d.children||[]),m.return=v,m)}function h(v,m,d,g,w){return m===null||m.tag!==7?(m=Jo(d,v.mode,g,w),m.return=v,m):(m=i(m,d),m.return=v,m)}function O(v,m,d){if(typeof m=="string"&&m!==""||typeof m=="number")return m=I1(""+m,v.mode,d),m.return=v,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case qf:return d=Md(m.type,m.key,m.props,null,v.mode,d),d.ref=Tu(v,null,m),d.return=v,d;case Ql:return m=D1(m,v.mode,d),m.return=v,m;case Wa:var g=m._init;return O(v,g(m._payload),d)}if(ju(m)||Ou(m))return m=Jo(m,v.mode,d,null),m.return=v,m;nd(v,m)}return null}function S(v,m,d,g){var w=m!==null?m.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return w!==null?null:l(v,m,""+d,g);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case qf:return d.key===w?u(v,m,d,g):null;case Ql:return d.key===w?f(v,m,d,g):null;case Wa:return w=d._init,S(v,m,w(d._payload),g)}if(ju(d)||Ou(d))return w!==null?null:h(v,m,d,g,null);nd(v,d)}return null}function b(v,m,d,g,w){if(typeof g=="string"&&g!==""||typeof g=="number")return v=v.get(d)||null,l(m,v,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case qf:return v=v.get(g.key===null?d:g.key)||null,u(m,v,g,w);case Ql:return v=v.get(g.key===null?d:g.key)||null,f(m,v,g,w);case Wa:var k=g._init;return b(v,m,d,k(g._payload),w)}if(ju(g)||Ou(g))return v=v.get(d)||null,h(m,v,g,w,null);nd(m,g)}return null}function _(v,m,d,g){for(var w=null,k=null,P=m,A=m=0,E=null;P!==null&&A<d.length;A++){P.index>A?(E=P,P=null):E=P.sibling;var x=S(v,P,d[A],g);if(x===null){P===null&&(P=E);break}e&&P&&x.alternate===null&&t(v,P),m=a(x,m,A),k===null?w=x:k.sibling=x,k=x,P=E}if(A===d.length)return r(v,P),Ht&&qo(v,A),w;if(P===null){for(;A<d.length;A++)P=O(v,d[A],g),P!==null&&(m=a(P,m,A),k===null?w=P:k.sibling=P,k=P);return Ht&&qo(v,A),w}for(P=n(v,P);A<d.length;A++)E=b(P,v,A,d[A],g),E!==null&&(e&&E.alternate!==null&&P.delete(E.key===null?A:E.key),m=a(E,m,A),k===null?w=E:k.sibling=E,k=E);return e&&P.forEach(function(C){return t(v,C)}),Ht&&qo(v,A),w}function y(v,m,d,g){var w=Ou(d);if(typeof w!="function")throw Error(xe(150));if(d=w.call(d),d==null)throw Error(xe(151));for(var k=w=null,P=m,A=m=0,E=null,x=d.next();P!==null&&!x.done;A++,x=d.next()){P.index>A?(E=P,P=null):E=P.sibling;var C=S(v,P,x.value,g);if(C===null){P===null&&(P=E);break}e&&P&&C.alternate===null&&t(v,P),m=a(C,m,A),k===null?w=C:k.sibling=C,k=C,P=E}if(x.done)return r(v,P),Ht&&qo(v,A),w;if(P===null){for(;!x.done;A++,x=d.next())x=O(v,x.value,g),x!==null&&(m=a(x,m,A),k===null?w=x:k.sibling=x,k=x);return Ht&&qo(v,A),w}for(P=n(v,P);!x.done;A++,x=d.next())x=b(P,v,A,x.value,g),x!==null&&(e&&x.alternate!==null&&P.delete(x.key===null?A:x.key),m=a(x,m,A),k===null?w=x:k.sibling=x,k=x);return e&&P.forEach(function(R){return t(v,R)}),Ht&&qo(v,A),w}function p(v,m,d,g){if(typeof d=="object"&&d!==null&&d.type===Jl&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case qf:e:{for(var w=d.key,k=m;k!==null;){if(k.key===w){if(w=d.type,w===Jl){if(k.tag===7){r(v,k.sibling),m=i(k,d.props.children),m.return=v,v=m;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Wa&&G3(w)===k.type){r(v,k.sibling),m=i(k,d.props),m.ref=Tu(v,k,d),m.return=v,v=m;break e}r(v,k);break}else t(v,k);k=k.sibling}d.type===Jl?(m=Jo(d.props.children,v.mode,g,d.key),m.return=v,v=m):(g=Md(d.type,d.key,d.props,null,v.mode,g),g.ref=Tu(v,m,d),g.return=v,v=g)}return o(v);case Ql:e:{for(k=d.key;m!==null;){if(m.key===k)if(m.tag===4&&m.stateNode.containerInfo===d.containerInfo&&m.stateNode.implementation===d.implementation){r(v,m.sibling),m=i(m,d.children||[]),m.return=v,v=m;break e}else{r(v,m);break}else t(v,m);m=m.sibling}m=D1(d,v.mode,g),m.return=v,v=m}return o(v);case Wa:return k=d._init,p(v,m,k(d._payload),g)}if(ju(d))return _(v,m,d,g);if(Ou(d))return y(v,m,d,g);nd(v,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,m!==null&&m.tag===6?(r(v,m.sibling),m=i(m,d),m.return=v,v=m):(r(v,m),m=I1(d,v.mode,g),m.return=v,v=m),o(v)):r(v,m)}return p}var Es=q6(!0),W6=q6(!1),Zd=bo(null),Qd=null,ls=null,Hm=null;function $m(){Hm=ls=Qd=null}function Gm(e){var t=Zd.current;zt(Zd),e._currentValue=t}function Rv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ms(e,t){Qd=e,Hm=ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(un=!0),e.firstContext=null)}function Yn(e){var t=e._currentValue;if(Hm!==e)if(e={context:e,memoizedValue:t,next:null},ls===null){if(Qd===null)throw Error(xe(308));ls=e,Qd.dependencies={lanes:0,firstContext:e}}else ls=ls.next=e;return t}var Yo=null;function Vm(e){Yo===null?Yo=[e]:Yo.push(e)}function K6(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Vm(t)):(r.next=i.next,i.next=r),t.interleaved=r,_a(e,n)}function _a(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ka=!1;function qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Y6(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ha(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ao(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,mt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,_a(e,r)}return i=n.interleaved,i===null?(t.next=t,Vm(n)):(t.next=i.next,i.next=t),n.interleaved=t,_a(e,r)}function Pd(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}function V3(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Jd(e,t,r,n){var i=e.updateQueue;Ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,f=u.next;u.next=null,o===null?a=f:o.next=f,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=f:l.next=f,h.lastBaseUpdate=u))}if(a!==null){var O=i.baseState;o=0,h=f=u=null,l=a;do{var S=l.lane,b=l.eventTime;if((n&S)===S){h!==null&&(h=h.next={eventTime:b,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var _=e,y=l;switch(S=t,b=r,y.tag){case 1:if(_=y.payload,typeof _=="function"){O=_.call(b,O,S);break e}O=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=y.payload,S=typeof _=="function"?_.call(b,O,S):_,S==null)break e;O=Kt({},O,S);break e;case 2:Ka=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,S=i.effects,S===null?i.effects=[l]:S.push(l))}else b={eventTime:b,lane:S,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(f=h=b,u=O):h=h.next=b,o|=S;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;S=l,l=S.next,S.next=null,i.lastBaseUpdate=S,i.shared.pending=null}}while(!0);if(h===null&&(u=O),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);al|=o,e.lanes=o,e.memoizedState=O}}function q3(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(xe(191,i));i.call(n)}}}var Lc={},Ui=bo(Lc),dc=bo(Lc),hc=bo(Lc);function Xo(e){if(e===Lc)throw Error(xe(174));return e}function Wm(e,t){switch(Lt(hc,t),Lt(dc,e),Lt(Ui,Lc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fv(t,e)}zt(Ui),Lt(Ui,t)}function Os(){zt(Ui),zt(dc),zt(hc)}function X6(e){Xo(hc.current);var t=Xo(Ui.current),r=fv(t,e.type);t!==r&&(Lt(dc,e),Lt(Ui,r))}function Km(e){dc.current===e&&(zt(Ui),zt(dc))}var qt=bo(0);function eh(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var T1=[];function Ym(){for(var e=0;e<T1.length;e++)T1[e]._workInProgressVersionPrimary=null;T1.length=0}var Cd=Oa.ReactCurrentDispatcher,A1=Oa.ReactCurrentBatchConfig,il=0,Wt=null,cr=null,wr=null,th=!1,Wu=!1,pc=0,dx=0;function zr(){throw Error(xe(321))}function Xm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!mi(e[r],t[r]))return!1;return!0}function Zm(e,t,r,n,i,a){if(il=a,Wt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cd.current=e===null||e.memoizedState===null?vx:mx,e=r(n,i),Wu){a=0;do{if(Wu=!1,pc=0,25<=a)throw Error(xe(301));a+=1,wr=cr=null,t.updateQueue=null,Cd.current=yx,e=r(n,i)}while(Wu)}if(Cd.current=rh,t=cr!==null&&cr.next!==null,il=0,wr=cr=Wt=null,th=!1,t)throw Error(xe(300));return e}function Qm(){var e=pc!==0;return pc=0,e}function Ii(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wr===null?Wt.memoizedState=wr=e:wr=wr.next=e,wr}function Xn(){if(cr===null){var e=Wt.alternate;e=e!==null?e.memoizedState:null}else e=cr.next;var t=wr===null?Wt.memoizedState:wr.next;if(t!==null)wr=t,cr=e;else{if(e===null)throw Error(xe(310));cr=e,e={memoizedState:cr.memoizedState,baseState:cr.baseState,baseQueue:cr.baseQueue,queue:cr.queue,next:null},wr===null?Wt.memoizedState=wr=e:wr=wr.next=e}return wr}function gc(e,t){return typeof t=="function"?t(e):t}function R1(e){var t=Xn(),r=t.queue;if(r===null)throw Error(xe(311));r.lastRenderedReducer=e;var n=cr,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=o=null,u=null,f=a;do{var h=f.lane;if((il&h)===h)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var O={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=O,o=n):u=u.next=O,Wt.lanes|=h,al|=h}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,mi(n,t.memoizedState)||(un=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,Wt.lanes|=a,al|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function M1(e){var t=Xn(),r=t.queue;if(r===null)throw Error(xe(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);mi(a,t.memoizedState)||(un=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function Z6(){}function Q6(e,t){var r=Wt,n=Xn(),i=t(),a=!mi(n.memoizedState,i);if(a&&(n.memoizedState=i,un=!0),n=n.queue,Jm(tw.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||wr!==null&&wr.memoizedState.tag&1){if(r.flags|=2048,vc(9,ew.bind(null,r,n,i,t),void 0,null),Sr===null)throw Error(xe(349));il&30||J6(r,t,i)}return i}function J6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Wt.updateQueue,t===null?(t={lastEffect:null,stores:null},Wt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function ew(e,t,r,n){t.value=r,t.getSnapshot=n,rw(t)&&nw(e)}function tw(e,t,r){return r(function(){rw(t)&&nw(e)})}function rw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!mi(e,r)}catch{return!0}}function nw(e){var t=_a(e,1);t!==null&&di(t,e,1,-1)}function W3(e){var t=Ii();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gc,lastRenderedState:e},t.queue=e,e=e.dispatch=gx.bind(null,Wt,e),[t.memoizedState,e]}function vc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Wt.updateQueue,t===null?(t={lastEffect:null,stores:null},Wt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function iw(){return Xn().memoizedState}function kd(e,t,r,n){var i=Ii();Wt.flags|=e,i.memoizedState=vc(1|t,r,void 0,n===void 0?null:n)}function Lh(e,t,r,n){var i=Xn();n=n===void 0?null:n;var a=void 0;if(cr!==null){var o=cr.memoizedState;if(a=o.destroy,n!==null&&Xm(n,o.deps)){i.memoizedState=vc(t,r,a,n);return}}Wt.flags|=e,i.memoizedState=vc(1|t,r,a,n)}function K3(e,t){return kd(8390656,8,e,t)}function Jm(e,t){return Lh(2048,8,e,t)}function aw(e,t){return Lh(4,2,e,t)}function ow(e,t){return Lh(4,4,e,t)}function lw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sw(e,t,r){return r=r!=null?r.concat([e]):null,Lh(4,4,lw.bind(null,t,e),r)}function ey(){}function uw(e,t){var r=Xn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function cw(e,t){var r=Xn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function fw(e,t,r){return il&21?(mi(r,t)||(r=v6(),Wt.lanes|=r,al|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,un=!0),e.memoizedState=r)}function hx(e,t){var r=xt;xt=r!==0&&4>r?r:4,e(!0);var n=A1.transition;A1.transition={};try{e(!1),t()}finally{xt=r,A1.transition=n}}function dw(){return Xn().memoizedState}function px(e,t,r){var n=lo(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},hw(e))pw(t,r);else if(r=K6(e,t,r,n),r!==null){var i=Wr();di(r,e,n,i),gw(r,t,n)}}function gx(e,t,r){var n=lo(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(hw(e))pw(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(i.hasEagerState=!0,i.eagerState=l,mi(l,o)){var u=t.interleaved;u===null?(i.next=i,Vm(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=K6(e,t,i,n),r!==null&&(i=Wr(),di(r,e,n,i),gw(r,t,n))}}function hw(e){var t=e.alternate;return e===Wt||t!==null&&t===Wt}function pw(e,t){Wu=th=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function gw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}var rh={readContext:Yn,useCallback:zr,useContext:zr,useEffect:zr,useImperativeHandle:zr,useInsertionEffect:zr,useLayoutEffect:zr,useMemo:zr,useReducer:zr,useRef:zr,useState:zr,useDebugValue:zr,useDeferredValue:zr,useTransition:zr,useMutableSource:zr,useSyncExternalStore:zr,useId:zr,unstable_isNewReconciler:!1},vx={readContext:Yn,useCallback:function(e,t){return Ii().memoizedState=[e,t===void 0?null:t],e},useContext:Yn,useEffect:K3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,kd(4194308,4,lw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return kd(4194308,4,e,t)},useInsertionEffect:function(e,t){return kd(4,2,e,t)},useMemo:function(e,t){var r=Ii();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ii();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=px.bind(null,Wt,e),[n.memoizedState,e]},useRef:function(e){var t=Ii();return e={current:e},t.memoizedState=e},useState:W3,useDebugValue:ey,useDeferredValue:function(e){return Ii().memoizedState=e},useTransition:function(){var e=W3(!1),t=e[0];return e=hx.bind(null,e[1]),Ii().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Wt,i=Ii();if(Ht){if(r===void 0)throw Error(xe(407));r=r()}else{if(r=t(),Sr===null)throw Error(xe(349));il&30||J6(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,K3(tw.bind(null,n,a,e),[e]),n.flags|=2048,vc(9,ew.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ii(),t=Sr.identifierPrefix;if(Ht){var r=da,n=fa;r=(n&~(1<<32-fi(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=pc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=dx++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mx={readContext:Yn,useCallback:uw,useContext:Yn,useEffect:Jm,useImperativeHandle:sw,useInsertionEffect:aw,useLayoutEffect:ow,useMemo:cw,useReducer:R1,useRef:iw,useState:function(){return R1(gc)},useDebugValue:ey,useDeferredValue:function(e){var t=Xn();return fw(t,cr.memoizedState,e)},useTransition:function(){var e=R1(gc)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:Z6,useSyncExternalStore:Q6,useId:dw,unstable_isNewReconciler:!1},yx={readContext:Yn,useCallback:uw,useContext:Yn,useEffect:Jm,useImperativeHandle:sw,useInsertionEffect:aw,useLayoutEffect:ow,useMemo:cw,useReducer:M1,useRef:iw,useState:function(){return M1(gc)},useDebugValue:ey,useDeferredValue:function(e){var t=Xn();return cr===null?t.memoizedState=e:fw(t,cr.memoizedState,e)},useTransition:function(){var e=M1(gc)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:Z6,useSyncExternalStore:Q6,useId:dw,unstable_isNewReconciler:!1};function si(e,t){if(e&&e.defaultProps){t=Kt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Mv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Kt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Nh={isMounted:function(e){return(e=e._reactInternals)?pl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Wr(),i=lo(e),a=ha(n,i);a.payload=t,r!=null&&(a.callback=r),t=ao(e,a,i),t!==null&&(di(t,e,i,n),Pd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Wr(),i=lo(e),a=ha(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=ao(e,a,i),t!==null&&(di(t,e,i,n),Pd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Wr(),n=lo(e),i=ha(r,n);i.tag=2,t!=null&&(i.callback=t),t=ao(e,i,n),t!==null&&(di(t,e,n,r),Pd(t,e,n))}};function Y3(e,t,r,n,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!sc(r,n)||!sc(i,a):!0}function vw(e,t,r){var n=!1,i=ho,a=t.contextType;return typeof a=="object"&&a!==null?a=Yn(a):(i=hn(t)?rl:Hr.current,n=t.contextTypes,a=(n=n!=null)?ws(e,i):ho),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Nh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function X3(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Nh.enqueueReplaceState(t,t.state,null)}function Lv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},qm(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Yn(a):(a=hn(t)?rl:Hr.current,i.context=ws(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Mv(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Nh.enqueueReplaceState(i,i.state,null),Jd(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function xs(e,t){try{var r="",n=t;do r+=qE(n),n=n.return;while(n);var i=r}catch(a){i=`
|
|
31
|
+
Error generating stack: `+a.message+`
|
|
32
|
+
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function L1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Nv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var bx=typeof WeakMap=="function"?WeakMap:Map;function mw(e,t,r){r=ha(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ih||(ih=!0,Gv=n),Nv(e,t)},r}function yw(e,t,r){r=ha(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Nv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Nv(e,t),typeof n!="function"&&(oo===null?oo=new Set([this]):oo.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Z3(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new bx;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Lx.bind(null,e,t,r),t.then(e,e))}function Q3(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function J3(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=ha(-1,1),t.tag=2,ao(r,t,1))),r.lanes|=1),e)}var _x=Oa.ReactCurrentOwner,un=!1;function qr(e,t,r,n){t.child=e===null?W6(t,null,r,n):Es(t,e.child,r,n)}function e5(e,t,r,n,i){r=r.render;var a=t.ref;return ms(t,i),n=Zm(e,t,r,n,a,i),r=Qm(),e!==null&&!un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wa(e,t,i)):(Ht&&r&&zm(t),t.flags|=1,qr(e,t,n,i),t.child)}function t5(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!sy(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,bw(e,t,a,n,i)):(e=Md(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:sc,r(o,n)&&e.ref===t.ref)return wa(e,t,i)}return t.flags|=1,e=so(a,n),e.ref=t.ref,e.return=t,t.child=e}function bw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(sc(a,n)&&e.ref===t.ref)if(un=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(un=!0);else return t.lanes=e.lanes,wa(e,t,i)}return Iv(e,t,r,n,i)}function _w(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(us,Sn),Sn|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Lt(us,Sn),Sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Lt(us,Sn),Sn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Lt(us,Sn),Sn|=n;return qr(e,t,i,r),t.child}function ww(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Iv(e,t,r,n,i){var a=hn(r)?rl:Hr.current;return a=ws(t,a),ms(t,i),r=Zm(e,t,r,n,a,i),n=Qm(),e!==null&&!un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wa(e,t,i)):(Ht&&n&&zm(t),t.flags|=1,qr(e,t,r,i),t.child)}function r5(e,t,r,n,i){if(hn(r)){var a=!0;Kd(t)}else a=!1;if(ms(t,i),t.stateNode===null)Td(e,t),vw(t,r,n),Lv(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,f=r.contextType;typeof f=="object"&&f!==null?f=Yn(f):(f=hn(r)?rl:Hr.current,f=ws(t,f));var h=r.getDerivedStateFromProps,O=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";O||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&X3(t,o,n,f),Ka=!1;var S=t.memoizedState;o.state=S,Jd(t,n,o,i),u=t.memoizedState,l!==n||S!==u||dn.current||Ka?(typeof h=="function"&&(Mv(t,r,h,n),u=t.memoizedState),(l=Ka||Y3(t,r,l,n,S,u,f))?(O||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=f,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,Y6(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:si(t.type,l),o.props=f,O=t.pendingProps,S=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Yn(u):(u=hn(r)?rl:Hr.current,u=ws(t,u));var b=r.getDerivedStateFromProps;(h=typeof b=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==O||S!==u)&&X3(t,o,n,u),Ka=!1,S=t.memoizedState,o.state=S,Jd(t,n,o,i);var _=t.memoizedState;l!==O||S!==_||dn.current||Ka?(typeof b=="function"&&(Mv(t,r,b,n),_=t.memoizedState),(f=Ka||Y3(t,r,f,n,S,_,u)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,_,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,_,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=_),o.props=n,o.state=_,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&S===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&S===e.memoizedState||(t.flags|=1024),n=!1)}return Dv(e,t,r,n,a,i)}function Dv(e,t,r,n,i,a){ww(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&U3(t,r,!1),wa(e,t,a);n=t.stateNode,_x.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Es(t,e.child,null,a),t.child=Es(t,null,l,a)):qr(e,t,l,a),t.memoizedState=n.state,i&&U3(t,r,!0),t.child}function Sw(e){var t=e.stateNode;t.pendingContext?B3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&B3(e,t.context,!1),Wm(e,t.containerInfo)}function n5(e,t,r,n,i){return Ss(),Um(i),t.flags|=256,qr(e,t,r,n),t.child}var jv={dehydrated:null,treeContext:null,retryLane:0};function Fv(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ew(e,t,r){var n=t.pendingProps,i=qt.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Lt(qt,i&1),e===null)return Av(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=jh(o,n,0,null),e=Jo(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Fv(r),t.memoizedState=jv,e):ty(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return wx(e,t,o,n,l,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=u,t.deletions=null):(n=so(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=so(l,a):(a=Jo(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Fv(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=jv,n}return a=e.child,e=a.sibling,n=so(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function ty(e,t){return t=jh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function id(e,t,r,n){return n!==null&&Um(n),Es(t,e.child,null,r),e=ty(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wx(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=L1(Error(xe(422))),id(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=jh({mode:"visible",children:n.children},i,0,null),a=Jo(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Es(t,e.child,null,o),t.child.memoizedState=Fv(o),t.memoizedState=jv,a);if(!(t.mode&1))return id(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(xe(419)),n=L1(a,n,void 0),id(e,t,o,n)}if(l=(o&e.childLanes)!==0,un||l){if(n=Sr,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,_a(e,i),di(n,e,i,-1))}return ly(),n=L1(Error(xe(421))),id(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Nx.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,On=io(i.nextSibling),xn=t,Ht=!0,ci=null,e!==null&&(Hn[$n++]=fa,Hn[$n++]=da,Hn[$n++]=nl,fa=e.id,da=e.overflow,nl=t),t=ty(t,n.children),t.flags|=4096,t)}function i5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rv(e.return,t,r)}function N1(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function Ow(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(qr(e,t,n.children,r),n=qt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&i5(e,r,t);else if(e.tag===19)i5(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Lt(qt,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&eh(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),N1(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&eh(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}N1(t,!0,r,null,a);break;case"together":N1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Td(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wa(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),al|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(xe(153));if(t.child!==null){for(e=t.child,r=so(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=so(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Sx(e,t,r){switch(t.tag){case 3:Sw(t),Ss();break;case 5:X6(t);break;case 1:hn(t.type)&&Kd(t);break;case 4:Wm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Lt(Zd,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Lt(qt,qt.current&1),t.flags|=128,null):r&t.child.childLanes?Ew(e,t,r):(Lt(qt,qt.current&1),e=wa(e,t,r),e!==null?e.sibling:null);Lt(qt,qt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Ow(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lt(qt,qt.current),n)break;return null;case 22:case 23:return t.lanes=0,_w(e,t,r)}return wa(e,t,r)}var xw,zv,Pw,Cw;xw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};zv=function(){};Pw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Xo(Ui.current);var a=null;switch(r){case"input":i=lv(e,i),n=lv(e,n),a=[];break;case"select":i=Kt({},i,{value:void 0}),n=Kt({},n,{value:void 0}),a=[];break;case"textarea":i=cv(e,i),n=cv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=qd)}dv(r,n);var o;r=null;for(f in i)if(!n.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var l=i[f];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(tc.hasOwnProperty(f)?a||(a=[]):(a=a||[]).push(f,null));for(f in n){var u=n[f];if(l=i!=null?i[f]:void 0,n.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(r||(r={}),r[o]=u[o])}else r||(a||(a=[]),a.push(f,r)),r=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(a=a||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(tc.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&Ft("scroll",e),a||l===u||(a=[])):(a=a||[]).push(f,u))}r&&(a=a||[]).push("style",r);var f=a;(t.updateQueue=f)&&(t.flags|=4)}};Cw=function(e,t,r,n){r!==n&&(t.flags|=4)};function Au(e,t){if(!Ht)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Br(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Ex(e,t,r){var n=t.pendingProps;switch(Bm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Br(t),null;case 1:return hn(t.type)&&Wd(),Br(t),null;case 3:return n=t.stateNode,Os(),zt(dn),zt(Hr),Ym(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(rd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ci!==null&&(Wv(ci),ci=null))),zv(e,t),Br(t),null;case 5:Km(t);var i=Xo(hc.current);if(r=t.type,e!==null&&t.stateNode!=null)Pw(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(xe(166));return Br(t),null}if(e=Xo(Ui.current),rd(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Di]=t,n[fc]=a,e=(t.mode&1)!==0,r){case"dialog":Ft("cancel",n),Ft("close",n);break;case"iframe":case"object":case"embed":Ft("load",n);break;case"video":case"audio":for(i=0;i<zu.length;i++)Ft(zu[i],n);break;case"source":Ft("error",n);break;case"img":case"image":case"link":Ft("error",n),Ft("load",n);break;case"details":Ft("toggle",n);break;case"input":h3(n,a),Ft("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Ft("invalid",n);break;case"textarea":g3(n,a),Ft("invalid",n)}dv(r,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&td(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&td(n.textContent,l,e),i=["children",""+l]):tc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ft("scroll",n)}switch(r){case"input":Wf(n),p3(n,a,!0);break;case"textarea":Wf(n),v3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=qd)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=t6(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Di]=t,e[fc]=n,xw(e,t,!1,!1),t.stateNode=e;e:{switch(o=hv(r,n),r){case"dialog":Ft("cancel",e),Ft("close",e),i=n;break;case"iframe":case"object":case"embed":Ft("load",e),i=n;break;case"video":case"audio":for(i=0;i<zu.length;i++)Ft(zu[i],e);i=n;break;case"source":Ft("error",e),i=n;break;case"img":case"image":case"link":Ft("error",e),Ft("load",e),i=n;break;case"details":Ft("toggle",e),i=n;break;case"input":h3(e,n),i=lv(e,n),Ft("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=Kt({},n,{value:void 0}),Ft("invalid",e);break;case"textarea":g3(e,n),i=cv(e,n),Ft("invalid",e);break;default:i=n}dv(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?i6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&r6(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&rc(e,u):typeof u=="number"&&rc(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(tc.hasOwnProperty(a)?u!=null&&a==="onScroll"&&Ft("scroll",e):u!=null&&xm(e,a,u,o))}switch(r){case"input":Wf(e),p3(e,n,!1);break;case"textarea":Wf(e),v3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+fo(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?hs(e,!!n.multiple,a,!1):n.defaultValue!=null&&hs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=qd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Br(t),null;case 6:if(e&&t.stateNode!=null)Cw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(xe(166));if(r=Xo(hc.current),Xo(Ui.current),rd(t)){if(n=t.stateNode,r=t.memoizedProps,n[Di]=t,(a=n.nodeValue!==r)&&(e=xn,e!==null))switch(e.tag){case 3:td(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&td(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Di]=t,t.stateNode=n}return Br(t),null;case 13:if(zt(qt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ht&&On!==null&&t.mode&1&&!(t.flags&128))V6(),Ss(),t.flags|=98560,a=!1;else if(a=rd(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(xe(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(xe(317));a[Di]=t}else Ss(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Br(t),a=!1}else ci!==null&&(Wv(ci),ci=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||qt.current&1?dr===0&&(dr=3):ly())),t.updateQueue!==null&&(t.flags|=4),Br(t),null);case 4:return Os(),zv(e,t),e===null&&uc(t.stateNode.containerInfo),Br(t),null;case 10:return Gm(t.type._context),Br(t),null;case 17:return hn(t.type)&&Wd(),Br(t),null;case 19:if(zt(qt),a=t.memoizedState,a===null)return Br(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)Au(a,!1);else{if(dr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=eh(e),o!==null){for(t.flags|=128,Au(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Lt(qt,qt.current&1|2),t.child}e=e.sibling}a.tail!==null&&tr()>Ps&&(t.flags|=128,n=!0,Au(a,!1),t.lanes=4194304)}else{if(!n)if(e=eh(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Au(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Ht)return Br(t),null}else 2*tr()-a.renderingStartTime>Ps&&r!==1073741824&&(t.flags|=128,n=!0,Au(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=tr(),t.sibling=null,r=qt.current,Lt(qt,n?r&1|2:r&1),t):(Br(t),null);case 22:case 23:return oy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Sn&1073741824&&(Br(t),t.subtreeFlags&6&&(t.flags|=8192)):Br(t),null;case 24:return null;case 25:return null}throw Error(xe(156,t.tag))}function Ox(e,t){switch(Bm(t),t.tag){case 1:return hn(t.type)&&Wd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Os(),zt(dn),zt(Hr),Ym(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Km(t),null;case 13:if(zt(qt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(xe(340));Ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zt(qt),null;case 4:return Os(),null;case 10:return Gm(t.type._context),null;case 22:case 23:return oy(),null;case 24:return null;default:return null}}var ad=!1,Ur=!1,xx=typeof WeakSet=="function"?WeakSet:Set,He=null;function ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Zt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){Zt(e,t,n)}}var a5=!1;function Px(e,t){if(Ev=$d,e=M6(),Fm(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,u=-1,f=0,h=0,O=e,S=null;t:for(;;){for(var b;O!==r||i!==0&&O.nodeType!==3||(l=o+i),O!==a||n!==0&&O.nodeType!==3||(u=o+n),O.nodeType===3&&(o+=O.nodeValue.length),(b=O.firstChild)!==null;)S=O,O=b;for(;;){if(O===e)break t;if(S===r&&++f===i&&(l=o),S===a&&++h===n&&(u=o),(b=O.nextSibling)!==null)break;O=S,S=O.parentNode}O=b}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ov={focusedElem:e,selectionRange:r},$d=!1,He=t;He!==null;)if(t=He,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,He=e;else for(;He!==null;){t=He;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var y=_.memoizedProps,p=_.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:si(t.type,y),p);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(xe(163))}}catch(g){Zt(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,He=e;break}He=t.return}return _=a5,a5=!1,_}function Ku(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Bv(t,r,a)}i=i.next}while(i!==n)}}function Ih(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Uv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function kw(e){var t=e.alternate;t!==null&&(e.alternate=null,kw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[fc],delete t[Cv],delete t[sx],delete t[ux])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Tw(e){return e.tag===5||e.tag===3||e.tag===4}function o5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=qd));else if(n!==4&&(e=e.child,e!==null))for(Hv(e,t,r),e=e.sibling;e!==null;)Hv(e,t,r),e=e.sibling}function $v(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for($v(e,t,r),e=e.sibling;e!==null;)$v(e,t,r),e=e.sibling}var Cr=null,ui=!1;function Ga(e,t,r){for(r=r.child;r!==null;)Aw(e,t,r),r=r.sibling}function Aw(e,t,r){if(Bi&&typeof Bi.onCommitFiberUnmount=="function")try{Bi.onCommitFiberUnmount(Ch,r)}catch{}switch(r.tag){case 5:Ur||ss(r,t);case 6:var n=Cr,i=ui;Cr=null,Ga(e,t,r),Cr=n,ui=i,Cr!==null&&(ui?(e=Cr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Cr.removeChild(r.stateNode));break;case 18:Cr!==null&&(ui?(e=Cr,r=r.stateNode,e.nodeType===8?C1(e.parentNode,r):e.nodeType===1&&C1(e,r),oc(e)):C1(Cr,r.stateNode));break;case 4:n=Cr,i=ui,Cr=r.stateNode.containerInfo,ui=!0,Ga(e,t,r),Cr=n,ui=i;break;case 0:case 11:case 14:case 15:if(!Ur&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Bv(r,t,o),i=i.next}while(i!==n)}Ga(e,t,r);break;case 1:if(!Ur&&(ss(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Zt(r,t,l)}Ga(e,t,r);break;case 21:Ga(e,t,r);break;case 22:r.mode&1?(Ur=(n=Ur)||r.memoizedState!==null,Ga(e,t,r),Ur=n):Ga(e,t,r);break;default:Ga(e,t,r)}}function l5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new xx),t.forEach(function(n){var i=Ix.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ai(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Cr=l.stateNode,ui=!1;break e;case 3:Cr=l.stateNode.containerInfo,ui=!0;break e;case 4:Cr=l.stateNode.containerInfo,ui=!0;break e}l=l.return}if(Cr===null)throw Error(xe(160));Aw(a,o,i),Cr=null,ui=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Zt(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Rw(t,e),t=t.sibling}function Rw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ai(t,e),Li(e),n&4){try{Ku(3,e,e.return),Ih(3,e)}catch(y){Zt(e,e.return,y)}try{Ku(5,e,e.return)}catch(y){Zt(e,e.return,y)}}break;case 1:ai(t,e),Li(e),n&512&&r!==null&&ss(r,r.return);break;case 5:if(ai(t,e),Li(e),n&512&&r!==null&&ss(r,r.return),e.flags&32){var i=e.stateNode;try{rc(i,"")}catch(y){Zt(e,e.return,y)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&J_(i,a),hv(l,o);var f=hv(l,a);for(o=0;o<u.length;o+=2){var h=u[o],O=u[o+1];h==="style"?i6(i,O):h==="dangerouslySetInnerHTML"?r6(i,O):h==="children"?rc(i,O):xm(i,h,O,f)}switch(l){case"input":sv(i,a);break;case"textarea":e6(i,a);break;case"select":var S=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var b=a.value;b!=null?hs(i,!!a.multiple,b,!1):S!==!!a.multiple&&(a.defaultValue!=null?hs(i,!!a.multiple,a.defaultValue,!0):hs(i,!!a.multiple,a.multiple?[]:"",!1))}i[fc]=a}catch(y){Zt(e,e.return,y)}}break;case 6:if(ai(t,e),Li(e),n&4){if(e.stateNode===null)throw Error(xe(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){Zt(e,e.return,y)}}break;case 3:if(ai(t,e),Li(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{oc(t.containerInfo)}catch(y){Zt(e,e.return,y)}break;case 4:ai(t,e),Li(e);break;case 13:ai(t,e),Li(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(iy=tr())),n&4&&l5(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(Ur=(f=Ur)||h,ai(t,e),Ur=f):ai(t,e),Li(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!h&&e.mode&1)for(He=e,h=e.child;h!==null;){for(O=He=h;He!==null;){switch(S=He,b=S.child,S.tag){case 0:case 11:case 14:case 15:Ku(4,S,S.return);break;case 1:ss(S,S.return);var _=S.stateNode;if(typeof _.componentWillUnmount=="function"){n=S,r=S.return;try{t=n,_.props=t.memoizedProps,_.state=t.memoizedState,_.componentWillUnmount()}catch(y){Zt(n,r,y)}}break;case 5:ss(S,S.return);break;case 22:if(S.memoizedState!==null){u5(O);continue}}b!==null?(b.return=S,He=b):u5(O)}h=h.sibling}e:for(h=null,O=e;;){if(O.tag===5){if(h===null){h=O;try{i=O.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=O.stateNode,u=O.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=n6("display",o))}catch(y){Zt(e,e.return,y)}}}else if(O.tag===6){if(h===null)try{O.stateNode.nodeValue=f?"":O.memoizedProps}catch(y){Zt(e,e.return,y)}}else if((O.tag!==22&&O.tag!==23||O.memoizedState===null||O===e)&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===e)break e;for(;O.sibling===null;){if(O.return===null||O.return===e)break e;h===O&&(h=null),O=O.return}h===O&&(h=null),O.sibling.return=O.return,O=O.sibling}}break;case 19:ai(t,e),Li(e),n&4&&l5(e);break;case 21:break;default:ai(t,e),Li(e)}}function Li(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Tw(r)){var n=r;break e}r=r.return}throw Error(xe(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(rc(i,""),n.flags&=-33);var a=o5(e);$v(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=o5(e);Hv(e,l,o);break;default:throw Error(xe(161))}}catch(u){Zt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cx(e,t,r){He=e,Mw(e)}function Mw(e,t,r){for(var n=(e.mode&1)!==0;He!==null;){var i=He,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||ad;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Ur;l=ad;var f=Ur;if(ad=o,(Ur=u)&&!f)for(He=i;He!==null;)o=He,u=o.child,o.tag===22&&o.memoizedState!==null?c5(i):u!==null?(u.return=o,He=u):c5(i);for(;a!==null;)He=a,Mw(a),a=a.sibling;He=i,ad=l,Ur=f}s5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,He=a):s5(e)}}function s5(e){for(;He!==null;){var t=He;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ur||Ih(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Ur)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:si(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&q3(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}q3(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var h=f.memoizedState;if(h!==null){var O=h.dehydrated;O!==null&&oc(O)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(xe(163))}Ur||t.flags&512&&Uv(t)}catch(S){Zt(t,t.return,S)}}if(t===e){He=null;break}if(r=t.sibling,r!==null){r.return=t.return,He=r;break}He=t.return}}function u5(e){for(;He!==null;){var t=He;if(t===e){He=null;break}var r=t.sibling;if(r!==null){r.return=t.return,He=r;break}He=t.return}}function c5(e){for(;He!==null;){var t=He;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ih(4,t)}catch(u){Zt(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){Zt(t,i,u)}}var a=t.return;try{Uv(t)}catch(u){Zt(t,a,u)}break;case 5:var o=t.return;try{Uv(t)}catch(u){Zt(t,o,u)}}}catch(u){Zt(t,t.return,u)}if(t===e){He=null;break}var l=t.sibling;if(l!==null){l.return=t.return,He=l;break}He=t.return}}var kx=Math.ceil,nh=Oa.ReactCurrentDispatcher,ry=Oa.ReactCurrentOwner,Wn=Oa.ReactCurrentBatchConfig,mt=0,Sr=null,ir=null,Tr=0,Sn=0,us=bo(0),dr=0,mc=null,al=0,Dh=0,ny=0,Yu=null,sn=null,iy=0,Ps=1/0,sa=null,ih=!1,Gv=null,oo=null,od=!1,Ja=null,ah=0,Xu=0,Vv=null,Ad=-1,Rd=0;function Wr(){return mt&6?tr():Ad!==-1?Ad:Ad=tr()}function lo(e){return e.mode&1?mt&2&&Tr!==0?Tr&-Tr:fx.transition!==null?(Rd===0&&(Rd=v6()),Rd):(e=xt,e!==0||(e=window.event,e=e===void 0?16:E6(e.type)),e):1}function di(e,t,r,n){if(50<Xu)throw Xu=0,Vv=null,Error(xe(185));Ac(e,r,n),(!(mt&2)||e!==Sr)&&(e===Sr&&(!(mt&2)&&(Dh|=r),dr===4&&Xa(e,Tr)),pn(e,n),r===1&&mt===0&&!(t.mode&1)&&(Ps=tr()+500,Mh&&_o()))}function pn(e,t){var r=e.callbackNode;fO(e,t);var n=Hd(e,e===Sr?Tr:0);if(n===0)r!==null&&b3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&b3(r),t===1)e.tag===0?cx(f5.bind(null,e)):H6(f5.bind(null,e)),ox(function(){!(mt&6)&&_o()}),r=null;else{switch(m6(n)){case 1:r=Am;break;case 4:r=p6;break;case 16:r=Ud;break;case 536870912:r=g6;break;default:r=Ud}r=Bw(r,Lw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Lw(e,t){if(Ad=-1,Rd=0,mt&6)throw Error(xe(327));var r=e.callbackNode;if(ys()&&e.callbackNode!==r)return null;var n=Hd(e,e===Sr?Tr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=oh(e,n);else{t=n;var i=mt;mt|=2;var a=Iw();(Sr!==e||Tr!==t)&&(sa=null,Ps=tr()+500,Qo(e,t));do try{Rx();break}catch(l){Nw(e,l)}while(!0);$m(),nh.current=a,mt=i,ir!==null?t=0:(Sr=null,Tr=0,t=dr)}if(t!==0){if(t===2&&(i=yv(e),i!==0&&(n=i,t=qv(e,i))),t===1)throw r=mc,Qo(e,0),Xa(e,n),pn(e,tr()),r;if(t===6)Xa(e,n);else{if(i=e.current.alternate,!(n&30)&&!Tx(i)&&(t=oh(e,n),t===2&&(a=yv(e),a!==0&&(n=a,t=qv(e,a))),t===1))throw r=mc,Qo(e,0),Xa(e,n),pn(e,tr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(xe(345));case 2:Wo(e,sn,sa);break;case 3:if(Xa(e,n),(n&130023424)===n&&(t=iy+500-tr(),10<t)){if(Hd(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Wr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Pv(Wo.bind(null,e,sn,sa),t);break}Wo(e,sn,sa);break;case 4:if(Xa(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-fi(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=tr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*kx(n/1960))-n,10<n){e.timeoutHandle=Pv(Wo.bind(null,e,sn,sa),n);break}Wo(e,sn,sa);break;case 5:Wo(e,sn,sa);break;default:throw Error(xe(329))}}}return pn(e,tr()),e.callbackNode===r?Lw.bind(null,e):null}function qv(e,t){var r=Yu;return e.current.memoizedState.isDehydrated&&(Qo(e,t).flags|=256),e=oh(e,t),e!==2&&(t=sn,sn=r,t!==null&&Wv(t)),e}function Wv(e){sn===null?sn=e:sn.push.apply(sn,e)}function Tx(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!mi(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xa(e,t){for(t&=~ny,t&=~Dh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-fi(t),n=1<<r;e[r]=-1,t&=~n}}function f5(e){if(mt&6)throw Error(xe(327));ys();var t=Hd(e,0);if(!(t&1))return pn(e,tr()),null;var r=oh(e,t);if(e.tag!==0&&r===2){var n=yv(e);n!==0&&(t=n,r=qv(e,n))}if(r===1)throw r=mc,Qo(e,0),Xa(e,t),pn(e,tr()),r;if(r===6)throw Error(xe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wo(e,sn,sa),pn(e,tr()),null}function ay(e,t){var r=mt;mt|=1;try{return e(t)}finally{mt=r,mt===0&&(Ps=tr()+500,Mh&&_o())}}function ol(e){Ja!==null&&Ja.tag===0&&!(mt&6)&&ys();var t=mt;mt|=1;var r=Wn.transition,n=xt;try{if(Wn.transition=null,xt=1,e)return e()}finally{xt=n,Wn.transition=r,mt=t,!(mt&6)&&_o()}}function oy(){Sn=us.current,zt(us)}function Qo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,ax(r)),ir!==null)for(r=ir.return;r!==null;){var n=r;switch(Bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Wd();break;case 3:Os(),zt(dn),zt(Hr),Ym();break;case 5:Km(n);break;case 4:Os();break;case 13:zt(qt);break;case 19:zt(qt);break;case 10:Gm(n.type._context);break;case 22:case 23:oy()}r=r.return}if(Sr=e,ir=e=so(e.current,null),Tr=Sn=t,dr=0,mc=null,ny=Dh=al=0,sn=Yu=null,Yo!==null){for(t=0;t<Yo.length;t++)if(r=Yo[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=i,n.next=o}r.pending=n}Yo=null}return e}function Nw(e,t){do{var r=ir;try{if($m(),Cd.current=rh,th){for(var n=Wt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}th=!1}if(il=0,wr=cr=Wt=null,Wu=!1,pc=0,ry.current=null,r===null||r.return===null){dr=1,mc=t,ir=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Tr,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,h=l,O=h.tag;if(!(h.mode&1)&&(O===0||O===11||O===15)){var S=h.alternate;S?(h.updateQueue=S.updateQueue,h.memoizedState=S.memoizedState,h.lanes=S.lanes):(h.updateQueue=null,h.memoizedState=null)}var b=Q3(o);if(b!==null){b.flags&=-257,J3(b,o,l,a,t),b.mode&1&&Z3(a,f,t),t=b,u=f;var _=t.updateQueue;if(_===null){var y=new Set;y.add(u),t.updateQueue=y}else _.add(u);break e}else{if(!(t&1)){Z3(a,f,t),ly();break e}u=Error(xe(426))}}else if(Ht&&l.mode&1){var p=Q3(o);if(p!==null){!(p.flags&65536)&&(p.flags|=256),J3(p,o,l,a,t),Um(xs(u,l));break e}}a=u=xs(u,l),dr!==4&&(dr=2),Yu===null?Yu=[a]:Yu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=mw(a,u,t);V3(a,v);break e;case 1:l=u;var m=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof m.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(oo===null||!oo.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var g=yw(a,l,t);V3(a,g);break e}}a=a.return}while(a!==null)}jw(r)}catch(w){t=w,ir===r&&r!==null&&(ir=r=r.return);continue}break}while(!0)}function Iw(){var e=nh.current;return nh.current=rh,e===null?rh:e}function ly(){(dr===0||dr===3||dr===2)&&(dr=4),Sr===null||!(al&268435455)&&!(Dh&268435455)||Xa(Sr,Tr)}function oh(e,t){var r=mt;mt|=2;var n=Iw();(Sr!==e||Tr!==t)&&(sa=null,Qo(e,t));do try{Ax();break}catch(i){Nw(e,i)}while(!0);if($m(),mt=r,nh.current=n,ir!==null)throw Error(xe(261));return Sr=null,Tr=0,dr}function Ax(){for(;ir!==null;)Dw(ir)}function Rx(){for(;ir!==null&&!rO();)Dw(ir)}function Dw(e){var t=zw(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?jw(e):ir=t,ry.current=null}function jw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Ox(r,t),r!==null){r.flags&=32767,ir=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dr=6,ir=null;return}}else if(r=Ex(r,t,Sn),r!==null){ir=r;return}if(t=t.sibling,t!==null){ir=t;return}ir=t=e}while(t!==null);dr===0&&(dr=5)}function Wo(e,t,r){var n=xt,i=Wn.transition;try{Wn.transition=null,xt=1,Mx(e,t,r,n)}finally{Wn.transition=i,xt=n}return null}function Mx(e,t,r,n){do ys();while(Ja!==null);if(mt&6)throw Error(xe(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(xe(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(dO(e,a),e===Sr&&(ir=Sr=null,Tr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||od||(od=!0,Bw(Ud,function(){return ys(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Wn.transition,Wn.transition=null;var o=xt;xt=1;var l=mt;mt|=4,ry.current=null,Px(e,r),Rw(r,e),QO(Ov),$d=!!Ev,Ov=Ev=null,e.current=r,Cx(r),nO(),mt=l,xt=o,Wn.transition=a}else e.current=r;if(od&&(od=!1,Ja=e,ah=i),a=e.pendingLanes,a===0&&(oo=null),oO(r.stateNode),pn(e,tr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(ih)throw ih=!1,e=Gv,Gv=null,e;return ah&1&&e.tag!==0&&ys(),a=e.pendingLanes,a&1?e===Vv?Xu++:(Xu=0,Vv=e):Xu=0,_o(),null}function ys(){if(Ja!==null){var e=m6(ah),t=Wn.transition,r=xt;try{if(Wn.transition=null,xt=16>e?16:e,Ja===null)var n=!1;else{if(e=Ja,Ja=null,ah=0,mt&6)throw Error(xe(331));var i=mt;for(mt|=4,He=e.current;He!==null;){var a=He,o=a.child;if(He.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(He=f;He!==null;){var h=He;switch(h.tag){case 0:case 11:case 15:Ku(8,h,a)}var O=h.child;if(O!==null)O.return=h,He=O;else for(;He!==null;){h=He;var S=h.sibling,b=h.return;if(kw(h),h===f){He=null;break}if(S!==null){S.return=b,He=S;break}He=b}}}var _=a.alternate;if(_!==null){var y=_.child;if(y!==null){_.child=null;do{var p=y.sibling;y.sibling=null,y=p}while(y!==null)}}He=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,He=o;else e:for(;He!==null;){if(a=He,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ku(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,He=v;break e}He=a.return}}var m=e.current;for(He=m;He!==null;){o=He;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,He=d;else e:for(o=m;He!==null;){if(l=He,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ih(9,l)}}catch(w){Zt(l,l.return,w)}if(l===o){He=null;break e}var g=l.sibling;if(g!==null){g.return=l.return,He=g;break e}He=l.return}}if(mt=i,_o(),Bi&&typeof Bi.onPostCommitFiberRoot=="function")try{Bi.onPostCommitFiberRoot(Ch,e)}catch{}n=!0}return n}finally{xt=r,Wn.transition=t}}return!1}function d5(e,t,r){t=xs(r,t),t=mw(e,t,1),e=ao(e,t,1),t=Wr(),e!==null&&(Ac(e,1,t),pn(e,t))}function Zt(e,t,r){if(e.tag===3)d5(e,e,r);else for(;t!==null;){if(t.tag===3){d5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(oo===null||!oo.has(n))){e=xs(r,e),e=yw(t,e,1),t=ao(t,e,1),e=Wr(),t!==null&&(Ac(t,1,e),pn(t,e));break}}t=t.return}}function Lx(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Wr(),e.pingedLanes|=e.suspendedLanes&r,Sr===e&&(Tr&r)===r&&(dr===4||dr===3&&(Tr&130023424)===Tr&&500>tr()-iy?Qo(e,0):ny|=r),pn(e,t)}function Fw(e,t){t===0&&(e.mode&1?(t=Xf,Xf<<=1,!(Xf&130023424)&&(Xf=4194304)):t=1);var r=Wr();e=_a(e,t),e!==null&&(Ac(e,t,r),pn(e,r))}function Nx(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Fw(e,r)}function Ix(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(xe(314))}n!==null&&n.delete(t),Fw(e,r)}var zw;zw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||dn.current)un=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return un=!1,Sx(e,t,r);un=!!(e.flags&131072)}else un=!1,Ht&&t.flags&1048576&&$6(t,Xd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Td(e,t),e=t.pendingProps;var i=ws(t,Hr.current);ms(t,r),i=Zm(null,t,n,e,i,r);var a=Qm();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,hn(n)?(a=!0,Kd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qm(t),i.updater=Nh,t.stateNode=i,i._reactInternals=t,Lv(t,n,e,r),t=Dv(null,t,n,!0,a,r)):(t.tag=0,Ht&&a&&zm(t),qr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Td(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=jx(n),e=si(n,e),i){case 0:t=Iv(null,t,n,e,r);break e;case 1:t=r5(null,t,n,e,r);break e;case 11:t=e5(null,t,n,e,r);break e;case 14:t=t5(null,t,n,si(n.type,e),r);break e}throw Error(xe(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),Iv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),r5(e,t,n,i,r);case 3:e:{if(Sw(t),e===null)throw Error(xe(387));n=t.pendingProps,a=t.memoizedState,i=a.element,Y6(e,t),Jd(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=xs(Error(xe(423)),t),t=n5(e,t,n,r,i);break e}else if(n!==i){i=xs(Error(xe(424)),t),t=n5(e,t,n,r,i);break e}else for(On=io(t.stateNode.containerInfo.firstChild),xn=t,Ht=!0,ci=null,r=W6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ss(),n===i){t=wa(e,t,r);break e}qr(e,t,n,r)}t=t.child}return t;case 5:return X6(t),e===null&&Av(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,xv(n,i)?o=null:a!==null&&xv(n,a)&&(t.flags|=32),ww(e,t),qr(e,t,o,r),t.child;case 6:return e===null&&Av(t),null;case 13:return Ew(e,t,r);case 4:return Wm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Es(t,null,n,r):qr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),e5(e,t,n,i,r);case 7:return qr(e,t,t.pendingProps,r),t.child;case 8:return qr(e,t,t.pendingProps.children,r),t.child;case 12:return qr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Lt(Zd,n._currentValue),n._currentValue=o,a!==null)if(mi(a.value,o)){if(a.children===i.children&&!dn.current){t=wa(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(a.tag===1){u=ha(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Rv(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(xe(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Rv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}qr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ms(t,r),i=Yn(i),n=n(i),t.flags|=1,qr(e,t,n,r),t.child;case 14:return n=t.type,i=si(n,t.pendingProps),i=si(n.type,i),t5(e,t,n,i,r);case 15:return bw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),Td(e,t),t.tag=1,hn(n)?(e=!0,Kd(t)):e=!1,ms(t,r),vw(t,n,i),Lv(t,n,i,r),Dv(null,t,n,!0,e,r);case 19:return Ow(e,t,r);case 22:return _w(e,t,r)}throw Error(xe(156,t.tag))};function Bw(e,t){return h6(e,t)}function Dx(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(e,t,r,n){return new Dx(e,t,r,n)}function sy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jx(e){if(typeof e=="function")return sy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cm)return 11;if(e===km)return 14}return 2}function so(e,t){var r=e.alternate;return r===null?(r=qn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Md(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")sy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Jl:return Jo(r.children,i,a,t);case Pm:o=8,i|=8;break;case nv:return e=qn(12,r,t,i|2),e.elementType=nv,e.lanes=a,e;case iv:return e=qn(13,r,t,i),e.elementType=iv,e.lanes=a,e;case av:return e=qn(19,r,t,i),e.elementType=av,e.lanes=a,e;case X_:return jh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K_:o=10;break e;case Y_:o=9;break e;case Cm:o=11;break e;case km:o=14;break e;case Wa:o=16,n=null;break e}throw Error(xe(130,e==null?e:typeof e,""))}return t=qn(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Jo(e,t,r,n){return e=qn(7,e,n,t),e.lanes=r,e}function jh(e,t,r,n){return e=qn(22,e,n,t),e.elementType=X_,e.lanes=r,e.stateNode={isHidden:!1},e}function I1(e,t,r){return e=qn(6,e,null,t),e.lanes=r,e}function D1(e,t,r){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fx(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v1(0),this.expirationTimes=v1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uy(e,t,r,n,i,a,o,l,u){return e=new Fx(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=qn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},qm(a),e}function zx(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ql,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Uw(e){if(!e)return ho;e=e._reactInternals;e:{if(pl(e)!==e||e.tag!==1)throw Error(xe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(hn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(xe(171))}if(e.tag===1){var r=e.type;if(hn(r))return U6(e,r,t)}return t}function Hw(e,t,r,n,i,a,o,l,u){return e=uy(r,n,!0,e,i,a,o,l,u),e.context=Uw(null),r=e.current,n=Wr(),i=lo(r),a=ha(n,i),a.callback=t??null,ao(r,a,i),e.current.lanes=i,Ac(e,i,n),pn(e,n),e}function Fh(e,t,r,n){var i=t.current,a=Wr(),o=lo(i);return r=Uw(r),t.context===null?t.context=r:t.pendingContext=r,t=ha(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ao(i,t,o),e!==null&&(di(e,i,o,a),Pd(e,i,o)),o}function lh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function h5(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function cy(e,t){h5(e,t),(e=e.alternate)&&h5(e,t)}function Bx(){return null}var $w=typeof reportError=="function"?reportError:function(e){console.error(e)};function fy(e){this._internalRoot=e}zh.prototype.render=fy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(xe(409));Fh(e,t,null,null)};zh.prototype.unmount=fy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ol(function(){Fh(null,e,null,null)}),t[ba]=null}};function zh(e){this._internalRoot=e}zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=_6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ya.length&&t!==0&&t<Ya[r].priority;r++);Ya.splice(r,0,e),r===0&&S6(e)}};function dy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function p5(){}function Ux(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=lh(o);a.call(f)}}var o=Hw(t,n,e,0,null,!1,!1,"",p5);return e._reactRootContainer=o,e[ba]=o.current,uc(e.nodeType===8?e.parentNode:e),ol(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=lh(u);l.call(f)}}var u=uy(e,0,!1,null,null,!1,!1,"",p5);return e._reactRootContainer=u,e[ba]=u.current,uc(e.nodeType===8?e.parentNode:e),ol(function(){Fh(t,u,r,n)}),u}function Uh(e,t,r,n,i){var a=r._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var u=lh(o);l.call(u)}}Fh(t,o,e,i)}else o=Ux(r,t,e,i,n);return lh(o)}y6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Fu(t.pendingLanes);r!==0&&(Rm(t,r|1),pn(t,tr()),!(mt&6)&&(Ps=tr()+500,_o()))}break;case 13:ol(function(){var n=_a(e,1);if(n!==null){var i=Wr();di(n,e,1,i)}}),cy(e,1)}};Mm=function(e){if(e.tag===13){var t=_a(e,134217728);if(t!==null){var r=Wr();di(t,e,134217728,r)}cy(e,134217728)}};b6=function(e){if(e.tag===13){var t=lo(e),r=_a(e,t);if(r!==null){var n=Wr();di(r,e,t,n)}cy(e,t)}};_6=function(){return xt};w6=function(e,t){var r=xt;try{return xt=e,t()}finally{xt=r}};gv=function(e,t,r){switch(t){case"input":if(sv(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Rh(n);if(!i)throw Error(xe(90));Q_(n),sv(n,i)}}}break;case"textarea":e6(e,r);break;case"select":t=r.value,t!=null&&hs(e,!!r.multiple,t,!1)}};l6=ay;s6=ol;var Hx={usingClientEntryPoint:!1,Events:[Mc,ns,Rh,a6,o6,ay]},Ru={findFiberByHostInstance:Ko,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$x={bundleType:Ru.bundleType,version:Ru.version,rendererPackageName:Ru.rendererPackageName,rendererConfig:Ru.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Oa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=f6(e),e===null?null:e.stateNode},findFiberByHostInstance:Ru.findFiberByHostInstance||Bx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ld.isDisabled&&ld.supportsFiber)try{Ch=ld.inject($x),Bi=ld}catch{}}kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hx;kn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dy(t))throw Error(xe(200));return zx(e,t,null,r)};kn.createRoot=function(e,t){if(!dy(e))throw Error(xe(299));var r=!1,n="",i=$w;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=uy(e,1,!1,null,null,r,!1,n,i),e[ba]=t.current,uc(e.nodeType===8?e.parentNode:e),new fy(t)};kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(xe(188)):(e=Object.keys(e).join(","),Error(xe(268,e)));return e=f6(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return ol(e)};kn.hydrate=function(e,t,r){if(!Bh(t))throw Error(xe(200));return Uh(null,e,t,!0,r)};kn.hydrateRoot=function(e,t,r){if(!dy(e))throw Error(xe(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=$w;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Hw(t,null,e,1,r??null,i,!1,a,o),e[ba]=t.current,uc(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new zh(t)};kn.render=function(e,t,r){if(!Bh(t))throw Error(xe(200));return Uh(null,e,t,!1,r)};kn.unmountComponentAtNode=function(e){if(!Bh(e))throw Error(xe(40));return e._reactRootContainer?(ol(function(){Uh(null,null,e,!1,function(){e._reactRootContainer=null,e[ba]=null})}),!0):!1};kn.unstable_batchedUpdates=ay;kn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Bh(r))throw Error(xe(200));if(e==null||e._reactInternals===void 0)throw Error(xe(38));return Uh(e,t,r,!1,n)};kn.version="18.3.1-next-f1338f8080-20240426";function Gw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gw)}catch(e){console.error(e)}}Gw(),G_.exports=kn;var Vw=G_.exports,g5=Vw;jd.createRoot=g5.createRoot,jd.hydrateRoot=g5.hydrateRoot;var qw={};function nt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var Gx={};function hy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Gx}var Ww=Object.assign,sh=Object.getOwnPropertyDescriptor,Hi=Object.defineProperty,Nc=Object.prototype,Kv=[];Object.freeze(Kv);var py={};Object.freeze(py);var Vx=typeof Proxy<"u",qx=Object.toString();function Kw(){Vx||nt("Proxy not available")}function Yw(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var cs=function(){};function Cn(e){return typeof e=="function"}function ll(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Hh(e){return e!==null&&typeof e=="object"}function Sa(e){if(!Hh(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===qx}function Xw(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Ic(e,t,r){Hi(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Zw(e,t,r){Hi(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function wo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Hh(n)&&n[r]===!0}}function Vs(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function Wx(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function ca(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Qw=typeof Object.getOwnPropertySymbols<"u";function Kx(e){var t=Object.keys(e);if(!Qw)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Nc.propertyIsEnumerable.call(e,n)})):t}var Cs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Qw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Jw(e){return e===null?null:typeof e=="object"?""+e:e}function pa(e,t){return Nc.hasOwnProperty.call(e,t)}var Yx=Object.getOwnPropertyDescriptors||function(t){var r={};return Cs(t).forEach(function(n){r[n]=sh(t,n)}),r};function v5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Xx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qx(n.key),n)}}function $h(e,t,r){return t&&Xx(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fs(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Jx(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},po.apply(null,arguments)}function e8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yv(e,t)}function Yv(e,t){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Yv(e,t)}function Zx(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Qx(e){var t=Zx(e,"string");return typeof t=="symbol"?t:t+""}function Jx(e,t){if(e){if(typeof e=="string")return v5(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v5(e,t):void 0}}var zi=Symbol("mobx-stored-annotations");function hi(e){function t(r,n){if(Dc(n))return e.decorate_20223_(r,n);qs(r,n,e)}return Object.assign(t,e)}function qs(e,t,r){pa(e,zi)||Ic(e,zi,po({},e[zi])),sP(r)||(e[zi][t]=r)}function eP(e){return pa(e,zi)||Ic(e,zi,po({},e[zi])),e[zi]}function Dc(e){return typeof e=="object"&&typeof e.kind=="string"}var Ke=Symbol("mobx administration"),jc=function(){function e(r){r===void 0&&(r="Atom"),this.name_=void 0,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=St.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return b8(this)},t.reportChanged=function(){cn(),_8(this),fn()},t.toString=function(){return this.name_},e}(),gy=wo("Atom",jc);function yc(e,t,r){t===void 0&&(t=cs),r===void 0&&(r=cs);var n=new jc(e);return t!==cs&&T8(n,t),r!==cs&&wy(n,r),n}function tP(e,t){return e===t}function rP(e,t){return Ry(e,t)}function nP(e,t){return Ry(e,t,1)}function iP(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var sl={identity:tP,structural:rP,default:iP,shallow:nP};function ul(e,t,r){return Zh(e)?e:Array.isArray(e)?Tt.array(e,{name:r}):Sa(e)?Tt.object(e,void 0,{name:r}):Vs(e)?Tt.map(e,{name:r}):ca(e)?Tt.set(e,{name:r}):typeof e=="function"&&!zc(e)&&!Rs(e)?Xw(e)?fl(e):Ts(r,e):e}function aP(e,t,r){if(e==null||Er(e)||Zr(e)||Rr(e)||Kr(e))return e;if(Array.isArray(e))return Tt.array(e,{name:r,deep:!1});if(Sa(e))return Tt.object(e,void 0,{name:r,deep:!1});if(Vs(e))return Tt.map(e,{name:r,deep:!1});if(ca(e))return Tt.set(e,{name:r,deep:!1})}function Gh(e){return e}function oP(e,t){return Ry(e,t)?t:e}var t8="override",lP=hi({annotationType_:t8,make_:uP,extend_:cP,decorate_20223_:fP});function sP(e){return e.annotationType_===t8}function uP(e,t){return 0}function cP(e,t,r,n){nt("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function fP(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Fc(e,t){return{annotationType_:e,options_:t,make_:dP,extend_:hP,decorate_20223_:pP}}function dP(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(zc(r.value))return 1;var a=r8(e,this,t,r,!1);return Hi(n,t,a),2}function hP(e,t,r,n){var i=r8(e,this,t,r);return e.defineProperty_(t,i,n)}function pP(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var h,O,S,b;return go((h=(O=a.options_)==null?void 0:O.name)!=null?h:n.toString(),f,(S=(b=a.options_)==null?void 0:b.autoAction)!=null?S:!1)};if(r=="field"){i(function(){qs(this,n,a)});return}if(r=="method"){var l;return zc(e)||(e=o(e)),(l=this.options_)!=null&&l.bound&&i(function(){var u=this,f=u[n].bind(u);f.isMobxAction=!0,u[n]=f}),e}nt("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
34
|
+
'`+a.annotationType_+"' can only be used on properties with a function value."))}function gP(e,t,r,n){t.annotationType_,n.value}function r8(e,t,r,n,i){var a,o,l,u,f,h,O;i===void 0&&(i=Te.safeDescriptors),gP(e,t,r,n);var S=n.value;if((a=t.options_)!=null&&a.bound){var b;S=S.bind((b=e.proxy_)!=null?b:e.target_)}return{value:go((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),S,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(h=t.options_)!=null&&h.bound?(O=e.proxy_)!=null?O:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function n8(e,t){return{annotationType_:e,options_:t,make_:vP,extend_:mP,decorate_20223_:yP}}function vP(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!pa(e.target_,t)||!Rs(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Rs(r.value))return 1;var a=i8(e,this,t,r,!1,!1);return Hi(n,t,a),2}function mP(e,t,r,n){var i,a=i8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function yP(e,t){var r,n=t.name,i=t.addInitializer;return Rs(e)||(e=fl(e)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),e}function bP(e,t,r,n){t.annotationType_,n.value}function i8(e,t,r,n,i,a){a===void 0&&(a=Te.safeDescriptors),bP(e,t,r,n);var o=n.value;if(Rs(o)||(o=fl(o)),i){var l;o=o.bind((l=e.proxy_)!=null?l:e.target_),o.isMobXFlow=!0}return{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function vy(e,t){return{annotationType_:e,options_:t,make_:_P,extend_:wP,decorate_20223_:SP}}function _P(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function wP(e,t,r,n){return EP(e,this,t,r),e.defineComputedProperty_(t,po({},this.options_,{get:r.get,set:r.set}),n)}function SP(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=ml(this)[Ke],o=po({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new Vi(o))}),function(){return this[Ke].getObservablePropValue_(n)}}function EP(e,t,r,n){t.annotationType_,n.get}function Vh(e,t){return{annotationType_:e,options_:t,make_:OP,extend_:xP,decorate_20223_:PP}}function OP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function xP(e,t,r,n){var i,a;return CP(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:ul,n)}function PP(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,h,O=ml(l)[Ke],S=new uo(u,(f=(h=r.options_)==null?void 0:h.enhancer)!=null?f:ul,"ObservableObject."+i.toString(),!1);O.values_.set(i,S),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Ke].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ke].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function CP(e,t,r,n){t.annotationType_}var kP="true",TP=a8();function a8(e){return{annotationType_:kP,options_:e,make_:AP,extend_:RP,decorate_20223_:MP}}function AP(e,t,r,n){var i,a;if(r.get)return gl.make_(e,t,r,n);if(r.set){var o=go(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Te.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Hi(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(Xw(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?fl.bound:fl;return f.make_(e,t,r,n)}var h=(l=this.options_)!=null&&l.autoBind?Ts.bound:Ts;return h.make_(e,t,r,n)}var O=((i=this.options_)==null?void 0:i.deep)===!1?Tt.ref:Tt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var S;r.value=r.value.bind((S=e.proxy_)!=null?S:e.target_)}return O.make_(e,t,r,n)}function RP(e,t,r,n){var i,a;if(r.get)return gl.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Te.safeDescriptors?e.isPlainObject_:!0,set:go(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?Tt.ref:Tt;return l.extend_(e,t,r,n)}function MP(e,t){nt("'"+this.annotationType_+"' cannot be used as a decorator")}var LP="observable",NP="observable.ref",IP="observable.shallow",DP="observable.struct",o8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(o8);function sd(e){return e||o8}var Xv=Vh(LP),jP=Vh(NP,{enhancer:Gh}),FP=Vh(IP,{enhancer:aP}),zP=Vh(DP,{enhancer:oP}),l8=hi(Xv);function ud(e){return e.deep===!0?ul:e.deep===!1?Gh:UP(e.defaultDecorator)}function BP(e){var t;return e?(t=e.defaultDecorator)!=null?t:a8(e):void 0}function UP(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:ul}function s8(e,t,r){if(Dc(t))return Xv.decorate_20223_(e,t);if(ll(t)){qs(e,t,Xv);return}return Zh(e)?e:Sa(e)?Tt.object(e,t,r):Array.isArray(e)?Tt.array(e,t):Vs(e)?Tt.map(e,t):ca(e)?Tt.set(e,t):typeof e=="object"&&e!==null?e:Tt.box(e,t)}Ww(s8,l8);var HP={box:function(t,r){var n=sd(r);return new uo(t,ud(n),n.name,!0,n.equals)},array:function(t,r){var n=sd(r);return(Te.useProxies===!1||n.proxy===!1?KC:FC)(t,ud(n),n.name)},map:function(t,r){var n=sd(r);return new Jh(t,ud(n),n.name)},set:function(t,r){var n=sd(r);return new Ty(t,ud(n),n.name)},object:function(t,r,n){return So(function(){return Sy(Te.useProxies===!1||(n==null?void 0:n.proxy)===!1?ml({},n):NC({},n),t,r)})},ref:hi(jP),shallow:hi(FP),deep:l8,struct:hi(zP)},Tt=Ww(s8,HP),u8="computed",$P="computed.struct",Zv=vy(u8),GP=vy($P,{equals:sl.structural}),gl=function(t,r){if(Dc(r))return Zv.decorate_20223_(t,r);if(ll(r))return qs(t,r,Zv);if(Sa(t))return hi(vy(u8,t));var n=Sa(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Vi(n)};Object.assign(gl,Zv);gl.struct=hi(GP);var m5,y5,uh=0,VP=1,qP=(m5=(y5=sh(function(){},"name"))==null?void 0:y5.configurable)!=null?m5:!1,b5={value:"action",configurable:!0,writable:!1,enumerable:!1};function go(e,t,r,n){r===void 0&&(r=!1);function i(){return c8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},qP&&(b5.value=e,Hi(i,"name",b5)),i}function c8(e,t,r,n,i){var a=f8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{d8(a)}}function f8(e,t,r,n){var i=!1,a=0,o=Te.trackingDerivation,l=!t||!o;cn();var u=Te.allowStateChanges;l&&(vl(),u=qh(!0));var f=Kh(!0),h={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:VP++,parentActionId_:uh};return uh=h.actionId_,h}function d8(e){uh!==e.actionId_&&nt(30),uh=e.parentActionId_,e.error_!==void 0&&(Te.suppressReactionErrors=!0),Wh(e.prevAllowStateChanges_),bs(e.prevAllowStateReads_),fn(),e.runAsAction_&&ga(e.prevDerivation_),Te.suppressReactionErrors=!1}function my(e,t){var r=qh(e);try{return t()}finally{Wh(r)}}function qh(e){var t=Te.allowStateChanges;return Te.allowStateChanges=e,t}function Wh(e){Te.allowStateChanges=e}var uo=function(e){function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=sl.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=l,u.value_=i(n,void 0,a),u}e8(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Te.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Gn(this)){var a=Vn(this,{object:this,type:$i,newValue:i});if(!a)return Te.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Te.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),pi(this)&&gi(this,{type:$i,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Bc(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:$i,newValue:this.value_,oldValue:void 0}),Uc(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Jw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(jc),yy=wo("ObservableValue",uo);function cd(e,t){return!!(e&t)}function fd(e,t,r){return r?e|=t:e&=~t,e}var Vi=function(){function e(r){this.dependenciesState_=St.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=St.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new fh(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=ch.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||nt(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=go("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?sl.structural:sl.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){rC(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&nt(32,this.name_,this.derivation),Te.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Qv(this)&&(this.warnAboutUntrackedRead_(),cn(),this.value_=this.computeValue_(!1),fn());else if(b8(this),Qv(this)){var n=Te.trackingContext;this.keepAlive_&&!n&&(Te.trackingContext=this),this.trackAndCompute()&&tC(this),Te.trackingContext=n}var i=this.value_;if(Ld(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&nt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else nt(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===St.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Ld(n)||Ld(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing=!0;var i=qh(!1),a;if(n)a=h8(this,this.derivation,this.scope_);else if(Te.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new fh(o)}return Wh(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(Jv(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return _y(function(){var u=a.get();if(!o||i){var f=vl();n({observableKind:"computed",debugObjectName:a.name_,type:$i,object:a,newValue:u,oldValue:l}),ga(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Jw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},$h(e,[{key:"isComputing",get:function(){return cd(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=fd(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return cd(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=fd(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return cd(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=fd(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return cd(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=fd(this.flags_,e.isPendingUnobservationMask_,n)}}])}();Vi.isComputingMask_=1;Vi.isRunningSetterMask_=2;Vi.isBeingObservedMask_=4;Vi.isPendingUnobservationMask_=8;var cl=wo("ComputedValue",Vi),St;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(St||(St={}));var ch;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(ch||(ch={}));var fh=function(t){this.cause=void 0,this.cause=t};function Ld(e){return e instanceof fh}function Qv(e){switch(e.dependenciesState_){case St.UP_TO_DATE_:return!1;case St.NOT_TRACKING_:case St.STALE_:return!0;case St.POSSIBLY_STALE_:{for(var t=Kh(!0),r=vl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(cl(o)){if(Te.disableErrorBoundaries)o.get();else try{o.get()}catch{return ga(r),bs(t),!0}if(e.dependenciesState_===St.STALE_)return ga(r),bs(t),!0}}return p8(e),ga(r),bs(t),!1}}}function WP(){return Te.trackingDerivation!==null}function h8(e,t,r){var n=Kh(!0);p8(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Te.runId;var i=Te.trackingDerivation;Te.trackingDerivation=e,Te.inBatch++;var a;if(Te.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new fh(o)}return Te.inBatch--,Te.trackingDerivation=i,KP(e),bs(n),a}function KP(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=St.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var l=r[o];l.diffValue_===0&&(l.diffValue_=1,i!==o&&(r[i]=l),i++),l.dependenciesState_>n&&(n=l.dependenciesState_)}for(r.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue_===0&&m8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,eC(f,e))}n!==St.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Jv(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)m8(t[r],e);e.dependenciesState_=St.NOT_TRACKING_}function by(e){var t=vl();try{return e()}finally{ga(t)}}function vl(){var e=Te.trackingDerivation;return Te.trackingDerivation=null,e}function ga(e){Te.trackingDerivation=e}function Kh(e){var t=Te.allowStateReads;return Te.allowStateReads=e,t}function bs(e){Te.allowStateReads=e}function p8(e){if(e.dependenciesState_!==St.UP_TO_DATE_){e.dependenciesState_=St.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=St.UP_TO_DATE_}}var YP=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Zu=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Nd=!0,g8=!1,Te=function(){var e=hy();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Nd=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Zu().version&&(Nd=!1),Nd?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Zu):(setTimeout(function(){g8||nt(35)},1),new Zu)}();function XP(){if((Te.pendingReactions.length||Te.inBatch||Te.isRunningReactions)&&nt(36),g8=!0,Nd){var e=hy();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Te=new Zu}}function v8(){return Te}function ZP(){var e=new Zu;for(var t in e)YP.indexOf(t)===-1&&(Te[t]=e[t]);Te.allowStateChanges=!Te.enforceActions}function QP(e){return e.observers_&&e.observers_.size>0}function JP(e){return e.observers_}function eC(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function m8(e,t){e.observers_.delete(t),e.observers_.size===0&&y8(e)}function y8(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Te.pendingUnobservations.push(e))}function cn(){Te.inBatch++}function fn(){if(--Te.inBatch===0){w8();for(var e=Te.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof Vi&&r.suspend_())}Te.pendingUnobservations=[]}}function b8(e){var t=Te.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Te.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Te.inBatch>0&&y8(e),!1)}function _8(e){e.lowestObserverState_!==St.STALE_&&(e.lowestObserverState_=St.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=St.STALE_}))}function tC(e){e.lowestObserverState_!==St.STALE_&&(e.lowestObserverState_=St.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.POSSIBLY_STALE_?t.dependenciesState_=St.STALE_:t.dependenciesState_===St.UP_TO_DATE_&&(e.lowestObserverState_=St.UP_TO_DATE_)}))}function rC(e){e.lowestObserverState_===St.UP_TO_DATE_&&(e.lowestObserverState_=St.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.UP_TO_DATE_&&(t.dependenciesState_=St.POSSIBLY_STALE_,t.onBecomeStale_())}))}var ks=function(){function e(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=St.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=ch.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,Te.pendingReactions.push(this),w8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){cn(),this.isScheduled_=!1;var n=Te.trackingContext;if(Te.trackingContext=this,Qv(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Te.trackingContext=n,fn()}},t.track=function(n){if(!this.isDisposed_){cn(),this.isRunning_=!0;var i=Te.trackingContext;Te.trackingContext=this;var a=h8(this,n,void 0);Te.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Jv(this),Ld(a)&&this.reportExceptionInDerivation_(a.cause),fn()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Te.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Te.suppressReactionErrors||console.error(a,n),Te.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(cn(),Jv(this),fn()))},t.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[Ke]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function nC(e){return Te.globalReactionErrorHandlers.push(e),function(){var t=Te.globalReactionErrorHandlers.indexOf(e);t>=0&&Te.globalReactionErrorHandlers.splice(t,1)}}var iC=100,em=function(t){return t()};function w8(){Te.inBatch>0||Te.isRunningReactions||em(aC)}function aC(){Te.isRunningReactions=!0;for(var e=Te.pendingReactions,t=0;e.length>0;){++t===iC&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Te.isRunningReactions=!1}var dh=wo("Reaction",ks);function oC(e){var t=em;em=function(n){return e(function(){return t(n)})}}function Qu(){return!1}function S8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var E8="action",lC="action.bound",O8="autoAction",sC="autoAction.bound",x8="<unnamed action>",tm=Fc(E8),uC=Fc(lC,{bound:!0}),rm=Fc(O8,{autoAction:!0}),cC=Fc(sC,{autoAction:!0,bound:!0});function P8(e){var t=function(n,i){if(Cn(n))return go(n.name||x8,n,e);if(Cn(i))return go(n,i,e);if(Dc(i))return(e?rm:tm).decorate_20223_(n,i);if(ll(i))return qs(n,i,e?rm:tm);if(ll(n))return hi(Fc(e?O8:E8,{name:n,autoAction:e}))};return t}var ar=P8(!1);Object.assign(ar,tm);var Ts=P8(!0);Object.assign(Ts,rm);ar.bound=hi(uC);Ts.bound=hi(cC);function As(e){return c8(e.name||x8,!1,e,this,void 0)}function zc(e){return Cn(e)&&e.isMobxAction===!0}function _y(e,t){var r,n,i,a;t===void 0&&(t=py);var o=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",l=!t.scheduler&&!t.delay,u;if(l)u=new ks(o,function(){this.track(O)},t.onError,t.requiresObservable);else{var f=C8(t),h=!1;u=new ks(o,function(){h||(h=!0,f(function(){h=!1,u.isDisposed_||u.track(O)}))},t.onError,t.requiresObservable)}function O(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var fC=function(t){return t()};function C8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:fC}function k8(e,t,r){var n,i,a;r===void 0&&(r=py);var o=(n=r.name)!=null?n:"Reaction",l=ar(o,r.onError?dC(r.onError,t):t),u=!r.scheduler&&!r.delay,f=C8(r),h=!0,O=!1,S,b=r.compareStructural?sl.structural:r.equals||sl.default,_=new ks(o,function(){h||u?y():O||(O=!0,f(y))},r.onError,r.requiresObservable);function y(){if(O=!1,!_.isDisposed_){var p=!1,v=S;_.track(function(){var m=my(!1,function(){return e(_)});p=h||!b(S,m),S=m}),(h&&r.fireImmediately||!h&&p)&&l(S,v,_),h=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||_.schedule_(),_.getDisposer_((a=r)==null?void 0:a.signal)}function dC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var hC="onBO",pC="onBUO";function T8(e,t,r){return A8(hC,e,t,r)}function wy(e,t,r){return A8(pC,e,t,r)}function A8(e,t,r,n){var i=typeof n=="function"?qi(t,r):qi(t),a=Cn(n)?n:r,o=e+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var l=i[o];l&&(l.delete(a),l.size===0&&delete i[o])}}var gC="never",dd="always",vC="observed";function R8(e){e.isolateGlobalState===!0&&XP();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Te.useProxies=t===dd?!0:t===gC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Te.verifyProxies=!0),r!==void 0){var n=r===dd?dd:r===vC;Te.enforceActions=n,Te.allowStateChanges=!(n===!0||n===dd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Te[i]=!!e[i])}),Te.allowStateReads=!Te.observableRequiresReaction,e.reactionScheduler&&oC(e.reactionScheduler)}function Sy(e,t,r,n){var i=Yx(t);return So(function(){var a=ml(e,n)[Ke];Cs(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function M8(e,t){return L8(qi(e,t))}function L8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=yC(e.observing_).map(L8)),t}function mC(e,t){return N8(qi(e,t))}function N8(e){var t={name:e.name_};return QP(e)&&(t.observers=Array.from(JP(e)).map(N8)),t}function yC(e){return Array.from(new Set(e))}var bC=0;function Yh(){this.message="FLOW_CANCELLED"}Yh.prototype=Object.create(Error.prototype);function _C(e){return e instanceof Yh}var j1=n8("flow"),wC=n8("flow.bound",{bound:!0}),fl=Object.assign(function(t,r){if(Dc(r))return j1.decorate_20223_(t,r);if(ll(r))return qs(t,r,j1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++bC,h=ar(i+" - runid: "+f+" - init",n).apply(l,u),O,S=void 0,b=new Promise(function(_,y){var p=0;O=y;function v(g){S=void 0;var w;try{w=ar(i+" - runid: "+f+" - yield "+p++,h.next).call(h,g)}catch(k){return y(k)}d(w)}function m(g){S=void 0;var w;try{w=ar(i+" - runid: "+f+" - yield "+p++,h.throw).call(h,g)}catch(k){return y(k)}d(w)}function d(g){if(Cn(g==null?void 0:g.then)){g.then(d,y);return}return g.done?_(g.value):(S=Promise.resolve(g.value),S.then(v,m))}v(void 0)});return b.cancel=ar(i+" - runid: "+f+" - cancel",function(){try{S&&_5(S);var _=h.return(void 0),y=Promise.resolve(_.value);y.then(cs,cs),_5(y),O(new Yh)}catch(p){O(p)}}),b};return a.isMobXFlow=!0,a},j1);fl.bound=hi(wC);function _5(e){Cn(e.cancel)&&e.cancel()}function SC(e){return e}function Rs(e){return(e==null?void 0:e.isMobXFlow)===!0}function Ey(e,t,r){var n;return Rr(e)||Zr(e)||yy(e)?n=yi(e):Er(e)&&(n=yi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function Xh(e,t,r){return Cn(r)?OC(e,t,r):EC(e,t)}function EC(e,t){return yi(e).intercept_(t)}function OC(e,t,r){return yi(e,t).intercept_(r)}function I8(e,t){if(t===void 0)return cl(e);if(Er(e)===!1||!e[Ke].values_.has(t))return!1;var r=qi(e,t);return cl(r)}function xC(e){return I8(e)}function D8(e,t){return I8(e,t)}function j8(e,t){return e?t!==void 0?Er(e)?e[Ke].values_.has(t):!1:Er(e)||!!e[Ke]||gy(e)||dh(e)||cl(e):!1}function Zh(e){return j8(e)}function F8(e,t){return j8(e,t)}function bc(e){if(Er(e))return e[Ke].keys_();if(Rr(e)||Kr(e))return Array.from(e.keys());if(Zr(e))return e.map(function(t,r){return r});nt(5)}function Oy(e){if(Er(e))return bc(e).map(function(t){return e[t]});if(Rr(e))return bc(e).map(function(t){return e.get(t)});if(Kr(e))return Array.from(e.values());if(Zr(e))return e.slice();nt(6)}function z8(e){if(Er(e))return bc(e).map(function(t){return[t,e[t]]});if(Rr(e))return bc(e).map(function(t){return[t,e.get(t)]});if(Kr(e))return Array.from(e.entries());if(Zr(e))return e.map(function(t,r){return[r,t]});nt(7)}function xy(e,t,r){if(arguments.length===2&&!Kr(e)){cn();var n=t;try{for(var i in n)xy(e,i,n[i])}finally{fn()}return}Er(e)?e[Ke].set_(t,r):Rr(e)?e.set(t,r):Kr(e)?e.add(t):Zr(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&nt("Invalid index: '"+t+"'"),cn(),t>=e.length&&(e.length=t+1),e[t]=r,fn()):nt(8)}function PC(e,t){Er(e)?e[Ke].delete_(t):Rr(e)||Kr(e)?e.delete(t):Zr(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):nt(9)}function B8(e,t){if(Er(e))return e[Ke].has_(t);if(Rr(e))return e.has(t);if(Kr(e))return e.has(t);if(Zr(e))return t>=0&&t<e.length;nt(10)}function CC(e,t){if(B8(e,t)){if(Er(e))return e[Ke].get_(t);if(Rr(e))return e.get(t);if(Zr(e))return e[t];nt(11)}}function Py(e,t,r){if(Er(e))return e[Ke].defineProperty_(t,r);nt(39)}function U8(e){if(Er(e))return e[Ke].ownKeys_();nt(38)}function Qh(e,t,r,n){return Cn(r)?TC(e,t,r,n):kC(e,t,r)}function kC(e,t,r){return yi(e).observe_(t,r)}function TC(e,t,r,n){return yi(e,t).observe_(r,n)}function hd(e,t,r){return e.set(t,r),r}function Zl(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Zh(e))return e;if(yy(e)||cl(e))return Zl(e.get(),t);if(t.has(e))return t.get(e);if(Zr(e)){var r=hd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Zl(o,t)}),r}if(Kr(e)){var n=hd(t,e,new Set);return e.forEach(function(o){n.add(Zl(o,t))}),n}if(Rr(e)){var i=hd(t,e,new Map);return e.forEach(function(o,l){i.set(l,Zl(o,t))}),i}else{var a=hd(t,e,{});return U8(e).forEach(function(o){Nc.propertyIsEnumerable.call(e,o)&&(a[o]=Zl(e[o],t))}),a}}function AC(e,t){return Zl(e,new Map)}function RC(){}function ji(e,t){t===void 0&&(t=void 0),cn();try{return e.apply(t)}finally{fn()}}function nm(e,t,r){return arguments.length===1||t&&typeof t=="object"?MC(e,t):H8(e,t,r||{})}function H8(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Ke].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=go("When-effect",t),o=_y(function(l){var u=my(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function MC(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,l){var u,f=H8(e,o,po({},t,{onError:l}));n=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return t==null||(o=t.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function Wl(e){return e[Ke]}var LC={has:function(t,r){return Wl(t).has_(r)},get:function(t,r){return Wl(t).get_(r)},set:function(t,r,n){var i;return ll(r)?(i=Wl(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return ll(r)?(n=Wl(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=Wl(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return Wl(t).ownKeys_()},preventExtensions:function(t){nt(13)}};function NC(e,t){var r,n;return Kw(),e=ml(e,t),(n=(r=e[Ke]).proxy_)!=null?n:r.proxy_=new Proxy(e,LC)}function Gn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Bc(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Yw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Vn(e,t){var r=vl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&nt(14),!!t);i++);return t}finally{ga(r)}}function pi(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Uc(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Yw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function gi(e,t){var r=vl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);ga(r)}}function Cy(e,t,r){return So(function(){var n,i=ml(e,r)[Ke];(n=t)!=null||(t=eP(e)),Cs(t).forEach(function(a){return i.make_(a,t[a])})}),e}var F1=Symbol("mobx-keys");function IC(e,t,r){return Sa(e)?Sy(e,e,t,r):(So(function(){var n=ml(e,r)[Ke];if(!e[F1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(Cs(e),Cs(i)));a.delete("constructor"),a.delete(Ke),Ic(i,F1,a)}e[F1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var w5="splice",$i="update",DC=1e4,jC={get:function(t,r){var n=t[Ke];return r===Ke?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):pa(hh,r)?hh[r]:t[r]},set:function(t,r,n){var i=t[Ke];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){nt(15)}},ky=function(){function e(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new jc(r),this.enhancer_=function(o,l){return n(o,l,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return Bc(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Uc(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&nt("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&nt(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&W8(n+i+1)},t.spliceWithArray_=function(n,i,a){var o=this;this.atom_;var l=this.values_.length;if(n===void 0?n=0:n>l?n=l:n<0&&(n=Math.max(0,l+n)),arguments.length===1?i=l-n:i==null?i=0:i=Math.max(0,Math.min(i,l-n)),a===void 0&&(a=Kv),Gn(this)){var u=Vn(this,{object:this.proxy_,type:w5,index:n,removedCount:i,added:a});if(!u)return Kv;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(O){return o.enhancer_(O,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var h=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,h),this.dehanceValues_(h)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<DC){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var l=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var f=0;f<a.length;f++)this.values_[n+f]=a[f];for(var h=0;h<u.length;h++)this.values_[n+a.length+h]=u[h];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Qu(),l=pi(this),u=l||o?{observableKind:"array",object:this.proxy_,type:$i,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&gi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Qu(),l=pi(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:w5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&gi(this,u)},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&nt(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Gn(this)){var l=Vn(this,{type:$i,object:this.proxy_,index:n,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var f=new Array(n+1-a.length),h=0;h<f.length-1;h++)f[h]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function FC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Kw(),So(function(){var i=new ky(r,t,n,!1);Zw(i.values_,Ke,i);var a=new Proxy(i.values_,jC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var hh={clear:function(){return this.splice(0)},replace:function(t){var r=this[Ke];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[Ke];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[Ke].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Ke],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[Ke].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ke],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return Te.trackingDerivation&&nt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Te.trackingDerivation&&nt(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Ke],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Nt("at",An);Nt("concat",An);Nt("flat",An);Nt("includes",An);Nt("indexOf",An);Nt("join",An);Nt("lastIndexOf",An);Nt("slice",An);Nt("toString",An);Nt("toLocaleString",An);Nt("toSorted",An);Nt("toSpliced",An);Nt("with",An);Nt("every",bi);Nt("filter",bi);Nt("find",bi);Nt("findIndex",bi);Nt("findLast",bi);Nt("findLastIndex",bi);Nt("flatMap",bi);Nt("forEach",bi);Nt("map",bi);Nt("some",bi);Nt("toReversed",bi);Nt("reduce",$8);Nt("reduceRight",$8);function Nt(e,t){typeof Array.prototype[e]=="function"&&(hh[e]=t(e))}function An(e){return function(){var t=this[Ke];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function bi(e){return function(t,r){var n=this,i=this[Ke];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function $8(e){return function(){var t=this,r=this[Ke];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,t)},n[e].apply(n,arguments)}}var zC=wo("ObservableArrayAdministration",ky);function Zr(e){return Hh(e)&&zC(e[Ke])}var BC={},eo="add",ph="delete",Jh=function(){function e(r,n,i){var a=this;n===void 0&&(n=ul),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ke]=BC,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,Cn(Map)||nt(18),So(function(){a.keysAtom_=yc("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!Te.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new uo(this.has_(n),Gh,"ObservableMap.key?",!1);this.hasMap_.set(n,o),wy(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(Gn(this)){var o=Vn(this,{type:a?$i:eo,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(this.keysAtom_,Gn(this)){var a=Vn(this,{type:ph,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Qu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:ph,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return ji(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var h=i.data_.get(n);h.setNewValue_(void 0),i.data_.delete(n)}),l&&gi(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Te.UNCHANGED){var o=Qu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:$i,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&gi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,ji(function(){var f,h=new uo(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,h),i=h.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Qu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:eo,object:this,name:n,newValue:i}:null;l&&gi(this,u)},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return _c({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return _c({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var a=fs(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return Rr(n)&&(n=new Map(n)),ji(function(){Sa(n)?Kx(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var o=a[0],l=a[1];return i.set(o,l)}):Vs(n)?(Wx(n)||nt(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&nt(20,n)}),this},t.clear=function(){var n=this;ji(function(){by(function(){for(var i=fs(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return ji(function(){for(var a=UC(n),o=new Map,l=!1,u=fs(i.data_.keys()),f;!(f=u()).done;){var h=f.value;if(!a.has(h)){var O=i.delete(h);if(O)l=!0;else{var S=i.data_.get(h);o.set(h,S)}}}for(var b=fs(a.entries()),_;!(_=b()).done;){var y=_.value,p=y[0],v=y[1],m=i.data_.has(p);if(i.set(p,v),i.data_.has(p)){var d=i.data_.get(p);o.set(p,d),m||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var g=i.data_.keys(),w=o.keys(),k=g.next(),P=w.next();!k.done;){if(k.value!==P.value){i.keysAtom_.reportChanged();break}k=g.next(),P=w.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return Uc(this,n)},t.intercept_=function(n){return Bc(this,n)},$h(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Rr=wo("ObservableMap",Jh);function UC(e){if(Vs(e)||Rr(e))return e;if(Array.isArray(e))return new Map(e);if(Sa(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return nt(21,e)}var HC={},Ty=function(){function e(r,n,i){var a=this;n===void 0&&(n=ul),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ke]=HC,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Cn(Set)||nt(22),this.enhancer_=function(o,l){return n(o,l,i)},So(function(){a.atom_=yc(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;ji(function(){by(function(){for(var i=fs(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=fs(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},t.add=function(n){var i=this;if(this.atom_,Gn(this)){var a=Vn(this,{type:eo,object:this,newValue:n});if(!a)return this}if(!this.has(n)){ji(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=pi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:eo,object:this,newValue:n}:null;l&&gi(this,u)}return this},t.delete=function(n){var i=this;if(Gn(this)){var a=Vn(this,{type:ph,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=pi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:ph,object:this,oldValue:n}:null;return ji(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&gi(this,u),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=0,i=Array.from(this.keys()),a=Array.from(this.values());return _c({next:function(){var l=n;return n+=1,l<a.length?{value:[i[l],a[l]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=0,a=Array.from(this.data_.values());return _c({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.intersection=function(n){if(ca(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(ca(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(ca(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(ca(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Kr(n)&&(n=new Set(n)),ji(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):ca(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&nt("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return Uc(this,n)},t.intercept_=function(n){return Bc(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},$h(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Kr=wo("ObservableSet",Ty),S5=Object.create(null),E5="remove",G8=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=TP),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new jc("ObservableObject.keys"),this.isPlainObject_=Sa(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof Vi)return a.set(i),!0;if(Gn(this)){var o=Vn(this,{type:$i,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Te.UNCHANGED){var l=pi(this),u=!1,f=l||u?{type:$i,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&gi(this,f)}return!0},t.get_=function(n){return Te.trackingDerivation&&!pa(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),pa(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(n){if(!Te.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new uo(n in this.target_,Gh,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[zi])!=null&&a[n])return;nt(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Nc;){var l=sh(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}x5(this,i,n)}},t.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var l=a.extend_(this,n,i,o);return l&&x5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{cn();var o=this.delete_(n);if(!o)return o;if(Gn(this)){var l=Vn(this,{object:this.proxy_||this.target_,name:n,type:eo,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=po({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Hi(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{fn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{cn();var l=this.delete_(n);if(!l)return l;if(Gn(this)){var u=Vn(this,{object:this.proxy_||this.target_,name:n,type:eo,newValue:i});if(!u)return null;i=u.newValue}var f=O5(n),h={configurable:Te.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,h))return!1}else Hi(this.target_,n,h);var O=new uo(i,a,"ObservableObject.key",!1);this.values_.set(n,O),this.notifyPropertyAddition_(n,O.value_)}finally{fn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{cn();var o=this.delete_(n);if(!o)return o;if(Gn(this)){var l=Vn(this,{object:this.proxy_||this.target_,name:n,type:eo,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=O5(n),f={configurable:Te.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Hi(this.target_,n,f);this.values_.set(n,new Vi(i)),this.notifyPropertyAddition_(n,void 0)}finally{fn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!pa(this.target_,n))return!0;if(Gn(this)){var a=Vn(this,{object:this.proxy_||this.target_,name:n,type:E5});if(!a)return null}try{var o;cn();var l=pi(this),u=!1,f=this.values_.get(n),h=void 0;if(!f&&(l||u)){var O;h=(O=sh(this.target_,n))==null?void 0:O.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(f&&(this.values_.delete(n),f instanceof uo&&(h=f.value_),_8(f)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),l||u){var S={type:E5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};l&&gi(this,S)}}finally{fn()}return!0},t.observe_=function(n,i){return Uc(this,n)},t.intercept_=function(n){return Bc(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o=pi(this),l=!1;if(o||l){var u=o||l?{type:eo,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&gi(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Cs(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function ml(e,t){var r;if(pa(e,Ke))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new G8(e,new Map,String(n),BP(t));return Ic(e,Ke,i),e}var $C=wo("ObservableObjectAdministration",G8);function O5(e){return S5[e]||(S5[e]={get:function(){return this[Ke].getObservablePropValue_(e)},set:function(r){return this[Ke].setObservablePropValue_(e,r)}})}function Er(e){return Hh(e)?$C(e[Ke]):!1}function x5(e,t,r){var n;(n=e.target_[zi])==null||delete n[r]}var GC=q8(0),VC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),z1=0,V8=function(){};function qC(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}qC(V8,Array.prototype);var Ay=function(e){function t(n,i,a,o){var l;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),l=e.call(this)||this,So(function(){var u=new ky(a,i,o,!0);u.proxy_=l,Zw(l,Ke,u),n&&n.length&&l.spliceWithArray(0,0,n),VC&&Object.defineProperty(l,"0",GC)}),l}e8(t,e);var r=t.prototype;return r.concat=function(){this[Ke].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(l){return Zr(l)?l.slice():l}))},r[Symbol.iterator]=function(){var n=this,i=0;return _c({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},$h(t,[{key:"length",get:function(){return this[Ke].getArrayLength_()},set:function(i){this[Ke].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(V8);Object.entries(hh).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Ic(Ay.prototype,t,r)});function q8(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ke].get_(e)},set:function(r){this[Ke].set_(e,r)}}}function WC(e){Hi(Ay.prototype,""+e,q8(e))}function W8(e){if(e>z1){for(var t=z1;t<e+100;t++)WC(t);z1=e}}W8(1e3);function KC(e,t,r){return new Ay(e,t,r)}function qi(e,t){if(typeof e=="object"&&e!==null){if(Zr(e))return t!==void 0&&nt(23),e[Ke].atom_;if(Kr(e))return e.atom_;if(Rr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||nt(25,t,gh(e)),r}if(Er(e)){if(!t)return nt(26);var n=e[Ke].values_.get(t);return n||nt(27,t,gh(e)),n}if(gy(e)||cl(e)||dh(e))return e}else if(Cn(e)&&dh(e[Ke]))return e[Ke];nt(28)}function yi(e,t){if(e||nt(29),t!==void 0)return yi(qi(e,t));if(gy(e)||cl(e)||dh(e)||Rr(e)||Kr(e))return e;if(e[Ke])return e[Ke];nt(24,e)}function gh(e,t){var r;if(t!==void 0)r=qi(e,t);else{if(zc(e))return e.name;Er(e)||Rr(e)||Kr(e)?r=yi(e):r=qi(e)}return r.name_}function So(e){var t=vl(),r=qh(!0);cn();try{return e()}finally{fn(),Wh(r),ga(t)}}var P5=Nc.toString;function Ry(e,t,r){return r===void 0&&(r=-1),im(e,t,r)}function im(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var o=P5.call(e);if(o!==P5.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=C5(e),t=C5(t);var l=o==="[object Array]";if(!l){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,f=t.constructor;if(u!==f&&!(Cn(u)&&u instanceof u&&Cn(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var h=n.length;h--;)if(n[h]===e)return i[h]===t;if(n.push(e),i.push(t),l){if(h=e.length,h!==t.length)return!1;for(;h--;)if(!im(e[h],t[h],r-1,n,i))return!1}else{var O=Object.keys(e),S;if(h=O.length,Object.keys(t).length!==h)return!1;for(;h--;)if(S=O[h],!(pa(t,S)&&im(e[S],t[S],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function C5(e){return Zr(e)?e.slice():Vs(e)||Rr(e)||ca(e)||Kr(e)?Array.from(e.entries()):e}function _c(e){return e[Symbol.iterator]=YC,e}function YC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=hy();typeof t[e]>"u"&&nt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:S8,extras:{getDebugName:gh},$mobx:Ke});const XC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ke,FlowCancellationError:Yh,ObservableMap:Jh,ObservableSet:Ty,Reaction:ks,_allowStateChanges:my,_allowStateChangesInsideComputed:As,_allowStateReadsEnd:bs,_allowStateReadsStart:Kh,_autoAction:Ts,_endAction:d8,_getAdministration:yi,_getGlobalState:v8,_interceptReads:Ey,_isComputingDerivation:WP,_resetGlobalState:ZP,_startAction:f8,action:ar,autorun:_y,comparer:sl,computed:gl,configure:R8,createAtom:yc,defineProperty:Py,entries:z8,extendObservable:Sy,flow:fl,flowResult:SC,get:CC,getAtom:qi,getDebugName:gh,getDependencyTree:M8,getObserverTree:mC,has:B8,intercept:Xh,isAction:zc,isBoxedObservable:yy,isComputed:xC,isComputedProp:D8,isFlow:Rs,isFlowCancellationError:_C,isObservable:Zh,isObservableArray:Zr,isObservableMap:Rr,isObservableObject:Er,isObservableProp:F8,isObservableSet:Kr,keys:bc,makeAutoObservable:IC,makeObservable:Cy,observable:Tt,observe:Qh,onBecomeObserved:T8,onBecomeUnobserved:wy,onReactionError:nC,override:lP,ownKeys:U8,reaction:k8,remove:PC,runInAction:As,set:xy,spy:S8,toJS:AC,trace:RC,transaction:ji,untracked:by,values:Oy,when:nm},Symbol.toStringTag,{value:"Module"}));if(!rt.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Cy)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function ZC(e){e()}function K8(e){e||(e=ZC),R8({reactionScheduler:e})}var QC=function(){return!0};function JC(e){return M8(e)}var Y8=!1;function X8(e){Y8=e}function My(){return Y8}var ek=1e4,tk=1e4,rk=function(){function e(t){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=ek),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,tk))}}),e}(),nk=typeof FinalizationRegistry<"u"?FinalizationRegistry:rk,vh=new nk(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),Z8={exports:{}},Q8={};/**
|
|
35
|
+
* @license React
|
|
36
|
+
* use-sync-external-store-shim.production.min.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var Ms=rt;function ik(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ak=typeof Object.is=="function"?Object.is:ik,ok=Ms.useState,lk=Ms.useEffect,sk=Ms.useLayoutEffect,uk=Ms.useDebugValue;function ck(e,t){var r=t(),n=ok({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return sk(function(){i.value=r,i.getSnapshot=t,B1(i)&&a({inst:i})},[e,r,t]),lk(function(){return B1(i)&&a({inst:i}),e(function(){B1(i)&&a({inst:i})})},[e]),uk(r),r}function B1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ak(e,r)}catch{return!0}}function fk(e,t){return t()}var dk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fk:ck;Q8.useSyncExternalStore=Ms.useSyncExternalStore!==void 0?Ms.useSyncExternalStore:dk;Z8.exports=Q8;var hk=Z8.exports;function k5(e){e.reaction=new ks("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function Ly(e,t){if(t===void 0&&(t="observed"),My())return e();var r=dt.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return vh.unregister(n),n.onStoreChange=l,n.reaction||(k5(n),n.stateVersion=Symbol()),function(){var u;n.onStoreChange=null,(u=n.reaction)===null||u===void 0||u.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var i=r.current;i.reaction||(k5(i),vh.register(r,i,i)),dt.useDebugValue(i.reaction,JC),hk.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(l){o=l}}),o)throw o;return a}var U1,H1,J8=typeof Symbol=="function"&&Symbol.for,pk=(H1=(U1=Object.getOwnPropertyDescriptor(function(){},"name"))===null||U1===void 0?void 0:U1.configurable)!==null&&H1!==void 0?H1:!1,T5=J8?Symbol.for("react.forward_ref"):typeof rt.forwardRef=="function"&&rt.forwardRef(function(e){return null}).$$typeof,A5=J8?Symbol.for("react.memo"):typeof rt.memo=="function"&&rt.memo(function(e){return null}).$$typeof;function gk(e,t){var r;if(A5&&e.$$typeof===A5)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(My())return e;var n=(r=t==null?void 0:t.forwardRef)!==null&&r!==void 0?r:!1,i=e,a=e.displayName||e.name;if(T5&&e.$$typeof===T5&&(n=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(l,u){return Ly(function(){return i(l,u)},a)};return o.displayName=e.displayName,pk&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=rt.forwardRef(o)),o=rt.memo(o),mk(e,o),o}var vk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function mk(e,t){Object.keys(e).forEach(function(r){vk[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function e9(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:Ly(n)}e9.displayName="Observer";function yk(e,t){return rt.useState(function(){return Tt(e(),t,{autoBind:!0})})[0]}function t9(e){var t=rt.useState(function(){return Tt(e,{},{deep:!1})})[0];return As(function(){Object.assign(t,e)}),t}function bk(e,t){var r=t&&t9(t);return rt.useState(function(){return Tt(e(r),void 0,{autoBind:!0})})[0]}var $1;K8(Vw.unstable_batchedUpdates);var _k=($1=vh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function wk(e,t){return t===void 0&&(t="observed"),Ly(e,t)}function Sk(e){X8(e)}const Ek=Object.freeze(Object.defineProperty({__proto__:null,Observer:e9,_observerFinalizationRegistry:vh,clearTimers:_k,enableStaticRendering:X8,isObserverBatched:QC,isUsingStaticRendering:My,observer:gk,observerBatching:K8,useAsObservableSource:t9,useLocalObservable:yk,useLocalStore:bk,useObserver:wk,useStaticRendering:Sk},Symbol.toStringTag,{value:"Module"})),Zn=mo(Ek);var r9={};const Yi=mo(XC);var Ny={exports:{}},ep={},mh={},ut={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof ve<"u"?ve:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.13",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var i;return(i=e.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const n=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=n,e.Konva._injectGlobal(e.Konva)})(ut);var Yt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ut;class r{constructor(g=[1,0,0,1,0,0]){this.dirty=!1,this.m=g&&g.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(g){g.m[0]=this.m[0],g.m[1]=this.m[1],g.m[2]=this.m[2],g.m[3]=this.m[3],g.m[4]=this.m[4],g.m[5]=this.m[5]}point(g){var w=this.m;return{x:w[0]*g.x+w[2]*g.y+w[4],y:w[1]*g.x+w[3]*g.y+w[5]}}translate(g,w){return this.m[4]+=this.m[0]*g+this.m[2]*w,this.m[5]+=this.m[1]*g+this.m[3]*w,this}scale(g,w){return this.m[0]*=g,this.m[1]*=g,this.m[2]*=w,this.m[3]*=w,this}rotate(g){var w=Math.cos(g),k=Math.sin(g),P=this.m[0]*w+this.m[2]*k,A=this.m[1]*w+this.m[3]*k,E=this.m[0]*-k+this.m[2]*w,x=this.m[1]*-k+this.m[3]*w;return this.m[0]=P,this.m[1]=A,this.m[2]=E,this.m[3]=x,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(g,w){var k=this.m[0]+this.m[2]*w,P=this.m[1]+this.m[3]*w,A=this.m[2]+this.m[0]*g,E=this.m[3]+this.m[1]*g;return this.m[0]=k,this.m[1]=P,this.m[2]=A,this.m[3]=E,this}multiply(g){var w=this.m[0]*g.m[0]+this.m[2]*g.m[1],k=this.m[1]*g.m[0]+this.m[3]*g.m[1],P=this.m[0]*g.m[2]+this.m[2]*g.m[3],A=this.m[1]*g.m[2]+this.m[3]*g.m[3],E=this.m[0]*g.m[4]+this.m[2]*g.m[5]+this.m[4],x=this.m[1]*g.m[4]+this.m[3]*g.m[5]+this.m[5];return this.m[0]=w,this.m[1]=k,this.m[2]=P,this.m[3]=A,this.m[4]=E,this.m[5]=x,this}invert(){var g=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),w=this.m[3]*g,k=-this.m[1]*g,P=-this.m[2]*g,A=this.m[0]*g,E=g*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),x=g*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=w,this.m[1]=k,this.m[2]=P,this.m[3]=A,this.m[4]=E,this.m[5]=x,this}getMatrix(){return this.m}decompose(){var g=this.m[0],w=this.m[1],k=this.m[2],P=this.m[3],A=this.m[4],E=this.m[5],x=g*P-w*k;let C={x:A,y:E,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(g!=0||w!=0){var R=Math.sqrt(g*g+w*w);C.rotation=w>0?Math.acos(g/R):-Math.acos(g/R),C.scaleX=R,C.scaleY=x/R,C.skewX=(g*k+w*P)/x,C.skewY=0}else if(k!=0||P!=0){var N=Math.sqrt(k*k+P*P);C.rotation=Math.PI/2-(P>0?Math.acos(-k/N):-Math.acos(k/N)),C.scaleX=x/N,C.scaleY=N,C.skewX=0,C.skewY=(g*k+w*P)/x}return C.rotation=e.Util._getRotation(C.rotation),C}}e.Transform=r;var n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,f="#",h="",O="0",S="Konva warning: ",b="Konva error: ",_="rgb(",y={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]},p=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,v=[];const m=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};e.Util={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===n},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===a},_isBoolean(d){return Object.prototype.toString.call(d)===o},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;var g=d[0];return g==="#"||g==="."||g===g.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){v.push(d),v.length===1&&m(function(){const g=v;v=[],g.forEach(function(w){w()})})},createCanvasElement(){var d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,g){var w=e.Util.createImageElement();w.onload=function(){g(w)},w.src=d},_rgbToHex(d,g,w){return((1<<24)+(d<<16)+(g<<8)+w).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,h);var g=parseInt(d,16);return{r:g>>16&255,g:g>>8&255,b:g&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=O+d;return f+d},getRGB(d){var g;return d in y?(g=y[d],{r:g[0],g:g[1],b:g[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===_?(g=p.exec(d.replace(/ /g,"")),{r:parseInt(g[1],10),g:parseInt(g[2],10),b:parseInt(g[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",e.Util._namedColorToRBA(d)||e.Util._hex3ColorToRGBA(d)||e.Util._hex4ColorToRGBA(d)||e.Util._hex6ColorToRGBA(d)||e.Util._hex8ColorToRGBA(d)||e.Util._rgbColorToRGBA(d)||e.Util._rgbaColorToRGBA(d)||e.Util._hslColorToRGBA(d)},_namedColorToRBA(d){var g=y[d.toLowerCase()];return g?{r:g[0],g:g[1],b:g[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var g=d.split(/ *, */).map(Number);return{r:g[0],g:g[1],b:g[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var g=d.split(/ *, */).map((w,k)=>w.slice(-1)==="%"?k===3?parseInt(w)/100:parseInt(w)/100*255:Number(w));return{r:g[0],g:g[1],b:g[2],a:g[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[g,...w]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),k=Number(w[0])/360,P=Number(w[1])/100,A=Number(w[2])/100;let E,x,C;if(P===0)return C=A*255,{r:Math.round(C),g:Math.round(C),b:Math.round(C),a:1};A<.5?E=A*(1+P):E=A+P-A*P;const R=2*A-E,N=[0,0,0];for(let U=0;U<3;U++)x=k+1/3*-(U-1),x<0&&x++,x>1&&x--,6*x<1?C=R+(E-R)*6*x:2*x<1?C=E:3*x<2?C=R+(E-R)*(2/3-x)*6:C=R,N[U]=C*255;return{r:Math.round(N[0]),g:Math.round(N[1]),b:Math.round(N[2]),a:1}}},haveIntersection(d,g){return!(g.x>d.x+d.width||g.x+g.width<d.x||g.y>d.y+d.height||g.y+g.height<d.y)},cloneObject(d){var g={};for(var w in d)this._isPlainObject(d[w])?g[w]=this.cloneObject(d[w]):this._isArray(d[w])?g[w]=this.cloneArray(d[w]):g[w]=d[w];return g},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*u},_degToRad(d){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(d)},_radToDeg(d){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(d)},_getRotation(d){return t.Konva.angleDeg?e.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(b+d)},error(d){console.error(b+d)},warn(d){t.Konva.showWarnings&&console.warn(S+d)},each(d,g){for(var w in d)g(w,d[w])},_inRange(d,g,w){return g<=d&&d<w},_getProjectionToSegment(d,g,w,k,P,A){var E,x,C,R=(d-w)*(d-w)+(g-k)*(g-k);if(R==0)E=d,x=g,C=(P-w)*(P-w)+(A-k)*(A-k);else{var N=((P-d)*(w-d)+(A-g)*(k-g))/R;N<0?(E=d,x=g,C=(d-P)*(d-P)+(g-A)*(g-A)):N>1?(E=w,x=k,C=(w-P)*(w-P)+(k-A)*(k-A)):(E=d+N*(w-d),x=g+N*(k-g),C=(E-P)*(E-P)+(x-A)*(x-A))}return[E,x,C]},_getProjectionToLine(d,g,w){var k=e.Util.cloneObject(d),P=Number.MAX_VALUE;return g.forEach(function(A,E){if(!(!w&&E===g.length-1)){var x=g[(E+1)%g.length],C=e.Util._getProjectionToSegment(A.x,A.y,x.x,x.y,d.x,d.y),R=C[0],N=C[1],U=C[2];U<P&&(k.x=R,k.y=N,P=U)}}),k},_prepareArrayForTween(d,g,w){var k,P=[],A=[];if(d.length>g.length){var E=g;g=d,d=E}for(k=0;k<d.length;k+=2)P.push({x:d[k],y:d[k+1]});for(k=0;k<g.length;k+=2)A.push({x:g[k],y:g[k+1]});var x=[];return A.forEach(function(C){var R=e.Util._getProjectionToLine(C,P,w);x.push(R.x),x.push(R.y)}),x},_prepareToStringify(d){var g;d.visitedByCircularReferenceRemoval=!0;for(var w in d)if(d.hasOwnProperty(w)&&d[w]&&typeof d[w]=="object"){if(g=Object.getOwnPropertyDescriptor(d,w),d[w].visitedByCircularReferenceRemoval||e.Util._isElement(d[w]))if(g.configurable)delete d[w];else return null;else if(e.Util._prepareToStringify(d[w])===null)if(g.configurable)delete d[w];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,g){for(var w in g)d[w]=g[w];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(g=>{g.width=0,g.height=0})},drawRoundedRectPath(d,g,w,k){let P=0,A=0,E=0,x=0;typeof k=="number"?P=A=E=x=Math.min(k,g/2,w/2):(P=Math.min(k[0]||0,g/2,w/2),A=Math.min(k[1]||0,g/2,w/2),x=Math.min(k[2]||0,g/2,w/2),E=Math.min(k[3]||0,g/2,w/2)),d.moveTo(P,0),d.lineTo(g-A,0),d.arc(g-A,A,A,Math.PI*3/2,0,!1),d.lineTo(g,w-x),d.arc(g-x,w-x,x,0,Math.PI/2,!1),d.lineTo(E,w),d.arc(E,w-E,E,Math.PI/2,Math.PI,!1),d.lineTo(0,P),d.arc(P,P,P,Math.PI,Math.PI*3/2,!1)}}})(Yt);var $t={},ct={},qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.getComponentValidator=qe.getBooleanValidator=qe.getNumberArrayValidator=qe.getFunctionValidator=qe.getStringOrGradientValidator=qe.getStringValidator=qe.getNumberOrAutoValidator=qe.getNumberOrArrayOfNumbersValidator=qe.getNumberValidator=qe.alphaComponent=qe.RGBComponent=void 0;const xa=ut,Qt=Yt;function Pa(e){return Qt.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Qt.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function Ok(e){return e>255?255:e<0?0:Math.round(e)}qe.RGBComponent=Ok;function xk(e){return e>1?1:e<1e-4?1e-4:e}qe.alphaComponent=xk;function Pk(){if(xa.Konva.isUnminified)return function(e,t){return Qt.Util._isNumber(e)||Qt.Util.warn(Pa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}qe.getNumberValidator=Pk;function Ck(e){if(xa.Konva.isUnminified)return function(t,r){let n=Qt.Util._isNumber(t),i=Qt.Util._isArray(t)&&t.length==e;return!n&&!i&&Qt.Util.warn(Pa(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}qe.getNumberOrArrayOfNumbersValidator=Ck;function kk(){if(xa.Konva.isUnminified)return function(e,t){var r=Qt.Util._isNumber(e),n=e==="auto";return r||n||Qt.Util.warn(Pa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}qe.getNumberOrAutoValidator=kk;function Tk(){if(xa.Konva.isUnminified)return function(e,t){return Qt.Util._isString(e)||Qt.Util.warn(Pa(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}qe.getStringValidator=Tk;function Ak(){if(xa.Konva.isUnminified)return function(e,t){const r=Qt.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||Qt.Util.warn(Pa(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}qe.getStringOrGradientValidator=Ak;function Rk(){if(xa.Konva.isUnminified)return function(e,t){return Qt.Util._isFunction(e)||Qt.Util.warn(Pa(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}qe.getFunctionValidator=Rk;function Mk(){if(xa.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(Qt.Util._isArray(e)?e.forEach(function(n){Qt.Util._isNumber(n)||Qt.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Qt.Util.warn(Pa(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}qe.getNumberArrayValidator=Mk;function Lk(){if(xa.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||Qt.Util.warn(Pa(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}qe.getBooleanValidator=Lk;function Nk(e){if(xa.Konva.isUnminified)return function(t,r){return t==null||Qt.Util.isObject(t)||Qt.Util.warn(Pa(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}qe.getComponentValidator=Nk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Yt,r=qe;var n="get",i="set";e.Factory={addGetterSetter(a,o,l,u,f){e.Factory.addGetter(a,o,l),e.Factory.addSetter(a,o,u,f),e.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){var u=n+t.Util._capitalize(o);a.prototype[u]=a.prototype[u]||function(){var f=this.attrs[o];return f===void 0?l:f}},addSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]||e.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var h=l.length,O=t.Util._capitalize,S=n+O(o),b=i+O(o),_,y;a.prototype[S]=function(){var v={};for(_=0;_<h;_++)y=l[_],v[y]=this.getAttr(o+O(y));return v};var p=(0,r.getComponentValidator)(l);a.prototype[b]=function(v){var m=this.attrs[o],d;u&&(v=u.call(this,v)),p&&p.call(this,v,o);for(d in v)v.hasOwnProperty(d)&&this._setAttr(o+O(d),v[d]);return v||l.forEach(g=>{this._setAttr(o+O(g),void 0)}),this._fireChangeEvent(o,m,v),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){var l=t.Util._capitalize(o),u=i+l,f=n+l;a.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(a,o,l,u){t.Util.error("Adding deprecated "+o);var f=n+t.Util._capitalize(o),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(h);var O=this.attrs[o];return O===void 0?l:O},e.Factory.addSetter(a,o,u,function(){t.Util.error(h)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],h=n+t.Util._capitalize(l),O=i+t.Util._capitalize(l);function S(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=S,a.prototype[h]=S,a.prototype[O]=S})},afterSetFilter(){this._filterUpToDate=!1}}})(ct);var vi={},va={};Object.defineProperty(va,"__esModule",{value:!0});va.HitContext=va.SceneContext=va.Context=void 0;const n9=Yt,Ik=ut;function Dk(e){var t=[],r=e.length,n=n9.Util,i,a;for(i=0;i<r;i++)a=e[i],n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),t.push(a);return t}var R5=",",jk="(",Fk=")",zk="([",Bk="])",Uk=";",Hk="()",$k="=",M5=["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"],Gk=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const Vk=100;class tp{constructor(t){this.canvas=t,Ik.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,r){var n=this.traceArr,i=n.length,a="",o,l,u,f;for(o=0;o<i;o++)l=n[o],u=l.method,u?(f=l.args,a+=u,t?a+=Hk:n9.Util._isArray(f[0])?a+=zk+f.join(R5)+Bk:(r&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),a+=jk+f.join(R5)+Fk)):(a+=l.property,t||(a+=$k+l.val)),a+=Uk;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=Vk&&r.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var r=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(t){const r=t.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(t){var r=t.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(t){const r=t.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(t,r){this._context[t]=r}arc(t,r,n,i,a,o){this._context.arc(t,r,n,i,a,o)}arcTo(t,r,n,i,a){this._context.arcTo(t,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(t,r,n,i,a,o){this._context.bezierCurveTo(t,r,n,i,a,o)}clearRect(t,r,n,i){this._context.clearRect(t,r,n,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,r){var n=arguments;if(n.length===2)return this._context.createImageData(t,r);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,r,n,i){return this._context.createLinearGradient(t,r,n,i)}createPattern(t,r){return this._context.createPattern(t,r)}createRadialGradient(t,r,n,i,a,o){return this._context.createRadialGradient(t,r,n,i,a,o)}drawImage(t,r,n,i,a,o,l,u,f){var h=arguments,O=this._context;h.length===3?O.drawImage(t,r,n):h.length===5?O.drawImage(t,r,n,i,a):h.length===9&&O.drawImage(t,r,n,i,a,o,l,u,f)}ellipse(t,r,n,i,a,o,l,u){this._context.ellipse(t,r,n,i,a,o,l,u)}isPointInPath(t,r,n,i){return n?this._context.isPointInPath(n,t,r,i):this._context.isPointInPath(t,r,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,r,n,i){this._context.fillRect(t,r,n,i)}strokeRect(t,r,n,i){this._context.strokeRect(t,r,n,i)}fillText(t,r,n,i){i?this._context.fillText(t,r,n,i):this._context.fillText(t,r,n)}measureText(t){return this._context.measureText(t)}getImageData(t,r,n,i){return this._context.getImageData(t,r,n,i)}lineTo(t,r){this._context.lineTo(t,r)}moveTo(t,r){this._context.moveTo(t,r)}rect(t,r,n,i){this._context.rect(t,r,n,i)}roundRect(t,r,n,i,a){this._context.roundRect(t,r,n,i,a)}putImageData(t,r,n){this._context.putImageData(t,r,n)}quadraticCurveTo(t,r,n,i){this._context.quadraticCurveTo(t,r,n,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,r){this._context.scale(t,r)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,r,n,i,a,o){this._context.setTransform(t,r,n,i,a,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,r,n,i){this._context.strokeText(t,r,n,i)}transform(t,r,n,i,a,o){this._context.transform(t,r,n,i,a,o)}translate(t,r){this._context.translate(t,r)}_enableTrace(){var t=this,r=M5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=Dk(Array.prototype.slice.call(arguments,0)),f=u.apply(t,arguments),t._trace({method:l,args:a}),f}};for(i=0;i<r;i++)o(M5[i]);t.setAttr=function(){n.apply(t,arguments);var l=arguments[0],u=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),t._trace({property:l,val:u})}}_applyGlobalCompositeOperation(t){const r=t.attrs.globalCompositeOperation;var n=!r||r==="source-over";n||this.setAttr("globalCompositeOperation",r)}}va.Context=tp;Gk.forEach(function(e){Object.defineProperty(tp.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class qk extends tp{constructor(t,{willReadFrequently:r=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(t){var r=t.fill();this.setAttr("fillStyle",r),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var r=t._getLinearGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fillRadialGradient(t){const r=t._getRadialGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fill(t){const r=t.fill(),n=t.getFillPriority();if(r&&n==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(t);return}const a=t.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}r?this._fillColor(t):i?this._fillPattern(t):a?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const r=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(var o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(t){var r=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),r&&t.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=t.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var r,n,i,a=(r=t.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,l=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=t.getAbsoluteScale(),f=this.canvas.getPixelRatio(),h=u.x*f,O=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(h),Math.abs(O))),this.setAttr("shadowOffsetX",l.x*h),this.setAttr("shadowOffsetY",l.y*O)}}va.SceneContext=qk;class Wk extends tp{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const a=t.getStrokeScaleEnabled();if(!a){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),i=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),a||this.restore()}}}va.HitContext=Wk;Object.defineProperty(vi,"__esModule",{value:!0});vi.HitCanvas=vi.SceneCanvas=vi.Canvas=void 0;const yh=Yt,i9=va,a9=ut,Kk=ct,Yk=qe;var pd;function Xk(){if(pd)return pd;var e=yh.Util.createCanvasElement(),t=e.getContext("2d");return pd=function(){var r=a9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),yh.Util.releaseCanvas(e),pd}class rp{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||a9.Konva.pixelRatio||Xk();this.pixelRatio=n,this._canvas=yh.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var r=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,r){this.setWidth(t||0),this.setHeight(r||0)}toDataURL(t,r){try{return this._canvas.toDataURL(t,r)}catch{try{return this._canvas.toDataURL()}catch(i){return yh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}vi.Canvas=rp;Kk.Factory.addGetterSetter(rp,"pixelRatio",void 0,(0,Yk.getNumberValidator)());class Zk extends rp{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new i9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}vi.SceneCanvas=Zk;class Qk extends rp{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new i9.HitContext(this),this.setSize(t.width,t.height)}}vi.HitCanvas=Qk;var np={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=ut,r=Yt;e.DD={get isDragging(){var n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const f=u._changedPointerPositions.find(S=>S.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var h=l.dragDistance(),O=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(O<h||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(h=>h.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const f=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(np);Object.defineProperty($t,"__esModule",{value:!0});$t.Node=void 0;const gt=Yt,Hc=ct,Mu=vi,Va=ut,Un=np,rr=qe;var Id="absoluteOpacity",gd="allEventListeners",la="absoluteTransform",L5="absoluteScale",$o="canvas",Jk="Change",eT="children",tT="konva",am="listening",N5="mouseenter",I5="mouseleave",D5="set",j5="Shape",Dd=" ",F5="stage",qa="transform",rT="Stage",om="visible",nT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Dd);let iT=1,lt=class lm{constructor(t){this._id=iT++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===qa||t===la)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,r){var n=this._cache.get(t),i=t===qa||t===la,a=n===void 0||i&&n.dirty===!0;return a&&(n=r.call(this),this._cache.set(t,n)),n}_calculate(t,r,n){if(!this._attachedDepsListeners.get(t)){const i=r.map(a=>a+"Change.konva").join(Dd);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get($o)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===la&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has($o)){const{scene:t,filter:r,hit:n}=this._cache.get($o);gt.Util.releaseCanvas(t,r,n),this._cache.delete($o)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var r=t||{},n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,l=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,f=r.offset||0,h=r.drawBorder||!1,O=r.hitCanvasPixelRatio||1;if(!i||!a){gt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const S=Math.abs(Math.round(n.x)-l)>.5?1:0,b=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+S,a+=f*2+b,l-=f,u-=f;var _=new Mu.SceneCanvas({pixelRatio:o,width:i,height:a}),y=new Mu.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),p=new Mu.HitCanvas({pixelRatio:O,width:i,height:a}),v=_.getContext(),m=p.getContext();return p.isCache=!0,_.isCache=!0,this._cache.delete($o),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(_.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),v.save(),m.save(),v.translate(-l,-u),m.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Id),this._clearSelfAndDescendantCache(L5),this.drawScene(_,this),this.drawHit(p,this),this._isUnderCache=!1,v.restore(),m.restore(),h&&(v.save(),v.beginPath(),v.rect(0,0,i,a),v.closePath(),v.setAttr("strokeStyle","red"),v.setAttr("lineWidth",5),v.stroke(),v.restore()),this._cache.set($o,{scene:_,filter:y,hit:p,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has($o)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,r){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i=1/0,a=1/0,o=-1/0,l=-1/0,u=this.getAbsoluteTransform(r);return n.forEach(function(f){var h=u.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();t.translate(r.x,r.y);var n=this._getCachedSceneCanvas(),i=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/i,n.height/i),t.restore()}_drawCachedHitCanvas(t){var r=this._getCanvasCache(),n=r.hit;t.save(),t.translate(r.x,r.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,l,u,f;if(t){if(!this._filterUpToDate){var h=n.pixelRatio;i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=t.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/h,n.getHeight()/h),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){gt.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),a.putImageData(l,0,0)}}catch(O){gt.Util.error("Unable to apply filter. "+O.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return n}on(t,r){if(this._cache&&this._cache.delete(gd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(Dd),i=n.length,a,o,l,u,f;for(a=0;a<i;a++)o=n[a],l=o.split("."),u=l[0],f=l[1]||"",this.eventListeners[u]||(this.eventListeners[u]=[]),this.eventListeners[u].push({name:f,handler:r});return this}off(t,r){var n=(t||"").split(Dd),i=n.length,a,o,l,u,f,h;if(this._cache&&this._cache.delete(gd),!t)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(l=n[a],u=l.split("."),f=u[0],h=u[1],f)this.eventListeners[f]&&this._off(f,h,r);else for(o in this.eventListeners)this._off(o,h,r);return this}dispatchEvent(t){var r={target:this,type:t.type,evt:t};return this.fire(t.type,r),this}addEventListener(t,r){return this.on(t,function(n){r.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,r,n){var i=this;this.on(t,function(a){for(var o=a.target.findAncestors(r,!0,i),l=0;l<o.length;l++)a=gt.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),Un.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(la),this._clearSelfAndDescendantCache(Id),this._clearSelfAndDescendantCache(L5),this._clearSelfAndDescendantCache(F5),this._clearSelfAndDescendantCache(om),this._clearSelfAndDescendantCache(am)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var r="get"+gt.Util._capitalize(t);return gt.Util._isFunction(this[r])?this[r]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),r=[];t;)r.push(t),t=t.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var r,n;if(!t)return this;for(r in t)r!==eT&&(n=D5+gt.Util._capitalize(r),gt.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(am,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(om,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,r=!1){if(t)return this._isVisible(t)&&this._isListening(t);var n=this.getLayer(),i=!1;Un.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!Va.Konva.hitOnDragEnabled&&(i||Va.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),r=this,n=0,i,a,o,l;function u(h){for(i=[],a=h.length,o=0;o<a;o++)l=h[o],n++,l.nodeType!==j5&&(i=i.concat(l.getChildren().slice())),l._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=t&&u(i)}const f=this.getStage();return r.nodeType!==rT&&f&&u(f.getChildren()),n}getDepth(){for(var t=0,r=this.parent;r;)t++,r=r.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(qa),this._clearSelfAndDescendantCache(la)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var r=t.getPointerPosition();if(!r)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(t){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),a=new gt.Transform,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(t){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache(qa);var a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(t.x,t.y),t={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache(qa),this._clearSelfAndDescendantCache(la),this}_setTransform(t){var r;for(r in t)this.attrs[r]=t[r]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var r=t.x,n=t.y,i=this.x(),a=this.y();return r!==void 0&&(i+=r),n!==void 0&&(a+=n),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(t,r){var n=[],i=this.getParent(),a,o;if(!(r&&r._id===this._id)){for(n.unshift(this);i&&(!r||i._id!==r._id);)n.unshift(i),i=i.parent;for(a=n.length,o=0;o<a;o++)t(n[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return gt.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return gt.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return gt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&>.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Id,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),r=this.getParent();return r&&!r._isUnderCache&&(t*=r.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),r,n,i,a,o;const l={attrs:{},className:this.getClassName()};for(r in t)n=t[r],o=gt.Util.isObject(n)&&!gt.Util._isPlainObject(n)&&!gt.Util._isArray(n),!o&&(i=typeof this[r]=="function"&&this[r],delete t[r],a=i?i.call(this):null,t[r]=n,a!==n&&(l.attrs[r]=n));return gt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,r,n){var i=[];r&&this._isMatch(t)&&i.push(this);for(var a=this.parent;a;){if(a===n)return i;a._isMatch(t)&&i.push(a),a=a.parent}return i}isAncestorOf(t){return!1}findAncestor(t,r,n){return this.findAncestors(t,r,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var r=t.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],gt.Util.isValidSelector(a)||(gt.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),gt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),gt.Util.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(F5,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,r={},n){return r.target=r.target||this,n?this._fireAndBubble(t,r):this._fire(t,r),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(la,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new gt.Transform,this._eachAncestorReverse(function(i){var a=i.transformsEnabled();a==="all"?r.multiply(i.getTransform()):a==="position"&&r.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),r;r=this._cache.get(la)||new gt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();var n=this.transformsEnabled();if(n==="all")r.multiply(this.getTransform());else if(n==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,l=this.attrs.offsetY||0;r.translate(i-o,a-l)}return r.dirty=!1,r}getAbsoluteScale(t){for(var r=this;r;)r._isUnderCache&&(t=r),r=r.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(qa,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(qa)||new gt.Transform;n.reset();var i=this.x(),a=this.y(),o=Va.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,f=this.attrs.skewX||0,h=this.attrs.skewY||0,O=this.attrs.offsetX||0,S=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||h!==0)&&n.skew(f,h),(l!==1||u!==1)&&n.scale(l,u),(O!==0||S!==0)&&n.translate(-1*O,-1*S),n.dirty=!1,n}clone(t){var r=gt.Util.cloneObject(this.attrs),n,i,a,o,l;for(n in t)r[n]=t[n];var u=new this.constructor(r);for(n in this.eventListeners)for(i=this.eventListeners[n],a=i.length,o=0;o<a;o++)l=i[o],l.name.indexOf(tT)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(l));return u}_toKonvaCanvas(t){t=t||{};var r=this.getClientRect(),n=this.getStage(),i=t.x!==void 0?t.x:Math.floor(r.x),a=t.y!==void 0?t.y:Math.floor(r.y),o=t.pixelRatio||1,l=new Mu.SceneCanvas({width:t.width||Math.ceil(r.width)||(n?n.width():0),height:t.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=l.getContext();const f=new Mu.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(a),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(l,void 0,f),u.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var r=t.mimeType||null,n=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(r,n);return t.callback&&t.callback(i),i}toImage(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,gt.Util._urlToImage(this.toDataURL(t),function(a){r(a),i==null||i(a)})}catch(i){n(i)}})}toBlob(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(a=>{r(a),i==null||i(a)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(i){n(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Va.Konva.dragDistance}_off(t,r,n){var i=this.eventListeners[t],a,o,l;for(a=0;a<i.length;a++)if(o=i[a].name,l=i[a].handler,(o!=="konva"||r==="konva")&&(!r||o===r)&&(!n||n===l)){if(i.splice(a,1),i.length===0){delete this.eventListeners[t];break}a--}}_fireChangeEvent(t,r,n){this._fire(t+Jk,{oldVal:r,newVal:n})}addName(t){if(!this.hasName(t)){var r=this.name(),n=r?r+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const r=this.name();if(!r)return!1;var n=(r||"").split(/\s/g);return n.indexOf(t)!==-1}removeName(t){var r=(this.name()||"").split(/\s/g),n=r.indexOf(t);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(t,r){var n=this[D5+gt.Util._capitalize(t)];return gt.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(Va.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!gt.Util.isObject(r)||(r==null?delete this.attrs[t]:this.attrs[t]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,r),this._requestDraw())}_setComponentAttr(t,r,n){var i;n!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][r]=n,this._fireChangeEvent(t,i,n))}_fireAndBubble(t,r,n){r&&this.nodeType===j5&&(r.target=this);var i=(t===N5||t===I5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===N5||t===I5)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!a&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,r,n):this._fireAndBubble.call(this.parent,t,r))}}_getProtoListeners(t){var r,n,i;const a=(r=this._cache.get(gd))!==null&&r!==void 0?r:{};let o=a==null?void 0:a[t];if(o===void 0){o=[];let l=Object.getPrototypeOf(this);for(;l;){const u=(i=(n=l.eventListeners)===null||n===void 0?void 0:n[t])!==null&&i!==void 0?i:[];o.push(...u),l=Object.getPrototypeOf(l)}a[t]=o,this._cache.set(gd,a)}return o}_fire(t,r){r=r||{},r.currentTarget=this,r.type=t;const n=this._getProtoListeners(t);if(n)for(var i=0;i<n.length;i++)n[i].handler.call(this,r);const a=this.eventListeners[t];if(a)for(var i=0;i<a.length;i++)a[i].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var r=t?t.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(n){var a=n._getPointerById(r)||n._changedPointerPositions[0]||i;Un.DD._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:r})}}startDrag(t,r=!0){Un.DD._dragElements.has(this._id)||this._createDragElement(t);const n=Un.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},r)}_setDragPosition(t,r){const n=this.getStage()._getPointerById(r.pointerId);if(n){var i={x:n.x-r.offset.x,y:n.y-r.offset.y},a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,t);o?i=o:gt.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const r=Un.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),Un.DD._endDragBefore(t),Un.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Un.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var r=t.evt.button!==void 0,n=!r||Va.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;Un.DD._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const r=Un.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&Un.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-t.x,y:-t.y,width:r.width()+2*t.x,height:r.height()+2*t.y};return gt.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return gt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=lm.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),Va.Konva[n]||(gt.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Va.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(lm._createNode(i[l]));return a}};$t.Node=lt;lt.prototype.nodeType="Node";lt.prototype._attrsAffectingSize=[];lt.prototype.eventListeners={};lt.prototype.on.call(lt.prototype,nT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(qa),this._clearSelfAndDescendantCache(la)});lt.prototype.on.call(lt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(om)});lt.prototype.on.call(lt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(am)});lt.prototype.on.call(lt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Id)});const Rt=Hc.Factory.addGetterSetter;Rt(lt,"zIndex");Rt(lt,"absolutePosition");Rt(lt,"position");Rt(lt,"x",0,(0,rr.getNumberValidator)());Rt(lt,"y",0,(0,rr.getNumberValidator)());Rt(lt,"globalCompositeOperation","source-over",(0,rr.getStringValidator)());Rt(lt,"opacity",1,(0,rr.getNumberValidator)());Rt(lt,"name","",(0,rr.getStringValidator)());Rt(lt,"id","",(0,rr.getStringValidator)());Rt(lt,"rotation",0,(0,rr.getNumberValidator)());Hc.Factory.addComponentsGetterSetter(lt,"scale",["x","y"]);Rt(lt,"scaleX",1,(0,rr.getNumberValidator)());Rt(lt,"scaleY",1,(0,rr.getNumberValidator)());Hc.Factory.addComponentsGetterSetter(lt,"skew",["x","y"]);Rt(lt,"skewX",0,(0,rr.getNumberValidator)());Rt(lt,"skewY",0,(0,rr.getNumberValidator)());Hc.Factory.addComponentsGetterSetter(lt,"offset",["x","y"]);Rt(lt,"offsetX",0,(0,rr.getNumberValidator)());Rt(lt,"offsetY",0,(0,rr.getNumberValidator)());Rt(lt,"dragDistance",null,(0,rr.getNumberValidator)());Rt(lt,"width",0,(0,rr.getNumberValidator)());Rt(lt,"height",0,(0,rr.getNumberValidator)());Rt(lt,"listening",!0,(0,rr.getBooleanValidator)());Rt(lt,"preventDefault",!0,(0,rr.getBooleanValidator)());Rt(lt,"filters",null,function(e){return this._filterUpToDate=!1,e});Rt(lt,"visible",!0,(0,rr.getBooleanValidator)());Rt(lt,"transformsEnabled","all",(0,rr.getStringValidator)());Rt(lt,"size");Rt(lt,"dragBoundFunc");Rt(lt,"draggable",!1,(0,rr.getBooleanValidator)());Hc.Factory.backCompat(lt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var yl={};Object.defineProperty(yl,"__esModule",{value:!0});yl.Container=void 0;const Ws=ct,G1=$t,ip=qe;class bl extends G1.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const r=this.children||[];var n=[];return r.forEach(function(i){t(i)&&n.push(i)}),n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var r=0;r<t.length;r++)this.add(t[r]);return this}const n=t[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var r=this._generalFind(t,!0);return r.length>0?r[0]:void 0}_generalFind(t,r){var n=[];return this._descendants(i=>{const a=i._isMatch(t);return a&&n.push(i),!!(a&&r)}),n}_descendants(t){let r=!1;const n=this.getChildren();for(const i of n){if(r=t(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(t),r))return!0}return!1}toObject(){var t=G1.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(r=>{t.children.push(r.toObject())}),t}isAncestorOf(t){for(var r=t.getParent();r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(t){var r=G1.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(t){var r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&r.push(n)}),r}_clearSelfAndDescendantCache(t){var r;super._clearSelfAndDescendantCache(t),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(t,r,n){var i=this.getLayer(),a=t||i&&i.getCanvas(),o=a&&a.getContext(),l=this._getCanvasCache(),u=l&&l.scene,f=a&&a.isCache;if(!this.isVisible()&&!f)return this;if(u){o.save();var h=this.getAbsoluteTransform(r).getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(t,r){if(!this.shouldDrawHit(r))return this;var n=this.getLayer(),i=t||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.hit;if(l){a.save();var u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(t,r,n,i){var a,o=r&&r.getContext(),l=this.clipWidth(),u=this.clipHeight(),f=this.clipFunc(),h=typeof l=="number"&&typeof u=="number"||f;const O=n===this;if(h){o.save();var S=this.getAbsoluteTransform(n),b=S.getMatrix();o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),o.beginPath();let v;if(f)v=f.call(this,o,this);else{var _=this.clipX(),y=this.clipY();o.rect(_||0,y||0,l,u)}o.clip.apply(o,v),b=S.copy().invert().getMatrix(),o.transform(b[0],b[1],b[2],b[3],b[4],b[5])}var p=!O&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";p&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(v){v[t](r,n,i)}),p&&o.restore(),h&&o.restore()}getClientRect(t={}){var r,n=t.skipTransform,i=t.relativeTo,a,o,l,u,f={x:1/0,y:1/0,width:0,height:0},h=this;(r=this.children)===null||r===void 0||r.forEach(function(y){if(y.visible()){var p=y.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});p.width===0&&p.height===0||(a===void 0?(a=p.x,o=p.y,l=p.x+p.width,u=p.y+p.height):(a=Math.min(a,p.x),o=Math.min(o,p.y),l=Math.max(l,p.x+p.width),u=Math.max(u,p.y+p.height)))}});for(var O=this.find("Shape"),S=!1,b=0;b<O.length;b++){var _=O[b];if(_._isVisible(this)){S=!0;break}}return S&&a!==void 0?f={x:a,y:o,width:l-a,height:u-o}:f={x:0,y:0,width:0,height:0},n?f:this._transformedRect(f,i)}}yl.Container=bl;Ws.Factory.addComponentsGetterSetter(bl,"clip",["x","y","width","height"]);Ws.Factory.addGetterSetter(bl,"clipX",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipY",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipWidth",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipHeight",void 0,(0,ip.getNumberValidator)());Ws.Factory.addGetterSetter(bl,"clipFunc");var o9={},En={};Object.defineProperty(En,"__esModule",{value:!0});En.releaseCapture=En.setPointerCapture=En.hasPointerCapture=En.createEvent=En.getCapturedShape=void 0;const aT=ut,wc=new Map,l9=aT.Konva._global.PointerEvent!==void 0;function oT(e){return wc.get(e)}En.getCapturedShape=oT;function Iy(e){return{evt:e,pointerId:e.pointerId}}En.createEvent=Iy;function lT(e,t){return wc.get(e)===t}En.hasPointerCapture=lT;function sT(e,t){s9(e),t.getStage()&&(wc.set(e,t),l9&&t._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}En.setPointerCapture=sT;function s9(e,t){const r=wc.get(e);if(!r)return;const n=r.getStage();n&&n.content,wc.delete(e),l9&&r._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}En.releaseCapture=s9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Yt,r=ct,n=yl,i=ut,a=vi,o=np,l=ut,u=En;var f="Stage",h="string",O="px",S="mouseout",b="mouseleave",_="mouseover",y="mouseenter",p="mousemove",v="mousedown",m="mouseup",d="pointermove",g="pointerdown",w="pointerup",k="pointercancel",P="lostpointercapture",A="pointerout",E="pointerleave",x="pointerover",C="pointerenter",R="contextmenu",N="touchstart",U="touchend",G="touchmove",Z="touchcancel",W="wheel",H=5,L=[[y,"_pointerenter"],[v,"_pointerdown"],[p,"_pointermove"],[m,"_pointerup"],[b,"_pointerleave"],[N,"_pointerdown"],[G,"_pointermove"],[U,"_pointerup"],[Z,"_pointercancel"],[_,"_pointerover"],[W,"_wheel"],[R,"_contextmenu"],[g,"_pointerdown"],[d,"_pointermove"],[w,"_pointerup"],[k,"_pointercancel"],[P,"_lostpointercapture"]];const M={mouse:{[A]:S,[E]:b,[x]:_,[C]:y,[d]:p,[g]:v,[w]:m,[k]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[A]:"touchout",[E]:"touchleave",[x]:"touchover",[C]:"touchenter",[d]:G,[g]:N,[w]:U,[k]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[A]:A,[E]:E,[x]:x,[C]:C,[d]:d,[g]:g,[w]:w,[k]:k,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},D=$=>$.indexOf("pointer")>=0?"pointer":$.indexOf("touch")>=0?"touch":"mouse",B=$=>{const F=D($);if(F==="pointer")return i.Konva.pointerEventsEnabled&&M.pointer;if(F==="touch")return M.touch;if(F==="mouse")return M.mouse};function q($={}){return($.clipFunc||$.clipWidth||$.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$}const K="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class z extends n.Container{constructor(F){super(q(F)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{q(this.attrs)}),this._checkVisibility()}_validateAdd(F){const Y=F.getType()==="Layer",X=F.getType()==="FastLayer";Y||X||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const F=this.visible()?"":"none";this.content.style.display=F}setContainer(F){if(typeof F===h){if(F.charAt(0)==="."){var Y=F.slice(1);F=document.getElementsByClassName(Y)[0]}else{var X;F.charAt(0)!=="#"?X=F:X=F.slice(1),F=document.getElementById(X)}if(!F)throw"Can not find container in document with id "+X}return this._setAttr("container",F),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),F.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var F=this.children,Y=F.length,X;for(X=0;X<Y;X++)F[X].clear();return this}clone(F){return F||(F={}),F.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,F)}destroy(){super.destroy();var F=this.content;F&&t.Util._isInDocument(F)&&this.container().removeChild(F);var Y=e.stages.indexOf(this);return Y>-1&&e.stages.splice(Y,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const F=this._pointerPositions[0]||this._changedPointerPositions[0];return F?{x:F.x,y:F.y}:(t.Util.warn(K),null)}_getPointerById(F){return this._pointerPositions.find(Y=>Y.id===F)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(F){F=F||{},F.x=F.x||0,F.y=F.y||0,F.width=F.width||this.width(),F.height=F.height||this.height();var Y=new a.SceneCanvas({width:F.width,height:F.height,pixelRatio:F.pixelRatio||1}),X=Y.getContext()._context,Q=this.children;return(F.x||F.y)&&X.translate(-1*F.x,-1*F.y),Q.forEach(function(J){if(J.isVisible()){var re=J._toKonvaCanvas(F);X.drawImage(re._canvas,F.x,F.y,re.getWidth()/re.getPixelRatio(),re.getHeight()/re.getPixelRatio())}}),Y}getIntersection(F){if(!F)return null;var Y=this.children,X=Y.length,Q=X-1,J;for(J=Q;J>=0;J--){const re=Y[J].getIntersection(F);if(re)return re}return null}_resizeDOM(){var F=this.width(),Y=this.height();this.content&&(this.content.style.width=F+O,this.content.style.height=Y+O),this.bufferCanvas.setSize(F,Y),this.bufferHitCanvas.setSize(F,Y),this.children.forEach(X=>{X.setSize({width:F,height:Y}),X.draw()})}add(F,...Y){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(F);var Q=this.children.length;return Q>H&&t.Util.warn("The stage has "+Q+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),F.setSize({width:this.width(),height:this.height()}),F.draw(),i.Konva.isBrowser&&this.content.appendChild(F.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(F){return u.hasPointerCapture(F,this)}setPointerCapture(F){u.setPointerCapture(F,this)}releaseCapture(F){u.releaseCapture(F,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&L.forEach(([F,Y])=>{this.content.addEventListener(F,X=>{this[Y](X)},{passive:!1})})}_pointerenter(F){this.setPointersPositions(F);const Y=B(F.type);Y&&this._fire(Y.pointerenter,{evt:F,target:this,currentTarget:this})}_pointerover(F){this.setPointersPositions(F);const Y=B(F.type);Y&&this._fire(Y.pointerover,{evt:F,target:this,currentTarget:this})}_getTargetShape(F){let Y=this[F+"targetShape"];return Y&&!Y.getStage()&&(Y=null),Y}_pointerleave(F){const Y=B(F.type),X=D(F.type);if(Y){this.setPointersPositions(F);var Q=this._getTargetShape(X),J=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&J?(Q._fireAndBubble(Y.pointerout,{evt:F}),Q._fireAndBubble(Y.pointerleave,{evt:F}),this._fire(Y.pointerleave,{evt:F,target:this,currentTarget:this}),this[X+"targetShape"]=null):J&&(this._fire(Y.pointerleave,{evt:F,target:this,currentTarget:this}),this._fire(Y.pointerout,{evt:F,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(F){const Y=B(F.type),X=D(F.type);if(Y){this.setPointersPositions(F);var Q=!1;this._changedPointerPositions.forEach(J=>{var re=this.getIntersection(J);if(o.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!re||!re.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&re.setPointerCapture(J.id),this[X+"ClickStartShape"]=re,re._fireAndBubble(Y.pointerdown,{evt:F,pointerId:J.id}),Q=!0;const ie=F.type.indexOf("touch")>=0;re.preventDefault()&&F.cancelable&&ie&&F.preventDefault()}),Q||this._fire(Y.pointerdown,{evt:F,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(F){const Y=B(F.type),X=D(F.type);if(!Y)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&F.cancelable&&F.preventDefault(),this.setPointersPositions(F);var Q=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!Q)return;var J={};let re=!1;var ie=this._getTargetShape(X);this._changedPointerPositions.forEach(ne=>{const ae=u.getCapturedShape(ne.id)||this.getIntersection(ne),ke=ne.id,Ae={evt:F,pointerId:ke};var oe=ie!==ae;if(oe&&ie&&(ie._fireAndBubble(Y.pointerout,{...Ae},ae),ie._fireAndBubble(Y.pointerleave,{...Ae},ae)),ae){if(J[ae._id])return;J[ae._id]=!0}ae&&ae.isListening()?(re=!0,oe&&(ae._fireAndBubble(Y.pointerover,{...Ae},ie),ae._fireAndBubble(Y.pointerenter,{...Ae},ie),this[X+"targetShape"]=ae),ae._fireAndBubble(Y.pointermove,{...Ae})):ie&&(this._fire(Y.pointerover,{evt:F,target:this,currentTarget:this,pointerId:ke}),this[X+"targetShape"]=null)}),re||this._fire(Y.pointermove,{evt:F,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(F){const Y=B(F.type),X=D(F.type);if(!Y)return;this.setPointersPositions(F);const Q=this[X+"ClickStartShape"],J=this[X+"ClickEndShape"];var re={};let ie=!1;this._changedPointerPositions.forEach(ne=>{const ae=u.getCapturedShape(ne.id)||this.getIntersection(ne);if(ae){if(ae.releaseCapture(ne.id),re[ae._id])return;re[ae._id]=!0}const ke=ne.id,Ae={evt:F,pointerId:ke};let oe=!1;i.Konva["_"+X+"InDblClickWindow"]?(oe=!0,clearTimeout(this[X+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),ae&&ae.isListening()?(ie=!0,this[X+"ClickEndShape"]=ae,ae._fireAndBubble(Y.pointerup,{...Ae}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===ae&&(ae._fireAndBubble(Y.pointerclick,{...Ae}),oe&&J&&J===ae&&ae._fireAndBubble(Y.pointerdblclick,{...Ae}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(Y.pointerclick,{evt:F,target:this,currentTarget:this,pointerId:ke}),oe&&this._fire(Y.pointerdblclick,{evt:F,target:this,currentTarget:this,pointerId:ke}))}),ie||this._fire(Y.pointerup,{evt:F,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,F.cancelable&&X!=="touch"&&F.preventDefault()}_contextmenu(F){this.setPointersPositions(F);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(R,{evt:F}):this._fire(R,{evt:F,target:this,currentTarget:this})}_wheel(F){this.setPointersPositions(F);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(W,{evt:F}):this._fire(W,{evt:F,target:this,currentTarget:this})}_pointercancel(F){this.setPointersPositions(F);const Y=u.getCapturedShape(F.pointerId)||this.getIntersection(this.getPointerPosition());Y&&Y._fireAndBubble(w,u.createEvent(F)),u.releaseCapture(F.pointerId)}_lostpointercapture(F){u.releaseCapture(F.pointerId)}setPointersPositions(F){var Y=this._getContentPosition(),X=null,Q=null;F=F||window.event,F.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(F.touches,J=>{this._pointerPositions.push({id:J.identifier,x:(J.clientX-Y.left)/Y.scaleX,y:(J.clientY-Y.top)/Y.scaleY})}),Array.prototype.forEach.call(F.changedTouches||F.touches,J=>{this._changedPointerPositions.push({id:J.identifier,x:(J.clientX-Y.left)/Y.scaleX,y:(J.clientY-Y.top)/Y.scaleY})})):(X=(F.clientX-Y.left)/Y.scaleX,Q=(F.clientY-Y.top)/Y.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(F)}],this._changedPointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(F)}])}_setPointerPosition(F){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(F)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var F=this.content.getBoundingClientRect();return{top:F.top,left:F.left,scaleX:F.width/this.content.clientWidth||1,scaleY:F.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var F=this.container();if(!F)throw"Stage has no container. A container is required.";F.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"),F.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(F){F.batchDraw()}),this}}e.Stage=z,z.prototype.nodeType=f,(0,l._registerNode)(z),r.Factory.addGetterSetter(z,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach($=>{$.batchDraw()})})})(o9);var $c={},gr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ut,r=Yt,n=ct,i=$t,a=qe,o=ut,l=En;var u="hasShadow",f="shadowRGBA",h="patternImage",O="linearGradient",S="radialGradient";let b;function _(){return b||(b=r.Util.createCanvasElement().getContext("2d"),b)}e.shapes={};function y(E){const x=this.attrs.fillRule;x?E.fill(x):E.fill()}function p(E){E.stroke()}function v(E){E.fill()}function m(E){E.stroke()}function d(){this._clearCache(u)}function g(){this._clearCache(f)}function w(){this._clearCache(h)}function k(){this._clearCache(O)}function P(){this._clearCache(S)}class A extends i.Node{constructor(x){super(x);let C;for(;C=r.Util.getRandomColor(),!(C&&!(C in e.shapes)););this.colorKey=C,e.shapes[C]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var x=_();const C=x.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(C&&C.setTransform){const R=new r.Transform;R.translate(this.fillPatternX(),this.fillPatternY()),R.rotate(t.Konva.getAngle(this.fillPatternRotation())),R.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),R.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const N=R.getMatrix(),U=typeof DOMMatrix>"u"?{a:N[0],b:N[1],c:N[2],d:N[3],e:N[4],f:N[5]}:new DOMMatrix(N);C.setTransform(U)}return C}}_getLinearGradient(){return this._getCache(O,this.__getLinearGradient)}__getLinearGradient(){var x=this.fillLinearGradientColorStops();if(x){for(var C=_(),R=this.fillLinearGradientStartPoint(),N=this.fillLinearGradientEndPoint(),U=C.createLinearGradient(R.x,R.y,N.x,N.y),G=0;G<x.length;G+=2)U.addColorStop(x[G],x[G+1]);return U}}_getRadialGradient(){return this._getCache(S,this.__getRadialGradient)}__getRadialGradient(){var x=this.fillRadialGradientColorStops();if(x){for(var C=_(),R=this.fillRadialGradientStartPoint(),N=this.fillRadialGradientEndPoint(),U=C.createRadialGradient(R.x,R.y,this.fillRadialGradientStartRadius(),N.x,N.y,this.fillRadialGradientEndRadius()),G=0;G<x.length;G+=2)U.addColorStop(x[G],x[G+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var x=r.Util.colorToRGBA(this.shadowColor());if(x)return"rgba("+x.r+","+x.g+","+x.b+","+x.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const x=this.hitStrokeWidth();return x==="auto"?this.hasStroke():this.strokeEnabled()&&!!x}intersects(x){var C=this.getStage();if(!C)return!1;const R=C.bufferHitCanvas;return R.getContext().clear(),this.drawHit(R,void 0,!0),R.context.getImageData(Math.round(x.x),Math.round(x.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(x){var C;if(!((C=this.attrs.perfectDrawEnabled)!==null&&C!==void 0?C:!0))return!1;const N=x||this.hasFill(),U=this.hasStroke(),G=this.getAbsoluteOpacity()!==1;if(N&&U&&G)return!0;const Z=this.hasShadow(),W=this.shadowForStrokeEnabled();return!!(N&&U&&Z&&W)}setStrokeHitEnabled(x){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),x?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var x=this.size();return{x:this._centroid?-x.width/2:0,y:this._centroid?-x.height/2:0,width:x.width,height:x.height}}getClientRect(x={}){let C=!1,R=this.getParent();for(;R;){if(R.isCached()){C=!0;break}R=R.getParent()}const N=x.skipTransform,U=x.relativeTo||C&&this.getStage()||void 0,G=this.getSelfRect(),W=!x.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,H=G.width+W,L=G.height+W,M=!x.skipShadow&&this.hasShadow(),D=M?this.shadowOffsetX():0,B=M?this.shadowOffsetY():0,q=H+Math.abs(D),K=L+Math.abs(B),z=M&&this.shadowBlur()||0,$=q+z*2,F=K+z*2,Y={width:$,height:F,x:-(W/2+z)+Math.min(D,0)+G.x,y:-(W/2+z)+Math.min(B,0)+G.y};return N?Y:this._transformedRect(Y,U)}drawScene(x,C,R){var N=this.getLayer(),U=x||N.getCanvas(),G=U.getContext(),Z=this._getCanvasCache(),W=this.getSceneFunc(),H=this.hasShadow(),L,M,D=U.isCache,B=C===this;if(!this.isVisible()&&!B)return this;if(Z){G.save();var q=this.getAbsoluteTransform(C).getMatrix();return G.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!W)return this;if(G.save(),this._useBufferCanvas()&&!D){L=this.getStage();const $=R||L.bufferCanvas;M=$.getContext(),M.clear(),M.save(),M._applyLineJoin(this);var K=this.getAbsoluteTransform(C).getMatrix();M.transform(K[0],K[1],K[2],K[3],K[4],K[5]),W.call(this,M,this),M.restore();var z=$.pixelRatio;H&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage($._canvas,0,0,$.width/z,$.height/z)}else{if(G._applyLineJoin(this),!B){var K=this.getAbsoluteTransform(C).getMatrix();G.transform(K[0],K[1],K[2],K[3],K[4],K[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}H&&G._applyShadow(this),W.call(this,G,this)}return G.restore(),this}drawHit(x,C,R=!1){if(!this.shouldDrawHit(C,R))return this;var N=this.getLayer(),U=x||N.hitCanvas,G=U&&U.getContext(),Z=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),H=W&&W.hit;if(this.colorKey||r.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),H){G.save();var L=this.getAbsoluteTransform(C).getMatrix();return G.transform(L[0],L[1],L[2],L[3],L[4],L[5]),this._drawCachedHitCanvas(G),G.restore(),this}if(!Z)return this;if(G.save(),G._applyLineJoin(this),!(this===C)){var D=this.getAbsoluteTransform(C).getMatrix();G.transform(D[0],D[1],D[2],D[3],D[4],D[5])}return Z.call(this,G,this),G.restore(),this}drawHitFromCache(x=0){var C=this._getCanvasCache(),R=this._getCachedSceneCanvas(),N=C.hit,U=N.getContext(),G=N.getWidth(),Z=N.getHeight(),W,H,L,M,D,B;U.clear(),U.drawImage(R._canvas,0,0,G,Z);try{for(W=U.getImageData(0,0,G,Z),H=W.data,L=H.length,M=r.Util._hexToRgb(this.colorKey),D=0;D<L;D+=4)B=H[D+3],B>x?(H[D]=M.r,H[D+1]=M.g,H[D+2]=M.b,H[D+3]=255):H[D+3]=0;U.putImageData(W,0,0)}catch(q){r.Util.error("Unable to draw hit graph from cached scene canvas. "+q.message)}return this}hasPointerCapture(x){return l.hasPointerCapture(x,this)}setPointerCapture(x){l.setPointerCapture(x,this)}releaseCapture(x){l.releaseCapture(x,this)}}e.Shape=A,A.prototype._fillFunc=y,A.prototype._strokeFunc=p,A.prototype._fillFuncHit=v,A.prototype._strokeFuncHit=m,A.prototype._centroid=!1,A.prototype.nodeType="Shape",(0,o._registerNode)(A),A.prototype.eventListeners={},A.prototype.on.call(A.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),A.prototype.on.call(A.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),A.prototype.on.call(A.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",w),A.prototype.on.call(A.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",k),A.prototype.on.call(A.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",P),n.Factory.addGetterSetter(A,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(A,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(A,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(A,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(A,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(A,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(A,"lineJoin"),n.Factory.addGetterSetter(A,"lineCap"),n.Factory.addGetterSetter(A,"sceneFunc"),n.Factory.addGetterSetter(A,"hitFunc"),n.Factory.addGetterSetter(A,"dash"),n.Factory.addGetterSetter(A,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(A,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(A,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(A,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternImage"),n.Factory.addGetterSetter(A,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(A,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(A,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(A,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(A,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(A,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(A,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(A,"fillEnabled",!0),n.Factory.addGetterSetter(A,"strokeEnabled",!0),n.Factory.addGetterSetter(A,"shadowEnabled",!0),n.Factory.addGetterSetter(A,"dashEnabled",!0),n.Factory.addGetterSetter(A,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(A,"fillPriority","color"),n.Factory.addComponentsGetterSetter(A,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(A,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(A,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(A,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(A,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(A,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(A,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(A,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(A,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(A,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(A,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(A,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(A,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(A,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(A,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(A,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(A,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(A,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(A,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(A,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(A,"fillPatternRotation",0),n.Factory.addGetterSetter(A,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(A,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(gr);Object.defineProperty($c,"__esModule",{value:!0});$c.Layer=void 0;const oa=Yt,V1=yl,Kl=$t,Dy=ct,z5=vi,uT=qe,cT=gr,fT=ut;var dT="#",hT="beforeDraw",pT="draw",u9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],gT=u9.length;let Ks=class extends V1.Container{constructor(t){super(t),this.canvas=new z5.SceneCanvas,this.hitCanvas=new z5.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),t<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[t+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Kl.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=Kl.Node.prototype.moveUp.call(this);if(!t)return!1;var r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Kl.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Kl.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return Kl.Node.prototype.remove.call(this),t&&t.parentNode&&oa.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:r}){return this.canvas.setSize(t,r),this.hitCanvas.setSize(t,r),this._setSmoothEnabled(),this}_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&oa.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Kl.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){oa.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){oa.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,oa.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var r=1,n=!1;;){for(let i=0;i<gT;i++){const a=u9[i],o=this._getIntersection({x:t.x+a.x*r,y:t.y+a.y*r}),l=o.shape;if(l)return l;if(n=!!o.antialiased,!o.antialiased)break}if(n)r+=1;else return null}}_getIntersection(t){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*r),Math.round(t.y*r),1,1).data,i=n[3];if(i===255){const a=oa.Util._rgbToHex(n[0],n[1],n[2]),o=cT.shapes[dT+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,r){var n=this.getLayer(),i=t||n&&n.getCanvas();return this._fire(hT,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,r),this._fire(pT,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),V1.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){oa.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return oa.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,r=!!this.hitCanvas._canvas.parentNode;r?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return oa.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};$c.Layer=Ks;Ks.prototype.nodeType="Layer";(0,fT._registerNode)(Ks);Dy.Factory.addGetterSetter(Ks,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Ks,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Ks,"hitGraphEnabled",!0,(0,uT.getBooleanValidator)());var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.FastLayer=void 0;const vT=Yt,mT=$c,yT=ut;let jy=class extends mT.Layer{constructor(t){super(t),this.listening(!1),vT.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};ap.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,yT._registerNode)(jy);var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.Group=void 0;const bT=Yt,_T=yl,wT=ut;let Fy=class extends _T.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&bT.Util.throw("You may only add groups and shapes to groups.")}};Ys.Group=Fy;Fy.prototype.nodeType="Group";(0,wT._registerNode)(Fy);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.Animation=void 0;const q1=ut,B5=Yt,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class Fi{constructor(t,r){this.id=Fi.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:W1(),frameRate:0},this.func=t,this.setLayers(r)}setLayers(t){let r=[];return t&&(r=Array.isArray(t)?t:[t]),this.layers=r,this}getLayers(){return this.layers}addLayer(t){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const r=Fi.animations,n=r.length;for(let i=0;i<n;i++)if(r[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=W1(),Fi._addAnimation(this),this}stop(){return Fi._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const r=t.id,n=this.animations,i=n.length;for(let a=0;a<i;a++)if(n[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const t={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject(W1());const l=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let f=0;f<l;f++){const h=a[f];h._id!==void 0&&(t[h._id]=h)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=Fi;t.animations.length?(t._runFrames(),B5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,B5.Util.requestAnimFrame(this._animationLoop))}}Xs.Animation=Fi;Fi.animations=[];Fi.animIdCounter=0;Fi.animRunning=!1;var c9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Yt,r=Xs,n=$t,i=ut;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,h=["fill","stroke","shadowColor"];class O{constructor(_,y,p,v,m,d,g){this.prop=_,this.propFunc=y,this.begin=v,this._pos=v,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=g,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=p,this._change=m-this.begin,this.pause()}fire(_){var y=this[_];y&&y()}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=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(_){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(){var _=this.getTimer()-this._startTime;this.state===l?this.setTime(_):this.state===u&&this.setTime(this.duration-_)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class S{constructor(_){var y=this,p=_.node,v=p._id,m,d=_.easing||e.Easings.Linear,g=!!_.yoyo,w;typeof _.duration>"u"?m=.3:_.duration===0?m=.001:m=_.duration,this.node=p,this._id=f++;var k=p.getLayer()||(p instanceof i.Konva.Stage?p.getLayers():null);k||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){y.tween.onEnterFrame()},k),this.tween=new O(w,function(P){y._tweenFunc(P)},d,0,1,m*1e3,g),this._addListeners(),S.attrs[v]||(S.attrs[v]={}),S.attrs[v][this._id]||(S.attrs[v][this._id]={}),S.tweens[v]||(S.tweens[v]={});for(w in _)a[w]===void 0&&this._addAttr(w,_[w]);this.reset(),this.onFinish=_.onFinish,this.onReset=_.onReset,this.onUpdate=_.onUpdate}_addAttr(_,y){var p=this.node,v=p._id,m,d,g,w,k,P,A,E;if(g=S.tweens[v][_],g&&delete S.attrs[v][g][_],m=p.getAttr(_),t.Util._isArray(y))if(d=[],k=Math.max(y.length,m.length),_==="points"&&y.length!==m.length&&(y.length>m.length?(A=m,m=t.Util._prepareArrayForTween(m,y,p.closed())):(P=y,y=t.Util._prepareArrayForTween(y,m,p.closed()))),_.indexOf("fill")===0)for(w=0;w<k;w++)if(w%2===0)d.push(y[w]-m[w]);else{var x=t.Util.colorToRGBA(m[w]);E=t.Util.colorToRGBA(y[w]),m[w]=x,d.push({r:E.r-x.r,g:E.g-x.g,b:E.b-x.b,a:E.a-x.a})}else for(w=0;w<k;w++)d.push(y[w]-m[w]);else h.indexOf(_)!==-1?(m=t.Util.colorToRGBA(m),E=t.Util.colorToRGBA(y),d={r:E.r-m.r,g:E.g-m.g,b:E.b-m.b,a:E.a-m.a}):d=y-m;S.attrs[v][this._id][_]={start:m,diff:d,end:y,trueEnd:P,trueStart:A},S.tweens[v][_]=this._id}_tweenFunc(_){var y=this.node,p=S.attrs[y._id][this._id],v,m,d,g,w,k,P,A;for(v in p){if(m=p[v],d=m.start,g=m.diff,A=m.end,t.Util._isArray(d))if(w=[],P=Math.max(d.length,A.length),v.indexOf("fill")===0)for(k=0;k<P;k++)k%2===0?w.push((d[k]||0)+g[k]*_):w.push("rgba("+Math.round(d[k].r+g[k].r*_)+","+Math.round(d[k].g+g[k].g*_)+","+Math.round(d[k].b+g[k].b*_)+","+(d[k].a+g[k].a*_)+")");else for(k=0;k<P;k++)w.push((d[k]||0)+g[k]*_);else h.indexOf(v)!==-1?w="rgba("+Math.round(d.r+g.r*_)+","+Math.round(d.g+g.g*_)+","+Math.round(d.b+g.b*_)+","+(d.a+g.a*_)+")":w=d+g*_;y.setAttr(v,w)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var _=this.node,y=S.attrs[_._id][this._id];y.points&&y.points.trueEnd&&_.setAttr("points",y.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var _=this.node,y=S.attrs[_._id][this._id];y.points&&y.points.trueStart&&_.points(y.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(){var _=this.node._id,y=this._id,p=S.tweens[_],v;this.pause();for(v in p)delete S.tweens[_][v];delete S.attrs[_][y]}}e.Tween=S,S.attrs={},S.tweens={},n.Node.prototype.to=function(b){var _=b.onFinish;b.node=this,b.onFinish=function(){this.destroy(),_&&_()};var y=new S(b);y.play()},e.Easings={BackEaseIn(b,_,y,p){var v=1.70158;return y*(b/=p)*b*((v+1)*b-v)+_},BackEaseOut(b,_,y,p){var v=1.70158;return y*((b=b/p-1)*b*((v+1)*b+v)+1)+_},BackEaseInOut(b,_,y,p){var v=1.70158;return(b/=p/2)<1?y/2*(b*b*(((v*=1.525)+1)*b-v))+_:y/2*((b-=2)*b*(((v*=1.525)+1)*b+v)+2)+_},ElasticEaseIn(b,_,y,p,v,m){var d=0;return b===0?_:(b/=p)===1?_+y:(m||(m=p*.3),!v||v<Math.abs(y)?(v=y,d=m/4):d=m/(2*Math.PI)*Math.asin(y/v),-(v*Math.pow(2,10*(b-=1))*Math.sin((b*p-d)*(2*Math.PI)/m))+_)},ElasticEaseOut(b,_,y,p,v,m){var d=0;return b===0?_:(b/=p)===1?_+y:(m||(m=p*.3),!v||v<Math.abs(y)?(v=y,d=m/4):d=m/(2*Math.PI)*Math.asin(y/v),v*Math.pow(2,-10*b)*Math.sin((b*p-d)*(2*Math.PI)/m)+y+_)},ElasticEaseInOut(b,_,y,p,v,m){var d=0;return b===0?_:(b/=p/2)===2?_+y:(m||(m=p*(.3*1.5)),!v||v<Math.abs(y)?(v=y,d=m/4):d=m/(2*Math.PI)*Math.asin(y/v),b<1?-.5*(v*Math.pow(2,10*(b-=1))*Math.sin((b*p-d)*(2*Math.PI)/m))+_:v*Math.pow(2,-10*(b-=1))*Math.sin((b*p-d)*(2*Math.PI)/m)*.5+y+_)},BounceEaseOut(b,_,y,p){return(b/=p)<1/2.75?y*(7.5625*b*b)+_:b<2/2.75?y*(7.5625*(b-=1.5/2.75)*b+.75)+_:b<2.5/2.75?y*(7.5625*(b-=2.25/2.75)*b+.9375)+_:y*(7.5625*(b-=2.625/2.75)*b+.984375)+_},BounceEaseIn(b,_,y,p){return y-e.Easings.BounceEaseOut(p-b,0,y,p)+_},BounceEaseInOut(b,_,y,p){return b<p/2?e.Easings.BounceEaseIn(b*2,0,y,p)*.5+_:e.Easings.BounceEaseOut(b*2-p,0,y,p)*.5+y*.5+_},EaseIn(b,_,y,p){return y*(b/=p)*b+_},EaseOut(b,_,y,p){return-y*(b/=p)*(b-2)+_},EaseInOut(b,_,y,p){return(b/=p/2)<1?y/2*b*b+_:-y/2*(--b*(b-2)-1)+_},StrongEaseIn(b,_,y,p){return y*(b/=p)*b*b*b*b+_},StrongEaseOut(b,_,y,p){return y*((b=b/p-1)*b*b*b*b+1)+_},StrongEaseInOut(b,_,y,p){return(b/=p/2)<1?y/2*b*b*b*b*b+_:y/2*((b-=2)*b*b*b*b+2)+_},Linear(b,_,y,p){return y*b/p+_}}})(c9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=ut,r=Yt,n=$t,i=yl,a=o9,o=$c,l=ap,u=Ys,f=np,h=gr,O=Xs,S=c9,b=va,_=vi;e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:l.FastLayer,Group:u.Group,DD:f.DD,Shape:h.Shape,shapes:h.shapes,Animation:O.Animation,Tween:S.Tween,Easings:S.Easings,Context:b.Context,Canvas:_.Canvas}),e.default=e.Konva})(mh);var op={};Object.defineProperty(op,"__esModule",{value:!0});op.Arc=void 0;const lp=ct,ST=gr,U5=ut,sp=qe,ET=ut;let Ca=class extends ST.Shape{_sceneFunc(t){var r=U5.Konva.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,r,n),t.arc(0,0,this.innerRadius(),r,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=U5.Konva.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),f=a*(a>0?t:r),h=o*r,O=l*(l>0?t:r),S=u*(u>0?r:t);return{x:f,y:n?-1*S:O,width:h-f,height:S-O}}};op.Arc=Ca;Ca.prototype._centroid=!0;Ca.prototype.className="Arc";Ca.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ET._registerNode)(Ca);lp.Factory.addGetterSetter(Ca,"innerRadius",0,(0,sp.getNumberValidator)());lp.Factory.addGetterSetter(Ca,"outerRadius",0,(0,sp.getNumberValidator)());lp.Factory.addGetterSetter(Ca,"angle",0,(0,sp.getNumberValidator)());lp.Factory.addGetterSetter(Ca,"clockwise",!1,(0,sp.getBooleanValidator)());var up={},Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.Line=void 0;const cp=ct,OT=gr,f9=qe,xT=ut;function sm(e,t,r,n,i,a,o){var l=Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),f=o*l/(l+u),h=o*u/(l+u),O=r-f*(i-e),S=n-f*(a-t),b=r+h*(i-e),_=n+h*(a-t);return[O,S,b,_]}function H5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=sm(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(a[0])&&(n.push(a[0]),n.push(a[1]),n.push(e[i]),n.push(e[i+1]),n.push(a[2]),n.push(a[3]));return n}let Eo=class extends OT.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier(),l,u,f;if(n){if(t.beginPath(),t.moveTo(r[0],r[1]),i!==0&&n>4){for(l=this.getTensionPoints(),u=l.length,f=a?0:4,a||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<u-2;)t.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);a||t.quadraticCurveTo(l[u-2],l[u-1],r[n-2],r[n-1])}else if(o)for(f=2;f<n;)t.bezierCurveTo(r[f++],r[f++],r[f++],r[f++],r[f++],r[f++]);else for(f=2;f<n;f+=2)t.lineTo(r[f],r[f+1]);a?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():H5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=sm(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=sm(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=H5(t,n),l=[i[2],i[3]].concat(o).concat([a[0],a[1],t[r-2],t[r-1],a[2],a[3],i[0],i[1],t[0],t[1]]);return l}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);return{x:r,y:i,width:n-r,height:a-i}}};Gc.Line=Eo;Eo.prototype.className="Line";Eo.prototype._attrsAffectingSize=["points","bezier","tension"];(0,xT._registerNode)(Eo);cp.Factory.addGetterSetter(Eo,"closed",!1);cp.Factory.addGetterSetter(Eo,"bezier",!1);cp.Factory.addGetterSetter(Eo,"tension",0,(0,f9.getNumberValidator)());cp.Factory.addGetterSetter(Eo,"points",[],(0,f9.getNumberArrayValidator)());var Zs={},d9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(o,l,u)=>{let f,h,O;f=u/2,h=0;for(let b=0;b<20;b++)O=f*e.tValues[20][b]+f,h+=e.cValues[20][b]*n(o,l,O);return f*h};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],h=l[0]-2*l[1]+l[2],O=2*o[1]-2*o[0],S=2*l[1]-2*l[0],b=4*(f*f+h*h),_=4*(f*O+h*S),y=O*O+S*S;if(b===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const p=_/(2*b),v=y/b,m=u+p,d=v-p*p,g=m*m+d>0?Math.sqrt(m*m+d):0,w=p*p+d>0?Math.sqrt(p*p+d):0,k=p+Math.sqrt(p*p+d)!==0?d*Math.log(Math.abs((m+g)/(p+w))):0;return Math.sqrt(b)/2*(m*g-p*w+k)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),h=i(1,u,l),O=f*f+h*h;return Math.sqrt(O)}const i=(o,l,u)=>{const f=u.length-1;let h,O;if(f===0)return 0;if(o===0){O=0;for(let S=0;S<=f;S++)O+=e.binomialCoefficients[f][S]*Math.pow(1-l,f-S)*Math.pow(l,S)*u[S];return O}else{h=new Array(f);for(let S=0;S<f;S++)h[S]=f*(u[S+1]-u[S]);return i(o-1,l,h)}},a=(o,l,u)=>{let f=1,h=o/l,O=(o-u(h))/l,S=0;for(;f>.001;){const b=u(h+O),_=Math.abs(o-b)/l;if(_<f)f=_,h+=O;else{const y=u(h-O),p=Math.abs(o-y)/l;p<f?(f=p,h-=O):O/=2}if(S++,S>500)break}return h};e.t2length=a})(d9);Object.defineProperty(Zs,"__esModule",{value:!0});Zs.Path=void 0;const PT=ct,CT=gr,kT=ut,Yl=d9;let Vc=class ln extends CT.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=ln.parsePathData(this.data()),this.pathLength=ln.getPathLength(this.dataArray)}_sceneFunc(t){var r=this.dataArray;t.beginPath();for(var n=!1,i=0;i<r.length;i++){var a=r[i].command,o=r[i].points;switch(a){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var l=o[0],u=o[1],f=o[2],h=o[3],O=o[4],S=o[5],b=o[6],_=o[7],y=f>h?f:h,p=f>h?1:f/h,v=f>h?h/f:1;t.translate(l,u),t.rotate(b),t.scale(p,v),t.arc(0,0,y,O,O+S,1-_),t.scale(1/p,1/v),t.rotate(-b),t.translate(-l,-u);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(f){if(f.command==="A"){var h=f.points[4],O=f.points[5],S=f.points[4]+O,b=Math.PI/180;if(Math.abs(h-S)<b&&(b=Math.abs(h-S)),O<0)for(let _=h-b;_>S;_-=b){const y=ln.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],_,0);t.push(y.x,y.y)}else for(let _=h+b;_<S;_+=b){const y=ln.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],_,0);t.push(y.x,y.y)}}else if(f.command==="C")for(let _=0;_<=1;_+=.01){const y=ln.getPointOnCubicBezier(_,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);t.push(y.x,y.y)}else t=t.concat(f.points)});for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(l)||(i=Math.min(i,l),a=Math.max(a,l));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return ln.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,r,n,i){return Math.sqrt((n-t)*(n-t)+(i-r)*(i-r))}static getPathLength(t){let r=0;for(var n=0;n<t.length;++n)r+=t[n].pathLength;return r}static getPointAtLengthOfDataArray(t,r){var n,i=0,a=r.length;if(!a)return null;for(;i<a&&t>r[i].pathLength;)t-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=r[i].points.slice(0,2),{x:n[0],y:n[1]};var o=r[i],l=o.points;switch(o.command){case"L":return ln.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return ln.getPointOnCubicBezier((0,Yl.t2length)(t,ln.getPathLength(r),y=>(0,Yl.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],y)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return ln.getPointOnQuadraticBezier((0,Yl.t2length)(t,ln.getPathLength(r),y=>(0,Yl.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],y)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],h=l[2],O=l[3],S=l[4],b=l[5],_=l[6];return S+=b*t/o.pathLength,ln.getPointOnEllipticalArc(u,f,h,O,S,_)}return null}static getPointOnLine(t,r,n,i,a,o,l){o=o??r,l=l??n;const u=this.getLineLength(r,n,i,a);if(u<1e-10)return{x:r,y:n};if(i===r)return{x:o,y:l+(a>n?t:-t)};const f=(a-n)/(i-r),h=Math.sqrt(t*t/(1+f*f))*(i<r?-1:1),O=f*h;if(Math.abs(l-n-f*(o-r))<1e-10)return{x:o+h,y:l+O};const S=((o-r)*(i-r)+(l-n)*(a-n))/(u*u),b=r+S*(i-r),_=n+S*(a-n),y=this.getLineLength(o,l,b,_),p=Math.sqrt(t*t-y*y),v=Math.sqrt(p*p/(1+f*f))*(i<r?-1:1),m=f*v;return{x:b+v,y:_+m}}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function h(p){return p*p*p}function O(p){return 3*p*p*(1-p)}function S(p){return 3*p*(1-p)*(1-p)}function b(p){return(1-p)*(1-p)*(1-p)}var _=u*h(t)+o*O(t)+i*S(t)+r*b(t),y=f*h(t)+l*O(t)+a*S(t)+n*b(t);return{x:_,y}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(b){return b*b}function f(b){return 2*b*(1-b)}function h(b){return(1-b)*(1-b)}var O=o*u(t)+i*f(t)+r*h(t),S=l*u(t)+a*f(t)+n*h(t);return{x:O,y:S}}static getPointOnEllipticalArc(t,r,n,i,a,o){var l=Math.cos(o),u=Math.sin(o),f={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:t+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(t){if(!t)return[];var r=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var i=0;i<n.length;i++)r=r.replace(new RegExp(n[i],"g"),"|"+n[i]);var a=r.split("|"),o=[],l=[],u=0,f=0,h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,O;for(i=1;i<a.length;i++){var S=a[i],b=S.charAt(0);for(S=S.slice(1),l.length=0;O=h.exec(S);)l.push(O[0]);for(var _=[],y=0,p=l.length;y<p;y++){if(l[y]==="00"){_.push(0,0);continue}var v=parseFloat(l[y]);isNaN(v)?_.push(0):_.push(v)}for(;_.length>0&&!isNaN(_[0]);){var m="",d=[],g=u,w=f,k,P,A,E,x,C,R,N,U,G;switch(b){case"l":u+=_.shift(),f+=_.shift(),m="L",d.push(u,f);break;case"L":u=_.shift(),f=_.shift(),d.push(u,f);break;case"m":var Z=_.shift(),W=_.shift();if(u+=Z,f+=W,m="M",o.length>2&&o[o.length-1].command==="z"){for(var H=o.length-2;H>=0;H--)if(o[H].command==="M"){u=o[H].points[0]+Z,f=o[H].points[1]+W;break}}d.push(u,f),b="l";break;case"M":u=_.shift(),f=_.shift(),m="M",d.push(u,f),b="L";break;case"h":u+=_.shift(),m="L",d.push(u,f);break;case"H":u=_.shift(),m="L",d.push(u,f);break;case"v":f+=_.shift(),m="L",d.push(u,f);break;case"V":f=_.shift(),m="L",d.push(u,f);break;case"C":d.push(_.shift(),_.shift(),_.shift(),_.shift()),u=_.shift(),f=_.shift(),d.push(u,f);break;case"c":d.push(u+_.shift(),f+_.shift(),u+_.shift(),f+_.shift()),u+=_.shift(),f+=_.shift(),m="C",d.push(u,f);break;case"S":P=u,A=f,k=o[o.length-1],k.command==="C"&&(P=u+(u-k.points[2]),A=f+(f-k.points[3])),d.push(P,A,_.shift(),_.shift()),u=_.shift(),f=_.shift(),m="C",d.push(u,f);break;case"s":P=u,A=f,k=o[o.length-1],k.command==="C"&&(P=u+(u-k.points[2]),A=f+(f-k.points[3])),d.push(P,A,u+_.shift(),f+_.shift()),u+=_.shift(),f+=_.shift(),m="C",d.push(u,f);break;case"Q":d.push(_.shift(),_.shift()),u=_.shift(),f=_.shift(),d.push(u,f);break;case"q":d.push(u+_.shift(),f+_.shift()),u+=_.shift(),f+=_.shift(),m="Q",d.push(u,f);break;case"T":P=u,A=f,k=o[o.length-1],k.command==="Q"&&(P=u+(u-k.points[0]),A=f+(f-k.points[1])),u=_.shift(),f=_.shift(),m="Q",d.push(P,A,u,f);break;case"t":P=u,A=f,k=o[o.length-1],k.command==="Q"&&(P=u+(u-k.points[0]),A=f+(f-k.points[1])),u+=_.shift(),f+=_.shift(),m="Q",d.push(P,A,u,f);break;case"A":E=_.shift(),x=_.shift(),C=_.shift(),R=_.shift(),N=_.shift(),U=u,G=f,u=_.shift(),f=_.shift(),m="A",d=this.convertEndpointToCenterParameterization(U,G,u,f,R,N,E,x,C);break;case"a":E=_.shift(),x=_.shift(),C=_.shift(),R=_.shift(),N=_.shift(),U=u,G=f,u+=_.shift(),f+=_.shift(),m="A",d=this.convertEndpointToCenterParameterization(U,G,u,f,R,N,E,x,C);break}o.push({command:m||b,points:d,start:{x:g,y:w},pathLength:this.calcLength(g,w,m||b,d)})}(b==="z"||b==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,r,n,i){var a,o,l,u,f=ln;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,Yl.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,Yl.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var h=i[4],O=i[5],S=i[4]+O,b=Math.PI/180;if(Math.abs(h-S)<b&&(b=Math.abs(h-S)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),O<0)for(u=h-b;u>S;u-=b)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=h+b;u<S;u+=b)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],S,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(t,r,n,i,a,o,l,u,f){var h=f*(Math.PI/180),O=Math.cos(h)*(t-n)/2+Math.sin(h)*(r-i)/2,S=-1*Math.sin(h)*(t-n)/2+Math.cos(h)*(r-i)/2,b=O*O/(l*l)+S*S/(u*u);b>1&&(l*=Math.sqrt(b),u*=Math.sqrt(b));var _=Math.sqrt((l*l*(u*u)-l*l*(S*S)-u*u*(O*O))/(l*l*(S*S)+u*u*(O*O)));a===o&&(_*=-1),isNaN(_)&&(_=0);var y=_*l*S/u,p=_*-u*O/l,v=(t+n)/2+Math.cos(h)*y-Math.sin(h)*p,m=(r+i)/2+Math.sin(h)*y+Math.cos(h)*p,d=function(x){return Math.sqrt(x[0]*x[0]+x[1]*x[1])},g=function(x,C){return(x[0]*C[0]+x[1]*C[1])/(d(x)*d(C))},w=function(x,C){return(x[0]*C[1]<x[1]*C[0]?-1:1)*Math.acos(g(x,C))},k=w([1,0],[(O-y)/l,(S-p)/u]),P=[(O-y)/l,(S-p)/u],A=[(-1*O-y)/l,(-1*S-p)/u],E=w(P,A);return g(P,A)<=-1&&(E=Math.PI),g(P,A)>=1&&(E=0),o===0&&E>0&&(E=E-2*Math.PI),o===1&&E<0&&(E=E+2*Math.PI),[v,m,l,u,k,E,h,o]}};Zs.Path=Vc;Vc.prototype.className="Path";Vc.prototype._attrsAffectingSize=["data"];(0,kT._registerNode)(Vc);PT.Factory.addGetterSetter(Vc,"data");Object.defineProperty(up,"__esModule",{value:!0});up.Arrow=void 0;const fp=ct,TT=Gc,h9=qe,AT=ut,$5=Zs;let _l=class extends TT.Line{_sceneFunc(t){super._sceneFunc(t);var r=Math.PI*2,n=this.points(),i=n,a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());var o=this.pointerLength(),l=n.length,u,f;if(a){const S=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],b=$5.Path.calcLength(i[i.length-4],i[i.length-3],"C",S),_=$5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/b),S[0],S[1],S[2],S[3],S[4],S[5]);u=n[l-2]-_.x,f=n[l-1]-_.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var h=(Math.atan2(f,u)+r)%r,O=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(h),t.moveTo(0,0),t.lineTo(-o,O/2),t.lineTo(-o,-O/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],f=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],f=n[3]-n[1]),t.rotate((Math.atan2(-f,-u)+r)%r),t.moveTo(0,0),t.lineTo(-o,O/2),t.lineTo(-o,-O/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),r=this.pointerWidth()/2;return{x:t.x-r,y:t.y-r,width:t.width+r*2,height:t.height+r*2}}};up.Arrow=_l;_l.prototype.className="Arrow";(0,AT._registerNode)(_l);fp.Factory.addGetterSetter(_l,"pointerLength",10,(0,h9.getNumberValidator)());fp.Factory.addGetterSetter(_l,"pointerWidth",10,(0,h9.getNumberValidator)());fp.Factory.addGetterSetter(_l,"pointerAtBeginning",!1);fp.Factory.addGetterSetter(_l,"pointerAtEnding",!0);var dp={};Object.defineProperty(dp,"__esModule",{value:!0});dp.Circle=void 0;const RT=ct,MT=gr,LT=qe,NT=ut;let Qs=class extends MT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};dp.Circle=Qs;Qs.prototype._centroid=!0;Qs.prototype.className="Circle";Qs.prototype._attrsAffectingSize=["radius"];(0,NT._registerNode)(Qs);RT.Factory.addGetterSetter(Qs,"radius",0,(0,LT.getNumberValidator)());var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Ellipse=void 0;const zy=ct,IT=gr,p9=qe,DT=ut;let Oo=class extends IT.Shape{_sceneFunc(t){var r=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),r!==n&&t.scale(1,n/r),t.arc(0,0,r,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}};hp.Ellipse=Oo;Oo.prototype.className="Ellipse";Oo.prototype._centroid=!0;Oo.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,DT._registerNode)(Oo);zy.Factory.addComponentsGetterSetter(Oo,"radius",["x","y"]);zy.Factory.addGetterSetter(Oo,"radiusX",0,(0,p9.getNumberValidator)());zy.Factory.addGetterSetter(Oo,"radiusY",0,(0,p9.getNumberValidator)());var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Image=void 0;const K1=Yt,wl=ct,jT=gr,FT=ut,qc=qe;let Xi=class g9 extends jT.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const r=this.getWidth(),n=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const l=this.attrs.cropWidth,u=this.attrs.cropHeight;l&&u?o=[a,this.cropX(),this.cropY(),l,u,0,0,r,n]:o=[a,0,0,r,n]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)),a&&(i&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){var r=this.width(),n=this.height(),i=this.cornerRadius();t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,r;return(t=this.attrs.width)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var t,r;return(t=this.attrs.height)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(t,r,n=null){var i=K1.Util.createImageElement();i.onload=function(){var a=new g9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};pp.Image=Xi;Xi.prototype.className="Image";(0,FT._registerNode)(Xi);wl.Factory.addGetterSetter(Xi,"cornerRadius",0,(0,qc.getNumberOrArrayOfNumbersValidator)(4));wl.Factory.addGetterSetter(Xi,"image");wl.Factory.addComponentsGetterSetter(Xi,"crop",["x","y","width","height"]);wl.Factory.addGetterSetter(Xi,"cropX",0,(0,qc.getNumberValidator)());wl.Factory.addGetterSetter(Xi,"cropY",0,(0,qc.getNumberValidator)());wl.Factory.addGetterSetter(Xi,"cropWidth",0,(0,qc.getNumberValidator)());wl.Factory.addGetterSetter(Xi,"cropHeight",0,(0,qc.getNumberValidator)());var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.Tag=Ls.Label=void 0;const gp=ct,zT=gr,BT=Ys,By=qe,v9=ut;var m9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],UT="Change.konva",HT="none",um="up",cm="right",fm="down",dm="left",$T=m9.length;let Uy=class extends BT.Group{constructor(t){super(t),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var r=this,n,i=function(){r._sync()};for(n=0;n<$T;n++)t.on(m9[n]+UT,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),r=this.getTag(),n,i,a,o,l,u,f;if(t&&r){switch(n=t.width(),i=t.height(),a=r.pointerDirection(),o=r.pointerWidth(),f=r.pointerHeight(),l=0,u=0,a){case um:l=n/2,u=-1*f;break;case cm:l=n+o,u=i/2;break;case fm:l=n/2,u=i+f;break;case dm:l=-1*o,u=i/2;break}r.setAttrs({x:-1*l,y:-1*u,width:n,height:i}),t.setAttrs({x:-1*l,y:-1*u})}}};Ls.Label=Uy;Uy.prototype.className="Label";(0,v9._registerNode)(Uy);let Sl=class extends zT.Shape{_sceneFunc(t){var r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),l=this.cornerRadius();let u=0,f=0,h=0,O=0;typeof l=="number"?u=f=h=O=Math.min(l,r/2,n/2):(u=Math.min(l[0]||0,r/2,n/2),f=Math.min(l[1]||0,r/2,n/2),O=Math.min(l[2]||0,r/2,n/2),h=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===um&&(t.lineTo((r-a)/2,0),t.lineTo(r/2,-1*o),t.lineTo((r+a)/2,0)),t.lineTo(r-f,0),t.arc(r-f,f,f,Math.PI*3/2,0,!1),i===cm&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-O),t.arc(r-O,n-O,O,0,Math.PI/2,!1),i===fm&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(h,n),t.arc(h,n-h,h,Math.PI/2,Math.PI,!1),i===dm&&(t.lineTo(0,(n+o)/2),t.lineTo(-1*a,n/2),t.lineTo(0,(n-o)/2)),t.lineTo(0,u),t.arc(u,u,u,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),l=this.height();return a===um?(r-=i,l+=i):a===fm?l+=i:a===dm?(t-=n*1.5,o+=n):a===cm&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};Ls.Tag=Sl;Sl.prototype.className="Tag";(0,v9._registerNode)(Sl);gp.Factory.addGetterSetter(Sl,"pointerDirection",HT);gp.Factory.addGetterSetter(Sl,"pointerWidth",0,(0,By.getNumberValidator)());gp.Factory.addGetterSetter(Sl,"pointerHeight",0,(0,By.getNumberValidator)());gp.Factory.addGetterSetter(Sl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Wc={};Object.defineProperty(Wc,"__esModule",{value:!0});Wc.Rect=void 0;const GT=ct,VT=gr,qT=ut,WT=Yt,KT=qe;let vp=class extends VT.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?WT.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};Wc.Rect=vp;vp.prototype.className="Rect";(0,qT._registerNode)(vp);GT.Factory.addGetterSetter(vp,"cornerRadius",0,(0,KT.getNumberOrArrayOfNumbersValidator)(4));var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.RegularPolygon=void 0;const y9=ct,YT=gr,b9=qe,XT=ut;let El=class extends YT.Shape{_sceneFunc(t){const r=this._getPoints();t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;n++)t.lineTo(r[n].x,r[n].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,r=this.attrs.radius||0,n=[];for(var i=0;i<t;i++)n.push({x:r*Math.sin(i*2*Math.PI/t),y:-1*r*Math.cos(i*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();var r=t[0].x,n=t[0].y,i=t[0].x,a=t[0].y;return t.forEach(o=>{r=Math.min(r,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:r,y:i,width:n-r,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};mp.RegularPolygon=El;El.prototype.className="RegularPolygon";El.prototype._centroid=!0;El.prototype._attrsAffectingSize=["radius"];(0,XT._registerNode)(El);y9.Factory.addGetterSetter(El,"radius",0,(0,b9.getNumberValidator)());y9.Factory.addGetterSetter(El,"sides",0,(0,b9.getNumberValidator)());var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.Ring=void 0;const _9=ct,ZT=gr,w9=qe,QT=ut;var G5=Math.PI*2;let Ol=class extends ZT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,G5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),G5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};yp.Ring=Ol;Ol.prototype.className="Ring";Ol.prototype._centroid=!0;Ol.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,QT._registerNode)(Ol);_9.Factory.addGetterSetter(Ol,"innerRadius",0,(0,w9.getNumberValidator)());_9.Factory.addGetterSetter(Ol,"outerRadius",0,(0,w9.getNumberValidator)());var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Sprite=void 0;const xl=ct,JT=gr,eA=Xs,S9=qe,tA=ut;let Zi=class extends JT.Shape{constructor(t){super(t),this._updated=!0,this.anim=new eA.Animation(()=>{var r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+0],u=a[i+1],f=a[i+2],h=a[i+3],O=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,h),t.closePath(),t.fillStrokeShape(this)),O)if(o){var S=o[r],b=n*2;t.drawImage(O,l,u,f,h,S[b+0],S[b+1],f,h)}else t.drawImage(O,l,u,f,h,0,0,f,h)}_hitFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+2],u=a[i+3];if(t.beginPath(),o){var f=o[r],h=n*2;t.rect(f[h+0],f[h+1],l,u)}else t.rect(0,0,l,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}};bp.Sprite=Zi;Zi.prototype.className="Sprite";(0,tA._registerNode)(Zi);xl.Factory.addGetterSetter(Zi,"animation");xl.Factory.addGetterSetter(Zi,"animations");xl.Factory.addGetterSetter(Zi,"frameOffsets");xl.Factory.addGetterSetter(Zi,"image");xl.Factory.addGetterSetter(Zi,"frameIndex",0,(0,S9.getNumberValidator)());xl.Factory.addGetterSetter(Zi,"frameRate",17,(0,S9.getNumberValidator)());xl.Factory.backCompat(Zi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Star=void 0;const Hy=ct,rA=gr,$y=qe,nA=ut;let xo=class extends rA.Shape{_sceneFunc(t){var r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var a=1;a<i*2;a++){var o=a%2===0?n:r,l=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);t.lineTo(l,u)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};_p.Star=xo;xo.prototype.className="Star";xo.prototype._centroid=!0;xo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,nA._registerNode)(xo);Hy.Factory.addGetterSetter(xo,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(xo,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(xo,"outerRadius",0,(0,$y.getNumberValidator)());var dl={};Object.defineProperty(dl,"__esModule",{value:!0});dl.Text=dl.stringToArray=void 0;const hm=Yt,$r=ct,iA=gr,Y1=ut,Po=qe,aA=ut;function E9(e){return Array.from(e)}dl.stringToArray=E9;var Xl="auto",oA="center",O9="inherit",Lu="justify",lA="Change.konva",sA="2d",V5="-",x9="left",uA="text",cA="Text",fA="top",dA="bottom",q5="middle",P9="normal",hA="px ",vd=" ",pA="right",W5="rtl",gA="word",vA="char",K5="none",X1="…",C9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],mA=C9.length;function yA(e){return e.split(",").map(t=>{t=t.trim();const r=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return r&&!n&&(t=`"${t}"`),t}).join(", ")}var md;function Z1(){return md||(md=hm.Util.createCanvasElement().getContext(sA),md)}function bA(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function _A(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function wA(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let Jt=class extends iA.Shape{constructor(t){super(wA(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<mA;r++)this.on(C9[r]+lA,this._setTextData);this._setTextData()}_sceneFunc(t){var r=this.textArr,n=r.length;if(this.text()){var i=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,l=this.verticalAlign(),u=this.direction(),f=0,h=this.align(),O=this.getWidth(),S=this.letterSpacing(),b=this.fill(),_=this.textDecoration(),y=_.indexOf("underline")!==-1,p=_.indexOf("line-through")!==-1,v;u=u===O9?t.direction:u;var m=o/2,d=q5;if(Y1.Konva._fixTextRendering){var g=this.measureSize("M");d="alphabetic",m=(g.fontBoundingBoxAscent-g.fontBoundingBoxDescent)/2+o/2}var w=0,k=0;for(u===W5&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",d),t.setAttr("textAlign",x9),l===q5?f=(this.getHeight()-n*o-i*2)/2:l===dA&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),v=0;v<n;v++){var w=0,k=0,P=r[v],A=P.text,E=P.width,x=P.lastInParagraph,C,R,N;if(t.save(),h===pA?w+=O-E-i*2:h===oA&&(w+=(O-E-i*2)/2),y){t.save(),t.beginPath();let L=Y1.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const M=w,D=m+k+L;t.moveTo(M,D),C=A.split(" ").length-1,R=C===0,N=h===Lu&&!x?O-i*2:E,t.lineTo(M+Math.round(N),D),t.lineWidth=a/15;const B=this._getLinearGradient();t.strokeStyle=B||b,t.stroke(),t.restore()}if(p){t.save(),t.beginPath();let L=Y1.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(w,m+k+L),C=A.split(" ").length-1,R=C===0,N=h===Lu&&x&&!R?O-i*2:E,t.lineTo(w+Math.round(N),m+k+L),t.lineWidth=a/15;const M=this._getLinearGradient();t.strokeStyle=M||b,t.stroke(),t.restore()}if(u!==W5&&(S!==0||h===Lu)){C=A.split(" ").length-1;for(var U=E9(A),G=0;G<U.length;G++){var Z=U[G];Z===" "&&!x&&h===Lu&&(w+=(O-i*2-E)/C),this._partialTextX=w,this._partialTextY=m+k,this._partialText=Z,t.fillStrokeShape(this),w+=this.measureSize(Z).width+S}}else S!==0&&t.setAttr("letterSpacing",`${S}px`),this._partialTextX=w,this._partialTextY=m+k,this._partialText=A,t.fillStrokeShape(this);t.restore(),n>1&&(m+=o)}}}_hitFunc(t){var r=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}setText(t){var r=hm.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(uA,r),this}getWidth(){var t=this.attrs.width===Xl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Xl||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return hm.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var r,n,i,a,o,l,u,f,h,O,S,b=Z1(),_=this.fontSize(),y;b.save(),b.font=this._getContextFont(),y=b.measureText(t),b.restore();const p=_/100;return{actualBoundingBoxAscent:(r=y.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*p,actualBoundingBoxDescent:(n=y.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(i=y.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*p,actualBoundingBoxRight:(a=y.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*p,alphabeticBaseline:(o=y.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(l=y.emHeightAscent)!==null&&l!==void 0?l:100*p,emHeightDescent:(u=y.emHeightDescent)!==null&&u!==void 0?u:-20*p,fontBoundingBoxAscent:(f=y.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*p,fontBoundingBoxDescent:(h=y.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*p,hangingBaseline:(O=y.hangingBaseline)!==null&&O!==void 0?O:72.80000305175781*p,ideographicBaseline:(S=y.ideographicBaseline)!==null&&S!==void 0?S:-21*p,width:y.width,height:_}}_getContextFont(){return this.fontStyle()+vd+this.fontVariant()+vd+(this.fontSize()+hA)+yA(this.fontFamily())}_addTextLine(t){this.align()===Lu&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var r=this.letterSpacing(),n=t.length;return Z1().measureText(t).width+(n?r*(n-1):0)}_setTextData(){var t=this.text().split(`
|
|
43
|
+
`),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,l=a!==Xl&&a!==void 0,u=o!==Xl&&o!==void 0,f=this.padding(),h=a-f*2,O=o-f*2,S=0,b=this.wrap(),_=b!==K5,y=b!==vA&&_,p=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();for(var v=p?this._getTextWidth(X1):0,m=0,d=t.length;m<d;++m){var g=t[m],w=this._getTextWidth(g);if(l&&w>h)for(;g.length>0;){for(var k=0,P=g.length,A="",E=0;k<P;){var x=k+P>>>1,C=g.slice(0,x+1),R=this._getTextWidth(C)+v;R<=h?(k=x+1,A=C,E=R):P=x}if(A){if(y){var N,U=g[A.length],G=U===vd||U===V5;G&&E<=h?N=A.length:N=Math.max(A.lastIndexOf(vd),A.lastIndexOf(V5))+1,N>0&&(k=N,A=A.slice(0,k),E=this._getTextWidth(A))}A=A.trimRight(),this._addTextLine(A),n=Math.max(n,E),S+=i;var Z=this._shouldHandleEllipsis(S);if(Z){this._tryToAddEllipsisToLastLine();break}if(g=g.slice(k),g=g.trimLeft(),g.length>0&&(w=this._getTextWidth(g),w<=h)){this._addTextLine(g),S+=i,n=Math.max(n,w);break}}else break}else this._addTextLine(g),S+=i,n=Math.max(n,w),this._shouldHandleEllipsis(S)&&m<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&S+i>O)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Xl&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==K5;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==Xl&&t!==void 0,n=this.padding(),i=t-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!a)){if(r){var l=this._getTextWidth(o.text+X1)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+X1)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return t&&r?!0:super._useBufferCanvas()}};dl.Text=Jt;Jt.prototype._fillFunc=bA;Jt.prototype._strokeFunc=_A;Jt.prototype.className=cA;Jt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,aA._registerNode)(Jt);$r.Factory.overWriteSetter(Jt,"width",(0,Po.getNumberOrAutoValidator)());$r.Factory.overWriteSetter(Jt,"height",(0,Po.getNumberOrAutoValidator)());$r.Factory.addGetterSetter(Jt,"direction",O9);$r.Factory.addGetterSetter(Jt,"fontFamily","Arial");$r.Factory.addGetterSetter(Jt,"fontSize",12,(0,Po.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"fontStyle",P9);$r.Factory.addGetterSetter(Jt,"fontVariant",P9);$r.Factory.addGetterSetter(Jt,"padding",0,(0,Po.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"align",x9);$r.Factory.addGetterSetter(Jt,"verticalAlign",fA);$r.Factory.addGetterSetter(Jt,"lineHeight",1,(0,Po.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"wrap",gA);$r.Factory.addGetterSetter(Jt,"ellipsis",!1,(0,Po.getBooleanValidator)());$r.Factory.addGetterSetter(Jt,"letterSpacing",0,(0,Po.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"text","",(0,Po.getStringValidator)());$r.Factory.addGetterSetter(Jt,"textDecoration","");var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.TextPath=void 0;const Q1=Yt,_i=ct,SA=gr,Nu=Zs,J1=dl,k9=qe,EA=ut;var OA="",T9="normal";function A9(e){e.fillText(this.partialText,0,0)}function R9(e){e.strokeText(this.partialText,0,0)}let vr=class extends SA.Shape{constructor(t){super(t),this.dummyCanvas=Q1.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Nu.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:Nu.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Nu.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&t.beginPath();for(var o=0;o<a.length;o++){t.save();var l=a[o].p0;t.translate(l.x,l.y),t.rotate(a[o].rotation),this.partialText=a[o].text,t.fillStrokeShape(this),r==="underline"&&(o===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}r==="underline"&&(t.strokeStyle=n,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var r=this.glyphInfo;if(r.length>=1){var n=r[0].p0;t.moveTo(n.x,n.y)}for(var i=0;i<r.length;i++){var a=r[i].p1;t.lineTo(a.x,a.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Q1.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return J1.Text.prototype.setText.call(this,t)}_getContextFont(){return J1.Text.prototype._getContextFont.call(this)}_getTextSize(t){var r=this.dummyCanvas,n=r.getContext("2d");n.save(),n.font=this._getContextFont();var i=n.measureText(t);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:r}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=r,this.glyphInfo=[],!this.attrs.data)return null;const n=this.letterSpacing(),i=this.align(),a=this.kerningFunc(),o=Math.max(this.textWidth+((this.attrs.text||"").length-1)*n,0);let l=0;i==="center"&&(l=Math.max(0,this.pathLength/2-o/2)),i==="right"&&(l=Math.max(0,this.pathLength-o));const u=(0,J1.stringToArray)(this.text());let f=l;for(var h=0;h<u.length;h++){const O=this._getPointAtLength(f);if(!O)return;let S=this._getTextSize(u[h]).width+n;if(u[h]===" "&&i==="justify"){const m=this.text().split(" ").length-1;S+=(this.pathLength-o)/m}const b=this._getPointAtLength(f+S);if(!b)return;const _=Nu.Path.getLineLength(O.x,O.y,b.x,b.y);let y=0;if(a)try{y=a(u[h-1],u[h])*this.fontSize()}catch{y=0}O.x+=y,b.x+=y,this.textWidth+=y;const p=Nu.Path.getPointOnLine(y+_/2,O.x,O.y,b.x,b.y),v=Math.atan2(b.y-O.y,b.x-O.x);this.glyphInfo.push({transposeX:p.x,transposeY:p.y,text:u[h],rotation:v,p0:O,p1:b}),f+=S}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(h){t.push(h.p0.x),t.push(h.p0.y),t.push(h.p1.x),t.push(h.p1.y)});for(var r=t[0]||0,n=t[0]||0,i=t[1]||0,a=t[1]||0,o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);var f=this.fontSize();return{x:r-f/2,y:i-f/2,width:n-r+f,height:a-i+f}}destroy(){return Q1.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};wp.TextPath=vr;vr.prototype._fillFunc=A9;vr.prototype._strokeFunc=R9;vr.prototype._fillFuncHit=A9;vr.prototype._strokeFuncHit=R9;vr.prototype.className="TextPath";vr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,EA._registerNode)(vr);_i.Factory.addGetterSetter(vr,"data");_i.Factory.addGetterSetter(vr,"fontFamily","Arial");_i.Factory.addGetterSetter(vr,"fontSize",12,(0,k9.getNumberValidator)());_i.Factory.addGetterSetter(vr,"fontStyle",T9);_i.Factory.addGetterSetter(vr,"align","left");_i.Factory.addGetterSetter(vr,"letterSpacing",0,(0,k9.getNumberValidator)());_i.Factory.addGetterSetter(vr,"textBaseline","middle");_i.Factory.addGetterSetter(vr,"fontVariant",T9);_i.Factory.addGetterSetter(vr,"text",OA);_i.Factory.addGetterSetter(vr,"textDecoration",null);_i.Factory.addGetterSetter(vr,"kerningFunc",null);var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Transformer=void 0;const kt=Yt,Et=ct,Y5=$t,xA=gr,PA=Wc,X5=Ys,oi=ut,Co=qe,CA=ut;var M9="tr-konva",kA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${M9}`).join(" "),Z5="nodesRect",TA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],AA={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const RA="ontouchstart"in oi.Konva._global;function MA(e,t,r){if(e==="rotater")return r;t+=kt.Util.degToRad(AA[e]||0);var n=(kt.Util.radToDeg(t)%360+360)%360;return kt.Util._inRange(n,315+22.5,360)||kt.Util._inRange(n,0,22.5)?"ns-resize":kt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":kt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":kt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":kt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":kt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":kt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":kt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(kt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var bh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Q5=1e8;function LA(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function L9(e,t,r){const n=r.x+(e.x-r.x)*Math.cos(t)-(e.y-r.y)*Math.sin(t),i=r.y+(e.x-r.x)*Math.sin(t)+(e.y-r.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:n,y:i}}function NA(e,t){const r=LA(e);return L9(e,t,r)}function IA(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=oi.Konva.getAngle(e[i]),o=Math.abs(a-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let pm=0,vt=class extends X5.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(kA,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return kt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return M9+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const r=t.filter(i=>i.isAncestorOf(this)?(kt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=r,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=i._attrsAffectingSize.map(l=>l+"Change."+this._getEventNamespace()).join(" ");i.on(o,a),i.on(TA.map(l=>l+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let r;t.on(`dragstart.${this._getEventNamespace()}`,n=>{r=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=t.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(l=>{if(l===t||l.isDragging())return;const u=l.getAbsolutePosition();l.setAbsolutePosition({x:u.x+a,y:u.y+o}),l.startDrag(n)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Z5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Z5,this.__getNodeRect)}__getNodeShape(t,r=this.rotation(),n){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(n),o=t.getAbsolutePosition(n),l=i.x*a.x-t.offsetX()*a.x,u=i.y*a.y-t.offsetY()*a.y;const f=(oi.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:o.x+l*Math.cos(f)+u*Math.sin(-f),y:o.y+u*Math.cos(f)+l*Math.sin(f),width:i.width*a.x,height:i.height*a.y,rotation:f};return L9(h,-oi.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-Q5,y:-Q5,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const h=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var O=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],S=f.getAbsoluteTransform();O.forEach(function(b){var _=S.point(b);r.push(_)})});const n=new kt.Transform;n.rotate(-oi.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var h=n.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:l-a,rotation:oi.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),bh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new PA.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:RA?10:"auto"}),n=this;r.on("mousedown touchstart",function(i){n._handleMouseDown(i)}),r.on("dragstart",i=>{r.stopDrag(),i.cancelBubble=!0}),r.on("dragend",i=>{i.cancelBubble=!0}),r.on("mouseenter",()=>{var i=oi.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=MA(t,i,a);r.getStage().content&&(r.getStage().content.style.cursor=o),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){var t=new xA.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(r,n){var i=n.getParent(),a=i.padding();r.beginPath(),r.rect(-a,-a,n.width()+a*2,n.height()+a*2),r.moveTo(n.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*kt.Util._sign(n.height())-a),r.fillStrokeShape(n)},hitFunc:(r,n)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();r.beginPath(),r.rect(-i,-i,n.width()+i*2,n.height()+i*2),r.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",r=>{r.cancelBubble=!0}),t.on("dragmove",r=>{r.cancelBubble=!0}),t.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(t){if(!this._transforming){this._movingAnchorName=t.target.name().split(" ")[0];var r=this._getNodeRect(),n=r.width,i=r.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var o=t.target.getAbsolutePosition(),l=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-o.x,y:l.y-o.y},pm++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:t.evt,target:u})})}}_handleMouseMove(t){var r,n,i,a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(t);const l=o.getPointerPosition();let u={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(f,u,t)),a.setAbsolutePosition(u);const h=a.getAbsolutePosition();if(!(f.x===h.x&&f.y===h.y)){if(this._movingAnchorName==="rotater"){var O=this._getNodeRect();r=a.x()-O.width/2,n=-a.y()+O.height/2;let N=Math.atan2(-n,r)+Math.PI/2;O.height<0&&(N-=Math.PI);var S=oi.Konva.getAngle(this.rotation());const U=S+N,G=oi.Konva.getAngle(this.rotationSnapTolerance()),W=IA(this.rotationSnaps(),U,G)-O.rotation,H=NA(O,W);this._fitNodesInto(H,t);return}var b=this.shiftBehavior(),_;b==="inverted"?_=this.keepRatio()&&!t.shiftKey:b==="none"?_=this.keepRatio():_=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(_){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(y.x-a.x(),2)+Math.pow(y.y-a.y(),2));var p=this.findOne(".top-left").x()>y.x?-1:1,v=this.findOne(".top-left").y()>y.y?-1:1;r=i*this.cos*p,n=i*this.sin*v,this.findOne(".top-left").x(y.x-r),this.findOne(".top-left").y(y.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(_){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-y.x,2)+Math.pow(y.y-a.y(),2));var p=this.findOne(".top-right").x()<y.x?-1:1,v=this.findOne(".top-right").y()>y.y?-1:1;r=i*this.cos*p,n=i*this.sin*v,this.findOne(".top-right").x(y.x+r),this.findOne(".top-right").y(y.y-n)}var m=a.position();this.findOne(".top-left").y(m.y),this.findOne(".bottom-right").x(m.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(_){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(y.x-a.x(),2)+Math.pow(a.y()-y.y,2));var p=y.x<a.x()?-1:1,v=a.y()<y.y?-1:1;r=i*this.cos*p,n=i*this.sin*v,a.x(y.x-r),a.y(y.y+n)}m=a.position(),this.findOne(".top-left").x(m.x),this.findOne(".bottom-right").y(m.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(_){var y=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-y.x,2)+Math.pow(a.y()-y.y,2));var p=this.findOne(".bottom-right").x()<y.x?-1:1,v=this.findOne(".bottom-right").y()<y.y?-1:1;r=i*this.cos*p,n=i*this.sin*v,this.findOne(".bottom-right").x(y.x+r),this.findOne(".bottom-right").y(y.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var g=this.findOne(".top-left"),w=this.findOne(".bottom-right"),k=g.x(),P=g.y(),A=this.getWidth()-w.x(),E=this.getHeight()-w.y();w.move({x:-k,y:-P}),g.move({x:A,y:E})}var x=this.findOne(".top-left").getAbsolutePosition();r=x.x,n=x.y;var C=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),R=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:C,height:R,rotation:oi.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var r;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();pm--,this._fire("transformend",{evt:t,target:n}),(r=this.getLayer())===null||r===void 0||r.batchDraw(),n&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:t,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,r){var n=this._getNodeRect();const i=1;if(kt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(kt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var a=new kt.Transform;if(a.rotate(oi.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const S=a.point({x:-this.padding()*2,y:0});t.x+=S.x,t.y+=S.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const S=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const S=a.point({x:0,y:-this.padding()*2});t.x+=S.x,t.y+=S.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const S=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const S=this.boundBoxFunc()(n,t);S?t=S:kt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new kt.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new kt.Transform,f=t.width/o,h=t.height/o;this.flipEnabled()===!1?(u.translate(t.x,t.y),u.rotate(t.rotation),u.translate(t.width<0?t.width:0,t.height<0?t.height:0),u.scale(Math.abs(f),Math.abs(h))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,h));const O=u.multiply(l.invert());this._nodes.forEach(S=>{var b;const _=S.getParent().getAbsoluteTransform(),y=S.getTransform().copy();y.translate(S.offsetX(),S.offsetY());const p=new kt.Transform;p.multiply(_.copy().invert()).multiply(O).multiply(_).multiply(y);const v=p.decompose();S.setAttrs(v),(b=S.getLayer())===null||b===void 0||b.batchDraw()}),this.rotation(kt.Util._getRotation(t.rotation)),this._nodes.forEach(S=>{this._fire("transform",{evt:r,target:S}),S._fire("transform",{evt:r,target:S})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,r){this.findOne(t).setAttrs(r)}update(){var t,r=this._getNodeRect();this.rotation(kt.Util._getRotation(r.rotation));var n=r.width,i=r.height,a=this.enabledAnchors(),o=this.resizeEnabled(),l=this.padding(),u=this.anchorSize();const f=this.find("._anchor");f.forEach(O=>{O.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+l,offsetY:u/2+l,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+l,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-l,offsetY:u/2+l,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+l,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-l,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-l,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*kt.Util._sign(i)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const h=this.anchorStyleFunc();h&&f.forEach(O=>{h(O)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),X5.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Y5.Node.prototype.toObject.call(this)}clone(t){var r=Y5.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Sp.Transformer=vt;vt.isTransforming=()=>pm>0;function DA(e){return e instanceof Array||kt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){bh.indexOf(t)===-1&&kt.Util.warn("Unknown anchor name: "+t+". Available names are: "+bh.join(", "))}),e||[]}vt.prototype.className="Transformer";(0,CA._registerNode)(vt);Et.Factory.addGetterSetter(vt,"enabledAnchors",bh,DA);Et.Factory.addGetterSetter(vt,"flipEnabled",!0,(0,Co.getBooleanValidator)());Et.Factory.addGetterSetter(vt,"resizeEnabled",!0);Et.Factory.addGetterSetter(vt,"anchorSize",10,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"rotateEnabled",!0);Et.Factory.addGetterSetter(vt,"rotateLineVisible",!0);Et.Factory.addGetterSetter(vt,"rotationSnaps",[]);Et.Factory.addGetterSetter(vt,"rotateAnchorOffset",50,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"rotateAnchorCursor","crosshair");Et.Factory.addGetterSetter(vt,"rotationSnapTolerance",5,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"borderEnabled",!0);Et.Factory.addGetterSetter(vt,"anchorStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(vt,"anchorStrokeWidth",1,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"anchorFill","white");Et.Factory.addGetterSetter(vt,"anchorCornerRadius",0,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"borderStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(vt,"borderStrokeWidth",1,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"borderDash");Et.Factory.addGetterSetter(vt,"keepRatio",!0);Et.Factory.addGetterSetter(vt,"shiftBehavior","default");Et.Factory.addGetterSetter(vt,"centeredScaling",!1);Et.Factory.addGetterSetter(vt,"ignoreStroke",!1);Et.Factory.addGetterSetter(vt,"padding",0,(0,Co.getNumberValidator)());Et.Factory.addGetterSetter(vt,"node");Et.Factory.addGetterSetter(vt,"nodes");Et.Factory.addGetterSetter(vt,"boundBoxFunc");Et.Factory.addGetterSetter(vt,"anchorDragBoundFunc");Et.Factory.addGetterSetter(vt,"anchorStyleFunc");Et.Factory.addGetterSetter(vt,"shouldOverdrawWholeArea",!1);Et.Factory.addGetterSetter(vt,"useSingleNodeRotation",!0);Et.Factory.backCompat(vt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Wedge=void 0;const Op=ct,jA=gr,FA=ut,N9=qe,zA=ut;let ka=class extends jA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,FA.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};Ep.Wedge=ka;ka.prototype.className="Wedge";ka.prototype._centroid=!0;ka.prototype._attrsAffectingSize=["radius"];(0,zA._registerNode)(ka);Op.Factory.addGetterSetter(ka,"radius",0,(0,N9.getNumberValidator)());Op.Factory.addGetterSetter(ka,"angle",0,(0,N9.getNumberValidator)());Op.Factory.addGetterSetter(ka,"clockwise",!1);Op.Factory.backCompat(ka,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Blur=void 0;const J5=ct,BA=$t,UA=qe;function e4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var HA=[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],$A=[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 GA(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,h,O,S,b,_,y,p,v,m,d,g,w,k,P,A,E,x,C,R,N=t+t+1,U=n-1,G=i-1,Z=t+1,W=Z*(Z+1)/2,H=new e4,L=null,M=H,D=null,B=null,q=HA[t],K=$A[t];for(l=1;l<N;l++)M=M.next=new e4,l===Z&&(L=M);for(M.next=H,O=h=0,o=0;o<i;o++){for(g=w=k=P=S=b=_=y=0,p=Z*(A=r[h]),v=Z*(E=r[h+1]),m=Z*(x=r[h+2]),d=Z*(C=r[h+3]),S+=W*A,b+=W*E,_+=W*x,y+=W*C,M=H,l=0;l<Z;l++)M.r=A,M.g=E,M.b=x,M.a=C,M=M.next;for(l=1;l<Z;l++)u=h+((U<l?U:l)<<2),S+=(M.r=A=r[u])*(R=Z-l),b+=(M.g=E=r[u+1])*R,_+=(M.b=x=r[u+2])*R,y+=(M.a=C=r[u+3])*R,g+=A,w+=E,k+=x,P+=C,M=M.next;for(D=H,B=L,a=0;a<n;a++)r[h+3]=C=y*q>>K,C!==0?(C=255/C,r[h]=(S*q>>K)*C,r[h+1]=(b*q>>K)*C,r[h+2]=(_*q>>K)*C):r[h]=r[h+1]=r[h+2]=0,S-=p,b-=v,_-=m,y-=d,p-=D.r,v-=D.g,m-=D.b,d-=D.a,u=O+((u=a+t+1)<U?u:U)<<2,g+=D.r=r[u],w+=D.g=r[u+1],k+=D.b=r[u+2],P+=D.a=r[u+3],S+=g,b+=w,_+=k,y+=P,D=D.next,p+=A=B.r,v+=E=B.g,m+=x=B.b,d+=C=B.a,g-=A,w-=E,k-=x,P-=C,B=B.next,h+=4;O+=n}for(a=0;a<n;a++){for(w=k=P=g=b=_=y=S=0,h=a<<2,p=Z*(A=r[h]),v=Z*(E=r[h+1]),m=Z*(x=r[h+2]),d=Z*(C=r[h+3]),S+=W*A,b+=W*E,_+=W*x,y+=W*C,M=H,l=0;l<Z;l++)M.r=A,M.g=E,M.b=x,M.a=C,M=M.next;for(f=n,l=1;l<=t;l++)h=f+a<<2,S+=(M.r=A=r[h])*(R=Z-l),b+=(M.g=E=r[h+1])*R,_+=(M.b=x=r[h+2])*R,y+=(M.a=C=r[h+3])*R,g+=A,w+=E,k+=x,P+=C,M=M.next,l<G&&(f+=n);for(h=a,D=H,B=L,o=0;o<i;o++)u=h<<2,r[u+3]=C=y*q>>K,C>0?(C=255/C,r[u]=(S*q>>K)*C,r[u+1]=(b*q>>K)*C,r[u+2]=(_*q>>K)*C):r[u]=r[u+1]=r[u+2]=0,S-=p,b-=v,_-=m,y-=d,p-=D.r,v-=D.g,m-=D.b,d-=D.a,u=a+((u=o+Z)<G?u:G)*n<<2,S+=g+=D.r=r[u],b+=w+=D.g=r[u+1],_+=k+=D.b=r[u+2],y+=P+=D.a=r[u+3],D=D.next,p+=A=B.r,v+=E=B.g,m+=x=B.b,d+=C=B.a,g-=A,w-=E,k-=x,P-=C,B=B.next,h+=n}}const VA=function(t){var r=Math.round(this.blurRadius());r>0&&GA(t,r)};xp.Blur=VA;J5.Factory.addGetterSetter(BA.Node,"blurRadius",0,(0,UA.getNumberValidator)(),J5.Factory.afterSetFilter);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Brighten=void 0;const t4=ct,qA=$t,WA=qe,KA=function(e){var t=this.brightness()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=4)r[i]+=t,r[i+1]+=t,r[i+2]+=t};Pp.Brighten=KA;t4.Factory.addGetterSetter(qA.Node,"brightness",0,(0,WA.getNumberValidator)(),t4.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Contrast=void 0;const r4=ct,YA=$t,XA=qe,ZA=function(e){var t=Math.pow((this.contrast()+100)/100,2),r=e.data,n=r.length,i=150,a=150,o=150,l;for(l=0;l<n;l+=4)i=r[l],a=r[l+1],o=r[l+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[l]=i,r[l+1]=a,r[l+2]=o};Cp.Contrast=ZA;r4.Factory.addGetterSetter(YA.Node,"contrast",0,(0,XA.getNumberValidator)(),r4.Factory.afterSetFilter);var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.Emboss=void 0;const vo=ct,Tp=$t,QA=Yt,I9=qe,JA=function(e){var t=this.embossStrength()*10,r=this.embossWhiteLevel()*255,n=this.embossDirection(),i=this.embossBlend(),a=0,o=0,l=e.data,u=e.width,f=e.height,h=u*4,O=f;switch(n){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:QA.Util.error("Unknown emboss direction: "+n)}do{var S=(O-1)*h,b=a;O+b<1&&(b=0),O+b>f&&(b=0);var _=(O-1+b)*u*4,y=u;do{var p=S+(y-1)*4,v=o;y+v<1&&(v=0),y+v>u&&(v=0);var m=_+(y-1+v)*4,d=l[p]-l[m],g=l[p+1]-l[m+1],w=l[p+2]-l[m+2],k=d,P=k>0?k:-k,A=g>0?g:-g,E=w>0?w:-w;if(A>P&&(k=g),E>P&&(k=w),k*=t,i){var x=l[p]+k,C=l[p+1]+k,R=l[p+2]+k;l[p]=x>255?255:x<0?0:x,l[p+1]=C>255?255:C<0?0:C,l[p+2]=R>255?255:R<0?0:R}else{var N=r-k;N<0?N=0:N>255&&(N=255),l[p]=l[p+1]=l[p+2]=N}}while(--y)}while(--O)};kp.Emboss=JA;vo.Factory.addGetterSetter(Tp.Node,"embossStrength",.5,(0,I9.getNumberValidator)(),vo.Factory.afterSetFilter);vo.Factory.addGetterSetter(Tp.Node,"embossWhiteLevel",.5,(0,I9.getNumberValidator)(),vo.Factory.afterSetFilter);vo.Factory.addGetterSetter(Tp.Node,"embossDirection","top-left",null,vo.Factory.afterSetFilter);vo.Factory.addGetterSetter(Tp.Node,"embossBlend",!1,null,vo.Factory.afterSetFilter);var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});Ap.Enhance=void 0;const n4=ct,eR=$t,tR=qe;function eg(e,t,r,n,i){var a=r-t,o=i-n,l;return a===0?n+o/2:o===0?n:(l=(e-t)/a,l=o*l+n,l)}const rR=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],h=f,O,S,b=this.enhance();if(b!==0){for(S=0;S<r;S+=4)a=t[S+0],a<n?n=a:a>i&&(i=a),u=t[S+1],u<o?o=u:u>l&&(l=u),O=t[S+2],O<f?f=O:O>h&&(h=O);i===n&&(i=255,n=0),l===o&&(l=255,o=0),h===f&&(h=255,f=0);var _,y,p,v,m,d,g,w,k;for(b>0?(y=i+b*(255-i),p=n-b*(n-0),m=l+b*(255-l),d=o-b*(o-0),w=h+b*(255-h),k=f-b*(f-0)):(_=(i+n)*.5,y=i+b*(i-_),p=n+b*(n-_),v=(l+o)*.5,m=l+b*(l-v),d=o+b*(o-v),g=(h+f)*.5,w=h+b*(h-g),k=f+b*(f-g)),S=0;S<r;S+=4)t[S+0]=eg(t[S+0],n,i,p,y),t[S+1]=eg(t[S+1],o,l,d,m),t[S+2]=eg(t[S+2],f,h,k,w)}};Ap.Enhance=rR;n4.Factory.addGetterSetter(eR.Node,"enhance",0,(0,tR.getNumberValidator)(),n4.Factory.afterSetFilter);var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Grayscale=void 0;const nR=function(e){var t=e.data,r=t.length,n,i;for(n=0;n<r;n+=4)i=.34*t[n]+.5*t[n+1]+.16*t[n+2],t[n]=i,t[n+1]=i,t[n+2]=i};Rp.Grayscale=nR;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.HSL=void 0;const Ns=ct,Gy=$t,Vy=qe;Ns.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),Ns.Factory.afterSetFilter);Ns.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),Ns.Factory.afterSetFilter);Ns.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),Ns.Factory.afterSetFilter);const iR=function(e){var t=e.data,r=t.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,l,u=n*i*Math.cos(a*Math.PI/180),f=n*i*Math.sin(a*Math.PI/180),h=.299*n+.701*u+.167*f,O=.587*n-.587*u+.33*f,S=.114*n-.114*u-.497*f,b=.299*n-.299*u-.328*f,_=.587*n+.413*u+.035*f,y=.114*n-.114*u+.293*f,p=.299*n-.3*u+1.25*f,v=.587*n-.586*u-1.05*f,m=.114*n+.886*u-.2*f,d,g,w,k;for(l=0;l<r;l+=4)d=t[l+0],g=t[l+1],w=t[l+2],k=t[l+3],t[l+0]=h*d+O*g+S*w+o,t[l+1]=b*d+_*g+y*w+o,t[l+2]=p*d+v*g+m*w+o,t[l+3]=k};Mp.HSL=iR;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.HSV=void 0;const Is=ct,qy=$t,Wy=qe,aR=function(e){var t=e.data,r=t.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o,l=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),f=.299*n+.701*l+.167*u,h=.587*n-.587*l+.33*u,O=.114*n-.114*l-.497*u,S=.299*n-.299*l-.328*u,b=.587*n+.413*l+.035*u,_=.114*n-.114*l+.293*u,y=.299*n-.3*l+1.25*u,p=.587*n-.586*l-1.05*u,v=.114*n+.886*l-.2*u,m,d,g,w;for(o=0;o<r;o+=4)m=t[o+0],d=t[o+1],g=t[o+2],w=t[o+3],t[o+0]=f*m+h*d+O*g,t[o+1]=S*m+b*d+_*g,t[o+2]=y*m+p*d+v*g,t[o+3]=w};Lp.HSV=aR;Is.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),Is.Factory.afterSetFilter);Is.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),Is.Factory.afterSetFilter);Is.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),Is.Factory.afterSetFilter);var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Invert=void 0;const oR=function(e){var t=e.data,r=t.length,n;for(n=0;n<r;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]};Np.Invert=oR;var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Kaleidoscope=void 0;const _h=ct,D9=$t,i4=Yt,j9=qe;var lR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,h,O,S=0,b=0,_=0,y=0,p,v=Math.sqrt(l*l+u*u);h=a-l,O=o-u,p=Math.sqrt(h*h+O*O),v=p>v?p:v;var m=o,d=a,g,w,k=360/d*Math.PI/180,P,A;for(w=0;w<d;w+=1)for(P=Math.sin(w*k),A=Math.cos(w*k),g=0;g<m;g+=1)h=Math.floor(l+v*g/m*A),O=Math.floor(u+v*g/m*P),f=(O*a+h)*4,S=n[f+0],b=n[f+1],_=n[f+2],y=n[f+3],f=(w+g*a)*4,i[f+0]=S,i[f+1]=b,i[f+2]=_,i[f+3]=y},sR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,h,O,S,b,_=0,y=0,p=0,v=0,m,d=Math.sqrt(l*l+u*u);h=a-l,O=o-u,m=Math.sqrt(h*h+O*O),d=m>d?m:d;var g=o,w=a,k,P,A=0,E,x;for(h=0;h<a;h+=1)for(O=0;O<o;O+=1)S=h-l,b=O-u,k=Math.sqrt(S*S+b*b)*g/d,P=(Math.atan2(b,S)*180/Math.PI+360+A)%360,P=P*w/360,E=Math.floor(P),x=Math.floor(k),f=(x*a+E)*4,_=n[f+0],y=n[f+1],p=n[f+2],v=n[f+3],f=(O*a+h)*4,i[f+0]=_,i[f+1]=y,i[f+2]=p,i[f+3]=v};const uR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,h,O,S,b=Math.round(this.kaleidoscopePower()),_=Math.round(this.kaleidoscopeAngle()),y=Math.floor(t*(_%360)/360);if(!(b<1)){var p=i4.Util.createCanvasElement();p.width=t,p.height=r;var v=p.getContext("2d").getImageData(0,0,t,r);i4.Util.releaseCanvas(p),lR(e,v,{polarCenterX:t/2,polarCenterY:r/2});for(var m=t/Math.pow(2,b);m<=8;)m=m*2,b-=1;m=Math.ceil(m);var d=m,g=0,w=d,k=1;for(y+m>t&&(g=d,w=0,k=-1),i=0;i<r;i+=1)for(n=g;n!==w;n+=k)a=Math.round(n+y)%t,O=(t*i+a)*4,l=v.data[O+0],u=v.data[O+1],f=v.data[O+2],h=v.data[O+3],S=(t*i+n)*4,v.data[S+0]=l,v.data[S+1]=u,v.data[S+2]=f,v.data[S+3]=h;for(i=0;i<r;i+=1)for(d=Math.floor(m),o=0;o<b;o+=1){for(n=0;n<d+1;n+=1)O=(t*i+n)*4,l=v.data[O+0],u=v.data[O+1],f=v.data[O+2],h=v.data[O+3],S=(t*i+d*2-n-1)*4,v.data[S+0]=l,v.data[S+1]=u,v.data[S+2]=f,v.data[S+3]=h;d*=2}sR(v,e,{polarRotation:0})}};Ip.Kaleidoscope=uR;_h.Factory.addGetterSetter(D9.Node,"kaleidoscopePower",2,(0,j9.getNumberValidator)(),_h.Factory.afterSetFilter);_h.Factory.addGetterSetter(D9.Node,"kaleidoscopeAngle",0,(0,j9.getNumberValidator)(),_h.Factory.afterSetFilter);var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Mask=void 0;const a4=ct,cR=$t,fR=qe;function yd(e,t,r){var n=(r*e.width+t)*4,i=[];return i.push(e.data[n++],e.data[n++],e.data[n++],e.data[n++]),i}function Iu(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function dR(e){for(var t=[0,0,0],r=0;r<e.length;r++)t[0]+=e[r][0],t[1]+=e[r][1],t[2]+=e[r][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function hR(e,t){var r=yd(e,0,0),n=yd(e,e.width-1,0),i=yd(e,0,e.height-1),a=yd(e,e.width-1,e.height-1),o=t||10;if(Iu(r,n)<o&&Iu(n,a)<o&&Iu(a,i)<o&&Iu(i,r)<o){for(var l=dR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var h=Iu(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=h<o?0:255}return u}}function pR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function gR(e,t,r){for(var n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,O=0;O<i;O++)for(var S=0;S<i;S++){var b=l+O-a,_=u+S-a;if(b>=0&&b<r&&_>=0&&_<t){var y=b*t+_,p=n[O*i+S];h+=e[y]*p}}o[f]=h===255*8?255:0}return o}function vR(e,t,r){for(var n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,O=0;O<i;O++)for(var S=0;S<i;S++){var b=l+O-a,_=u+S-a;if(b>=0&&b<r&&_>=0&&_<t){var y=b*t+_,p=n[O*i+S];h+=e[y]*p}}o[f]=h>=255*4?255:0}return o}function mR(e,t,r){for(var n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,O=0;O<i;O++)for(var S=0;S<i;S++){var b=l+O-a,_=u+S-a;if(b>=0&&b<r&&_>=0&&_<t){var y=b*t+_,p=n[O*i+S];h+=e[y]*p}}o[f]=h}return o}const yR=function(e){var t=this.threshold(),r=hR(e,t);return r&&(r=gR(r,e.width,e.height),r=vR(r,e.width,e.height),r=mR(r,e.width,e.height),pR(e,r)),e};Dp.Mask=yR;a4.Factory.addGetterSetter(cR.Node,"threshold",0,(0,fR.getNumberValidator)(),a4.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Noise=void 0;const o4=ct,bR=$t,_R=qe,wR=function(e){var t=this.noise()*255,r=e.data,n=r.length,i=t/2,a;for(a=0;a<n;a+=4)r[a+0]+=i-2*i*Math.random(),r[a+1]+=i-2*i*Math.random(),r[a+2]+=i-2*i*Math.random()};jp.Noise=wR;o4.Factory.addGetterSetter(bR.Node,"noise",.2,(0,_R.getNumberValidator)(),o4.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Pixelate=void 0;const l4=ct,SR=Yt,ER=$t,OR=qe,xR=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,h,O=Math.ceil(r/t),S=Math.ceil(n/t),b,_,y,p,v,m,d,g=e.data;if(t<=0){SR.Util.error("pixelSize value can not be <= 0");return}for(v=0;v<O;v+=1)for(m=0;m<S;m+=1){for(l=0,u=0,f=0,h=0,b=v*t,_=b+t,y=m*t,p=y+t,d=0,i=b;i<_;i+=1)if(!(i>=r))for(a=y;a<p;a+=1)a>=n||(o=(r*a+i)*4,l+=g[o+0],u+=g[o+1],f+=g[o+2],h+=g[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,h=h/d,i=b;i<_;i+=1)if(!(i>=r))for(a=y;a<p;a+=1)a>=n||(o=(r*a+i)*4,g[o+0]=l,g[o+1]=u,g[o+2]=f,g[o+3]=h)}};Fp.Pixelate=xR;l4.Factory.addGetterSetter(ER.Node,"pixelSize",8,(0,OR.getNumberValidator)(),l4.Factory.afterSetFilter);var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.Posterize=void 0;const s4=ct,PR=$t,CR=qe,kR=function(e){var t=Math.round(this.levels()*254)+1,r=e.data,n=r.length,i=255/t,a;for(a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};zp.Posterize=kR;s4.Factory.addGetterSetter(PR.Node,"levels",.5,(0,CR.getNumberValidator)(),s4.Factory.afterSetFilter);var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.RGB=void 0;const wh=ct,Ky=$t,TR=qe,AR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o,l;for(o=0;o<r;o+=4)l=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255,t[o]=l*n,t[o+1]=l*i,t[o+2]=l*a,t[o+3]=t[o+3]};Bp.RGB=AR;wh.Factory.addGetterSetter(Ky.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});wh.Factory.addGetterSetter(Ky.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});wh.Factory.addGetterSetter(Ky.Node,"blue",0,TR.RGBComponent,wh.Factory.afterSetFilter);var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.RGBA=void 0;const Sc=ct,Hp=$t,RR=qe,MR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o=this.alpha(),l,u;for(l=0;l<r;l+=4)u=1-o,t[l]=n*o+t[l]*u,t[l+1]=i*o+t[l+1]*u,t[l+2]=a*o+t[l+2]*u};Up.RGBA=MR;Sc.Factory.addGetterSetter(Hp.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Sc.Factory.addGetterSetter(Hp.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Sc.Factory.addGetterSetter(Hp.Node,"blue",0,RR.RGBComponent,Sc.Factory.afterSetFilter);Sc.Factory.addGetterSetter(Hp.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var $p={};Object.defineProperty($p,"__esModule",{value:!0});$p.Sepia=void 0;const LR=function(e){var t=e.data,r=t.length,n,i,a,o;for(n=0;n<r;n+=4)i=t[n+0],a=t[n+1],o=t[n+2],t[n+0]=Math.min(255,i*.393+a*.769+o*.189),t[n+1]=Math.min(255,i*.349+a*.686+o*.168),t[n+2]=Math.min(255,i*.272+a*.534+o*.131)};$p.Sepia=LR;var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Solarize=void 0;const NR=function(e){var t=e.data,r=e.width,n=e.height,i=r*4,a=n;do{var o=(a-1)*i,l=r;do{var u=o+(l-1)*4,f=t[u],h=t[u+1],O=t[u+2];f>127&&(f=255-f),h>127&&(h=255-h),O>127&&(O=255-O),t[u]=f,t[u+1]=h,t[u+2]=O}while(--l)}while(--a)};Gp.Solarize=NR;var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Threshold=void 0;const u4=ct,IR=$t,DR=qe,jR=function(e){var t=this.threshold()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=1)r[i]=r[i]<t?0:255};Vp.Threshold=jR;u4.Factory.addGetterSetter(IR.Node,"threshold",.5,(0,DR.getNumberValidator)(),u4.Factory.afterSetFilter);Object.defineProperty(ep,"__esModule",{value:!0});ep.Konva=void 0;const c4=mh,FR=op,zR=up,BR=dp,UR=hp,HR=pp,f4=Ls,$R=Gc,GR=Zs,VR=Wc,qR=mp,WR=yp,KR=bp,YR=_p,XR=dl,ZR=wp,QR=Sp,JR=Ep,eM=xp,tM=Pp,rM=Cp,nM=kp,iM=Ap,aM=Rp,oM=Mp,lM=Lp,sM=Np,uM=Ip,cM=Dp,fM=jp,dM=Fp,hM=zp,pM=Bp,gM=Up,vM=$p,mM=Gp,yM=Vp;ep.Konva=c4.Konva.Util._assign(c4.Konva,{Arc:FR.Arc,Arrow:zR.Arrow,Circle:BR.Circle,Ellipse:UR.Ellipse,Image:HR.Image,Label:f4.Label,Tag:f4.Tag,Line:$R.Line,Path:GR.Path,Rect:VR.Rect,RegularPolygon:qR.RegularPolygon,Ring:WR.Ring,Sprite:KR.Sprite,Star:YR.Star,Text:XR.Text,TextPath:ZR.TextPath,Transformer:QR.Transformer,Wedge:JR.Wedge,Filters:{Blur:eM.Blur,Brighten:tM.Brighten,Contrast:rM.Contrast,Emboss:nM.Emboss,Enhance:iM.Enhance,Grayscale:aM.Grayscale,HSL:oM.HSL,HSV:lM.HSV,Invert:sM.Invert,Kaleidoscope:uM.Kaleidoscope,Mask:cM.Mask,Noise:fM.Noise,Pixelate:dM.Pixelate,Posterize:hM.Posterize,RGB:pM.RGB,RGBA:gM.RGBA,Sepia:vM.Sepia,Solarize:mM.Solarize,Threshold:yM.Threshold}});var bM=Ny.exports;Object.defineProperty(bM,"__esModule",{value:!0});const _M=ep;Ny.exports=_M.Konva;var wi=Ny.exports,gm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=mh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=mh;e.exports=n.Konva})(gm,gm.exports);var wM=gm.exports;const Ec=Ph(wM);var F9={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 SM=function(t){var r={},n=rt,i=Uu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,T=1;T<arguments.length;T++)c+="&args[]="+encodeURIComponent(arguments[T]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),_=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),w=Symbol.iterator;function k(s){return s===null||typeof s!="object"?null:(s=w&&s[w]||s["@@iterator"],typeof s=="function"?s:null)}function P(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case h:return"Fragment";case f:return"Portal";case S:return"Profiler";case O:return"StrictMode";case p:return"Suspense";case v:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case _:return(s.displayName||"Context")+".Consumer";case b:return(s._context.displayName||"Context")+".Provider";case y:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case m:return c=s.displayName||null,c!==null?c:P(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return P(s(c))}catch{}}return null}function A(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return P(c);case 8:return c===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function E(s){var c=s,T=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(T=c.return),s=c.return;while(s)}return c.tag===3?T:null}function x(s){if(E(s)!==s)throw Error(o(188))}function C(s){var c=s.alternate;if(!c){if(c=E(s),c===null)throw Error(o(188));return c!==s?null:s}for(var T=s,I=c;;){var j=T.return;if(j===null)break;var V=j.alternate;if(V===null){if(I=j.return,I!==null){T=I;continue}break}if(j.child===V.child){for(V=j.child;V;){if(V===T)return x(j),s;if(V===I)return x(j),c;V=V.sibling}throw Error(o(188))}if(T.return!==I.return)T=j,I=V;else{for(var ee=!1,se=j.child;se;){if(se===T){ee=!0,T=j,I=V;break}if(se===I){ee=!0,I=j,T=V;break}se=se.sibling}if(!ee){for(se=V.child;se;){if(se===T){ee=!0,T=V,I=j;break}if(se===I){ee=!0,I=V,T=j;break}se=se.sibling}if(!ee)throw Error(o(189))}}if(T.alternate!==I)throw Error(o(190))}if(T.tag!==3)throw Error(o(188));return T.stateNode.current===T?s:c}function R(s){return s=C(s),s!==null?N(s):null}function N(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=N(s);if(c!==null)return c;s=s.sibling}return null}function U(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=U(s);if(c!==null)return c}s=s.sibling}return null}var G=Array.isArray,Z=t.getPublicInstance,W=t.getRootHostContext,H=t.getChildHostContext,L=t.prepareForCommit,M=t.resetAfterCommit,D=t.createInstance,B=t.appendInitialChild,q=t.finalizeInitialChildren,K=t.prepareUpdate,z=t.shouldSetTextContent,$=t.createTextInstance,F=t.scheduleTimeout,Y=t.cancelTimeout,X=t.noTimeout,Q=t.isPrimaryRenderer,J=t.supportsMutation,re=t.supportsPersistence,ie=t.supportsHydration,ne=t.getInstanceFromNode,ae=t.preparePortalMount,ke=t.getCurrentEventPriority,Ae=t.detachDeletedInstance,oe=t.supportsMicrotasks,ce=t.scheduleMicrotask,_e=t.supportsTestSelectors,ye=t.findFiberRoot,te=t.getBoundingRect,le=t.getTextContent,me=t.isHiddenSubtree,Ee=t.matchAccessibilityRole,We=t.setFocusIfFocusable,Qe=t.setupIntersectionObserver,Re=t.appendChild,Pe=t.appendChildToContainer,Oe=t.commitTextUpdate,Ne=t.commitMount,Je=t.commitUpdate,fe=t.insertBefore,de=t.insertInContainerBefore,Xe=t.removeChild,be=t.removeChildFromContainer,Ie=t.resetTextContent,Me=t.hideInstance,we=t.hideTextInstance,et=t.unhideInstance,Se=t.unhideTextInstance,Ye=t.clearContainer,Le=t.cloneInstance,je=t.createContainerChildSet,Ve=t.appendChildToContainerChildSet,pt=t.finalizeContainerChildren,Ot=t.replaceContainerChildren,Qr=t.cloneHiddenInstance,Or=t.cloneHiddenTextInstance,Mr=t.canHydrateInstance,Jr=t.canHydrateTextInstance,Si=t.canHydrateSuspenseInstance,yn=t.isSuspenseInstancePending,Gr=t.isSuspenseInstanceFallback,Ra=t.getSuspenseInstanceFallbackErrorDetails,Rn=t.registerSuspenseInstanceRetry,De=t.getNextHydratableSibling,tt=t.getFirstHydratableChild,yt=t.getFirstHydratableChildWithinContainer,Xt=t.getFirstHydratableChildWithinSuspenseInstance,Ct=t.hydrateInstance,or=t.hydrateTextInstance,Lr=t.hydrateSuspenseInstance,lr=t.getNextHydratableInstanceAfterSuspenseInstance,Mn=t.commitHydratedContainer,Ei=t.commitHydratedSuspenseInstance,Qi=t.clearSuspenseBoundary,Ma=t.clearSuspenseBoundaryFromContainer,au=t.shouldDeleteUnhydratedTailInstances,Ro=t.didNotMatchHydratedContainerTextInstance,Mo=t.didNotMatchHydratedTextInstance,Oi;function La(s){if(Oi===void 0)try{throw Error()}catch(T){var c=T.stack.trim().match(/\n( *(at )?)/);Oi=c&&c[1]||""}return`
|
|
52
|
+
`+Oi+s}var Rl=!1;function t0(s,c){if(!s||Rl)return"";Rl=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Ce){var I=Ce}Reflect.construct(s,[],c)}else{try{c.call()}catch(Ce){I=Ce}s.call(c.prototype)}else{try{throw Error()}catch(Ce){I=Ce}s()}}catch(Ce){if(Ce&&I&&typeof Ce.stack=="string"){for(var j=Ce.stack.split(`
|
|
53
|
+
`),V=I.stack.split(`
|
|
54
|
+
`),ee=j.length-1,se=V.length-1;1<=ee&&0<=se&&j[ee]!==V[se];)se--;for(;1<=ee&&0<=se;ee--,se--)if(j[ee]!==V[se]){if(ee!==1||se!==1)do if(ee--,se--,0>se||j[ee]!==V[se]){var pe=`
|
|
55
|
+
`+j[ee].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=ee&&0<=se);break}}}finally{Rl=!1,Error.prepareStackTrace=T}return(s=s?s.displayName||s.name:"")?La(s):""}var NS=Object.prototype.hasOwnProperty,r0=[],Ml=-1;function Na(s){return{current:s}}function Dt(s){0>Ml||(s.current=r0[Ml],r0[Ml]=null,Ml--)}function Mt(s,c){Ml++,r0[Ml]=s.current,s.current=c}var Ia={},Nr=Na(Ia),en=Na(!1),Lo=Ia;function Ll(s,c){var T=s.type.contextTypes;if(!T)return Ia;var I=s.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===c)return I.__reactInternalMemoizedMaskedChildContext;var j={},V;for(V in T)j[V]=c[V];return I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=j),j}function tn(s){return s=s.childContextTypes,s!=null}function Jc(){Dt(en),Dt(Nr)}function P2(s,c,T){if(Nr.current!==Ia)throw Error(o(168));Mt(Nr,c),Mt(en,T)}function C2(s,c,T){var I=s.stateNode;if(c=c.childContextTypes,typeof I.getChildContext!="function")return T;I=I.getChildContext();for(var j in I)if(!(j in c))throw Error(o(108,A(s)||"Unknown",j));return a({},T,I)}function ef(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Ia,Lo=Nr.current,Mt(Nr,s),Mt(en,en.current),!0}function k2(s,c,T){var I=s.stateNode;if(!I)throw Error(o(169));T?(s=C2(s,c,Lo),I.__reactInternalMemoizedMergedChildContext=s,Dt(en),Dt(Nr),Mt(Nr,s)):Dt(en),Mt(en,T)}var Jn=Math.clz32?Math.clz32:jS,IS=Math.log,DS=Math.LN2;function jS(s){return s>>>=0,s===0?32:31-(IS(s)/DS|0)|0}var tf=64,rf=4194304;function ou(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function nf(s,c){var T=s.pendingLanes;if(T===0)return 0;var I=0,j=s.suspendedLanes,V=s.pingedLanes,ee=T&268435455;if(ee!==0){var se=ee&~j;se!==0?I=ou(se):(V&=ee,V!==0&&(I=ou(V)))}else ee=T&~j,ee!==0?I=ou(ee):V!==0&&(I=ou(V));if(I===0)return 0;if(c!==0&&c!==I&&!(c&j)&&(j=I&-I,V=c&-c,j>=V||j===16&&(V&4194240)!==0))return c;if(I&4&&(I|=T&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=I;0<c;)T=31-Jn(c),j=1<<T,I|=s[T],c&=~j;return I}function FS(s,c){switch(s){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zS(s,c){for(var T=s.suspendedLanes,I=s.pingedLanes,j=s.expirationTimes,V=s.pendingLanes;0<V;){var ee=31-Jn(V),se=1<<ee,pe=j[ee];pe===-1?(!(se&T)||se&I)&&(j[ee]=FS(se,c)):pe<=c&&(s.expiredLanes|=se),V&=~se}}function n0(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function T2(){var s=tf;return tf<<=1,!(tf&4194240)&&(tf=64),s}function i0(s){for(var c=[],T=0;31>T;T++)c.push(s);return c}function lu(s,c,T){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Jn(c),s[c]=T}function BS(s,c){var T=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var I=s.eventTimes;for(s=s.expirationTimes;0<T;){var j=31-Jn(T),V=1<<j;c[j]=0,I[j]=-1,s[j]=-1,T&=~V}}function a0(s,c){var T=s.entangledLanes|=c;for(s=s.entanglements;T;){var I=31-Jn(T),j=1<<I;j&c|s[I]&c&&(s[I]|=c),T&=~j}}var bt=0;function A2(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var o0=i.unstable_scheduleCallback,R2=i.unstable_cancelCallback,US=i.unstable_shouldYield,HS=i.unstable_requestPaint,mr=i.unstable_now,l0=i.unstable_ImmediatePriority,$S=i.unstable_UserBlockingPriority,s0=i.unstable_NormalPriority,GS=i.unstable_IdlePriority,af=null,xi=null;function VS(s){if(xi&&typeof xi.onCommitFiberRoot=="function")try{xi.onCommitFiberRoot(af,s,void 0,(s.current.flags&128)===128)}catch{}}function qS(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var ei=typeof Object.is=="function"?Object.is:qS,Ji=null,of=!1,u0=!1;function M2(s){Ji===null?Ji=[s]:Ji.push(s)}function WS(s){of=!0,M2(s)}function Pi(){if(!u0&&Ji!==null){u0=!0;var s=0,c=bt;try{var T=Ji;for(bt=1;s<T.length;s++){var I=T[s];do I=I(!0);while(I!==null)}Ji=null,of=!1}catch(j){throw Ji!==null&&(Ji=Ji.slice(s+1)),o0(l0,Pi),j}finally{bt=c,u0=!1}}return null}var Nl=[],Il=0,lf=null,sf=0,Ln=[],Nn=0,No=null,ea=1,ta="";function Io(s,c){Nl[Il++]=sf,Nl[Il++]=lf,lf=s,sf=c}function L2(s,c,T){Ln[Nn++]=ea,Ln[Nn++]=ta,Ln[Nn++]=No,No=s;var I=ea;s=ta;var j=32-Jn(I)-1;I&=~(1<<j),T+=1;var V=32-Jn(c)+j;if(30<V){var ee=j-j%5;V=(I&(1<<ee)-1).toString(32),I>>=ee,j-=ee,ea=1<<32-Jn(c)+j|T<<j|I,ta=V+s}else ea=1<<V|T<<j|I,ta=s}function c0(s){s.return!==null&&(Io(s,1),L2(s,1,0))}function f0(s){for(;s===lf;)lf=Nl[--Il],Nl[Il]=null,sf=Nl[--Il],Nl[Il]=null;for(;s===No;)No=Ln[--Nn],Ln[Nn]=null,ta=Ln[--Nn],Ln[Nn]=null,ea=Ln[--Nn],Ln[Nn]=null}var bn=null,In=null,Bt=!1,su=!1,ti=null;function N2(s,c){var T=Bn(5,null,null,0);T.elementType="DELETED",T.stateNode=c,T.return=s,c=s.deletions,c===null?(s.deletions=[T],s.flags|=16):c.push(T)}function I2(s,c){switch(s.tag){case 5:return c=Mr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,bn=s,In=tt(c),!0):!1;case 6:return c=Jr(c,s.pendingProps),c!==null?(s.stateNode=c,bn=s,In=null,!0):!1;case 13:if(c=Si(c),c!==null){var T=No!==null?{id:ea,overflow:ta}:null;return s.memoizedState={dehydrated:c,treeContext:T,retryLane:1073741824},T=Bn(18,null,null,0),T.stateNode=c,T.return=s,s.child=T,bn=s,In=null,!0}return!1;default:return!1}}function d0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function h0(s){if(Bt){var c=In;if(c){var T=c;if(!I2(s,c)){if(d0(s))throw Error(o(418));c=De(T);var I=bn;c&&I2(s,c)?N2(I,T):(s.flags=s.flags&-4097|2,Bt=!1,bn=s)}}else{if(d0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Bt=!1,bn=s}}}function D2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;bn=s}function uf(s){if(!ie||s!==bn)return!1;if(!Bt)return D2(s),Bt=!0,!1;if(s.tag!==3&&(s.tag!==5||au(s.type)&&!z(s.type,s.memoizedProps))){var c=In;if(c){if(d0(s))throw j2(),Error(o(418));for(;c;)N2(s,c),c=De(c)}}if(D2(s),s.tag===13){if(!ie)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));In=lr(s)}else In=bn?De(s.stateNode):null;return!0}function j2(){for(var s=In;s;)s=De(s)}function Dl(){ie&&(In=bn=null,su=Bt=!1)}function p0(s){ti===null?ti=[s]:ti.push(s)}var KS=l.ReactCurrentBatchConfig;function cf(s,c){if(ei(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var T=Object.keys(s),I=Object.keys(c);if(T.length!==I.length)return!1;for(I=0;I<T.length;I++){var j=T[I];if(!NS.call(c,j)||!ei(s[j],c[j]))return!1}return!0}function YS(s){switch(s.tag){case 5:return La(s.type);case 16:return La("Lazy");case 13:return La("Suspense");case 19:return La("SuspenseList");case 0:case 2:case 15:return s=t0(s.type,!1),s;case 11:return s=t0(s.type.render,!1),s;case 1:return s=t0(s.type,!0),s;default:return""}}function uu(s,c,T){if(s=T.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(T._owner){if(T=T._owner,T){if(T.tag!==1)throw Error(o(309));var I=T.stateNode}if(!I)throw Error(o(147,s));var j=I,V=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===V?c.ref:(c=function(ee){var se=j.refs;ee===null?delete se[V]:se[V]=ee},c._stringRef=V,c)}if(typeof s!="string")throw Error(o(284));if(!T._owner)throw Error(o(290,s))}return s}function ff(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function F2(s){var c=s._init;return c(s._payload)}function z2(s){function c(he,ue){if(s){var ge=he.deletions;ge===null?(he.deletions=[ue],he.flags|=16):ge.push(ue)}}function T(he,ue){if(!s)return null;for(;ue!==null;)c(he,ue),ue=ue.sibling;return null}function I(he,ue){for(he=new Map;ue!==null;)ue.key!==null?he.set(ue.key,ue):he.set(ue.index,ue),ue=ue.sibling;return he}function j(he,ue){return he=Ha(he,ue),he.index=0,he.sibling=null,he}function V(he,ue,ge){return he.index=ge,s?(ge=he.alternate,ge!==null?(ge=ge.index,ge<ue?(he.flags|=2,ue):ge):(he.flags|=2,ue)):(he.flags|=1048576,ue)}function ee(he){return s&&he.alternate===null&&(he.flags|=2),he}function se(he,ue,ge,ze){return ue===null||ue.tag!==6?(ue=u1(ge,he.mode,ze),ue.return=he,ue):(ue=j(ue,ge),ue.return=he,ue)}function pe(he,ue,ge,ze){var Ze=ge.type;return Ze===h?$e(he,ue,ge.props.children,ze,ge.key):ue!==null&&(ue.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===d&&F2(Ze)===ue.type)?(ze=j(ue,ge.props),ze.ref=uu(he,ue,ge),ze.return=he,ze):(ze=Hf(ge.type,ge.key,ge.props,null,he.mode,ze),ze.ref=uu(he,ue,ge),ze.return=he,ze)}function Ce(he,ue,ge,ze){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ge.containerInfo||ue.stateNode.implementation!==ge.implementation?(ue=c1(ge,he.mode,ze),ue.return=he,ue):(ue=j(ue,ge.children||[]),ue.return=he,ue)}function $e(he,ue,ge,ze,Ze){return ue===null||ue.tag!==7?(ue=Ho(ge,he.mode,ze,Ze),ue.return=he,ue):(ue=j(ue,ge),ue.return=he,ue)}function it(he,ue,ge){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return ue=u1(""+ue,he.mode,ge),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case u:return ge=Hf(ue.type,ue.key,ue.props,null,he.mode,ge),ge.ref=uu(he,null,ue),ge.return=he,ge;case f:return ue=c1(ue,he.mode,ge),ue.return=he,ue;case d:var ze=ue._init;return it(he,ze(ue._payload),ge)}if(G(ue)||k(ue))return ue=Ho(ue,he.mode,ge,null),ue.return=he,ue;ff(he,ue)}return null}function Fe(he,ue,ge,ze){var Ze=ue!==null?ue.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return Ze!==null?null:se(he,ue,""+ge,ze);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:return ge.key===Ze?pe(he,ue,ge,ze):null;case f:return ge.key===Ze?Ce(he,ue,ge,ze):null;case d:return Ze=ge._init,Fe(he,ue,Ze(ge._payload),ze)}if(G(ge)||k(ge))return Ze!==null?null:$e(he,ue,ge,ze,null);ff(he,ge)}return null}function jt(he,ue,ge,ze,Ze){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return he=he.get(ge)||null,se(ue,he,""+ze,Ze);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case u:return he=he.get(ze.key===null?ge:ze.key)||null,pe(ue,he,ze,Ze);case f:return he=he.get(ze.key===null?ge:ze.key)||null,Ce(ue,he,ze,Ze);case d:var st=ze._init;return jt(he,ue,ge,st(ze._payload),Ze)}if(G(ze)||k(ze))return he=he.get(ge)||null,$e(ue,he,ze,Ze,null);ff(ue,ze)}return null}function At(he,ue,ge,ze){for(var Ze=null,st=null,at=ue,_t=ue=0,_r=null;at!==null&&_t<ge.length;_t++){at.index>_t?(_r=at,at=null):_r=at.sibling;var wt=Fe(he,at,ge[_t],ze);if(wt===null){at===null&&(at=_r);break}s&&at&&wt.alternate===null&&c(he,at),ue=V(wt,ue,_t),st===null?Ze=wt:st.sibling=wt,st=wt,at=_r}if(_t===ge.length)return T(he,at),Bt&&Io(he,_t),Ze;if(at===null){for(;_t<ge.length;_t++)at=it(he,ge[_t],ze),at!==null&&(ue=V(at,ue,_t),st===null?Ze=at:st.sibling=at,st=at);return Bt&&Io(he,_t),Ze}for(at=I(he,at);_t<ge.length;_t++)_r=jt(at,he,_t,ge[_t],ze),_r!==null&&(s&&_r.alternate!==null&&at.delete(_r.key===null?_t:_r.key),ue=V(_r,ue,_t),st===null?Ze=_r:st.sibling=_r,st=_r);return s&&at.forEach(function($a){return c(he,$a)}),Bt&&Io(he,_t),Ze}function on(he,ue,ge,ze){var Ze=k(ge);if(typeof Ze!="function")throw Error(o(150));if(ge=Ze.call(ge),ge==null)throw Error(o(151));for(var st=Ze=null,at=ue,_t=ue=0,_r=null,wt=ge.next();at!==null&&!wt.done;_t++,wt=ge.next()){at.index>_t?(_r=at,at=null):_r=at.sibling;var $a=Fe(he,at,wt.value,ze);if($a===null){at===null&&(at=_r);break}s&&at&&$a.alternate===null&&c(he,at),ue=V($a,ue,_t),st===null?Ze=$a:st.sibling=$a,st=$a,at=_r}if(wt.done)return T(he,at),Bt&&Io(he,_t),Ze;if(at===null){for(;!wt.done;_t++,wt=ge.next())wt=it(he,wt.value,ze),wt!==null&&(ue=V(wt,ue,_t),st===null?Ze=wt:st.sibling=wt,st=wt);return Bt&&Io(he,_t),Ze}for(at=I(he,at);!wt.done;_t++,wt=ge.next())wt=jt(at,he,_t,wt.value,ze),wt!==null&&(s&&wt.alternate!==null&&at.delete(wt.key===null?_t:wt.key),ue=V(wt,ue,_t),st===null?Ze=wt:st.sibling=wt,st=wt);return s&&at.forEach(function(xE){return c(he,xE)}),Bt&&Io(he,_t),Ze}function aa(he,ue,ge,ze){if(typeof ge=="object"&&ge!==null&&ge.type===h&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:e:{for(var Ze=ge.key,st=ue;st!==null;){if(st.key===Ze){if(Ze=ge.type,Ze===h){if(st.tag===7){T(he,st.sibling),ue=j(st,ge.props.children),ue.return=he,he=ue;break e}}else if(st.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===d&&F2(Ze)===st.type){T(he,st.sibling),ue=j(st,ge.props),ue.ref=uu(he,st,ge),ue.return=he,he=ue;break e}T(he,st);break}else c(he,st);st=st.sibling}ge.type===h?(ue=Ho(ge.props.children,he.mode,ze,ge.key),ue.return=he,he=ue):(ze=Hf(ge.type,ge.key,ge.props,null,he.mode,ze),ze.ref=uu(he,ue,ge),ze.return=he,he=ze)}return ee(he);case f:e:{for(st=ge.key;ue!==null;){if(ue.key===st)if(ue.tag===4&&ue.stateNode.containerInfo===ge.containerInfo&&ue.stateNode.implementation===ge.implementation){T(he,ue.sibling),ue=j(ue,ge.children||[]),ue.return=he,he=ue;break e}else{T(he,ue);break}else c(he,ue);ue=ue.sibling}ue=c1(ge,he.mode,ze),ue.return=he,he=ue}return ee(he);case d:return st=ge._init,aa(he,ue,st(ge._payload),ze)}if(G(ge))return At(he,ue,ge,ze);if(k(ge))return on(he,ue,ge,ze);ff(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,ue!==null&&ue.tag===6?(T(he,ue.sibling),ue=j(ue,ge),ue.return=he,he=ue):(T(he,ue),ue=u1(ge,he.mode,ze),ue.return=he,he=ue),ee(he)):T(he,ue)}return aa}var jl=z2(!0),B2=z2(!1),df=Na(null),hf=null,Fl=null,g0=null;function v0(){g0=Fl=hf=null}function U2(s,c,T){Q?(Mt(df,c._currentValue),c._currentValue=T):(Mt(df,c._currentValue2),c._currentValue2=T)}function m0(s){var c=df.current;Dt(df),Q?s._currentValue=c:s._currentValue2=c}function y0(s,c,T){for(;s!==null;){var I=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,I!==null&&(I.childLanes|=c)):I!==null&&(I.childLanes&c)!==c&&(I.childLanes|=c),s===T)break;s=s.return}}function zl(s,c){hf=s,g0=Fl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(rn=!0),s.firstContext=null)}function Dn(s){var c=Q?s._currentValue:s._currentValue2;if(g0!==s)if(s={context:s,memoizedValue:c,next:null},Fl===null){if(hf===null)throw Error(o(308));Fl=s,hf.dependencies={lanes:0,firstContext:s}}else Fl=Fl.next=s;return c}var Do=null;function b0(s){Do===null?Do=[s]:Do.push(s)}function H2(s,c,T,I){var j=c.interleaved;return j===null?(T.next=T,b0(c)):(T.next=j.next,j.next=T),c.interleaved=T,Ci(s,I)}function Ci(s,c){s.lanes|=c;var T=s.alternate;for(T!==null&&(T.lanes|=c),T=s,s=s.return;s!==null;)s.childLanes|=c,T=s.alternate,T!==null&&(T.childLanes|=c),T=s,s=s.return;return T.tag===3?T.stateNode:null}var Da=!1;function _0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $2(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function ra(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function ja(s,c,T){var I=s.updateQueue;if(I===null)return null;if(I=I.shared,ft&2){var j=I.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),I.pending=c,Ci(s,T)}return j=I.interleaved,j===null?(c.next=c,b0(I)):(c.next=j.next,j.next=c),I.interleaved=c,Ci(s,T)}function pf(s,c,T){if(c=c.updateQueue,c!==null&&(c=c.shared,(T&4194240)!==0)){var I=c.lanes;I&=s.pendingLanes,T|=I,c.lanes=T,a0(s,T)}}function G2(s,c){var T=s.updateQueue,I=s.alternate;if(I!==null&&(I=I.updateQueue,T===I)){var j=null,V=null;if(T=T.firstBaseUpdate,T!==null){do{var ee={eventTime:T.eventTime,lane:T.lane,tag:T.tag,payload:T.payload,callback:T.callback,next:null};V===null?j=V=ee:V=V.next=ee,T=T.next}while(T!==null);V===null?j=V=c:V=V.next=c}else j=V=c;T={baseState:I.baseState,firstBaseUpdate:j,lastBaseUpdate:V,shared:I.shared,effects:I.effects},s.updateQueue=T;return}s=T.lastBaseUpdate,s===null?T.firstBaseUpdate=c:s.next=c,T.lastBaseUpdate=c}function gf(s,c,T,I){var j=s.updateQueue;Da=!1;var V=j.firstBaseUpdate,ee=j.lastBaseUpdate,se=j.shared.pending;if(se!==null){j.shared.pending=null;var pe=se,Ce=pe.next;pe.next=null,ee===null?V=Ce:ee.next=Ce,ee=pe;var $e=s.alternate;$e!==null&&($e=$e.updateQueue,se=$e.lastBaseUpdate,se!==ee&&(se===null?$e.firstBaseUpdate=Ce:se.next=Ce,$e.lastBaseUpdate=pe))}if(V!==null){var it=j.baseState;ee=0,$e=Ce=pe=null,se=V;do{var Fe=se.lane,jt=se.eventTime;if((I&Fe)===Fe){$e!==null&&($e=$e.next={eventTime:jt,lane:0,tag:se.tag,payload:se.payload,callback:se.callback,next:null});e:{var At=s,on=se;switch(Fe=c,jt=T,on.tag){case 1:if(At=on.payload,typeof At=="function"){it=At.call(jt,it,Fe);break e}it=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=on.payload,Fe=typeof At=="function"?At.call(jt,it,Fe):At,Fe==null)break e;it=a({},it,Fe);break e;case 2:Da=!0}}se.callback!==null&&se.lane!==0&&(s.flags|=64,Fe=j.effects,Fe===null?j.effects=[se]:Fe.push(se))}else jt={eventTime:jt,lane:Fe,tag:se.tag,payload:se.payload,callback:se.callback,next:null},$e===null?(Ce=$e=jt,pe=it):$e=$e.next=jt,ee|=Fe;if(se=se.next,se===null){if(se=j.shared.pending,se===null)break;Fe=se,se=Fe.next,Fe.next=null,j.lastBaseUpdate=Fe,j.shared.pending=null}}while(!0);if($e===null&&(pe=it),j.baseState=pe,j.firstBaseUpdate=Ce,j.lastBaseUpdate=$e,c=j.shared.interleaved,c!==null){j=c;do ee|=j.lane,j=j.next;while(j!==c)}else V===null&&(j.shared.lanes=0);Fo|=ee,s.lanes=ee,s.memoizedState=it}}function V2(s,c,T){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var I=s[c],j=I.callback;if(j!==null){if(I.callback=null,I=T,typeof j!="function")throw Error(o(191,j));j.call(I)}}}var cu={},jn=Na(cu),fu=Na(cu),Bl=Na(cu);function ki(s){if(s===cu)throw Error(o(174));return s}function w0(s,c){Mt(Bl,c),Mt(fu,s),Mt(jn,cu),s=W(c),Dt(jn),Mt(jn,s)}function Ul(){Dt(jn),Dt(fu),Dt(Bl)}function q2(s){var c=ki(Bl.current),T=ki(jn.current);c=H(T,s.type,c),T!==c&&(Mt(fu,s),Mt(jn,c))}function S0(s){fu.current===s&&(Dt(jn),Dt(fu))}var Gt=Na(0);function vf(s){for(var c=s;c!==null;){if(c.tag===13){var T=c.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||yn(T)||Gr(T)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var E0=[];function O0(){for(var s=0;s<E0.length;s++){var c=E0[s];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}E0.length=0}var mf=l.ReactCurrentDispatcher,x0=l.ReactCurrentBatchConfig,jo=0,Vt=null,sr=null,yr=null,yf=!1,du=!1,hu=0,XS=0;function Ir(){throw Error(o(321))}function P0(s,c){if(c===null)return!1;for(var T=0;T<c.length&&T<s.length;T++)if(!ei(s[T],c[T]))return!1;return!0}function C0(s,c,T,I,j,V){if(jo=V,Vt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,mf.current=s===null||s.memoizedState===null?eE:tE,s=T(I,j),du){V=0;do{if(du=!1,hu=0,25<=V)throw Error(o(301));V+=1,yr=sr=null,c.updateQueue=null,mf.current=rE,s=T(I,j)}while(du)}if(mf.current=wf,c=sr!==null&&sr.next!==null,jo=0,yr=sr=Vt=null,yf=!1,c)throw Error(o(300));return s}function k0(){var s=hu!==0;return hu=0,s}function Ti(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yr===null?Vt.memoizedState=yr=s:yr=yr.next=s,yr}function Fn(){if(sr===null){var s=Vt.alternate;s=s!==null?s.memoizedState:null}else s=sr.next;var c=yr===null?Vt.memoizedState:yr.next;if(c!==null)yr=c,sr=s;else{if(s===null)throw Error(o(310));sr=s,s={memoizedState:sr.memoizedState,baseState:sr.baseState,baseQueue:sr.baseQueue,queue:sr.queue,next:null},yr===null?Vt.memoizedState=yr=s:yr=yr.next=s}return yr}function pu(s,c){return typeof c=="function"?c(s):c}function T0(s){var c=Fn(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var I=sr,j=I.baseQueue,V=T.pending;if(V!==null){if(j!==null){var ee=j.next;j.next=V.next,V.next=ee}I.baseQueue=j=V,T.pending=null}if(j!==null){V=j.next,I=I.baseState;var se=ee=null,pe=null,Ce=V;do{var $e=Ce.lane;if((jo&$e)===$e)pe!==null&&(pe=pe.next={lane:0,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null}),I=Ce.hasEagerState?Ce.eagerState:s(I,Ce.action);else{var it={lane:$e,action:Ce.action,hasEagerState:Ce.hasEagerState,eagerState:Ce.eagerState,next:null};pe===null?(se=pe=it,ee=I):pe=pe.next=it,Vt.lanes|=$e,Fo|=$e}Ce=Ce.next}while(Ce!==null&&Ce!==V);pe===null?ee=I:pe.next=se,ei(I,c.memoizedState)||(rn=!0),c.memoizedState=I,c.baseState=ee,c.baseQueue=pe,T.lastRenderedState=I}if(s=T.interleaved,s!==null){j=s;do V=j.lane,Vt.lanes|=V,Fo|=V,j=j.next;while(j!==s)}else j===null&&(T.lanes=0);return[c.memoizedState,T.dispatch]}function A0(s){var c=Fn(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var I=T.dispatch,j=T.pending,V=c.memoizedState;if(j!==null){T.pending=null;var ee=j=j.next;do V=s(V,ee.action),ee=ee.next;while(ee!==j);ei(V,c.memoizedState)||(rn=!0),c.memoizedState=V,c.baseQueue===null&&(c.baseState=V),T.lastRenderedState=V}return[V,I]}function W2(){}function K2(s,c){var T=Vt,I=Fn(),j=c(),V=!ei(I.memoizedState,j);if(V&&(I.memoizedState=j,rn=!0),I=I.queue,R0(Z2.bind(null,T,I,s),[s]),I.getSnapshot!==c||V||yr!==null&&yr.memoizedState.tag&1){if(T.flags|=2048,gu(9,X2.bind(null,T,I,j,c),void 0,null),br===null)throw Error(o(349));jo&30||Y2(T,c,j)}return j}function Y2(s,c,T){s.flags|=16384,s={getSnapshot:c,value:T},c=Vt.updateQueue,c===null?(c={lastEffect:null,stores:null},Vt.updateQueue=c,c.stores=[s]):(T=c.stores,T===null?c.stores=[s]:T.push(s))}function X2(s,c,T,I){c.value=T,c.getSnapshot=I,Q2(c)&&J2(s)}function Z2(s,c,T){return T(function(){Q2(c)&&J2(s)})}function Q2(s){var c=s.getSnapshot;s=s.value;try{var T=c();return!ei(s,T)}catch{return!0}}function J2(s){var c=Ci(s,1);c!==null&&zn(c,s,1,-1)}function eb(s){var c=Ti();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pu,lastRenderedState:s},c.queue=s,s=s.dispatch=JS.bind(null,Vt,s),[c.memoizedState,s]}function gu(s,c,T,I){return s={tag:s,create:c,destroy:T,deps:I,next:null},c=Vt.updateQueue,c===null?(c={lastEffect:null,stores:null},Vt.updateQueue=c,c.lastEffect=s.next=s):(T=c.lastEffect,T===null?c.lastEffect=s.next=s:(I=T.next,T.next=s,s.next=I,c.lastEffect=s)),s}function tb(){return Fn().memoizedState}function bf(s,c,T,I){var j=Ti();Vt.flags|=s,j.memoizedState=gu(1|c,T,void 0,I===void 0?null:I)}function _f(s,c,T,I){var j=Fn();I=I===void 0?null:I;var V=void 0;if(sr!==null){var ee=sr.memoizedState;if(V=ee.destroy,I!==null&&P0(I,ee.deps)){j.memoizedState=gu(c,T,V,I);return}}Vt.flags|=s,j.memoizedState=gu(1|c,T,V,I)}function rb(s,c){return bf(8390656,8,s,c)}function R0(s,c){return _f(2048,8,s,c)}function nb(s,c){return _f(4,2,s,c)}function ib(s,c){return _f(4,4,s,c)}function ab(s,c){if(typeof c=="function")return s=s(),c(s),function(){c(null)};if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function ob(s,c,T){return T=T!=null?T.concat([s]):null,_f(4,4,ab.bind(null,c,s),T)}function M0(){}function lb(s,c){var T=Fn();c=c===void 0?null:c;var I=T.memoizedState;return I!==null&&c!==null&&P0(c,I[1])?I[0]:(T.memoizedState=[s,c],s)}function sb(s,c){var T=Fn();c=c===void 0?null:c;var I=T.memoizedState;return I!==null&&c!==null&&P0(c,I[1])?I[0]:(s=s(),T.memoizedState=[s,c],s)}function ub(s,c,T){return jo&21?(ei(T,c)||(T=T2(),Vt.lanes|=T,Fo|=T,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,rn=!0),s.memoizedState=T)}function ZS(s,c){var T=bt;bt=T!==0&&4>T?T:4,s(!0);var I=x0.transition;x0.transition={};try{s(!1),c()}finally{bt=T,x0.transition=I}}function cb(){return Fn().memoizedState}function QS(s,c,T){var I=Ba(s);if(T={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null},fb(s))db(c,T);else if(T=H2(s,c,T,I),T!==null){var j=Fr();zn(T,s,I,j),hb(T,c,I)}}function JS(s,c,T){var I=Ba(s),j={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null};if(fb(s))db(c,j);else{var V=s.alternate;if(s.lanes===0&&(V===null||V.lanes===0)&&(V=c.lastRenderedReducer,V!==null))try{var ee=c.lastRenderedState,se=V(ee,T);if(j.hasEagerState=!0,j.eagerState=se,ei(se,ee)){var pe=c.interleaved;pe===null?(j.next=j,b0(c)):(j.next=pe.next,pe.next=j),c.interleaved=j;return}}catch{}finally{}T=H2(s,c,j,I),T!==null&&(j=Fr(),zn(T,s,I,j),hb(T,c,I))}}function fb(s){var c=s.alternate;return s===Vt||c!==null&&c===Vt}function db(s,c){du=yf=!0;var T=s.pending;T===null?c.next=c:(c.next=T.next,T.next=c),s.pending=c}function hb(s,c,T){if(T&4194240){var I=c.lanes;I&=s.pendingLanes,T|=I,c.lanes=T,a0(s,T)}}var wf={readContext:Dn,useCallback:Ir,useContext:Ir,useEffect:Ir,useImperativeHandle:Ir,useInsertionEffect:Ir,useLayoutEffect:Ir,useMemo:Ir,useReducer:Ir,useRef:Ir,useState:Ir,useDebugValue:Ir,useDeferredValue:Ir,useTransition:Ir,useMutableSource:Ir,useSyncExternalStore:Ir,useId:Ir,unstable_isNewReconciler:!1},eE={readContext:Dn,useCallback:function(s,c){return Ti().memoizedState=[s,c===void 0?null:c],s},useContext:Dn,useEffect:rb,useImperativeHandle:function(s,c,T){return T=T!=null?T.concat([s]):null,bf(4194308,4,ab.bind(null,c,s),T)},useLayoutEffect:function(s,c){return bf(4194308,4,s,c)},useInsertionEffect:function(s,c){return bf(4,2,s,c)},useMemo:function(s,c){var T=Ti();return c=c===void 0?null:c,s=s(),T.memoizedState=[s,c],s},useReducer:function(s,c,T){var I=Ti();return c=T!==void 0?T(c):c,I.memoizedState=I.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},I.queue=s,s=s.dispatch=QS.bind(null,Vt,s),[I.memoizedState,s]},useRef:function(s){var c=Ti();return s={current:s},c.memoizedState=s},useState:eb,useDebugValue:M0,useDeferredValue:function(s){return Ti().memoizedState=s},useTransition:function(){var s=eb(!1),c=s[0];return s=ZS.bind(null,s[1]),Ti().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,T){var I=Vt,j=Ti();if(Bt){if(T===void 0)throw Error(o(407));T=T()}else{if(T=c(),br===null)throw Error(o(349));jo&30||Y2(I,c,T)}j.memoizedState=T;var V={value:T,getSnapshot:c};return j.queue=V,rb(Z2.bind(null,I,V,s),[s]),I.flags|=2048,gu(9,X2.bind(null,I,V,T,c),void 0,null),T},useId:function(){var s=Ti(),c=br.identifierPrefix;if(Bt){var T=ta,I=ea;T=(I&~(1<<32-Jn(I)-1)).toString(32)+T,c=":"+c+"R"+T,T=hu++,0<T&&(c+="H"+T.toString(32)),c+=":"}else T=XS++,c=":"+c+"r"+T.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},tE={readContext:Dn,useCallback:lb,useContext:Dn,useEffect:R0,useImperativeHandle:ob,useInsertionEffect:nb,useLayoutEffect:ib,useMemo:sb,useReducer:T0,useRef:tb,useState:function(){return T0(pu)},useDebugValue:M0,useDeferredValue:function(s){var c=Fn();return ub(c,sr.memoizedState,s)},useTransition:function(){var s=T0(pu)[0],c=Fn().memoizedState;return[s,c]},useMutableSource:W2,useSyncExternalStore:K2,useId:cb,unstable_isNewReconciler:!1},rE={readContext:Dn,useCallback:lb,useContext:Dn,useEffect:R0,useImperativeHandle:ob,useInsertionEffect:nb,useLayoutEffect:ib,useMemo:sb,useReducer:A0,useRef:tb,useState:function(){return A0(pu)},useDebugValue:M0,useDeferredValue:function(s){var c=Fn();return sr===null?c.memoizedState=s:ub(c,sr.memoizedState,s)},useTransition:function(){var s=A0(pu)[0],c=Fn().memoizedState;return[s,c]},useMutableSource:W2,useSyncExternalStore:K2,useId:cb,unstable_isNewReconciler:!1};function ri(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var T in s)c[T]===void 0&&(c[T]=s[T]);return c}return c}function L0(s,c,T,I){c=s.memoizedState,T=T(I,c),T=T==null?c:a({},c,T),s.memoizedState=T,s.lanes===0&&(s.updateQueue.baseState=T)}var Sf={isMounted:function(s){return(s=s._reactInternals)?E(s)===s:!1},enqueueSetState:function(s,c,T){s=s._reactInternals;var I=Fr(),j=Ba(s),V=ra(I,j);V.payload=c,T!=null&&(V.callback=T),c=ja(s,V,j),c!==null&&(zn(c,s,j,I),pf(c,s,j))},enqueueReplaceState:function(s,c,T){s=s._reactInternals;var I=Fr(),j=Ba(s),V=ra(I,j);V.tag=1,V.payload=c,T!=null&&(V.callback=T),c=ja(s,V,j),c!==null&&(zn(c,s,j,I),pf(c,s,j))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var T=Fr(),I=Ba(s),j=ra(T,I);j.tag=2,c!=null&&(j.callback=c),c=ja(s,j,I),c!==null&&(zn(c,s,I,T),pf(c,s,I))}};function pb(s,c,T,I,j,V,ee){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(I,V,ee):c.prototype&&c.prototype.isPureReactComponent?!cf(T,I)||!cf(j,V):!0}function gb(s,c,T){var I=!1,j=Ia,V=c.contextType;return typeof V=="object"&&V!==null?V=Dn(V):(j=tn(c)?Lo:Nr.current,I=c.contextTypes,V=(I=I!=null)?Ll(s,j):Ia),c=new c(T,V),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Sf,s.stateNode=c,c._reactInternals=s,I&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=j,s.__reactInternalMemoizedMaskedChildContext=V),c}function vb(s,c,T,I){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(T,I),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(T,I),c.state!==s&&Sf.enqueueReplaceState(c,c.state,null)}function N0(s,c,T,I){var j=s.stateNode;j.props=T,j.state=s.memoizedState,j.refs={},_0(s);var V=c.contextType;typeof V=="object"&&V!==null?j.context=Dn(V):(V=tn(c)?Lo:Nr.current,j.context=Ll(s,V)),j.state=s.memoizedState,V=c.getDerivedStateFromProps,typeof V=="function"&&(L0(s,c,V,T),j.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(c=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),c!==j.state&&Sf.enqueueReplaceState(j,j.state,null),gf(s,T,j,I),j.state=s.memoizedState),typeof j.componentDidMount=="function"&&(s.flags|=4194308)}function Hl(s,c){try{var T="",I=c;do T+=YS(I),I=I.return;while(I);var j=T}catch(V){j=`
|
|
56
|
+
Error generating stack: `+V.message+`
|
|
57
|
+
`+V.stack}return{value:s,source:c,stack:j,digest:null}}function I0(s,c,T){return{value:s,source:null,stack:T??null,digest:c??null}}function D0(s,c){try{console.error(c.value)}catch(T){setTimeout(function(){throw T})}}var nE=typeof WeakMap=="function"?WeakMap:Map;function mb(s,c,T){T=ra(-1,T),T.tag=3,T.payload={element:null};var I=c.value;return T.callback=function(){Df||(Df=!0,r1=I),D0(s,c)},T}function yb(s,c,T){T=ra(-1,T),T.tag=3;var I=s.type.getDerivedStateFromError;if(typeof I=="function"){var j=c.value;T.payload=function(){return I(j)},T.callback=function(){D0(s,c)}}var V=s.stateNode;return V!==null&&typeof V.componentDidCatch=="function"&&(T.callback=function(){D0(s,c),typeof I!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var ee=c.stack;this.componentDidCatch(c.value,{componentStack:ee!==null?ee:""})}),T}function bb(s,c,T){var I=s.pingCache;if(I===null){I=s.pingCache=new nE;var j=new Set;I.set(c,j)}else j=I.get(c),j===void 0&&(j=new Set,I.set(c,j));j.has(T)||(j.add(T),s=mE.bind(null,s,c,T),c.then(s,s))}function _b(s){do{var c;if((c=s.tag===13)&&(c=s.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return s;s=s.return}while(s!==null);return null}function wb(s,c,T,I,j){return s.mode&1?(s.flags|=65536,s.lanes=j,s):(s===c?s.flags|=65536:(s.flags|=128,T.flags|=131072,T.flags&=-52805,T.tag===1&&(T.alternate===null?T.tag=17:(c=ra(-1,1),c.tag=2,ja(T,c,1))),T.lanes|=1),s)}var iE=l.ReactCurrentOwner,rn=!1;function Vr(s,c,T,I){c.child=s===null?B2(c,null,T,I):jl(c,s.child,T,I)}function Sb(s,c,T,I,j){T=T.render;var V=c.ref;return zl(c,j),I=C0(s,c,T,I,V,j),T=k0(),s!==null&&!rn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,na(s,c,j)):(Bt&&T&&c0(c),c.flags|=1,Vr(s,c,I,j),c.child)}function Eb(s,c,T,I,j){if(s===null){var V=T.type;return typeof V=="function"&&!s1(V)&&V.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(c.tag=15,c.type=V,Ob(s,c,V,I,j)):(s=Hf(T.type,null,I,c,c.mode,j),s.ref=c.ref,s.return=c,c.child=s)}if(V=s.child,!(s.lanes&j)){var ee=V.memoizedProps;if(T=T.compare,T=T!==null?T:cf,T(ee,I)&&s.ref===c.ref)return na(s,c,j)}return c.flags|=1,s=Ha(V,I),s.ref=c.ref,s.return=c,c.child=s}function Ob(s,c,T,I,j){if(s!==null){var V=s.memoizedProps;if(cf(V,I)&&s.ref===c.ref)if(rn=!1,c.pendingProps=I=V,(s.lanes&j)!==0)s.flags&131072&&(rn=!0);else return c.lanes=s.lanes,na(s,c,j)}return j0(s,c,T,I,j)}function xb(s,c,T){var I=c.pendingProps,j=I.children,V=s!==null?s.memoizedState:null;if(I.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(Gl,_n),_n|=T;else{if(!(T&1073741824))return s=V!==null?V.baseLanes|T:T,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Mt(Gl,_n),_n|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=V!==null?V.baseLanes:T,Mt(Gl,_n),_n|=I}else V!==null?(I=V.baseLanes|T,c.memoizedState=null):I=T,Mt(Gl,_n),_n|=I;return Vr(s,c,j,T),c.child}function Pb(s,c){var T=c.ref;(s===null&&T!==null||s!==null&&s.ref!==T)&&(c.flags|=512,c.flags|=2097152)}function j0(s,c,T,I,j){var V=tn(T)?Lo:Nr.current;return V=Ll(c,V),zl(c,j),T=C0(s,c,T,I,V,j),I=k0(),s!==null&&!rn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,na(s,c,j)):(Bt&&I&&c0(c),c.flags|=1,Vr(s,c,T,j),c.child)}function Cb(s,c,T,I,j){if(tn(T)){var V=!0;ef(c)}else V=!1;if(zl(c,j),c.stateNode===null)Of(s,c),gb(c,T,I),N0(c,T,I,j),I=!0;else if(s===null){var ee=c.stateNode,se=c.memoizedProps;ee.props=se;var pe=ee.context,Ce=T.contextType;typeof Ce=="object"&&Ce!==null?Ce=Dn(Ce):(Ce=tn(T)?Lo:Nr.current,Ce=Ll(c,Ce));var $e=T.getDerivedStateFromProps,it=typeof $e=="function"||typeof ee.getSnapshotBeforeUpdate=="function";it||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(se!==I||pe!==Ce)&&vb(c,ee,I,Ce),Da=!1;var Fe=c.memoizedState;ee.state=Fe,gf(c,I,ee,j),pe=c.memoizedState,se!==I||Fe!==pe||en.current||Da?(typeof $e=="function"&&(L0(c,T,$e,I),pe=c.memoizedState),(se=Da||pb(c,T,se,I,Fe,pe,Ce))?(it||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount=="function"&&(c.flags|=4194308)):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=I,c.memoizedState=pe),ee.props=I,ee.state=pe,ee.context=Ce,I=se):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),I=!1)}else{ee=c.stateNode,$2(s,c),se=c.memoizedProps,Ce=c.type===c.elementType?se:ri(c.type,se),ee.props=Ce,it=c.pendingProps,Fe=ee.context,pe=T.contextType,typeof pe=="object"&&pe!==null?pe=Dn(pe):(pe=tn(T)?Lo:Nr.current,pe=Ll(c,pe));var jt=T.getDerivedStateFromProps;($e=typeof jt=="function"||typeof ee.getSnapshotBeforeUpdate=="function")||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(se!==it||Fe!==pe)&&vb(c,ee,I,pe),Da=!1,Fe=c.memoizedState,ee.state=Fe,gf(c,I,ee,j);var At=c.memoizedState;se!==it||Fe!==At||en.current||Da?(typeof jt=="function"&&(L0(c,T,jt,I),At=c.memoizedState),(Ce=Da||pb(c,T,Ce,I,Fe,At,pe)||!1)?($e||typeof ee.UNSAFE_componentWillUpdate!="function"&&typeof ee.componentWillUpdate!="function"||(typeof ee.componentWillUpdate=="function"&&ee.componentWillUpdate(I,At,pe),typeof ee.UNSAFE_componentWillUpdate=="function"&&ee.UNSAFE_componentWillUpdate(I,At,pe)),typeof ee.componentDidUpdate=="function"&&(c.flags|=4),typeof ee.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof ee.componentDidUpdate!="function"||se===s.memoizedProps&&Fe===s.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||se===s.memoizedProps&&Fe===s.memoizedState||(c.flags|=1024),c.memoizedProps=I,c.memoizedState=At),ee.props=I,ee.state=At,ee.context=pe,I=Ce):(typeof ee.componentDidUpdate!="function"||se===s.memoizedProps&&Fe===s.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||se===s.memoizedProps&&Fe===s.memoizedState||(c.flags|=1024),I=!1)}return F0(s,c,T,I,V,j)}function F0(s,c,T,I,j,V){Pb(s,c);var ee=(c.flags&128)!==0;if(!I&&!ee)return j&&k2(c,T,!1),na(s,c,V);I=c.stateNode,iE.current=c;var se=ee&&typeof T.getDerivedStateFromError!="function"?null:I.render();return c.flags|=1,s!==null&&ee?(c.child=jl(c,s.child,null,V),c.child=jl(c,null,se,V)):Vr(s,c,se,V),c.memoizedState=I.state,j&&k2(c,T,!0),c.child}function kb(s){var c=s.stateNode;c.pendingContext?P2(s,c.pendingContext,c.pendingContext!==c.context):c.context&&P2(s,c.context,!1),w0(s,c.containerInfo)}function Tb(s,c,T,I,j){return Dl(),p0(j),c.flags|=256,Vr(s,c,T,I),c.child}var z0={dehydrated:null,treeContext:null,retryLane:0};function B0(s){return{baseLanes:s,cachePool:null,transitions:null}}function Ab(s,c,T){var I=c.pendingProps,j=Gt.current,V=!1,ee=(c.flags&128)!==0,se;if((se=ee)||(se=s!==null&&s.memoizedState===null?!1:(j&2)!==0),se?(V=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(j|=1),Mt(Gt,j&1),s===null)return h0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?Gr(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(ee=I.children,s=I.fallback,V?(I=c.mode,V=c.child,ee={mode:"hidden",children:ee},!(I&1)&&V!==null?(V.childLanes=0,V.pendingProps=ee):V=$f(ee,I,0,null),s=Ho(s,I,T,null),V.return=c,s.return=c,V.sibling=s,c.child=V,c.child.memoizedState=B0(T),c.memoizedState=z0,s):U0(c,ee));if(j=s.memoizedState,j!==null&&(se=j.dehydrated,se!==null))return aE(s,c,ee,I,se,j,T);if(V){V=I.fallback,ee=c.mode,j=s.child,se=j.sibling;var pe={mode:"hidden",children:I.children};return!(ee&1)&&c.child!==j?(I=c.child,I.childLanes=0,I.pendingProps=pe,c.deletions=null):(I=Ha(j,pe),I.subtreeFlags=j.subtreeFlags&14680064),se!==null?V=Ha(se,V):(V=Ho(V,ee,T,null),V.flags|=2),V.return=c,I.return=c,I.sibling=V,c.child=I,I=V,V=c.child,ee=s.child.memoizedState,ee=ee===null?B0(T):{baseLanes:ee.baseLanes|T,cachePool:null,transitions:ee.transitions},V.memoizedState=ee,V.childLanes=s.childLanes&~T,c.memoizedState=z0,I}return V=s.child,s=V.sibling,I=Ha(V,{mode:"visible",children:I.children}),!(c.mode&1)&&(I.lanes=T),I.return=c,I.sibling=null,s!==null&&(T=c.deletions,T===null?(c.deletions=[s],c.flags|=16):T.push(s)),c.child=I,c.memoizedState=null,I}function U0(s,c){return c=$f({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Ef(s,c,T,I){return I!==null&&p0(I),jl(c,s.child,null,T),s=U0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function aE(s,c,T,I,j,V,ee){if(T)return c.flags&256?(c.flags&=-257,I=I0(Error(o(422))),Ef(s,c,ee,I)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(V=I.fallback,j=c.mode,I=$f({mode:"visible",children:I.children},j,0,null),V=Ho(V,j,ee,null),V.flags|=2,I.return=c,V.return=c,I.sibling=V,c.child=I,c.mode&1&&jl(c,s.child,null,ee),c.child.memoizedState=B0(ee),c.memoizedState=z0,V);if(!(c.mode&1))return Ef(s,c,ee,null);if(Gr(j))return I=Ra(j).digest,V=Error(o(419)),I=I0(V,I,void 0),Ef(s,c,ee,I);if(T=(ee&s.childLanes)!==0,rn||T){if(I=br,I!==null){switch(ee&-ee){case 4:j=2;break;case 16:j=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(I.suspendedLanes|ee)?0:j,j!==0&&j!==V.retryLane&&(V.retryLane=j,Ci(s,j),zn(I,s,j,-1))}return l1(),I=I0(Error(o(421))),Ef(s,c,ee,I)}return yn(j)?(c.flags|=128,c.child=s.child,c=yE.bind(null,s),Rn(j,c),null):(s=V.treeContext,ie&&(In=Xt(j),bn=c,Bt=!0,ti=null,su=!1,s!==null&&(Ln[Nn++]=ea,Ln[Nn++]=ta,Ln[Nn++]=No,ea=s.id,ta=s.overflow,No=c)),c=U0(c,I.children),c.flags|=4096,c)}function Rb(s,c,T){s.lanes|=c;var I=s.alternate;I!==null&&(I.lanes|=c),y0(s.return,c,T)}function H0(s,c,T,I,j){var V=s.memoizedState;V===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:I,tail:T,tailMode:j}:(V.isBackwards=c,V.rendering=null,V.renderingStartTime=0,V.last=I,V.tail=T,V.tailMode=j)}function Mb(s,c,T){var I=c.pendingProps,j=I.revealOrder,V=I.tail;if(Vr(s,c,I.children,T),I=Gt.current,I&2)I=I&1|2,c.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Rb(s,T,c);else if(s.tag===19)Rb(s,T,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}I&=1}if(Mt(Gt,I),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(T=c.child,j=null;T!==null;)s=T.alternate,s!==null&&vf(s)===null&&(j=T),T=T.sibling;T=j,T===null?(j=c.child,c.child=null):(j=T.sibling,T.sibling=null),H0(c,!1,j,T,V);break;case"backwards":for(T=null,j=c.child,c.child=null;j!==null;){if(s=j.alternate,s!==null&&vf(s)===null){c.child=j;break}s=j.sibling,j.sibling=T,T=j,j=s}H0(c,!0,T,null,V);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Of(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function na(s,c,T){if(s!==null&&(c.dependencies=s.dependencies),Fo|=c.lanes,!(T&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,T=Ha(s,s.pendingProps),c.child=T,T.return=c;s.sibling!==null;)s=s.sibling,T=T.sibling=Ha(s,s.pendingProps),T.return=c;T.sibling=null}return c.child}function oE(s,c,T){switch(c.tag){case 3:kb(c),Dl();break;case 5:q2(c);break;case 1:tn(c.type)&&ef(c);break;case 4:w0(c,c.stateNode.containerInfo);break;case 10:U2(c,c.type._context,c.memoizedProps.value);break;case 13:var I=c.memoizedState;if(I!==null)return I.dehydrated!==null?(Mt(Gt,Gt.current&1),c.flags|=128,null):T&c.child.childLanes?Ab(s,c,T):(Mt(Gt,Gt.current&1),s=na(s,c,T),s!==null?s.sibling:null);Mt(Gt,Gt.current&1);break;case 19:if(I=(T&c.childLanes)!==0,s.flags&128){if(I)return Mb(s,c,T);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Mt(Gt,Gt.current),I)break;return null;case 22:case 23:return c.lanes=0,xb(s,c,T)}return na(s,c,T)}function Ai(s){s.flags|=4}function Lb(s,c){if(s!==null&&s.child===c.child)return!0;if(c.flags&16)return!1;for(s=c.child;s!==null;){if(s.flags&12854||s.subtreeFlags&12854)return!1;s=s.sibling}return!0}var vu,mu,xf,Pf;if(J)vu=function(s,c){for(var T=c.child;T!==null;){if(T.tag===5||T.tag===6)B(s,T.stateNode);else if(T.tag!==4&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===c)break;for(;T.sibling===null;){if(T.return===null||T.return===c)return;T=T.return}T.sibling.return=T.return,T=T.sibling}},mu=function(){},xf=function(s,c,T,I,j){if(s=s.memoizedProps,s!==I){var V=c.stateNode,ee=ki(jn.current);T=K(V,T,s,I,j,ee),(c.updateQueue=T)&&Ai(c)}},Pf=function(s,c,T,I){T!==I&&Ai(c)};else if(re){vu=function(s,c,T,I){for(var j=c.child;j!==null;){if(j.tag===5){var V=j.stateNode;T&&I&&(V=Qr(V,j.type,j.memoizedProps,j)),B(s,V)}else if(j.tag===6)V=j.stateNode,T&&I&&(V=Or(V,j.memoizedProps,j)),B(s,V);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)V=j.child,V!==null&&(V.return=j),vu(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};var Nb=function(s,c,T,I){for(var j=c.child;j!==null;){if(j.tag===5){var V=j.stateNode;T&&I&&(V=Qr(V,j.type,j.memoizedProps,j)),Ve(s,V)}else if(j.tag===6)V=j.stateNode,T&&I&&(V=Or(V,j.memoizedProps,j)),Ve(s,V);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)V=j.child,V!==null&&(V.return=j),Nb(s,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};mu=function(s,c){var T=c.stateNode;if(!Lb(s,c)){s=T.containerInfo;var I=je(s);Nb(I,c,!1,!1),T.pendingChildren=I,Ai(c),pt(s,I)}},xf=function(s,c,T,I,j){var V=s.stateNode,ee=s.memoizedProps;if((s=Lb(s,c))&&ee===I)c.stateNode=V;else{var se=c.stateNode,pe=ki(jn.current),Ce=null;ee!==I&&(Ce=K(se,T,ee,I,j,pe)),s&&Ce===null?c.stateNode=V:(V=Le(V,Ce,T,ee,I,c,s,se),q(V,T,I,j,pe)&&Ai(c),c.stateNode=V,s?Ai(c):vu(V,c,!1,!1))}},Pf=function(s,c,T,I){T!==I?(s=ki(Bl.current),T=ki(jn.current),c.stateNode=$(I,s,T,c),Ai(c)):c.stateNode=s.stateNode}}else mu=function(){},xf=function(){},Pf=function(){};function yu(s,c){if(!Bt)switch(s.tailMode){case"hidden":c=s.tail;for(var T=null;c!==null;)c.alternate!==null&&(T=c),c=c.sibling;T===null?s.tail=null:T.sibling=null;break;case"collapsed":T=s.tail;for(var I=null;T!==null;)T.alternate!==null&&(I=T),T=T.sibling;I===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:I.sibling=null}}function Dr(s){var c=s.alternate!==null&&s.alternate.child===s.child,T=0,I=0;if(c)for(var j=s.child;j!==null;)T|=j.lanes|j.childLanes,I|=j.subtreeFlags&14680064,I|=j.flags&14680064,j.return=s,j=j.sibling;else for(j=s.child;j!==null;)T|=j.lanes|j.childLanes,I|=j.subtreeFlags,I|=j.flags,j.return=s,j=j.sibling;return s.subtreeFlags|=I,s.childLanes=T,c}function lE(s,c,T){var I=c.pendingProps;switch(f0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dr(c),null;case 1:return tn(c.type)&&Jc(),Dr(c),null;case 3:return T=c.stateNode,Ul(),Dt(en),Dt(Nr),O0(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(s===null||s.child===null)&&(uf(c)?Ai(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ti!==null&&(a1(ti),ti=null))),mu(s,c),Dr(c),null;case 5:S0(c),T=ki(Bl.current);var j=c.type;if(s!==null&&c.stateNode!=null)xf(s,c,j,I,T),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!I){if(c.stateNode===null)throw Error(o(166));return Dr(c),null}if(s=ki(jn.current),uf(c)){if(!ie)throw Error(o(175));s=Ct(c.stateNode,c.type,c.memoizedProps,T,s,c,!su),c.updateQueue=s,s!==null&&Ai(c)}else{var V=D(j,I,T,s,c);vu(V,c,!1,!1),c.stateNode=V,q(V,j,I,T,s)&&Ai(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Dr(c),null;case 6:if(s&&c.stateNode!=null)Pf(s,c,s.memoizedProps,I);else{if(typeof I!="string"&&c.stateNode===null)throw Error(o(166));if(s=ki(Bl.current),T=ki(jn.current),uf(c)){if(!ie)throw Error(o(176));if(s=c.stateNode,T=c.memoizedProps,(I=or(s,T,c,!su))&&(j=bn,j!==null))switch(j.tag){case 3:Ro(j.stateNode.containerInfo,s,T,(j.mode&1)!==0);break;case 5:Mo(j.type,j.memoizedProps,j.stateNode,s,T,(j.mode&1)!==0)}I&&Ai(c)}else c.stateNode=$(I,s,T,c)}return Dr(c),null;case 13:if(Dt(Gt),I=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Bt&&In!==null&&c.mode&1&&!(c.flags&128))j2(),Dl(),c.flags|=98560,j=!1;else if(j=uf(c),I!==null&&I.dehydrated!==null){if(s===null){if(!j)throw Error(o(318));if(!ie)throw Error(o(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));Lr(j,c)}else Dl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Dr(c),j=!1}else ti!==null&&(a1(ti),ti=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=T,c):(T=I!==null,T!==(s!==null&&s.memoizedState!==null)&&T&&(c.child.flags|=8192,c.mode&1&&(s===null||Gt.current&1?ur===0&&(ur=3):l1())),c.updateQueue!==null&&(c.flags|=4),Dr(c),null);case 4:return Ul(),mu(s,c),s===null&&ae(c.stateNode.containerInfo),Dr(c),null;case 10:return m0(c.type._context),Dr(c),null;case 17:return tn(c.type)&&Jc(),Dr(c),null;case 19:if(Dt(Gt),j=c.memoizedState,j===null)return Dr(c),null;if(I=(c.flags&128)!==0,V=j.rendering,V===null)if(I)yu(j,!1);else{if(ur!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(V=vf(s),V!==null){for(c.flags|=128,yu(j,!1),s=V.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=T,T=c.child;T!==null;)I=T,j=s,I.flags&=14680066,V=I.alternate,V===null?(I.childLanes=0,I.lanes=j,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=V.childLanes,I.lanes=V.lanes,I.child=V.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=V.memoizedProps,I.memoizedState=V.memoizedState,I.updateQueue=V.updateQueue,I.type=V.type,j=V.dependencies,I.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),T=T.sibling;return Mt(Gt,Gt.current&1|2),c.child}s=s.sibling}j.tail!==null&&mr()>t1&&(c.flags|=128,I=!0,yu(j,!1),c.lanes=4194304)}else{if(!I)if(s=vf(V),s!==null){if(c.flags|=128,I=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),yu(j,!0),j.tail===null&&j.tailMode==="hidden"&&!V.alternate&&!Bt)return Dr(c),null}else 2*mr()-j.renderingStartTime>t1&&T!==1073741824&&(c.flags|=128,I=!0,yu(j,!1),c.lanes=4194304);j.isBackwards?(V.sibling=c.child,c.child=V):(s=j.last,s!==null?s.sibling=V:c.child=V,j.last=V)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=mr(),c.sibling=null,s=Gt.current,Mt(Gt,I?s&1|2:s&1),c):(Dr(c),null);case 22:case 23:return o1(),T=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==T&&(c.flags|=8192),T&&c.mode&1?_n&1073741824&&(Dr(c),J&&c.subtreeFlags&6&&(c.flags|=8192)):Dr(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function sE(s,c){switch(f0(c),c.tag){case 1:return tn(c.type)&&Jc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ul(),Dt(en),Dt(Nr),O0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return S0(c),null;case 13:if(Dt(Gt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));Dl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Dt(Gt),null;case 4:return Ul(),null;case 10:return m0(c.type._context),null;case 22:case 23:return o1(),null;case 24:return null;default:return null}}var Cf=!1,jr=!1,uE=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function $l(s,c){var T=s.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(I){Ut(s,c,I)}else T.current=null}function $0(s,c,T){try{T()}catch(I){Ut(s,c,I)}}var Ib=!1;function cE(s,c){for(L(s.containerInfo),Ue=c;Ue!==null;)if(s=Ue,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Ue=c;else for(;Ue!==null;){s=Ue;try{var T=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var I=T.memoizedProps,j=T.memoizedState,V=s.stateNode,ee=V.getSnapshotBeforeUpdate(s.elementType===s.type?I:ri(s.type,I),j);V.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:J&&Ye(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(se){Ut(s,s.return,se)}if(c=s.sibling,c!==null){c.return=s.return,Ue=c;break}Ue=s.return}return T=Ib,Ib=!1,T}function bu(s,c,T){var I=c.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var j=I=I.next;do{if((j.tag&s)===s){var V=j.destroy;j.destroy=void 0,V!==void 0&&$0(c,T,V)}j=j.next}while(j!==I)}}function kf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var T=c=c.next;do{if((T.tag&s)===s){var I=T.create;T.destroy=I()}T=T.next}while(T!==c)}}function G0(s){var c=s.ref;if(c!==null){var T=s.stateNode;switch(s.tag){case 5:s=Z(T);break;default:s=T}typeof c=="function"?c(s):c.current=s}}function Db(s){var c=s.alternate;c!==null&&(s.alternate=null,Db(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Ae(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function jb(s){return s.tag===5||s.tag===3||s.tag===4}function Fb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||jb(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function V0(s,c,T){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?de(T,s,c):Pe(T,s);else if(I!==4&&(s=s.child,s!==null))for(V0(s,c,T),s=s.sibling;s!==null;)V0(s,c,T),s=s.sibling}function q0(s,c,T){var I=s.tag;if(I===5||I===6)s=s.stateNode,c?fe(T,s,c):Re(T,s);else if(I!==4&&(s=s.child,s!==null))for(q0(s,c,T),s=s.sibling;s!==null;)q0(s,c,T),s=s.sibling}var xr=null,ni=!1;function Ri(s,c,T){for(T=T.child;T!==null;)W0(s,c,T),T=T.sibling}function W0(s,c,T){if(xi&&typeof xi.onCommitFiberUnmount=="function")try{xi.onCommitFiberUnmount(af,T)}catch{}switch(T.tag){case 5:jr||$l(T,c);case 6:if(J){var I=xr,j=ni;xr=null,Ri(s,c,T),xr=I,ni=j,xr!==null&&(ni?be(xr,T.stateNode):Xe(xr,T.stateNode))}else Ri(s,c,T);break;case 18:J&&xr!==null&&(ni?Ma(xr,T.stateNode):Qi(xr,T.stateNode));break;case 4:J?(I=xr,j=ni,xr=T.stateNode.containerInfo,ni=!0,Ri(s,c,T),xr=I,ni=j):(re&&(I=T.stateNode.containerInfo,j=je(I),Ot(I,j)),Ri(s,c,T));break;case 0:case 11:case 14:case 15:if(!jr&&(I=T.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){j=I=I.next;do{var V=j,ee=V.destroy;V=V.tag,ee!==void 0&&(V&2||V&4)&&$0(T,c,ee),j=j.next}while(j!==I)}Ri(s,c,T);break;case 1:if(!jr&&($l(T,c),I=T.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=T.memoizedProps,I.state=T.memoizedState,I.componentWillUnmount()}catch(se){Ut(T,c,se)}Ri(s,c,T);break;case 21:Ri(s,c,T);break;case 22:T.mode&1?(jr=(I=jr)||T.memoizedState!==null,Ri(s,c,T),jr=I):Ri(s,c,T);break;default:Ri(s,c,T)}}function zb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var T=s.stateNode;T===null&&(T=s.stateNode=new uE),c.forEach(function(I){var j=bE.bind(null,s,I);T.has(I)||(T.add(I),I.then(j,j))})}}function ii(s,c){var T=c.deletions;if(T!==null)for(var I=0;I<T.length;I++){var j=T[I];try{var V=s,ee=c;if(J){var se=ee;e:for(;se!==null;){switch(se.tag){case 5:xr=se.stateNode,ni=!1;break e;case 3:xr=se.stateNode.containerInfo,ni=!0;break e;case 4:xr=se.stateNode.containerInfo,ni=!0;break e}se=se.return}if(xr===null)throw Error(o(160));W0(V,ee,j),xr=null,ni=!1}else W0(V,ee,j);var pe=j.alternate;pe!==null&&(pe.return=null),j.return=null}catch(Ce){Ut(j,c,Ce)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Bb(c,s),c=c.sibling}function Bb(s,c){var T=s.alternate,I=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ii(c,s),Mi(s),I&4){try{bu(3,s,s.return),kf(3,s)}catch(Fe){Ut(s,s.return,Fe)}try{bu(5,s,s.return)}catch(Fe){Ut(s,s.return,Fe)}}break;case 1:ii(c,s),Mi(s),I&512&&T!==null&&$l(T,T.return);break;case 5:if(ii(c,s),Mi(s),I&512&&T!==null&&$l(T,T.return),J){if(s.flags&32){var j=s.stateNode;try{Ie(j)}catch(Fe){Ut(s,s.return,Fe)}}if(I&4&&(j=s.stateNode,j!=null)){var V=s.memoizedProps;if(T=T!==null?T.memoizedProps:V,I=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Je(j,c,I,T,V,s)}catch(Fe){Ut(s,s.return,Fe)}}}break;case 6:if(ii(c,s),Mi(s),I&4&&J){if(s.stateNode===null)throw Error(o(162));j=s.stateNode,V=s.memoizedProps,T=T!==null?T.memoizedProps:V;try{Oe(j,T,V)}catch(Fe){Ut(s,s.return,Fe)}}break;case 3:if(ii(c,s),Mi(s),I&4){if(J&&ie&&T!==null&&T.memoizedState.isDehydrated)try{Mn(c.containerInfo)}catch(Fe){Ut(s,s.return,Fe)}if(re){j=c.containerInfo,V=c.pendingChildren;try{Ot(j,V)}catch(Fe){Ut(s,s.return,Fe)}}}break;case 4:if(ii(c,s),Mi(s),I&4&&re){V=s.stateNode,j=V.containerInfo,V=V.pendingChildren;try{Ot(j,V)}catch(Fe){Ut(s,s.return,Fe)}}break;case 13:ii(c,s),Mi(s),j=s.child,j.flags&8192&&(V=j.memoizedState!==null,j.stateNode.isHidden=V,!V||j.alternate!==null&&j.alternate.memoizedState!==null||(e1=mr())),I&4&&zb(s);break;case 22:var ee=T!==null&&T.memoizedState!==null;if(s.mode&1?(jr=(T=jr)||ee,ii(c,s),jr=T):ii(c,s),Mi(s),I&8192){if(T=s.memoizedState!==null,(s.stateNode.isHidden=T)&&!ee&&s.mode&1)for(Ue=s,I=s.child;I!==null;){for(c=Ue=I;Ue!==null;){ee=Ue;var se=ee.child;switch(ee.tag){case 0:case 11:case 14:case 15:bu(4,ee,ee.return);break;case 1:$l(ee,ee.return);var pe=ee.stateNode;if(typeof pe.componentWillUnmount=="function"){var Ce=ee,$e=ee.return;try{var it=Ce;pe.props=it.memoizedProps,pe.state=it.memoizedState,pe.componentWillUnmount()}catch(Fe){Ut(Ce,$e,Fe)}}break;case 5:$l(ee,ee.return);break;case 22:if(ee.memoizedState!==null){$b(c);continue}}se!==null?(se.return=ee,Ue=se):$b(c)}I=I.sibling}if(J){e:if(I=null,J)for(c=s;;){if(c.tag===5){if(I===null){I=c;try{j=c.stateNode,T?Me(j):et(c.stateNode,c.memoizedProps)}catch(Fe){Ut(s,s.return,Fe)}}}else if(c.tag===6){if(I===null)try{V=c.stateNode,T?we(V):Se(V,c.memoizedProps)}catch(Fe){Ut(s,s.return,Fe)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;I===c&&(I=null),c=c.return}I===c&&(I=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ii(c,s),Mi(s),I&4&&zb(s);break;case 21:break;default:ii(c,s),Mi(s)}}function Mi(s){var c=s.flags;if(c&2){try{if(J){e:{for(var T=s.return;T!==null;){if(jb(T)){var I=T;break e}T=T.return}throw Error(o(160))}switch(I.tag){case 5:var j=I.stateNode;I.flags&32&&(Ie(j),I.flags&=-33);var V=Fb(s);q0(s,V,j);break;case 3:case 4:var ee=I.stateNode.containerInfo,se=Fb(s);V0(s,se,ee);break;default:throw Error(o(161))}}}catch(pe){Ut(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function fE(s,c,T){Ue=s,Ub(s)}function Ub(s,c,T){for(var I=(s.mode&1)!==0;Ue!==null;){var j=Ue,V=j.child;if(j.tag===22&&I){var ee=j.memoizedState!==null||Cf;if(!ee){var se=j.alternate,pe=se!==null&&se.memoizedState!==null||jr;se=Cf;var Ce=jr;if(Cf=ee,(jr=pe)&&!Ce)for(Ue=j;Ue!==null;)ee=Ue,pe=ee.child,ee.tag===22&&ee.memoizedState!==null?Gb(j):pe!==null?(pe.return=ee,Ue=pe):Gb(j);for(;V!==null;)Ue=V,Ub(V),V=V.sibling;Ue=j,Cf=se,jr=Ce}Hb(s)}else j.subtreeFlags&8772&&V!==null?(V.return=j,Ue=V):Hb(s)}}function Hb(s){for(;Ue!==null;){var c=Ue;if(c.flags&8772){var T=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:jr||kf(5,c);break;case 1:var I=c.stateNode;if(c.flags&4&&!jr)if(T===null)I.componentDidMount();else{var j=c.elementType===c.type?T.memoizedProps:ri(c.type,T.memoizedProps);I.componentDidUpdate(j,T.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var V=c.updateQueue;V!==null&&V2(c,V,I);break;case 3:var ee=c.updateQueue;if(ee!==null){if(T=null,c.child!==null)switch(c.child.tag){case 5:T=Z(c.child.stateNode);break;case 1:T=c.child.stateNode}V2(c,ee,T)}break;case 5:var se=c.stateNode;T===null&&c.flags&4&&Ne(se,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ie&&c.memoizedState===null){var pe=c.alternate;if(pe!==null){var Ce=pe.memoizedState;if(Ce!==null){var $e=Ce.dehydrated;$e!==null&&Ei($e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}jr||c.flags&512&&G0(c)}catch(it){Ut(c,c.return,it)}}if(c===s){Ue=null;break}if(T=c.sibling,T!==null){T.return=c.return,Ue=T;break}Ue=c.return}}function $b(s){for(;Ue!==null;){var c=Ue;if(c===s){Ue=null;break}var T=c.sibling;if(T!==null){T.return=c.return,Ue=T;break}Ue=c.return}}function Gb(s){for(;Ue!==null;){var c=Ue;try{switch(c.tag){case 0:case 11:case 15:var T=c.return;try{kf(4,c)}catch(pe){Ut(c,T,pe)}break;case 1:var I=c.stateNode;if(typeof I.componentDidMount=="function"){var j=c.return;try{I.componentDidMount()}catch(pe){Ut(c,j,pe)}}var V=c.return;try{G0(c)}catch(pe){Ut(c,V,pe)}break;case 5:var ee=c.return;try{G0(c)}catch(pe){Ut(c,ee,pe)}}}catch(pe){Ut(c,c.return,pe)}if(c===s){Ue=null;break}var se=c.sibling;if(se!==null){se.return=c.return,Ue=se;break}Ue=c.return}}var Tf=0,Af=1,Rf=2,Mf=3,Lf=4;if(typeof Symbol=="function"&&Symbol.for){var _u=Symbol.for;Tf=_u("selector.component"),Af=_u("selector.has_pseudo_class"),Rf=_u("selector.role"),Mf=_u("selector.test_id"),Lf=_u("selector.text")}function K0(s){var c=ne(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=ye(s),s===null)throw Error(o(362));return s.stateNode.current}function Y0(s,c){switch(c.$$typeof){case Tf:if(s.type===c.value)return!0;break;case Af:e:{c=c.value,s=[s,0];for(var T=0;T<s.length;){var I=s[T++],j=s[T++],V=c[j];if(I.tag!==5||!me(I)){for(;V!=null&&Y0(I,V);)j++,V=c[j];if(j===c.length){c=!0;break e}else for(I=I.child;I!==null;)s.push(I,j),I=I.sibling}}c=!1}return c;case Rf:if(s.tag===5&&Ee(s.stateNode,c.value))return!0;break;case Lf:if((s.tag===5||s.tag===6)&&(s=le(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case Mf:if(s.tag===5&&(s=s.memoizedProps["data-testname"],typeof s=="string"&&s.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function X0(s){switch(s.$$typeof){case Tf:return"<"+(P(s.value)||"Unknown")+">";case Af:return":has("+(X0(s)||"")+")";case Rf:return'[role="'+s.value+'"]';case Lf:return'"'+s.value+'"';case Mf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Vb(s,c){var T=[];s=[s,0];for(var I=0;I<s.length;){var j=s[I++],V=s[I++],ee=c[V];if(j.tag!==5||!me(j)){for(;ee!=null&&Y0(j,ee);)V++,ee=c[V];if(V===c.length)T.push(j);else for(j=j.child;j!==null;)s.push(j,V),j=j.sibling}}return T}function Z0(s,c){if(!_e)throw Error(o(363));s=K0(s),s=Vb(s,c),c=[],s=Array.from(s);for(var T=0;T<s.length;){var I=s[T++];if(I.tag===5)me(I)||c.push(I.stateNode);else for(I=I.child;I!==null;)s.push(I),I=I.sibling}return c}var dE=Math.ceil,Nf=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,er=l.ReactCurrentBatchConfig,ft=0,br=null,nr=null,Pr=0,_n=0,Gl=Na(0),ur=0,wu=null,Fo=0,If=0,J0=0,Su=null,nn=null,e1=0,t1=1/0,ia=null;function Vl(){t1=mr()+500}var Df=!1,r1=null,Fa=null,jf=!1,za=null,Ff=0,Eu=0,n1=null,zf=-1,Bf=0;function Fr(){return ft&6?mr():zf!==-1?zf:zf=mr()}function Ba(s){return s.mode&1?ft&2&&Pr!==0?Pr&-Pr:KS.transition!==null?(Bf===0&&(Bf=T2()),Bf):(s=bt,s!==0?s:ke()):1}function zn(s,c,T,I){if(50<Eu)throw Eu=0,n1=null,Error(o(185));lu(s,T,I),(!(ft&2)||s!==br)&&(s===br&&(!(ft&2)&&(If|=T),ur===4&&Ua(s,Pr)),an(s,I),T===1&&ft===0&&!(c.mode&1)&&(Vl(),of&&Pi()))}function an(s,c){var T=s.callbackNode;zS(s,c);var I=nf(s,s===br?Pr:0);if(I===0)T!==null&&R2(T),s.callbackNode=null,s.callbackPriority=0;else if(c=I&-I,s.callbackPriority!==c){if(T!=null&&R2(T),c===1)s.tag===0?WS(Wb.bind(null,s)):M2(Wb.bind(null,s)),oe?ce(function(){!(ft&6)&&Pi()}):o0(l0,Pi),T=null;else{switch(A2(I)){case 1:T=l0;break;case 4:T=$S;break;case 16:T=s0;break;case 536870912:T=GS;break;default:T=s0}T=r3(T,qb.bind(null,s))}s.callbackPriority=c,s.callbackNode=T}}function qb(s,c){if(zf=-1,Bf=0,ft&6)throw Error(o(327));var T=s.callbackNode;if(Uo()&&s.callbackNode!==T)return null;var I=nf(s,s===br?Pr:0);if(I===0)return null;if(I&30||I&s.expiredLanes||c)c=Uf(s,I);else{c=I;var j=ft;ft|=2;var V=Xb();(br!==s||Pr!==c)&&(ia=null,Vl(),zo(s,c));do try{gE();break}catch(se){Yb(s,se)}while(!0);v0(),Nf.current=V,ft=j,nr!==null?c=0:(br=null,Pr=0,c=ur)}if(c!==0){if(c===2&&(j=n0(s),j!==0&&(I=j,c=i1(s,j))),c===1)throw T=wu,zo(s,0),Ua(s,I),an(s,mr()),T;if(c===6)Ua(s,I);else{if(j=s.current.alternate,!(I&30)&&!hE(j)&&(c=Uf(s,I),c===2&&(V=n0(s),V!==0&&(I=V,c=i1(s,V))),c===1))throw T=wu,zo(s,0),Ua(s,I),an(s,mr()),T;switch(s.finishedWork=j,s.finishedLanes=I,c){case 0:case 1:throw Error(o(345));case 2:Bo(s,nn,ia);break;case 3:if(Ua(s,I),(I&130023424)===I&&(c=e1+500-mr(),10<c)){if(nf(s,0)!==0)break;if(j=s.suspendedLanes,(j&I)!==I){Fr(),s.pingedLanes|=s.suspendedLanes&j;break}s.timeoutHandle=F(Bo.bind(null,s,nn,ia),c);break}Bo(s,nn,ia);break;case 4:if(Ua(s,I),(I&4194240)===I)break;for(c=s.eventTimes,j=-1;0<I;){var ee=31-Jn(I);V=1<<ee,ee=c[ee],ee>j&&(j=ee),I&=~V}if(I=j,I=mr()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*dE(I/1960))-I,10<I){s.timeoutHandle=F(Bo.bind(null,s,nn,ia),I);break}Bo(s,nn,ia);break;case 5:Bo(s,nn,ia);break;default:throw Error(o(329))}}}return an(s,mr()),s.callbackNode===T?qb.bind(null,s):null}function i1(s,c){var T=Su;return s.current.memoizedState.isDehydrated&&(zo(s,c).flags|=256),s=Uf(s,c),s!==2&&(c=nn,nn=T,c!==null&&a1(c)),s}function a1(s){nn===null?nn=s:nn.push.apply(nn,s)}function hE(s){for(var c=s;;){if(c.flags&16384){var T=c.updateQueue;if(T!==null&&(T=T.stores,T!==null))for(var I=0;I<T.length;I++){var j=T[I],V=j.getSnapshot;j=j.value;try{if(!ei(V(),j))return!1}catch{return!1}}}if(T=c.child,c.subtreeFlags&16384&&T!==null)T.return=c,c=T;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ua(s,c){for(c&=~J0,c&=~If,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var T=31-Jn(c),I=1<<T;s[T]=-1,c&=~I}}function Wb(s){if(ft&6)throw Error(o(327));Uo();var c=nf(s,0);if(!(c&1))return an(s,mr()),null;var T=Uf(s,c);if(s.tag!==0&&T===2){var I=n0(s);I!==0&&(c=I,T=i1(s,I))}if(T===1)throw T=wu,zo(s,0),Ua(s,c),an(s,mr()),T;if(T===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,Bo(s,nn,ia),an(s,mr()),null}function Kb(s){za!==null&&za.tag===0&&!(ft&6)&&Uo();var c=ft;ft|=1;var T=er.transition,I=bt;try{if(er.transition=null,bt=1,s)return s()}finally{bt=I,er.transition=T,ft=c,!(ft&6)&&Pi()}}function o1(){_n=Gl.current,Dt(Gl)}function zo(s,c){s.finishedWork=null,s.finishedLanes=0;var T=s.timeoutHandle;if(T!==X&&(s.timeoutHandle=X,Y(T)),nr!==null)for(T=nr.return;T!==null;){var I=T;switch(f0(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&Jc();break;case 3:Ul(),Dt(en),Dt(Nr),O0();break;case 5:S0(I);break;case 4:Ul();break;case 13:Dt(Gt);break;case 19:Dt(Gt);break;case 10:m0(I.type._context);break;case 22:case 23:o1()}T=T.return}if(br=s,nr=s=Ha(s.current,null),Pr=_n=c,ur=0,wu=null,J0=If=Fo=0,nn=Su=null,Do!==null){for(c=0;c<Do.length;c++)if(T=Do[c],I=T.interleaved,I!==null){T.interleaved=null;var j=I.next,V=T.pending;if(V!==null){var ee=V.next;V.next=j,I.next=ee}T.pending=I}Do=null}return s}function Yb(s,c){do{var T=nr;try{if(v0(),mf.current=wf,yf){for(var I=Vt.memoizedState;I!==null;){var j=I.queue;j!==null&&(j.pending=null),I=I.next}yf=!1}if(jo=0,yr=sr=Vt=null,du=!1,hu=0,Q0.current=null,T===null||T.return===null){ur=1,wu=c,nr=null;break}e:{var V=s,ee=T.return,se=T,pe=c;if(c=Pr,se.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ce=pe,$e=se,it=$e.tag;if(!($e.mode&1)&&(it===0||it===11||it===15)){var Fe=$e.alternate;Fe?($e.updateQueue=Fe.updateQueue,$e.memoizedState=Fe.memoizedState,$e.lanes=Fe.lanes):($e.updateQueue=null,$e.memoizedState=null)}var jt=_b(ee);if(jt!==null){jt.flags&=-257,wb(jt,ee,se,V,c),jt.mode&1&&bb(V,Ce,c),c=jt,pe=Ce;var At=c.updateQueue;if(At===null){var on=new Set;on.add(pe),c.updateQueue=on}else At.add(pe);break e}else{if(!(c&1)){bb(V,Ce,c),l1();break e}pe=Error(o(426))}}else if(Bt&&se.mode&1){var aa=_b(ee);if(aa!==null){!(aa.flags&65536)&&(aa.flags|=256),wb(aa,ee,se,V,c),p0(Hl(pe,se));break e}}V=pe=Hl(pe,se),ur!==4&&(ur=2),Su===null?Su=[V]:Su.push(V),V=ee;do{switch(V.tag){case 3:V.flags|=65536,c&=-c,V.lanes|=c;var he=mb(V,pe,c);G2(V,he);break e;case 1:se=pe;var ue=V.type,ge=V.stateNode;if(!(V.flags&128)&&(typeof ue.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(Fa===null||!Fa.has(ge)))){V.flags|=65536,c&=-c,V.lanes|=c;var ze=yb(V,se,c);G2(V,ze);break e}}V=V.return}while(V!==null)}Qb(T)}catch(Ze){c=Ze,nr===T&&T!==null&&(nr=T=T.return);continue}break}while(!0)}function Xb(){var s=Nf.current;return Nf.current=wf,s===null?wf:s}function l1(){(ur===0||ur===3||ur===2)&&(ur=4),br===null||!(Fo&268435455)&&!(If&268435455)||Ua(br,Pr)}function Uf(s,c){var T=ft;ft|=2;var I=Xb();(br!==s||Pr!==c)&&(ia=null,zo(s,c));do try{pE();break}catch(j){Yb(s,j)}while(!0);if(v0(),ft=T,Nf.current=I,nr!==null)throw Error(o(261));return br=null,Pr=0,ur}function pE(){for(;nr!==null;)Zb(nr)}function gE(){for(;nr!==null&&!US();)Zb(nr)}function Zb(s){var c=t3(s.alternate,s,_n);s.memoizedProps=s.pendingProps,c===null?Qb(s):nr=c,Q0.current=null}function Qb(s){var c=s;do{var T=c.alternate;if(s=c.return,c.flags&32768){if(T=sE(T,c),T!==null){T.flags&=32767,nr=T;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{ur=6,nr=null;return}}else if(T=lE(T,c,_n),T!==null){nr=T;return}if(c=c.sibling,c!==null){nr=c;return}nr=c=s}while(c!==null);ur===0&&(ur=5)}function Bo(s,c,T){var I=bt,j=er.transition;try{er.transition=null,bt=1,vE(s,c,T,I)}finally{er.transition=j,bt=I}return null}function vE(s,c,T,I){do Uo();while(za!==null);if(ft&6)throw Error(o(327));T=s.finishedWork;var j=s.finishedLanes;if(T===null)return null;if(s.finishedWork=null,s.finishedLanes=0,T===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var V=T.lanes|T.childLanes;if(BS(s,V),s===br&&(nr=br=null,Pr=0),!(T.subtreeFlags&2064)&&!(T.flags&2064)||jf||(jf=!0,r3(s0,function(){return Uo(),null})),V=(T.flags&15990)!==0,T.subtreeFlags&15990||V){V=er.transition,er.transition=null;var ee=bt;bt=1;var se=ft;ft|=4,Q0.current=null,cE(s,T),Bb(T,s),M(s.containerInfo),s.current=T,fE(T),HS(),ft=se,bt=ee,er.transition=V}else s.current=T;if(jf&&(jf=!1,za=s,Ff=j),V=s.pendingLanes,V===0&&(Fa=null),VS(T.stateNode),an(s,mr()),c!==null)for(I=s.onRecoverableError,T=0;T<c.length;T++)j=c[T],I(j.value,{componentStack:j.stack,digest:j.digest});if(Df)throw Df=!1,s=r1,r1=null,s;return Ff&1&&s.tag!==0&&Uo(),V=s.pendingLanes,V&1?s===n1?Eu++:(Eu=0,n1=s):Eu=0,Pi(),null}function Uo(){if(za!==null){var s=A2(Ff),c=er.transition,T=bt;try{if(er.transition=null,bt=16>s?16:s,za===null)var I=!1;else{if(s=za,za=null,Ff=0,ft&6)throw Error(o(331));var j=ft;for(ft|=4,Ue=s.current;Ue!==null;){var V=Ue,ee=V.child;if(Ue.flags&16){var se=V.deletions;if(se!==null){for(var pe=0;pe<se.length;pe++){var Ce=se[pe];for(Ue=Ce;Ue!==null;){var $e=Ue;switch($e.tag){case 0:case 11:case 15:bu(8,$e,V)}var it=$e.child;if(it!==null)it.return=$e,Ue=it;else for(;Ue!==null;){$e=Ue;var Fe=$e.sibling,jt=$e.return;if(Db($e),$e===Ce){Ue=null;break}if(Fe!==null){Fe.return=jt,Ue=Fe;break}Ue=jt}}}var At=V.alternate;if(At!==null){var on=At.child;if(on!==null){At.child=null;do{var aa=on.sibling;on.sibling=null,on=aa}while(on!==null)}}Ue=V}}if(V.subtreeFlags&2064&&ee!==null)ee.return=V,Ue=ee;else e:for(;Ue!==null;){if(V=Ue,V.flags&2048)switch(V.tag){case 0:case 11:case 15:bu(9,V,V.return)}var he=V.sibling;if(he!==null){he.return=V.return,Ue=he;break e}Ue=V.return}}var ue=s.current;for(Ue=ue;Ue!==null;){ee=Ue;var ge=ee.child;if(ee.subtreeFlags&2064&&ge!==null)ge.return=ee,Ue=ge;else e:for(ee=ue;Ue!==null;){if(se=Ue,se.flags&2048)try{switch(se.tag){case 0:case 11:case 15:kf(9,se)}}catch(Ze){Ut(se,se.return,Ze)}if(se===ee){Ue=null;break e}var ze=se.sibling;if(ze!==null){ze.return=se.return,Ue=ze;break e}Ue=se.return}}if(ft=j,Pi(),xi&&typeof xi.onPostCommitFiberRoot=="function")try{xi.onPostCommitFiberRoot(af,s)}catch{}I=!0}return I}finally{bt=T,er.transition=c}}return!1}function Jb(s,c,T){c=Hl(T,c),c=mb(s,c,1),s=ja(s,c,1),c=Fr(),s!==null&&(lu(s,1,c),an(s,c))}function Ut(s,c,T){if(s.tag===3)Jb(s,s,T);else for(;c!==null;){if(c.tag===3){Jb(c,s,T);break}else if(c.tag===1){var I=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(Fa===null||!Fa.has(I))){s=Hl(T,s),s=yb(c,s,1),c=ja(c,s,1),s=Fr(),c!==null&&(lu(c,1,s),an(c,s));break}}c=c.return}}function mE(s,c,T){var I=s.pingCache;I!==null&&I.delete(c),c=Fr(),s.pingedLanes|=s.suspendedLanes&T,br===s&&(Pr&T)===T&&(ur===4||ur===3&&(Pr&130023424)===Pr&&500>mr()-e1?zo(s,0):J0|=T),an(s,c)}function e3(s,c){c===0&&(s.mode&1?(c=rf,rf<<=1,!(rf&130023424)&&(rf=4194304)):c=1);var T=Fr();s=Ci(s,c),s!==null&&(lu(s,c,T),an(s,T))}function yE(s){var c=s.memoizedState,T=0;c!==null&&(T=c.retryLane),e3(s,T)}function bE(s,c){var T=0;switch(s.tag){case 13:var I=s.stateNode,j=s.memoizedState;j!==null&&(T=j.retryLane);break;case 19:I=s.stateNode;break;default:throw Error(o(314))}I!==null&&I.delete(c),e3(s,T)}var t3;t3=function(s,c,T){if(s!==null)if(s.memoizedProps!==c.pendingProps||en.current)rn=!0;else{if(!(s.lanes&T)&&!(c.flags&128))return rn=!1,oE(s,c,T);rn=!!(s.flags&131072)}else rn=!1,Bt&&c.flags&1048576&&L2(c,sf,c.index);switch(c.lanes=0,c.tag){case 2:var I=c.type;Of(s,c),s=c.pendingProps;var j=Ll(c,Nr.current);zl(c,T),j=C0(null,c,I,s,j,T);var V=k0();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,tn(I)?(V=!0,ef(c)):V=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,_0(c),j.updater=Sf,c.stateNode=j,j._reactInternals=c,N0(c,I,s,T),c=F0(null,c,I,!0,V,T)):(c.tag=0,Bt&&V&&c0(c),Vr(null,c,j,T),c=c.child),c;case 16:I=c.elementType;e:{switch(Of(s,c),s=c.pendingProps,j=I._init,I=j(I._payload),c.type=I,j=c.tag=wE(I),s=ri(I,s),j){case 0:c=j0(null,c,I,s,T);break e;case 1:c=Cb(null,c,I,s,T);break e;case 11:c=Sb(null,c,I,s,T);break e;case 14:c=Eb(null,c,I,ri(I.type,s),T);break e}throw Error(o(306,I,""))}return c;case 0:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ri(I,j),j0(s,c,I,j,T);case 1:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ri(I,j),Cb(s,c,I,j,T);case 3:e:{if(kb(c),s===null)throw Error(o(387));I=c.pendingProps,V=c.memoizedState,j=V.element,$2(s,c),gf(c,I,null,T);var ee=c.memoizedState;if(I=ee.element,ie&&V.isDehydrated)if(V={element:I,isDehydrated:!1,cache:ee.cache,pendingSuspenseBoundaries:ee.pendingSuspenseBoundaries,transitions:ee.transitions},c.updateQueue.baseState=V,c.memoizedState=V,c.flags&256){j=Hl(Error(o(423)),c),c=Tb(s,c,I,T,j);break e}else if(I!==j){j=Hl(Error(o(424)),c),c=Tb(s,c,I,T,j);break e}else for(ie&&(In=yt(c.stateNode.containerInfo),bn=c,Bt=!0,ti=null,su=!1),T=B2(c,null,I,T),c.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(Dl(),I===j){c=na(s,c,T);break e}Vr(s,c,I,T)}c=c.child}return c;case 5:return q2(c),s===null&&h0(c),I=c.type,j=c.pendingProps,V=s!==null?s.memoizedProps:null,ee=j.children,z(I,j)?ee=null:V!==null&&z(I,V)&&(c.flags|=32),Pb(s,c),Vr(s,c,ee,T),c.child;case 6:return s===null&&h0(c),null;case 13:return Ab(s,c,T);case 4:return w0(c,c.stateNode.containerInfo),I=c.pendingProps,s===null?c.child=jl(c,null,I,T):Vr(s,c,I,T),c.child;case 11:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ri(I,j),Sb(s,c,I,j,T);case 7:return Vr(s,c,c.pendingProps,T),c.child;case 8:return Vr(s,c,c.pendingProps.children,T),c.child;case 12:return Vr(s,c,c.pendingProps.children,T),c.child;case 10:e:{if(I=c.type._context,j=c.pendingProps,V=c.memoizedProps,ee=j.value,U2(c,I,ee),V!==null)if(ei(V.value,ee)){if(V.children===j.children&&!en.current){c=na(s,c,T);break e}}else for(V=c.child,V!==null&&(V.return=c);V!==null;){var se=V.dependencies;if(se!==null){ee=V.child;for(var pe=se.firstContext;pe!==null;){if(pe.context===I){if(V.tag===1){pe=ra(-1,T&-T),pe.tag=2;var Ce=V.updateQueue;if(Ce!==null){Ce=Ce.shared;var $e=Ce.pending;$e===null?pe.next=pe:(pe.next=$e.next,$e.next=pe),Ce.pending=pe}}V.lanes|=T,pe=V.alternate,pe!==null&&(pe.lanes|=T),y0(V.return,T,c),se.lanes|=T;break}pe=pe.next}}else if(V.tag===10)ee=V.type===c.type?null:V.child;else if(V.tag===18){if(ee=V.return,ee===null)throw Error(o(341));ee.lanes|=T,se=ee.alternate,se!==null&&(se.lanes|=T),y0(ee,T,c),ee=V.sibling}else ee=V.child;if(ee!==null)ee.return=V;else for(ee=V;ee!==null;){if(ee===c){ee=null;break}if(V=ee.sibling,V!==null){V.return=ee.return,ee=V;break}ee=ee.return}V=ee}Vr(s,c,j.children,T),c=c.child}return c;case 9:return j=c.type,I=c.pendingProps.children,zl(c,T),j=Dn(j),I=I(j),c.flags|=1,Vr(s,c,I,T),c.child;case 14:return I=c.type,j=ri(I,c.pendingProps),j=ri(I.type,j),Eb(s,c,I,j,T);case 15:return Ob(s,c,c.type,c.pendingProps,T);case 17:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:ri(I,j),Of(s,c),c.tag=1,tn(I)?(s=!0,ef(c)):s=!1,zl(c,T),gb(c,I,j),N0(c,I,j,T),F0(null,c,I,!0,s,T);case 19:return Mb(s,c,T);case 22:return xb(s,c,T)}throw Error(o(156,c.tag))};function r3(s,c){return o0(s,c)}function _E(s,c,T,I){this.tag=s,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(s,c,T,I){return new _E(s,c,T,I)}function s1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function wE(s){if(typeof s=="function")return s1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===y)return 11;if(s===m)return 14}return 2}function Ha(s,c){var T=s.alternate;return T===null?(T=Bn(s.tag,c,s.key,s.mode),T.elementType=s.elementType,T.type=s.type,T.stateNode=s.stateNode,T.alternate=s,s.alternate=T):(T.pendingProps=c,T.type=s.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=s.flags&14680064,T.childLanes=s.childLanes,T.lanes=s.lanes,T.child=s.child,T.memoizedProps=s.memoizedProps,T.memoizedState=s.memoizedState,T.updateQueue=s.updateQueue,c=s.dependencies,T.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},T.sibling=s.sibling,T.index=s.index,T.ref=s.ref,T}function Hf(s,c,T,I,j,V){var ee=2;if(I=s,typeof s=="function")s1(s)&&(ee=1);else if(typeof s=="string")ee=5;else e:switch(s){case h:return Ho(T.children,j,V,c);case O:ee=8,j|=8;break;case S:return s=Bn(12,T,c,j|2),s.elementType=S,s.lanes=V,s;case p:return s=Bn(13,T,c,j),s.elementType=p,s.lanes=V,s;case v:return s=Bn(19,T,c,j),s.elementType=v,s.lanes=V,s;case g:return $f(T,j,V,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case b:ee=10;break e;case _:ee=9;break e;case y:ee=11;break e;case m:ee=14;break e;case d:ee=16,I=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Bn(ee,T,c,j),c.elementType=s,c.type=I,c.lanes=V,c}function Ho(s,c,T,I){return s=Bn(7,s,I,c),s.lanes=T,s}function $f(s,c,T,I){return s=Bn(22,s,I,c),s.elementType=g,s.lanes=T,s.stateNode={isHidden:!1},s}function u1(s,c,T){return s=Bn(6,s,null,c),s.lanes=T,s}function c1(s,c,T){return c=Bn(4,s.children!==null?s.children:[],s.key,c),c.lanes=T,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function SE(s,c,T,I,j){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i0(0),this.expirationTimes=i0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i0(0),this.identifierPrefix=I,this.onRecoverableError=j,ie&&(this.mutableSourceEagerHydrationData=null)}function n3(s,c,T,I,j,V,ee,se,pe){return s=new SE(s,c,T,se,pe),c===1?(c=1,V===!0&&(c|=8)):c=0,V=Bn(3,null,null,c),s.current=V,V.stateNode=s,V.memoizedState={element:I,isDehydrated:T,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(V),s}function i3(s){if(!s)return Ia;s=s._reactInternals;e:{if(E(s)!==s||s.tag!==1)throw Error(o(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(tn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var T=s.type;if(tn(T))return C2(s,T,c)}return c}function a3(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=R(c),s===null?null:s.stateNode}function o3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var T=s.retryLane;s.retryLane=T!==0&&T<c?T:c}}function Gf(s,c){o3(s,c),(s=s.alternate)&&o3(s,c)}function EE(s){return s=R(s),s===null?null:s.stateNode}function OE(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=Ci(s,134217728);if(c!==null){var T=Fr();zn(c,s,134217728,T)}Gf(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=Ci(s,1);if(c!==null){var T=Fr();zn(c,s,1,T)}Gf(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=Ba(s),T=Ci(s,c);if(T!==null){var I=Fr();zn(T,s,c,I)}Gf(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var T=ou(c.pendingLanes);T!==0&&(a0(c,T|1),an(c,mr()),!(ft&6)&&(Vl(),Pi()))}break;case 13:Kb(function(){var I=Ci(s,1);if(I!==null){var j=Fr();zn(I,s,1,j)}}),Gf(s,1)}},r.batchedUpdates=function(s,c){var T=ft;ft|=1;try{return s(c)}finally{ft=T,ft===0&&(Vl(),of&&Pi())}},r.createComponentSelector=function(s){return{$$typeof:Tf,value:s}},r.createContainer=function(s,c,T,I,j,V,ee){return n3(s,c,!1,null,T,I,j,V,ee)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Af,value:s}},r.createHydrationContainer=function(s,c,T,I,j,V,ee,se,pe){return s=n3(T,I,!0,s,j,V,ee,se,pe),s.context=i3(null),T=s.current,I=Fr(),j=Ba(T),V=ra(I,j),V.callback=c??null,ja(T,V,j),s.current.lanes=j,lu(s,j,I),an(s,I),s},r.createPortal=function(s,c,T){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:I==null?null:""+I,children:s,containerInfo:c,implementation:T}},r.createRoleSelector=function(s){return{$$typeof:Rf,value:s}},r.createTestNameSelector=function(s){return{$$typeof:Mf,value:s}},r.createTextSelector=function(s){return{$$typeof:Lf,value:s}},r.deferredUpdates=function(s){var c=bt,T=er.transition;try{return er.transition=null,bt=16,s()}finally{bt=c,er.transition=T}},r.discreteUpdates=function(s,c,T,I,j){var V=bt,ee=er.transition;try{return er.transition=null,bt=1,s(c,T,I,j)}finally{bt=V,er.transition=ee,ft===0&&Vl()}},r.findAllNodes=Z0,r.findBoundingRects=function(s,c){if(!_e)throw Error(o(363));c=Z0(s,c),s=[];for(var T=0;T<c.length;T++)s.push(te(c[T]));for(c=s.length-1;0<c;c--){T=s[c];for(var I=T.x,j=I+T.width,V=T.y,ee=V+T.height,se=c-1;0<=se;se--)if(c!==se){var pe=s[se],Ce=pe.x,$e=Ce+pe.width,it=pe.y,Fe=it+pe.height;if(I>=Ce&&V>=it&&j<=$e&&ee<=Fe){s.splice(c,1);break}else if(I!==Ce||T.width!==pe.width||Fe<V||it>ee){if(!(V!==it||T.height!==pe.height||$e<I||Ce>j)){Ce>I&&(pe.width+=Ce-I,pe.x=I),$e<j&&(pe.width=j-Ce),s.splice(c,1);break}}else{it>V&&(pe.height+=it-V,pe.y=V),Fe<ee&&(pe.height=ee-it),s.splice(c,1);break}}}return s},r.findHostInstance=a3,r.findHostInstanceWithNoPortals=function(s){return s=C(s),s=s!==null?U(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return a3(s)},r.flushControlled=function(s){var c=ft;ft|=1;var T=er.transition,I=bt;try{er.transition=null,bt=1,s()}finally{bt=I,er.transition=T,ft=c,ft===0&&(Vl(),Pi())}},r.flushPassiveEffects=Uo,r.flushSync=Kb,r.focusWithin=function(s,c){if(!_e)throw Error(o(363));for(s=K0(s),c=Vb(s,c),c=Array.from(c),s=0;s<c.length;){var T=c[s++];if(!me(T)){if(T.tag===5&&We(T.stateNode))return!0;for(T=T.child;T!==null;)c.push(T),T=T.sibling}}return!1},r.getCurrentUpdatePriority=function(){return bt},r.getFindAllNodesFailureDescription=function(s,c){if(!_e)throw Error(o(363));var T=0,I=[];s=[K0(s),0];for(var j=0;j<s.length;){var V=s[j++],ee=s[j++],se=c[ee];if((V.tag!==5||!me(V))&&(Y0(V,se)&&(I.push(X0(se)),ee++,ee>T&&(T=ee)),ee<c.length))for(V=V.child;V!==null;)s.push(V,ee),V=V.sibling}if(T<c.length){for(s=[];T<c.length;T++)s.push(X0(c[T]));return`findAllNodes was able to match part of the selector:
|
|
58
|
+
`+(I.join(" > ")+`
|
|
59
|
+
|
|
60
|
+
No matching component was found for:
|
|
61
|
+
`)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return Z(s.child.stateNode);default:return s.child.stateNode}},r.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:EE,findFiberByHostInstance:s.findFiberByHostInstance||OE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)s=!0;else{try{af=c.inject(s),xi=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,T,I){if(!_e)throw Error(o(363));s=Z0(s,c);var j=Qe(s,T,I).disconnect;return{disconnect:function(){j()}}},r.registerMutableSourceForHydration=function(s,c){var T=c._getVersion;T=T(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,T]:s.mutableSourceEagerHydrationData.push(c,T)},r.runWithPriority=function(s,c){var T=bt;try{return bt=s,c()}finally{bt=T}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,T,I){var j=c.current,V=Fr(),ee=Ba(j);return T=i3(T),c.context===null?c.context=T:c.pendingContext=T,c=ra(V,ee),c.payload={element:s},I=I===void 0?null:I,I!==null&&(c.callback=I),s=ja(j,c,ee),s!==null&&(zn(s,j,ee,V),pf(s,j,ee)),ee},r};F9.exports=SM;var EM=F9.exports;const OM=Ph(EM);var z9={exports:{}},Pl={};/**
|
|
62
|
+
* @license React
|
|
63
|
+
* react-reconciler-constants.production.min.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/Pl.ConcurrentRoot=1;Pl.ContinuousEventPriority=4;Pl.DefaultEventPriority=16;Pl.DiscreteEventPriority=1;Pl.IdleEventPriority=536870912;Pl.LegacyRoot=0;z9.exports=Pl;var B9=z9.exports;const d4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let h4=!1,p4=!1;const Yy=".react-konva-event";let U9=!1;function xM(e){U9=e}const PM=`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
|
+
`,CM=`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
|
+
`,kM={};function qp(e,t,r=kM){if(!h4&&"zIndex"in t&&(console.warn(CM),h4=!0),!p4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(PM),p4=!0)}for(var a in r)if(!d4[a]){var o=a.slice(0,2)==="on",l=r[a]!==t[a];if(o&&l){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var f=!t.hasOwnProperty(a);f&&e.setAttr(a,void 0)}var h=U9||t._useStrictMode,O={},S=!1;const b={};for(var a in t)if(!d4[a]){var o=a.slice(0,2)==="on",_=r[a]!==t[a];if(o&&_){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(b[u]=t[a])}!o&&(t[a]!==r[a]||h&&t[a]!==e.getAttr(a))&&(S=!0,O[a]=t[a])}S&&(e.setAttrs(O),ko(e));for(var u in b)e.on(u+Yy,b[u])}function ko(e){if(!ut.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const H9={},TM={};Ec.Node.prototype._applyProps=qp;function AM(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),ko(e)}function RM(e,t,r){let n=Ec[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=Ec.Group);const i={},a={};for(var o in t){var l=o.slice(0,2)==="on";l?a[o]=t[o]:i[o]=t[o]}const u=new n(i);return qp(u,a),u}function MM(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function LM(e,t,r){return!1}function NM(e){return e}function IM(){return null}function DM(){return null}function jM(e,t,r,n){return TM}function FM(){}function zM(e){}function BM(e,t){return!1}function UM(){return H9}function HM(){return H9}const $M=setTimeout,GM=clearTimeout,VM=-1;function qM(e,t){return!1}const WM=!1,KM=!0,YM=!0;function XM(e,t){t.parent===e?t.moveToTop():e.add(t),ko(e)}function ZM(e,t){t.parent===e?t.moveToTop():e.add(t),ko(e)}function $9(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),ko(e)}function QM(e,t,r){$9(e,t,r)}function JM(e,t){t.destroy(),t.off(Yy),ko(e)}function eL(e,t){t.destroy(),t.off(Yy),ko(e)}function tL(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function rL(e,t,r){}function nL(e,t,r,n,i){qp(e,i,n)}function iL(e){e.hide(),ko(e)}function aL(e){}function oL(e,t){(t.visible==null||t.visible)&&e.show()}function lL(e,t){}function sL(e){}function uL(){}const cL=()=>B9.DefaultEventPriority,fL=Object.freeze(Object.defineProperty({__proto__:null,appendChild:XM,appendChildToContainer:ZM,appendInitialChild:AM,cancelTimeout:GM,clearContainer:sL,commitMount:rL,commitTextUpdate:tL,commitUpdate:nL,createInstance:RM,createTextInstance:MM,detachDeletedInstance:uL,finalizeInitialChildren:LM,getChildHostContext:HM,getCurrentEventPriority:cL,getPublicInstance:NM,getRootHostContext:UM,hideInstance:iL,hideTextInstance:aL,idlePriority:Uu.unstable_IdlePriority,insertBefore:$9,insertInContainerBefore:QM,isPrimaryRenderer:WM,noTimeout:VM,now:Uu.unstable_now,prepareForCommit:IM,preparePortalMount:DM,prepareUpdate:jM,removeChild:JM,removeChildFromContainer:eL,resetAfterCommit:FM,resetTextContent:zM,run:Uu.unstable_runWithPriority,scheduleTimeout:$M,shouldDeprioritizeSubtree:BM,shouldSetTextContent:qM,supportsMutation:YM,unhideInstance:oL,unhideTextInstance:lL,warnsIfNotActing:KM},Symbol.toStringTag,{value:"Module"}));var dL=Object.defineProperty,hL=Object.defineProperties,pL=Object.getOwnPropertyDescriptors,g4=Object.getOwnPropertySymbols,gL=Object.prototype.hasOwnProperty,vL=Object.prototype.propertyIsEnumerable,v4=(e,t,r)=>t in e?dL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m4=(e,t)=>{for(var r in t||(t={}))gL.call(t,r)&&v4(e,r,t[r]);if(g4)for(var r of g4(t))vL.call(t,r)&&v4(e,r,t[r]);return e},mL=(e,t)=>hL(e,pL(t)),y4,b4;typeof window<"u"&&((y4=window.document)!=null&&y4.createElement||((b4=window.navigator)==null?void 0:b4.product)==="ReactNative")?rt.useLayoutEffect:rt.useEffect;function G9(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=G9(n,t,r);if(i)return i;n=n.sibling}}function V9(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const _4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=_4;return}return _4.apply(this,arguments)};const Xy=V9(rt.createContext(null));class q9 extends rt.Component{render(){return rt.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}function yL(){const e=rt.useContext(Xy);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=rt.useId();return rt.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=G9(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}});if(i)return i}},[e,t])}function bL(){const e=yL(),[t]=rt.useState(()=>new Map);t.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==Xy&&!t.has(i)&&t.set(i,rt.useContext(V9(i)))}r=r.return}return t}function W9(){const e=bL();return rt.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>rt.createElement(t,null,rt.createElement(r.Provider,mL(m4({},n),{value:e.get(r)}))),t=>rt.createElement(q9,m4({},t))),[e])}function _L(e){const t=dt.useRef({});return dt.useLayoutEffect(()=>{t.current=e}),dt.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const wL=e=>{const t=dt.useRef(),r=dt.useRef(),n=dt.useRef(),i=_L(e),a=W9(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return dt.useLayoutEffect(()=>(r.current=new Ec.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=ds.createContainer(r.current,B9.LegacyRoot,!1,null),ds.updateContainer(dt.createElement(a,{},e.children),n.current),()=>{Ec.isBrowser&&(o(null),ds.updateContainer(null,n.current,null),r.current.destroy())}),[]),dt.useLayoutEffect(()=>{o(r.current),qp(r.current,e,i),ds.updateContainer(dt.createElement(a,{},e.children),n.current,null)}),dt.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},SL="Layer",EL="FastLayer",Sh="Group",OL="Label",xL="Rect",PL="Circle",CL="Ellipse",kL="Wedge",TL="Line",AL="Sprite",RL="Image",ML="Text",LL="TextPath",NL="Star",IL="Ring",DL="Arc",jL="Tag",FL="Path",zL="RegularPolygon",BL="Arrow",UL="Shape",HL="Transformer",ds=OM(fL);ds.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:dt.version,rendererPackageName:"react-konva"});const $L=dt.forwardRef((e,t)=>dt.createElement(q9,{},dt.createElement(wL,{...e,forwardedRef:t}))),GL=xM,VL=Object.freeze(Object.defineProperty({__proto__:null,Arc:DL,Arrow:BL,Circle:PL,Ellipse:CL,FastLayer:EL,Group:Sh,Image:RL,KonvaRenderer:ds,Label:OL,Layer:SL,Line:TL,Path:FL,Rect:xL,RegularPolygon:zL,Ring:IL,Shape:UL,Sprite:AL,Stage:$L,Star:NL,Tag:jL,Text:ML,TextPath:LL,Transformer:HL,Wedge:kL,useStrictMode:GL},Symbol.toStringTag,{value:"Module"})),Ta=mo(VL);var Go=rt,Wp=function(t,r,n){const i=Go.useRef("loading"),a=Go.useRef(),[o,l]=Go.useState(0),u=Go.useRef(),f=Go.useRef(),h=Go.useRef();return(u.current!==t||f.current!==r||h.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,h.current=n),Go.useLayoutEffect(function(){if(!t)return;var O=document.createElement("img");function S(){i.current="loaded",a.current=O,l(Math.random())}function b(){i.current="failed",a.current=void 0,l(Math.random())}return O.addEventListener("load",S),O.addEventListener("error",b),r&&(O.crossOrigin=r),n&&(O.referrerPolicy=n),O.src=t,function(){O.removeEventListener("load",S),O.removeEventListener("error",b)}},[t,r,n]),[a.current,i.current]};const qL=Ph(Wp);var K9={},Zy={},WL=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const KL=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function Y9(e=()=>{}){const t=dt.useRef(e);return t.current=e,dt.useCallback((...r)=>t.current.apply(null,r),[])}const YL=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=W9(),o=dt.useRef(null);dt.useRef();const[l]=dt.useState(()=>document.createElement("div")),u=dt.useMemo(()=>jd.createRoot(l),[l]),f=n??!0,h=Y9(()=>{if(f&&o.current){let y=o.current.getAbsoluteTransform().decompose();i&&(y=i(y)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${y.x}px, ${y.y}px) rotate(${y.rotation}deg) scaleX(${y.scaleX}) scaleY(${y.scaleY})`,l.style.transformOrigin="top left"}else l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.transform="",l.style.transformOrigin="";const O=r||{},{style:S}=O,b=WL(O,["style"]);Object.assign(l.style,S),Object.assign(l,b)});return dt.useLayoutEffect(()=>{var O;const S=o.current;if(!S)return;const b=(O=S.getStage())===null||O===void 0?void 0:O.container();if(b)return b.appendChild(l),f&&KL(b)&&(b.style.position="relative"),S.on("absoluteTransformChange",h),h(),()=>{var _;S.off("absoluteTransformChange",h),(_=l.parentNode)===null||_===void 0||_.removeChild(l)}},[f]),dt.useLayoutEffect(()=>{h()},[r,i]),dt.useLayoutEffect(()=>{u.render(dt.createElement(a,null,e))}),dt.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),dt.createElement(Sh,Object.assign({ref:o},t))},XL=({selector:e,enabled:t,children:r})=>{const n=dt.useRef(null),i=dt.useRef(null),a=dt.useRef(),o=t??!0;return dt.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const f=n.current.getLayer();if(f&&(f.batchDraw(),u)){const h=u.getLayer();if(!h)return;h.batchDraw()}},[e,o]),dt.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),dt.createElement(Sh,{name:"_outer_portal",ref:n},dt.createElement(Sh,{name:"_inner_portal",ref:i},r))},ZL=Object.freeze(Object.defineProperty({__proto__:null,Html:YL,Portal:XL,useEvent:Y9,useImage:qL},Symbol.toStringTag,{value:"Module"})),Kc=mo(ZL);function QL(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function X9(e,t,r){const n=t-1,i=r[Q9(n,r.length)];return i.marker!=="Z"?i:X9(e,n,r)}function Z9(e,t,r){const n=t+1,i=r[Q9(n,r.length)];return i.marker==="Z"?Z9(e,n,r):i}function JL(e,t,r){let n=r[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let a=function(l,u){return l[u].marker==="M"?l[u]:a(l,u-1)};var i=a;let o=a(r,t);e.values.x=o.values.x,e.values.y=o.values.y}return e}function eN(e,t){const r=[];switch(e.toUpperCase()){case"M":for(let n=0;n<t.length;n+=2){let i;e===e.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:t[n],y:t[n+1]}})}break;case"L":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"H":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:t[n],y:0}});break;case"V":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:0,y:t[n]}});break;case"C":for(let n=0;n<t.length;n+=6)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x2:t[n+2],y2:t[n+3],x:t[n+4],y:t[n+5]}});break;case"S":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x2:t[n],y2:t[n+1],x:t[n+2],y:t[n+3]}});break;case"Q":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x:t[n+2],y:t[n+3]}});break;case"T":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"A":for(let n=0;n<t.length;n+=7)r.push({marker:e,values:{radiusX:t[n],radiusY:t[n+1],rotation:t[n+2],largeArc:t[n+3],sweep:t[n+4],x:t[n+5],y:t[n+6]}});break;case"Z":r.push({marker:e,values:{x:0,y:0}});break}return r}function Q9(e,t){return(e%t+t)%t}function tN(e,t,r){if(t!==0&&e.marker==="L"){let n=r[t-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function vm(e,t){const r=["x","y"].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker==="L"&&r&&(e[t].overlap=!0,vm(e,t-1)),e[t].marker==="Z"&&vm(e,t-1)}function rN(e,t,r){const n=S4(e.values,r.values),i=S4(t.values,e.values);return Math.min(i,n)}function w4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function S4(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function E4(e,t){return Math.sin(e)*t}function O4(e,t){return Math.cos(e)*t}function x4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function nN(e,t){return t*Math.tan(e)}function iN(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=x4(e/2,-t):(r=x4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function aN(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=t.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function J9(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=e.substring(i.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return eN(n.marker,a)}).map(JL)}function e7(e,t,r){let n=[],i=[];return r&&e.forEach(a=>QL(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(tN),vm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const O=X9(l,u,f),S=Z9(l,u,f),b=w4(l.values,O.values),_=w4(l.values,S.values),y=_-b,p=y*(180/Math.PI),v=rN(l,O,S),m=Math.abs(nN(y/2,v/2)),d=Math.min(t,m),g=iN(y,d),w=g.offset,k=g.sweepFlag,P=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const A=[l.values.x+E4(b,w),l.values.y+O4(b,w)],E=[l.values.x+E4(_,w),l.values.y+O4(_,w)];P?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(A[0].toFixed(3)),y:parseFloat(A[1].toFixed(3))}}),!P&&(S.marker==="L"||S.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:p,largeArc:0,sweep:k,x:parseFloat(E[0].toFixed(3)),y:parseFloat(E[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:l.marker,values:l.values});break}})}),{path:aN(i),commands:i}}function oN(e,t,r){return e7([...J9(e)],t,r)}const lN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:J9,roundCommands:e7,roundCorners:oN},Symbol.toStringTag,{value:"Module"})),sN=mo(lN);var Yc={},Qy={},Jy={},Cl=Cl||{};Cl.stringify=function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var r=e.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+e.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,n=e.visit(t.at),i=e.visit(t.style);return i&&(r+=" "+i),n&&(r+=" at "+n),r},"visit_default-radial":function(t){var r="",n=e.visit(t.at);return n&&(r+=n),r},"visit_extent-keyword":function(t){var r=t.value,n=e.visit(t.at);return n&&(r+=" at "+n),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return e.visit(t.value.x)+" "+e.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color("#"+t.value,t)},visit_rgb:function(t){return e.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return e.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var n=t,i=e.visit(r.length);return i&&(n+=" "+i),n},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",n=t.length;return t.forEach(function(i,a){r+=e.visit(i),a<n-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return e.visit_array(t,r);if(t.type){var n=e["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return e.visit(t)}}();var Cl=Cl||{};Cl.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function r(W){var H=new Error(t+": "+W);throw H.source=t,H}function n(){var W=i();return t.length>0&&r("Invalid input not EOF"),W}function i(){return d(a)}function a(){return o("linear-gradient",e.linearGradient,u)||o("repeating-linear-gradient",e.repeatingLinearGradient,u)||o("radial-gradient",e.radialGradient,O)||o("repeating-radial-gradient",e.repeatingRadialGradient,O)}function o(W,H,L){return l(H,function(M){var D=L();return D&&(G(e.comma)||r("Missing comma before color stops")),{type:W,orientation:D,colorStops:d(g)}})}function l(W,H){var L=G(W);if(L){G(e.startCall)||r("Missing (");var M=H(L);return G(e.endCall)||r("Missing )"),M}}function u(){return f()||h()}function f(){return U("directional",e.sideOrCorner,1)}function h(){return U("angular",e.angleValue,1)}function O(){var W,H=S(),L;return H&&(W=[],W.push(H),L=t,G(e.comma)&&(H=S(),H?W.push(H):t=L)),W}function S(){var W=b()||_();if(W)W.at=p();else{var H=y();if(H){W=H;var L=p();L&&(W.at=L)}else{var M=v();M&&(W={type:"default-radial",at:M})}}return W}function b(){var W=U("shape",/^(circle)/i,0);return W&&(W.style=N()||y()),W}function _(){var W=U("shape",/^(ellipse)/i,0);return W&&(W.style=C()||y()),W}function y(){return U("extent-keyword",e.extentKeywords,1)}function p(){if(U("position",/^at/,0)){var W=v();return W||r("Missing positioning value"),W}}function v(){var W=m();if(W.x||W.y)return{type:"position",value:W}}function m(){return{x:C(),y:C()}}function d(W){var H=W(),L=[];if(H)for(L.push(H);G(e.comma);)H=W(),H?L.push(H):r("One extra comma");return L}function g(){var W=w();return W||r("Expected color definition"),W.length=C(),W}function w(){return P()||E()||A()||k()}function k(){return U("literal",e.literalColor,0)}function P(){return U("hex",e.hexColor,1)}function A(){return l(e.rgbColor,function(){return{type:"rgb",value:d(x)}})}function E(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(x)}})}function x(){return G(e.number)[1]}function C(){return U("%",e.percentageValue,1)||R()||N()}function R(){return U("position-keyword",e.positionKeywords,1)}function N(){return U("px",e.pixelValue,1)||U("em",e.emValue,1)}function U(W,H,L){var M=G(H);if(M)return{type:W,value:M[L]}}function G(W){var H,L;return L=/^[\n\r\t\s]+/.exec(t),L&&Z(L[0].length),H=W.exec(t),H&&Z(H[0].length),H}function Z(W){t=t.substr(W)}return function(W){return t=W.toString(),n()}}();Jy.parse=Cl.parse;Jy.stringify=Cl.stringify;(function(e){var t=ve&&ve.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const r=t(Jy),n=o=>o.indexOf("linear-gradient")>=0;e.isGradient=n;const i=o=>o.type==="hex"?"#"+o.value:o.type==="literal"?o.value:`${o.type}(${o.value.join(",")})`,a=o=>{if(!(0,e.isGradient)(o))return{rotation:0,stops:[{offset:0,color:o},{offset:1,color:o}]};const l=r.default.parse(o)[0];return{rotation:parseFloat(l.orientation.value),stops:l.colorStops.map((u,f)=>({color:i(u),offset:u.length?parseFloat(u.length.value)/100:f/(l.colorStops.length-1)}))}};e.parseColor=a})(Qy);(function(e){var t=ve&&ve.__createBinding||(Object.create?function(f,h,O,S){S===void 0&&(S=O);var b=Object.getOwnPropertyDescriptor(h,O);b&&!("get"in b?!h.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return h[O]}}),Object.defineProperty(f,S,b)}:function(f,h,O,S){S===void 0&&(S=O),f[S]=h[O]}),r=ve&&ve.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),n=ve&&ve.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var O in f)O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)&&t(h,f,O);return r(h,f),h},i=ve&&ve.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(rt),o=n(Qy),l=i(wi),u=(f,h=f.fill,O="fill")=>a.default.useMemo(()=>{if(!o.isGradient(h))return{[O]:h};const{stops:S,rotation:b}=o.parseColor(h),_={x:f.a.width/2,y:f.a.height/2},y=Math.sqrt(Math.pow(_.x,2)+Math.pow(_.y,2)),p=l.default.Util.degToRad(b)-Math.PI/2,v=[];return S.forEach(({offset:m,color:d})=>{v.push(m,d)}),O==="fill"?{fillLinearGradientStartPointX:_.x-y*Math.cos(p),fillLinearGradientStartPointY:_.y-y*Math.sin(p),fillLinearGradientColorStops:v,fillLinearGradientEndPointX:_.x+y*Math.cos(p),fillLinearGradientEndPointY:_.y+y*Math.sin(p),fill:S[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:_.x-y*Math.cos(p),strokeLinearGradientStartPointY:_.y-y*Math.sin(p),strokeLinearGradientColorStops:v,strokeLinearGradientEndPointX:_.x+y*Math.cos(p),strokeLinearGradientEndPointY:_.y+y*Math.sin(p)}},[h,f.width,f.height]);e.useColor=u})(Yc);var Gi={},kl={};(function(e){var t=ve&&ve.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFadeIn=e.isAnimationUsed=e.toggleFadeInAnimation=void 0;const r=t(rt),n=t(wi);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const h=r.default.useRef();r.default.useLayoutEffect(()=>{h.current&&h.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const O=u.current.opacity();return O?(u.current.opacity(0),h.current=new n.default.Tween({node:u.current,opacity:O,onFinish:()=>{var S;(S=h.current)===null||S===void 0||S.destroy()}}),h.current.play(),()=>{var S;(S=h.current)===null||S===void 0||S.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(kl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.triggerLoadError=e.onLoadError=e.whenLoaded=e.decrementLoader=e.incrementLoader=e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0;const t=kl;let r=0,n=[],i=3e4;const a=v=>{i=v};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=v=>{l=v};e.setFontLoadTimeout=u;const f=()=>l;function h(v){r+=1;let m=!1;const d=setTimeout(()=>{m||(p(`Timeout loading asset ${v}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",v),m=!0,O())},i);return()=>{m||(clearTimeout(d),O())}}function O(){r-=1,r===0&&(n.forEach(v=>v()),n=[])}function S(v){r===0?v():n.push(v)}function b(){return new Promise(v=>S(()=>{(0,t.isAnimationUsed)()?setTimeout(v,300):v(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=h,e.decrementLoader=O,e.whenLoaded=b;let _=[];function y(v){_.push(v)}function p(v){_.forEach(m=>m(v))}e.onLoadError=y,e.triggerLoadError=p})(Gi);var Js={};(function(e){var t=ve&&ve.__createBinding||(Object.create?function(C,R,N,U){U===void 0&&(U=N);var G=Object.getOwnPropertyDescriptor(R,N);G&&!("get"in G?!R.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return R[N]}}),Object.defineProperty(C,U,G)}:function(C,R,N,U){U===void 0&&(U=N),C[U]=R[N]}),r=ve&&ve.__setModuleDefault||(Object.create?function(C,R){Object.defineProperty(C,"default",{enumerable:!0,value:R})}:function(C,R){C.default=R}),n=ve&&ve.__importStar||function(C){if(C&&C.__esModule)return C;var R={};if(C!=null)for(var N in C)N!=="default"&&Object.prototype.hasOwnProperty.call(C,N)&&t(R,C,N);return r(R,C),R};Object.defineProperty(e,"__esModule",{value:!0}),e.injectCustomFont=e.injectGoogleFont=e.getGoogleFontsVariants=e.setGoogleFontsVariants=e.loadFont=e.isFontLoaded=e.replaceGlobalFonts=e.removeGlobalFont=e.addGlobalFont=e.globalFonts=e.getFontsList=e.setGoogleFonts=e.isGoogleFontChanged=void 0;const i=n(Yi),a=Gi;let o=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),l=i.observable({value:!1});function u(){return l.value}function f(C){C!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...C)):l.value=!1}function h(){return o}function O(C){e.globalFonts.push(C)}function S(C){const R=e.globalFonts.findIndex(N=>N.fontFamily===C);R!==-1&&e.globalFonts.splice(R,1)}function b(C){e.globalFonts.replace(C)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=h,e.globalFonts=i.observable([]),e.addGlobalFont=O,e.removeGlobalFont=S,e.replaceGlobalFonts=b;var _="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",y=document.createElement("canvas");function p(C,R="Arial",N="normal",U="normal"){var G=y.getContext("2d");return G.font=`${N} ${U} 40px '${C}', ${R}`,G.measureText(_).width}const v={Arial:!0},m=C=>!!v[C];async function d(C,R,N){var U;if(v[C])return;const G=!!(!((U=document.fonts)===null||U===void 0)&&U.load),Z=p("Arial","Arial",R,N);if(G)try{await document.fonts.load(`16px '${C}', ${R} ${N}`);const M=p(C,"Arial",R,N);if(Z!==M)return void(v[C]=!0)}catch{}const W=p("Times","Times",R,N),H=p(C,"Arial",R,N),L=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let M=0;M<L;M++){const D=p(C,"Arial",R,N),B=p(C,"Times",R,N);if(D!==H||D!==Z||B!==W)return void(v[C]=!0);await new Promise(q=>setTimeout(q,60))}console.warn(`Timeout for loading font "${C}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${C}"`)}e.isFontLoaded=m,e.loadFont=d;const g={};let w="400,400italic,700,700italic";function k(C){w=C}function P(){return w}function A(C){if(g[C])return;const R=`https://fonts.googleapis.com/css?family=${C.replace(/ /g,"+")}:${w}`,N=document.createElement("link");N.type="text/css",N.href=R,N.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(N),g[C]=!0}e.setGoogleFontsVariants=k,e.getGoogleFontsVariants=P,e.injectGoogleFont=A;const E={};function x(C){const R=C.fontFamily;if(E[R]||!C.url&&!C.styles)return;const N=document.createElement("style");N.type="text/css";const U=C.styles||(C.url?[{src:`url("${C.url}")`}]:[]);let G="";U.forEach(Z=>{G+=`
|
|
77
|
+
@font-face {
|
|
78
|
+
font-family: '${R}';
|
|
79
|
+
src: ${Z.src};
|
|
80
|
+
font-style: ${Z.fontStyle||"normal"};
|
|
81
|
+
font-weight: ${Z.fontWeight||"normal"};
|
|
82
|
+
}
|
|
83
|
+
`}),N.innerHTML=G,document.getElementsByTagName("head")[0].appendChild(N),E[C.fontFamily]=!0}e.injectCustomFont=x})(Js);var Kn={};(function(e){var t=ve&&ve.__createBinding||(Object.create?function(a,o,l,u){u===void 0&&(u=l);var f=Object.getOwnPropertyDescriptor(o,l);f&&!("get"in f?!o.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(a,u,f)}:function(a,o,l,u){u===void 0&&(u=l),a[u]=o[l]}),r=ve&&ve.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=ve&&ve.__importStar||function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var l in a)l!=="default"&&Object.prototype.hasOwnProperty.call(a,l)&&t(o,a,l);return r(o,a),o};Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=n(Yi);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(a=>{e.flags.textVerticalResizeEnabled=a}),e.useRemoveBackground=i.action(a=>{e.flags.removeBackgroundEnabled=a}),e.useHtmlTextRender=i.action(a=>{e.flags.htmlRenderEnabled=a}),e.setDownScalingEnabled=i.action(a=>{e.flags.imageDownScalingEnabled=a}),e.useDownScaling=i.action(a=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(a)}),e.setForceTextFit=i.action(a=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(a=>{e.flags.textOverflow=a}),e.setAnimationsEnabled=i.action(a=>{e.flags.animationsEnabled=a})})(Kn);var e2={};(function(e){function t(r=""){return(r.match(/<\/p>/gi)||[]).length>1&&(r=r.replace(/<\/p>/gi,(n,i,a)=>(a.slice(i+n.length).match(/<\/p>/gi)||[]).length>0?`
|
|
84
|
+
`:n)),r.replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(e2);var Xc={};(function(e){var t=ve&&ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(wi);function n(i,a){var o;const l={filters:[]};a.brightnessEnabled&&(l.filters.push(r.default.Filters.Brighten),l.brightness=a.brightness),a.blurEnabled&&(l.filters.push(r.default.Filters.Blur),l.blurRadius=a.blurRadius),a.sepiaEnabled&&l.filters.push(r.default.Filters.Sepia),a.grayscaleEnabled&&l.filters.push(r.default.Filters.Grayscale),i.setAttrs(l),l.filters.length?i.cache({pixelRatio:a.store._elementsPixelRatio}):i.clearCache(),(o=i.getLayer())===null||o===void 0||o.batchDraw()}e.applyFilter=n})(Xc);var Tl={};(function(e){var t=ve&&ve.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const r=t(rt),n=Zn,i=Ta,a={stroke:"rgb(0, 161, 255)",strokeWidth:2},o=l=>{Object.assign(a,l)};e.setHighlighterStyle=o,e.Highlighter=(0,n.observer)(({element:l})=>r.default.createElement(i.Rect,Object.assign({name:"highlighter",x:l.a.x,y:l.a.y,rotation:l.a.rotation,width:l.a.width,height:l.a.height,listening:!1,strokeScaleEnabled:!1},a)))})(Tl);var To={};(function(e){var t=ve&&ve.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const r=t(rt);e.MOBILE_BREAKPOINT=800;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const i=l=>`
|
|
85
|
+
@media (max-width: ${e.MOBILE_BREAKPOINT}px) {
|
|
86
|
+
${l}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.polotno-mobile & {
|
|
90
|
+
${l}
|
|
91
|
+
}
|
|
92
|
+
`;e.mobileStyle=i;const a=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;e.isTouchDevice=a;const o=()=>{const[l,u]=r.default.useState((0,e.isMobile)());return r.default.useEffect(()=>{const f=()=>{u((0,e.isMobile)())};return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[]),l};e.useMobile=o})(To);var P4={},t7="warn";function r7(e){t7=e}function n7(){return t7}function uN(e){r7(e)}var fr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(fr||(fr={}));var mm=function(e,t){return mm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},mm(e,t)};function It(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mm(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var hr=function(){return hr=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},hr.apply(this,arguments)};function cN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function i7(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(f){return function(h){return u([f,h])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(r=0)),r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(h){f=[6,h],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Ju(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function Ki(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Zc(e){return Ge(e).type}function fN(e,t){return Ge(e).getChildType(t)}function a7(e,t){return Ge(e).onPatch(t)}function dN(e,t){return Ge(e).onSnapshot(t)}function Ds(e,t){Ge(e).applyPatches(s2(t))}function hN(e,t){var r={patches:[],inversePatches:[]},n={},i,a={get recording(){return!!i},get patches(){return n.patches||(n.patches=r.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=r.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=r.inversePatches.slice()),n.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=a7(e,function(o,l){t&&!t(o,l,i2())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ds(o||e,r.patches)},undo:function(o){Ds(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function pN(e){var t=Ge(e);if(!t.isRoot)throw new Be("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function gN(e){var t=Ge(e);if(!t.isRoot)throw new Be("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function vN(e){return Ge(e).isProtected}function o7(e,t){return Ge(e).applySnapshot(t)}function t2(e,t){t===void 0&&(t=!0);var r=Ge(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function mN(e,t){t===void 0&&(t=1);for(var r=Ge(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function yN(e,t){t===void 0&&(t=1);for(var r=t,n=Ge(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw new Be("Failed to find the parent of ".concat(Ge(e)," at depth ").concat(t))}function bN(e,t){for(var r=Ge(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function _N(e,t){for(var r=Ge(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new Be("Failed to find the parent of ".concat(Ge(e)," of a given type"))}function l7(e){return Ge(e).root.storedValue}function s7(e){return Ge(e).path}function wN(e){return Us(Ge(e).path)}function SN(e){return Ge(e).isRoot}function EN(e,t){var r=P7(Ge(e),t);return r?r.value:void 0}function ON(e,t,r){var n=Ge(t).root.identifierCache.resolve(e,eu(r));return n==null?void 0:n.value}function u7(e){return Ge(e).identifier}function xN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Pt(r))return t?r2(r)?r:void 0:r;throw new Be("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return;throw n}}function PN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Pt(r))return t?r2(r):!0;throw new Be("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return!1;throw n}}function c7(e,t){var r=P7(Ge(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function CN(e,t){return x7(Ge(e),Ge(t))}function kN(e,t){t===void 0&&(t=!0);var r=Ge(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function TN(e){return Ge(e).detach(),e}function AN(e){var t=Ge(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function r2(e){return Ge(e).observableIsAlive}function RN(e,t){var r=Ge(e);return r.addDisposer(t),t}function MN(e){var t=Ge(e),r=t.root.environment;if(!r)throw new Be("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function LN(e){var t=Ge(e),r=t.root.environment;return!!r}function f7(e,t){var r=Ge(e);r.getChildren().forEach(function(n){Pt(n.storedValue)&&f7(n.storedValue,t)}),t(r.storedValue)}function d7(e){var t;return Pt(e)?t=Zc(e):t=e,{name:t.name,properties:hr({},t.properties)}}function NN(e){var t=Ge(e).type,r=hr(hr({},d7(t)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(i){if(!(i in r.properties)){var a=Object.getOwnPropertyDescriptor(e,i);if(a.get){D8(e,i)?r.views.push(i):r.volatile.push(i);return}a.value._isFlowAction===!0&&r.flowActions.push(i),a.value._isMSTAction===!0?r.actions.push(i):F8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function IN(e){return e}function DN(e){return e}function jN(e){return e}function FN(e){return Ge(e).nodeId}var h7=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:kr.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new R7),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=yc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?co(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==kr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===kr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=yc("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===kr.CREATED){if(this.parent){if(this.parent.state!==kr.FINALIZED)return;this.fireHook(fr.afterAttach)}this.state=kr.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=kr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(fr.beforeDestroy)}}),e}(),Oc=function(e){It(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=kr.DEAD,u}return l.state=kr.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Be("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===kr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(h7);Oc.prototype.die=ar(Oc.prototype.die);var zN=1,li;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(li||(li={}));var wn;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(wn||(wn={}));var BN={onError:function(e){throw e}},gn=function(e){It(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++zN}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:li.UNINITIALIZED}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=gl(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new oI),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var u=l._initialSnapshot[l.identifierAttribute];if(u===void 0){var f=l._childNodes[l.identifierAttribute];f&&(u=f.value)}if(typeof u!="string"&&typeof u!="number")throw new Be("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=eu(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===li.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=li.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===li.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=Ju(l),h=f.next();!h.done;h=f.next()){var O=h.value;O.createObservableInstanceIfNeeded(!1)}}catch(y){n={error:y}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var S=this.type;try{this.storedValue=S.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,S.finalizeNewInstance(this,this.storedValue)}catch(y){throw this.state=kr.DEAD,y}finally{this._isRunningAction=!1}if(this._observableInstanceState=li.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=zs,this.state=kr.CREATED,r){this.fireHook(fr.afterCreate),this.finalizeCreation();try{for(var b=Ju(l.reverse()),_=b.next();!_.done;_=b.next()){var O=_.value;O.fireHook(fr.afterCreate),O.finalizeCreation()}}catch(y){a={error:y}}finally{try{_&&!_.done&&(o=b.return)&&o.call(b)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(fr.beforeDetach);var r=this.state;this.state=kr.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(fr.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(As?As(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===li.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=n7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new Be(i);case"warn":bI(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&co(r.subpath)||"",a=r.actionContext||n2();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&s7(a.context)||n;o="".concat(l,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===li.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(zs),this._autoUnbox=!1;try{return this._observableInstanceState===li.CREATED?this.type.getChildren(this):k7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new Be("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=Ju(r.getChildren()),o=a.next();!o.done;o=a.next()){var l=o.value;l.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(fr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Be("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=xc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Us(i.path),o=C7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=xc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),el(this.storedValue,"$treenode",this),el(this.storedValue,"toJSON",sI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===kr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==li.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(wn.Dispose),this._internalEventsClear(wn.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(wn.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(wn.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(wn.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(wn.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=vI({},r,{path:i}),o=Wi(xI(a),2),l=o[0],u=o[1];this._internalEventsEmit(wn.Patch,l,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(wn.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(wn.Dispose,r,!0);return}throw new Be("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(wn.Dispose,r))throw new Be("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(wn.Dispose,r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=k8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},BN);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new R7),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,Ki([r],Wi(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(h7);gn.prototype.createObservableInstance=ar(gn.prototype.createObservableInstance);gn.prototype.detach=ar(gn.prototype.detach);gn.prototype.die=ar(gn.prototype.die);var p7,ot;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(ot||(ot={}));var g7="cannotDetermine",UN=Symbol("$type"),Ea=function(){function e(t){Object.defineProperty(this,p7,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return ma(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw new Be("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=O7(t);if(n){var i=Zc(t);return this.isAssignableFrom(i)?vn():mn(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Be("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Be("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Be("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Be("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();p7=UN;Ea.prototype.create=ar(Ea.prototype.create);var js=function(e){It(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===eu(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Pt(n)&&Ge(n)===r?!0:r.type===this&&T7(n)&&!Pt(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),Pt(n)&&this.isAssignableFrom(Zc(n))){var l=Ge(n);return l.setParent(i,a),l}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Ea);js.prototype.create=ar(js.prototype.create);var Al=function(e){It(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Ea);function pr(e){return typeof e=="object"&&e&&e.isType===!0}var Ni=new Map;function HN(e){return function(r,n,i){switch(r.type){case"action":if(!e.filter||e.filter(r)===!0){var a=e.onStart(r);e.onResume(r,a),Ni.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Ni.get(r.id).async===!1&&(Ni.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Ni.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Ni.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Ni.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Ni.get(r.rootId);return Ni.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Ni.get(r.rootId);return Ni.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var $N=function(){function e(t,r){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),t&&t.onStart(r)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,t))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function GN(e){var t=new Map;return function(n,i){var a=n.parentActionEvent?t.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=hr(hr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new $N(u,o);t.set(n.id,f);var h=void 0;try{h=i(n)}catch(S){throw t.delete(n.id),f.finish(S),S}return f.hasFlowsPending||(t.delete(n.id),f.finish()),h}else{if(!a)return i(n);switch(n.type){case"flow_spawn":return a.incFlowsPending(),i(n);case"flow_resume":case"flow_resume_error":return i(n);case"flow_throw":{var O=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(O))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function VN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(Bs(n))return n;if(Pt(n))return bd("[MSTNode: ".concat(Zc(n).name,"]"));if(typeof n=="function")return bd("[function]");if(typeof n=="object"&&!Zo(n)&&!l2(n))return bd("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return bd(""+i)}}function qN(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function bd(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function v7(e,t){As(function(){s2(t).forEach(function(r){return WN(e,r)})})}function WN(e,t){var r=c7(e,t.path||"");if(!r)throw new Be("Invalid action path: ".concat(t.path||""));var n=Ge(r);if(t.name==="@APPLY_PATCHES")return Ds.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return o7.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw new Be("Action '".concat(t.name,"' does not exist in '").concat(n.path,"'"));return r[t.name].apply(r,t.args?t.args.map(function(i){return qN(n,i)}):[])}function KN(e,t){var r=[],n=function(o){var l=t?t(o,i2()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=m7(e,n))},replay:function(o){v7(o,r)}};return a.resume(),a}function m7(e,t,r){return r===void 0&&(r=!1),_7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=Ge(i.context),l={name:i.name,path:x7(Ge(e),o),args:i.args.map(function(f,h){return VN(o,i.name,h,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var YN=1,ec;function n2(){return ec}function y7(){return YN++}function ym(e,t){var r=Ge(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=ec;ec=e;try{return QN(r,e,t)}finally{ec=i,r._isRunningAction=n}}function b7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function xc(e,t,r){var n=function(){var i=y7(),a=ec,o=b7(a);return ym({type:"action",name:t,id:i,args:M7(arguments),context:e,tree:l7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Ki(Ki([],Wi(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function _7(e,t,r){r===void 0&&(r=!0);var n=Ge(e);return n.addMiddleWare(t,r)}function XN(e,t,r){r===void 0&&(r=!0);var n={handler:e,includeHooks:r};return t.$mst_middleware=t.$mst_middleware||[],t.$mst_middleware.push(n),t}var ZN=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function QN(e,t,r){var n=new ZN(e,r);if(n.isEmpty)return ar(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return ar(r).apply(null,o.args);if(!l.includeHooks&&fr[o.name])return a(o);function f(O,S){i=a(O),S&&(i=S(i))}function h(O){i=O}return u(o,f,h),i}return a(t)}function i2(){for(var e=n2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function w7(e,t,r){for(var n=typeof t=="number"?t:t.id,i=r?e:e.parentActionEvent;i;){if(i.id===n)return!0;i=i.parentActionEvent}return!1}function JN(e,t){return w7(e,t,!1)}function eI(e,t){return w7(e,t,!0)}function tI(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function S7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Pt(e)?"<".concat(e,">"):"`".concat(tI(e),"`")}function rI(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function nI(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var u=l.path;return u}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=Pt(t)?"value of type ".concat(Ge(t).type.name,":"):Bs(t)?"value":"snapshot",o=r&&Pt(t)&&r.is(Ge(t).snapshot);return"".concat(i).concat(a," ").concat(S7(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?V7(r)||Bs(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function a2(e,t,r){return e.concat([{path:t,type:r}])}function vn(){return Fs}function mn(e,t,r){return[{context:e,value:t,message:r}]}function Kp(e){return e.reduce(function(t,r){return t.concat(r)},[])}function ma(e,t){_I()&&E7(e,t)}function E7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Be(iI(e,t,r))}function iI(e,t,r){if(r.length!==0)return"Error while converting ".concat(rI(S7(t))," to `").concat(e.name,`\`:
|
|
93
|
+
|
|
94
|
+
`)+r.map(nI).join(`
|
|
95
|
+
`)}var aI=0,oI=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:aI++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Tt.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Tt.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,Tt.array([],Yp));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Be("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;Oy(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return z8(this.cache).forEach(function(a){for(var o=Wi(a,2),l=o[0],u=o[1],f=!1,h=u.length-1;h>=0;h--){var O=u[h];(O===t||O.path.indexOf(i)===0)&&(n.addNodeToCache(O,!1),u.splice(h,1),u.length||r.cache.delete(l),f=!0)}f&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new Be("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e}();function o2(e,t,r,n,i){var a=O7(i);if(a){if(a.parent)throw new Be("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new gn(e,t,r,n,i)}function Ao(e,t,r,n,i){return new Oc(e,t,r,n,i)}function lI(e){return e instanceof Oc||e instanceof gn}var kr;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(kr||(kr={}));function Pt(e){return!!(e&&e.$treenode)}function Ge(e){if(!Pt(e))throw new Be("Value ".concat(e," is no MST Node"));return e.$treenode}function O7(e){return e&&e.$treenode||null}function sI(){return Ge(this).snapshot}var uI=function(e){return".."};function x7(e,t){if(e.root!==t.root)throw new Be("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=Us(e.path),n=Us(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(uI).join("/")+Eh(n.slice(i))}function P7(e,t,r){return r===void 0&&(r=!0),C7(e,Us(t),r)}function C7(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof Oc){var o=n.value;Pt(o)&&(n=Ge(o))}if(n instanceof gn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new Be("Could not resolve '".concat(a,"' in path '").concat(Eh(t.slice(0,i))||"/","' while resolving '").concat(Eh(t),"'"))}}catch(u){if(!r)return;throw u}return n}function k7(e){if(!e)return Fs;var t=Object.keys(e);if(!t.length)return Fs;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function cI(e){return L7(),N7(e)}var fI=Object.toString(),Fs=Object.freeze([]),zs=Object.freeze({}),Yp=v8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Yp);var Be=function(e){It(t,e);function t(r){return r===void 0&&(r="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(r))||this}return t}(Error);function dI(e){return e}var hI=Number.isInteger;function pI(e){return Number(e)===e&&e%1!==0}function gI(e){return Number.isFinite(e)}function l2(e){return Array.isArray(e)||Zr(e)}function s2(e){return e?l2(e)?e:[e]:Fs}function vI(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}function Zo(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===fI}function T7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function Bs(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function A7(e){return typeof e!="function"}function mI(e,t,r){Er(e)?Py(e,t,r):Object.defineProperty(e,t,r)}function el(e,t,r){mI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var yI=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,Ki([],Wi(t),!1))})}}),e}(),R7=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new yI),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(r=a).emit.apply(r,Ki([],Wi(n),!1))}}),e}();function M7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function tg(e,t){return e.indexOf(t)===0}var L7=function(e,t){};L7.ids={};function bI(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function _I(){return typeof process<"u"&&P4&&P4.ENABLE_TYPE_CHECK==="true"}function rg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function N7(e){return OI(e.name,e)}function wI(e){return e}function SI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return i7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,Ki([],Wi(r),!1))];case 1:return[2,n.sent()]}})}}function EI(e){return i7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function OI(e,t){var r=function(){var i=y7(),a=n2();if(!a)throw new Be("a mst flow must always have a parent context");var o=b7(a);if(!o)throw new Be("a mst flow must always have a parent action context");var l={name:e,id:i,tree:a.tree,context:a.context,parentId:a.id,allParentIds:Ki(Ki([],Wi(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(h,O,S){return h.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:O,args:[S]}),h)}return new Promise(function(h,O){var S,b=function(){S=t.apply(null,arguments),_(void 0)};b.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:"flow_spawn",args:M7(u)}),b);function _(v){var m;try{var d=f(function(g){m=S.next(g)},"flow_resume",v);d instanceof Error&&(m=S.throw(d))}catch(g){rg(function(){f(function(w){O(g)},"flow_throw",g)});return}p(m)}function y(v){var m;try{f(function(d){m=S.throw(d)},"flow_resume_error",v)}catch(d){rg(function(){f(function(g){O(d)},"flow_throw",d)});return}p(m)}function p(v){if(v.done){rg(function(){f(function(m){h(m)},"flow_return",v.value)});return}if(!v.value||typeof v.value.then!="function")throw new Be("Only promises can be yielded to `async`, got: "+v);return v.value.then(_,y)}})};return r._isFlowAction=!0,r}function xI(e){if(!("oldValue"in e))throw new Be("Patches without `oldValue` field cannot be inversed");return[PI(e),CI(e)]}function PI(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 CI(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 kI(e){return typeof e=="number"}function co(e){return kI(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function I7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Eh(e){if(e.length===0)return"";var t=function(r){return r.map(co).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Us(e){var t=e.split("/").map(I7),r=e===""||e==="."||e===".."||tg(e,"/")||tg(e,"./")||tg(e,"../");if(!r)throw new Be("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var ng=Symbol("$preProcessorFailed"),TI=function(e){It(t,e);function t(r,n,i){var a=e.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return ng}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;AI(r.type,this,"create"),r instanceof gn&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},W7(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?a:this.preProcessSnapshot(a),l=this._subtype.instantiate(r,n,i,o);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,Pt(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===ng?mn(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=pr(r)?this._subtype:Pt(r)?t2(r,!1):this.preProcessSnapshotSafe(r);return n===ng?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof js))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(Ea);function AI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Ju(i),l=o.next();!l.done;l=o.next()){var u=l.value;e[u]=t[u].bind(t)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function RI(e,t,r){return new TI(e,t,r)}var C4="Map.put can only be used to store complex values that have an identifier type attribute";function D7(e,t){var r,n,i=e.getSubTypes();if(i===g7)return!1;if(i){var a=s2(i);try{for(var o=Ju(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!D7(u,t))return!1}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return e instanceof Pc&&t.push(e),!0}var Za;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Za||(Za={}));var MI=function(e){It(t,e);function t(r,n){return e.call(this,r,Tt.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new Be("Map.put cannot be used to set empty values");if(Pt(r)){var n=Ge(r);if(n.identifier===null)throw new Be(C4);return this.set(n.identifier,r),r}else if(T7(r)){var i=Ge(this),a=i.type;if(a.identifierMode!==Za.YES)throw new Be(C4);var o=a.mapIdentifierAttribute,l=r[o];if(!c2(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(t2(u))}var f=eu(l);return this.set(f,r),this.get(f)}else throw new Be("Map.put can only be used to store complex values")}}),t}(Jh),Oh=function(e){It(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Za.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Za.UNKNOWN){var r=[];if(D7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new Be("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);n?(this.identifierMode=Za.YES,this.mapIdentifierAttribute=n):this.identifierMode=Za.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new MI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Ey(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=xc(n,l,u);el(n,l,f)})}),Xh(n,this.willChange),Qh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return Oy(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new Be("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var l=r.newValue,u=r.object.get(i);if(l===u)return null;ma(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":ma(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Za.YES&&n instanceof gn){var i=n.identifier;if(i!==r)throw new Be("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:co(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:co(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:co(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ma(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(l){a[l]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(l){a[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return Zo(r)?Kp(Object.keys(r).map(function(a){return i._subType.validate(r[a],a2(n,a,i._subType))})):mn(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return zs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(js);Oh.prototype.applySnapshot=ar(Oh.prototype.applySnapshot);function LI(e){return new Oh("Map<string, ".concat(e.name,">"),e)}function NI(e){return pr(e)&&(e.flags&ot.Map)>0}var xh=function(e){It(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,l){var u=""+l;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=hr(hr({},Yp),{name:this.name});return Tt.array(k7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){yi(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=xc(n,l,u);el(n,l,f)})}),Xh(n,this.willChange),Qh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new Be("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,a=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var o=k4(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var l=r.index,u=r.removedCount,f=r.added,h=k4(n,i,a.slice(l,l+u),f,f.map(function(S,b){return l+b}));if(!h)return null;r.added=h;for(var O=l+u;O<a.length;O++)a[O].setParent(n,""+(O+f.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ma(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return l2(r)?Kp(r.map(function(a,o){return i._subType.validate(a,a2(n,""+o,i._subType))})):mn(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Fs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(js);xh.prototype.applySnapshot=ar(xh.prototype.applySnapshot);function II(e){return new xh("".concat(e.name,"[]"),e)}function k4(e,t,r,n,i){for(var a=!0,o=0;;o++){var l=o<=n.length-1,u=r[o],f=l?n[o]:void 0,h=""+i[o];if(lI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof gn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(T4(u,f))r[o]=ig(t,e,h,f,u);else{for(var S=void 0,b=o;b<r.length;b++)if(T4(r[b],f)){S=r.splice(b,1)[0];break}a=!1;var O=ig(t,e,h,f,S);r.splice(o,0,O)}else{if(Pt(f)&&Ge(f).parent===e)throw new Be("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(h,"', but it lives already at '").concat(Ge(f).path,"'"));a=!1;var O=ig(t,e,h,f);r.splice(o,0,O)}}return a?null:r}function ig(e,t,r,n,i){ma(e,n);function a(){if(Pt(n)){var l=Ge(n);if(l.assertAlive(zs),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof gn&&i.createObservableInstanceIfNeeded(),i.die()),o}function T4(e,t){if(!e.isAlive)return!1;if(Pt(t)){var r=Ge(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof gn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Zo(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function DI(e){return pr(e)&&(e.flags&ot.Array)>0}var A4="preProcessSnapshot",R4="postProcessSnapshot";function jI(){return Ge(this).toString()}var M4={name:"AnonymousModel",properties:{},initializers:Fs};function FI(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Be("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),t.reduce(function(n,i){if(i in fr)throw new Be("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new Be("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new Be("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Bs(o))n[i]=tl(GI(o),o);else if(o instanceof Oh)n[i]=tl(o,{});else if(o instanceof xh)n[i]=tl(o,[]);else if(!pr(o))throw new Be("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},hr({},e))}var Pc=function(e){It(t,e);function t(r){var n=e.call(this,r.name||M4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.preProcessor;return a?n.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.postProcessor;return a?n.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,M4,r),n.properties=FI(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&ot.Identifier){if(r)throw new Be("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Zo(n))throw new Be("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===A4)throw new Be("Cannot define action '".concat(A4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===R4)throw new Be("Cannot define action '".concat(R4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in fr&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,f=a.bind(n);f._isFlowAction=a._isFlowAction||!1,f.$mst_middleware=u;var h=xc(r,i,f);n[i]=h,el(r,i,h)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Be("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Zo(n))throw new Be("volatile state initializer should return a plain object containing state");xy(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),l=o.actions,u=o.views,f=o.state,h=cN(o,["actions","views","state"]);for(var O in h)throw new Be("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(O,"'"));return f&&n.instantiateVolatileState(a,f),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Zo(n))throw new Be("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)Py(r,i,o),Cy(r,(a={},a[i]=gl,a));else if(typeof o.value=="function")el(r,i,o.value);else throw new Be("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?a:this.applySnapshotPreProcessor(a);return o2(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,l){a[o]=l.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=hr(hr({},Yp),{name:this.name});return Tt.object(r,zs,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){el(n,"toString",jI),this.forAllProps(function(i){Ey(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Xh(n,this.willChange),Qh(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Ge(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(ma(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Ge(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:co(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new Be("Not a value property: "+n);var a=yi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new Be("Node not available for property "+n);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,l){try{var u=qi(r.storedValue,o);u.reportObserved()}catch{throw new Be("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new Be("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ma(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return Zo(a)?Kp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],a2(n,o,i.properties[o]))})):mn(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return zs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(js);Pc.prototype.applySnapshot=ar(Pc.prototype.applySnapshot);function zI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new Pc({name:r,properties:n})}function BI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function j7(e){return pr(e)&&(e.flags&ot.Object)>0}var Aa=function(e){It(t,e);function t(r,n,i,a){a===void 0&&(a=dI);var o=e.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(Bs(r)&&this.checker(r))return vn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return mn(n,r,"Value is not a ".concat(i))}}),t}(Al),F7=new Aa("string",ot.String,function(e){return typeof e=="string"}),z7=new Aa("number",ot.Number,function(e){return typeof e=="number"}),UI=new Aa("integer",ot.Integer,function(e){return hI(e)}),HI=new Aa("float",ot.Float,function(e){return pI(e)}),$I=new Aa("finite",ot.Finite,function(e){return gI(e)}),B7=new Aa("boolean",ot.Boolean,function(e){return typeof e=="boolean"}),U7=new Aa("null",ot.Null,function(e){return e===null}),H7=new Aa("undefined",ot.Undefined,function(e){return e===void 0}),$7=new Aa("Date",ot.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});$7.getSnapshot=function(e){return e.storedValue.getTime()};var G7=$7;function GI(e){switch(typeof e){case"string":return F7;case"number":return z7;case"boolean":return B7;case"object":if(e instanceof Date)return G7}throw new Be("Cannot determine primitive type from value "+e)}function V7(e){return pr(e)&&(e.flags&(ot.String|ot.Number|ot.Integer|ot.Boolean|ot.Date))>0}var VI=function(e){It(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Bs(r)&&r===this.value?vn():mn(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Al);function q7(e){return new VI(e)}function qI(e){return pr(e)&&(e.flags&ot.Literal)>0}var WI=function(e){It(t,e);function t(r,n,i,a){var o=e.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=Pt(r)?Ge(r).snapshot:r;return this._predicate(a)?vn():mn(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Ea);function KI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():pr(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new WI(r,n,i,a)}function YI(e){return pr(e)&&(e.flags&ot.Refinement)>0}function XI(e,t){var r=typeof e=="string"?t:e,n=Xp.apply(void 0,Ki([],Wi(r.map(function(i){return q7(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var ZI=function(e){It(t,e);function t(r,n,i){var a=e.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=hr({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=ot.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new Be("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new Be("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var l=this._types[o],u=l.validate(r,n);if(u.length===0){if(this._eager)return vn();a++}else i.push(u)}return a===1?vn():mn(n,r,"No type is applicable for the union").concat(Kp(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Ea);function Xp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=pr(e)?void 0:e,i=pr(e)?Ki([e],Wi(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new ZI(a,i,n)}function W7(e){return pr(e)&&(e.flags&ot.Union)>0}var QI=function(e){It(t,e);function t(r,n,i){var a=e.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&ma(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?vn():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Ea);function JI(e,t){if(typeof t!="function"&&Pt(t))throw new Be("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function tl(e,t,r){return JI(e,t),new QI(e,t,r||eD)}var eD=[void 0];function tD(e){return pr(e)&&(e.flags&ot.Optional)>0}var rD=tl(H7,void 0),nD=tl(U7,null);function K7(e){return Xp(e,rD)}function iD(e){return Xp(e,nD)}var aD=function(e){It(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|ot.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new Be("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):vn()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||g7}}),t}(Ea);function oD(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new aD(r,n)}function lD(e){return pr(e)&&(e.flags&ot.Late)>0}function sD(e,t){return new uD(e,t)}var uD=function(e){It(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Tt.array()}),nm(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(ar(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var l=Ao(this,r,n,i,a);return this.pendingNodeList.push(l),nm(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):A7(r)?vn():mn(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(Al),Y7=function(e){It(t,e);function t(r){var n=e.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return A7(r)?this.subType?this.subType.validate(r,n):vn():mn(n,r,"Value is not serializable and cannot be frozen")}}),t}(Al),L4=new Y7;function cD(e){return arguments.length===0?L4:pr(e)?new Y7(e):tl(L4,e)}function fD(e){return pr(e)&&(e.flags&ot.Frozen)>0}function dD(e){switch(e){case fr.beforeDestroy:return"destroy";case fr.beforeDetach:return"detach";default:return}}var hD=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c2(t))this.identifier=t;else if(Pt(t)){var n=Ge(t);if(!n.identifierAttribute)throw new Be("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Be("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Be("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=eu(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new u2("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),u2=function(e){It(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),X7=function(e){It(t,e);function t(r,n){var i=e.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return c2(r)?vn():mn(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var l=o.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){Ds(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){j7(o.type)?this.replaceRef(void 0):Ds(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=Ge(a),l=function(h,O){var S=dD(O);S&&i.fireInvalidated(S,r,n,o)},u=o.registerHook(fr.beforeDetach,l),f=o.registerHook(fr.beforeDestroy,l);return function(){u(),f()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(fr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,h=f&&f.storedValue;if(f&&f.isAlive&&h){var O=void 0;i?O=!!i.get(n,h):O=r.root.identifierCache.has(a.targetType,eu(n)),O?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===kr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(fr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(fr.afterAttach,function(){l(!1)}))}}}),t}(Al),pD=function(e){It(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?u7(a):a,l=new hD(a,this.targetType),u=Ao(this,r,n,i,l);return l.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=Pt(n),l=r.storedValue;if(!o&&l.identifier===n||o&&l.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),t}(X7),gD=function(e){It(t,e);function t(r,n,i){var a=e.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(a)?this.options.set(a,r?r.storedValue:null):a,l=Ao(this,r,n,i,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Pt(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var l=this.instantiate(i,a,void 0,o);return r.die(),l}}),t}(X7);function Z7(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new gD(e,{get:r.get,set:r.set},n):new pD(e,n)}function vD(e){return pr(e)&&(e.flags&ot.Reference)>0}function mD(e,t){var r=Z7(e,hr(hr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:K7(r)}var Q7=function(e){It(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof Pc))throw new Be("Identifier types can only be instantiated as direct child of a model type");return Ao(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new Be("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?mn(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):vn()}}),t}(Al),yD=function(e){It(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(Q7),bD=function(e){It(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(Q7),_D=new yD,wD=new bD;function SD(e){return pr(e)&&(e.flags&ot.Identifier)>0}function eu(e){return""+e}function c2(e){return typeof e=="string"||typeof e=="number"}function ED(e){return new OD(e)}var OD=function(e){It(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return vn();var i=this.options.getValidationMessage(r);return i?mn(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):vn()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return Ao(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,f=this.instantiate(i,a,void 0,u);return r.die(),f}}),t}(Al),N4={enumeration:XI,model:zI,compose:BI,custom:ED,reference:Z7,safeReference:mD,union:Xp,optional:tl,literal:q7,maybe:K7,maybeNull:iD,refinement:KI,string:F7,boolean:B7,number:z7,integer:UI,float:HI,finite:$I,Date:G7,map:LI,array:II,frozen:cD,identifier:_D,identifierNumber:wD,late:oD,lazy:sD,undefined:H7,null:U7,snapshotProcessor:RI};const xD=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:RN,addMiddleware:_7,applyAction:v7,applyPatch:Ds,applySnapshot:o7,cast:IN,castFlowReturn:wI,castToReferenceSnapshot:jN,castToSnapshot:DN,clone:kN,createActionTrackingMiddleware:HN,createActionTrackingMiddleware2:GN,decorate:XN,destroy:AN,detach:TN,escapeJsonPath:co,flow:N7,getChildType:fN,getEnv:MN,getIdentifier:u7,getLivelinessChecking:n7,getMembers:NN,getNodeId:FN,getParent:yN,getParentOfType:_N,getPath:s7,getPathParts:wN,getPropertyMembers:d7,getRelativePath:CN,getRoot:l7,getRunningActionContext:i2,getSnapshot:t2,getType:Zc,hasEnv:LN,hasParent:mN,hasParentOfType:bN,isActionContextChildOf:JN,isActionContextThisOrChildOf:eI,isAlive:r2,isArrayType:DI,isFrozenType:fD,isIdentifierType:SD,isLateType:lD,isLiteralType:qI,isMapType:NI,isModelType:j7,isOptionalType:tD,isPrimitiveType:V7,isProtected:vN,isReferenceType:vD,isRefinementType:YI,isRoot:SN,isStateTreeNode:Pt,isType:pr,isUnionType:W7,isValidReference:PN,joinJsonPath:Eh,onAction:m7,onPatch:a7,onSnapshot:dN,process:cI,protect:pN,recordActions:KN,recordPatches:hN,resolveIdentifier:ON,resolvePath:EN,setLivelinessChecking:r7,setLivelynessChecking:uN,splitJsonPath:Us,t:N4,toGenerator:EI,toGeneratorFunction:SI,tryReference:xN,tryResolve:c7,typecheck:E7,types:N4,unescapeJsonPath:I7,unprotect:gN,walk:f7},Symbol.toStringTag,{value:"Module"})),Qn=mo(xD);var f2={};(function(e){function t({oldText:r,newText:n,element:i}){if(!(n.length/Math.max(20,r.length)>=4))return i.fontSize;const a=i.width*i.page.computedHeight/n.length,o=1.5*Math.sqrt(a),l=i.fontSize;return Math.min(l,Math.max(5,Math.round(o)))}Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=void 0,e.getLimitedFontSize=t})(f2);(function(e){var t=ve&&ve.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(rt),n=Zn,i=Ta,a=Kc,o=Yi,l=t(wi),u=sN,f=Yc,h=Gi,O=Js,S=Kn,b=e2,_=Xc,y=kl,p=Tl,v=To,m=Qn,d=f2;l.default._fixTextRendering=!0;const g=document.createElement("style");g.type="text/css",document.head.appendChild(g);const w={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function k(M){var D="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+D+"]*?["+D+"]").test(M)}function P(M){M=M.replace(/\s/g,"");let D=0;for(var B=0;B<M.length;B++)k(M[B])&&(D+=1);return D>M.length/2}function A(M){return P(M)?"rtl":"ltr"}e.isRTLText=P,e.getDir=A;const E=(0,n.observer)(({textNodeRef:M,element:D,onBlur:B,selectAll:q,cursorPosition:K})=>{const[z,$]=r.default.useState(w),F=M.current;r.default.useLayoutEffect(()=>{const re={};re.width=F.width()-2*F.padding()+"px",re.height=F.height()-2*F.padding()+F.fontSize()*F.lineHeight()+"px",re.fontSize=F.fontSize()+"px",re.lineHeight=F.lineHeight()+.01,re.fontFamily=F.fontFamily(),re.textAlign=F.align(),re.color=F.fill(),re.fontWeight=D.fontWeight,re.fontStyle=D.fontStyle,re.letterSpacing=D.letterSpacing+"em";const ie=`
|
|
96
|
+
.polotno-input::placeholder {
|
|
97
|
+
color: ${z.color};
|
|
98
|
+
opacity: 0.6;
|
|
99
|
+
}
|
|
100
|
+
`;g.innerHTML="",g.appendChild(document.createTextNode(ie)),JSON.stringify(re)!==JSON.stringify(z)&&$(re)});const Y=r.default.useRef(null);r.default.useLayoutEffect(()=>{var re;const ie=Y.current;if(!ie)return;(re=Y.current)===null||re===void 0||re.focus();const ne=K||ie.value.length;ie.selectionStart=ie.selectionEnd=ne,q&&(ie==null||ie.select(),document.execCommand("selectAll",!1,null))},[]),r.default.useEffect(()=>{window.addEventListener("blur",B);const re=ie=>{var ne;!((ne=Y.current)===null||ne===void 0)&&ne.contains(ie.target)||B()};return window.addEventListener("touchstart",re),()=>{window.removeEventListener("blur",B),window.removeEventListener("touchstart",re)}},[]);let X=0;const Q=F.textArr.length*F.lineHeight()*F.fontSize();D.verticalAlign==="middle"&&(X=(D.a.height-Q)/2),D.verticalAlign==="bottom"&&(X=D.a.height-Q);const J=(0,b.removeTags)(D.text);return r.default.createElement("textarea",{className:"polotno-input",ref:Y,dir:A(J),style:Object.assign(Object.assign(Object.assign({},w),z),{paddingTop:X+"px"}),value:J,onChange:re=>{const ie=(0,d.getLimitedFontSize)({oldText:D.text,newText:re.target.value,element:D});D.set({text:re.target.value,fontSize:ie})},placeholder:D.placeholder,onBlur:B})}),x=M=>r.default.createElement(a.Html,null,r.default.createElement(E,Object.assign({},M))),C=M=>{const[D,B]=r.default.useState(!1),q=r.default.useRef(!1);return r.default.useEffect(()=>{var K=!0;return setTimeout(()=>{K&&(M._editModeEnabled&&(q.current=!0),B(!0),setTimeout(()=>{q.current=!1},50))},50),()=>{K=!1}},[]),{editorEnabled:D&&M._editModeEnabled,selectAll:q.current}},R=(M,D)=>{const[B,q]=r.default.useReducer(z=>z+1,0),K=r.default.useRef((0,O.isFontLoaded)(D));return r.default.useLayoutEffect(()=>{if(K.current=(0,O.isFontLoaded)(D),K.current)return;let z=!0;return(async()=>{K.current=!1,q();const $=(0,h.incrementLoader)(`text ${D}`);await M.loadFont(D),setTimeout($,100),z&&(K.current=!0,q())})(),()=>{z=!1}},[D]),[K.current]};e.useFontLoader=R;const N=({fontLoaded:M,fontFamily:D,fontSize:B,lineHeight:q})=>r.default.useMemo(()=>{if(typeof q=="number")return q;const K=document.createElement("div");K.style.fontFamily=D,K.style.fontSize=B+"px",K.style.lineHeight=q,K.innerText="Test text",document.body.appendChild(K);const z=K.offsetHeight;return document.body.removeChild(K),z/B},[M,D,B,q]);function U(M){var D=M.getAbsoluteTransform().copy();D.invert();var B=M.getStage().getPointerPosition();return D.point(B)}function G(M){var D;const B=M.target,q=U(B),K=B.textArr,z=Math.floor(q.y/(B.fontSize()*B.lineHeight())),$=K.slice(0,z).reduce((X,Q)=>X+Q.text.length,z),F=(D=K[z])!==null&&D!==void 0?D:K[0];let Y=0;return B.align()==="right"?Y=B.width()-F.width:B.align()==="center"&&(Y=B.width()/2-F.width/2),$+Math.round((q.x-Y)/F.width*F.text.length)}function Z(M){const D=r.default.useRef(M),B=r.default.useRef(M);return r.default.useMemo(()=>{B.current=D.current,D.current=M},[M]),B.current}function W(M){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(M)}function H(M,D){const B=M.fontSize(),q=M.height(),K=(0,b.removeTags)(D.text);let z=D.a.fontSize;M.height(void 0);const $=Math.round(2*D.a.fontSize)-1;for(let F=1;F<$;F++){const Y=D.a.height&&M.height()>D.a.height;let X=K.split(`
|
|
101
|
+
`).join(" ").split(/[\s-]+/).reduce((re,ie)=>W(ie)?re.concat(ie.split("")):re.concat(ie),[]),Q=M.textArr.map(re=>re.text).join(";");const J=X.find(re=>!Q.includes(re)||(Q=Q.replace(re,""),!1));if(!(Y||J))break;z-=.5,M.fontSize(z)}return M.fontSize(B),M.height(q),z}function L({lines:M,lineHeight:D,width:B,align:q="left",padding:K=0,cornerRadius:z=0}){var $;M.forEach((Q,J)=>{Q.cx=B/2,q==="right"?Q.cx=B-Q.width/2:q==="left"&&(Q.cx=Q.width/2),q!=="justify"||Q.lastInParagraph||(Q.width=B),q==="justify"&&(Q.cx=Q.width/2)});let F=`M ${($=M[0])===null||$===void 0?void 0:$.cx} ${-K}`;M.forEach((Q,J)=>{const{cx:re}=Q,ie=M[J-1];ie&&ie.width>Q.width?F+=` L ${re+Q.width/2+K} ${J*D+K}`:F+=` L ${re+Q.width/2+K} ${J*D-K}`;const ne=M[J+1];ne&&ne.width>Q.width?F+=` L ${re+Q.width/2+K} ${(J+1)*D-K}`:F+=` L ${re+Q.width/2+K} ${(J+1)*D+K}`});for(var Y=M.length-1;Y>=0;Y--){const Q=M[Y],{cx:J}=Q,re=M[Y+1];re&&re.width>Q.width?F+=` L ${J-Q.width/2-K} ${(Y+1)*D-K}`:F+=` L ${J-Q.width/2-K} ${(Y+1)*D+K}`;const ie=M[Y-1];ie&&ie.width>Q.width?F+=` L ${J-Q.width/2-K} ${Y*D+K}`:F+=` L ${J-Q.width/2-K} ${Y*D-K}`}F+=" Z";const X=(0,u.parsePath)(F);return(0,u.roundCommands)(X,z).path}e.getLineHeight=N,e.usePrevious=Z,e.TextElement=(0,n.observer)(({element:M,store:D})=>{const B=r.default.useRef(null),q=r.default.useRef(null),{editorEnabled:K,selectAll:z}=C(M),[$,F]=r.default.useState(!1),[Y,X]=r.default.useState(!1),Q=r.default.useRef(M.a.height),J=D.selectedShapes.indexOf(M)>=0,{textVerticalResizeEnabled:re}=S.flags,ie=Z(M.fontFamily),[ne,ae]=r.default.useState([]);r.default.useEffect(()=>{var Pe,Oe;const Ne=(Oe=(Pe=B.current)===null||Pe===void 0?void 0:Pe.textArr)!==null&&Oe!==void 0?Oe:[];JSON.stringify(Ne)!==JSON.stringify(ne)&&ae(Ne)}),r.default.useEffect(()=>{if(M.a.width)return;const Pe=B.current;Pe.width(600),M.set({width:1.4*Pe.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Pe=B.current;(0,_.applyFilter)(Pe,M)}));const[ke]=(0,e.useFontLoader)(D,M.fontFamily),Ae=(0,b.removeTags)(M.text),oe=()=>{const Pe=B.current.clone({height:void 0}),Oe=Math.ceil(Pe.fontSize()*Pe.lineHeight()*Pe.textArr.length+1);return Pe.destroy(),Oe};r.default.useLayoutEffect(()=>{if(!ke)return;const{textOverflow:Pe}=S.flags;if(M.a.height)if(Pe!=="change-font-size"||Y||D.isPlaying){if(Pe==="resize"){const Oe=oe();re&&M.a.height<Oe&&D.history.ignore(()=>{var Ne;(0,m.isAlive)(M)&&M.set({height:Oe}),(Ne=B.current)===null||Ne===void 0||Ne.height(Oe)},!1,!0),re||M.a.height===Oe||D.history.ignore(()=>{var Ne;(0,m.isAlive)(M)&&M.set({height:Oe}),(Ne=B.current)===null||Ne===void 0||Ne.height(Oe)},!1,!0)}}else{const Oe=H(B.current,M);if(Oe!==M.a.fontSize)return void D.history.ignore(()=>{M.set({fontSize:Oe})},!1,!0);const Ne=oe();M.a.height===Ne||re||D.history.ignore(()=>{M.set({height:Ne})},!1,!0)}else{const Oe=oe();D.history.ignore(()=>{M.set({height:Oe})},!1,!0)}}),r.default.useLayoutEffect(()=>{const Pe=B.current;Pe&&(Pe.width(Pe.width()+1e-8),Pe._setTextData(),(0,_.applyFilter)(Pe,M))},[ke]);const ce=r.default.useRef(null),_e=r.default.useRef(0),ye=Pe=>{Pe.evt.preventDefault(),D.selectedShapes.find(Ne=>Ne===M)&&M.contentEditable&&(_e.current=G(Pe),M.toggleEditMode())},te=!Ae&&M.placeholder?.6:M.a.opacity;(0,y.useFadeIn)(B,te);const le=(0,e.getLineHeight)({fontLoaded:ke,fontFamily:M.fontFamily,fontSize:M.a.fontSize,lineHeight:M.lineHeight}),me=M.selectable||D.role==="admin",Ee=(0,f.useColor)(M),We=r.default.useMemo(()=>M.backgroundEnabled?L({lines:JSON.parse(JSON.stringify(ne)),cornerRadius:M.backgroundCornerRadius*(M.a.fontSize*le*.5),lineHeight:le*M.a.fontSize,padding:M.backgroundPadding*(M.a.fontSize*le*.5),width:M.a.width,align:M.align}):"",[M.backgroundEnabled,M.backgroundCornerRadius,M.a.fontSize,le,M.backgroundPadding,M.a.width,M.align,ne]),Qe=(0,v.isTouchDevice)();let Re=0;return M.verticalAlign==="middle"?Re=(M.a.height-ne.length*le*M.a.fontSize)/2:M.verticalAlign==="bottom"&&(Re=M.a.height-ne.length*le*M.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:q,x:M.a.x,y:M.a.y,rotation:M.a.rotation,hideInExport:!M.showInExport,listening:!1,visible:M.backgroundEnabled,opacity:M.backgroundOpacity*te,data:We,fill:M.backgroundColor,offsetY:-Re}),r.default.createElement(i.Text,Object.assign({ref:B,id:M.id,name:"element",hideInExport:!M.showInExport,editModeEnabled:M._editModeEnabled,x:M.a.x,y:M.a.y,rotation:M.a.rotation,width:M.a.width,height:M.a.height,text:Ae||M.placeholder},Ee,{stroke:M.stroke,lineJoin:"round",strokeWidth:M.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:M.a.fontSize,fontFamily:`"${M.fontFamily}", "${ie}"`,fontStyle:M.fontStyle+" "+M.fontWeight,textDecoration:M.textDecoration,align:M.align,verticalAlign:M.verticalAlign,draggable:Qe?M.draggable&&J:M.draggable,preventDefault:!Qe||J,opacity:te,visible:!M._editModeEnabled,ellipsis:S.flags.textOverflow==="ellipsis",shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,lineHeight:le,letterSpacing:M.letterSpacing*M.a.fontSize,listening:me,onDragMove:Pe=>{M.set({x:Pe.target.x(),y:Pe.target.y()})},onDragEnd:Pe=>{M.set({x:Pe.target.x(),y:Pe.target.y()})},onMouseEnter:()=>{F(!0)},onMouseLeave:()=>{F(!1)},onClick:ye,onTap:ye,onTransformStart:()=>{X(!0),Q.current=B.current.height()},onTransform:Pe=>{var Oe,Ne;const Je=Pe.target;(Oe=q.current)===null||Oe===void 0||Oe.setAttrs({x:Je.x(),y:Je.y(),rotation:Je.rotation(),scale:Je.scale()});const fe=((Ne=Je.getStage())===null||Ne===void 0?void 0:Ne.findOne("Transformer")).getActiveAnchor();if(fe==="middle-left"||fe==="middle-right"){const de=Je.scaleX(),Xe=Je.width()*de,be=M.a.fontSize;let Ie=Xe;Xe<be&&(Ie=be,ce.current&&Je.position(ce.current)),Je.width(Ie),Je.scaleX(1),Je.scaleY(1);const Me=oe();if(S.flags.textOverflow!=="ellipsis"){const we=Math.max(Me,Q.current);Je.height(we),M.set({height:Je.height()})}M.set({x:Je.x(),y:Je.y(),width:Je.width(),rotation:Je.rotation()}),(0,_.applyFilter)(Je,M)}if(fe==="top-center"||fe==="bottom-center"){let de=S.flags.textOverflow==="resize"?oe():le*M.a.fontSize;Pe.target.height(Math.max(de,Pe.target.height()*Pe.target.scaleY())),Pe.target.scaleY(1)}ce.current=Pe.target.position()},onTransformEnd:Pe=>{var Oe;const Ne=Pe.target.scaleX();Pe.target.scaleX(1),Pe.target.scaleY(1),M.set({fontSize:Math.round(M.a.fontSize*Ne),width:Math.ceil(Pe.target.width()*Ne),x:Pe.target.x(),y:Pe.target.y(),rotation:Pe.target.rotation(),height:Pe.target.height()*Ne,shadowBlur:M.shadowBlur*Ne,shadowOffsetX:M.shadowOffsetX*Ne,shadowOffsetY:M.shadowOffsetY*Ne,strokeWidth:M.strokeWidth*Ne}),(Oe=q.current)===null||Oe===void 0||Oe.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),K&&r.default.createElement(i.Group,{x:M.a.x,y:M.a.y,rotation:M.a.rotation},r.default.createElement(x,{textNodeRef:B,element:M,selectAll:z,cursorPosition:_e.current,onBlur:()=>{M.toggleEditMode(!1)}})),!Y&&($||J)&&r.default.createElement(p.Highlighter,{element:M}))})})(Zy);var d2={},tu={},J7={exports:{}},eS={exports:{}};(function(e,t){e.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
|
|
102
|
+
`)}})(eS);var h2=eS.exports;(function(e,t){h2("lex"),e.exports=r;function r(n){var i="",a,o=0,l=-1,u=0,f=1,h="before-selector",O=[h],S={},b=[],_=["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 y(){return A(),n[l]}function p(W){return W?O[O.length-1-W]:h}function v(W){var H=l+1;return W===n.slice(H,H+W.length)}function m(W){var H=n.slice(l).indexOf(W);return H>0?H:!1}function d(W){return W===g(1)}function g(W){return n[l+(W||1)]}function w(){var W=O.pop();return h=O[O.length-1],W}function k(W){return h=W,O.push(h),O.length}function P(W){var H=h;return O[O.length-1]=h=W,H}function A(W){if((W||1)==1)n[l]==`
|
|
103
|
+
`?(f++,o=1):o++,l++;else{var H=n.slice(l,l+W).split(`
|
|
104
|
+
`);H.length>1&&(f+=H.length-1,o=1),o+=H[H.length-1].length,l=l+W}}function E(){S.end={line:f,col:o},b.push(S),i="",S={}}function x(W){S={type:W,start:{line:f,col:o}}}for(;a=y();)switch(a){case" ":switch(p()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
|
|
105
|
+
`:case" ":case"\r":case"\f":switch(p()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
|
|
106
|
+
`&&(S.value=i.trim(),E(),w());break}break;case":":switch(p()){case"name":S.name=i.trim(),i="",P("before-value");break;case"before-selector":i+=a,x("selector"),k("selector");break;case"before-value":P("value"),i+=a;break;default:i+=a;break}break;case";":switch(p()){case"name":case"before-value":case"value":i.trim().length>0&&(S.value=i.trim(),E()),P("before-name");break;case"value-paren":i+=a;break;case"at-value":S.value=i.trim(),E(),w();break;case"before-name":break;default:i+=a;break}break;case"{":switch(p()){case"selector":if(g(-1)==="\\"){i+=a;break}S.text=i.trim(),E(),P("before-name"),u=u+1;break;case"at-group":switch(S.name=i.trim(),S.type){case"font-face":case"viewport":case"page":k("before-name");break;default:k("before-selector")}E(),u=u+1;break;case"name":case"at-rule":S.name=i.trim(),E(),k("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":P("value"),i+=a;break}break;case"}":switch(p()){case"before-name":case"name":case"before-value":case"value":i&&(S.value=i.trim()),S.name&&S.value&&E(),x("end"),E(),w(),p()==="at-group"&&(x("at-group-end"),E(),w()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(g(-1)==="\\"){i+=a;break}u>0&&p(1)==="at-group"&&(x("at-group-end"),E()),u>1&&w(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(p()){case"double-string":a==='"'&&g(-1)!=="\\"&&w();break;case"single-string":a==="'"&&g(-1)!=="\\"&&w();break;case"before-at-value":P("at-value"),k(a==='"'?"double-string":"single-string");break;case"before-value":P("value"),k(a==='"'?"double-string":"single-string");break;case"comment":break;default:g(-1)!=="\\"&&k(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(p()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(d("*")){var C=m("*/");C&&A(C+1)}else p()=="before-value"&&P("value"),i+=a;break;default:d("*")?(x("comment"),k("comment"),A()):i+=a;break}break;case"*":switch(p()){case"comment":d("/")?(S.text=i,A(),E(),w()):i+=a;break;case"before-selector":i+=a,x("selector"),k("selector");break;case"before-value":P("value"),i+=a;break;default:i+=a}break;case"@":switch(p()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":P("value"),i+=a;break;default:for(var R=!1,N,U,G=0,Z=_.length;!R&&G<Z;++G)U=_[G],N=U.name||U,v(N)&&(R=!0,x(N),k(U.state||"at-group"),A(N.length),U.prefix&&(S.prefix=U.prefix),U.type&&(S.type=U.type));R||(i+=a);break}break;case"(":switch(p()){case"value":k("value-paren");break;case"before-value":P("value");break}i+=a;break;case")":switch(p()){case"value-paren":w();break;case"before-value":P("value");break}i+=a;break;default:switch(p()){case"before-selector":x("selector"),k("selector");break;case"before-name":x("property"),P("name");break;case"before-value":P("value");break;case"before-at-value":P("at-value");break}i+=a;break}return b}})(J7);var tS=J7.exports,rS={exports:{}};(function(e,t){h2("parse");var r=tS;e.exports=l;var n,i,a,o;function l(w,k){k||(k={}),n=!!k.comments,a=!!k.position,i=0,o=Array.isArray(w)?w.slice():r(w);for(var P,A=[],E;E=f();)P=v(E),P&&A.push(P);return{type:"stylesheet",stylesheet:{rules:A}}}function u(w,k){k||(k={});for(var P,A=["type","name","value"],E={},x=0;x<A.length;++x)P=A[x],w[P]&&(E[P]=k[P]||w[P]);for(A=Object.keys(k),x=0;x<A.length;++x)P=A[x],E[P]||(E[P]=k[P]);return a&&(E.position={start:w.start,end:w.end}),E}function f(){var w=o.shift();return w}function h(w){i=i+1;var k={};switch(w.type){case"font-face":case"viewport":k.declarations=d();break;case"page":k.prefix=w.prefix,k.declarations=d();break;default:k.prefix=w.prefix,k.rules=g()}return u(w,k)}function O(w){return u(w)}function S(w){return u(w)}function b(w){return u(w,{text:w.text})}function _(w){return u(w)}function y(w){return u(w)}function p(w){function k(P){return P.trim()}return u(w,{type:"rule",selectors:w.text.split(",").map(k),declarations:d()})}function v(w){switch(w.type){case"property":return y(w);case"selector":return p(w);case"at-group-end":i=i-1;return;case"media":case"keyframes":return h(w);case"comment":if(n)return b(w);break;case"charset":return S(w);case"import":return O(w);case"namespace":return _(w);case"font-face":case"supports":case"viewport":case"document":case"page":return h(w)}}function m(w){for(var k,P=[],A;(A=f())&&w&&w(A);)k=v(A),k&&P.push(k);return A&&A.type!=="end"&&o.unshift(A),P}function d(){return m(function(w){return w.type==="property"||w.type==="comment"})}function g(){return m(function(){return i})}})(rS);var PD=rS.exports,nS={exports:{}};(function(e,t){h2("stringify");var r,n,i,a,o,l;e.exports=u;function u(g,w){w||(w={}),i=w.indentation||"",n=!!w.compress,r=!!w.comments,a=1,n?o=l="":(o=`
|
|
107
|
+
`,l=" ");var k=_(g.stylesheet.rules,m).join(`
|
|
108
|
+
`).trim();return k}function f(g){if(g){a+=g;return}return n?"":Array(a).join(i||"")}function h(g){return"@"+g.type+" "+g.value+";"+o}function O(g){var w="",k=g.prefix||"";g.name&&(w=" "+g.name);var P=g.type!=="page";return"@"+k+g.type+w+l+y(g,P)+o}function S(g){return r?"/*"+(g.text||"")+"*/"+o:""}function b(g){var w;return g.selectors?w=g.selectors.join(","+o):(w="@"+g.type,w+=g.name?" "+g.name:""),f()+w+l+y(g)+o}function _(g,w){return g.reduce(function(k,P){var A=P.type==="comment"?S(P):w(P);return A&&k.push(A),k},[])}function y(g,w){var k=g.declarations,P=v;return g.rules&&(k=g.rules,P=b),k=p(k,P),k&&(k=o+k+(w?"":o)),"{"+k+f()+"}"}function p(g,w){if(!g)return"";f(1);var k=_(g,w);return f(-1),k.length?k.join(o):""}function v(g){if(g.type==="property")return d(g)}function m(g){switch(g.type){case"rule":return b(g);case"media":case"keyframes":return O(g);case"comment":return S(g);case"import":case"charset":case"namespace":return h(g);case"font-face":case"supports":case"viewport":case"document":case"page":return O(g)}}function d(g){var w=g.name?g.name+":"+l:"";return f()+w+g.value+";"}})(nS);var CD=nS.exports,kD={lex:tS,parse:PD,stringify:CD};(function(e){var t=ve&&ve.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.replaceColors=e.sameColors=e.fixSize=e.getSvgSize=e.svgToURL=e.getColors=e.urlToString=e.urlToBase64=void 0;const r=t(wi),n=t(rt),i=Qy,a=t(kD);function o(w){for(;w.parentNode;){if(w.nodeName==="defs")return!0;w=w.parentNode}return!1}function l(w){const k={};return w.querySelectorAll("style").forEach(P=>{const A=a.default.parse(P.textContent).stylesheet.rules;for(let E of A)E.selectors&&E.selectors.forEach(x=>{const C=k[x]||{};E.declarations.forEach(R=>{C[R.name]=R.value}),k[x]=C})}),k}function u(w,k){var P;const A={fill:"",stroke:""},E=((P=w.getAttribute("class"))===null||P===void 0?void 0:P.split(" "))||[],x=w.getAttribute("id");let C={};if(x&&k[`#${x}`]?C=k[`#${x}`]:E.forEach(R=>{k[`.${R}`]&&(C=Object.assign(Object.assign({},C),k[`.${R}`]))}),k[w.nodeName]&&(C=Object.assign(Object.assign({},C),k[w.nodeName])),w.getAttribute("fill")&&w.getAttribute("fill")!=="none"?A.fill=w.getAttribute("fill"):C.fill&&C.fill!=="none"&&(A.fill=C.fill),w.getAttribute("stroke")&&w.getAttribute("stroke")!=="none"?A.stroke=w.getAttribute("stroke"):C.stroke&&C.stroke!=="none"&&(A.stroke=C.stroke),!A.fill&&w.style.fill&&w.style.fill!=="none"&&(A.fill=w.style.fill),!A.stroke&&w.style.stroke&&w.style.stroke!=="none"&&(A.stroke=w.style.stroke),!A.stroke&&!A.fill){const R=w.ownerSVGElement,N=R&&R!==w&&u(R,k);(N==null?void 0:N.fill)==="currentColor"||(N==null?void 0:N.stroke)==="currentColor"||(A.fill="black")}return A}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(w){for(var k=[],P=w.getElementsByTagName("*"),A=0,E=P.length;A<E;A++){const x=P[A];o(x)||(x.getAttribute("fill")!==null&&k.push(x),(x.getAttribute("stroke")!==null||x.style&&x.style.fill||f.indexOf(x.nodeName)>=0)&&k.push(x))}return k}async function O(w){const k=await fetch(w);return _(await k.text())}async function S(w){return await(await fetch(w,{mode:"cors"})).text()}function b(w){var k=new DOMParser().parseFromString(w,"image/svg+xml");const P=l(k),A=h(k),E=[];return A.forEach(x=>{const{fill:C,stroke:R}=u(x,P);[C,R].forEach(N=>{N&&(N==="currentColor"&&(N="black"),r.default.Util.colorToRGBA(N)&&E.indexOf(N)===-1&&E.push(N))})}),E}function _(w){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(w)))}async function y(w){const k=await S(w),P=new DOMParser().parseFromString(k,"image/svg+xml").documentElement.getAttribute("viewBox"),[A,E,x,C]=(P==null?void 0:P.split(" "))||[];return{width:parseFloat(x),height:parseFloat(C)}}function p(w){var k=new DOMParser().parseFromString(w,"image/svg+xml");const P=k.documentElement.getAttribute("viewBox"),[A,E,x,C]=(P==null?void 0:P.split(" "))||[],R=k.documentElement.getAttribute("width");!R&&k.documentElement.setAttribute("width",x+"px");const N=k.documentElement.getAttribute("height");if((!N||N.indexOf("%")>=0)&&k.documentElement.setAttribute("height",C+"px"),R&&R.indexOf("%")>=0&&N&&N.indexOf("%")===-1){const U=parseFloat(N)/parseFloat(C);k.documentElement.setAttribute("width",U*parseFloat(x)+"px")}if(N&&N.indexOf("%")>=0&&R&&R.indexOf("%")===-1){const U=parseFloat(R)/parseFloat(x);k.documentElement.setAttribute("height",U*parseFloat(C)+"px")}return R==="100%"&&N==="100%"&&(k.documentElement.setAttribute("width",x+"px"),k.documentElement.setAttribute("height",C+"px")),new XMLSerializer().serializeToString(k)}e.urlToBase64=O,e.urlToString=S,e.getColors=b,e.svgToURL=_,e.getSvgSize=y,e.fixSize=p;const v=(w,k)=>{if(!w||!k)return!1;if(k==="currentColor"&&w==="black")return!0;const P=r.default.Util.colorToRGBA(w),A=r.default.Util.colorToRGBA(k);return P&&A?P.r===A.r&&P.g===A.g&&P.b===A.b&&P.a===A.a:void 0};function m(w,k,P,A){var E=w.namespaceURI,x=document.createElementNS(E,"linearGradient");const C=r.default.Util.degToRad(P+90),R=(Math.cos(C)+1)/2,N=(Math.sin(C)+1)/2,U=(Math.cos(C+Math.PI)+1)/2,G=(Math.sin(C+Math.PI)+1)/2;x.setAttribute("x1",100*R+"%"),x.setAttribute("y1",100*N+"%"),x.setAttribute("x2",100*U+"%"),x.setAttribute("y2",100*G+"%"),x.setAttribute("gradientUnits","userSpaceOnUse"),x.setAttribute("id",k);for(var Z=0;Z<A.length;Z++){var W=A[Z],H=document.createElementNS(E,"stop");for(var L in W)W.hasOwnProperty(L)&&H.setAttribute(L,W[L]);x.appendChild(H)}return(w.querySelector("defs")||w.insertBefore(document.createElementNS(E,"defs"),w.firstChild)).appendChild(x)}function d(w,k){var P=new DOMParser().parseFromString(w,"image/svg+xml");const A=h(P),E=Array.from(k.keys()),x=l(P);return A.forEach(C=>{const{fill:R,stroke:N}=u(C,x);[{prop:"fill",color:R},{prop:"stroke",color:N}].forEach(({prop:U,color:G})=>{const Z=E.find(W=>(0,e.sameColors)(W,G));if(Z){const W=k.get(Z);if((0,i.isGradient)(W)){const{rotation:H,stops:L}=(0,i.parseColor)(W),M=L.map(B=>({offset:100*B.offset+"%","stop-color":B.color})),D="color"+Math.round(1e8*Math.random());m(P.children[0],D,H,M),C.style[U]=null,C.setAttribute(U,`url('#${D}')`)}else C.style[U]=k.get(Z)}})}),_(new XMLSerializer().serializeToString(P))}e.sameColors=v,e.replaceColors=d;const g=w=>{const[k,P]=n.default.useState([]);return n.default.useEffect(()=>{let A=!1;return(async()=>{P([]);const E=b(await S(w));A||P(E)})(),()=>{A=!0}},[w]),k};e.useSvgColors=g})(tu);var p2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0;const t=(r,n,i)=>{let a=n,o=i,l=1;for(;a>0&&o>0;){r.width=a,r.height=o;const u=r.getContext("2d");if(!u)return;if(u.fillStyle="rgba(0,0,0,0.1)",u.fillRect(0,0,1,1),u.getImageData(0,0,1,1).data[3]!==0)return void u.clearRect(0,0,r.width,r.height);if(l*=.9,a=Math.floor(n*l),o=Math.floor(i*l),a=Math.max(a,1),o=Math.max(o,1),a<=1&&o<=1)return r.width=1,void(r.height=1)}};e.trySetCanvasSize=t})(p2);(function(e){var t=ve&&ve.__createBinding||(Object.create?function(z,$,F,Y){Y===void 0&&(Y=F);var X=Object.getOwnPropertyDescriptor($,F);X&&!("get"in X?!$.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return $[F]}}),Object.defineProperty(z,Y,X)}:function(z,$,F,Y){Y===void 0&&(Y=F),z[Y]=$[F]}),r=ve&&ve.__setModuleDefault||(Object.create?function(z,$){Object.defineProperty(z,"default",{enumerable:!0,value:$})}:function(z,$){z.default=$}),n=ve&&ve.__importStar||function(z){if(z&&z.__esModule)return z;var $={};if(z!=null)for(var F in z)F!=="default"&&Object.prototype.hasOwnProperty.call(z,F)&&t($,z,F);return r($,z),$},i=ve&&ve.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(rt),o=Zn,l=Yi,u=Ta,f=i(Wp),h=i(wi),O=Kc,S=Tl,b=Gi,_=n(tu),y=Kn,p=p2,v=Xc,m=kl,d=To;function g(){return document.createElement("canvas")}async function w(z){if(!(z.indexOf("data:image/svg+xml")>=0||z.indexOf(".svg")>=0))return z;const $=await _.urlToString(z),F=_.fixSize($);return _.svgToURL(F)}const k=z=>{const[$,F]=a.default.useState(z);return a.default.useEffect(()=>{(async()=>{const Y=await w(z);Y!==$&&F(Y)})()},[z]),$};function P(z,$){return Math.sqrt(Math.pow($.x-z.x,2)+Math.pow($.y-z.y,2))}function A(z,$){return{x:(z.x+$.x)/2,y:(z.y+$.y)/2}}const E=(z,$,F)=>{const Y=a.default.useMemo(()=>{var X,Q;const{flipX:J,flipY:re}=z,ie=z.type==="svg"||z.src.indexOf("data:image/svg+xml")>=0||z.src.indexOf(".svg")>=0,ne=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,ae=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||ne)&&ie||z.maskSrc;if(!J&&!re&&!ae)return $;if(!$||!$.width||!$.height)return null;const ke=g();let Ae=1;z.type==="svg"&&(Ae=Math.max(z.a.width/$.width*F,z.a.height/$.height*F)),(0,p.trySetCanvasSize)(ke,Math.max($.width*Ae,1),Math.max($.height*Ae,1));let oe=J?-ke.width:0,ce=re?-ke.height:0;return(X=ke.getContext("2d"))===null||X===void 0||X.scale(J?-1:1,re?-1:1),(Q=ke.getContext("2d"))===null||Q===void 0||Q.drawImage($,oe,ce,ke.width,ke.height),ke},[z.maskSrc,z.flipX,z.flipY,$,z.a.width,z.a.height,F]);return a.default.useEffect(()=>()=>{Y&&Y.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(Y)},[Y]),Y};function x(z,$){const F=$.width/$.height;let Y,X;return F>=z.width/z.height?(Y=z.width,X=z.width/F):(Y=z.height*F,X=z.height),{x:(z.width-Y)/2,y:(z.height-X)/2,width:Y,height:X}}function C(z,$,F,Y,X,Q,J){for(var re=new ImageData($,F),ie=new Int32Array(z.data.buffer),ne=z.width,ae=new Int32Array(re.data.buffer),ke=re.width,Ae=$/Q,oe=F/J,ce=Math.round(1/Ae),_e=Math.round(1/oe),ye=ce*_e,te=0;te<re.height;te++)for(var le=0;le<ke;le++){for(var me=Y+Math.round(le/Ae)+(X+Math.round(te/oe))*ne,Ee=0,We=0,Qe=0,Re=0,Pe=0;Pe<_e;Pe++)for(var Oe=0;Oe<ce;Oe++){var Ne=ie[me+Oe+Pe*ne];Ee+=Ne<<24>>>24,We+=Ne<<16>>>24,Qe+=Ne<<8>>>24,Re+=Ne>>>24}Ee=Math.round(Ee/ye),We=Math.round(We/ye),Qe=Math.round(Qe/ye),Re=Math.round(Re/ye),ae[le+te*ke]=Re<<24|Qe<<16|We<<8|Ee}return re}function R(z,$){var F,Y;const X=g();X.width=z.width,X.height=z.height;const Q=Math.max(1,Math.floor(X.width*$)),J=Math.max(1,Math.floor(X.height*$));(F=X.getContext("2d"))===null||F===void 0||F.drawImage(z,0,0,X.width,X.height);const re=C(X.getContext("2d").getImageData(0,0,X.width,X.height),Q,J,0,0,X.width,X.height);return X.width=Q,X.height=J,(Y=X.getContext("2d"))===null||Y===void 0||Y.putImageData(re,0,0),X}const N=(z,$)=>{const[F,Y]=M(z.maskSrc,"anonymous"),X=z.maskSrc?Y:"loaded";return(0,e.useImageLoader)(X,z.id+"-mask"),a.default.useMemo(()=>{if(!F||!$||!$.width||!$.height)return $;const Q=g();Q.width=Math.max($.width,1),Q.height=Math.max($.height,1);const J=Q.getContext("2d");if(!J)return $;J.drawImage($,0,0),J.globalCompositeOperation="source-in";const re=x(F,z);return J.drawImage(F,re.x,re.y,re.width,re.height,0,0,$.width,$.height),Q},[$,F,z.a.width,z.a.height])},U=(z,$,F)=>Math.max($,Math.min(F,z)),G=(z,$,F,Y,X=0,Q=!1,J=!0)=>{const re=Math.floor(U(z.a.width*Y,1,1e4)),ie=Math.floor(U(z.a.height*Y,1,1e4)),ne=Math.min(X*Y,re/2,ie/2),ae=Math.max(z.a.width/F.width,z.a.height/F.height)*Y,ke=z.page._exportingOrRendering&&y.flags.imageDownScalingEnabled&&ae<1&&!Q,Ae=F.x===0&&F.y===0&&F.width===($==null?void 0:$.width)&&F.height===($==null?void 0:$.height),oe=a.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return Ae&&ne===0&&!ke?void 0:g()},[$,ne,ke,Ae]);return a.default.useLayoutEffect(()=>{if(!oe||!$)return;(0,p.trySetCanvasSize)(oe,re,ie);const ce=oe.getContext("2d");if(!ce)return;ne&&(ce.beginPath(),ce.moveTo(ne,0),ce.lineTo(re-ne,0),ce.arc(re-ne,ne,ne,3*Math.PI/2,0,!1),ce.lineTo(re,ie-ne),ce.arc(re-ne,ie-ne,ne,0,Math.PI/2,!1),ce.lineTo(ne,ie),ce.arc(ne,ie-ne,ne,Math.PI/2,Math.PI,!1),ce.lineTo(0,ne),ce.arc(ne,ne,ne,Math.PI,3*Math.PI/2,!1),ce.clip());const _e=ke?R($,ae):$,ye=ke?{x:Math.floor(F.x*ae),y:Math.floor(F.y*ae),width:Math.floor(F.width*ae),height:Math.floor(F.height*ae)}:F;ce.drawImage(_e,ye.x,ye.y,ye.width,ye.height,0,0,oe.width,oe.height)},[oe,z.a.width,z.a.height,F.x,F.y,F.width,F.height,X,Y,Q,z.page._exportingOrRendering,ke]),a.default.useEffect(()=>()=>{oe&&oe.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(oe)},[oe]),oe||$},Z=(z,$,F,Y)=>{const X=k(z.clipSrc||""),[Q,J]=M(X,"anonymous"),re=z.clipSrc?J:"loaded";(0,e.useImageLoader)(re,z.id+"-clip");const ie=a.default.useMemo(()=>{if($&&Q)return g()},[$,Q]);return a.default.useLayoutEffect(()=>{var ne;if(!Q||!$||!$.width||!$.height||!Q||!Q.width||!Q.height||!ie)return;const ae=g(),ke=Math.max(z.a.width/Q.width*F,z.a.height/Q.height*F);ae.width=Q.width*ke,ae.height=Q.height*ke,(ne=ae.getContext("2d"))===null||ne===void 0||ne.drawImage(Q,0,0,ae.width,ae.height),ie.width=Math.max($.width,1),ie.height=Math.max($.height,1);const Ae=ie.getContext("2d");Ae&&(Ae.save(),Ae.drawImage(ae,0,0,$.width,$.height),h.default.Util.releaseCanvas(ae),Ae.globalCompositeOperation="source-in",Ae.drawImage($,0,0,ie.width,ie.height),Ae.restore())},[ie,$,Q,z.a.width,z.a.height,F,...Y]),z.clipSrc&&Q?ie:$},W=g(),H=(0,o.observer)(({element:z})=>{const $=Math.min(30,z.a.width/4,z.a.height/4),F=a.default.useRef(null);return a.default.useEffect(()=>{const Y=F.current;if(!Y)return;const X=new h.default.Animation(Q=>{Y.rotate(((Q==null?void 0:Q.timeDiff)||0)/2)},Y.getLayer());return X.start(),()=>{X.stop()}}),a.default.createElement(u.Group,{x:z.x,y:z.y,rotation:z.rotation,listening:!1,opacity:z.a.opacity,hideInExport:!z.showInExport},a.default.createElement(u.Rect,{width:z.a.width,height:z.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:F,x:z.a.width/2,y:z.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),L=(0,o.observer)(({element:z})=>{const $="Can not load the image...",F=Math.max(10,Math.min(30,z.a.width/25));return a.default.createElement(u.Group,{x:z.x,y:z.y,rotation:z.rotation,listening:!1,opacity:z.a.opacity,hideInExport:!z.showInExport},a.default.createElement(u.Rect,{width:z.a.width,height:z.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:$,fontSize:F,width:z.a.width,height:z.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let M=f.default;const D=z=>{M=z};e.setImageLoaderHook=D;const B=(z,$)=>{const F=a.default.useRef(),Y=()=>{var X;(X=F.current)===null||X===void 0||X.call(F),F.current=void 0};a.default.useEffect(()=>Y,[]),a.default.useLayoutEffect(()=>{z!=="loading"||F.current||(F.current=(0,b.incrementLoader)(`image ${$}`)),z!=="loading"&&Y(),z==="failed"&&(0,b.triggerLoadError)(`image ${$}`)},[z])};e.useImageLoader=B;const q=({image:z,status:$,type:F})=>{const Y=a.default.useRef();return a.default.useEffect(()=>{Y.current=z||Y.current},[z]),$!=="failed"||$!=="failed"&&F==="svg"?Y.current:void 0},K=z=>{const[$,F]=a.default.useReducer(J=>J+1,0),Y=a.default.useRef("loading"),X=a.default.useRef(z.src),Q=a.default.useRef(z.src);return Q.current!==z.src&&(Q.current=z.src,Y.current="loading"),a.default.useEffect(()=>{if(z.type!=="svg"||!z.src)return;let J=!1;return(async()=>{Y.current="loading",F();const re=await _.urlToString(z.src),ie=_.fixSize(re),ne=_.replaceColors(ie,z.colorsReplace);J||(X.current=ne,Y.current="loaded",F())})(),()=>{J=!0}},[z.src,JSON.stringify(z.colorsReplace)]),z.type!=="svg"?[z.src,"loaded"]:[X.current,Y.current]};e.ImageElement=(0,o.observer)(({element:z,store:$})=>{var F;const[Y,X]=a.default.useState(!1),Q=a.default.useRef(null),J=a.default.useRef(null),[re,ie]=a.default.useState(!1),ne=$.selectedShapes.indexOf(z)>=0,[ae,ke]=K(z),[Ae,oe]=M(ae,"anonymous"),ce=z.type!=="svg"||ke==="loaded"?oe:"loading";(0,e.useImageLoader)(ce,z.id);const _e=z.page._exportingOrRendering?1:Math.max(1,$.scale),ye=$._elementsPixelRatio*_e,te=q({image:Ae,status:oe,type:z.type}),le=N(z,E(z,Ae||te,ye))||W;let{cropX:me,cropY:Ee,cropWidth:We,cropHeight:Qe}=z;oe!=="loaded"&&(me=Ee=0,We=Qe=1);const Re=le.width*We,Pe=le.height*Qe,Oe=z.a.width/z.a.height;let Ne,Je;const fe=Re/Pe,de=z.type==="svg";de?(Ne=Re,Je=Pe):Oe>=fe?(Ne=Re,Je=Re/Oe):(Ne=Pe*Oe,Je=Pe);const Xe={x:le.width*me,y:le.height*Ee,width:Ne,height:Je},be=(F=z.cornerRadius)!==null&&F!==void 0?F:0,Ie=z.page._exportingOrRendering?1:Math.min(2,$.scale),Me=$._elementsPixelRatio*Ie;let we=Z(z,G(z,le,Xe,Me,be,Y||z._cropModeEnabled||z.type==="svg",!0),Me,[Xe,be,Me]);const et=Math.max(z.a.width/Ne,z.a.height/Je);a.default.useEffect(()=>{var De;if(!z._cropModeEnabled)return;const tt=(De=Q.current)===null||De===void 0?void 0:De.getStage();function yt(Ct){z._cropModeEnabled&&Ct.target!==J.current&&z.toggleCropMode(!1)}function Xt(Ct){z._cropModeEnabled&&Ct.target.parentNode!==tt.content&&z.toggleCropMode(!1)}return document.body.addEventListener("click",Xt),tt==null||tt.on("click",yt),tt==null||tt.on("tap",yt),()=>{document.body.removeEventListener("click",Xt),document.body.removeEventListener("touchstart",Xt),tt==null||tt.off("click",yt),tt==null||tt.off("click",yt)}},[z._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(Y||z._cropModeEnabled))return(0,v.applyFilter)(Q.current,z),(0,l.autorun)(()=>{(0,v.applyFilter)(Q.current,z)},{delay:100})},[we,z.page._exportingOrRendering,Y,We,Qe,z._cropModeEnabled]),a.default.useLayoutEffect(()=>{var De;Y||z._cropModeEnabled?(De=Q.current)===null||De===void 0||De.clearCache():(0,v.applyFilter)(Q.current,z)},[Y,z.a.width,z.a.height,z._cropModeEnabled]),a.default.useEffect(()=>{(0,v.applyFilter)(Q.current,z)},[z.shadowEnabled,z.shadowBlur,z.cornerRadius,z.shadowColor,z.shadowOffsetX,z.shadowOffsetY,z.shadowOpacity]);const Se=a.default.useRef(null),Ye=a.default.useRef(null),Le=a.default.useRef(null);a.default.useLayoutEffect(()=>{z._cropModeEnabled&&(Ye.current.nodes([Se.current]),Le.current.nodes([J.current]))},[z._cropModeEnabled]);var je=a.default.useRef(null),Ve=a.default.useRef(0),pt=a.default.useRef(!1);const Ot=De=>{var tt;((tt=De.evt.touches)===null||tt===void 0?void 0:tt.length)>2&&De.target.stopDrag(),Math.round(De.target.x())>0&&(De.target.x(0),De.target.scaleX(1)),Math.round(De.target.y())>0&&(De.target.y(0),De.target.scaleY(1));const yt=De.target.width()*De.target.scaleX(),Xt=De.target.height()*De.target.scaleY(),Ct=Math.min(1,Ne/yt),or=Math.min(1,Je/Xt),Lr=1-Ct,lr=Math.min(Lr,Math.max(0,Math.round(-De.target.x())/yt)),Mn=1-or,Ei=Math.min(Mn,Math.max(0,Math.round(-De.target.y())/Xt));De.target.setAttrs({x:-lr*le.width,y:-Ei*le.height,scaleX:1,scaleY:1}),z.set({cropX:lr,cropY:Ei,cropWidth:Ct,cropHeight:or})},Qr=()=>{z.type!=="svg"&&z.contentEditable&&setTimeout(()=>{z.toggleCropMode(!0)})},Or=z.type==="svg"&&te,Mr=oe==="loading"&&!Or,Jr=oe==="failed",Si=!Mr&&!Jr,yn=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Gr=Si?z.a.opacity:0;(0,m.useFadeIn)(Q,Gr);const Ra=z.selectable||$.role==="admin",Rn=(0,d.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,Mr&&a.default.createElement(H,{element:z}),Jr&&a.default.createElement(L,{element:z}),a.default.createElement(u.Image,{ref:Q,name:"element",id:z.id,image:we,x:z.a.x,y:z.a.y,width:z.a.width||1,height:z.a.height||1,rotation:z.a.rotation,opacity:Gr,shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur,shadowOffsetX:z.shadowOffsetX,shadowOffsetY:z.shadowOffsetY,shadowColor:z.shadowColor,shadowOpacity:z.shadowOpacity,customCrop:Xe,listening:Ra,draggable:Rn?z.draggable&&ne:z.draggable,preventDefault:!Rn||ne,hideInExport:!z.showInExport,onMouseEnter:()=>{ie(!0)},onMouseLeave:()=>{ie(!1)},onDragMove:De=>{z.set({x:De.target.x(),y:De.target.y()})},onDragEnd:De=>{z.set({x:De.target.x(),y:De.target.y()})},onDblClick:Qr,onDblTap:Qr,onTransformStart:()=>{X(!0),yn.current={cropX:z.cropX,cropY:z.cropY,cropWidth:z.cropWidth,cropHeight:z.cropHeight}},onTransform:De=>{var tt;const yt=De.currentTarget,Xt=Math.abs(yt.scaleX()-1)<1e-7?1:yt.scaleX(),Ct=Math.abs(yt.scaleY()-1)<1e-7?1:yt.scaleY();yt.scaleX(1),yt.scaleY(1);const or=(tt=De.target.getStage())===null||tt===void 0?void 0:tt.findOne("Transformer"),Lr=1-Ne/le.width,lr=Math.min(Lr,Math.max(0,z.cropX)),Mn=1-Je/le.height,Ei=Math.min(Mn,Math.max(0,z.cropY)),Qi=or.getActiveAnchor(),Ma=!(Qi.indexOf("middle")>=0||Qi.indexOf("center")>=0),au=!Ma&&Xt<1&&yn.current.cropHeight>Je/le.height;let Ro=Ma?z.cropWidth:z.cropWidth*Xt;au&&(Ro=z.cropWidth);const Mo=!Ma&&Ct<1&&yn.current.cropWidth>Ne/le.width;let Oi=Ma?z.cropHeight:z.cropHeight*Ct;Mo&&(Oi=z.cropHeight),de&&(Ro=z.cropWidth,Oi=z.cropHeight),z.set({cropX:lr,cropY:Ei,x:yt.x(),y:yt.y(),width:yt.width()*Xt,height:yt.height()*Ct,rotation:De.target.rotation(),cropWidth:Math.min(Ro,1-lr),cropHeight:Math.min(Oi,1-Ei)})},onTransformEnd:De=>{const tt=De.currentTarget;z.set({width:tt.width(),height:tt.height(),x:tt.x(),y:tt.y(),rotation:De.target.rotation(),cropWidth:Ne/le.width,cropHeight:Je/le.height}),X(!1)}}),a.default.createElement(u.Rect,{x:z.x,y:z.y,width:Math.max(z.a.width-z.borderSize,0),height:Math.max(z.a.height-z.borderSize,0),opacity:Gr,offsetX:-z.borderSize/2,offsetY:-z.borderSize/2,stroke:z.borderColor,strokeWidth:z.borderSize,listening:!1,visible:!!z.borderSize,rotation:z.rotation,cornerRadius:Math.max(0,be-z.borderSize),hideInExport:!z.showInExport}),z._cropModeEnabled&&a.default.createElement(O.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/$.scale,y:-window.innerWidth/$.scale,width:window.innerWidth/$.scale*3,height:window.innerWidth/$.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:we,x:z.x,y:z.y,width:z.a.width,height:z.a.height,rotation:z.rotation,shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur}),a.default.createElement(u.Group,{x:z.x,y:z.y,rotation:z.rotation,scaleX:et,scaleY:et},a.default.createElement(u.Image,{image:le,ref:J,opacity:.4,draggable:!0,x:-z.cropX*le.width,y:-z.cropY*le.height,onDragMove:Ot,onTransform:Ot,onTouchMove:De=>{De.evt.preventDefault();const tt=De.target.getStage().getPointersPositions();var yt=tt[0],Xt=tt[1];const Ct=De.target;if(yt&&!Xt&&!Ct.isDragging()&&pt.current&&(Ct.startDrag(),pt.current=!1),yt&&Xt){h.default.hitOnDragEnabled=!0,Ct.isDragging()&&(pt.current=!0,Ct.stopDrag());const Mo=De.target.getAbsoluteTransform().copy();Mo.invert();var or={x:yt.x,y:yt.y},Lr={x:Xt.x,y:Xt.y};if(!je.current)return void(je.current=A(or,Lr));var lr=A(or,Lr),Mn=P(or,Lr);Ve.current||(Ve.current=Mn);const Oi=Ct.position();var Ei={x:lr.x-Oi.x,y:lr.y-Oi.y},Qi=Mn/Ve.current;Ct.scaleX(Qi),Ct.scaleY(Qi);const La=Mo.point(lr),Rl=Mo.point(je.current);var Ma=La.x-Rl.x,au=La.y-Rl.y,Ro={x:Math.min(0,lr.x-Ei.x*Qi+Ma),y:Math.min(0,lr.y-Ei.y*Qi+au)};Ct.position(Ro),Ve.current=Mn,je.current=lr,Ot(De)}},onTouchEnd:De=>{Ve.current=0,je.current=null,h.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:Le,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,tt)=>tt.width<5||tt.height<5?De:tt,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Ne,height:Je,ref:Se,listening:!1,onTransform:De=>{De.target.x()<-z.cropX*le.width-1e-9&&(De.target.x(-z.cropX*le.width),De.target.scaleX(1)),De.target.y()<-z.cropY*le.height-1e-9&&(De.target.y(-z.cropY*le.height),De.target.scaleY(1));const tt=Math.min(1,Math.max(0,z.cropX+De.target.x()/le.width)),yt=Math.min(1,Math.max(0,De.target.y()/le.height+z.cropY)),Xt=De.target.width()*De.target.scaleX(),Ct=De.target.height()*De.target.scaleY(),or=Math.min(1-tt,Xt/le.width),Lr=Math.min(1-yt,Ct/le.height),lr=De.target.getAbsolutePosition(De.target.getParent().getParent());De.target.scale({x:1,y:1}),De.target.position({x:0,y:0}),z.set({x:lr.x,y:lr.y,cropX:tt,cropY:yt,cropWidth:or,cropHeight:Lr,width:Math.min(Xt*et,le.width*(1-tt)*et),height:Math.min(Ct*et,le.height*(1-yt)*et)})}}),a.default.createElement(u.Transformer,{ref:Ye,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(De,tt)=>tt.width<5||tt.height<5?De:tt,visible:z.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(re||ne)&&a.default.createElement(S.Highlighter,{element:z}))})})(d2);var iS={},aS={exports:{}};/*!
|
|
109
|
+
* Quill Editor v1.3.7
|
|
110
|
+
* https://quilljs.com/
|
|
111
|
+
* Copyright (c) 2014, Jason Chen
|
|
112
|
+
* Copyright (c) 2013, salesforce.com
|
|
113
|
+
*/(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:ve,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),h=i(47),O=i(48),S=i(49),b=i(12),_=i(32),y=i(33),p=i(31),v=i(1),m={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:O.default,Scroll:u.default,Block:h.default,Inline:f.default,Text:S.default,Attributor:{Attribute:b.default,Class:_.default,Style:y.default,Store:p.default}};n.default=m},function(r,n,i){var a=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,m){v.__proto__=m}||function(v,m){for(var d in m)m.hasOwnProperty(d)&&(v[d]=m[d])};return function(v,m){p(v,m);function d(){this.constructor=v}v.prototype=m===null?Object.create(m):(d.prototype=m.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(p){a(v,p);function v(m){var d=this;return m="[Parchment] "+m,d=p.call(this,m)||this,d.message=m,d.name=d.constructor.name,d}return v}(Error);n.ParchmentError=o;var l={},u={},f={},h={};n.DATA_KEY="__blot";var O;(function(p){p[p.TYPE=3]="TYPE",p[p.LEVEL=12]="LEVEL",p[p.ATTRIBUTE=13]="ATTRIBUTE",p[p.BLOT=14]="BLOT",p[p.INLINE=7]="INLINE",p[p.BLOCK=11]="BLOCK",p[p.BLOCK_BLOT=10]="BLOCK_BLOT",p[p.INLINE_BLOT=6]="INLINE_BLOT",p[p.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",p[p.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",p[p.ANY=15]="ANY"})(O=n.Scope||(n.Scope={}));function S(p,v){var m=_(p);if(m==null)throw new o("Unable to create "+p+" blot");var d=m,g=p instanceof Node||p.nodeType===Node.TEXT_NODE?p:d.create(v);return new d(g,v)}n.create=S;function b(p,v){return v===void 0&&(v=!1),p==null?null:p[n.DATA_KEY]!=null?p[n.DATA_KEY].blot:v?b(p.parentNode,v):null}n.find=b;function _(p,v){v===void 0&&(v=O.ANY);var m;if(typeof p=="string")m=h[p]||l[p];else if(p instanceof Text||p.nodeType===Node.TEXT_NODE)m=h.text;else if(typeof p=="number")p&O.LEVEL&O.BLOCK?m=h.block:p&O.LEVEL&O.INLINE&&(m=h.inline);else if(p instanceof HTMLElement){var d=(p.getAttribute("class")||"").split(/\s+/);for(var g in d)if(m=u[d[g]],m)break;m=m||f[p.tagName]}return m==null?null:v&O.LEVEL&m.scope&&v&O.TYPE&m.scope?m:null}n.query=_;function y(){for(var p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];if(p.length>1)return p.map(function(g){return y(g)});var m=p[0];if(typeof m.blotName!="string"&&typeof m.attrName!="string")throw new o("Invalid definition");if(m.blotName==="abstract")throw new o("Cannot register abstract class");if(h[m.blotName||m.attrName]=m,typeof m.keyName=="string")l[m.keyName]=m;else if(m.className!=null&&(u[m.className]=m),m.tagName!=null){Array.isArray(m.tagName)?m.tagName=m.tagName.map(function(g){return g.toUpperCase()}):m.tagName=m.tagName.toUpperCase();var d=Array.isArray(m.tagName)?m.tagName:[m.tagName];d.forEach(function(g){(f[g]==null||m.className==null)&&(f[g]=m)})}return m}n.register=y},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",h=function(O){Array.isArray(O)?this.ops=O:O!=null&&Array.isArray(O.ops)?this.ops=O.ops:this.ops=[]};h.prototype.insert=function(O,S){var b={};return O.length===0?this:(b.insert=O,S!=null&&typeof S=="object"&&Object.keys(S).length>0&&(b.attributes=S),this.push(b))},h.prototype.delete=function(O){return O<=0?this:this.push({delete:O})},h.prototype.retain=function(O,S){if(O<=0)return this;var b={retain:O};return S!=null&&typeof S=="object"&&Object.keys(S).length>0&&(b.attributes=S),this.push(b)},h.prototype.push=function(O){var S=this.ops.length,b=this.ops[S-1];if(O=l(!0,{},O),typeof b=="object"){if(typeof O.delete=="number"&&typeof b.delete=="number")return this.ops[S-1]={delete:b.delete+O.delete},this;if(typeof b.delete=="number"&&O.insert!=null&&(S-=1,b=this.ops[S-1],typeof b!="object"))return this.ops.unshift(O),this;if(o(O.attributes,b.attributes)){if(typeof O.insert=="string"&&typeof b.insert=="string")return this.ops[S-1]={insert:b.insert+O.insert},typeof O.attributes=="object"&&(this.ops[S-1].attributes=O.attributes),this;if(typeof O.retain=="number"&&typeof b.retain=="number")return this.ops[S-1]={retain:b.retain+O.retain},typeof O.attributes=="object"&&(this.ops[S-1].attributes=O.attributes),this}}return S===this.ops.length?this.ops.push(O):this.ops.splice(S,0,O),this},h.prototype.chop=function(){var O=this.ops[this.ops.length-1];return O&&O.retain&&!O.attributes&&this.ops.pop(),this},h.prototype.filter=function(O){return this.ops.filter(O)},h.prototype.forEach=function(O){this.ops.forEach(O)},h.prototype.map=function(O){return this.ops.map(O)},h.prototype.partition=function(O){var S=[],b=[];return this.forEach(function(_){var y=O(_)?S:b;y.push(_)}),[S,b]},h.prototype.reduce=function(O,S){return this.ops.reduce(O,S)},h.prototype.changeLength=function(){return this.reduce(function(O,S){return S.insert?O+u.length(S):S.delete?O-S.delete:O},0)},h.prototype.length=function(){return this.reduce(function(O,S){return O+u.length(S)},0)},h.prototype.slice=function(O,S){O=O||0,typeof S!="number"&&(S=1/0);for(var b=[],_=u.iterator(this.ops),y=0;y<S&&_.hasNext();){var p;y<O?p=_.next(O-y):(p=_.next(S-y),b.push(p)),y+=u.length(p)}return new h(b)},h.prototype.compose=function(O){var S=u.iterator(this.ops),b=u.iterator(O.ops),_=[],y=b.peek();if(y!=null&&typeof y.retain=="number"&&y.attributes==null){for(var p=y.retain;S.peekType()==="insert"&&S.peekLength()<=p;)p-=S.peekLength(),_.push(S.next());y.retain-p>0&&b.next(y.retain-p)}for(var v=new h(_);S.hasNext()||b.hasNext();)if(b.peekType()==="insert")v.push(b.next());else if(S.peekType()==="delete")v.push(S.next());else{var m=Math.min(S.peekLength(),b.peekLength()),d=S.next(m),g=b.next(m);if(typeof g.retain=="number"){var w={};typeof d.retain=="number"?w.retain=m:w.insert=d.insert;var k=u.attributes.compose(d.attributes,g.attributes,typeof d.retain=="number");if(k&&(w.attributes=k),v.push(w),!b.hasNext()&&o(v.ops[v.ops.length-1],w)){var P=new h(S.rest());return v.concat(P).chop()}}else typeof g.delete=="number"&&typeof d.retain=="number"&&v.push(g)}return v.chop()},h.prototype.concat=function(O){var S=new h(this.ops.slice());return O.ops.length>0&&(S.push(O.ops[0]),S.ops=S.ops.concat(O.ops.slice(1))),S},h.prototype.diff=function(O,S){if(this.ops===O.ops)return new h;var b=[this,O].map(function(m){return m.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var g=m===O?"on":"with";throw new Error("diff() called "+g+" non-document")}).join("")}),_=new h,y=a(b[0],b[1],S),p=u.iterator(this.ops),v=u.iterator(O.ops);return y.forEach(function(m){for(var d=m[1].length;d>0;){var g=0;switch(m[0]){case a.INSERT:g=Math.min(v.peekLength(),d),_.push(v.next(g));break;case a.DELETE:g=Math.min(d,p.peekLength()),p.next(g),_.delete(g);break;case a.EQUAL:g=Math.min(p.peekLength(),v.peekLength(),d);var w=p.next(g),k=v.next(g);o(w.insert,k.insert)?_.retain(g,u.attributes.diff(w.attributes,k.attributes)):_.push(k).delete(g);break}d-=g}}),_.chop()},h.prototype.eachLine=function(O,S){S=S||`
|
|
114
|
+
`;for(var b=u.iterator(this.ops),_=new h,y=0;b.hasNext();){if(b.peekType()!=="insert")return;var p=b.peek(),v=u.length(p)-b.peekLength(),m=typeof p.insert=="string"?p.insert.indexOf(S,v)-v:-1;if(m<0)_.push(b.next());else if(m>0)_.push(b.next(m));else{if(O(_,b.next(1).attributes||{},y)===!1)return;y+=1,_=new h}}_.length()>0&&O(_,{},y)},h.prototype.transform=function(O,S){if(S=!!S,typeof O=="number")return this.transformPosition(O,S);for(var b=u.iterator(this.ops),_=u.iterator(O.ops),y=new h;b.hasNext()||_.hasNext();)if(b.peekType()==="insert"&&(S||_.peekType()!=="insert"))y.retain(u.length(b.next()));else if(_.peekType()==="insert")y.push(_.next());else{var p=Math.min(b.peekLength(),_.peekLength()),v=b.next(p),m=_.next(p);if(v.delete)continue;m.delete?y.push(m):y.retain(p,u.attributes.transform(v.attributes,m.attributes,S))}return y.chop()},h.prototype.transformPosition=function(O,S){S=!!S;for(var b=u.iterator(this.ops),_=0;b.hasNext()&&_<=O;){var y=b.peekLength(),p=b.peekType();if(b.next(),p==="delete"){O-=Math.min(y,O-_);continue}else p==="insert"&&(_<O||!S)&&(O+=y);_+=y}return O},r.exports=h},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(b){return typeof Array.isArray=="function"?Array.isArray(b):a.call(b)==="[object Array]"},f=function(b){if(!b||a.call(b)!=="[object Object]")return!1;var _=i.call(b,"constructor"),y=b.constructor&&b.constructor.prototype&&i.call(b.constructor.prototype,"isPrototypeOf");if(b.constructor&&!_&&!y)return!1;var p;for(p in b);return typeof p>"u"||i.call(b,p)},h=function(b,_){o&&_.name==="__proto__"?o(b,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):b[_.name]=_.newValue},O=function(b,_){if(_==="__proto__")if(i.call(b,_)){if(l)return l(b,_).value}else return;return b[_]};r.exports=function S(){var b,_,y,p,v,m,d=arguments[0],g=1,w=arguments.length,k=!1;for(typeof d=="boolean"&&(k=d,d=arguments[1]||{},g=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});g<w;++g)if(b=arguments[g],b!=null)for(_ in b)y=O(d,_),p=O(b,_),d!==p&&(k&&p&&(f(p)||(v=u(p)))?(v?(v=!1,m=y&&u(y)?y:[]):m=y&&f(y)?y:{},h(d,{name:_,newValue:S(k,m,p)})):typeof p<"u"&&h(d,{name:_,newValue:p}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function C(R,N){for(var U=0;U<N.length;U++){var G=N[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(R,G.key,G)}}return function(R,N,U){return N&&C(R.prototype,N),U&&C(R,U),R}}(),o=function C(R,N,U){R===null&&(R=Function.prototype);var G=Object.getOwnPropertyDescriptor(R,N);if(G===void 0){var Z=Object.getPrototypeOf(R);return Z===null?void 0:C(Z,N,U)}else{if("value"in G)return G.value;var W=G.get;return W===void 0?void 0:W.call(U)}},l=i(3),u=d(l),f=i(2),h=d(f),O=i(0),S=d(O),b=i(16),_=d(b),y=i(6),p=d(y),v=i(7),m=d(v);function d(C){return C&&C.__esModule?C:{default:C}}function g(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function w(C,R){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:C}function k(C,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);C.prototype=Object.create(R&&R.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(C,R):C.__proto__=R)}var P=1,A=function(C){k(R,C);function R(){return g(this,R),w(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return a(R,[{key:"attach",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"attach",this).call(this),this.attributes=new S.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(U,G){var Z=S.default.query(U,S.default.Scope.BLOCK_ATTRIBUTE);Z!=null&&this.attributes.attribute(Z,G)}},{key:"formatAt",value:function(U,G,Z,W){this.format(Z,W)}},{key:"insertAt",value:function(U,G,Z){if(typeof G=="string"&&G.endsWith(`
|
|
115
|
+
`)){var W=S.default.create(E.blotName);this.parent.insertBefore(W,U===0?this:this.next),W.insertAt(0,G.slice(0,-1))}else o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,G,Z)}}]),R}(S.default.Embed);A.scope=S.default.Scope.BLOCK_BLOT;var E=function(C){k(R,C);function R(N){g(this,R);var U=w(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,N));return U.cache={},U}return a(R,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(S.default.Leaf).reduce(function(U,G){return G.length()===0?U:U.insert(G.value(),x(G))},new h.default).insert(`
|
|
116
|
+
`,x(this))),this.cache.delta}},{key:"deleteAt",value:function(U,G){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,U,G),this.cache={}}},{key:"formatAt",value:function(U,G,Z,W){G<=0||(S.default.query(Z,S.default.Scope.BLOCK)?U+G===this.length()&&this.format(Z,W):o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,U,Math.min(G,this.length()-U-1),Z,W),this.cache={})}},{key:"insertAt",value:function(U,G,Z){if(Z!=null)return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,U,G,Z);if(G.length!==0){var W=G.split(`
|
|
117
|
+
`),H=W.shift();H.length>0&&(U<this.length()-1||this.children.tail==null?o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,Math.min(U,this.length()-1),H):this.children.tail.insertAt(this.children.tail.length(),H),this.cache={});var L=this;W.reduce(function(M,D){return L=L.split(M,!0),L.insertAt(0,D),D.length},U+H.length)}}},{key:"insertBefore",value:function(U,G){var Z=this.children.head;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,U,G),Z instanceof _.default&&Z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"length",this).call(this)+P),this.cache.length}},{key:"moveChildren",value:function(U,G){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"moveChildren",this).call(this,U,G),this.cache={}}},{key:"optimize",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"removeChild",this).call(this,U),this.cache={}}},{key:"split",value:function(U){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(G&&(U===0||U>=this.length()-P)){var Z=this.clone();return U===0?(this.parent.insertBefore(Z,this),this):(this.parent.insertBefore(Z,this.next),Z)}else{var W=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"split",this).call(this,U,G);return this.cache={},W}}}]),R}(S.default.Block);E.blotName="block",E.tagName="P",E.defaultChild="break",E.allowedChildren=[p.default,S.default.Embed,m.default];function x(C){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C==null||(typeof C.formats=="function"&&(R=(0,u.default)(R,C.formats())),C.parent==null||C.parent.blotName=="scroll"||C.parent.statics.scope!==C.statics.scope)?R:x(C.parent,R)}n.bubbleFormats=x,n.BlockEmbed=A,n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},o=function(){function L(M,D){var B=[],q=!0,K=!1,z=void 0;try{for(var $=M[Symbol.iterator](),F;!(q=(F=$.next()).done)&&(B.push(F.value),!(D&&B.length===D));q=!0);}catch(Y){K=!0,z=Y}finally{try{!q&&$.return&&$.return()}finally{if(K)throw z}}return B}return function(M,D){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return L(M,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function L(M,D){for(var B=0;B<D.length;B++){var q=D[B];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(M,q.key,q)}}return function(M,D,B){return D&&L(M.prototype,D),B&&L(M,B),M}}();i(50);var u=i(2),f=x(u),h=i(14),O=x(h),S=i(8),b=x(S),_=i(9),y=x(_),p=i(0),v=x(p),m=i(15),d=x(m),g=i(3),w=x(g),k=i(10),P=x(k),A=i(34),E=x(A);function x(L){return L&&L.__esModule?L:{default:L}}function C(L,M,D){return M in L?Object.defineProperty(L,M,{value:D,enumerable:!0,configurable:!0,writable:!0}):L[M]=D,L}function R(L,M){if(!(L instanceof M))throw new TypeError("Cannot call a class as a function")}var N=(0,P.default)("quill"),U=function(){l(L,null,[{key:"debug",value:function(D){D===!0&&(D="log"),P.default.level(D)}},{key:"find",value:function(D){return D.__quill||v.default.find(D)}},{key:"import",value:function(D){return this.imports[D]==null&&N.error("Cannot import "+D+". Are you sure it was registered?"),this.imports[D]}},{key:"register",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof D!="string"){var z=D.attrName||D.blotName;typeof z=="string"?this.register("formats/"+z,D,B):Object.keys(D).forEach(function($){q.register($,D[$],B)})}else this.imports[D]!=null&&!K&&N.warn("Overwriting "+D+" with",B),this.imports[D]=B,(D.startsWith("blots/")||D.startsWith("formats/"))&&B.blotName!=="abstract"?v.default.register(B):D.startsWith("modules")&&typeof B.register=="function"&&B.register()}}]);function L(M){var D=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(R(this,L),this.options=G(M,B),this.container=this.options.container,this.container==null)return N.error("Invalid Quill container",M);this.options.debug&&L.debug(this.options.debug);var q=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new b.default,this.scroll=v.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new O.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(b.default.events.EDITOR_CHANGE,function(z){z===b.default.events.TEXT_CHANGE&&D.root.classList.toggle("ql-blank",D.editor.isBlank())}),this.emitter.on(b.default.events.SCROLL_UPDATE,function(z,$){var F=D.selection.lastRange,Y=F&&F.length===0?F.index:void 0;Z.call(D,function(){return D.editor.update(null,$,Y)},z)});var K=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+q+"<p><br></p></div>");this.setContents(K),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(L,[{key:"addContainer",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof D=="string"){var q=D;D=document.createElement("div"),D.classList.add(q)}return this.container.insertBefore(D,B),D}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(D,B,q){var K=this,z=W(D,B,q),$=o(z,4);return D=$[0],B=$[1],q=$[3],Z.call(this,function(){return K.editor.deleteText(D,B)},q,D,-1*B)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(D),this.container.classList.toggle("ql-disabled",!D)}},{key:"focus",value:function(){var D=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=D,this.scrollIntoView()}},{key:"format",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;return Z.call(this,function(){var z=q.getSelection(!0),$=new f.default;if(z==null)return $;if(v.default.query(D,v.default.Scope.BLOCK))$=q.editor.formatLine(z.index,z.length,C({},D,B));else{if(z.length===0)return q.selection.format(D,B),$;$=q.editor.formatText(z.index,z.length,C({},D,B))}return q.setSelection(z,b.default.sources.SILENT),$},K)}},{key:"formatLine",value:function(D,B,q,K,z){var $=this,F=void 0,Y=W(D,B,q,K,z),X=o(Y,4);return D=X[0],B=X[1],F=X[2],z=X[3],Z.call(this,function(){return $.editor.formatLine(D,B,F)},z,D,0)}},{key:"formatText",value:function(D,B,q,K,z){var $=this,F=void 0,Y=W(D,B,q,K,z),X=o(Y,4);return D=X[0],B=X[1],F=X[2],z=X[3],Z.call(this,function(){return $.editor.formatText(D,B,F)},z,D,0)}},{key:"getBounds",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=void 0;typeof D=="number"?q=this.selection.getBounds(D,B):q=this.selection.getBounds(D.index,D.length);var K=this.container.getBoundingClientRect();return{bottom:q.bottom-K.top,height:q.height,left:q.left-K.left,right:q.right-K.left,top:q.top-K.top,width:q.width}}},{key:"getContents",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,q=W(D,B),K=o(q,2);return D=K[0],B=K[1],this.editor.getContents(D,B)}},{key:"getFormat",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof D=="number"?this.editor.getFormat(D,B):this.editor.getFormat(D.index,D.length)}},{key:"getIndex",value:function(D){return D.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(D){return this.scroll.leaf(D)}},{key:"getLine",value:function(D){return this.scroll.line(D)}},{key:"getLines",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof D!="number"?this.scroll.lines(D.index,D.length):this.scroll.lines(D,B)}},{key:"getModule",value:function(D){return this.theme.modules[D]}},{key:"getSelection",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return D&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,q=W(D,B),K=o(q,2);return D=K[0],B=K[1],this.editor.getText(D,B)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(D,B,q){var K=this,z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:L.sources.API;return Z.call(this,function(){return K.editor.insertEmbed(D,B,q)},z,D)}},{key:"insertText",value:function(D,B,q,K,z){var $=this,F=void 0,Y=W(D,0,q,K,z),X=o(Y,4);return D=X[0],F=X[2],z=X[3],Z.call(this,function(){return $.editor.insertText(D,B,F)},z,D,B.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(D,B,q){this.clipboard.dangerouslyPasteHTML(D,B,q)}},{key:"removeFormat",value:function(D,B,q){var K=this,z=W(D,B,q),$=o(z,4);return D=$[0],B=$[1],q=$[3],Z.call(this,function(){return K.editor.removeFormat(D,B)},q,D)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(D){var B=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b.default.sources.API;return Z.call(this,function(){D=new f.default(D);var K=B.getLength(),z=B.editor.deleteText(0,K),$=B.editor.applyDelta(D),F=$.ops[$.ops.length-1];F!=null&&typeof F.insert=="string"&&F.insert[F.insert.length-1]===`
|
|
118
|
+
`&&(B.editor.deleteText(B.getLength()-1,1),$.delete(1));var Y=z.compose($);return Y},q)}},{key:"setSelection",value:function(D,B,q){if(D==null)this.selection.setRange(null,B||L.sources.API);else{var K=W(D,B,q),z=o(K,4);D=z[0],B=z[1],q=z[3],this.selection.setRange(new m.Range(D,B),q),q!==b.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b.default.sources.API,q=new f.default().insert(D);return this.setContents(q,B)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b.default.sources.USER,B=this.scroll.update(D);return this.selection.update(D),B}},{key:"updateContents",value:function(D){var B=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b.default.sources.API;return Z.call(this,function(){return D=new f.default(D),B.editor.applyDelta(D,q)},q,!0)}}]),L}();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=b.default.events,U.sources=b.default.sources,U.version="1.3.7",U.imports={delta:f.default,parchment:v.default,"core/module":y.default,"core/theme":E.default};function G(L,M){if(M=(0,w.default)(!0,{container:L,modules:{clipboard:!0,keyboard:!0,history:!0}},M),!M.theme||M.theme===U.DEFAULTS.theme)M.theme=E.default;else if(M.theme=U.import("themes/"+M.theme),M.theme==null)throw new Error("Invalid theme "+M.theme+". Did you register it?");var D=(0,w.default)(!0,{},M.theme.DEFAULTS);[D,M].forEach(function(K){K.modules=K.modules||{},Object.keys(K.modules).forEach(function(z){K.modules[z]===!0&&(K.modules[z]={})})});var B=Object.keys(D.modules).concat(Object.keys(M.modules)),q=B.reduce(function(K,z){var $=U.import("modules/"+z);return $==null?N.error("Cannot load "+z+" module. Are you sure you registered it?"):K[z]=$.DEFAULTS||{},K},{});return M.modules!=null&&M.modules.toolbar&&M.modules.toolbar.constructor!==Object&&(M.modules.toolbar={container:M.modules.toolbar}),M=(0,w.default)(!0,{},U.DEFAULTS,{modules:q},D,M),["bounds","container","scrollingContainer"].forEach(function(K){typeof M[K]=="string"&&(M[K]=document.querySelector(M[K]))}),M.modules=Object.keys(M.modules).reduce(function(K,z){return M.modules[z]&&(K[z]=M.modules[z]),K},{}),M}function Z(L,M,D,B){if(this.options.strict&&!this.isEnabled()&&M===b.default.sources.USER)return new f.default;var q=D==null?null:this.getSelection(),K=this.editor.delta,z=L();if(q!=null&&(D===!0&&(D=q.index),B==null?q=H(q,z,M):B!==0&&(q=H(q,D,B,M)),this.setSelection(q,b.default.sources.SILENT)),z.length()>0){var $,F=[b.default.events.TEXT_CHANGE,z,K,M];if(($=this.emitter).emit.apply($,[b.default.events.EDITOR_CHANGE].concat(F)),M!==b.default.sources.SILENT){var Y;(Y=this.emitter).emit.apply(Y,F)}}return z}function W(L,M,D,B,q){var K={};return typeof L.index=="number"&&typeof L.length=="number"?typeof M!="number"?(q=B,B=D,D=M,M=L.length,L=L.index):(M=L.length,L=L.index):typeof M!="number"&&(q=B,B=D,D=M,M=0),(typeof D>"u"?"undefined":a(D))==="object"?(K=D,q=B):typeof D=="string"&&(B!=null?K[D]=B:q=D),q=q||b.default.sources.API,[L,M,K,q]}function H(L,M,D,B){if(L==null)return null;var q=void 0,K=void 0;if(M instanceof f.default){var z=[L.index,L.index+L.length].map(function(X){return M.transformPosition(X,B!==b.default.sources.USER)}),$=o(z,2);q=$[0],K=$[1]}else{var F=[L.index,L.index+L.length].map(function(X){return X<M||X===M&&B===b.default.sources.USER?X:D>=0?X+D:Math.max(M,X+D)}),Y=o(F,2);q=Y[0],K=Y[1]}return new m.Range(q,K-q)}n.expandConfig=G,n.overload=W,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&p(v.prototype,m),d&&p(v,d),v}}(),o=function p(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:p(w,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(7),u=O(l),f=i(0),h=O(f);function O(p){return p&&p.__esModule?p:{default:p}}function S(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function b(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function _(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var y=function(p){_(v,p);function v(){return S(this,v),b(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"formatAt",value:function(d,g,w,k){if(v.compare(this.statics.blotName,w)<0&&h.default.query(w,h.default.Scope.BLOT)){var P=this.isolate(d,g);k&&P.wrap(w,k)}else o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,d,g,w,k)}},{key:"optimize",value:function(d){if(o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,d),this.parent instanceof v&&v.compare(this.statics.blotName,this.parent.statics.blotName)>0){var g=this.parent.isolate(this.offset(),this.length());this.moveChildren(g),g.wrap(this)}}}],[{key:"compare",value:function(d,g){var w=v.order.indexOf(d),k=v.order.indexOf(g);return w>=0||k>=0?w-k:d===g?0:d<g?-1:1}}]),v}(h.default.Inline);y.allowedChildren=[y,h.default.Embed,u.default],y.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(S){return S&&S.__esModule?S:{default:S}}function u(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function f(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function h(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var O=function(S){h(b,S);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default.Text);n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(d,g){for(var w=0;w<g.length;w++){var k=g[w];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(d,k.key,k)}}return function(d,g,w){return g&&m(d.prototype,g),w&&m(d,w),d}}(),o=function m(d,g,w){d===null&&(d=Function.prototype);var k=Object.getOwnPropertyDescriptor(d,g);if(k===void 0){var P=Object.getPrototypeOf(d);return P===null?void 0:m(P,g,w)}else{if("value"in k)return k.value;var A=k.get;return A===void 0?void 0:A.call(w)}},l=i(54),u=O(l),f=i(10),h=O(f);function O(m){return m&&m.__esModule?m:{default:m}}function S(m,d){if(!(m instanceof d))throw new TypeError("Cannot call a class as a function")}function b(m,d){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:m}function _(m,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);m.prototype=Object.create(d&&d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(m,d):m.__proto__=d)}var y=(0,h.default)("quill:events"),p=["selectionchange","mousedown","mouseup","click"];p.forEach(function(m){document.addEventListener(m,function(){for(var d=arguments.length,g=Array(d),w=0;w<d;w++)g[w]=arguments[w];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(k){if(k.__quill&&k.__quill.emitter){var P;(P=k.__quill.emitter).handleDOM.apply(P,g)}})})});var v=function(m){_(d,m);function d(){S(this,d);var g=b(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return g.listeners={},g.on("error",y.error),g}return a(d,[{key:"emit",value:function(){y.log.apply(y,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(w){for(var k=arguments.length,P=Array(k>1?k-1:0),A=1;A<k;A++)P[A-1]=arguments[A];(this.listeners[w.type]||[]).forEach(function(E){var x=E.node,C=E.handler;(w.target===x||x.contains(w.target))&&C.apply(void 0,[w].concat(P))})}},{key:"listenDOM",value:function(w,k,P){this.listeners[w]||(this.listeners[w]=[]),this.listeners[w].push({node:k,handler:P})}}]),d}(u.default);v.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},v.sources={API:"api",SILENT:"silent",USER:"user"},n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=f};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(f){if(a.indexOf(f)<=a.indexOf(o)){for(var h,O=arguments.length,S=Array(O>1?O-1:0),b=1;b<O;b++)S[b-1]=arguments[b];(h=console)[f].apply(h,S)}}function u(f){return a.reduce(function(h,O){return h[O]=l.bind(console,O,f),h},{})}l.level=u.level=function(f){o=f},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(S,b,_){return _||(_={}),S===b?!0:S instanceof Date&&b instanceof Date?S.getTime()===b.getTime():!S||!b||typeof S!="object"&&typeof b!="object"?_.strict?S===b:S==b:O(S,b,_)};function f(S){return S==null}function h(S){return!(!S||typeof S!="object"||typeof S.length!="number"||typeof S.copy!="function"||typeof S.slice!="function"||S.length>0&&typeof S[0]!="number")}function O(S,b,_){var y,p;if(f(S)||f(b)||S.prototype!==b.prototype)return!1;if(l(S))return l(b)?(S=a.call(S),b=a.call(b),u(S,b,_)):!1;if(h(S)){if(!h(b)||S.length!==b.length)return!1;for(y=0;y<S.length;y++)if(S[y]!==b[y])return!1;return!0}try{var v=o(S),m=o(b)}catch{return!1}if(v.length!=m.length)return!1;for(v.sort(),m.sort(),y=v.length-1;y>=0;y--)if(v[y]!=m[y])return!1;for(y=v.length-1;y>=0;y--)if(p=v[y],!u(S[p],b[p],_))return!1;return typeof S==typeof b}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,h){h===void 0&&(h={}),this.attrName=u,this.keyName=f;var O=a.Scope.TYPE&a.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&a.Scope.LEVEL|O:this.scope=a.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return l.keys=function(u){return[].map.call(u.attributes,function(f){return f.name})},l.prototype.add=function(u,f){return this.canAdd(u,f)?(u.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(u,f){var h=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var f=u.getAttribute(this.keyName);return this.canAdd(u,f)&&f?f:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function A(E,x){var C=[],R=!0,N=!1,U=void 0;try{for(var G=E[Symbol.iterator](),Z;!(R=(Z=G.next()).done)&&(C.push(Z.value),!(x&&C.length===x));R=!0);}catch(W){N=!0,U=W}finally{try{!R&&G.return&&G.return()}finally{if(N)throw U}}return C}return function(E,x){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return A(E,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(E,x){for(var C=0;C<x.length;C++){var R=x[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(E,R.key,R)}}return function(E,x,C){return x&&A(E.prototype,x),C&&A(E,C),E}}(),l=function A(E,x,C){E===null&&(E=Function.prototype);var R=Object.getOwnPropertyDescriptor(E,x);if(R===void 0){var N=Object.getPrototypeOf(E);return N===null?void 0:A(N,x,C)}else{if("value"in R)return R.value;var U=R.get;return U===void 0?void 0:U.call(C)}},u=i(2),f=m(u),h=i(0),O=m(h),S=i(4),b=m(S),_=i(6),y=m(_),p=i(7),v=m(p);function m(A){return A&&A.__esModule?A:{default:A}}function d(A,E){if(!(A instanceof E))throw new TypeError("Cannot call a class as a function")}function g(A,E){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:A}function w(A,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);A.prototype=Object.create(E&&E.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(A,E):A.__proto__=E)}var k=function(A){w(E,A);function E(){return d(this,E),g(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return E}(y.default);k.blotName="code",k.tagName="CODE";var P=function(A){w(E,A);function E(){return d(this,E),g(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return o(E,[{key:"delta",value:function(){var C=this,R=this.domNode.textContent;return R.endsWith(`
|
|
119
|
+
`)&&(R=R.slice(0,-1)),R.split(`
|
|
120
|
+
`).reduce(function(N,U){return N.insert(U).insert(`
|
|
121
|
+
`,C.formats())},new f.default)}},{key:"format",value:function(C,R){if(!(C===this.statics.blotName&&R)){var N=this.descendant(v.default,this.length()-1),U=a(N,1),G=U[0];G!=null&&G.deleteAt(G.length()-1,1),l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"format",this).call(this,C,R)}}},{key:"formatAt",value:function(C,R,N,U){if(R!==0&&!(O.default.query(N,O.default.Scope.BLOCK)==null||N===this.statics.blotName&&U===this.statics.formats(this.domNode))){var G=this.newlineIndex(C);if(!(G<0||G>=C+R)){var Z=this.newlineIndex(C,!0)+1,W=G-Z+1,H=this.isolate(Z,W),L=H.next;H.format(N,U),L instanceof E&&L.formatAt(0,C-Z+R-W,N,U)}}}},{key:"insertAt",value:function(C,R,N){if(N==null){var U=this.descendant(v.default,C),G=a(U,2),Z=G[0],W=G[1];Z.insertAt(W,R)}}},{key:"length",value:function(){var C=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
122
|
+
`)?C:C+1}},{key:"newlineIndex",value:function(C){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R)return this.domNode.textContent.slice(0,C).lastIndexOf(`
|
|
123
|
+
`);var N=this.domNode.textContent.slice(C).indexOf(`
|
|
124
|
+
`);return N>-1?C+N:-1}},{key:"optimize",value:function(C){this.domNode.textContent.endsWith(`
|
|
125
|
+
`)||this.appendChild(O.default.create("text",`
|
|
126
|
+
`)),l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,C);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===R.statics.formats(R.domNode)&&(R.optimize(C),R.moveChildren(this),R.remove())}},{key:"replace",value:function(C){l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"replace",this).call(this,C),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(R){var N=O.default.find(R);N==null?R.parentNode.removeChild(R):N instanceof O.default.Embed?N.remove():N.unwrap()})}}],[{key:"create",value:function(C){var R=l(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,C);return R.setAttribute("spellcheck",!1),R}},{key:"formats",value:function(){return!0}}]),E}(b.default);P.blotName="code-block",P.tagName="PRE",P.TAB=" ",n.Code=k,n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},o=function(){function L(M,D){var B=[],q=!0,K=!1,z=void 0;try{for(var $=M[Symbol.iterator](),F;!(q=(F=$.next()).done)&&(B.push(F.value),!(D&&B.length===D));q=!0);}catch(Y){K=!0,z=Y}finally{try{!q&&$.return&&$.return()}finally{if(K)throw z}}return B}return function(M,D){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return L(M,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function L(M,D){for(var B=0;B<D.length;B++){var q=D[B];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(M,q.key,q)}}return function(M,D,B){return D&&L(M.prototype,D),B&&L(M,B),M}}(),u=i(2),f=R(u),h=i(20),O=R(h),S=i(0),b=R(S),_=i(13),y=R(_),p=i(24),v=R(p),m=i(4),d=R(m),g=i(16),w=R(g),k=i(21),P=R(k),A=i(11),E=R(A),x=i(3),C=R(x);function R(L){return L&&L.__esModule?L:{default:L}}function N(L,M,D){return M in L?Object.defineProperty(L,M,{value:D,enumerable:!0,configurable:!0,writable:!0}):L[M]=D,L}function U(L,M){if(!(L instanceof M))throw new TypeError("Cannot call a class as a function")}var G=/^[ -~]*$/,Z=function(){function L(M){U(this,L),this.scroll=M,this.delta=this.getDelta()}return l(L,[{key:"applyDelta",value:function(D){var B=this,q=!1;this.scroll.update();var K=this.scroll.length();return this.scroll.batchStart(),D=H(D),D.reduce(function(z,$){var F=$.retain||$.delete||$.insert.length||1,Y=$.attributes||{};if($.insert!=null){if(typeof $.insert=="string"){var X=$.insert;X.endsWith(`
|
|
127
|
+
`)&&q&&(q=!1,X=X.slice(0,-1)),z>=K&&!X.endsWith(`
|
|
128
|
+
`)&&(q=!0),B.scroll.insertAt(z,X);var Q=B.scroll.line(z),J=o(Q,2),re=J[0],ie=J[1],ne=(0,C.default)({},(0,m.bubbleFormats)(re));if(re instanceof d.default){var ae=re.descendant(b.default.Leaf,ie),ke=o(ae,1),Ae=ke[0];ne=(0,C.default)(ne,(0,m.bubbleFormats)(Ae))}Y=O.default.attributes.diff(ne,Y)||{}}else if(a($.insert)==="object"){var oe=Object.keys($.insert)[0];if(oe==null)return z;B.scroll.insertAt(z,oe,$.insert[oe])}K+=F}return Object.keys(Y).forEach(function(ce){B.scroll.formatAt(z,F,ce,Y[ce])}),z+F},0),D.reduce(function(z,$){return typeof $.delete=="number"?(B.scroll.deleteAt(z,$.delete),z):z+($.retain||$.insert.length||1)},0),this.scroll.batchEnd(),this.update(D)}},{key:"deleteText",value:function(D,B){return this.scroll.deleteAt(D,B),this.update(new f.default().retain(D).delete(B))}},{key:"formatLine",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(K).forEach(function(z){if(!(q.scroll.whitelist!=null&&!q.scroll.whitelist[z])){var $=q.scroll.lines(D,Math.max(B,1)),F=B;$.forEach(function(Y){var X=Y.length();if(!(Y instanceof y.default))Y.format(z,K[z]);else{var Q=D-Y.offset(q.scroll),J=Y.newlineIndex(Q+F)-Q+1;Y.formatAt(Q,J,z,K[z])}F-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(D).retain(B,(0,P.default)(K)))}},{key:"formatText",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(K).forEach(function(z){q.scroll.formatAt(D,B,z,K[z])}),this.update(new f.default().retain(D).retain(B,(0,P.default)(K)))}},{key:"getContents",value:function(D,B){return this.delta.slice(D,D+B)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(D,B){return D.concat(B.delta())},new f.default)}},{key:"getFormat",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=[],K=[];B===0?this.scroll.path(D).forEach(function($){var F=o($,1),Y=F[0];Y instanceof d.default?q.push(Y):Y instanceof b.default.Leaf&&K.push(Y)}):(q=this.scroll.lines(D,B),K=this.scroll.descendants(b.default.Leaf,D,B));var z=[q,K].map(function($){if($.length===0)return{};for(var F=(0,m.bubbleFormats)($.shift());Object.keys(F).length>0;){var Y=$.shift();if(Y==null)return F;F=W((0,m.bubbleFormats)(Y),F)}return F});return C.default.apply(C.default,z)}},{key:"getText",value:function(D,B){return this.getContents(D,B).filter(function(q){return typeof q.insert=="string"}).map(function(q){return q.insert}).join("")}},{key:"insertEmbed",value:function(D,B,q){return this.scroll.insertAt(D,B,q),this.update(new f.default().retain(D).insert(N({},B,q)))}},{key:"insertText",value:function(D,B){var q=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B=B.replace(/\r\n/g,`
|
|
129
|
+
`).replace(/\r/g,`
|
|
130
|
+
`),this.scroll.insertAt(D,B),Object.keys(K).forEach(function(z){q.scroll.formatAt(D,B.length,z,K[z])}),this.update(new f.default().retain(D).insert(B,(0,P.default)(K)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var D=this.scroll.children.head;return D.statics.blotName!==d.default.blotName||D.children.length>1?!1:D.children.head instanceof w.default}},{key:"removeFormat",value:function(D,B){var q=this.getText(D,B),K=this.scroll.line(D+B),z=o(K,2),$=z[0],F=z[1],Y=0,X=new f.default;$!=null&&($ instanceof y.default?Y=$.newlineIndex(F)-F+1:Y=$.length()-F,X=$.delta().slice(F,F+Y-1).insert(`
|
|
131
|
+
`));var Q=this.getContents(D,B+Y),J=Q.diff(new f.default().insert(q).concat(X)),re=new f.default().retain(D).concat(J);return this.applyDelta(re)}},{key:"update",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,K=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match(G)&&b.default.find(B[0].target)){var z=b.default.find(B[0].target),$=(0,m.bubbleFormats)(z),F=z.offset(this.scroll),Y=B[0].oldValue.replace(v.default.CONTENTS,""),X=new f.default().insert(Y),Q=new f.default().insert(z.value()),J=new f.default().retain(F).concat(X.diff(Q,q));D=J.reduce(function(re,ie){return ie.insert?re.insert(ie.insert,$):re.push(ie)},new f.default),this.delta=K.compose(D)}else this.delta=this.getDelta(),(!D||!(0,E.default)(K.compose(D),this.delta))&&(D=K.diff(this.delta,q));return D}}]),L}();function W(L,M){return Object.keys(M).reduce(function(D,B){return L[B]==null||(M[B]===L[B]?D[B]=M[B]:Array.isArray(M[B])?M[B].indexOf(L[B])<0&&(D[B]=M[B].concat([L[B]])):D[B]=[M[B],L[B]]),D},{})}function H(L){return L.reduce(function(M,D){if(D.insert===1){var B=(0,P.default)(D.attributes);return delete B.image,M.insert({image:D.attributes.image},B)}if(D.attributes!=null&&(D.attributes.list===!0||D.attributes.bullet===!0)&&(D=(0,P.default)(D),D.attributes.list?D.attributes.list="ordered":(D.attributes.list="bullet",delete D.attributes.bullet)),typeof D.insert=="string"){var q=D.insert.replace(/\r\n/g,`
|
|
132
|
+
`).replace(/\r/g,`
|
|
133
|
+
`);return M.insert(q,D.attributes)}return M.push(D)},new f.default)}n.default=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function A(E,x){var C=[],R=!0,N=!1,U=void 0;try{for(var G=E[Symbol.iterator](),Z;!(R=(Z=G.next()).done)&&(C.push(Z.value),!(x&&C.length===x));R=!0);}catch(W){N=!0,U=W}finally{try{!R&&G.return&&G.return()}finally{if(N)throw U}}return C}return function(E,x){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return A(E,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(E,x){for(var C=0;C<x.length;C++){var R=x[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(E,R.key,R)}}return function(E,x,C){return x&&A(E.prototype,x),C&&A(E,C),E}}(),l=i(0),u=v(l),f=i(21),h=v(f),O=i(11),S=v(O),b=i(8),_=v(b),y=i(10),p=v(y);function v(A){return A&&A.__esModule?A:{default:A}}function m(A){if(Array.isArray(A)){for(var E=0,x=Array(A.length);E<A.length;E++)x[E]=A[E];return x}else return Array.from(A)}function d(A,E){if(!(A instanceof E))throw new TypeError("Cannot call a class as a function")}var g=(0,p.default)("quill:selection"),w=function A(E){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,A),this.index=E,this.length=x},k=function(){function A(E,x){var C=this;d(this,A),this.emitter=x,this.scroll=E,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new w(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){C.mouseDown||setTimeout(C.update.bind(C,_.default.sources.USER),1)}),this.emitter.on(_.default.events.EDITOR_CHANGE,function(R,N){R===_.default.events.TEXT_CHANGE&&N.length()>0&&C.update(_.default.sources.SILENT)}),this.emitter.on(_.default.events.SCROLL_BEFORE_UPDATE,function(){if(C.hasFocus()){var R=C.getNativeRange();R!=null&&R.start.node!==C.cursor.textNode&&C.emitter.once(_.default.events.SCROLL_UPDATE,function(){try{C.setNativeRange(R.start.node,R.start.offset,R.end.node,R.end.offset)}catch{}})}}),this.emitter.on(_.default.events.SCROLL_OPTIMIZE,function(R,N){if(N.range){var U=N.range,G=U.startNode,Z=U.startOffset,W=U.endNode,H=U.endOffset;C.setNativeRange(G,Z,W,H)}}),this.update(_.default.sources.SILENT)}return o(A,[{key:"handleComposition",value:function(){var x=this;this.root.addEventListener("compositionstart",function(){x.composing=!0}),this.root.addEventListener("compositionend",function(){if(x.composing=!1,x.cursor.parent){var C=x.cursor.restore();if(!C)return;setTimeout(function(){x.setNativeRange(C.startNode,C.startOffset,C.endNode,C.endOffset)},1)}})}},{key:"handleDragging",value:function(){var x=this;this.emitter.listenDOM("mousedown",document.body,function(){x.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){x.mouseDown=!1,x.update(_.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(x,C){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[x])){this.scroll.update();var R=this.getNativeRange();if(!(R==null||!R.native.collapsed||u.default.query(x,u.default.Scope.BLOCK))){if(R.start.node!==this.cursor.textNode){var N=u.default.find(R.start.node,!1);if(N==null)return;if(N instanceof u.default.Leaf){var U=N.split(R.start.offset);N.parent.insertBefore(this.cursor,U)}else N.insertBefore(this.cursor,R.start.node);this.cursor.attach()}this.cursor.format(x,C),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(x){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=this.scroll.length();x=Math.min(x,R-1),C=Math.min(x+C,R-1)-x;var N=void 0,U=this.scroll.leaf(x),G=a(U,2),Z=G[0],W=G[1];if(Z==null)return null;var H=Z.position(W,!0),L=a(H,2);N=L[0],W=L[1];var M=document.createRange();if(C>0){M.setStart(N,W);var D=this.scroll.leaf(x+C),B=a(D,2);if(Z=B[0],W=B[1],Z==null)return null;var q=Z.position(W,!0),K=a(q,2);return N=K[0],W=K[1],M.setEnd(N,W),M.getBoundingClientRect()}else{var z="left",$=void 0;return N instanceof Text?(W<N.data.length?(M.setStart(N,W),M.setEnd(N,W+1)):(M.setStart(N,W-1),M.setEnd(N,W),z="right"),$=M.getBoundingClientRect()):($=Z.domNode.getBoundingClientRect(),W>0&&(z="right")),{bottom:$.top+$.height,height:$.height,left:$[z],right:$[z],top:$.top,width:0}}}},{key:"getNativeRange",value:function(){var x=document.getSelection();if(x==null||x.rangeCount<=0)return null;var C=x.getRangeAt(0);if(C==null)return null;var R=this.normalizeNative(C);return g.info("getNativeRange",R),R}},{key:"getRange",value:function(){var x=this.getNativeRange();if(x==null)return[null,null];var C=this.normalizedToRange(x);return[C,x]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(x){var C=this,R=[[x.start.node,x.start.offset]];x.native.collapsed||R.push([x.end.node,x.end.offset]);var N=R.map(function(Z){var W=a(Z,2),H=W[0],L=W[1],M=u.default.find(H,!0),D=M.offset(C.scroll);return L===0?D:M instanceof u.default.Container?D+M.length():D+M.index(H,L)}),U=Math.min(Math.max.apply(Math,m(N)),this.scroll.length()-1),G=Math.min.apply(Math,[U].concat(m(N)));return new w(G,U-G)}},{key:"normalizeNative",value:function(x){if(!P(this.root,x.startContainer)||!x.collapsed&&!P(this.root,x.endContainer))return null;var C={start:{node:x.startContainer,offset:x.startOffset},end:{node:x.endContainer,offset:x.endOffset},native:x};return[C.start,C.end].forEach(function(R){for(var N=R.node,U=R.offset;!(N instanceof Text)&&N.childNodes.length>0;)if(N.childNodes.length>U)N=N.childNodes[U],U=0;else if(N.childNodes.length===U)N=N.lastChild,U=N instanceof Text?N.data.length:N.childNodes.length+1;else break;R.node=N,R.offset=U}),C}},{key:"rangeToNative",value:function(x){var C=this,R=x.collapsed?[x.index]:[x.index,x.index+x.length],N=[],U=this.scroll.length();return R.forEach(function(G,Z){G=Math.min(U-1,G);var W=void 0,H=C.scroll.leaf(G),L=a(H,2),M=L[0],D=L[1],B=M.position(D,Z!==0),q=a(B,2);W=q[0],D=q[1],N.push(W,D)}),N.length<2&&(N=N.concat(N)),N}},{key:"scrollIntoView",value:function(x){var C=this.lastRange;if(C!=null){var R=this.getBounds(C.index,C.length);if(R!=null){var N=this.scroll.length()-1,U=this.scroll.line(Math.min(C.index,N)),G=a(U,1),Z=G[0],W=Z;if(C.length>0){var H=this.scroll.line(Math.min(C.index+C.length,N)),L=a(H,1);W=L[0]}if(!(Z==null||W==null)){var M=x.getBoundingClientRect();R.top<M.top?x.scrollTop-=M.top-R.top:R.bottom>M.bottom&&(x.scrollTop+=R.bottom-M.bottom)}}}}},{key:"setNativeRange",value:function(x,C){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x,N=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(g.info("setNativeRange",x,C,R,N),!(x!=null&&(this.root.parentNode==null||x.parentNode==null||R.parentNode==null))){var G=document.getSelection();if(G!=null)if(x!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||U||x!==Z.startContainer||C!==Z.startOffset||R!==Z.endContainer||N!==Z.endOffset){x.tagName=="BR"&&(C=[].indexOf.call(x.parentNode.childNodes,x),x=x.parentNode),R.tagName=="BR"&&(N=[].indexOf.call(R.parentNode.childNodes,R),R=R.parentNode);var W=document.createRange();W.setStart(x,C),W.setEnd(R,N),G.removeAllRanges(),G.addRange(W)}}else G.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(x){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof C=="string"&&(R=C,C=!1),g.info("setRange",x),x!=null){var N=this.rangeToNative(x);this.setNativeRange.apply(this,m(N).concat([C]))}else this.setNativeRange(null);this.update(R)}},{key:"update",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_.default.sources.USER,C=this.lastRange,R=this.getRange(),N=a(R,2),U=N[0],G=N[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,S.default)(C,this.lastRange)){var Z;!this.composing&&G!=null&&G.native.collapsed&&G.start.node!==this.cursor.textNode&&this.cursor.restore();var W=[_.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(C),x];if((Z=this.emitter).emit.apply(Z,[_.default.events.EDITOR_CHANGE].concat(W)),x!==_.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,W)}}}}]),A}();function P(A,E){try{E.parentNode}catch{return!1}return E instanceof Text&&(E=E.parentNode),A.contains(E)}n.Range=w,n.default=k},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function _(y,p){for(var v=0;v<p.length;v++){var m=p[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,p,v){return p&&_(y.prototype,p),v&&_(y,v),y}}(),o=function _(y,p,v){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,p);if(m===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:_(d,p,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(0),u=f(l);function f(_){return _&&_.__esModule?_:{default:_}}function h(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function O(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function S(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var b=function(_){S(y,_);function y(){return h(this,y),O(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"insertInto",value:function(v,m){v.children.length===0?o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertInto",this).call(this,v,m):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),y}(u.default.Embed);b.blotName="break",b.tagName="BR",n.default=b},function(r,n,i){var a=this&&this.__extends||function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,b){S.__proto__=b}||function(S,b){for(var _ in b)b.hasOwnProperty(_)&&(S[_]=b[_])};return function(S,b){O(S,b);function _(){this.constructor=S}S.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(O){a(S,O);function S(b){var _=O.call(this,b)||this;return _.build(),_}return S.prototype.appendChild=function(b){this.insertBefore(b)},S.prototype.attach=function(){O.prototype.attach.call(this),this.children.forEach(function(b){b.attach()})},S.prototype.build=function(){var b=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(_){try{var y=h(_);b.insertBefore(y,b.children.head||void 0)}catch(p){if(p instanceof u.ParchmentError)return;throw p}})},S.prototype.deleteAt=function(b,_){if(b===0&&_===this.length())return this.remove();this.children.forEachAt(b,_,function(y,p,v){y.deleteAt(p,v)})},S.prototype.descendant=function(b,_){var y=this.children.find(_),p=y[0],v=y[1];return b.blotName==null&&b(p)||b.blotName!=null&&p instanceof b?[p,v]:p instanceof S?p.descendant(b,v):[null,-1]},S.prototype.descendants=function(b,_,y){_===void 0&&(_=0),y===void 0&&(y=Number.MAX_VALUE);var p=[],v=y;return this.children.forEachAt(_,y,function(m,d,g){(b.blotName==null&&b(m)||b.blotName!=null&&m instanceof b)&&p.push(m),m instanceof S&&(p=p.concat(m.descendants(b,d,v))),v-=g}),p},S.prototype.detach=function(){this.children.forEach(function(b){b.detach()}),O.prototype.detach.call(this)},S.prototype.formatAt=function(b,_,y,p){this.children.forEachAt(b,_,function(v,m,d){v.formatAt(m,d,y,p)})},S.prototype.insertAt=function(b,_,y){var p=this.children.find(b),v=p[0],m=p[1];if(v)v.insertAt(m,_,y);else{var d=y==null?u.create("text",_):u.create(_,y);this.appendChild(d)}},S.prototype.insertBefore=function(b,_){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(y){return b instanceof y}))throw new u.ParchmentError("Cannot insert "+b.statics.blotName+" into "+this.statics.blotName);b.insertInto(this,_)},S.prototype.length=function(){return this.children.reduce(function(b,_){return b+_.length()},0)},S.prototype.moveChildren=function(b,_){this.children.forEach(function(y){b.insertBefore(y,_)})},S.prototype.optimize=function(b){if(O.prototype.optimize.call(this,b),this.children.length===0)if(this.statics.defaultChild!=null){var _=u.create(this.statics.defaultChild);this.appendChild(_),_.optimize(b)}else this.remove()},S.prototype.path=function(b,_){_===void 0&&(_=!1);var y=this.children.find(b,_),p=y[0],v=y[1],m=[[this,b]];return p instanceof S?m.concat(p.path(v,_)):(p!=null&&m.push([p,v]),m)},S.prototype.removeChild=function(b){this.children.remove(b)},S.prototype.replace=function(b){b instanceof S&&b.moveChildren(this),O.prototype.replace.call(this,b)},S.prototype.split=function(b,_){if(_===void 0&&(_=!1),!_){if(b===0)return this;if(b===this.length())return this.next}var y=this.clone();return this.parent.insertBefore(y,this.next),this.children.forEachAt(b,this.length(),function(p,v,m){p=p.split(v,_),y.appendChild(p)}),y},S.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},S.prototype.update=function(b,_){var y=this,p=[],v=[];b.forEach(function(m){m.target===y.domNode&&m.type==="childList"&&(p.push.apply(p,m.addedNodes),v.push.apply(v,m.removedNodes))}),v.forEach(function(m){if(!(m.parentNode!=null&&m.tagName!=="IFRAME"&&document.body.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(m);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===y.domNode)&&d.detach()}}),p.filter(function(m){return m.parentNode==y.domNode}).sort(function(m,d){return m===d?0:m.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(m){var d=null;m.nextSibling!=null&&(d=u.find(m.nextSibling));var g=h(m);(g.next!=d||g.next==null)&&(g.parent!=null&&g.parent.removeChild(y),y.insertBefore(g,d||void 0))})},S}(l.default);function h(O){var S=u.find(O);if(S==null)try{S=u.create(O)}catch{S=u.create(u.Scope.INLINE),[].slice.call(O.childNodes).forEach(function(_){S.domNode.appendChild(_)}),O.parentNode&&O.parentNode.replaceChild(S.domNode,O),S.attach()}return S}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,b){S.__proto__=b}||function(S,b){for(var _ in b)b.hasOwnProperty(_)&&(S[_]=b[_])};return function(S,b){O(S,b);function _(){this.constructor=S}S.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),h=function(O){a(S,O);function S(b){var _=O.call(this,b)||this;return _.attributes=new l.default(_.domNode),_}return S.formats=function(b){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return b.tagName.toLowerCase()},S.prototype.format=function(b,_){var y=f.query(b);y instanceof o.default?this.attributes.attribute(y,_):_&&y!=null&&(b!==this.statics.blotName||this.formats()[b]!==_)&&this.replaceWith(b,_)},S.prototype.formats=function(){var b=this.attributes.values(),_=this.statics.formats(this.domNode);return _!=null&&(b[this.statics.blotName]=_),b},S.prototype.replaceWith=function(b,_){var y=O.prototype.replaceWith.call(this,b,_);return this.attributes.copy(y),y},S.prototype.update=function(b,_){var y=this;O.prototype.update.call(this,b,_),b.some(function(p){return p.target===y.domNode&&p.type==="attributes"})&&this.attributes.build()},S.prototype.wrap=function(b,_){var y=O.prototype.wrap.call(this,b,_);return y instanceof S&&y.statics.scope===this.statics.scope&&this.attributes.move(y),y},S}(u.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var S in O)O.hasOwnProperty(S)&&(h[S]=O[S])};return function(h,O){f(h,O);function S(){this.constructor=h}h.prototype=O===null?Object.create(O):(S.prototype=O.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.value=function(O){return!0},h.prototype.index=function(O,S){return this.domNode===O||this.domNode.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(S,1):-1},h.prototype.position=function(O,S){var b=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return O>0&&(b+=1),[this.parent.domNode,b]},h.prototype.value=function(){var O;return O={},O[this.statics.blotName]=this.statics.value(this.domNode)||!0,O},h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,h,O){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var S=o(!0,{},h);O||(S=Object.keys(S).reduce(function(_,y){return S[y]!=null&&(_[y]=S[y]),_},{}));for(var b in f)f[b]!==void 0&&h[b]===void 0&&(S[b]=f[b]);return Object.keys(S).length>0?S:void 0},diff:function(f,h){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var O=Object.keys(f).concat(Object.keys(h)).reduce(function(S,b){return a(f[b],h[b])||(S[b]=h[b]===void 0?null:h[b]),S},{});return Object.keys(O).length>0?O:void 0},transform:function(f,h,O){if(typeof f!="object")return h;if(typeof h=="object"){if(!O)return h;var S=Object.keys(h).reduce(function(b,_){return f[_]===void 0&&(b[_]=h[_]),b},{});return Object.keys(S).length>0?S:void 0}}},iterator:function(f){return new u(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function u(f){this.ops=f,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(f){f||(f=1/0);var h=this.ops[this.index];if(h){var O=this.offset,S=l.length(h);if(f>=S-O?(f=S-O,this.index+=1,this.offset=0):this.offset+=f,typeof h.delete=="number")return{delete:f};var b={};return h.attributes&&(b.attributes=h.attributes),typeof h.retain=="number"?b.retain=f:typeof h.insert=="string"?b.insert=h.insert.substr(O,f):b.insert=h.insert,b}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,h=this.index,O=this.next(),S=this.ops.slice(this.index);return this.offset=f,this.index=h,[O].concat(S)}else return[]},r.exports=l},function(r,n){var i=function(){function a(y,p){return p!=null&&y instanceof p}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function f(y,p,v,m,d){typeof p=="object"&&(v=p.depth,m=p.prototype,d=p.includeNonEnumerable,p=p.circular);var g=[],w=[],k=typeof Buffer<"u";typeof p>"u"&&(p=!0),typeof v>"u"&&(v=1/0);function P(A,E){if(A===null)return null;if(E===0)return A;var x,C;if(typeof A!="object")return A;if(a(A,o))x=new o;else if(a(A,l))x=new l;else if(a(A,u))x=new u(function(M,D){A.then(function(B){M(P(B,E-1))},function(B){D(P(B,E-1))})});else if(f.__isArray(A))x=[];else if(f.__isRegExp(A))x=new RegExp(A.source,_(A)),A.lastIndex&&(x.lastIndex=A.lastIndex);else if(f.__isDate(A))x=new Date(A.getTime());else{if(k&&Buffer.isBuffer(A))return Buffer.allocUnsafe?x=Buffer.allocUnsafe(A.length):x=new Buffer(A.length),A.copy(x),x;a(A,Error)?x=Object.create(A):typeof m>"u"?(C=Object.getPrototypeOf(A),x=Object.create(C)):(x=Object.create(m),C=m)}if(p){var R=g.indexOf(A);if(R!=-1)return w[R];g.push(A),w.push(x)}a(A,o)&&A.forEach(function(M,D){var B=P(D,E-1),q=P(M,E-1);x.set(B,q)}),a(A,l)&&A.forEach(function(M){var D=P(M,E-1);x.add(D)});for(var N in A){var U;C&&(U=Object.getOwnPropertyDescriptor(C,N)),!(U&&U.set==null)&&(x[N]=P(A[N],E-1))}if(Object.getOwnPropertySymbols)for(var G=Object.getOwnPropertySymbols(A),N=0;N<G.length;N++){var Z=G[N],W=Object.getOwnPropertyDescriptor(A,Z);W&&!W.enumerable&&!d||(x[Z]=P(A[Z],E-1),W.enumerable||Object.defineProperty(x,Z,{enumerable:!1}))}if(d)for(var H=Object.getOwnPropertyNames(A),N=0;N<H.length;N++){var L=H[N],W=Object.getOwnPropertyDescriptor(A,L);W&&W.enumerable||(x[L]=P(A[L],E-1),Object.defineProperty(x,L,{enumerable:!1}))}return x}return P(y,v)}f.clonePrototype=function(p){if(p===null)return null;var v=function(){};return v.prototype=p,new v};function h(y){return Object.prototype.toString.call(y)}f.__objToStr=h;function O(y){return typeof y=="object"&&h(y)==="[object Date]"}f.__isDate=O;function S(y){return typeof y=="object"&&h(y)==="[object Array]"}f.__isArray=S;function b(y){return typeof y=="object"&&h(y)==="[object RegExp]"}f.__isRegExp=b;function _(y){var p="";return y.global&&(p+="g"),y.ignoreCase&&(p+="i"),y.multiline&&(p+="m"),p}return f.__getRegExpFlags=_,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(C,R){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=C[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(R&&N.length===R));U=!0);}catch(L){G=!0,Z=L}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(C,R){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return x(C,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(C,R){for(var N=0;N<R.length;N++){var U=R[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(C,U.key,U)}}return function(C,R,N){return R&&x(C.prototype,R),N&&x(C,N),C}}(),l=function x(C,R,N){C===null&&(C=Function.prototype);var U=Object.getOwnPropertyDescriptor(C,R);if(U===void 0){var G=Object.getPrototypeOf(C);return G===null?void 0:x(G,R,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},u=i(0),f=g(u),h=i(8),O=g(h),S=i(4),b=g(S),_=i(16),y=g(_),p=i(13),v=g(p),m=i(25),d=g(m);function g(x){return x&&x.__esModule?x:{default:x}}function w(x,C){if(!(x instanceof C))throw new TypeError("Cannot call a class as a function")}function k(x,C){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:x}function P(x,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);x.prototype=Object.create(C&&C.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(x,C):x.__proto__=C)}function A(x){return x instanceof b.default||x instanceof S.BlockEmbed}var E=function(x){P(C,x);function C(R,N){w(this,C);var U=k(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R));return U.emitter=N.emitter,Array.isArray(N.whitelist)&&(U.whitelist=N.whitelist.reduce(function(G,Z){return G[Z]=!0,G},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return o(C,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(N,U){var G=this.line(N),Z=a(G,2),W=Z[0],H=Z[1],L=this.line(N+U),M=a(L,1),D=M[0];if(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,N,U),D!=null&&W!==D&&H>0){if(W instanceof S.BlockEmbed||D instanceof S.BlockEmbed){this.optimize();return}if(W instanceof v.default){var B=W.newlineIndex(W.length(),!0);if(B>-1&&(W=W.split(B+1),W===D)){this.optimize();return}}else if(D instanceof v.default){var q=D.newlineIndex(0);q>-1&&D.split(q+1)}var K=D.children.head instanceof y.default?null:D.children.head;W.moveChildren(D,K),W.remove()}this.optimize()}},{key:"enable",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",N)}},{key:"formatAt",value:function(N,U,G,Z){this.whitelist!=null&&!this.whitelist[G]||(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,N,U,G,Z),this.optimize())}},{key:"insertAt",value:function(N,U,G){if(!(G!=null&&this.whitelist!=null&&!this.whitelist[U])){if(N>=this.length())if(G==null||f.default.query(U,f.default.Scope.BLOCK)==null){var Z=f.default.create(this.statics.defaultChild);this.appendChild(Z),G==null&&U.endsWith(`
|
|
134
|
+
`)&&(U=U.slice(0,-1)),Z.insertAt(0,U,G)}else{var W=f.default.create(U,G);this.appendChild(W)}else l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,N,U,G);this.optimize()}}},{key:"insertBefore",value:function(N,U){if(N.statics.scope===f.default.Scope.INLINE_BLOT){var G=f.default.create(this.statics.defaultChild);G.appendChild(N),N=G}l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,N,U)}},{key:"leaf",value:function(N){return this.path(N).pop()||[null,-1]}},{key:"line",value:function(N){return N===this.length()?this.line(N-1):this.descendant(A,N)}},{key:"lines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,G=function Z(W,H,L){var M=[],D=L;return W.children.forEachAt(H,L,function(B,q,K){A(B)?M.push(B):B instanceof f.default.Container&&(M=M.concat(Z(B,q,D))),D-=K}),M};return G(this,N,U)}},{key:"optimize",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,N,U),N.length>0&&this.emitter.emit(O.default.events.SCROLL_OPTIMIZE,N,U))}},{key:"path",value:function(N){return l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,N).slice(1)}},{key:"update",value:function(N){if(this.batch!==!0){var U=O.default.sources.USER;typeof N=="string"&&(U=N),Array.isArray(N)||(N=this.observer.takeRecords()),N.length>0&&this.emitter.emit(O.default.events.SCROLL_BEFORE_UPDATE,U,N),l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"update",this).call(this,N.concat([])),N.length>0&&this.emitter.emit(O.default.events.SCROLL_UPDATE,U,N)}}}]),C}(f.default.Scroll);E.blotName="scroll",E.className="ql-editor",E.tagName="DIV",E.defaultChild="block",E.allowedChildren=[b.default,S.BlockEmbed,d.default],n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},o=function(){function $(F,Y){var X=[],Q=!0,J=!1,re=void 0;try{for(var ie=F[Symbol.iterator](),ne;!(Q=(ne=ie.next()).done)&&(X.push(ne.value),!(Y&&X.length===Y));Q=!0);}catch(ae){J=!0,re=ae}finally{try{!Q&&ie.return&&ie.return()}finally{if(J)throw re}}return X}return function(F,Y){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return $(F,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function $(F,Y){for(var X=0;X<Y.length;X++){var Q=Y[X];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(F,Q.key,Q)}}return function(F,Y,X){return Y&&$(F.prototype,Y),X&&$(F,X),F}}(),u=i(21),f=x(u),h=i(11),O=x(h),S=i(3),b=x(S),_=i(2),y=x(_),p=i(20),v=x(p),m=i(0),d=x(m),g=i(5),w=x(g),k=i(10),P=x(k),A=i(9),E=x(A);function x($){return $&&$.__esModule?$:{default:$}}function C($,F,Y){return F in $?Object.defineProperty($,F,{value:Y,enumerable:!0,configurable:!0,writable:!0}):$[F]=Y,$}function R($,F){if(!($ instanceof F))throw new TypeError("Cannot call a class as a function")}function N($,F){if(!$)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:$}function U($,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);$.prototype=Object.create(F&&F.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf($,F):$.__proto__=F)}var G=(0,P.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",W=function($){U(F,$),l(F,null,[{key:"match",value:function(X,Q){return Q=z(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(J){return!!Q[J]!==X[J]&&Q[J]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function F(Y,X){R(this,F);var Q=N(this,(F.__proto__||Object.getPrototypeOf(F)).call(this,Y,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(J){J==="list autofill"&&Y.scroll.whitelist!=null&&!Y.scroll.whitelist.list||Q.options.bindings[J]&&Q.addBinding(Q.options.bindings[J])}),Q.addBinding({key:F.keys.ENTER,shiftKey:null},B),Q.addBinding({key:F.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:F.keys.BACKSPACE},{collapsed:!0},L),Q.addBinding({key:F.keys.DELETE},{collapsed:!0},M)):(Q.addBinding({key:F.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},L),Q.addBinding({key:F.keys.DELETE},{collapsed:!0,suffix:/^.?$/},M)),Q.addBinding({key:F.keys.BACKSPACE},{collapsed:!1},D),Q.addBinding({key:F.keys.DELETE},{collapsed:!1},D),Q.addBinding({key:F.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},L),Q.listen(),Q}return l(F,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},re=z(X);if(re==null||re.key==null)return G.warn("Attempted to add invalid keyboard binding",re);typeof Q=="function"&&(Q={handler:Q}),typeof J=="function"&&(J={handler:J}),re=(0,b.default)(re,Q,J),this.bindings[re.key]=this.bindings[re.key]||[],this.bindings[re.key].push(re)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Q){if(!Q.defaultPrevented){var J=Q.which||Q.keyCode,re=(X.bindings[J]||[]).filter(function(Oe){return F.match(Q,Oe)});if(re.length!==0){var ie=X.quill.getSelection();if(!(ie==null||!X.quill.hasFocus())){var ne=X.quill.getLine(ie.index),ae=o(ne,2),ke=ae[0],Ae=ae[1],oe=X.quill.getLeaf(ie.index),ce=o(oe,2),_e=ce[0],ye=ce[1],te=ie.length===0?[_e,ye]:X.quill.getLeaf(ie.index+ie.length),le=o(te,2),me=le[0],Ee=le[1],We=_e instanceof d.default.Text?_e.value().slice(0,ye):"",Qe=me instanceof d.default.Text?me.value().slice(Ee):"",Re={collapsed:ie.length===0,empty:ie.length===0&&ke.length()<=1,format:X.quill.getFormat(ie),offset:Ae,prefix:We,suffix:Qe},Pe=re.some(function(Oe){if(Oe.collapsed!=null&&Oe.collapsed!==Re.collapsed||Oe.empty!=null&&Oe.empty!==Re.empty||Oe.offset!=null&&Oe.offset!==Re.offset)return!1;if(Array.isArray(Oe.format)){if(Oe.format.every(function(Ne){return Re.format[Ne]==null}))return!1}else if(a(Oe.format)==="object"&&!Object.keys(Oe.format).every(function(Ne){return Oe.format[Ne]===!0?Re.format[Ne]!=null:Oe.format[Ne]===!1?Re.format[Ne]==null:(0,O.default)(Oe.format[Ne],Re.format[Ne])}))return!1;return Oe.prefix!=null&&!Oe.prefix.test(Re.prefix)||Oe.suffix!=null&&!Oe.suffix.test(Re.suffix)?!1:Oe.handler.call(X,ie,Re)!==!0});Pe&&Q.preventDefault()}}}})}}]),F}(E.default);W.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},W.DEFAULTS={bindings:{bold:K("bold"),italic:K("italic"),underline:K("underline"),indent:{key:W.keys.TAB,format:["blockquote","indent","list"],handler:function(F,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","+1",w.default.sources.USER)}},outdent:{key:W.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(F,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","-1",w.default.sources.USER)}},"outdent backspace":{key:W.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(F,Y){Y.format.indent!=null?this.quill.format("indent","-1",w.default.sources.USER):Y.format.list!=null&&this.quill.format("list",!1,w.default.sources.USER)}},"indent code-block":q(!0),"outdent code-block":q(!1),"remove tab":{key:W.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(F){this.quill.deleteText(F.index-1,1,w.default.sources.USER)}},tab:{key:W.keys.TAB,handler:function(F){this.quill.history.cutoff();var Y=new y.default().retain(F.index).delete(F.length).insert(" ");this.quill.updateContents(Y,w.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index+1,w.default.sources.SILENT)}},"list empty enter":{key:W.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(F,Y){this.quill.format("list",!1,w.default.sources.USER),Y.format.indent&&this.quill.format("indent",!1,w.default.sources.USER)}},"checklist enter":{key:W.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(F){var Y=this.quill.getLine(F.index),X=o(Y,2),Q=X[0],J=X[1],re=(0,b.default)({},Q.formats(),{list:"checked"}),ie=new y.default().retain(F.index).insert(`
|
|
135
|
+
`,re).retain(Q.length()-J-1).retain(1,{list:"unchecked"});this.quill.updateContents(ie,w.default.sources.USER),this.quill.setSelection(F.index+1,w.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:W.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(F,Y){var X=this.quill.getLine(F.index),Q=o(X,2),J=Q[0],re=Q[1],ie=new y.default().retain(F.index).insert(`
|
|
136
|
+
`,Y.format).retain(J.length()-re-1).retain(1,{header:null});this.quill.updateContents(ie,w.default.sources.USER),this.quill.setSelection(F.index+1,w.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(F,Y){var X=Y.prefix.length,Q=this.quill.getLine(F.index),J=o(Q,2),re=J[0],ie=J[1];if(ie>X)return!0;var ne=void 0;switch(Y.prefix.trim()){case"[]":case"[ ]":ne="unchecked";break;case"[x]":ne="checked";break;case"-":case"*":ne="bullet";break;default:ne="ordered"}this.quill.insertText(F.index," ",w.default.sources.USER),this.quill.history.cutoff();var ae=new y.default().retain(F.index-ie).delete(X+1).retain(re.length()-2-ie).retain(1,{list:ne});this.quill.updateContents(ae,w.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(F.index-X,w.default.sources.SILENT)}},"code exit":{key:W.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(F){var Y=this.quill.getLine(F.index),X=o(Y,2),Q=X[0],J=X[1],re=new y.default().retain(F.index+Q.length()-J-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(re,w.default.sources.USER)}},"embed left":H(W.keys.LEFT,!1),"embed left shift":H(W.keys.LEFT,!0),"embed right":H(W.keys.RIGHT,!1),"embed right shift":H(W.keys.RIGHT,!0)}};function H($,F){var Y,X=$===W.keys.LEFT?"prefix":"suffix";return Y={key:$,shiftKey:F,altKey:null},C(Y,X,/^$/),C(Y,"handler",function(J){var re=J.index;$===W.keys.RIGHT&&(re+=J.length+1);var ie=this.quill.getLeaf(re),ne=o(ie,1),ae=ne[0];return ae instanceof d.default.Embed?($===W.keys.LEFT?F?this.quill.setSelection(J.index-1,J.length+1,w.default.sources.USER):this.quill.setSelection(J.index-1,w.default.sources.USER):F?this.quill.setSelection(J.index,J.length+1,w.default.sources.USER):this.quill.setSelection(J.index+J.length+1,w.default.sources.USER),!1):!0}),Y}function L($,F){if(!($.index===0||this.quill.getLength()<=1)){var Y=this.quill.getLine($.index),X=o(Y,1),Q=X[0],J={};if(F.offset===0){var re=this.quill.getLine($.index-1),ie=o(re,1),ne=ie[0];if(ne!=null&&ne.length()>1){var ae=Q.formats(),ke=this.quill.getFormat($.index-1,1);J=v.default.attributes.diff(ae,ke)||{}}}var Ae=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(F.prefix)?2:1;this.quill.deleteText($.index-Ae,Ae,w.default.sources.USER),Object.keys(J).length>0&&this.quill.formatLine($.index-Ae,Ae,J,w.default.sources.USER),this.quill.focus()}}function M($,F){var Y=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(F.suffix)?2:1;if(!($.index>=this.quill.getLength()-Y)){var X={},Q=0,J=this.quill.getLine($.index),re=o(J,1),ie=re[0];if(F.offset>=ie.length()-1){var ne=this.quill.getLine($.index+1),ae=o(ne,1),ke=ae[0];if(ke){var Ae=ie.formats(),oe=this.quill.getFormat($.index,1);X=v.default.attributes.diff(Ae,oe)||{},Q=ke.length()}}this.quill.deleteText($.index,Y,w.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine($.index+Q-1,Y,X,w.default.sources.USER)}}function D($){var F=this.quill.getLines($),Y={};if(F.length>1){var X=F[0].formats(),Q=F[F.length-1].formats();Y=v.default.attributes.diff(Q,X)||{}}this.quill.deleteText($,w.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine($.index,1,Y,w.default.sources.USER),this.quill.setSelection($.index,w.default.sources.SILENT),this.quill.focus()}function B($,F){var Y=this;$.length>0&&this.quill.scroll.deleteAt($.index,$.length);var X=Object.keys(F.format).reduce(function(Q,J){return d.default.query(J,d.default.Scope.BLOCK)&&!Array.isArray(F.format[J])&&(Q[J]=F.format[J]),Q},{});this.quill.insertText($.index,`
|
|
137
|
+
`,X,w.default.sources.USER),this.quill.setSelection($.index+1,w.default.sources.SILENT),this.quill.focus(),Object.keys(F.format).forEach(function(Q){X[Q]==null&&(Array.isArray(F.format[Q])||Q!=="link"&&Y.quill.format(Q,F.format[Q],w.default.sources.USER))})}function q($){return{key:W.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(Y){var X=d.default.query("code-block"),Q=Y.index,J=Y.length,re=this.quill.scroll.descendant(X,Q),ie=o(re,2),ne=ie[0],ae=ie[1];if(ne!=null){var ke=this.quill.getIndex(ne),Ae=ne.newlineIndex(ae,!0)+1,oe=ne.newlineIndex(ke+ae+J),ce=ne.domNode.textContent.slice(Ae,oe).split(`
|
|
138
|
+
`);ae=0,ce.forEach(function(_e,ye){$?(ne.insertAt(Ae+ae,X.TAB),ae+=X.TAB.length,ye===0?Q+=X.TAB.length:J+=X.TAB.length):_e.startsWith(X.TAB)&&(ne.deleteAt(Ae+ae,X.TAB.length),ae-=X.TAB.length,ye===0?Q-=X.TAB.length:J-=X.TAB.length),ae+=_e.length+1}),this.quill.update(w.default.sources.USER),this.quill.setSelection(Q,J,w.default.sources.SILENT)}}}}function K($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(Y,X){this.quill.format($,!X.format[$],w.default.sources.USER)}}}function z($){if(typeof $=="string"||typeof $=="number")return z({key:$});if((typeof $>"u"?"undefined":a($))==="object"&&($=(0,f.default)($,!1)),typeof $.key=="string")if(W.keys[$.key.toUpperCase()]!=null)$.key=W.keys[$.key.toUpperCase()];else if($.key.length===1)$.key=$.key.toUpperCase().charCodeAt(0);else return null;return $.shortKey&&($[Z]=$.shortKey,delete $.shortKey),$}n.default=W,n.SHORTKEY=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(m,d){var g=[],w=!0,k=!1,P=void 0;try{for(var A=m[Symbol.iterator](),E;!(w=(E=A.next()).done)&&(g.push(E.value),!(d&&g.length===d));w=!0);}catch(x){k=!0,P=x}finally{try{!w&&A.return&&A.return()}finally{if(k)throw P}}return g}return function(m,d){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return v(m,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function v(m,d,g){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,d);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:v(k,d,g)}else{if("value"in w)return w.value;var P=w.get;return P===void 0?void 0:P.call(g)}},l=function(){function v(m,d){for(var g=0;g<d.length;g++){var w=d[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,d,g){return d&&v(m.prototype,d),g&&v(m,g),m}}(),u=i(0),f=S(u),h=i(7),O=S(h);function S(v){return v&&v.__esModule?v:{default:v}}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function y(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p=function(v){y(m,v),l(m,null,[{key:"value",value:function(){}}]);function m(d,g){b(this,m);var w=_(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,d));return w.selection=g,w.textNode=document.createTextNode(m.CONTENTS),w.domNode.appendChild(w.textNode),w._length=0,w}return l(m,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(g,w){if(this._length!==0)return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,g,w);for(var k=this,P=0;k!=null&&k.statics.scope!==f.default.Scope.BLOCK_BLOT;)P+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=m.CONTENTS.length,k.optimize(),k.formatAt(P,m.CONTENTS.length,g,w),this._length=0)}},{key:"index",value:function(g,w){return g===this.textNode?0:o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,g,w)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var g=this.textNode,w=this.selection.getNativeRange(),k=void 0,P=void 0,A=void 0;if(w!=null&&w.start.node===g&&w.end.node===g){var E=[g,w.start.offset,w.end.offset];k=E[0],P=E[1],A=E[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==m.CONTENTS){var x=this.textNode.data.split(m.CONTENTS).join("");this.next instanceof O.default?(k=this.next.domNode,this.next.insertAt(0,x),this.textNode.data=m.CONTENTS):(this.textNode.data=x,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(m.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),P!=null){var C=[P,A].map(function(N){return Math.max(0,Math.min(k.data.length,N-1))}),R=a(C,2);return P=R[0],A=R[1],{startNode:k,startOffset:P,endNode:k,endOffset:A}}}}},{key:"update",value:function(g,w){var k=this;if(g.some(function(A){return A.type==="characterData"&&A.target===k.textNode})){var P=this.restore();P&&(w.range=P)}}},{key:"value",value:function(){return""}}]),m}(f.default.Embed);p.blotName="cursor",p.className="ql-cursor",p.tagName="span",p.CONTENTS="\uFEFF",n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=f(a),l=i(4),u=f(l);function f(_){return _&&_.__esModule?_:{default:_}}function h(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function O(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function S(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var b=function(_){S(y,_);function y(){return h(this,y),O(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return y}(o.default.Container);b.allowedChildren=[u.default,l.BlockEmbed,b],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function p(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&p(v.prototype,m),d&&p(v,d),v}}(),o=function p(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:p(w,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=f(l);function f(p){return p&&p.__esModule?p:{default:p}}function h(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function O(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function S(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var b=function(p){S(v,p);function v(){return h(this,v),O(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"value",value:function(d){var g=o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,d);return g.startsWith("rgb(")?(g=g.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+g.split(",").map(function(w){return("00"+parseInt(w).toString(16)).slice(-2)}).join("")):g}}]),v}(u.default.Attributor.Style),_=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),y=new b("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=b,n.ColorClass=_,n.ColorStyle=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function y(p,v){for(var m=0;m<v.length;m++){var d=v[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}return function(p,v,m){return v&&y(p.prototype,v),m&&y(p,m),p}}(),o=function y(p,v,m){p===null&&(p=Function.prototype);var d=Object.getOwnPropertyDescriptor(p,v);if(d===void 0){var g=Object.getPrototypeOf(p);return g===null?void 0:y(g,v,m)}else{if("value"in d)return d.value;var w=d.get;return w===void 0?void 0:w.call(m)}},l=i(6),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function h(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function O(y,p){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:y}function S(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(y,p):y.__proto__=p)}var b=function(y){S(p,y);function p(){return h(this,p),O(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"format",value:function(m,d){if(m!==this.statics.blotName||!d)return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,m,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(m){var d=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,m);return m=this.sanitize(m),d.setAttribute("href",m),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(m){return m.getAttribute("href")}},{key:"sanitize",value:function(m){return _(m,this.PROTOCOL_WHITELIST)?m:this.SANITIZED_URL}}]),p}(u.default);b.blotName="link",b.tagName="A",b.SANITIZED_URL="about:blank",b.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function _(y,p){var v=document.createElement("a");v.href=y;var m=v.href.slice(0,v.href.indexOf(":"));return p.indexOf(m)>-1}n.default=b,n.sanitize=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o=function(){function p(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&p(v.prototype,m),d&&p(v,d),v}}(),l=i(23),u=O(l),f=i(107),h=O(f);function O(p){return p&&p.__esModule?p:{default:p}}function S(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}var b=0;function _(p,v){p.setAttribute(v,p.getAttribute(v)!=="true")}var y=function(){function p(v){var m=this;S(this,p),this.select=v,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){m.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:m.togglePicker();break;case u.default.keys.ESCAPE:m.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(p,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),_(this.label,"aria-expanded"),_(this.options,"aria-hidden")}},{key:"buildItem",value:function(m){var d=this,g=document.createElement("span");return g.tabIndex="0",g.setAttribute("role","button"),g.classList.add("ql-picker-item"),m.hasAttribute("value")&&g.setAttribute("data-value",m.getAttribute("value")),m.textContent&&g.setAttribute("data-label",m.textContent),g.addEventListener("click",function(){d.selectItem(g,!0)}),g.addEventListener("keydown",function(w){switch(w.keyCode){case u.default.keys.ENTER:d.selectItem(g,!0),w.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),w.preventDefault();break}}),g}},{key:"buildLabel",value:function(){var m=document.createElement("span");return m.classList.add("ql-picker-label"),m.innerHTML=h.default,m.tabIndex="0",m.setAttribute("role","button"),m.setAttribute("aria-expanded","false"),this.container.appendChild(m),m}},{key:"buildOptions",value:function(){var m=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+b,b+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(g){var w=m.buildItem(g);d.appendChild(w),g.selected===!0&&m.selectItem(w)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var m=this;[].slice.call(this.select.attributes).forEach(function(d){m.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var m=this;this.close(),setTimeout(function(){return m.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(m){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.container.querySelector(".ql-selected");if(m!==g&&(g!=null&&g.classList.remove("ql-selected"),m!=null&&(m.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(m.parentNode.children,m),m.hasAttribute("data-value")?this.label.setAttribute("data-value",m.getAttribute("data-value")):this.label.removeAttribute("data-value"),m.hasAttribute("data-label")?this.label.setAttribute("data-label",m.getAttribute("data-label")):this.label.removeAttribute("data-label"),d))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var w=document.createEvent("Event");w.initEvent("change",!0,!0),this.select.dispatchEvent(w)}this.close()}}},{key:"update",value:function(){var m=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];m=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var g=m!=null&&m!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",g)}}]),p}();n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=G(a),l=i(5),u=G(l),f=i(4),h=G(f),O=i(16),S=G(O),b=i(25),_=G(b),y=i(24),p=G(y),v=i(35),m=G(v),d=i(6),g=G(d),w=i(22),k=G(w),P=i(7),A=G(P),E=i(55),x=G(E),C=i(42),R=G(C),N=i(23),U=G(N);function G(Z){return Z&&Z.__esModule?Z:{default:Z}}u.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":S.default,"blots/container":_.default,"blots/cursor":p.default,"blots/embed":m.default,"blots/inline":g.default,"blots/scroll":k.default,"blots/text":A.default,"modules/clipboard":x.default,"modules/history":R.default,"modules/keyboard":U.default}),o.default.register(h.default,S.default,p.default,g.default,k.default,A.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?f=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?f=document.createElement(u):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(u,f){var h=this.isolate(u,f);h.remove()},l.prototype.formatAt=function(u,f,h,O){var S=this.isolate(u,f);if(a.query(h,a.Scope.BLOT)!=null&&O)S.wrap(h,O);else if(a.query(h,a.Scope.ATTRIBUTE)!=null){var b=a.create(this.statics.scope);S.wrap(b),b.format(h,O)}},l.prototype.insertAt=function(u,f,h){var O=h==null?a.create("text",f):a.create(f,h),S=this.split(u);this.parent.insertBefore(O,S)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;u.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=h)&&u.domNode.insertBefore(this.domNode,h),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var h=this.split(u);return h.split(f),h},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,f){var h=typeof u=="string"?a.create(u,f):u;return h.replace(this),h},l.prototype.split=function(u,f){return u===0?this:this.next},l.prototype.update=function(u,f){},l.prototype.wrap=function(u,f){var h=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),l=i(33),u=i(1),f=function(){function h(O){this.attributes={},this.domNode=O,this.build()}return h.prototype.attribute=function(O,S){S?O.add(this.domNode,S)&&(O.value(this.domNode)!=null?this.attributes[O.attrName]=O:delete this.attributes[O.attrName]):(O.remove(this.domNode),delete this.attributes[O.attrName])},h.prototype.build=function(){var O=this;this.attributes={};var S=a.default.keys(this.domNode),b=o.default.keys(this.domNode),_=l.default.keys(this.domNode);S.concat(b).concat(_).forEach(function(y){var p=u.query(y,u.Scope.ATTRIBUTE);p instanceof a.default&&(O.attributes[p.attrName]=p)})},h.prototype.copy=function(O){var S=this;Object.keys(this.attributes).forEach(function(b){var _=S.attributes[b].value(S.domNode);O.format(b,_)})},h.prototype.move=function(O){var S=this;this.copy(O),Object.keys(this.attributes).forEach(function(b){S.attributes[b].remove(S.domNode)}),this.attributes={}},h.prototype.values=function(){var O=this;return Object.keys(this.attributes).reduce(function(S,b){return S[b]=O.attributes[b].value(O.domNode),S},{})},h}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var S in O)O.hasOwnProperty(S)&&(h[S]=O[S])};return function(h,O){f(h,O);function S(){this.constructor=h}h.prototype=O===null?Object.create(O):(S.prototype=O.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,h){var O=f.getAttribute("class")||"";return O.split(/\s+/).filter(function(S){return S.indexOf(h+"-")===0})}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(O){return(O.getAttribute("class")||"").split(/\s+/).map(function(S){return S.split("-").slice(0,-1).join("-")})},h.prototype.add=function(O,S){return this.canAdd(O,S)?(this.remove(O),O.classList.add(this.keyName+"-"+S),!0):!1},h.prototype.remove=function(O){var S=l(O,this.keyName);S.forEach(function(b){O.classList.remove(b)}),O.classList.length===0&&O.removeAttribute("class")},h.prototype.value=function(O){var S=l(O,this.keyName)[0]||"",b=S.slice(this.keyName.length+1);return this.canAdd(O,b)?b:""},h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var S in O)O.hasOwnProperty(S)&&(h[S]=O[S])};return function(h,O){f(h,O);function S(){this.constructor=h}h.prototype=O===null?Object.create(O):(S.prototype=O.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var h=f.split("-"),O=h.slice(1).map(function(S){return S[0].toUpperCase()+S.slice(1)}).join("");return h[0]+O}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(O){return(O.getAttribute("style")||"").split(";").map(function(S){var b=S.split(":");return b[0].trim()})},h.prototype.add=function(O,S){return this.canAdd(O,S)?(O.style[l(this.keyName)]=S,!0):!1},h.prototype.remove=function(O){O.style[l(this.keyName)]="",O.getAttribute("style")||O.removeAttribute("style")},h.prototype.value=function(O){var S=O.style[l(this.keyName)];return this.canAdd(O,S)?S:""},h}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var O=0;O<h.length;O++){var S=h[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(f,S.key,S)}}return function(f,h,O){return h&&u(f.prototype,h),O&&u(f,O),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,h){o(this,u),this.quill=f,this.options=h,this.modules={}}return a(u,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(O){h.modules[O]==null&&h.addModule(O)})}},{key:"addModule",value:function(h){var O=this.quill.constructor.import("modules/"+h);return this.modules[h]=new O(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(m,d){for(var g=0;g<d.length;g++){var w=d[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,d,g){return d&&v(m.prototype,d),g&&v(m,g),m}}(),o=function v(m,d,g){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,d);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:v(k,d,g)}else{if("value"in w)return w.value;var P=w.get;return P===void 0?void 0:P.call(g)}},l=i(0),u=O(l),f=i(7),h=O(f);function O(v){return v&&v.__esModule?v:{default:v}}function S(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function b(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function _(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var y="\uFEFF",p=function(v){_(m,v);function m(d){S(this,m);var g=b(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,d));return g.contentNode=document.createElement("span"),g.contentNode.setAttribute("contenteditable",!1),[].slice.call(g.domNode.childNodes).forEach(function(w){g.contentNode.appendChild(w)}),g.leftGuard=document.createTextNode(y),g.rightGuard=document.createTextNode(y),g.domNode.appendChild(g.leftGuard),g.domNode.appendChild(g.contentNode),g.domNode.appendChild(g.rightGuard),g}return a(m,[{key:"index",value:function(g,w){return g===this.leftGuard?0:g===this.rightGuard?1:o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,g,w)}},{key:"restore",value:function(g){var w=void 0,k=void 0,P=g.data.split(y).join("");if(g===this.leftGuard)if(this.prev instanceof h.default){var A=this.prev.length();this.prev.insertAt(A,P),w={startNode:this.prev.domNode,startOffset:A+P.length}}else k=document.createTextNode(P),this.parent.insertBefore(u.default.create(k),this),w={startNode:k,startOffset:P.length};else g===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,P),w={startNode:this.next.domNode,startOffset:P.length}):(k=document.createTextNode(P),this.parent.insertBefore(u.default.create(k),this.next),w={startNode:k,startOffset:P.length}));return g.data=y,w}},{key:"update",value:function(g,w){var k=this;g.forEach(function(P){if(P.type==="characterData"&&(P.target===k.leftGuard||P.target===k.rightGuard)){var A=k.restore(P.target);A&&(w.range=A)}})}}]),m}(u.default.Embed);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=l(a);function l(S){return S&&S.__esModule?S:{default:S}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),h=new o.default.Attributor.Class("align","ql-align",u),O=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=h,n.AlignStyle=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),l=i(26);function u(O){return O&&O.__esModule?O:{default:O}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(S){return S&&S.__esModule?S:{default:S}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),h=new o.default.Attributor.Class("direction","ql-direction",u),O=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=h,n.DirectionStyle=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function v(m,d){for(var g=0;g<d.length;g++){var w=d[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,d,g){return d&&v(m.prototype,d),g&&v(m,g),m}}(),o=function v(m,d,g){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,d);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:v(k,d,g)}else{if("value"in w)return w.value;var P=w.get;return P===void 0?void 0:P.call(g)}},l=i(0),u=f(l);function f(v){return v&&v.__esModule?v:{default:v}}function h(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function O(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function S(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var b={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},_=new u.default.Attributor.Class("font","ql-font",b),y=function(v){S(m,v);function m(){return h(this,m),O(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"value",value:function(g){return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,g).replace(/["']/g,"")}}]),m}(u.default.Attributor.Style),p=new y("font","font-family",b);n.FontStyle=p,n.FontClass=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(g,w){for(var k=0;k<w.length;k++){var P=w[k];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,w,k){return w&&d(g.prototype,w),k&&d(g,k),g}}(),o=i(0),l=S(o),u=i(5),f=S(u),h=i(9),O=S(h);function S(d){return d&&d.__esModule?d:{default:d}}function b(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function _(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function y(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var p=function(d){y(g,d);function g(w,k){b(this,g);var P=_(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,w,k));return P.lastRecorded=0,P.ignoreChange=!1,P.clear(),P.quill.on(f.default.events.EDITOR_CHANGE,function(A,E,x,C){A!==f.default.events.TEXT_CHANGE||P.ignoreChange||(!P.options.userOnly||C===f.default.sources.USER?P.record(E,x):P.transform(E))}),P.quill.keyboard.addBinding({key:"Z",shortKey:!0},P.undo.bind(P)),P.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},P.redo.bind(P)),/Win/i.test(navigator.platform)&&P.quill.keyboard.addBinding({key:"Y",shortKey:!0},P.redo.bind(P)),P}return a(g,[{key:"change",value:function(k,P){if(this.stack[k].length!==0){var A=this.stack[k].pop();this.stack[P].push(A),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(A[k],f.default.sources.USER),this.ignoreChange=!1;var E=m(A[k]);this.quill.setSelection(E)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(k,P){if(k.ops.length!==0){this.stack.redo=[];var A=this.quill.getContents().diff(P),E=Date.now();if(this.lastRecorded+this.options.delay>E&&this.stack.undo.length>0){var x=this.stack.undo.pop();A=A.compose(x.undo),k=x.redo.compose(k)}else this.lastRecorded=E;this.stack.undo.push({redo:k,undo:A}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(k){this.stack.undo.forEach(function(P){P.undo=k.transform(P.undo,!0),P.redo=k.transform(P.redo,!0)}),this.stack.redo.forEach(function(P){P.undo=k.transform(P.undo,!0),P.redo=k.transform(P.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),g}(O.default);p.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function v(d){var g=d.ops[d.ops.length-1];return g==null?!1:g.insert!=null?typeof g.insert=="string"&&g.insert.endsWith(`
|
|
139
|
+
`):g.attributes!=null?Object.keys(g.attributes).some(function(w){return l.default.query(w,l.default.Scope.BLOCK)!=null}):!1}function m(d){var g=d.reduce(function(k,P){return k+=P.delete||0,k},0),w=d.length()-g;return v(d)&&(w-=1),w}n.default=p,n.getLastChangeIndex=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function B(q,K){for(var z=0;z<K.length;z++){var $=K[z];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(q,$.key,$)}}return function(q,K,z){return K&&B(q.prototype,K),z&&B(q,z),q}}(),o=function B(q,K,z){q===null&&(q=Function.prototype);var $=Object.getOwnPropertyDescriptor(q,K);if($===void 0){var F=Object.getPrototypeOf(q);return F===null?void 0:B(F,K,z)}else{if("value"in $)return $.value;var Y=$.get;return Y===void 0?void 0:Y.call(z)}},l=i(3),u=E(l),f=i(2),h=E(f),O=i(8),S=E(O),b=i(23),_=E(b),y=i(34),p=E(y),v=i(59),m=E(v),d=i(60),g=E(d),w=i(28),k=E(w),P=i(61),A=E(P);function E(B){return B&&B.__esModule?B:{default:B}}function x(B,q){if(!(B instanceof q))throw new TypeError("Cannot call a class as a function")}function C(B,q){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q&&(typeof q=="object"||typeof q=="function")?q:B}function R(B,q){if(typeof q!="function"&&q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof q);B.prototype=Object.create(q&&q.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),q&&(Object.setPrototypeOf?Object.setPrototypeOf(B,q):B.__proto__=q)}var N=[!1,"center","right","justify"],U=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],G=[!1,"serif","monospace"],Z=["1","2","3",!1],W=["small",!1,"large","huge"],H=function(B){R(q,B);function q(K,z){x(this,q);var $=C(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,K,z)),F=function Y(X){if(!document.body.contains(K.root))return document.body.removeEventListener("click",Y);$.tooltip!=null&&!$.tooltip.root.contains(X.target)&&document.activeElement!==$.tooltip.textbox&&!$.quill.hasFocus()&&$.tooltip.hide(),$.pickers!=null&&$.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return K.emitter.listenDOM("click",document.body,F),$}return a(q,[{key:"addModule",value:function(z){var $=o(q.prototype.__proto__||Object.getPrototypeOf(q.prototype),"addModule",this).call(this,z);return z==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(z,$){z.forEach(function(F){var Y=F.getAttribute("class")||"";Y.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),$[X]!=null))if(X==="direction")F.innerHTML=$[X][""]+$[X].rtl;else if(typeof $[X]=="string")F.innerHTML=$[X];else{var Q=F.value||"";Q!=null&&$[X][Q]&&(F.innerHTML=$[X][Q])}})})}},{key:"buildPickers",value:function(z,$){var F=this;this.pickers=z.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&D(X,N),new g.default(X,$.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var Q=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&D(X,U,Q==="background"?"#ffffff":"#000000"),new m.default(X,$[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?D(X,G):X.classList.contains("ql-header")?D(X,Z):X.classList.contains("ql-size")&&D(X,W)),new k.default(X)});var Y=function(){F.pickers.forEach(function(Q){Q.update()})};this.quill.on(S.default.events.EDITOR_CHANGE,Y)}}]),q}(p.default);H.DEFAULTS=(0,u.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var q=this,K=this.container.querySelector("input.ql-image[type=file]");K==null&&(K=document.createElement("input"),K.setAttribute("type","file"),K.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),K.classList.add("ql-image"),K.addEventListener("change",function(){if(K.files!=null&&K.files[0]!=null){var z=new FileReader;z.onload=function($){var F=q.quill.getSelection(!0);q.quill.updateContents(new h.default().retain(F.index).delete(F.length).insert({image:$.target.result}),S.default.sources.USER),q.quill.setSelection(F.index+1,S.default.sources.SILENT),K.value=""},z.readAsDataURL(K.files[0])}}),this.container.appendChild(K)),K.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var L=function(B){R(q,B);function q(K,z){x(this,q);var $=C(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,K,z));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return a(q,[{key:"listen",value:function(){var z=this;this.textbox.addEventListener("keydown",function($){_.default.match($,"enter")?(z.save(),$.preventDefault()):_.default.match($,"escape")&&(z.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),$!=null?this.textbox.value=$:z!==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-"+z)||""),this.root.setAttribute("data-mode",z)}},{key:"restoreFocus",value:function(){var z=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=z}},{key:"save",value:function(){var z=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",z,S.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",z,S.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":z=M(z);case"formula":{if(!z)break;var F=this.quill.getSelection(!0);if(F!=null){var Y=F.index+F.length;this.quill.insertEmbed(Y,this.root.getAttribute("data-mode"),z,S.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Y+1," ",S.default.sources.USER),this.quill.setSelection(Y+2,S.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),q}(A.default);function M(B){var q=B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return q?(q[1]||"https")+"://www.youtube.com/embed/"+q[2]+"?showinfo=0":(q=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(q[1]||"https")+"://player.vimeo.com/video/"+q[2]+"/":B}function D(B,q){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;q.forEach(function(z){var $=document.createElement("option");z===K?$.setAttribute("selected","selected"):$.setAttribute("value",z),B.appendChild($)})}n.BaseTooltip=L,n.default=H},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,f=this.iterator();u=f();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var u=0,f=this.head;f!=null;){if(f===l)return u;u+=f.length(),f=f.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var f,h=this.iterator();f=h();){var O=f.length();if(l<O||u&&l===O&&(f.next==null||f.next.length()!==0))return[f,l];l-=O}return[null,0]},o.prototype.forEach=function(l){for(var u,f=this.iterator();u=f();)l(u)},o.prototype.forEachAt=function(l,u,f){if(!(u<=0))for(var h=this.find(l),O=h[0],S=h[1],b,_=l-S,y=this.iterator(O);(b=y())&&_<l+u;){var p=b.length();l>_?f(b,l-_,Math.min(u,_+p-l)):f(b,0,Math.min(p,l+u-_)),_+=p}},o.prototype.map=function(l){return this.reduce(function(u,f){return u.push(l(f)),u},[])},o.prototype.reduce=function(l,u){for(var f,h=this.iterator();f=h();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,b){S.__proto__=b}||function(S,b){for(var _ in b)b.hasOwnProperty(_)&&(S[_]=b[_])};return function(S,b){O(S,b);function _(){this.constructor=S}S.prototype=b===null?Object.create(b):(_.prototype=b.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=function(O){a(S,O);function S(b){var _=O.call(this,b)||this;return _.scroll=_,_.observer=new MutationObserver(function(y){_.update(y)}),_.observer.observe(_.domNode,u),_.attach(),_}return S.prototype.detach=function(){O.prototype.detach.call(this),this.observer.disconnect()},S.prototype.deleteAt=function(b,_){this.update(),b===0&&_===this.length()?this.children.forEach(function(y){y.remove()}):O.prototype.deleteAt.call(this,b,_)},S.prototype.formatAt=function(b,_,y,p){this.update(),O.prototype.formatAt.call(this,b,_,y,p)},S.prototype.insertAt=function(b,_,y){this.update(),O.prototype.insertAt.call(this,b,_,y)},S.prototype.optimize=function(b,_){var y=this;b===void 0&&(b=[]),_===void 0&&(_={}),O.prototype.optimize.call(this,_);for(var p=[].slice.call(this.observer.takeRecords());p.length>0;)b.push(p.pop());for(var v=function(w,k){k===void 0&&(k=!0),!(w==null||w===y)&&w.domNode.parentNode!=null&&(w.domNode[l.DATA_KEY].mutations==null&&(w.domNode[l.DATA_KEY].mutations=[]),k&&v(w.parent))},m=function(w){w.domNode[l.DATA_KEY]==null||w.domNode[l.DATA_KEY].mutations==null||(w instanceof o.default&&w.children.forEach(m),w.optimize(_))},d=b,g=0;d.length>0;g+=1){if(g>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(w){var k=l.find(w.target,!0);k!=null&&(k.domNode===w.target&&(w.type==="childList"?(v(l.find(w.previousSibling,!1)),[].forEach.call(w.addedNodes,function(P){var A=l.find(P,!1);v(A,!1),A instanceof o.default&&A.children.forEach(function(E){v(E,!1)})})):w.type==="attributes"&&v(k.prev)),v(k))}),this.children.forEach(m),d=[].slice.call(this.observer.takeRecords()),p=d.slice();p.length>0;)b.push(p.pop())}},S.prototype.update=function(b,_){var y=this;_===void 0&&(_={}),b=b||this.observer.takeRecords(),b.map(function(p){var v=l.find(p.target,!0);return v==null?null:v.domNode[l.DATA_KEY].mutations==null?(v.domNode[l.DATA_KEY].mutations=[p],v):(v.domNode[l.DATA_KEY].mutations.push(p),null)}).forEach(function(p){p==null||p===y||p.domNode[l.DATA_KEY]==null||p.update(p.domNode[l.DATA_KEY].mutations||[],_)}),this.domNode[l.DATA_KEY].mutations!=null&&O.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,_),this.optimize(b,_)},S.blotName="scroll",S.defaultChild="block",S.scope=l.Scope.BLOCK_BLOT,S.tagName="DIV",S}(o.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,S){O.__proto__=S}||function(O,S){for(var b in S)S.hasOwnProperty(b)&&(O[b]=S[b])};return function(O,S){h(O,S);function b(){this.constructor=O}O.prototype=S===null?Object.create(S):(b.prototype=S.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(h,O){if(Object.keys(h).length!==Object.keys(O).length)return!1;for(var S in h)if(h[S]!==O[S])return!1;return!0}var f=function(h){a(O,h);function O(){return h!==null&&h.apply(this,arguments)||this}return O.formats=function(S){if(S.tagName!==O.tagName)return h.formats.call(this,S)},O.prototype.format=function(S,b){var _=this;S===this.statics.blotName&&!b?(this.children.forEach(function(y){y instanceof o.default||(y=y.wrap(O.blotName,!0)),_.attributes.copy(y)}),this.unwrap()):h.prototype.format.call(this,S,b)},O.prototype.formatAt=function(S,b,_,y){if(this.formats()[_]!=null||l.query(_,l.Scope.ATTRIBUTE)){var p=this.isolate(S,b);p.format(_,y)}else h.prototype.formatAt.call(this,S,b,_,y)},O.prototype.optimize=function(S){h.prototype.optimize.call(this,S);var b=this.formats();if(Object.keys(b).length===0)return this.unwrap();var _=this.next;_ instanceof O&&_.prev===this&&u(b,_.formats())&&(_.moveChildren(this),_.remove())},O.blotName="inline",O.scope=l.Scope.INLINE_BLOT,O.tagName="SPAN",O}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var S in O)O.hasOwnProperty(S)&&(h[S]=O[S])};return function(h,O){f(h,O);function S(){this.constructor=h}h.prototype=O===null?Object.create(O):(S.prototype=O.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(O){var S=l.query(h.blotName).tagName;if(O.tagName!==S)return f.formats.call(this,O)},h.prototype.format=function(O,S){l.query(O,l.Scope.BLOCK)!=null&&(O===this.statics.blotName&&!S?this.replaceWith(h.blotName):f.prototype.format.call(this,O,S))},h.prototype.formatAt=function(O,S,b,_){l.query(b,l.Scope.BLOCK)!=null?this.format(b,_):f.prototype.formatAt.call(this,O,S,b,_)},h.prototype.insertAt=function(O,S,b){if(b==null||l.query(S,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,O,S,b);else{var _=this.split(O),y=l.create(S,b);_.parent.insertBefore(y,_)}},h.prototype.update=function(O,S){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,O,S)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var O in h)h.hasOwnProperty(O)&&(f[O]=h[O])};return function(f,h){u(f,h);function O(){this.constructor=f}f.prototype=h===null?Object.create(h):(O.prototype=h.prototype,new O)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(h){},f.prototype.format=function(h,O){u.prototype.formatAt.call(this,0,this.length(),h,O)},f.prototype.formatAt=function(h,O,S,b){h===0&&O===this.length()?this.format(S,b):u.prototype.formatAt.call(this,h,O,S,b)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,O){h.__proto__=O}||function(h,O){for(var S in O)O.hasOwnProperty(S)&&(h[S]=O[S])};return function(h,O){f(h,O);function S(){this.constructor=h}h.prototype=O===null?Object.create(O):(S.prototype=O.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(h,f);function h(O){var S=f.call(this,O)||this;return S.text=S.statics.value(S.domNode),S}return h.create=function(O){return document.createTextNode(O)},h.value=function(O){var S=O.data;return S.normalize&&(S=S.normalize()),S},h.prototype.deleteAt=function(O,S){this.domNode.data=this.text=this.text.slice(0,O)+this.text.slice(O+S)},h.prototype.index=function(O,S){return this.domNode===O?S:-1},h.prototype.insertAt=function(O,S,b){b==null?(this.text=this.text.slice(0,O)+S+this.text.slice(O),this.domNode.data=this.text):f.prototype.insertAt.call(this,O,S,b)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(O){f.prototype.optimize.call(this,O),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(O,S){return[this.domNode,O]},h.prototype.split=function(O,S){if(S===void 0&&(S=!1),!S){if(O===0)return this;if(O===this.length())return this.next}var b=l.create(this.domNode.splitText(O));return this.parent.insertBefore(b,this.next),this.text=this.statics.value(this.domNode),b},h.prototype.update=function(O,S){var b=this;O.some(function(_){return _.type==="characterData"&&_.target===b.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var f=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>f.length)&&(u=f.length),u-=l.length;var h=f.indexOf(l,u);return h!==-1&&h===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),h=f.length>>>0,O=arguments[1],S,b=0;b<h;b++)if(S=f[b],u.call(O,S,b,f))return S}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(g,w,k){if(g==w)return g?[[o,g]]:[];(k<0||g.length<k)&&(k=null);var P=O(g,w),A=g.substring(0,P);g=g.substring(P),w=w.substring(P),P=S(g,w);var E=g.substring(g.length-P);g=g.substring(0,g.length-P),w=w.substring(0,w.length-P);var x=u(g,w);return A&&x.unshift([o,A]),E&&x.push([o,E]),_(x),k!=null&&(x=v(x,k)),x=m(x),x}function u(g,w){var k;if(!g)return[[a,w]];if(!w)return[[i,g]];var P=g.length>w.length?g:w,A=g.length>w.length?w:g,E=P.indexOf(A);if(E!=-1)return k=[[a,P.substring(0,E)],[o,A],[a,P.substring(E+A.length)]],g.length>w.length&&(k[0][0]=k[2][0]=i),k;if(A.length==1)return[[i,g],[a,w]];var x=b(g,w);if(x){var C=x[0],R=x[1],N=x[2],U=x[3],G=x[4],Z=l(C,N),W=l(R,U);return Z.concat([[o,G]],W)}return f(g,w)}function f(g,w){for(var k=g.length,P=w.length,A=Math.ceil((k+P)/2),E=A,x=2*A,C=new Array(x),R=new Array(x),N=0;N<x;N++)C[N]=-1,R[N]=-1;C[E+1]=0,R[E+1]=0;for(var U=k-P,G=U%2!=0,Z=0,W=0,H=0,L=0,M=0;M<A;M++){for(var D=-M+Z;D<=M-W;D+=2){var B=E+D,q;D==-M||D!=M&&C[B-1]<C[B+1]?q=C[B+1]:q=C[B-1]+1;for(var K=q-D;q<k&&K<P&&g.charAt(q)==w.charAt(K);)q++,K++;if(C[B]=q,q>k)W+=2;else if(K>P)Z+=2;else if(G){var z=E+U-D;if(z>=0&&z<x&&R[z]!=-1){var $=k-R[z];if(q>=$)return h(g,w,q,K)}}}for(var F=-M+H;F<=M-L;F+=2){var z=E+F,$;F==-M||F!=M&&R[z-1]<R[z+1]?$=R[z+1]:$=R[z-1]+1;for(var Y=$-F;$<k&&Y<P&&g.charAt(k-$-1)==w.charAt(P-Y-1);)$++,Y++;if(R[z]=$,$>k)L+=2;else if(Y>P)H+=2;else if(!G){var B=E+U-F;if(B>=0&&B<x&&C[B]!=-1){var q=C[B],K=E+q-B;if($=k-$,q>=$)return h(g,w,q,K)}}}}return[[i,g],[a,w]]}function h(g,w,k,P){var A=g.substring(0,k),E=w.substring(0,P),x=g.substring(k),C=w.substring(P),R=l(A,E),N=l(x,C);return R.concat(N)}function O(g,w){if(!g||!w||g.charAt(0)!=w.charAt(0))return 0;for(var k=0,P=Math.min(g.length,w.length),A=P,E=0;k<A;)g.substring(E,A)==w.substring(E,A)?(k=A,E=k):P=A,A=Math.floor((P-k)/2+k);return A}function S(g,w){if(!g||!w||g.charAt(g.length-1)!=w.charAt(w.length-1))return 0;for(var k=0,P=Math.min(g.length,w.length),A=P,E=0;k<A;)g.substring(g.length-A,g.length-E)==w.substring(w.length-A,w.length-E)?(k=A,E=k):P=A,A=Math.floor((P-k)/2+k);return A}function b(g,w){var k=g.length>w.length?g:w,P=g.length>w.length?w:g;if(k.length<4||P.length*2<k.length)return null;function A(W,H,L){for(var M=W.substring(L,L+Math.floor(W.length/4)),D=-1,B="",q,K,z,$;(D=H.indexOf(M,D+1))!=-1;){var F=O(W.substring(L),H.substring(D)),Y=S(W.substring(0,L),H.substring(0,D));B.length<Y+F&&(B=H.substring(D-Y,D)+H.substring(D,D+F),q=W.substring(0,L-Y),K=W.substring(L+F),z=H.substring(0,D-Y),$=H.substring(D+F))}return B.length*2>=W.length?[q,K,z,$,B]:null}var E=A(k,P,Math.ceil(k.length/4)),x=A(k,P,Math.ceil(k.length/2)),C;if(!E&&!x)return null;x?E?C=E[4].length>x[4].length?E:x:C=x:C=E;var R,N,U,G;g.length>w.length?(R=C[0],N=C[1],U=C[2],G=C[3]):(U=C[0],G=C[1],R=C[2],N=C[3]);var Z=C[4];return[R,N,U,G,Z]}function _(g){g.push([o,""]);for(var w=0,k=0,P=0,A="",E="",x;w<g.length;)switch(g[w][0]){case a:P++,E+=g[w][1],w++;break;case i:k++,A+=g[w][1],w++;break;case o:k+P>1?(k!==0&&P!==0&&(x=O(E,A),x!==0&&(w-k-P>0&&g[w-k-P-1][0]==o?g[w-k-P-1][1]+=E.substring(0,x):(g.splice(0,0,[o,E.substring(0,x)]),w++),E=E.substring(x),A=A.substring(x)),x=S(E,A),x!==0&&(g[w][1]=E.substring(E.length-x)+g[w][1],E=E.substring(0,E.length-x),A=A.substring(0,A.length-x))),k===0?g.splice(w-P,k+P,[a,E]):P===0?g.splice(w-k,k+P,[i,A]):g.splice(w-k-P,k+P,[i,A],[a,E]),w=w-k-P+(k?1:0)+(P?1:0)+1):w!==0&&g[w-1][0]==o?(g[w-1][1]+=g[w][1],g.splice(w,1)):w++,P=0,k=0,A="",E="";break}g[g.length-1][1]===""&&g.pop();var C=!1;for(w=1;w<g.length-1;)g[w-1][0]==o&&g[w+1][0]==o&&(g[w][1].substring(g[w][1].length-g[w-1][1].length)==g[w-1][1]?(g[w][1]=g[w-1][1]+g[w][1].substring(0,g[w][1].length-g[w-1][1].length),g[w+1][1]=g[w-1][1]+g[w+1][1],g.splice(w-1,1),C=!0):g[w][1].substring(0,g[w+1][1].length)==g[w+1][1]&&(g[w-1][1]+=g[w+1][1],g[w][1]=g[w][1].substring(g[w+1][1].length)+g[w+1][1],g.splice(w+1,1),C=!0)),w++;C&&_(g)}var y=l;y.INSERT=a,y.DELETE=i,y.EQUAL=o,r.exports=y;function p(g,w){if(w===0)return[o,g];for(var k=0,P=0;P<g.length;P++){var A=g[P];if(A[0]===i||A[0]===o){var E=k+A[1].length;if(w===E)return[P+1,g];if(w<E){g=g.slice();var x=w-k,C=[A[0],A[1].slice(0,x)],R=[A[0],A[1].slice(x)];return g.splice(P,1,C,R),[P+1,g]}else k=E}}throw new Error("cursor_pos is out of bounds!")}function v(g,w){var k=p(g,w),P=k[1],A=k[0],E=P[A],x=P[A+1];if(E==null)return g;if(E[0]!==o)return g;if(x!=null&&E[1]+x[1]===x[1]+E[1])return P.splice(A,2,x,E),d(P,A,2);if(x!=null&&x[1].indexOf(E[1])===0){P.splice(A,2,[x[0],E[1]],[0,E[1]]);var C=x[1].slice(E[1].length);return C.length>0&&P.splice(A+2,0,[x[0],C]),d(P,A,3)}else return g}function m(g){for(var w=!1,k=function(x){return x.charCodeAt(0)>=56320&&x.charCodeAt(0)<=57343},P=function(x){return x.charCodeAt(x.length-1)>=55296&&x.charCodeAt(x.length-1)<=56319},A=2;A<g.length;A+=1)g[A-2][0]===o&&P(g[A-2][1])&&g[A-1][0]===i&&k(g[A-1][1])&&g[A][0]===a&&k(g[A][1])&&(w=!0,g[A-1][1]=g[A-2][1].slice(-1)+g[A-1][1],g[A][1]=g[A-2][1].slice(-1)+g[A][1],g[A-2][1]=g[A-2][1].slice(0,-1));if(!w)return g;for(var E=[],A=0;A<g.length;A+=1)g[A][1].length>0&&E.push(g[A]);return E}function d(g,w,k){for(var P=w+k-1;P>=0&&P>=w-1;P--)if(P+1<g.length){var A=g[P],E=g[P+1];A[0]===E[1]&&g.splice(P,2,[A[0],A[1]+E[1]])}return g}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,h,O){this.fn=f,this.context=h,this.once=O||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],O,S;if(this._eventsCount===0)return h;for(S in O=this._events)i.call(O,S)&&h.push(a?S.slice(1):S);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(O)):h},u.prototype.listeners=function(h,O){var S=a?a+h:h,b=this._events[S];if(O)return!!b;if(!b)return[];if(b.fn)return[b.fn];for(var _=0,y=b.length,p=new Array(y);_<y;_++)p[_]=b[_].fn;return p},u.prototype.emit=function(h,O,S,b,_,y){var p=a?a+h:h;if(!this._events[p])return!1;var v=this._events[p],m=arguments.length,d,g;if(v.fn){switch(v.once&&this.removeListener(h,v.fn,void 0,!0),m){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,O),!0;case 3:return v.fn.call(v.context,O,S),!0;case 4:return v.fn.call(v.context,O,S,b),!0;case 5:return v.fn.call(v.context,O,S,b,_),!0;case 6:return v.fn.call(v.context,O,S,b,_,y),!0}for(g=1,d=new Array(m-1);g<m;g++)d[g-1]=arguments[g];v.fn.apply(v.context,d)}else{var w=v.length,k;for(g=0;g<w;g++)switch(v[g].once&&this.removeListener(h,v[g].fn,void 0,!0),m){case 1:v[g].fn.call(v[g].context);break;case 2:v[g].fn.call(v[g].context,O);break;case 3:v[g].fn.call(v[g].context,O,S);break;case 4:v[g].fn.call(v[g].context,O,S,b);break;default:if(!d)for(k=1,d=new Array(m-1);k<m;k++)d[k-1]=arguments[k];v[g].fn.apply(v[g].context,d)}}return!0},u.prototype.on=function(h,O,S){var b=new l(O,S||this),_=a?a+h:h;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],b]:this._events[_].push(b):(this._events[_]=b,this._eventsCount++),this},u.prototype.once=function(h,O,S){var b=new l(O,S||this,!0),_=a?a+h:h;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],b]:this._events[_].push(b):(this._events[_]=b,this._eventsCount++),this},u.prototype.removeListener=function(h,O,S,b){var _=a?a+h:h;if(!this._events[_])return this;if(!O)return--this._eventsCount===0?this._events=new o:delete this._events[_],this;var y=this._events[_];if(y.fn)y.fn===O&&(!b||y.once)&&(!S||y.context===S)&&(--this._eventsCount===0?this._events=new o:delete this._events[_]);else{for(var p=0,v=[],m=y.length;p<m;p++)(y[p].fn!==O||b&&!y[p].once||S&&y[p].context!==S)&&v.push(y[p]);v.length?this._events[_]=v.length===1?v[0]:v:--this._eventsCount===0?this._events=new o:delete this._events[_]}return this},u.prototype.removeAllListeners=function(h){var O;return h?(O=a?a+h:h,this._events[O]&&(--this._eventsCount===0?this._events=new o:delete this._events[O])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(oe){return typeof oe}:function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},o=function(){function oe(ce,_e){var ye=[],te=!0,le=!1,me=void 0;try{for(var Ee=ce[Symbol.iterator](),We;!(te=(We=Ee.next()).done)&&(ye.push(We.value),!(_e&&ye.length===_e));te=!0);}catch(Qe){le=!0,me=Qe}finally{try{!te&&Ee.return&&Ee.return()}finally{if(le)throw me}}return ye}return function(ce,_e){if(Array.isArray(ce))return ce;if(Symbol.iterator in Object(ce))return oe(ce,_e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function oe(ce,_e){for(var ye=0;ye<_e.length;ye++){var te=_e[ye];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ce,te.key,te)}}return function(ce,_e,ye){return _e&&oe(ce.prototype,_e),ye&&oe(ce,ye),ce}}(),u=i(3),f=R(u),h=i(2),O=R(h),S=i(0),b=R(S),_=i(5),y=R(_),p=i(10),v=R(p),m=i(9),d=R(m),g=i(36),w=i(37),k=i(13),P=R(k),A=i(26),E=i(38),x=i(39),C=i(40);function R(oe){return oe&&oe.__esModule?oe:{default:oe}}function N(oe,ce,_e){return ce in oe?Object.defineProperty(oe,ce,{value:_e,enumerable:!0,configurable:!0,writable:!0}):oe[ce]=_e,oe}function U(oe,ce){if(!(oe instanceof ce))throw new TypeError("Cannot call a class as a function")}function G(oe,ce){if(!oe)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ce&&(typeof ce=="object"||typeof ce=="function")?ce:oe}function Z(oe,ce){if(typeof ce!="function"&&ce!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ce);oe.prototype=Object.create(ce&&ce.prototype,{constructor:{value:oe,enumerable:!1,writable:!0,configurable:!0}}),ce&&(Object.setPrototypeOf?Object.setPrototypeOf(oe,ce):oe.__proto__=ce)}var W=(0,v.default)("quill:clipboard"),H="__ql-matcher",L=[[Node.TEXT_NODE,Ae],[Node.TEXT_NODE,ne],["br",J],[Node.ELEMENT_NODE,ne],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,ae],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,ke],["li",ie],["b",Y.bind(Y,"bold")],["i",Y.bind(Y,"italic")],["style",re]],M=[g.AlignAttribute,E.DirectionAttribute].reduce(function(oe,ce){return oe[ce.keyName]=ce,oe},{}),D=[g.AlignStyle,w.BackgroundStyle,A.ColorStyle,E.DirectionStyle,x.FontStyle,C.SizeStyle].reduce(function(oe,ce){return oe[ce.keyName]=ce,oe},{}),B=function(oe){Z(ce,oe);function ce(_e,ye){U(this,ce);var te=G(this,(ce.__proto__||Object.getPrototypeOf(ce)).call(this,_e,ye));return te.quill.root.addEventListener("paste",te.onPaste.bind(te)),te.container=te.quill.addContainer("ql-clipboard"),te.container.setAttribute("contenteditable",!0),te.container.setAttribute("tabindex",-1),te.matchers=[],L.concat(te.options.matchers).forEach(function(le){var me=o(le,2),Ee=me[0],We=me[1];!ye.matchVisual&&We===ae||te.addMatcher(Ee,We)}),te}return l(ce,[{key:"addMatcher",value:function(ye,te){this.matchers.push([ye,te])}},{key:"convert",value:function(ye){if(typeof ye=="string")return this.container.innerHTML=ye.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[P.default.blotName]){var le=this.container.innerText;return this.container.innerHTML="",new O.default().insert(le,N({},P.default.blotName,te[P.default.blotName]))}var me=this.prepareMatching(),Ee=o(me,2),We=Ee[0],Qe=Ee[1],Re=F(this.container,We,Qe);return z(Re,`
|
|
140
|
+
`)&&Re.ops[Re.ops.length-1].attributes==null&&(Re=Re.compose(new O.default().retain(Re.length()-1).delete(1))),W.log("convert",this.container.innerHTML,Re),this.container.innerHTML="",Re}},{key:"dangerouslyPasteHTML",value:function(ye,te){var le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof ye=="string")this.quill.setContents(this.convert(ye),te),this.quill.setSelection(0,y.default.sources.SILENT);else{var me=this.convert(te);this.quill.updateContents(new O.default().retain(ye).concat(me),le),this.quill.setSelection(ye+me.length(),y.default.sources.SILENT)}}},{key:"onPaste",value:function(ye){var te=this;if(!(ye.defaultPrevented||!this.quill.isEnabled())){var le=this.quill.getSelection(),me=new O.default().retain(le.index),Ee=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(y.default.sources.SILENT),setTimeout(function(){me=me.concat(te.convert()).delete(le.length),te.quill.updateContents(me,y.default.sources.USER),te.quill.setSelection(me.length()-le.length,y.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=Ee,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ye=this,te=[],le=[];return this.matchers.forEach(function(me){var Ee=o(me,2),We=Ee[0],Qe=Ee[1];switch(We){case Node.TEXT_NODE:le.push(Qe);break;case Node.ELEMENT_NODE:te.push(Qe);break;default:[].forEach.call(ye.container.querySelectorAll(We),function(Re){Re[H]=Re[H]||[],Re[H].push(Qe)});break}}),[te,le]}}]),ce}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function q(oe,ce,_e){return(typeof ce>"u"?"undefined":a(ce))==="object"?Object.keys(ce).reduce(function(ye,te){return q(ye,te,ce[te])},oe):oe.reduce(function(ye,te){return te.attributes&&te.attributes[ce]?ye.push(te):ye.insert(te.insert,(0,f.default)({},N({},ce,_e),te.attributes))},new O.default)}function K(oe){if(oe.nodeType!==Node.ELEMENT_NODE)return{};var ce="__ql-computed-style";return oe[ce]||(oe[ce]=window.getComputedStyle(oe))}function z(oe,ce){for(var _e="",ye=oe.ops.length-1;ye>=0&&_e.length<ce.length;--ye){var te=oe.ops[ye];if(typeof te.insert!="string")break;_e=te.insert+_e}return _e.slice(-1*ce.length)===ce}function $(oe){if(oe.childNodes.length===0)return!1;var ce=K(oe);return["block","list-item"].indexOf(ce.display)>-1}function F(oe,ce,_e){return oe.nodeType===oe.TEXT_NODE?_e.reduce(function(ye,te){return te(oe,ye)},new O.default):oe.nodeType===oe.ELEMENT_NODE?[].reduce.call(oe.childNodes||[],function(ye,te){var le=F(te,ce,_e);return te.nodeType===oe.ELEMENT_NODE&&(le=ce.reduce(function(me,Ee){return Ee(te,me)},le),le=(te[H]||[]).reduce(function(me,Ee){return Ee(te,me)},le)),ye.concat(le)},new O.default):new O.default}function Y(oe,ce,_e){return q(_e,oe,!0)}function X(oe,ce){var _e=b.default.Attributor.Attribute.keys(oe),ye=b.default.Attributor.Class.keys(oe),te=b.default.Attributor.Style.keys(oe),le={};return _e.concat(ye).concat(te).forEach(function(me){var Ee=b.default.query(me,b.default.Scope.ATTRIBUTE);Ee!=null&&(le[Ee.attrName]=Ee.value(oe),le[Ee.attrName])||(Ee=M[me],Ee!=null&&(Ee.attrName===me||Ee.keyName===me)&&(le[Ee.attrName]=Ee.value(oe)||void 0),Ee=D[me],Ee!=null&&(Ee.attrName===me||Ee.keyName===me)&&(Ee=D[me],le[Ee.attrName]=Ee.value(oe)||void 0))}),Object.keys(le).length>0&&(ce=q(ce,le)),ce}function Q(oe,ce){var _e=b.default.query(oe);if(_e==null)return ce;if(_e.prototype instanceof b.default.Embed){var ye={},te=_e.value(oe);te!=null&&(ye[_e.blotName]=te,ce=new O.default().insert(ye,_e.formats(oe)))}else typeof _e.formats=="function"&&(ce=q(ce,_e.blotName,_e.formats(oe)));return ce}function J(oe,ce){return z(ce,`
|
|
141
|
+
`)||ce.insert(`
|
|
142
|
+
`),ce}function re(){return new O.default}function ie(oe,ce){var _e=b.default.query(oe);if(_e==null||_e.blotName!=="list-item"||!z(ce,`
|
|
143
|
+
`))return ce;for(var ye=-1,te=oe.parentNode;!te.classList.contains("ql-clipboard");)(b.default.query(te)||{}).blotName==="list"&&(ye+=1),te=te.parentNode;return ye<=0?ce:ce.compose(new O.default().retain(ce.length()-1).retain(1,{indent:ye}))}function ne(oe,ce){return z(ce,`
|
|
144
|
+
`)||($(oe)||ce.length()>0&&oe.nextSibling&&$(oe.nextSibling))&&ce.insert(`
|
|
145
|
+
`),ce}function ae(oe,ce){if($(oe)&&oe.nextElementSibling!=null&&!z(ce,`
|
|
146
|
+
|
|
147
|
+
`)){var _e=oe.offsetHeight+parseFloat(K(oe).marginTop)+parseFloat(K(oe).marginBottom);oe.nextElementSibling.offsetTop>oe.offsetTop+_e*1.5&&ce.insert(`
|
|
148
|
+
`)}return ce}function ke(oe,ce){var _e={},ye=oe.style||{};return ye.fontStyle&&K(oe).fontStyle==="italic"&&(_e.italic=!0),ye.fontWeight&&(K(oe).fontWeight.startsWith("bold")||parseInt(K(oe).fontWeight)>=700)&&(_e.bold=!0),Object.keys(_e).length>0&&(ce=q(ce,_e)),parseFloat(ye.textIndent||0)>0&&(ce=new O.default().insert(" ").concat(ce)),ce}function Ae(oe,ce){var _e=oe.data;if(oe.parentNode.tagName==="O:P")return ce.insert(_e.trim());if(_e.trim().length===0&&oe.parentNode.classList.contains("ql-clipboard"))return ce;if(!K(oe.parentNode).whiteSpace.startsWith("pre")){var ye=function(le,me){return me=me.replace(/[^\u00a0]/g,""),me.length<1&&le?" ":me};_e=_e.replace(/\r\n/g," ").replace(/\n/g," "),_e=_e.replace(/\s\s+/g,ye.bind(ye,!0)),(oe.previousSibling==null&&$(oe.parentNode)||oe.previousSibling!=null&&$(oe.previousSibling))&&(_e=_e.replace(/^\s+/,ye.bind(ye,!1))),(oe.nextSibling==null&&$(oe.parentNode)||oe.nextSibling!=null&&$(oe.nextSibling))&&(_e=_e.replace(/\s+$/,ye.bind(ye,!1)))}return ce.insert(_e)}n.default=B,n.matchAttributor=X,n.matchBlot=Q,n.matchNewline=ne,n.matchSpacing=ae,n.matchText=Ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function _(y,p){for(var v=0;v<p.length;v++){var m=p[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,p,v){return p&&_(y.prototype,p),v&&_(y,v),y}}(),o=function _(y,p,v){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,p);if(m===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:_(d,p,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(6),u=f(l);function f(_){return _&&_.__esModule?_:{default:_}}function h(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function O(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function S(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var b=function(_){S(y,_);function y(){return h(this,y),O(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"optimize",value:function(v){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,v),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),y}(u.default);b.blotName="bold",b.tagName=["STRONG","B"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function C(R,N){var U=[],G=!0,Z=!1,W=void 0;try{for(var H=R[Symbol.iterator](),L;!(G=(L=H.next()).done)&&(U.push(L.value),!(N&&U.length===N));G=!0);}catch(M){Z=!0,W=M}finally{try{!G&&H.return&&H.return()}finally{if(Z)throw W}}return U}return function(R,N){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return C(R,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function C(R,N){for(var U=0;U<N.length;U++){var G=N[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(R,G.key,G)}}return function(R,N,U){return N&&C(R.prototype,N),U&&C(R,U),R}}(),l=i(2),u=v(l),f=i(0),h=v(f),O=i(5),S=v(O),b=i(10),_=v(b),y=i(9),p=v(y);function v(C){return C&&C.__esModule?C:{default:C}}function m(C,R,N){return R in C?Object.defineProperty(C,R,{value:N,enumerable:!0,configurable:!0,writable:!0}):C[R]=N,C}function d(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function g(C,R){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:C}function w(C,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);C.prototype=Object.create(R&&R.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(C,R):C.__proto__=R)}var k=(0,_.default)("quill:toolbar"),P=function(C){w(R,C);function R(N,U){d(this,R);var G=g(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,N,U));if(Array.isArray(G.options.container)){var Z=document.createElement("div");E(Z,G.options.container),N.container.parentNode.insertBefore(Z,N.container),G.container=Z}else typeof G.options.container=="string"?G.container=document.querySelector(G.options.container):G.container=G.options.container;if(!(G.container instanceof HTMLElement)){var W;return W=k.error("Container required for toolbar",G.options),g(G,W)}return G.container.classList.add("ql-toolbar"),G.controls=[],G.handlers={},Object.keys(G.options.handlers).forEach(function(H){G.addHandler(H,G.options.handlers[H])}),[].forEach.call(G.container.querySelectorAll("button, select"),function(H){G.attach(H)}),G.quill.on(S.default.events.EDITOR_CHANGE,function(H,L){H===S.default.events.SELECTION_CHANGE&&G.update(L)}),G.quill.on(S.default.events.SCROLL_OPTIMIZE,function(){var H=G.quill.selection.getRange(),L=a(H,1),M=L[0];G.update(M)}),G}return o(R,[{key:"addHandler",value:function(U,G){this.handlers[U]=G}},{key:"attach",value:function(U){var G=this,Z=[].find.call(U.classList,function(H){return H.indexOf("ql-")===0});if(Z){if(Z=Z.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[Z]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Z]==null){k.warn("ignoring attaching to disabled format",Z,U);return}if(h.default.query(Z)==null){k.warn("ignoring attaching to nonexistent format",Z,U);return}}var W=U.tagName==="SELECT"?"change":"click";U.addEventListener(W,function(H){var L=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var M=U.options[U.selectedIndex];M.hasAttribute("selected")?L=!1:L=M.value||!1}else U.classList.contains("ql-active")?L=!1:L=U.value||!U.hasAttribute("value"),H.preventDefault();G.quill.focus();var D=G.quill.selection.getRange(),B=a(D,1),q=B[0];if(G.handlers[Z]!=null)G.handlers[Z].call(G,L);else if(h.default.query(Z).prototype instanceof h.default.Embed){if(L=prompt("Enter "+Z),!L)return;G.quill.updateContents(new u.default().retain(q.index).delete(q.length).insert(m({},Z,L)),S.default.sources.USER)}else G.quill.format(Z,L,S.default.sources.USER);G.update(q)}),this.controls.push([Z,U])}}},{key:"update",value:function(U){var G=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(Z){var W=a(Z,2),H=W[0],L=W[1];if(L.tagName==="SELECT"){var M=void 0;if(U==null)M=null;else if(G[H]==null)M=L.querySelector("option[selected]");else if(!Array.isArray(G[H])){var D=G[H];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),M=L.querySelector('option[value="'+D+'"]')}M==null?(L.value="",L.selectedIndex=-1):M.selected=!0}else if(U==null)L.classList.remove("ql-active");else if(L.hasAttribute("value")){var B=G[H]===L.getAttribute("value")||G[H]!=null&&G[H].toString()===L.getAttribute("value")||G[H]==null&&!L.getAttribute("value");L.classList.toggle("ql-active",B)}else L.classList.toggle("ql-active",G[H]!=null)})}}]),R}(p.default);P.DEFAULTS={};function A(C,R,N){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+R),N!=null&&(U.value=N),C.appendChild(U)}function E(C,R){Array.isArray(R[0])||(R=[R]),R.forEach(function(N){var U=document.createElement("span");U.classList.add("ql-formats"),N.forEach(function(G){if(typeof G=="string")A(U,G);else{var Z=Object.keys(G)[0],W=G[Z];Array.isArray(W)?x(U,Z,W):A(U,Z,W)}}),C.appendChild(U)})}function x(C,R,N){var U=document.createElement("select");U.classList.add("ql-"+R),N.forEach(function(G){var Z=document.createElement("option");G!==!1?Z.setAttribute("value",G):Z.setAttribute("selected","selected"),U.appendChild(Z)}),C.appendChild(U)}P.DEFAULTS={container:null,handlers:{clean:function(){var R=this,N=this.quill.getSelection();if(N!=null)if(N.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function(G){h.default.query(G,h.default.Scope.INLINE)!=null&&R.quill.format(G,!1)})}else this.quill.removeFormat(N,S.default.sources.USER)},direction:function(R){var N=this.quill.getFormat().align;R==="rtl"&&N==null?this.quill.format("align","right",S.default.sources.USER):!R&&N==="right"&&this.quill.format("align",!1,S.default.sources.USER),this.quill.format("direction",R,S.default.sources.USER)},indent:function(R){var N=this.quill.getSelection(),U=this.quill.getFormat(N),G=parseInt(U.indent||0);if(R==="+1"||R==="-1"){var Z=R==="+1"?1:-1;U.direction==="rtl"&&(Z*=-1),this.quill.format("indent",G+Z,S.default.sources.USER)}},link:function(R){R===!0&&(R=prompt("Enter link URL:")),this.quill.format("link",R,S.default.sources.USER)},list:function(R){var N=this.quill.getSelection(),U=this.quill.getFormat(N);R==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,S.default.sources.USER):this.quill.format("list","unchecked",S.default.sources.USER):this.quill.format("list",R,S.default.sources.USER)}}},n.default=P,n.addControls=E},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function _(y,p){for(var v=0;v<p.length;v++){var m=p[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,p,v){return p&&_(y.prototype,p),v&&_(y,v),y}}(),o=function _(y,p,v){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,p);if(m===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:_(d,p,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(28),u=f(l);function f(_){return _&&_.__esModule?_:{default:_}}function h(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function O(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function S(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var b=function(_){S(y,_);function y(p,v){h(this,y);var m=O(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,p));return m.label.innerHTML=v,m.container.classList.add("ql-color-picker"),[].slice.call(m.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),m}return a(y,[{key:"buildItem",value:function(v){var m=o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"buildItem",this).call(this,v);return m.style.backgroundColor=v.getAttribute("value")||"",m}},{key:"selectItem",value:function(v,m){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"selectItem",this).call(this,v,m);var d=this.label.querySelector(".ql-color-label"),g=v&&v.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=g:d.style.fill=g)}}]),y}(u.default);n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function _(y,p){for(var v=0;v<p.length;v++){var m=p[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,p,v){return p&&_(y.prototype,p),v&&_(y,v),y}}(),o=function _(y,p,v){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,p);if(m===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:_(d,p,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(28),u=f(l);function f(_){return _&&_.__esModule?_:{default:_}}function h(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function O(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function S(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var b=function(_){S(y,_);function y(p,v){h(this,y);var m=O(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,p));return m.container.classList.add("ql-icon-picker"),[].forEach.call(m.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=v[d.getAttribute("data-value")||""]}),m.defaultItem=m.container.querySelector(".ql-selected"),m.selectItem(m.defaultItem),m}return a(y,[{key:"selectItem",value:function(v,m){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"selectItem",this).call(this,v,m),v=v||this.defaultItem,this.label.innerHTML=v.innerHTML}}]),y}(u.default);n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var O=0;O<h.length;O++){var S=h[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(f,S.key,S)}}return function(f,h,O){return h&&u(f.prototype,h),O&&u(f,O),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,h){var O=this;o(this,u),this.quill=f,this.boundsContainer=h||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){O.root.style.marginTop=-1*O.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var O=h.left+h.width/2-this.root.offsetWidth/2,S=h.bottom+this.quill.root.scrollTop;this.root.style.left=O+"px",this.root.style.top=S+"px",this.root.classList.remove("ql-flip");var b=this.boundsContainer.getBoundingClientRect(),_=this.root.getBoundingClientRect(),y=0;if(_.right>b.right&&(y=b.right-_.right,this.root.style.left=O+y+"px"),_.left<b.left&&(y=b.left-_.left,this.root.style.left=O+y+"px"),_.bottom>b.bottom){var p=_.bottom-_.top,v=h.bottom-h.top+p;this.root.style.top=S-v+"px",this.root.classList.add("ql-flip")}return y}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(C,R){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=C[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(R&&N.length===R));U=!0);}catch(L){G=!0,Z=L}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(C,R){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return x(C,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(C,R,N){C===null&&(C=Function.prototype);var U=Object.getOwnPropertyDescriptor(C,R);if(U===void 0){var G=Object.getPrototypeOf(C);return G===null?void 0:x(G,R,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},l=function(){function x(C,R){for(var N=0;N<R.length;N++){var U=R[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(C,U.key,U)}}return function(C,R,N){return R&&x(C.prototype,R),N&&x(C,N),C}}(),u=i(3),f=d(u),h=i(8),O=d(h),S=i(43),b=d(S),_=i(27),y=d(_),p=i(15),v=i(41),m=d(v);function d(x){return x&&x.__esModule?x:{default:x}}function g(x,C){if(!(x instanceof C))throw new TypeError("Cannot call a class as a function")}function w(x,C){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:x}function k(x,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);x.prototype=Object.create(C&&C.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(x,C):x.__proto__=C)}var P=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],A=function(x){k(C,x);function C(R,N){g(this,C),N.modules.toolbar!=null&&N.modules.toolbar.container==null&&(N.modules.toolbar.container=P);var U=w(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R,N));return U.quill.container.classList.add("ql-snow"),U}return l(C,[{key:"extendToolbar",value:function(N){N.container.classList.add("ql-snow"),this.buildButtons([].slice.call(N.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(N.container.querySelectorAll("select")),m.default),this.tooltip=new E(this.quill,this.options.bounds),N.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,G){N.handlers.link.call(N,!G.format.link)})}}]),C}(b.default);A.DEFAULTS=(0,f.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(C){if(C){var R=this.quill.getSelection();if(R==null||R.length==0)return;var N=this.quill.getText(R);/^\S+@\S+\.\S+$/.test(N)&&N.indexOf("mailto:")!==0&&(N="mailto:"+N);var U=this.quill.theme.tooltip;U.edit("link",N)}else this.quill.format("link",!1)}}}}});var E=function(x){k(C,x);function C(R,N){g(this,C);var U=w(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R,N));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(C,[{key:"listen",value:function(){var N=this;o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){N.root.classList.contains("ql-editing")?N.save():N.edit("link",N.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(N.linkRange!=null){var G=N.linkRange;N.restoreFocus(),N.quill.formatText(G,"link",!1,O.default.sources.USER),delete N.linkRange}U.preventDefault(),N.hide()}),this.quill.on(O.default.events.SELECTION_CHANGE,function(U,G,Z){if(U!=null){if(U.length===0&&Z===O.default.sources.USER){var W=N.quill.scroll.descendant(y.default,U.index),H=a(W,2),L=H[0],M=H[1];if(L!=null){N.linkRange=new p.Range(U.index-M,L.length());var D=y.default.formats(L.domNode);N.preview.textContent=D,N.preview.setAttribute("href",D),N.show(),N.position(N.quill.getBounds(N.linkRange));return}}else delete N.linkRange;N.hide()}})}},{key:"show",value:function(){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),C}(S.BaseTooltip);E.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=A},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=te(a),l=i(36),u=i(38),f=i(64),h=i(65),O=te(h),S=i(66),b=te(S),_=i(67),y=te(_),p=i(37),v=i(26),m=i(39),d=i(40),g=i(56),w=te(g),k=i(68),P=te(k),A=i(27),E=te(A),x=i(69),C=te(x),R=i(70),N=te(R),U=i(71),G=te(U),Z=i(72),W=te(Z),H=i(73),L=te(H),M=i(13),D=te(M),B=i(74),q=te(B),K=i(75),z=te(K),$=i(57),F=te($),Y=i(41),X=te(Y),Q=i(28),J=te(Q),re=i(59),ie=te(re),ne=i(60),ae=te(ne),ke=i(61),Ae=te(ke),oe=i(108),ce=te(oe),_e=i(62),ye=te(_e);function te(le){return le&&le.__esModule?le:{default:le}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":p.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":m.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":p.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":m.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":p.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":m.FontClass,"formats/size":d.SizeClass,"formats/blockquote":O.default,"formats/code-block":D.default,"formats/header":b.default,"formats/list":y.default,"formats/bold":w.default,"formats/code":M.Code,"formats/italic":P.default,"formats/link":E.default,"formats/script":C.default,"formats/strike":N.default,"formats/underline":G.default,"formats/image":W.default,"formats/video":L.default,"formats/list/item":_.ListItem,"modules/formula":q.default,"modules/syntax":z.default,"modules/toolbar":F.default,"themes/bubble":ce.default,"themes/snow":ye.default,"ui/icons":X.default,"ui/picker":J.default,"ui/icon-picker":ae.default,"ui/color-picker":ie.default,"ui/tooltip":Ae.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function y(p,v){for(var m=0;m<v.length;m++){var d=v[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}return function(p,v,m){return v&&y(p.prototype,v),m&&y(p,m),p}}(),o=function y(p,v,m){p===null&&(p=Function.prototype);var d=Object.getOwnPropertyDescriptor(p,v);if(d===void 0){var g=Object.getPrototypeOf(p);return g===null?void 0:y(g,v,m)}else{if("value"in d)return d.value;var w=d.get;return w===void 0?void 0:w.call(m)}},l=i(0),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function h(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function O(y,p){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:y}function S(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(y,p):y.__proto__=p)}var b=function(y){S(p,y);function p(){return h(this,p),O(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"add",value:function(m,d){if(d==="+1"||d==="-1"){var g=this.value(m)||0;d=d==="+1"?g+1:g-1}return d===0?(this.remove(m),!0):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"add",this).call(this,m,d)}},{key:"canAdd",value:function(m,d){return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"canAdd",this).call(this,m,d)||o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"canAdd",this).call(this,m,parseInt(d))}},{key:"value",value:function(m){return parseInt(o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,m))||void 0}}]),p}(u.default.Attributor.Class),_=new b("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(S){return S&&S.__esModule?S:{default:S}}function u(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function f(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function h(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var O=function(S){h(b,S);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="blockquote",O.tagName="blockquote",n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(_,y){for(var p=0;p<y.length;p++){var v=y[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(_,v.key,v)}}return function(_,y,p){return y&&b(_.prototype,y),p&&b(_,p),_}}(),o=i(4),l=u(o);function u(b){return b&&b.__esModule?b:{default:b}}function f(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function h(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function O(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var S=function(b){O(_,b);function _(){return f(this,_),h(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"formats",value:function(p){return this.tagName.indexOf(p.tagName)+1}}]),_}(l.default);S.blotName="header",S.tagName=["H1","H2","H3","H4","H5","H6"],n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function g(w,k){for(var P=0;P<k.length;P++){var A=k[P];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}return function(w,k,P){return k&&g(w.prototype,k),P&&g(w,P),w}}(),o=function g(w,k,P){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,k);if(A===void 0){var E=Object.getPrototypeOf(w);return E===null?void 0:g(E,k,P)}else{if("value"in A)return A.value;var x=A.get;return x===void 0?void 0:x.call(P)}},l=i(0),u=b(l),f=i(4),h=b(f),O=i(25),S=b(O);function b(g){return g&&g.__esModule?g:{default:g}}function _(g,w,k){return w in g?Object.defineProperty(g,w,{value:k,enumerable:!0,configurable:!0,writable:!0}):g[w]=k,g}function y(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}function p(g,w){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:g}function v(g,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);g.prototype=Object.create(w&&w.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(g,w):g.__proto__=w)}var m=function(g){v(w,g);function w(){return y(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,[{key:"format",value:function(P,A){P===d.blotName&&!A?this.replaceWith(u.default.create(this.statics.scope)):o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,P,A)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(P,A){return this.parent.isolate(this.offset(this.parent),this.length()),P===this.parent.statics.blotName?(this.parent.replaceWith(P,A),this):(this.parent.unwrap(),o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"replaceWith",this).call(this,P,A))}}],[{key:"formats",value:function(P){return P.tagName===this.tagName?void 0:o(w.__proto__||Object.getPrototypeOf(w),"formats",this).call(this,P)}}]),w}(h.default);m.blotName="list-item",m.tagName="LI";var d=function(g){v(w,g),a(w,null,[{key:"create",value:function(P){var A=P==="ordered"?"OL":"UL",E=o(w.__proto__||Object.getPrototypeOf(w),"create",this).call(this,A);return(P==="checked"||P==="unchecked")&&E.setAttribute("data-checked",P==="checked"),E}},{key:"formats",value:function(P){if(P.tagName==="OL")return"ordered";if(P.tagName==="UL")return P.hasAttribute("data-checked")?P.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function w(k){y(this,w);var P=p(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,k)),A=function(x){if(x.target.parentNode===k){var C=P.statics.formats(k),R=u.default.find(x.target);C==="checked"?R.format("list","unchecked"):C==="unchecked"&&R.format("list","checked")}};return k.addEventListener("touchstart",A),k.addEventListener("mousedown",A),P}return a(w,[{key:"format",value:function(P,A){this.children.length>0&&this.children.tail.format(P,A)}},{key:"formats",value:function(){return _({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(P,A){if(P instanceof m)o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertBefore",this).call(this,P,A);else{var E=A==null?this.length():A.offset(this),x=this.split(E);x.parent.insertBefore(P,x)}}},{key:"optimize",value:function(P){o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,P);var A=this.next;A!=null&&A.prev===this&&A.statics.blotName===this.statics.blotName&&A.domNode.tagName===this.domNode.tagName&&A.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(A.moveChildren(this),A.remove())}},{key:"replace",value:function(P){if(P.statics.blotName!==this.statics.blotName){var A=u.default.create(this.statics.defaultChild);P.moveChildren(A),this.appendChild(A)}o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"replace",this).call(this,P)}}]),w}(S.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[m],n.ListItem=m,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(S){return S&&S.__esModule?S:{default:S}}function u(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function f(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function h(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var O=function(S){h(b,S);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="italic",O.tagName=["EM","I"],n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function _(y,p){for(var v=0;v<p.length;v++){var m=p[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,m.key,m)}}return function(y,p,v){return p&&_(y.prototype,p),v&&_(y,v),y}}(),o=function _(y,p,v){y===null&&(y=Function.prototype);var m=Object.getOwnPropertyDescriptor(y,p);if(m===void 0){var d=Object.getPrototypeOf(y);return d===null?void 0:_(d,p,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(6),u=f(l);function f(_){return _&&_.__esModule?_:{default:_}}function h(_,y){if(!(_ instanceof y))throw new TypeError("Cannot call a class as a function")}function O(_,y){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:_}function S(_,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);_.prototype=Object.create(y&&y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(_,y):_.__proto__=y)}var b=function(_){S(y,_);function y(){return h(this,y),O(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"create",value:function(v){return v==="super"?document.createElement("sup"):v==="sub"?document.createElement("sub"):o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,v)}},{key:"formats",value:function(v){if(v.tagName==="SUB")return"sub";if(v.tagName==="SUP")return"super"}}]),y}(u.default);b.blotName="script",b.tagName=["SUB","SUP"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(S){return S&&S.__esModule?S:{default:S}}function u(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function f(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function h(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var O=function(S){h(b,S);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="strike",O.tagName="S",n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(S){return S&&S.__esModule?S:{default:S}}function u(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function f(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function h(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var O=function(S){h(b,S);function b(){return u(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default);O.blotName="underline",O.tagName="U",n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&p(v.prototype,m),d&&p(v,d),v}}(),o=function p(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:p(w,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=h(l),f=i(27);function h(p){return p&&p.__esModule?p:{default:p}}function O(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function S(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function b(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var _=["alt","height","width"],y=function(p){b(v,p);function v(){return O(this,v),S(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(d,g){_.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,d);return typeof d=="string"&&g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return _.reduce(function(g,w){return d.hasAttribute(w)&&(g[w]=d.getAttribute(w)),g},{})}},{key:"match",value:function(d){return/\.(jpe?g|gif|png)$/.test(d)||/^data:image\/.+;base64/.test(d)}},{key:"sanitize",value:function(d){return(0,f.sanitize)(d,["http","https","data"])?d:"//:0"}},{key:"value",value:function(d){return d.getAttribute("src")}}]),v}(u.default.Embed);y.blotName="image",y.tagName="IMG",n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&p(v.prototype,m),d&&p(v,d),v}}(),o=function p(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var w=Object.getPrototypeOf(v);return w===null?void 0:p(w,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(4),u=i(27),f=h(u);function h(p){return p&&p.__esModule?p:{default:p}}function O(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function S(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function b(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var _=["height","width"],y=function(p){b(v,p);function v(){return O(this,v),S(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(d,g){_.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,d);return g.setAttribute("frameborder","0"),g.setAttribute("allowfullscreen",!0),g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return _.reduce(function(g,w){return d.hasAttribute(w)&&(g[w]=d.getAttribute(w)),g},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),v}(l.BlockEmbed);y.blotName="video",y.className="ql-video",y.tagName="IFRAME",n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(g,w){for(var k=0;k<w.length;k++){var P=w[k];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,w,k){return w&&d(g.prototype,w),k&&d(g,k),g}}(),o=function d(g,w,k){g===null&&(g=Function.prototype);var P=Object.getOwnPropertyDescriptor(g,w);if(P===void 0){var A=Object.getPrototypeOf(g);return A===null?void 0:d(A,w,k)}else{if("value"in P)return P.value;var E=P.get;return E===void 0?void 0:E.call(k)}},l=i(35),u=b(l),f=i(5),h=b(f),O=i(9),S=b(O);function b(d){return d&&d.__esModule?d:{default:d}}function _(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function y(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function p(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var v=function(d){p(g,d);function g(){return _(this,g),y(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,null,[{key:"create",value:function(k){var P=o(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,k);return typeof k=="string"&&(window.katex.render(k,P,{throwOnError:!1,errorColor:"#f00"}),P.setAttribute("data-value",k)),P}},{key:"value",value:function(k){return k.getAttribute("data-value")}}]),g}(u.default);v.blotName="formula",v.className="ql-formula",v.tagName="SPAN";var m=function(d){p(g,d),a(g,null,[{key:"register",value:function(){h.default.register(v,!0)}}]);function g(){_(this,g);var w=y(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return w}return g}(S.default);n.FormulaBlot=v,n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function k(P,A){for(var E=0;E<A.length;E++){var x=A[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(P,x.key,x)}}return function(P,A,E){return A&&k(P.prototype,A),E&&k(P,E),P}}(),o=function k(P,A,E){P===null&&(P=Function.prototype);var x=Object.getOwnPropertyDescriptor(P,A);if(x===void 0){var C=Object.getPrototypeOf(P);return C===null?void 0:k(C,A,E)}else{if("value"in x)return x.value;var R=x.get;return R===void 0?void 0:R.call(E)}},l=i(0),u=y(l),f=i(5),h=y(f),O=i(9),S=y(O),b=i(13),_=y(b);function y(k){return k&&k.__esModule?k:{default:k}}function p(k,P){if(!(k instanceof P))throw new TypeError("Cannot call a class as a function")}function v(k,P){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:k}function m(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);k.prototype=Object.create(P&&P.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(k,P):k.__proto__=P)}var d=function(k){m(P,k);function P(){return p(this,P),v(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return a(P,[{key:"replaceWith",value:function(E){this.domNode.textContent=this.domNode.textContent,this.attach(),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,E)}},{key:"highlight",value:function(E){var x=this.domNode.textContent;this.cachedText!==x&&((x.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=E(x),this.domNode.normalize(),this.attach()),this.cachedText=x)}}]),P}(_.default);d.className="ql-syntax";var g=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),w=function(k){m(P,k),a(P,null,[{key:"register",value:function(){h.default.register(g,!0),h.default.register(d,!0)}}]);function P(A,E){p(this,P);var x=v(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,A,E));if(typeof x.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var C=null;return x.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(C),C=setTimeout(function(){x.highlight(),C=null},x.options.interval)}),x.highlight(),x}return a(P,[{key:"highlight",value:function(){var E=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var x=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(C){C.highlight(E.options.highlight)}),this.quill.update(h.default.sources.SILENT),x!=null&&this.quill.setSelection(x,h.default.sources.SILENT)}}}]),P}(S.default);w.DEFAULTS={highlight:function(){return window.hljs==null?null:function(k){var P=window.hljs.highlightAuto(k);return P.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=g,n.default=w},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function P(A,E,x){A===null&&(A=Function.prototype);var C=Object.getOwnPropertyDescriptor(A,E);if(C===void 0){var R=Object.getPrototypeOf(A);return R===null?void 0:P(R,E,x)}else{if("value"in C)return C.value;var N=C.get;return N===void 0?void 0:N.call(x)}},o=function(){function P(A,E){for(var x=0;x<E.length;x++){var C=E[x];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(A,C.key,C)}}return function(A,E,x){return E&&P(A.prototype,E),x&&P(A,x),A}}(),l=i(3),u=p(l),f=i(8),h=p(f),O=i(43),S=p(O),b=i(15),_=i(41),y=p(_);function p(P){return P&&P.__esModule?P:{default:P}}function v(P,A){if(!(P instanceof A))throw new TypeError("Cannot call a class as a function")}function m(P,A){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:P}function d(P,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);P.prototype=Object.create(A&&A.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(P,A):P.__proto__=A)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],w=function(P){d(A,P);function A(E,x){v(this,A),x.modules.toolbar!=null&&x.modules.toolbar.container==null&&(x.modules.toolbar.container=g);var C=m(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,E,x));return C.quill.container.classList.add("ql-bubble"),C}return o(A,[{key:"extendToolbar",value:function(x){this.tooltip=new k(this.quill,this.options.bounds),this.tooltip.root.appendChild(x.container),this.buildButtons([].slice.call(x.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(x.container.querySelectorAll("select")),y.default)}}]),A}(S.default);w.DEFAULTS=(0,u.default)(!0,{},S.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){A?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var k=function(P){d(A,P);function A(E,x){v(this,A);var C=m(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,E,x));return C.quill.on(h.default.events.EDITOR_CHANGE,function(R,N,U,G){if(R===h.default.events.SELECTION_CHANGE)if(N!=null&&N.length>0&&G===h.default.sources.USER){C.show(),C.root.style.left="0px",C.root.style.width="",C.root.style.width=C.root.offsetWidth+"px";var Z=C.quill.getLines(N.index,N.length);if(Z.length===1)C.position(C.quill.getBounds(N));else{var W=Z[Z.length-1],H=C.quill.getIndex(W),L=Math.min(W.length()-1,N.index+N.length-H),M=C.quill.getBounds(new b.Range(H,L));C.position(M)}}else document.activeElement!==C.textbox&&C.quill.hasFocus()&&C.hide()}),C}return o(A,[{key:"listen",value:function(){var x=this;a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){x.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!x.root.classList.contains("ql-hidden")){var C=x.quill.getSelection();C!=null&&x.position(x.quill.getBounds(C))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(x){var C=a(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"position",this).call(this,x),R=this.root.querySelector(".ql-tooltip-arrow");if(R.style.marginLeft="",C===0)return C;R.style.marginLeft=-1*C-R.offsetWidth/2+"px"}}]),A}(O.BaseTooltip);k.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=k,n.default=w},function(r,n,i){r.exports=i(63)}]).default})})(aS);var TD=aS.exports,g2={},oS={exports:{}},Vo={},Bu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Bu.exports;var I4;function AD(){return I4||(I4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof ve=="object"&&ve;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,h=26,O=38,S=700,b=72,_=128,y="-",p=/^xn--/,v=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=u-f,w=Math.floor,k=String.fromCharCode,P;function A(M){throw new RangeError(d[M])}function E(M,D){for(var B=M.length,q=[];B--;)q[B]=D(M[B]);return q}function x(M,D){var B=M.split("@"),q="";B.length>1&&(q=B[0]+"@",M=B[1]),M=M.replace(m,".");var K=M.split("."),z=E(K,D).join(".");return q+z}function C(M){for(var D=[],B=0,q=M.length,K,z;B<q;)K=M.charCodeAt(B++),K>=55296&&K<=56319&&B<q?(z=M.charCodeAt(B++),(z&64512)==56320?D.push(((K&1023)<<10)+(z&1023)+65536):(D.push(K),B--)):D.push(K);return D}function R(M){return E(M,function(D){var B="";return D>65535&&(D-=65536,B+=k(D>>>10&1023|55296),D=56320|D&1023),B+=k(D),B}).join("")}function N(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:u}function U(M,D){return M+22+75*(M<26)-((D!=0)<<5)}function G(M,D,B){var q=0;for(M=B?w(M/S):M>>1,M+=w(M/D);M>g*h>>1;q+=u)M=w(M/g);return w(q+(g+1)*M/(M+O))}function Z(M){var D=[],B=M.length,q,K=0,z=_,$=b,F,Y,X,Q,J,re,ie,ne,ae;for(F=M.lastIndexOf(y),F<0&&(F=0),Y=0;Y<F;++Y)M.charCodeAt(Y)>=128&&A("not-basic"),D.push(M.charCodeAt(Y));for(X=F>0?F+1:0;X<B;){for(Q=K,J=1,re=u;X>=B&&A("invalid-input"),ie=N(M.charCodeAt(X++)),(ie>=u||ie>w((l-K)/J))&&A("overflow"),K+=ie*J,ne=re<=$?f:re>=$+h?h:re-$,!(ie<ne);re+=u)ae=u-ne,J>w(l/ae)&&A("overflow"),J*=ae;q=D.length+1,$=G(K-Q,q,Q==0),w(K/q)>l-z&&A("overflow"),z+=w(K/q),K%=q,D.splice(K++,0,z)}return R(D)}function W(M){var D,B,q,K,z,$,F,Y,X,Q,J,re=[],ie,ne,ae,ke;for(M=C(M),ie=M.length,D=_,B=0,z=b,$=0;$<ie;++$)J=M[$],J<128&&re.push(k(J));for(q=K=re.length,K&&re.push(y);q<ie;){for(F=l,$=0;$<ie;++$)J=M[$],J>=D&&J<F&&(F=J);for(ne=q+1,F-D>w((l-B)/ne)&&A("overflow"),B+=(F-D)*ne,D=F,$=0;$<ie;++$)if(J=M[$],J<D&&++B>l&&A("overflow"),J==D){for(Y=B,X=u;Q=X<=z?f:X>=z+h?h:X-z,!(Y<Q);X+=u)ke=Y-Q,ae=u-Q,re.push(k(U(Q+ke%ae,0))),Y=w(ke/ae);re.push(k(U(Y,0))),z=G(B,ne,q==K),B=0,++q}++B,++D}return re.join("")}function H(M){return x(M,function(D){return p.test(D)?Z(D.slice(4).toLowerCase()):D})}function L(M){return x(M,function(D){return v.test(D)?"xn--"+W(D):D})}if(o={version:"1.4.1",ucs2:{decode:C,encode:R},decode:Z,encode:W,toASCII:L,toUnicode:H},n&&i)if(e.exports==n)i.exports=o;else for(P in o)o.hasOwnProperty(P)&&(n[P]=o[P]);else r.punycode=o})(ve)}(Bu,Bu.exports)),Bu.exports}var ag,D4;function RD(){return D4||(D4=1,ag=Error),ag}var og,j4;function MD(){return j4||(j4=1,og=EvalError),og}var lg,F4;function LD(){return F4||(F4=1,lg=RangeError),lg}var sg,z4;function ND(){return z4||(z4=1,sg=ReferenceError),sg}var ug,B4;function lS(){return B4||(B4=1,ug=SyntaxError),ug}var cg,U4;function Qc(){return U4||(U4=1,cg=TypeError),cg}var fg,H4;function ID(){return H4||(H4=1,fg=URIError),fg}var dg,$4;function DD(){return $4||($4=1,dg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),dg}var hg,G4;function jD(){if(G4)return hg;G4=1;var e=typeof Symbol<"u"&&Symbol,t=DD();return hg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hg}var pg,V4;function FD(){if(V4)return pg;V4=1;var e={__proto__:null,foo:{}},t=Object;return pg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},pg}var gg,q4;function zD(){if(q4)return gg;q4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var h=[],O=0;O<u.length;O+=1)h[O]=u[O];for(var S=0;S<f.length;S+=1)h[S+u.length]=f[S];return h},a=function(u,f){for(var h=[],O=f,S=0;O<u.length;O+=1,S+=1)h[S]=u[O];return h},o=function(l,u){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+1<l.length&&(f+=u);return f};return gg=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var h=a(arguments,1),O,S=function(){if(this instanceof O){var v=f.apply(this,i(h,arguments));return Object(v)===v?v:this}return f.apply(u,i(h,arguments))},b=r(0,f.length-h.length),_=[],y=0;y<b;y++)_[y]="$"+y;if(O=Function("binder","return function ("+o(_,",")+"){ return binder.apply(this,arguments); }")(S),f.prototype){var p=function(){};p.prototype=f.prototype,O.prototype=new p,p.prototype=null}return O},gg}var vg,W4;function v2(){if(W4)return vg;W4=1;var e=zD();return vg=Function.prototype.bind||e,vg}var mg,K4;function BD(){if(K4)return mg;K4=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=v2();return mg=r.call(e,t),mg}var yg,Y4;function ru(){if(Y4)return yg;Y4=1;var e,t=RD(),r=MD(),n=LD(),i=ND(),a=lS(),o=Qc(),l=ID(),u=Function,f=function(W){try{return u('"use strict"; return ('+W+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var O=function(){throw new o},S=h?function(){try{return arguments.callee,O}catch{try{return h(arguments,"callee").get}catch{return O}}}():O,b=jD()(),_=FD()(),y=Object.getPrototypeOf||(_?function(W){return W.__proto__}:null),p={},v=typeof Uint8Array>"u"||!y?e:y(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":b&&y?y([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":p,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b&&y?y(y([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!b||!y?e:y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!b||!y?e:y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b&&y?y(""[Symbol.iterator]()):e,"%Symbol%":b?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":S,"%TypedArray%":v,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(y)try{null.error}catch(W){var d=y(y(W));m["%Error.prototype%"]=d}var g=function W(H){var L;if(H==="%AsyncFunction%")L=f("async function () {}");else if(H==="%GeneratorFunction%")L=f("function* () {}");else if(H==="%AsyncGeneratorFunction%")L=f("async function* () {}");else if(H==="%AsyncGenerator%"){var M=W("%AsyncGeneratorFunction%");M&&(L=M.prototype)}else if(H==="%AsyncIteratorPrototype%"){var D=W("%AsyncGenerator%");D&&y&&(L=y(D.prototype))}return m[H]=L,L},w={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=v2(),P=BD(),A=k.call(Function.call,Array.prototype.concat),E=k.call(Function.apply,Array.prototype.splice),x=k.call(Function.call,String.prototype.replace),C=k.call(Function.call,String.prototype.slice),R=k.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,G=function(H){var L=C(H,0,1),M=C(H,-1);if(L==="%"&&M!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&L!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var D=[];return x(H,N,function(B,q,K,z){D[D.length]=K?x(z,U,"$1"):q||B}),D},Z=function(H,L){var M=H,D;if(P(w,M)&&(D=w[M],M="%"+D[0]+"%"),P(m,M)){var B=m[M];if(B===p&&(B=g(M)),typeof B>"u"&&!L)throw new o("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:D,name:M,value:B}}throw new a("intrinsic "+H+" does not exist!")};return yg=function(H,L){if(typeof H!="string"||H.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof L!="boolean")throw new o('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,H)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=G(H),D=M.length>0?M[0]:"",B=Z("%"+D+"%",L),q=B.name,K=B.value,z=!1,$=B.alias;$&&(D=$[0],E(M,A([0,1],$)));for(var F=1,Y=!0;F<M.length;F+=1){var X=M[F],Q=C(X,0,1),J=C(X,-1);if((Q==='"'||Q==="'"||Q==="`"||J==='"'||J==="'"||J==="`")&&Q!==J)throw new a("property names with quotes must have matching quotes");if((X==="constructor"||!Y)&&(z=!0),D+="."+X,q="%"+D+"%",P(m,q))K=m[q];else if(K!=null){if(!(X in K)){if(!L)throw new o("base intrinsic for "+H+" exists, but the property is not available.");return}if(h&&F+1>=M.length){var re=h(K,X);Y=!!re,Y&&"get"in re&&!("originalValue"in re.get)?K=re.get:K=K[X]}else Y=P(K,X),K=K[X];Y&&!z&&(m[q]=K)}}return K},yg}var bg={exports:{}},_g,X4;function m2(){if(X4)return _g;X4=1;var e=ru(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return _g=t,_g}var wg,Z4;function sS(){if(Z4)return wg;Z4=1;var e=ru(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return wg=t,wg}var Sg,Q4;function UD(){if(Q4)return Sg;Q4=1;var e=m2(),t=lS(),r=Qc(),n=sS();return Sg=function(a,o,l){if(!a||typeof a!="object"&&typeof a!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,O=arguments.length>6?arguments[6]:!1,S=!!n&&n(a,o);if(e)e(a,o,{configurable:h===null&&S?S.configurable:!h,enumerable:u===null&&S?S.enumerable:!u,value:l,writable:f===null&&S?S.writable:!f});else if(O||!u&&!f&&!h)a[o]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Sg}var Eg,J4;function HD(){if(J4)return Eg;J4=1;var e=m2(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Eg=t,Eg}var Og,e_;function $D(){if(e_)return Og;e_=1;var e=ru(),t=UD(),r=HD()(),n=sS(),i=Qc(),a=e("%Math.floor%");return Og=function(l,u){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||a(u)!==u)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,O=!0;if("length"in l&&n){var S=n(l,"length");S&&!S.configurable&&(h=!1),S&&!S.writable&&(O=!1)}return(h||O||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Og}var t_;function GD(){return t_||(t_=1,function(e){var t=v2(),r=ru(),n=$D(),i=Qc(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=m2(),f=r("%Math.max%");e.exports=function(S){if(typeof S!="function")throw new i("a function is required");var b=l(t,o,arguments);return n(b,1+f(0,S.length-(arguments.length-1)),!0)};var h=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h}(bg)),bg.exports}var xg,r_;function VD(){if(r_)return xg;r_=1;var e=ru(),t=GD(),r=t(e("String.prototype.indexOf"));return xg=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},xg}const qD={},WD=Object.freeze(Object.defineProperty({__proto__:null,default:qD},Symbol.toStringTag,{value:"Module"})),KD=mo(WD);var Pg,n_;function YD(){if(n_)return Pg;n_=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,f=u?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,O=h?WeakSet.prototype.has:null,S=typeof WeakRef=="function"&&WeakRef.prototype,b=S?WeakRef.prototype.deref:null,_=Boolean.prototype.valueOf,y=Object.prototype.toString,p=Function.prototype.toString,v=String.prototype.match,m=String.prototype.slice,d=String.prototype.replace,g=String.prototype.toUpperCase,w=String.prototype.toLowerCase,k=RegExp.prototype.test,P=Array.prototype.concat,A=Array.prototype.join,E=Array.prototype.slice,x=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",G=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,Z=Object.prototype.propertyIsEnumerable,W=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(fe){return fe.__proto__}:null);function H(fe,de){if(fe===1/0||fe===-1/0||fe!==fe||fe&&fe>-1e3&&fe<1e3||k.call(/e/,de))return de;var Xe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof fe=="number"){var be=fe<0?-x(-fe):x(fe);if(be!==fe){var Ie=String(be),Me=m.call(de,Ie.length+1);return d.call(Ie,Xe,"$&_")+"."+d.call(d.call(Me,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(de,Xe,"$&_")}var L=KD,M=L.custom,D=J(M)?M:null;Pg=function fe(de,Xe,be,Ie){var Me=Xe||{};if(ne(Me,"quoteStyle")&&Me.quoteStyle!=="single"&&Me.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ne(Me,"maxStringLength")&&(typeof Me.maxStringLength=="number"?Me.maxStringLength<0&&Me.maxStringLength!==1/0:Me.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var we=ne(Me,"customInspect")?Me.customInspect:!0;if(typeof we!="boolean"&&we!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ne(Me,"indent")&&Me.indent!==null&&Me.indent!==" "&&!(parseInt(Me.indent,10)===Me.indent&&Me.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ne(Me,"numericSeparator")&&typeof Me.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var et=Me.numericSeparator;if(typeof de>"u")return"undefined";if(de===null)return"null";if(typeof de=="boolean")return de?"true":"false";if(typeof de=="string")return me(de,Me);if(typeof de=="number"){if(de===0)return 1/0/de>0?"0":"-0";var Se=String(de);return et?H(de,Se):Se}if(typeof de=="bigint"){var Ye=String(de)+"n";return et?H(de,Ye):Ye}var Le=typeof Me.depth>"u"?5:Me.depth;if(typeof be>"u"&&(be=0),be>=Le&&Le>0&&typeof de=="object")return K(de)?"[Array]":"[Object]";var je=Oe(Me,be);if(typeof Ie>"u")Ie=[];else if(Ae(Ie,de)>=0)return"[Circular]";function Ve(or,Lr,lr){if(Lr&&(Ie=E.call(Ie),Ie.push(Lr)),lr){var Mn={depth:Me.depth};return ne(Me,"quoteStyle")&&(Mn.quoteStyle=Me.quoteStyle),fe(or,Mn,be+1,Ie)}return fe(or,Me,be+1,Ie)}if(typeof de=="function"&&!$(de)){var pt=ke(de),Ot=Je(de,Ve);return"[Function"+(pt?": "+pt:" (anonymous)")+"]"+(Ot.length>0?" { "+A.call(Ot,", ")+" }":"")}if(J(de)){var Qr=U?d.call(String(de),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(de);return typeof de=="object"&&!U?We(Qr):Qr}if(le(de)){for(var Or="<"+w.call(String(de.nodeName)),Mr=de.attributes||[],Jr=0;Jr<Mr.length;Jr++)Or+=" "+Mr[Jr].name+"="+B(q(Mr[Jr].value),"double",Me);return Or+=">",de.childNodes&&de.childNodes.length&&(Or+="..."),Or+="</"+w.call(String(de.nodeName))+">",Or}if(K(de)){if(de.length===0)return"[]";var Si=Je(de,Ve);return je&&!Pe(Si)?"["+Ne(Si,je)+"]":"[ "+A.call(Si,", ")+" ]"}if(F(de)){var yn=Je(de,Ve);return!("cause"in Error.prototype)&&"cause"in de&&!Z.call(de,"cause")?"{ ["+String(de)+"] "+A.call(P.call("[cause]: "+Ve(de.cause),yn),", ")+" }":yn.length===0?"["+String(de)+"]":"{ ["+String(de)+"] "+A.call(yn,", ")+" }"}if(typeof de=="object"&&we){if(D&&typeof de[D]=="function"&&L)return L(de,{depth:Le-be});if(we!=="symbol"&&typeof de.inspect=="function")return de.inspect()}if(oe(de)){var Gr=[];return n&&n.call(de,function(or,Lr){Gr.push(Ve(Lr,de,!0)+" => "+Ve(or,de))}),Re("Map",r.call(de),Gr,je)}if(ye(de)){var Ra=[];return l&&l.call(de,function(or){Ra.push(Ve(or,de))}),Re("Set",o.call(de),Ra,je)}if(ce(de))return Qe("WeakMap");if(te(de))return Qe("WeakSet");if(_e(de))return Qe("WeakRef");if(X(de))return We(Ve(Number(de)));if(re(de))return We(Ve(C.call(de)));if(Q(de))return We(_.call(de));if(Y(de))return We(Ve(String(de)));if(typeof window<"u"&&de===window)return"{ [object Window] }";if(typeof globalThis<"u"&&de===globalThis||typeof ve<"u"&&de===ve)return"{ [object globalThis] }";if(!z(de)&&!$(de)){var Rn=Je(de,Ve),De=W?W(de)===Object.prototype:de instanceof Object||de.constructor===Object,tt=de instanceof Object?"":"null prototype",yt=!De&&G&&Object(de)===de&&G in de?m.call(ae(de),8,-1):tt?"Object":"",Xt=De||typeof de.constructor!="function"?"":de.constructor.name?de.constructor.name+" ":"",Ct=Xt+(yt||tt?"["+A.call(P.call([],yt||[],tt||[]),": ")+"] ":"");return Rn.length===0?Ct+"{}":je?Ct+"{"+Ne(Rn,je)+"}":Ct+"{ "+A.call(Rn,", ")+" }"}return String(de)};function B(fe,de,Xe){var be=(Xe.quoteStyle||de)==="double"?'"':"'";return be+fe+be}function q(fe){return d.call(String(fe),/"/g,""")}function K(fe){return ae(fe)==="[object Array]"&&(!G||!(typeof fe=="object"&&G in fe))}function z(fe){return ae(fe)==="[object Date]"&&(!G||!(typeof fe=="object"&&G in fe))}function $(fe){return ae(fe)==="[object RegExp]"&&(!G||!(typeof fe=="object"&&G in fe))}function F(fe){return ae(fe)==="[object Error]"&&(!G||!(typeof fe=="object"&&G in fe))}function Y(fe){return ae(fe)==="[object String]"&&(!G||!(typeof fe=="object"&&G in fe))}function X(fe){return ae(fe)==="[object Number]"&&(!G||!(typeof fe=="object"&&G in fe))}function Q(fe){return ae(fe)==="[object Boolean]"&&(!G||!(typeof fe=="object"&&G in fe))}function J(fe){if(U)return fe&&typeof fe=="object"&&fe instanceof Symbol;if(typeof fe=="symbol")return!0;if(!fe||typeof fe!="object"||!N)return!1;try{return N.call(fe),!0}catch{}return!1}function re(fe){if(!fe||typeof fe!="object"||!C)return!1;try{return C.call(fe),!0}catch{}return!1}var ie=Object.prototype.hasOwnProperty||function(fe){return fe in this};function ne(fe,de){return ie.call(fe,de)}function ae(fe){return y.call(fe)}function ke(fe){if(fe.name)return fe.name;var de=v.call(p.call(fe),/^function\s*([\w$]+)/);return de?de[1]:null}function Ae(fe,de){if(fe.indexOf)return fe.indexOf(de);for(var Xe=0,be=fe.length;Xe<be;Xe++)if(fe[Xe]===de)return Xe;return-1}function oe(fe){if(!r||!fe||typeof fe!="object")return!1;try{r.call(fe);try{o.call(fe)}catch{return!0}return fe instanceof Map}catch{}return!1}function ce(fe){if(!f||!fe||typeof fe!="object")return!1;try{f.call(fe,f);try{O.call(fe,O)}catch{return!0}return fe instanceof WeakMap}catch{}return!1}function _e(fe){if(!b||!fe||typeof fe!="object")return!1;try{return b.call(fe),!0}catch{}return!1}function ye(fe){if(!o||!fe||typeof fe!="object")return!1;try{o.call(fe);try{r.call(fe)}catch{return!0}return fe instanceof Set}catch{}return!1}function te(fe){if(!O||!fe||typeof fe!="object")return!1;try{O.call(fe,O);try{f.call(fe,f)}catch{return!0}return fe instanceof WeakSet}catch{}return!1}function le(fe){return!fe||typeof fe!="object"?!1:typeof HTMLElement<"u"&&fe instanceof HTMLElement?!0:typeof fe.nodeName=="string"&&typeof fe.getAttribute=="function"}function me(fe,de){if(fe.length>de.maxStringLength){var Xe=fe.length-de.maxStringLength,be="... "+Xe+" more character"+(Xe>1?"s":"");return me(m.call(fe,0,de.maxStringLength),de)+be}var Ie=d.call(d.call(fe,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ee);return B(Ie,"single",de)}function Ee(fe){var de=fe.charCodeAt(0),Xe={8:"b",9:"t",10:"n",12:"f",13:"r"}[de];return Xe?"\\"+Xe:"\\x"+(de<16?"0":"")+g.call(de.toString(16))}function We(fe){return"Object("+fe+")"}function Qe(fe){return fe+" { ? }"}function Re(fe,de,Xe,be){var Ie=be?Ne(Xe,be):A.call(Xe,", ");return fe+" ("+de+") {"+Ie+"}"}function Pe(fe){for(var de=0;de<fe.length;de++)if(Ae(fe[de],`
|
|
149
|
+
`)>=0)return!1;return!0}function Oe(fe,de){var Xe;if(fe.indent===" ")Xe=" ";else if(typeof fe.indent=="number"&&fe.indent>0)Xe=A.call(Array(fe.indent+1)," ");else return null;return{base:Xe,prev:A.call(Array(de+1),Xe)}}function Ne(fe,de){if(fe.length===0)return"";var Xe=`
|
|
150
|
+
`+de.prev+de.base;return Xe+A.call(fe,","+Xe)+`
|
|
151
|
+
`+de.prev}function Je(fe,de){var Xe=K(fe),be=[];if(Xe){be.length=fe.length;for(var Ie=0;Ie<fe.length;Ie++)be[Ie]=ne(fe,Ie)?de(fe[Ie],fe):""}var Me=typeof R=="function"?R(fe):[],we;if(U){we={};for(var et=0;et<Me.length;et++)we["$"+Me[et]]=Me[et]}for(var Se in fe)ne(fe,Se)&&(Xe&&String(Number(Se))===Se&&Se<fe.length||U&&we["$"+Se]instanceof Symbol||(k.call(/[^\w$]/,Se)?be.push(de(Se,fe)+": "+de(fe[Se],fe)):be.push(Se+": "+de(fe[Se],fe))));if(typeof R=="function")for(var Ye=0;Ye<Me.length;Ye++)Z.call(fe,Me[Ye])&&be.push("["+de(Me[Ye])+"]: "+de(fe[Me[Ye]],fe));return be}return Pg}var Cg,i_;function XD(){if(i_)return Cg;i_=1;var e=ru(),t=VD(),r=YD(),n=Qc(),i=e("%WeakMap%",!0),a=e("%Map%",!0),o=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),f=t("Map.prototype.get",!0),h=t("Map.prototype.set",!0),O=t("Map.prototype.has",!0),S=function(p,v){for(var m=p,d;(d=m.next)!==null;m=d)if(d.key===v)return m.next=d.next,d.next=p.next,p.next=d,d},b=function(p,v){var m=S(p,v);return m&&m.value},_=function(p,v,m){var d=S(p,v);d?d.value=m:p.next={key:v,next:p.next,value:m}},y=function(p,v){return!!S(p,v)};return Cg=function(){var v,m,d,g={assert:function(w){if(!g.has(w))throw new n("Side channel does not contain "+r(w))},get:function(w){if(i&&w&&(typeof w=="object"||typeof w=="function")){if(v)return o(v,w)}else if(a){if(m)return f(m,w)}else if(d)return b(d,w)},has:function(w){if(i&&w&&(typeof w=="object"||typeof w=="function")){if(v)return u(v,w)}else if(a){if(m)return O(m,w)}else if(d)return y(d,w);return!1},set:function(w,k){i&&w&&(typeof w=="object"||typeof w=="function")?(v||(v=new i),l(v,w,k)):a?(m||(m=new a),h(m,w,k)):(d||(d={key:{},next:null}),_(d,w,k))}};return g},Cg}var kg,a_;function y2(){if(a_)return kg;a_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},kg}var Tg,o_;function uS(){if(o_)return Tg;o_=1;var e=y2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var p=[],v=0;v<256;++v)p.push("%"+((v<16?"0":"")+v.toString(16)).toUpperCase());return p}(),i=function(v){for(;v.length>1;){var m=v.pop(),d=m.obj[m.prop];if(r(d)){for(var g=[],w=0;w<d.length;++w)typeof d[w]<"u"&&g.push(d[w]);m.obj[m.prop]=g}}},a=function(v,m){for(var d=m&&m.plainObjects?Object.create(null):{},g=0;g<v.length;++g)typeof v[g]<"u"&&(d[g]=v[g]);return d},o=function p(v,m,d){if(!m)return v;if(typeof m!="object"){if(r(v))v.push(m);else if(v&&typeof v=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,m))&&(v[m]=!0);else return[v,m];return v}if(!v||typeof v!="object")return[v].concat(m);var g=v;return r(v)&&!r(m)&&(g=a(v,d)),r(v)&&r(m)?(m.forEach(function(w,k){if(t.call(v,k)){var P=v[k];P&&typeof P=="object"&&w&&typeof w=="object"?v[k]=p(P,w,d):v.push(w)}else v[k]=w}),v):Object.keys(m).reduce(function(w,k){var P=m[k];return t.call(w,k)?w[k]=p(w[k],P,d):w[k]=P,w},g)},l=function(v,m){return Object.keys(m).reduce(function(d,g){return d[g]=m[g],d},v)},u=function(p,v,m){var d=p.replace(/\+/g," ");if(m==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,h=function(v,m,d,g,w){if(v.length===0)return v;var k=v;if(typeof v=="symbol"?k=Symbol.prototype.toString.call(v):typeof v!="string"&&(k=String(v)),d==="iso-8859-1")return escape(k).replace(/%u[0-9a-f]{4}/gi,function(N){return"%26%23"+parseInt(N.slice(2),16)+"%3B"});for(var P="",A=0;A<k.length;A+=f){for(var E=k.length>=f?k.slice(A,A+f):k,x=[],C=0;C<E.length;++C){var R=E.charCodeAt(C);if(R===45||R===46||R===95||R===126||R>=48&&R<=57||R>=65&&R<=90||R>=97&&R<=122||w===e.RFC1738&&(R===40||R===41)){x[x.length]=E.charAt(C);continue}if(R<128){x[x.length]=n[R];continue}if(R<2048){x[x.length]=n[192|R>>6]+n[128|R&63];continue}if(R<55296||R>=57344){x[x.length]=n[224|R>>12]+n[128|R>>6&63]+n[128|R&63];continue}C+=1,R=65536+((R&1023)<<10|E.charCodeAt(C)&1023),x[x.length]=n[240|R>>18]+n[128|R>>12&63]+n[128|R>>6&63]+n[128|R&63]}P+=x.join("")}return P},O=function(v){for(var m=[{obj:{o:v},prop:"o"}],d=[],g=0;g<m.length;++g)for(var w=m[g],k=w.obj[w.prop],P=Object.keys(k),A=0;A<P.length;++A){var E=P[A],x=k[E];typeof x=="object"&&x!==null&&d.indexOf(x)===-1&&(m.push({obj:k,prop:E}),d.push(x))}return i(m),v},S=function(v){return Object.prototype.toString.call(v)==="[object RegExp]"},b=function(v){return!v||typeof v!="object"?!1:!!(v.constructor&&v.constructor.isBuffer&&v.constructor.isBuffer(v))},_=function(v,m){return[].concat(v,m)},y=function(v,m){if(r(v)){for(var d=[],g=0;g<v.length;g+=1)d.push(m(v[g]));return d}return m(v)};return Tg={arrayToObject:a,assign:l,combine:_,compact:O,decode:u,encode:h,isBuffer:b,isRegExp:S,maybeMap:y,merge:o},Tg}var Ag,l_;function ZD(){if(l_)return Ag;l_=1;var e=XD(),t=uS(),r=y2(),n=Object.prototype.hasOwnProperty,i={brackets:function(p){return p+"[]"},comma:"comma",indices:function(p,v){return p+"["+v+"]"},repeat:function(p){return p}},a=Array.isArray,o=Array.prototype.push,l=function(y,p){o.apply(y,a(p)?p:[p])},u=Date.prototype.toISOString,f=r.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(p){return u.call(p)},skipNulls:!1,strictNullHandling:!1},O=function(p){return typeof p=="string"||typeof p=="number"||typeof p=="boolean"||typeof p=="symbol"||typeof p=="bigint"},S={},b=function y(p,v,m,d,g,w,k,P,A,E,x,C,R,N,U,G,Z,W){for(var H=p,L=W,M=0,D=!1;(L=L.get(S))!==void 0&&!D;){var B=L.get(p);if(M+=1,typeof B<"u"){if(B===M)throw new RangeError("Cyclic object value");D=!0}typeof L.get(S)>"u"&&(M=0)}if(typeof E=="function"?H=E(v,H):H instanceof Date?H=R(H):m==="comma"&&a(H)&&(H=t.maybeMap(H,function(ae){return ae instanceof Date?R(ae):ae})),H===null){if(w)return A&&!G?A(v,h.encoder,Z,"key",N):v;H=""}if(O(H)||t.isBuffer(H)){if(A){var q=G?v:A(v,h.encoder,Z,"key",N);return[U(q)+"="+U(A(H,h.encoder,Z,"value",N))]}return[U(v)+"="+U(String(H))]}var K=[];if(typeof H>"u")return K;var z;if(m==="comma"&&a(H))G&&A&&(H=t.maybeMap(H,A)),z=[{value:H.length>0?H.join(",")||null:void 0}];else if(a(E))z=E;else{var $=Object.keys(H);z=x?$.sort(x):$}var F=P?v.replace(/\./g,"%2E"):v,Y=d&&a(H)&&H.length===1?F+"[]":F;if(g&&a(H)&&H.length===0)return Y+"[]";for(var X=0;X<z.length;++X){var Q=z[X],J=typeof Q=="object"&&typeof Q.value<"u"?Q.value:H[Q];if(!(k&&J===null)){var re=C&&P?Q.replace(/\./g,"%2E"):Q,ie=a(H)?typeof m=="function"?m(Y,re):Y:Y+(C?"."+re:"["+re+"]");W.set(p,M);var ne=e();ne.set(S,W),l(K,y(J,ie,m,d,g,w,k,P,m==="comma"&&G&&a(H)?null:A,E,x,C,R,N,U,G,Z,ne))}}return K},_=function(p){if(!p)return h;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.encodeDotInKeys<"u"&&typeof p.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(p.encoder!==null&&typeof p.encoder<"u"&&typeof p.encoder!="function")throw new TypeError("Encoder has to be a function.");var v=p.charset||h.charset;if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var m=r.default;if(typeof p.format<"u"){if(!n.call(r.formatters,p.format))throw new TypeError("Unknown format option provided.");m=p.format}var d=r.formatters[m],g=h.filter;(typeof p.filter=="function"||a(p.filter))&&(g=p.filter);var w;if(p.arrayFormat in i?w=p.arrayFormat:"indices"in p?w=p.indices?"indices":"repeat":w=h.arrayFormat,"commaRoundTrip"in p&&typeof p.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var k=typeof p.allowDots>"u"?p.encodeDotInKeys===!0?!0:h.allowDots:!!p.allowDots;return{addQueryPrefix:typeof p.addQueryPrefix=="boolean"?p.addQueryPrefix:h.addQueryPrefix,allowDots:k,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:w,charset:v,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:h.charsetSentinel,commaRoundTrip:p.commaRoundTrip,delimiter:typeof p.delimiter>"u"?h.delimiter:p.delimiter,encode:typeof p.encode=="boolean"?p.encode:h.encode,encodeDotInKeys:typeof p.encodeDotInKeys=="boolean"?p.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof p.encoder=="function"?p.encoder:h.encoder,encodeValuesOnly:typeof p.encodeValuesOnly=="boolean"?p.encodeValuesOnly:h.encodeValuesOnly,filter:g,format:m,formatter:d,serializeDate:typeof p.serializeDate=="function"?p.serializeDate:h.serializeDate,skipNulls:typeof p.skipNulls=="boolean"?p.skipNulls:h.skipNulls,sort:typeof p.sort=="function"?p.sort:null,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:h.strictNullHandling}};return Ag=function(y,p){var v=y,m=_(p),d,g;typeof m.filter=="function"?(g=m.filter,v=g("",v)):a(m.filter)&&(g=m.filter,d=g);var w=[];if(typeof v!="object"||v===null)return"";var k=i[m.arrayFormat],P=k==="comma"&&m.commaRoundTrip;d||(d=Object.keys(v)),m.sort&&d.sort(m.sort);for(var A=e(),E=0;E<d.length;++E){var x=d[E];m.skipNulls&&v[x]===null||l(w,b(v[x],x,k,P,m.allowEmptyArrays,m.strictNullHandling,m.skipNulls,m.encodeDotInKeys,m.encode?m.encoder:null,m.filter,m.sort,m.allowDots,m.serializeDate,m.format,m.formatter,m.encodeValuesOnly,m.charset,A))}var C=w.join(m.delimiter),R=m.addQueryPrefix===!0?"?":"";return m.charsetSentinel&&(m.charset==="iso-8859-1"?R+="utf8=%26%2310003%3B&":R+="utf8=%E2%9C%93&"),C.length>0?R+C:""},Ag}var Rg,s_;function QD(){if(s_)return Rg;s_=1;var e=uS(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(S){return S.replace(/&#(\d+);/g,function(b,_){return String.fromCharCode(parseInt(_,10))})},a=function(S,b){return S&&typeof S=="string"&&b.comma&&S.indexOf(",")>-1?S.split(","):S},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(b,_){var y={__proto__:null},p=_.ignoreQueryPrefix?b.replace(/^\?/,""):b;p=p.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var v=_.parameterLimit===1/0?void 0:_.parameterLimit,m=p.split(_.delimiter,v),d=-1,g,w=_.charset;if(_.charsetSentinel)for(g=0;g<m.length;++g)m[g].indexOf("utf8=")===0&&(m[g]===l?w="utf-8":m[g]===o&&(w="iso-8859-1"),d=g,g=m.length);for(g=0;g<m.length;++g)if(g!==d){var k=m[g],P=k.indexOf("]="),A=P===-1?k.indexOf("="):P+1,E,x;A===-1?(E=_.decoder(k,n.decoder,w,"key"),x=_.strictNullHandling?null:""):(E=_.decoder(k.slice(0,A),n.decoder,w,"key"),x=e.maybeMap(a(k.slice(A+1),_),function(R){return _.decoder(R,n.decoder,w,"value")})),x&&_.interpretNumericEntities&&w==="iso-8859-1"&&(x=i(x)),k.indexOf("[]=")>-1&&(x=r(x)?[x]:x);var C=t.call(y,E);C&&_.duplicates==="combine"?y[E]=e.combine(y[E],x):(!C||_.duplicates==="last")&&(y[E]=x)}return y},f=function(S,b,_,y){for(var p=y?b:a(b,_),v=S.length-1;v>=0;--v){var m,d=S[v];if(d==="[]"&&_.parseArrays)m=_.allowEmptyArrays&&p===""?[]:[].concat(p);else{m=_.plainObjects?Object.create(null):{};var g=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,w=_.decodeDotInKeys?g.replace(/%2E/g,"."):g,k=parseInt(w,10);!_.parseArrays&&w===""?m={0:p}:!isNaN(k)&&d!==w&&String(k)===w&&k>=0&&_.parseArrays&&k<=_.arrayLimit?(m=[],m[k]=p):w!=="__proto__"&&(m[w]=p)}p=m}return p},h=function(b,_,y,p){if(b){var v=y.allowDots?b.replace(/\.([^.[]+)/g,"[$1]"):b,m=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,g=y.depth>0&&m.exec(v),w=g?v.slice(0,g.index):v,k=[];if(w){if(!y.plainObjects&&t.call(Object.prototype,w)&&!y.allowPrototypes)return;k.push(w)}for(var P=0;y.depth>0&&(g=d.exec(v))!==null&&P<y.depth;){if(P+=1,!y.plainObjects&&t.call(Object.prototype,g[1].slice(1,-1))&&!y.allowPrototypes)return;k.push(g[1])}return g&&k.push("["+v.slice(g.index)+"]"),f(k,_,y,p)}},O=function(b){if(!b)return n;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.decodeDotInKeys<"u"&&typeof b.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(b.decoder!==null&&typeof b.decoder<"u"&&typeof b.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var _=typeof b.charset>"u"?n.charset:b.charset,y=typeof b.duplicates>"u"?n.duplicates:b.duplicates;if(y!=="combine"&&y!=="first"&&y!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var p=typeof b.allowDots>"u"?b.decodeDotInKeys===!0?!0:n.allowDots:!!b.allowDots;return{allowDots:p,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof b.allowPrototypes=="boolean"?b.allowPrototypes:n.allowPrototypes,allowSparse:typeof b.allowSparse=="boolean"?b.allowSparse:n.allowSparse,arrayLimit:typeof b.arrayLimit=="number"?b.arrayLimit:n.arrayLimit,charset:_,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:n.charsetSentinel,comma:typeof b.comma=="boolean"?b.comma:n.comma,decodeDotInKeys:typeof b.decodeDotInKeys=="boolean"?b.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof b.decoder=="function"?b.decoder:n.decoder,delimiter:typeof b.delimiter=="string"||e.isRegExp(b.delimiter)?b.delimiter:n.delimiter,depth:typeof b.depth=="number"||b.depth===!1?+b.depth:n.depth,duplicates:y,ignoreQueryPrefix:b.ignoreQueryPrefix===!0,interpretNumericEntities:typeof b.interpretNumericEntities=="boolean"?b.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof b.parameterLimit=="number"?b.parameterLimit:n.parameterLimit,parseArrays:b.parseArrays!==!1,plainObjects:typeof b.plainObjects=="boolean"?b.plainObjects:n.plainObjects,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:n.strictNullHandling}};return Rg=function(S,b){var _=O(b);if(S===""||S===null||typeof S>"u")return _.plainObjects?Object.create(null):{};for(var y=typeof S=="string"?u(S,_):S,p=_.plainObjects?Object.create(null):{},v=Object.keys(y),m=0;m<v.length;++m){var d=v[m],g=h(d,y[d],_,typeof S=="string");p=e.merge(p,g,_)}return _.allowSparse===!0?p:e.compact(p)},Rg}var Mg,u_;function JD(){if(u_)return Mg;u_=1;var e=ZD(),t=QD(),r=y2();return Mg={formats:r,parse:t,stringify:e},Mg}var c_;function cS(){if(c_)return Vo;c_=1;var e=AD();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
|
|
152
|
+
`," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=255,O=/^[+a-z0-9A-Z_-]{0,63}$/,S=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},p=JD();function v(w,k,P){if(w&&typeof w=="object"&&w instanceof t)return w;var A=new t;return A.parse(w,k,P),A}t.prototype.parse=function(w,k,P){if(typeof w!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof w);var A=w.indexOf("?"),E=A!==-1&&A<w.indexOf("#")?"?":"#",x=w.split(E),C=/\\/g;x[0]=x[0].replace(C,"/"),w=x.join(E);var R=w;if(R=R.trim(),!P&&w.split("#").length===1){var N=i.exec(R);if(N)return this.path=R,this.href=R,this.pathname=N[1],N[2]?(this.search=N[2],k?this.query=p.parse(this.search.substr(1)):this.query=this.search.substr(1)):k&&(this.search="",this.query={}),this}var U=r.exec(R);if(U){U=U[0];var G=U.toLowerCase();this.protocol=G,R=R.substr(U.length)}if(P||U||R.match(/^\/\/[^@/]+@[^@/]+/)){var Z=R.substr(0,2)==="//";Z&&!(U&&_[U])&&(R=R.substr(2),this.slashes=!0)}if(!_[U]&&(Z||U&&!y[U])){for(var W=-1,H=0;H<f.length;H++){var L=R.indexOf(f[H]);L!==-1&&(W===-1||L<W)&&(W=L)}var M,D;W===-1?D=R.lastIndexOf("@"):D=R.lastIndexOf("@",W),D!==-1&&(M=R.slice(0,D),R=R.slice(D+1),this.auth=decodeURIComponent(M)),W=-1;for(var H=0;H<u.length;H++){var L=R.indexOf(u[H]);L!==-1&&(W===-1||L<W)&&(W=L)}W===-1&&(W=R.length),this.host=R.slice(0,W),R=R.slice(W),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var q=this.hostname.split(/\./),H=0,K=q.length;H<K;H++){var z=q[H];if(z&&!z.match(O)){for(var $="",F=0,Y=z.length;F<Y;F++)z.charCodeAt(F)>127?$+="x":$+=z[F];if(!$.match(O)){var X=q.slice(0,H),Q=q.slice(H+1),J=z.match(S);J&&(X.push(J[1]),Q.unshift(J[2])),Q.length&&(R="/"+Q.join(".")+R),this.hostname=X.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=e.toASCII(this.hostname));var re=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+re,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!b[G])for(var H=0,K=l.length;H<K;H++){var ne=l[H];if(R.indexOf(ne)!==-1){var ae=encodeURIComponent(ne);ae===ne&&(ae=escape(ne)),R=R.split(ne).join(ae)}}var ke=R.indexOf("#");ke!==-1&&(this.hash=R.substr(ke),R=R.slice(0,ke));var Ae=R.indexOf("?");if(Ae!==-1?(this.search=R.substr(Ae),this.query=R.substr(Ae+1),k&&(this.query=p.parse(this.query)),R=R.slice(0,Ae)):k&&(this.search="",this.query={}),R&&(this.pathname=R),y[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var re=this.pathname||"",oe=this.search||"";this.path=re+oe}return this.href=this.format(),this};function m(w){return typeof w=="string"&&(w=v(w)),w instanceof t?w.format():t.prototype.format.call(w)}t.prototype.format=function(){var w=this.auth||"";w&&(w=encodeURIComponent(w),w=w.replace(/%3A/i,":"),w+="@");var k=this.protocol||"",P=this.pathname||"",A=this.hash||"",E=!1,x="";this.host?E=w+this.host:this.hostname&&(E=w+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(E+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(x=p.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var C=this.search||x&&"?"+x||"";return k&&k.substr(-1)!==":"&&(k+=":"),this.slashes||(!k||y[k])&&E!==!1?(E="//"+(E||""),P&&P.charAt(0)!=="/"&&(P="/"+P)):E||(E=""),A&&A.charAt(0)!=="#"&&(A="#"+A),C&&C.charAt(0)!=="?"&&(C="?"+C),P=P.replace(/[?#]/g,function(R){return encodeURIComponent(R)}),C=C.replace("#","%23"),k+E+P+C+A};function d(w,k){return v(w,!1,!0).resolve(k)}t.prototype.resolve=function(w){return this.resolveObject(v(w,!1,!0)).format()};function g(w,k){return w?v(w,!1,!0).resolveObject(k):k}return t.prototype.resolveObject=function(w){if(typeof w=="string"){var k=new t;k.parse(w,!1,!0),w=k}for(var P=new t,A=Object.keys(this),E=0;E<A.length;E++){var x=A[E];P[x]=this[x]}if(P.hash=w.hash,w.href==="")return P.href=P.format(),P;if(w.slashes&&!w.protocol){for(var C=Object.keys(w),R=0;R<C.length;R++){var N=C[R];N!=="protocol"&&(P[N]=w[N])}return y[P.protocol]&&P.hostname&&!P.pathname&&(P.pathname="/",P.path=P.pathname),P.href=P.format(),P}if(w.protocol&&w.protocol!==P.protocol){if(!y[w.protocol]){for(var U=Object.keys(w),G=0;G<U.length;G++){var Z=U[G];P[Z]=w[Z]}return P.href=P.format(),P}if(P.protocol=w.protocol,!w.host&&!_[w.protocol]){for(var K=(w.pathname||"").split("/");K.length&&!(w.host=K.shift()););w.host||(w.host=""),w.hostname||(w.hostname=""),K[0]!==""&&K.unshift(""),K.length<2&&K.unshift(""),P.pathname=K.join("/")}else P.pathname=w.pathname;if(P.search=w.search,P.query=w.query,P.host=w.host||"",P.auth=w.auth,P.hostname=w.hostname||w.host,P.port=w.port,P.pathname||P.search){var W=P.pathname||"",H=P.search||"";P.path=W+H}return P.slashes=P.slashes||w.slashes,P.href=P.format(),P}var L=P.pathname&&P.pathname.charAt(0)==="/",M=w.host||w.pathname&&w.pathname.charAt(0)==="/",D=M||L||P.host&&w.pathname,B=D,q=P.pathname&&P.pathname.split("/")||[],K=w.pathname&&w.pathname.split("/")||[],z=P.protocol&&!y[P.protocol];if(z&&(P.hostname="",P.port=null,P.host&&(q[0]===""?q[0]=P.host:q.unshift(P.host)),P.host="",w.protocol&&(w.hostname=null,w.port=null,w.host&&(K[0]===""?K[0]=w.host:K.unshift(w.host)),w.host=null),D=D&&(K[0]===""||q[0]==="")),M)P.host=w.host||w.host===""?w.host:P.host,P.hostname=w.hostname||w.hostname===""?w.hostname:P.hostname,P.search=w.search,P.query=w.query,q=K;else if(K.length)q||(q=[]),q.pop(),q=q.concat(K),P.search=w.search,P.query=w.query;else if(w.search!=null){if(z){P.host=q.shift(),P.hostname=P.host;var $=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;$&&(P.auth=$.shift(),P.hostname=$.shift(),P.host=P.hostname)}return P.search=w.search,P.query=w.query,(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.href=P.format(),P}if(!q.length)return P.pathname=null,P.search?P.path="/"+P.search:P.path=null,P.href=P.format(),P;for(var F=q.slice(-1)[0],Y=(P.host||w.host||q.length>1)&&(F==="."||F==="..")||F==="",X=0,Q=q.length;Q>=0;Q--)F=q[Q],F==="."?q.splice(Q,1):F===".."?(q.splice(Q,1),X++):X&&(q.splice(Q,1),X--);if(!D&&!B)for(;X--;X)q.unshift("..");D&&q[0]!==""&&(!q[0]||q[0].charAt(0)!=="/")&&q.unshift(""),Y&&q.join("/").substr(-1)!=="/"&&q.push("");var J=q[0]===""||q[0]&&q[0].charAt(0)==="/";if(z){P.hostname=J?"":q.length?q.shift():"",P.host=P.hostname;var $=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;$&&(P.auth=$.shift(),P.hostname=$.shift(),P.host=P.hostname)}return D=D||P.host&&q.length,D&&!J&&q.unshift(""),q.length>0?P.pathname=q.join("/"):(P.pathname=null,P.path=null),(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.auth=w.auth||P.auth,P.slashes=P.slashes||w.slashes,P.href=P.format(),P},t.prototype.parseHost=function(){var w=this.host,k=n.exec(w);k&&(k=k[0],k!==":"&&(this.port=k.substr(1)),w=w.substr(0,w.length-k.length)),w&&(this.hostname=w)},Vo.parse=v,Vo.resolve=d,Vo.resolveObject=g,Vo.format=m,Vo.Url=t,Vo}var Lg={exports:{}},f_;function ej(){return f_||(f_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(ve,function(){var t=function(b){return b.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(b){return b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},i=function(b){var _=b.value;return" "+b.name+'="'+r(_)+'"'},a=function(b){var _=b.tagName;return b.namespaceURI==="http://www.w3.org/1999/xhtml"&&(_=_.toLowerCase()),_},o=function(b,_){var y=Array.prototype.map.call(b.attributes||b.attrs,function(p){return p.name}).indexOf("xmlns")>=0;return!y&&(_||b.namespaceURI!==b.parentNode.namespaceURI)?' xmlns="'+b.namespaceURI+'"':""},l=function(b){return Array.prototype.map.call(b.childNodes,function(_){return S(_)}).join("")},u=function(b,_){var y="<"+a(b);return y+=o(b,_),Array.prototype.forEach.call(b.attributes||b.attrs,function(p){y+=i(p)}),b.childNodes.length>0?(y+=">",y+=l(b),y+="</"+a(b)+">"):y+="/>",y},f=function(b){var _=b.nodeValue||b.value||"";return n(_)},h=function(b){return"<!--"+b.data.replace(/-/g,"-")+"-->"},O=function(b){return"<![CDATA["+b.nodeValue+"]]>"},S=function(b,_){var y=_&&_.rootNode;if(b.nodeName==="#document"||b.nodeName==="#document-fragment")return l(b);if(b.tagName)return u(b,y);if(b.nodeName==="#text")return f(b);if(b.nodeName==="#comment")return h(b);if(b.nodeName==="#cdata-section")return O(b)};return{serializeToString:function(b){return t(S(b,{rootNode:!0}))}}})}(Lg)),Lg.exports}var Ng={},d_;function tj(){if(d_)return Ng;d_=1;var e=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(l){return o.serializeToString(l)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
153
|
+
?</div>`),new RegExp(`^(.+)
|
|
154
|
+
`)],n=function(a){var o=e(a),l,u;for(l=0;l<r.length;l++)if(u=r[l].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var l=t(a);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return Ng.failOnParseError=function(a){return i(a),a},Ng}var Ig={},Dg={},h_;function Zp(){return h_||(h_=1,function(e){var t=cS();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},f;for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?t.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(f){return f.catch(function(h){u.push(h)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};e.ajax=function(l,u){return new Promise(function(f,h){var O=new window.XMLHttpRequest,S=e.joinUrl(u.baseUrl,l),b,_=function(){h({msg:"Unable to load url",url:S})};b=n(S,u.cache),O.addEventListener("load",function(){O.status===200||O.status===0?f(O.response):_()},!1),O.addEventListener("error",_,!1);try{O.open("GET",b,!0),O.overrideMimeType(u.mimeType),O.send(null)}catch{_()}})},e.binaryAjax=function(l,u){var f=e.clone(u);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(l,f).then(function(h){for(var O="",S=0;S<h.length;S++)O+=String.fromCharCode(h.charCodeAt(S)&255);return O})};var i=function(l){var u=function(f,h){return f.substring(0,h.length)===h};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(f){var h=btoa(f),O=i(f);return"data:"+O+";base64,"+h})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};e.memoize=function(l,u,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),O=u(h),S=o(l),b;return f[S]&&f[S][O]?f[S][O]:(b=l.apply(null,h),f[S]=f[S]||{},f[S][O]=b,b)}}}(Dg)),Dg}var jg={},p_;function rj(){if(p_)return jg;p_=1;var e=Zp(),t=function(a,o){var l=null;a.hasAttribute("src")?l=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(l=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.getDataURIForImageURL(l,f).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},r=function(a){return a.filter(function(o){var l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!e.isDataUri(l)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return jg.inline=function(a,o){var l=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),f=n(a.getElementsByTagName("input"));l=l.concat(u),l=l.concat(f);var h=r(l);return e.collectAndReportErrors(h.map(function(O){return t(O,o).then(function(S){O.attributes.src?O.attributes.src.value=S:O.attributes["xlink:href"]?O.attributes["xlink:href"].value=S:O.attributes.href&&(O.attributes.href.value=S)})}))},jg}var Fg={},g_;function nj(){if(g_)return Fg;g_=1;var e=Zp(),t=function(a,o){var l=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.ajax(l,f).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(l){return!!l.attributes.src})};return Fg.inline=function(a,o){var l=i(a);return e.collectAndReportErrors(l.map(function(u){return t(u,o).then(function(f){n(u,f)})}))},Fg}var zg={},Bg={},v_;function b2(){return v_||(v_=1,function(e){e.unquoteString=function(t){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(t)?t.replace(r,"$1"):n.test(t)?t.replace(n,"$1"):t},e.rulesForCssText=function(t){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=t,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(r,n){return r+n.cssText},"")},e.exchangeRule=function(t,r,n){var i=t.indexOf(r);t[i]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(t,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",e.exchangeRule(t,r,i)}}(Bg)),Bg}var Ug={},m_;function ij(){return m_||(m_=1,function(e){var t=b2(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],t.unquoteString(r(l))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",f="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",h=new RegExp(u,"g"),O,S=[],b=function(_){var y=new RegExp(l,"g"),p=[],v;for(v=y.exec(_);v;)p.push(v[1]),v=y.exec(_);return p};if(a.match(new RegExp(f))){for(O=h.exec(a);O;)S.push(b(O[0])),O=h.exec(a);return S}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(Ug)),Ug}function _d(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hg={exports:{}},y_;function aj(){return y_||(y_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,h){if(!i[f]){if(!n[f]){var O=typeof _d=="function"&&_d;if(!h&&O)return O(f,!0);if(l)return l(f,!0);var S=new Error("Cannot find module '"+f+"'");throw S.code="MODULE_NOT_FOUND",S}var b=i[f]={exports:{}};n[f][0].call(b.exports,function(_){var y=n[f][1][_];return o(y||_)},b,b.exports,r,n,i,a)}return i[f].exports}for(var l=typeof _d=="function"&&_d,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function h(){this.constructor=u}h.prototype=f.prototype,u.prototype=new h}function o(u,f,h,O){this.message=u,this.expected=f,this.found=h,this.location=O,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var h={literal:function(v){return'"'+S(v.text)+'"'},class:function(v){var m="",d;for(d=0;d<v.parts.length;d++)m+=v.parts[d]instanceof Array?b(v.parts[d][0])+"-"+b(v.parts[d][1]):b(v.parts[d]);return"["+(v.inverted?"^":"")+m+"]"},any:function(v){return"any character"},end:function(v){return"end of input"},other:function(v){return v.description}};function O(v){return v.charCodeAt(0).toString(16).toUpperCase()}function S(v){return v.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(m){return"\\x0"+O(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+O(m)})}function b(v){return v.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(m){return"\\x0"+O(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+O(m)})}function _(v){return h[v.type](v)}function y(v){var m=new Array(v.length),d,g;for(d=0;d<v.length;d++)m[d]=_(v[d]);if(m.sort(),m.length>0){for(d=1,g=1;d<m.length;d++)m[d-1]!==m[d]&&(m[g]=m[d],g++);m.length=g}switch(m.length){case 1:return m[0];case 2:return m[0]+" or "+m[1];default:return m.slice(0,-1).join(", ")+", or "+m[m.length-1]}}function p(v){return v?'"'+S(v)+'"':"end of input"}return"Expected "+y(u)+" but "+p(f)+" found."};function l(u,f){f=f!==void 0?f:{};var h={},O={start:re},S=re,b="",_=function(){return[]},y=",",p=z(",",!1),v=function(te,le){return[te].concat(le)},m=function(te){return[te]},d=function(te,le){return{url:te,format:le}},g=function(te){return{url:te}},w="url(",k=z("url(",!1),P=")",A=z(")",!1),E=function(te){return te},x="format(",C=z("format(",!1),R="local(",N=z("local(",!1),U=function(te){return{local:te}},G=/^[^)]/,Z=$([")"],!0,!1),W=function(te){return ye.extractValue(te.join(""))},H=/^[ \t\r\n\f]/,L=$([" "," ","\r",`
|
|
155
|
+
`,"\f"],!1,!1),M=0,D=[{line:1,column:1}],B=0,q=[],K;if("startRule"in f){if(!(f.startRule in O))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');S=O[f.startRule]}function z(te,le){return{type:"literal",text:te,ignoreCase:le}}function $(te,le,me){return{type:"class",parts:te,inverted:le,ignoreCase:me}}function F(){return{type:"end"}}function Y(te){var le=D[te],me;if(le)return le;for(me=te-1;!D[me];)me--;for(le=D[me],le={line:le.line,column:le.column};me<te;)u.charCodeAt(me)===10?(le.line++,le.column=1):le.column++,me++;return D[te]=le,le}function X(te,le){var me=Y(te),Ee=Y(le);return{start:{offset:te,line:me.line,column:me.column},end:{offset:le,line:Ee.line,column:Ee.column}}}function Q(te){M<B||(M>B&&(B=M,q=[]),q.push(te))}function J(te,le,me){return new o(o.buildMessage(te,le),te,le,me)}function re(){var te,le;return te=ie(),te===h&&(te=M,le=b,le!==h&&(le=_()),te=le),te}function ie(){var te,le,me,Ee,We,Qe;if(te=M,le=ne(),le!==h){for(me=[],Ee=_e();Ee!==h;)me.push(Ee),Ee=_e();if(me!==h)if(u.charCodeAt(M)===44?(Ee=y,M++):(Ee=h,Q(p)),Ee!==h){for(We=[],Qe=_e();Qe!==h;)We.push(Qe),Qe=_e();We!==h?(Qe=ie(),Qe!==h?(le=v(le,Qe),te=le):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;else M=te,te=h}else M=te,te=h;return te===h&&(te=M,le=ne(),le!==h&&(le=m(le)),te=le),te}function ne(){var te;return te=ae(),te===h&&(te=oe()),te}function ae(){var te,le,me,Ee;if(te=M,le=ke(),le!==h){if(me=[],Ee=_e(),Ee!==h)for(;Ee!==h;)me.push(Ee),Ee=_e();else me=h;me!==h?(Ee=Ae(),Ee!==h?(le=d(le,Ee),te=le):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;return te===h&&(te=M,le=ke(),le!==h&&(le=g(le)),te=le),te}function ke(){var te,le,me,Ee;return te=M,u.substr(M,4)===w?(le=w,M+=4):(le=h,Q(k)),le!==h?(me=ce(),me!==h?(u.charCodeAt(M)===41?(Ee=P,M++):(Ee=h,Q(A)),Ee!==h?(le=E(me),te=le):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function Ae(){var te,le,me,Ee;return te=M,u.substr(M,7)===x?(le=x,M+=7):(le=h,Q(C)),le!==h?(me=ce(),me!==h?(u.charCodeAt(M)===41?(Ee=P,M++):(Ee=h,Q(A)),Ee!==h?(le=E(me),te=le):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function oe(){var te,le,me,Ee;return te=M,u.substr(M,6)===R?(le=R,M+=6):(le=h,Q(N)),le!==h?(me=ce(),me!==h?(u.charCodeAt(M)===41?(Ee=P,M++):(Ee=h,Q(A)),Ee!==h?(le=U(me),te=le):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function ce(){var te,le,me;if(te=M,le=[],G.test(u.charAt(M))?(me=u.charAt(M),M++):(me=h,Q(Z)),me!==h)for(;me!==h;)le.push(me),G.test(u.charAt(M))?(me=u.charAt(M),M++):(me=h,Q(Z));else le=h;return le!==h&&(le=W(le)),te=le,te}function _e(){var te;return H.test(u.charAt(M))?(te=u.charAt(M),M++):(te=h,Q(L)),te}var ye=r("../util");if(K=S(),K!==h&&M===u.length)return K;throw K!==h&&M<u.length&&Q(F()),J(q,B<u.length?u.charAt(B):null,B<u.length?X(B,B+1):X(B,B))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,l){this.message=o,this.offset=l},i.parse=function(o){try{return a.parse(o)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,f=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return o(a(l))}},{}]},{},[2])(2)})}(Hg)),Hg.exports}var b_;function oj(){return b_||(b_=1,function(e){var t=Zp(),r=b2(),n=ij(),i=aj(),a=function(m,d,g){m.style.setProperty(d,g,m.style.getPropertyPriority(d))},o=function(m){return m.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(m){var d=[];return m.forEach(function(g){g.style.getPropertyValue("background-image")?d.push({property:"background-image",value:g.style.getPropertyValue("background-image"),rule:g}):g.style.getPropertyValue("background")&&d.push({property:"background",value:g.style.getPropertyValue("background"),rule:g})}),d},u=function(m){return m.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(m){return m.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},h=function(m){var d=[];return m.forEach(function(g,w){g.url&&!t.isDataUri(g.url)&&d.push(w)}),d},O=function(m){var d=[];return m.forEach(function(g,w){g.url&&!t.isDataUri(g.url)&&d.push(w)}),d};e.adjustPathsOfCssResources=function(m,d){var g=o(d),w=l(g),k=!1;return w.forEach(function(P){var A=n.parse(P.value),E=h(A),x;E.length>0&&(E.forEach(function(C){var R=A[C].url,N=t.joinUrl(m,R);A[C].url=N}),x=n.serialize(A),a(P.rule,P.property,x),k=!0)}),u(d).forEach(function(P){var A=P.style.getPropertyValue("src"),E,x;try{E=i.parse(A)}catch{return}x=O(E),x.length>0&&(x.forEach(function(C){var R=E[C].url,N=t.joinUrl(m,R);E[C].url=N}),r.changeFontFaceRuleSrc(d,P,i.serialize(E)),k=!0)}),f(d).forEach(function(P){var A=P.href,E=t.joinUrl(m,A);r.exchangeRule(d,P,"@import url("+E+");"),k=!0}),k};var S=function(m,d,g){var w=m.indexOf(d);m.splice(w,1),g.forEach(function(k,P){m.splice(w+P,0,k)})},b=function(m,d,g,w){var k=d.href,P;return k=r.unquoteString(k),P=t.joinUrl(w.baseUrl,k),g.indexOf(P)>=0?(S(m,d,[]),Promise.resolve([])):(g.push(P),t.ajax(k,w).then(function(A){var E=r.rulesForCssText(A);return e.loadCSSImportsForRules(E,g,w).then(function(x){return e.adjustPathsOfCssResources(k,E),S(m,d,E),x.errors})},function(A){throw{resourceType:"stylesheet",url:A.url,msg:"Unable to load stylesheet "+A.url}}))};e.loadCSSImportsForRules=function(m,d,g){var w=f(m),k=[],P=!1;return Promise.all(w.map(function(A){return b(m,A,d,g).then(function(E){k=k.concat(E),P=!0},function(E){k.push(E)})})).then(function(){return{hasChanges:P,errors:k}})};var _=function(m,d){var g=n.parse(m),w=h(g),k=!1;return t.collectAndReportErrors(w.map(function(P){var A=g[P].url;return t.getDataURIForImageURL(A,d).then(function(E){g[P].url=E,k=!0},function(E){throw{resourceType:"backgroundImage",url:E.url,msg:"Unable to load background-image "+E.url}})})).then(function(P){return{backgroundValue:n.serialize(g),hasChanges:k,errors:P}})},y=function(m,d){var g=o(m),w=l(g),k=[],P=!1;return Promise.all(w.map(function(A){return _(A.value,d).then(function(E){E.hasChanges&&(a(A.rule,A.property,E.backgroundValue),P=!0),k=k.concat(E.errors)})})).then(function(){return{hasChanges:P,errors:k}})},p=function(m,d){var g=!1,w,k;try{w=i.parse(m)}catch{w=[]}return k=O(w),t.collectAndReportErrors(k.map(function(P){var A=w[P],E=A.format||"woff";return t.binaryAjax(A.url,d).then(function(x){var C=btoa(x);A.url="data:font/"+E+";base64,"+C,g=!0},function(x){throw{resourceType:"fontFace",url:x.url,msg:"Unable to load font-face "+x.url}})})).then(function(P){return{srcDeclarationValue:i.serialize(w),hasChanges:g,errors:P}})},v=function(m,d){var g=u(m),w=[],k=!1;return Promise.all(g.map(function(P){var A=P.style.getPropertyValue("src");return p(A,d).then(function(E){E.hasChanges&&(r.changeFontFaceRuleSrc(m,P,E.srcDeclarationValue),k=!0),w=w.concat(E.errors)})})).then(function(){return{hasChanges:k,errors:w}})};e.loadAndInlineCSSResourcesForRules=function(m,d){var g=!1,w=[];return Promise.all([y,v].map(function(k){return k(m,d).then(function(P){g=g||P.hasChanges,w=w.concat(P.errors)})})).then(function(){return{hasChanges:g,errors:w}})}}(zg)),zg}var __;function lj(){return __||(__=1,function(e){var t=Zp(),r=rj(),n=nj(),i=oj(),a=b2(),o=function(p){return t.joinUrl(p,".")},l=function(p){var v=p.map(function(m,d){return d===p.length-1&&(m={baseUrl:o(m.baseUrl)}),JSON.stringify(m)});return v},u=function(p,v){return v.cache!==!1&&v.cache!=="none"&&v.cacheBucket?t.memoize(p,l,v.cacheBucket):p},f=function(p,v,m){var d=a.rulesForCssText(p);return i.loadCSSImportsForRules(d,v,m).then(function(g){return i.loadAndInlineCSSResourcesForRules(d,m).then(function(w){var k=g.errors.concat(w.errors),P=g.hasChanges||w.hasChanges;return P&&(p=a.cssRulesToText(d)),{hasChanges:P,content:p,errors:k}})})},h=function(p,v,m){var d=p.textContent,g=u(f,v);return g(d,m,v).then(function(w){return w.hasChanges&&(p.childNodes[0].nodeValue=w.content),t.cloneArray(w.errors)})},O=function(p){var v=p.getElementsByTagName("style");return Array.prototype.filter.call(v,function(m){return!m.attributes.type||m.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(p,v){var m=O(p),d=[],g=[],w;return w=t.clone(v),w.baseUrl=w.baseUrl||t.getDocumentBaseUrl(p),Promise.all(m.map(function(k){return h(k,w,g).then(function(P){d=d.concat(P)})})).then(function(){return d})};var S=function(p,v){var m=p.parentNode,d;v=v.trim(),v&&(d=p.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(p.ownerDocument.createTextNode(v)),m.insertBefore(d,p)),m.removeChild(p)},b=function(p,v){return t.ajax(p,v).then(function(m){var d=a.rulesForCssText(m);return{content:m,cssRules:d}}).then(function(m){var d=i.adjustPathsOfCssResources(p,m.cssRules);return{content:m.content,cssRules:m.cssRules,hasChanges:d}}).then(function(m){return i.loadCSSImportsForRules(m.cssRules,[],v).then(function(d){return{content:m.content,cssRules:m.cssRules,hasChanges:m.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(m){return i.loadAndInlineCSSResourcesForRules(m.cssRules,v).then(function(d){return{content:m.content,cssRules:m.cssRules,hasChanges:m.hasChanges||d.hasChanges,errors:m.errors.concat(d.errors)}})}).then(function(m){var d=m.content;return m.hasChanges&&(d=a.cssRulesToText(m.cssRules)),{content:d,errors:m.errors}})},_=function(p,v){var m=p.attributes.href.value,d=t.getDocumentBaseUrl(p.ownerDocument),g=t.clone(v);!g.baseUrl&&d&&(g.baseUrl=d);var w=u(b,v);return w(m,g).then(function(k){return{content:k.content,errors:t.cloneArray(k.errors)}})},y=function(p){var v=p.getElementsByTagName("link");return Array.prototype.filter.call(v,function(m){return m.attributes.rel&&m.attributes.rel.value==="stylesheet"&&(!m.attributes.type||m.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(p,v){var m=y(p),d=[];return Promise.all(m.map(function(g){return _(g,v).then(function(w){S(g,w.content+`
|
|
156
|
+
`),d=d.concat(w.errors)},function(w){d.push({resourceType:"stylesheet",url:w.url,msg:"Unable to load stylesheet "+w.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(p,v){var m=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return v.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(g){return g(p,v).then(function(w){m=m.concat(w)})})).then(function(){return m})}}(Ig)),Ig}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
157
|
+
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
158
|
+
* Copyright (c) 2022 Christoph Burgmer; Licensed MIT */(function(e){(function(t,r){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=r(cS(),ej(),tj(),lj()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(ve,function(t,r,n,i){var a=function(_){var y={},p=[];y.joinUrl=function(d,g){return d?_.resolve(d,g):g},y.getConstantUniqueIdFor=function(d){return p.indexOf(d)<0&&p.push(d),p.indexOf(d)},y.clone=function(d){var g={},w;for(w in d)d.hasOwnProperty(w)&&(g[w]=d[w]);return g};var v=function(d){return typeof d=="object"&&d!==null},m=function(d){return v(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return y.parseOptionalParameters=function(d){var g={canvas:null,options:{}};return d[0]==null||m(d[0])?(g.canvas=d[0]||null,g.options=y.clone(d[1])):g.options=y.clone(d[0]),g},y}(t),o=function(_){var y={},p=function(v,m,d){var g=v[m];return v[m]=function(){var w=Array.prototype.slice.call(arguments);return d.apply(this,[w,g])},g};return y.baseUrlRespectingXhr=function(v,m){var d=function(){var g=new v;return p(g,"open",function(w,k){var P=w.shift(),A=w.shift(),E=_.joinUrl(m,A);return k.apply(this,[P,E].concat(w))}),g};return d},y.finishNotifyingXhr=function(v){var m=0,d=0,g=!1,w,k=new Promise(function(A){w=function(){var E=m-d;E<=0&&g&&A({totalCount:m})}}),P=function(){var A=new v;return p(A,"send",function(E,x){return m+=1,x.apply(this,arguments)}),A.addEventListener("load",function(){d+=1,w()}),A};return P.waitForRequestsToFinish=function(){return g=!0,w(),k},P},y}(a),l=function(){var _={},y=function(P){return Array.prototype.slice.call(P)};_.addClassName=function(P,A){P.className+=" "+A},_.addClassNameRecursively=function(P,A){_.addClassName(P,A),P.parentNode!==P.ownerDocument&&_.addClassNameRecursively(P.parentNode,A)};var p=function(P,A){var E=P.parentStyleSheet,x=y(E.cssRules).indexOf(P);E.insertRule(A,x+1),E.deleteRule(x)},v=function(P,A){var E=P.cssText.replace(/^[^\{]+/,""),x=A+" "+E;p(P,x)},m=function(P){return y(P).reduce(function(A,E){return A+E.cssText},"")},d=function(P){P.textContent=m(P.sheet.cssRules)},g=function(P){var A=document.implementation.createHTMLDocument(""),E=document.createElement("style");E.textContent=P.textContent,A.body.appendChild(E),P.sheet=E.sheet},w=function(P){return"((?:^|[^.#:\\w])|(?=\\W))("+P.join("|")+")(?=\\W|$)"},k=function(P,A,E){var x=w(A);y(P.querySelectorAll("style")).forEach(function(C){typeof C.sheet>"u"&&g(C);var R=y(C.sheet.cssRules).filter(function(N){return N.selectorText&&new RegExp(x,"i").test(N.selectorText)});R.length&&(R.forEach(function(N){var U=N.selectorText.replace(new RegExp(x,"gi"),function(G,Z,W){return Z+E(W)});U!==N.selectorText&&v(N,U)}),d(C))})};return _.rewriteCssSelectorWith=function(P,A,E){k(P,[A],function(){return E})},_.lowercaseCssTypeSelectors=function(P,A){k(P,A,function(E){return E.toLowerCase()})},_.findHtmlOnlyNodeNames=function(P){var A=P.ownerDocument.createTreeWalker(P,NodeFilter.SHOW_ELEMENT),E={},x={},C;do C=A.currentNode.tagName.toLowerCase(),A.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?E[C]=!0:x[C]=!0;while(A.nextNode());return Object.keys(E).filter(function(R){return!x[R]})},_}(),u=function(_){var y={},p=function(m){return Array.prototype.slice.call(m)},v={active:!0,hover:!0,focus:!1,target:!1};return y.fakeUserAction=function(m,d,g){var w=m.querySelector(d),k=":"+g,P="rasterizehtml"+g;w&&(v[g]?_.addClassNameRecursively(w,P):_.addClassName(w,P),_.rewriteCssSelectorWith(m,k,"."+P))},y.persistInputValues=function(m){var d=m.querySelectorAll("input"),g=m.querySelectorAll("textarea"),w=function(k){return k.type==="checkbox"||k.type==="radio"};p(d).filter(w).forEach(function(k){k.checked?k.setAttribute("checked",""):k.removeAttribute("checked")}),p(d).filter(function(k){return!w(k)}).forEach(function(k){k.setAttribute("value",k.value)}),p(g).forEach(function(k){k.textContent=k.value})},y.rewriteTagNameSelectorsToLowerCase=function(m){_.lowercaseCssTypeSelectors(m,_.findHtmlOnlyNodeNames(m))},y}(l),f=function(_,y,p,v){var m={},d=function(W,H,L,M){var D=W.createElement(H);return D.style.visibility="hidden",D.style.width=L+"px",D.style.height=M+"px",D.style.position="absolute",D.style.top=-1e4-M+"px",D.style.left=-1e4-L+"px",W.getElementsByTagName("body")[0].appendChild(D),D},g=function(W){return W>0?new Promise(function(H){setTimeout(H,W)}):Promise.resolve()};m.executeJavascript=function(W,H){return new Promise(function(L){var M=d(v.document,"iframe",H.width,H.height),D=W.outerHTML,B=[],q=H.executeJsTimeout||0,K=function(){v.document.getElementsByTagName("body")[0].removeChild(M)},z=function(){var X=M.contentDocument;L({document:X,errors:B,cleanUp:K})},$=M.contentWindow.XMLHttpRequest,F=y.finishNotifyingXhr($),Y=y.baseUrlRespectingXhr(F,H.baseUrl);M.onload=function(){g(q).then(F.waitForRequestsToFinish).then(z)},M.contentDocument.open(),M.contentWindow.XMLHttpRequest=Y,M.contentWindow.onerror=function(X){B.push({resourceType:"scriptExecution",msg:X})},M.contentDocument.write("<!DOCTYPE html>"),M.contentDocument.write(D),M.contentDocument.close()})};var w=function(W,H,L){var M=W.createElement("iframe");return M.style.width=H+"px",M.style.height=L+"px",M.style.visibility="hidden",M.style.position="absolute",M.style.top=-1e4-L+"px",M.style.left=-1e4-H+"px",M.style.borderWidth=0,M.sandbox="allow-same-origin",M.scrolling="no",M},k=function(W,H,L){var M=Math.floor(W/L),D=Math.floor(H/L);return w(v.document,M,D)},P=function(W,H,L,M){return{width:Math.max(W.width*M,H),height:Math.max(W.height*M,L)}},A=function(W,H){var L=W.querySelector(H);if(L)return L;if(W.ownerDocument.querySelector(H)===W)return W;throw{message:"Clipping selector not found"}},E=function(W,H,L,M,D){var B=Math.max(W.scrollWidth,W.clientWidth),q=Math.max(W.scrollHeight,W.clientHeight),K,z,$,F,Y,X,Q,J;return H?(X=A(W,H),Q=X.getBoundingClientRect(),K=Q.top,z=Q.left,$=Q.width,F=Q.height):(K=0,z=0,$=B,F=q),J=P({width:$,height:F},L,M,D),Y=v.getComputedStyle(W.ownerDocument.documentElement).fontSize,{left:z,top:K,width:J.width,height:J.height,viewportWidth:B,viewportHeight:q,rootFontSize:Y}},x=function(W,H){var L=W.tagName;return H.querySelector(L)},C=function(W){var H=W.tagName.toLowerCase();return H==="html"||H==="body"?W.outerHTML:'<body style="margin: 0;">'+W.outerHTML+"</body>"};m.calculateDocumentContentSize=function(W,H){return new Promise(function(L,M){var D=H.zoom||1,B;B=k(H.width,H.height,D),v.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var q=B.contentDocument,K;try{K=E(x(W,q),H.clip,H.width,H.height,D),L(K)}catch(z){M(z)}finally{v.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(C(W)),B.contentDocument.close()})},m.parseHtmlFragment=function(W){var H=v.document.implementation.createHTMLDocument("");H.documentElement.innerHTML=W;var L=H.querySelector("body").firstChild;if(!L)throw"Invalid source";return L};var R=function(W,H){var L=/<html((?:\s+[^>]*)?)>/im.exec(H),M=v.document.implementation.createHTMLDocument(""),D,B,q,K;if(L)for(D="<div"+L[1]+"></div>",M.documentElement.innerHTML=D,q=M.querySelector("div"),B=0;B<q.attributes.length;B++)K=q.attributes[B],W.documentElement.setAttribute(K.name,K.value)};m.parseHTML=function(W){var H=v.document.implementation.createHTMLDocument("");return H.documentElement.innerHTML=W,R(H,W),H};var N=function(W){try{return p.failOnParseError(W)}catch(H){throw{message:"Invalid source",originalError:H}}};m.validateXHTML=function(W){var H=new DOMParser,L=H.parseFromString(W,"application/xml");N(L)};var U=null,G=function(W,H){return H==="none"||H==="repeated"?((U===null||H!=="repeated")&&(U=Date.now()),W+"?_="+U):W},Z=function(W,H){return new Promise(function(L,M){var D=new window.XMLHttpRequest,B=_.joinUrl(H.baseUrl,W),q=G(B,H.cache),K=function(z){M({message:"Unable to load page",originalError:z})};D.addEventListener("load",function(){D.status===200||D.status===0?L(D.responseXML):K(D.statusText)},!1),D.addEventListener("error",function(z){K(z)},!1);try{D.open("GET",q,!0),D.responseType="document",D.send(null)}catch(z){K(z)}})};return m.loadDocument=function(W,H){return Z(W,H).then(function(L){return N(L)})},m}(a,o,n,window),h=function(_){var y={},p=function(x,C){return C?URL.createObjectURL(new Blob([x],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(x)},v=function(x){x instanceof Blob&&URL.revokeObjectURL(x)},m='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(x){return new Promise(function(C,R){var N=document.createElement("canvas"),U=new Image;U.onload=function(){var G=N.getContext("2d");try{G.drawImage(U,0,0),N.toDataURL("image/png"),C(!0)}catch{C(!1)}},U.onerror=R,U.src=x})},g=function(){var x=p(m,!0);return d(x).then(function(C){return v(x),C?!1:d(p(m,!1)).then(function(R){return R})},function(){return!1})},w=function(){if(_.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},k=function(){return new Promise(function(x,C){w()&&_.URL?g().then(function(R){x(!R)},function(){C()}):x(!1)})},P,A=function(){return P===void 0&&(P=k()),P},E=function(x){return A().then(function(C){return p(x,C)})};return y.renderSvg=function(x){return new Promise(function(C,R){var N,U,G=function(){U.onload=null,U.onerror=null},Z=function(){N&&v(N)};U=new Image,U.onload=function(){G(),Z(),C(U)},U.onerror=function(){Z(),R()},E(x).then(function(W){N=W,U.src=N},R)})},y}(window),O=function(_,y,p,v){var m={},d=function(x,C){var R=C||1,N={width:x.width,height:x.height,"font-size":x.rootFontSize};return R!==1&&(N.style="transform:scale("+R+"); transform-origin: 0 0;"),N},g=function(x){var C,R,N,U;C=Math.round(x.viewportWidth),R=Math.round(x.viewportHeight),N=-x.left,U=-x.top;var G={x:N,y:U,width:C,height:R};return G},w=function(x){var C=x.style||"";x.style=C+"float: left;"},k=function(x){x.externalResourcesRequired=!0},P=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},A=function(x){var C=Object.keys(x);return C.length?" "+C.map(function(R){return R+'="'+x[R]+'"'}).join(" "):""},E=function(x,C,R){var N=v.serializeToString(x);y.validateXHTML(N);var U=g(C);return w(U),k(U),'<svg xmlns="http://www.w3.org/2000/svg"'+A(d(C,R))+">"+P()+"<foreignObject"+A(U)+">"+N+"</foreignObject></svg>"};return m.getSvgForDocument=function(x,C,R){return p.rewriteTagNameSelectorsToLowerCase(x),E(x,C,R)},m.drawDocumentAsSvg=function(x,C){return["hover","active","focus","target"].forEach(function(R){C[R]&&p.fakeUserAction(x,C[R],R)}),y.calculateDocumentContentSize(x,C).then(function(R){return m.getSvgForDocument(x,R,C.zoom)})},m}(a,f,u,r),S=function(_,y,p,v,m,d){var g={},w=function(x){return{message:"Error rendering page",originalError:x}},k=function(x){return m.renderSvg(x).then(function(C){return{image:C,svg:x}},function(C){throw w(C)})},P=function(x,C){try{C.getContext("2d").drawImage(x,0,0)}catch(R){throw w(R)}},A=function(x,C,R){return v.drawDocumentAsSvg(x,R).then(k).then(function(N){return C&&P(N.image,C),N})},E=function(x,C){return y.executeJavascript(x,C).then(function(R){var N=R.document;return p.persistInputValues(N),{document:N,errors:R.errors,cleanUp:R.cleanUp}})};return g.rasterize=function(x,C,R){var N;return N=_.clone(R),N.inlineScripts=R.executeJs===!0,d.inlineReferences(x,N).then(function(U){return R.executeJs?E(x,R).then(function(G){return{element:G.document.documentElement,errors:U.concat(G.errors),cleanUp:G.cleanUp}}):{element:x,errors:U,cleanUp:function(){}}}).then(function(U){return A(U.element,C,R).then(function(G){return U.cleanUp(),{image:G.image,svg:G.svg,errors:U.errors}})})},g}(a,f,u,O,h,i),b=function(_,y,p){var v={},m=function(P,A){var E=300,x=200,C=P?P.width:E,R=P?P.height:x,N=A.width!==void 0?A.width:C,U=A.height!==void 0?A.height:R;return{width:N,height:U}},d=function(P){var A=m(P.canvas,P.options),E;return E=_.clone(P.options),E.width=A.width,E.height=A.height,E};v.drawDocument=function(){var P=arguments[0],A=Array.prototype.slice.call(arguments,1),E=_.parseOptionalParameters(A),x=P.documentElement?P.documentElement:P;return p.rasterize(x,E.canvas,d(E))};var g=function(P,A,E){var x=y.parseHTML(P);return v.drawDocument(x,A,E)};v.drawHTML=function(){var P=arguments[0],A=Array.prototype.slice.call(arguments,1),E=_.parseOptionalParameters(A);return g(P,E.canvas,E.options)};var w=function(P,A,E){var x=document.implementation.createHTMLDocument("");x.replaceChild(P.documentElement,x.documentElement);var C=E?_.clone(E):{};return E.baseUrl||(C.baseUrl=A),{document:x,options:C}},k=function(P,A,E){return y.loadDocument(P,E).then(function(x){var C=w(x,P,E);return v.drawDocument(C.document,A,C.options)})};return v.drawURL=function(){var P=arguments[0],A=Array.prototype.slice.call(arguments,1),E=_.parseOptionalParameters(A);return k(P,E.canvas,E.options)},v}(a,f,S);return b})})(oS);var sj=oS.exports;(function(e){var t=ve&&ve.__createBinding||(Object.create?function(g,w,k,P){P===void 0&&(P=k);var A=Object.getOwnPropertyDescriptor(w,k);A&&!("get"in A?!w.__esModule:A.writable||A.configurable)||(A={enumerable:!0,get:function(){return w[k]}}),Object.defineProperty(g,P,A)}:function(g,w,k,P){P===void 0&&(P=k),g[P]=w[k]}),r=ve&&ve.__setModuleDefault||(Object.create?function(g,w){Object.defineProperty(g,"default",{enumerable:!0,value:w})}:function(g,w){g.default=w}),n=ve&&ve.__importStar||function(g){if(g&&g.__esModule)return g;var w={};if(g!=null)for(var k in g)k!=="default"&&Object.prototype.hasOwnProperty.call(g,k)&&t(w,g,k);return r(w,g),w};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=e.isContentWrapping=e.prerenderFont=e.resetStyleContent=void 0;const i=n(sj),a=Js,o=p2;e.resetStyleContent=`
|
|
159
|
+
p {
|
|
160
|
+
margin: 0;
|
|
161
|
+
padding: 0;
|
|
162
|
+
word-wrap: break-word; /* Required for Firefox */
|
|
163
|
+
/* a text may have several spaces, we need to preserve them */
|
|
164
|
+
white-space: pre-wrap;
|
|
165
|
+
}
|
|
166
|
+
ul, ol {
|
|
167
|
+
list-style-position: outside;
|
|
168
|
+
margin: 0;
|
|
169
|
+
padding: 0;
|
|
170
|
+
display: inline-block;
|
|
171
|
+
text-align: left;
|
|
172
|
+
width: 100%;
|
|
173
|
+
}
|
|
174
|
+
li {
|
|
175
|
+
margin-left: 1.7em;
|
|
176
|
+
padding-left: 0.5em; /* This should match the margin-left value */
|
|
177
|
+
}
|
|
178
|
+
/* Add resets */
|
|
179
|
+
ul {
|
|
180
|
+
list-style-type: disc;
|
|
181
|
+
}
|
|
182
|
+
ol {
|
|
183
|
+
list-style-type: decimal;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
`;const l=`
|
|
187
|
+
<style>
|
|
188
|
+
html, body {
|
|
189
|
+
padding: 0;
|
|
190
|
+
margin: 0;
|
|
191
|
+
}
|
|
192
|
+
${e.resetStyleContent}
|
|
193
|
+
</style>
|
|
194
|
+
`;let u;const f=()=>(u||(u=document.createElement("div"),u.id="polotno-hidden-do-not-touch",u.style.overflow="hidden",u.style.position="relative",document.body.appendChild(u),u.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),u),h=new Map,O=navigator.userAgent.includes("Firefox"),S=async g=>{if(h.has(g))return h.get(g);const w=(async()=>{const k=`<div style="font-family: ${g}; font-size: 100px;">${g}<strong>${g}</strong></div>`,P=document.createElement("div");P.innerHTML=k,P.style.visibility="hidden",P.style.position="absolute";const A=f();A.appendChild(P);const E=O?180:50;await new Promise(x=>setTimeout(x,E)),A.removeChild(P)})();return h.set(g,w),w};function b({html:g}){const w=document.createElement("div");w.innerHTML=g,w.style.display="inline-block",w.style.position="fixed",w.style.top="0px",w.style.left="0px",w.style.zIndex="1000",w.style.whiteSpace="nowrap",w.style.visibility="hidden";const k=f();k.appendChild(w);const P=w.textContent,A=w.childNodes[0],E=P.split(/\s+/);let x=!1;for(let C=0;C<E.length;C++){const R=E[C];if(A.textContent=R,x=A.scrollWidth>w.clientWidth,x)break}return k.removeChild(w),x}function _(g){g.indexOf("Avellino");const w=document.createElement("div");w.innerHTML=g,w.style.display="inline-block",w.style.position="fixed",w.style.top="0px",w.style.left="0px",w.style.zIndex="1000";const k=f();k.appendChild(w);const P=w.getBoundingClientRect();return k.removeChild(w),{width:P.width,height:P.height}}e.prerenderFont=S,e.isContentWrapping=b,e.detectSize=_;const y={};function p(g){const w=[];for(const k of document.styleSheets)try{for(const P of k.cssRules)P instanceof CSSFontFaceRule&&P.style.fontFamily.replace(/['"]/g,"")===g&&w.push(P)}catch(P){console.warn(`Could not access stylesheet: ${k.href}`,P)}return w}const v={},m=g=>{if(v[g])return v[g];const w=p(g).filter(k=>k.style.fontFamily.replace(/['"]/g,"")===g).map(k=>({src:k.style.src,fontStyle:k.style.fontStyle||"normal",fontWeight:k.style.fontWeight||"normal"}));return v[g]=w,w};async function d({html:g,width:w,height:k,fontFamily:P,padding:A,font:E,pixelRatio:x}){if(P!=="Arial"&&!E){const U=(0,a.getGoogleFontsVariants)();g+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${P}:${U}" rel="stylesheet">`}if(E){const U=E.styles||(E.url?[{src:`url("${E.url}")`}]:m(P));g+="<style>",U.forEach(G=>{g+=`
|
|
195
|
+
@font-face {
|
|
196
|
+
font-family: '${P}';
|
|
197
|
+
src: ${G.src};
|
|
198
|
+
font-style: ${G.fontStyle||"normal"};
|
|
199
|
+
font-weight: ${G.fontWeight||"normal"};
|
|
200
|
+
}
|
|
201
|
+
`}),g+="</style>"}g+=l;const C=document.createElement("canvas"),R=await i.drawHTML(`<div style="padding: ${A}px;">${g}</div>`,C,{width:w+2*A,height:k+2*A,cacheBucket:y});(0,o.trySetCanvasSize)(C,(w+2*A)*x,(k+2*A)*x);const N=C.getContext("2d");return N==null||N.drawImage(R.image,0,0,C.width,C.height),C}e.htmlToCanvas=d})(g2);var _2={},w2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.styled=e.setup=e.keyframes=e.glob=e.extractCss=e.css=void 0;let t={data:""},r=d=>typeof window=="object"?((d?d.querySelector("#_goober"):window._goober)||Object.assign((d||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:d||t,n=d=>{let g=r(d),w=g.data;return g.data="",w},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,g)=>{let w="",k="",P="";for(let A in d){let E=d[A];A[0]=="@"?A[1]=="i"?w=A+" "+E+";":k+=A[1]=="f"?o(E,A):A+"{"+o(E,A[1]=="k"?"":g)+"}":typeof E=="object"?k+=o(E,g?g.replace(/([^,])+/g,x=>A.replace(/(^:.*)|([^,])+/g,C=>/&/.test(C)?C.replace(/&/g,x):x?x+" "+C:C)):A):E!=null&&(A=A.replace(/[A-Z]/g,"-$&").toLowerCase(),P+=o.p?o.p(A,E):A+":"+E+";")}return w+(g&&P?g+"{"+P+"}":P)+k},l={},u=d=>{if(typeof d=="object"){let g="";for(let w in d)g+=w+u(d[w]);return g}return d},f=(d,g,w,k,P)=>{let A=u(d),E=l[A]||(l[A]=(x=>{let C=0,R=11;for(;C<x.length;)R=101*R+x.charCodeAt(C++)>>>0;return"go"+R})(A));if(!l[E]){let x=A!==d?d:(C=>{let R,N=[{}];for(;R=i.exec(C.replace(a,""));)R[4]?N.shift():R[3]?N.unshift(N[0][R[3]]=N[0][R[3]]||{}):N[0][R[1]]=R[2];return N[0]})(d);l[E]=o(P?{["@keyframes "+E]:x}:x,w?"":"."+E)}return((x,C,R)=>{C.data.indexOf(x)==-1&&(C.data=R?x+C.data:C.data+x)})(l[E],g,k),E},h=(d,g,w)=>d.reduce((k,P,A)=>{let E=g[A];if(E&&E.call){let x=E(w),C=x&&x.props&&x.props.className||/^go/.test(x)&&x;E=C?"."+C:x&&typeof x=="object"?x.props?"":o(x,""):x===!1?"":x}return k+P+(E??"")},"");function O(d){let g=this||{},w=d.call?d(g.p):d;return f(w.unshift?w.raw?h(w,[].slice.call(arguments,1),g.p):w.reduce((k,P)=>Object.assign(k,P&&P.call?P(g.p):P),{}):w,r(g.target),g.g,g.o,g.k)}e.extractCss=n,e.css=O;let S,b,_,y=O.bind({g:1}),p=O.bind({k:1});function v(d,g,w,k){o.p=g,S=d,b=w,_=k}function m(d,g){let w=this||{};return function(){let k=arguments;function P(A,E){let x=Object.assign({},A),C=x.className||P.className;w.p=Object.assign({theme:b&&b()},x),w.o=/ *go\d+/.test(C),x.className=O.apply(w,k)+(C?" "+C:""),g&&(x.ref=E);let R=d;return d[0]&&(R=x.as||d,delete x.as),_&&R[0]&&_(x),S(R,x)}return g?g(P):P}}e.glob=y,e.keyframes=p,e.setup=v,e.styled=m})(w2);var uj=ve&&ve.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_2,"__esModule",{value:!0});const cj=uj(rt),w_=w2;(0,w_.setup)(cj.default.createElement),_2.default=w_.styled;(function(e){var t=ve&&ve.__createBinding||(Object.create?function(L,M,D,B){B===void 0&&(B=D);var q=Object.getOwnPropertyDescriptor(M,D);q&&!("get"in q?!M.__esModule:q.writable||q.configurable)||(q={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(L,B,q)}:function(L,M,D,B){B===void 0&&(B=D),L[B]=M[D]}),r=ve&&ve.__setModuleDefault||(Object.create?function(L,M){Object.defineProperty(L,"default",{enumerable:!0,value:M})}:function(L,M){L.default=M}),n=ve&&ve.__importStar||function(L){if(L&&L.__esModule)return L;var M={};if(L!=null)for(var D in L)D!=="default"&&Object.prototype.hasOwnProperty.call(L,D)&&t(M,L,D);return r(M,L),M},i=ve&&ve.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.quillRef=void 0;const a=i(rt),o=Zn,l=Ta,u=i(TD),f=i(wi),h=n(Yi),O=Kn,S=Xc,b=Zy,_=Yc,y=g2,p=kl,v=Tl,m=Kc,d=i(_2),g=Gi,w=e2,k=n(Js),P=To,A=f2;e.quillRef=h.observable({enabled:!1,currentFormat:{},editor:h.observable.object({instance:null},{},{deep:!1})});const E=(0,d.default)("div",a.default.forwardRef)`
|
|
202
|
+
.ql-editor {
|
|
203
|
+
outline: none;
|
|
204
|
+
}
|
|
205
|
+
${y.resetStyleContent}
|
|
206
|
+
strong {
|
|
207
|
+
font-weight: 700;
|
|
208
|
+
}
|
|
209
|
+
.ql-direction-rtl {
|
|
210
|
+
direction: rtl;
|
|
211
|
+
}
|
|
212
|
+
`,x=L=>new u.default(L,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["bold","color","font","italic","size","strike","underline","indent","list","direction"]});e.createQuill=x;const C=(L,M)=>{var D=L.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+M+"<p><br></p></div>");L.setContents(D),L.history.clear()};e.setQuillContent=C;const R=({html:L,onBlur:M,onChange:D,element:B})=>{const q=a.default.useRef(null);a.default.useEffect(()=>{if(!q.current)return;const z=(0,e.createQuill)(q.current);return h.runInAction(()=>{e.quillRef.editor.instance=z}),window.__polotnoQuill=z,z.on("text-change",()=>{z.getSelection()&&h.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()}),setTimeout(()=>{var $;const F=($=q.current)===null||$===void 0?void 0:$.childNodes[0];D(F.innerHTML)},10)}),z.setSelection(0,0,"api"),z.on("selection-change",$=>{$||M(),$&&h.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()})}),q.current.childNodes[0].addEventListener("blur",$=>{var F;!((F=$.relatedTarget)===null||F===void 0)&&F.classList.contains("ql-clipboard")||M()}),()=>{h.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var z;const $=e.quillRef.editor.instance;if(!$)return;const F=$.getSelection();((z=q.current)===null||z===void 0?void 0:z.childNodes[0].innerHTML)===B.text||((0,e.setQuillContent)($,L),F&&($.setSelection(F.index,F.length),h.runInAction(()=>{e.quillRef.currentFormat=$.getFormat()})))},[B.text]);const K={color:B.fill};return B.fill.indexOf("gradient")>=0&&(K.backgroundColor=B.fill,K.backgroundImage=B.fill,K.backgroundSize="100% 100%",K.backgroundRepeat="repeat",K.webkitBackgroundClip="text",K.MozBackgroundClip="text",K.WebkitTextFillColor="transparent",K.MozTextFillColor="transparent"),a.default.createElement(E,{ref:q,style:Object.assign(Object.assign({},K),{fontSize:B.fontSize,width:B.a.width,fontFamily:B.fontFamily,lineHeight:B.lineHeight,letterSpacing:B.letterSpacing+"rem",textAlign:B.align}),dir:(0,b.getDir)((0,w.removeTags)(B.text))})};function N(L,M,D){return a.default.useMemo(()=>(0,y.detectSize)(L),[L,M.width,D])}function U(L){const M=L.getContext("2d").getImageData(0,0,L.width,L.height).data;for(let D=0;D<M.length;D+=4)if(M[D+3]!==0)return!0;return!1}function G(L){return!U(L)}function Z(L,{fontFamily:M="",color:D="black"}={}){let B=`color: ${D||L.fill}`;return L.fill.indexOf("gradient")>=0&&(B=`
|
|
213
|
+
background-color: ${D};
|
|
214
|
+
background-image: ${L.fill};
|
|
215
|
+
background-size: 100% 100%;
|
|
216
|
+
background-repeat: repeat;
|
|
217
|
+
-webkit-background-clip: text;
|
|
218
|
+
-moz-background-clip: text;
|
|
219
|
+
-webkit-text-fill-color: transparent;
|
|
220
|
+
-moz-text-fill-color: transparent;
|
|
221
|
+
`),`<div style="${["white-space: pre-wrap",`width: ${Math.round(L.width||100)}px`,B,`font-size: ${L.fontSize}px`,`font-family: '${M}'`,`text-align: ${L.align}`,L.textDecoration?`text-decoration: ${L.textDecoration}`:"",L.lineHeight?`line-height: ${L.lineHeight}`:"",L.letterSpacing?`letter-spacing: ${L.letterSpacing}rem`:"",L.fontStyle?`font-style: ${L.fontStyle}`:"",L.fontWeight?`font-weight: ${L.fontWeight}`:"",L.strokeWidth?`-webkit-text-stroke: ${L.strokeWidth}px ${L.stroke}`:"",L.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,b.getDir)((0,w.removeTags)(L.text))}">${L.text.replaceAll(`
|
|
222
|
+
`,"</br>")}</div>`}const W=L=>{let M=L.fontSize;for(let D=1;D<50;D++){const B=Z(Object.assign(Object.assign({},L.toJSON()),{fontSize:M}),{fontFamily:L.fontFamily}),{height:q}=(0,y.detectSize)(B),K=L.height&&q>L.height,z=(0,y.isContentWrapping)({html:B});if(!(K||z))break;M-=.5}return M},H=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:L,store:M})=>{const D=a.default.useRef(null),[B,q]=a.default.useState(),[K,z]=a.default.useState(!1),[$,F]=a.default.useState(!0),[Y,X]=a.default.useState(!1),Q=a.default.useRef(L.height),J=M.selectedShapes.indexOf(L)>=0,re=L.fontSize/3,{textVerticalResizeEnabled:ie}=O.flags,ne=(0,b.usePrevious)(L.fontFamily),[ae]=(0,b.useFontLoader)(M,L.fontFamily),ke=L._editModeEnabled;(0,p.useFadeIn)(D);const Ae=ae?L.fontFamily:ne!==L.fontFamily?ne:"Arial",oe=(0,_.useColor)(L).fill,ce=Z(L,{fontFamily:Ae,color:oe}),{width:_e,height:ye}=N(ce,L,ae);a.default.useEffect(()=>{if(!ae)return;if(!L.height)return void L.set({height:ye});const{textOverflow:Re}=O.flags;if(Re!=="change-font-size"||K)Re==="resize"&&(ie&&L.height<ye&&M.history.ignore(()=>{L.set({height:ye})}),ie||L.height===ye||M.history.ignore(()=>{L.set({height:ye})}));else{const Pe=W(L);Pe!==L.fontSize?M.history.ignore(()=>{L.set({fontSize:Pe})}):L.height!==ye&&(ie&&L.height<ye?M.history.ignore(()=>{L.set({height:ye})}):ie||M.history.ignore(()=>{L.set({height:ye})}))}});const te=a.default.useRef(0),le=a.default.useMemo(()=>{const Re={lastArgs:null,lastResult:null};return async function(Pe){return Re.lastArgs&&Re.lastResult&&(Oe=Re.lastArgs,Ne=Pe,JSON.stringify(Oe)===JSON.stringify(Ne))||(Re.lastResult=await(0,y.htmlToCanvas)(Pe),Re.lastArgs=Object.assign({},Pe)),Re.lastResult;var Oe,Ne}},[]);a.default.useEffect(()=>{K||ke||(async()=>{te.current++;const Re=te.current,Pe=(0,g.incrementLoader)(`text ${L.id}`);F(!0);let Oe=null;const Ne=H?5:1;for(let Je=0;Je<Ne;Je++){if(Oe=await(Je>0?le:y.htmlToCanvas)({skipCache:Je>0,html:ce,width:L.width||1,height:L.height||ye||1,fontFamily:Ae,padding:re,pixelRatio:M._elementsPixelRatio,font:M.fonts.find(de=>de.fontFamily===Ae)||k.globalFonts.find(de=>de.fontFamily===Ae)}),Re!==te.current)return void Pe();G(Oe)&&H&&await new Promise(de=>setTimeout(de,50*(Je+1)))}Oe?(q(Oe),F(!1),f.default.Util.requestAnimFrame(Pe)):Pe()})()},[ce,K,ye,ke,Ae,L.height,M._elementsPixelRatio]);const me=K||$;a.default.useEffect(()=>h.autorun(()=>{const Re=D.current;(0,S.applyFilter)(Re,L)}),[B,me,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);let Ee=0;L.verticalAlign==="middle"&&(Ee=(L.height-ye)/2),L.verticalAlign==="bottom"&&(Ee=L.height-ye);const We=(0,b.getLineHeight)({fontLoaded:ae,fontFamily:L.fontFamily,fontSize:L.fontSize,lineHeight:L.lineHeight}),Qe=(0,P.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:L.a.x,y:L.a.y,offsetX:L.backgroundPadding*(L.fontSize*We*.5),offsetY:L.backgroundPadding*(L.fontSize*We*.5),rotation:L.a.rotation,hideInExport:!L.showInExport,listening:!1,visible:L.backgroundEnabled,opacity:L.backgroundOpacity*L.a.opacity,fill:L.backgroundColor,width:L.a.width+L.backgroundPadding*(L.fontSize*We),height:L.a.height+L.backgroundPadding*(L.fontSize*We),cornerRadius:L.backgroundCornerRadius*(L.fontSize*We*.5)}),a.default.createElement(l.Rect,{ref:D,name:"element",x:L.a.x,y:L.a.y,listening:L.selectable,rotation:L.a.rotation,width:L.a.width,height:L.a.height,visible:!me,draggable:Qe?L.draggable&&J:L.draggable,preventDefault:!Qe||J,opacity:ke?0:L.a.opacity,hideInExport:!L.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Re=>{L.set({x:Re.target.x(),y:Re.target.y()})},onDragEnd:Re=>{L.set({x:Re.target.x(),y:Re.target.y()})},id:L.id,onDblClick:()=>{L.contentEditable&&L.toggleEditMode(!0)},onDblTap:()=>{L.contentEditable&&L.toggleEditMode(!0)},onTransformStart:Re=>{z(!0),Q.current=L.height},onTransform:Re=>{var Pe;const Oe=Re.target,Ne=((Pe=Oe.getStage())===null||Pe===void 0?void 0:Pe.findOne("Transformer")).getActiveAnchor(),Je=Ne==="middle-left"||Ne==="middle-right",fe=Ne==="top-center"||Ne==="bottom-center",de=Oe.scaleX();if(Je){const Xe=Oe.scaleX(),be=Math.max(Oe.width()*Xe,L.fontSize);if(Oe.width(be),Oe.scaleX(1),O.flags.textVerticalResizeEnabled){const Ie=Math.max(ye,Q.current);L.set({height:Ie})}L.set({width:be,x:Oe.x(),y:Oe.y()})}else if(fe){let Xe=O.flags.textOverflow==="resize"?ye:L.lineHeight*L.fontSize;const be=Math.max(Xe,Re.target.height()*Re.target.scaleY());Oe.scaleY(1),L.set({x:Oe.x(),y:Oe.y(),height:be,rotation:Oe.rotation()})}else Oe.scaleX(1),Oe.scaleY(1),L.set({fontSize:L.fontSize*de,width:Oe.width()*de,x:Oe.x(),y:Oe.y(),rotation:Oe.rotation(),height:Oe.height()*de})},onTransformEnd:Re=>{z(!1),F(!0);const Pe=Re.target.scaleX();Re.target.scaleX(1),Re.target.scaleY(1),L.set({fontSize:L.fontSize*Pe,width:Re.target.width()*Pe,x:Re.target.x(),y:Re.target.y(),rotation:Re.target.rotation(),shadowBlur:L.shadowBlur*Pe,shadowOffsetX:L.shadowOffsetX*Pe,shadowOffsetY:L.shadowOffsetY*Pe,strokeWidth:L.strokeWidth*Pe})}}),a.default.createElement(l.Image,{ref:D,image:B,x:L.a.x,y:L.a.y,offsetX:re,offsetY:re-Ee,listening:!1,rotation:L.rotation,width:L.a.width+2*re,height:L.a.height+2*re,visible:!me,opacity:ke?0:L.a.opacity,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,hideInExport:!L.showInExport}),me&&a.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},a.default.createElement(m.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(E,{dangerouslySetInnerHTML:{__html:ce},style:{pointerEvents:"none",display:"inline-block"}}))),ke&&a.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},a.default.createElement(m.Html,null,a.default.createElement(R,{html:ce,element:L,onChange:Re=>{const Pe=(0,A.getLimitedFontSize)({oldText:(0,w.removeTags)(L.text),newText:(0,w.removeTags)(Re),element:L});L.set({text:Re,fontSize:Pe})},onBlur:Re=>{L.toggleEditMode(!1)}}))),(J||Y)&&a.default.createElement(v.Highlighter,{element:L}))})})(iS);var fS={},S2={},nu={};(function(e){function t(u){return u/180*Math.PI}function r(u,f,h,O,S){const b=Math.sqrt(h*h+O*O);return S+=Math.atan2(O,h),{x:u+b*Math.cos(S),y:f+b*Math.sin(S)}}function n(u){const{x:f,y:h,width:O,height:S}=u,b=t(u.rotation),_=r(f,h,0,0,b),y=r(f,h,O,0,b),p=r(f,h,O,S,b),v=r(f,h,0,S,b),m=Math.min(_.x,y.x,p.x,v.x),d=Math.min(_.y,y.y,p.y,v.y),g=Math.max(_.x,y.x,p.x,v.x),w=Math.max(_.y,y.y,p.y,v.y);return{x:m,y:d,width:g-m,height:w-d,minX:m,minY:d,maxX:g,maxY:w}}function i(u){const f=u.map(_=>n(_)),h=Math.min(...f.map(_=>_.minX)),O=Math.min(...f.map(_=>_.minY)),S=Math.max(...f.map(_=>_.maxX)),b=Math.max(...f.map(_=>_.maxY));return{x:h,y:O,width:S-h,height:b-O,minX:h,minY:O,maxX:S,maxY:b}}function a(u){const f=t(u.rotation||0);return{x:u.x+u.width/2*Math.cos(f)+u.height/2*Math.sin(-f),y:u.y+u.height/2*Math.cos(f)+u.width/2*Math.sin(f)}}function o(u,f,h){const O=t(f),S=h.x+(u.x-h.x)*Math.cos(O)-(u.y-h.y)*Math.sin(O),b=h.y+(u.x-h.x)*Math.sin(O)+(u.y-h.y)*Math.cos(O);return Object.assign(Object.assign({},u),{rotation:u.rotation+f,x:S,y:b})}function l(u,f){return o(u,f,a(u))}Object.defineProperty(e,"__esModule",{value:!0}),e.rotateAroundCenter=e.rotateAroundPoint=e.getCenter=e.getTotalClientRect=e.getClientRect=e.degToRad=void 0,e.degToRad=t,e.getClientRect=n,e.getTotalClientRect=i,e.getCenter=a,e.rotateAroundPoint=o,e.rotateAroundCenter=l})(nu);(function(e){var t=ve&&ve.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=e.setSnapFilterFunc=void 0;const r=t(rt),n=t(wi),i=nu;var a=5;let o=({targetKonvaNodes:b,guideKonvaNode:_,distance:y,snapDirection:p})=>y<a;const l=b=>{o=b};function u(b){const _=b.__getNodeRect(),y=(0,i.getClientRect)(Object.assign(Object.assign({},_),{rotation:n.default.Util.radToDeg(_.rotation)})),p=b.getAbsolutePosition();return{vertical:[{guide:y.x,offset:p.x-y.x,snap:"start",nodes:b.nodes()},{guide:y.x+y.width/2,offset:p.x-y.x-y.width/2,snap:"center",nodes:b.nodes()},{guide:y.x+y.width,offset:p.x-y.x-y.width,snap:"end",nodes:b.nodes()}],horizontal:[{guide:y.y,offset:p.y-y.y,snap:"start",nodes:b.nodes()},{guide:y.y+y.height/2,offset:p.y-y.y-y.height/2,snap:"center",nodes:b.nodes()},{guide:y.y+y.height,offset:p.y-y.y-y.height,snap:"end",nodes:b.nodes()}]}}function f(b,_){var y=[],p=[];b.vertical.forEach(k=>{_.vertical.forEach(P=>{var A=Math.abs(k.offset-P.guide);o({targetKonvaNodes:P.nodes,guideKonvaNode:k.node,distance:A,snapDirection:k.snap})&&y.push({lineGuide:k.offset,diff:A,snap:P.snap,offset:P.offset})})}),b.horizontal.forEach(k=>{_.horizontal.forEach(P=>{var A=Math.abs(k.offset-P.guide);o({targetKonvaNodes:P.nodes,guideKonvaNode:k.node,distance:A,snapDirection:k.snap})&&p.push({lineGuide:k.offset,diff:A,snap:P.snap,offset:P.offset})})});var v=[];const m=y.sort((k,P)=>k.diff-P.diff),d=p.sort((k,P)=>k.diff-P.diff);var g=m[0],w=d[0];return g&&m.filter(k=>Math.abs(k.diff-g.diff)<.1).forEach(k=>{v.push(Object.assign({orientation:"V"},k))}),w&&d.filter(k=>Math.abs(k.diff-w.diff)<.1).forEach(k=>{v.push(Object.assign({orientation:"H"},k))}),v}function h(b,_){const y=r.default.useRef(),p=k=>k.hasName("element")||k.hasName("page-background")||!y.current&&k.hasName("elements-area");function v(k){var P;const A=(P=b.current)===null||P===void 0?void 0:P.getStage(),E=[],x=[];return A.find(p).forEach(C=>{if(!(k.indexOf(C)>=0)){var R=C.getClientRect({skipShadow:!0,skipStroke:!0});E.push({offset:R.x,node:C,snap:"start"},{offset:R.x+R.width,node:C,snap:"end"},{offset:R.x+R.width/2,node:C,snap:"center"}),x.push({offset:R.y,node:C,snap:"start"},{offset:R.y+R.height,node:C,snap:"end"},{offset:R.y+R.height/2,node:C,snap:"center"})}}),{vertical:E,horizontal:x}}function m(k){var P;const A=(P=b.current)===null||P===void 0?void 0:P.getLayer(),E=A==null?void 0:A.children.find(x=>x.name()==="line-guides");k.forEach(x=>{if(x.orientation==="H"){var C=new n.default.Line({points:[-6e3,x.lineGuide,6e3,x.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});E==null||E.add(C),A.batchDraw()}else x.orientation==="V"&&(C=new n.default.Line({points:[x.lineGuide,-6e3,x.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),E==null||E.add(C))})}const d=k=>{const P=k.target.getLayer().children.find(N=>N.name()==="line-guides");P==null||P.destroyChildren();var A=f(v(k.target.nodes()),u(k.target));if(!A.length)return;m(A);const E=k.target.getAbsolutePosition(),x=(k.target.nodes().map(N=>N.getAbsolutePosition()),Object.assign({},E));A.forEach(N=>{switch(N.snap){case"start":case"center":case"end":switch(N.orientation){case"V":x.x=N.lineGuide+N.offset;break;case"H":x.y=N.lineGuide+N.offset}}});const C=x.x-E.x,R=x.y-E.y;k.evt.ctrlKey||k.evt.metaKey||k.target.nodes().forEach(N=>{const U=N.getAbsolutePosition();N.setAbsolutePosition({x:U.x+C,y:U.y+R})})},g=(k,P,A)=>{const E=b.current,x=E.getLayer(),C=x.children.find(W=>W.name()==="line-guides");if(C==null||C.destroyChildren(),E.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(P.x-k.x,2)+Math.pow(P.y-k.y,2))>50||!x)return P;var R=f(v(E.nodes()),{vertical:[{guide:P.x,offset:0,snap:"start",nodes:E.nodes()}],horizontal:[{guide:P.y,offset:0,snap:"start",nodes:E.nodes()}]});if(!R.length||(m(R),A.ctrlKey||A.metaKey))return P;let N=P.x,U=P.x;R.forEach(W=>{switch(W.orientation){case"V":N=W.lineGuide;break;case"H":U=W.lineGuide}});const G=Math.abs(P.x-N)<10,Z=Math.abs(P.y-U)<10;return G&&!Z?{x:N,y:k.y}:Z&&!G?{x:k.x,y:U}:G&&Z?{x:N,y:U}:P},w=k=>{if(!k.target)return;const P=k.target.getLayer(),A=P.children.find(E=>E.name()==="line-guides");A==null||A.destroyChildren(),P.batchDraw()};r.default.useEffect(()=>{b.current&&(b.current.anchorDragBoundFunc(g),b.current.on("dragstart",()=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const k=[...n.default.DD._dragElements.entries()],P=k.find(([A,E])=>E.node instanceof n.default.Transformer);k.splice(k.indexOf(P),1),k.unshift(P),n.default.DD._dragElements.clear(),k.forEach(([A,E])=>{n.default.DD._dragElements.set(A,E)})})}),b.current.on("dragmove",d),b.current.on("dragend",w),b.current.on("transformend",w),b.current.on("transform",k=>{var P,A;k.evt.ctrlKey||k.evt.metaKey?(P=b.current)===null||P===void 0||P.rotationSnapTolerance(0):(A=b.current)===null||A===void 0||A.rotationSnapTolerance(5)}))},[])}function O(b){return{vertical:[{guide:b.absolutePosition().x,offset:0,snap:"center",nodes:[b]}],horizontal:[{guide:b.absolutePosition().y,offset:0,snap:"center",nodes:[b]}]}}function S(b,_,y){const p=d=>d.hasName("element")||d.hasName("line-anchor")||d.hasName("page-background")||d.hasName("elements-area"),v=d=>{const g=d.target.getLayer().children.find(x=>x.name()==="line-guides");g==null||g.destroyChildren();var w=f(function(x){var C;const R=(C=b.current)===null||C===void 0?void 0:C.getStage();var N=[],U=[];return R.find(p).forEach(G=>{if(!(x.indexOf(G)>=0)){var Z=G.getClientRect({skipShadow:!0,skipStroke:!0});G.hasName("line-anchor")&&(Z={x:G.absolutePosition().x,y:G.absolutePosition().y,width:0,height:0}),N.push({offset:Z.x,node:G,snap:"start"},{offset:Z.x+Z.width,node:G,snap:"end"},{offset:Z.x+Z.width/2,node:G,snap:"center"}),U.push({offset:Z.y,node:G,snap:"start"},{offset:Z.y+Z.height,node:G,snap:"end"},{offset:Z.y+Z.height/2,node:G,snap:"center"})}}),{vertical:N,horizontal:U}}([d.target,..._.map(x=>x.current)]),O(d.target));if(!w.length)return;(function(x){var C;const R=(C=b.current)===null||C===void 0?void 0:C.getLayer(),N=R==null?void 0:R.children.find(U=>U.name()==="line-guides");x.forEach(U=>{if(U.orientation==="H"){var G=new n.default.Line({points:[-6e3,U.lineGuide,6e3,U.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});N==null||N.add(G),R.batchDraw()}else U.orientation==="V"&&(G=new n.default.Line({points:[U.lineGuide,-6e3,U.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),N==null||N.add(G))})})(w);const k=d.target.getAbsolutePosition(),P=Object.assign({},k);w.forEach(x=>{switch(x.snap){case"start":case"center":case"end":switch(x.orientation){case"V":P.x=x.lineGuide+x.offset;break;case"H":P.y=x.lineGuide+x.offset}}});const A=P.x-k.x,E=P.y-k.y;if(!(d.evt.ctrlKey||d.evt.metaKey)){const x=d.target.getAbsolutePosition();d.target.absolutePosition({x:x.x+A,y:x.y+E})}},m=d=>{if(!d.target)return;const g=d.target.getLayer(),w=g.children.find(k=>k.name()==="line-guides");w==null||w.destroyChildren(),g.batchDraw()};r.default.useEffect(()=>{b.current&&(b.current.on("dragmove",v),b.current.on("dragend",m))},y)}e.setSnapFilterFunc=l,e.useSnap=h,e.useAnchorSnap=S})(S2);(function(e){var t=ve&&ve.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(rt),n=Zn,i=Ta,a=Yc,o=Kc,l=Tl,u=S2,f=To;function h(_){const{x:y,y:p,width:v,height:m,rotation:d}=_.a,g=d*Math.PI/180,w={x:y+m/2*Math.cos(g+Math.PI/2),y:p+m/2*Math.sin(g+Math.PI/2)};return{middleLeft:w,middleRight:{x:w.x+v*Math.cos(g),y:w.y+v*Math.sin(g)}}}function O(_,y,p){const v=Math.sqrt(Math.pow(y.x-_.x,2)+Math.pow(y.y-_.y,2)),m=Math.atan2(y.y-_.y,y.x-_.x),d=180*m/Math.PI;return{x:_.x+Math.cos(m-Math.PI/2)*p/2,y:_.y+Math.sin(m-Math.PI/2)*p/2,width:v,height:p,rotation:d}}e.getMiddlePoints=h,e.getLinePositionFromMiddlePoints=O;const S=(_,y)=>({offsetX:5/_,offsetY:5/_,width:10/_,height:10/_,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:p=>{p.target.getStage().container().style.cursor="crosshair"},onMouseLeave:p=>{p.target.getStage().container().style.cursor=""},onDragStart:p=>{y.history.startTransaction()},onDragEnd:p=>{y.history.endTransaction()}}),b=(0,n.observer)(({element:_,type:y})=>{const p=(0,a.useColor)(_,_.a.color,"fill"),v=(0,a.useColor)(_,_.a.color,"stroke"),m=Object.assign(Object.assign(Object.assign({strokeWidth:_.height,lineCap:"round",lineJoin:"round"},v),p),{opacity:_.a.opacity,hideInExport:!_.showInExport});return r.default.createElement(r.default.Fragment,null,y==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*_.height,2*-_.height,0,0,3*_.height,2*_.height]},m)),y==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*_.height,2*-_.height,0,0,3*_.height,2*_.height],closed:!0},m)),y==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-_.height,0,2*_.height],closed:!0},m)),y==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-_.height,4*_.height,2*-_.height,4*_.height,2*_.height,0,2*_.height],closed:!0},m)),y==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*_.height,y:0,radius:2*_.height},m)))});e.LineElement=(0,n.observer)(({element:_,store:y})=>{const p=r.default.useRef(null),v=r.default.useRef(null),m=r.default.useRef(null),d=_.selectable||y.role==="admin",g=(0,f.isTouchDevice)(),[w,k]=r.default.useState(!1),P=y.selectedElements.indexOf(_)>=0&&y.selectedElements.length===1,A=y.selectedShapes.indexOf(_)>=0,{middleLeft:E,middleRight:x}=h(_);(0,u.useAnchorSnap)(v,[p],[P]),(0,u.useAnchorSnap)(m,[p],[P]);const C=(0,a.useColor)(_,_.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:p,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(R=>R*_.a.height)},C,{rotation:_.a.rotation,opacity:_.animated("opacity"),shadowEnabled:_.shadowEnabled,shadowBlur:_.shadowBlur,shadowOffsetX:_.shadowOffsetX,shadowOffsetY:_.shadowOffsetY,shadowColor:_.shadowColor,shadowOpacity:_.shadowOpacity,listening:d,draggable:g?_.draggable&&A:_.draggable,preventDefault:!g||A,hideInExport:!_.showInExport,onMouseEnter:()=>{k(!0)},onMouseLeave:()=>{k(!1)},onDragMove:R=>{_.set({x:R.target.x(),y:R.target.y()})},onDragEnd:R=>{_.set({x:R.target.x(),y:R.target.y()})},onTransform:R=>{const N=R.target.scaleX();R.target.scaleX(1),R.target.scaleY(1),_.set({height:_.height*N,width:_.width*N,x:R.target.x(),y:R.target.y(),rotation:R.target.rotation()})}})),r.default.createElement(i.Group,{x:E.x,y:E.y,rotation:_.rotation,hideInExport:!_.showInExport},r.default.createElement(b,{element:_,type:_.startHead})),r.default.createElement(i.Group,{x:x.x,y:x.y,rotation:_.rotation+180},r.default.createElement(b,{element:_,type:_.endHead})),(w||A&&!P)&&r.default.createElement(l.Highlighter,{element:_}),P&&_.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:P},r.default.createElement(i.Rect,Object.assign({x:E.x,y:E.y,ref:v,name:"line-anchor"},S(y.scale,y),{onDragMove:R=>{const N=O(R.target.position(),x,_.height);_.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:x.x,y:x.y,ref:m,name:"line-anchor"},S(y.scale,y),{onDragMove:R=>{const N=O(E,R.target.position(),_.height);_.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})))))})})(fS);var dS={};(function(e){var t=ve&&ve.__createBinding||(Object.create?function(L,M,D,B){B===void 0&&(B=D);var q=Object.getOwnPropertyDescriptor(M,D);q&&!("get"in q?!M.__esModule:q.writable||q.configurable)||(q={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(L,B,q)}:function(L,M,D,B){B===void 0&&(B=D),L[B]=M[D]}),r=ve&&ve.__setModuleDefault||(Object.create?function(L,M){Object.defineProperty(L,"default",{enumerable:!0,value:M})}:function(L,M){L.default=M}),n=ve&&ve.__importStar||function(L){if(L&&L.__esModule)return L;var M={};if(L!=null)for(var D in L)D!=="default"&&Object.prototype.hasOwnProperty.call(L,D)&&t(M,L,D);return r(M,L),M},i=ve&&ve.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(rt),o=Zn,l=Yi,u=Ta,f=i(Wp),h=i(wi),O=Kc,S=Tl,b=Gi,_=n(tu),y=Kn,p=Xc,v=kl,m=To;function d(){return document.createElement("canvas")}async function g(L){if(!(L.indexOf("data:image/svg+xml")>=0||L.indexOf(".svg")>=0))return L;const M=await _.urlToString(L),D=_.fixSize(M);return _.svgToURL(D)}const w=L=>{const[M,D]=a.default.useState(L);return a.default.useEffect(()=>{(async()=>{const B=await g(L);B!==M&&D(B)})()},[L]),M},k=new window.Image;k.src=_.svgToURL(`
|
|
223
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
224
|
+
<path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
|
|
225
|
+
<path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
226
|
+
</svg>
|
|
227
|
+
`);const P=new window.Image;P.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="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" fill="white"/>
|
|
230
|
+
<path opacity="0.6" d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" fill="white"/>
|
|
231
|
+
<path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
232
|
+
<path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
233
|
+
</svg>
|
|
234
|
+
`);function A(L,M,D,B,q,K,z){for(var $=new ImageData(M,D),F=new Int32Array(L.data.buffer),Y=L.width,X=new Int32Array($.data.buffer),Q=$.width,J=M/K,re=D/z,ie=Math.round(1/J),ne=Math.round(1/re),ae=ie*ne,ke=0;ke<$.height;ke++)for(var Ae=0;Ae<Q;Ae++){for(var oe=B+Math.round(Ae/J)+(q+Math.round(ke/re))*Y,ce=0,_e=0,ye=0,te=0,le=0;le<ne;le++)for(var me=0;me<ie;me++){var Ee=F[oe+me+le*Y];ce+=Ee<<24>>>24,_e+=Ee<<16>>>24,ye+=Ee<<8>>>24,te+=Ee>>>24}ce=Math.round(ce/ae),_e=Math.round(_e/ae),ye=Math.round(ye/ae),te=Math.round(te/ae),X[Ae+ke*Q]=te<<24|ye<<16|_e<<8|ce}return $}function E(L,M){var D,B;const q=d();q.width=L.width,q.height=L.height,(D=q.getContext("2d"))===null||D===void 0||D.drawImage(L,0,0,q.width,q.height);const K=A(q.getContext("2d").getImageData(0,0,q.width,q.height),Math.floor(q.width*M),Math.floor(q.height*M),0,0,q.width,q.height);return q.width=Math.floor(q.width*M),q.height=Math.floor(q.height*M),(B=q.getContext("2d"))===null||B===void 0||B.putImageData(K,0,0),q}const x=(L,M,D,B,q=0,K=!1)=>{const z=Math.floor(Math.max(L.width*B,1)),$=Math.floor(Math.max(L.height*B,1)),F=Math.min(q*B,z/2,$/2),Y=Math.max(L.width/D.width,L.height/D.height)*B,X=L.page._exportingOrRendering&&y.flags.imageDownScalingEnabled&&Y<1&&!K,Q=D.x===0&&D.y===0&&D.width===(M==null?void 0:M.width)&&D.height===(M==null?void 0:M.height),J=a.default.useMemo(()=>{if(!(!M||!M.width||!M.height))return Q&&F===0&&!X?void 0:d()},[M,F,X,Q]);return a.default.useLayoutEffect(()=>{if(!J||!M)return;J.width=z,J.height=$;const re=J.getContext("2d");if(!re)return;F&&(re.beginPath(),re.moveTo(F,0),re.lineTo(z-F,0),re.arc(z-F,F,F,3*Math.PI/2,0,!1),re.lineTo(z,$-F),re.arc(z-F,$-F,F,0,Math.PI/2,!1),re.lineTo(F,$),re.arc(F,$-F,F,Math.PI/2,Math.PI,!1),re.lineTo(0,F),re.arc(F,F,F,Math.PI,3*Math.PI/2,!1),re.clip());const ie=X?E(M,Y):M,ne=X?{x:Math.floor(D.x*Y),y:Math.floor(D.y*Y),width:Math.floor(D.width*Y),height:Math.floor(D.height*Y)}:D;re.drawImage(ie,ne.x,ne.y,ne.width,ne.height,0,0,J.width,J.height)},[J,L.width,L.height,D.x,D.y,D.width,D.height,q,B,K,L.page._exportingOrRendering,X]),a.default.useEffect(()=>()=>{J&&J.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(J)},[J]),J||M},C=(L,M,D,B)=>{const q=w(L.clipSrc||""),[K,z]=G(q,"anonymous"),$=L.clipSrc?z:"loaded";(0,e.useImageLoader)($,L.id+"-clip");const F=a.default.useMemo(()=>{if(M&&K)return d()},[M,K]);return a.default.useLayoutEffect(()=>{var Y;if(!K||!M||!M.width||!M.height||!K||!K.width||!K.height||!F)return;const X=d(),Q=Math.max(L.width/K.width*D,L.height/K.height*D);X.width=K.width*Q,X.height=K.height*Q,(Y=X.getContext("2d"))===null||Y===void 0||Y.drawImage(K,0,0,X.width,X.height),F.width=Math.max(M.width,1),F.height=Math.max(M.height,1);const J=F.getContext("2d");J&&(J.save(),J.drawImage(X,0,0,M.width,M.height),h.default.Util.releaseCanvas(X),J.globalCompositeOperation="source-in",J.drawImage(M,0,0,F.width,F.height),J.restore())},[F,M,K,L.width,L.height,D,...B]),L.clipSrc&&K?F:M},R=d(),N=(0,o.observer)(({element:L})=>{const M=Math.min(30,L.width/4,L.height/4),D=a.default.useRef(null);return a.default.useEffect(()=>{const B=D.current;if(!B)return;const q=new h.default.Animation(K=>{B.rotate(((K==null?void 0:K.timeDiff)||0)/2)},B.getLayer());return q.start(),()=>{q.stop()}}),a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},a.default.createElement(u.Rect,{width:L.width,height:L.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:D,x:L.width/2,y:L.height/2,fill:"white",outerRadius:Math.abs(M),innerRadius:Math.max(1,M-5),angle:270}))}),U=(0,o.observer)(({element:L})=>{const M="Can not load the video...",D=Math.max(10,Math.min(30,L.width/25));return a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},a.default.createElement(u.Rect,{width:L.width,height:L.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:M,fontSize:D,width:L.width,height:L.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let G=f.default;const Z=L=>{G=L};e.setImageLoaderHook=Z;const W=(L,M)=>{const D=a.default.useRef(),B=()=>{var q;(q=D.current)===null||q===void 0||q.call(D),D.current=void 0};a.default.useEffect(()=>B,[]),a.default.useLayoutEffect(()=>{L!=="loading"||D.current||(D.current=(0,b.incrementLoader)(`video ${M}`)),L!=="loading"&&B(),L==="failed"&&(0,b.triggerLoadError)(`video ${M}`)},[L])};e.useImageLoader=W;function H(L,M,D){const B=a.default.useRef("loading"),q=a.default.useRef(null),[K,z]=a.default.useState(0),$=a.default.useRef(),F=a.default.useRef(),Y=a.default.useRef();return $.current===L&&F.current===M&&Y.current===D||(B.current="loading",q.current=void 0,$.current=L,F.current=M,Y.current=D),a.default.useLayoutEffect(function(){if(L){var X=document.createElement("video");return X.addEventListener("canplay",Q),X.addEventListener("error",J),X.crossOrigin=M,X.src=L,function(){X.removeEventListener("canplay",Q),X.removeEventListener("error",J)}}function Q(){B.current="loaded",q.current=X,q.current.currentTime=0,z(Math.random()),q.current.removeEventListener("canplay",Q)}function J(re){B.current="failed",q.current=void 0,z(Math.random())}},[L,M,D]),[q.current,B.current]}e.VideoElement=(0,o.observer)(({element:L,store:M})=>{var D;const[B,q]=a.default.useState(!1),K=a.default.useRef(null),z=a.default.useRef(null),[$,F]=a.default.useState(!1),Y=M.selectedShapes.indexOf(L)>=0,[X,Q]=a.default.useState(!1),[J,re]=H(L.src,"anonymous"),ie=M.activePage===L.page;(0,e.useImageLoader)(re,L.id+"-video"),J&&(J.width=J.videoWidth,J.height=J.videoHeight);const ne=J||R;a.default.useEffect(()=>{J&&M.history.ignore(()=>{L.set({duration:1e3*J.duration})})},[J]),a.default.useEffect(()=>{var Le;if(!J)return;const je=ie&&(M.isPlaying||X);if(!je)return void J.pause();je&&(J.currentTime=L.startTime*J.duration,J.play());const Ve=new h.default.Animation(()=>{},(Le=K.current)===null||Le===void 0?void 0:Le.getLayer());Ve.start();const pt=()=>{Q(!1),J.currentTime=L.startTime*J.duration},Ot=()=>{J.currentTime>=L.endTime*J.duration&&(J.pause(),J.currentTime=L.startTime*J.duration,Q(!1))};return J.addEventListener("ended",pt),J.addEventListener("timeupdate",Ot),()=>{Ve.stop(),J.removeEventListener("ended",pt),J.removeEventListener("timeupdate",Ot)}},[J,X,M.isPlaying,ie]),a.default.useEffect(()=>{J&&(J.volume=L.volume)},[J,L.volume]);const ae=a.default.useRef();a.default.useEffect(()=>{const Le=(0,l.autorun)(()=>{var je,Ve;if(J){const pt=(M.currentTime-L.page.startTime)%L.duration;if(Math.abs(1e3*J.currentTime-pt)>500||!M.isPlaying){const Ot=pt/1e3;Ot!==J.currentTime&&(J.currentTime=Ot),J.readyState!==4&&!M.isPlaying&&!ae.current&&(ae.current=(0,b.incrementLoader)(`video ${L.id}`))}(Ve=(je=K.current)===null||je===void 0?void 0:je.getLayer())===null||Ve===void 0||Ve.batchDraw()}});return()=>{Le(),ae.current&&(ae.current(),ae.current=null)}},[M,J]),a.default.useEffect(()=>{if(!J)return;const Le=()=>{var Ve,pt;J.readyState!==4&&L.page._exportingOrRendering||ae.current&&((pt=(Ve=K.current)===null||Ve===void 0?void 0:Ve.getLayer())===null||pt===void 0||pt.batchDraw(),ae.current(),ae.current=null)};let je;return L.page._exportingOrRendering&&(je=setInterval(Le,50)),J.addEventListener("timeupdate",Le),J.addEventListener("canplay",Le),()=>{clearInterval(je),J.removeEventListener("timeupdate",Le),J.removeEventListener("canplay",Le)}},[L.page._exportingOrRendering,J,L.id,b.incrementLoader]);let{cropX:ke,cropY:Ae,cropWidth:oe,cropHeight:ce}=L;re!=="loaded"&&(ke=Ae=0,oe=ce=1);const _e=ne.width*oe,ye=ne.height*ce,te=L.width/L.height;let le,me;const Ee=_e/ye,We=L.type==="svg";We?(le=_e,me=ye):te>=Ee?(le=_e,me=_e/te):(le=ye*te,me=ye);const Qe={x:ne.width*ke,y:ne.height*Ae,width:le,height:me},Re=(D=L.cornerRadius)!==null&&D!==void 0?D:0;let Pe=C(L,x(L,ne,Qe,M._elementsPixelRatio,Re,B||L._cropModeEnabled||L.type==="svg"),M._elementsPixelRatio,[Qe,Re,M._elementsPixelRatio]);const Oe=Math.max(L.width/le,L.height/me);a.default.useEffect(()=>{var Le;if(!L._cropModeEnabled)return;const je=(Le=K.current)===null||Le===void 0?void 0:Le.getStage();function Ve(Ot){L._cropModeEnabled&&Ot.target!==z.current&&L.toggleCropMode(!1)}function pt(Ot){L._cropModeEnabled&&Ot.target.parentNode!==je.content&&L.toggleCropMode(!1)}return document.body.addEventListener("click",pt),je==null||je.on("click",Ve),je==null||je.on("tap",Ve),()=>{document.body.removeEventListener("click",pt),document.body.removeEventListener("touchstart",pt),je==null||je.off("click",Ve),je==null||je.off("click",Ve)}},[L._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(B||L._cropModeEnabled))return(0,p.applyFilter)(K.current,L),(0,l.autorun)(()=>{(0,p.applyFilter)(K.current,L)},{delay:100})},[ne,B,oe,ce,L._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Le;B||L._cropModeEnabled?(Le=K.current)===null||Le===void 0||Le.clearCache():(0,p.applyFilter)(K.current,L)},[B,L.width,L.height,L._cropModeEnabled]),a.default.useEffect(()=>{(0,p.applyFilter)(K.current,L)},[L.shadowEnabled,L.shadowBlur,L.cornerRadius,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);const Ne=a.default.useRef(null),Je=a.default.useRef(null),fe=a.default.useRef(null);a.default.useLayoutEffect(()=>{L._cropModeEnabled&&(Je.current.nodes([Ne.current]),fe.current.nodes([z.current]))},[L._cropModeEnabled]);const de=Le=>{Math.round(Le.target.x())>0&&(Le.target.x(0),Le.target.scaleX(1)),Math.round(Le.target.y())>0&&(Le.target.y(0),Le.target.scaleY(1));const je=Le.target.width()*Le.target.scaleX(),Ve=Le.target.height()*Le.target.scaleY(),pt=Math.min(1,le/je),Ot=Math.min(1,me/Ve),Qr=1-pt,Or=Math.min(Qr,Math.max(0,Math.round(-Le.target.x())/je)),Mr=1-Ot,Jr=Math.min(Mr,Math.max(0,Math.round(-Le.target.y())/Ve));Le.target.setAttrs({x:-Or*ne.width,y:-Jr*ne.height,scaleX:1,scaleY:1}),L.set({cropX:Or,cropY:Jr,cropWidth:pt,cropHeight:Ot})},Xe=()=>{L.type!=="svg"&&L.contentEditable&&setTimeout(()=>{L.toggleCropMode(!0)})},be=re==="loading",Ie=re==="failed",Me=!be&&!Ie,we=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),et=Me?L.a.opacity:0;(0,v.useFadeIn)(K,et);const Se=L.selectable||M.role==="admin",Ye=(0,m.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,be&&a.default.createElement(N,{element:L}),Ie&&a.default.createElement(U,{element:L}),a.default.createElement(u.Image,{ref:K,name:"element",id:L.id,image:ne,x:L.x,y:L.y,width:L.width||1,height:L.height||1,rotation:L.rotation,opacity:et,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,customCrop:Qe,listening:Se,cropX:Qe.x,cropY:Qe.y,cropWidth:Qe.width,cropHeight:Qe.height,draggable:Ye?L.draggable&&Y:L.draggable,preventDefault:!Ye||Y,hideInExport:!L.showInExport,onMouseEnter:()=>{F(!0)},onMouseLeave:()=>{F(!1)},onDragMove:Le=>{L.set({x:Le.target.x(),y:Le.target.y()})},onDragEnd:Le=>{L.set({x:Le.target.x(),y:Le.target.y()})},onDblClick:Xe,onDblTap:Xe,onTransformStart:()=>{q(!0),we.current={cropX:L.cropX,cropY:L.cropY,cropWidth:L.cropWidth,cropHeight:L.cropHeight}},onTransform:Le=>{var je;const Ve=Le.currentTarget,pt=Math.abs(Ve.scaleX()-1)<1e-7?1:Ve.scaleX(),Ot=Math.abs(Ve.scaleY()-1)<1e-7?1:Ve.scaleY();Ve.scaleX(1),Ve.scaleY(1);const Qr=(je=Le.target.getStage())===null||je===void 0?void 0:je.findOne("Transformer"),Or=1-le/ne.width,Mr=Math.min(Or,Math.max(0,L.cropX)),Jr=1-me/ne.height,Si=Math.min(Jr,Math.max(0,L.cropY)),yn=Qr.getActiveAnchor(),Gr=!(yn.indexOf("middle")>=0||yn.indexOf("center")>=0),Ra=!Gr&&pt<1&&we.current.cropHeight>me/ne.height;let Rn=Gr?L.cropWidth:L.cropWidth*pt;Ra&&(Rn=L.cropWidth);const De=!Gr&&Ot<1&&we.current.cropWidth>le/ne.width;let tt=Gr?L.cropHeight:L.cropHeight*Ot;De&&(tt=L.cropHeight),We&&(Rn=L.cropWidth,tt=L.cropHeight),L.set({cropX:Mr,cropY:Si,x:Ve.x(),y:Ve.y(),width:Ve.width()*pt,height:Ve.height()*Ot,rotation:Le.target.rotation(),cropWidth:Math.min(Rn,1-Mr),cropHeight:Math.min(tt,1-Si)})},onTransformEnd:Le=>{const je=Le.currentTarget;L.set({width:je.width(),height:je.height(),x:je.x(),y:je.y(),rotation:Le.target.rotation(),cropWidth:le/ne.width,cropHeight:me/ne.height}),q(!1)}}),a.default.createElement(u.Rect,{x:L.x,y:L.y,width:Math.max(L.width-L.borderSize,0),height:Math.max(L.height-L.borderSize,0),opacity:et,offsetX:-L.borderSize/2,offsetY:-L.borderSize/2,stroke:L.borderColor,strokeWidth:L.borderSize,listening:!1,visible:!!L.borderSize,rotation:L.rotation,cornerRadius:Math.max(0,Re-L.borderSize),hideInExport:!L.showInExport}),!X&&!M.isPlaying&&a.default.createElement(u.Image,{image:k,x:L.x+L.width/2-15/M.scale,y:L.y+L.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!0)}}),X&&!M.isPlaying&&a.default.createElement(u.Image,{image:P,x:L.x+L.width/2-15/M.scale,y:L.y+L.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!1)}}),L._cropModeEnabled&&a.default.createElement(O.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/M.scale,y:-window.innerWidth/M.scale,width:window.innerWidth/M.scale*3,height:window.innerWidth/M.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Pe,x:L.x,y:L.y,width:L.width,height:L.height,rotation:L.rotation,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur}),a.default.createElement(u.Group,{x:L.x,y:L.y,rotation:L.rotation,scaleX:Oe,scaleY:Oe},a.default.createElement(u.Image,{image:ne,ref:z,opacity:.4,draggable:!0,x:-L.cropX*ne.width,y:-L.cropY*ne.height,onDragMove:de,onTransform:de}),a.default.createElement(u.Transformer,{ref:fe,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Le,je)=>je.width<5||je.height<5?Le:je,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:le,height:me,ref:Ne,listening:!1,onTransform:Le=>{Le.target.x()<-L.cropX*ne.width-1e-9&&(Le.target.x(-L.cropX*ne.width),Le.target.scaleX(1)),Le.target.y()<-L.cropY*ne.height-1e-9&&(Le.target.y(-L.cropY*ne.height),Le.target.scaleY(1));const je=Math.min(1,Math.max(0,L.cropX+Le.target.x()/ne.width)),Ve=Math.min(1,Math.max(0,Le.target.y()/ne.height+L.cropY)),pt=Le.target.width()*Le.target.scaleX(),Ot=Le.target.height()*Le.target.scaleY(),Qr=Math.min(1-je,pt/ne.width),Or=Math.min(1-Ve,Ot/ne.height),Mr=Le.target.getAbsolutePosition(Le.target.getParent().getParent());Le.target.scale({x:1,y:1}),Le.target.position({x:0,y:0}),L.set({x:Mr.x,y:Mr.y,cropX:je,cropY:Ve,cropWidth:Qr,cropHeight:Or,width:Math.min(pt*Oe,ne.width*(1-je)*Oe),height:Math.min(Ot*Oe,ne.height*(1-Ve)*Oe)})}}),a.default.createElement(u.Transformer,{ref:Je,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Le,je)=>je.width<5||je.height<5?Le:je,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),($||Y)&&a.default.createElement(S.Highlighter,{element:L}))})})(dS);var hS={},Qp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.figureToSvg=e.subTypeToPathDataFunc=e.TYPES=e.crossPath=e.speechBubblePath=e.hexagonPath=e.pentagonPath=e.diamondPath=e.starPath=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0;const t=({width:y,height:p,cornerRadius:v})=>{if(v>0){const m=Math.min(v,y/2,p/2);return`M 0 ${m} A ${m} ${m} 0 0 1 ${m} 0 L ${y-m} 0 A ${m} ${m} 0 0 1 ${y} ${m} L ${y} ${p-m} A ${m} ${m} 0 0 1 ${y-m} ${p} L ${m} ${p} A ${m} ${m} 0 0 1 0 ${p-m} Z`}return`M 0 0 L ${y} 0 L ${y} ${p} L 0 ${p} Z`};e.rectData=t;const r=({width:y,height:p})=>`M ${y/2} 0 L ${y} ${p} L 0 ${p} Z`;e.triangleData=r;const n=({width:y,height:p})=>`M 0 0 L ${y} 0 L 0 ${p} Z`;e.rightTriangleData=n;const i=({width:y,height:p})=>`M ${y/2} ${p/2} m -${y/2}, 0 a ${y/2},${p/2} 0 1,0 ${y},0 a ${y/2},${p/2} 0 1,0 -${y},0`;function a({width:y,height:p}){const v=y/2,m=p/2,d=y/2,g=p/2,w=d/2,k=g/2;let P="",A=Math.PI/5;for(let E=0;E<10;E++){const x=E%2==0?g:k,C=v+(E%2==0?d:w)*Math.sin(E*A),R=m-x*Math.cos(E*A);E===0?P=`M ${C} ${R}`:P+=` L ${C} ${R}`}return P+" Z"}function o({width:y,height:p}){const v=y/2,m=p/2;return`M ${v} 0 L ${y} ${m} L ${v} ${p} L 0 ${m} Z`}function l({width:y,height:p}){const v=y/2,m=p/2,d=y/2,g=p/2;let w="",k=2*Math.PI/5;for(let P=0;P<5;P++){const A=g,E=v+d*Math.sin(P*k),x=m-A*Math.cos(P*k);P===0?w=`M ${E} ${x}`:w+=` L ${E} ${x}`}return w+" Z"}function u({width:y,height:p}){const v=y/2,m=p/2,d=y/2,g=p/2;let w="",k=2*Math.PI/6;for(let P=0;P<6;P++){const A=g,E=v+d*Math.sin(P*k),x=m-A*Math.cos(P*k);P===0?w=`M ${E} ${x}`:w+=` L ${E} ${x}`}return w+" Z"}function f({path:y,aspectRatio:p,width:v,height:m}){return{path:y,scaleX:v/p.width,scaleY:m/p.height}}function h({width:y,height:p}){const v=.1*Math.min(y,p),m=.2*y,d=.2*p,g=.5*y;let w=`M ${v},0`;return w+=" H "+(y-v),w+=` A ${v},${v} 0 0 1 ${y},${v}`,w+=" V "+(p-v-d),w+=` A ${v},${v} 0 0 1 ${y-v},${p-d}`,w+=` H ${g+m/2}`,w+=` L ${g},${p}`,w+=` L ${g-m/2},${p-d}`,w+=` H ${v}`,w+=` A ${v},${v} 0 0 1 0,${p-v-d}`,w+=` V ${v}`,w+=` A ${v},${v} 0 0 1 ${v},0`,w+=" Z",w}function O({width:y,height:p}){const v=.3*y,m=.3*p,d=y/2,g=p/2,w=d-v/2,k=d+v/2,P=g-m/2,A=g+m/2;let E=`M ${w},0 `;return E+=`H ${k} `,E+=`V ${P} `,E+=`H ${y} `,E+=`V ${A} `,E+=`H ${k} `,E+=`V ${p} `,E+=`H ${w} `,E+=`V ${A} `,E+="H 0 ",E+=`V ${P} `,E+=`H ${w} `,E+="V 0 ",E+="Z",E}function S(y){return e.TYPES[y]||e.rectData}function b(y,p){const{width:v,height:m,fill:d,stroke:g,strokeWidth:w,dash:k}=y,P=(k||[]).map(R=>R*w);let A=p(y),E=1,x=1;typeof A!="string"&&(E=A.scaleX,x=A.scaleY,A=A.path);const C=`clip-${y.id||Math.random()}`;return`
|
|
235
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${v}" height="${m}">
|
|
236
|
+
<defs>
|
|
237
|
+
<clipPath id="${C}">
|
|
238
|
+
<path d="${A}" />
|
|
239
|
+
</clipPath>
|
|
240
|
+
</defs>
|
|
241
|
+
|
|
242
|
+
<!-- Path for the fill -->
|
|
243
|
+
<path d="${A}" fill="${d}" transform="scale(${E}, ${x})"/>
|
|
244
|
+
|
|
245
|
+
<!-- Path for the stroke, clipped by the star path -->
|
|
246
|
+
<path d="${A}" fill="none" stroke="${g}" stroke-width="${2*w}" clip-path="url(#${C})" transform="scale(${E}, ${x})" stroke-dasharray="${P.join(" ")}"/>
|
|
247
|
+
</svg>
|
|
248
|
+
`}function _(y){const{subType:p}=y,v=S(p);return v?b(y,v):(console.error(`Polotno error: Can not convert ${y.subType} figure to svg.`),(0,e.rectData)(y))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=h,e.crossPath=O,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:h,cross:O,arc:({width:y,height:p})=>f({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:y,height:p}),cloud:({width:y,height:p})=>f({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:y,height:p}),rightArrow:({width:y,height:p})=>{const v=.6*y;return`M 0 ${p/4} L ${v} ${p/4} L ${v} 0 L ${y} ${p/2} L ${v} ${p} L ${v} ${.75*p} L 0 ${.75*p} Z`},leftArrow:({width:y,height:p})=>{const v=.4*y;return`M ${y} ${p/4} L ${v} ${p/4} L ${v} 0 L 0 ${p/2} L ${v} ${p} L ${v} ${.75*p} L ${y} ${.75*p} Z`},downArrow:({width:y,height:p})=>{const v=.6*p;return`M ${y/4} 0 L ${y/4} ${v} L 0 ${v} L ${y/2} ${p} L ${y} ${v} L ${.75*y} ${v} L ${.75*y} 0 Z`},upArrow:({width:y,height:p})=>{const v=.4*p;return`M ${y/4} ${p} L ${y/4} ${v} L 0 ${v} L ${y/2} 0 L ${y} ${v} L ${.75*y} ${v} L ${.75*y} ${p} Z`},asterisk1:({width:y,height:p})=>f({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:y,height:p}),asterisk2:({width:y,height:p})=>f({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:y,height:p}),bookmark:({width:y,height:p})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:y,height:p}),butterfly:({width:y,height:p})=>f({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:y,height:p}),cylinder:({width:y,height:p})=>f({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:y,height:p}),diamond2:({width:y,height:p})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:y,height:p}),door:({width:y,height:p})=>f({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:y,height:p}),drop1:({width:y,height:p})=>f({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:y,height:p}),drop2:({width:y,height:p})=>f({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:y,height:p}),explosion:({width:y,height:p})=>f({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:y,height:p}),flag:({width:y,height:p})=>f({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:y,height:p}),flower:({width:y,height:p})=>f({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:y,height:p}),frame:({width:y,height:p})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:y,height:p}),heart1:({width:y,height:p})=>f({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:y,height:p}),home:({width:y,height:p})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:y,height:p}),home2:({width:y,height:p})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:y,height:p}),hourglass:({width:y,height:p})=>f({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:y,height:p}),house:({width:y,height:p})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:y,height:p}),keyhole:({width:y,height:p})=>f({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:y,height:p}),kiss:({width:y,height:p})=>f({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:y,height:p}),leaf:({width:y,height:p})=>f({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:y,height:p}),lightning1:({width:y,height:p})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:y,height:p}),lightning2:({width:y,height:p})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:y,height:p}),magnet:({width:y,height:p})=>f({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:y,height:p}),mithosis:({width:y,height:p})=>f({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:y,height:p}),orangeRicky:({width:y,height:p})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:y,height:p}),party:({width:y,height:p})=>f({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:y,height:p}),pillow:({width:y,height:p})=>f({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:y,height:p}),polygon:({width:y,height:p})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:y,height:p}),rainbow:({width:y,height:p})=>f({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:y,height:p}),rhodeIsland:({width:y,height:p})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:y,height:p}),shell:({width:y,height:p})=>f({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:y,height:p}),shield1:({width:y,height:p})=>f({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:y,height:p}),shield2:({width:y,height:p})=>f({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:y,height:p}),skewedRectangle:({width:y,height:p})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:y,height:p}),softFlower:({width:y,height:p})=>f({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:y,height:p}),softStar:({width:y,height:p})=>f({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:y,height:p}),stairs1:({width:y,height:p})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:y,height:p}),stairs2:({width:y,height:p})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:y,height:p}),teewee:({width:y,height:p})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:y,height:p}),blob1:({width:y,height:p})=>f({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:y,height:p}),blob10:({width:y,height:p})=>f({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:y,height:p}),blob11:({width:y,height:p})=>f({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:y,height:p}),blob12:({width:y,height:p})=>f({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:y,height:p}),blob13:({width:y,height:p})=>f({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:y,height:p}),blob14:({width:y,height:p})=>f({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:y,height:p}),blob15:({width:y,height:p})=>f({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:y,height:p}),blob16:({width:y,height:p})=>f({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:y,height:p}),blob17:({width:y,height:p})=>f({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:y,height:p}),blob18:({width:y,height:p})=>f({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:y,height:p}),blob19:({width:y,height:p})=>f({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:y,height:p}),blob2:({width:y,height:p})=>f({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:y,height:p}),blob20:({width:y,height:p})=>f({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:y,height:p}),blob21:({width:y,height:p})=>f({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:y,height:p}),blob22:({width:y,height:p})=>f({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:y,height:p}),blob23:({width:y,height:p})=>f({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:y,height:p}),blob24:({width:y,height:p})=>f({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:y,height:p}),blob25:({width:y,height:p})=>f({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:y,height:p}),blob26:({width:y,height:p})=>f({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:y,height:p}),blob27:({width:y,height:p})=>f({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:y,height:p}),blob28:({width:y,height:p})=>f({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:y,height:p}),blob29:({width:y,height:p})=>f({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:y,height:p}),blob3:({width:y,height:p})=>f({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:y,height:p}),blob30:({width:y,height:p})=>f({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:y,height:p}),blob31:({width:y,height:p})=>f({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:y,height:p}),blob32:({width:y,height:p})=>f({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:y,height:p}),blob4:({width:y,height:p})=>f({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:y,height:p}),blob5:({width:y,height:p})=>f({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:y,height:p}),blob6:({width:y,height:p})=>f({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:y,height:p}),blob7:({width:y,height:p})=>f({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:y,height:p}),blob8:({width:y,height:p})=>f({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:y,height:p}),blob9:({width:y,height:p})=>f({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:y,height:p})},e.subTypeToPathDataFunc=S,e.figureToSvg=_})(Qp);(function(e){var t=ve&&ve.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(rt),n=Zn,i=Ta,a=Qp,o=Tl,l=To,u=Yc,f={};e.FigureElement=(0,n.observer)(({element:h,store:O})=>{const S=h.selectable||O.role==="admin",b=(0,l.isTouchDevice)(),[_,y]=r.default.useState(!1),p=O.selectedShapes.indexOf(h)>=0,v=Math.min(h.strokeWidth,h.width/2,h.height/2),m=Math.max(0,Math.min(h.width/2,h.height/2,h.cornerRadius)),d=(0,u.useColor)(h,h.a.fill,"fill"),g=Object.assign(Object.assign({width:h.a.width,height:h.a.height},d),{cornerRadius:m,opacity:h.animated("opacity"),shadowEnabled:h.shadowEnabled,shadowBlur:h.shadowBlur,shadowOffsetX:h.shadowOffsetX,shadowOffsetY:h.shadowOffsetY,shadowColor:h.shadowColor,shadowOpacity:h.shadowOpacity,preventDefault:!b||p,hideInExport:!h.showInExport}),w=(0,u.useColor)(h,h.stroke,"stroke"),k=Object.assign(Object.assign({visible:v>0,x:v/2,y:v/2,width:h.a.width-v,height:h.a.height-v},w),{strokeWidth:v,cornerRadius:Math.max(0,m-v),dash:h.dash.map(x=>x*v),opacity:h.animated("opacity"),hideInExport:!h.showInExport,listening:!1}),P=(A=h.subType,f[A]||(f[A]=(E=(0,a.subTypeToPathDataFunc)(A),(0,n.observer)(({element:x,fillProps:C,strokeProps:R})=>{let N=E({width:x.a.width,height:x.a.height,cornerRadius:x.cornerRadius}),U=1,G=1;typeof N!="string"&&(U=N.scaleX,G=N.scaleY,N=N.path);const Z=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:x.width,height:x.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},C,{ref:Z,data:N,scaleX:U,scaleY:G})),r.default.createElement(i.Group,{clipFunc:W=>{const H=Z.current;if(H){var L=H.dataArray;W.beginPath();for(var M=0;M<L.length;M++){var D=L[M].command,B=L[M].points;switch(D){case"L":W.lineTo(B[0],B[1]);break;case"M":W.moveTo(B[0],B[1]);break;case"C":W.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case"Q":W.quadraticCurveTo(B[0],B[1],B[2],B[3]);break;case"A":var q=B[0],K=B[1],z=B[2],$=B[3],F=B[4],Y=B[5],X=B[6],Q=B[7],J=z>$?z:$,re=z>$?1:z/$,ie=z>$?$/z:1;W.translate(q,K),W.rotate(X),W.scale(re,ie),W.arc(0,0,J,F,F+Y,1-Q),W.scale(1/re,1/ie),W.rotate(-X),W.translate(-q,-K);break;case"z":W.closePath()}}}},scaleX:U,scaleY:G},r.default.createElement(i.Path,Object.assign({},R,{x:0,y:0,data:N,strokeWidth:2*R.strokeWidth,dash:R.dash.map(W=>W)}))))}))),f[A]||i.Group);var A,E;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:h.id,x:h.a.x,y:h.a.y,rotation:h.a.rotation,opacity:h.a.opacity,listening:S,draggable:b?h.draggable&&p:h.draggable,name:"element",onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1)},onDragMove:x=>{h.set({x:x.target.x(),y:x.target.y()})},onDragEnd:x=>{h.set({x:x.target.x(),y:x.target.y()})},onTransform:x=>{const C=x.target.scale();x.target.scaleX(1),x.target.scaleY(1),h.set({width:h.width*C.x,height:h.height*C.y,x:x.target.x(),y:x.target.y(),rotation:x.target.rotation()})}},r.default.createElement(P,{element:h,fillProps:g,strokeProps:k})),(_||p)&&r.default.createElement(o.Highlighter,{element:h}))})})(hS);(function(e){var t=ve&&ve.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(rt),n=Zn,i=Zy,a=d2,o=iS,l=fS,u=dS,f=hS,h=Ta,O=Kn,S=(0,n.observer)(p=>{const{element:v,store:m}=p,{children:d}=v,g=v.selectable||m.role==="admin";return r.default.createElement(h.Group,{opacity:v.opacity,listening:g,hideInExport:!v.showInExport},d.map(w=>r.default.createElement(y,Object.assign({},p,{key:w.id,store:m,element:w}))))}),b={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:S};function _(p,v){b[p]=v}e.registerShapeComponent=_;const y=(0,n.observer)(p=>{let v=b[p.element.type];return p.element.type==="text"&&O.flags.htmlRenderEnabled&&(v=o.HTMLElement),p.element.visible?v?r.default.createElement(v,Object.assign({},p)):(console.error("Can not find component for "+p.element.type),null):null});e.default=y})(K9);var pS={};(function(e){function t(r,n,i="scale"){const a=n.width/n.height;let o,l;a>=r.width/r.height?(o=r.width,l=r.width/a):(o=r.height*a,l=r.height);let u=0,f=0;return i==="left-top"?(u=0,f=0):i==="left-middle"?(u=0,f=(r.height-l)/2):i==="left-bottom"?(u=0,f=r.height-l):i==="center-top"?(u=(r.width-o)/2,f=0):i==="center-middle"?(u=(r.width-o)/2,f=(r.height-l)/2):i==="center-bottom"?(u=(r.width-o)/2,f=r.height-l):i==="right-top"?(u=r.width-o,f=0):i==="right-middle"?(u=r.width-o,f=(r.height-l)/2):i==="right-bottom"?(u=r.width-o,f=r.height-l):i==="scale"?(u=0,f=0,o=r.width,l=r.height):console.error(new Error("Unknown clip position property - "+i)),{cropX:u,cropY:f,cropWidth:o,cropHeight:l}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=void 0,e.getCrop=t})(pS);var $g={},Gg={},S_;function fj(){return S_||(S_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const t=E2();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";const r=()=>e.URL+"/api";e.getAPI=r;const n={},i=(d,g)=>{n[d]||(n[d]=!0,console.error(g))},a=`API for iconscout is provided as a demonstration.
|
|
249
|
+
For production usage you have to use your own API endpoint.
|
|
250
|
+
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
251
|
+
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:d,page:g=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${g}&KEY=${(0,t.getKey)()}`,unsplashDownload:d=>`${(0,e.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,t.getKey)()}`,svgapiList:({query:d,page:g=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${d}&page=${g}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:d=>`${(0,e.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:d,page:g=1})=>(i("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${d}&page=${g}&KEY=${(0,t.getKey)()}`),iconscoutDownload:d=>(i("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,t.getKey)()}`),nounProjectList:({query:d,page:g=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${d}&page=${g}&KEY=${(0,t.getKey)()}`,nounProjectDownload:d=>`${(0,e.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,t.getKey)()}`,templateList:({query:d,page:g=1,sizeQuery:w})=>`${(0,e.getAPI)()}/get-templates?${w}&query=${d}&per_page=30&page=${g}&KEY=${(0,t.getKey)()}`};const o=()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=o;const l=d=>{return`${e.URL}/google-fonts-previews/black/${g=d,w=" ",k="-",g.replace(new RegExp(w,"g"),k)}.png`;var g,w,k};e.getGoogleFontImage=l;const u=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=u;const f=()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=f;const h=d=>e.URLS.templateList(d);e.templateList=h;const O=()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=O;const S=d=>e.URLS.unsplashList(d);e.unsplashList=S;const b=d=>e.URLS.unsplashDownload(d);e.unsplashDownload=b;const _=d=>e.URLS.svgapiList(d);e.svgapiList=_;const y=d=>e.URLS.svgapiDownload(d);e.svgapiDownload=y;const p=d=>e.URLS.iconscoutList(d);e.iconscoutList=p;const v=d=>e.URLS.iconscoutDownload(d);e.iconscoutDownload=v;const m=(d,g)=>{e.URLS[d]=g};e.setAPI=m}(Gg)),Gg}var E_;function E2(){return E_||(E_=1,function(e){var t=ve&&ve.__createBinding||(Object.create?function(k,P,A,E){E===void 0&&(E=A);var x=Object.getOwnPropertyDescriptor(P,A);x&&!("get"in x?!P.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return P[A]}}),Object.defineProperty(k,E,x)}:function(k,P,A,E){E===void 0&&(E=A),k[E]=P[A]}),r=ve&&ve.__setModuleDefault||(Object.create?function(k,P){Object.defineProperty(k,"default",{enumerable:!0,value:P})}:function(k,P){k.default=P}),n=ve&&ve.__importStar||function(k){if(k&&k.__esModule)return k;var P={};if(k!=null)for(var A in k)A!=="default"&&Object.prototype.hasOwnProperty.call(k,A)&&t(P,k,A);return r(P,k),P};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(Yi),a=fj(),o=Kn;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const h=5,O=3e3,S="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",b="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",_="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",y="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let p=window.location.origin;const v=navigator.userAgent.indexOf("Headless")>-1,m=navigator.userAgent.indexOf("Electron")>-1;p==="file://"&&v&&(p="headless"),p==="file://"&&m&&(p="electron");const d=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${p}" here: https://polotno.com/cabinet`;async function g(k){for(let P=0;P<h;P++)try{const A=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:k,site:location.host})});if(!k)return console.warn(S),!1;if(A.status!==200){await new Promise(x=>setTimeout(x,O));continue}const E=await A.json();return E.is_valid||console.warn(b),E.is_paid||console.log(y,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),E.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(E.remove_background_enabled),E.is_paid||!1}catch{await new Promise(E=>setTimeout(E,O))}return console.error(_),!0}async function w(k,P){u=k,await g(k)&&!P||l()}e.isKeyPaid=g,e.validateKey=w}($g)),$g}var Jp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0;const t=({px:a,unit:o="px",dpi:l})=>{switch(o){case"pt":default:return a;case"mm":return a/(l/25.4);case"cm":return a/(l/2.54);case"in":return a/l}};e.pxToUnit=t;const r=({px:a,precious:o=2,dpi:l=72,unit:u="px"})=>parseFloat((0,e.pxToUnit)({px:a,dpi:l,unit:u}).toFixed(o));e.pxToUnitRounded=r;const n=({unitVal:a,dpi:o,unit:l})=>a/(0,e.pxToUnit)({px:1,unit:l,dpi:o});e.unitToPx=n;const i=a=>{const o=parseFloat((0,e.pxToUnit)(a).toFixed(1));switch(a.unit){case"pt":return`${Math.round(o)}pt`;case"mm":return`${o}mm`;case"cm":return`${o}cm`;case"in":return`${o}in`;default:return`${Math.round(o)}px`}};e.pxToUnitString=i})(Jp);(function(e){var t=ve&&ve.__rest||function(H,L){var M={};for(var D in H)Object.prototype.hasOwnProperty.call(H,D)&&L.indexOf(D)<0&&(M[D]=H[D]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(D=Object.getOwnPropertySymbols(H);B<D.length;B++)L.indexOf(D[B])<0&&Object.prototype.propertyIsEnumerable.call(H,D[B])&&(M[D[B]]=H[D[B]])}return M},r=ve&&ve.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(rt),i=Zn,a=Yi,o=Ta,l=r(Wp),u=r(wi),f=r(K9),h=S2,O=d2,S=pS,b=E2(),_=nu,y=Jp,p=Kn,v=To,m=u.default.DD._drag;window.removeEventListener("mousemove",m),u.default.DD._drag=function(H){(0,a.runInAction)(()=>{m.call(this,H)})},window.addEventListener("mousemove",u.default.DD._drag);const d=new u.default.Group;d.add(new u.default.Rect({width:20,height:20,fill:"white"})),d.add(new u.default.Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const g=d.toCanvas({pixelRatio:2,width:20,height:20}),w={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:H=>{H.hasName("rotater")&&H.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:g,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},k=H=>{Object.assign(w,H)};e.setTransformerStyle=k;const P={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(H,L){P[H]=P[H]||L,Object.assign(P[H],L)}e.registerTransformerAttrs=A;const E=H=>n.default.createElement(o.Rect,Object.assign({},H,{preventDefault:!1})),x=H=>{var{url:L}=H,M=t(H,["url"]);const[D,B]=(0,l.default)(L,"anonymous"),q=D?(0,S.getCrop)(D,{width:M.width,height:M.height},"center-middle"):{};return(0,O.useImageLoader)(B,"background"),n.default.createElement(o.Image,Object.assign({image:D},M,q))},C=H=>n.default.createElement(o.Rect,Object.assign({},H)),R=H=>{const{background:L,scale:M,borderColor:D}=H,B=t(H,["background","scale","borderColor"]),q=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(L),[L]),K=n.default.useMemo(()=>{const z=document.createElement("canvas"),$=30;z.width=60,z.height=60;const F=z.getContext("2d");return F&&(F.fillStyle="black",F.fillRect($,0,$,$),F.fillRect(0,$,$,$)),z},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:K},B,{opacity:.1,hideInExport:!0})),q?n.default.createElement(C,Object.assign({fill:L},B)):n.default.createElement(x,Object.assign({url:L},B)))},N=(0,i.observer)(({selection:H})=>H.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(H.x1,H.x2),y:Math.min(H.y1,H.y2),width:Math.abs(H.x1-H.x2),height:Math.abs(H.y1-H.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:H,y:L,width:M,height:D,rotation:B,anchor:q,store:K})=>{const z=(0,_.getClientRect)({x:H,y:L,width:M,height:D,rotation:u.default.Util.radToDeg(B)});if(q===void 0)return null;const $=(D/2+70)*Math.cos(B-Math.PI/2),F=(D/2+70)*Math.sin(B-Math.PI/2),Y=(0,y.pxToUnitRounded)({unit:K.unit,dpi:K.dpi,px:M/K.scale,precious:K.unit==="px"?0:1})+" x "+(0,y.pxToUnitRounded)({unit:K.unit,dpi:K.dpi,px:D/K.scale,precious:K.unit==="px"?0:1})+(K.unit==="px"?"":" "+K.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(z.minX+z.maxX)/2+$,y:(z.minY+z.maxY)/2+F,offsetX:14,offsetY:14,visible:q==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(u.default.Util.radToDeg(B)).toString()+"°"})),n.default.createElement(o.Label,{x:(z.minX+z.maxX)/2,y:z.maxY+20,visible:q!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Y})))}),G=(0,i.observer)(({elements:H,store:L})=>{const M=H.filter(B=>B.alwaysOnTop),D=H.filter(B=>!B.alwaysOnTop).concat(M);return n.default.createElement(n.default.Fragment,null,D.map(B=>n.default.createElement(f.default,{key:B.id,store:L,element:B,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const W=H=>{Z=H};e.registerNextDomDrop=W,e.default=(0,i.observer)(({store:H,page:L,width:M,height:D,pageControlsEnabled:B,backColor:q,pageBorderColor:K,activePageBorderColor:z,components:$,bleedColor:F,altCloneEnabled:Y})=>{const X=H.bleedVisible?L.bleed:0,Q=L.computedWidth+2*X,J=L.computedHeight+2*X,re=(M-Q*H.scale)/2,ie=(D-J*H.scale)/2,ne=n.default.useRef(null),ae=n.default.useRef(null),ke=n.default.useRef(null),Ae=B==null||B,[oe,ce]=n.default.useState(null),[_e,ye]=n.default.useState({}),te=H.selectedElements.find(be=>be._cropModeEnabled),le=H.selectedShapes.filter(be=>!be.resizable).length>0,me=H.selectedShapes.filter(be=>!be.draggable).length>0,Ee=H.selectedElements.filter(be=>!be.visible).length>0;n.default.useLayoutEffect(()=>{var be,Ie,Me;if(!ne.current)return;const we=ne.current.getStage(),et=H.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:we.findOne("#"+Ye.id)).filter(Ye=>Ye),Se=H.selectedElements.length===1&&((be=H.selectedElements[0])===null||be===void 0?void 0:be.type)||"many";P[Se]?(ne.current.setAttrs(Object.assign(Object.assign({},w),P[Se])),Se!=="svg"&&Se!=="image"||H.selectedElements[0].keepRatio||ne.current.setAttrs({enabledAnchors:w.enabledAnchors}),Se==="text"&&p.flags.textVerticalResizeEnabled&&ne.current.setAttrs({enabledAnchors:(Ie=P.text.enabledAnchors)===null||Ie===void 0?void 0:Ie.concat(["bottom-center"])})):ne.current.setAttrs(w),le&&ne.current.enabledAnchors([]),me&&ne.current.rotateEnabled(!1),et.find(Ye=>Ye==null?void 0:Ye.isDragging())&&et.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),ne.current.nodes(et),(Me=ne.current.getLayer())===null||Me===void 0||Me.batchDraw()},[H.selectedElements,te,le,Ee,me]);const We=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Qe=n.default.useRef(!1),Re=(0,v.isTouchDevice)(),Pe=(0,a.action)(be=>{var Ie,Me;if(Re)return;Qe.current=!1;const we=be.target.findAncestor(".elements-container"),et=be.target.findAncestor("Transformer"),Se=be.target.findAncestor(".page-abs-container");if(we||et||Se)return;const Ye=(Ie=be.target.getStage())===null||Ie===void 0?void 0:Ie.getPointerPosition();Ye&&(We.visible=!0,We.x1=Ye.x,We.y1=Ye.y,We.x2=Ye.x,We.y2=Ye.y,((Me=be.target.getStage())===null||Me===void 0?void 0:Me.getPointersPositions().length)>=2&&(We.visible=!1))});n.default.useEffect(()=>{const be=(0,a.action)(Me=>{var we,et;if(!We.visible)return;(we=ae.current)===null||we===void 0||we.setPointersPositions(Me);let Se=((et=ae.current)===null||et===void 0?void 0:et.getPointerPosition())||{x:We.x2,y:We.y2};We.x2=Se.x,We.y2=Se.y}),Ie=(0,a.action)(()=>{if(!We.visible||!ae.current)return;const Me=ae.current.findOne(".selection"),we=Me?Me.getClientRect():{width:0,height:0,x:0,y:0};if(we.width&&we.height){const et=[];ae.current.find(".element").forEach(Ye=>{const Le=Ye.getClientRect(),je=H.getElementById(Ye.id()),Ve=je==null?void 0:je.draggable,pt=je==null?void 0:je.selectable;u.default.Util.haveIntersection(we,Le)&&Ve&&pt&&et.push(je.top.id)});const Se=[...new Set(et)];H.selectElements(Se)}We.visible=!1,Qe.current=!0});return window.addEventListener("mousemove",be),window.addEventListener("touchmove",be),window.addEventListener("mouseup",Ie),window.addEventListener("touchend",Ie),()=>{window.removeEventListener("mousemove",be),window.removeEventListener("touchmove",be),window.removeEventListener("mouseup",Ie),window.removeEventListener("touchend",Ie)}},[]);const Oe=be=>{if(H.activePage!==L&&L.select(),Qe.current)return;const Ie=be.evt.ctrlKey||be.evt.metaKey||be.evt.shiftKey,Me=be.target.findAncestor(".elements-container"),we=be.target.findAncestor(".page-abs-container"),et=be.target.findAncestor("Transformer");if(!(Ie||Me||et||we))return void H.selectElements([]);const Se=be.target.findAncestor(".element",!0),Ye=H.getElementById(Se==null?void 0:Se.id()),Le=Ye==null?void 0:Ye.top,je=Le==null?void 0:Le.id,Ve=H.selectedElementsIds.indexOf(je)>=0;je&&Ie&&!Ve?H.selectElements(H.selectedElementsIds.concat([je])):je&&Ie&&Ve?H.selectElements(H.selectedElementsIds.filter(pt=>pt!==je)):!je||Ie||Ve||H.selectElements([je])};(0,h.useSnap)(ne,H);const Ne=H.activePage===L,Je=$==null?void 0:$.PageControls,fe=$==null?void 0:$.Tooltip,de=1/H.scale,Xe=0/H.scale;return n.default.createElement("div",{ref:ke,onDragOver:be=>be.preventDefault(),onDrop:be=>{if(be.preventDefault(),!ae.current)return;ae.current.setPointersPositions(be);const Ie=ae.current.findOne(".elements-container").getRelativePointerPosition(),Me=ae.current.getPointerPosition(),we=ae.current.getAllIntersections(Me).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),et=[...new Set(we.reverse())].map(Ye=>H.getElementById(Ye.id())),Se=et[0];Z&&(Z(Ie,Se,{elements:et,page:L}),Z=null)},style:{position:"relative",width:M+"px"},className:"polotno-page-container"+(Ne?" active-page":"")},n.default.createElement(o.Stage,{ref:ae,width:Math.min(M,4*window.innerWidth),height:Math.min(D,4*window.innerHeight),onClick:Oe,onTap:Oe,onMouseDown:Pe,onMouseMove:be=>{if(!be.evt.altKey&&oe)return void ce(null);if(!be.evt.altKey)return;const Ie=be.target.findAncestor(".element",!0),Me=Ie==null?void 0:Ie.id();if(!H.selectedElements[0]||H.selectedElementsIds.includes(Me))return;const we=(0,_.getTotalClientRect)(H.selectedShapes),et=Me?H.getElementById(Me):{x:0,y:0,width:L.computedWidth,height:L.computedHeight,rotation:0},Se=(0,_.getClientRect)(et),Ye=[];we.minX>Se.maxX&&Ye.push({distance:we.minX-Se.maxX,box1:we,box2:Se,points:[{x:we.minX,y:we.minY+we.height/2},{x:Se.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),we.maxX<Se.minX&&Ye.push({distance:Se.minX-we.maxX,box1:we,box2:Se,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Se.minX,y:we.minY+we.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),we.minY>Se.maxY&&Ye.push({box1:we,box2:Se,distance:we.minY-Se.maxY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]}),we.maxY<Se.minY&&Ye.push({box1:we,box2:Se,distance:Se.minY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),we.minX>=Se.minX&&we.maxX<=Se.maxX&&we.minY>=Se.minY&&we.maxY<=Se.maxY&&(Ye.push({distance:we.minX-Se.minX,box1:we,box2:Se,points:[{x:we.minX,y:we.minY+we.height/2},{x:Se.minX,y:we.minY+we.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),Ye.push({distance:Se.maxX-we.maxX,box1:we,box2:Se,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),Ye.push({box1:we,box2:Se,distance:we.minY-Se.minY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),Ye.push({box1:we,box2:Se,distance:Se.maxY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]})),JSON.stringify(oe)!==JSON.stringify(Ye)&&ce(Ye)},onDragStart:be=>{var Ie;const Me=be.target.findAncestor(".element",!0);if(Me){const we=H.getElementById(Me==null?void 0:Me.id()),et=we==null?void 0:we.top,Se=et==null?void 0:et.id;!(H.selectedElementsIds.indexOf(Se)>=0)&&Se&&(H.selectElements([Se]),be.target.stopDrag(),be.target.startDrag(be),(Ie=ne.current)===null||Ie===void 0||Ie.startDrag(be))}oe&&ce(null)},pageId:L.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(E,{width:M,height:D,fill:q}),n.default.createElement(o.Group,{x:re,y:ie,scaleX:H.scale,scaleY:H.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:X,y:X},n.default.createElement(R,{x:-L.bleed,y:-L.bleed,width:L.computedWidth+2*L.bleed,height:L.computedHeight+2*L.bleed,background:L.background,name:"page-background",preventDefault:!1,scale:H.scale})),n.default.createElement(o.Group,{x:X,y:X,name:"elements-container",listening:!H.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:L.computedWidth,height:L.computedHeight,listening:!1}),n.default.createElement(G,{elements:L.children,store:H})),n.default.createElement(o.Rect,{stroke:F,name:"bleed",strokeWidth:L.bleed,x:L.bleed/2,y:L.bleed/2,width:L.computedWidth+L.bleed,height:L.computedHeight+L.bleed,listening:!1,visible:L.bleed>0&&H.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,M,0,M,D,0,D,0,0,re,ie,re,D-ie,M-re,D-ie,M-re,ie,re,ie],listening:!1,closed:!0,fill:q}),n.default.createElement(o.Group,{x:re,y:ie,scaleX:H.scale,scaleY:H.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-de/2-Xe,y:-de/2-Xe,width:Q+de+2*Xe,height:J+de+2*Xe,stroke:Ne&&H.pages.length>1?z:K,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:re+X*H.scale,y:ie+X*H.scale,scaleX:H.scale,scaleY:H.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ne,onDragStart:be=>{var Ie;!((Ie=be.evt)===null||Ie===void 0)&&Ie.altKey&&Y&&H.selectedElements.forEach(Me=>{const we=Me.clone({},{skipSelect:!0}),et=L.children.indexOf(Me);L.setElementZIndex(we.id,et)}),H.history.startTransaction()},onDragEnd:()=>{H.history.endTransaction()},onTransformStart:()=>{H.history.startTransaction()},boundBoxFunc:(be,Ie)=>{const Me=Math.abs(Ie.width)<1||Math.abs(Ie.height)<1,we=Math.abs(be.width)<1||Math.abs(be.height)<1;return Me&&!we?be:Ie},onTransform:be=>{var Ie,Me;const we=ne.current.nodes(),et=we[we.length-1];if(be.target!==et)return;const Se=(Ie=ne.current)===null||Ie===void 0?void 0:Ie.__getNodeRect(),Ye=(Me=ne.current)===null||Me===void 0?void 0:Me.getActiveAnchor();ye({anchor:Ye,x:Se.x,y:Se.y,rotation:Se.rotation,width:Se.width,height:Se.height})},onTransformEnd:be=>{ye({}),H.history.endTransaction()},visible:!H.isPlaying}),oe&&oe.map(({points:be,distance:Ie,box1:Me,box2:we},et)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:et,listening:!1},n.default.createElement(o.Rect,Object.assign({},Me,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},we,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[be[0].x,be[0].y,be[1].x,be[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[be[1].x,be[1].y,be[2].x,be[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(be[0].x+be[1].x)/2,y:(be[0].y+be[1].y)/2,offsetY:-10,scaleX:1/H.scale,scaleY:1/H.scale},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,y.pxToUnitString)({unit:H.unit,dpi:H.dpi,px:Ie})})))),L._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Q,height:J,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Q,height:J,align:"center",verticalAlign:"middle"})),fe&&n.default.createElement(fe,{components:$,store:H,page:L,stageRef:ae})),n.default.createElement(U,Object.assign({},_e,{store:H})),n.default.createElement(N,{selection:We}),b.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:M-170,y:D-18,onMouseEnter:be=>{be.target.getStage().container().style.cursor="pointer"},onMouseLeave:be=>{be.target.getStage().container().style.cursor=""},onTouchStart:be=>{be.cancelBubble=!0},onMouseDown:be=>{be.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Ae&&Ne&&Je&&n.default.createElement(Je,{store:H,page:L,xPadding:re,yPadding:ie}))})})(r9);var gS={};(function(e){var t=ve&&ve.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(rt),n=nu,i=Jp,a=Zn,o=w2,l=(0,o.styled)("div",r.default.forwardRef)`
|
|
252
|
+
position: absolute;
|
|
253
|
+
top: 0;
|
|
254
|
+
left: 0;
|
|
255
|
+
pointer-events: none;
|
|
256
|
+
`,u=(0,o.styled)("div",r.default.forwardRef)`
|
|
257
|
+
height: 14px;
|
|
258
|
+
position: sticky;
|
|
259
|
+
font-size: 8px;
|
|
260
|
+
line-height: 14px;
|
|
261
|
+
top: 0;
|
|
262
|
+
left: 0;
|
|
263
|
+
color: grey;
|
|
264
|
+
border-bottom: 1px solid grey;
|
|
265
|
+
background-color: #e8e8e8;
|
|
266
|
+
overflow: hidden;
|
|
267
|
+
`,f=(0,o.styled)("div",r.default.forwardRef)`
|
|
268
|
+
left: 0;
|
|
269
|
+
width: 14px;
|
|
270
|
+
position: sticky;
|
|
271
|
+
font-size: 8px;
|
|
272
|
+
line-height: 14px;
|
|
273
|
+
color: grey;
|
|
274
|
+
border-right: 1px solid grey;
|
|
275
|
+
background-color: #e8e8e8;
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
`,h=(0,o.styled)("div",r.default.forwardRef)`
|
|
278
|
+
position: absolute;
|
|
279
|
+
border-left: 1px solid grey;
|
|
280
|
+
padding-left: 2px;
|
|
281
|
+
`,O=(0,o.styled)("div",r.default.forwardRef)`
|
|
282
|
+
position: absolute;
|
|
283
|
+
left: 14px;
|
|
284
|
+
border-left: 1px solid grey;
|
|
285
|
+
padding-left: 2px;
|
|
286
|
+
transform: rotate(90deg);
|
|
287
|
+
transform-origin: left top;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
`,S=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function b(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:_,width:y,height:p})=>{const v=r.default.useRef(null);if(!_.activePage)return null;const m=_.activePage,d=(_.bleedVisible&&m.bleed,m.computedWidth*_.scale),g=m.computedHeight*_.scale,w=(y-d)/2,k=(P=R=>(0,i.unitToPx)({unitVal:R,dpi:_.dpi,unit:_.unit})*_.scale,S.find(R=>P(R)>30)||1e4);var P;const A=(0,i.unitToPx)({unitVal:k,dpi:_.dpi,unit:_.unit})*_.scale,E=Math.round(d/A)+1,x=Math.round(g/A)+1,C=(0,n.getTotalClientRect)(_.selectedShapes);return r.default.createElement(l,{ref:v,className:"polotno-rulers"},r.default.createElement(u,{style:{width:y+"px"},className:"polotno-x-ruler"},[...Array(E)].map((R,N)=>r.default.createElement(h,{key:N,style:{left:w+N*A+"px",width:A+"px"}},_.unit==="px"||k>=1?Math.round(k*N):(k*N).toFixed(1))),!!_.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:w+C.x*_.scale+"px",height:"14px",width:C.width*_.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),_.pages.map((R,N)=>{var U;const G=R.computedHeight*_.scale,Z=(p-G)/2;return r.default.createElement(f,{key:R.id,style:{height:p+"px"},className:"polotno-y-ruler"},[...Array(x)].map((W,H)=>r.default.createElement(O,{key:H,style:{top:Z+H*A-14+"px",width:A+"px"}},_.unit==="px"||k>=1?Math.round(k*H):(k*H).toFixed(1))),((U=_.selectedShapes[0])===null||U===void 0?void 0:U.page)===R&&r.default.createElement("div",{style:{position:"absolute",top:Z+C.y*_.scale-14+"px",width:"14px",height:C.height*_.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=b})(gS);var vS={};(function(e){var t=ve&&ve.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const r=t(rt),n=Zn;function i(a){const[o,l]=r.default.useState(null),[u,f]=r.default.useState("loading");return r.default.useEffect(()=>{const h=new Audio(a),O=()=>{f("loaded"),l(h)},S=()=>{f("failed"),l(null)};return h.addEventListener("canplay",O),h.addEventListener("error",S),()=>{h.removeEventListener("canplay",O),h.removeEventListener("error",S)}},[a]),[o,u]}e.AudioElement=(0,n.observer)(({audio:a,store:o})=>{const[l,u]=i(a.src);return r.default.useEffect(()=>{l&&o.history.ignore(()=>{a.set({duration:1e3*l.duration})})},[l,a,o.history]),r.default.useEffect(()=>{if(!l)return;o.isPlaying?(l.currentTime=a.startTime*a.duration,l.volume=a.volume,l.play()):l.pause();const f=()=>{l.currentTime=a.startTime*a.duration},h=()=>{l.currentTime>=a.endTime*a.duration&&(l.pause(),l.currentTime=a.startTime*a.duration)};return l.addEventListener("ended",f),l.addEventListener("timeupdate",h),()=>{l.removeEventListener("ended",f),l.removeEventListener("timeupdate",h)}},[o.isPlaying,a.startTime,a.endTime,a.volume,l]),null})})(vS);var mS={},Vg={};let dj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",yS=e=>crypto.getRandomValues(new Uint8Array(e)),bS=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(a=t)=>{let o="";for(;;){let l=r(i),u=i;for(;u--;)if(o+=e[l[u]&n]||"",o.length===a)return o}}},hj=(e,t=21)=>bS(e,t,yS),pj=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const gj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:hj,customRandom:bS,nanoid:pj,random:yS,urlAlphabet:dj},Symbol.toStringTag,{value:"Module"})),e0=mo(gj);var qg={},Wg={},_S={},O2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0;const t=function(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(var i in r)if(!n.hasOwnProperty(i)||!(0,e.deepEqual)(r[i],n[i]))return!1;return!0}return!1};e.deepEqual=t})(O2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=Qn,r=O2;Object.assign(t.types),e.UndoManager=t.types.model("UndoManager",{history:t.types.array(t.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let i,a,o=!1,l=null,u=0,f=0;const h=()=>f>0;function O(){const b=(0,t.getSnapshot)(i);return{pages:b.pages,width:b.width,height:b.height,custom:b.custom}}function S(b){const _=i.pages.map(p=>p.id),y=b.pages.map(p=>p.id);(0,r.deepEqual)(_,y)?i.pages.forEach((p,v)=>{(0,t.applySnapshot)(p,b.pages[v])}):(0,t.applySnapshot)(i.pages,b.pages),i.setSize(b.width,b.height)}return{startTransaction(){f++},endTransaction(b){f--,b||this.requestAddState(O())},async ignore(b,_=!1,y=!1){y&&await new Promise(g=>setTimeout(g,10)),u&&n.addUndoState();let p=h();n.startTransaction();let v=f;try{await b()}catch(g){setTimeout(()=>{throw g})}const m=v!==f,d=!m;n.endTransaction(d),_||p||n.replaceState(),m||(clearTimeout(u),u=0)},async transaction(b){await n.ignore(b,!0),this.addUndoState()},requestAddState(b){l=b,u||h()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),h()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const b=n.history[n.undoIdx];!(0,r.deepEqual)(l,b)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,t.resolvePath)(n,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");a=(0,t.onSnapshot)(i,()=>{this.requestAddState(O())}),n.history.length===0&&this.requestAddState(O())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(O())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,S(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,S(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=O()}}}),e.default=e.UndoManager})(_S);var wS={};(function(e){async function t(r,n){const i=await(await fetch(r)).blob(),a=document.createElement("a"),o=URL.createObjectURL(i);a.href=o,a.download=n,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=void 0,e.downloadFile=t})(wS);var SS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=void 0;const t="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let r;function n(){return r?Promise.resolve(r):new Promise(i=>{var a=document.createElement("script");a.onload=function(){r=window.jspdf.jsPDF,i(r)},a.src=t,document.head.appendChild(a)})}e.getJsPDF=n})(SS);var ES={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createGIF=e.getGIF=void 0;const t="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function r(){return window.GIF?Promise.resolve(window.GIF):new Promise(i=>{var a=document.createElement("script");a.onload=function(){i(window.GIF)},a.src=t,document.head.appendChild(a)})}async function n({width:i,height:a}){return new(await r())({workers:4,width:i,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
290
|
+
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
|
|
291
|
+
`],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(ES);var OS={};(function(e){async function t(r){for(let n=0;n<30;n++){const i=await r();if(i)return i;await new Promise(a=>setTimeout(a,50))}}Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=void 0,e.waitTillAvailable=t})(OS);var xS={},Cc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=tu;function r(o){return new Promise(l=>{const u=document.createElement("img");u.onload=async()=>{u.width===0||u.height===0?l(await(0,t.getSvgSize)(o)):l({width:u.width,height:u.height})},u.crossOrigin="anonymous",u.src=o})}function n(o){return new Promise((l,u)=>{const f=document.createElement("img");f.onload=()=>{l(f)},f.onerror=h=>{u(h)},f.crossOrigin="anonymous",f.src=o})}async function i(o,l){const u=await n(o),f=document.createElement("canvas");f.width=2*u.width,f.height=2*u.height,f.getContext("2d").drawImage(u,0,0,f.width,f.height);const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const O=h.getContext("2d");let{cropX:S,cropY:b}=l;const _=f.width*l.cropWidth,y=f.height*l.cropHeight,p=l.width/l.height;let v,m;const d=_/y;return l.type==="svg"?(v=_,m=y):p>=d?(v=_,m=_/p):(v=y*p,m=y),O.drawImage(f,S*f.width,b*f.height,v,m,0,0,h.width,h.height),h.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,h=u/f;let O,S;h>=l.width/l.height?(O=l.width,S=l.width/h):(O=l.height*h,S=l.height);const b=(l.width-O)/2,_=(l.height-S)/2;return{cropX:b/l.width,cropY:_/l.height,cropWidth:O/l.width,cropHeight:S/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(Cc);(function(e){var t=ve&&ve.__createBinding||(Object.create?function(E,x,C,R){R===void 0&&(R=C);var N=Object.getOwnPropertyDescriptor(x,C);N&&!("get"in N?!x.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return x[C]}}),Object.defineProperty(E,R,N)}:function(E,x,C,R){R===void 0&&(R=C),E[R]=x[C]}),r=ve&&ve.__setModuleDefault||(Object.create?function(E,x){Object.defineProperty(E,"default",{enumerable:!0,value:x})}:function(E,x){E.default=x}),n=ve&&ve.__importStar||function(E){if(E&&E.__esModule)return E;var x={};if(E!=null)for(var C in E)C!=="default"&&Object.prototype.hasOwnProperty.call(E,C)&&t(x,E,C);return r(x,E),x},i=ve&&ve.__rest||function(E,x){var C={};for(var R in E)Object.prototype.hasOwnProperty.call(E,R)&&x.indexOf(R)<0&&(C[R]=E[R]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(R=Object.getOwnPropertySymbols(E);N<R.length;N++)x.indexOf(R[N])<0&&Object.prototype.propertyIsEnumerable.call(E,R[N])&&(C[R[N]]=E[R[N]])}return C};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=Cc,o=n(tu),l=Cc,u=Qp,f=g2,h=(E,x,...C)=>({type:E,props:x,children:C||[]});function O(E){var x=new DOMParser().parseFromString(E,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=O;const S=async({element:E,page:x,store:C})=>{let{src:R}=E;if(E.type==="svg"&&Object.keys(E.colorsReplace).length){const X=await o.urlToString(R);R=o.replaceColors(X,new Map(Object.entries(E.colorsReplace)))}let N="";E.flipX&&(N+="scaleX(-1)"),E.flipY&&(N+="scaleY(-1)"),N||(N="none");const U={};if(E.clipSrc){const X=await o.urlToBase64(E.clipSrc);U["clip-path"]=`url(${X})`}const G=await(0,l.loadImage)(R),Z=G.width*E.cropWidth,W=G.height*E.cropHeight,H=E.width/E.height;let L,M;const D=Z/W;E.type==="svg"?(L=Z,M=W):H>=D?(L=Z,M=Z/H):(L=W*H,M=W);const B=L/G.width,q=M/G.height,K=L/M>E.width/E.height?E.height/M:E.width/L,z=L*K/B,$=M*K/q,F=E.cropX*K*G.width,Y=E.cropY*K*G.height;return h("div",{style:Object.assign(Object.assign({},U),{width:"100%",height:"100%","border-radius":E.cornerRadius+"px",border:E.borderSize?`${E.borderSize}px solid ${E.borderColor}`:"none",background:`url(${R})`,transform:N,"background-size":`${Math.round(z)}px ${Math.round($)}px`,"background-position-x":-Math.round(F)+"px","background-position-y":-Math.round(Y)+"px"})})},b=async({element:E,page:x,store:C})=>{let R={top:0,left:0};E.fill.indexOf("gradient")>=0&&(R=Object.assign(Object.assign({},R),{"background-color":E.fill,"background-image":E.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const N=E.backgroundPadding*(E.fontSize*E.lineHeight),U=h("div",{style:{position:"absolute",top:-N/2+"px",left:-N/2+"px",display:E.backgroundEnabled?"block":"none",width:E.width+N+"px",height:E.height+N+"px","background-color":E.backgroundColor,"border-radius":E.backgroundCornerRadius*(E.fontSize*E.lineHeight*.5)+"px"}});E.verticalAlign==="middle"?(R.top="50%",R.transform="translateY(-50%)"):E.verticalAlign==="bottom"&&(R.bottom=0);const G=/<[a-z][\s\S]*>/i.test(E.text),Z=Object.assign(Object.assign({},R),{position:"absolute",width:E.width+"px",color:E.fill,"white-space":"pre-wrap","font-size":E.fontSize+"px","text-align":E.align,"font-family":E.fontFamily,"text-decoration":E.textDecoration||"none","line-height":E.lineHeight,"letter-spacing":E.letterSpacing+"em","font-style":E.fontStyle,"font-weight":E.fontWeight,"-webkit-text-stroke":`${E.strokeWidth}px ${E.stroke}`,"text-stroke":`${E.strokeWidth}px ${E.stroke}`}),W="el-"+E.id,H=G?{id:W}:{},L=`<style>#${W} {${f.resetStyleContent}}</style>`,M=h("div",Object.assign(Object.assign({style:Z},H),{innerHTML:G?`${L}${E.text}`:E.text.split(`
|
|
292
|
+
`).join("<br />")}));return h("div",{style:{position:"relative",width:"100%",height:"100%"}},U,M)},_=({element:E,type:x})=>{const C={"stroke-width":E.height,stroke:E.color,"line-cap":"round","stroke-linejoin":"round",opacity:E.opacity};return x==="arrow"||x==="triangle"?h("polyline",Object.assign({points:`${3*E.height},${2*-E.height} 0,0 ${3*E.height},${2*E.height}`},C)):x==="bar"?h("polyline",Object.assign({points:`0,${2*-E.height} 0,${2*E.height}`},C)):x==="circle"?h("circle",Object.assign({r:E.height},C)):x==="square"?h("polyline",Object.assign({points:`${-E.height},${-E.height} ${-E.height},${E.height} ${E.height},${E.height} ${E.height},${-E.height}`},C)):null},y=async({element:E,page:x,store:C})=>h("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},h("rect",{x:0,y:0,width:E.width,height:E.height,fill:E.color}),h("g",{transform:`translate(0 ${E.height/2})`},_({element:E,type:E.startHead})),h("g",{transform:`translate(${E.width} ${E.height/2}) rotate(180)`},_({element:E,type:E.endHead}))),p=async({element:E,page:x,store:C,elementHook:R})=>{const N=await Promise.all(E.children.map(G=>d({element:G,page:x,store:C,elementHook:R}))),U=h("div",{style:{"transform-origin":"top left",opacity:E.opacity}},...N);return R&&R({dom:U,element:E})||U},v=async({element:E,page:x,store:C,elementHook:R})=>{const N=(0,u.figureToSvg)(E),U=h("div",{innerHTML:N});return R&&R({dom:U,element:E})||U},m={image:S,svg:S,text:b,line:y,figure:v,group:p};async function d({element:E,page:x,store:C,elementHook:R}){let N=await m[E.type];N||(N=()=>h("div",{}),console.error(`HTML export does not support ${E.type} type...`));const U=await N({element:E,page:x,store:C}),G=[];E.blurEnabled&&G.push(`blur(${E.blurRadius/2}px)`),E.brightnessEnabled&&G.push(`brightness(${100*E.brightness+100}%)`),E.sepiaEnabled&&G.push("sepia()"),E.grayscaleEnabled&&G.push("grayscale()"),E.shadowEnabled&&G.push(`drop-shadow(${E.shadowOffsetX}px ${E.shadowOffsetY}px ${E.shadowBlur}px ${E.shadowColor})`);const Z=h("div",{id:E.id,style:{position:"absolute",left:E.x+"px",top:E.y+"px",width:E.width+"px",height:E.height+"px",transform:`rotate(${E.rotation}deg)`,"transform-origin":"top left",opacity:E.opacity,display:E.visible&&E.showInExport?"block":"none",filter:G.join(" ")||"none"}},U);return R&&R({dom:Z,element:E})||Z}async function g({page:E,store:x,elementHook:C}){const R=await Promise.all(E.children.map(Z=>d({element:Z,page:E,store:x,elementHook:C}))),N=E.width==="auto"?x.width:E.width,U=E.height==="auto"?x.height:E.height;let G={};if(E.background.indexOf("url")>=0||E.background.indexOf("http")>=0||E.background.indexOf(".jpg")>=0||E.background.indexOf(".png")>=0||E.background.indexOf(".jpeg")>=0){const{width:Z,height:W}=await(0,l.loadImage)(E.background),H=await S({element:Object.assign({x:0,y:0,width:Z,height:W,src:E.background,cornerRadius:0},(0,a.getCrop)({width:Z,height:W},{width:Z,height:W})),page:E,store:x});R.unshift(H)}else G=Object.assign(Object.assign({},G),{"background-color":E.background});return h("div",{className:"page",id:E.id,style:Object.assign(Object.assign({},G),{width:N+"px",height:U+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...R)}async function w({json:E,elementHook:x}){const C=await Promise.all(E.pages.map(U=>g({page:U,store:E,elementHook:x}))),R=[];E.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&R.indexOf(G.fontFamily)===-1&&R.push(G.fontFamily)})});const N=R.map(U=>E.fonts.find(G=>G.fontFamily===U)?h("style",{},""):h("link",{href:`https://fonts.googleapis.com/css?family=${U}`,rel:"stylesheet"}));return h("div",{className:"design"},...N,...C)}e.jsonToDOM=w;const k=(E,x)=>typeof x=="object"?`${E}="${Object.keys(x).map(C=>`${C}:${x[C]};`).join(" ")}"`:`${E}="${x}"`,P=({dom:E})=>{if(typeof E=="string")return E;if(!E)return"";const x=E.props,{innerHTML:C}=x,R=i(x,["innerHTML"]);return`<${E.type} ${Object.keys(R).map(N=>k(N,E.props[N])).join(" ")}>${C||E.children.map(N=>P({dom:N})).join("")}</${E.type}>`};async function A({json:E,elementHook:x}){const C=await w({json:E,elementHook:x});return P({dom:C})}e.jsonToHTML=A})(xS);var PS={};(function(e){var t=ve&&ve.__createBinding||(Object.create?function(E,x,C,R){R===void 0&&(R=C);var N=Object.getOwnPropertyDescriptor(x,C);N&&!("get"in N?!x.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return x[C]}}),Object.defineProperty(E,R,N)}:function(E,x,C,R){R===void 0&&(R=C),E[R]=x[C]}),r=ve&&ve.__setModuleDefault||(Object.create?function(E,x){Object.defineProperty(E,"default",{enumerable:!0,value:x})}:function(E,x){E.default=x}),n=ve&&ve.__importStar||function(E){if(E&&E.__esModule)return E;var x={};if(E!=null)for(var C in E)C!=="default"&&Object.prototype.hasOwnProperty.call(E,C)&&t(x,E,C);return r(x,E),x},i=ve&&ve.__rest||function(E,x){var C={};for(var R in E)Object.prototype.hasOwnProperty.call(E,R)&&x.indexOf(R)<0&&(C[R]=E[R]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(R=Object.getOwnPropertySymbols(E);N<R.length;N++)x.indexOf(R[N])<0&&Object.prototype.propertyIsEnumerable.call(E,R[N])&&(C[R[N]]=E[R[N]])}return C};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const a=Cc,o=n(tu),l=Cc,u=Qp,f=(E,x,...C)=>({type:E,props:x,children:C||[]});function h(E){var x=new DOMParser().parseFromString(E,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=h;const O=async({element:E,page:x,store:C})=>{let{src:R}=E;if(E.type==="svg"){const Q=await o.urlToString(R);R=o.replaceColors(Q,new Map(Object.entries(E.colorsReplace)))}let N="";E.flipX&&(N+="scaleX(-1)"),E.flipY&&(N+="scaleY(-1)"),E.clipSrc&&await o.urlToBase64(E.clipSrc);const U=await(0,l.loadImage)(R),G=U.width*E.cropWidth,Z=U.height*E.cropHeight,W=E.width/E.height;let H,L;const M=G/Z;E.type==="svg"?(H=G,L=Z):W>=M?(H=G,L=G/W):(H=Z*W,L=Z);const D=H/U.width,B=L/U.height,q=H/L>E.width/E.height?E.height/L:E.width/H,K=H*q/D,z=L*q/B,$=E.cropX*U.width*q,F=E.cropY*U.height*q,Y=`clip-${E.id}`,X=R.replace(/&/g,"&");return f("g",{style:{transform:N}},f("defs",{},f("clipPath",{id:Y},f("rect",{x:0,y:0,width:E.width,height:E.height}))),f("image",{"xlink:href":X,x:-$,y:-F,width:K,height:z,preserveAspectRatio:"none","clip-path":`url(#${Y})`}))},S=async({element:E,page:x,store:C})=>{const R=(W,H,L,M,D)=>{const B=document.createElement("canvas").getContext("2d");return B.font=`${D} ${M} ${H}px ${L}`,B.measureText(W).width},N=((W,H,L,M,D,B)=>{const q=[];return W.split(`
|
|
293
|
+
`).forEach(K=>{const z=K.split(" ");let $="";for(let F=0;F<z.length;F++){const Y=$+z[F]+" ";R(Y,L,M,D,B)>H&&F>0?(q.push($.trim()),$=z[F]+" "):$=Y}q.push($.trim())}),q})(E.text,E.width,E.fontSize,E.fontFamily,E.fontWeight,E.fontStyle),U=E.fontSize*E.lineHeight,G=E.align==="center"?"middle":E.align==="right"?"end":"start",Z=N.map((W,H)=>f("tspan",{x:E.align==="center"?E.width/2:E.align==="right"?E.width:0,dy:H===0?0:U,innerHTML:W}));return f("g",{},f("text",{fill:E.fill,y:E.fontSize,"font-size":E.fontSize+"px","text-anchor":G,"font-family":E.fontFamily,"font-style":E.fontStyle,"font-weight":E.fontWeight,"text-decoration":E.textDecoration,"line-height":E.lineHeight,"letter-spacing":E.letterSpacing+"em","stroke-width":E.strokeWidth,stroke:E.stroke},...Z))},b=({element:E,type:x})=>{const C={"stroke-width":E.height,stroke:E.color,"line-cap":"round","stroke-linejoin":"round",opacity:E.opacity};return x==="arrow"||x==="triangle"?f("polyline",Object.assign({points:`${3*E.height},${2*-E.height} 0,0 ${3*E.height},${2*E.height}`},C)):x==="bar"?f("polyline",Object.assign({points:`0,${2*-E.height} 0,${2*E.height}`},C)):x==="circle"?f("circle",Object.assign({r:E.height},C)):x==="square"?f("polyline",Object.assign({points:`${-E.height},${-E.height} ${-E.height},${E.height} ${E.height},${E.height} ${E.height},${-E.height}`},C)):null},_=async({element:E,page:x,store:C})=>f("g",{},f("line",{x1:0,y1:E.height/2,x2:E.width,y2:E.height/2,stroke:E.color,"stroke-width":E.height}),f("g",{transform:`translate(0 ${E.height/2})`},b({element:E,type:E.startHead})),f("g",{transform:`translate(${E.width} ${E.height/2}) rotate(180)`},b({element:E,type:E.endHead}))),y=async({element:E,page:x,store:C,elementHook:R})=>{const N=await Promise.all(E.children.map(G=>d({element:G,page:x,store:C,elementHook:R}))),U=f("g",{opacity:E.opacity,transform:`translate(${E.x}, ${E.y}) rotate(${E.rotation})`,style:{"transform-origin":"top left"}},...N);return R&&R({dom:U,element:E})||U};function p(E){let x=E.replace(/<svg[^>]*>/,"");return x=x.replace(/<\/svg>/,""),x}const v=async({element:E,page:x,store:C,elementHook:R})=>{const N=p((0,u.figureToSvg)(E)),U=f("g",{innerHTML:N});return R&&R({dom:U,element:E})||U},m={image:O,svg:O,text:S,line:_,figure:v,group:y};async function d({element:E,page:x,store:C,elementHook:R}){let N=await m[E.type];N||(N=()=>f("g",{}),console.error(`SVG export does not support ${E.type} type...`));const U=await N({element:E,page:x,store:C}),G=[];E.blurEnabled&&G.push(`blur(${E.blurRadius/2}px)`),E.brightnessEnabled&&G.push(`brightness(${100*E.brightness+100}%)`),E.sepiaEnabled&&G.push("sepia()"),E.grayscaleEnabled&&G.push("grayscale()"),E.shadowEnabled&&G.push(`drop-shadow(${E.shadowOffsetX}px ${E.shadowOffsetY}px ${E.shadowBlur}px ${E.shadowColor})`);const Z=f("g",{className:"element",id:E.id,transform:`translate(${E.x}, ${E.y}) rotate(${E.rotation})`,display:E.visible?void 0:"none",style:{"transform-origin":"top left",filter:G.join(" ")}},U);return R&&R({dom:Z,element:E})||Z}async function g({page:E,store:x,elementHook:C}){const R=await Promise.all(E.children.map(G=>d({element:G,page:E,store:x,elementHook:C}))),N=E.background.indexOf("url")>=0||E.background.indexOf("http")>=0||E.background.indexOf(".jpg")>=0||E.background.indexOf(".png")>=0||E.background.indexOf(".jpeg")>=0;let U;if(N){const G=await(0,l.loadImage)(E.background);U=await(0,l.cropImage)(E.background,Object.assign({width:x.width,height:x.height,x:0,y:0},(0,a.getCrop)({width:x.width,height:x.height},{width:G.width,height:G.height})))}return f("g",{className:"page",style:{}},N?f("image",{"xlink:href":U,x:0,y:0,width:x.width,height:x.height,preserveAspectRatio:"none"}):f("rect",{x:0,y:0,width:x.width,height:x.height,fill:N?void 0:E.background}),...R)}async function w({json:E,elementHook:x}){const C=await Promise.all(E.pages.map(U=>g({page:U,store:E,elementHook:x}))),R=[];E.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&R.indexOf(G.fontFamily)===-1&&R.push(G.fontFamily)})});const N=R.map(U=>E.fonts.find(G=>G.fontFamily===U)?f("style",{},""):f("defs",{},f("style",{type:"text/css",innerHTML:`@import url('https://fonts.googleapis.com/css?family=${U}:bi,normal,i,b');`.replace(/&/g,"&")})));return f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${E.width} ${E.height}`},...N,...C)}e.jsonToDOM=w;const k=(E,x)=>typeof x=="object"?`${E}="${Object.keys(x).map(C=>`${C}:${x[C]};`).join(" ")}"`:x==null||x===""?"":`${E}="${x}"`,P=({dom:E,nestLevel:x=0})=>{if(typeof E=="string")return E;if(!E)return"";const C=E.props,{innerHTML:R}=C,N=i(C,["innerHTML"]),U=" ".repeat(x);return`${U}<${E.type} ${Object.keys(N).map(G=>k(G,N[G])).join(" ")}>${R||`
|
|
294
|
+
`+E.children.map(G=>P({dom:G,nestLevel:x+1})).join("")}${U}</${E.type}>
|
|
295
|
+
`};async function A({json:E,elementHook:x}){const C=await w({json:E,elementHook:x});return P({dom:C})}e.jsonToSVG=A})(PS);var Kg={},O_;function CS(){return O_||(O_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=Qn,r=e0,n=kc(),i=x2(),a=kc(),o=nu;e.Page=t.types.model("Page",{id:t.types.identifier,children:t.types.array(t.types.late(()=>n.ElementTypes)),width:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),height:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),background:"white",bleed:0,custom:t.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(l=>{const u=Object.assign({},l),f={};for(var h in u)h[0]!=="_"&&(f[h]=l[h]);return f}).views(l=>({get store(){return(0,t.getParentOfType)(l,i.Store)}})).views(l=>({get startTime(){let u=0;for(const f of l.store.pages){if(f.id===l.id)return u;u+=f.duration}return u},get _exportingOrRendering(){return l._exporting||l._rendering}})).views(l=>({get computedWidth(){return l.width==="auto"?l.store.width:l.width},get computedHeight(){return l.height==="auto"?l.store.height:l.height}})).actions(l=>({toJSON:()=>JSON.parse(JSON.stringify((0,t.getSnapshot)(l))),_forEachElementUp(u,f){const h=u.map(O=>({id:O,index:l.children.findIndex(S=>S.id===O)}));h.sort((O,S)=>S.index-O.index);for(const{index:O}of h){if(O==-1)continue;const S=O<l.children.length-1&&l.children[O+1],b=u.indexOf(S==null?void 0:S.id)>=0;O===l.children.length-1||b||f(O)}},_forEachElementDown(u,f){const h=u.map(O=>({id:O,index:l.children.findIndex(S=>S.id===O)}));h.sort((O,S)=>O.index-S.index);for(const{index:O}of h){if(O==-1)continue;const S=O>0&&l.children[O-1],b=u.indexOf(S==null?void 0:S.id)>=0;O===0||b||f(O)}return!1}})).actions(l=>({clone(u={}){const f=l.toJSON();f.children.forEach(b=>{b.id=(0,r.nanoid)(10),(0,a.forEveryChild)(b,_=>{_.id=(0,r.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},f),{id:(0,r.nanoid)(10)}),u),O=l.store.addPage(h),S=l.store.pages.indexOf(l);O.setZIndex(S+1),O.select()},setZIndex(u){l.store.setPageZIndex(l.id,u)},set(u){Object.assign(l,u)},select(){l.store.selectPage(l.id)},addElement(u,{skipSelect:f=!1}={}){const h=a.TYPES_MAP[u.type];if(!h)return void console.error("Can not find model with type "+u.type);u.children&&u.children.forEach(S=>{S.id=(0,r.nanoid)(10)});const O=h.create(Object.assign({id:(0,r.nanoid)(10)},u));return l.children.push(O),O.selectable&&!f&&l.store.selectElements([O.id]),O},canMoveElementsUp(u){let f=!1;return l._forEachElementUp(u,()=>{f=f||!0}),f},moveElementsUp(u){l._forEachElementUp(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f+1,0,h)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const f=[],h=[];l.children.forEach(O=>{u.indexOf(O.id)>=0?f.push(O):h.push(O)}),l.children.replace(h.concat(f))},canMoveElementsDown(u){let f=!1;return l._forEachElementDown(u,()=>{f=f||!0}),f},moveElementsDown(u){l._forEachElementDown(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f-1,0,h)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const f=[],h=[];l.children.forEach(O=>{u.indexOf(O.id)>=0?f.push(O):h.push(O)}),l.children.replace(f.concat(h))},setElementZIndex(u,f){const h=l.children.find(O=>O.id===u);h&&((0,t.detach)(h),l.children.remove(h),l.children.splice(f,0,h))},setSize({width:u,height:f,useMagic:h,softChange:O}){if(h){const S=[],b=N=>N.type==="image"&&N.x<1&&N.y<1&&N.width>=l.computedWidth-2&&N.height>=l.computedHeight-2;(0,a.forEveryChild)(l,N=>{N.type!=="group"&&(b(N)||S.push(N))});const _=S.length?(0,o.getTotalClientRect)(S):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},y=0,p=Math.max(0,Math.min(_.x,l.computedWidth-_.x-_.width)),v=l.computedWidth*y,m=Math.max(0,p-v),d=Math.max(0,Math.min(_.y,l.computedHeight-_.y-_.height)),g=l.computedHeight*y,w=Math.max(0,d-g),k=l.computedWidth-2*m,P=l.computedHeight-2*w,A=u/k,E=f/P,x=Math.min(A,E),C=(u-k*x)/2-m*x,R=(f-P*x)/2-w*x;(0,a.forEveryChild)(l,N=>{N.type!=="group"&&(b(N)?N.set({x:N.x*x,y:N.y*x,width:N.width*A,height:N.height*E,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(N.set({x:C+N.x*x,y:R+N.y*x,width:N.width*x,height:N.height*x}),N.type==="text"?N.set({fontSize:N.fontSize*x}):N.type==="figure"&&N.set({strokeWidth:N.strokeWidth*x})))})}O||(l.width=u),O||(l.height=f)}})).actions(l=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([u])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Kg)),Kg}var kS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const t=Qn;e.Audio=t.types.model("Audio",{id:t.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(r=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(r))})).actions(r=>({set(n){Object.assign(r,n)}}))})(kS);var x_;function x2(){return x_||(x_=1,function(e){var t=ve&&ve.__createBinding||(Object.create?function(E,x,C,R){R===void 0&&(R=C);var N=Object.getOwnPropertyDescriptor(x,C);N&&!("get"in N?!x.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return x[C]}}),Object.defineProperty(E,R,N)}:function(E,x,C,R){R===void 0&&(R=C),E[R]=x[C]}),r=ve&&ve.__setModuleDefault||(Object.create?function(E,x){Object.defineProperty(E,"default",{enumerable:!0,value:x})}:function(E,x){E.default=x}),n=ve&&ve.__importStar||function(E){if(E&&E.__esModule)return E;var x={};if(E!=null)for(var C in E)C!=="default"&&Object.prototype.hasOwnProperty.call(E,C)&&t(x,E,C);return r(x,E),x},i=ve&&ve.__rest||function(E,x){var C={};for(var R in E)Object.prototype.hasOwnProperty.call(E,R)&&x.indexOf(R)<0&&(C[R]=E[R]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(R=Object.getOwnPropertySymbols(E);N<R.length;N++)x.indexOf(R[N])<0&&Object.prototype.propertyIsEnumerable.call(E,R[N])&&(C[R[N]]=E[R[N]])}return C},a=ve&&ve.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=Qn,l=_S,u=e0,f=a(wi),h=wS,O=SS,S=ES,b=E2(),_=n(Js),y=Gi,p=Jp,v=O2,m=OS,d=xS,g=PS,w=CS(),k=kc(),P=kS;function A({key:E,showCredit:x}={key:"",showCredit:!1}){const C=e.Store.create();return(0,b.validateKey)(E,x),C}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(E=>Object.assign(Object.assign({},E),{fontFamily:E.fontFamily||E.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(w.Page),fonts:o.types.array(e.Font),audios:o.types.array(P.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:o.types.frozen(),selectedElementsIds:o.types.array(o.types.string),animatedElementsIds:o.types.array(o.types.string),history:o.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:""}).views(E=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),E.bleedVisible},get selectedElements(){return E.selectedElementsIds.map(x=>{for(const C of E.pages)for(const R of C.children)if(R.id===x)return R}).filter(x=>!!x)},get children(){return E.pages},get selectedShapes(){const x=[];return(0,k.forEveryChild)({children:E.selectedElements},C=>{C.type!=="group"&&x.push(C)}),x},get activePage(){return E.pages.slice().find(x=>x.id===E._activePageId)||(E.pages.length?E.pages[0]:null)},get duration(){let x=0;return E.pages.forEach(C=>{x+=C.duration}),x},get _hasCroppedImages(){return E.find(x=>x.type==="image"&&x._cropModeEnabled)},find(x){let C;return(0,k.forEveryChild)({children:E.pages},R=>{if(!C&&x(R))return C=R,!0}),C},getElementById:x=>E.find(C=>C.id===x)})).actions(E=>{let x=0,C=null,R=!1;return{afterCreate(){E.history.canUndo},setCurrentTime(N){E.currentTime=N},play({animatedElementsIds:N=[],startTime:U=0,currentTime:G=0,endTime:Z=E.duration,repeat:W=!1}={}){G&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),U=G),E.animatedElementsIds=(0,o.cast)(N),E.currentTime=U,E.isPlaying=!0,x=Date.now(),C=Z,R=W,requestAnimationFrame(E.seek)},checkActivePage(){let N=0;for(const U of E.pages){if(E.currentTime>=U.startTime&&E.currentTime<U.startTime+U.duration){E.selectPage(U.id);break}N+=U.duration}},seek(){if(!E.isPlaying)return;const N=Date.now(),U=N-x;x=N,E.currentTime+=U,E.checkActivePage();const G=C||E.duration;E.isPlaying&&E.currentTime<G?requestAnimationFrame(E.seek):E.isPlaying&&R?(E.currentTime=0,requestAnimationFrame(E.seek)):E.stop()},stop(){E.isPlaying=!1,E.currentTime=0,E.animatedElementsIds=(0,o.cast)([]),E.checkActivePage()}}}).actions(E=>({set(x){Object.assign(E,x)},setUnit({unit:x,dpi:C}){E.unit=x||E.unit,E.dpi=C||E.dpi},setRole(x){E.role=x},addPage(x){const C=w.Page.create(Object.assign({id:(0,u.nanoid)(10)},x));return E.pages.push(C),E._activePageId=C.id,C},selectPage(x){E._activePageId=x},selectElements(x){const C=x.map(R=>E.getElementById(R)).sort((R,N)=>R.page.children.indexOf(R)-R.page.children.indexOf(N)).filter(R=>!!R).map(R=>R.id);E.selectedElementsIds=(0,o.cast)(C)},toggleBleed(x){E.bleedVisible=x??!E.bleedVisible},toggleRulers(x){E.rulesVisible=x??!E.rulesVisible},openSidePanel(x){E.openedSidePanel!==x&&(E.previousOpenedSidePanel=E.openedSidePanel,E.openedSidePanel=x)},setScale(x){E.scale=x},_setScaleToFit(x){E.scaleToFit=x},setElementsPixelRatio(x){E._elementsPixelRatio=x},setSize(x,C,R){E.pages.forEach(N=>{N.setSize({width:x,height:C,useMagic:R,softChange:!0})}),E.width=x,E.height=C},setPageZIndex(x,C){const R=E.pages.find(N=>N.id===x);R&&((0,o.detach)(R),E.pages.remove(R),E.pages.splice(C,0,R))},deletePages(x){const C=E.pages.indexOf(E.activePage);x.forEach(U=>{const G=E.pages.find(Z=>Z.id===U);(0,o.destroy)(G)});const R=Math.min(E.pages.length-1,C),N=E.pages[R];N&&(E._activePageId=N.id),E.selectedElementsIds=(0,o.cast)(E.selectedElementsIds.filter(U=>E.getElementById(U)))},groupElements(x){const C=x.map(U=>E.getElementById(U));C.forEach(U=>{U&&(0,o.detach)(U)});const R=E.activePage,N={id:(0,u.nanoid)(10),children:C,type:"group"};return R.children.push(N),E.selectedElementsIds=(0,o.cast)([N.id]),N},ungroupElements(x){const C=x.map(N=>E.getElementById(N)),R=[];C.forEach(N=>{if(N&&N.type==="group"){const U=N.page,G=U.children.indexOf(N);N.children.forEach(Z=>{R.push(Z.id)}),N.children.forEach(Z=>{(0,o.detach)(Z),U.children.push(Z)}),U.children.splice(G,1)}}),E.selectedElementsIds=(0,o.cast)(R)},deleteElements(x){const C=[];E.find(R=>(x.includes(R.id)&&C.push(R),!1)),C.forEach(R=>{(0,o.destroy)(R)}),E.selectedElementsIds=(0,o.cast)(E.selectedElementsIds.filter(R=>E.getElementById(R)))},on(x,C){if(x==="change"){let R=E.toJSON();return(0,o.onSnapshot)(E,N=>{const U=E.toJSON();!(0,v.deepEqual)(R,U)&&(R=U,C(U))})}},async _toCanvas({pixelRatio:x,ignoreBackground:C,pageId:R,mimeType:N,includeBleed:U,_skipTimeout:G}={}){var Z;const W=x||1;R=R||((Z=E.pages[0])===null||Z===void 0?void 0:Z.id);const H=E.pages.find(ae=>ae.id===R);if(!H)throw new Error(`No page for export with id ${R}`);H==null||H.set({_exporting:!0});const L=await(0,m.waitTillAvailable)(()=>f.default.stages.find(ae=>ae.getAttr("pageId")===R));if(!L)throw new Error(`Export is failed. Can not find stage for page ${R}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const M=!!L.findOne(".page-container"),D=E._elementsPixelRatio;W>E._elementsPixelRatio&&E.setElementsPixelRatio(W),await E.waitLoading({_skipTimeout:G});const B=L.findOne(".page-container");if(!B)throw E.setElementsPixelRatio(D),new Error(`Export is failed. Can't find page container. ${M}`);L.find("Transformer").forEach(ae=>ae.visible(!1)),B.find(".page-background").forEach(ae=>ae.shadowEnabled(!1)),B.find(".page-background").forEach(ae=>ae.strokeEnabled(!1)),B.find(".highlighter").forEach(ae=>ae.visible(!1));const q=B.findOne(".page-background-group"),K=q.clip();q.clip({x:null,y:null,width:null,height:null});const z=B.findOne(".elements-container"),$=z.clip();z.clip({x:null,y:null,width:null,height:null});const F=B.find(ae=>ae.getAttr("hideInExport"));F.forEach(ae=>{ae.setAttr("oldVisible",ae.visible()),ae.hide()});const Y=B.find(ae=>!ae.visible()&&ae.getAttr("editModeEnabled"));Y.forEach(ae=>{ae.setAttr("oldVisible",ae.visible()),ae.show()}),C&&B.find(".page-background").forEach(ae=>ae.hide());const X=U?H.bleed:0;let Q=X;!E.bleedVisible&&U||(E.bleedVisible||U?E.bleedVisible&&U?Q=0:E.bleedVisible&&!U&&(Q=-H.bleed):Q=0);const J=document.createElement("canvas");J.width=Math.round((H.computedWidth+2*X)*W),J.height=Math.round((H.computedHeight+2*X)*W);const re=J.getContext("2d");N==="image/jpeg"&&(re.fillStyle="white",re.fillRect(0,0,J.width,J.height));const ie=B.scale();B.scale({x:1,y:1});const ne=B.toCanvas({x:B.x()-Q,y:B.y()-Q,width:H.computedWidth+2*X,height:H.computedHeight+2*X,pixelRatio:W});return B.scale(ie),re.drawImage(ne,0,0,J.width,J.height),f.default.Util.releaseCanvas(ne),C&&B.find(".page-background").forEach(ae=>ae.show()),F.forEach(ae=>{ae.visible(ae.getAttr("oldVisible"))}),Y.forEach(ae=>{ae.visible(ae.getAttr("oldVisible"))}),B.find(".page-background").forEach(ae=>ae.shadowEnabled(!0)),B.find(".page-background").forEach(ae=>ae.strokeEnabled(!0)),L.find("Transformer").forEach(ae=>ae.visible(!0)),B.find(".highlighter").forEach(ae=>ae.visible(!0)),q.clip(K),z.clip($),E.setElementsPixelRatio(D),H==null||H.set({_exporting:!1}),J},async toDataURL(x={}){var{mimeType:C,quality:R}=x,N=i(x,["mimeType","quality"]);const U=await E._toCanvas(Object.assign({mimeType:C},N)),G=U.toDataURL(C,R);return f.default.Util.releaseCanvas(U),G},async toBlob(x={}){var{mimeType:C,quality:R}=x,N=i(x,["mimeType","quality"]);const U=await E._toCanvas(Object.assign({mimeType:C},N)),G=new Promise(Z=>{U.toBlob(Z,C,R)});return f.default.Util.releaseCanvas(U),G},async saveAsImage(x={}){var{fileName:C}=x,R=i(x,["fileName"]);const N=R.mimeType||"image/png",U=N.split("/")[1];(0,h.downloadFile)(await E.toDataURL(R),C||"polotno."+U,N)},async _toPDF(x){const C=x.dpi||E.dpi,R=x.parallel||1,N=x.unit||(E.unit==="px"?"mm":E.unit),U=x.pixelRatio||1,G=x.pageIds||E.pages.map(F=>F.id),Z=E.pages.filter(F=>G.includes(F.id)),W=await(0,O.getJsPDF)(),H=F=>(0,p.pxToUnit)({px:F,unit:N,dpi:C}),L=H(x.cropMarkSize||0),M=Z[0]||{},D=x.includeBleed?M.bleed:0,B=H(M.computedWidth+2*D)+2*L,q=H(M.computedHeight+2*D)+2*L;var K=new W({unit:N,orientation:B>q?"landscape":"portrait",format:[B,q],compress:!0,putOnlyUsedFonts:!0});K.deletePage(1);const z=((F,Y)=>{for(var X=[],Q=0;Q<F.length;Q+=Y)X.push(F.slice(Q,Q+Y));return X})(Z,R);let $=0;for(const F of z){const Y=F.map(async X=>{const Q=x.includeBleed?X.bleed:0,J=H(X.computedWidth+2*Q)+2*L,re=H(X.computedHeight+2*Q)+2*L;let ie=0,ne=U;for(;ie<10;){ie+=1,ie===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ae=await E.toDataURL(Object.assign(Object.assign({},x),{pageId:X.id,pixelRatio:ne}));if(ae.length>20)return x.onProgress&&x.onProgress(++$/G.length*.9),{url:ae,width:J,height:re};ne*=.8}});(await Promise.all(Y)).forEach(({url:X,width:Q,height:J})=>{K.addPage([Q,J],Q>J?"landscape":"portrait"),L&&(K.setLineWidth(H(1)),K.line(2*L,0,2*L,L),K.line(0,2*L,L,2*L),K.line(Q-2*L,0,Q-2*L,L),K.line(Q,2*L,Q-L,2*L),K.line(0,J-2*L,L,J-2*L),K.line(2*L,J,2*L,J-L),K.line(Q,J-2*L,Q-L,J-2*L),K.line(Q-2*L,J,Q-2*L,J-L)),K.addImage(X,L,L,Q-2*L,J-2*L,void 0,"FAST")})}return K},toPDFDataURL:async x=>(await E._toPDF(Object.assign({mimeType:"image/jpeg"},x))).output("datauristring"),async toGIFDataURL(x={}){const C=x.pixelRatio||1,R=await(0,S.createGIF)({width:E.width*C,height:E.height*C}),N=1e3/(x.fps||10),U=E.duration/N;for(let G=0;G<U-1;G++){const Z=G*N||1;E.setCurrentTime(Z);let W=0,H="";for(const M of E.pages)if(W+=M.duration,M.set({_rendering:W>Z}),W>Z){H=M.id;break}const L=await E._toCanvas({pixelRatio:C,pageId:H,_skipTimeout:!0});R.addFrame(L.getContext("2d"),{delay:N,copy:!0})}for(const G of E.pages)G.set({_rendering:!1});return E.stop(),R.render(),new Promise(G=>{R.on("finished",function(Z){(function(W,H){var L=new FileReader;L.onload=function(M){H(M.target.result)},L.readAsDataURL(W)})(Z,G)})})},async saveAsGIF(x={}){var{fileName:C}=x,R=i(x,["fileName"]);const N=await E.toGIFDataURL(R);(0,h.downloadFile)(N,C||"polotno.gif")},async toHTML({elementHook:x}={elementHook:void 0}){const C=E.toJSON();return(0,d.jsonToHTML)({json:C,elementHook:x})},async saveAsHTML({fileName:x}={}){const C=await E.toHTML(),R="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(C)));(0,h.downloadFile)(R,x||"polotno.html")},async toSVG({elementHook:x}={elementHook:void 0}){const C=E.toJSON();return(0,g.jsonToSVG)({json:C,elementHook:x})},async saveAsSVG({fileName:x,elementHook:C}={}){const R=await E.toSVG({elementHook:C}),N="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(R)));(0,h.downloadFile)(N,x||"polotno.svg")},async saveAsPDF(x={}){var{fileName:C}=x,R=i(x,["fileName"]);(await E._toPDF(Object.assign({mimeType:"image/jpeg"},R))).save(C||"polotno.pdf")},async waitLoading({_skipTimeout:x=!1}={}){x||await new Promise(C=>setTimeout(C,50)),await(0,y.whenLoaded)()},toJSON:()=>({width:E.width,height:E.height,fonts:(0,o.getSnapshot)(E.fonts),pages:(0,o.getSnapshot)(E.pages),audios:(0,o.getSnapshot)(E.audios),unit:E.unit,dpi:E.dpi,custom:E.custom}),loadJSON(x,C=!1){var R;const N=Object.assign({},x),U=E.pages.indexOf(E.activePage);let G=(R=N.pages[U]||N.pages[0])===null||R===void 0?void 0:R.id;N._activePageId=G;const Z=Object.assign({},(0,o.getSnapshot)(E));Object.assign(Z,N),Z.history=C?E.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(E,Z)},clear({keepHistory:x=!1}={}){const C=E.pages.map(R=>R.id);E.deletePages(C),x||E.history.clear()},addFont(x){E.removeFont(x.fontFamily),E.fonts.push(x),E.loadFont(x.fontFamily)},removeFont(x){E.fonts.filter(C=>C.fontFamily===x).forEach(C=>(0,o.destroy)(C))},addAudio(x){const C=P.Audio.create(Object.assign({id:(0,u.nanoid)(10)},x));E.audios.push(C)},removeAudio(x){const C=E.audios.find(R=>R.id===x);C&&E.audios.remove(C)},async loadFont(x){const C=E.fonts.find(N=>N.fontFamily===x)||_.globalFonts.find(N=>N.fontFamily===x);let R=[{fontStyle:"normal",fontWeight:"normal"}];return C?(C.styles&&(R=C.styles.map(N=>({fontStyle:N.fontStyle||"normal",fontWeight:N.fontWeight||"normal"}))),_.injectCustomFont(C)):_.injectGoogleFont(x),Promise.all(R.map(N=>_.loadFont(x,N.fontStyle,N.fontWeight)))},validate:x=>e.Store.validate(x,[{path:"",type:e.Store}]).map(C=>({path:"store"+C.context.map(R=>R.path).join("."),message:C.message}))})),e.createStore=A,e.default=A}(Wg)),Wg}var P_;function TS(){return P_||(P_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=Qn,r=e0,n=x2(),i=CS(),a=kc();e.Node=t.types.model("Node",{id:t.types.identifier,type:"none",name:"",opacity:1,custom:t.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var l in o)o[l]===null&&(o[l]=void 0);return o}).postProcessSnapshot(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,t.getParentOfType)(o,i.Page)},get store(){return(0,t.getParentOfType)(o,n.Store)},get top(){let l=o;for(;;){if(!(0,t.hasParentOfType)(l,a.GroupElement))return l;l=(0,t.getParentOfType)(l,a.GroupElement)}},get parent(){return(0,t.hasParentOfType)(o,a.GroupElement)?(0,t.getParentOfType)(o,a.GroupElement):(0,t.hasParentOfType)(o,i.Page)?(0,t.getParentOfType)(o,i.Page):(0,t.hasParentOfType)(o,n.Store)?(0,t.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(o))})).actions(o=>({clone(l={},{skipSelect:u=!1}={}){const f=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(f,h=>{h.id=(0,r.nanoid)(10)}),Object.assign(f,l),o.page.addElement(f,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(l){o.parent.setElementZIndex(o.id,l)},beforeDestroy(){}}))}(qg)),qg}var Yg={},AS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t=nu,r={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}};e.animations={fade:({dTime:a,element:o,animation:l})=>{const u=a/l.duration;return l.type==="enter"?{opacity:u*o.opacity}:{opacity:(1-u)*o.opacity}},rotate:({dTime:a,element:o,animation:l})=>{const u=a/l.duration*360;return(0,t.rotateAroundCenter)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation},u)},blink:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=a%u/(u/2),h=f<=1?f:2-f;return{opacity:o.opacity*h}},bounce:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=u/2,h={},O={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},S={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},b=a%u/f,_=b<=1?b:2-b;for(let y in O){const p=O[y],v=S[y]-p;h[y]=p+_*v}return h},move:({dTime:a,element:o,animation:l})=>{const u=r[l.data.direction]||r.right,f={};for(var h in u.from){let O=u.from[h],S=u.to[h];l.type==="exit"&&(O=u.to[h],S=-u.from[h]);const b=o[h]+O,_=o[h]+S-b;f[h]=b+a/l.duration*_}return f},zoom:({dTime:a,element:o,animation:l})=>{const u={},f={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},h={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var O in f){let S=f[O],b=h[O];if(l.type==="exit"){const y=S;S=b,b=y}const _=b-S;u[O]=S+a/l.duration*_}return u}};const n=({element:a,dTime:o,animation:l})=>{const u=e.animations[l.name];return u?u({element:a,dTime:o,animation:l}):(console.error("Can not find animation type: "+l.name),{})};e.animate=n;const i=(a,o)=>{};e.registerAnimation=i})(AS);var C_;function iu(){return C_||(C_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=Qn,r=AS,n=Yi,i=TS();e.Animation=t.types.model("Animation",{delay:0,duration:500,enabled:!0,type:t.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:t.types.frozen({})}),e.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:t.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(a=>{const o=Object.assign(Object.assign({},a),{x:a.x||0,y:a.y||0});return"width"in a&&(o.width=o.width||1),"height"in a&&(o.height=o.height||1),a.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1,o.removable=!1),o}).views(a=>{const o=(0,n.observable)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),l=(0,n.action)(u=>{Object.assign(o,u)});return{get a(){const{currentTime:u}=a.store;if(l({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),u===0)return o;const f=u-a.page.startTime;if(f>a.page.duration||f<0)return o;const h=a.store.animatedElementsIds;if(h.length&&!h.includes(a.id))return o;const O=a.animations.find(_=>_.type==="enter");if(O!=null&&O.enabled&&f<O.delay&&l({opacity:0}),O!=null&&O.enabled&&f>=O.delay&&f<=O.delay+O.duration){const _=f-O.delay,y=(0,r.animate)({element:a,animation:O,dTime:_});l(y)}const S=a.animations.find(_=>_.type==="exit");if(S!=null&&S.enabled&&f>=a.page.duration-S.duration-S.delay&&f<=a.page.duration-S.delay){const _=f-(a.page.duration-S.duration-S.delay),y=(0,r.animate)({element:a,animation:S,dTime:_});l(y)}S!=null&&S.enabled&&f>=a.page.duration-S.delay&&l({opacity:0});const b=a.animations.find(_=>_.type==="loop");if(b!=null&&b.enabled){const _=f,y=(0,r.animate)({element:a,animation:b,dTime:_});l(y)}return o},animated:u=>a.a[u]}}).actions(a=>({setAnimation(o,l){const u=a.animations.find(f=>f.type===o);u?Object.assign(u,l):a.animations.push(Object.assign({type:o},l))}}))}(Yg)),Yg}var Xg={},k_;function vj(){return k_||(k_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=Qn,r=iu();e.TextElement=r.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:t.types.optional(t.types.union(t.types.number,t.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(i){n._editModeEnabled=i??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},T_;function RS(){return T_||(T_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=iu();e.ImageElement=t.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(r=>({toggleCropMode(n){r._cropModeEnabled=n??!r._cropModeEnabled,r._cropModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()},beforeDestroy(){r._cropModeEnabled&&r.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},A_;function mj(){return A_||(A_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const t=RS();e.VideoElement=t.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Qg)),Qg}var Jg={},R_;function yj(){return R_||(R_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=Qn,r=iu();e.LineElement=r.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:t.types.array(t.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Jg)),Jg}var ev={},M_;function bj(){return M_||(M_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=Qn,r=iu();e.SVGElement=r.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:t.types.map(t.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource})).actions(n=>({replaceColor(i,a){n.colorsReplace.set(i,a)}}))}(ev)),ev}var tv={},L_;function _j(){return L_||(L_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=Qn,r=iu();e.FigureElement=r.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:t.types.array(t.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var N_;function kc(){return N_||(N_=1,function(e){var t=ve&&ve.__rest||function(p,v){var m={};for(var d in p)Object.prototype.hasOwnProperty.call(p,d)&&v.indexOf(d)<0&&(m[d]=p[d]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function"){var g=0;for(d=Object.getOwnPropertySymbols(p);g<d.length;g++)v.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(p,d[g])&&(m[d[g]]=p[d[g]])}return m};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=Qn,n=e0,i=TS(),a=iu(),o=vj(),l=RS(),u=mj(),f=yj(),h=bj(),O=_j(),S=(p,v)=>{if(p.children)for(const m of p.children){if(v(m)===!0)break;(0,e.forEveryChild)(m,v)}};e.forEveryChild=S;const b=[...new Array(20)].map((p,v)=>r.types.late(()=>_[v]));e.ElementTypes=r.types.union({dispatcher:p=>{const v=e.TYPES_MAP[p.type];if(!v)throw new Error(`Unknown element type: "${p.type}"`);return v}},h.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,O.FigureElement,r.types.late(()=>e.GroupElement),...b),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(p=>({get draggable(){let v=!0;return(0,e.forEveryChild)(p,m=>{m.draggable||(v=!1)}),v},get resizable(){let v=!0;return(0,e.forEveryChild)(p,m=>{m.resizable||(v=!1)}),v},get contentEditable(){let v=!0;return(0,e.forEveryChild)(p,m=>{m.contentEditable||(v=!1)}),v},get styleEditable(){let v=!0;return(0,e.forEveryChild)(p,m=>{m.styleEditable||(v=!1)}),v},get locked(){let v=!0;return(0,e.forEveryChild)(p,m=>{m.locked||(v=!1)}),v}})).actions(p=>({set(v){var{draggable:m,contentEditable:d,styleEditable:g,resizable:w}=v,k=t(v,["draggable","contentEditable","styleEditable","resizable"]);m!==void 0&&(0,e.forEveryChild)(p,P=>{P.set({draggable:m})}),d!==void 0&&(0,e.forEveryChild)(p,P=>{P.set({contentEditable:d})}),g!==void 0&&(0,e.forEveryChild)(p,P=>{P.set({styleEditable:g})}),w!==void 0&&(0,e.forEveryChild)(p,P=>{P.set({resizable:w})}),Object.assign(p,k)},addElement(v,{skipSelect:m=!1}={}){const d=e.TYPES_MAP[v.type];if(!d)return void console.error("Can not find model with type "+v.type);v.children&&v.children.forEach(w=>{w.id=(0,n.nanoid)(10)});const g=d.create(Object.assign({id:(0,n.nanoid)(10)},v));return p.children.push(g),g.selectable&&!m&&p.store.selectElements([g.id]),g},setElementZIndex(v,m){const d=p.children.find(g=>g.id===v);d&&((0,r.detach)(d),p.children.remove(d),p.children.splice(m,0,d))}}));const _=[];function y(p,v){const m=p.type;if(!m)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(m).props(p);v&&(d=v(d)),e.TYPES_MAP[m]=d,_.push(d)}e.TYPES_MAP={svg:h.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:f.LineElement,video:u.VideoElement,figure:O.FigureElement},e.registerShapeModel=y}(Vg)),Vg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=kc();let r=[],n="";const i="polotno_clipboard",a=u=>{r=JSON.parse(JSON.stringify(u));try{localStorage.setItem(i,JSON.stringify(u))}catch{}},o=()=>{try{const u=localStorage.getItem(i);if(u)return JSON.parse(u)}catch{}return r};function l(u,f){var h,O,S,b,_,y,p,v;if(((h=document.activeElement)===null||h===void 0?void 0:h.tagName)==="INPUT"||((O=document.activeElement)===null||O===void 0?void 0:O.tagName)==="TEXTAREA"||((S=document.activeElement)===null||S===void 0?void 0:S.contentEditable)==="true")return;const m=f.selectedElements.filter(k=>k.removable),d=m.map(k=>k.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const g=u.ctrlKey||u.metaKey,w=u.shiftKey;if(g&&!w&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),g&&w&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),g&&u.code==="KeyA"){u.preventDefault();const k=(b=f.activePage)===null||b===void 0?void 0:b.children.filter(A=>A.selectable),P=(k==null?void 0:k.map(A=>A.id))||[];f.selectElements(P)}if(g&&u.code==="KeyC"&&(u.preventDefault(),n=(_=f.activePage)===null||_===void 0?void 0:_.id,a(f.selectedElements.map(k=>k.toJSON()))),g&&u.code==="KeyX"&&(u.preventDefault(),n=(y=f.activePage)===null||y===void 0?void 0:y.id,a(f.selectedElements.map(k=>k.toJSON())),f.deleteElements(m)),g&&u.code==="KeyV"){u.preventDefault();let k=0;n===((p=f.activePage)===null||p===void 0?void 0:p.id)&&(k=f.width/20),n=(v=f.activePage)===null||v===void 0?void 0:v.id,f.history.transaction(()=>{const P=[],A=o();(0,t.forEveryChild)({children:A},E=>{delete E.id,E.type!=="group"&&(E.x+=k,E.y+=k)}),A.forEach(E=>{var x;const C=(x=f.activePage)===null||x===void 0?void 0:x.addElement(E);C&&P.push(C.id)}),a(A),f.selectElements(P)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x+1})}))}e.handleHotkey=l})(mS);var MS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=Yi,r=(0,t.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",removeAudio:"Remove audio"}});function n(h,O){var S,b=O.split("."),_=h;for(S=0;S<b.length;++S){if(_[b[S]]==null)return;_=_[b[S]]}return _}const i=h=>h&&typeof h=="object";function a(h,O){Object.keys(O).forEach(S=>{const b=h[S],_=O[S];i(_)&&i(b)?a(b,_):h[S]=_})}function o(h,O,S=""){Object.keys(O).forEach(b=>{const _=O[b],y=S?`${S}.${b}`:b;i(_)?i(h[b])?o(h[b],_,y):console.warn(`Missing nested translation object at '${y}'`):h[b]===void 0&&console.warn(`Missing translation '${y}'`)})}e.setTranslations=(0,t.action)((h,{validate:O=!1}={})=>{O&&o(h,r),a(r,h)});const l=()=>(0,t.toJS)(r);e.getTranslations=l;const u={},f=h=>{const O=n(r,h);if(O!==void 0)return O;u[h]||(u[h]=!0,console.warn(`Missing translation '${h}'`));const S=h.split("."),b=S[S.length-1]||" ";return b.charAt(0).toUpperCase()+b.slice(1)};e.t=f})(MS);(function(e){var t=ve&&ve.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(rt),n=Zn,i=t(r9),a=gS,o=vS,l=mS,u=MS,f=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
296
|
+
Width or height of parent elements is equal 0.
|
|
297
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
298
|
+
For simpler debugging here is the log of the parent element:`,h=(_,y,p,v,m,d)=>{const g=r.default.useRef({width:y,height:p}),w=r.default.useRef({top:0,left:0}),k=r.default.useRef(!1),P=r.default.useRef(m.pages.length);k.current=P.current!==m.pages.length,P.current=m.pages.length,r.default.useEffect(()=>{const A=_.current,E=x=>{w.current={top:A.scrollTop,left:A.scrollLeft}};return A.addEventListener("scroll",E),()=>{A.removeEventListener("scroll",E)}},[]),r.default.useLayoutEffect(()=>{if(!_.current||k.current)return;const A=_.current,E=(w.current.left+A.offsetWidth/2)/g.current.width,x=(w.current.top+A.offsetHeight/2)/g.current.height;d.current=!0,A.scrollLeft=E*y-A.offsetWidth/2,A.scrollTop=x*p-A.offsetHeight/2,g.current={width:y,height:p}},[v,y,p])},O=(_,y,p,v,m)=>{const d=r.default.useRef(!1),g=r.default.useRef(null);r.default.useEffect(()=>{const k=_.current,P=()=>{m.current};return k.addEventListener("scroll",P),()=>{k.removeEventListener("scroll",P)}},[]);const w=p.pages.indexOf(p.activePage);return r.default.useLayoutEffect(()=>{if(!p.activePage||!_.current||d.current)return;const k=_.current,P=p.pages.indexOf(p.activePage)*y;Math.abs(P-k.scrollTop)>.5*y&&(m.current=!0,k.scrollTop=P)},[p.activePage,w]),{handleScroll:k=>{if(m.current)return void(m.current=!1);d.current=!0,clearTimeout(g.current),g.current=setTimeout(()=>{d.current=!1},300);const P=k.currentTarget.childNodes[0].offsetHeight,A=k.currentTarget.scrollTop,E=Math.floor((A+v.height/3)/P),x=p.pages[E];x&&x.select()}}},S=({store:_})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,u.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{_.addPage()}},(0,u.t)("workspace.addPage"))),b=({width:_,height:y,xPadding:p,yPadding:v,backgroundColor:m})=>r.default.createElement("div",{style:{width:_+"px",height:y+"px",backgroundColor:m,paddingLeft:p+"px",paddingRight:p+"px",paddingTop:v+"px",paddingBottom:v+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:_,pageControlsEnabled:y,backgroundColor:p,pageBorderColor:v,activePageBorderColor:m,bleedColor:d,components:g,onKeyDown:w,paddingX:k,paddingY:P,altCloneEnabled:A=!0,visiblePagesOffset:E})=>{const x=k??20,C=P??55,[R,N]=r.default.useState({width:100,height:100}),U=r.default.useRef(R),G=r.default.useRef(null),Z=r.default.useRef(null),W=_.bleedVisible?Math.max(0,..._.pages.map(ie=>ie.bleed)):0,H=Math.max(..._.pages.map(ie=>ie.computedWidth)),L=Math.max(..._.pages.map(ie=>ie.computedHeight)),M=H+2*W,D=L+2*W,B=async({skipTimeout:ie}={skipTimeout:!1})=>{if(ie||await new Promise(_e=>setTimeout(_e,50)),G.current===null)return;const ne=G.current.getBoundingClientRect();ne.width!==0&&ne.height!==0||(console.warn(f),console.log(G.current));const ae=Z.current.clientWidth||ne.width,ke={width:ae,height:ne.height};(U.current.width!==ke.width||U.current.height!==ke.height)&&(N(ke),U.current=ke);const Ae=(ae-2*x)/M,oe=(ne.height-2*C)/D,ce=Math.max(Math.min(Ae,oe),.01);_.scaleToFit!==ce&&(_.setScale(ce),_._setScaleToFit(ce))};r.default.useLayoutEffect(()=>{B({skipTimeout:!0})},[]),r.default.useEffect(()=>{B()},[M,D]),r.default.useEffect(()=>{const ie=G.current;if(window.ResizeObserver){const ne=new ResizeObserver(()=>{B({skipTimeout:!0})});return ne.observe(ie),()=>ne.unobserve(ie)}{const ne=setInterval(()=>{B({skipTimeout:!0})},100);return()=>clearInterval(ne)}},[M,D]);const q=Math.max(x,(R.width-M*_.scale)/2),K=D*_.scale*_.pages.length,z=Math.max(C,(R.height-K)/_.pages.length/2);r.default.useEffect(()=>{const ie=ne=>{(w||l.handleHotkey)(ne,_)};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[]),r.default.useEffect(()=>{var ie;const ne=ae=>{if(ae.ctrlKey||ae.metaKey){ae.preventDefault();const ce=Math.max(3,_.scaleToFit),_e=Math.min(.1,_.scaleToFit),ye=(ke=ae.deltaY<0?1.05*_.scale:_.scale/1.05,Ae=_e,oe=ce,Math.max(Ae,Math.min(oe,ke)));_.setScale(ye)}else var ke,Ae,oe};return(ie=Z.current)===null||ie===void 0||ie.addEventListener("wheel",ne),()=>{var ae;return(ae=Z.current)===null||ae===void 0?void 0:ae.removeEventListener("wheel",ne)}},[]);const $=r.default.useRef(!1);h(Z,M*_.scale+2*q,D*_.scale+2*z,_.scale,_,$);const{handleScroll:F}=O(Z,D*_.scale+2*z,_,R,$),Y=R.width>=M*_.scale+2*q,X=p||"rgba(232, 232, 232, 0.9)",Q=_.pages.indexOf(_.activePage),J=(g==null?void 0:g.NoPages)||S,re=E??Math.min(3,Math.max(1,Math.ceil(R.height/2/(D*_.scale))));return r.default.createElement("div",{ref:G,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:X},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:Z,onScroll:F,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:Y?"hidden":"auto"},className:"polotno-workspace-inner"},_.pages.map((ie,ne)=>Math.abs(ne-Q)<=re||ie._exportingOrRendering?r.default.createElement(i.default,{key:ie.id,page:ie,xPadding:q,yPadding:z,width:M*_.scale+2*q,height:D*_.scale+2*z,store:_,pageControlsEnabled:y,backColor:X,pageBorderColor:v||"lightgrey",activePageBorderColor:m||"rgb(0, 161, 255)",altCloneEnabled:A,bleedColor:d||"rgba(255, 0, 0, 0.1)",components:g}):r.default.createElement(b,{key:ie.id,width:M*_.scale+2*q,height:D*_.scale+2*z,backgroundColor:X,xPadding:q,yPadding:z})),_.rulesVisible&&r.default.createElement(a.TopRules,{store:_,xPadding:q,yPadding:z,width:M*_.scale+2*q,height:D*_.scale+2*z}),_.pages.length===0&&r.default.createElement(J,{store:_}),_.audios.map(ie=>r.default.createElement(o.AudioElement,{key:ie.id,audio:ie,store:_}))))}),e.default=e.WorkspaceCanvas})(qw);var wj=x2();kl.toggleFadeInAnimation(!1);Kn.setTextOverflow("change-font-size");const Sj=new URLSearchParams(location.search).get("key"),LS=wj.createStore({key:Sj});window.store=LS;window.config={addGlobalFont:Js.addGlobalFont,unstable_useHtmlTextRender:Kn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Kn.setTextVerticalResizeEnabled,unstable_setTextOverflow:Kn.setTextOverflow,onLoadError:Gi.onLoadError,setAssetLoadTimeout:Gi.setAssetLoadTimeout,setFontLoadTimeout:Gi.setFontLoadTimeout};const Ej=jd.createRoot(document.getElementById("root"));Ej.render(dt.createElement(qw.WorkspaceCanvas,{visiblePagesOffset:0,store:LS,components:{PageControls:()=>null,Tooltip:()=>null}}));
|