polotno-node 2.7.3 → 2.8.1
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-1AcU7sVo.js +243 -0
- package/dist/index.html +1 -1
- package/package.json +9 -9
- package/video-parallel.js +17 -2
- package/dist/assets/index-5QUPlfKu.js +0 -229
|
@@ -0,0 +1,243 @@
|
|
|
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 be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ao(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 a_={exports:{}},ct={};/**
|
|
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 yc=Symbol.for("react.element"),QS=Symbol.for("react.portal"),JS=Symbol.for("react.fragment"),eE=Symbol.for("react.strict_mode"),tE=Symbol.for("react.profiler"),rE=Symbol.for("react.provider"),nE=Symbol.for("react.context"),iE=Symbol.for("react.forward_ref"),aE=Symbol.for("react.suspense"),oE=Symbol.for("react.memo"),lE=Symbol.for("react.lazy"),zb=Symbol.iterator;function sE(e){return e===null||typeof e!="object"?null:(e=zb&&e[zb]||e["@@iterator"],typeof e=="function"?e:null)}var o_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},l_=Object.assign,s_={};function Ns(e,t,r){this.props=e,this.context=t,this.refs=s_,this.updater=r||o_}Ns.prototype.isReactComponent={};Ns.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")};Ns.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function u_(){}u_.prototype=Ns.prototype;function Qv(e,t,r){this.props=e,this.context=t,this.refs=s_,this.updater=r||o_}var Jv=Qv.prototype=new u_;Jv.constructor=Qv;l_(Jv,Ns.prototype);Jv.isPureReactComponent=!0;var Bb=Array.isArray,c_=Object.prototype.hasOwnProperty,em={current:null},f_={key:!0,ref:!0,__self:!0,__source:!0};function d_(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)c_.call(t,n)&&!f_.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:yc,type:e,key:a,ref:o,props:i,_owner:em.current}}function uE(e,t){return{$$typeof:yc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function tm(e){return typeof e=="object"&&e!==null&&e.$$typeof===yc}function cE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ub=/\/+/g;function t1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?cE(""+e.key):t.toString(36)}function fd(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 yc:case QS:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+t1(o,0):n,Bb(i)?(r="",e!=null&&(r=e.replace(Ub,"$&/")+"/"),fd(i,t,r,"",function(f){return f})):i!=null&&(tm(i)&&(i=uE(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Ub,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",Bb(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+t1(a,l);o+=fd(a,t,r,u,i)}else if(u=sE(e),typeof u=="function")for(e=u.call(e),l=0;!(a=e.next()).done;)a=a.value,u=n+t1(a,l++),o+=fd(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 Df(e,t,r){if(e==null)return e;var n=[],i=0;return fd(e,n,"","",function(a){return t.call(r,a,i++)}),n}function fE(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},dd={transition:null},dE={ReactCurrentDispatcher:Yr,ReactCurrentBatchConfig:dd,ReactCurrentOwner:em};ct.Children={map:Df,forEach:function(e,t,r){Df(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Df(e,function(){t++}),t},toArray:function(e){return Df(e,function(t){return t})||[]},only:function(e){if(!tm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ct.Component=Ns;ct.Fragment=JS;ct.Profiler=tE;ct.PureComponent=Qv;ct.StrictMode=eE;ct.Suspense=aE;ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dE;ct.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=l_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=em.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)c_.call(t,u)&&!f_.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:yc,type:e.type,key:i,ref:a,props:n,_owner:o}};ct.createContext=function(e){return e={$$typeof:nE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rE,_context:e},e.Consumer=e};ct.createElement=d_;ct.createFactory=function(e){var t=d_.bind(null,e);return t.type=e,t};ct.createRef=function(){return{current:null}};ct.forwardRef=function(e){return{$$typeof:iE,render:e}};ct.isValidElement=tm;ct.lazy=function(e){return{$$typeof:lE,_payload:{_status:-1,_result:e},_init:fE}};ct.memo=function(e,t){return{$$typeof:oE,type:e,compare:t===void 0?null:t}};ct.startTransition=function(e){var t=dd.transition;dd.transition={};try{e()}finally{dd.transition=t}};ct.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};ct.useCallback=function(e,t){return Yr.current.useCallback(e,t)};ct.useContext=function(e){return Yr.current.useContext(e)};ct.useDebugValue=function(){};ct.useDeferredValue=function(e){return Yr.current.useDeferredValue(e)};ct.useEffect=function(e,t){return Yr.current.useEffect(e,t)};ct.useId=function(){return Yr.current.useId()};ct.useImperativeHandle=function(e,t,r){return Yr.current.useImperativeHandle(e,t,r)};ct.useInsertionEffect=function(e,t){return Yr.current.useInsertionEffect(e,t)};ct.useLayoutEffect=function(e,t){return Yr.current.useLayoutEffect(e,t)};ct.useMemo=function(e,t){return Yr.current.useMemo(e,t)};ct.useReducer=function(e,t,r){return Yr.current.useReducer(e,t,r)};ct.useRef=function(e){return Yr.current.useRef(e)};ct.useState=function(e){return Yr.current.useState(e)};ct.useSyncExternalStore=function(e,t,r){return Yr.current.useSyncExternalStore(e,t,r)};ct.useTransition=function(){return Yr.current.useTransition()};ct.version="18.2.0";a_.exports=ct;var Qe=a_.exports;const ut=vh(Qe);var Cd={},h_={exports:{}},kn={},p_={exports:{}},g_={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/(function(e){function t(U,W){var M=U.length;U.push(W);e:for(;0<M;){var j=M-1>>>1,B=U[j];if(0<i(B,W))U[j]=W,U[M]=B,M=j;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var W=U[0],M=U.pop();if(M!==W){U[0]=M;e:for(var j=0,B=U.length,N=B>>>1;j<N;){var G=2*(j+1)-1,K=U[G],q=G+1,z=U[q];if(0>i(K,M))q<B&&0>i(z,K)?(U[j]=z,U[q]=M,j=q):(U[j]=K,U[G]=M,j=G);else if(q<B&&0>i(z,M))U[j]=z,U[q]=M,j=q;else break e}}return W}function i(U,W){var M=U.sortIndex-W.sortIndex;return M!==0?M:U.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],f=[],v=1,S=null,_=3,h=!1,E=!1,m=!1,p=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(U){for(var W=r(f);W!==null;){if(W.callback===null)n(f);else if(W.startTime<=U)n(f),W.sortIndex=W.expirationTime,t(u,W);else break;W=r(f)}}function b(U){if(m=!1,d(U),!E)if(r(u)!==null)E=!0,$(O);else{var W=r(f);W!==null&&I(b,W.startTime-U)}}function O(U,W){E=!1,m&&(m=!1,y(w),w=-1),h=!0;var M=_;try{for(d(W),S=r(u);S!==null&&(!(S.expirationTime>W)||U&&!A());){var j=S.callback;if(typeof j=="function"){S.callback=null,_=S.priorityLevel;var B=j(S.expirationTime<=W);W=e.unstable_now(),typeof B=="function"?S.callback=B:S===r(u)&&n(u),d(W)}else n(u);S=r(u)}if(S!==null)var N=!0;else{var G=r(f);G!==null&&I(b,G.startTime-W),N=!1}return N}finally{S=null,_=M,h=!1}}var P=!1,x=null,w=-1,T=5,k=-1;function A(){return!(e.unstable_now()-k<T)}function R(){if(x!==null){var U=e.unstable_now();k=U;var W=!0;try{W=x(!0,U)}finally{W?F():(P=!1,x=null)}}else P=!1}var F;if(typeof g=="function")F=function(){g(R)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,Y=H.port2;H.port1.onmessage=R,F=function(){Y.postMessage(null)}}else F=function(){p(R,0)};function $(U){x=U,P||(P=!0,F())}function I(U,W){w=p(function(){U(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_continueExecution=function(){E||h||(E=!0,$(O))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(U){switch(_){case 1:case 2:case 3:var W=3;break;default:W=_}var M=_;_=W;try{return U()}finally{_=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,W){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var M=_;_=U;try{return W()}finally{_=M}},e.unstable_scheduleCallback=function(U,W,M){var j=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?j+M:j):M=j,U){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,U={id:v++,callback:W,priorityLevel:U,startTime:M,expirationTime:B,sortIndex:-1},M>j?(U.sortIndex=M,t(f,U),r(u)===null&&U===r(f)&&(m?(y(w),w=-1):m=!0,I(b,M-j))):(U.sortIndex=B,t(u,U),E||h||(E=!0,$(O))),U},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(U){var W=_;return function(){var M=_;_=W;try{return U.apply(this,arguments)}finally{_=M}}}})(g_);p_.exports=g_;var Au=p_.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 v_=Qe,xn=Au;function Pe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var m_=new Set,Gu={};function al(e,t){ds(e,t),ds(e+"Capture",t)}function ds(e,t){for(Gu[e]=t,e=0;e<t.length;e++)m_.add(t[e])}var la=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jg=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]*$/,Hb={},$b={};function pE(e){return jg.call($b,e)?!0:jg.call(Hb,e)?!1:hE.test(e)?$b[e]=!0:(Hb[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 Kr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rr[e]=new Kr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rr[t]=new Kr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rr[e]=new Kr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rr[e]=new Kr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Rr[e]=new Kr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rr[e]=new Kr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rr[e]=new Kr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rr[e]=new Kr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rr[e]=new Kr(e,5,!1,e.toLowerCase(),null,!1,!1)});var rm=/[\-:]([a-z])/g;function nm(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(rm,nm);Rr[t]=new Kr(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(rm,nm);Rr[t]=new Kr(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(rm,nm);Rr[t]=new Kr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rr[e]=new Kr(e,1,!1,e.toLowerCase(),null,!1,!1)});Rr.xlinkHref=new Kr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rr[e]=new Kr(e,1,!1,e.toLowerCase(),null,!0,!0)});function im(e,t,r,n){var i=Rr.hasOwnProperty(t)?Rr[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(vE(t,r,i,n)&&(r=null),n||i===null?pE(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 pa=v_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ff=Symbol.for("react.element"),Gl=Symbol.for("react.portal"),Vl=Symbol.for("react.fragment"),am=Symbol.for("react.strict_mode"),Dg=Symbol.for("react.profiler"),y_=Symbol.for("react.provider"),b_=Symbol.for("react.context"),om=Symbol.for("react.forward_ref"),Fg=Symbol.for("react.suspense"),zg=Symbol.for("react.suspense_list"),lm=Symbol.for("react.memo"),ja=Symbol.for("react.lazy"),__=Symbol.for("react.offscreen"),Gb=Symbol.iterator;function hu(e){return e===null||typeof e!="object"?null:(e=Gb&&e[Gb]||e["@@iterator"],typeof e=="function"?e:null)}var Kt=Object.assign,r1;function Pu(e){if(r1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);r1=t&&t[1]||""}return`
|
|
26
|
+
`+r1+e}var n1=!1;function i1(e,t){if(!e||n1)return"";n1=!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{n1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Pu(e):""}function mE(e){switch(e.tag){case 5:return Pu(e.type);case 16:return Pu("Lazy");case 13:return Pu("Suspense");case 19:return Pu("SuspenseList");case 0:case 2:case 15:return e=i1(e.type,!1),e;case 11:return e=i1(e.type.render,!1),e;case 1:return e=i1(e.type,!0),e;default:return""}}function Bg(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 Vl:return"Fragment";case Gl:return"Portal";case Dg:return"Profiler";case am:return"StrictMode";case Fg:return"Suspense";case zg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b_:return(e.displayName||"Context")+".Consumer";case y_:return(e._context.displayName||"Context")+".Provider";case om:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case lm:return t=e.displayName||null,t!==null?t:Bg(e.type)||"Memo";case ja:t=e._payload,e=e._init;try{return Bg(e(t))}catch{}}return null}function yE(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 Bg(t);case 8:return t===am?"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 eo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function w_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bE(e){var t=w_(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 zf(e){e._valueTracker||(e._valueTracker=bE(e))}function S_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=w_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function kd(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 Ug(e,t){var r=t.checked;return Kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Vb(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=eo(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 E_(e,t){t=t.checked,t!=null&&im(e,"checked",t,!1)}function Hg(e,t){E_(e,t);var r=eo(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")?$g(e,t.type,r):t.hasOwnProperty("defaultValue")&&$g(e,t.type,eo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qb(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 $g(e,t,r){(t!=="number"||kd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var xu=Array.isArray;function as(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=""+eo(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 Gg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Pe(91));return Kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wb(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Pe(92));if(xu(r)){if(1<r.length)throw Error(Pe(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:eo(r)}}function O_(e,t){var r=eo(t.value),n=eo(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 Yb(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function P_(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 Vg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?P_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Bf,x_=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(Bf=Bf||document.createElement("div"),Bf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Bf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ru={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},_E=["Webkit","ms","Moz","O"];Object.keys(Ru).forEach(function(e){_E.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ru[t]=Ru[e]})});function C_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ru.hasOwnProperty(e)&&Ru[e]?(""+t).trim():t+"px"}function k_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=C_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var wE=Kt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qg(e,t){if(t){if(wE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Pe(62))}}function Wg(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 Yg=null;function sm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kg=null,os=null,ls=null;function Kb(e){if(e=wc(e)){if(typeof Kg!="function")throw Error(Pe(280));var t=e.stateNode;t&&(t=wh(t),Kg(e.stateNode,e.type,t))}}function T_(e){os?ls?ls.push(e):ls=[e]:os=e}function A_(){if(os){var e=os,t=ls;if(ls=os=null,Kb(e),t)for(e=0;e<t.length;e++)Kb(t[e])}}function R_(e,t){return e(t)}function M_(){}var a1=!1;function L_(e,t,r){if(a1)return e(t,r);a1=!0;try{return R_(e,t,r)}finally{a1=!1,(os!==null||ls!==null)&&(M_(),A_())}}function qu(e,t){var r=e.stateNode;if(r===null)return null;var n=wh(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Pe(231,t,typeof r));return r}var Xg=!1;if(la)try{var pu={};Object.defineProperty(pu,"passive",{get:function(){Xg=!0}}),window.addEventListener("test",pu,pu),window.removeEventListener("test",pu,pu)}catch{Xg=!1}function SE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(v){this.onError(v)}}var Mu=!1,Td=null,Ad=!1,Zg=null,EE={onError:function(e){Mu=!0,Td=e}};function OE(e,t,r,n,i,a,o,l,u){Mu=!1,Td=null,SE.apply(EE,arguments)}function PE(e,t,r,n,i,a,o,l,u){if(OE.apply(this,arguments),Mu){if(Mu){var f=Td;Mu=!1,Td=null}else throw Error(Pe(198));Ad||(Ad=!0,Zg=f)}}function ol(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 N_(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 Xb(e){if(ol(e)!==e)throw Error(Pe(188))}function xE(e){var t=e.alternate;if(!t){if(t=ol(e),t===null)throw Error(Pe(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return Xb(i),e;if(a===n)return Xb(i),t;a=a.sibling}throw Error(Pe(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(Pe(189))}}if(r.alternate!==n)throw Error(Pe(190))}if(r.tag!==3)throw Error(Pe(188));return r.stateNode.current===r?e:t}function I_(e){return e=xE(e),e!==null?j_(e):null}function j_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=j_(e);if(t!==null)return t;e=e.sibling}return null}var D_=xn.unstable_scheduleCallback,Zb=xn.unstable_cancelCallback,CE=xn.unstable_shouldYield,kE=xn.unstable_requestPaint,tr=xn.unstable_now,TE=xn.unstable_getCurrentPriorityLevel,um=xn.unstable_ImmediatePriority,F_=xn.unstable_UserBlockingPriority,Rd=xn.unstable_NormalPriority,AE=xn.unstable_LowPriority,z_=xn.unstable_IdlePriority,mh=null,ji=null;function RE(e){if(ji&&typeof ji.onCommitFiberRoot=="function")try{ji.onCommitFiberRoot(mh,e,void 0,(e.current.flags&128)===128)}catch{}}var si=Math.clz32?Math.clz32:NE,ME=Math.log,LE=Math.LN2;function NE(e){return e>>>=0,e===0?32:31-(ME(e)/LE|0)|0}var Uf=64,Hf=4194304;function Cu(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 Md(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=Cu(l):(a&=o,a!==0&&(n=Cu(a)))}else o=r&~i,o!==0?n=Cu(o):a!==0&&(n=Cu(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-si(t),i=1<<r,n|=e[r],t&=~i;return n}function IE(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 jE(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-si(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=IE(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function Qg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function B_(){var e=Uf;return Uf<<=1,!(Uf&4194240)&&(Uf=64),e}function o1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function bc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-si(t),e[t]=r}function DE(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-si(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function cm(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-si(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Et=0;function U_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var H_,fm,$_,G_,V_,Jg=!1,$f=[],Ga=null,Va=null,qa=null,Wu=new Map,Yu=new Map,Fa=[],FE="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 Qb(e,t){switch(e){case"focusin":case"focusout":Ga=null;break;case"dragenter":case"dragleave":Va=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Wu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yu.delete(t.pointerId)}}function gu(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=wc(t),t!==null&&fm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zE(e,t,r,n,i){switch(t){case"focusin":return Ga=gu(Ga,e,t,r,n,i),!0;case"dragenter":return Va=gu(Va,e,t,r,n,i),!0;case"mouseover":return qa=gu(qa,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return Wu.set(a,gu(Wu.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,Yu.set(a,gu(Yu.get(a)||null,e,t,r,n,i)),!0}return!1}function q_(e){var t=zo(e.target);if(t!==null){var r=ol(t);if(r!==null){if(t=r.tag,t===13){if(t=N_(r),t!==null){e.blockedOn=t,V_(e.priority,function(){$_(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 hd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ev(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Yg=n,r.target.dispatchEvent(n),Yg=null}else return t=wc(r),t!==null&&fm(t),e.blockedOn=r,!1;t.shift()}return!0}function Jb(e,t,r){hd(e)&&r.delete(t)}function BE(){Jg=!1,Ga!==null&&hd(Ga)&&(Ga=null),Va!==null&&hd(Va)&&(Va=null),qa!==null&&hd(qa)&&(qa=null),Wu.forEach(Jb),Yu.forEach(Jb)}function vu(e,t){e.blockedOn===t&&(e.blockedOn=null,Jg||(Jg=!0,xn.unstable_scheduleCallback(xn.unstable_NormalPriority,BE)))}function Ku(e){function t(i){return vu(i,e)}if(0<$f.length){vu($f[0],e);for(var r=1;r<$f.length;r++){var n=$f[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ga!==null&&vu(Ga,e),Va!==null&&vu(Va,e),qa!==null&&vu(qa,e),Wu.forEach(t),Yu.forEach(t),r=0;r<Fa.length;r++)n=Fa[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Fa.length&&(r=Fa[0],r.blockedOn===null);)q_(r),r.blockedOn===null&&Fa.shift()}var ss=pa.ReactCurrentBatchConfig,Ld=!0;function UE(e,t,r,n){var i=Et,a=ss.transition;ss.transition=null;try{Et=1,dm(e,t,r,n)}finally{Et=i,ss.transition=a}}function HE(e,t,r,n){var i=Et,a=ss.transition;ss.transition=null;try{Et=4,dm(e,t,r,n)}finally{Et=i,ss.transition=a}}function dm(e,t,r,n){if(Ld){var i=ev(e,t,r,n);if(i===null)v1(e,t,n,Nd,r),Qb(e,n);else if(zE(i,e,t,r,n))n.stopPropagation();else if(Qb(e,n),t&4&&-1<FE.indexOf(e)){for(;i!==null;){var a=wc(i);if(a!==null&&H_(a),a=ev(e,t,r,n),a===null&&v1(e,t,n,Nd,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else v1(e,t,n,null,r)}}var Nd=null;function ev(e,t,r,n){if(Nd=null,e=sm(n),e=zo(e),e!==null)if(t=ol(e),t===null)e=null;else if(r=t.tag,r===13){if(e=N_(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 Nd=e,null}function W_(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(TE()){case um:return 1;case F_:return 4;case Rd:case AE:return 16;case z_:return 536870912;default:return 16}default:return 16}}var Ua=null,hm=null,pd=null;function Y_(){if(pd)return pd;var e,t=hm,r=t.length,n,i="value"in Ua?Ua.value:Ua.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 pd=i.slice(e,1<n?1-n:void 0)}function gd(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 Gf(){return!0}function e3(){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)?Gf:e3,this.isPropagationStopped=e3,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=Gf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Gf)},persist:function(){},isPersistent:Gf}),t}var Is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pm=Tn(Is),_c=Kt({},Is,{view:0,detail:0}),$E=Tn(_c),l1,s1,mu,yh=Kt({},_c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gm,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!==mu&&(mu&&e.type==="mousemove"?(l1=e.screenX-mu.screenX,s1=e.screenY-mu.screenY):s1=l1=0,mu=e),l1)},movementY:function(e){return"movementY"in e?e.movementY:s1}}),t3=Tn(yh),GE=Kt({},yh,{dataTransfer:0}),VE=Tn(GE),qE=Kt({},_c,{relatedTarget:0}),u1=Tn(qE),WE=Kt({},Is,{animationName:0,elapsedTime:0,pseudoElement:0}),YE=Tn(WE),KE=Kt({},Is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),XE=Tn(KE),ZE=Kt({},Is,{data:0}),r3=Tn(ZE),QE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JE={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"},eO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eO[e])?!!t[e]:!1}function gm(){return tO}var rO=Kt({},_c,{key:function(e){if(e.key){var t=QE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=gd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?JE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gm,charCode:function(e){return e.type==="keypress"?gd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nO=Tn(rO),iO=Kt({},yh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),n3=Tn(iO),aO=Kt({},_c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gm}),oO=Tn(aO),lO=Kt({},Is,{propertyName:0,elapsedTime:0,pseudoElement:0}),sO=Tn(lO),uO=Kt({},yh,{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}),cO=Tn(uO),fO=[9,13,27,32],vm=la&&"CompositionEvent"in window,Lu=null;la&&"documentMode"in document&&(Lu=document.documentMode);var dO=la&&"TextEvent"in window&&!Lu,K_=la&&(!vm||Lu&&8<Lu&&11>=Lu),i3=" ",a3=!1;function X_(e,t){switch(e){case"keyup":return fO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ql=!1;function hO(e,t){switch(e){case"compositionend":return Z_(t);case"keypress":return t.which!==32?null:(a3=!0,i3);case"textInput":return e=t.data,e===i3&&a3?null:e;default:return null}}function pO(e,t){if(ql)return e==="compositionend"||!vm&&X_(e,t)?(e=Y_(),pd=hm=Ua=null,ql=!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 K_&&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 o3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gO[e.type]:t==="textarea"}function Q_(e,t,r,n){T_(n),t=Id(t,"onChange"),0<t.length&&(r=new pm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Nu=null,Xu=null;function vO(e){u6(e,0)}function bh(e){var t=Kl(e);if(S_(t))return e}function mO(e,t){if(e==="change")return t}var J_=!1;if(la){var c1;if(la){var f1="oninput"in document;if(!f1){var l3=document.createElement("div");l3.setAttribute("oninput","return;"),f1=typeof l3.oninput=="function"}c1=f1}else c1=!1;J_=c1&&(!document.documentMode||9<document.documentMode)}function s3(){Nu&&(Nu.detachEvent("onpropertychange",e6),Xu=Nu=null)}function e6(e){if(e.propertyName==="value"&&bh(Xu)){var t=[];Q_(t,Xu,e,sm(e)),L_(vO,t)}}function yO(e,t,r){e==="focusin"?(s3(),Nu=t,Xu=r,Nu.attachEvent("onpropertychange",e6)):e==="focusout"&&s3()}function bO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bh(Xu)}function _O(e,t){if(e==="click")return bh(t)}function wO(e,t){if(e==="input"||e==="change")return bh(t)}function SO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pi=typeof Object.is=="function"?Object.is:SO;function Zu(e,t){if(pi(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(!jg.call(t,i)||!pi(e[i],t[i]))return!1}return!0}function u3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function c3(e,t){var r=u3(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=u3(r)}}function t6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?t6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function r6(){for(var e=window,t=kd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=kd(e.document)}return t}function mm(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 EO(e){var t=r6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&t6(r.ownerDocument.documentElement,r)){if(n!==null&&mm(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=c3(r,a);var o=c3(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 OO=la&&"documentMode"in document&&11>=document.documentMode,Wl=null,tv=null,Iu=null,rv=!1;function f3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;rv||Wl==null||Wl!==kd(n)||(n=Wl,"selectionStart"in n&&mm(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}),Iu&&Zu(Iu,n)||(Iu=n,n=Id(tv,"onSelect"),0<n.length&&(t=new pm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Wl)))}function Vf(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Yl={animationend:Vf("Animation","AnimationEnd"),animationiteration:Vf("Animation","AnimationIteration"),animationstart:Vf("Animation","AnimationStart"),transitionend:Vf("Transition","TransitionEnd")},d1={},n6={};la&&(n6=document.createElement("div").style,"AnimationEvent"in window||(delete Yl.animationend.animation,delete Yl.animationiteration.animation,delete Yl.animationstart.animation),"TransitionEvent"in window||delete Yl.transitionend.transition);function _h(e){if(d1[e])return d1[e];if(!Yl[e])return e;var t=Yl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in n6)return d1[e]=t[r];return e}var i6=_h("animationend"),a6=_h("animationiteration"),o6=_h("animationstart"),l6=_h("transitionend"),s6=new Map,d3="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 oo(e,t){s6.set(e,t),al(t,[e])}for(var h1=0;h1<d3.length;h1++){var p1=d3[h1],PO=p1.toLowerCase(),xO=p1[0].toUpperCase()+p1.slice(1);oo(PO,"on"+xO)}oo(i6,"onAnimationEnd");oo(a6,"onAnimationIteration");oo(o6,"onAnimationStart");oo("dblclick","onDoubleClick");oo("focusin","onFocus");oo("focusout","onBlur");oo(l6,"onTransitionEnd");ds("onMouseEnter",["mouseout","mouseover"]);ds("onMouseLeave",["mouseout","mouseover"]);ds("onPointerEnter",["pointerout","pointerover"]);ds("onPointerLeave",["pointerout","pointerover"]);al("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));al("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));al("onBeforeInput",["compositionend","keypress","textInput","paste"]);al("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));al("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));al("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ku="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(" "),CO=new Set("cancel close invalid load scroll toggle".split(" ").concat(ku));function h3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,PE(n,t,void 0,e),e.currentTarget=null}function u6(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;h3(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;h3(i,l,f),a=u}}}if(Ad)throw e=Zg,Ad=!1,Zg=null,e}function Ft(e,t){var r=t[lv];r===void 0&&(r=t[lv]=new Set);var n=e+"__bubble";r.has(n)||(c6(t,e,2,!1),r.add(n))}function g1(e,t,r){var n=0;t&&(n|=4),c6(r,e,n,t)}var qf="_reactListening"+Math.random().toString(36).slice(2);function Qu(e){if(!e[qf]){e[qf]=!0,m_.forEach(function(r){r!=="selectionchange"&&(CO.has(r)||g1(r,!1,e),g1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qf]||(t[qf]=!0,g1("selectionchange",!1,t))}}function c6(e,t,r,n){switch(W_(t)){case 1:var i=UE;break;case 4:i=HE;break;default:i=dm}r=i.bind(null,t,r,e),i=void 0,!Xg||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 v1(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=zo(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}L_(function(){var f=a,v=sm(r),S=[];e:{var _=s6.get(e);if(_!==void 0){var h=pm,E=e;switch(e){case"keypress":if(gd(r)===0)break e;case"keydown":case"keyup":h=nO;break;case"focusin":E="focus",h=u1;break;case"focusout":E="blur",h=u1;break;case"beforeblur":case"afterblur":h=u1;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":h=t3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=VE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=oO;break;case i6:case a6:case o6:h=YE;break;case l6:h=sO;break;case"scroll":h=$E;break;case"wheel":h=cO;break;case"copy":case"cut":case"paste":h=XE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=n3}var m=(t&4)!==0,p=!m&&e==="scroll",y=m?_!==null?_+"Capture":null:_;m=[];for(var g=f,d;g!==null;){d=g;var b=d.stateNode;if(d.tag===5&&b!==null&&(d=b,y!==null&&(b=qu(g,y),b!=null&&m.push(Ju(g,b,d)))),p)break;g=g.return}0<m.length&&(_=new h(_,E,null,r,v),S.push({event:_,listeners:m}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",_&&r!==Yg&&(E=r.relatedTarget||r.fromElement)&&(zo(E)||E[sa]))break e;if((h||_)&&(_=v.window===v?v:(_=v.ownerDocument)?_.defaultView||_.parentWindow:window,h?(E=r.relatedTarget||r.toElement,h=f,E=E?zo(E):null,E!==null&&(p=ol(E),E!==p||E.tag!==5&&E.tag!==6)&&(E=null)):(h=null,E=f),h!==E)){if(m=t3,b="onMouseLeave",y="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=n3,b="onPointerLeave",y="onPointerEnter",g="pointer"),p=h==null?_:Kl(h),d=E==null?_:Kl(E),_=new m(b,g+"leave",h,r,v),_.target=p,_.relatedTarget=d,b=null,zo(v)===f&&(m=new m(y,g+"enter",E,r,v),m.target=d,m.relatedTarget=p,b=m),p=b,h&&E)t:{for(m=h,y=E,g=0,d=m;d;d=Fl(d))g++;for(d=0,b=y;b;b=Fl(b))d++;for(;0<g-d;)m=Fl(m),g--;for(;0<d-g;)y=Fl(y),d--;for(;g--;){if(m===y||y!==null&&m===y.alternate)break t;m=Fl(m),y=Fl(y)}m=null}else m=null;h!==null&&p3(S,_,h,m,!1),E!==null&&p!==null&&p3(S,p,E,m,!0)}}e:{if(_=f?Kl(f):window,h=_.nodeName&&_.nodeName.toLowerCase(),h==="select"||h==="input"&&_.type==="file")var O=mO;else if(o3(_))if(J_)O=wO;else{O=bO;var P=yO}else(h=_.nodeName)&&h.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(O=_O);if(O&&(O=O(e,f))){Q_(S,O,r,v);break e}P&&P(e,_,f),e==="focusout"&&(P=_._wrapperState)&&P.controlled&&_.type==="number"&&$g(_,"number",_.value)}switch(P=f?Kl(f):window,e){case"focusin":(o3(P)||P.contentEditable==="true")&&(Wl=P,tv=f,Iu=null);break;case"focusout":Iu=tv=Wl=null;break;case"mousedown":rv=!0;break;case"contextmenu":case"mouseup":case"dragend":rv=!1,f3(S,r,v);break;case"selectionchange":if(OO)break;case"keydown":case"keyup":f3(S,r,v)}var x;if(vm)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else ql?X_(e,r)&&(w="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(w="onCompositionStart");w&&(K_&&r.locale!=="ko"&&(ql||w!=="onCompositionStart"?w==="onCompositionEnd"&&ql&&(x=Y_()):(Ua=v,hm="value"in Ua?Ua.value:Ua.textContent,ql=!0)),P=Id(f,w),0<P.length&&(w=new r3(w,e,null,r,v),S.push({event:w,listeners:P}),x?w.data=x:(x=Z_(r),x!==null&&(w.data=x)))),(x=dO?hO(e,r):pO(e,r))&&(f=Id(f,"onBeforeInput"),0<f.length&&(v=new r3("onBeforeInput","beforeinput",null,r,v),S.push({event:v,listeners:f}),v.data=x))}u6(S,t)})}function Ju(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Id(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=qu(e,r),a!=null&&n.unshift(Ju(e,a,i)),a=qu(e,t),a!=null&&n.push(Ju(e,a,i))),e=e.return}return n}function Fl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function p3(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=qu(r,a),u!=null&&o.unshift(Ju(r,u,l))):i||(u=qu(r,a),u!=null&&o.push(Ju(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var kO=/\r\n?/g,TO=/\u0000|\uFFFD/g;function g3(e){return(typeof e=="string"?e:""+e).replace(kO,`
|
|
30
|
+
`).replace(TO,"")}function Wf(e,t,r){if(t=g3(t),g3(e)!==t&&r)throw Error(Pe(425))}function jd(){}var nv=null,iv=null;function av(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 ov=typeof setTimeout=="function"?setTimeout:void 0,AO=typeof clearTimeout=="function"?clearTimeout:void 0,v3=typeof Promise=="function"?Promise:void 0,RO=typeof queueMicrotask=="function"?queueMicrotask:typeof v3<"u"?function(e){return v3.resolve(null).then(e).catch(MO)}:ov;function MO(e){setTimeout(function(){throw e})}function m1(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),Ku(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Ku(t)}function Wa(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 m3(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 js=Math.random().toString(36).slice(2),Mi="__reactFiber$"+js,ec="__reactProps$"+js,sa="__reactContainer$"+js,lv="__reactEvents$"+js,LO="__reactListeners$"+js,NO="__reactHandles$"+js;function zo(e){var t=e[Mi];if(t)return t;for(var r=e.parentNode;r;){if(t=r[sa]||r[Mi]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=m3(e);e!==null;){if(r=e[Mi])return r;e=m3(e)}return t}e=r,r=e.parentNode}return null}function wc(e){return e=e[Mi]||e[sa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Kl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Pe(33))}function wh(e){return e[ec]||null}var sv=[],Xl=-1;function lo(e){return{current:e}}function zt(e){0>Xl||(e.current=sv[Xl],sv[Xl]=null,Xl--)}function Lt(e,t){Xl++,sv[Xl]=e.current,e.current=t}var to={},Ur=lo(to),fn=lo(!1),Wo=to;function hs(e,t){var r=e.type.contextTypes;if(!r)return to;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function dn(e){return e=e.childContextTypes,e!=null}function Dd(){zt(fn),zt(Ur)}function y3(e,t,r){if(Ur.current!==to)throw Error(Pe(168));Lt(Ur,t),Lt(fn,r)}function f6(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Pe(108,yE(e)||"Unknown",i));return Kt({},r,n)}function Fd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Wo=Ur.current,Lt(Ur,e),Lt(fn,fn.current),!0}function b3(e,t,r){var n=e.stateNode;if(!n)throw Error(Pe(169));r?(e=f6(e,t,Wo),n.__reactInternalMemoizedMergedChildContext=e,zt(fn),zt(Ur),Lt(Ur,e)):zt(fn),Lt(fn,r)}var Ji=null,Sh=!1,y1=!1;function d6(e){Ji===null?Ji=[e]:Ji.push(e)}function IO(e){Sh=!0,d6(e)}function so(){if(!y1&&Ji!==null){y1=!0;var e=0,t=Et;try{var r=Ji;for(Et=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ji=null,Sh=!1}catch(i){throw Ji!==null&&(Ji=Ji.slice(e+1)),D_(um,so),i}finally{Et=t,y1=!1}}return null}var Zl=[],Ql=0,zd=null,Bd=0,Bn=[],Un=0,Yo=null,ea=1,ta="";function Do(e,t){Zl[Ql++]=Bd,Zl[Ql++]=zd,zd=e,Bd=t}function h6(e,t,r){Bn[Un++]=ea,Bn[Un++]=ta,Bn[Un++]=Yo,Yo=e;var n=ea;e=ta;var i=32-si(n)-1;n&=~(1<<i),r+=1;var a=32-si(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,ea=1<<32-si(t)+i|r<<i|n,ta=a+e}else ea=1<<a|r<<i|n,ta=e}function ym(e){e.return!==null&&(Do(e,1),h6(e,1,0))}function bm(e){for(;e===zd;)zd=Zl[--Ql],Zl[Ql]=null,Bd=Zl[--Ql],Zl[Ql]=null;for(;e===Yo;)Yo=Bn[--Un],Bn[Un]=null,ta=Bn[--Un],Bn[Un]=null,ea=Bn[--Un],Bn[Un]=null}var Pn=null,On=null,$t=!1,li=null;function p6(e,t){var r=Gn(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 _3(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,Pn=e,On=Wa(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,On=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Yo!==null?{id:ea,overflow:ta}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Gn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Pn=e,On=null,!0):!1;default:return!1}}function uv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cv(e){if($t){var t=On;if(t){var r=t;if(!_3(e,t)){if(uv(e))throw Error(Pe(418));t=Wa(r.nextSibling);var n=Pn;t&&_3(e,t)?p6(n,r):(e.flags=e.flags&-4097|2,$t=!1,Pn=e)}}else{if(uv(e))throw Error(Pe(418));e.flags=e.flags&-4097|2,$t=!1,Pn=e}}}function w3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function Yf(e){if(e!==Pn)return!1;if(!$t)return w3(e),$t=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!av(e.type,e.memoizedProps)),t&&(t=On)){if(uv(e))throw g6(),Error(Pe(418));for(;t;)p6(e,t),t=Wa(t.nextSibling)}if(w3(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Pe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){On=Wa(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}On=null}}else On=Pn?Wa(e.stateNode.nextSibling):null;return!0}function g6(){for(var e=On;e;)e=Wa(e.nextSibling)}function ps(){On=Pn=null,$t=!1}function _m(e){li===null?li=[e]:li.push(e)}var jO=pa.ReactCurrentBatchConfig;function ai(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}var Ud=lo(null),Hd=null,Jl=null,wm=null;function Sm(){wm=Jl=Hd=null}function Em(e){var t=Ud.current;zt(Ud),e._currentValue=t}function fv(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 us(e,t){Hd=e,wm=Jl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sn=!0),e.firstContext=null)}function Wn(e){var t=e._currentValue;if(wm!==e)if(e={context:e,memoizedValue:t,next:null},Jl===null){if(Hd===null)throw Error(Pe(308));Jl=e,Hd.dependencies={lanes:0,firstContext:e}}else Jl=Jl.next=e;return t}var Bo=null;function Om(e){Bo===null?Bo=[e]:Bo.push(e)}function v6(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Om(t)):(r.next=i.next,i.next=r),t.interleaved=r,ua(e,n)}function ua(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 Da=!1;function Pm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function m6(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ra(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ht&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ua(e,r)}return i=n.interleaved,i===null?(t.next=t,Om(n)):(t.next=i.next,i.next=t),n.interleaved=t,ua(e,r)}function vd(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,cm(e,r)}}function S3(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 $d(e,t,r,n){var i=e.updateQueue;Da=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,f=u.next;u.next=null,o===null?a=f:o.next=f,o=u;var v=e.alternate;v!==null&&(v=v.updateQueue,l=v.lastBaseUpdate,l!==o&&(l===null?v.firstBaseUpdate=f:l.next=f,v.lastBaseUpdate=u))}if(a!==null){var S=i.baseState;o=0,v=f=u=null,l=a;do{var _=l.lane,h=l.eventTime;if((n&_)===_){v!==null&&(v=v.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var E=e,m=l;switch(_=t,h=r,m.tag){case 1:if(E=m.payload,typeof E=="function"){S=E.call(h,S,_);break e}S=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=m.payload,_=typeof E=="function"?E.call(h,S,_):E,_==null)break e;S=Kt({},S,_);break e;case 2:Da=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,_=i.effects,_===null?i.effects=[l]:_.push(l))}else h={eventTime:h,lane:_,tag:l.tag,payload:l.payload,callback:l.callback,next:null},v===null?(f=v=h,u=S):v=v.next=h,o|=_;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;_=l,l=_.next,_.next=null,i.lastBaseUpdate=_,i.shared.pending=null}}while(!0);if(v===null&&(u=S),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=v,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Xo|=o,e.lanes=o,e.memoizedState=S}}function E3(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(Pe(191,i));i.call(n)}}}var y6=new v_.Component().refs;function dv(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 Eh={isMounted:function(e){return(e=e._reactInternals)?ol(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=qr(),i=Xa(e),a=ra(n,i);a.payload=t,r!=null&&(a.callback=r),t=Ya(e,a,i),t!==null&&(ui(t,e,i,n),vd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=qr(),i=Xa(e),a=ra(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Ya(e,a,i),t!==null&&(ui(t,e,i,n),vd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qr(),n=Xa(e),i=ra(r,n);i.tag=2,t!=null&&(i.callback=t),t=Ya(e,i,n),t!==null&&(ui(t,e,n,r),vd(t,e,n))}};function O3(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?!Zu(r,n)||!Zu(i,a):!0}function b6(e,t,r){var n=!1,i=to,a=t.contextType;return typeof a=="object"&&a!==null?a=Wn(a):(i=dn(t)?Wo:Ur.current,n=t.contextTypes,a=(n=n!=null)?hs(e,i):to),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Eh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function P3(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&&Eh.enqueueReplaceState(t,t.state,null)}function hv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=y6,Pm(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Wn(a):(a=dn(t)?Wo:Ur.current,i.context=hs(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(dv(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&&Eh.enqueueReplaceState(i,i.state,null),$d(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function yu(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Pe(309));var n=r.stateNode}if(!n)throw Error(Pe(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;l===y6&&(l=i.refs={}),o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Pe(284));if(!r._owner)throw Error(Pe(290,e))}return e}function Kf(e,t){throw e=Object.prototype.toString.call(t),Error(Pe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function x3(e){var t=e._init;return t(e._payload)}function _6(e){function t(y,g){if(e){var d=y.deletions;d===null?(y.deletions=[g],y.flags|=16):d.push(g)}}function r(y,g){if(!e)return null;for(;g!==null;)t(y,g),g=g.sibling;return null}function n(y,g){for(y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function i(y,g){return y=Za(y,g),y.index=0,y.sibling=null,y}function a(y,g,d){return y.index=d,e?(d=y.alternate,d!==null?(d=d.index,d<g?(y.flags|=2,g):d):(y.flags|=2,g)):(y.flags|=1048576,g)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,g,d,b){return g===null||g.tag!==6?(g=P1(d,y.mode,b),g.return=y,g):(g=i(g,d),g.return=y,g)}function u(y,g,d,b){var O=d.type;return O===Vl?v(y,g,d.props.children,b,d.key):g!==null&&(g.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ja&&x3(O)===g.type)?(b=i(g,d.props),b.ref=yu(y,g,d),b.return=y,b):(b=Sd(d.type,d.key,d.props,null,y.mode,b),b.ref=yu(y,g,d),b.return=y,b)}function f(y,g,d,b){return g===null||g.tag!==4||g.stateNode.containerInfo!==d.containerInfo||g.stateNode.implementation!==d.implementation?(g=x1(d,y.mode,b),g.return=y,g):(g=i(g,d.children||[]),g.return=y,g)}function v(y,g,d,b,O){return g===null||g.tag!==7?(g=Go(d,y.mode,b,O),g.return=y,g):(g=i(g,d),g.return=y,g)}function S(y,g,d){if(typeof g=="string"&&g!==""||typeof g=="number")return g=P1(""+g,y.mode,d),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ff:return d=Sd(g.type,g.key,g.props,null,y.mode,d),d.ref=yu(y,null,g),d.return=y,d;case Gl:return g=x1(g,y.mode,d),g.return=y,g;case ja:var b=g._init;return S(y,b(g._payload),d)}if(xu(g)||hu(g))return g=Go(g,y.mode,d,null),g.return=y,g;Kf(y,g)}return null}function _(y,g,d,b){var O=g!==null?g.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return O!==null?null:l(y,g,""+d,b);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Ff:return d.key===O?u(y,g,d,b):null;case Gl:return d.key===O?f(y,g,d,b):null;case ja:return O=d._init,_(y,g,O(d._payload),b)}if(xu(d)||hu(d))return O!==null?null:v(y,g,d,b,null);Kf(y,d)}return null}function h(y,g,d,b,O){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(d)||null,l(g,y,""+b,O);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ff:return y=y.get(b.key===null?d:b.key)||null,u(g,y,b,O);case Gl:return y=y.get(b.key===null?d:b.key)||null,f(g,y,b,O);case ja:var P=b._init;return h(y,g,d,P(b._payload),O)}if(xu(b)||hu(b))return y=y.get(d)||null,v(g,y,b,O,null);Kf(g,b)}return null}function E(y,g,d,b){for(var O=null,P=null,x=g,w=g=0,T=null;x!==null&&w<d.length;w++){x.index>w?(T=x,x=null):T=x.sibling;var k=_(y,x,d[w],b);if(k===null){x===null&&(x=T);break}e&&x&&k.alternate===null&&t(y,x),g=a(k,g,w),P===null?O=k:P.sibling=k,P=k,x=T}if(w===d.length)return r(y,x),$t&&Do(y,w),O;if(x===null){for(;w<d.length;w++)x=S(y,d[w],b),x!==null&&(g=a(x,g,w),P===null?O=x:P.sibling=x,P=x);return $t&&Do(y,w),O}for(x=n(y,x);w<d.length;w++)T=h(x,y,w,d[w],b),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?w:T.key),g=a(T,g,w),P===null?O=T:P.sibling=T,P=T);return e&&x.forEach(function(A){return t(y,A)}),$t&&Do(y,w),O}function m(y,g,d,b){var O=hu(d);if(typeof O!="function")throw Error(Pe(150));if(d=O.call(d),d==null)throw Error(Pe(151));for(var P=O=null,x=g,w=g=0,T=null,k=d.next();x!==null&&!k.done;w++,k=d.next()){x.index>w?(T=x,x=null):T=x.sibling;var A=_(y,x,k.value,b);if(A===null){x===null&&(x=T);break}e&&x&&A.alternate===null&&t(y,x),g=a(A,g,w),P===null?O=A:P.sibling=A,P=A,x=T}if(k.done)return r(y,x),$t&&Do(y,w),O;if(x===null){for(;!k.done;w++,k=d.next())k=S(y,k.value,b),k!==null&&(g=a(k,g,w),P===null?O=k:P.sibling=k,P=k);return $t&&Do(y,w),O}for(x=n(y,x);!k.done;w++,k=d.next())k=h(x,y,w,k.value,b),k!==null&&(e&&k.alternate!==null&&x.delete(k.key===null?w:k.key),g=a(k,g,w),P===null?O=k:P.sibling=k,P=k);return e&&x.forEach(function(R){return t(y,R)}),$t&&Do(y,w),O}function p(y,g,d,b){if(typeof d=="object"&&d!==null&&d.type===Vl&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Ff:e:{for(var O=d.key,P=g;P!==null;){if(P.key===O){if(O=d.type,O===Vl){if(P.tag===7){r(y,P.sibling),g=i(P,d.props.children),g.return=y,y=g;break e}}else if(P.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ja&&x3(O)===P.type){r(y,P.sibling),g=i(P,d.props),g.ref=yu(y,P,d),g.return=y,y=g;break e}r(y,P);break}else t(y,P);P=P.sibling}d.type===Vl?(g=Go(d.props.children,y.mode,b,d.key),g.return=y,y=g):(b=Sd(d.type,d.key,d.props,null,y.mode,b),b.ref=yu(y,g,d),b.return=y,y=b)}return o(y);case Gl:e:{for(P=d.key;g!==null;){if(g.key===P)if(g.tag===4&&g.stateNode.containerInfo===d.containerInfo&&g.stateNode.implementation===d.implementation){r(y,g.sibling),g=i(g,d.children||[]),g.return=y,y=g;break e}else{r(y,g);break}else t(y,g);g=g.sibling}g=x1(d,y.mode,b),g.return=y,y=g}return o(y);case ja:return P=d._init,p(y,g,P(d._payload),b)}if(xu(d))return E(y,g,d,b);if(hu(d))return m(y,g,d,b);Kf(y,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,g!==null&&g.tag===6?(r(y,g.sibling),g=i(g,d),g.return=y,y=g):(r(y,g),g=P1(d,y.mode,b),g.return=y,y=g),o(y)):r(y,g)}return p}var gs=_6(!0),w6=_6(!1),Sc={},Di=lo(Sc),tc=lo(Sc),rc=lo(Sc);function Uo(e){if(e===Sc)throw Error(Pe(174));return e}function xm(e,t){switch(Lt(rc,t),Lt(tc,e),Lt(Di,Sc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vg(t,e)}zt(Di),Lt(Di,t)}function vs(){zt(Di),zt(tc),zt(rc)}function S6(e){Uo(rc.current);var t=Uo(Di.current),r=Vg(t,e.type);t!==r&&(Lt(tc,e),Lt(Di,r))}function Cm(e){tc.current===e&&(zt(Di),zt(tc))}var Wt=lo(0);function Gd(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 b1=[];function km(){for(var e=0;e<b1.length;e++)b1[e]._workInProgressVersionPrimary=null;b1.length=0}var md=pa.ReactCurrentDispatcher,_1=pa.ReactCurrentBatchConfig,Ko=0,Yt=null,fr=null,_r=null,Vd=!1,ju=!1,nc=0,DO=0;function Fr(){throw Error(Pe(321))}function Tm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!pi(e[r],t[r]))return!1;return!0}function Am(e,t,r,n,i,a){if(Ko=a,Yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,md.current=e===null||e.memoizedState===null?UO:HO,e=r(n,i),ju){a=0;do{if(ju=!1,nc=0,25<=a)throw Error(Pe(301));a+=1,_r=fr=null,t.updateQueue=null,md.current=$O,e=r(n,i)}while(ju)}if(md.current=qd,t=fr!==null&&fr.next!==null,Ko=0,_r=fr=Yt=null,Vd=!1,t)throw Error(Pe(300));return e}function Rm(){var e=nc!==0;return nc=0,e}function Ri(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _r===null?Yt.memoizedState=_r=e:_r=_r.next=e,_r}function Yn(){if(fr===null){var e=Yt.alternate;e=e!==null?e.memoizedState:null}else e=fr.next;var t=_r===null?Yt.memoizedState:_r.next;if(t!==null)_r=t,fr=e;else{if(e===null)throw Error(Pe(310));fr=e,e={memoizedState:fr.memoizedState,baseState:fr.baseState,baseQueue:fr.baseQueue,queue:fr.queue,next:null},_r===null?Yt.memoizedState=_r=e:_r=_r.next=e}return _r}function ic(e,t){return typeof t=="function"?t(e):t}function w1(e){var t=Yn(),r=t.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=e;var n=fr,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=o=null,u=null,f=a;do{var v=f.lane;if((Ko&v)===v)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var S={lane:v,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=S,o=n):u=u.next=S,Yt.lanes|=v,Xo|=v}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,pi(n,t.memoizedState)||(sn=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,Yt.lanes|=a,Xo|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function S1(e){var t=Yn(),r=t.queue;if(r===null)throw Error(Pe(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);pi(a,t.memoizedState)||(sn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function E6(){}function O6(e,t){var r=Yt,n=Yn(),i=t(),a=!pi(n.memoizedState,i);if(a&&(n.memoizedState=i,sn=!0),n=n.queue,Mm(C6.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||_r!==null&&_r.memoizedState.tag&1){if(r.flags|=2048,ac(9,x6.bind(null,r,n,i,t),void 0,null),Sr===null)throw Error(Pe(349));Ko&30||P6(r,t,i)}return i}function P6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Yt.updateQueue,t===null?(t={lastEffect:null,stores:null},Yt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function x6(e,t,r,n){t.value=r,t.getSnapshot=n,k6(t)&&T6(e)}function C6(e,t,r){return r(function(){k6(t)&&T6(e)})}function k6(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!pi(e,r)}catch{return!0}}function T6(e){var t=ua(e,1);t!==null&&ui(t,e,1,-1)}function C3(e){var t=Ri();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ic,lastRenderedState:e},t.queue=e,e=e.dispatch=BO.bind(null,Yt,e),[t.memoizedState,e]}function ac(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Yt.updateQueue,t===null?(t={lastEffect:null,stores:null},Yt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function A6(){return Yn().memoizedState}function yd(e,t,r,n){var i=Ri();Yt.flags|=e,i.memoizedState=ac(1|t,r,void 0,n===void 0?null:n)}function Oh(e,t,r,n){var i=Yn();n=n===void 0?null:n;var a=void 0;if(fr!==null){var o=fr.memoizedState;if(a=o.destroy,n!==null&&Tm(n,o.deps)){i.memoizedState=ac(t,r,a,n);return}}Yt.flags|=e,i.memoizedState=ac(1|t,r,a,n)}function k3(e,t){return yd(8390656,8,e,t)}function Mm(e,t){return Oh(2048,8,e,t)}function R6(e,t){return Oh(4,2,e,t)}function M6(e,t){return Oh(4,4,e,t)}function L6(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 N6(e,t,r){return r=r!=null?r.concat([e]):null,Oh(4,4,L6.bind(null,t,e),r)}function Lm(){}function I6(e,t){var r=Yn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Tm(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function j6(e,t){var r=Yn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Tm(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function D6(e,t,r){return Ko&21?(pi(r,t)||(r=B_(),Yt.lanes|=r,Xo|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sn=!0),e.memoizedState=r)}function FO(e,t){var r=Et;Et=r!==0&&4>r?r:4,e(!0);var n=_1.transition;_1.transition={};try{e(!1),t()}finally{Et=r,_1.transition=n}}function F6(){return Yn().memoizedState}function zO(e,t,r){var n=Xa(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},z6(e))B6(t,r);else if(r=v6(e,t,r,n),r!==null){var i=qr();ui(r,e,n,i),U6(r,t,n)}}function BO(e,t,r){var n=Xa(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(z6(e))B6(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,pi(l,o)){var u=t.interleaved;u===null?(i.next=i,Om(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=v6(e,t,i,n),r!==null&&(i=qr(),ui(r,e,n,i),U6(r,t,n))}}function z6(e){var t=e.alternate;return e===Yt||t!==null&&t===Yt}function B6(e,t){ju=Vd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function U6(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,cm(e,r)}}var qd={readContext:Wn,useCallback:Fr,useContext:Fr,useEffect:Fr,useImperativeHandle:Fr,useInsertionEffect:Fr,useLayoutEffect:Fr,useMemo:Fr,useReducer:Fr,useRef:Fr,useState:Fr,useDebugValue:Fr,useDeferredValue:Fr,useTransition:Fr,useMutableSource:Fr,useSyncExternalStore:Fr,useId:Fr,unstable_isNewReconciler:!1},UO={readContext:Wn,useCallback:function(e,t){return Ri().memoizedState=[e,t===void 0?null:t],e},useContext:Wn,useEffect:k3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yd(4194308,4,L6.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yd(4194308,4,e,t)},useInsertionEffect:function(e,t){return yd(4,2,e,t)},useMemo:function(e,t){var r=Ri();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ri();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=zO.bind(null,Yt,e),[n.memoizedState,e]},useRef:function(e){var t=Ri();return e={current:e},t.memoizedState=e},useState:C3,useDebugValue:Lm,useDeferredValue:function(e){return Ri().memoizedState=e},useTransition:function(){var e=C3(!1),t=e[0];return e=FO.bind(null,e[1]),Ri().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Yt,i=Ri();if($t){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=t(),Sr===null)throw Error(Pe(349));Ko&30||P6(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,k3(C6.bind(null,n,a,e),[e]),n.flags|=2048,ac(9,x6.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ri(),t=Sr.identifierPrefix;if($t){var r=ta,n=ea;r=(n&~(1<<32-si(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=DO++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},HO={readContext:Wn,useCallback:I6,useContext:Wn,useEffect:Mm,useImperativeHandle:N6,useInsertionEffect:R6,useLayoutEffect:M6,useMemo:j6,useReducer:w1,useRef:A6,useState:function(){return w1(ic)},useDebugValue:Lm,useDeferredValue:function(e){var t=Yn();return D6(t,fr.memoizedState,e)},useTransition:function(){var e=w1(ic)[0],t=Yn().memoizedState;return[e,t]},useMutableSource:E6,useSyncExternalStore:O6,useId:F6,unstable_isNewReconciler:!1},$O={readContext:Wn,useCallback:I6,useContext:Wn,useEffect:Mm,useImperativeHandle:N6,useInsertionEffect:R6,useLayoutEffect:M6,useMemo:j6,useReducer:S1,useRef:A6,useState:function(){return S1(ic)},useDebugValue:Lm,useDeferredValue:function(e){var t=Yn();return fr===null?t.memoizedState=e:D6(t,fr.memoizedState,e)},useTransition:function(){var e=S1(ic)[0],t=Yn().memoizedState;return[e,t]},useMutableSource:E6,useSyncExternalStore:O6,useId:F6,unstable_isNewReconciler:!1};function ms(e,t){try{var r="",n=t;do r+=mE(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 E1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function pv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var GO=typeof WeakMap=="function"?WeakMap:Map;function H6(e,t,r){r=ra(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Yd||(Yd=!0,Ov=n),pv(e,t)},r}function $6(e,t,r){r=ra(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){pv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){pv(e,t),typeof n!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function T3(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new GO;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=iP.bind(null,e,t,r),t.then(e,e))}function A3(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 R3(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=ra(-1,1),t.tag=2,Ya(r,t,1))),r.lanes|=1),e)}var VO=pa.ReactCurrentOwner,sn=!1;function Vr(e,t,r,n){t.child=e===null?w6(t,null,r,n):gs(t,e.child,r,n)}function M3(e,t,r,n,i){r=r.render;var a=t.ref;return us(t,i),n=Am(e,t,r,n,a,i),r=Rm(),e!==null&&!sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):($t&&r&&ym(t),t.flags|=1,Vr(e,t,n,i),t.child)}function L3(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!Um(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,G6(e,t,a,n,i)):(e=Sd(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:Zu,r(o,n)&&e.ref===t.ref)return ca(e,t,i)}return t.flags|=1,e=Za(a,n),e.ref=t.ref,e.return=t,t.child=e}function G6(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(Zu(a,n)&&e.ref===t.ref)if(sn=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(sn=!0);else return t.lanes=e.lanes,ca(e,t,i)}return gv(e,t,r,n,i)}function V6(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(ts,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(ts,Sn),Sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Lt(ts,Sn),Sn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Lt(ts,Sn),Sn|=n;return Vr(e,t,i,r),t.child}function q6(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function gv(e,t,r,n,i){var a=dn(r)?Wo:Ur.current;return a=hs(t,a),us(t,i),r=Am(e,t,r,n,a,i),n=Rm(),e!==null&&!sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ca(e,t,i)):($t&&n&&ym(t),t.flags|=1,Vr(e,t,r,i),t.child)}function N3(e,t,r,n,i){if(dn(r)){var a=!0;Fd(t)}else a=!1;if(us(t,i),t.stateNode===null)bd(e,t),b6(t,r,n),hv(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=Wn(f):(f=dn(r)?Wo:Ur.current,f=hs(t,f));var v=r.getDerivedStateFromProps,S=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function";S||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&P3(t,o,n,f),Da=!1;var _=t.memoizedState;o.state=_,$d(t,n,o,i),u=t.memoizedState,l!==n||_!==u||fn.current||Da?(typeof v=="function"&&(dv(t,r,v,n),u=t.memoizedState),(l=Da||O3(t,r,l,n,_,u,f))?(S||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=f,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,m6(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:ai(t.type,l),o.props=f,S=t.pendingProps,_=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Wn(u):(u=dn(r)?Wo:Ur.current,u=hs(t,u));var h=r.getDerivedStateFromProps;(v=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==S||_!==u)&&P3(t,o,n,u),Da=!1,_=t.memoizedState,o.state=_,$d(t,n,o,i);var E=t.memoizedState;l!==S||_!==E||fn.current||Da?(typeof h=="function"&&(dv(t,r,h,n),E=t.memoizedState),(f=Da||O3(t,r,f,n,_,E,u)||!1)?(v||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,E,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,E,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=E),o.props=n,o.state=E,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),n=!1)}return vv(e,t,r,n,a,i)}function vv(e,t,r,n,i,a){q6(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&b3(t,r,!1),ca(e,t,a);n=t.stateNode,VO.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=gs(t,e.child,null,a),t.child=gs(t,null,l,a)):Vr(e,t,l,a),t.memoizedState=n.state,i&&b3(t,r,!0),t.child}function W6(e){var t=e.stateNode;t.pendingContext?y3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&y3(e,t.context,!1),xm(e,t.containerInfo)}function I3(e,t,r,n,i){return ps(),_m(i),t.flags|=256,Vr(e,t,r,n),t.child}var mv={dehydrated:null,treeContext:null,retryLane:0};function yv(e){return{baseLanes:e,cachePool:null,transitions:null}}function Y6(e,t,r){var n=t.pendingProps,i=Wt.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(Wt,i&1),e===null)return cv(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=Ch(o,n,0,null),e=Go(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=yv(r),t.memoizedState=mv,e):Nm(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return qO(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=Za(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Za(l,a):(a=Go(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?yv(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=mv,n}return a=e.child,e=a.sibling,n=Za(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 Nm(e,t){return t=Ch({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xf(e,t,r,n){return n!==null&&_m(n),gs(t,e.child,null,r),e=Nm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qO(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=E1(Error(Pe(422))),Xf(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Ch({mode:"visible",children:n.children},i,0,null),a=Go(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&gs(t,e.child,null,o),t.child.memoizedState=yv(o),t.memoizedState=mv,a);if(!(t.mode&1))return Xf(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Pe(419)),n=E1(a,n,void 0),Xf(e,t,o,n)}if(l=(o&e.childLanes)!==0,sn||l){if(n=Sr,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,ua(e,i),ui(n,e,i,-1))}return Bm(),n=E1(Error(Pe(421))),Xf(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=aP.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,On=Wa(i.nextSibling),Pn=t,$t=!0,li=null,e!==null&&(Bn[Un++]=ea,Bn[Un++]=ta,Bn[Un++]=Yo,ea=e.id,ta=e.overflow,Yo=t),t=Nm(t,n.children),t.flags|=4096,t)}function j3(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),fv(e.return,t,r)}function O1(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 K6(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Vr(e,t,n.children,r),n=Wt.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&&j3(e,r,t);else if(e.tag===19)j3(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(Wt,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&&Gd(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),O1(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&&Gd(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}O1(t,!0,r,null,a);break;case"together":O1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function bd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ca(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Xo|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Pe(153));if(t.child!==null){for(e=t.child,r=Za(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Za(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function WO(e,t,r){switch(t.tag){case 3:W6(t),ps();break;case 5:S6(t);break;case 1:dn(t.type)&&Fd(t);break;case 4:xm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Lt(Ud,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Lt(Wt,Wt.current&1),t.flags|=128,null):r&t.child.childLanes?Y6(e,t,r):(Lt(Wt,Wt.current&1),e=ca(e,t,r),e!==null?e.sibling:null);Lt(Wt,Wt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return K6(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lt(Wt,Wt.current),n)break;return null;case 22:case 23:return t.lanes=0,V6(e,t,r)}return ca(e,t,r)}var X6,bv,Z6,Q6;X6=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}};bv=function(){};Z6=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Uo(Di.current);var a=null;switch(r){case"input":i=Ug(e,i),n=Ug(e,n),a=[];break;case"select":i=Kt({},i,{value:void 0}),n=Kt({},n,{value:void 0}),a=[];break;case"textarea":i=Gg(e,i),n=Gg(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=jd)}qg(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"&&(Gu.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"&&(Gu.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)}};Q6=function(e,t,r,n){r!==n&&(t.flags|=4)};function bu(e,t){if(!$t)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function zr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function YO(e,t,r){var n=t.pendingProps;switch(bm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zr(t),null;case 1:return dn(t.type)&&Dd(),zr(t),null;case 3:return n=t.stateNode,vs(),zt(fn),zt(Ur),km(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Yf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,li!==null&&(Cv(li),li=null))),bv(e,t),zr(t),null;case 5:Cm(t);var i=Uo(rc.current);if(r=t.type,e!==null&&t.stateNode!=null)Z6(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Pe(166));return zr(t),null}if(e=Uo(Di.current),Yf(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Mi]=t,n[ec]=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<ku.length;i++)Ft(ku[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":Vb(n,a),Ft("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Ft("invalid",n);break;case"textarea":Wb(n,a),Ft("invalid",n)}qg(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&&Wf(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Wf(n.textContent,l,e),i=["children",""+l]):Gu.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ft("scroll",n)}switch(r){case"input":zf(n),qb(n,a,!0);break;case"textarea":zf(n),Yb(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=jd)}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=P_(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[Mi]=t,e[ec]=n,X6(e,t,!1,!1),t.stateNode=e;e:{switch(o=Wg(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<ku.length;i++)Ft(ku[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":Vb(e,n),i=Ug(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":Wb(e,n),i=Gg(e,n),Ft("invalid",e);break;default:i=n}qg(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?k_(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&x_(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Vu(e,u):typeof u=="number"&&Vu(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Gu.hasOwnProperty(a)?u!=null&&a==="onScroll"&&Ft("scroll",e):u!=null&&im(e,a,u,o))}switch(r){case"input":zf(e),qb(e,n,!1);break;case"textarea":zf(e),Yb(e);break;case"option":n.value!=null&&e.setAttribute("value",""+eo(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?as(e,!!n.multiple,a,!1):n.defaultValue!=null&&as(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=jd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return zr(t),null;case 6:if(e&&t.stateNode!=null)Q6(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Pe(166));if(r=Uo(rc.current),Uo(Di.current),Yf(t)){if(n=t.stateNode,r=t.memoizedProps,n[Mi]=t,(a=n.nodeValue!==r)&&(e=Pn,e!==null))switch(e.tag){case 3:Wf(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wf(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Mi]=t,t.stateNode=n}return zr(t),null;case 13:if(zt(Wt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&On!==null&&t.mode&1&&!(t.flags&128))g6(),ps(),t.flags|=98560,a=!1;else if(a=Yf(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Pe(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Pe(317));a[Mi]=t}else ps(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zr(t),a=!1}else li!==null&&(Cv(li),li=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Wt.current&1?hr===0&&(hr=3):Bm())),t.updateQueue!==null&&(t.flags|=4),zr(t),null);case 4:return vs(),bv(e,t),e===null&&Qu(t.stateNode.containerInfo),zr(t),null;case 10:return Em(t.type._context),zr(t),null;case 17:return dn(t.type)&&Dd(),zr(t),null;case 19:if(zt(Wt),a=t.memoizedState,a===null)return zr(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)bu(a,!1);else{if(hr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Gd(e),o!==null){for(t.flags|=128,bu(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(Wt,Wt.current&1|2),t.child}e=e.sibling}a.tail!==null&&tr()>ys&&(t.flags|=128,n=!0,bu(a,!1),t.lanes=4194304)}else{if(!n)if(e=Gd(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),bu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!$t)return zr(t),null}else 2*tr()-a.renderingStartTime>ys&&r!==1073741824&&(t.flags|=128,n=!0,bu(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=Wt.current,Lt(Wt,n?r&1|2:r&1),t):(zr(t),null);case 22:case 23:return zm(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Sn&1073741824&&(zr(t),t.subtreeFlags&6&&(t.flags|=8192)):zr(t),null;case 24:return null;case 25:return null}throw Error(Pe(156,t.tag))}function KO(e,t){switch(bm(t),t.tag){case 1:return dn(t.type)&&Dd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vs(),zt(fn),zt(Ur),km(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cm(t),null;case 13:if(zt(Wt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Pe(340));ps()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zt(Wt),null;case 4:return vs(),null;case 10:return Em(t.type._context),null;case 22:case 23:return zm(),null;case 24:return null;default:return null}}var Zf=!1,Br=!1,XO=typeof WeakSet=="function"?WeakSet:Set,Be=null;function es(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 _v(e,t,r){try{r()}catch(n){Zt(e,t,n)}}var D3=!1;function ZO(e,t){if(nv=Ld,e=r6(),mm(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,u=-1,f=0,v=0,S=e,_=null;t:for(;;){for(var h;S!==r||i!==0&&S.nodeType!==3||(l=o+i),S!==a||n!==0&&S.nodeType!==3||(u=o+n),S.nodeType===3&&(o+=S.nodeValue.length),(h=S.firstChild)!==null;)_=S,S=h;for(;;){if(S===e)break t;if(_===r&&++f===i&&(l=o),_===a&&++v===n&&(u=o),(h=S.nextSibling)!==null)break;S=_,_=S.parentNode}S=h}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(iv={focusedElem:e,selectionRange:r},Ld=!1,Be=t;Be!==null;)if(t=Be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Be=e;else for(;Be!==null;){t=Be;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var m=E.memoizedProps,p=E.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:ai(t.type,m),p);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Pe(163))}}catch(b){Zt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,Be=e;break}Be=t.return}return E=D3,D3=!1,E}function Du(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&&_v(t,r,a)}i=i.next}while(i!==n)}}function Ph(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 wv(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 J6(e){var t=e.alternate;t!==null&&(e.alternate=null,J6(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mi],delete t[ec],delete t[lv],delete t[LO],delete t[NO])),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 e8(e){return e.tag===5||e.tag===3||e.tag===4}function F3(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||e8(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 Sv(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=jd));else if(n!==4&&(e=e.child,e!==null))for(Sv(e,t,r),e=e.sibling;e!==null;)Sv(e,t,r),e=e.sibling}function Ev(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(Ev(e,t,r),e=e.sibling;e!==null;)Ev(e,t,r),e=e.sibling}var kr=null,oi=!1;function Na(e,t,r){for(r=r.child;r!==null;)t8(e,t,r),r=r.sibling}function t8(e,t,r){if(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(mh,r)}catch{}switch(r.tag){case 5:Br||es(r,t);case 6:var n=kr,i=oi;kr=null,Na(e,t,r),kr=n,oi=i,kr!==null&&(oi?(e=kr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):kr.removeChild(r.stateNode));break;case 18:kr!==null&&(oi?(e=kr,r=r.stateNode,e.nodeType===8?m1(e.parentNode,r):e.nodeType===1&&m1(e,r),Ku(e)):m1(kr,r.stateNode));break;case 4:n=kr,i=oi,kr=r.stateNode.containerInfo,oi=!0,Na(e,t,r),kr=n,oi=i;break;case 0:case 11:case 14:case 15:if(!Br&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&_v(r,t,o),i=i.next}while(i!==n)}Na(e,t,r);break;case 1:if(!Br&&(es(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)}Na(e,t,r);break;case 21:Na(e,t,r);break;case 22:r.mode&1?(Br=(n=Br)||r.memoizedState!==null,Na(e,t,r),Br=n):Na(e,t,r);break;default:Na(e,t,r)}}function z3(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new XO),t.forEach(function(n){var i=oP.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ni(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:kr=l.stateNode,oi=!1;break e;case 3:kr=l.stateNode.containerInfo,oi=!0;break e;case 4:kr=l.stateNode.containerInfo,oi=!0;break e}l=l.return}if(kr===null)throw Error(Pe(160));t8(a,o,i),kr=null,oi=!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;)r8(t,e),t=t.sibling}function r8(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ni(t,e),Ti(e),n&4){try{Du(3,e,e.return),Ph(3,e)}catch(m){Zt(e,e.return,m)}try{Du(5,e,e.return)}catch(m){Zt(e,e.return,m)}}break;case 1:ni(t,e),Ti(e),n&512&&r!==null&&es(r,r.return);break;case 5:if(ni(t,e),Ti(e),n&512&&r!==null&&es(r,r.return),e.flags&32){var i=e.stateNode;try{Vu(i,"")}catch(m){Zt(e,e.return,m)}}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&&E_(i,a),Wg(l,o);var f=Wg(l,a);for(o=0;o<u.length;o+=2){var v=u[o],S=u[o+1];v==="style"?k_(i,S):v==="dangerouslySetInnerHTML"?x_(i,S):v==="children"?Vu(i,S):im(i,v,S,f)}switch(l){case"input":Hg(i,a);break;case"textarea":O_(i,a);break;case"select":var _=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;h!=null?as(i,!!a.multiple,h,!1):_!==!!a.multiple&&(a.defaultValue!=null?as(i,!!a.multiple,a.defaultValue,!0):as(i,!!a.multiple,a.multiple?[]:"",!1))}i[ec]=a}catch(m){Zt(e,e.return,m)}}break;case 6:if(ni(t,e),Ti(e),n&4){if(e.stateNode===null)throw Error(Pe(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){Zt(e,e.return,m)}}break;case 3:if(ni(t,e),Ti(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Ku(t.containerInfo)}catch(m){Zt(e,e.return,m)}break;case 4:ni(t,e),Ti(e);break;case 13:ni(t,e),Ti(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Dm=tr())),n&4&&z3(e);break;case 22:if(v=r!==null&&r.memoizedState!==null,e.mode&1?(Br=(f=Br)||v,ni(t,e),Br=f):ni(t,e),Ti(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!v&&e.mode&1)for(Be=e,v=e.child;v!==null;){for(S=Be=v;Be!==null;){switch(_=Be,h=_.child,_.tag){case 0:case 11:case 14:case 15:Du(4,_,_.return);break;case 1:es(_,_.return);var E=_.stateNode;if(typeof E.componentWillUnmount=="function"){n=_,r=_.return;try{t=n,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(m){Zt(n,r,m)}}break;case 5:es(_,_.return);break;case 22:if(_.memoizedState!==null){U3(S);continue}}h!==null?(h.return=_,Be=h):U3(S)}v=v.sibling}e:for(v=null,S=e;;){if(S.tag===5){if(v===null){v=S;try{i=S.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=S.stateNode,u=S.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=C_("display",o))}catch(m){Zt(e,e.return,m)}}}else if(S.tag===6){if(v===null)try{S.stateNode.nodeValue=f?"":S.memoizedProps}catch(m){Zt(e,e.return,m)}}else if((S.tag!==22&&S.tag!==23||S.memoizedState===null||S===e)&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===e)break e;for(;S.sibling===null;){if(S.return===null||S.return===e)break e;v===S&&(v=null),S=S.return}v===S&&(v=null),S.sibling.return=S.return,S=S.sibling}}break;case 19:ni(t,e),Ti(e),n&4&&z3(e);break;case 21:break;default:ni(t,e),Ti(e)}}function Ti(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(e8(r)){var n=r;break e}r=r.return}throw Error(Pe(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Vu(i,""),n.flags&=-33);var a=F3(e);Ev(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=F3(e);Sv(e,l,o);break;default:throw Error(Pe(161))}}catch(u){Zt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function QO(e,t,r){Be=e,n8(e)}function n8(e,t,r){for(var n=(e.mode&1)!==0;Be!==null;){var i=Be,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||Zf;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Br;l=Zf;var f=Br;if(Zf=o,(Br=u)&&!f)for(Be=i;Be!==null;)o=Be,u=o.child,o.tag===22&&o.memoizedState!==null?H3(i):u!==null?(u.return=o,Be=u):H3(i);for(;a!==null;)Be=a,n8(a),a=a.sibling;Be=i,Zf=l,Br=f}B3(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Be=a):B3(e)}}function B3(e){for(;Be!==null;){var t=Be;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Br||Ph(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Br)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:ai(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&E3(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}E3(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var v=f.memoizedState;if(v!==null){var S=v.dehydrated;S!==null&&Ku(S)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Pe(163))}Br||t.flags&512&&wv(t)}catch(_){Zt(t,t.return,_)}}if(t===e){Be=null;break}if(r=t.sibling,r!==null){r.return=t.return,Be=r;break}Be=t.return}}function U3(e){for(;Be!==null;){var t=Be;if(t===e){Be=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Be=r;break}Be=t.return}}function H3(e){for(;Be!==null;){var t=Be;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ph(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{wv(t)}catch(u){Zt(t,a,u)}break;case 5:var o=t.return;try{wv(t)}catch(u){Zt(t,o,u)}}}catch(u){Zt(t,t.return,u)}if(t===e){Be=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Be=l;break}Be=t.return}}var JO=Math.ceil,Wd=pa.ReactCurrentDispatcher,Im=pa.ReactCurrentOwner,Vn=pa.ReactCurrentBatchConfig,ht=0,Sr=null,ar=null,Ar=0,Sn=0,ts=lo(0),hr=0,oc=null,Xo=0,xh=0,jm=0,Fu=null,ln=null,Dm=0,ys=1/0,Qi=null,Yd=!1,Ov=null,Ka=null,Qf=!1,Ha=null,Kd=0,zu=0,Pv=null,_d=-1,wd=0;function qr(){return ht&6?tr():_d!==-1?_d:_d=tr()}function Xa(e){return e.mode&1?ht&2&&Ar!==0?Ar&-Ar:jO.transition!==null?(wd===0&&(wd=B_()),wd):(e=Et,e!==0||(e=window.event,e=e===void 0?16:W_(e.type)),e):1}function ui(e,t,r,n){if(50<zu)throw zu=0,Pv=null,Error(Pe(185));bc(e,r,n),(!(ht&2)||e!==Sr)&&(e===Sr&&(!(ht&2)&&(xh|=r),hr===4&&za(e,Ar)),hn(e,n),r===1&&ht===0&&!(t.mode&1)&&(ys=tr()+500,Sh&&so()))}function hn(e,t){var r=e.callbackNode;jE(e,t);var n=Md(e,e===Sr?Ar:0);if(n===0)r!==null&&Zb(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Zb(r),t===1)e.tag===0?IO($3.bind(null,e)):d6($3.bind(null,e)),RO(function(){!(ht&6)&&so()}),r=null;else{switch(U_(n)){case 1:r=um;break;case 4:r=F_;break;case 16:r=Rd;break;case 536870912:r=z_;break;default:r=Rd}r=f8(r,i8.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function i8(e,t){if(_d=-1,wd=0,ht&6)throw Error(Pe(327));var r=e.callbackNode;if(cs()&&e.callbackNode!==r)return null;var n=Md(e,e===Sr?Ar:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Xd(e,n);else{t=n;var i=ht;ht|=2;var a=o8();(Sr!==e||Ar!==t)&&(Qi=null,ys=tr()+500,$o(e,t));do try{rP();break}catch(l){a8(e,l)}while(!0);Sm(),Wd.current=a,ht=i,ar!==null?t=0:(Sr=null,Ar=0,t=hr)}if(t!==0){if(t===2&&(i=Qg(e),i!==0&&(n=i,t=xv(e,i))),t===1)throw r=oc,$o(e,0),za(e,n),hn(e,tr()),r;if(t===6)za(e,n);else{if(i=e.current.alternate,!(n&30)&&!eP(i)&&(t=Xd(e,n),t===2&&(a=Qg(e),a!==0&&(n=a,t=xv(e,a))),t===1))throw r=oc,$o(e,0),za(e,n),hn(e,tr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Pe(345));case 2:Fo(e,ln,Qi);break;case 3:if(za(e,n),(n&130023424)===n&&(t=Dm+500-tr(),10<t)){if(Md(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){qr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ov(Fo.bind(null,e,ln,Qi),t);break}Fo(e,ln,Qi);break;case 4:if(za(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-si(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*JO(n/1960))-n,10<n){e.timeoutHandle=ov(Fo.bind(null,e,ln,Qi),n);break}Fo(e,ln,Qi);break;case 5:Fo(e,ln,Qi);break;default:throw Error(Pe(329))}}}return hn(e,tr()),e.callbackNode===r?i8.bind(null,e):null}function xv(e,t){var r=Fu;return e.current.memoizedState.isDehydrated&&($o(e,t).flags|=256),e=Xd(e,t),e!==2&&(t=ln,ln=r,t!==null&&Cv(t)),e}function Cv(e){ln===null?ln=e:ln.push.apply(ln,e)}function eP(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(!pi(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 za(e,t){for(t&=~jm,t&=~xh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-si(t),n=1<<r;e[r]=-1,t&=~n}}function $3(e){if(ht&6)throw Error(Pe(327));cs();var t=Md(e,0);if(!(t&1))return hn(e,tr()),null;var r=Xd(e,t);if(e.tag!==0&&r===2){var n=Qg(e);n!==0&&(t=n,r=xv(e,n))}if(r===1)throw r=oc,$o(e,0),za(e,t),hn(e,tr()),r;if(r===6)throw Error(Pe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Fo(e,ln,Qi),hn(e,tr()),null}function Fm(e,t){var r=ht;ht|=1;try{return e(t)}finally{ht=r,ht===0&&(ys=tr()+500,Sh&&so())}}function Zo(e){Ha!==null&&Ha.tag===0&&!(ht&6)&&cs();var t=ht;ht|=1;var r=Vn.transition,n=Et;try{if(Vn.transition=null,Et=1,e)return e()}finally{Et=n,Vn.transition=r,ht=t,!(ht&6)&&so()}}function zm(){Sn=ts.current,zt(ts)}function $o(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,AO(r)),ar!==null)for(r=ar.return;r!==null;){var n=r;switch(bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Dd();break;case 3:vs(),zt(fn),zt(Ur),km();break;case 5:Cm(n);break;case 4:vs();break;case 13:zt(Wt);break;case 19:zt(Wt);break;case 10:Em(n.type._context);break;case 22:case 23:zm()}r=r.return}if(Sr=e,ar=e=Za(e.current,null),Ar=Sn=t,hr=0,oc=null,jm=xh=Xo=0,ln=Fu=null,Bo!==null){for(t=0;t<Bo.length;t++)if(r=Bo[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}Bo=null}return e}function a8(e,t){do{var r=ar;try{if(Sm(),md.current=qd,Vd){for(var n=Yt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Vd=!1}if(Ko=0,_r=fr=Yt=null,ju=!1,nc=0,Im.current=null,r===null||r.return===null){hr=1,oc=t,ar=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Ar,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,v=l,S=v.tag;if(!(v.mode&1)&&(S===0||S===11||S===15)){var _=v.alternate;_?(v.updateQueue=_.updateQueue,v.memoizedState=_.memoizedState,v.lanes=_.lanes):(v.updateQueue=null,v.memoizedState=null)}var h=A3(o);if(h!==null){h.flags&=-257,R3(h,o,l,a,t),h.mode&1&&T3(a,f,t),t=h,u=f;var E=t.updateQueue;if(E===null){var m=new Set;m.add(u),t.updateQueue=m}else E.add(u);break e}else{if(!(t&1)){T3(a,f,t),Bm();break e}u=Error(Pe(426))}}else if($t&&l.mode&1){var p=A3(o);if(p!==null){!(p.flags&65536)&&(p.flags|=256),R3(p,o,l,a,t),_m(ms(u,l));break e}}a=u=ms(u,l),hr!==4&&(hr=2),Fu===null?Fu=[a]:Fu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=H6(a,u,t);S3(a,y);break e;case 1:l=u;var g=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof g.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ka===null||!Ka.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var b=$6(a,l,t);S3(a,b);break e}}a=a.return}while(a!==null)}s8(r)}catch(O){t=O,ar===r&&r!==null&&(ar=r=r.return);continue}break}while(!0)}function o8(){var e=Wd.current;return Wd.current=qd,e===null?qd:e}function Bm(){(hr===0||hr===3||hr===2)&&(hr=4),Sr===null||!(Xo&268435455)&&!(xh&268435455)||za(Sr,Ar)}function Xd(e,t){var r=ht;ht|=2;var n=o8();(Sr!==e||Ar!==t)&&(Qi=null,$o(e,t));do try{tP();break}catch(i){a8(e,i)}while(!0);if(Sm(),ht=r,Wd.current=n,ar!==null)throw Error(Pe(261));return Sr=null,Ar=0,hr}function tP(){for(;ar!==null;)l8(ar)}function rP(){for(;ar!==null&&!CE();)l8(ar)}function l8(e){var t=c8(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?s8(e):ar=t,Im.current=null}function s8(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=KO(r,t),r!==null){r.flags&=32767,ar=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{hr=6,ar=null;return}}else if(r=YO(r,t,Sn),r!==null){ar=r;return}if(t=t.sibling,t!==null){ar=t;return}ar=t=e}while(t!==null);hr===0&&(hr=5)}function Fo(e,t,r){var n=Et,i=Vn.transition;try{Vn.transition=null,Et=1,nP(e,t,r,n)}finally{Vn.transition=i,Et=n}return null}function nP(e,t,r,n){do cs();while(Ha!==null);if(ht&6)throw Error(Pe(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Pe(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(DE(e,a),e===Sr&&(ar=Sr=null,Ar=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Qf||(Qf=!0,f8(Rd,function(){return cs(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Vn.transition,Vn.transition=null;var o=Et;Et=1;var l=ht;ht|=4,Im.current=null,ZO(e,r),r8(r,e),EO(iv),Ld=!!nv,iv=nv=null,e.current=r,QO(r),kE(),ht=l,Et=o,Vn.transition=a}else e.current=r;if(Qf&&(Qf=!1,Ha=e,Kd=i),a=e.pendingLanes,a===0&&(Ka=null),RE(r.stateNode),hn(e,tr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Yd)throw Yd=!1,e=Ov,Ov=null,e;return Kd&1&&e.tag!==0&&cs(),a=e.pendingLanes,a&1?e===Pv?zu++:(zu=0,Pv=e):zu=0,so(),null}function cs(){if(Ha!==null){var e=U_(Kd),t=Vn.transition,r=Et;try{if(Vn.transition=null,Et=16>e?16:e,Ha===null)var n=!1;else{if(e=Ha,Ha=null,Kd=0,ht&6)throw Error(Pe(331));var i=ht;for(ht|=4,Be=e.current;Be!==null;){var a=Be,o=a.child;if(Be.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(Be=f;Be!==null;){var v=Be;switch(v.tag){case 0:case 11:case 15:Du(8,v,a)}var S=v.child;if(S!==null)S.return=v,Be=S;else for(;Be!==null;){v=Be;var _=v.sibling,h=v.return;if(J6(v),v===f){Be=null;break}if(_!==null){_.return=h,Be=_;break}Be=h}}}var E=a.alternate;if(E!==null){var m=E.child;if(m!==null){E.child=null;do{var p=m.sibling;m.sibling=null,m=p}while(m!==null)}}Be=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,Be=o;else e:for(;Be!==null;){if(a=Be,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Du(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,Be=y;break e}Be=a.return}}var g=e.current;for(Be=g;Be!==null;){o=Be;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,Be=d;else e:for(o=g;Be!==null;){if(l=Be,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ph(9,l)}}catch(O){Zt(l,l.return,O)}if(l===o){Be=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,Be=b;break e}Be=l.return}}if(ht=i,so(),ji&&typeof ji.onPostCommitFiberRoot=="function")try{ji.onPostCommitFiberRoot(mh,e)}catch{}n=!0}return n}finally{Et=r,Vn.transition=t}}return!1}function G3(e,t,r){t=ms(r,t),t=H6(e,t,1),e=Ya(e,t,1),t=qr(),e!==null&&(bc(e,1,t),hn(e,t))}function Zt(e,t,r){if(e.tag===3)G3(e,e,r);else for(;t!==null;){if(t.tag===3){G3(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ka===null||!Ka.has(n))){e=ms(r,e),e=$6(t,e,1),t=Ya(t,e,1),e=qr(),t!==null&&(bc(t,1,e),hn(t,e));break}}t=t.return}}function iP(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=qr(),e.pingedLanes|=e.suspendedLanes&r,Sr===e&&(Ar&r)===r&&(hr===4||hr===3&&(Ar&130023424)===Ar&&500>tr()-Dm?$o(e,0):jm|=r),hn(e,t)}function u8(e,t){t===0&&(e.mode&1?(t=Hf,Hf<<=1,!(Hf&130023424)&&(Hf=4194304)):t=1);var r=qr();e=ua(e,t),e!==null&&(bc(e,t,r),hn(e,r))}function aP(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),u8(e,r)}function oP(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Pe(314))}n!==null&&n.delete(t),u8(e,r)}var c8;c8=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||fn.current)sn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sn=!1,WO(e,t,r);sn=!!(e.flags&131072)}else sn=!1,$t&&t.flags&1048576&&h6(t,Bd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;bd(e,t),e=t.pendingProps;var i=hs(t,Ur.current);us(t,r),i=Am(null,t,n,e,i,r);var a=Rm();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dn(n)?(a=!0,Fd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Pm(t),i.updater=Eh,t.stateNode=i,i._reactInternals=t,hv(t,n,e,r),t=vv(null,t,n,!0,a,r)):(t.tag=0,$t&&a&&ym(t),Vr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(bd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=sP(n),e=ai(n,e),i){case 0:t=gv(null,t,n,e,r);break e;case 1:t=N3(null,t,n,e,r);break e;case 11:t=M3(null,t,n,e,r);break e;case 14:t=L3(null,t,n,ai(n.type,e),r);break e}throw Error(Pe(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ai(n,i),gv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ai(n,i),N3(e,t,n,i,r);case 3:e:{if(W6(t),e===null)throw Error(Pe(387));n=t.pendingProps,a=t.memoizedState,i=a.element,m6(e,t),$d(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=ms(Error(Pe(423)),t),t=I3(e,t,n,r,i);break e}else if(n!==i){i=ms(Error(Pe(424)),t),t=I3(e,t,n,r,i);break e}else for(On=Wa(t.stateNode.containerInfo.firstChild),Pn=t,$t=!0,li=null,r=w6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ps(),n===i){t=ca(e,t,r);break e}Vr(e,t,n,r)}t=t.child}return t;case 5:return S6(t),e===null&&cv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,av(n,i)?o=null:a!==null&&av(n,a)&&(t.flags|=32),q6(e,t),Vr(e,t,o,r),t.child;case 6:return e===null&&cv(t),null;case 13:return Y6(e,t,r);case 4:return xm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=gs(t,null,n,r):Vr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ai(n,i),M3(e,t,n,i,r);case 7:return Vr(e,t,t.pendingProps,r),t.child;case 8:return Vr(e,t,t.pendingProps.children,r),t.child;case 12:return Vr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Lt(Ud,n._currentValue),n._currentValue=o,a!==null)if(pi(a.value,o)){if(a.children===i.children&&!fn.current){t=ca(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(a.tag===1){u=ra(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var v=f.pending;v===null?u.next=u:(u.next=v.next,v.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),fv(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Pe(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),fv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Vr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,us(t,r),i=Wn(i),n=n(i),t.flags|=1,Vr(e,t,n,r),t.child;case 14:return n=t.type,i=ai(n,t.pendingProps),i=ai(n.type,i),L3(e,t,n,i,r);case 15:return G6(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ai(n,i),bd(e,t),t.tag=1,dn(n)?(e=!0,Fd(t)):e=!1,us(t,r),b6(t,n,i),hv(t,n,i,r),vv(null,t,n,!0,e,r);case 19:return K6(e,t,r);case 22:return V6(e,t,r)}throw Error(Pe(156,t.tag))};function f8(e,t){return D_(e,t)}function lP(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(e,t,r,n){return new lP(e,t,r,n)}function Um(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sP(e){if(typeof e=="function")return Um(e)?1:0;if(e!=null){if(e=e.$$typeof,e===om)return 11;if(e===lm)return 14}return 2}function Za(e,t){var r=e.alternate;return r===null?(r=Gn(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 Sd(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")Um(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Vl:return Go(r.children,i,a,t);case am:o=8,i|=8;break;case Dg:return e=Gn(12,r,t,i|2),e.elementType=Dg,e.lanes=a,e;case Fg:return e=Gn(13,r,t,i),e.elementType=Fg,e.lanes=a,e;case zg:return e=Gn(19,r,t,i),e.elementType=zg,e.lanes=a,e;case __:return Ch(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y_:o=10;break e;case b_:o=9;break e;case om:o=11;break e;case lm:o=14;break e;case ja:o=16,n=null;break e}throw Error(Pe(130,e==null?e:typeof e,""))}return t=Gn(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Go(e,t,r,n){return e=Gn(7,e,n,t),e.lanes=r,e}function Ch(e,t,r,n){return e=Gn(22,e,n,t),e.elementType=__,e.lanes=r,e.stateNode={isHidden:!1},e}function P1(e,t,r){return e=Gn(6,e,null,t),e.lanes=r,e}function x1(e,t,r){return t=Gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uP(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=o1(0),this.expirationTimes=o1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=o1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Hm(e,t,r,n,i,a,o,l,u){return e=new uP(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Gn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pm(a),e}function cP(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Gl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function d8(e){if(!e)return to;e=e._reactInternals;e:{if(ol(e)!==e||e.tag!==1)throw Error(Pe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Pe(171))}if(e.tag===1){var r=e.type;if(dn(r))return f6(e,r,t)}return t}function h8(e,t,r,n,i,a,o,l,u){return e=Hm(r,n,!0,e,i,a,o,l,u),e.context=d8(null),r=e.current,n=qr(),i=Xa(r),a=ra(n,i),a.callback=t??null,Ya(r,a,i),e.current.lanes=i,bc(e,i,n),hn(e,n),e}function kh(e,t,r,n){var i=t.current,a=qr(),o=Xa(i);return r=d8(r),t.context===null?t.context=r:t.pendingContext=r,t=ra(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ya(i,t,o),e!==null&&(ui(e,i,o,a),vd(e,i,o)),o}function Zd(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 V3(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function $m(e,t){V3(e,t),(e=e.alternate)&&V3(e,t)}function fP(){return null}var p8=typeof reportError=="function"?reportError:function(e){console.error(e)};function Gm(e){this._internalRoot=e}Th.prototype.render=Gm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Pe(409));kh(e,t,null,null)};Th.prototype.unmount=Gm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zo(function(){kh(null,e,null,null)}),t[sa]=null}};function Th(e){this._internalRoot=e}Th.prototype.unstable_scheduleHydration=function(e){if(e){var t=G_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Fa.length&&t!==0&&t<Fa[r].priority;r++);Fa.splice(r,0,e),r===0&&q_(e)}};function Vm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ah(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function q3(){}function dP(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=Zd(o);a.call(f)}}var o=h8(t,n,e,0,null,!1,!1,"",q3);return e._reactRootContainer=o,e[sa]=o.current,Qu(e.nodeType===8?e.parentNode:e),Zo(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=Zd(u);l.call(f)}}var u=Hm(e,0,!1,null,null,!1,!1,"",q3);return e._reactRootContainer=u,e[sa]=u.current,Qu(e.nodeType===8?e.parentNode:e),Zo(function(){kh(t,u,r,n)}),u}function Rh(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=Zd(o);l.call(u)}}kh(t,o,e,i)}else o=dP(r,t,e,i,n);return Zd(o)}H_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Cu(t.pendingLanes);r!==0&&(cm(t,r|1),hn(t,tr()),!(ht&6)&&(ys=tr()+500,so()))}break;case 13:Zo(function(){var n=ua(e,1);if(n!==null){var i=qr();ui(n,e,1,i)}}),$m(e,1)}};fm=function(e){if(e.tag===13){var t=ua(e,134217728);if(t!==null){var r=qr();ui(t,e,134217728,r)}$m(e,134217728)}};$_=function(e){if(e.tag===13){var t=Xa(e),r=ua(e,t);if(r!==null){var n=qr();ui(r,e,t,n)}$m(e,t)}};G_=function(){return Et};V_=function(e,t){var r=Et;try{return Et=e,t()}finally{Et=r}};Kg=function(e,t,r){switch(t){case"input":if(Hg(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=wh(n);if(!i)throw Error(Pe(90));S_(n),Hg(n,i)}}}break;case"textarea":O_(e,r);break;case"select":t=r.value,t!=null&&as(e,!!r.multiple,t,!1)}};R_=Fm;M_=Zo;var hP={usingClientEntryPoint:!1,Events:[wc,Kl,wh,T_,A_,Fm]},_u={findFiberByHostInstance:zo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},pP={bundleType:_u.bundleType,version:_u.version,rendererPackageName:_u.rendererPackageName,rendererConfig:_u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:pa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=I_(e),e===null?null:e.stateNode},findFiberByHostInstance:_u.findFiberByHostInstance||fP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jf.isDisabled&&Jf.supportsFiber)try{mh=Jf.inject(pP),ji=Jf}catch{}}kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hP;kn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vm(t))throw Error(Pe(200));return cP(e,t,null,r)};kn.createRoot=function(e,t){if(!Vm(e))throw Error(Pe(299));var r=!1,n="",i=p8;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Hm(e,1,!1,null,null,r,!1,n,i),e[sa]=t.current,Qu(e.nodeType===8?e.parentNode:e),new Gm(t)};kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Pe(188)):(e=Object.keys(e).join(","),Error(Pe(268,e)));return e=I_(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return Zo(e)};kn.hydrate=function(e,t,r){if(!Ah(t))throw Error(Pe(200));return Rh(null,e,t,!0,r)};kn.hydrateRoot=function(e,t,r){if(!Vm(e))throw Error(Pe(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=p8;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=h8(t,null,e,1,r??null,i,!1,a,o),e[sa]=t.current,Qu(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 Th(t)};kn.render=function(e,t,r){if(!Ah(t))throw Error(Pe(200));return Rh(null,e,t,!1,r)};kn.unmountComponentAtNode=function(e){if(!Ah(e))throw Error(Pe(40));return e._reactRootContainer?(Zo(function(){Rh(null,null,e,!1,function(){e._reactRootContainer=null,e[sa]=null})}),!0):!1};kn.unstable_batchedUpdates=Fm;kn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Ah(r))throw Error(Pe(200));if(e==null||e._reactInternals===void 0)throw Error(Pe(38));return Rh(e,t,r,!1,n)};kn.version="18.2.0-next-9e3b772b8-20220608";function g8(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g8)}catch(e){console.error(e)}}g8(),h_.exports=kn;var v8=h_.exports,W3=v8;Cd.createRoot=W3.createRoot,Cd.hydrateRoot=W3.hydrateRoot;var m8={};function Ze(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 gP={};function qm(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:gP}var y8=Object.assign,Qd=Object.getOwnPropertyDescriptor,Fi=Object.defineProperty,Ec=Object.prototype,kv=[];Object.freeze(kv);var Wm={};Object.freeze(Wm);var vP=typeof Proxy<"u",mP=Object.toString();function b8(){vP||Ze("Proxy not available")}function _8(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var rs=function(){};function Cn(e){return typeof e=="function"}function Qo(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Mh(e){return e!==null&&typeof e=="object"}function fa(e){if(!Mh(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()===mP}function w8(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Oc(e,t,r){Fi(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function S8(e,t,r){Fi(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function uo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Mh(n)&&n[r]===!0}}function Ds(e){return e instanceof Map}function Pc(e){return e instanceof Set}var E8=typeof Object.getOwnPropertySymbols<"u";function yP(e){var t=Object.keys(e);if(!E8)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Ec.propertyIsEnumerable.call(e,n)})):t}var bs=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:E8?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function O8(e){return e===null?null:typeof e=="object"?""+e:e}function na(e,t){return Ec.hasOwnProperty.call(e,t)}var bP=Object.getOwnPropertyDescriptors||function(t){var r={};return bs(t).forEach(function(n){r[n]=Qd(t,n)}),r};function Y3(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,SP(n.key),n)}}function Ym(e,t,r){return t&&Y3(e.prototype,t),r&&Y3(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ro(){return ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ro.apply(this,arguments)}function P8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Tv(e,t)}function Tv(e,t){return Tv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Tv(e,t)}function C1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _P(e,t){if(e){if(typeof e=="string")return K3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K3(e,t)}}function K3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ns(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=_P(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wP(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SP(e){var t=wP(e,"string");return typeof t=="symbol"?t:String(t)}var Ii=Symbol("mobx-stored-annotations");function ci(e){function t(r,n){if(xc(n))return e.decorate_20223_(r,n);Fs(r,n,e)}return Object.assign(t,e)}function Fs(e,t,r){na(e,Ii)||Oc(e,Ii,ro({},e[Ii])),RP(r)||(e[Ii][t]=r)}function EP(e){return na(e,Ii)||Oc(e,Ii,ro({},e[Ii])),e[Ii]}function xc(e){return typeof e=="object"&&typeof e.kind=="string"}var Ve=Symbol("mobx administration"),Cc=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_=bt.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 q8(this)},t.reportChanged=function(){un(),W8(this),cn()},t.toString=function(){return this.name_},e}(),Km=uo("Atom",Cc);function lc(e,t,r){t===void 0&&(t=rs),r===void 0&&(r=rs);var n=new Cc(e);return t!==rs&&rw(n,t),r!==rs&&ty(n,r),n}function OP(e,t){return e===t}function PP(e,t){return fy(e,t)}function xP(e,t){return fy(e,t,1)}function CP(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Jo={identity:OP,structural:PP,default:CP,shallow:xP};function el(e,t,r){return Bh(e)?e:Array.isArray(e)?Tt.array(e,{name:r}):fa(e)?Tt.object(e,void 0,{name:r}):Ds(e)?Tt.map(e,{name:r}):Pc(e)?Tt.set(e,{name:r}):typeof e=="function"&&!Tc(e)&&!Os(e)?w8(e)?rl(e):Ss(r,e):e}function kP(e,t,r){if(e==null||Er(e)||Xr(e)||Mr(e)||Wr(e))return e;if(Array.isArray(e))return Tt.array(e,{name:r,deep:!1});if(fa(e))return Tt.object(e,void 0,{name:r,deep:!1});if(Ds(e))return Tt.map(e,{name:r,deep:!1});if(Pc(e))return Tt.set(e,{name:r,deep:!1})}function Lh(e){return e}function TP(e,t){return fy(e,t)?t:e}var x8="override",AP=ci({annotationType_:x8,make_:MP,extend_:LP,decorate_20223_:NP});function RP(e){return e.annotationType_===x8}function MP(e,t){return 0}function LP(e,t,r,n){Ze("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function NP(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function kc(e,t){return{annotationType_:e,options_:t,make_:IP,extend_:jP,decorate_20223_:DP}}function IP(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(Tc(r.value))return 1;var a=C8(e,this,t,r,!1);return Fi(n,t,a),2}function jP(e,t,r,n){var i=C8(e,this,t,r);return e.defineProperty_(t,i,n)}function DP(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var v,S,_,h;return no((v=(S=a.options_)==null?void 0:S.name)!=null?v:n.toString(),f,(_=(h=a.options_)==null?void 0:h.autoAction)!=null?_:!1)};if(r=="field"){i(function(){Fs(this,n,a)});return}if(r=="method"){var l;return Tc(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}Ze("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
34
|
+
'`+a.annotationType_+"' can only be used on properties with a function value."))}function FP(e,t,r,n){t.annotationType_,n.value}function C8(e,t,r,n,i){var a,o,l,u,f,v,S;i===void 0&&(i=Ce.safeDescriptors),FP(e,t,r,n);var _=n.value;if((a=t.options_)!=null&&a.bound){var h;_=_.bind((h=e.proxy_)!=null?h:e.target_)}return{value:no((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),_,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(v=t.options_)!=null&&v.bound?(S=e.proxy_)!=null?S:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function k8(e,t){return{annotationType_:e,options_:t,make_:zP,extend_:BP,decorate_20223_:UP}}function zP(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&&(!na(e.target_,t)||!Os(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Os(r.value))return 1;var a=T8(e,this,t,r,!1,!1);return Fi(n,t,a),2}function BP(e,t,r,n){var i,a=T8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function UP(e,t){var r,n=t.name,i=t.addInitializer;return Os(e)||(e=rl(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 HP(e,t,r,n){t.annotationType_,n.value}function T8(e,t,r,n,i,a){a===void 0&&(a=Ce.safeDescriptors),HP(e,t,r,n);var o=n.value;if(Os(o)||(o=rl(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 Xm(e,t){return{annotationType_:e,options_:t,make_:$P,extend_:GP,decorate_20223_:VP}}function $P(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function GP(e,t,r,n){return qP(e,this,t,r),e.defineComputedProperty_(t,ro({},this.options_,{get:r.get,set:r.set}),n)}function VP(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=ul(this)[Ve],o=ro({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new _s(o))}),function(){return this[Ve].getObservablePropValue_(n)}}function qP(e,t,r,n){t.annotationType_,n.get}function Nh(e,t){return{annotationType_:e,options_:t,make_:WP,extend_:YP,decorate_20223_:KP}}function WP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function YP(e,t,r,n){var i,a;return XP(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:el,n)}function KP(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,v,S=ul(l)[Ve],_=new Qa(u,(f=(v=r.options_)==null?void 0:v.enhancer)!=null?f:el,"ObservableObject."+i.toString(),!1);S.values_.set(i,_),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Ve].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ve].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function XP(e,t,r,n){t.annotationType_}var ZP="true",QP=A8();function A8(e){return{annotationType_:ZP,options_:e,make_:JP,extend_:ex,decorate_20223_:tx}}function JP(e,t,r,n){var i,a;if(r.get)return ll.make_(e,t,r,n);if(r.set){var o=no(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Ce.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Fi(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(w8(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?rl.bound:rl;return f.make_(e,t,r,n)}var v=(l=this.options_)!=null&&l.autoBind?Ss.bound:Ss;return v.make_(e,t,r,n)}var S=((i=this.options_)==null?void 0:i.deep)===!1?Tt.ref:Tt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var _;r.value=r.value.bind((_=e.proxy_)!=null?_:e.target_)}return S.make_(e,t,r,n)}function ex(e,t,r,n){var i,a;if(r.get)return ll.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Ce.safeDescriptors?e.isPlainObject_:!0,set:no(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?Tt.ref:Tt;return l.extend_(e,t,r,n)}function tx(e,t){Ze("'"+this.annotationType_+"' cannot be used as a decorator")}var rx="observable",nx="observable.ref",ix="observable.shallow",ax="observable.struct",R8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(R8);function ed(e){return e||R8}var Av=Nh(rx),ox=Nh(nx,{enhancer:Lh}),lx=Nh(ix,{enhancer:kP}),sx=Nh(ax,{enhancer:TP}),M8=ci(Av);function td(e){return e.deep===!0?el:e.deep===!1?Lh:cx(e.defaultDecorator)}function ux(e){var t;return e?(t=e.defaultDecorator)!=null?t:A8(e):void 0}function cx(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:el}function L8(e,t,r){if(xc(t))return Av.decorate_20223_(e,t);if(Qo(t)){Fs(e,t,Av);return}return Bh(e)?e:fa(e)?Tt.object(e,t,r):Array.isArray(e)?Tt.array(e,t):Ds(e)?Tt.map(e,t):Pc(e)?Tt.set(e,t):typeof e=="object"&&e!==null?e:Tt.box(e,t)}y8(L8,M8);var fx={box:function(t,r){var n=ed(r);return new Qa(t,td(n),n.name,!0,n.equals)},array:function(t,r){var n=ed(r);return(Ce.useProxies===!1||n.proxy===!1?mC:lC)(t,td(n),n.name)},map:function(t,r){var n=ed(r);return new Hh(t,td(n),n.name)},set:function(t,r){var n=ed(r);return new uy(t,td(n),n.name)},object:function(t,r,n){return co(function(){return ry(Ce.useProxies===!1||(n==null?void 0:n.proxy)===!1?ul({},n):nC({},n),t,r)})},ref:ci(ox),shallow:ci(lx),deep:M8,struct:ci(sx)},Tt=y8(L8,fx),N8="computed",dx="computed.struct",Rv=Xm(N8),hx=Xm(dx,{equals:Jo.structural}),ll=function(t,r){if(xc(r))return Rv.decorate_20223_(t,r);if(Qo(r))return Fs(t,r,Rv);if(fa(t))return ci(Xm(N8,t));var n=fa(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new _s(n)};Object.assign(ll,Rv);ll.struct=ci(hx);var X3,Z3,Jd=0,px=1,gx=(X3=(Z3=Qd(function(){},"name"))==null?void 0:Z3.configurable)!=null?X3:!1,Q3={value:"action",configurable:!0,writable:!1,enumerable:!1};function no(e,t,r,n){r===void 0&&(r=!1);function i(){return I8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},gx&&(Q3.value=e,Fi(i,"name",Q3)),i}function I8(e,t,r,n,i){var a=j8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{D8(a)}}function j8(e,t,r,n){var i=!1,a=0,o=Ce.trackingDerivation,l=!t||!o;un();var u=Ce.allowStateChanges;l&&(sl(),u=Ih(!0));var f=Dh(!0),v={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:px++,parentActionId_:Jd};return Jd=v.actionId_,v}function D8(e){Jd!==e.actionId_&&Ze(30),Jd=e.parentActionId_,e.error_!==void 0&&(Ce.suppressReactionErrors=!0),jh(e.prevAllowStateChanges_),fs(e.prevAllowStateReads_),cn(),e.runAsAction_&&ia(e.prevDerivation_),Ce.suppressReactionErrors=!1}function Zm(e,t){var r=Ih(e);try{return t()}finally{jh(r)}}function Ih(e){var t=Ce.allowStateChanges;return Ce.allowStateChanges=e,t}function jh(e){Ce.allowStateChanges=e}var F8;F8=Symbol.toPrimitive;var Qa=function(e){P8(t,e);function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=Jo.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=l,u.value_=i(n,void 0,a),u}var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Ce.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Hn(this)){var a=$n(this,{object:this,type:zi,newValue:i});if(!a)return Ce.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Ce.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),fi(this)&&di(this,{type:zi,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Ac(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:zi,newValue:this.value_,oldValue:void 0}),Rc(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 O8(this.get())},r[F8]=function(){return this.valueOf()},t}(Cc),Qm=uo("ObservableValue",Qa),z8;z8=Symbol.toPrimitive;var _s=function(){function e(r){this.dependenciesState_=bt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=bt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new th(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=eh.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||Ze(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=no("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Jo.structural:Jo.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Px(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_&&Ze(32,this.name_,this.derivation),Ce.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Mv(this)&&(this.warnAboutUntrackedRead_(),un(),this.value_=this.computeValue_(!1),cn());else if(q8(this),Mv(this)){var n=Ce.trackingContext;this.keepAlive_&&!n&&(Ce.trackingContext=this),this.trackAndCompute()&&Ox(this),Ce.trackingContext=n}var i=this.value_;if(Ed(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter_&&Ze(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter_=!1}}else Ze(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===bt.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Ed(n)||Ed(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing_=!0;var i=Ih(!1),a;if(n)a=B8(this,this.derivation,this.scope_);else if(Ce.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new th(o)}return jh(i),this.isComputing_=!1,a},t.suspend_=function(){this.keepAlive_||(Lv(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return ey(function(){var u=a.get();if(!o||i){var f=sl();n({observableKind:"computed",debugObjectName:a.name_,type:zi,object:a,newValue:u,oldValue:l}),ia(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return O8(this.get())},t[z8]=function(){return this.valueOf()},e}(),tl=uo("ComputedValue",_s),bt;(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_"})(bt||(bt={}));var eh;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(eh||(eh={}));var th=function(t){this.cause=void 0,this.cause=t};function Ed(e){return e instanceof th}function Mv(e){switch(e.dependenciesState_){case bt.UP_TO_DATE_:return!1;case bt.NOT_TRACKING_:case bt.STALE_:return!0;case bt.POSSIBLY_STALE_:{for(var t=Dh(!0),r=sl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(tl(o)){if(Ce.disableErrorBoundaries)o.get();else try{o.get()}catch{return ia(r),fs(t),!0}if(e.dependenciesState_===bt.STALE_)return ia(r),fs(t),!0}}return U8(e),ia(r),fs(t),!1}}}function vx(){return Ce.trackingDerivation!==null}function B8(e,t,r){var n=Dh(!0);U8(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++Ce.runId;var i=Ce.trackingDerivation;Ce.trackingDerivation=e,Ce.inBatch++;var a;if(Ce.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new th(o)}return Ce.inBatch--,Ce.trackingDerivation=i,mx(e),fs(n),a}function mx(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=bt.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&&G8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,Ex(f,e))}n!==bt.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Lv(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)G8(t[r],e);e.dependenciesState_=bt.NOT_TRACKING_}function Jm(e){var t=sl();try{return e()}finally{ia(t)}}function sl(){var e=Ce.trackingDerivation;return Ce.trackingDerivation=null,e}function ia(e){Ce.trackingDerivation=e}function Dh(e){var t=Ce.allowStateReads;return Ce.allowStateReads=e,t}function fs(e){Ce.allowStateReads=e}function U8(e){if(e.dependenciesState_!==bt.UP_TO_DATE_){e.dependenciesState_=bt.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=bt.UP_TO_DATE_}}var yx=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Bu=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},Od=!0,H8=!1,Ce=function(){var e=qm();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Od=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Bu().version&&(Od=!1),Od?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Bu):(setTimeout(function(){H8||Ze(35)},1),new Bu)}();function bx(){if((Ce.pendingReactions.length||Ce.inBatch||Ce.isRunningReactions)&&Ze(36),H8=!0,Od){var e=qm();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Ce=new Bu}}function $8(){return Ce}function _x(){var e=new Bu;for(var t in e)yx.indexOf(t)===-1&&(Ce[t]=e[t]);Ce.allowStateChanges=!Ce.enforceActions}function wx(e){return e.observers_&&e.observers_.size>0}function Sx(e){return e.observers_}function Ex(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function G8(e,t){e.observers_.delete(t),e.observers_.size===0&&V8(e)}function V8(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,Ce.pendingUnobservations.push(e))}function un(){Ce.inBatch++}function cn(){if(--Ce.inBatch===0){Y8();for(var e=Ce.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 _s&&r.suspend_())}Ce.pendingUnobservations=[]}}function q8(e){var t=Ce.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&Ce.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),e.isBeingObserved_):(e.observers_.size===0&&Ce.inBatch>0&&V8(e),!1)}function W8(e){e.lowestObserverState_!==bt.STALE_&&(e.lowestObserverState_=bt.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===bt.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=bt.STALE_}))}function Ox(e){e.lowestObserverState_!==bt.STALE_&&(e.lowestObserverState_=bt.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===bt.POSSIBLY_STALE_?t.dependenciesState_=bt.STALE_:t.dependenciesState_===bt.UP_TO_DATE_&&(e.lowestObserverState_=bt.UP_TO_DATE_)}))}function Px(e){e.lowestObserverState_===bt.UP_TO_DATE_&&(e.lowestObserverState_=bt.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===bt.UP_TO_DATE_&&(t.dependenciesState_=bt.POSSIBLY_STALE_,t.onBecomeStale_())}))}var ws=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_=bt.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_=eh.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,Ce.pendingReactions.push(this),Y8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){un(),this.isScheduled_=!1;var n=Ce.trackingContext;if(Ce.trackingContext=this,Mv(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Ce.trackingContext=n,cn()}},t.track=function(n){if(!this.isDisposed_){un(),this.isRunning_=!0;var i=Ce.trackingContext;Ce.trackingContext=this;var a=B8(this,n,void 0);Ce.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Lv(this),Ed(a)&&this.reportExceptionInDerivation_(a.cause),cn()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Ce.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Ce.suppressReactionErrors||console.error(a,n),Ce.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(un(),Lv(this),cn()))},t.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[Ve]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function xx(e){return Ce.globalReactionErrorHandlers.push(e),function(){var t=Ce.globalReactionErrorHandlers.indexOf(e);t>=0&&Ce.globalReactionErrorHandlers.splice(t,1)}}var Cx=100,Nv=function(t){return t()};function Y8(){Ce.inBatch>0||Ce.isRunningReactions||Nv(kx)}function kx(){Ce.isRunningReactions=!0;for(var e=Ce.pendingReactions,t=0;e.length>0;){++t===Cx&&(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_()}Ce.isRunningReactions=!1}var rh=uo("Reaction",ws);function Tx(e){var t=Nv;Nv=function(n){return e(function(){return t(n)})}}function Uu(){return!1}function K8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var X8="action",Ax="action.bound",Z8="autoAction",Rx="autoAction.bound",Q8="<unnamed action>",Iv=kc(X8),Mx=kc(Ax,{bound:!0}),jv=kc(Z8,{autoAction:!0}),Lx=kc(Rx,{autoAction:!0,bound:!0});function J8(e){var t=function(n,i){if(Cn(n))return no(n.name||Q8,n,e);if(Cn(i))return no(n,i,e);if(xc(i))return(e?jv:Iv).decorate_20223_(n,i);if(Qo(i))return Fs(n,i,e?jv:Iv);if(Qo(n))return ci(kc(e?Z8:X8,{name:n,autoAction:e}))};return t}var or=J8(!1);Object.assign(or,Iv);var Ss=J8(!0);Object.assign(Ss,jv);or.bound=ci(Mx);Ss.bound=ci(Lx);function Es(e){return I8(e.name||Q8,!1,e,this,void 0)}function Tc(e){return Cn(e)&&e.isMobxAction===!0}function ey(e,t){var r,n,i,a,o;t===void 0&&(t=Wm);var l=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",u=!t.scheduler&&!t.delay,f;if(u)f=new ws(l,function(){this.track(_)},t.onError,t.requiresObservable);else{var v=ew(t),S=!1;f=new ws(l,function(){S||(S=!0,v(function(){S=!1,f.isDisposed_||f.track(_)}))},t.onError,t.requiresObservable)}function _(){e(f)}return(i=t)!=null&&(a=i.signal)!=null&&a.aborted||f.schedule_(),f.getDisposer_((o=t)==null?void 0:o.signal)}var Nx=function(t){return t()};function ew(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Nx}function tw(e,t,r){var n,i,a,o;r===void 0&&(r=Wm);var l=(n=r.name)!=null?n:"Reaction",u=or(l,r.onError?Ix(r.onError,t):t),f=!r.scheduler&&!r.delay,v=ew(r),S=!0,_=!1,h,E,m=r.compareStructural?Jo.structural:r.equals||Jo.default,p=new ws(l,function(){S||f?y():_||(_=!0,v(y))},r.onError,r.requiresObservable);function y(){if(_=!1,!p.isDisposed_){var g=!1;p.track(function(){var d=Zm(!1,function(){return e(p)});g=S||!m(h,d),E=h,h=d}),(S&&r.fireImmediately||!S&&g)&&u(h,E,p),S=!1}}return(i=r)!=null&&(a=i.signal)!=null&&a.aborted||p.schedule_(),p.getDisposer_((o=r)==null?void 0:o.signal)}function Ix(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var jx="onBO",Dx="onBUO";function rw(e,t,r){return nw(jx,e,t,r)}function ty(e,t,r){return nw(Dx,e,t,r)}function nw(e,t,r,n){var i=typeof n=="function"?Bi(t,r):Bi(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 Fx="never",rd="always",zx="observed";function iw(e){e.isolateGlobalState===!0&&bx();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Ce.useProxies=t===rd?!0:t===Fx?!1:typeof Proxy<"u"),t==="ifavailable"&&(Ce.verifyProxies=!0),r!==void 0){var n=r===rd?rd:r===zx;Ce.enforceActions=n,Ce.allowStateChanges=!(n===!0||n===rd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Ce[i]=!!e[i])}),Ce.allowStateReads=!Ce.observableRequiresReaction,e.reactionScheduler&&Tx(e.reactionScheduler)}function ry(e,t,r,n){var i=bP(t);return co(function(){var a=ul(e,n)[Ve];bs(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function aw(e,t){return ow(Bi(e,t))}function ow(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Ux(e.observing_).map(ow)),t}function Bx(e,t){return lw(Bi(e,t))}function lw(e){var t={name:e.name_};return wx(e)&&(t.observers=Array.from(Sx(e)).map(lw)),t}function Ux(e){return Array.from(new Set(e))}var Hx=0;function Fh(){this.message="FLOW_CANCELLED"}Fh.prototype=Object.create(Error.prototype);function $x(e){return e instanceof Fh}var k1=k8("flow"),Gx=k8("flow.bound",{bound:!0}),rl=Object.assign(function(t,r){if(xc(r))return k1.decorate_20223_(t,r);if(Qo(r))return Fs(t,r,k1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++Hx,v=or(i+" - runid: "+f+" - init",n).apply(l,u),S,_=void 0,h=new Promise(function(E,m){var p=0;S=m;function y(b){_=void 0;var O;try{O=or(i+" - runid: "+f+" - yield "+p++,v.next).call(v,b)}catch(P){return m(P)}d(O)}function g(b){_=void 0;var O;try{O=or(i+" - runid: "+f+" - yield "+p++,v.throw).call(v,b)}catch(P){return m(P)}d(O)}function d(b){if(Cn(b==null?void 0:b.then)){b.then(d,m);return}return b.done?E(b.value):(_=Promise.resolve(b.value),_.then(y,g))}y(void 0)});return h.cancel=or(i+" - runid: "+f+" - cancel",function(){try{_&&J3(_);var E=v.return(void 0),m=Promise.resolve(E.value);m.then(rs,rs),J3(m),S(new Fh)}catch(p){S(p)}}),h};return a.isMobXFlow=!0,a},k1);rl.bound=ci(Gx);function J3(e){Cn(e.cancel)&&e.cancel()}function Vx(e){return e}function Os(e){return(e==null?void 0:e.isMobXFlow)===!0}function ny(e,t,r){var n;return Mr(e)||Xr(e)||Qm(e)?n=gi(e):Er(e)&&(n=gi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function zh(e,t,r){return Cn(r)?Wx(e,t,r):qx(e,t)}function qx(e,t){return gi(e).intercept_(t)}function Wx(e,t,r){return gi(e,t).intercept_(r)}function sw(e,t){if(t===void 0)return tl(e);if(Er(e)===!1||!e[Ve].values_.has(t))return!1;var r=Bi(e,t);return tl(r)}function Yx(e){return sw(e)}function uw(e,t){return sw(e,t)}function cw(e,t){return e?t!==void 0?Er(e)?e[Ve].values_.has(t):!1:Er(e)||!!e[Ve]||Km(e)||rh(e)||tl(e):!1}function Bh(e){return cw(e)}function fw(e,t){return cw(e,t)}function sc(e){if(Er(e))return e[Ve].keys_();if(Mr(e)||Wr(e))return Array.from(e.keys());if(Xr(e))return e.map(function(t,r){return r});Ze(5)}function iy(e){if(Er(e))return sc(e).map(function(t){return e[t]});if(Mr(e))return sc(e).map(function(t){return e.get(t)});if(Wr(e))return Array.from(e.values());if(Xr(e))return e.slice();Ze(6)}function dw(e){if(Er(e))return sc(e).map(function(t){return[t,e[t]]});if(Mr(e))return sc(e).map(function(t){return[t,e.get(t)]});if(Wr(e))return Array.from(e.entries());if(Xr(e))return e.map(function(t,r){return[r,t]});Ze(7)}function ay(e,t,r){if(arguments.length===2&&!Wr(e)){un();var n=t;try{for(var i in n)ay(e,i,n[i])}finally{cn()}return}Er(e)?e[Ve].set_(t,r):Mr(e)?e.set(t,r):Wr(e)?e.add(t):Xr(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&Ze("Invalid index: '"+t+"'"),un(),t>=e.length&&(e.length=t+1),e[t]=r,cn()):Ze(8)}function Kx(e,t){Er(e)?e[Ve].delete_(t):Mr(e)||Wr(e)?e.delete(t):Xr(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):Ze(9)}function hw(e,t){if(Er(e))return e[Ve].has_(t);if(Mr(e))return e.has(t);if(Wr(e))return e.has(t);if(Xr(e))return t>=0&&t<e.length;Ze(10)}function Xx(e,t){if(hw(e,t)){if(Er(e))return e[Ve].get_(t);if(Mr(e))return e.get(t);if(Xr(e))return e[t];Ze(11)}}function oy(e,t,r){if(Er(e))return e[Ve].defineProperty_(t,r);Ze(39)}function pw(e){if(Er(e))return e[Ve].ownKeys_();Ze(38)}function Uh(e,t,r,n){return Cn(r)?Qx(e,t,r,n):Zx(e,t,r)}function Zx(e,t,r){return gi(e).observe_(t,r)}function Qx(e,t,r,n){return gi(e,t).observe_(r,n)}function nd(e,t,r){return e.set(t,r),r}function $l(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Bh(e))return e;if(Qm(e)||tl(e))return $l(e.get(),t);if(t.has(e))return t.get(e);if(Xr(e)){var r=nd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=$l(o,t)}),r}if(Wr(e)){var n=nd(t,e,new Set);return e.forEach(function(o){n.add($l(o,t))}),n}if(Mr(e)){var i=nd(t,e,new Map);return e.forEach(function(o,l){i.set(l,$l(o,t))}),i}else{var a=nd(t,e,{});return pw(e).forEach(function(o){Ec.propertyIsEnumerable.call(e,o)&&(a[o]=$l(e[o],t))}),a}}function Jx(e,t){return $l(e,new Map)}function eC(){}function Li(e,t){t===void 0&&(t=void 0),un();try{return e.apply(t)}finally{cn()}}function Dv(e,t,r){return arguments.length===1||t&&typeof t=="object"?tC(e,t):gw(e,t,r||{})}function gw(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Ve].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=no("When-effect",t),o=ey(function(l){var u=Zm(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function tC(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,l){var u,f=gw(e,o,ro({},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 zl(e){return e[Ve]}var rC={has:function(t,r){return zl(t).has_(r)},get:function(t,r){return zl(t).get_(r)},set:function(t,r,n){var i;return Qo(r)?(i=zl(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return Qo(r)?(n=zl(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=zl(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return zl(t).ownKeys_()},preventExtensions:function(t){Ze(13)}};function nC(e,t){var r,n;return b8(),e=ul(e,t),(n=(r=e[Ve]).proxy_)!=null?n:r.proxy_=new Proxy(e,rC)}function Hn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ac(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),_8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function $n(e,t){var r=sl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&Ze(14),!!t);i++);return t}finally{ia(r)}}function fi(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Rc(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),_8(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function di(e,t){var r=sl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);ia(r)}}function ly(e,t,r){return co(function(){var n,i=ul(e,r)[Ve];(n=t)!=null||(t=EP(e)),bs(t).forEach(function(a){return i.make_(a,t[a])})}),e}var T1=Symbol("mobx-keys");function iC(e,t,r){return fa(e)?ry(e,e,t,r):(co(function(){var n=ul(e,r)[Ve];if(!e[T1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(bs(e),bs(i)));a.delete("constructor"),a.delete(Ve),Oc(i,T1,a)}e[T1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var e5="splice",zi="update",aC=1e4,oC={get:function(t,r){var n=t[Ve];return r===Ve?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):na(nh,r)?nh[r]:t[r]},set:function(t,r,n){var i=t[Ve];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){Ze(15)}},sy=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 Cc(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 Ac(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}),Rc(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&Ze("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_&&Ze(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&Ow(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),Hn(this)){var u=$n(this,{object:this.proxy_,type:e5,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(S){return o.enhancer_(S,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var v=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,v),this.dehanceValues_(v)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<aC){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var l=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var f=0;f<a.length;f++)this.values_[n+f]=a[f];for(var v=0;v<u.length;v++)this.values_[n+a.length+v]=u[v];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Uu(),l=fi(this),u=l||o?{observableKind:"array",object:this.proxy_,type:zi,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&di(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Uu(),l=fi(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:e5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&di(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&&Ze(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Hn(this)){var l=$n(this,{type:zi,object:this.proxy_,index:n,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var f=new Array(n+1-a.length),v=0;v<f.length-1;v++)f[v]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function lC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),b8(),co(function(){var i=new sy(r,t,n,!1);S8(i.values_,Ve,i);var a=new Proxy(i.values_,oC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var nh={clear:function(){return this.splice(0)},replace:function(t){var r=this[Ve];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[Ve];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[Ve].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Ve],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[Ve].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ve],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 Ce.trackingDerivation&&Ze(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Ce.trackingDerivation&&Ze(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Ve],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",vi);Nt("filter",vi);Nt("find",vi);Nt("findIndex",vi);Nt("findLast",vi);Nt("findLastIndex",vi);Nt("flatMap",vi);Nt("forEach",vi);Nt("map",vi);Nt("some",vi);Nt("toReversed",vi);Nt("reduce",vw);Nt("reduceRight",vw);function Nt(e,t){typeof Array.prototype[e]=="function"&&(nh[e]=t(e))}function An(e){return function(){var t=this[Ve];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function vi(e){return function(t,r){var n=this,i=this[Ve];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function vw(e){return function(){var t=this,r=this[Ve];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 sC=uo("ObservableArrayAdministration",sy);function Xr(e){return Mh(e)&&sC(e[Ve])}var mw,yw,uC={},$a="add",ih="delete";mw=Symbol.iterator;yw=Symbol.toStringTag;var Hh=function(){function e(r,n,i){var a=this;n===void 0&&(n=el),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ve]=uC,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)||Ze(18),co(function(){a.keysAtom_=lc("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(!Ce.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new Qa(this.has_(n),Lh,"ObservableMap.key?",!1);this.hasMap_.set(n,o),ty(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(Hn(this)){var o=$n(this,{type:a?zi:$a,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_,Hn(this)){var a=$n(this,{type:ih,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Uu(),l=fi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:ih,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Li(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var v=i.data_.get(n);v.setNewValue_(void 0),i.data_.delete(n)}),l&&di(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Ce.UNCHANGED){var o=Uu(),l=fi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:zi,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&di(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,Li(function(){var f,v=new Qa(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,v),i=v.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Uu(),l=fi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:$a,object:this,name:n,newValue:i}:null;l&&di(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 uc({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 uc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[mw]=function(){return this.entries()},t.forEach=function(n,i){for(var a=ns(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return Mr(n)&&(n=new Map(n)),Li(function(){fa(n)?yP(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)}):Ds(n)?(n.constructor!==Map&&Ze(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&Ze(20,n)}),this},t.clear=function(){var n=this;Li(function(){Jm(function(){for(var i=ns(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Li(function(){for(var a=cC(n),o=new Map,l=!1,u=ns(i.data_.keys()),f;!(f=u()).done;){var v=f.value;if(!a.has(v)){var S=i.delete(v);if(S)l=!0;else{var _=i.data_.get(v);o.set(v,_)}}}for(var h=ns(a.entries()),E;!(E=h()).done;){var m=E.value,p=m[0],y=m[1],g=i.data_.has(p);if(i.set(p,y),i.data_.has(p)){var d=i.data_.get(p);o.set(p,d),g||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var b=i.data_.keys(),O=o.keys(),P=b.next(),x=O.next();!P.done;){if(P.value!==x.value){i.keysAtom_.reportChanged();break}P=b.next(),x=O.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return Rc(this,n)},t.intercept_=function(n){return Ac(this,n)},Ym(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:yw,get:function(){return"Map"}}]),e}(),Mr=uo("ObservableMap",Hh);function cC(e){if(Ds(e)||Mr(e))return e;if(Array.isArray(e))return new Map(e);if(fa(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return Ze(21,e)}var bw,_w,fC={};bw=Symbol.iterator;_w=Symbol.toStringTag;var uy=function(){function e(r,n,i){var a=this;n===void 0&&(n=el),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ve]=fC,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Cn(Set)||Ze(22),this.enhancer_=function(o,l){return n(o,l,i)},co(function(){a.atom_=lc(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;Li(function(){Jm(function(){for(var i=ns(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=ns(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_,Hn(this)){var a=$n(this,{type:$a,object:this,newValue:n});if(!a)return this}if(!this.has(n)){Li(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=fi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:$a,object:this,newValue:n}:null;l&&di(this,u)}return this},t.delete=function(n){var i=this;if(Hn(this)){var a=$n(this,{type:ih,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=fi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:ih,object:this,oldValue:n}:null;return Li(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&di(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 uc({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 uc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.replace=function(n){var i=this;return Wr(n)&&(n=new Set(n)),Li(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):Pc(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&Ze("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return Rc(this,n)},t.intercept_=function(n){return Ac(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[bw]=function(){return this.values()},Ym(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:_w,get:function(){return"Set"}}]),e}(),Wr=uo("ObservableSet",uy),t5=Object.create(null),r5="remove",ww=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=QP),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 Cc("ObservableObject.keys"),this.isPlainObject_=fa(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 _s)return a.set(i),!0;if(Hn(this)){var o=$n(this,{type:zi,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Ce.UNCHANGED){var l=fi(this),u=!1,f=l||u?{type:zi,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&di(this,f)}return!0},t.get_=function(n){return Ce.trackingDerivation&&!na(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),na(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(!Ce.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new Qa(n in this.target_,Lh,"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_[Ii])!=null&&a[n])return;Ze(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Ec;){var l=Qd(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}i5(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&&i5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{un();var o=this.delete_(n);if(!o)return o;if(Hn(this)){var l=$n(this,{object:this.proxy_||this.target_,name:n,type:$a,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=ro({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Fi(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{cn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{un();var l=this.delete_(n);if(!l)return l;if(Hn(this)){var u=$n(this,{object:this.proxy_||this.target_,name:n,type:$a,newValue:i});if(!u)return null;i=u.newValue}var f=n5(n),v={configurable:Ce.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,v))return!1}else Fi(this.target_,n,v);var S=new Qa(i,a,"ObservableObject.key",!1);this.values_.set(n,S),this.notifyPropertyAddition_(n,S.value_)}finally{cn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{un();var o=this.delete_(n);if(!o)return o;if(Hn(this)){var l=$n(this,{object:this.proxy_||this.target_,name:n,type:$a,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=n5(n),f={configurable:Ce.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Fi(this.target_,n,f);this.values_.set(n,new _s(i)),this.notifyPropertyAddition_(n,void 0)}finally{cn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!na(this.target_,n))return!0;if(Hn(this)){var a=$n(this,{object:this.proxy_||this.target_,name:n,type:r5});if(!a)return null}try{var o,l;un();var u=fi(this),f=!1,v=this.values_.get(n),S=void 0;if(!v&&(u||f)){var _;S=(_=Qd(this.target_,n))==null?void 0:_.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(v&&(this.values_.delete(n),v instanceof Qa&&(S=v.value_),W8(v)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(l=o.get(n))==null||l.set(n in this.target_),u||f){var h={type:r5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:S,name:n};u&&di(this,h)}}finally{cn()}return!0},t.observe_=function(n,i){return Rc(this,n)},t.intercept_=function(n){return Ac(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o,l=fi(this),u=!1;if(l||u){var f=l||u?{type:$a,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;l&&di(this,f)}(a=this.pendingKeys_)==null||(o=a.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),bs(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function ul(e,t){var r;if(na(e,Ve))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new ww(e,new Map,String(n),ux(t));return Oc(e,Ve,i),e}var dC=uo("ObservableObjectAdministration",ww);function n5(e){return t5[e]||(t5[e]={get:function(){return this[Ve].getObservablePropValue_(e)},set:function(r){return this[Ve].setObservablePropValue_(e,r)}})}function Er(e){return Mh(e)?dC(e[Ve]):!1}function i5(e,t,r){var n;(n=e.target_[Ii])==null||delete n[r]}var hC=Ew(0),pC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),A1=0,Sw=function(){};function gC(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}gC(Sw,Array.prototype);var cy=function(e,t,r){P8(n,e);function n(a,o,l,u){var f;return l===void 0&&(l="ObservableArray"),u===void 0&&(u=!1),f=e.call(this)||this,co(function(){var v=new sy(l,o,u,!0);v.proxy_=C1(f),S8(C1(f),Ve,v),a&&a.length&&f.spliceWithArray(0,0,a),pC&&Object.defineProperty(C1(f),"0",hC)}),f}var i=n.prototype;return i.concat=function(){this[Ve].atom_.reportObserved();for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];return Array.prototype.concat.apply(this.slice(),l.map(function(f){return Xr(f)?f.slice():f}))},i[r]=function(){var a=this,o=0;return uc({next:function(){return o<a.length?{value:a[o++],done:!1}:{done:!0,value:void 0}}})},Ym(n,[{key:"length",get:function(){return this[Ve].getArrayLength_()},set:function(o){this[Ve].setArrayLength_(o)}},{key:t,get:function(){return"Array"}}]),n}(Sw,Symbol.toStringTag,Symbol.iterator);Object.entries(nh).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Oc(cy.prototype,t,r)});function Ew(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ve].get_(e)},set:function(r){this[Ve].set_(e,r)}}}function vC(e){Fi(cy.prototype,""+e,Ew(e))}function Ow(e){if(e>A1){for(var t=A1;t<e+100;t++)vC(t);A1=e}}Ow(1e3);function mC(e,t,r){return new cy(e,t,r)}function Bi(e,t){if(typeof e=="object"&&e!==null){if(Xr(e))return t!==void 0&&Ze(23),e[Ve].atom_;if(Wr(e))return e.atom_;if(Mr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||Ze(25,t,ah(e)),r}if(Er(e)){if(!t)return Ze(26);var n=e[Ve].values_.get(t);return n||Ze(27,t,ah(e)),n}if(Km(e)||tl(e)||rh(e))return e}else if(Cn(e)&&rh(e[Ve]))return e[Ve];Ze(28)}function gi(e,t){if(e||Ze(29),t!==void 0)return gi(Bi(e,t));if(Km(e)||tl(e)||rh(e)||Mr(e)||Wr(e))return e;if(e[Ve])return e[Ve];Ze(24,e)}function ah(e,t){var r;if(t!==void 0)r=Bi(e,t);else{if(Tc(e))return e.name;Er(e)||Mr(e)||Wr(e)?r=gi(e):r=Bi(e)}return r.name_}function co(e){var t=sl(),r=Ih(!0);un();try{return e()}finally{cn(),jh(r),ia(t)}}var a5=Ec.toString;function fy(e,t,r){return r===void 0&&(r=-1),Fv(e,t,r)}function Fv(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=a5.call(e);if(o!==a5.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=o5(e),t=o5(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 v=n.length;v--;)if(n[v]===e)return i[v]===t;if(n.push(e),i.push(t),l){if(v=e.length,v!==t.length)return!1;for(;v--;)if(!Fv(e[v],t[v],r-1,n,i))return!1}else{var S=Object.keys(e),_;if(v=S.length,Object.keys(t).length!==v)return!1;for(;v--;)if(_=S[v],!(na(t,_)&&Fv(e[_],t[_],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function o5(e){return Xr(e)?e.slice():Ds(e)||Mr(e)||Pc(e)||Wr(e)?Array.from(e.entries()):e}function uc(e){return e[Symbol.iterator]=yC,e}function yC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=qm();typeof t[e]>"u"&&Ze("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:K8,extras:{getDebugName:ah},$mobx:Ve});const bC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ve,FlowCancellationError:Fh,ObservableMap:Hh,ObservableSet:uy,Reaction:ws,_allowStateChanges:Zm,_allowStateChangesInsideComputed:Es,_allowStateReadsEnd:fs,_allowStateReadsStart:Dh,_autoAction:Ss,_endAction:D8,_getAdministration:gi,_getGlobalState:$8,_interceptReads:ny,_isComputingDerivation:vx,_resetGlobalState:_x,_startAction:j8,action:or,autorun:ey,comparer:Jo,computed:ll,configure:iw,createAtom:lc,defineProperty:oy,entries:dw,extendObservable:ry,flow:rl,flowResult:Vx,get:Xx,getAtom:Bi,getDebugName:ah,getDependencyTree:aw,getObserverTree:Bx,has:hw,intercept:zh,isAction:Tc,isBoxedObservable:Qm,isComputed:Yx,isComputedProp:uw,isFlow:Os,isFlowCancellationError:$x,isObservable:Bh,isObservableArray:Xr,isObservableMap:Mr,isObservableObject:Er,isObservableProp:fw,isObservableSet:Wr,keys:sc,makeAutoObservable:iC,makeObservable:ly,observable:Tt,observe:Uh,onBecomeObserved:rw,onBecomeUnobserved:ty,onReactionError:xx,override:AP,ownKeys:pw,reaction:tw,remove:Kx,runInAction:Es,set:ay,spy:K8,toJS:Jx,trace:eC,transaction:Li,untracked:Jm,values:iy,when:Dv},Symbol.toStringTag,{value:"Module"}));if(!Qe.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!ly)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function _C(e){e()}function Pw(e){e||(e=_C),iw({reactionScheduler:e})}var wC=function(){return!0};function SC(e){return aw(e)}var xw=!1;function Cw(e){xw=e}function dy(){return xw}var EC=1e4,OC=1e4,PC=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=EC),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,OC))}}),e}(),xC=typeof FinalizationRegistry<"u"?FinalizationRegistry:PC,oh=new xC(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),kw={exports:{}},Tw={};/**
|
|
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 Ps=Qe;function CC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kC=typeof Object.is=="function"?Object.is:CC,TC=Ps.useState,AC=Ps.useEffect,RC=Ps.useLayoutEffect,MC=Ps.useDebugValue;function LC(e,t){var r=t(),n=TC({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return RC(function(){i.value=r,i.getSnapshot=t,R1(i)&&a({inst:i})},[e,r,t]),AC(function(){return R1(i)&&a({inst:i}),e(function(){R1(i)&&a({inst:i})})},[e]),MC(r),r}function R1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!kC(e,r)}catch{return!0}}function NC(e,t){return t()}var IC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?NC:LC;Tw.useSyncExternalStore=Ps.useSyncExternalStore!==void 0?Ps.useSyncExternalStore:IC;kw.exports=Tw;var jC=kw.exports,DC=function(){};function l5(e){e.reaction=new ws("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function hy(e,t){if(t===void 0&&(t="observed"),dy())return e();var r=ut.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return oh.unregister(n),n.onStoreChange=l,n.reaction||(l5(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||(l5(i),oh.register(r,i,i)),ut.useDebugValue(i.reaction,SC),jC.useSyncExternalStore(i.subscribe,i.getSnapshot,DC);var a,o;if(i.reaction.track(function(){try{a=e()}catch(l){o=l}}),o)throw o;return a}var Aw=typeof Symbol=="function"&&Symbol.for,s5=Aw?Symbol.for("react.forward_ref"):typeof Qe.forwardRef=="function"&&Qe.forwardRef(function(e){return null}).$$typeof,u5=Aw?Symbol.for("react.memo"):typeof Qe.memo=="function"&&Qe.memo(function(e){return null}).$$typeof;function FC(e,t){var r;if(u5&&e.$$typeof===u5)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(dy())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(s5&&e.$$typeof===s5&&(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 hy(function(){return i(l,u)},a)};return o.displayName=e.displayName,Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=Qe.forwardRef(o)),o=Qe.memo(o),BC(e,o),o}var zC={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function BC(e,t){Object.keys(e).forEach(function(r){zC[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function Rw(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:hy(n)}Rw.displayName="Observer";function UC(e,t){return Qe.useState(function(){return Tt(e(),t,{autoBind:!0})})[0]}var HC=function(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 Mw(e){var t=HC(Qe.useState(function(){return Tt(e,{},{deep:!1})}),1),r=t[0];return Es(function(){Object.assign(r,e)}),r}function $C(e,t){var r=t&&Mw(t);return Qe.useState(function(){return Tt(e(r),void 0,{autoBind:!0})})[0]}var M1;Pw(v8.unstable_batchedUpdates);var GC=(M1=oh.finalizeAllImmediately)!==null&&M1!==void 0?M1:function(){};function VC(e,t){return t===void 0&&(t="observed"),hy(e,t)}function qC(e){Cw(e)}const WC=Object.freeze(Object.defineProperty({__proto__:null,Observer:Rw,_observerFinalizationRegistry:oh,clearTimers:GC,enableStaticRendering:Cw,isObserverBatched:wC,isUsingStaticRendering:dy,observer:FC,observerBatching:Pw,useAsObservableSource:Mw,useLocalObservable:UC,useLocalStore:$C,useObserver:VC,useStaticRendering:qC},Symbol.toStringTag,{value:"Module"})),mi=ao(WC);var Lw={};const ga=ao(bC);var py={exports:{}},$h={},lh={},at={};(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 be<"u"?be:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.1",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,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},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)})(at);var Xt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=at;class r{constructor(b=[1,0,0,1,0,0]){this.dirty=!1,this.m=b&&b.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(b){b.m[0]=this.m[0],b.m[1]=this.m[1],b.m[2]=this.m[2],b.m[3]=this.m[3],b.m[4]=this.m[4],b.m[5]=this.m[5]}point(b){var O=this.m;return{x:O[0]*b.x+O[2]*b.y+O[4],y:O[1]*b.x+O[3]*b.y+O[5]}}translate(b,O){return this.m[4]+=this.m[0]*b+this.m[2]*O,this.m[5]+=this.m[1]*b+this.m[3]*O,this}scale(b,O){return this.m[0]*=b,this.m[1]*=b,this.m[2]*=O,this.m[3]*=O,this}rotate(b){var O=Math.cos(b),P=Math.sin(b),x=this.m[0]*O+this.m[2]*P,w=this.m[1]*O+this.m[3]*P,T=this.m[0]*-P+this.m[2]*O,k=this.m[1]*-P+this.m[3]*O;return this.m[0]=x,this.m[1]=w,this.m[2]=T,this.m[3]=k,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(b,O){var P=this.m[0]+this.m[2]*O,x=this.m[1]+this.m[3]*O,w=this.m[2]+this.m[0]*b,T=this.m[3]+this.m[1]*b;return this.m[0]=P,this.m[1]=x,this.m[2]=w,this.m[3]=T,this}multiply(b){var O=this.m[0]*b.m[0]+this.m[2]*b.m[1],P=this.m[1]*b.m[0]+this.m[3]*b.m[1],x=this.m[0]*b.m[2]+this.m[2]*b.m[3],w=this.m[1]*b.m[2]+this.m[3]*b.m[3],T=this.m[0]*b.m[4]+this.m[2]*b.m[5]+this.m[4],k=this.m[1]*b.m[4]+this.m[3]*b.m[5]+this.m[5];return this.m[0]=O,this.m[1]=P,this.m[2]=x,this.m[3]=w,this.m[4]=T,this.m[5]=k,this}invert(){var b=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),O=this.m[3]*b,P=-this.m[1]*b,x=-this.m[2]*b,w=this.m[0]*b,T=b*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),k=b*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=O,this.m[1]=P,this.m[2]=x,this.m[3]=w,this.m[4]=T,this.m[5]=k,this}getMatrix(){return this.m}decompose(){var b=this.m[0],O=this.m[1],P=this.m[2],x=this.m[3],w=this.m[4],T=this.m[5],k=b*x-O*P;let A={x:w,y:T,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(b!=0||O!=0){var R=Math.sqrt(b*b+O*O);A.rotation=O>0?Math.acos(b/R):-Math.acos(b/R),A.scaleX=R,A.scaleY=k/R,A.skewX=(b*P+O*x)/k,A.skewY=0}else if(P!=0||x!=0){var F=Math.sqrt(P*P+x*x);A.rotation=Math.PI/2-(x>0?Math.acos(-P/F):-Math.acos(P/F)),A.scaleX=k/F,A.scaleY=F,A.skewX=0,A.skewY=(b*P+O*x)/k}return A.rotation=e.Util._getRotation(A.rotation),A}}e.Transform=r;var n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,f="#",v="",S="0",_="Konva warning: ",h="Konva error: ",E="rgb(",m={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})\)/,y=[];const g=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 b=d[0];return b==="#"||b==="."||b===b.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){y.push(d),y.length===1&&g(function(){const b=y;y=[],b.forEach(function(O){O()})})},createCanvasElement(){var d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,b){var O=e.Util.createImageElement();O.onload=function(){b(O)},O.src=d},_rgbToHex(d,b,O){return((1<<24)+(d<<16)+(b<<8)+O).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,v);var b=parseInt(d,16);return{r:b>>16&255,g:b>>8&255,b:b&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=S+d;return f+d},getRGB(d){var b;return d in m?(b=m[d],{r:b[0],g:b[1],b:b[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===E?(b=p.exec(d.replace(/ /g,"")),{r:parseInt(b[1],10),g:parseInt(b[2],10),b:parseInt(b[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 b=m[d.toLowerCase()];return b?{r:b[0],g:b[1],b:b[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var b=d.split(/ *, */).map(Number);return{r:b[0],g:b[1],b:b[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var b=d.split(/ *, */).map((O,P)=>O.slice(-1)==="%"?P===3?parseInt(O)/100:parseInt(O)/100*255:Number(O));return{r:b[0],g:b[1],b:b[2],a:b[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[b,...O]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),P=Number(O[0])/360,x=Number(O[1])/100,w=Number(O[2])/100;let T,k,A;if(x===0)return A=w*255,{r:Math.round(A),g:Math.round(A),b:Math.round(A),a:1};w<.5?T=w*(1+x):T=w+x-w*x;const R=2*w-T,F=[0,0,0];for(let H=0;H<3;H++)k=P+1/3*-(H-1),k<0&&k++,k>1&&k--,6*k<1?A=R+(T-R)*6*k:2*k<1?A=T:3*k<2?A=R+(T-R)*(2/3-k)*6:A=R,F[H]=A*255;return{r:Math.round(F[0]),g:Math.round(F[1]),b:Math.round(F[2]),a:1}}},haveIntersection(d,b){return!(b.x>d.x+d.width||b.x+b.width<d.x||b.y>d.y+d.height||b.y+b.height<d.y)},cloneObject(d){var b={};for(var O in d)this._isPlainObject(d[O])?b[O]=this.cloneObject(d[O]):this._isArray(d[O])?b[O]=this.cloneArray(d[O]):b[O]=d[O];return b},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(h+d)},error(d){console.error(h+d)},warn(d){t.Konva.showWarnings&&console.warn(_+d)},each(d,b){for(var O in d)b(O,d[O])},_inRange(d,b,O){return b<=d&&d<O},_getProjectionToSegment(d,b,O,P,x,w){var T,k,A,R=(d-O)*(d-O)+(b-P)*(b-P);if(R==0)T=d,k=b,A=(x-O)*(x-O)+(w-P)*(w-P);else{var F=((x-d)*(O-d)+(w-b)*(P-b))/R;F<0?(T=d,k=b,A=(d-x)*(d-x)+(b-w)*(b-w)):F>1?(T=O,k=P,A=(O-x)*(O-x)+(P-w)*(P-w)):(T=d+F*(O-d),k=b+F*(P-b),A=(T-x)*(T-x)+(k-w)*(k-w))}return[T,k,A]},_getProjectionToLine(d,b,O){var P=e.Util.cloneObject(d),x=Number.MAX_VALUE;return b.forEach(function(w,T){if(!(!O&&T===b.length-1)){var k=b[(T+1)%b.length],A=e.Util._getProjectionToSegment(w.x,w.y,k.x,k.y,d.x,d.y),R=A[0],F=A[1],H=A[2];H<x&&(P.x=R,P.y=F,x=H)}}),P},_prepareArrayForTween(d,b,O){var P,x=[],w=[];if(d.length>b.length){var T=b;b=d,d=T}for(P=0;P<d.length;P+=2)x.push({x:d[P],y:d[P+1]});for(P=0;P<b.length;P+=2)w.push({x:b[P],y:b[P+1]});var k=[];return w.forEach(function(A){var R=e.Util._getProjectionToLine(A,x,O);k.push(R.x),k.push(R.y)}),k},_prepareToStringify(d){var b;d.visitedByCircularReferenceRemoval=!0;for(var O in d)if(d.hasOwnProperty(O)&&d[O]&&typeof d[O]=="object"){if(b=Object.getOwnPropertyDescriptor(d,O),d[O].visitedByCircularReferenceRemoval||e.Util._isElement(d[O]))if(b.configurable)delete d[O];else return null;else if(e.Util._prepareToStringify(d[O])===null)if(b.configurable)delete d[O];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,b){for(var O in b)d[O]=b[O];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(b=>{b.width=0,b.height=0})},drawRoundedRectPath(d,b,O,P){let x=0,w=0,T=0,k=0;typeof P=="number"?x=w=T=k=Math.min(P,b/2,O/2):(x=Math.min(P[0]||0,b/2,O/2),w=Math.min(P[1]||0,b/2,O/2),k=Math.min(P[2]||0,b/2,O/2),T=Math.min(P[3]||0,b/2,O/2)),d.moveTo(x,0),d.lineTo(b-w,0),d.arc(b-w,w,w,Math.PI*3/2,0,!1),d.lineTo(b,O-k),d.arc(b-k,O-k,k,0,Math.PI/2,!1),d.lineTo(T,O),d.arc(T,O-T,T,Math.PI/2,Math.PI,!1),d.lineTo(0,x),d.arc(x,x,x,Math.PI,Math.PI*3/2,!1)}}})(Xt);var Gt={},ot={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.getComponentValidator=Ge.getBooleanValidator=Ge.getNumberArrayValidator=Ge.getFunctionValidator=Ge.getStringOrGradientValidator=Ge.getStringValidator=Ge.getNumberOrAutoValidator=Ge.getNumberOrArrayOfNumbersValidator=Ge.getNumberValidator=Ge.alphaComponent=Ge.RGBComponent=void 0;const va=at,Qt=Xt;function ma(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 YC(e){return e>255?255:e<0?0:Math.round(e)}Ge.RGBComponent=YC;function KC(e){return e>1?1:e<1e-4?1e-4:e}Ge.alphaComponent=KC;function XC(){if(va.Konva.isUnminified)return function(e,t){return Qt.Util._isNumber(e)||Qt.Util.warn(ma(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Ge.getNumberValidator=XC;function ZC(e){if(va.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(ma(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Ge.getNumberOrArrayOfNumbersValidator=ZC;function QC(){if(va.Konva.isUnminified)return function(e,t){var r=Qt.Util._isNumber(e),n=e==="auto";return r||n||Qt.Util.warn(ma(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Ge.getNumberOrAutoValidator=QC;function JC(){if(va.Konva.isUnminified)return function(e,t){return Qt.Util._isString(e)||Qt.Util.warn(ma(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Ge.getStringValidator=JC;function ek(){if(va.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(ma(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Ge.getStringOrGradientValidator=ek;function tk(){if(va.Konva.isUnminified)return function(e,t){return Qt.Util._isFunction(e)||Qt.Util.warn(ma(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Ge.getFunctionValidator=tk;function rk(){if(va.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(ma(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Ge.getNumberArrayValidator=rk;function nk(){if(va.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||Qt.Util.warn(ma(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Ge.getBooleanValidator=nk;function ik(e){if(va.Konva.isUnminified)return function(t,r){return t==null||Qt.Util.isObject(t)||Qt.Util.warn(ma(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}Ge.getComponentValidator=ik;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Xt,r=Ge;var n="get",i="set";e.Factory={addGetterSetter(a,o,l,u,f){e.Factory.addGetter(a,o,l),e.Factory.addSetter(a,o,u,f),e.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){var u=n+t.Util._capitalize(o);a.prototype[u]=a.prototype[u]||function(){var f=this.attrs[o];return f===void 0?l:f}},addSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]||e.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]=function(v){return l&&v!==void 0&&v!==null&&(v=l.call(this,v,o)),this._setAttr(o,v),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var v=l.length,S=t.Util._capitalize,_=n+S(o),h=i+S(o),E,m;a.prototype[_]=function(){var y={};for(E=0;E<v;E++)m=l[E],y[m]=this.getAttr(o+S(m));return y};var p=(0,r.getComponentValidator)(l);a.prototype[h]=function(y){var g=this.attrs[o],d;u&&(y=u.call(this,y)),p&&p.call(this,y,o);for(d in y)y.hasOwnProperty(d)&&this._setAttr(o+S(d),y[d]);return y||l.forEach(b=>{this._setAttr(o+S(b),void 0)}),this._fireChangeEvent(o,g,y),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){var l=t.Util._capitalize(o),u=i+l,f=n+l;a.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(a,o,l,u){t.Util.error("Adding deprecated "+o);var f=n+t.Util._capitalize(o),v=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(v);var S=this.attrs[o];return S===void 0?l:S},e.Factory.addSetter(a,o,u,function(){t.Util.error(v)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],v=n+t.Util._capitalize(l),S=i+t.Util._capitalize(l);function _(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=_,a.prototype[v]=_,a.prototype[S]=_})},afterSetFilter(){this._filterUpToDate=!1}}})(ot);var hi={},aa={};Object.defineProperty(aa,"__esModule",{value:!0});aa.HitContext=aa.SceneContext=aa.Context=void 0;const Nw=Xt,ak=at;function ok(e){var t=[],r=e.length,n=Nw.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 c5=",",lk="(",sk=")",uk="([",ck="])",fk=";",dk="()",hk="=",f5=["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"],pk=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const gk=100;class Gh{constructor(t){this.canvas=t,ak.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+=dk:Nw.Util._isArray(f[0])?a+=uk+f.join(c5)+ck:(r&&(f=f.map(v=>typeof v=="number"?Math.floor(v):v)),a+=lk+f.join(c5)+sk)):(a+=l.property,t||(a+=hk+l.val)),a+=fk;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=gk&&r.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var r=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(t){const r=t.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(t){var r=t.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(t){const r=t.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(t,r){this._context[t]=r}arc(t,r,n,i,a,o){this._context.arc(t,r,n,i,a,o)}arcTo(t,r,n,i,a){this._context.arcTo(t,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(t,r,n,i,a,o){this._context.bezierCurveTo(t,r,n,i,a,o)}clearRect(t,r,n,i){this._context.clearRect(t,r,n,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,r){var n=arguments;if(n.length===2)return this._context.createImageData(t,r);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,r,n,i){return this._context.createLinearGradient(t,r,n,i)}createPattern(t,r){return this._context.createPattern(t,r)}createRadialGradient(t,r,n,i,a,o){return this._context.createRadialGradient(t,r,n,i,a,o)}drawImage(t,r,n,i,a,o,l,u,f){var v=arguments,S=this._context;v.length===3?S.drawImage(t,r,n):v.length===5?S.drawImage(t,r,n,i,a):v.length===9&&S.drawImage(t,r,n,i,a,o,l,u,f)}ellipse(t,r,n,i,a,o,l,u){this._context.ellipse(t,r,n,i,a,o,l,u)}isPointInPath(t,r,n,i){return n?this._context.isPointInPath(n,t,r,i):this._context.isPointInPath(t,r,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,r,n,i){this._context.fillRect(t,r,n,i)}strokeRect(t,r,n,i){this._context.strokeRect(t,r,n,i)}fillText(t,r,n,i){i?this._context.fillText(t,r,n,i):this._context.fillText(t,r,n)}measureText(t){return this._context.measureText(t)}getImageData(t,r,n,i){return this._context.getImageData(t,r,n,i)}lineTo(t,r){this._context.lineTo(t,r)}moveTo(t,r){this._context.moveTo(t,r)}rect(t,r,n,i){this._context.rect(t,r,n,i)}roundRect(t,r,n,i,a){this._context.roundRect(t,r,n,i,a)}putImageData(t,r,n){this._context.putImageData(t,r,n)}quadraticCurveTo(t,r,n,i){this._context.quadraticCurveTo(t,r,n,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,r){this._context.scale(t,r)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,r,n,i,a,o){this._context.setTransform(t,r,n,i,a,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,r,n,i){this._context.strokeText(t,r,n,i)}transform(t,r,n,i,a,o){this._context.transform(t,r,n,i,a,o)}translate(t,r){this._context.translate(t,r)}_enableTrace(){var t=this,r=f5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=ok(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(f5[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)}}aa.Context=Gh;pk.forEach(function(e){Object.defineProperty(Gh.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class vk extends Gh{constructor(t,{willReadFrequently:r=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(t){var r=t.fill();this.setAttr("fillStyle",r),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var r=t._getLinearGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fillRadialGradient(t){const r=t._getRadialGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fill(t){const r=t.fill(),n=t.getFillPriority();if(r&&n==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(t);return}const a=t.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}r?this._fillColor(t):i?this._fillPattern(t):a?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const r=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(var o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(t){var r=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),r&&t.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=t.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var r,n,i,a=(r=t.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,l=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=t.getAbsoluteScale(),f=this.canvas.getPixelRatio(),v=u.x*f,S=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(v),Math.abs(S))),this.setAttr("shadowOffsetX",l.x*v),this.setAttr("shadowOffsetY",l.y*S)}}aa.SceneContext=vk;class mk extends Gh{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()}}}aa.HitContext=mk;Object.defineProperty(hi,"__esModule",{value:!0});hi.HitCanvas=hi.SceneCanvas=hi.Canvas=void 0;const sh=Xt,Iw=aa,jw=at,yk=ot,bk=Ge;var id;function _k(){if(id)return id;var e=sh.Util.createCanvasElement(),t=e.getContext("2d");return id=function(){var r=jw.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),sh.Util.releaseCanvas(e),id}class Vh{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||jw.Konva.pixelRatio||_k();this.pixelRatio=n,this._canvas=sh.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 sh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}hi.Canvas=Vh;yk.Factory.addGetterSetter(Vh,"pixelRatio",void 0,(0,bk.getNumberValidator)());class wk extends Vh{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new Iw.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}hi.SceneCanvas=wk;class Sk extends Vh{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new Iw.HitContext(this),this.setSize(t.width,t.height)}}hi.HitCanvas=Sk;var qh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=at,r=Xt;e.DD={get isDragging(){var n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const f=u._changedPointerPositions.find(_=>_.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var v=l.dragDistance(),S=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(S<v||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(v=>v.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const f=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(qh);Object.defineProperty(Gt,"__esModule",{value:!0});Gt.Node=void 0;const st=Xt,Mc=ot,wu=hi,Lo=at,zn=qh,rr=Ge;var Pd="absoluteOpacity",ad="allEventListeners",Zi="absoluteTransform",d5="absoluteScale",No="canvas",Ek="Change",Ok="children",Pk="konva",zv="listening",h5="mouseenter",p5="mouseleave",g5="set",v5="Shape",xd=" ",m5="stage",Ia="transform",xk="Stage",Bv="visible",Ck=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(xd);let kk=1,nt=class Uv{constructor(t){this._id=kk++,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===Ia||t===Zi)&&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===Ia||t===Zi,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(xd);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(No)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Zi&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(No)){const{scene:t,filter:r,hit:n}=this._cache.get(No);st.Util.releaseCanvas(t,r,n),this._cache.delete(No)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var r=t||{},n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,l=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,f=r.offset||0,v=r.drawBorder||!1,S=r.hitCanvasPixelRatio||1;if(!i||!a){st.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const _=Math.abs(Math.round(n.x)-l)>.5?1:0,h=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+_,a+=f*2+h,l-=f,u-=f;var E=new wu.SceneCanvas({pixelRatio:o,width:i,height:a}),m=new wu.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),p=new wu.HitCanvas({pixelRatio:S,width:i,height:a}),y=E.getContext(),g=p.getContext();return p.isCache=!0,E.isCache=!0,this._cache.delete(No),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(E.getContext()._context.imageSmoothingEnabled=!1,m.getContext()._context.imageSmoothingEnabled=!1),y.save(),g.save(),y.translate(-l,-u),g.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Pd),this._clearSelfAndDescendantCache(d5),this.drawScene(E,this),this.drawHit(p,this),this._isUnderCache=!1,y.restore(),g.restore(),v&&(y.save(),y.beginPath(),y.rect(0,0,i,a),y.closePath(),y.setAttr("strokeStyle","red"),y.setAttr("lineWidth",5),y.stroke(),y.restore()),this._cache.set(No,{scene:E,filter:m,hit:p,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(No)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,r){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i=1/0,a=1/0,o=-1/0,l=-1/0,u=this.getAbsoluteTransform(r);return n.forEach(function(f){var v=u.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();t.translate(r.x,r.y);var n=this._getCachedSceneCanvas(),i=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/i,n.height/i),t.restore()}_drawCachedHitCanvas(t){var r=this._getCanvasCache(),n=r.hit;t.save(),t.translate(r.x,r.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,l,u,f;if(t){if(!this._filterUpToDate){var v=n.pixelRatio;i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=t.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/v,n.getHeight()/v),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){st.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),a.putImageData(l,0,0)}}catch(S){st.Util.error("Unable to apply filter. "+S.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return n}on(t,r){if(this._cache&&this._cache.delete(ad),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(xd),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(xd),i=n.length,a,o,l,u,f,v;if(this._cache&&this._cache.delete(ad),!t)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(l=n[a],u=l.split("."),f=u[0],v=u[1],f)this.eventListeners[f]&&this._off(f,v,r);else for(o in this.eventListeners)this._off(o,v,r);return this}dispatchEvent(t){var r={target:this,type:t.type,evt:t};return this.fire(t.type,r),this}addEventListener(t,r){return this.on(t,function(n){r.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,r,n){var i=this;this.on(t,function(a){for(var o=a.target.findAncestors(r,!0,i),l=0;l<o.length;l++)a=st.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),zn.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Zi),this._clearSelfAndDescendantCache(Pd),this._clearSelfAndDescendantCache(d5),this._clearSelfAndDescendantCache(m5),this._clearSelfAndDescendantCache(Bv),this._clearSelfAndDescendantCache(zv)}_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"+st.Util._capitalize(t);return st.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!==Ok&&(n=g5+st.Util._capitalize(r),st.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(zv,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(Bv,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;zn.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!Lo.Konva.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),r=this,n=0,i,a,o,l;function u(v){for(i=[],a=v.length,o=0;o<a;o++)l=v[o],n++,l.nodeType!==v5&&(i=i.concat(l.getChildren().slice())),l._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=t&&u(i)}const f=this.getStage();return r.nodeType!==xk&&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(Ia),this._clearSelfAndDescendantCache(Zi)),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 st.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(Ia);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(Ia),this._clearSelfAndDescendantCache(Zi),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 st.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 st.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 st.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 st.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 st.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&st.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(Pd,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=st.Util.isObject(n)&&!st.Util._isPlainObject(n)&&!st.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 st.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],st.Util.isValidSelector(a)||(st.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),st.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),st.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(m5,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(Zi,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new st.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(Zi)||new st.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(Ia,this._getTransform)}_getTransform(){var t,r,n=this._cache.get(Ia)||new st.Transform;n.reset();var i=this.x(),a=this.y(),o=Lo.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,f=this.attrs.skewX||0,v=this.attrs.skewY||0,S=this.attrs.offsetX||0,_=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||v!==0)&&n.skew(f,v),(l!==1||u!==1)&&n.scale(l,u),(S!==0||_!==0)&&n.translate(-1*S,-1*_),n.dirty=!1,n}clone(t){var r=st.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(Pk)<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 wu.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 wu.SceneCanvas({width:l.width,height:l.height,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,st.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():Lo.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+Ek,{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[g5+st.Util._capitalize(t)];return st.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(Lo.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!st.Util.isObject(r)||(r==null?delete this.attrs[t]:this.attrs[t]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,r),this._requestDraw())}_setComponentAttr(t,r,n){var i;n!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][r]=n,this._fireChangeEvent(t,i,n))}_fireAndBubble(t,r,n){r&&this.nodeType===v5&&(r.target=this);var i=(t===h5||t===p5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===h5||t===p5)&&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(ad))!==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(ad,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;zn.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){zn.DD._dragElements.has(this._id)||this._createDragElement(t);const n=zn.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:st.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=zn.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),zn.DD._endDragBefore(t),zn.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=zn.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||Lo.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;zn.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=zn.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&zn.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 st.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return st.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=Uv.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),Lo.Konva[n]||(st.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Lo.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(Uv._createNode(i[l]));return a}};Gt.Node=nt;nt.prototype.nodeType="Node";nt.prototype._attrsAffectingSize=[];nt.prototype.eventListeners={};nt.prototype.on.call(nt.prototype,Ck,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Ia),this._clearSelfAndDescendantCache(Zi)});nt.prototype.on.call(nt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Bv)});nt.prototype.on.call(nt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(zv)});nt.prototype.on.call(nt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Pd)});const Rt=Mc.Factory.addGetterSetter;Rt(nt,"zIndex");Rt(nt,"absolutePosition");Rt(nt,"position");Rt(nt,"x",0,(0,rr.getNumberValidator)());Rt(nt,"y",0,(0,rr.getNumberValidator)());Rt(nt,"globalCompositeOperation","source-over",(0,rr.getStringValidator)());Rt(nt,"opacity",1,(0,rr.getNumberValidator)());Rt(nt,"name","",(0,rr.getStringValidator)());Rt(nt,"id","",(0,rr.getStringValidator)());Rt(nt,"rotation",0,(0,rr.getNumberValidator)());Mc.Factory.addComponentsGetterSetter(nt,"scale",["x","y"]);Rt(nt,"scaleX",1,(0,rr.getNumberValidator)());Rt(nt,"scaleY",1,(0,rr.getNumberValidator)());Mc.Factory.addComponentsGetterSetter(nt,"skew",["x","y"]);Rt(nt,"skewX",0,(0,rr.getNumberValidator)());Rt(nt,"skewY",0,(0,rr.getNumberValidator)());Mc.Factory.addComponentsGetterSetter(nt,"offset",["x","y"]);Rt(nt,"offsetX",0,(0,rr.getNumberValidator)());Rt(nt,"offsetY",0,(0,rr.getNumberValidator)());Rt(nt,"dragDistance",null,(0,rr.getNumberValidator)());Rt(nt,"width",0,(0,rr.getNumberValidator)());Rt(nt,"height",0,(0,rr.getNumberValidator)());Rt(nt,"listening",!0,(0,rr.getBooleanValidator)());Rt(nt,"preventDefault",!0,(0,rr.getBooleanValidator)());Rt(nt,"filters",null,function(e){return this._filterUpToDate=!1,e});Rt(nt,"visible",!0,(0,rr.getBooleanValidator)());Rt(nt,"transformsEnabled","all",(0,rr.getStringValidator)());Rt(nt,"size");Rt(nt,"dragBoundFunc");Rt(nt,"draggable",!1,(0,rr.getBooleanValidator)());Mc.Factory.backCompat(nt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var cl={};Object.defineProperty(cl,"__esModule",{value:!0});cl.Container=void 0;const zs=ot,L1=Gt,Wh=Ge;class fl extends L1.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=L1.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=L1.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(t){var r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&r.push(n)}),r}_clearSelfAndDescendantCache(t){var r;super._clearSelfAndDescendantCache(t),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(t,r,n){var i=this.getLayer(),a=t||i&&i.getCanvas(),o=a&&a.getContext(),l=this._getCanvasCache(),u=l&&l.scene,f=a&&a.isCache;if(!this.isVisible()&&!f)return this;if(u){o.save();var v=this.getAbsoluteTransform(r).getMatrix();o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(t,r){if(!this.shouldDrawHit(r))return this;var n=this.getLayer(),i=t||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.hit;if(l){a.save();var u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(t,r,n,i){var a,o=r&&r.getContext(),l=this.clipWidth(),u=this.clipHeight(),f=this.clipFunc(),v=l&&u||f;const S=n===this;if(v){o.save();var _=this.getAbsoluteTransform(n),h=_.getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),o.beginPath();let y;if(f)y=f.call(this,o,this);else{var E=this.clipX(),m=this.clipY();o.rect(E,m,l,u)}o.clip.apply(o,y),h=_.copy().invert().getMatrix(),o.transform(h[0],h[1],h[2],h[3],h[4],h[5])}var p=!S&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";p&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(y){y[t](r,n,i)}),p&&o.restore(),v&&o.restore()}getClientRect(t={}){var r,n=t.skipTransform,i=t.relativeTo,a,o,l,u,f={x:1/0,y:1/0,width:0,height:0},v=this;(r=this.children)===null||r===void 0||r.forEach(function(m){if(m.visible()){var p=m.getClientRect({relativeTo:v,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 S=this.find("Shape"),_=!1,h=0;h<S.length;h++){var E=S[h];if(E._isVisible(this)){_=!0;break}}return _&&a!==void 0?f={x:a,y:o,width:l-a,height:u-o}:f={x:0,y:0,width:0,height:0},n?f:this._transformedRect(f,i)}}cl.Container=fl;zs.Factory.addComponentsGetterSetter(fl,"clip",["x","y","width","height"]);zs.Factory.addGetterSetter(fl,"clipX",void 0,(0,Wh.getNumberValidator)());zs.Factory.addGetterSetter(fl,"clipY",void 0,(0,Wh.getNumberValidator)());zs.Factory.addGetterSetter(fl,"clipWidth",void 0,(0,Wh.getNumberValidator)());zs.Factory.addGetterSetter(fl,"clipHeight",void 0,(0,Wh.getNumberValidator)());zs.Factory.addGetterSetter(fl,"clipFunc");var Dw={},En={};Object.defineProperty(En,"__esModule",{value:!0});En.releaseCapture=En.setPointerCapture=En.hasPointerCapture=En.createEvent=En.getCapturedShape=void 0;const Tk=at,cc=new Map,Fw=Tk.Konva._global.PointerEvent!==void 0;function Ak(e){return cc.get(e)}En.getCapturedShape=Ak;function gy(e){return{evt:e,pointerId:e.pointerId}}En.createEvent=gy;function Rk(e,t){return cc.get(e)===t}En.hasPointerCapture=Rk;function Mk(e,t){zw(e),t.getStage()&&(cc.set(e,t),Fw&&t._fire("gotpointercapture",gy(new PointerEvent("gotpointercapture"))))}En.setPointerCapture=Mk;function zw(e,t){const r=cc.get(e);if(!r)return;const n=r.getStage();n&&n.content,cc.delete(e),Fw&&r._fire("lostpointercapture",gy(new PointerEvent("lostpointercapture")))}En.releaseCapture=zw;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Xt,r=ot,n=cl,i=at,a=hi,o=qh,l=at,u=En;var f="Stage",v="string",S="px",_="mouseout",h="mouseleave",E="mouseover",m="mouseenter",p="mousemove",y="mousedown",g="mouseup",d="pointermove",b="pointerdown",O="pointerup",P="pointercancel",x="lostpointercapture",w="pointerout",T="pointerleave",k="pointerover",A="pointerenter",R="contextmenu",F="touchstart",H="touchend",Y="touchmove",$="touchcancel",I="wheel",U=5,W=[[m,"_pointerenter"],[y,"_pointerdown"],[p,"_pointermove"],[g,"_pointerup"],[h,"_pointerleave"],[F,"_pointerdown"],[Y,"_pointermove"],[H,"_pointerup"],[$,"_pointercancel"],[E,"_pointerover"],[I,"_wheel"],[R,"_contextmenu"],[b,"_pointerdown"],[d,"_pointermove"],[O,"_pointerup"],[P,"_pointercancel"],[x,"_lostpointercapture"]];const M={mouse:{[w]:_,[T]:h,[k]:E,[A]:m,[d]:p,[b]:y,[O]:g,[P]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[w]:"touchout",[T]:"touchleave",[k]:"touchover",[A]:"touchenter",[d]:Y,[b]:F,[O]:H,[P]:$,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[w]:w,[T]:T,[k]:k,[A]:A,[d]:d,[b]:b,[O]:O,[P]:P,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},j=q=>q.indexOf("pointer")>=0?"pointer":q.indexOf("touch")>=0?"touch":"mouse",B=q=>{const z=j(q);if(z==="pointer")return i.Konva.pointerEventsEnabled&&M.pointer;if(z==="touch")return M.touch;if(z==="mouse")return M.mouse};function N(q={}){return(q.clipFunc||q.clipWidth||q.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),q}const G="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class K extends n.Container{constructor(z){super(N(z)),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",()=>{N(this.attrs)}),this._checkVisibility()}_validateAdd(z){const X=z.getType()==="Layer",Z=z.getType()==="FastLayer";X||Z||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const z=this.visible()?"":"none";this.content.style.display=z}setContainer(z){if(typeof z===v){if(z.charAt(0)==="."){var X=z.slice(1);z=document.getElementsByClassName(X)[0]}else{var Z;z.charAt(0)!=="#"?Z=z:Z=z.slice(1),z=document.getElementById(Z)}if(!z)throw"Can not find container in document with id "+Z}return this._setAttr("container",z),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),z.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var z=this.children,X=z.length,Z;for(Z=0;Z<X;Z++)z[Z].clear();return this}clone(z){return z||(z={}),z.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,z)}destroy(){super.destroy();var z=this.content;z&&t.Util._isInDocument(z)&&this.container().removeChild(z);var X=e.stages.indexOf(this);return X>-1&&e.stages.splice(X,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const z=this._pointerPositions[0]||this._changedPointerPositions[0];return z?{x:z.x,y:z.y}:(t.Util.warn(G),null)}_getPointerById(z){return this._pointerPositions.find(X=>X.id===z)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(z){z=z||{},z.x=z.x||0,z.y=z.y||0,z.width=z.width||this.width(),z.height=z.height||this.height();var X=new a.SceneCanvas({width:z.width,height:z.height,pixelRatio:z.pixelRatio||1}),Z=X.getContext()._context,J=this.children;return(z.x||z.y)&&Z.translate(-1*z.x,-1*z.y),J.forEach(function(te){if(te.isVisible()){var ee=te._toKonvaCanvas(z);Z.drawImage(ee._canvas,z.x,z.y,ee.getWidth()/ee.getPixelRatio(),ee.getHeight()/ee.getPixelRatio())}}),X}getIntersection(z){if(!z)return null;var X=this.children,Z=X.length,J=Z-1,te;for(te=J;te>=0;te--){const ee=X[te].getIntersection(z);if(ee)return ee}return null}_resizeDOM(){var z=this.width(),X=this.height();this.content&&(this.content.style.width=z+S,this.content.style.height=X+S),this.bufferCanvas.setSize(z,X),this.bufferHitCanvas.setSize(z,X),this.children.forEach(Z=>{Z.setSize({width:z,height:X}),Z.draw()})}add(z,...X){if(arguments.length>1){for(var Z=0;Z<arguments.length;Z++)this.add(arguments[Z]);return this}super.add(z);var J=this.children.length;return J>U&&t.Util.warn("The stage has "+J+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),z.setSize({width:this.width(),height:this.height()}),z.draw(),i.Konva.isBrowser&&this.content.appendChild(z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(z){return u.hasPointerCapture(z,this)}setPointerCapture(z){u.setPointerCapture(z,this)}releaseCapture(z){u.releaseCapture(z,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&W.forEach(([z,X])=>{this.content.addEventListener(z,Z=>{this[X](Z)},{passive:!1})})}_pointerenter(z){this.setPointersPositions(z);const X=B(z.type);X&&this._fire(X.pointerenter,{evt:z,target:this,currentTarget:this})}_pointerover(z){this.setPointersPositions(z);const X=B(z.type);X&&this._fire(X.pointerover,{evt:z,target:this,currentTarget:this})}_getTargetShape(z){let X=this[z+"targetShape"];return X&&!X.getStage()&&(X=null),X}_pointerleave(z){const X=B(z.type),Z=j(z.type);if(X){this.setPointersPositions(z);var J=this._getTargetShape(Z),te=!o.DD.isDragging||i.Konva.hitOnDragEnabled;J&&te?(J._fireAndBubble(X.pointerout,{evt:z}),J._fireAndBubble(X.pointerleave,{evt:z}),this._fire(X.pointerleave,{evt:z,target:this,currentTarget:this}),this[Z+"targetShape"]=null):te&&(this._fire(X.pointerleave,{evt:z,target:this,currentTarget:this}),this._fire(X.pointerout,{evt:z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(z){const X=B(z.type),Z=j(z.type);if(X){this.setPointersPositions(z);var J=!1;this._changedPointerPositions.forEach(te=>{var ee=this.getIntersection(te);if(o.DD.justDragged=!1,i.Konva["_"+Z+"ListenClick"]=!0,!ee||!ee.isListening())return;i.Konva.capturePointerEventsEnabled&&ee.setPointerCapture(te.id),this[Z+"ClickStartShape"]=ee,ee._fireAndBubble(X.pointerdown,{evt:z,pointerId:te.id}),J=!0;const se=z.type.indexOf("touch")>=0;ee.preventDefault()&&z.cancelable&&se&&z.preventDefault()}),J||this._fire(X.pointerdown,{evt:z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(z){const X=B(z.type),Z=j(z.type);if(!X)return;o.DD.isDragging&&o.DD.node.preventDefault()&&z.cancelable&&z.preventDefault(),this.setPointersPositions(z);var J=!o.DD.isDragging||i.Konva.hitOnDragEnabled;if(!J)return;var te={};let ee=!1;var se=this._getTargetShape(Z);this._changedPointerPositions.forEach(de=>{const he=u.getCapturedShape(de.id)||this.getIntersection(de),ke=de.id,Ie={evt:z,pointerId:ke};var ue=se!==he;if(ue&&se&&(se._fireAndBubble(X.pointerout,{...Ie},he),se._fireAndBubble(X.pointerleave,{...Ie},he)),he){if(te[he._id])return;te[he._id]=!0}he&&he.isListening()?(ee=!0,ue&&(he._fireAndBubble(X.pointerover,{...Ie},se),he._fireAndBubble(X.pointerenter,{...Ie},se),this[Z+"targetShape"]=he),he._fireAndBubble(X.pointermove,{...Ie})):se&&(this._fire(X.pointerover,{evt:z,target:this,currentTarget:this,pointerId:ke}),this[Z+"targetShape"]=null)}),ee||this._fire(X.pointermove,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(z){const X=B(z.type),Z=j(z.type);if(!X)return;this.setPointersPositions(z);const J=this[Z+"ClickStartShape"],te=this[Z+"ClickEndShape"];var ee={};let se=!1;this._changedPointerPositions.forEach(de=>{const he=u.getCapturedShape(de.id)||this.getIntersection(de);if(he){if(he.releaseCapture(de.id),ee[he._id])return;ee[he._id]=!0}const ke=de.id,Ie={evt:z,pointerId:ke};let ue=!1;i.Konva["_"+Z+"InDblClickWindow"]?(ue=!0,clearTimeout(this[Z+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+Z+"InDblClickWindow"]=!0,clearTimeout(this[Z+"DblTimeout"])),this[Z+"DblTimeout"]=setTimeout(function(){i.Konva["_"+Z+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),he&&he.isListening()?(se=!0,this[Z+"ClickEndShape"]=he,he._fireAndBubble(X.pointerup,{...Ie}),i.Konva["_"+Z+"ListenClick"]&&J&&J===he&&(he._fireAndBubble(X.pointerclick,{...Ie}),ue&&te&&te===he&&he._fireAndBubble(X.pointerdblclick,{...Ie}))):(this[Z+"ClickEndShape"]=null,i.Konva["_"+Z+"ListenClick"]&&this._fire(X.pointerclick,{evt:z,target:this,currentTarget:this,pointerId:ke}),ue&&this._fire(X.pointerdblclick,{evt:z,target:this,currentTarget:this,pointerId:ke}))}),se||this._fire(X.pointerup,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+Z+"ListenClick"]=!1,z.cancelable&&Z!=="touch"&&z.preventDefault()}_contextmenu(z){this.setPointersPositions(z);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(R,{evt:z}):this._fire(R,{evt:z,target:this,currentTarget:this})}_wheel(z){this.setPointersPositions(z);var X=this.getIntersection(this.getPointerPosition());X&&X.isListening()?X._fireAndBubble(I,{evt:z}):this._fire(I,{evt:z,target:this,currentTarget:this})}_pointercancel(z){this.setPointersPositions(z);const X=u.getCapturedShape(z.pointerId)||this.getIntersection(this.getPointerPosition());X&&X._fireAndBubble(O,u.createEvent(z)),u.releaseCapture(z.pointerId)}_lostpointercapture(z){u.releaseCapture(z.pointerId)}setPointersPositions(z){var X=this._getContentPosition(),Z=null,J=null;z=z||window.event,z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(z.touches,te=>{this._pointerPositions.push({id:te.identifier,x:(te.clientX-X.left)/X.scaleX,y:(te.clientY-X.top)/X.scaleY})}),Array.prototype.forEach.call(z.changedTouches||z.touches,te=>{this._changedPointerPositions.push({id:te.identifier,x:(te.clientX-X.left)/X.scaleX,y:(te.clientY-X.top)/X.scaleY})})):(Z=(z.clientX-X.left)/X.scaleX,J=(z.clientY-X.top)/X.scaleY,this.pointerPos={x:Z,y:J},this._pointerPositions=[{x:Z,y:J,id:t.Util._getFirstPointerId(z)}],this._changedPointerPositions=[{x:Z,y:J,id:t.Util._getFirstPointerId(z)}])}_setPointerPosition(z){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(z)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var z=this.content.getBoundingClientRect();return{top:z.top,left:z.left,scaleX:z.width/this.content.clientWidth||1,scaleY:z.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 z=this.container();if(!z)throw"Stage has no container. A container is required.";z.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"),z.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(z){z.batchDraw()}),this}}e.Stage=K,K.prototype.nodeType=f,(0,l._registerNode)(K),r.Factory.addGetterSetter(K,"container")})(Dw);var Lc={},pr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=at,r=Xt,n=ot,i=Gt,a=Ge,o=at,l=En;var u="hasShadow",f="shadowRGBA",v="patternImage",S="linearGradient",_="radialGradient";let h;function E(){return h||(h=r.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function m(T){const k=this.attrs.fillRule;k?T.fill(k):T.fill()}function p(T){T.stroke()}function y(T){T.fill()}function g(T){T.stroke()}function d(){this._clearCache(u)}function b(){this._clearCache(f)}function O(){this._clearCache(v)}function P(){this._clearCache(S)}function x(){this._clearCache(_)}class w extends i.Node{constructor(k){super(k);let A;for(;A=r.Util.getRandomColor(),!(A&&!(A in e.shapes)););this.colorKey=A,e.shapes[A]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(v,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var k=E();const A=k.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(A&&A.setTransform){const R=new r.Transform;R.translate(this.fillPatternX(),this.fillPatternY()),R.rotate(t.Konva.getAngle(this.fillPatternRotation())),R.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),R.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const F=R.getMatrix(),H=typeof DOMMatrix>"u"?{a:F[0],b:F[1],c:F[2],d:F[3],e:F[4],f:F[5]}:new DOMMatrix(F);A.setTransform(H)}return A}}_getLinearGradient(){return this._getCache(S,this.__getLinearGradient)}__getLinearGradient(){var k=this.fillLinearGradientColorStops();if(k){for(var A=E(),R=this.fillLinearGradientStartPoint(),F=this.fillLinearGradientEndPoint(),H=A.createLinearGradient(R.x,R.y,F.x,F.y),Y=0;Y<k.length;Y+=2)H.addColorStop(k[Y],k[Y+1]);return H}}_getRadialGradient(){return this._getCache(_,this.__getRadialGradient)}__getRadialGradient(){var k=this.fillRadialGradientColorStops();if(k){for(var A=E(),R=this.fillRadialGradientStartPoint(),F=this.fillRadialGradientEndPoint(),H=A.createRadialGradient(R.x,R.y,this.fillRadialGradientStartRadius(),F.x,F.y,this.fillRadialGradientEndRadius()),Y=0;Y<k.length;Y+=2)H.addColorStop(k[Y],k[Y+1]);return H}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var k=r.Util.colorToRGBA(this.shadowColor());if(k)return"rgba("+k.r+","+k.g+","+k.b+","+k.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 k=this.hitStrokeWidth();return k==="auto"?this.hasStroke():this.strokeEnabled()&&!!k}intersects(k){var A=this.getStage();if(!A)return!1;const R=A.bufferHitCanvas;return R.getContext().clear(),this.drawHit(R,void 0,!0),R.context.getImageData(Math.round(k.x),Math.round(k.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(k){var A;if(!((A=this.attrs.perfectDrawEnabled)!==null&&A!==void 0?A:!0))return!1;const F=k||this.hasFill(),H=this.hasStroke(),Y=this.getAbsoluteOpacity()!==1;if(F&&H&&Y)return!0;const $=this.hasShadow(),I=this.shadowForStrokeEnabled();return!!(F&&H&&$&&I)}setStrokeHitEnabled(k){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),k?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var k=this.size();return{x:this._centroid?-k.width/2:0,y:this._centroid?-k.height/2:0,width:k.width,height:k.height}}getClientRect(k={}){const A=k.skipTransform,R=k.relativeTo,F=this.getSelfRect(),Y=!k.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,$=F.width+Y,I=F.height+Y,U=!k.skipShadow&&this.hasShadow(),W=U?this.shadowOffsetX():0,M=U?this.shadowOffsetY():0,j=$+Math.abs(W),B=I+Math.abs(M),N=U&&this.shadowBlur()||0,G=j+N*2,K=B+N*2,q={width:G,height:K,x:-(Y/2+N)+Math.min(W,0)+F.x,y:-(Y/2+N)+Math.min(M,0)+F.y};return A?q:this._transformedRect(q,R)}drawScene(k,A,R){var F=this.getLayer(),H=k||F.getCanvas(),Y=H.getContext(),$=this._getCanvasCache(),I=this.getSceneFunc(),U=this.hasShadow(),W,M,j=H.isCache,B=A===this;if(!this.isVisible()&&!B)return this;if($){Y.save();var N=this.getAbsoluteTransform(A).getMatrix();return Y.transform(N[0],N[1],N[2],N[3],N[4],N[5]),this._drawCachedSceneCanvas(Y),Y.restore(),this}if(!I)return this;if(Y.save(),this._useBufferCanvas()&&!j){W=this.getStage();const q=R||W.bufferCanvas;M=q.getContext(),M.clear(),M.save(),M._applyLineJoin(this);var G=this.getAbsoluteTransform(A).getMatrix();M.transform(G[0],G[1],G[2],G[3],G[4],G[5]),I.call(this,M,this),M.restore();var K=q.pixelRatio;U&&Y._applyShadow(this),Y._applyOpacity(this),Y._applyGlobalCompositeOperation(this),Y.drawImage(q._canvas,0,0,q.width/K,q.height/K)}else{if(Y._applyLineJoin(this),!B){var G=this.getAbsoluteTransform(A).getMatrix();Y.transform(G[0],G[1],G[2],G[3],G[4],G[5]),Y._applyOpacity(this),Y._applyGlobalCompositeOperation(this)}U&&Y._applyShadow(this),I.call(this,Y,this)}return Y.restore(),this}drawHit(k,A,R=!1){if(!this.shouldDrawHit(A,R))return this;var F=this.getLayer(),H=k||F.hitCanvas,Y=H&&H.getContext(),$=this.hitFunc()||this.sceneFunc(),I=this._getCanvasCache(),U=I&&I.hit;if(this.colorKey||r.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),U){Y.save();var W=this.getAbsoluteTransform(A).getMatrix();return Y.transform(W[0],W[1],W[2],W[3],W[4],W[5]),this._drawCachedHitCanvas(Y),Y.restore(),this}if(!$)return this;if(Y.save(),Y._applyLineJoin(this),!(this===A)){var j=this.getAbsoluteTransform(A).getMatrix();Y.transform(j[0],j[1],j[2],j[3],j[4],j[5])}return $.call(this,Y,this),Y.restore(),this}drawHitFromCache(k=0){var A=this._getCanvasCache(),R=this._getCachedSceneCanvas(),F=A.hit,H=F.getContext(),Y=F.getWidth(),$=F.getHeight(),I,U,W,M,j,B;H.clear(),H.drawImage(R._canvas,0,0,Y,$);try{for(I=H.getImageData(0,0,Y,$),U=I.data,W=U.length,M=r.Util._hexToRgb(this.colorKey),j=0;j<W;j+=4)B=U[j+3],B>k?(U[j]=M.r,U[j+1]=M.g,U[j+2]=M.b,U[j+3]=255):U[j+3]=0;H.putImageData(I,0,0)}catch(N){r.Util.error("Unable to draw hit graph from cached scene canvas. "+N.message)}return this}hasPointerCapture(k){return l.hasPointerCapture(k,this)}setPointerCapture(k){l.setPointerCapture(k,this)}releaseCapture(k){l.releaseCapture(k,this)}}e.Shape=w,w.prototype._fillFunc=m,w.prototype._strokeFunc=p,w.prototype._fillFuncHit=y,w.prototype._strokeFuncHit=g,w.prototype._centroid=!1,w.prototype.nodeType="Shape",(0,o._registerNode)(w),w.prototype.eventListeners={},w.prototype.on.call(w.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),w.prototype.on.call(w.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",b),w.prototype.on.call(w.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",O),w.prototype.on.call(w.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",P),w.prototype.on.call(w.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",x),n.Factory.addGetterSetter(w,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(w,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(w,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(w,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(w,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(w,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(w,"lineJoin"),n.Factory.addGetterSetter(w,"lineCap"),n.Factory.addGetterSetter(w,"sceneFunc"),n.Factory.addGetterSetter(w,"hitFunc"),n.Factory.addGetterSetter(w,"dash"),n.Factory.addGetterSetter(w,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(w,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(w,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(w,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternImage"),n.Factory.addGetterSetter(w,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(w,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(w,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(w,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(w,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(w,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(w,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(w,"fillEnabled",!0),n.Factory.addGetterSetter(w,"strokeEnabled",!0),n.Factory.addGetterSetter(w,"shadowEnabled",!0),n.Factory.addGetterSetter(w,"dashEnabled",!0),n.Factory.addGetterSetter(w,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(w,"fillPriority","color"),n.Factory.addComponentsGetterSetter(w,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(w,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(w,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(w,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(w,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(w,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(w,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(w,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(w,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(w,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(w,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(w,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(w,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(w,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(w,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(w,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(w,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(w,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(w,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(w,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(w,"fillPatternRotation",0),n.Factory.addGetterSetter(w,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(w,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(pr);Object.defineProperty(Lc,"__esModule",{value:!0});Lc.Layer=void 0;const Xi=Xt,N1=cl,Bl=Gt,vy=ot,y5=hi,Lk=Ge,Nk=pr,Ik=at;var jk="#",Dk="beforeDraw",Fk="draw",Bw=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],zk=Bw.length;let Bs=class extends N1.Container{constructor(t){super(t),this.canvas=new y5.SceneCanvas,this.hitCanvas=new y5.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(){Bl.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=Bl.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(Bl.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(Bl.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 Bl.Node.prototype.remove.call(this),t&&t.parentNode&&Xi.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"&&Xi.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(),Bl.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(){Xi.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Xi.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Xi.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<zk;i++){const a=Bw[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=Xi.Util._rgbToHex(n[0],n[1],n[2]),o=Nk.shapes[jk+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(Dk,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),N1.Container.prototype.drawScene.call(this,i,r),this._fire(Fk,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),N1.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){Xi.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Xi.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 Xi.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Lc.Layer=Bs;Bs.prototype.nodeType="Layer";(0,Ik._registerNode)(Bs);vy.Factory.addGetterSetter(Bs,"imageSmoothingEnabled",!0);vy.Factory.addGetterSetter(Bs,"clearBeforeDraw",!0);vy.Factory.addGetterSetter(Bs,"hitGraphEnabled",!0,(0,Lk.getBooleanValidator)());var Yh={};Object.defineProperty(Yh,"__esModule",{value:!0});Yh.FastLayer=void 0;const Bk=Xt,Uk=Lc,Hk=at;let my=class extends Uk.Layer{constructor(t){super(t),this.listening(!1),Bk.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};Yh.FastLayer=my;my.prototype.nodeType="FastLayer";(0,Hk._registerNode)(my);var Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.Group=void 0;const $k=Xt,Gk=cl,Vk=at;let yy=class extends Gk.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&$k.Util.throw("You may only add groups and shapes to groups.")}};Us.Group=yy;yy.prototype.nodeType="Group";(0,Vk._registerNode)(yy);var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.Animation=void 0;const I1=at,b5=Xt,j1=function(){return I1.glob.performance&&I1.glob.performance.now?function(){return I1.glob.performance.now()}:function(){return new Date().getTime()}}();class Ni{constructor(t,r){this.id=Ni.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:j1(),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=Ni.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=j1(),Ni._addAnimation(this),this}stop(){return Ni._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(j1());const l=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let f=0;f<l;f++){const v=a[f];v._id!==void 0&&(t[v._id]=v)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=Ni;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))}}Hs.Animation=Ni;Ni.animations=[];Ni.animIdCounter=0;Ni.animRunning=!1;var Uw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Xt,r=Hs,n=Gt,i=at;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,v=["fill","stroke","shadowColor"];class S{constructor(E,m,p,y,g,d,b){this.prop=E,this.propFunc=m,this.begin=y,this._pos=y,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=b,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=p,this._change=g-this.begin,this.pause()}fire(E){var m=this[E];m&&m()}setTime(E){E>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():E<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=E,this.update())}getTime(){return this._time}setPosition(E){this.prevPos=this._pos,this.propFunc(E),this._pos=E}getPosition(E){return E===void 0&&(E=this._time),this.func(E,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(E){this.pause(),this._time=E,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var E=this.getTimer()-this._startTime;this.state===l?this.setTime(E):this.state===u&&this.setTime(this.duration-E)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class _{constructor(E){var m=this,p=E.node,y=p._id,g,d=E.easing||e.Easings.Linear,b=!!E.yoyo,O;typeof E.duration>"u"?g=.3:E.duration===0?g=.001:g=E.duration,this.node=p,this._id=f++;var P=p.getLayer()||(p instanceof i.Konva.Stage?p.getLayers():null);P||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(){m.tween.onEnterFrame()},P),this.tween=new S(O,function(x){m._tweenFunc(x)},d,0,1,g*1e3,b),this._addListeners(),_.attrs[y]||(_.attrs[y]={}),_.attrs[y][this._id]||(_.attrs[y][this._id]={}),_.tweens[y]||(_.tweens[y]={});for(O in E)a[O]===void 0&&this._addAttr(O,E[O]);this.reset(),this.onFinish=E.onFinish,this.onReset=E.onReset,this.onUpdate=E.onUpdate}_addAttr(E,m){var p=this.node,y=p._id,g,d,b,O,P,x,w,T;if(b=_.tweens[y][E],b&&delete _.attrs[y][b][E],g=p.getAttr(E),t.Util._isArray(m))if(d=[],P=Math.max(m.length,g.length),E==="points"&&m.length!==g.length&&(m.length>g.length?(w=g,g=t.Util._prepareArrayForTween(g,m,p.closed())):(x=m,m=t.Util._prepareArrayForTween(m,g,p.closed()))),E.indexOf("fill")===0)for(O=0;O<P;O++)if(O%2===0)d.push(m[O]-g[O]);else{var k=t.Util.colorToRGBA(g[O]);T=t.Util.colorToRGBA(m[O]),g[O]=k,d.push({r:T.r-k.r,g:T.g-k.g,b:T.b-k.b,a:T.a-k.a})}else for(O=0;O<P;O++)d.push(m[O]-g[O]);else v.indexOf(E)!==-1?(g=t.Util.colorToRGBA(g),T=t.Util.colorToRGBA(m),d={r:T.r-g.r,g:T.g-g.g,b:T.b-g.b,a:T.a-g.a}):d=m-g;_.attrs[y][this._id][E]={start:g,diff:d,end:m,trueEnd:x,trueStart:w},_.tweens[y][E]=this._id}_tweenFunc(E){var m=this.node,p=_.attrs[m._id][this._id],y,g,d,b,O,P,x,w;for(y in p){if(g=p[y],d=g.start,b=g.diff,w=g.end,t.Util._isArray(d))if(O=[],x=Math.max(d.length,w.length),y.indexOf("fill")===0)for(P=0;P<x;P++)P%2===0?O.push((d[P]||0)+b[P]*E):O.push("rgba("+Math.round(d[P].r+b[P].r*E)+","+Math.round(d[P].g+b[P].g*E)+","+Math.round(d[P].b+b[P].b*E)+","+(d[P].a+b[P].a*E)+")");else for(P=0;P<x;P++)O.push((d[P]||0)+b[P]*E);else v.indexOf(y)!==-1?O="rgba("+Math.round(d.r+b.r*E)+","+Math.round(d.g+b.g*E)+","+Math.round(d.b+b.b*E)+","+(d.a+b.a*E)+")":O=d+b*E;m.setAttr(y,O)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var E=this.node,m=_.attrs[E._id][this._id];m.points&&m.points.trueEnd&&E.setAttr("points",m.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var E=this.node,m=_.attrs[E._id][this._id];m.points&&m.points.trueStart&&E.points(m.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(E){return this.tween.seek(E*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var E=this.node._id,m=this._id,p=_.tweens[E],y;this.pause();for(y in p)delete _.tweens[E][y];delete _.attrs[E][m]}}e.Tween=_,_.attrs={},_.tweens={},n.Node.prototype.to=function(h){var E=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),E&&E()};var m=new _(h);m.play()},e.Easings={BackEaseIn(h,E,m,p){var y=1.70158;return m*(h/=p)*h*((y+1)*h-y)+E},BackEaseOut(h,E,m,p){var y=1.70158;return m*((h=h/p-1)*h*((y+1)*h+y)+1)+E},BackEaseInOut(h,E,m,p){var y=1.70158;return(h/=p/2)<1?m/2*(h*h*(((y*=1.525)+1)*h-y))+E:m/2*((h-=2)*h*(((y*=1.525)+1)*h+y)+2)+E},ElasticEaseIn(h,E,m,p,y,g){var d=0;return h===0?E:(h/=p)===1?E+m:(g||(g=p*.3),!y||y<Math.abs(m)?(y=m,d=g/4):d=g/(2*Math.PI)*Math.asin(m/y),-(y*Math.pow(2,10*(h-=1))*Math.sin((h*p-d)*(2*Math.PI)/g))+E)},ElasticEaseOut(h,E,m,p,y,g){var d=0;return h===0?E:(h/=p)===1?E+m:(g||(g=p*.3),!y||y<Math.abs(m)?(y=m,d=g/4):d=g/(2*Math.PI)*Math.asin(m/y),y*Math.pow(2,-10*h)*Math.sin((h*p-d)*(2*Math.PI)/g)+m+E)},ElasticEaseInOut(h,E,m,p,y,g){var d=0;return h===0?E:(h/=p/2)===2?E+m:(g||(g=p*(.3*1.5)),!y||y<Math.abs(m)?(y=m,d=g/4):d=g/(2*Math.PI)*Math.asin(m/y),h<1?-.5*(y*Math.pow(2,10*(h-=1))*Math.sin((h*p-d)*(2*Math.PI)/g))+E:y*Math.pow(2,-10*(h-=1))*Math.sin((h*p-d)*(2*Math.PI)/g)*.5+m+E)},BounceEaseOut(h,E,m,p){return(h/=p)<1/2.75?m*(7.5625*h*h)+E:h<2/2.75?m*(7.5625*(h-=1.5/2.75)*h+.75)+E:h<2.5/2.75?m*(7.5625*(h-=2.25/2.75)*h+.9375)+E:m*(7.5625*(h-=2.625/2.75)*h+.984375)+E},BounceEaseIn(h,E,m,p){return m-e.Easings.BounceEaseOut(p-h,0,m,p)+E},BounceEaseInOut(h,E,m,p){return h<p/2?e.Easings.BounceEaseIn(h*2,0,m,p)*.5+E:e.Easings.BounceEaseOut(h*2-p,0,m,p)*.5+m*.5+E},EaseIn(h,E,m,p){return m*(h/=p)*h+E},EaseOut(h,E,m,p){return-m*(h/=p)*(h-2)+E},EaseInOut(h,E,m,p){return(h/=p/2)<1?m/2*h*h+E:-m/2*(--h*(h-2)-1)+E},StrongEaseIn(h,E,m,p){return m*(h/=p)*h*h*h*h+E},StrongEaseOut(h,E,m,p){return m*((h=h/p-1)*h*h*h*h+1)+E},StrongEaseInOut(h,E,m,p){return(h/=p/2)<1?m/2*h*h*h*h*h+E:m/2*((h-=2)*h*h*h*h+2)+E},Linear(h,E,m,p){return m*h/p+E}}})(Uw);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=at,r=Xt,n=Gt,i=cl,a=Dw,o=Lc,l=Yh,u=Us,f=qh,v=pr,S=Hs,_=Uw,h=aa,E=hi;e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:l.FastLayer,Group:u.Group,DD:f.DD,Shape:v.Shape,shapes:v.shapes,Animation:S.Animation,Tween:_.Tween,Easings:_.Easings,Context:h.Context,Canvas:E.Canvas}),e.default=e.Konva})(lh);var Kh={};Object.defineProperty(Kh,"__esModule",{value:!0});Kh.Arc=void 0;const Xh=ot,qk=pr,_5=at,Zh=Ge,Wk=at;let ya=class extends qk.Shape{_sceneFunc(t){var r=_5.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=_5.Konva.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),f=a*(a>0?t:r),v=o*r,S=l*(l>0?t:r),_=u*(u>0?r:t);return{x:f,y:n?-1*_:S,width:v-f,height:_-S}}};Kh.Arc=ya;ya.prototype._centroid=!0;ya.prototype.className="Arc";ya.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Wk._registerNode)(ya);Xh.Factory.addGetterSetter(ya,"innerRadius",0,(0,Zh.getNumberValidator)());Xh.Factory.addGetterSetter(ya,"outerRadius",0,(0,Zh.getNumberValidator)());Xh.Factory.addGetterSetter(ya,"angle",0,(0,Zh.getNumberValidator)());Xh.Factory.addGetterSetter(ya,"clockwise",!1,(0,Zh.getBooleanValidator)());var Qh={},Nc={};Object.defineProperty(Nc,"__esModule",{value:!0});Nc.Line=void 0;const Jh=ot,Yk=pr,Hw=Ge,Kk=at;function Hv(e,t,r,n,i,a,o){var l=Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),f=o*l/(l+u),v=o*u/(l+u),S=r-f*(i-e),_=n-f*(a-t),h=r+v*(i-e),E=n+v*(a-t);return[S,_,h,E]}function w5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=Hv(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 fo=class extends Yk.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():w5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=Hv(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=Hv(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=w5(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}}};Nc.Line=fo;fo.prototype.className="Line";fo.prototype._attrsAffectingSize=["points","bezier","tension"];(0,Kk._registerNode)(fo);Jh.Factory.addGetterSetter(fo,"closed",!1);Jh.Factory.addGetterSetter(fo,"bezier",!1);Jh.Factory.addGetterSetter(fo,"tension",0,(0,Hw.getNumberValidator)());Jh.Factory.addGetterSetter(fo,"points",[],(0,Hw.getNumberArrayValidator)());var $s={},$w={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(o,l,u)=>{let f,v,S;f=u/2,v=0;for(let h=0;h<20;h++)S=f*e.tValues[20][h]+f,v+=e.cValues[20][h]*n(o,l,S);return f*v};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],v=l[0]-2*l[1]+l[2],S=2*o[1]-2*o[0],_=2*l[1]-2*l[0],h=4*(f*f+v*v),E=4*(f*S+v*_),m=S*S+_*_;if(h===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const p=E/(2*h),y=m/h,g=u+p,d=y-p*p,b=g*g+d>0?Math.sqrt(g*g+d):0,O=p*p+d>0?Math.sqrt(p*p+d):0,P=p+Math.sqrt(p*p+d)!==0?d*Math.log(Math.abs((g+b)/(p+O))):0;return Math.sqrt(h)/2*(g*b-p*O+P)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),v=i(1,u,l),S=f*f+v*v;return Math.sqrt(S)}const i=(o,l,u)=>{const f=u.length-1;let v,S;if(f===0)return 0;if(o===0){S=0;for(let _=0;_<=f;_++)S+=e.binomialCoefficients[f][_]*Math.pow(1-l,f-_)*Math.pow(l,_)*u[_];return S}else{v=new Array(f);for(let _=0;_<f;_++)v[_]=f*(u[_+1]-u[_]);return i(o-1,l,v)}},a=(o,l,u)=>{let f=1,v=o/l,S=(o-u(v))/l,_=0;for(;f>.001;){const h=u(v+S),E=Math.abs(o-h)/l;if(E<f)f=E,v+=S;else{const m=u(v-S),p=Math.abs(o-m)/l;p<f?(f=p,v-=S):S/=2}if(_++,_>500)break}return v};e.t2length=a})($w);Object.defineProperty($s,"__esModule",{value:!0});$s.Path=void 0;const Xk=ot,Zk=pr,Qk=at,Ul=$w;let Ic=class on extends Zk.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=on.parsePathData(this.data()),this.pathLength=on.getPathLength(this.dataArray)}_sceneFunc(t){var r=this.dataArray;t.beginPath();for(var n=!1,i=0;i<r.length;i++){var a=r[i].command,o=r[i].points;switch(a){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var l=o[0],u=o[1],f=o[2],v=o[3],S=o[4],_=o[5],h=o[6],E=o[7],m=f>v?f:v,p=f>v?1:f/v,y=f>v?v/f:1;t.translate(l,u),t.rotate(h),t.scale(p,y),t.arc(0,0,m,S,S+_,1-E),t.scale(1/p,1/y),t.rotate(-h),t.translate(-l,-u);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(f){if(f.command==="A"){var v=f.points[4],S=f.points[5],_=f.points[4]+S,h=Math.PI/180;if(Math.abs(v-_)<h&&(h=Math.abs(v-_)),S<0)for(let E=v-h;E>_;E-=h){const m=on.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(m.x,m.y)}else for(let E=v+h;E<_;E+=h){const m=on.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],E,0);t.push(m.x,m.y)}}else if(f.command==="C")for(let E=0;E<=1;E+=.01){const m=on.getPointOnCubicBezier(E,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);t.push(m.x,m.y)}else t=t.concat(f.points)});for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(l)||(i=Math.min(i,l),a=Math.max(a,l));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return on.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,r,n,i){return Math.sqrt((n-t)*(n-t)+(i-r)*(i-r))}static getPathLength(t){let r=0;for(var n=0;n<t.length;++n)r+=t[n].pathLength;return r}static getPointAtLengthOfDataArray(t,r){var n,i=0,a=r.length;if(!a)return null;for(;i<a&&t>r[i].pathLength;)t-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=r[i].points.slice(0,2),{x:n[0],y:n[1]};var o=r[i],l=o.points;switch(o.command){case"L":return on.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return on.getPointOnCubicBezier((0,Ul.t2length)(t,on.getPathLength(r),m=>(0,Ul.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],m)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return on.getPointOnQuadraticBezier((0,Ul.t2length)(t,on.getPathLength(r),m=>(0,Ul.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],m)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],v=l[2],S=l[3],_=l[4],h=l[5],E=l[6];return _+=h*t/o.pathLength,on.getPointOnEllipticalArc(u,f,v,S,_,E)}return null}static getPointOnLine(t,r,n,i,a,o,l){o===void 0&&(o=r),l===void 0&&(l=n);var u=(a-n)/(i-r+1e-8),f=Math.sqrt(t*t/(1+u*u));i<r&&(f*=-1);var v=u*f,S;if(i===r)S={x:o,y:l+v};else if((l-n)/(o-r+1e-8)===u)S={x:o+f,y:l+v};else{var _,h,E=this.getLineLength(r,n,i,a),m=(o-r)*(i-r)+(l-n)*(a-n);m=m/(E*E),_=r+m*(i-r),h=n+m*(a-n);var p=this.getLineLength(o,l,_,h),y=Math.sqrt(t*t-p*p);f=Math.sqrt(y*y/(1+u*u)),i<r&&(f*=-1),v=u*f,S={x:_+f,y:h+v}}return S}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function v(p){return p*p*p}function S(p){return 3*p*p*(1-p)}function _(p){return 3*p*(1-p)*(1-p)}function h(p){return(1-p)*(1-p)*(1-p)}var E=u*v(t)+o*S(t)+i*_(t)+r*h(t),m=f*v(t)+l*S(t)+a*_(t)+n*h(t);return{x:E,y:m}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(h){return h*h}function f(h){return 2*h*(1-h)}function v(h){return(1-h)*(1-h)}var S=o*u(t)+i*f(t)+r*v(t),_=l*u(t)+a*f(t)+n*v(t);return{x:S,y:_}}static getPointOnEllipticalArc(t,r,n,i,a,o){var l=Math.cos(o),u=Math.sin(o),f={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:t+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(t){if(!t)return[];var r=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var i=0;i<n.length;i++)r=r.replace(new RegExp(n[i],"g"),"|"+n[i]);var a=r.split("|"),o=[],l=[],u=0,f=0,v=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,S;for(i=1;i<a.length;i++){var _=a[i],h=_.charAt(0);for(_=_.slice(1),l.length=0;S=v.exec(_);)l.push(S[0]);for(var E=[],m=0,p=l.length;m<p;m++){if(l[m]==="00"){E.push(0,0);continue}var y=parseFloat(l[m]);isNaN(y)?E.push(0):E.push(y)}for(;E.length>0&&!isNaN(E[0]);){var g="",d=[],b=u,O=f,P,x,w,T,k,A,R,F,H,Y;switch(h){case"l":u+=E.shift(),f+=E.shift(),g="L",d.push(u,f);break;case"L":u=E.shift(),f=E.shift(),d.push(u,f);break;case"m":var $=E.shift(),I=E.shift();if(u+=$,f+=I,g="M",o.length>2&&o[o.length-1].command==="z"){for(var U=o.length-2;U>=0;U--)if(o[U].command==="M"){u=o[U].points[0]+$,f=o[U].points[1]+I;break}}d.push(u,f),h="l";break;case"M":u=E.shift(),f=E.shift(),g="M",d.push(u,f),h="L";break;case"h":u+=E.shift(),g="L",d.push(u,f);break;case"H":u=E.shift(),g="L",d.push(u,f);break;case"v":f+=E.shift(),g="L",d.push(u,f);break;case"V":f=E.shift(),g="L",d.push(u,f);break;case"C":d.push(E.shift(),E.shift(),E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"c":d.push(u+E.shift(),f+E.shift(),u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),g="C",d.push(u,f);break;case"S":x=u,w=f,P=o[o.length-1],P.command==="C"&&(x=u+(u-P.points[2]),w=f+(f-P.points[3])),d.push(x,w,E.shift(),E.shift()),u=E.shift(),f=E.shift(),g="C",d.push(u,f);break;case"s":x=u,w=f,P=o[o.length-1],P.command==="C"&&(x=u+(u-P.points[2]),w=f+(f-P.points[3])),d.push(x,w,u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),g="C",d.push(u,f);break;case"Q":d.push(E.shift(),E.shift()),u=E.shift(),f=E.shift(),d.push(u,f);break;case"q":d.push(u+E.shift(),f+E.shift()),u+=E.shift(),f+=E.shift(),g="Q",d.push(u,f);break;case"T":x=u,w=f,P=o[o.length-1],P.command==="Q"&&(x=u+(u-P.points[0]),w=f+(f-P.points[1])),u=E.shift(),f=E.shift(),g="Q",d.push(x,w,u,f);break;case"t":x=u,w=f,P=o[o.length-1],P.command==="Q"&&(x=u+(u-P.points[0]),w=f+(f-P.points[1])),u+=E.shift(),f+=E.shift(),g="Q",d.push(x,w,u,f);break;case"A":T=E.shift(),k=E.shift(),A=E.shift(),R=E.shift(),F=E.shift(),H=u,Y=f,u=E.shift(),f=E.shift(),g="A",d=this.convertEndpointToCenterParameterization(H,Y,u,f,R,F,T,k,A);break;case"a":T=E.shift(),k=E.shift(),A=E.shift(),R=E.shift(),F=E.shift(),H=u,Y=f,u+=E.shift(),f+=E.shift(),g="A",d=this.convertEndpointToCenterParameterization(H,Y,u,f,R,F,T,k,A);break}o.push({command:g||h,points:d,start:{x:b,y:O},pathLength:this.calcLength(b,O,g||h,d)})}(h==="z"||h==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,r,n,i){var a,o,l,u,f=on;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,Ul.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,Ul.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var v=i[4],S=i[5],_=i[4]+S,h=Math.PI/180;if(Math.abs(v-_)<h&&(h=Math.abs(v-_)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),S<0)for(u=v-h;u>_;u-=h)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=v+h;u<_;u+=h)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],_,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(t,r,n,i,a,o,l,u,f){var v=f*(Math.PI/180),S=Math.cos(v)*(t-n)/2+Math.sin(v)*(r-i)/2,_=-1*Math.sin(v)*(t-n)/2+Math.cos(v)*(r-i)/2,h=S*S/(l*l)+_*_/(u*u);h>1&&(l*=Math.sqrt(h),u*=Math.sqrt(h));var E=Math.sqrt((l*l*(u*u)-l*l*(_*_)-u*u*(S*S))/(l*l*(_*_)+u*u*(S*S)));a===o&&(E*=-1),isNaN(E)&&(E=0);var m=E*l*_/u,p=E*-u*S/l,y=(t+n)/2+Math.cos(v)*m-Math.sin(v)*p,g=(r+i)/2+Math.sin(v)*m+Math.cos(v)*p,d=function(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])},b=function(k,A){return(k[0]*A[0]+k[1]*A[1])/(d(k)*d(A))},O=function(k,A){return(k[0]*A[1]<k[1]*A[0]?-1:1)*Math.acos(b(k,A))},P=O([1,0],[(S-m)/l,(_-p)/u]),x=[(S-m)/l,(_-p)/u],w=[(-1*S-m)/l,(-1*_-p)/u],T=O(x,w);return b(x,w)<=-1&&(T=Math.PI),b(x,w)>=1&&(T=0),o===0&&T>0&&(T=T-2*Math.PI),o===1&&T<0&&(T=T+2*Math.PI),[y,g,l,u,P,T,v,o]}};$s.Path=Ic;Ic.prototype.className="Path";Ic.prototype._attrsAffectingSize=["data"];(0,Qk._registerNode)(Ic);Xk.Factory.addGetterSetter(Ic,"data");Object.defineProperty(Qh,"__esModule",{value:!0});Qh.Arrow=void 0;const ep=ot,Jk=Nc,Gw=Ge,eT=at,S5=$s;let dl=class extends Jk.Line{_sceneFunc(t){super._sceneFunc(t);var r=Math.PI*2,n=this.points(),i=n,a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());var o=this.pointerLength(),l=n.length,u,f;if(a){const _=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],h=S5.Path.calcLength(i[i.length-4],i[i.length-3],"C",_),E=S5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/h),_[0],_[1],_[2],_[3],_[4],_[5]);u=n[l-2]-E.x,f=n[l-1]-E.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var v=(Math.atan2(f,u)+r)%r,S=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(v),t.moveTo(0,0),t.lineTo(-o,S/2),t.lineTo(-o,-S/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],f=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],f=n[3]-n[1]),t.rotate((Math.atan2(-f,-u)+r)%r),t.moveTo(0,0),t.lineTo(-o,S/2),t.lineTo(-o,-S/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),r=this.pointerWidth()/2;return{x:t.x-r,y:t.y-r,width:t.width+r*2,height:t.height+r*2}}};Qh.Arrow=dl;dl.prototype.className="Arrow";(0,eT._registerNode)(dl);ep.Factory.addGetterSetter(dl,"pointerLength",10,(0,Gw.getNumberValidator)());ep.Factory.addGetterSetter(dl,"pointerWidth",10,(0,Gw.getNumberValidator)());ep.Factory.addGetterSetter(dl,"pointerAtBeginning",!1);ep.Factory.addGetterSetter(dl,"pointerAtEnding",!0);var tp={};Object.defineProperty(tp,"__esModule",{value:!0});tp.Circle=void 0;const tT=ot,rT=pr,nT=Ge,iT=at;let Gs=class extends rT.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)}};tp.Circle=Gs;Gs.prototype._centroid=!0;Gs.prototype.className="Circle";Gs.prototype._attrsAffectingSize=["radius"];(0,iT._registerNode)(Gs);tT.Factory.addGetterSetter(Gs,"radius",0,(0,nT.getNumberValidator)());var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.Ellipse=void 0;const by=ot,aT=pr,Vw=Ge,oT=at;let ho=class extends aT.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)}};rp.Ellipse=ho;ho.prototype.className="Ellipse";ho.prototype._centroid=!0;ho.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,oT._registerNode)(ho);by.Factory.addComponentsGetterSetter(ho,"radius",["x","y"]);by.Factory.addGetterSetter(ho,"radiusX",0,(0,Vw.getNumberValidator)());by.Factory.addGetterSetter(ho,"radiusY",0,(0,Vw.getNumberValidator)());var np={};Object.defineProperty(np,"__esModule",{value:!0});np.Image=void 0;const D1=Xt,hl=ot,lT=pr,sT=at,jc=Ge;let Ui=class qw extends lT.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?D1.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?D1.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=D1.Util.createImageElement();i.onload=function(){var a=new qw({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};np.Image=Ui;Ui.prototype.className="Image";(0,sT._registerNode)(Ui);hl.Factory.addGetterSetter(Ui,"cornerRadius",0,(0,jc.getNumberOrArrayOfNumbersValidator)(4));hl.Factory.addGetterSetter(Ui,"image");hl.Factory.addComponentsGetterSetter(Ui,"crop",["x","y","width","height"]);hl.Factory.addGetterSetter(Ui,"cropX",0,(0,jc.getNumberValidator)());hl.Factory.addGetterSetter(Ui,"cropY",0,(0,jc.getNumberValidator)());hl.Factory.addGetterSetter(Ui,"cropWidth",0,(0,jc.getNumberValidator)());hl.Factory.addGetterSetter(Ui,"cropHeight",0,(0,jc.getNumberValidator)());var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.Tag=xs.Label=void 0;const ip=ot,uT=pr,cT=Us,_y=Ge,Ww=at;var Yw=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],fT="Change.konva",dT="none",$v="up",Gv="right",Vv="down",qv="left",hT=Yw.length;let wy=class extends cT.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<hT;n++)t.on(Yw[n]+fT,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),r=this.getTag(),n,i,a,o,l,u,f;if(t&&r){switch(n=t.width(),i=t.height(),a=r.pointerDirection(),o=r.pointerWidth(),f=r.pointerHeight(),l=0,u=0,a){case $v:l=n/2,u=-1*f;break;case Gv:l=n+o,u=i/2;break;case Vv:l=n/2,u=i+f;break;case qv: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})}}};xs.Label=wy;wy.prototype.className="Label";(0,Ww._registerNode)(wy);let pl=class extends uT.Shape{_sceneFunc(t){var r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),l=this.cornerRadius();let u=0,f=0,v=0,S=0;typeof l=="number"?u=f=v=S=Math.min(l,r/2,n/2):(u=Math.min(l[0]||0,r/2,n/2),f=Math.min(l[1]||0,r/2,n/2),S=Math.min(l[2]||0,r/2,n/2),v=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===$v&&(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===Gv&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-S),t.arc(r-S,n-S,S,0,Math.PI/2,!1),i===Vv&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(v,n),t.arc(v,n-v,v,Math.PI/2,Math.PI,!1),i===qv&&(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===$v?(r-=i,l+=i):a===Vv?l+=i:a===qv?(t-=n*1.5,o+=n):a===Gv&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};xs.Tag=pl;pl.prototype.className="Tag";(0,Ww._registerNode)(pl);ip.Factory.addGetterSetter(pl,"pointerDirection",dT);ip.Factory.addGetterSetter(pl,"pointerWidth",0,(0,_y.getNumberValidator)());ip.Factory.addGetterSetter(pl,"pointerHeight",0,(0,_y.getNumberValidator)());ip.Factory.addGetterSetter(pl,"cornerRadius",0,(0,_y.getNumberOrArrayOfNumbersValidator)(4));var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.Rect=void 0;const pT=ot,gT=pr,vT=at,mT=Xt,yT=Ge;let ap=class extends gT.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?mT.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};Dc.Rect=ap;ap.prototype.className="Rect";(0,vT._registerNode)(ap);pT.Factory.addGetterSetter(ap,"cornerRadius",0,(0,yT.getNumberOrArrayOfNumbersValidator)(4));var op={};Object.defineProperty(op,"__esModule",{value:!0});op.RegularPolygon=void 0;const Kw=ot,bT=pr,Xw=Ge,_T=at;let gl=class extends bT.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)}};op.RegularPolygon=gl;gl.prototype.className="RegularPolygon";gl.prototype._centroid=!0;gl.prototype._attrsAffectingSize=["radius"];(0,_T._registerNode)(gl);Kw.Factory.addGetterSetter(gl,"radius",0,(0,Xw.getNumberValidator)());Kw.Factory.addGetterSetter(gl,"sides",0,(0,Xw.getNumberValidator)());var lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.Ring=void 0;const Zw=ot,wT=pr,Qw=Ge,ST=at;var E5=Math.PI*2;let vl=class extends wT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,E5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),E5,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)}};lp.Ring=vl;vl.prototype.className="Ring";vl.prototype._centroid=!0;vl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ST._registerNode)(vl);Zw.Factory.addGetterSetter(vl,"innerRadius",0,(0,Qw.getNumberValidator)());Zw.Factory.addGetterSetter(vl,"outerRadius",0,(0,Qw.getNumberValidator)());var sp={};Object.defineProperty(sp,"__esModule",{value:!0});sp.Sprite=void 0;const ml=ot,ET=pr,OT=Hs,Jw=Ge,PT=at;let Hi=class extends ET.Shape{constructor(t){super(t),this._updated=!0,this.anim=new OT.Animation(()=>{var r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+0],u=a[i+1],f=a[i+2],v=a[i+3],S=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,v),t.closePath(),t.fillStrokeShape(this)),S)if(o){var _=o[r],h=n*2;t.drawImage(S,l,u,f,v,_[h+0],_[h+1],f,v)}else t.drawImage(S,l,u,f,v,0,0,f,v)}_hitFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+2],u=a[i+3];if(t.beginPath(),o){var f=o[r],v=n*2;t.rect(f[v+0],f[v+1],l,u)}else t.rect(0,0,l,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}};sp.Sprite=Hi;Hi.prototype.className="Sprite";(0,PT._registerNode)(Hi);ml.Factory.addGetterSetter(Hi,"animation");ml.Factory.addGetterSetter(Hi,"animations");ml.Factory.addGetterSetter(Hi,"frameOffsets");ml.Factory.addGetterSetter(Hi,"image");ml.Factory.addGetterSetter(Hi,"frameIndex",0,(0,Jw.getNumberValidator)());ml.Factory.addGetterSetter(Hi,"frameRate",17,(0,Jw.getNumberValidator)());ml.Factory.backCompat(Hi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var up={};Object.defineProperty(up,"__esModule",{value:!0});up.Star=void 0;const Sy=ot,xT=pr,Ey=Ge,CT=at;let po=class extends xT.Shape{_sceneFunc(t){var r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var a=1;a<i*2;a++){var o=a%2===0?n:r,l=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);t.lineTo(l,u)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};up.Star=po;po.prototype.className="Star";po.prototype._centroid=!0;po.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,CT._registerNode)(po);Sy.Factory.addGetterSetter(po,"numPoints",5,(0,Ey.getNumberValidator)());Sy.Factory.addGetterSetter(po,"innerRadius",0,(0,Ey.getNumberValidator)());Sy.Factory.addGetterSetter(po,"outerRadius",0,(0,Ey.getNumberValidator)());var nl={};Object.defineProperty(nl,"__esModule",{value:!0});nl.Text=nl.stringToArray=void 0;const Wv=Xt,$r=ot,kT=pr,go=Ge,TT=at;function e9(e){return Array.from(e)}nl.stringToArray=e9;var Hl="auto",AT="center",t9="inherit",Su="justify",RT="Change.konva",MT="2d",O5="-",r9="left",LT="text",NT="Text",IT="top",jT="bottom",P5="middle",n9="normal",DT="px ",od=" ",FT="right",x5="rtl",zT="word",BT="char",C5="none",F1="…",i9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],UT=i9.length;function HT(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 ld;function z1(){return ld||(ld=Wv.Util.createCanvasElement().getContext(MT),ld)}function $T(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function GT(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function VT(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let Jt=class extends kT.Shape{constructor(t){super(VT(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<UT;r++)this.on(i9[r]+RT,this._setTextData);this._setTextData()}_sceneFunc(t){var r=this.textArr,n=r.length;if(this.text()){var i=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,l=this.verticalAlign(),u=this.direction(),f=0,v=this.align(),S=this.getWidth(),_=this.letterSpacing(),h=this.fill(),E=this.textDecoration(),m=E.indexOf("underline")!==-1,p=E.indexOf("line-through")!==-1,y;u=u===t9?t.direction:u;var g=0,g=o/2,d=0,b=0;for(u===x5&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",P5),t.setAttr("textAlign",r9),l===P5?f=(this.getHeight()-n*o-i*2)/2:l===jT&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),y=0;y<n;y++){var d=0,b=0,O=r[y],P=O.text,x=O.width,w=O.lastInParagraph,T,k,A;if(t.save(),v===FT?d+=S-x-i*2:v===AT&&(d+=(S-x-i*2)/2),m){t.save(),t.beginPath(),t.moveTo(d,g+b+Math.round(a/2)),T=P.split(" ").length-1,k=T===0,A=v===Su&&!w?S-i*2:x,t.lineTo(d+Math.round(A),g+b+Math.round(a/2)),t.lineWidth=a/15;const I=this._getLinearGradient();t.strokeStyle=I||h,t.stroke(),t.restore()}if(p){t.save(),t.beginPath(),t.moveTo(d,g+b),T=P.split(" ").length-1,k=T===0,A=v===Su&&w&&!k?S-i*2:x,t.lineTo(d+Math.round(A),g+b),t.lineWidth=a/15;const I=this._getLinearGradient();t.strokeStyle=I||h,t.stroke(),t.restore()}if(u!==x5&&(_!==0||v===Su)){T=P.split(" ").length-1;for(var R=e9(P),F=0;F<R.length;F++){var H=R[F];H===" "&&!w&&v===Su&&(d+=(S-i*2-x)/T),this._partialTextX=d,this._partialTextY=g+b,this._partialText=H,t.fillStrokeShape(this),d+=this.measureSize(H).width+_}}else _!==0&&t.setAttr("letterSpacing",`${_}px`),this._partialTextX=d,this._partialTextY=g+b,this._partialText=P,t.fillStrokeShape(this);t.restore(),n>1&&(g+=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=Wv.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(LT,r),this}getWidth(){var t=this.attrs.width===Hl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Hl||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 Wv.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=z1(),n=this.fontSize(),i;return r.save(),r.font=this._getContextFont(),i=r.measureText(t),r.restore(),{width:i.width,height:n}}_getContextFont(){return this.fontStyle()+od+this.fontVariant()+od+(this.fontSize()+DT)+HT(this.fontFamily())}_addTextLine(t){this.align()===Su&&(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!==Hl&&a!==void 0,u=o!==Hl&&o!==void 0,f=this.padding(),v=a-f*2,S=o-f*2,_=0,h=this.wrap(),E=h!==C5,m=h!==BT&&E,p=this.ellipsis();this.textArr=[],z1().font=this._getContextFont();for(var y=p?this._getTextWidth(F1):0,g=0,d=t.length;g<d;++g){var b=t[g],O=this._getTextWidth(b);if(l&&O>v)for(;b.length>0;){for(var P=0,x=b.length,w="",T=0;P<x;){var k=P+x>>>1,A=b.slice(0,k+1),R=this._getTextWidth(A)+y;R<=v?(P=k+1,w=A,T=R):x=k}if(w){if(m){var F,H=b[w.length],Y=H===od||H===O5;Y&&T<=v?F=w.length:F=Math.max(w.lastIndexOf(od),w.lastIndexOf(O5))+1,F>0&&(P=F,w=w.slice(0,P),T=this._getTextWidth(w))}w=w.trimRight(),this._addTextLine(w),n=Math.max(n,T),_+=i;var $=this._shouldHandleEllipsis(_);if($){this._tryToAddEllipsisToLastLine();break}if(b=b.slice(P),b=b.trimLeft(),b.length>0&&(O=this._getTextWidth(b),O<=v)){this._addTextLine(b),_+=i,n=Math.max(n,O);break}}else break}else this._addTextLine(b),_+=i,n=Math.max(n,O),this._shouldHandleEllipsis(_)&&g<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&_+i>S)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Hl&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==C5;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==Hl&&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+F1)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+F1)}}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()}};nl.Text=Jt;Jt.prototype._fillFunc=$T;Jt.prototype._strokeFunc=GT;Jt.prototype.className=NT;Jt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,TT._registerNode)(Jt);$r.Factory.overWriteSetter(Jt,"width",(0,go.getNumberOrAutoValidator)());$r.Factory.overWriteSetter(Jt,"height",(0,go.getNumberOrAutoValidator)());$r.Factory.addGetterSetter(Jt,"direction",t9);$r.Factory.addGetterSetter(Jt,"fontFamily","Arial");$r.Factory.addGetterSetter(Jt,"fontSize",12,(0,go.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"fontStyle",n9);$r.Factory.addGetterSetter(Jt,"fontVariant",n9);$r.Factory.addGetterSetter(Jt,"padding",0,(0,go.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"align",r9);$r.Factory.addGetterSetter(Jt,"verticalAlign",IT);$r.Factory.addGetterSetter(Jt,"lineHeight",1,(0,go.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"wrap",zT);$r.Factory.addGetterSetter(Jt,"ellipsis",!1,(0,go.getBooleanValidator)());$r.Factory.addGetterSetter(Jt,"letterSpacing",0,(0,go.getNumberValidator)());$r.Factory.addGetterSetter(Jt,"text","",(0,go.getStringValidator)());$r.Factory.addGetterSetter(Jt,"textDecoration","");var cp={};Object.defineProperty(cp,"__esModule",{value:!0});cp.TextPath=void 0;const B1=Xt,yi=ot,qT=pr,Eu=$s,U1=nl,a9=Ge,WT=at;var YT="",o9="normal";function l9(e){e.fillText(this.partialText,0,0)}function s9(e){e.strokeText(this.partialText,0,0)}let gr=class extends qT.Shape{constructor(t){super(t),this.dummyCanvas=B1.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 Eu.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:Eu.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Eu.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 B1.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 U1.Text.prototype.setText.call(this,t)}_getContextFont(){return U1.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,U1.stringToArray)(this.text());let f=l;for(var v=0;v<u.length;v++){const S=this._getPointAtLength(f);if(!S)return;let _=this._getTextSize(u[v]).width+n;if(u[v]===" "&&i==="justify"){const g=this.text().split(" ").length-1;_+=(this.pathLength-o)/g}const h=this._getPointAtLength(f+_);if(!h)return;const E=Eu.Path.getLineLength(S.x,S.y,h.x,h.y);let m=0;if(a)try{m=a(u[v-1],u[v])*this.fontSize()}catch{m=0}S.x+=m,h.x+=m,this.textWidth+=m;const p=Eu.Path.getPointOnLine(m+E/2,S.x,S.y,h.x,h.y),y=Math.atan2(h.y-S.y,h.x-S.x);this.glyphInfo.push({transposeX:p.x,transposeY:p.y,text:u[v],rotation:y,p0:S,p1:h}),f+=_}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(v){t.push(v.p0.x),t.push(v.p0.y),t.push(v.p1.x),t.push(v.p1.y)});for(var r=t[0]||0,n=t[0]||0,i=t[1]||0,a=t[1]||0,o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);var f=this.fontSize();return{x:r-f/2,y:i-f/2,width:n-r+f,height:a-i+f}}destroy(){return B1.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};cp.TextPath=gr;gr.prototype._fillFunc=l9;gr.prototype._strokeFunc=s9;gr.prototype._fillFuncHit=l9;gr.prototype._strokeFuncHit=s9;gr.prototype.className="TextPath";gr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,WT._registerNode)(gr);yi.Factory.addGetterSetter(gr,"data");yi.Factory.addGetterSetter(gr,"fontFamily","Arial");yi.Factory.addGetterSetter(gr,"fontSize",12,(0,a9.getNumberValidator)());yi.Factory.addGetterSetter(gr,"fontStyle",o9);yi.Factory.addGetterSetter(gr,"align","left");yi.Factory.addGetterSetter(gr,"letterSpacing",0,(0,a9.getNumberValidator)());yi.Factory.addGetterSetter(gr,"textBaseline","middle");yi.Factory.addGetterSetter(gr,"fontVariant",o9);yi.Factory.addGetterSetter(gr,"text",YT);yi.Factory.addGetterSetter(gr,"textDecoration",null);yi.Factory.addGetterSetter(gr,"kerningFunc",null);var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.Transformer=void 0;const kt=Xt,wt=ot,k5=Gt,KT=pr,XT=Dc,T5=Us,ii=at,vo=Ge,ZT=at;var u9="tr-konva",QT=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${u9}`).join(" "),A5="nodesRect",JT=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],eA={"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 tA="ontouchstart"in ii.Konva._global;function rA(e,t,r){if(e==="rotater")return r;t+=kt.Util.degToRad(eA[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 uh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],R5=1e8;function nA(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 c9(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 iA(e,t){const r=nA(e);return c9(e,t,r)}function aA(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=ii.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 dt=class extends T5.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(QT,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 u9+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(JT.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(A5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(A5,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=(ii.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={x:o.x+l*Math.cos(f)+u*Math.sin(-f),y:o.y+u*Math.cos(f)+l*Math.sin(f),width:i.width*a.x,height:i.height*a.y,rotation:f};return c9(v,-ii.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-R5,y:-R5,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const v=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var S=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],_=f.getAbsoluteTransform();S.forEach(function(h){var E=_.point(h);r.push(E)})});const n=new kt.Transform;n.rotate(-ii.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var v=n.point(f);i===void 0&&(i=o=v.x,a=l=v.y),i=Math.min(i,v.x),a=Math.min(a,v.y),o=Math.max(o,v.x),l=Math.max(l,v.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:l-a,rotation:ii.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),uh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new XT.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:tA?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=ii.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=rA(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 KT.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){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},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:t.evt,target:u})})}_handleMouseMove(t){var r,n,i,a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(t);const l=o.getPointerPosition();let u={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(f,u,t)),a.setAbsolutePosition(u);const v=a.getAbsolutePosition();if(!(f.x===v.x&&f.y===v.y)){if(this._movingAnchorName==="rotater"){var S=this._getNodeRect();r=a.x()-S.width/2,n=-a.y()+S.height/2;let F=Math.atan2(-n,r)+Math.PI/2;S.height<0&&(F-=Math.PI);var _=ii.Konva.getAngle(this.rotation());const H=_+F,Y=ii.Konva.getAngle(this.rotationSnapTolerance()),I=aA(this.rotationSnaps(),H,Y)-S.rotation,U=iA(S,I);this._fitNodesInto(U,t);return}var h=this.shiftBehavior(),E;h==="inverted"?E=this.keepRatio()&&!t.shiftKey:h==="none"?E=this.keepRatio():E=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(E){var m=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(m.x-a.x(),2)+Math.pow(m.y-a.y(),2));var p=this.findOne(".top-left").x()>m.x?-1:1,y=this.findOne(".top-left").y()>m.y?-1:1;r=i*this.cos*p,n=i*this.sin*y,this.findOne(".top-left").x(m.x-r),this.findOne(".top-left").y(m.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(E){var m=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()-m.x,2)+Math.pow(m.y-a.y(),2));var p=this.findOne(".top-right").x()<m.x?-1:1,y=this.findOne(".top-right").y()>m.y?-1:1;r=i*this.cos*p,n=i*this.sin*y,this.findOne(".top-right").x(m.x+r),this.findOne(".top-right").y(m.y-n)}var g=a.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(E){var m=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(m.x-a.x(),2)+Math.pow(a.y()-m.y,2));var p=m.x<a.x()?-1:1,y=a.y()<m.y?-1:1;r=i*this.cos*p,n=i*this.sin*y,a.x(m.x-r),a.y(m.y+n)}g=a.position(),this.findOne(".top-left").x(g.x),this.findOne(".bottom-right").y(g.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(E){var m=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()-m.x,2)+Math.pow(a.y()-m.y,2));var p=this.findOne(".bottom-right").x()<m.x?-1:1,y=this.findOne(".bottom-right").y()<m.y?-1:1;r=i*this.cos*p,n=i*this.sin*y,this.findOne(".bottom-right").x(m.x+r),this.findOne(".bottom-right").y(m.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var b=this.findOne(".top-left"),O=this.findOne(".bottom-right"),P=b.x(),x=b.y(),w=this.getWidth()-O.x(),T=this.getHeight()-O.y();O.move({x:-P,y:-x}),b.move({x:w,y:T})}var k=this.findOne(".top-left").getAbsolutePosition();r=k.x,n=k.y;var A=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),R=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:A,height:R,rotation:ii.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){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 r=this.getNode();this._fire("transformend",{evt:t,target:r}),r&&this._nodes.forEach(n=>{n._fire("transformend",{evt:t,target:n})}),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(ii.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=a.point({x:-this.padding()*2,y:0});t.x+=_.x,t.y+=_.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=a.point({x:0,y:-this.padding()*2});t.x+=_.x,t.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(n,t);_?t=_: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,v=t.height/o;this.flipEnabled()===!1?(u.translate(t.x,t.y),u.rotate(t.rotation),u.translate(t.width<0?t.width:0,t.height<0?t.height:0),u.scale(Math.abs(f),Math.abs(v))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,v));const S=u.multiply(l.invert());this._nodes.forEach(_=>{var h;const E=_.getParent().getAbsoluteTransform(),m=_.getTransform().copy();m.translate(_.offsetX(),_.offsetY());const p=new kt.Transform;p.multiply(E.copy().invert()).multiply(S).multiply(E).multiply(m);const y=p.decompose();_.setAttrs(y),this._fire("transform",{evt:r,target:_}),_._fire("transform",{evt:r,target:_}),(h=_.getLayer())===null||h===void 0||h.batchDraw()}),this.rotation(kt.Util._getRotation(t.rotation)),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(S=>{S.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+l,offsetY:u/2+l,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+l,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-l,offsetY:u/2+l,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+l,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-l,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-l,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*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 v=this.anchorStyleFunc();v&&f.forEach(S=>{v(S)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),T5.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return k5.Node.prototype.toObject.call(this)}clone(t){var r=k5.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};fp.Transformer=dt;function oA(e){return e instanceof Array||kt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){uh.indexOf(t)===-1&&kt.Util.warn("Unknown anchor name: "+t+". Available names are: "+uh.join(", "))}),e||[]}dt.prototype.className="Transformer";(0,ZT._registerNode)(dt);wt.Factory.addGetterSetter(dt,"enabledAnchors",uh,oA);wt.Factory.addGetterSetter(dt,"flipEnabled",!0,(0,vo.getBooleanValidator)());wt.Factory.addGetterSetter(dt,"resizeEnabled",!0);wt.Factory.addGetterSetter(dt,"anchorSize",10,(0,vo.getNumberValidator)());wt.Factory.addGetterSetter(dt,"rotateEnabled",!0);wt.Factory.addGetterSetter(dt,"rotateLineVisible",!0);wt.Factory.addGetterSetter(dt,"rotationSnaps",[]);wt.Factory.addGetterSetter(dt,"rotateAnchorOffset",50,(0,vo.getNumberValidator)());wt.Factory.addGetterSetter(dt,"rotateAnchorCursor","crosshair");wt.Factory.addGetterSetter(dt,"rotationSnapTolerance",5,(0,vo.getNumberValidator)());wt.Factory.addGetterSetter(dt,"borderEnabled",!0);wt.Factory.addGetterSetter(dt,"anchorStroke","rgb(0, 161, 255)");wt.Factory.addGetterSetter(dt,"anchorStrokeWidth",1,(0,vo.getNumberValidator)());wt.Factory.addGetterSetter(dt,"anchorFill","white");wt.Factory.addGetterSetter(dt,"anchorCornerRadius",0,(0,vo.getNumberValidator)());wt.Factory.addGetterSetter(dt,"borderStroke","rgb(0, 161, 255)");wt.Factory.addGetterSetter(dt,"borderStrokeWidth",1,(0,vo.getNumberValidator)());wt.Factory.addGetterSetter(dt,"borderDash");wt.Factory.addGetterSetter(dt,"keepRatio",!0);wt.Factory.addGetterSetter(dt,"shiftBehavior","default");wt.Factory.addGetterSetter(dt,"centeredScaling",!1);wt.Factory.addGetterSetter(dt,"ignoreStroke",!1);wt.Factory.addGetterSetter(dt,"padding",0,(0,vo.getNumberValidator)());wt.Factory.addGetterSetter(dt,"node");wt.Factory.addGetterSetter(dt,"nodes");wt.Factory.addGetterSetter(dt,"boundBoxFunc");wt.Factory.addGetterSetter(dt,"anchorDragBoundFunc");wt.Factory.addGetterSetter(dt,"anchorStyleFunc");wt.Factory.addGetterSetter(dt,"shouldOverdrawWholeArea",!1);wt.Factory.addGetterSetter(dt,"useSingleNodeRotation",!0);wt.Factory.backCompat(dt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var dp={};Object.defineProperty(dp,"__esModule",{value:!0});dp.Wedge=void 0;const hp=ot,lA=pr,sA=at,f9=Ge,uA=at;let ba=class extends lA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,sA.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)}};dp.Wedge=ba;ba.prototype.className="Wedge";ba.prototype._centroid=!0;ba.prototype._attrsAffectingSize=["radius"];(0,uA._registerNode)(ba);hp.Factory.addGetterSetter(ba,"radius",0,(0,f9.getNumberValidator)());hp.Factory.addGetterSetter(ba,"angle",0,(0,f9.getNumberValidator)());hp.Factory.addGetterSetter(ba,"clockwise",!1);hp.Factory.backCompat(ba,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Blur=void 0;const M5=ot,cA=Gt,fA=Ge;function L5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var dA=[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],hA=[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 pA(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,v,S,_,h,E,m,p,y,g,d,b,O,P,x,w,T,k,A,R,F=t+t+1,H=n-1,Y=i-1,$=t+1,I=$*($+1)/2,U=new L5,W=null,M=U,j=null,B=null,N=dA[t],G=hA[t];for(l=1;l<F;l++)M=M.next=new L5,l===$&&(W=M);for(M.next=U,S=v=0,o=0;o<i;o++){for(b=O=P=x=_=h=E=m=0,p=$*(w=r[v]),y=$*(T=r[v+1]),g=$*(k=r[v+2]),d=$*(A=r[v+3]),_+=I*w,h+=I*T,E+=I*k,m+=I*A,M=U,l=0;l<$;l++)M.r=w,M.g=T,M.b=k,M.a=A,M=M.next;for(l=1;l<$;l++)u=v+((H<l?H:l)<<2),_+=(M.r=w=r[u])*(R=$-l),h+=(M.g=T=r[u+1])*R,E+=(M.b=k=r[u+2])*R,m+=(M.a=A=r[u+3])*R,b+=w,O+=T,P+=k,x+=A,M=M.next;for(j=U,B=W,a=0;a<n;a++)r[v+3]=A=m*N>>G,A!==0?(A=255/A,r[v]=(_*N>>G)*A,r[v+1]=(h*N>>G)*A,r[v+2]=(E*N>>G)*A):r[v]=r[v+1]=r[v+2]=0,_-=p,h-=y,E-=g,m-=d,p-=j.r,y-=j.g,g-=j.b,d-=j.a,u=S+((u=a+t+1)<H?u:H)<<2,b+=j.r=r[u],O+=j.g=r[u+1],P+=j.b=r[u+2],x+=j.a=r[u+3],_+=b,h+=O,E+=P,m+=x,j=j.next,p+=w=B.r,y+=T=B.g,g+=k=B.b,d+=A=B.a,b-=w,O-=T,P-=k,x-=A,B=B.next,v+=4;S+=n}for(a=0;a<n;a++){for(O=P=x=b=h=E=m=_=0,v=a<<2,p=$*(w=r[v]),y=$*(T=r[v+1]),g=$*(k=r[v+2]),d=$*(A=r[v+3]),_+=I*w,h+=I*T,E+=I*k,m+=I*A,M=U,l=0;l<$;l++)M.r=w,M.g=T,M.b=k,M.a=A,M=M.next;for(f=n,l=1;l<=t;l++)v=f+a<<2,_+=(M.r=w=r[v])*(R=$-l),h+=(M.g=T=r[v+1])*R,E+=(M.b=k=r[v+2])*R,m+=(M.a=A=r[v+3])*R,b+=w,O+=T,P+=k,x+=A,M=M.next,l<Y&&(f+=n);for(v=a,j=U,B=W,o=0;o<i;o++)u=v<<2,r[u+3]=A=m*N>>G,A>0?(A=255/A,r[u]=(_*N>>G)*A,r[u+1]=(h*N>>G)*A,r[u+2]=(E*N>>G)*A):r[u]=r[u+1]=r[u+2]=0,_-=p,h-=y,E-=g,m-=d,p-=j.r,y-=j.g,g-=j.b,d-=j.a,u=a+((u=o+$)<Y?u:Y)*n<<2,_+=b+=j.r=r[u],h+=O+=j.g=r[u+1],E+=P+=j.b=r[u+2],m+=x+=j.a=r[u+3],j=j.next,p+=w=B.r,y+=T=B.g,g+=k=B.b,d+=A=B.a,b-=w,O-=T,P-=k,x-=A,B=B.next,v+=n}}const gA=function(t){var r=Math.round(this.blurRadius());r>0&&pA(t,r)};pp.Blur=gA;M5.Factory.addGetterSetter(cA.Node,"blurRadius",0,(0,fA.getNumberValidator)(),M5.Factory.afterSetFilter);var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.Brighten=void 0;const N5=ot,vA=Gt,mA=Ge,yA=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};gp.Brighten=yA;N5.Factory.addGetterSetter(vA.Node,"brightness",0,(0,mA.getNumberValidator)(),N5.Factory.afterSetFilter);var vp={};Object.defineProperty(vp,"__esModule",{value:!0});vp.Contrast=void 0;const I5=ot,bA=Gt,_A=Ge,wA=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};vp.Contrast=wA;I5.Factory.addGetterSetter(bA.Node,"contrast",0,(0,_A.getNumberValidator)(),I5.Factory.afterSetFilter);var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.Emboss=void 0;const io=ot,yp=Gt,SA=Xt,d9=Ge,EA=function(e){var t=this.embossStrength()*10,r=this.embossWhiteLevel()*255,n=this.embossDirection(),i=this.embossBlend(),a=0,o=0,l=e.data,u=e.width,f=e.height,v=u*4,S=f;switch(n){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:SA.Util.error("Unknown emboss direction: "+n)}do{var _=(S-1)*v,h=a;S+h<1&&(h=0),S+h>f&&(h=0);var E=(S-1+h)*u*4,m=u;do{var p=_+(m-1)*4,y=o;m+y<1&&(y=0),m+y>u&&(y=0);var g=E+(m-1+y)*4,d=l[p]-l[g],b=l[p+1]-l[g+1],O=l[p+2]-l[g+2],P=d,x=P>0?P:-P,w=b>0?b:-b,T=O>0?O:-O;if(w>x&&(P=b),T>x&&(P=O),P*=t,i){var k=l[p]+P,A=l[p+1]+P,R=l[p+2]+P;l[p]=k>255?255:k<0?0:k,l[p+1]=A>255?255:A<0?0:A,l[p+2]=R>255?255:R<0?0:R}else{var F=r-P;F<0?F=0:F>255&&(F=255),l[p]=l[p+1]=l[p+2]=F}}while(--m)}while(--S)};mp.Emboss=EA;io.Factory.addGetterSetter(yp.Node,"embossStrength",.5,(0,d9.getNumberValidator)(),io.Factory.afterSetFilter);io.Factory.addGetterSetter(yp.Node,"embossWhiteLevel",.5,(0,d9.getNumberValidator)(),io.Factory.afterSetFilter);io.Factory.addGetterSetter(yp.Node,"embossDirection","top-left",null,io.Factory.afterSetFilter);io.Factory.addGetterSetter(yp.Node,"embossBlend",!1,null,io.Factory.afterSetFilter);var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Enhance=void 0;const j5=ot,OA=Gt,PA=Ge;function H1(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 xA=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],v=f,S,_,h=this.enhance();if(h!==0){for(_=0;_<r;_+=4)a=t[_+0],a<n?n=a:a>i&&(i=a),u=t[_+1],u<o?o=u:u>l&&(l=u),S=t[_+2],S<f?f=S:S>v&&(v=S);i===n&&(i=255,n=0),l===o&&(l=255,o=0),v===f&&(v=255,f=0);var E,m,p,y,g,d,b,O,P;for(h>0?(m=i+h*(255-i),p=n-h*(n-0),g=l+h*(255-l),d=o-h*(o-0),O=v+h*(255-v),P=f-h*(f-0)):(E=(i+n)*.5,m=i+h*(i-E),p=n+h*(n-E),y=(l+o)*.5,g=l+h*(l-y),d=o+h*(o-y),b=(v+f)*.5,O=v+h*(v-b),P=f+h*(f-b)),_=0;_<r;_+=4)t[_+0]=H1(t[_+0],n,i,p,m),t[_+1]=H1(t[_+1],o,l,d,g),t[_+2]=H1(t[_+2],f,v,P,O)}};bp.Enhance=xA;j5.Factory.addGetterSetter(OA.Node,"enhance",0,(0,PA.getNumberValidator)(),j5.Factory.afterSetFilter);var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Grayscale=void 0;const CA=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};_p.Grayscale=CA;var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.HSL=void 0;const Cs=ot,Oy=Gt,Py=Ge;Cs.Factory.addGetterSetter(Oy.Node,"hue",0,(0,Py.getNumberValidator)(),Cs.Factory.afterSetFilter);Cs.Factory.addGetterSetter(Oy.Node,"saturation",0,(0,Py.getNumberValidator)(),Cs.Factory.afterSetFilter);Cs.Factory.addGetterSetter(Oy.Node,"luminance",0,(0,Py.getNumberValidator)(),Cs.Factory.afterSetFilter);const kA=function(e){var t=e.data,r=t.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,l,u=n*i*Math.cos(a*Math.PI/180),f=n*i*Math.sin(a*Math.PI/180),v=.299*n+.701*u+.167*f,S=.587*n-.587*u+.33*f,_=.114*n-.114*u-.497*f,h=.299*n-.299*u-.328*f,E=.587*n+.413*u+.035*f,m=.114*n-.114*u+.293*f,p=.299*n-.3*u+1.25*f,y=.587*n-.586*u-1.05*f,g=.114*n+.886*u-.2*f,d,b,O,P;for(l=0;l<r;l+=4)d=t[l+0],b=t[l+1],O=t[l+2],P=t[l+3],t[l+0]=v*d+S*b+_*O+o,t[l+1]=h*d+E*b+m*O+o,t[l+2]=p*d+y*b+g*O+o,t[l+3]=P};wp.HSL=kA;var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.HSV=void 0;const ks=ot,xy=Gt,Cy=Ge,TA=function(e){var t=e.data,r=t.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o,l=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),f=.299*n+.701*l+.167*u,v=.587*n-.587*l+.33*u,S=.114*n-.114*l-.497*u,_=.299*n-.299*l-.328*u,h=.587*n+.413*l+.035*u,E=.114*n-.114*l+.293*u,m=.299*n-.3*l+1.25*u,p=.587*n-.586*l-1.05*u,y=.114*n+.886*l-.2*u,g,d,b,O;for(o=0;o<r;o+=4)g=t[o+0],d=t[o+1],b=t[o+2],O=t[o+3],t[o+0]=f*g+v*d+S*b,t[o+1]=_*g+h*d+E*b,t[o+2]=m*g+p*d+y*b,t[o+3]=O};Sp.HSV=TA;ks.Factory.addGetterSetter(xy.Node,"hue",0,(0,Cy.getNumberValidator)(),ks.Factory.afterSetFilter);ks.Factory.addGetterSetter(xy.Node,"saturation",0,(0,Cy.getNumberValidator)(),ks.Factory.afterSetFilter);ks.Factory.addGetterSetter(xy.Node,"value",0,(0,Cy.getNumberValidator)(),ks.Factory.afterSetFilter);var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Invert=void 0;const AA=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]};Ep.Invert=AA;var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Kaleidoscope=void 0;const ch=ot,h9=Gt,D5=Xt,p9=Ge;var RA=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,v,S,_=0,h=0,E=0,m=0,p,y=Math.sqrt(l*l+u*u);v=a-l,S=o-u,p=Math.sqrt(v*v+S*S),y=p>y?p:y;var g=o,d=a,b,O,P=360/d*Math.PI/180,x,w;for(O=0;O<d;O+=1)for(x=Math.sin(O*P),w=Math.cos(O*P),b=0;b<g;b+=1)v=Math.floor(l+y*b/g*w),S=Math.floor(u+y*b/g*x),f=(S*a+v)*4,_=n[f+0],h=n[f+1],E=n[f+2],m=n[f+3],f=(O+b*a)*4,i[f+0]=_,i[f+1]=h,i[f+2]=E,i[f+3]=m},MA=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,v,S,_,h,E=0,m=0,p=0,y=0,g,d=Math.sqrt(l*l+u*u);v=a-l,S=o-u,g=Math.sqrt(v*v+S*S),d=g>d?g:d;var b=o,O=a,P,x,w=r.polarRotation||0,T,k;for(v=0;v<a;v+=1)for(S=0;S<o;S+=1)_=v-l,h=S-u,P=Math.sqrt(_*_+h*h)*b/d,x=(Math.atan2(h,_)*180/Math.PI+360+w)%360,x=x*O/360,T=Math.floor(x),k=Math.floor(P),f=(k*a+T)*4,E=n[f+0],m=n[f+1],p=n[f+2],y=n[f+3],f=(S*a+v)*4,i[f+0]=E,i[f+1]=m,i[f+2]=p,i[f+3]=y};const LA=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,v,S,_,h=Math.round(this.kaleidoscopePower()),E=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(E%360)/360);if(!(h<1)){var p=D5.Util.createCanvasElement();p.width=t,p.height=r;var y=p.getContext("2d").getImageData(0,0,t,r);D5.Util.releaseCanvas(p),RA(e,y,{polarCenterX:t/2,polarCenterY:r/2});for(var g=t/Math.pow(2,h);g<=8;)g=g*2,h-=1;g=Math.ceil(g);var d=g,b=0,O=d,P=1;for(m+g>t&&(b=d,O=0,P=-1),i=0;i<r;i+=1)for(n=b;n!==O;n+=P)a=Math.round(n+m)%t,S=(t*i+a)*4,l=y.data[S+0],u=y.data[S+1],f=y.data[S+2],v=y.data[S+3],_=(t*i+n)*4,y.data[_+0]=l,y.data[_+1]=u,y.data[_+2]=f,y.data[_+3]=v;for(i=0;i<r;i+=1)for(d=Math.floor(g),o=0;o<h;o+=1){for(n=0;n<d+1;n+=1)S=(t*i+n)*4,l=y.data[S+0],u=y.data[S+1],f=y.data[S+2],v=y.data[S+3],_=(t*i+d*2-n-1)*4,y.data[_+0]=l,y.data[_+1]=u,y.data[_+2]=f,y.data[_+3]=v;d*=2}MA(y,e,{polarRotation:0})}};Op.Kaleidoscope=LA;ch.Factory.addGetterSetter(h9.Node,"kaleidoscopePower",2,(0,p9.getNumberValidator)(),ch.Factory.afterSetFilter);ch.Factory.addGetterSetter(h9.Node,"kaleidoscopeAngle",0,(0,p9.getNumberValidator)(),ch.Factory.afterSetFilter);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Mask=void 0;const F5=ot,NA=Gt,IA=Ge;function sd(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 Ou(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 jA(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 DA(e,t){var r=sd(e,0,0),n=sd(e,e.width-1,0),i=sd(e,0,e.height-1),a=sd(e,e.width-1,e.height-1),o=t||10;if(Ou(r,n)<o&&Ou(n,a)<o&&Ou(a,i)<o&&Ou(i,r)<o){for(var l=jA([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var v=Ou(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=v<o?0:255}return u}}function FA(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function zA(e,t,r){for(var n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,v=0,S=0;S<i;S++)for(var _=0;_<i;_++){var h=l+S-a,E=u+_-a;if(h>=0&&h<r&&E>=0&&E<t){var m=h*t+E,p=n[S*i+_];v+=e[m]*p}}o[f]=v===255*8?255:0}return o}function BA(e,t,r){for(var n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,v=0,S=0;S<i;S++)for(var _=0;_<i;_++){var h=l+S-a,E=u+_-a;if(h>=0&&h<r&&E>=0&&E<t){var m=h*t+E,p=n[S*i+_];v+=e[m]*p}}o[f]=v>=255*4?255:0}return o}function UA(e,t,r){for(var n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,v=0,S=0;S<i;S++)for(var _=0;_<i;_++){var h=l+S-a,E=u+_-a;if(h>=0&&h<r&&E>=0&&E<t){var m=h*t+E,p=n[S*i+_];v+=e[m]*p}}o[f]=v}return o}const HA=function(e){var t=this.threshold(),r=DA(e,t);return r&&(r=zA(r,e.width,e.height),r=BA(r,e.width,e.height),r=UA(r,e.width,e.height),FA(e,r)),e};Pp.Mask=HA;F5.Factory.addGetterSetter(NA.Node,"threshold",0,(0,IA.getNumberValidator)(),F5.Factory.afterSetFilter);var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Noise=void 0;const z5=ot,$A=Gt,GA=Ge,VA=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()};xp.Noise=VA;z5.Factory.addGetterSetter($A.Node,"noise",.2,(0,GA.getNumberValidator)(),z5.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Pixelate=void 0;const B5=ot,qA=Xt,WA=Gt,YA=Ge,KA=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,v,S=Math.ceil(r/t),_=Math.ceil(n/t),h,E,m,p,y,g,d,b=e.data;if(t<=0){qA.Util.error("pixelSize value can not be <= 0");return}for(y=0;y<S;y+=1)for(g=0;g<_;g+=1){for(l=0,u=0,f=0,v=0,h=y*t,E=h+t,m=g*t,p=m+t,d=0,i=h;i<E;i+=1)if(!(i>=r))for(a=m;a<p;a+=1)a>=n||(o=(r*a+i)*4,l+=b[o+0],u+=b[o+1],f+=b[o+2],v+=b[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,v=v/d,i=h;i<E;i+=1)if(!(i>=r))for(a=m;a<p;a+=1)a>=n||(o=(r*a+i)*4,b[o+0]=l,b[o+1]=u,b[o+2]=f,b[o+3]=v)}};Cp.Pixelate=KA;B5.Factory.addGetterSetter(WA.Node,"pixelSize",8,(0,YA.getNumberValidator)(),B5.Factory.afterSetFilter);var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.Posterize=void 0;const U5=ot,XA=Gt,ZA=Ge,QA=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};kp.Posterize=QA;U5.Factory.addGetterSetter(XA.Node,"levels",.5,(0,ZA.getNumberValidator)(),U5.Factory.afterSetFilter);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.RGB=void 0;const fh=ot,ky=Gt,JA=Ge,eR=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]};Tp.RGB=eR;fh.Factory.addGetterSetter(ky.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});fh.Factory.addGetterSetter(ky.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});fh.Factory.addGetterSetter(ky.Node,"blue",0,JA.RGBComponent,fh.Factory.afterSetFilter);var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});Ap.RGBA=void 0;const fc=ot,Rp=Gt,tR=Ge,rR=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};Ap.RGBA=rR;fc.Factory.addGetterSetter(Rp.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});fc.Factory.addGetterSetter(Rp.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});fc.Factory.addGetterSetter(Rp.Node,"blue",0,tR.RGBComponent,fc.Factory.afterSetFilter);fc.Factory.addGetterSetter(Rp.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Sepia=void 0;const nR=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)};Mp.Sepia=nR;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.Solarize=void 0;const iR=function(e){var t=e.data,r=e.width,n=e.height,i=r*4,a=n;do{var o=(a-1)*i,l=r;do{var u=o+(l-1)*4,f=t[u],v=t[u+1],S=t[u+2];f>127&&(f=255-f),v>127&&(v=255-v),S>127&&(S=255-S),t[u]=f,t[u+1]=v,t[u+2]=S}while(--l)}while(--a)};Lp.Solarize=iR;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Threshold=void 0;const H5=ot,aR=Gt,oR=Ge,lR=function(e){var t=this.threshold()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=1)r[i]=r[i]<t?0:255};Np.Threshold=lR;H5.Factory.addGetterSetter(aR.Node,"threshold",.5,(0,oR.getNumberValidator)(),H5.Factory.afterSetFilter);Object.defineProperty($h,"__esModule",{value:!0});$h.Konva=void 0;const $5=lh,sR=Kh,uR=Qh,cR=tp,fR=rp,dR=np,G5=xs,hR=Nc,pR=$s,gR=Dc,vR=op,mR=lp,yR=sp,bR=up,_R=nl,wR=cp,SR=fp,ER=dp,OR=pp,PR=gp,xR=vp,CR=mp,kR=bp,TR=_p,AR=wp,RR=Sp,MR=Ep,LR=Op,NR=Pp,IR=xp,jR=Cp,DR=kp,FR=Tp,zR=Ap,BR=Mp,UR=Lp,HR=Np;$h.Konva=$5.Konva.Util._assign($5.Konva,{Arc:sR.Arc,Arrow:uR.Arrow,Circle:cR.Circle,Ellipse:fR.Ellipse,Image:dR.Image,Label:G5.Label,Tag:G5.Tag,Line:hR.Line,Path:pR.Path,Rect:gR.Rect,RegularPolygon:vR.RegularPolygon,Ring:mR.Ring,Sprite:yR.Sprite,Star:bR.Star,Text:_R.Text,TextPath:wR.TextPath,Transformer:SR.Transformer,Wedge:ER.Wedge,Filters:{Blur:OR.Blur,Brighten:PR.Brighten,Contrast:xR.Contrast,Emboss:CR.Emboss,Enhance:kR.Enhance,Grayscale:TR.Grayscale,HSL:AR.HSL,HSV:RR.HSV,Invert:MR.Invert,Kaleidoscope:LR.Kaleidoscope,Mask:NR.Mask,Noise:IR.Noise,Pixelate:jR.Pixelate,Posterize:DR.Posterize,RGB:FR.RGB,RGBA:zR.RGBA,Sepia:BR.Sepia,Solarize:UR.Solarize,Threshold:HR.Threshold}});var $R=py.exports;Object.defineProperty($R,"__esModule",{value:!0});const GR=$h;py.exports=GR.Konva;var Kn=py.exports,Yv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=lh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=lh;e.exports=n.Konva})(Yv,Yv.exports);var VR=Yv.exports;const dc=vh(VR);var g9={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 qR=function(t){var r={},n=Qe,i=Au,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,C=1;C<arguments.length;C++)c+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),E=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),O=Symbol.iterator;function P(s){return s===null||typeof s!="object"?null:(s=O&&s[O]||s["@@iterator"],typeof s=="function"?s:null)}function x(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case v:return"Fragment";case f:return"Portal";case _:return"Profiler";case S:return"StrictMode";case p:return"Suspense";case y:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case E:return(s.displayName||"Context")+".Consumer";case h:return(s._context.displayName||"Context")+".Provider";case m:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case g:return c=s.displayName||null,c!==null?c:x(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return x(s(c))}catch{}}return null}function w(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return x(c);case 8:return c===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function T(s){var c=s,C=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(C=c.return),s=c.return;while(s)}return c.tag===3?C:null}function k(s){if(T(s)!==s)throw Error(o(188))}function A(s){var c=s.alternate;if(!c){if(c=T(s),c===null)throw Error(o(188));return c!==s?null:s}for(var C=s,L=c;;){var D=C.return;if(D===null)break;var V=D.alternate;if(V===null){if(L=D.return,L!==null){C=L;continue}break}if(D.child===V.child){for(V=D.child;V;){if(V===C)return k(D),s;if(V===L)return k(D),c;V=V.sibling}throw Error(o(188))}if(C.return!==L.return)C=D,L=V;else{for(var Q=!1,ae=D.child;ae;){if(ae===C){Q=!0,C=D,L=V;break}if(ae===L){Q=!0,L=D,C=V;break}ae=ae.sibling}if(!Q){for(ae=V.child;ae;){if(ae===C){Q=!0,C=V,L=D;break}if(ae===L){Q=!0,L=V,C=D;break}ae=ae.sibling}if(!Q)throw Error(o(189))}}if(C.alternate!==L)throw Error(o(190))}if(C.tag!==3)throw Error(o(188));return C.stateNode.current===C?s:c}function R(s){return s=A(s),s!==null?F(s):null}function F(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=F(s);if(c!==null)return c;s=s.sibling}return null}function H(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=H(s);if(c!==null)return c}s=s.sibling}return null}var Y=Array.isArray,$=t.getPublicInstance,I=t.getRootHostContext,U=t.getChildHostContext,W=t.prepareForCommit,M=t.resetAfterCommit,j=t.createInstance,B=t.appendInitialChild,N=t.finalizeInitialChildren,G=t.prepareUpdate,K=t.shouldSetTextContent,q=t.createTextInstance,z=t.scheduleTimeout,X=t.cancelTimeout,Z=t.noTimeout,J=t.isPrimaryRenderer,te=t.supportsMutation,ee=t.supportsPersistence,se=t.supportsHydration,de=t.getInstanceFromNode,he=t.preparePortalMount,ke=t.getCurrentEventPriority,Ie=t.detachDeletedInstance,ue=t.supportsMicrotasks,ie=t.scheduleMicrotask,_e=t.supportsTestSelectors,Se=t.findFiberRoot,re=t.getBoundingRect,ce=t.getTextContent,ge=t.isHiddenSubtree,me=t.matchAccessibilityRole,we=t.setFocusIfFocusable,Ee=t.setupIntersectionObserver,Te=t.appendChild,Je=t.appendChildToContainer,Ye=t.commitTextUpdate,pt=t.commitMount,It=t.commitUpdate,le=t.insertBefore,ne=t.insertInContainerBefore,Re=t.removeChild,Me=t.removeChildFromContainer,ye=t.resetTextContent,Le=t.hideInstance,Oe=t.hideTextInstance,qe=t.unhideInstance,Pt=t.unhideTextInstance,_t=t.clearContainer,Ae=t.cloneInstance,$e=t.createContainerChildSet,Xe=t.appendChildToContainerChildSet,xt=t.finalizeContainerChildren,St=t.replaceContainerChildren,mn=t.cloneHiddenInstance,lr=t.cloneHiddenTextInstance,Or=t.canHydrateInstance,yn=t.canHydrateTextInstance,Xn=t.canHydrateSuspenseInstance,Ne=t.isSuspenseInstancePending,Ke=t.isSuspenseInstanceFallback,ft=t.getSuspenseInstanceFallbackErrorDetails,Ct=t.registerSuspenseInstanceRetry,gt=t.getNextHydratableSibling,nr=t.getFirstHydratableChild,Zr=t.getFirstHydratableChildWithinContainer,sr=t.getFirstHydratableChildWithinSuspenseInstance,bn=t.hydrateInstance,Pr=t.hydrateTextInstance,Qr=t.hydrateSuspenseInstance,_i=t.getNextHydratableInstanceAfterSuspenseInstance,Sa=t.commitHydratedContainer,wo=t.commitHydratedSuspenseInstance,So=t.clearSuspenseBoundary,Ea=t.clearSuspenseBoundaryFromContainer,$c=t.shouldDeleteUnhydratedTailInstances,Gc=t.didNotMatchHydratedContainerTextInstance,aS=t.didNotMatchHydratedTextInstance,$p;function Ys(s){if($p===void 0)try{throw Error()}catch(C){var c=C.stack.trim().match(/\n( *(at )?)/);$p=c&&c[1]||""}return`
|
|
52
|
+
`+$p+s}var Gp=!1;function Vp(s,c){if(!s||Gp)return"";Gp=!0;var C=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(xe){var L=xe}Reflect.construct(s,[],c)}else{try{c.call()}catch(xe){L=xe}s.call(c.prototype)}else{try{throw Error()}catch(xe){L=xe}s()}}catch(xe){if(xe&&L&&typeof xe.stack=="string"){for(var D=xe.stack.split(`
|
|
53
|
+
`),V=L.stack.split(`
|
|
54
|
+
`),Q=D.length-1,ae=V.length-1;1<=Q&&0<=ae&&D[Q]!==V[ae];)ae--;for(;1<=Q&&0<=ae;Q--,ae--)if(D[Q]!==V[ae]){if(Q!==1||ae!==1)do if(Q--,ae--,0>ae||D[Q]!==V[ae]){var pe=`
|
|
55
|
+
`+D[Q].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=Q&&0<=ae);break}}}finally{Gp=!1,Error.prepareStackTrace=C}return(s=s?s.displayName||s.name:"")?Ys(s):""}var oS=Object.prototype.hasOwnProperty,qp=[],Ol=-1;function Oa(s){return{current:s}}function jt(s){0>Ol||(s.current=qp[Ol],qp[Ol]=null,Ol--)}function Mt(s,c){Ol++,qp[Ol]=s.current,s.current=c}var Pa={},Lr=Oa(Pa),Jr=Oa(!1),Eo=Pa;function Pl(s,c){var C=s.type.contextTypes;if(!C)return Pa;var L=s.stateNode;if(L&&L.__reactInternalMemoizedUnmaskedChildContext===c)return L.__reactInternalMemoizedMaskedChildContext;var D={},V;for(V in C)D[V]=c[V];return L&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=D),D}function en(s){return s=s.childContextTypes,s!=null}function Vc(){jt(Jr),jt(Lr)}function n2(s,c,C){if(Lr.current!==Pa)throw Error(o(168));Mt(Lr,c),Mt(Jr,C)}function i2(s,c,C){var L=s.stateNode;if(c=c.childContextTypes,typeof L.getChildContext!="function")return C;L=L.getChildContext();for(var D in L)if(!(D in c))throw Error(o(108,w(s)||"Unknown",D));return a({},C,L)}function qc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Pa,Eo=Lr.current,Mt(Lr,s),Mt(Jr,Jr.current),!0}function a2(s,c,C){var L=s.stateNode;if(!L)throw Error(o(169));C?(s=i2(s,c,Eo),L.__reactInternalMemoizedMergedChildContext=s,jt(Jr),jt(Lr),Mt(Lr,s)):jt(Jr),Mt(Jr,C)}var Zn=Math.clz32?Math.clz32:uS,lS=Math.log,sS=Math.LN2;function uS(s){return s>>>=0,s===0?32:31-(lS(s)/sS|0)|0}var Wc=64,Yc=4194304;function Ks(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 Kc(s,c){var C=s.pendingLanes;if(C===0)return 0;var L=0,D=s.suspendedLanes,V=s.pingedLanes,Q=C&268435455;if(Q!==0){var ae=Q&~D;ae!==0?L=Ks(ae):(V&=Q,V!==0&&(L=Ks(V)))}else Q=C&~D,Q!==0?L=Ks(Q):V!==0&&(L=Ks(V));if(L===0)return 0;if(c!==0&&c!==L&&!(c&D)&&(D=L&-L,V=c&-c,D>=V||D===16&&(V&4194240)!==0))return c;if(L&4&&(L|=C&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=L;0<c;)C=31-Zn(c),D=1<<C,L|=s[C],c&=~D;return L}function cS(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 fS(s,c){for(var C=s.suspendedLanes,L=s.pingedLanes,D=s.expirationTimes,V=s.pendingLanes;0<V;){var Q=31-Zn(V),ae=1<<Q,pe=D[Q];pe===-1?(!(ae&C)||ae&L)&&(D[Q]=cS(ae,c)):pe<=c&&(s.expiredLanes|=ae),V&=~ae}}function Wp(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function o2(){var s=Wc;return Wc<<=1,!(Wc&4194240)&&(Wc=64),s}function Yp(s){for(var c=[],C=0;31>C;C++)c.push(s);return c}function Xs(s,c,C){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Zn(c),s[c]=C}function dS(s,c){var C=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 L=s.eventTimes;for(s=s.expirationTimes;0<C;){var D=31-Zn(C),V=1<<D;c[D]=0,L[D]=-1,s[D]=-1,C&=~V}}function Kp(s,c){var C=s.entangledLanes|=c;for(s=s.entanglements;C;){var L=31-Zn(C),D=1<<L;D&c|s[L]&c&&(s[L]|=c),C&=~D}}var vt=0;function l2(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var Xp=i.unstable_scheduleCallback,s2=i.unstable_cancelCallback,hS=i.unstable_shouldYield,pS=i.unstable_requestPaint,vr=i.unstable_now,Zp=i.unstable_ImmediatePriority,gS=i.unstable_UserBlockingPriority,Qp=i.unstable_NormalPriority,vS=i.unstable_IdlePriority,Xc=null,wi=null;function mS(s){if(wi&&typeof wi.onCommitFiberRoot=="function")try{wi.onCommitFiberRoot(Xc,s,void 0,(s.current.flags&128)===128)}catch{}}function yS(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Qn=typeof Object.is=="function"?Object.is:yS,$i=null,Zc=!1,Jp=!1;function u2(s){$i===null?$i=[s]:$i.push(s)}function bS(s){Zc=!0,u2(s)}function Si(){if(!Jp&&$i!==null){Jp=!0;var s=0,c=vt;try{var C=$i;for(vt=1;s<C.length;s++){var L=C[s];do L=L(!0);while(L!==null)}$i=null,Zc=!1}catch(D){throw $i!==null&&($i=$i.slice(s+1)),Xp(Zp,Si),D}finally{vt=c,Jp=!1}}return null}var xl=[],Cl=0,Qc=null,Jc=0,Rn=[],Mn=0,Oo=null,Gi=1,Vi="";function Po(s,c){xl[Cl++]=Jc,xl[Cl++]=Qc,Qc=s,Jc=c}function c2(s,c,C){Rn[Mn++]=Gi,Rn[Mn++]=Vi,Rn[Mn++]=Oo,Oo=s;var L=Gi;s=Vi;var D=32-Zn(L)-1;L&=~(1<<D),C+=1;var V=32-Zn(c)+D;if(30<V){var Q=D-D%5;V=(L&(1<<Q)-1).toString(32),L>>=Q,D-=Q,Gi=1<<32-Zn(c)+D|C<<D|L,Vi=V+s}else Gi=1<<V|C<<D|L,Vi=s}function e0(s){s.return!==null&&(Po(s,1),c2(s,1,0))}function t0(s){for(;s===Qc;)Qc=xl[--Cl],xl[Cl]=null,Jc=xl[--Cl],xl[Cl]=null;for(;s===Oo;)Oo=Rn[--Mn],Rn[Mn]=null,Vi=Rn[--Mn],Rn[Mn]=null,Gi=Rn[--Mn],Rn[Mn]=null}var _n=null,Ln=null,Ut=!1,Zs=!1,Jn=null;function f2(s,c){var C=Fn(5,null,null,0);C.elementType="DELETED",C.stateNode=c,C.return=s,c=s.deletions,c===null?(s.deletions=[C],s.flags|=16):c.push(C)}function d2(s,c){switch(s.tag){case 5:return c=Or(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,_n=s,Ln=nr(c),!0):!1;case 6:return c=yn(c,s.pendingProps),c!==null?(s.stateNode=c,_n=s,Ln=null,!0):!1;case 13:if(c=Xn(c),c!==null){var C=Oo!==null?{id:Gi,overflow:Vi}:null;return s.memoizedState={dehydrated:c,treeContext:C,retryLane:1073741824},C=Fn(18,null,null,0),C.stateNode=c,C.return=s,s.child=C,_n=s,Ln=null,!0}return!1;default:return!1}}function r0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function n0(s){if(Ut){var c=Ln;if(c){var C=c;if(!d2(s,c)){if(r0(s))throw Error(o(418));c=gt(C);var L=_n;c&&d2(s,c)?f2(L,C):(s.flags=s.flags&-4097|2,Ut=!1,_n=s)}}else{if(r0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Ut=!1,_n=s}}}function h2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;_n=s}function ef(s){if(!se||s!==_n)return!1;if(!Ut)return h2(s),Ut=!0,!1;if(s.tag!==3&&(s.tag!==5||$c(s.type)&&!K(s.type,s.memoizedProps))){var c=Ln;if(c){if(r0(s))throw p2(),Error(o(418));for(;c;)f2(s,c),c=gt(c)}}if(h2(s),s.tag===13){if(!se)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));Ln=_i(s)}else Ln=_n?gt(s.stateNode):null;return!0}function p2(){for(var s=Ln;s;)s=gt(s)}function kl(){se&&(Ln=_n=null,Zs=Ut=!1)}function i0(s){Jn===null?Jn=[s]:Jn.push(s)}var _S=l.ReactCurrentBatchConfig;function tf(s,c){if(Qn(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var C=Object.keys(s),L=Object.keys(c);if(C.length!==L.length)return!1;for(L=0;L<C.length;L++){var D=C[L];if(!oS.call(c,D)||!Qn(s[D],c[D]))return!1}return!0}function wS(s){switch(s.tag){case 5:return Ys(s.type);case 16:return Ys("Lazy");case 13:return Ys("Suspense");case 19:return Ys("SuspenseList");case 0:case 2:case 15:return s=Vp(s.type,!1),s;case 11:return s=Vp(s.type.render,!1),s;case 1:return s=Vp(s.type,!0),s;default:return""}}function ei(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var C in s)c[C]===void 0&&(c[C]=s[C]);return c}return c}var rf=Oa(null),nf=null,Tl=null,a0=null;function o0(){a0=Tl=nf=null}function g2(s,c,C){J?(Mt(rf,c._currentValue),c._currentValue=C):(Mt(rf,c._currentValue2),c._currentValue2=C)}function l0(s){var c=rf.current;jt(rf),J?s._currentValue=c:s._currentValue2=c}function s0(s,c,C){for(;s!==null;){var L=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,L!==null&&(L.childLanes|=c)):L!==null&&(L.childLanes&c)!==c&&(L.childLanes|=c),s===C)break;s=s.return}}function Al(s,c){nf=s,a0=Tl=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(tn=!0),s.firstContext=null)}function Nn(s){var c=J?s._currentValue:s._currentValue2;if(a0!==s)if(s={context:s,memoizedValue:c,next:null},Tl===null){if(nf===null)throw Error(o(308));Tl=s,nf.dependencies={lanes:0,firstContext:s}}else Tl=Tl.next=s;return c}var xo=null;function u0(s){xo===null?xo=[s]:xo.push(s)}function v2(s,c,C,L){var D=c.interleaved;return D===null?(C.next=C,u0(c)):(C.next=D.next,D.next=C),c.interleaved=C,Ei(s,L)}function Ei(s,c){s.lanes|=c;var C=s.alternate;for(C!==null&&(C.lanes|=c),C=s,s=s.return;s!==null;)s.childLanes|=c,C=s.alternate,C!==null&&(C.childLanes|=c),C=s,s=s.return;return C.tag===3?C.stateNode:null}var xa=!1;function c0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function m2(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 qi(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function Ca(s,c,C){var L=s.updateQueue;if(L===null)return null;if(L=L.shared,lt&2){var D=L.pending;return D===null?c.next=c:(c.next=D.next,D.next=c),L.pending=c,Ei(s,C)}return D=L.interleaved,D===null?(c.next=c,u0(L)):(c.next=D.next,D.next=c),L.interleaved=c,Ei(s,C)}function af(s,c,C){if(c=c.updateQueue,c!==null&&(c=c.shared,(C&4194240)!==0)){var L=c.lanes;L&=s.pendingLanes,C|=L,c.lanes=C,Kp(s,C)}}function y2(s,c){var C=s.updateQueue,L=s.alternate;if(L!==null&&(L=L.updateQueue,C===L)){var D=null,V=null;if(C=C.firstBaseUpdate,C!==null){do{var Q={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};V===null?D=V=Q:V=V.next=Q,C=C.next}while(C!==null);V===null?D=V=c:V=V.next=c}else D=V=c;C={baseState:L.baseState,firstBaseUpdate:D,lastBaseUpdate:V,shared:L.shared,effects:L.effects},s.updateQueue=C;return}s=C.lastBaseUpdate,s===null?C.firstBaseUpdate=c:s.next=c,C.lastBaseUpdate=c}function of(s,c,C,L){var D=s.updateQueue;xa=!1;var V=D.firstBaseUpdate,Q=D.lastBaseUpdate,ae=D.shared.pending;if(ae!==null){D.shared.pending=null;var pe=ae,xe=pe.next;pe.next=null,Q===null?V=xe:Q.next=xe,Q=pe;var Ue=s.alternate;Ue!==null&&(Ue=Ue.updateQueue,ae=Ue.lastBaseUpdate,ae!==Q&&(ae===null?Ue.firstBaseUpdate=xe:ae.next=xe,Ue.lastBaseUpdate=pe))}if(V!==null){var et=D.baseState;Q=0,Ue=xe=pe=null,ae=V;do{var je=ae.lane,Dt=ae.eventTime;if((L&je)===je){Ue!==null&&(Ue=Ue.next={eventTime:Dt,lane:0,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null});e:{var At=s,an=ae;switch(je=c,Dt=C,an.tag){case 1:if(At=an.payload,typeof At=="function"){et=At.call(Dt,et,je);break e}et=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=an.payload,je=typeof At=="function"?At.call(Dt,et,je):At,je==null)break e;et=a({},et,je);break e;case 2:xa=!0}}ae.callback!==null&&ae.lane!==0&&(s.flags|=64,je=D.effects,je===null?D.effects=[ae]:je.push(ae))}else Dt={eventTime:Dt,lane:je,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ue===null?(xe=Ue=Dt,pe=et):Ue=Ue.next=Dt,Q|=je;if(ae=ae.next,ae===null){if(ae=D.shared.pending,ae===null)break;je=ae,ae=je.next,je.next=null,D.lastBaseUpdate=je,D.shared.pending=null}}while(!0);if(Ue===null&&(pe=et),D.baseState=pe,D.firstBaseUpdate=xe,D.lastBaseUpdate=Ue,c=D.shared.interleaved,c!==null){D=c;do Q|=D.lane,D=D.next;while(D!==c)}else V===null&&(D.shared.lanes=0);ko|=Q,s.lanes=Q,s.memoizedState=et}}function b2(s,c,C){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var L=s[c],D=L.callback;if(D!==null){if(L.callback=null,L=C,typeof D!="function")throw Error(o(191,D));D.call(L)}}}var _2=new n.Component().refs;function f0(s,c,C,L){c=s.memoizedState,C=C(L,c),C=C==null?c:a({},c,C),s.memoizedState=C,s.lanes===0&&(s.updateQueue.baseState=C)}var lf={isMounted:function(s){return(s=s._reactInternals)?T(s)===s:!1},enqueueSetState:function(s,c,C){s=s._reactInternals;var L=Dr(),D=Aa(s),V=qi(L,D);V.payload=c,C!=null&&(V.callback=C),c=Ca(s,V,D),c!==null&&(Dn(c,s,D,L),af(c,s,D))},enqueueReplaceState:function(s,c,C){s=s._reactInternals;var L=Dr(),D=Aa(s),V=qi(L,D);V.tag=1,V.payload=c,C!=null&&(V.callback=C),c=Ca(s,V,D),c!==null&&(Dn(c,s,D,L),af(c,s,D))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var C=Dr(),L=Aa(s),D=qi(C,L);D.tag=2,c!=null&&(D.callback=c),c=Ca(s,D,L),c!==null&&(Dn(c,s,L,C),af(c,s,L))}};function w2(s,c,C,L,D,V,Q){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(L,V,Q):c.prototype&&c.prototype.isPureReactComponent?!tf(C,L)||!tf(D,V):!0}function S2(s,c,C){var L=!1,D=Pa,V=c.contextType;return typeof V=="object"&&V!==null?V=Nn(V):(D=en(c)?Eo:Lr.current,L=c.contextTypes,V=(L=L!=null)?Pl(s,D):Pa),c=new c(C,V),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=lf,s.stateNode=c,c._reactInternals=s,L&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=D,s.__reactInternalMemoizedMaskedChildContext=V),c}function E2(s,c,C,L){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(C,L),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(C,L),c.state!==s&&lf.enqueueReplaceState(c,c.state,null)}function d0(s,c,C,L){var D=s.stateNode;D.props=C,D.state=s.memoizedState,D.refs=_2,c0(s);var V=c.contextType;typeof V=="object"&&V!==null?D.context=Nn(V):(V=en(c)?Eo:Lr.current,D.context=Pl(s,V)),D.state=s.memoizedState,V=c.getDerivedStateFromProps,typeof V=="function"&&(f0(s,c,V,C),D.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof D.getSnapshotBeforeUpdate=="function"||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(c=D.state,typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount(),c!==D.state&&lf.enqueueReplaceState(D,D.state,null),of(s,C,D,L),D.state=s.memoizedState),typeof D.componentDidMount=="function"&&(s.flags|=4194308)}function Qs(s,c,C){if(s=C.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(o(309));var L=C.stateNode}if(!L)throw Error(o(147,s));var D=L,V=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===V?c.ref:(c=function(Q){var ae=D.refs;ae===_2&&(ae=D.refs={}),Q===null?delete ae[V]:ae[V]=Q},c._stringRef=V,c)}if(typeof s!="string")throw Error(o(284));if(!C._owner)throw Error(o(290,s))}return s}function sf(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function O2(s){var c=s._init;return c(s._payload)}function P2(s){function c(fe,oe){if(s){var ve=fe.deletions;ve===null?(fe.deletions=[oe],fe.flags|=16):ve.push(oe)}}function C(fe,oe){if(!s)return null;for(;oe!==null;)c(fe,oe),oe=oe.sibling;return null}function L(fe,oe){for(fe=new Map;oe!==null;)oe.key!==null?fe.set(oe.key,oe):fe.set(oe.index,oe),oe=oe.sibling;return fe}function D(fe,oe){return fe=Ma(fe,oe),fe.index=0,fe.sibling=null,fe}function V(fe,oe,ve){return fe.index=ve,s?(ve=fe.alternate,ve!==null?(ve=ve.index,ve<oe?(fe.flags|=2,oe):ve):(fe.flags|=2,oe)):(fe.flags|=1048576,oe)}function Q(fe){return s&&fe.alternate===null&&(fe.flags|=2),fe}function ae(fe,oe,ve,De){return oe===null||oe.tag!==6?(oe=J0(ve,fe.mode,De),oe.return=fe,oe):(oe=D(oe,ve),oe.return=fe,oe)}function pe(fe,oe,ve,De){var We=ve.type;return We===v?Ue(fe,oe,ve.props.children,De,ve.key):oe!==null&&(oe.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===d&&O2(We)===oe.type)?(De=D(oe,ve.props),De.ref=Qs(fe,oe,ve),De.return=fe,De):(De=Nf(ve.type,ve.key,ve.props,null,fe.mode,De),De.ref=Qs(fe,oe,ve),De.return=fe,De)}function xe(fe,oe,ve,De){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==ve.containerInfo||oe.stateNode.implementation!==ve.implementation?(oe=e1(ve,fe.mode,De),oe.return=fe,oe):(oe=D(oe,ve.children||[]),oe.return=fe,oe)}function Ue(fe,oe,ve,De,We){return oe===null||oe.tag!==7?(oe=Mo(ve,fe.mode,De,We),oe.return=fe,oe):(oe=D(oe,ve),oe.return=fe,oe)}function et(fe,oe,ve){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return oe=J0(""+oe,fe.mode,ve),oe.return=fe,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case u:return ve=Nf(oe.type,oe.key,oe.props,null,fe.mode,ve),ve.ref=Qs(fe,null,oe),ve.return=fe,ve;case f:return oe=e1(oe,fe.mode,ve),oe.return=fe,oe;case d:var De=oe._init;return et(fe,De(oe._payload),ve)}if(Y(oe)||P(oe))return oe=Mo(oe,fe.mode,ve,null),oe.return=fe,oe;sf(fe,oe)}return null}function je(fe,oe,ve,De){var We=oe!==null?oe.key:null;if(typeof ve=="string"&&ve!==""||typeof ve=="number")return We!==null?null:ae(fe,oe,""+ve,De);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case u:return ve.key===We?pe(fe,oe,ve,De):null;case f:return ve.key===We?xe(fe,oe,ve,De):null;case d:return We=ve._init,je(fe,oe,We(ve._payload),De)}if(Y(ve)||P(ve))return We!==null?null:Ue(fe,oe,ve,De,null);sf(fe,ve)}return null}function Dt(fe,oe,ve,De,We){if(typeof De=="string"&&De!==""||typeof De=="number")return fe=fe.get(ve)||null,ae(oe,fe,""+De,We);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case u:return fe=fe.get(De.key===null?ve:De.key)||null,pe(oe,fe,De,We);case f:return fe=fe.get(De.key===null?ve:De.key)||null,xe(oe,fe,De,We);case d:var it=De._init;return Dt(fe,oe,ve,it(De._payload),We)}if(Y(De)||P(De))return fe=fe.get(ve)||null,Ue(oe,fe,De,We,null);sf(oe,De)}return null}function At(fe,oe,ve,De){for(var We=null,it=null,tt=oe,mt=oe=0,br=null;tt!==null&&mt<ve.length;mt++){tt.index>mt?(br=tt,tt=null):br=tt.sibling;var yt=je(fe,tt,ve[mt],De);if(yt===null){tt===null&&(tt=br);break}s&&tt&&yt.alternate===null&&c(fe,tt),oe=V(yt,oe,mt),it===null?We=yt:it.sibling=yt,it=yt,tt=br}if(mt===ve.length)return C(fe,tt),Ut&&Po(fe,mt),We;if(tt===null){for(;mt<ve.length;mt++)tt=et(fe,ve[mt],De),tt!==null&&(oe=V(tt,oe,mt),it===null?We=tt:it.sibling=tt,it=tt);return Ut&&Po(fe,mt),We}for(tt=L(fe,tt);mt<ve.length;mt++)br=Dt(tt,fe,mt,ve[mt],De),br!==null&&(s&&br.alternate!==null&&tt.delete(br.key===null?mt:br.key),oe=V(br,oe,mt),it===null?We=br:it.sibling=br,it=br);return s&&tt.forEach(function(La){return c(fe,La)}),Ut&&Po(fe,mt),We}function an(fe,oe,ve,De){var We=P(ve);if(typeof We!="function")throw Error(o(150));if(ve=We.call(ve),ve==null)throw Error(o(151));for(var it=We=null,tt=oe,mt=oe=0,br=null,yt=ve.next();tt!==null&&!yt.done;mt++,yt=ve.next()){tt.index>mt?(br=tt,tt=null):br=tt.sibling;var La=je(fe,tt,yt.value,De);if(La===null){tt===null&&(tt=br);break}s&&tt&&La.alternate===null&&c(fe,tt),oe=V(La,oe,mt),it===null?We=La:it.sibling=La,it=La,tt=br}if(yt.done)return C(fe,tt),Ut&&Po(fe,mt),We;if(tt===null){for(;!yt.done;mt++,yt=ve.next())yt=et(fe,yt.value,De),yt!==null&&(oe=V(yt,oe,mt),it===null?We=yt:it.sibling=yt,it=yt);return Ut&&Po(fe,mt),We}for(tt=L(fe,tt);!yt.done;mt++,yt=ve.next())yt=Dt(tt,fe,mt,yt.value,De),yt!==null&&(s&&yt.alternate!==null&&tt.delete(yt.key===null?mt:yt.key),oe=V(yt,oe,mt),it===null?We=yt:it.sibling=yt,it=yt);return s&&tt.forEach(function(ZS){return c(fe,ZS)}),Ut&&Po(fe,mt),We}function Ki(fe,oe,ve,De){if(typeof ve=="object"&&ve!==null&&ve.type===v&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case u:e:{for(var We=ve.key,it=oe;it!==null;){if(it.key===We){if(We=ve.type,We===v){if(it.tag===7){C(fe,it.sibling),oe=D(it,ve.props.children),oe.return=fe,fe=oe;break e}}else if(it.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===d&&O2(We)===it.type){C(fe,it.sibling),oe=D(it,ve.props),oe.ref=Qs(fe,it,ve),oe.return=fe,fe=oe;break e}C(fe,it);break}else c(fe,it);it=it.sibling}ve.type===v?(oe=Mo(ve.props.children,fe.mode,De,ve.key),oe.return=fe,fe=oe):(De=Nf(ve.type,ve.key,ve.props,null,fe.mode,De),De.ref=Qs(fe,oe,ve),De.return=fe,fe=De)}return Q(fe);case f:e:{for(it=ve.key;oe!==null;){if(oe.key===it)if(oe.tag===4&&oe.stateNode.containerInfo===ve.containerInfo&&oe.stateNode.implementation===ve.implementation){C(fe,oe.sibling),oe=D(oe,ve.children||[]),oe.return=fe,fe=oe;break e}else{C(fe,oe);break}else c(fe,oe);oe=oe.sibling}oe=e1(ve,fe.mode,De),oe.return=fe,fe=oe}return Q(fe);case d:return it=ve._init,Ki(fe,oe,it(ve._payload),De)}if(Y(ve))return At(fe,oe,ve,De);if(P(ve))return an(fe,oe,ve,De);sf(fe,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,oe!==null&&oe.tag===6?(C(fe,oe.sibling),oe=D(oe,ve),oe.return=fe,fe=oe):(C(fe,oe),oe=J0(ve,fe.mode,De),oe.return=fe,fe=oe),Q(fe)):C(fe,oe)}return Ki}var Rl=P2(!0),x2=P2(!1),Js={},In=Oa(Js),eu=Oa(Js),Ml=Oa(Js);function Oi(s){if(s===Js)throw Error(o(174));return s}function h0(s,c){Mt(Ml,c),Mt(eu,s),Mt(In,Js),s=I(c),jt(In),Mt(In,s)}function Ll(){jt(In),jt(eu),jt(Ml)}function C2(s){var c=Oi(Ml.current),C=Oi(In.current);c=U(C,s.type,c),C!==c&&(Mt(eu,s),Mt(In,c))}function p0(s){eu.current===s&&(jt(In),jt(eu))}var Vt=Oa(0);function uf(s){for(var c=s;c!==null;){if(c.tag===13){var C=c.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||Ne(C)||Ke(C)))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 g0=[];function v0(){for(var s=0;s<g0.length;s++){var c=g0[s];J?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}g0.length=0}var cf=l.ReactCurrentDispatcher,m0=l.ReactCurrentBatchConfig,Co=0,qt=null,ur=null,mr=null,ff=!1,tu=!1,ru=0,SS=0;function Nr(){throw Error(o(321))}function y0(s,c){if(c===null)return!1;for(var C=0;C<c.length&&C<s.length;C++)if(!Qn(s[C],c[C]))return!1;return!0}function b0(s,c,C,L,D,V){if(Co=V,qt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,cf.current=s===null||s.memoizedState===null?xS:CS,s=C(L,D),tu){V=0;do{if(tu=!1,ru=0,25<=V)throw Error(o(301));V+=1,mr=ur=null,c.updateQueue=null,cf.current=kS,s=C(L,D)}while(tu)}if(cf.current=pf,c=ur!==null&&ur.next!==null,Co=0,mr=ur=qt=null,ff=!1,c)throw Error(o(300));return s}function _0(){var s=ru!==0;return ru=0,s}function Pi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mr===null?qt.memoizedState=mr=s:mr=mr.next=s,mr}function jn(){if(ur===null){var s=qt.alternate;s=s!==null?s.memoizedState:null}else s=ur.next;var c=mr===null?qt.memoizedState:mr.next;if(c!==null)mr=c,ur=s;else{if(s===null)throw Error(o(310));ur=s,s={memoizedState:ur.memoizedState,baseState:ur.baseState,baseQueue:ur.baseQueue,queue:ur.queue,next:null},mr===null?qt.memoizedState=mr=s:mr=mr.next=s}return mr}function nu(s,c){return typeof c=="function"?c(s):c}function w0(s){var c=jn(),C=c.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=s;var L=ur,D=L.baseQueue,V=C.pending;if(V!==null){if(D!==null){var Q=D.next;D.next=V.next,V.next=Q}L.baseQueue=D=V,C.pending=null}if(D!==null){V=D.next,L=L.baseState;var ae=Q=null,pe=null,xe=V;do{var Ue=xe.lane;if((Co&Ue)===Ue)pe!==null&&(pe=pe.next={lane:0,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),L=xe.hasEagerState?xe.eagerState:s(L,xe.action);else{var et={lane:Ue,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null};pe===null?(ae=pe=et,Q=L):pe=pe.next=et,qt.lanes|=Ue,ko|=Ue}xe=xe.next}while(xe!==null&&xe!==V);pe===null?Q=L:pe.next=ae,Qn(L,c.memoizedState)||(tn=!0),c.memoizedState=L,c.baseState=Q,c.baseQueue=pe,C.lastRenderedState=L}if(s=C.interleaved,s!==null){D=s;do V=D.lane,qt.lanes|=V,ko|=V,D=D.next;while(D!==s)}else D===null&&(C.lanes=0);return[c.memoizedState,C.dispatch]}function S0(s){var c=jn(),C=c.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=s;var L=C.dispatch,D=C.pending,V=c.memoizedState;if(D!==null){C.pending=null;var Q=D=D.next;do V=s(V,Q.action),Q=Q.next;while(Q!==D);Qn(V,c.memoizedState)||(tn=!0),c.memoizedState=V,c.baseQueue===null&&(c.baseState=V),C.lastRenderedState=V}return[V,L]}function k2(){}function T2(s,c){var C=qt,L=jn(),D=c(),V=!Qn(L.memoizedState,D);if(V&&(L.memoizedState=D,tn=!0),L=L.queue,E0(M2.bind(null,C,L,s),[s]),L.getSnapshot!==c||V||mr!==null&&mr.memoizedState.tag&1){if(C.flags|=2048,iu(9,R2.bind(null,C,L,D,c),void 0,null),yr===null)throw Error(o(349));Co&30||A2(C,c,D)}return D}function A2(s,c,C){s.flags|=16384,s={getSnapshot:c,value:C},c=qt.updateQueue,c===null?(c={lastEffect:null,stores:null},qt.updateQueue=c,c.stores=[s]):(C=c.stores,C===null?c.stores=[s]:C.push(s))}function R2(s,c,C,L){c.value=C,c.getSnapshot=L,L2(c)&&N2(s)}function M2(s,c,C){return C(function(){L2(c)&&N2(s)})}function L2(s){var c=s.getSnapshot;s=s.value;try{var C=c();return!Qn(s,C)}catch{return!0}}function N2(s){var c=Ei(s,1);c!==null&&Dn(c,s,1,-1)}function I2(s){var c=Pi();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:nu,lastRenderedState:s},c.queue=s,s=s.dispatch=PS.bind(null,qt,s),[c.memoizedState,s]}function iu(s,c,C,L){return s={tag:s,create:c,destroy:C,deps:L,next:null},c=qt.updateQueue,c===null?(c={lastEffect:null,stores:null},qt.updateQueue=c,c.lastEffect=s.next=s):(C=c.lastEffect,C===null?c.lastEffect=s.next=s:(L=C.next,C.next=s,s.next=L,c.lastEffect=s)),s}function j2(){return jn().memoizedState}function df(s,c,C,L){var D=Pi();qt.flags|=s,D.memoizedState=iu(1|c,C,void 0,L===void 0?null:L)}function hf(s,c,C,L){var D=jn();L=L===void 0?null:L;var V=void 0;if(ur!==null){var Q=ur.memoizedState;if(V=Q.destroy,L!==null&&y0(L,Q.deps)){D.memoizedState=iu(c,C,V,L);return}}qt.flags|=s,D.memoizedState=iu(1|c,C,V,L)}function D2(s,c){return df(8390656,8,s,c)}function E0(s,c){return hf(2048,8,s,c)}function F2(s,c){return hf(4,2,s,c)}function z2(s,c){return hf(4,4,s,c)}function B2(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 U2(s,c,C){return C=C!=null?C.concat([s]):null,hf(4,4,B2.bind(null,c,s),C)}function O0(){}function H2(s,c){var C=jn();c=c===void 0?null:c;var L=C.memoizedState;return L!==null&&c!==null&&y0(c,L[1])?L[0]:(C.memoizedState=[s,c],s)}function $2(s,c){var C=jn();c=c===void 0?null:c;var L=C.memoizedState;return L!==null&&c!==null&&y0(c,L[1])?L[0]:(s=s(),C.memoizedState=[s,c],s)}function G2(s,c,C){return Co&21?(Qn(C,c)||(C=o2(),qt.lanes|=C,ko|=C,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,tn=!0),s.memoizedState=C)}function ES(s,c){var C=vt;vt=C!==0&&4>C?C:4,s(!0);var L=m0.transition;m0.transition={};try{s(!1),c()}finally{vt=C,m0.transition=L}}function V2(){return jn().memoizedState}function OS(s,c,C){var L=Aa(s);if(C={lane:L,action:C,hasEagerState:!1,eagerState:null,next:null},q2(s))W2(c,C);else if(C=v2(s,c,C,L),C!==null){var D=Dr();Dn(C,s,L,D),Y2(C,c,L)}}function PS(s,c,C){var L=Aa(s),D={lane:L,action:C,hasEagerState:!1,eagerState:null,next:null};if(q2(s))W2(c,D);else{var V=s.alternate;if(s.lanes===0&&(V===null||V.lanes===0)&&(V=c.lastRenderedReducer,V!==null))try{var Q=c.lastRenderedState,ae=V(Q,C);if(D.hasEagerState=!0,D.eagerState=ae,Qn(ae,Q)){var pe=c.interleaved;pe===null?(D.next=D,u0(c)):(D.next=pe.next,pe.next=D),c.interleaved=D;return}}catch{}finally{}C=v2(s,c,D,L),C!==null&&(D=Dr(),Dn(C,s,L,D),Y2(C,c,L))}}function q2(s){var c=s.alternate;return s===qt||c!==null&&c===qt}function W2(s,c){tu=ff=!0;var C=s.pending;C===null?c.next=c:(c.next=C.next,C.next=c),s.pending=c}function Y2(s,c,C){if(C&4194240){var L=c.lanes;L&=s.pendingLanes,C|=L,c.lanes=C,Kp(s,C)}}var pf={readContext:Nn,useCallback:Nr,useContext:Nr,useEffect:Nr,useImperativeHandle:Nr,useInsertionEffect:Nr,useLayoutEffect:Nr,useMemo:Nr,useReducer:Nr,useRef:Nr,useState:Nr,useDebugValue:Nr,useDeferredValue:Nr,useTransition:Nr,useMutableSource:Nr,useSyncExternalStore:Nr,useId:Nr,unstable_isNewReconciler:!1},xS={readContext:Nn,useCallback:function(s,c){return Pi().memoizedState=[s,c===void 0?null:c],s},useContext:Nn,useEffect:D2,useImperativeHandle:function(s,c,C){return C=C!=null?C.concat([s]):null,df(4194308,4,B2.bind(null,c,s),C)},useLayoutEffect:function(s,c){return df(4194308,4,s,c)},useInsertionEffect:function(s,c){return df(4,2,s,c)},useMemo:function(s,c){var C=Pi();return c=c===void 0?null:c,s=s(),C.memoizedState=[s,c],s},useReducer:function(s,c,C){var L=Pi();return c=C!==void 0?C(c):c,L.memoizedState=L.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},L.queue=s,s=s.dispatch=OS.bind(null,qt,s),[L.memoizedState,s]},useRef:function(s){var c=Pi();return s={current:s},c.memoizedState=s},useState:I2,useDebugValue:O0,useDeferredValue:function(s){return Pi().memoizedState=s},useTransition:function(){var s=I2(!1),c=s[0];return s=ES.bind(null,s[1]),Pi().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,C){var L=qt,D=Pi();if(Ut){if(C===void 0)throw Error(o(407));C=C()}else{if(C=c(),yr===null)throw Error(o(349));Co&30||A2(L,c,C)}D.memoizedState=C;var V={value:C,getSnapshot:c};return D.queue=V,D2(M2.bind(null,L,V,s),[s]),L.flags|=2048,iu(9,R2.bind(null,L,V,C,c),void 0,null),C},useId:function(){var s=Pi(),c=yr.identifierPrefix;if(Ut){var C=Vi,L=Gi;C=(L&~(1<<32-Zn(L)-1)).toString(32)+C,c=":"+c+"R"+C,C=ru++,0<C&&(c+="H"+C.toString(32)),c+=":"}else C=SS++,c=":"+c+"r"+C.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},CS={readContext:Nn,useCallback:H2,useContext:Nn,useEffect:E0,useImperativeHandle:U2,useInsertionEffect:F2,useLayoutEffect:z2,useMemo:$2,useReducer:w0,useRef:j2,useState:function(){return w0(nu)},useDebugValue:O0,useDeferredValue:function(s){var c=jn();return G2(c,ur.memoizedState,s)},useTransition:function(){var s=w0(nu)[0],c=jn().memoizedState;return[s,c]},useMutableSource:k2,useSyncExternalStore:T2,useId:V2,unstable_isNewReconciler:!1},kS={readContext:Nn,useCallback:H2,useContext:Nn,useEffect:E0,useImperativeHandle:U2,useInsertionEffect:F2,useLayoutEffect:z2,useMemo:$2,useReducer:S0,useRef:j2,useState:function(){return S0(nu)},useDebugValue:O0,useDeferredValue:function(s){var c=jn();return ur===null?c.memoizedState=s:G2(c,ur.memoizedState,s)},useTransition:function(){var s=S0(nu)[0],c=jn().memoizedState;return[s,c]},useMutableSource:k2,useSyncExternalStore:T2,useId:V2,unstable_isNewReconciler:!1};function Nl(s,c){try{var C="",L=c;do C+=wS(L),L=L.return;while(L);var D=C}catch(V){D=`
|
|
56
|
+
Error generating stack: `+V.message+`
|
|
57
|
+
`+V.stack}return{value:s,source:c,stack:D,digest:null}}function P0(s,c,C){return{value:s,source:null,stack:C??null,digest:c??null}}function x0(s,c){try{console.error(c.value)}catch(C){setTimeout(function(){throw C})}}var TS=typeof WeakMap=="function"?WeakMap:Map;function K2(s,c,C){C=qi(-1,C),C.tag=3,C.payload={element:null};var L=c.value;return C.callback=function(){kf||(kf=!0,q0=L),x0(s,c)},C}function X2(s,c,C){C=qi(-1,C),C.tag=3;var L=s.type.getDerivedStateFromError;if(typeof L=="function"){var D=c.value;C.payload=function(){return L(D)},C.callback=function(){x0(s,c)}}var V=s.stateNode;return V!==null&&typeof V.componentDidCatch=="function"&&(C.callback=function(){x0(s,c),typeof L!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var Q=c.stack;this.componentDidCatch(c.value,{componentStack:Q!==null?Q:""})}),C}function Z2(s,c,C){var L=s.pingCache;if(L===null){L=s.pingCache=new TS;var D=new Set;L.set(c,D)}else D=L.get(c),D===void 0&&(D=new Set,L.set(c,D));D.has(C)||(D.add(C),s=$S.bind(null,s,c,C),c.then(s,s))}function Q2(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 J2(s,c,C,L,D){return s.mode&1?(s.flags|=65536,s.lanes=D,s):(s===c?s.flags|=65536:(s.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(c=qi(-1,1),c.tag=2,Ca(C,c,1))),C.lanes|=1),s)}var AS=l.ReactCurrentOwner,tn=!1;function Gr(s,c,C,L){c.child=s===null?x2(c,null,C,L):Rl(c,s.child,C,L)}function eb(s,c,C,L,D){C=C.render;var V=c.ref;return Al(c,D),L=b0(s,c,C,L,V,D),C=_0(),s!==null&&!tn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~D,Wi(s,c,D)):(Ut&&C&&e0(c),c.flags|=1,Gr(s,c,L,D),c.child)}function tb(s,c,C,L,D){if(s===null){var V=C.type;return typeof V=="function"&&!Q0(V)&&V.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(c.tag=15,c.type=V,rb(s,c,V,L,D)):(s=Nf(C.type,null,L,c,c.mode,D),s.ref=c.ref,s.return=c,c.child=s)}if(V=s.child,!(s.lanes&D)){var Q=V.memoizedProps;if(C=C.compare,C=C!==null?C:tf,C(Q,L)&&s.ref===c.ref)return Wi(s,c,D)}return c.flags|=1,s=Ma(V,L),s.ref=c.ref,s.return=c,c.child=s}function rb(s,c,C,L,D){if(s!==null){var V=s.memoizedProps;if(tf(V,L)&&s.ref===c.ref)if(tn=!1,c.pendingProps=L=V,(s.lanes&D)!==0)s.flags&131072&&(tn=!0);else return c.lanes=s.lanes,Wi(s,c,D)}return C0(s,c,C,L,D)}function nb(s,c,C){var L=c.pendingProps,D=L.children,V=s!==null?s.memoizedState:null;if(L.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(jl,wn),wn|=C;else{if(!(C&1073741824))return s=V!==null?V.baseLanes|C:C,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Mt(jl,wn),wn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},L=V!==null?V.baseLanes:C,Mt(jl,wn),wn|=L}else V!==null?(L=V.baseLanes|C,c.memoizedState=null):L=C,Mt(jl,wn),wn|=L;return Gr(s,c,D,C),c.child}function ib(s,c){var C=c.ref;(s===null&&C!==null||s!==null&&s.ref!==C)&&(c.flags|=512,c.flags|=2097152)}function C0(s,c,C,L,D){var V=en(C)?Eo:Lr.current;return V=Pl(c,V),Al(c,D),C=b0(s,c,C,L,V,D),L=_0(),s!==null&&!tn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~D,Wi(s,c,D)):(Ut&&L&&e0(c),c.flags|=1,Gr(s,c,C,D),c.child)}function ab(s,c,C,L,D){if(en(C)){var V=!0;qc(c)}else V=!1;if(Al(c,D),c.stateNode===null)vf(s,c),S2(c,C,L),d0(c,C,L,D),L=!0;else if(s===null){var Q=c.stateNode,ae=c.memoizedProps;Q.props=ae;var pe=Q.context,xe=C.contextType;typeof xe=="object"&&xe!==null?xe=Nn(xe):(xe=en(C)?Eo:Lr.current,xe=Pl(c,xe));var Ue=C.getDerivedStateFromProps,et=typeof Ue=="function"||typeof Q.getSnapshotBeforeUpdate=="function";et||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(ae!==L||pe!==xe)&&E2(c,Q,L,xe),xa=!1;var je=c.memoizedState;Q.state=je,of(c,L,Q,D),pe=c.memoizedState,ae!==L||je!==pe||Jr.current||xa?(typeof Ue=="function"&&(f0(c,C,Ue,L),pe=c.memoizedState),(ae=xa||w2(c,C,ae,L,je,pe,xe))?(et||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount()),typeof Q.componentDidMount=="function"&&(c.flags|=4194308)):(typeof Q.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=L,c.memoizedState=pe),Q.props=L,Q.state=pe,Q.context=xe,L=ae):(typeof Q.componentDidMount=="function"&&(c.flags|=4194308),L=!1)}else{Q=c.stateNode,m2(s,c),ae=c.memoizedProps,xe=c.type===c.elementType?ae:ei(c.type,ae),Q.props=xe,et=c.pendingProps,je=Q.context,pe=C.contextType,typeof pe=="object"&&pe!==null?pe=Nn(pe):(pe=en(C)?Eo:Lr.current,pe=Pl(c,pe));var Dt=C.getDerivedStateFromProps;(Ue=typeof Dt=="function"||typeof Q.getSnapshotBeforeUpdate=="function")||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(ae!==et||je!==pe)&&E2(c,Q,L,pe),xa=!1,je=c.memoizedState,Q.state=je,of(c,L,Q,D);var At=c.memoizedState;ae!==et||je!==At||Jr.current||xa?(typeof Dt=="function"&&(f0(c,C,Dt,L),At=c.memoizedState),(xe=xa||w2(c,C,xe,L,je,At,pe)||!1)?(Ue||typeof Q.UNSAFE_componentWillUpdate!="function"&&typeof Q.componentWillUpdate!="function"||(typeof Q.componentWillUpdate=="function"&&Q.componentWillUpdate(L,At,pe),typeof Q.UNSAFE_componentWillUpdate=="function"&&Q.UNSAFE_componentWillUpdate(L,At,pe)),typeof Q.componentDidUpdate=="function"&&(c.flags|=4),typeof Q.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof Q.componentDidUpdate!="function"||ae===s.memoizedProps&&je===s.memoizedState||(c.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&je===s.memoizedState||(c.flags|=1024),c.memoizedProps=L,c.memoizedState=At),Q.props=L,Q.state=At,Q.context=pe,L=xe):(typeof Q.componentDidUpdate!="function"||ae===s.memoizedProps&&je===s.memoizedState||(c.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&je===s.memoizedState||(c.flags|=1024),L=!1)}return k0(s,c,C,L,V,D)}function k0(s,c,C,L,D,V){ib(s,c);var Q=(c.flags&128)!==0;if(!L&&!Q)return D&&a2(c,C,!1),Wi(s,c,V);L=c.stateNode,AS.current=c;var ae=Q&&typeof C.getDerivedStateFromError!="function"?null:L.render();return c.flags|=1,s!==null&&Q?(c.child=Rl(c,s.child,null,V),c.child=Rl(c,null,ae,V)):Gr(s,c,ae,V),c.memoizedState=L.state,D&&a2(c,C,!0),c.child}function ob(s){var c=s.stateNode;c.pendingContext?n2(s,c.pendingContext,c.pendingContext!==c.context):c.context&&n2(s,c.context,!1),h0(s,c.containerInfo)}function lb(s,c,C,L,D){return kl(),i0(D),c.flags|=256,Gr(s,c,C,L),c.child}var T0={dehydrated:null,treeContext:null,retryLane:0};function A0(s){return{baseLanes:s,cachePool:null,transitions:null}}function sb(s,c,C){var L=c.pendingProps,D=Vt.current,V=!1,Q=(c.flags&128)!==0,ae;if((ae=Q)||(ae=s!==null&&s.memoizedState===null?!1:(D&2)!==0),ae?(V=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(D|=1),Mt(Vt,D&1),s===null)return n0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?Ke(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(Q=L.children,s=L.fallback,V?(L=c.mode,V=c.child,Q={mode:"hidden",children:Q},!(L&1)&&V!==null?(V.childLanes=0,V.pendingProps=Q):V=If(Q,L,0,null),s=Mo(s,L,C,null),V.return=c,s.return=c,V.sibling=s,c.child=V,c.child.memoizedState=A0(C),c.memoizedState=T0,s):R0(c,Q));if(D=s.memoizedState,D!==null&&(ae=D.dehydrated,ae!==null))return RS(s,c,Q,L,ae,D,C);if(V){V=L.fallback,Q=c.mode,D=s.child,ae=D.sibling;var pe={mode:"hidden",children:L.children};return!(Q&1)&&c.child!==D?(L=c.child,L.childLanes=0,L.pendingProps=pe,c.deletions=null):(L=Ma(D,pe),L.subtreeFlags=D.subtreeFlags&14680064),ae!==null?V=Ma(ae,V):(V=Mo(V,Q,C,null),V.flags|=2),V.return=c,L.return=c,L.sibling=V,c.child=L,L=V,V=c.child,Q=s.child.memoizedState,Q=Q===null?A0(C):{baseLanes:Q.baseLanes|C,cachePool:null,transitions:Q.transitions},V.memoizedState=Q,V.childLanes=s.childLanes&~C,c.memoizedState=T0,L}return V=s.child,s=V.sibling,L=Ma(V,{mode:"visible",children:L.children}),!(c.mode&1)&&(L.lanes=C),L.return=c,L.sibling=null,s!==null&&(C=c.deletions,C===null?(c.deletions=[s],c.flags|=16):C.push(s)),c.child=L,c.memoizedState=null,L}function R0(s,c){return c=If({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function gf(s,c,C,L){return L!==null&&i0(L),Rl(c,s.child,null,C),s=R0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function RS(s,c,C,L,D,V,Q){if(C)return c.flags&256?(c.flags&=-257,L=P0(Error(o(422))),gf(s,c,Q,L)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(V=L.fallback,D=c.mode,L=If({mode:"visible",children:L.children},D,0,null),V=Mo(V,D,Q,null),V.flags|=2,L.return=c,V.return=c,L.sibling=V,c.child=L,c.mode&1&&Rl(c,s.child,null,Q),c.child.memoizedState=A0(Q),c.memoizedState=T0,V);if(!(c.mode&1))return gf(s,c,Q,null);if(Ke(D))return L=ft(D).digest,V=Error(o(419)),L=P0(V,L,void 0),gf(s,c,Q,L);if(C=(Q&s.childLanes)!==0,tn||C){if(L=yr,L!==null){switch(Q&-Q){case 4:D=2;break;case 16:D=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:D=32;break;case 536870912:D=268435456;break;default:D=0}D=D&(L.suspendedLanes|Q)?0:D,D!==0&&D!==V.retryLane&&(V.retryLane=D,Ei(s,D),Dn(L,s,D,-1))}return Z0(),L=P0(Error(o(421))),gf(s,c,Q,L)}return Ne(D)?(c.flags|=128,c.child=s.child,c=GS.bind(null,s),Ct(D,c),null):(s=V.treeContext,se&&(Ln=sr(D),_n=c,Ut=!0,Jn=null,Zs=!1,s!==null&&(Rn[Mn++]=Gi,Rn[Mn++]=Vi,Rn[Mn++]=Oo,Gi=s.id,Vi=s.overflow,Oo=c)),c=R0(c,L.children),c.flags|=4096,c)}function ub(s,c,C){s.lanes|=c;var L=s.alternate;L!==null&&(L.lanes|=c),s0(s.return,c,C)}function M0(s,c,C,L,D){var V=s.memoizedState;V===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:L,tail:C,tailMode:D}:(V.isBackwards=c,V.rendering=null,V.renderingStartTime=0,V.last=L,V.tail=C,V.tailMode=D)}function cb(s,c,C){var L=c.pendingProps,D=L.revealOrder,V=L.tail;if(Gr(s,c,L.children,C),L=Vt.current,L&2)L=L&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&&ub(s,C,c);else if(s.tag===19)ub(s,C,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}L&=1}if(Mt(Vt,L),!(c.mode&1))c.memoizedState=null;else switch(D){case"forwards":for(C=c.child,D=null;C!==null;)s=C.alternate,s!==null&&uf(s)===null&&(D=C),C=C.sibling;C=D,C===null?(D=c.child,c.child=null):(D=C.sibling,C.sibling=null),M0(c,!1,D,C,V);break;case"backwards":for(C=null,D=c.child,c.child=null;D!==null;){if(s=D.alternate,s!==null&&uf(s)===null){c.child=D;break}s=D.sibling,D.sibling=C,C=D,D=s}M0(c,!0,C,null,V);break;case"together":M0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function vf(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Wi(s,c,C){if(s!==null&&(c.dependencies=s.dependencies),ko|=c.lanes,!(C&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,C=Ma(s,s.pendingProps),c.child=C,C.return=c;s.sibling!==null;)s=s.sibling,C=C.sibling=Ma(s,s.pendingProps),C.return=c;C.sibling=null}return c.child}function MS(s,c,C){switch(c.tag){case 3:ob(c),kl();break;case 5:C2(c);break;case 1:en(c.type)&&qc(c);break;case 4:h0(c,c.stateNode.containerInfo);break;case 10:g2(c,c.type._context,c.memoizedProps.value);break;case 13:var L=c.memoizedState;if(L!==null)return L.dehydrated!==null?(Mt(Vt,Vt.current&1),c.flags|=128,null):C&c.child.childLanes?sb(s,c,C):(Mt(Vt,Vt.current&1),s=Wi(s,c,C),s!==null?s.sibling:null);Mt(Vt,Vt.current&1);break;case 19:if(L=(C&c.childLanes)!==0,s.flags&128){if(L)return cb(s,c,C);c.flags|=128}var D=c.memoizedState;if(D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),Mt(Vt,Vt.current),L)break;return null;case 22:case 23:return c.lanes=0,nb(s,c,C)}return Wi(s,c,C)}function xi(s){s.flags|=4}function fb(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 au,ou,mf,yf;if(te)au=function(s,c){for(var C=c.child;C!==null;){if(C.tag===5||C.tag===6)B(s,C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===c)break;for(;C.sibling===null;){if(C.return===null||C.return===c)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},ou=function(){},mf=function(s,c,C,L,D){if(s=s.memoizedProps,s!==L){var V=c.stateNode,Q=Oi(In.current);C=G(V,C,s,L,D,Q),(c.updateQueue=C)&&xi(c)}},yf=function(s,c,C,L){C!==L&&xi(c)};else if(ee){au=function(s,c,C,L){for(var D=c.child;D!==null;){if(D.tag===5){var V=D.stateNode;C&&L&&(V=mn(V,D.type,D.memoizedProps,D)),B(s,V)}else if(D.tag===6)V=D.stateNode,C&&L&&(V=lr(V,D.memoizedProps,D)),B(s,V);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)V=D.child,V!==null&&(V.return=D),au(s,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===c)break;for(;D.sibling===null;){if(D.return===null||D.return===c)return;D=D.return}D.sibling.return=D.return,D=D.sibling}};var db=function(s,c,C,L){for(var D=c.child;D!==null;){if(D.tag===5){var V=D.stateNode;C&&L&&(V=mn(V,D.type,D.memoizedProps,D)),Xe(s,V)}else if(D.tag===6)V=D.stateNode,C&&L&&(V=lr(V,D.memoizedProps,D)),Xe(s,V);else if(D.tag!==4){if(D.tag===22&&D.memoizedState!==null)V=D.child,V!==null&&(V.return=D),db(s,D,!0,!0);else if(D.child!==null){D.child.return=D,D=D.child;continue}}if(D===c)break;for(;D.sibling===null;){if(D.return===null||D.return===c)return;D=D.return}D.sibling.return=D.return,D=D.sibling}};ou=function(s,c){var C=c.stateNode;if(!fb(s,c)){s=C.containerInfo;var L=$e(s);db(L,c,!1,!1),C.pendingChildren=L,xi(c),xt(s,L)}},mf=function(s,c,C,L,D){var V=s.stateNode,Q=s.memoizedProps;if((s=fb(s,c))&&Q===L)c.stateNode=V;else{var ae=c.stateNode,pe=Oi(In.current),xe=null;Q!==L&&(xe=G(ae,C,Q,L,D,pe)),s&&xe===null?c.stateNode=V:(V=Ae(V,xe,C,Q,L,c,s,ae),N(V,C,L,D,pe)&&xi(c),c.stateNode=V,s?xi(c):au(V,c,!1,!1))}},yf=function(s,c,C,L){C!==L?(s=Oi(Ml.current),C=Oi(In.current),c.stateNode=q(L,s,C,c),xi(c)):c.stateNode=s.stateNode}}else ou=function(){},mf=function(){},yf=function(){};function lu(s,c){if(!Ut)switch(s.tailMode){case"hidden":c=s.tail;for(var C=null;c!==null;)c.alternate!==null&&(C=c),c=c.sibling;C===null?s.tail=null:C.sibling=null;break;case"collapsed":C=s.tail;for(var L=null;C!==null;)C.alternate!==null&&(L=C),C=C.sibling;L===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:L.sibling=null}}function Ir(s){var c=s.alternate!==null&&s.alternate.child===s.child,C=0,L=0;if(c)for(var D=s.child;D!==null;)C|=D.lanes|D.childLanes,L|=D.subtreeFlags&14680064,L|=D.flags&14680064,D.return=s,D=D.sibling;else for(D=s.child;D!==null;)C|=D.lanes|D.childLanes,L|=D.subtreeFlags,L|=D.flags,D.return=s,D=D.sibling;return s.subtreeFlags|=L,s.childLanes=C,c}function LS(s,c,C){var L=c.pendingProps;switch(t0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ir(c),null;case 1:return en(c.type)&&Vc(),Ir(c),null;case 3:return C=c.stateNode,Ll(),jt(Jr),jt(Lr),v0(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(s===null||s.child===null)&&(ef(c)?xi(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Jn!==null&&(K0(Jn),Jn=null))),ou(s,c),Ir(c),null;case 5:p0(c),C=Oi(Ml.current);var D=c.type;if(s!==null&&c.stateNode!=null)mf(s,c,D,L,C),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!L){if(c.stateNode===null)throw Error(o(166));return Ir(c),null}if(s=Oi(In.current),ef(c)){if(!se)throw Error(o(175));s=bn(c.stateNode,c.type,c.memoizedProps,C,s,c,!Zs),c.updateQueue=s,s!==null&&xi(c)}else{var V=j(D,L,C,s,c);au(V,c,!1,!1),c.stateNode=V,N(V,D,L,C,s)&&xi(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Ir(c),null;case 6:if(s&&c.stateNode!=null)yf(s,c,s.memoizedProps,L);else{if(typeof L!="string"&&c.stateNode===null)throw Error(o(166));if(s=Oi(Ml.current),C=Oi(In.current),ef(c)){if(!se)throw Error(o(176));if(s=c.stateNode,C=c.memoizedProps,(L=Pr(s,C,c,!Zs))&&(D=_n,D!==null))switch(D.tag){case 3:Gc(D.stateNode.containerInfo,s,C,(D.mode&1)!==0);break;case 5:aS(D.type,D.memoizedProps,D.stateNode,s,C,(D.mode&1)!==0)}L&&xi(c)}else c.stateNode=q(L,s,C,c)}return Ir(c),null;case 13:if(jt(Vt),L=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Ut&&Ln!==null&&c.mode&1&&!(c.flags&128))p2(),kl(),c.flags|=98560,D=!1;else if(D=ef(c),L!==null&&L.dehydrated!==null){if(s===null){if(!D)throw Error(o(318));if(!se)throw Error(o(344));if(D=c.memoizedState,D=D!==null?D.dehydrated:null,!D)throw Error(o(317));Qr(D,c)}else kl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Ir(c),D=!1}else Jn!==null&&(K0(Jn),Jn=null),D=!0;if(!D)return c.flags&65536?c:null}return c.flags&128?(c.lanes=C,c):(C=L!==null,C!==(s!==null&&s.memoizedState!==null)&&C&&(c.child.flags|=8192,c.mode&1&&(s===null||Vt.current&1?cr===0&&(cr=3):Z0())),c.updateQueue!==null&&(c.flags|=4),Ir(c),null);case 4:return Ll(),ou(s,c),s===null&&he(c.stateNode.containerInfo),Ir(c),null;case 10:return l0(c.type._context),Ir(c),null;case 17:return en(c.type)&&Vc(),Ir(c),null;case 19:if(jt(Vt),D=c.memoizedState,D===null)return Ir(c),null;if(L=(c.flags&128)!==0,V=D.rendering,V===null)if(L)lu(D,!1);else{if(cr!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(V=uf(s),V!==null){for(c.flags|=128,lu(D,!1),s=V.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=C,C=c.child;C!==null;)L=C,D=s,L.flags&=14680066,V=L.alternate,V===null?(L.childLanes=0,L.lanes=D,L.child=null,L.subtreeFlags=0,L.memoizedProps=null,L.memoizedState=null,L.updateQueue=null,L.dependencies=null,L.stateNode=null):(L.childLanes=V.childLanes,L.lanes=V.lanes,L.child=V.child,L.subtreeFlags=0,L.deletions=null,L.memoizedProps=V.memoizedProps,L.memoizedState=V.memoizedState,L.updateQueue=V.updateQueue,L.type=V.type,D=V.dependencies,L.dependencies=D===null?null:{lanes:D.lanes,firstContext:D.firstContext}),C=C.sibling;return Mt(Vt,Vt.current&1|2),c.child}s=s.sibling}D.tail!==null&&vr()>V0&&(c.flags|=128,L=!0,lu(D,!1),c.lanes=4194304)}else{if(!L)if(s=uf(V),s!==null){if(c.flags|=128,L=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),lu(D,!0),D.tail===null&&D.tailMode==="hidden"&&!V.alternate&&!Ut)return Ir(c),null}else 2*vr()-D.renderingStartTime>V0&&C!==1073741824&&(c.flags|=128,L=!0,lu(D,!1),c.lanes=4194304);D.isBackwards?(V.sibling=c.child,c.child=V):(s=D.last,s!==null?s.sibling=V:c.child=V,D.last=V)}return D.tail!==null?(c=D.tail,D.rendering=c,D.tail=c.sibling,D.renderingStartTime=vr(),c.sibling=null,s=Vt.current,Mt(Vt,L?s&1|2:s&1),c):(Ir(c),null);case 22:case 23:return X0(),C=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==C&&(c.flags|=8192),C&&c.mode&1?wn&1073741824&&(Ir(c),te&&c.subtreeFlags&6&&(c.flags|=8192)):Ir(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function NS(s,c){switch(t0(c),c.tag){case 1:return en(c.type)&&Vc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ll(),jt(Jr),jt(Lr),v0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return p0(c),null;case 13:if(jt(Vt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));kl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return jt(Vt),null;case 4:return Ll(),null;case 10:return l0(c.type._context),null;case 22:case 23:return X0(),null;case 24:return null;default:return null}}var bf=!1,jr=!1,IS=typeof WeakSet=="function"?WeakSet:Set,ze=null;function Il(s,c){var C=s.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(L){Ht(s,c,L)}else C.current=null}function L0(s,c,C){try{C()}catch(L){Ht(s,c,L)}}var hb=!1;function jS(s,c){for(W(s.containerInfo),ze=c;ze!==null;)if(s=ze,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,ze=c;else for(;ze!==null;){s=ze;try{var C=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var L=C.memoizedProps,D=C.memoizedState,V=s.stateNode,Q=V.getSnapshotBeforeUpdate(s.elementType===s.type?L:ei(s.type,L),D);V.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:te&&_t(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ae){Ht(s,s.return,ae)}if(c=s.sibling,c!==null){c.return=s.return,ze=c;break}ze=s.return}return C=hb,hb=!1,C}function su(s,c,C){var L=c.updateQueue;if(L=L!==null?L.lastEffect:null,L!==null){var D=L=L.next;do{if((D.tag&s)===s){var V=D.destroy;D.destroy=void 0,V!==void 0&&L0(c,C,V)}D=D.next}while(D!==L)}}function _f(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var C=c=c.next;do{if((C.tag&s)===s){var L=C.create;C.destroy=L()}C=C.next}while(C!==c)}}function N0(s){var c=s.ref;if(c!==null){var C=s.stateNode;switch(s.tag){case 5:s=$(C);break;default:s=C}typeof c=="function"?c(s):c.current=s}}function pb(s){var c=s.alternate;c!==null&&(s.alternate=null,pb(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Ie(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function gb(s){return s.tag===5||s.tag===3||s.tag===4}function vb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||gb(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 I0(s,c,C){var L=s.tag;if(L===5||L===6)s=s.stateNode,c?ne(C,s,c):Je(C,s);else if(L!==4&&(s=s.child,s!==null))for(I0(s,c,C),s=s.sibling;s!==null;)I0(s,c,C),s=s.sibling}function j0(s,c,C){var L=s.tag;if(L===5||L===6)s=s.stateNode,c?le(C,s,c):Te(C,s);else if(L!==4&&(s=s.child,s!==null))for(j0(s,c,C),s=s.sibling;s!==null;)j0(s,c,C),s=s.sibling}var xr=null,ti=!1;function Ci(s,c,C){for(C=C.child;C!==null;)D0(s,c,C),C=C.sibling}function D0(s,c,C){if(wi&&typeof wi.onCommitFiberUnmount=="function")try{wi.onCommitFiberUnmount(Xc,C)}catch{}switch(C.tag){case 5:jr||Il(C,c);case 6:if(te){var L=xr,D=ti;xr=null,Ci(s,c,C),xr=L,ti=D,xr!==null&&(ti?Me(xr,C.stateNode):Re(xr,C.stateNode))}else Ci(s,c,C);break;case 18:te&&xr!==null&&(ti?Ea(xr,C.stateNode):So(xr,C.stateNode));break;case 4:te?(L=xr,D=ti,xr=C.stateNode.containerInfo,ti=!0,Ci(s,c,C),xr=L,ti=D):(ee&&(L=C.stateNode.containerInfo,D=$e(L),St(L,D)),Ci(s,c,C));break;case 0:case 11:case 14:case 15:if(!jr&&(L=C.updateQueue,L!==null&&(L=L.lastEffect,L!==null))){D=L=L.next;do{var V=D,Q=V.destroy;V=V.tag,Q!==void 0&&(V&2||V&4)&&L0(C,c,Q),D=D.next}while(D!==L)}Ci(s,c,C);break;case 1:if(!jr&&(Il(C,c),L=C.stateNode,typeof L.componentWillUnmount=="function"))try{L.props=C.memoizedProps,L.state=C.memoizedState,L.componentWillUnmount()}catch(ae){Ht(C,c,ae)}Ci(s,c,C);break;case 21:Ci(s,c,C);break;case 22:C.mode&1?(jr=(L=jr)||C.memoizedState!==null,Ci(s,c,C),jr=L):Ci(s,c,C);break;default:Ci(s,c,C)}}function mb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var C=s.stateNode;C===null&&(C=s.stateNode=new IS),c.forEach(function(L){var D=VS.bind(null,s,L);C.has(L)||(C.add(L),L.then(D,D))})}}function ri(s,c){var C=c.deletions;if(C!==null)for(var L=0;L<C.length;L++){var D=C[L];try{var V=s,Q=c;if(te){var ae=Q;e:for(;ae!==null;){switch(ae.tag){case 5:xr=ae.stateNode,ti=!1;break e;case 3:xr=ae.stateNode.containerInfo,ti=!0;break e;case 4:xr=ae.stateNode.containerInfo,ti=!0;break e}ae=ae.return}if(xr===null)throw Error(o(160));D0(V,Q,D),xr=null,ti=!1}else D0(V,Q,D);var pe=D.alternate;pe!==null&&(pe.return=null),D.return=null}catch(xe){Ht(D,c,xe)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)yb(c,s),c=c.sibling}function yb(s,c){var C=s.alternate,L=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ri(c,s),ki(s),L&4){try{su(3,s,s.return),_f(3,s)}catch(je){Ht(s,s.return,je)}try{su(5,s,s.return)}catch(je){Ht(s,s.return,je)}}break;case 1:ri(c,s),ki(s),L&512&&C!==null&&Il(C,C.return);break;case 5:if(ri(c,s),ki(s),L&512&&C!==null&&Il(C,C.return),te){if(s.flags&32){var D=s.stateNode;try{ye(D)}catch(je){Ht(s,s.return,je)}}if(L&4&&(D=s.stateNode,D!=null)){var V=s.memoizedProps;if(C=C!==null?C.memoizedProps:V,L=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{It(D,c,L,C,V,s)}catch(je){Ht(s,s.return,je)}}}break;case 6:if(ri(c,s),ki(s),L&4&&te){if(s.stateNode===null)throw Error(o(162));D=s.stateNode,V=s.memoizedProps,C=C!==null?C.memoizedProps:V;try{Ye(D,C,V)}catch(je){Ht(s,s.return,je)}}break;case 3:if(ri(c,s),ki(s),L&4){if(te&&se&&C!==null&&C.memoizedState.isDehydrated)try{Sa(c.containerInfo)}catch(je){Ht(s,s.return,je)}if(ee){D=c.containerInfo,V=c.pendingChildren;try{St(D,V)}catch(je){Ht(s,s.return,je)}}}break;case 4:if(ri(c,s),ki(s),L&4&&ee){V=s.stateNode,D=V.containerInfo,V=V.pendingChildren;try{St(D,V)}catch(je){Ht(s,s.return,je)}}break;case 13:ri(c,s),ki(s),D=s.child,D.flags&8192&&(V=D.memoizedState!==null,D.stateNode.isHidden=V,!V||D.alternate!==null&&D.alternate.memoizedState!==null||(G0=vr())),L&4&&mb(s);break;case 22:var Q=C!==null&&C.memoizedState!==null;if(s.mode&1?(jr=(C=jr)||Q,ri(c,s),jr=C):ri(c,s),ki(s),L&8192){if(C=s.memoizedState!==null,(s.stateNode.isHidden=C)&&!Q&&s.mode&1)for(ze=s,L=s.child;L!==null;){for(c=ze=L;ze!==null;){Q=ze;var ae=Q.child;switch(Q.tag){case 0:case 11:case 14:case 15:su(4,Q,Q.return);break;case 1:Il(Q,Q.return);var pe=Q.stateNode;if(typeof pe.componentWillUnmount=="function"){var xe=Q,Ue=Q.return;try{var et=xe;pe.props=et.memoizedProps,pe.state=et.memoizedState,pe.componentWillUnmount()}catch(je){Ht(xe,Ue,je)}}break;case 5:Il(Q,Q.return);break;case 22:if(Q.memoizedState!==null){wb(c);continue}}ae!==null?(ae.return=Q,ze=ae):wb(c)}L=L.sibling}if(te){e:if(L=null,te)for(c=s;;){if(c.tag===5){if(L===null){L=c;try{D=c.stateNode,C?Le(D):qe(c.stateNode,c.memoizedProps)}catch(je){Ht(s,s.return,je)}}}else if(c.tag===6){if(L===null)try{V=c.stateNode,C?Oe(V):Pt(V,c.memoizedProps)}catch(je){Ht(s,s.return,je)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;L===c&&(L=null),c=c.return}L===c&&(L=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ri(c,s),ki(s),L&4&&mb(s);break;case 21:break;default:ri(c,s),ki(s)}}function ki(s){var c=s.flags;if(c&2){try{if(te){e:{for(var C=s.return;C!==null;){if(gb(C)){var L=C;break e}C=C.return}throw Error(o(160))}switch(L.tag){case 5:var D=L.stateNode;L.flags&32&&(ye(D),L.flags&=-33);var V=vb(s);j0(s,V,D);break;case 3:case 4:var Q=L.stateNode.containerInfo,ae=vb(s);I0(s,ae,Q);break;default:throw Error(o(161))}}}catch(pe){Ht(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function DS(s,c,C){ze=s,bb(s)}function bb(s,c,C){for(var L=(s.mode&1)!==0;ze!==null;){var D=ze,V=D.child;if(D.tag===22&&L){var Q=D.memoizedState!==null||bf;if(!Q){var ae=D.alternate,pe=ae!==null&&ae.memoizedState!==null||jr;ae=bf;var xe=jr;if(bf=Q,(jr=pe)&&!xe)for(ze=D;ze!==null;)Q=ze,pe=Q.child,Q.tag===22&&Q.memoizedState!==null?Sb(D):pe!==null?(pe.return=Q,ze=pe):Sb(D);for(;V!==null;)ze=V,bb(V),V=V.sibling;ze=D,bf=ae,jr=xe}_b(s)}else D.subtreeFlags&8772&&V!==null?(V.return=D,ze=V):_b(s)}}function _b(s){for(;ze!==null;){var c=ze;if(c.flags&8772){var C=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:jr||_f(5,c);break;case 1:var L=c.stateNode;if(c.flags&4&&!jr)if(C===null)L.componentDidMount();else{var D=c.elementType===c.type?C.memoizedProps:ei(c.type,C.memoizedProps);L.componentDidUpdate(D,C.memoizedState,L.__reactInternalSnapshotBeforeUpdate)}var V=c.updateQueue;V!==null&&b2(c,V,L);break;case 3:var Q=c.updateQueue;if(Q!==null){if(C=null,c.child!==null)switch(c.child.tag){case 5:C=$(c.child.stateNode);break;case 1:C=c.child.stateNode}b2(c,Q,C)}break;case 5:var ae=c.stateNode;C===null&&c.flags&4&&pt(ae,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(se&&c.memoizedState===null){var pe=c.alternate;if(pe!==null){var xe=pe.memoizedState;if(xe!==null){var Ue=xe.dehydrated;Ue!==null&&wo(Ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}jr||c.flags&512&&N0(c)}catch(et){Ht(c,c.return,et)}}if(c===s){ze=null;break}if(C=c.sibling,C!==null){C.return=c.return,ze=C;break}ze=c.return}}function wb(s){for(;ze!==null;){var c=ze;if(c===s){ze=null;break}var C=c.sibling;if(C!==null){C.return=c.return,ze=C;break}ze=c.return}}function Sb(s){for(;ze!==null;){var c=ze;try{switch(c.tag){case 0:case 11:case 15:var C=c.return;try{_f(4,c)}catch(pe){Ht(c,C,pe)}break;case 1:var L=c.stateNode;if(typeof L.componentDidMount=="function"){var D=c.return;try{L.componentDidMount()}catch(pe){Ht(c,D,pe)}}var V=c.return;try{N0(c)}catch(pe){Ht(c,V,pe)}break;case 5:var Q=c.return;try{N0(c)}catch(pe){Ht(c,Q,pe)}}}catch(pe){Ht(c,c.return,pe)}if(c===s){ze=null;break}var ae=c.sibling;if(ae!==null){ae.return=c.return,ze=ae;break}ze=c.return}}var wf=0,Sf=1,Ef=2,Of=3,Pf=4;if(typeof Symbol=="function"&&Symbol.for){var uu=Symbol.for;wf=uu("selector.component"),Sf=uu("selector.has_pseudo_class"),Ef=uu("selector.role"),Of=uu("selector.test_id"),Pf=uu("selector.text")}function F0(s){var c=de(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=Se(s),s===null)throw Error(o(362));return s.stateNode.current}function z0(s,c){switch(c.$$typeof){case wf:if(s.type===c.value)return!0;break;case Sf:e:{c=c.value,s=[s,0];for(var C=0;C<s.length;){var L=s[C++],D=s[C++],V=c[D];if(L.tag!==5||!ge(L)){for(;V!=null&&z0(L,V);)D++,V=c[D];if(D===c.length){c=!0;break e}else for(L=L.child;L!==null;)s.push(L,D),L=L.sibling}}c=!1}return c;case Ef:if(s.tag===5&&me(s.stateNode,c.value))return!0;break;case Pf:if((s.tag===5||s.tag===6)&&(s=ce(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case Of: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 B0(s){switch(s.$$typeof){case wf:return"<"+(x(s.value)||"Unknown")+">";case Sf:return":has("+(B0(s)||"")+")";case Ef:return'[role="'+s.value+'"]';case Pf:return'"'+s.value+'"';case Of:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Eb(s,c){var C=[];s=[s,0];for(var L=0;L<s.length;){var D=s[L++],V=s[L++],Q=c[V];if(D.tag!==5||!ge(D)){for(;Q!=null&&z0(D,Q);)V++,Q=c[V];if(V===c.length)C.push(D);else for(D=D.child;D!==null;)s.push(D,V),D=D.sibling}}return C}function U0(s,c){if(!_e)throw Error(o(363));s=F0(s),s=Eb(s,c),c=[],s=Array.from(s);for(var C=0;C<s.length;){var L=s[C++];if(L.tag===5)ge(L)||c.push(L.stateNode);else for(L=L.child;L!==null;)s.push(L),L=L.sibling}return c}var FS=Math.ceil,xf=l.ReactCurrentDispatcher,H0=l.ReactCurrentOwner,er=l.ReactCurrentBatchConfig,lt=0,yr=null,ir=null,Cr=0,wn=0,jl=Oa(0),cr=0,cu=null,ko=0,Cf=0,$0=0,fu=null,rn=null,G0=0,V0=1/0,Yi=null;function Dl(){V0=vr()+500}var kf=!1,q0=null,ka=null,Tf=!1,Ta=null,Af=0,du=0,W0=null,Rf=-1,Mf=0;function Dr(){return lt&6?vr():Rf!==-1?Rf:Rf=vr()}function Aa(s){return s.mode&1?lt&2&&Cr!==0?Cr&-Cr:_S.transition!==null?(Mf===0&&(Mf=o2()),Mf):(s=vt,s!==0?s:ke()):1}function Dn(s,c,C,L){if(50<du)throw du=0,W0=null,Error(o(185));Xs(s,C,L),(!(lt&2)||s!==yr)&&(s===yr&&(!(lt&2)&&(Cf|=C),cr===4&&Ra(s,Cr)),nn(s,L),C===1&<===0&&!(c.mode&1)&&(Dl(),Zc&&Si()))}function nn(s,c){var C=s.callbackNode;fS(s,c);var L=Kc(s,s===yr?Cr:0);if(L===0)C!==null&&s2(C),s.callbackNode=null,s.callbackPriority=0;else if(c=L&-L,s.callbackPriority!==c){if(C!=null&&s2(C),c===1)s.tag===0?bS(Pb.bind(null,s)):u2(Pb.bind(null,s)),ue?ie(function(){!(lt&6)&&Si()}):Xp(Zp,Si),C=null;else{switch(l2(L)){case 1:C=Zp;break;case 4:C=gS;break;case 16:C=Qp;break;case 536870912:C=vS;break;default:C=Qp}C=Nb(C,Ob.bind(null,s))}s.callbackPriority=c,s.callbackNode=C}}function Ob(s,c){if(Rf=-1,Mf=0,lt&6)throw Error(o(327));var C=s.callbackNode;if(Ro()&&s.callbackNode!==C)return null;var L=Kc(s,s===yr?Cr:0);if(L===0)return null;if(L&30||L&s.expiredLanes||c)c=Lf(s,L);else{c=L;var D=lt;lt|=2;var V=kb();(yr!==s||Cr!==c)&&(Yi=null,Dl(),To(s,c));do try{US();break}catch(ae){Cb(s,ae)}while(!0);o0(),xf.current=V,lt=D,ir!==null?c=0:(yr=null,Cr=0,c=cr)}if(c!==0){if(c===2&&(D=Wp(s),D!==0&&(L=D,c=Y0(s,D))),c===1)throw C=cu,To(s,0),Ra(s,L),nn(s,vr()),C;if(c===6)Ra(s,L);else{if(D=s.current.alternate,!(L&30)&&!zS(D)&&(c=Lf(s,L),c===2&&(V=Wp(s),V!==0&&(L=V,c=Y0(s,V))),c===1))throw C=cu,To(s,0),Ra(s,L),nn(s,vr()),C;switch(s.finishedWork=D,s.finishedLanes=L,c){case 0:case 1:throw Error(o(345));case 2:Ao(s,rn,Yi);break;case 3:if(Ra(s,L),(L&130023424)===L&&(c=G0+500-vr(),10<c)){if(Kc(s,0)!==0)break;if(D=s.suspendedLanes,(D&L)!==L){Dr(),s.pingedLanes|=s.suspendedLanes&D;break}s.timeoutHandle=z(Ao.bind(null,s,rn,Yi),c);break}Ao(s,rn,Yi);break;case 4:if(Ra(s,L),(L&4194240)===L)break;for(c=s.eventTimes,D=-1;0<L;){var Q=31-Zn(L);V=1<<Q,Q=c[Q],Q>D&&(D=Q),L&=~V}if(L=D,L=vr()-L,L=(120>L?120:480>L?480:1080>L?1080:1920>L?1920:3e3>L?3e3:4320>L?4320:1960*FS(L/1960))-L,10<L){s.timeoutHandle=z(Ao.bind(null,s,rn,Yi),L);break}Ao(s,rn,Yi);break;case 5:Ao(s,rn,Yi);break;default:throw Error(o(329))}}}return nn(s,vr()),s.callbackNode===C?Ob.bind(null,s):null}function Y0(s,c){var C=fu;return s.current.memoizedState.isDehydrated&&(To(s,c).flags|=256),s=Lf(s,c),s!==2&&(c=rn,rn=C,c!==null&&K0(c)),s}function K0(s){rn===null?rn=s:rn.push.apply(rn,s)}function zS(s){for(var c=s;;){if(c.flags&16384){var C=c.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var L=0;L<C.length;L++){var D=C[L],V=D.getSnapshot;D=D.value;try{if(!Qn(V(),D))return!1}catch{return!1}}}if(C=c.child,c.subtreeFlags&16384&&C!==null)C.return=c,c=C;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 Ra(s,c){for(c&=~$0,c&=~Cf,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var C=31-Zn(c),L=1<<C;s[C]=-1,c&=~L}}function Pb(s){if(lt&6)throw Error(o(327));Ro();var c=Kc(s,0);if(!(c&1))return nn(s,vr()),null;var C=Lf(s,c);if(s.tag!==0&&C===2){var L=Wp(s);L!==0&&(c=L,C=Y0(s,L))}if(C===1)throw C=cu,To(s,0),Ra(s,c),nn(s,vr()),C;if(C===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,Ao(s,rn,Yi),nn(s,vr()),null}function xb(s){Ta!==null&&Ta.tag===0&&!(lt&6)&&Ro();var c=lt;lt|=1;var C=er.transition,L=vt;try{if(er.transition=null,vt=1,s)return s()}finally{vt=L,er.transition=C,lt=c,!(lt&6)&&Si()}}function X0(){wn=jl.current,jt(jl)}function To(s,c){s.finishedWork=null,s.finishedLanes=0;var C=s.timeoutHandle;if(C!==Z&&(s.timeoutHandle=Z,X(C)),ir!==null)for(C=ir.return;C!==null;){var L=C;switch(t0(L),L.tag){case 1:L=L.type.childContextTypes,L!=null&&Vc();break;case 3:Ll(),jt(Jr),jt(Lr),v0();break;case 5:p0(L);break;case 4:Ll();break;case 13:jt(Vt);break;case 19:jt(Vt);break;case 10:l0(L.type._context);break;case 22:case 23:X0()}C=C.return}if(yr=s,ir=s=Ma(s.current,null),Cr=wn=c,cr=0,cu=null,$0=Cf=ko=0,rn=fu=null,xo!==null){for(c=0;c<xo.length;c++)if(C=xo[c],L=C.interleaved,L!==null){C.interleaved=null;var D=L.next,V=C.pending;if(V!==null){var Q=V.next;V.next=D,L.next=Q}C.pending=L}xo=null}return s}function Cb(s,c){do{var C=ir;try{if(o0(),cf.current=pf,ff){for(var L=qt.memoizedState;L!==null;){var D=L.queue;D!==null&&(D.pending=null),L=L.next}ff=!1}if(Co=0,mr=ur=qt=null,tu=!1,ru=0,H0.current=null,C===null||C.return===null){cr=1,cu=c,ir=null;break}e:{var V=s,Q=C.return,ae=C,pe=c;if(c=Cr,ae.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var xe=pe,Ue=ae,et=Ue.tag;if(!(Ue.mode&1)&&(et===0||et===11||et===15)){var je=Ue.alternate;je?(Ue.updateQueue=je.updateQueue,Ue.memoizedState=je.memoizedState,Ue.lanes=je.lanes):(Ue.updateQueue=null,Ue.memoizedState=null)}var Dt=Q2(Q);if(Dt!==null){Dt.flags&=-257,J2(Dt,Q,ae,V,c),Dt.mode&1&&Z2(V,xe,c),c=Dt,pe=xe;var At=c.updateQueue;if(At===null){var an=new Set;an.add(pe),c.updateQueue=an}else At.add(pe);break e}else{if(!(c&1)){Z2(V,xe,c),Z0();break e}pe=Error(o(426))}}else if(Ut&&ae.mode&1){var Ki=Q2(Q);if(Ki!==null){!(Ki.flags&65536)&&(Ki.flags|=256),J2(Ki,Q,ae,V,c),i0(Nl(pe,ae));break e}}V=pe=Nl(pe,ae),cr!==4&&(cr=2),fu===null?fu=[V]:fu.push(V),V=Q;do{switch(V.tag){case 3:V.flags|=65536,c&=-c,V.lanes|=c;var fe=K2(V,pe,c);y2(V,fe);break e;case 1:ae=pe;var oe=V.type,ve=V.stateNode;if(!(V.flags&128)&&(typeof oe.getDerivedStateFromError=="function"||ve!==null&&typeof ve.componentDidCatch=="function"&&(ka===null||!ka.has(ve)))){V.flags|=65536,c&=-c,V.lanes|=c;var De=X2(V,ae,c);y2(V,De);break e}}V=V.return}while(V!==null)}Ab(C)}catch(We){c=We,ir===C&&C!==null&&(ir=C=C.return);continue}break}while(!0)}function kb(){var s=xf.current;return xf.current=pf,s===null?pf:s}function Z0(){(cr===0||cr===3||cr===2)&&(cr=4),yr===null||!(ko&268435455)&&!(Cf&268435455)||Ra(yr,Cr)}function Lf(s,c){var C=lt;lt|=2;var L=kb();(yr!==s||Cr!==c)&&(Yi=null,To(s,c));do try{BS();break}catch(D){Cb(s,D)}while(!0);if(o0(),lt=C,xf.current=L,ir!==null)throw Error(o(261));return yr=null,Cr=0,cr}function BS(){for(;ir!==null;)Tb(ir)}function US(){for(;ir!==null&&!hS();)Tb(ir)}function Tb(s){var c=Lb(s.alternate,s,wn);s.memoizedProps=s.pendingProps,c===null?Ab(s):ir=c,H0.current=null}function Ab(s){var c=s;do{var C=c.alternate;if(s=c.return,c.flags&32768){if(C=NS(C,c),C!==null){C.flags&=32767,ir=C;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{cr=6,ir=null;return}}else if(C=LS(C,c,wn),C!==null){ir=C;return}if(c=c.sibling,c!==null){ir=c;return}ir=c=s}while(c!==null);cr===0&&(cr=5)}function Ao(s,c,C){var L=vt,D=er.transition;try{er.transition=null,vt=1,HS(s,c,C,L)}finally{er.transition=D,vt=L}return null}function HS(s,c,C,L){do Ro();while(Ta!==null);if(lt&6)throw Error(o(327));C=s.finishedWork;var D=s.finishedLanes;if(C===null)return null;if(s.finishedWork=null,s.finishedLanes=0,C===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var V=C.lanes|C.childLanes;if(dS(s,V),s===yr&&(ir=yr=null,Cr=0),!(C.subtreeFlags&2064)&&!(C.flags&2064)||Tf||(Tf=!0,Nb(Qp,function(){return Ro(),null})),V=(C.flags&15990)!==0,C.subtreeFlags&15990||V){V=er.transition,er.transition=null;var Q=vt;vt=1;var ae=lt;lt|=4,H0.current=null,jS(s,C),yb(C,s),M(s.containerInfo),s.current=C,DS(C),pS(),lt=ae,vt=Q,er.transition=V}else s.current=C;if(Tf&&(Tf=!1,Ta=s,Af=D),V=s.pendingLanes,V===0&&(ka=null),mS(C.stateNode),nn(s,vr()),c!==null)for(L=s.onRecoverableError,C=0;C<c.length;C++)D=c[C],L(D.value,{componentStack:D.stack,digest:D.digest});if(kf)throw kf=!1,s=q0,q0=null,s;return Af&1&&s.tag!==0&&Ro(),V=s.pendingLanes,V&1?s===W0?du++:(du=0,W0=s):du=0,Si(),null}function Ro(){if(Ta!==null){var s=l2(Af),c=er.transition,C=vt;try{if(er.transition=null,vt=16>s?16:s,Ta===null)var L=!1;else{if(s=Ta,Ta=null,Af=0,lt&6)throw Error(o(331));var D=lt;for(lt|=4,ze=s.current;ze!==null;){var V=ze,Q=V.child;if(ze.flags&16){var ae=V.deletions;if(ae!==null){for(var pe=0;pe<ae.length;pe++){var xe=ae[pe];for(ze=xe;ze!==null;){var Ue=ze;switch(Ue.tag){case 0:case 11:case 15:su(8,Ue,V)}var et=Ue.child;if(et!==null)et.return=Ue,ze=et;else for(;ze!==null;){Ue=ze;var je=Ue.sibling,Dt=Ue.return;if(pb(Ue),Ue===xe){ze=null;break}if(je!==null){je.return=Dt,ze=je;break}ze=Dt}}}var At=V.alternate;if(At!==null){var an=At.child;if(an!==null){At.child=null;do{var Ki=an.sibling;an.sibling=null,an=Ki}while(an!==null)}}ze=V}}if(V.subtreeFlags&2064&&Q!==null)Q.return=V,ze=Q;else e:for(;ze!==null;){if(V=ze,V.flags&2048)switch(V.tag){case 0:case 11:case 15:su(9,V,V.return)}var fe=V.sibling;if(fe!==null){fe.return=V.return,ze=fe;break e}ze=V.return}}var oe=s.current;for(ze=oe;ze!==null;){Q=ze;var ve=Q.child;if(Q.subtreeFlags&2064&&ve!==null)ve.return=Q,ze=ve;else e:for(Q=oe;ze!==null;){if(ae=ze,ae.flags&2048)try{switch(ae.tag){case 0:case 11:case 15:_f(9,ae)}}catch(We){Ht(ae,ae.return,We)}if(ae===Q){ze=null;break e}var De=ae.sibling;if(De!==null){De.return=ae.return,ze=De;break e}ze=ae.return}}if(lt=D,Si(),wi&&typeof wi.onPostCommitFiberRoot=="function")try{wi.onPostCommitFiberRoot(Xc,s)}catch{}L=!0}return L}finally{vt=C,er.transition=c}}return!1}function Rb(s,c,C){c=Nl(C,c),c=K2(s,c,1),s=Ca(s,c,1),c=Dr(),s!==null&&(Xs(s,1,c),nn(s,c))}function Ht(s,c,C){if(s.tag===3)Rb(s,s,C);else for(;c!==null;){if(c.tag===3){Rb(c,s,C);break}else if(c.tag===1){var L=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof L.componentDidCatch=="function"&&(ka===null||!ka.has(L))){s=Nl(C,s),s=X2(c,s,1),c=Ca(c,s,1),s=Dr(),c!==null&&(Xs(c,1,s),nn(c,s));break}}c=c.return}}function $S(s,c,C){var L=s.pingCache;L!==null&&L.delete(c),c=Dr(),s.pingedLanes|=s.suspendedLanes&C,yr===s&&(Cr&C)===C&&(cr===4||cr===3&&(Cr&130023424)===Cr&&500>vr()-G0?To(s,0):$0|=C),nn(s,c)}function Mb(s,c){c===0&&(s.mode&1?(c=Yc,Yc<<=1,!(Yc&130023424)&&(Yc=4194304)):c=1);var C=Dr();s=Ei(s,c),s!==null&&(Xs(s,c,C),nn(s,C))}function GS(s){var c=s.memoizedState,C=0;c!==null&&(C=c.retryLane),Mb(s,C)}function VS(s,c){var C=0;switch(s.tag){case 13:var L=s.stateNode,D=s.memoizedState;D!==null&&(C=D.retryLane);break;case 19:L=s.stateNode;break;default:throw Error(o(314))}L!==null&&L.delete(c),Mb(s,C)}var Lb;Lb=function(s,c,C){if(s!==null)if(s.memoizedProps!==c.pendingProps||Jr.current)tn=!0;else{if(!(s.lanes&C)&&!(c.flags&128))return tn=!1,MS(s,c,C);tn=!!(s.flags&131072)}else tn=!1,Ut&&c.flags&1048576&&c2(c,Jc,c.index);switch(c.lanes=0,c.tag){case 2:var L=c.type;vf(s,c),s=c.pendingProps;var D=Pl(c,Lr.current);Al(c,C),D=b0(null,c,L,s,D,C);var V=_0();return c.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,en(L)?(V=!0,qc(c)):V=!1,c.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,c0(c),D.updater=lf,c.stateNode=D,D._reactInternals=c,d0(c,L,s,C),c=k0(null,c,L,!0,V,C)):(c.tag=0,Ut&&V&&e0(c),Gr(null,c,D,C),c=c.child),c;case 16:L=c.elementType;e:{switch(vf(s,c),s=c.pendingProps,D=L._init,L=D(L._payload),c.type=L,D=c.tag=WS(L),s=ei(L,s),D){case 0:c=C0(null,c,L,s,C);break e;case 1:c=ab(null,c,L,s,C);break e;case 11:c=eb(null,c,L,s,C);break e;case 14:c=tb(null,c,L,ei(L.type,s),C);break e}throw Error(o(306,L,""))}return c;case 0:return L=c.type,D=c.pendingProps,D=c.elementType===L?D:ei(L,D),C0(s,c,L,D,C);case 1:return L=c.type,D=c.pendingProps,D=c.elementType===L?D:ei(L,D),ab(s,c,L,D,C);case 3:e:{if(ob(c),s===null)throw Error(o(387));L=c.pendingProps,V=c.memoizedState,D=V.element,m2(s,c),of(c,L,null,C);var Q=c.memoizedState;if(L=Q.element,se&&V.isDehydrated)if(V={element:L,isDehydrated:!1,cache:Q.cache,pendingSuspenseBoundaries:Q.pendingSuspenseBoundaries,transitions:Q.transitions},c.updateQueue.baseState=V,c.memoizedState=V,c.flags&256){D=Nl(Error(o(423)),c),c=lb(s,c,L,C,D);break e}else if(L!==D){D=Nl(Error(o(424)),c),c=lb(s,c,L,C,D);break e}else for(se&&(Ln=Zr(c.stateNode.containerInfo),_n=c,Ut=!0,Jn=null,Zs=!1),C=x2(c,null,L,C),c.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(kl(),L===D){c=Wi(s,c,C);break e}Gr(s,c,L,C)}c=c.child}return c;case 5:return C2(c),s===null&&n0(c),L=c.type,D=c.pendingProps,V=s!==null?s.memoizedProps:null,Q=D.children,K(L,D)?Q=null:V!==null&&K(L,V)&&(c.flags|=32),ib(s,c),Gr(s,c,Q,C),c.child;case 6:return s===null&&n0(c),null;case 13:return sb(s,c,C);case 4:return h0(c,c.stateNode.containerInfo),L=c.pendingProps,s===null?c.child=Rl(c,null,L,C):Gr(s,c,L,C),c.child;case 11:return L=c.type,D=c.pendingProps,D=c.elementType===L?D:ei(L,D),eb(s,c,L,D,C);case 7:return Gr(s,c,c.pendingProps,C),c.child;case 8:return Gr(s,c,c.pendingProps.children,C),c.child;case 12:return Gr(s,c,c.pendingProps.children,C),c.child;case 10:e:{if(L=c.type._context,D=c.pendingProps,V=c.memoizedProps,Q=D.value,g2(c,L,Q),V!==null)if(Qn(V.value,Q)){if(V.children===D.children&&!Jr.current){c=Wi(s,c,C);break e}}else for(V=c.child,V!==null&&(V.return=c);V!==null;){var ae=V.dependencies;if(ae!==null){Q=V.child;for(var pe=ae.firstContext;pe!==null;){if(pe.context===L){if(V.tag===1){pe=qi(-1,C&-C),pe.tag=2;var xe=V.updateQueue;if(xe!==null){xe=xe.shared;var Ue=xe.pending;Ue===null?pe.next=pe:(pe.next=Ue.next,Ue.next=pe),xe.pending=pe}}V.lanes|=C,pe=V.alternate,pe!==null&&(pe.lanes|=C),s0(V.return,C,c),ae.lanes|=C;break}pe=pe.next}}else if(V.tag===10)Q=V.type===c.type?null:V.child;else if(V.tag===18){if(Q=V.return,Q===null)throw Error(o(341));Q.lanes|=C,ae=Q.alternate,ae!==null&&(ae.lanes|=C),s0(Q,C,c),Q=V.sibling}else Q=V.child;if(Q!==null)Q.return=V;else for(Q=V;Q!==null;){if(Q===c){Q=null;break}if(V=Q.sibling,V!==null){V.return=Q.return,Q=V;break}Q=Q.return}V=Q}Gr(s,c,D.children,C),c=c.child}return c;case 9:return D=c.type,L=c.pendingProps.children,Al(c,C),D=Nn(D),L=L(D),c.flags|=1,Gr(s,c,L,C),c.child;case 14:return L=c.type,D=ei(L,c.pendingProps),D=ei(L.type,D),tb(s,c,L,D,C);case 15:return rb(s,c,c.type,c.pendingProps,C);case 17:return L=c.type,D=c.pendingProps,D=c.elementType===L?D:ei(L,D),vf(s,c),c.tag=1,en(L)?(s=!0,qc(c)):s=!1,Al(c,C),S2(c,L,D),d0(c,L,D,C),k0(null,c,L,!0,s,C);case 19:return cb(s,c,C);case 22:return nb(s,c,C)}throw Error(o(156,c.tag))};function Nb(s,c){return Xp(s,c)}function qS(s,c,C,L){this.tag=s,this.key=C,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=L,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(s,c,C,L){return new qS(s,c,C,L)}function Q0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function WS(s){if(typeof s=="function")return Q0(s)?1:0;if(s!=null){if(s=s.$$typeof,s===m)return 11;if(s===g)return 14}return 2}function Ma(s,c){var C=s.alternate;return C===null?(C=Fn(s.tag,c,s.key,s.mode),C.elementType=s.elementType,C.type=s.type,C.stateNode=s.stateNode,C.alternate=s,s.alternate=C):(C.pendingProps=c,C.type=s.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=s.flags&14680064,C.childLanes=s.childLanes,C.lanes=s.lanes,C.child=s.child,C.memoizedProps=s.memoizedProps,C.memoizedState=s.memoizedState,C.updateQueue=s.updateQueue,c=s.dependencies,C.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},C.sibling=s.sibling,C.index=s.index,C.ref=s.ref,C}function Nf(s,c,C,L,D,V){var Q=2;if(L=s,typeof s=="function")Q0(s)&&(Q=1);else if(typeof s=="string")Q=5;else e:switch(s){case v:return Mo(C.children,D,V,c);case S:Q=8,D|=8;break;case _:return s=Fn(12,C,c,D|2),s.elementType=_,s.lanes=V,s;case p:return s=Fn(13,C,c,D),s.elementType=p,s.lanes=V,s;case y:return s=Fn(19,C,c,D),s.elementType=y,s.lanes=V,s;case b:return If(C,D,V,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case h:Q=10;break e;case E:Q=9;break e;case m:Q=11;break e;case g:Q=14;break e;case d:Q=16,L=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Fn(Q,C,c,D),c.elementType=s,c.type=L,c.lanes=V,c}function Mo(s,c,C,L){return s=Fn(7,s,L,c),s.lanes=C,s}function If(s,c,C,L){return s=Fn(22,s,L,c),s.elementType=b,s.lanes=C,s.stateNode={isHidden:!1},s}function J0(s,c,C){return s=Fn(6,s,null,c),s.lanes=C,s}function e1(s,c,C){return c=Fn(4,s.children!==null?s.children:[],s.key,c),c.lanes=C,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function YS(s,c,C,L,D){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Z,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yp(0),this.expirationTimes=Yp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yp(0),this.identifierPrefix=L,this.onRecoverableError=D,se&&(this.mutableSourceEagerHydrationData=null)}function Ib(s,c,C,L,D,V,Q,ae,pe){return s=new YS(s,c,C,ae,pe),c===1?(c=1,V===!0&&(c|=8)):c=0,V=Fn(3,null,null,c),s.current=V,V.stateNode=s,V.memoizedState={element:L,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},c0(V),s}function jb(s){if(!s)return Pa;s=s._reactInternals;e:{if(T(s)!==s||s.tag!==1)throw Error(o(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(en(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var C=s.type;if(en(C))return i2(s,C,c)}return c}function Db(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 Fb(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var C=s.retryLane;s.retryLane=C!==0&&C<c?C:c}}function jf(s,c){Fb(s,c),(s=s.alternate)&&Fb(s,c)}function KS(s){return s=R(s),s===null?null:s.stateNode}function XS(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=Ei(s,134217728);if(c!==null){var C=Dr();Dn(c,s,134217728,C)}jf(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=Ei(s,1);if(c!==null){var C=Dr();Dn(c,s,1,C)}jf(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=Aa(s),C=Ei(s,c);if(C!==null){var L=Dr();Dn(C,s,c,L)}jf(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var C=Ks(c.pendingLanes);C!==0&&(Kp(c,C|1),nn(c,vr()),!(lt&6)&&(Dl(),Si()))}break;case 13:xb(function(){var L=Ei(s,1);if(L!==null){var D=Dr();Dn(L,s,1,D)}}),jf(s,1)}},r.batchedUpdates=function(s,c){var C=lt;lt|=1;try{return s(c)}finally{lt=C,lt===0&&(Dl(),Zc&&Si())}},r.createComponentSelector=function(s){return{$$typeof:wf,value:s}},r.createContainer=function(s,c,C,L,D,V,Q){return Ib(s,c,!1,null,C,L,D,V,Q)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Sf,value:s}},r.createHydrationContainer=function(s,c,C,L,D,V,Q,ae,pe){return s=Ib(C,L,!0,s,D,V,Q,ae,pe),s.context=jb(null),C=s.current,L=Dr(),D=Aa(C),V=qi(L,D),V.callback=c??null,Ca(C,V,D),s.current.lanes=D,Xs(s,D,L),nn(s,L),s},r.createPortal=function(s,c,C){var L=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:L==null?null:""+L,children:s,containerInfo:c,implementation:C}},r.createRoleSelector=function(s){return{$$typeof:Ef,value:s}},r.createTestNameSelector=function(s){return{$$typeof:Of,value:s}},r.createTextSelector=function(s){return{$$typeof:Pf,value:s}},r.deferredUpdates=function(s){var c=vt,C=er.transition;try{return er.transition=null,vt=16,s()}finally{vt=c,er.transition=C}},r.discreteUpdates=function(s,c,C,L,D){var V=vt,Q=er.transition;try{return er.transition=null,vt=1,s(c,C,L,D)}finally{vt=V,er.transition=Q,lt===0&&Dl()}},r.findAllNodes=U0,r.findBoundingRects=function(s,c){if(!_e)throw Error(o(363));c=U0(s,c),s=[];for(var C=0;C<c.length;C++)s.push(re(c[C]));for(c=s.length-1;0<c;c--){C=s[c];for(var L=C.x,D=L+C.width,V=C.y,Q=V+C.height,ae=c-1;0<=ae;ae--)if(c!==ae){var pe=s[ae],xe=pe.x,Ue=xe+pe.width,et=pe.y,je=et+pe.height;if(L>=xe&&V>=et&&D<=Ue&&Q<=je){s.splice(c,1);break}else if(L!==xe||C.width!==pe.width||je<V||et>Q){if(!(V!==et||C.height!==pe.height||Ue<L||xe>D)){xe>L&&(pe.width+=xe-L,pe.x=L),Ue<D&&(pe.width=D-xe),s.splice(c,1);break}}else{et>V&&(pe.height+=et-V,pe.y=V),je<Q&&(pe.height=Q-et),s.splice(c,1);break}}}return s},r.findHostInstance=Db,r.findHostInstanceWithNoPortals=function(s){return s=A(s),s=s!==null?H(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return Db(s)},r.flushControlled=function(s){var c=lt;lt|=1;var C=er.transition,L=vt;try{er.transition=null,vt=1,s()}finally{vt=L,er.transition=C,lt=c,lt===0&&(Dl(),Si())}},r.flushPassiveEffects=Ro,r.flushSync=xb,r.focusWithin=function(s,c){if(!_e)throw Error(o(363));for(s=F0(s),c=Eb(s,c),c=Array.from(c),s=0;s<c.length;){var C=c[s++];if(!ge(C)){if(C.tag===5&&we(C.stateNode))return!0;for(C=C.child;C!==null;)c.push(C),C=C.sibling}}return!1},r.getCurrentUpdatePriority=function(){return vt},r.getFindAllNodesFailureDescription=function(s,c){if(!_e)throw Error(o(363));var C=0,L=[];s=[F0(s),0];for(var D=0;D<s.length;){var V=s[D++],Q=s[D++],ae=c[Q];if((V.tag!==5||!ge(V))&&(z0(V,ae)&&(L.push(B0(ae)),Q++,Q>C&&(C=Q)),Q<c.length))for(V=V.child;V!==null;)s.push(V,Q),V=V.sibling}if(C<c.length){for(s=[];C<c.length;C++)s.push(B0(c[C]));return`findAllNodes was able to match part of the selector:
|
|
58
|
+
`+(L.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 $(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:KS,findFiberByHostInstance:s.findFiberByHostInstance||XS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)s=!0;else{try{Xc=c.inject(s),wi=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,C,L){if(!_e)throw Error(o(363));s=U0(s,c);var D=Ee(s,C,L).disconnect;return{disconnect:function(){D()}}},r.registerMutableSourceForHydration=function(s,c){var C=c._getVersion;C=C(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,C]:s.mutableSourceEagerHydrationData.push(c,C)},r.runWithPriority=function(s,c){var C=vt;try{return vt=s,c()}finally{vt=C}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,C,L){var D=c.current,V=Dr(),Q=Aa(D);return C=jb(C),c.context===null?c.context=C:c.pendingContext=C,c=qi(V,Q),c.payload={element:s},L=L===void 0?null:L,L!==null&&(c.callback=L),s=Ca(D,c,Q),s!==null&&(Dn(s,D,Q,V),af(s,D,Q)),Q},r};g9.exports=qR;var WR=g9.exports;const YR=vh(WR);var v9={exports:{}},yl={};/**
|
|
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
|
+
*/yl.ConcurrentRoot=1;yl.ContinuousEventPriority=4;yl.DefaultEventPriority=16;yl.DiscreteEventPriority=1;yl.IdleEventPriority=536870912;yl.LegacyRoot=0;v9.exports=yl;var m9=v9.exports;const V5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let q5=!1,W5=!1;const Ty=".react-konva-event";let y9=!1;function KR(e){y9=e}const XR=`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
|
+
`,ZR=`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
|
+
`,QR={};function Ip(e,t,r=QR){if(!q5&&"zIndex"in t&&(console.warn(ZR),q5=!0),!W5&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(XR),W5=!0)}for(var a in r)if(!V5[a]){var o=a.slice(0,2)==="on",l=r[a]!==t[a];if(o&&l){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var f=!t.hasOwnProperty(a);f&&e.setAttr(a,void 0)}var v=y9||t._useStrictMode,S={},_=!1;const h={};for(var a in t)if(!V5[a]){var o=a.slice(0,2)==="on",E=r[a]!==t[a];if(o&&E){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(h[u]=t[a])}!o&&(t[a]!==r[a]||v&&t[a]!==e.getAttr(a))&&(_=!0,S[a]=t[a])}_&&(e.setAttrs(S),mo(e));for(var u in h)e.on(u+Ty,h[u])}function mo(e){if(!at.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const b9={},JR={};dc.Node.prototype._applyProps=Ip;function eM(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),mo(e)}function tM(e,t,r){let n=dc[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=dc.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 Ip(u,a),u}function rM(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function nM(e,t,r){return!1}function iM(e){return e}function aM(){return null}function oM(){return null}function lM(e,t,r,n){return JR}function sM(){}function uM(e){}function cM(e,t){return!1}function fM(){return b9}function dM(){return b9}const hM=setTimeout,pM=clearTimeout,gM=-1;function vM(e,t){return!1}const mM=!1,yM=!0,bM=!0;function _M(e,t){t.parent===e?t.moveToTop():e.add(t),mo(e)}function wM(e,t){t.parent===e?t.moveToTop():e.add(t),mo(e)}function _9(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),mo(e)}function SM(e,t,r){_9(e,t,r)}function EM(e,t){t.destroy(),t.off(Ty),mo(e)}function OM(e,t){t.destroy(),t.off(Ty),mo(e)}function PM(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function xM(e,t,r){}function CM(e,t,r,n,i){Ip(e,i,n)}function kM(e){e.hide(),mo(e)}function TM(e){}function AM(e,t){(t.visible==null||t.visible)&&e.show()}function RM(e,t){}function MM(e){}function LM(){}const NM=()=>m9.DefaultEventPriority,IM=Object.freeze(Object.defineProperty({__proto__:null,appendChild:_M,appendChildToContainer:wM,appendInitialChild:eM,cancelTimeout:pM,clearContainer:MM,commitMount:xM,commitTextUpdate:PM,commitUpdate:CM,createInstance:tM,createTextInstance:rM,detachDeletedInstance:LM,finalizeInitialChildren:nM,getChildHostContext:dM,getCurrentEventPriority:NM,getPublicInstance:iM,getRootHostContext:fM,hideInstance:kM,hideTextInstance:TM,idlePriority:Au.unstable_IdlePriority,insertBefore:_9,insertInContainerBefore:SM,isPrimaryRenderer:mM,noTimeout:gM,now:Au.unstable_now,prepareForCommit:aM,preparePortalMount:oM,prepareUpdate:lM,removeChild:EM,removeChildFromContainer:OM,resetAfterCommit:sM,resetTextContent:uM,run:Au.unstable_runWithPriority,scheduleTimeout:hM,shouldDeprioritizeSubtree:cM,shouldSetTextContent:vM,supportsMutation:bM,unhideInstance:AM,unhideTextInstance:RM,warnsIfNotActing:yM},Symbol.toStringTag,{value:"Module"}));var jM=Object.defineProperty,DM=Object.defineProperties,FM=Object.getOwnPropertyDescriptors,Y5=Object.getOwnPropertySymbols,zM=Object.prototype.hasOwnProperty,BM=Object.prototype.propertyIsEnumerable,K5=(e,t,r)=>t in e?jM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X5=(e,t)=>{for(var r in t||(t={}))zM.call(t,r)&&K5(e,r,t[r]);if(Y5)for(var r of Y5(t))BM.call(t,r)&&K5(e,r,t[r]);return e},UM=(e,t)=>DM(e,FM(t));function w9(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=t?e.return:e.child;for(;n;){const i=w9(n,t,r);if(i)return i;n=t?null:n.sibling}}function S9(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Ay=S9(Qe.createContext(null));class E9 extends Qe.Component{render(){return Qe.createElement(Ay.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Z5,ReactCurrentDispatcher:Q5}=Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function HM(){const e=Qe.useContext(Ay);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Qe.useId();return Qe.useMemo(()=>{for(const n of[Z5==null?void 0:Z5.current,e,e==null?void 0:e.alternate]){if(!n)continue;const i=w9(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 $M(){var e,t;const r=HM(),[n]=Qe.useState(()=>new Map);n.clear();let i=r;for(;i;){const a=(e=i.type)==null?void 0:e._context;a&&a!==Ay&&!n.has(a)&&n.set(a,(t=Q5==null?void 0:Q5.current)==null?void 0:t.readContext(S9(a))),i=i.return}return n}function GM(){const e=$M();return Qe.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>Qe.createElement(t,null,Qe.createElement(r.Provider,UM(X5({},n),{value:e.get(r)}))),t=>Qe.createElement(E9,X5({},t))),[e])}function VM(e){const t=ut.useRef({});return ut.useLayoutEffect(()=>{t.current=e}),ut.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const qM=e=>{const t=ut.useRef(),r=ut.useRef(),n=ut.useRef(),i=VM(e),a=GM(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return ut.useLayoutEffect(()=>(r.current=new dc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=is.createContainer(r.current,m9.LegacyRoot,!1,null),is.updateContainer(ut.createElement(a,{},e.children),n.current),()=>{dc.isBrowser&&(o(null),is.updateContainer(null,n.current,null),r.current.destroy())}),[]),ut.useLayoutEffect(()=>{o(r.current),Ip(r.current,e,i),is.updateContainer(ut.createElement(a,{},e.children),n.current,null)}),ut.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})},WM="Layer",YM="FastLayer",dh="Group",KM="Label",XM="Rect",ZM="Circle",QM="Ellipse",JM="Wedge",eL="Line",tL="Sprite",rL="Image",nL="Text",iL="TextPath",aL="Star",oL="Ring",lL="Arc",sL="Tag",uL="Path",cL="RegularPolygon",fL="Arrow",dL="Shape",hL="Transformer",is=YR(IM);is.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ut.version,rendererPackageName:"react-konva"});const pL=ut.forwardRef((e,t)=>ut.createElement(E9,{},ut.createElement(qM,{...e,forwardedRef:t}))),gL=KR,vL=Object.freeze(Object.defineProperty({__proto__:null,Arc:lL,Arrow:fL,Circle:ZM,Ellipse:QM,FastLayer:YM,Group:dh,Image:rL,KonvaRenderer:is,Label:KM,Layer:WM,Line:eL,Path:uL,Rect:XM,RegularPolygon:cL,Ring:oL,Shape:dL,Sprite:tL,Stage:pL,Star:aL,Tag:sL,Text:nL,TextPath:iL,Transformer:hL,Wedge:JM,useStrictMode:gL},Symbol.toStringTag,{value:"Module"})),_a=ao(vL);var Io=Qe,jp=function(t,r,n){const i=Io.useRef("loading"),a=Io.useRef(),[o,l]=Io.useState(0),u=Io.useRef(),f=Io.useRef(),v=Io.useRef();return(u.current!==t||f.current!==r||v.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,v.current=n),Io.useLayoutEffect(function(){if(!t)return;var S=document.createElement("img");function _(){i.current="loaded",a.current=S,l(Math.random())}function h(){i.current="failed",a.current=void 0,l(Math.random())}return S.addEventListener("load",_),S.addEventListener("error",h),r&&(S.crossOrigin=r),n&&(S.referrerPolicy=n),S.src=t,function(){S.removeEventListener("load",_),S.removeEventListener("error",h)}},[t,r,n]),[a.current,i.current]};const mL=vh(jp);var O9={},Ry={},yL=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 bL=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function P9(e=()=>{}){const t=ut.useRef(e);return t.current=e,ut.useCallback((...r)=>t.current.apply(null,r),[])}const _L=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=ut.useRef(null);ut.useRef();const[o]=ut.useState(()=>document.createElement("div")),l=ut.useMemo(()=>Cd.createRoot(o),[o]),u=n??!0,f=P9(()=>{if(u&&a.current){let E=a.current.getAbsoluteTransform().decompose();i&&(E=i(E)),o.style.position="absolute",o.style.zIndex="10",o.style.top="0px",o.style.left="0px",o.style.transform=`translate(${E.x}px, ${E.y}px) rotate(${E.rotation}deg) scaleX(${E.scaleX}) scaleY(${E.scaleY})`,o.style.transformOrigin="top left"}else o.style.position="",o.style.zIndex="",o.style.top="",o.style.left="",o.style.transform="",o.style.transformOrigin="";const v=r||{},{style:S}=v,_=yL(v,["style"]);Object.assign(o.style,S),Object.assign(o,_)});return ut.useLayoutEffect(()=>{var v;const S=a.current;if(!S)return;const _=(v=S.getStage())===null||v===void 0?void 0:v.container();if(_)return _.appendChild(o),u&&bL(_)&&(_.style.position="relative"),S.on("absoluteTransformChange",f),f(),()=>{var h;S.off("absoluteTransformChange",f),(h=o.parentNode)===null||h===void 0||h.removeChild(o)}},[u]),ut.useLayoutEffect(()=>{f()},[r,i]),ut.useLayoutEffect(()=>{l.render(e)}),ut.useLayoutEffect(()=>()=>{setTimeout(()=>{l.unmount()})},[]),ut.createElement(dh,Object.assign({ref:a},t))},wL=({selector:e,enabled:t,children:r})=>{const n=ut.useRef(null),i=ut.useRef(null),a=ut.useRef(),o=t??!0;return ut.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const f=n.current.getLayer();if(f&&(f.batchDraw(),u)){const v=u.getLayer();if(!v)return;v.batchDraw()}},[e,o]),ut.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),ut.createElement(dh,{name:"_outer_portal",ref:n},ut.createElement(dh,{name:"_inner_portal",ref:i},r))},SL=Object.freeze(Object.defineProperty({__proto__:null,Html:_L,Portal:wL,useEvent:P9,useImage:mL},Symbol.toStringTag,{value:"Module"})),Fc=ao(SL);function EL(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[k9(n,r.length)];return i.marker!=="Z"?i:x9(e,n,r)}function C9(e,t,r){const n=t+1,i=r[k9(n,r.length)];return i.marker==="Z"?C9(e,n,r):i}function OL(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 PL(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 k9(e,t){return(e%t+t)%t}function xL(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 Kv(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,Kv(e,t-1)),e[t].marker==="Z"&&Kv(e,t-1)}function CL(e,t,r){const n=e4(e.values,r.values),i=e4(t.values,e.values);return Math.min(i,n)}function J5(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function e4(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 t4(e,t){return Math.sin(e)*t}function r4(e,t){return Math.cos(e)*t}function n4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function kL(e,t){return t*Math.tan(e)}function TL(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=n4(e/2,-t):(r=n4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function AL(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 T9(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 PL(n.marker,a)}).map(OL)}function A9(e,t,r){let n=[],i=[];return r&&e.forEach(a=>EL(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(xL),Kv(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const S=x9(l,u,f),_=C9(l,u,f),h=J5(l.values,S.values),E=J5(l.values,_.values),m=E-h,p=m*(180/Math.PI),y=CL(l,S,_),g=Math.abs(kL(m/2,y/2)),d=Math.min(t,g),b=TL(m,d),O=b.offset,P=b.sweepFlag,x=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const w=[l.values.x+t4(h,O),l.values.y+r4(h,O)],T=[l.values.x+t4(E,O),l.values.y+r4(E,O)];x?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(w[0].toFixed(3)),y:parseFloat(w[1].toFixed(3))}}),!x&&(_.marker==="L"||_.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:d,radiusY:d,rotation:p,largeArc:0,sweep:P,x:parseFloat(T[0].toFixed(3)),y:parseFloat(T[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:l.marker,values:l.values});break}})}),{path:AL(i),commands:i}}function RL(e,t,r){return A9([...T9(e)],t,r)}const ML=Object.freeze(Object.defineProperty({__proto__:null,parsePath:T9,roundCommands:A9,roundCorners:RL},Symbol.toStringTag,{value:"Module"})),LL=ao(ML);var zc={},My={},Ly={},bl=bl||{};bl.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 bl=bl||{};bl.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(I){var U=new Error(t+": "+I);throw U.source=t,U}function n(){var I=i();return t.length>0&&r("Invalid input not EOF"),I}function i(){return d(a)}function a(){return o("linear-gradient",e.linearGradient,u)||o("repeating-linear-gradient",e.repeatingLinearGradient,u)||o("radial-gradient",e.radialGradient,S)||o("repeating-radial-gradient",e.repeatingRadialGradient,S)}function o(I,U,W){return l(U,function(M){var j=W();return j&&(Y(e.comma)||r("Missing comma before color stops")),{type:I,orientation:j,colorStops:d(b)}})}function l(I,U){var W=Y(I);if(W){Y(e.startCall)||r("Missing (");var M=U(W);return Y(e.endCall)||r("Missing )"),M}}function u(){return f()||v()}function f(){return H("directional",e.sideOrCorner,1)}function v(){return H("angular",e.angleValue,1)}function S(){var I,U=_(),W;return U&&(I=[],I.push(U),W=t,Y(e.comma)&&(U=_(),U?I.push(U):t=W)),I}function _(){var I=h()||E();if(I)I.at=p();else{var U=m();if(U){I=U;var W=p();W&&(I.at=W)}else{var M=y();M&&(I={type:"default-radial",at:M})}}return I}function h(){var I=H("shape",/^(circle)/i,0);return I&&(I.style=F()||m()),I}function E(){var I=H("shape",/^(ellipse)/i,0);return I&&(I.style=A()||m()),I}function m(){return H("extent-keyword",e.extentKeywords,1)}function p(){if(H("position",/^at/,0)){var I=y();return I||r("Missing positioning value"),I}}function y(){var I=g();if(I.x||I.y)return{type:"position",value:I}}function g(){return{x:A(),y:A()}}function d(I){var U=I(),W=[];if(U)for(W.push(U);Y(e.comma);)U=I(),U?W.push(U):r("One extra comma");return W}function b(){var I=O();return I||r("Expected color definition"),I.length=A(),I}function O(){return x()||T()||w()||P()}function P(){return H("literal",e.literalColor,0)}function x(){return H("hex",e.hexColor,1)}function w(){return l(e.rgbColor,function(){return{type:"rgb",value:d(k)}})}function T(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(k)}})}function k(){return Y(e.number)[1]}function A(){return H("%",e.percentageValue,1)||R()||F()}function R(){return H("position-keyword",e.positionKeywords,1)}function F(){return H("px",e.pixelValue,1)||H("em",e.emValue,1)}function H(I,U,W){var M=Y(U);if(M)return{type:I,value:M[W]}}function Y(I){var U,W;return W=/^[\n\r\t\s]+/.exec(t),W&&$(W[0].length),U=I.exec(t),U&&$(U[0].length),U}function $(I){t=t.substr(I)}return function(I){return t=I.toString(),n()}}();Ly.parse=bl.parse;Ly.stringify=bl.stringify;(function(e){var t=be&&be.__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(Ly),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})(My);(function(e){var t=be&&be.__createBinding||(Object.create?function(f,v,S,_){_===void 0&&(_=S);var h=Object.getOwnPropertyDescriptor(v,S);h&&!("get"in h?!v.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return v[S]}}),Object.defineProperty(f,_,h)}:function(f,v,S,_){_===void 0&&(_=S),f[_]=v[S]}),r=be&&be.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),n=be&&be.__importStar||function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var S in f)S!=="default"&&Object.prototype.hasOwnProperty.call(f,S)&&t(v,f,S);return r(v,f),v},i=be&&be.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(Qe),o=n(My),l=i(Kn),u=(f,v=f.fill,S="fill")=>a.default.useMemo(()=>{if(!o.isGradient(v))return{[S]:v};const{stops:_,rotation:h}=o.parseColor(v),E={x:f.a.width/2,y:f.a.height/2},m=Math.sqrt(Math.pow(E.x,2)+Math.pow(E.y,2)),p=l.default.Util.degToRad(h)-Math.PI/2,y=[];return _.forEach(({offset:g,color:d})=>{y.push(g,d)}),S==="fill"?{fillLinearGradientStartPointX:E.x-m*Math.cos(p),fillLinearGradientStartPointY:E.y-m*Math.sin(p),fillLinearGradientColorStops:y,fillLinearGradientEndPointX:E.x+m*Math.cos(p),fillLinearGradientEndPointY:E.y+m*Math.sin(p),fill:_[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:E.x-m*Math.cos(p),strokeLinearGradientStartPointY:E.y-m*Math.sin(p),strokeLinearGradientColorStops:y,strokeLinearGradientEndPointX:E.x+m*Math.cos(p),strokeLinearGradientEndPointY:E.y+m*Math.sin(p)}},[v,f.width,f.height]);e.useColor=u})(zc);var da={},_l={};(function(e){var t=be&&be.__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(Qe),n=t(Kn);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const v=r.default.useRef();r.default.useLayoutEffect(()=>{v.current&&v.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const S=u.current.opacity();return S?(u.current.opacity(0),v.current=new n.default.Tween({node:u.current,opacity:S,onFinish:()=>{var _;(_=v.current)===null||_===void 0||_.destroy()}}),v.current.play(),()=>{var _;(_=v.current)===null||_===void 0||_.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(_l);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.triggerLoadError=e.onLoadError=e.whenLoaded=e.decrementLoader=e.incrementLoader=e.setAssetLoadTimeout=void 0;const t=_l;let r=0,n=[],i=3e4;const a=h=>{i=h};function o(h){r+=1;let E=!1;const m=setTimeout(()=>{E||(_(`Timeout loading image ${h}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",h),E=!0,l())},i);return()=>{E||(clearTimeout(m),l())}}function l(){r-=1,r===0&&(n.forEach(h=>h()),n=[])}function u(h){r===0?h():n.push(h)}function f(){return new Promise(h=>u(()=>{(0,t.isAnimationUsed)()?setTimeout(h,300):h(!0)}))}e.setAssetLoadTimeout=a,e.incrementLoader=o,e.decrementLoader=l,e.whenLoaded=f;let v=[];function S(h){v.push(h)}function _(h){v.forEach(E=>E(h))}e.onLoadError=S,e.triggerLoadError=_})(da);var Bc={};(function(e){var t=be&&be.__createBinding||(Object.create?function(R,F,H,Y){Y===void 0&&(Y=H);var $=Object.getOwnPropertyDescriptor(F,H);$&&!("get"in $?!F.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return F[H]}}),Object.defineProperty(R,Y,$)}:function(R,F,H,Y){Y===void 0&&(Y=H),R[Y]=F[H]}),r=be&&be.__setModuleDefault||(Object.create?function(R,F){Object.defineProperty(R,"default",{enumerable:!0,value:F})}:function(R,F){R.default=F}),n=be&&be.__importStar||function(R){if(R&&R.__esModule)return R;var F={};if(R!=null)for(var H in R)H!=="default"&&Object.prototype.hasOwnProperty.call(R,H)&&t(F,R,H);return r(F,R),F};Object.defineProperty(e,"__esModule",{value:!0}),e.injectCustomFont=e.injectGoogleFont=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(ga),a=da;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(R){R!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...R)):l.value=!1}function v(){return o}function S(R){e.globalFonts.push(R)}function _(R){const F=e.globalFonts.findIndex(H=>H.fontFamily===R);F!==-1&&e.globalFonts.splice(F,1)}function h(R){e.globalFonts.replace(R)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=v,e.globalFonts=i.observable([]),e.addGlobalFont=S,e.removeGlobalFont=_,e.replaceGlobalFonts=h;var E="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",m=document.createElement("canvas");function p(){return g("Arial")}function y(){return g("Times","Times")}function g(R,F="Arial"){var H=m.getContext("2d");return H.font=`normal 40px '${R}', ${F}`,H.measureText(E).width}const d={Arial:!0},b=R=>!!d[R];async function O(R){var F;if(d[R])return;const H=!!(!((F=document.fonts)===null||F===void 0)&&F.load),Y=p();if(H)try{await document.fonts.load(`16px '${R}'`);const U=g(R);if(Y!==U)return void(d[R]=!0)}catch{}const $=y(),I=g(R);for(let U=0;U<100;U++){const W=g(R,"Arial"),M=g(R,"Times");if(W!==I||W!==Y||M!==$)return void(d[R]=!0);await new Promise(j=>setTimeout(j,60))}console.warn(`Timeout for loading font "${R}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${R}"`)}e.isFontLoaded=b,e.loadFont=O;const P={};let x="400,400italic,700,700italic";function w(R){x=R}function T(R){if(P[R])return;const F=`https://fonts.googleapis.com/css?family=${R.replace(/ /g,"+")}:${x}`,H=document.createElement("link");H.type="text/css",H.href=F,H.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(H),P[R]=!0}e.setGoogleFontsVariants=w,e.injectGoogleFont=T;const k={};function A(R){const F=R.fontFamily;if(k[F]||!R.url&&!R.styles)return;const H=document.createElement("style");H.type="text/css";const Y=R.styles||(R.url?[{src:`url("${R.url}")`}]:[]);let $="";Y.forEach(I=>{$+=`
|
|
77
|
+
@font-face {
|
|
78
|
+
font-family: '${F}';
|
|
79
|
+
src: ${I.src};
|
|
80
|
+
font-style: ${I.fontStyle||"normal"};
|
|
81
|
+
font-weight: ${I.fontWeight||"normal"};
|
|
82
|
+
}
|
|
83
|
+
`}),H.innerHTML=$,document.getElementsByTagName("head")[0].appendChild(H),k[R.fontFamily]=!0}e.injectCustomFont=A})(Bc);var qn={};(function(e){var t=be&&be.__createBinding||(Object.create?function(h,E,m,p){p===void 0&&(p=m);var y=Object.getOwnPropertyDescriptor(E,m);y&&!("get"in y?!E.__esModule:y.writable||y.configurable)||(y={enumerable:!0,get:function(){return E[m]}}),Object.defineProperty(h,p,y)}:function(h,E,m,p){p===void 0&&(p=m),h[p]=E[m]}),r=be&&be.__setModuleDefault||(Object.create?function(h,E){Object.defineProperty(h,"default",{enumerable:!0,value:E})}:function(h,E){h.default=E}),n=be&&be.__importStar||function(h){if(h&&h.__esModule)return h;var E={};if(h!=null)for(var m in h)m!=="default"&&Object.prototype.hasOwnProperty.call(h,m)&&t(E,h,m);return r(E,h),E};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(ga);function a(h){e.flags.textVerticalResizeEnabled=h}function o(h){e.flags.removeBackgroundEnabled=h}function l(h){e.flags.htmlRenderEnabled=h}function u(h){e.flags.imageDownScalingEnabled=h}function f(h){console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),u(h)}function v(h){console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}function S(h){e.flags.textOverflow=h}function _(h){e.flags.animationsEnabled=h}e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",animationsEnabled:!1}),e.setTextVerticalResizeEnabled=a,e.useRemoveBackground=o,e.useHtmlTextRender=l,e.setDownScalingEnabled=u,e.useDownScaling=f,e.setForceTextFit=v,e.setTextOverflow=S,e.setAnimationsEnabled=_})(qn);var Ny={};(function(e){function t(r=""){return(r=r.replace(/<\/p>/gi,`
|
|
84
|
+
`)).replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(Ny);var Uc={};(function(e){var t=be&&be.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(Kn);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})(Uc);var wl={};(function(e){var t=be&&be.__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(Qe),n=mi,i=_a,a={stroke:"rgb(0, 161, 255)",strokeWidth:2},o=l=>{Object.assign(a,l)};e.setHighlighterStyle=o,e.Highlighter=(0,n.observer)(({element:l})=>r.default.createElement(i.Rect,Object.assign({name:"highlighter",x:l.a.x,y:l.a.y,rotation:l.a.rotation,width:l.a.width,height:l.a.height,listening:!1,strokeScaleEnabled:!1},a)))})(wl);var yo={};(function(e){var t=be&&be.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const r=t(Qe);e.MOBILE_BREAKPOINT=500;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const i=o=>`
|
|
85
|
+
@media (max-width: ${e.MOBILE_BREAKPOINT}px) {
|
|
86
|
+
${o}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.polotno-mobile & {
|
|
90
|
+
${o}
|
|
91
|
+
}
|
|
92
|
+
`;e.mobileStyle=i;const a=()=>{const[o,l]=r.default.useState((0,e.isMobile)());return r.default.useEffect(()=>{const u=()=>{l((0,e.isMobile)())};return window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[]),o};e.useMobile=a})(yo);var i4={},R9="warn";function M9(e){R9=e}function L9(){return R9}function NL(e){M9(e)}var dr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(dr||(dr={}));/*! *****************************************************************************
|
|
93
|
+
Copyright (c) Microsoft Corporation.
|
|
94
|
+
|
|
95
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
96
|
+
purpose with or without fee is hereby granted.
|
|
97
|
+
|
|
98
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
99
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
100
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
101
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
102
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
103
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
104
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
105
|
+
***************************************************************************** */var Xv=function(e,t){return Xv=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])},Xv(e,t)};function Bt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var wr=function(){return wr=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},wr.apply(this,arguments)};function IL(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 N9(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(f){return function(v){return u([f,v])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(v){f=[6,v],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Hu(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 Iy(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 bo(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Iy(arguments[t]));return e}function Hc(e){return He(e).type}function jL(e,t){return He(e).getChildType(t)}function I9(e,t){return He(e).onPatch(t)}function DL(e,t){return He(e).onSnapshot(t)}function Ts(e,t){He(e).applyPatches($y(t))}function FL(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=I9(e,function(o,l){t&&!t(o,l,zy())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ts(o||e,r.patches)},undo:function(o){Ts(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function zL(e){var t=He(e);if(!t.isRoot)throw Fe("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function BL(e){var t=He(e);if(!t.isRoot)throw Fe("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function UL(e){return He(e).isProtected}function j9(e,t){return He(e).applySnapshot(t)}function jy(e,t){t===void 0&&(t=!0);var r=He(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function HL(e,t){t===void 0&&(t=1);for(var r=He(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function $L(e,t){t===void 0&&(t=1);for(var r=t,n=He(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw Fe("Failed to find the parent of "+He(e)+" at depth "+t)}function GL(e,t){for(var r=He(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function VL(e,t){for(var r=He(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw Fe("Failed to find the parent of "+He(e)+" of a given type")}function D9(e){return He(e).root.storedValue}function F9(e){return He(e).path}function qL(e){return Ls(He(e).path)}function WL(e){return He(e).isRoot}function YL(e,t){var r=r7(He(e),t);return r?r.value:void 0}function KL(e,t,r){var n=He(t).root.identifierCache.resolve(e,Vs(r));return n==null?void 0:n.value}function z9(e){return He(e).identifier}function XL(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Ot(r))return t?Dy(r)?r:void 0:r;throw Fe("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof Gy)return;throw n}}function ZL(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Ot(r))return t?Dy(r):!0;throw Fe("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof Gy)return!1;throw n}}function B9(e,t){var r=r7(He(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function QL(e,t){return t7(He(e),He(t))}function JL(e,t){t===void 0&&(t=!0);var r=He(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function eN(e){return He(e).detach(),e}function tN(e){var t=He(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function Dy(e){return He(e).observableIsAlive}function rN(e,t){var r=He(e);return r.addDisposer(t),t}function nN(e){var t=He(e),r=t.root.environment;return r||il}function U9(e,t){var r=He(e);r.getChildren().forEach(function(n){Ot(n.storedValue)&&U9(n.storedValue,t)}),t(r.storedValue)}function H9(e){var t;return Ot(e)?t=Hc(e):t=e,{name:t.name,properties:wr({},t.properties)}}function iN(e){var t=He(e).type,r=wr(wr({},H9(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){uw(e,i)?r.views.push(i):r.volatile.push(i);return}a.value._isMSTAction===!0&&r.actions.push(i),a.value._isFlowAction===!0?r.flowActions.push(i):fw(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function aN(e){return e}function oN(e){return e}function lN(e){return e}function sN(e){return He(e).nodeId}var $9=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Tr.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new l7),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=lc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Ja(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Tr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Tr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=lc("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Tr.CREATED){if(this.parent){if(this.parent.state!==Tr.FINALIZED)return;this.fireHook(dr.afterAttach)}this.state=Tr.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Tr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(dr.beforeDestroy)}}),e}(),hc=function(e){Bt(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=Tr.DEAD,u}return l.state=Tr.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw Fe("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return this.type.name+"@"+r+(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}($9);hc.prototype.die=or(hc.prototype.die);var uN=1,cN={onError:function(e){throw e}},pn=function(e){Bt(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:++uN}),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:0}),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=ll(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new AN),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 Fe("Instance identifier '"+l.identifierAttribute+"' for type '"+l.type.name+"' must be a string or a number");l.identifier=Vs(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===0&&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=1;for(var l=[],u=this.parent;u&&u._observableInstanceState===0;)l.unshift(u),u=u.parent;try{for(var f=Hu(l),v=f.next();!v.done;v=f.next()){var S=v.value;S.createObservableInstanceIfNeeded(!1)}}catch(m){n={error:m}}finally{try{v&&!v.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var _=this.type;try{this.storedValue=_.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,_.finalizeNewInstance(this,this.storedValue)}catch(m){throw this.state=Tr.DEAD,m}finally{this._isRunningAction=!1}if(this._observableInstanceState=2,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=il,this.state=Tr.CREATED,r){this.fireHook(dr.afterCreate),this.finalizeCreation();try{for(var h=Hu(l.reverse()),E=h.next();!E.done;E=h.next()){var S=E.value;S.fireHook(dr.afterCreate),S.finalizeCreation()}}catch(m){a={error:m}}finally{try{E&&!E.done&&(o=h.return)&&o.call(h)}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(dr.beforeDetach);var r=this.state;this.state=Tr.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(dr.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"&&(Es?Es(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===2?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=L9();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw Fe(i);case"warn":$N(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&&Ja(r.subpath)||"",a=r.actionContext||Fy();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&F9(a.context)||n;o=l+"."+a.name+"()"}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '"+this.type.name+"', Path upon death: '"+n+"', Subpath: '"+i+"', Action: '"+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===2?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(il),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):i7(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 Fe("Cannot modify '"+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: "+this.identifier+")":"";return this.type.name+"@"+r+n+(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=Hu(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(dr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw Fe("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=pc(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Ls(i.path),o=n7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=pc(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Vo(this.storedValue,"$treenode",this),Vo(this.storedValue,"toJSON",MN)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==0&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit("dispose"),this._internalEventsClear("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("snapshot",r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit("snapshot",r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister("patch",r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers("patch")){var i=BN({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),a=Iy(KN(i),2),o=a[0],l=a[1];this._internalEventsEmit("patch",o,l)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas("dispose",r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister("dispose",r,!0);return}throw Fe("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas("dispose",r))throw Fe("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister("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=tw(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},cN);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 l7),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,bo([r],i))}}),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}($9);pn.prototype.createObservableInstance=or(pn.prototype.createObservableInstance);pn.prototype.detach=or(pn.prototype.detach);pn.prototype.die=or(pn.prototype.die);var G9,rt;(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"})(rt||(rt={}));var V9="cannotDetermine",fN=Symbol("$type"),ha=function(){function e(t){Object.defineProperty(this,G9,{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 oa(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw Fe("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=e7(t);if(n){var i=Hc(t);return this.isAssignableFrom(i)?gn():vn(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw Fe("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw Fe("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw Fe("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw Fe("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();G9=fN;ha.prototype.create=or(ha.prototype.create);var As=function(e){Bt(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===Vs(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||Ot(n)&&He(n)===r?!0:r.type===this&&a7(n)&&!Ot(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(),Ot(n)&&this.isAssignableFrom(Hc(n))){var l=He(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}(ha);As.prototype.create=or(As.prototype.create);var Sl=function(e){Bt(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}(ha);function Hr(e){return typeof e=="object"&&e&&e.isType===!0}var Ai=new Map;function dN(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),Ai.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Ai.get(r.id).async===!1&&(Ai.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Ai.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Ai.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Ai.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Ai.get(r.rootId);return Ai.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Ai.get(r.rootId);return Ai.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var hN=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 pN(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=wr(wr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new hN(u,o);t.set(n.id,f);var v=void 0;try{v=i(n)}catch(_){throw t.delete(n.id),f.finish(_),_}return f.hasFlowsPending||(t.delete(n.id),f.finish()),v}else{if(!a)return i(n);switch(n.type){case"flow_spawn":return a.incFlowsPending(),i(n);case"flow_resume":case"flow_resume_error":return i(n);case"flow_throw":{var S=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(S))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function gN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(Ms(n))return n;if(Ot(n))return ud("[MSTNode: "+Hc(n).name+"]");if(typeof n=="function")return ud("[function]");if(typeof n=="object"&&!Ho(n)&&!Hy(n))return ud("[object "+(n&&n.constructor&&n.constructor.name||"Complex Object")+"]");try{return JSON.stringify(n),n}catch(i){return ud(""+i)}}function vN(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function ud(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function q9(e,t){Es(function(){$y(t).forEach(function(r){return mN(e,r)})})}function mN(e,t){var r=B9(e,t.path||"");if(!r)throw Fe("Invalid action path: "+(t.path||""));var n=He(r);if(t.name==="@APPLY_PATCHES")return Ts.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return j9.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw Fe("Action '"+t.name+"' does not exist in '"+n.path+"'");return r[t.name].apply(r,t.args?t.args.map(function(i){return vN(n,i)}):[])}function yN(e,t){var r=[],n=function(o){var l=t?t(o,zy()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=W9(e,n))},replay:function(o){q9(o,r)}};return a.resume(),a}function W9(e,t,r){return r===void 0&&(r=!1),X9(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=He(i.context),l={name:i.name,path:t7(He(e),o),args:i.args.map(function(f,v){return gN(o,i.name,v,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var bN=1,$u;function Fy(){return $u}function Y9(){return bN++}function Zv(e,t){var r=He(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=$u;$u=e;try{return SN(r,e,t)}finally{$u=i,r._isRunningAction=n}}function K9(e){if(e)return e.type==="action"?e:e.parentActionEvent}function pc(e,t,r){var n=function(){var i=Y9(),a=$u,o=K9(a);return Zv({type:"action",name:t,id:i,args:s7(arguments),context:e,tree:D9(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?bo(a.allParentIds,[a.id]):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function X9(e,t,r){r===void 0&&(r=!0);var n=He(e);return n.addMiddleWare(t,r)}function _N(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 wN=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 SN(e,t,r){var n=new wN(e,r);if(n.isEmpty)return or(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return or(r).apply(null,o.args);if(!l.includeHooks&&dr[o.name])return a(o);function f(S,_){i=a(S),_&&(i=_(i))}function v(S){i=S}return u(o,f,v),i}return a(t)}function zy(){for(var e=Fy();e&&e.type!=="action";)e=e.parentActionEvent;return e}function Z9(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 EN(e,t){return Z9(e,t,!1)}function ON(e,t){return Z9(e,t,!0)}function PN(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: "+t+">"}}function Q9(e){return typeof e=="function"?"<function"+(e.name?" "+e.name:"")+">":Ot(e)?"<"+e+">":"`"+PN(e)+"`"}function xN(e){return e.length<280?e:e.substring(0,272)+"......"+e.substring(e.length-8)}function CN(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 "/'+n+'" ':"",a=Ot(t)?"value of type "+He(t).type.name+":":Ms(t)?"value":"snapshot",o=r&&Ot(t)&&r.is(He(t).snapshot);return""+i+a+" "+Q9(t)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(e.message?" ("+e.message+")":"")+(r?w7(r)||Ms(t)?".":", expected an instance of `"+r.name+"` or a snapshot like `"+r.describe()+"` instead."+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function By(e,t,r){return e.concat([{path:t,type:r}])}function gn(){return Rs}function vn(e,t,r){return[{context:e,value:t,message:r}]}function Dp(e){return e.reduce(function(t,r){return t.concat(r)},[])}function oa(e,t){GN()&&J9(e,t)}function J9(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw Fe(kN(e,t,r))}function kN(e,t,r){if(r.length!==0)return"Error while converting "+xN(Q9(t))+" to `"+e.name+`\`:
|
|
106
|
+
|
|
107
|
+
`+r.map(CN).join(`
|
|
108
|
+
`)}var TN=0,AN=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:TN++}),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 this.cacheId+"-"+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([],Fp));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw Fe("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;iy(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 dw(this.cache).forEach(function(a){for(var o=Iy(a,2),l=o[0],u=o[1],f=!1,v=u.length-1;v>=0;v--){var S=u[v];(S===t||S.path.indexOf(i)===0)&&(n.addNodeToCache(S,!1),u.splice(v,1),u.length||r.cache.delete(l),f=!0)}f&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw Fe("Cannot resolve a reference to type '"+t.name+"' with id: '"+r+"' unambigously, there are multiple candidates: "+i.map(function(a){return a.path}).join(", "))}}}),e}();function Uy(e,t,r,n,i){var a=e7(i);if(a){if(a.parent)throw Fe("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+(t?t.path:"")+"/"+r+"', but it lives already at '"+a.path+"'");return t&&a.setParent(t,r),a}return new pn(e,t,r,n,i)}function _o(e,t,r,n,i){return new hc(e,t,r,n,i)}function RN(e){return e instanceof hc||e instanceof pn}var Tr;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Tr||(Tr={}));function Ot(e){return!!(e&&e.$treenode)}function He(e){if(!Ot(e))throw Fe("Value "+e+" is no MST Node");return e.$treenode}function e7(e){return e&&e.$treenode||null}function MN(){return He(this).snapshot}var LN=function(e){return".."};function t7(e,t){if(e.root!==t.root)throw Fe("Cannot calculate relative path: objects '"+e+"' and '"+t+"' are not part of the same object tree");for(var r=Ls(e.path),n=Ls(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(LN).join("/")+hh(n.slice(i))}function r7(e,t,r){return r===void 0&&(r=!0),n7(e,Ls(t),r)}function n7(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 hc){var o=n.value;Ot(o)&&(n=He(o))}if(n instanceof pn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw Fe("Could not resolve '"+a+"' in path '"+(hh(t.slice(0,i))||"/")+"' while resolving '"+hh(t)+"'")}}catch(u){if(!r)return;throw u}return n}function i7(e){if(!e)return Rs;var t=Object.keys(e);if(!t.length)return Rs;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function NN(e){return u7(),c7(e)}var IN=Object.toString(),Rs=Object.freeze([]),il=Object.freeze({}),Fp=$8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Fp);function Fe(e){return e===void 0&&(e="Illegal state"),new Error("[mobx-state-tree] "+e)}function jN(e){return e}var DN=Number.isInteger;function FN(e){return Number(e)===e&&e%1!==0}function zN(e){return Number.isFinite(e)}function Hy(e){return Array.isArray(e)||Xr(e)}function $y(e){return e?Hy(e)?e:[e]:Rs}function BN(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 Ho(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())===IN}function a7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function Ms(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function o7(e){return typeof e!="function"}function UN(e,t,r){Er(e)?oy(e,t,r):Object.defineProperty(e,t,r)}function Vo(e,t,r){UN(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var HN=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,bo(t))})}}),e}(),l7=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 HN),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,bo(n))}}),e}();function s7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function $1(e,t){return e.indexOf(t)===0}var u7=function(e,t){};u7.ids={};function $N(e){console.warn(new Error("[mobx-state-tree] "+e))}function GN(){return typeof process<"u"&&i4&&i4.ENABLE_TYPE_CHECK==="true"}function G1(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function c7(e){return YN(e.name,e)}function VN(e){return e}function qN(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return N9(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,bo(r))];case 1:return[2,n.sent()]}})}}function WN(e){return N9(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function YN(e,t){var r=function(){var i=Y9(),a=Fy();if(!a)throw Fe("a mst flow must always have a parent context");var o=K9(a);if(!o)throw Fe("a mst flow must always have a parent action context");var l={name:e,id:i,tree:a.tree,context:a.context,parentId:a.id,allParentIds:bo(a.allParentIds,[a.id]),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(v,S,_){return v.$mst_middleware=r.$mst_middleware,Zv(wr(wr({},l),{type:S,args:[_]}),v)}return new Promise(function(v,S){var _,h=function(){_=t.apply(null,arguments),E(void 0)};h.$mst_middleware=r.$mst_middleware,Zv(wr(wr({},l),{type:"flow_spawn",args:s7(u)}),h);function E(y){var g;try{var d=f(function(b){g=_.next(b)},"flow_resume",y);d instanceof Error&&(g=_.throw(d))}catch(b){G1(function(){f(function(O){S(b)},"flow_throw",b)});return}p(g)}function m(y){var g;try{f(function(d){g=_.throw(d)},"flow_resume_error",y)}catch(d){G1(function(){f(function(b){S(d)},"flow_throw",d)});return}p(g)}function p(y){if(y.done){G1(function(){f(function(g){v(g)},"flow_return",y.value)});return}if(!y.value||typeof y.value.then!="function")throw Fe("Only promises can be yielded to `async`, got: "+y);return y.value.then(E,m)}})};return r._isFlowAction=!0,r}function KN(e){if(!("oldValue"in e))throw Fe("Patches without `oldValue` field cannot be inversed");return[XN(e),ZN(e)]}function XN(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 ZN(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 QN(e){return typeof e=="number"}function Ja(e){return QN(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function f7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function hh(e){if(e.length===0)return"";var t=function(r){return r.map(Ja).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Ls(e){var t=e.split("/").map(f7),r=e===""||e==="."||e===".."||$1(e,"/")||$1(e,"./")||$1(e,"../");if(!r)throw Fe("a json path must be either rooted, empty or relative, but got '"+e+"'");return t[0]===""&&t.shift(),t}var V1=Symbol("$preProcessorFailed"),JN=function(e){Bt(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|rt.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor("+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 V1}}}),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;eI(r.type,this,"create"),r instanceof pn&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},E7(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=Ot(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,Ot(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===V1?vn(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Hr(r)?this._subtype:Ot(r)?jy(r,!1):this.preProcessSnapshotSafe(r);return n===V1?!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 As))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(ha);function eI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Hu(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 tI(e,t,r){return new JN(e,t,r)}var a4="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===V9)return!1;if(i){var a=$y(i);try{for(var o=Hu(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 gc&&t.push(e),!0}var Ba;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Ba||(Ba={}));var rI=function(e){Bt(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 Fe("Map.put cannot be used to set empty values");if(Ot(r)){var n=He(r);if(n.identifier===null)throw Fe(a4);return this.set(n.identifier,r),r}else if(a7(r)){var i=He(this),a=i.type;if(a.identifierMode!==Ba.YES)throw Fe(a4);var o=a.mapIdentifierAttribute,l=r[o];if(!Vy(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(jy(u))}var f=Vs(l);return this.set(f,r),this.get(f)}else throw Fe("Map.put can only be used to store complex values")}}),t}(Hh),ph=function(e){Bt(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:Ba.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:rt.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(),Uy(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Ba.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 Fe("The objects in a map should all have the same identifier attribute, expected '"+i+"', but child of type '"+a.name+"' declared attribute '"+a.identifierAttribute+"' as identifier");return a.identifierAttribute},void 0);n?(this.identifierMode=Ba.YES,this.mapIdentifierAttribute=n):this.identifierMode=Ba.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 rI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ny(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=pc(n,l,u);Vo(n,l,f)})}),zh(n,this.willChange),Uh(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 iy(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 Fe("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=He(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;oa(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":oa(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===Ba.YES&&n instanceof pn){var i=n.identifier;if(i!==r)throw Fe("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+i+"', but expected: '"+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=He(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:Ja(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Ja(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:Ja(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){oa(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 Ho(r)?Dp(Object.keys(r).map(function(a){return i._subType.validate(r[a],By(n,a,i._subType))})):vn(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return il}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(As);ph.prototype.applySnapshot=or(ph.prototype.applySnapshot);function nI(e){return new ph("Map<string, "+e.name+">",e)}function iI(e){return Hr(e)&&(e.flags&rt.Map)>0}var gh=function(e){Bt(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:rt.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 Uy(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=wr(wr({},Fp),{name:this.name});return Tt.array(i7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){gi(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=pc(n,l,u);Vo(n,l,f)})}),zh(n,this.willChange),Uh(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 Fe("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=He(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=o4(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var l=r.index,u=r.removedCount,f=r.added,v=o4(n,i,a.slice(l,l+u),f,f.map(function(_,h){return l+h}));if(!v)return null;r.added=v;for(var S=l+u;S<a.length;S++)a[S].setParent(n,""+(S+f.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=He(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":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:n.getChildNode(""+(r.index+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){oa(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 Hy(r)?Dp(r.map(function(a,o){return i._subType.validate(a,By(n,""+o,i._subType))})):vn(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Rs}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(As);gh.prototype.applySnapshot=or(gh.prototype.applySnapshot);function aI(e){return new gh(e.name+"[]",e)}function o4(e,t,r,n,i){for(var a=!0,o=0;;o++){var l=o<=n.length-1,u=r[o],f=l?n[o]:void 0,v=""+i[o];if(RN(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof pn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(l4(u,f))r[o]=q1(t,e,v,f,u);else{for(var _=void 0,h=o;h<r.length;h++)if(l4(r[h],f)){_=r.splice(h,1)[0];break}a=!1;var S=q1(t,e,v,f,_);r.splice(o,0,S)}else{if(Ot(f)&&He(f).parent===e)throw Fe("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+e.path+"/"+v+"', but it lives already at '"+He(f).path+"'");a=!1;var S=q1(t,e,v,f);r.splice(o,0,S)}}return a?null:r}function q1(e,t,r,n,i){oa(e,n);function a(){if(Ot(n)){var l=He(n);if(l.assertAlive(il),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof pn&&i.createObservableInstanceIfNeeded(),i.die()),o}function l4(e,t){if(!e.isAlive)return!1;if(Ot(t)){var r=He(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof pn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Ho(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function oI(e){return Hr(e)&&(e.flags&rt.Array)>0}var s4="preProcessSnapshot",u4="postProcessSnapshot";function lI(){return He(this).toString()}var c4={name:"AnonymousModel",properties:{},initializers:Rs};function sI(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw Fe(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 dr)throw Fe("Hook '"+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 Fe("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw Fe("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Ms(o))n[i]=qo(pI(o),o);else if(o instanceof ph)n[i]=qo(o,{});else if(o instanceof gh)n[i]=qo(o,[]);else if(!Hr(o))throw Fe("Invalid type definition for property '"+i+"', cannot infer a type from a value like '"+o+"' ("+typeof o+")");return n},e)}var gc=function(e){Bt(t,e);function t(r){var n=e.call(this,r.name||c4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rt.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,c4,r),n.properties=sI(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&rt.Identifier){if(r)throw Fe("Cannot define property '"+n+"' as object identifier, property '"+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(!Ho(n))throw Fe("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===s4)throw Fe("Cannot define action '"+s4+"', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(i===u4)throw Fe("Cannot define action '"+u4+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var a=n[i],o=r[i];if(i in dr&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,f=a.bind(n);f._isFlowAction=a._isFlowAction||!1,f.$mst_middleware=u;var v=pc(r,i,f);n[i]=v,Vo(r,i,v)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw Fe("You passed an "+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(!Ho(n))throw Fe("volatile state initializer should return a plain object containing state");ay(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),l=o.actions,u=o.views,f=o.state,v=IL(o,["actions","views","state"]);for(var S in v)throw Fe("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+S+"'");return f&&n.instantiateVolatileState(a,f),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Ho(n))throw Fe("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)oy(r,i,o),ly(r,(a={},a[i]=ll,a));else if(typeof o.value=="function")Vo(r,i,o.value);else throw Fe("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ot(a)?a:this.applySnapshotPreProcessor(a);return Uy(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=wr(wr({},Fp),{name:this.name});return Tt.object(r,il,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Vo(n,"toString",lI),this.forAllProps(function(i){ny(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),zh(n,this.willChange),Uh(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=He(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(oa(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=He(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:Ja(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 Fe("Not a value property: "+n);var a=gi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw Fe("Node not available for property "+n);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,l){try{var u=Bi(r.storedValue,o);u.reportObserved()}catch{throw Fe(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 Fe("object does not support operation "+i.op);r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){oa(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 Ho(a)?Dp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],By(n,o,i.properties[o]))})):vn(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return il}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(As);gc.prototype.applySnapshot=or(gc.prototype.applySnapshot);function uI(){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 gc({name:r,properties:n})}function cI(){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 h7(e){return Hr(e)&&(e.flags&rt.Object)>0}var wa=function(e){Bt(t,e);function t(r,n,i,a){a===void 0&&(a=jN);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 _o(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(Ms(r)&&this.checker(r))return gn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return vn(n,r,"Value is not a "+i)}}),t}(Sl),p7=new wa("string",rt.String,function(e){return typeof e=="string"}),g7=new wa("number",rt.Number,function(e){return typeof e=="number"}),fI=new wa("integer",rt.Integer,function(e){return DN(e)}),dI=new wa("float",rt.Float,function(e){return FN(e)}),hI=new wa("finite",rt.Finite,function(e){return zN(e)}),v7=new wa("boolean",rt.Boolean,function(e){return typeof e=="boolean"}),m7=new wa("null",rt.Null,function(e){return e===null}),y7=new wa("undefined",rt.Undefined,function(e){return e===void 0}),b7=new wa("Date",rt.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});b7.getSnapshot=function(e){return e.storedValue.getTime()};var _7=b7;function pI(e){switch(typeof e){case"string":return p7;case"number":return g7;case"boolean":return v7;case"object":if(e instanceof Date)return _7}throw Fe("Cannot determine primitive type from value "+e)}function w7(e){return Hr(e)&&(e.flags&(rt.String|rt.Number|rt.Integer|rt.Boolean|rt.Date))>0}var gI=function(e){Bt(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:rt.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return _o(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 Ms(r)&&r===this.value?gn():vn(n,r,"Value is not a literal "+JSON.stringify(this.value))}}),t}(Sl);function S7(e){return new gI(e)}function vI(e){return Hr(e)&&(e.flags&rt.Literal)>0}var mI=function(e){Bt(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|rt.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=Ot(r)?He(r).snapshot:r;return this._predicate(a)?gn():vn(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(ha);function yI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():Hr(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 mI(r,n,i,a)}function bI(e){return(e.flags&rt.Refinement)>0}function _I(e,t){var r=typeof e=="string"?t:e,n=zp.apply(void 0,bo(r.map(function(i){return S7(""+i)})));return typeof e=="string"&&(n.name=e),n}var wI=function(e){Bt(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=wr({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=rt.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 Fe("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw Fe("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var l=this._types[o],u=l.validate(r,n);if(u.length===0){if(this._eager)return gn();a++}else i.push(u)}return a===1?gn():vn(n,r,"No type is applicable for the union").concat(Dp(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(ha);function zp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Hr(e)?void 0:e,i=Hr(e)?bo([e],t):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new wI(a,i,n)}function E7(e){return(e.flags&rt.Union)>0}var SI=function(e){Bt(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|rt.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"&&oa(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?gn():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(ha);function EI(e,t){if(typeof t!="function"&&Ot(t))throw Fe("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function qo(e,t,r){return EI(e,t),new SI(e,t,r||OI)}var OI=[void 0];function PI(e){return Hr(e)&&(e.flags&rt.Optional)>0}var xI=qo(y7,void 0),CI=qo(m7,null);function O7(e){return zp(e,xI)}function kI(e){return zp(e,CI)}var TI=function(e){Bt(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)|rt.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 Fe("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):gn()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||V9}}),t}(ha);function AI(e,t){var r=typeof e=="string"?e:"late("+e.toString()+")",n=typeof e=="string"?t:e;return new TI(r,n)}function RI(e){return Hr(e)&&(e.flags&rt.Late)>0}function MI(e,t){return new LI(e,t)}var LI=function(e){Bt(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:rt.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()}),Dv(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(or(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/"+o.subpath,value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy "+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=_o(this,r,n,i,a);return this.pendingNodeList.push(l),Dv(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):o7(r)?gn():vn(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(Sl),P7=function(e){Bt(t,e);function t(r){var n=e.call(this,r?"frozen("+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:rt.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 _o(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return o7(r)?this.subType?this.subType.validate(r,n):gn():vn(n,r,"Value is not serializable and cannot be frozen")}}),t}(Sl),f4=new P7;function NI(e){return arguments.length===0?f4:Hr(e)?new P7(e):qo(f4,e)}function II(e){return Hr(e)&&(e.flags&rt.Frozen)>0}function jI(e){switch(e){case dr.beforeDestroy:return"destroy";case dr.beforeDetach:return"detach";default:return}}var DI=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}),Vy(t))this.identifier=t;else if(Ot(t)){var n=He(t);if(!n.identifierAttribute)throw Fe("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw Fe("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw Fe("Can only store references to tree nodes or identifiers, got: '"+t+"'")}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Vs(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 Gy("[mobx-state-tree] Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+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}(),Gy=function(e){Bt(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){Bt(t,e);function t(r,n){var i=e.call(this,"reference("+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:rt.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 Vy(r)?gn():vn(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var l=o.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){Ts(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){h7(o.type)?this.replaceRef(void 0):Ts(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=He(a),l=function(v,S){var _=jI(S);_&&i.fireInvalidated(_,r,n,o)},u=o.registerHook(dr.beforeDetach,l),f=o.registerHook(dr.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(dr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,v=f&&f.storedValue;if(f&&f.isAlive&&v){var S=void 0;i?S=!!i.get(n,v):S=r.root.identifierCache.has(a.targetType,Vs(n)),S?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Tr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(dr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(dr.afterAttach,function(){l(!1)}))}}}),t}(Sl),FI=function(e){Bt(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=Ot(a)?z9(a):a,l=new DI(a,this.targetType),u=_o(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=Ot(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),zI=function(e){Bt(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=Ot(a)?this.options.set(a,r?r.storedValue:null):a,l=_o(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=Ot(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 C7(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new zI(e,{get:r.get,set:r.set},n):new FI(e,n)}function BI(e){return(e.flags&rt.Reference)>0}function UI(e,t){var r=C7(e,wr(wr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:O7(r)}var k7=function(e){Bt(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:rt.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 gc))throw Fe("Identifier types can only be instantiated as direct child of a model type");return _o(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 Fe("Tried to change identifier from '"+r.storedValue+"' to '"+n+"'. Changing identifiers is not allowed.");return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?vn(n,r,"Value is not a valid "+this.describe()+", expected a "+this.validType):gn()}}),t}(Sl),HI=function(e){Bt(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:rt.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(k7),$I=function(e){Bt(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}(k7),GI=new HI,VI=new $I;function qI(e){return Hr(e)&&(e.flags&rt.Identifier)>0}function Vs(e){return""+e}function Vy(e){return typeof e=="string"||typeof e=="number"}function WI(e){return new YI(e)}var YI=function(e){Bt(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:rt.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return gn();var i=this.options.getValidationMessage(r);return i?vn(n,r,"Invalid value for type '"+this.name+"': "+i):gn()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return _o(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}(Sl),d4={enumeration:_I,model:uI,compose:cI,custom:WI,reference:C7,safeReference:UI,union:zp,optional:qo,literal:S7,maybe:O7,maybeNull:kI,refinement:yI,string:p7,boolean:v7,number:g7,integer:fI,float:dI,finite:hI,Date:_7,map:nI,array:aI,frozen:NI,identifier:GI,identifierNumber:VI,late:AI,lazy:MI,undefined:y7,null:m7,snapshotProcessor:tI};const KI=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:rN,addMiddleware:X9,applyAction:q9,applyPatch:Ts,applySnapshot:j9,cast:aN,castFlowReturn:VN,castToReferenceSnapshot:lN,castToSnapshot:oN,clone:JL,createActionTrackingMiddleware:dN,createActionTrackingMiddleware2:pN,decorate:_N,destroy:tN,detach:eN,escapeJsonPath:Ja,flow:c7,getChildType:jL,getEnv:nN,getIdentifier:z9,getLivelinessChecking:L9,getMembers:iN,getNodeId:sN,getParent:$L,getParentOfType:VL,getPath:F9,getPathParts:qL,getPropertyMembers:H9,getRelativePath:QL,getRoot:D9,getRunningActionContext:zy,getSnapshot:jy,getType:Hc,hasParent:HL,hasParentOfType:GL,isActionContextChildOf:EN,isActionContextThisOrChildOf:ON,isAlive:Dy,isArrayType:oI,isFrozenType:II,isIdentifierType:qI,isLateType:RI,isLiteralType:vI,isMapType:iI,isModelType:h7,isOptionalType:PI,isPrimitiveType:w7,isProtected:UL,isReferenceType:BI,isRefinementType:bI,isRoot:WL,isStateTreeNode:Ot,isType:Hr,isUnionType:E7,isValidReference:ZL,joinJsonPath:hh,onAction:W9,onPatch:I9,onSnapshot:DL,process:NN,protect:zL,recordActions:yN,recordPatches:FL,resolveIdentifier:KL,resolvePath:YL,setLivelinessChecking:M9,setLivelynessChecking:NL,splitJsonPath:Ls,t:d4,toGenerator:WN,toGeneratorFunction:qN,tryReference:XL,tryResolve:B9,typecheck:J9,types:d4,unescapeJsonPath:f7,unprotect:BL,walk:U9},Symbol.toStringTag,{value:"Module"})),bi=ao(KI);(function(e){var t=be&&be.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(Qe),n=mi,i=_a,a=Fc,o=ga,l=t(Kn),u=LL,f=zc,v=da,S=Bc,_=qn,h=Ny,E=Uc,m=_l,p=wl,y=yo,g=bi,d=document.createElement("style");d.type="text/css",document.head.appendChild(d);const b={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function O(I){var U="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+U+"]*?["+U+"]").test(I)}function P(I){I=I.replace(/\s/g,"");let U=0;for(var W=0;W<I.length;W++)O(I[W])&&(U+=1);return U>I.length/2}function x(I){return P(I)?"rtl":"ltr"}e.isRTLText=P,e.getDir=x;const w=(0,n.observer)(({textNodeRef:I,element:U,onBlur:W,selectAll:M,cursorPosition:j})=>{const[B,N]=r.default.useState(b),G=I.current;r.default.useLayoutEffect(()=>{const Z={};Z.width=G.width()-2*G.padding()+"px",Z.height=G.height()-2*G.padding()+10+"px",Z.fontSize=G.fontSize()+"px",Z.lineHeight=G.lineHeight()+.01,Z.fontFamily=G.fontFamily(),Z.textAlign=G.align(),Z.color=G.fill(),Z.fontWeight=U.fontWeight,Z.fontStyle=U.fontStyle,Z.letterSpacing=U.letterSpacing+"em";const J=`
|
|
109
|
+
.polotno-input::placeholder {
|
|
110
|
+
color: ${B.color};
|
|
111
|
+
opacity: 0.6;
|
|
112
|
+
}
|
|
113
|
+
`;d.innerHTML="",d.appendChild(document.createTextNode(J)),JSON.stringify(Z)!==JSON.stringify(B)&&N(Z)});const K=r.default.useRef(null);r.default.useEffect(()=>{const Z=setTimeout(()=>{var J;const te=K.current;if(!te)return;(J=K.current)===null||J===void 0||J.focus();const ee=j||te.value.length;te.selectionStart=te.selectionEnd=ee,M&&(te==null||te.select(),document.execCommand("selectAll",!1,null))});return()=>{clearTimeout(Z)}},[]),r.default.useEffect(()=>{window.addEventListener("blur",W);const Z=J=>{var te;!((te=K.current)===null||te===void 0)&&te.contains(J.target)||W()};return window.addEventListener("touchstart",Z),()=>{window.removeEventListener("blur",W),window.removeEventListener("touchstart",Z)}},[]);let q=0;const z=G.textArr.length*G.lineHeight()*G.fontSize();U.verticalAlign==="middle"&&(q=(U.a.height-z)/2),U.verticalAlign==="bottom"&&(q=U.a.height-z);const X=(0,h.removeTags)(U.text);return r.default.createElement(a.Html,null,r.default.createElement("textarea",{className:"polotno-input",ref:K,dir:x(X),style:Object.assign(Object.assign(Object.assign({},b),B),{paddingTop:q+"px"}),value:X,onChange:Z=>{U.set({text:Z.target.value})},placeholder:U.placeholder,onBlur:W}))}),T=I=>{const[U,W]=r.default.useState(!1),M=r.default.useRef(!1);return r.default.useEffect(()=>{var j=!0;return setTimeout(()=>{j&&(I._editModeEnabled&&(M.current=!0),W(!0),setTimeout(()=>{M.current=!1},50))},50),()=>{j=!1}},[]),{editorEnabled:U&&I._editModeEnabled,selectAll:M.current}},k=(I,U)=>{const[W,M]=r.default.useReducer(B=>B+1,0),j=r.default.useRef((0,S.isFontLoaded)(U));return r.default.useLayoutEffect(()=>{if(j.current=(0,S.isFontLoaded)(U),j.current)return;let B=!0;return(async()=>{j.current=!1,M();const N=(0,v.incrementLoader)(`text ${U}`);await I.loadFont(U),l.default.Util.requestAnimFrame(N),B&&(j.current=!0,M())})(),()=>{B=!1}},[U]),[j.current]};e.useFontLoader=k;const A=({fontLoaded:I,fontFamily:U,fontSize:W,lineHeight:M})=>r.default.useMemo(()=>{if(typeof M=="number")return M;const j=document.createElement("div");j.style.fontFamily=U,j.style.fontSize=W+"px",j.style.lineHeight=M,j.innerText="Test text",document.body.appendChild(j);const B=j.offsetHeight;return document.body.removeChild(j),B/W},[I,U,W,M]);function R(I){var U=I.getAbsoluteTransform().copy();U.invert();var W=I.getStage().getPointerPosition();return U.point(W)}function F(I){var U;const W=I.target,M=R(W),j=W.textArr,B=Math.floor(M.y/(W.fontSize()*W.lineHeight())),N=j.slice(0,B).reduce((q,z)=>q+z.text.length,B),G=(U=j[B])!==null&&U!==void 0?U:j[0];let K=0;return W.align()==="right"?K=W.width()-G.width:W.align()==="center"&&(K=W.width()/2-G.width/2),N+Math.round((M.x-K)/G.width*G.text.length)}function H(I){const U=r.default.useRef(I),W=r.default.useRef(I);return r.default.useMemo(()=>{W.current=U.current,U.current=I},[I]),W.current}function Y(I,U){const W=I.fontSize(),M=I.height(),j=(0,h.removeTags)(U.text);let B=U.a.fontSize;I.height(void 0);const N=Math.round(2*U.a.fontSize)-1;for(let G=1;G<N;G++){const K=U.a.height&&I.height()>U.a.height,q=j.split(`
|
|
114
|
+
`).join(" ").split(/[\s-]+/);let z=I.textArr.map(Z=>Z.text).join(";");const X=q.find(Z=>!z.includes(Z)||(z=z.replace(Z,""),!1));if(!(K||X))break;B-=.5,I.fontSize(B)}return I.fontSize(W),I.height(M),B}function $({lines:I,lineHeight:U,width:W,align:M="left",padding:j=0,cornerRadius:B=0}){var N;I.forEach((z,X)=>{z.cx=W/2,M==="right"?z.cx=W-z.width/2:M==="left"&&(z.cx=z.width/2),M!=="justify"||z.lastInParagraph||(z.width=W),M==="justify"&&(z.cx=z.width/2)});let G=`M ${(N=I[0])===null||N===void 0?void 0:N.cx} ${-j}`;I.forEach((z,X)=>{const{cx:Z}=z,J=I[X-1];J&&J.width>z.width?G+=` L ${Z+z.width/2+j} ${X*U+j}`:G+=` L ${Z+z.width/2+j} ${X*U-j}`;const te=I[X+1];te&&te.width>z.width?G+=` L ${Z+z.width/2+j} ${(X+1)*U-j}`:G+=` L ${Z+z.width/2+j} ${(X+1)*U+j}`});for(var K=I.length-1;K>=0;K--){const z=I[K],{cx:X}=z,Z=I[K+1];Z&&Z.width>z.width?G+=` L ${X-z.width/2-j} ${(K+1)*U-j}`:G+=` L ${X-z.width/2-j} ${(K+1)*U+j}`;const J=I[K-1];J&&J.width>z.width?G+=` L ${X-z.width/2-j} ${K*U+j}`:G+=` L ${X-z.width/2-j} ${K*U-j}`}G+=" Z";const q=(0,u.parsePath)(G);return(0,u.roundCommands)(q,B).path}e.getLineHeight=A,e.usePrevious=H,e.TextElement=(0,n.observer)(({element:I,store:U})=>{const W=r.default.useRef(null),M=r.default.useRef(null),{editorEnabled:j,selectAll:B}=T(I),[N,G]=r.default.useState(!1),[K,q]=r.default.useState(!1),z=r.default.useRef(I.a.height),X=U.selectedElements.indexOf(I)>=0,{textVerticalResizeEnabled:Z}=_.flags,J=H(I.fontFamily),[te,ee]=r.default.useState([]);r.default.useEffect(()=>{var we,Ee;const Te=(Ee=(we=W.current)===null||we===void 0?void 0:we.textArr)!==null&&Ee!==void 0?Ee:[];JSON.stringify(Te)!==JSON.stringify(te)&&ee(Te)}),r.default.useEffect(()=>{if(I.a.width)return;const we=W.current;we.width(600),I.set({width:1.4*we.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const we=W.current;(0,E.applyFilter)(we,I)}));const[se]=(0,e.useFontLoader)(U,I.fontFamily),de=(0,h.removeTags)(I.text),he=()=>{const we=W.current.clone({height:void 0}),Ee=Math.ceil(we.fontSize()*we.lineHeight()*we.textArr.length+1);return we.destroy(),Ee};r.default.useLayoutEffect(()=>{if(!se)return;const{textOverflow:we}=_.flags;if(I.a.height)if(we!=="change-font-size"||K||U.isPlaying){if(we==="resize"){const Ee=he();Z&&I.a.height<Ee&&U.history.ignore(()=>{var Te;(0,g.isAlive)(I)&&I.set({height:Ee}),(Te=W.current)===null||Te===void 0||Te.height(Ee)},!1,!0),Z||I.a.height===Ee||U.history.ignore(()=>{var Te;(0,g.isAlive)(I)&&I.set({height:Ee}),(Te=W.current)===null||Te===void 0||Te.height(Ee)},!1,!0)}}else{const Ee=Y(W.current,I);if(Ee!==I.a.fontSize)return void U.history.ignore(()=>{I.set({fontSize:Ee})},!1,!0);const Te=he();I.a.height===Te||Z||U.history.ignore(()=>{I.set({height:Te})},!1,!0)}else{const Ee=he();U.history.ignore(()=>{I.set({height:Ee})},!1,!0)}}),r.default.useLayoutEffect(()=>{const we=W.current;we&&(we.width(we.width()+1e-8),we._setTextData(),(0,E.applyFilter)(we,I))},[se]);const ke=r.default.useRef(null),Ie=r.default.useRef(0),ue=we=>{we.evt.preventDefault(),U.selectedShapes.find(Te=>Te===I)&&I.contentEditable&&(Ie.current=F(we),I.toggleEditMode())},ie=!de&&I.placeholder?.6:I.a.opacity;(0,m.useFadeIn)(W,ie);const _e=(0,e.getLineHeight)({fontLoaded:se,fontFamily:I.fontFamily,fontSize:I.a.fontSize,lineHeight:I.lineHeight}),Se=I.selectable||U.role==="admin",re=(0,f.useColor)(I),ce=r.default.useMemo(()=>I.backgroundEnabled?$({lines:JSON.parse(JSON.stringify(te)),cornerRadius:I.backgroundCornerRadius*(I.a.fontSize*_e*.5),lineHeight:_e*I.a.fontSize,padding:I.backgroundPadding*(I.a.fontSize*_e*.5),width:I.a.width,align:I.align}):"",[I.backgroundEnabled,I.backgroundCornerRadius,I.a.fontSize,_e,I.backgroundPadding,I.a.width,I.align,te]),ge=(0,y.useMobile)();let me=0;return I.verticalAlign==="middle"?me=(I.a.height-te.length*_e*I.a.fontSize)/2:I.verticalAlign==="bottom"&&(me=I.a.height-te.length*_e*I.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:M,x:I.a.x,y:I.a.y,rotation:I.a.rotation,hideInExport:!I.showInExport||!de,listening:!1,visible:I.backgroundEnabled,opacity:I.backgroundOpacity,data:ce,fill:I.backgroundColor,offsetY:-me}),r.default.createElement(i.Text,Object.assign({ref:W,id:I.id,name:"element",hideInExport:!I.showInExport||!de,editModeEnabled:I._editModeEnabled,x:I.a.x,y:I.a.y,rotation:I.a.rotation,width:I.a.width,height:I.a.height,text:de||I.placeholder},re,{stroke:I.stroke,lineJoin:"round",strokeWidth:I.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:I.a.fontSize,fontFamily:`"${I.fontFamily}", "${J}"`,fontStyle:I.fontStyle+" "+I.fontWeight,textDecoration:I.textDecoration,align:I.align,verticalAlign:I.verticalAlign,draggable:ge?I.draggable&&X:I.draggable,preventDefault:!ge||X,opacity:ie,visible:!I._editModeEnabled,ellipsis:_.flags.textOverflow==="ellipsis",shadowEnabled:I.shadowEnabled,shadowBlur:I.shadowBlur,shadowOffsetX:I.shadowOffsetX,shadowOffsetY:I.shadowOffsetY,shadowColor:I.shadowColor,shadowOpacity:I.shadowOpacity,lineHeight:_e,letterSpacing:I.letterSpacing*I.a.fontSize,listening:Se,onDragMove:we=>{I.set({x:we.target.x(),y:we.target.y()})},onDragEnd:we=>{I.set({x:we.target.x(),y:we.target.y()})},onMouseEnter:()=>{G(!0)},onMouseLeave:()=>{G(!1)},onClick:ue,onTap:ue,onTransformStart:()=>{q(!0),z.current=W.current.height()},onTransform:we=>{var Ee,Te;const Je=we.target;(Ee=M.current)===null||Ee===void 0||Ee.setAttrs({x:Je.x(),y:Je.y(),rotation:Je.rotation(),scale:Je.scale()});const Ye=((Te=Je.getStage())===null||Te===void 0?void 0:Te.findOne("Transformer")).getActiveAnchor();if(Ye==="middle-left"||Ye==="middle-right"){const pt=Je.scaleX(),It=Je.width()*pt,le=I.a.fontSize;let ne=It;It<le&&(ne=le,ke.current&&Je.position(ke.current)),Je.width(ne),Je.scaleX(1),Je.scaleY(1);const Re=he();if(_.flags.textOverflow!=="ellipsis"){const Me=Math.max(Re,z.current);Je.height(Me),I.set({height:Je.height()})}I.set({x:Je.x(),y:Je.y(),width:Je.width(),rotation:Je.rotation()}),(0,E.applyFilter)(Je,I)}if(Ye==="top-center"||Ye==="bottom-center"){let pt=_.flags.textOverflow==="resize"?he():_e*I.a.fontSize;we.target.height(Math.max(pt,we.target.height()*we.target.scaleY())),we.target.scaleY(1)}ke.current=we.target.position()},onTransformEnd:we=>{var Ee;const Te=we.target.scaleX();we.target.scaleX(1),we.target.scaleY(1),I.set({fontSize:Math.round(I.a.fontSize*Te),width:Math.ceil(we.target.width()*Te),x:we.target.x(),y:we.target.y(),rotation:we.target.rotation(),height:we.target.height()*Te,shadowBlur:I.shadowBlur*Te,shadowOffsetX:I.shadowOffsetX*Te,shadowOffsetY:I.shadowOffsetY*Te,strokeWidth:I.strokeWidth*Te}),(Ee=M.current)===null||Ee===void 0||Ee.setAttrs({scaleX:1,scaleY:1}),q(!1)}})),j&&r.default.createElement(i.Group,{x:I.a.x,y:I.a.y,rotation:I.a.rotation},r.default.createElement(w,{textNodeRef:W,element:I,selectAll:B,cursorPosition:Ie.current,onBlur:()=>{I.toggleEditMode(!1)}})),!K&&(N||X)&&r.default.createElement(p.Highlighter,{element:I}))})})(Ry);var qy={},qs={};(function(e){var t=be&&be.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.replaceColors=e.sameColors=e.fixSize=e.getSvgSize=e.svgToURL=e.getColors=e.urlToString=e.urlToBase64=void 0;const r=t(Kn),n=t(Qe),i=My;function a(d){for(;d.parentNode;){if(d.nodeName==="defs")return!0;d=d.parentNode}return!1}function o(d){const b={fill:"",stroke:""};return d.getAttribute("fill")&&d.getAttribute("fill")!=="none"&&(b.fill=d.getAttribute("fill")),!b.fill&&d.style.fill&&d.style.fill!=="none"&&(b.fill=d.style.fill),d.getAttribute("stroke")&&(b.stroke=d.getAttribute("stroke")),!b.stroke&&d.style.stroke&&(b.stroke=d.style.stroke),b.stroke||b.fill||(b.fill="black"),b}const l=["path","rect","circle"];function u(d){for(var b=[],O=d.getElementsByTagName("*"),P=0,x=O.length;P<x;P++){const w=O[P];a(w)||(w.getAttribute("fill")!==null&&b.push(w),(w.getAttribute("stroke")!==null||w.style&&w.style.fill||l.indexOf(w.nodeName)>=0)&&b.push(w))}return b}async function f(d){const b=await fetch(d);return _(await b.text())}async function v(d){return await(await fetch(d,{mode:"cors"})).text()}function S(d){const b=u(new DOMParser().parseFromString(d,"image/svg+xml")),O=[];return b.forEach(P=>{const{fill:x,stroke:w}=o(P);[x,w].forEach(T=>{T&&r.default.Util.colorToRGBA(T)&&O.indexOf(T)===-1&&O.push(T)})}),O}function _(d){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(d)))}async function h(d){const b=await v(d),O=new DOMParser().parseFromString(b,"image/svg+xml").documentElement.getAttribute("viewBox"),[P,x,w,T]=(O==null?void 0:O.split(" "))||[];return{width:parseFloat(w),height:parseFloat(T)}}function E(d){var b=new DOMParser().parseFromString(d,"image/svg+xml");const O=b.documentElement.getAttribute("viewBox"),[P,x,w,T]=(O==null?void 0:O.split(" "))||[],k=b.documentElement.getAttribute("width");!k&&b.documentElement.setAttribute("width",w+"px");const A=b.documentElement.getAttribute("height");if((!A||A.indexOf("%")>=0)&&b.documentElement.setAttribute("height",T+"px"),k&&k.indexOf("%")>=0&&A&&A.indexOf("%")===-1){const R=parseFloat(A)/parseFloat(T);b.documentElement.setAttribute("width",R*parseFloat(w)+"px")}if(A&&A.indexOf("%")>=0&&k&&k.indexOf("%")===-1){const R=parseFloat(k)/parseFloat(w);b.documentElement.setAttribute("height",R*parseFloat(T)+"px")}return new XMLSerializer().serializeToString(b)}e.urlToBase64=f,e.urlToString=v,e.getColors=S,e.svgToURL=_,e.getSvgSize=h,e.fixSize=E;const m=(d,b)=>{if(!d||!b)return!1;const O=r.default.Util.colorToRGBA(d),P=r.default.Util.colorToRGBA(b);return O&&P?O.r===P.r&&O.g===P.g&&O.b===P.b&&O.a===P.a:void 0};function p(d,b,O,P){var x=d.namespaceURI,w=document.createElementNS(x,"linearGradient");const T=r.default.Util.degToRad(O+90),k=(Math.cos(T)+1)/2,A=(Math.sin(T)+1)/2,R=(Math.cos(T+Math.PI)+1)/2,F=(Math.sin(T+Math.PI)+1)/2;w.setAttribute("x1",100*k+"%"),w.setAttribute("y1",100*A+"%"),w.setAttribute("x2",100*R+"%"),w.setAttribute("y2",100*F+"%"),w.setAttribute("gradientUnits","userSpaceOnUse"),w.setAttribute("id",b);for(var H=0;H<P.length;H++){var Y=P[H],$=document.createElementNS(x,"stop");for(var I in Y)Y.hasOwnProperty(I)&&$.setAttribute(I,Y[I]);w.appendChild($)}return(d.querySelector("defs")||d.insertBefore(document.createElementNS(x,"defs"),d.firstChild)).appendChild(w)}function y(d,b){var O=new DOMParser().parseFromString(d,"image/svg+xml");const P=u(O),x=Array.from(b.keys());return P.forEach(w=>{const{fill:T,stroke:k}=o(w);[{prop:"fill",color:T},{prop:"stroke",color:k}].forEach(({prop:A,color:R})=>{const F=x.find(H=>(0,e.sameColors)(H,R));if(F){const H=b.get(F);if((0,i.isGradient)(H)){const{rotation:Y,stops:$}=(0,i.parseColor)(H),I=$.map(W=>({offset:100*W.offset+"%","stop-color":W.color})),U="color"+Math.round(1e8*Math.random());p(O.children[0],U,Y,I),w.style[A]=null,w.setAttribute(A,`url('#${U}')`)}else w.style[A]=b.get(F)}})}),_(new XMLSerializer().serializeToString(O))}e.sameColors=m,e.replaceColors=y;const g=d=>{const[b,O]=n.default.useState([]);return n.default.useEffect(()=>{let P=!1;return(async()=>{O([]);const x=S(await v(d));P||O(x)})(),()=>{P=!0}},[d]),b};e.useSvgColors=g})(qs);(function(e){var t=be&&be.__createBinding||(Object.create?function(N,G,K,q){q===void 0&&(q=K);var z=Object.getOwnPropertyDescriptor(G,K);z&&!("get"in z?!G.__esModule:z.writable||z.configurable)||(z={enumerable:!0,get:function(){return G[K]}}),Object.defineProperty(N,q,z)}:function(N,G,K,q){q===void 0&&(q=K),N[q]=G[K]}),r=be&&be.__setModuleDefault||(Object.create?function(N,G){Object.defineProperty(N,"default",{enumerable:!0,value:G})}:function(N,G){N.default=G}),n=be&&be.__importStar||function(N){if(N&&N.__esModule)return N;var G={};if(N!=null)for(var K in N)K!=="default"&&Object.prototype.hasOwnProperty.call(N,K)&&t(G,N,K);return r(G,N),G},i=be&&be.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Qe),o=mi,l=ga,u=_a,f=i(jp),v=i(Kn),S=Fc,_=wl,h=da,E=n(qs),m=qn,p=Uc,y=_l,g=yo;function d(){return document.createElement("canvas")}async function b(N){if(!(N.indexOf("data:image/svg+xml")>=0||N.indexOf(".svg")>=0))return N;const G=await E.urlToString(N),K=E.fixSize(G);return E.svgToURL(K)}const O=N=>{const[G,K]=a.default.useState(N);return a.default.useEffect(()=>{(async()=>{const q=await b(N);q!==G&&K(q)})()},[N]),G};function P(N,G){return Math.sqrt(Math.pow(G.x-N.x,2)+Math.pow(G.y-N.y,2))}function x(N,G){return{x:(N.x+G.x)/2,y:(N.y+G.y)/2}}const w=(N,G,K)=>{const q=a.default.useMemo(()=>{var z,X;const{flipX:Z,flipY:J}=N,te=N.type==="svg"||N.src.indexOf("data:image/svg+xml")>=0||N.src.indexOf(".svg")>=0,ee=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&te||N.maskSrc;if(!Z&&!J&&!ee)return G;if(!G||!G.width||!G.height)return null;const se=d();let de=1;N.type==="svg"&&(de=Math.max(N.a.width/G.width*K,N.a.height/G.height*K)),se.width=Math.max(G.width*de,1),se.height=Math.max(G.height*de,1);let he=Z?-se.width:0,ke=J?-se.height:0;return(z=se.getContext("2d"))===null||z===void 0||z.scale(Z?-1:1,J?-1:1),(X=se.getContext("2d"))===null||X===void 0||X.drawImage(G,he,ke,se.width,se.height),se},[N.maskSrc,N.flipX,N.flipY,G,N.a.width,N.a.height,K]);return a.default.useEffect(()=>()=>{q&&q.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(q)},[q]),q};function T(N,G){const K=G.width/G.height;let q,z;return K>=N.width/N.height?(q=N.width,z=N.width/K):(q=N.height*K,z=N.height),{x:(N.width-q)/2,y:(N.height-z)/2,width:q,height:z}}function k(N,G,K,q,z,X,Z){for(var J=new ImageData(G,K),te=new Int32Array(N.data.buffer),ee=N.width,se=new Int32Array(J.data.buffer),de=J.width,he=G/X,ke=K/Z,Ie=Math.round(1/he),ue=Math.round(1/ke),ie=Ie*ue,_e=0;_e<J.height;_e++)for(var Se=0;Se<de;Se++){for(var re=q+Math.round(Se/he)+(z+Math.round(_e/ke))*ee,ce=0,ge=0,me=0,we=0,Ee=0;Ee<ue;Ee++)for(var Te=0;Te<Ie;Te++){var Je=te[re+Te+Ee*ee];ce+=Je<<24>>>24,ge+=Je<<16>>>24,me+=Je<<8>>>24,we+=Je>>>24}ce=Math.round(ce/ie),ge=Math.round(ge/ie),me=Math.round(me/ie),we=Math.round(we/ie),se[Se+_e*de]=we<<24|me<<16|ge<<8|ce}return J}function A(N,G){var K,q;const z=d();z.width=N.width,z.height=N.height,(K=z.getContext("2d"))===null||K===void 0||K.drawImage(N,0,0,z.width,z.height);const X=k(z.getContext("2d").getImageData(0,0,z.width,z.height),Math.floor(z.width*G),Math.floor(z.height*G),0,0,z.width,z.height);return z.width=Math.floor(z.width*G),z.height=Math.floor(z.height*G),(q=z.getContext("2d"))===null||q===void 0||q.putImageData(X,0,0),z}const R=(N,G)=>{const[K,q]=U(N.maskSrc,"anonymous"),z=N.maskSrc?q:"loaded";return(0,e.useImageLoader)(z,N.id+"-mask"),a.default.useMemo(()=>{if(!K||!G||!G.width||!G.height)return G;const X=d();X.width=Math.max(G.width,1),X.height=Math.max(G.height,1);const Z=X.getContext("2d");if(!Z)return G;Z.drawImage(G,0,0),Z.globalCompositeOperation="source-in";const J=T(K,N);return Z.drawImage(K,J.x,J.y,J.width,J.height,0,0,G.width,G.height),X},[G,K,N.a.width,N.a.height])},F=(N,G,K,q,z=0,X=!1)=>{const Z=Math.floor(Math.max(N.a.width*q,1)),J=Math.floor(Math.max(N.a.height*q,1)),te=Math.min(z*q,Z/2,J/2),ee=Math.max(N.a.width/K.width,N.a.height/K.height)*q,se=N.page._exporting&&m.flags.imageDownScalingEnabled&&ee<1&&!X,de=K.x===0&&K.y===0&&K.width===(G==null?void 0:G.width)&&K.height===(G==null?void 0:G.height),he=a.default.useMemo(()=>{if(!(!G||!G.width||!G.height))return de&&te===0&&!se?void 0:d()},[G,te,se,de]);return a.default.useLayoutEffect(()=>{if(!he||!G)return;he.width=Z,he.height=J;const ke=he.getContext("2d");if(!ke)return;te&&(ke.beginPath(),ke.moveTo(te,0),ke.lineTo(Z-te,0),ke.arc(Z-te,te,te,3*Math.PI/2,0,!1),ke.lineTo(Z,J-te),ke.arc(Z-te,J-te,te,0,Math.PI/2,!1),ke.lineTo(te,J),ke.arc(te,J-te,te,Math.PI/2,Math.PI,!1),ke.lineTo(0,te),ke.arc(te,te,te,Math.PI,3*Math.PI/2,!1),ke.clip());const Ie=se?A(G,ee):G,ue=se?{x:Math.floor(K.x*ee),y:Math.floor(K.y*ee),width:Math.floor(K.width*ee),height:Math.floor(K.height*ee)}:K;ke.drawImage(Ie,ue.x,ue.y,ue.width,ue.height,0,0,he.width,he.height)},[he,N.a.width,N.a.height,K.x,K.y,K.width,K.height,z,q,X,N.page._exporting,se]),a.default.useEffect(()=>()=>{he&&he.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(he)},[he]),he||G},H=(N,G,K,q)=>{const z=O(N.clipSrc||""),[X,Z]=U(z,"anonymous"),J=N.clipSrc?Z:"loaded";(0,e.useImageLoader)(J,N.id+"-clip");const te=a.default.useMemo(()=>{if(G&&X)return d()},[G,X]);return a.default.useLayoutEffect(()=>{var ee;if(!X||!G||!G.width||!G.height||!X||!X.width||!X.height||!te)return;const se=d(),de=Math.max(N.a.width/X.width*K,N.a.height/X.height*K);se.width=X.width*de,se.height=X.height*de,(ee=se.getContext("2d"))===null||ee===void 0||ee.drawImage(X,0,0,se.width,se.height),te.width=Math.max(G.width,1),te.height=Math.max(G.height,1);const he=te.getContext("2d");he&&(he.save(),he.drawImage(se,0,0,G.width,G.height),v.default.Util.releaseCanvas(se),he.globalCompositeOperation="source-in",he.drawImage(G,0,0,te.width,te.height),he.restore())},[te,G,X,N.a.width,N.a.height,K,...q]),N.clipSrc&&X?te:G},Y=d(),$=(0,o.observer)(({element:N})=>{const G=Math.min(30,N.a.width/4,N.a.height/4),K=a.default.useRef(null);return a.default.useEffect(()=>{const q=K.current;if(!q)return;const z=new v.default.Animation(X=>{q.rotate(((X==null?void 0:X.timeDiff)||0)/2)},q.getLayer());return z.start(),()=>{z.stop()}}),a.default.createElement(u.Group,{x:N.x,y:N.y,rotation:N.rotation,listening:!1,opacity:N.a.opacity,hideInExport:!N.showInExport},a.default.createElement(u.Rect,{width:N.a.width,height:N.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:K,x:N.a.width/2,y:N.a.height/2,fill:"white",outerRadius:Math.abs(G),innerRadius:Math.max(1,G-5),angle:270}))}),I=(0,o.observer)(({element:N})=>{const G="Can not load the image...",K=Math.max(10,Math.min(30,N.a.width/25));return a.default.createElement(u.Group,{x:N.x,y:N.y,rotation:N.rotation,listening:!1,opacity:N.a.opacity,hideInExport:!N.showInExport},a.default.createElement(u.Rect,{width:N.a.width,height:N.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:G,fontSize:K,width:N.a.width,height:N.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let U=f.default;const W=N=>{U=N};e.setImageLoaderHook=W;const M=(N,G)=>{const K=a.default.useRef(),q=()=>{var z;(z=K.current)===null||z===void 0||z.call(K),K.current=void 0};a.default.useEffect(()=>q,[]),a.default.useLayoutEffect(()=>{N!=="loading"||K.current||(K.current=(0,h.incrementLoader)(`image ${G}`)),N!=="loading"&&q(),N==="failed"&&(0,h.triggerLoadError)(`image ${G}`)},[N])};e.useImageLoader=M;const j=({image:N,status:G,type:K})=>{const q=a.default.useRef();return a.default.useEffect(()=>{q.current=N||q.current},[N]),G!=="failed"||G!=="failed"&&K==="svg"?q.current:void 0},B=N=>{const[G,K]=a.default.useReducer(Z=>Z+1,0),q=a.default.useRef("loading"),z=a.default.useRef(N.src),X=a.default.useRef(N.src);return X.current!==N.src&&(X.current=N.src,q.current="loading"),a.default.useEffect(()=>{if(N.type!=="svg"||!N.src)return;let Z=!1;return(async()=>{q.current="loading",K();const J=await E.urlToString(N.src),te=E.fixSize(J),ee=E.replaceColors(te,N.colorsReplace);Z||(z.current=ee,q.current="loaded",K())})(),()=>{Z=!0}},[N.src,JSON.stringify(N.colorsReplace)]),N.type!=="svg"?[N.src,"loaded"]:[z.current,q.current]};e.ImageElement=(0,o.observer)(({element:N,store:G})=>{var K;const[q,z]=a.default.useState(!1),X=a.default.useRef(null),Z=a.default.useRef(null),[J,te]=a.default.useState(!1),ee=G.selectedElements.indexOf(N)>=0,[se,de]=B(N),[he,ke]=U(se,"anonymous"),Ie=N.type!=="svg"||de==="loaded"?ke:"loading";(0,e.useImageLoader)(Ie,N.id);const ue=j({image:he,status:ke,type:N.type}),ie=R(N,w(N,he||ue,G._elementsPixelRatio))||Y;let{cropX:_e,cropY:Se,cropWidth:re,cropHeight:ce}=N;ke!=="loaded"&&(_e=Se=0,re=ce=1);const ge=ie.width*re,me=ie.height*ce,we=N.a.width/N.a.height;let Ee,Te;const Je=ge/me,Ye=N.type==="svg";Ye?(Ee=ge,Te=me):we>=Je?(Ee=ge,Te=ge/we):(Ee=me*we,Te=me);const pt={x:ie.width*_e,y:ie.height*Se,width:Ee,height:Te},It=(K=N.cornerRadius)!==null&&K!==void 0?K:0,le=N.page._exporting?1:Math.min(2,G.scale),ne=G._elementsPixelRatio*le;let Re=H(N,F(N,ie,pt,ne,It,q||N._cropModeEnabled||N.type==="svg"),ne,[pt,It,ne]);const Me=Math.max(N.a.width/Ee,N.a.height/Te);a.default.useEffect(()=>{var Ne;if(!N._cropModeEnabled)return;const Ke=(Ne=X.current)===null||Ne===void 0?void 0:Ne.getStage();function ft(gt){N._cropModeEnabled&>.target!==Z.current&&N.toggleCropMode(!1)}function Ct(gt){N._cropModeEnabled&>.target.parentNode!==Ke.content&&N.toggleCropMode(!1)}return document.body.addEventListener("click",Ct),Ke==null||Ke.on("click",ft),Ke==null||Ke.on("tap",ft),()=>{document.body.removeEventListener("click",Ct),document.body.removeEventListener("touchstart",Ct),Ke==null||Ke.off("click",ft),Ke==null||Ke.off("click",ft)}},[N._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(q||N._cropModeEnabled))return(0,p.applyFilter)(X.current,N),(0,l.autorun)(()=>{(0,p.applyFilter)(X.current,N)},{delay:100})},[ie,q,re,ce,N._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ne;q||N._cropModeEnabled?(Ne=X.current)===null||Ne===void 0||Ne.clearCache():(0,p.applyFilter)(X.current,N)},[q,N.a.width,N.a.height,N._cropModeEnabled]),a.default.useEffect(()=>{(0,p.applyFilter)(X.current,N)},[N.shadowEnabled,N.shadowBlur,N.cornerRadius,N.shadowColor,N.shadowOffsetX,N.shadowOffsetY,N.shadowOpacity]);const ye=a.default.useRef(null),Le=a.default.useRef(null),Oe=a.default.useRef(null);a.default.useLayoutEffect(()=>{N._cropModeEnabled&&(Le.current.nodes([ye.current]),Oe.current.nodes([Z.current]))},[N._cropModeEnabled]);var qe=a.default.useRef(null),Pt=a.default.useRef(0),_t=a.default.useRef(!1);const Ae=Ne=>{var Ke;((Ke=Ne.evt.touches)===null||Ke===void 0?void 0:Ke.length)>2&&Ne.target.stopDrag(),Math.round(Ne.target.x())>0&&(Ne.target.x(0),Ne.target.scaleX(1)),Math.round(Ne.target.y())>0&&(Ne.target.y(0),Ne.target.scaleY(1));const ft=Ne.target.width()*Ne.target.scaleX(),Ct=Ne.target.height()*Ne.target.scaleY(),gt=Math.min(1,Ee/ft),nr=Math.min(1,Te/Ct),Zr=1-gt,sr=Math.min(Zr,Math.max(0,Math.round(-Ne.target.x())/ft)),bn=1-nr,Pr=Math.min(bn,Math.max(0,Math.round(-Ne.target.y())/Ct));Ne.target.setAttrs({x:-sr*ie.width,y:-Pr*ie.height,scaleX:1,scaleY:1}),N.set({cropX:sr,cropY:Pr,cropWidth:gt,cropHeight:nr})},$e=()=>{N.type!=="svg"&&N.contentEditable&&setTimeout(()=>{N.toggleCropMode(!0)})},Xe=N.type==="svg"&&ue,xt=ke==="loading"&&!Xe,St=ke==="failed",mn=!xt&&!St,lr=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Or=mn?N.a.opacity:0;(0,y.useFadeIn)(X,Or);const yn=N.selectable||G.role==="admin",Xn=(0,g.useMobile)();return a.default.createElement(a.default.Fragment,null,xt&&a.default.createElement($,{element:N}),St&&a.default.createElement(I,{element:N}),a.default.createElement(u.Image,{ref:X,name:"element",id:N.id,image:Re,x:N.a.x,y:N.a.y,width:N.a.width||1,height:N.a.height||1,rotation:N.rotation,opacity:Or,shadowEnabled:N.shadowEnabled,shadowBlur:N.shadowBlur,shadowOffsetX:N.shadowOffsetX,shadowOffsetY:N.shadowOffsetY,shadowColor:N.shadowColor,shadowOpacity:N.shadowOpacity,customCrop:pt,listening:yn,draggable:Xn?N.draggable&&ee:N.draggable,preventDefault:!Xn||ee,hideInExport:!N.showInExport,onMouseEnter:()=>{te(!0)},onMouseLeave:()=>{te(!1)},onDragMove:Ne=>{N.set({x:Ne.target.x(),y:Ne.target.y()})},onDragEnd:Ne=>{N.set({x:Ne.target.x(),y:Ne.target.y()})},onDblClick:$e,onDblTap:$e,onTransformStart:()=>{z(!0),lr.current={cropX:N.cropX,cropY:N.cropY,cropWidth:N.cropWidth,cropHeight:N.cropHeight}},onTransform:Ne=>{var Ke;const ft=Ne.currentTarget,Ct=Math.abs(ft.scaleX()-1)<1e-7?1:ft.scaleX(),gt=Math.abs(ft.scaleY()-1)<1e-7?1:ft.scaleY();ft.scaleX(1),ft.scaleY(1);const nr=(Ke=Ne.target.getStage())===null||Ke===void 0?void 0:Ke.findOne("Transformer"),Zr=1-Ee/ie.width,sr=Math.min(Zr,Math.max(0,N.cropX)),bn=1-Te/ie.height,Pr=Math.min(bn,Math.max(0,N.cropY)),Qr=nr.getActiveAnchor(),_i=!(Qr.indexOf("middle")>=0||Qr.indexOf("center")>=0),Sa=!_i&&Ct<1&&lr.current.cropHeight>Te/ie.height;let wo=_i?N.cropWidth:N.cropWidth*Ct;Sa&&(wo=N.cropWidth);const So=!_i&><1&&lr.current.cropWidth>Ee/ie.width;let Ea=_i?N.cropHeight:N.cropHeight*gt;So&&(Ea=N.cropHeight),Ye&&(wo=N.cropWidth,Ea=N.cropHeight),N.set({cropX:sr,cropY:Pr,x:ft.x(),y:ft.y(),width:ft.width()*Ct,height:ft.height()*gt,rotation:Ne.target.rotation(),cropWidth:Math.min(wo,1-sr),cropHeight:Math.min(Ea,1-Pr)})},onTransformEnd:Ne=>{const Ke=Ne.currentTarget;N.set({width:Ke.width(),height:Ke.height(),x:Ke.x(),y:Ke.y(),rotation:Ne.target.rotation(),cropWidth:Ee/ie.width,cropHeight:Te/ie.height}),z(!1)}}),a.default.createElement(u.Rect,{x:N.x,y:N.y,width:Math.max(N.a.width-N.borderSize,0),height:Math.max(N.a.height-N.borderSize,0),opacity:Or,offsetX:-N.borderSize/2,offsetY:-N.borderSize/2,stroke:N.borderColor,strokeWidth:N.borderSize,listening:!1,visible:!!N.borderSize,rotation:N.rotation,cornerRadius:Math.max(0,It-N.borderSize),hideInExport:!N.showInExport}),N._cropModeEnabled&&a.default.createElement(S.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/G.scale,y:-window.innerWidth/G.scale,width:window.innerWidth/G.scale*3,height:window.innerWidth/G.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Re,x:N.x,y:N.y,width:N.a.width,height:N.a.height,rotation:N.rotation,shadowEnabled:N.shadowEnabled,shadowBlur:N.shadowBlur}),a.default.createElement(u.Group,{x:N.x,y:N.y,rotation:N.rotation,scaleX:Me,scaleY:Me},a.default.createElement(u.Image,{image:ie,ref:Z,opacity:.4,draggable:!0,x:-N.cropX*ie.width,y:-N.cropY*ie.height,onDragMove:Ae,onTransform:Ae,onTouchMove:Ne=>{Ne.evt.preventDefault();const Ke=Ne.target.getStage().getPointersPositions();var ft=Ke[0],Ct=Ke[1];const gt=Ne.target;if(ft&&!Ct&&!gt.isDragging()&&_t.current&&(gt.startDrag(),_t.current=!1),ft&&Ct){v.default.hitOnDragEnabled=!0,gt.isDragging()&&(_t.current=!0,gt.stopDrag());const So=Ne.target.getAbsoluteTransform().copy();So.invert();var nr={x:ft.x,y:ft.y},Zr={x:Ct.x,y:Ct.y};if(!qe.current)return void(qe.current=x(nr,Zr));var sr=x(nr,Zr),bn=P(nr,Zr);Pt.current||(Pt.current=bn);const Ea=gt.position();var Pr={x:sr.x-Ea.x,y:sr.y-Ea.y},Qr=bn/Pt.current;gt.scaleX(Qr),gt.scaleY(Qr);const $c=So.point(sr),Gc=So.point(qe.current);var _i=$c.x-Gc.x,Sa=$c.y-Gc.y,wo={x:Math.min(0,sr.x-Pr.x*Qr+_i),y:Math.min(0,sr.y-Pr.y*Qr+Sa)};gt.position(wo),Pt.current=bn,qe.current=sr,Ae(Ne)}},onTouchEnd:Ne=>{Pt.current=0,qe.current=null,v.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:Oe,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,Ke)=>Ke.width<5||Ke.height<5?Ne:Ke,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Ee,height:Te,ref:ye,listening:!1,onTransform:Ne=>{Ne.target.x()<-N.cropX*ie.width-1e-9&&(Ne.target.x(-N.cropX*ie.width),Ne.target.scaleX(1)),Ne.target.y()<-N.cropY*ie.height-1e-9&&(Ne.target.y(-N.cropY*ie.height),Ne.target.scaleY(1));const Ke=Math.min(1,Math.max(0,N.cropX+Ne.target.x()/ie.width)),ft=Math.min(1,Math.max(0,Ne.target.y()/ie.height+N.cropY)),Ct=Ne.target.width()*Ne.target.scaleX(),gt=Ne.target.height()*Ne.target.scaleY(),nr=Math.min(1-Ke,Ct/ie.width),Zr=Math.min(1-ft,gt/ie.height),sr=Ne.target.getAbsolutePosition(Ne.target.getParent().getParent());Ne.target.scale({x:1,y:1}),Ne.target.position({x:0,y:0}),N.set({x:sr.x,y:sr.y,cropX:Ke,cropY:ft,cropWidth:nr,cropHeight:Zr,width:Math.min(Ct*Me,ie.width*(1-Ke)*Me),height:Math.min(gt*Me,ie.height*(1-ft)*Me)})}}),a.default.createElement(u.Transformer,{ref:Le,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,Ke)=>Ke.width<5||Ke.height<5?Ne:Ke,visible:N.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(J||ee)&&a.default.createElement(_.Highlighter,{element:N}))})})(qy);var T7={},A7={exports:{}};/*!
|
|
115
|
+
* Quill Editor v1.3.7
|
|
116
|
+
* https://quilljs.com/
|
|
117
|
+
* Copyright (c) 2014, Jason Chen
|
|
118
|
+
* Copyright (c) 2013, salesforce.com
|
|
119
|
+
*/(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:be,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),v=i(47),S=i(48),_=i(49),h=i(12),E=i(32),m=i(33),p=i(31),y=i(1),g={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:S.default,Scroll:u.default,Block:v.default,Inline:f.default,Text:_.default,Attributor:{Attribute:h.default,Class:E.default,Style:m.default,Store:p.default}};n.default=g},function(r,n,i){var a=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,g){y.__proto__=g}||function(y,g){for(var d in g)g.hasOwnProperty(d)&&(y[d]=g[d])};return function(y,g){p(y,g);function d(){this.constructor=y}y.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(p){a(y,p);function y(g){var d=this;return g="[Parchment] "+g,d=p.call(this,g)||this,d.message=g,d.name=d.constructor.name,d}return y}(Error);n.ParchmentError=o;var l={},u={},f={},v={};n.DATA_KEY="__blot";var S;(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"})(S=n.Scope||(n.Scope={}));function _(p,y){var g=E(p);if(g==null)throw new o("Unable to create "+p+" blot");var d=g,b=p instanceof Node||p.nodeType===Node.TEXT_NODE?p:d.create(y);return new d(b,y)}n.create=_;function h(p,y){return y===void 0&&(y=!1),p==null?null:p[n.DATA_KEY]!=null?p[n.DATA_KEY].blot:y?h(p.parentNode,y):null}n.find=h;function E(p,y){y===void 0&&(y=S.ANY);var g;if(typeof p=="string")g=v[p]||l[p];else if(p instanceof Text||p.nodeType===Node.TEXT_NODE)g=v.text;else if(typeof p=="number")p&S.LEVEL&S.BLOCK?g=v.block:p&S.LEVEL&S.INLINE&&(g=v.inline);else if(p instanceof HTMLElement){var d=(p.getAttribute("class")||"").split(/\s+/);for(var b in d)if(g=u[d[b]],g)break;g=g||f[p.tagName]}return g==null?null:y&S.LEVEL&g.scope&&y&S.TYPE&g.scope?g:null}n.query=E;function m(){for(var p=[],y=0;y<arguments.length;y++)p[y]=arguments[y];if(p.length>1)return p.map(function(b){return m(b)});var g=p[0];if(typeof g.blotName!="string"&&typeof g.attrName!="string")throw new o("Invalid definition");if(g.blotName==="abstract")throw new o("Cannot register abstract class");if(v[g.blotName||g.attrName]=g,typeof g.keyName=="string")l[g.keyName]=g;else if(g.className!=null&&(u[g.className]=g),g.tagName!=null){Array.isArray(g.tagName)?g.tagName=g.tagName.map(function(b){return b.toUpperCase()}):g.tagName=g.tagName.toUpperCase();var d=Array.isArray(g.tagName)?g.tagName:[g.tagName];d.forEach(function(b){(f[b]==null||g.className==null)&&(f[b]=g)})}return g}n.register=m},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",v=function(S){Array.isArray(S)?this.ops=S:S!=null&&Array.isArray(S.ops)?this.ops=S.ops:this.ops=[]};v.prototype.insert=function(S,_){var h={};return S.length===0?this:(h.insert=S,_!=null&&typeof _=="object"&&Object.keys(_).length>0&&(h.attributes=_),this.push(h))},v.prototype.delete=function(S){return S<=0?this:this.push({delete:S})},v.prototype.retain=function(S,_){if(S<=0)return this;var h={retain:S};return _!=null&&typeof _=="object"&&Object.keys(_).length>0&&(h.attributes=_),this.push(h)},v.prototype.push=function(S){var _=this.ops.length,h=this.ops[_-1];if(S=l(!0,{},S),typeof h=="object"){if(typeof S.delete=="number"&&typeof h.delete=="number")return this.ops[_-1]={delete:h.delete+S.delete},this;if(typeof h.delete=="number"&&S.insert!=null&&(_-=1,h=this.ops[_-1],typeof h!="object"))return this.ops.unshift(S),this;if(o(S.attributes,h.attributes)){if(typeof S.insert=="string"&&typeof h.insert=="string")return this.ops[_-1]={insert:h.insert+S.insert},typeof S.attributes=="object"&&(this.ops[_-1].attributes=S.attributes),this;if(typeof S.retain=="number"&&typeof h.retain=="number")return this.ops[_-1]={retain:h.retain+S.retain},typeof S.attributes=="object"&&(this.ops[_-1].attributes=S.attributes),this}}return _===this.ops.length?this.ops.push(S):this.ops.splice(_,0,S),this},v.prototype.chop=function(){var S=this.ops[this.ops.length-1];return S&&S.retain&&!S.attributes&&this.ops.pop(),this},v.prototype.filter=function(S){return this.ops.filter(S)},v.prototype.forEach=function(S){this.ops.forEach(S)},v.prototype.map=function(S){return this.ops.map(S)},v.prototype.partition=function(S){var _=[],h=[];return this.forEach(function(E){var m=S(E)?_:h;m.push(E)}),[_,h]},v.prototype.reduce=function(S,_){return this.ops.reduce(S,_)},v.prototype.changeLength=function(){return this.reduce(function(S,_){return _.insert?S+u.length(_):_.delete?S-_.delete:S},0)},v.prototype.length=function(){return this.reduce(function(S,_){return S+u.length(_)},0)},v.prototype.slice=function(S,_){S=S||0,typeof _!="number"&&(_=1/0);for(var h=[],E=u.iterator(this.ops),m=0;m<_&&E.hasNext();){var p;m<S?p=E.next(S-m):(p=E.next(_-m),h.push(p)),m+=u.length(p)}return new v(h)},v.prototype.compose=function(S){var _=u.iterator(this.ops),h=u.iterator(S.ops),E=[],m=h.peek();if(m!=null&&typeof m.retain=="number"&&m.attributes==null){for(var p=m.retain;_.peekType()==="insert"&&_.peekLength()<=p;)p-=_.peekLength(),E.push(_.next());m.retain-p>0&&h.next(m.retain-p)}for(var y=new v(E);_.hasNext()||h.hasNext();)if(h.peekType()==="insert")y.push(h.next());else if(_.peekType()==="delete")y.push(_.next());else{var g=Math.min(_.peekLength(),h.peekLength()),d=_.next(g),b=h.next(g);if(typeof b.retain=="number"){var O={};typeof d.retain=="number"?O.retain=g:O.insert=d.insert;var P=u.attributes.compose(d.attributes,b.attributes,typeof d.retain=="number");if(P&&(O.attributes=P),y.push(O),!h.hasNext()&&o(y.ops[y.ops.length-1],O)){var x=new v(_.rest());return y.concat(x).chop()}}else typeof b.delete=="number"&&typeof d.retain=="number"&&y.push(b)}return y.chop()},v.prototype.concat=function(S){var _=new v(this.ops.slice());return S.ops.length>0&&(_.push(S.ops[0]),_.ops=_.ops.concat(S.ops.slice(1))),_},v.prototype.diff=function(S,_){if(this.ops===S.ops)return new v;var h=[this,S].map(function(g){return g.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var b=g===S?"on":"with";throw new Error("diff() called "+b+" non-document")}).join("")}),E=new v,m=a(h[0],h[1],_),p=u.iterator(this.ops),y=u.iterator(S.ops);return m.forEach(function(g){for(var d=g[1].length;d>0;){var b=0;switch(g[0]){case a.INSERT:b=Math.min(y.peekLength(),d),E.push(y.next(b));break;case a.DELETE:b=Math.min(d,p.peekLength()),p.next(b),E.delete(b);break;case a.EQUAL:b=Math.min(p.peekLength(),y.peekLength(),d);var O=p.next(b),P=y.next(b);o(O.insert,P.insert)?E.retain(b,u.attributes.diff(O.attributes,P.attributes)):E.push(P).delete(b);break}d-=b}}),E.chop()},v.prototype.eachLine=function(S,_){_=_||`
|
|
120
|
+
`;for(var h=u.iterator(this.ops),E=new v,m=0;h.hasNext();){if(h.peekType()!=="insert")return;var p=h.peek(),y=u.length(p)-h.peekLength(),g=typeof p.insert=="string"?p.insert.indexOf(_,y)-y:-1;if(g<0)E.push(h.next());else if(g>0)E.push(h.next(g));else{if(S(E,h.next(1).attributes||{},m)===!1)return;m+=1,E=new v}}E.length()>0&&S(E,{},m)},v.prototype.transform=function(S,_){if(_=!!_,typeof S=="number")return this.transformPosition(S,_);for(var h=u.iterator(this.ops),E=u.iterator(S.ops),m=new v;h.hasNext()||E.hasNext();)if(h.peekType()==="insert"&&(_||E.peekType()!=="insert"))m.retain(u.length(h.next()));else if(E.peekType()==="insert")m.push(E.next());else{var p=Math.min(h.peekLength(),E.peekLength()),y=h.next(p),g=E.next(p);if(y.delete)continue;g.delete?m.push(g):m.retain(p,u.attributes.transform(y.attributes,g.attributes,_))}return m.chop()},v.prototype.transformPosition=function(S,_){_=!!_;for(var h=u.iterator(this.ops),E=0;h.hasNext()&&E<=S;){var m=h.peekLength(),p=h.peekType();if(h.next(),p==="delete"){S-=Math.min(m,S-E);continue}else p==="insert"&&(E<S||!_)&&(S+=m);E+=m}return S},r.exports=v},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):a.call(h)==="[object Array]"},f=function(h){if(!h||a.call(h)!=="[object Object]")return!1;var E=i.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&i.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!E&&!m)return!1;var p;for(p in h);return typeof p>"u"||i.call(h,p)},v=function(h,E){o&&E.name==="__proto__"?o(h,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):h[E.name]=E.newValue},S=function(h,E){if(E==="__proto__")if(i.call(h,E)){if(l)return l(h,E).value}else return;return h[E]};r.exports=function _(){var h,E,m,p,y,g,d=arguments[0],b=1,O=arguments.length,P=!1;for(typeof d=="boolean"&&(P=d,d=arguments[1]||{},b=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});b<O;++b)if(h=arguments[b],h!=null)for(E in h)m=S(d,E),p=S(h,E),d!==p&&(P&&p&&(f(p)||(y=u(p)))?(y?(y=!1,g=m&&u(m)?m:[]):g=m&&f(m)?m:{},v(d,{name:E,newValue:_(P,g,p)})):typeof p<"u"&&v(d,{name:E,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 A(R,F){for(var H=0;H<F.length;H++){var Y=F[H];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(R,Y.key,Y)}}return function(R,F,H){return F&&A(R.prototype,F),H&&A(R,H),R}}(),o=function A(R,F,H){R===null&&(R=Function.prototype);var Y=Object.getOwnPropertyDescriptor(R,F);if(Y===void 0){var $=Object.getPrototypeOf(R);return $===null?void 0:A($,F,H)}else{if("value"in Y)return Y.value;var I=Y.get;return I===void 0?void 0:I.call(H)}},l=i(3),u=d(l),f=i(2),v=d(f),S=i(0),_=d(S),h=i(16),E=d(h),m=i(6),p=d(m),y=i(7),g=d(y);function d(A){return A&&A.__esModule?A:{default:A}}function b(A,R){if(!(A instanceof R))throw new TypeError("Cannot call a class as a function")}function O(A,R){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:A}function P(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(A,R):A.__proto__=R)}var x=1,w=function(A){P(R,A);function R(){return b(this,R),O(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return a(R,[{key:"attach",value:function(){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"attach",this).call(this),this.attributes=new _.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new v.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(H,Y){var $=_.default.query(H,_.default.Scope.BLOCK_ATTRIBUTE);$!=null&&this.attributes.attribute($,Y)}},{key:"formatAt",value:function(H,Y,$,I){this.format($,I)}},{key:"insertAt",value:function(H,Y,$){if(typeof Y=="string"&&Y.endsWith(`
|
|
121
|
+
`)){var I=_.default.create(T.blotName);this.parent.insertBefore(I,H===0?this:this.next),I.insertAt(0,Y.slice(0,-1))}else o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,H,Y,$)}}]),R}(_.default.Embed);w.scope=_.default.Scope.BLOCK_BLOT;var T=function(A){P(R,A);function R(F){b(this,R);var H=O(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,F));return H.cache={},H}return a(R,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(_.default.Leaf).reduce(function(H,Y){return Y.length()===0?H:H.insert(Y.value(),k(Y))},new v.default).insert(`
|
|
122
|
+
`,k(this))),this.cache.delta}},{key:"deleteAt",value:function(H,Y){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"deleteAt",this).call(this,H,Y),this.cache={}}},{key:"formatAt",value:function(H,Y,$,I){Y<=0||(_.default.query($,_.default.Scope.BLOCK)?H+Y===this.length()&&this.format($,I):o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"formatAt",this).call(this,H,Math.min(Y,this.length()-H-1),$,I),this.cache={})}},{key:"insertAt",value:function(H,Y,$){if($!=null)return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,H,Y,$);if(Y.length!==0){var I=Y.split(`
|
|
123
|
+
`),U=I.shift();U.length>0&&(H<this.length()-1||this.children.tail==null?o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertAt",this).call(this,Math.min(H,this.length()-1),U):this.children.tail.insertAt(this.children.tail.length(),U),this.cache={});var W=this;I.reduce(function(M,j){return W=W.split(M,!0),W.insertAt(0,j),j.length},H+U.length)}}},{key:"insertBefore",value:function(H,Y){var $=this.children.head;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"insertBefore",this).call(this,H,Y),$ instanceof E.default&&$.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)+x),this.cache.length}},{key:"moveChildren",value:function(H,Y){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"moveChildren",this).call(this,H,Y),this.cache={}}},{key:"optimize",value:function(H){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,H),this.cache={}}},{key:"path",value:function(H){return o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"path",this).call(this,H,!0)}},{key:"removeChild",value:function(H){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"removeChild",this).call(this,H),this.cache={}}},{key:"split",value:function(H){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Y&&(H===0||H>=this.length()-x)){var $=this.clone();return H===0?(this.parent.insertBefore($,this),this):(this.parent.insertBefore($,this.next),$)}else{var I=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"split",this).call(this,H,Y);return this.cache={},I}}}]),R}(_.default.Block);T.blotName="block",T.tagName="P",T.defaultChild="break",T.allowedChildren=[p.default,_.default.Embed,g.default];function k(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A==null||(typeof A.formats=="function"&&(R=(0,u.default)(R,A.formats())),A.parent==null||A.parent.blotName=="scroll"||A.parent.statics.scope!==A.statics.scope)?R:k(A.parent,R)}n.bubbleFormats=k,n.BlockEmbed=w,n.default=T},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(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},o=function(){function W(M,j){var B=[],N=!0,G=!1,K=void 0;try{for(var q=M[Symbol.iterator](),z;!(N=(z=q.next()).done)&&(B.push(z.value),!(j&&B.length===j));N=!0);}catch(X){G=!0,K=X}finally{try{!N&&q.return&&q.return()}finally{if(G)throw K}}return B}return function(M,j){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return W(M,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function W(M,j){for(var B=0;B<j.length;B++){var N=j[B];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(M,N.key,N)}}return function(M,j,B){return j&&W(M.prototype,j),B&&W(M,B),M}}();i(50);var u=i(2),f=k(u),v=i(14),S=k(v),_=i(8),h=k(_),E=i(9),m=k(E),p=i(0),y=k(p),g=i(15),d=k(g),b=i(3),O=k(b),P=i(10),x=k(P),w=i(34),T=k(w);function k(W){return W&&W.__esModule?W:{default:W}}function A(W,M,j){return M in W?Object.defineProperty(W,M,{value:j,enumerable:!0,configurable:!0,writable:!0}):W[M]=j,W}function R(W,M){if(!(W instanceof M))throw new TypeError("Cannot call a class as a function")}var F=(0,x.default)("quill"),H=function(){l(W,null,[{key:"debug",value:function(j){j===!0&&(j="log"),x.default.level(j)}},{key:"find",value:function(j){return j.__quill||y.default.find(j)}},{key:"import",value:function(j){return this.imports[j]==null&&F.error("Cannot import "+j+". Are you sure it was registered?"),this.imports[j]}},{key:"register",value:function(j,B){var N=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof j!="string"){var K=j.attrName||j.blotName;typeof K=="string"?this.register("formats/"+K,j,B):Object.keys(j).forEach(function(q){N.register(q,j[q],B)})}else this.imports[j]!=null&&!G&&F.warn("Overwriting "+j+" with",B),this.imports[j]=B,(j.startsWith("blots/")||j.startsWith("formats/"))&&B.blotName!=="abstract"?y.default.register(B):j.startsWith("modules")&&typeof B.register=="function"&&B.register()}}]);function W(M){var j=this,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(R(this,W),this.options=Y(M,B),this.container=this.options.container,this.container==null)return F.error("Invalid Quill container",M);this.options.debug&&W.debug(this.options.debug);var N=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 h.default,this.scroll=y.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new S.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(h.default.events.EDITOR_CHANGE,function(K){K===h.default.events.TEXT_CHANGE&&j.root.classList.toggle("ql-blank",j.editor.isBlank())}),this.emitter.on(h.default.events.SCROLL_UPDATE,function(K,q){var z=j.selection.lastRange,X=z&&z.length===0?z.index:void 0;$.call(j,function(){return j.editor.update(null,q,X)},K)});var G=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+N+"<p><br></p></div>");this.setContents(G),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(W,[{key:"addContainer",value:function(j){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof j=="string"){var N=j;j=document.createElement("div"),j.classList.add(N)}return this.container.insertBefore(j,B),j}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(j,B,N){var G=this,K=I(j,B,N),q=o(K,4);return j=q[0],B=q[1],N=q[3],$.call(this,function(){return G.editor.deleteText(j,B)},N,j,-1*B)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(j),this.container.classList.toggle("ql-disabled",!j)}},{key:"focus",value:function(){var j=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=j,this.scrollIntoView()}},{key:"format",value:function(j,B){var N=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;return $.call(this,function(){var K=N.getSelection(!0),q=new f.default;if(K==null)return q;if(y.default.query(j,y.default.Scope.BLOCK))q=N.editor.formatLine(K.index,K.length,A({},j,B));else{if(K.length===0)return N.selection.format(j,B),q;q=N.editor.formatText(K.index,K.length,A({},j,B))}return N.setSelection(K,h.default.sources.SILENT),q},G)}},{key:"formatLine",value:function(j,B,N,G,K){var q=this,z=void 0,X=I(j,B,N,G,K),Z=o(X,4);return j=Z[0],B=Z[1],z=Z[2],K=Z[3],$.call(this,function(){return q.editor.formatLine(j,B,z)},K,j,0)}},{key:"formatText",value:function(j,B,N,G,K){var q=this,z=void 0,X=I(j,B,N,G,K),Z=o(X,4);return j=Z[0],B=Z[1],z=Z[2],K=Z[3],$.call(this,function(){return q.editor.formatText(j,B,z)},K,j,0)}},{key:"getBounds",value:function(j){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=void 0;typeof j=="number"?N=this.selection.getBounds(j,B):N=this.selection.getBounds(j.index,j.length);var G=this.container.getBoundingClientRect();return{bottom:N.bottom-G.top,height:N.height,left:N.left-G.left,right:N.right-G.left,top:N.top-G.top,width:N.width}}},{key:"getContents",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-j,N=I(j,B),G=o(N,2);return j=G[0],B=G[1],this.editor.getContents(j,B)}},{key:"getFormat",value:function(){var j=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 j=="number"?this.editor.getFormat(j,B):this.editor.getFormat(j.index,j.length)}},{key:"getIndex",value:function(j){return j.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(j){return this.scroll.leaf(j)}},{key:"getLine",value:function(j){return this.scroll.line(j)}},{key:"getLines",value:function(){var j=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 j!="number"?this.scroll.lines(j.index,j.length):this.scroll.lines(j,B)}},{key:"getModule",value:function(j){return this.theme.modules[j]}},{key:"getSelection",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return j&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-j,N=I(j,B),G=o(N,2);return j=G[0],B=G[1],this.editor.getText(j,B)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(j,B,N){var G=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:W.sources.API;return $.call(this,function(){return G.editor.insertEmbed(j,B,N)},K,j)}},{key:"insertText",value:function(j,B,N,G,K){var q=this,z=void 0,X=I(j,0,N,G,K),Z=o(X,4);return j=Z[0],z=Z[2],K=Z[3],$.call(this,function(){return q.editor.insertText(j,B,z)},K,j,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(j,B,N){this.clipboard.dangerouslyPasteHTML(j,B,N)}},{key:"removeFormat",value:function(j,B,N){var G=this,K=I(j,B,N),q=o(K,4);return j=q[0],B=q[1],N=q[3],$.call(this,function(){return G.editor.removeFormat(j,B)},N,j)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(j){var B=this,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return $.call(this,function(){j=new f.default(j);var G=B.getLength(),K=B.editor.deleteText(0,G),q=B.editor.applyDelta(j),z=q.ops[q.ops.length-1];z!=null&&typeof z.insert=="string"&&z.insert[z.insert.length-1]===`
|
|
124
|
+
`&&(B.editor.deleteText(B.getLength()-1,1),q.delete(1));var X=K.compose(q);return X},N)}},{key:"setSelection",value:function(j,B,N){if(j==null)this.selection.setRange(null,B||W.sources.API);else{var G=I(j,B,N),K=o(G,4);j=K[0],B=K[1],N=K[3],this.selection.setRange(new g.Range(j,B),N),N!==h.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(j){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API,N=new f.default().insert(j);return this.setContents(N,B)}},{key:"update",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h.default.sources.USER,B=this.scroll.update(j);return this.selection.update(j),B}},{key:"updateContents",value:function(j){var B=this,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h.default.sources.API;return $.call(this,function(){return j=new f.default(j),B.editor.applyDelta(j,N)},N,!0)}}]),W}();H.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},H.events=h.default.events,H.sources=h.default.sources,H.version="1.3.7",H.imports={delta:f.default,parchment:y.default,"core/module":m.default,"core/theme":T.default};function Y(W,M){if(M=(0,O.default)(!0,{container:W,modules:{clipboard:!0,keyboard:!0,history:!0}},M),!M.theme||M.theme===H.DEFAULTS.theme)M.theme=T.default;else if(M.theme=H.import("themes/"+M.theme),M.theme==null)throw new Error("Invalid theme "+M.theme+". Did you register it?");var j=(0,O.default)(!0,{},M.theme.DEFAULTS);[j,M].forEach(function(G){G.modules=G.modules||{},Object.keys(G.modules).forEach(function(K){G.modules[K]===!0&&(G.modules[K]={})})});var B=Object.keys(j.modules).concat(Object.keys(M.modules)),N=B.reduce(function(G,K){var q=H.import("modules/"+K);return q==null?F.error("Cannot load "+K+" module. Are you sure you registered it?"):G[K]=q.DEFAULTS||{},G},{});return M.modules!=null&&M.modules.toolbar&&M.modules.toolbar.constructor!==Object&&(M.modules.toolbar={container:M.modules.toolbar}),M=(0,O.default)(!0,{},H.DEFAULTS,{modules:N},j,M),["bounds","container","scrollingContainer"].forEach(function(G){typeof M[G]=="string"&&(M[G]=document.querySelector(M[G]))}),M.modules=Object.keys(M.modules).reduce(function(G,K){return M.modules[K]&&(G[K]=M.modules[K]),G},{}),M}function $(W,M,j,B){if(this.options.strict&&!this.isEnabled()&&M===h.default.sources.USER)return new f.default;var N=j==null?null:this.getSelection(),G=this.editor.delta,K=W();if(N!=null&&(j===!0&&(j=N.index),B==null?N=U(N,K,M):B!==0&&(N=U(N,j,B,M)),this.setSelection(N,h.default.sources.SILENT)),K.length()>0){var q,z=[h.default.events.TEXT_CHANGE,K,G,M];if((q=this.emitter).emit.apply(q,[h.default.events.EDITOR_CHANGE].concat(z)),M!==h.default.sources.SILENT){var X;(X=this.emitter).emit.apply(X,z)}}return K}function I(W,M,j,B,N){var G={};return typeof W.index=="number"&&typeof W.length=="number"?typeof M!="number"?(N=B,B=j,j=M,M=W.length,W=W.index):(M=W.length,W=W.index):typeof M!="number"&&(N=B,B=j,j=M,M=0),(typeof j>"u"?"undefined":a(j))==="object"?(G=j,N=B):typeof j=="string"&&(B!=null?G[j]=B:N=j),N=N||h.default.sources.API,[W,M,G,N]}function U(W,M,j,B){if(W==null)return null;var N=void 0,G=void 0;if(M instanceof f.default){var K=[W.index,W.index+W.length].map(function(Z){return M.transformPosition(Z,B!==h.default.sources.USER)}),q=o(K,2);N=q[0],G=q[1]}else{var z=[W.index,W.index+W.length].map(function(Z){return Z<M||Z===M&&B===h.default.sources.USER?Z:j>=0?Z+j:Math.max(M,Z+j)}),X=o(z,2);N=X[0],G=X[1]}return new g.Range(N,G-N)}n.expandConfig=Y,n.overload=I,n.default=H},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(y,g){for(var d=0;d<g.length;d++){var b=g[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,d){return g&&p(y.prototype,g),d&&p(y,d),y}}(),o=function p(y,g,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:p(O,g,d)}else{if("value"in b)return b.value;var P=b.get;return P===void 0?void 0:P.call(d)}},l=i(7),u=S(l),f=i(0),v=S(f);function S(p){return p&&p.__esModule?p:{default:p}}function _(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function h(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function E(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var m=function(p){E(y,p);function y(){return _(this,y),h(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"formatAt",value:function(d,b,O,P){if(y.compare(this.statics.blotName,O)<0&&v.default.query(O,v.default.Scope.BLOT)){var x=this.isolate(d,b);P&&x.wrap(O,P)}else o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,d,b,O,P)}},{key:"optimize",value:function(d){if(o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,d),this.parent instanceof y&&y.compare(this.statics.blotName,this.parent.statics.blotName)>0){var b=this.parent.isolate(this.offset(),this.length());this.moveChildren(b),b.wrap(this)}}}],[{key:"compare",value:function(d,b){var O=y.order.indexOf(d),P=y.order.indexOf(b);return O>=0||P>=0?O-P:d===b?0:d<b?-1:1}}]),y}(v.default.Inline);m.allowedChildren=[m,v.default.Embed,u.default],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function v(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){v(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default.Text);n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function g(d,b){for(var O=0;O<b.length;O++){var P=b[O];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(d,P.key,P)}}return function(d,b,O){return b&&g(d.prototype,b),O&&g(d,O),d}}(),o=function g(d,b,O){d===null&&(d=Function.prototype);var P=Object.getOwnPropertyDescriptor(d,b);if(P===void 0){var x=Object.getPrototypeOf(d);return x===null?void 0:g(x,b,O)}else{if("value"in P)return P.value;var w=P.get;return w===void 0?void 0:w.call(O)}},l=i(54),u=S(l),f=i(10),v=S(f);function S(g){return g&&g.__esModule?g:{default:g}}function _(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function h(g,d){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:g}function E(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(g,d):g.__proto__=d)}var m=(0,v.default)("quill:events"),p=["selectionchange","mousedown","mouseup","click"];p.forEach(function(g){document.addEventListener(g,function(){for(var d=arguments.length,b=Array(d),O=0;O<d;O++)b[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(P){if(P.__quill&&P.__quill.emitter){var x;(x=P.__quill.emitter).handleDOM.apply(x,b)}})})});var y=function(g){E(d,g);function d(){_(this,d);var b=h(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return b.listeners={},b.on("error",m.error),b}return a(d,[{key:"emit",value:function(){m.log.apply(m,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(O){for(var P=arguments.length,x=Array(P>1?P-1:0),w=1;w<P;w++)x[w-1]=arguments[w];(this.listeners[O.type]||[]).forEach(function(T){var k=T.node,A=T.handler;(O.target===k||k.contains(O.target))&&A.apply(void 0,[O].concat(x))})}},{key:"listenDOM",value:function(O,P,x){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:P,handler:x})}}]),d}(u.default);y.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"},y.sources={API:"api",SILENT:"silent",USER:"user"},n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=f};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(f){if(a.indexOf(f)<=a.indexOf(o)){for(var v,S=arguments.length,_=Array(S>1?S-1:0),h=1;h<S;h++)_[h-1]=arguments[h];(v=console)[f].apply(v,_)}}function u(f){return a.reduce(function(v,S){return v[S]=l.bind(console,S,f),v},{})}l.level=u.level=function(f){o=f},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(_,h,E){return E||(E={}),_===h?!0:_ instanceof Date&&h instanceof Date?_.getTime()===h.getTime():!_||!h||typeof _!="object"&&typeof h!="object"?E.strict?_===h:_==h:S(_,h,E)};function f(_){return _==null}function v(_){return!(!_||typeof _!="object"||typeof _.length!="number"||typeof _.copy!="function"||typeof _.slice!="function"||_.length>0&&typeof _[0]!="number")}function S(_,h,E){var m,p;if(f(_)||f(h)||_.prototype!==h.prototype)return!1;if(l(_))return l(h)?(_=a.call(_),h=a.call(h),u(_,h,E)):!1;if(v(_)){if(!v(h)||_.length!==h.length)return!1;for(m=0;m<_.length;m++)if(_[m]!==h[m])return!1;return!0}try{var y=o(_),g=o(h)}catch{return!1}if(y.length!=g.length)return!1;for(y.sort(),g.sort(),m=y.length-1;m>=0;m--)if(y[m]!=g[m])return!1;for(m=y.length-1;m>=0;m--)if(p=y[m],!u(_[p],h[p],E))return!1;return typeof _==typeof h}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,v){v===void 0&&(v={}),this.attrName=u,this.keyName=f;var S=a.Scope.TYPE&a.Scope.ATTRIBUTE;v.scope!=null?this.scope=v.scope&a.Scope.LEVEL|S:this.scope=a.Scope.ATTRIBUTE,v.whitelist!=null&&(this.whitelist=v.whitelist)}return l.keys=function(u){return[].map.call(u.attributes,function(f){return f.name})},l.prototype.add=function(u,f){return this.canAdd(u,f)?(u.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(u,f){var v=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return v==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var f=u.getAttribute(this.keyName);return this.canAdd(u,f)&&f?f:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function w(T,k){var A=[],R=!0,F=!1,H=void 0;try{for(var Y=T[Symbol.iterator](),$;!(R=($=Y.next()).done)&&(A.push($.value),!(k&&A.length===k));R=!0);}catch(I){F=!0,H=I}finally{try{!R&&Y.return&&Y.return()}finally{if(F)throw H}}return A}return function(T,k){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return w(T,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function w(T,k){for(var A=0;A<k.length;A++){var R=k[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(T,R.key,R)}}return function(T,k,A){return k&&w(T.prototype,k),A&&w(T,A),T}}(),l=function w(T,k,A){T===null&&(T=Function.prototype);var R=Object.getOwnPropertyDescriptor(T,k);if(R===void 0){var F=Object.getPrototypeOf(T);return F===null?void 0:w(F,k,A)}else{if("value"in R)return R.value;var H=R.get;return H===void 0?void 0:H.call(A)}},u=i(2),f=g(u),v=i(0),S=g(v),_=i(4),h=g(_),E=i(6),m=g(E),p=i(7),y=g(p);function g(w){return w&&w.__esModule?w:{default:w}}function d(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}function b(w,T){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:w}function O(w,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);w.prototype=Object.create(T&&T.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(w,T):w.__proto__=T)}var P=function(w){O(T,w);function T(){return d(this,T),b(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return T}(m.default);P.blotName="code",P.tagName="CODE";var x=function(w){O(T,w);function T(){return d(this,T),b(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return o(T,[{key:"delta",value:function(){var A=this,R=this.domNode.textContent;return R.endsWith(`
|
|
125
|
+
`)&&(R=R.slice(0,-1)),R.split(`
|
|
126
|
+
`).reduce(function(F,H){return F.insert(H).insert(`
|
|
127
|
+
`,A.formats())},new f.default)}},{key:"format",value:function(A,R){if(!(A===this.statics.blotName&&R)){var F=this.descendant(y.default,this.length()-1),H=a(F,1),Y=H[0];Y!=null&&Y.deleteAt(Y.length()-1,1),l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"format",this).call(this,A,R)}}},{key:"formatAt",value:function(A,R,F,H){if(R!==0&&!(S.default.query(F,S.default.Scope.BLOCK)==null||F===this.statics.blotName&&H===this.statics.formats(this.domNode))){var Y=this.newlineIndex(A);if(!(Y<0||Y>=A+R)){var $=this.newlineIndex(A,!0)+1,I=Y-$+1,U=this.isolate($,I),W=U.next;U.format(F,H),W instanceof T&&W.formatAt(0,A-$+R-I,F,H)}}}},{key:"insertAt",value:function(A,R,F){if(F==null){var H=this.descendant(y.default,A),Y=a(H,2),$=Y[0],I=Y[1];$.insertAt(I,R)}}},{key:"length",value:function(){var A=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
128
|
+
`)?A:A+1}},{key:"newlineIndex",value:function(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R)return this.domNode.textContent.slice(0,A).lastIndexOf(`
|
|
129
|
+
`);var F=this.domNode.textContent.slice(A).indexOf(`
|
|
130
|
+
`);return F>-1?A+F:-1}},{key:"optimize",value:function(A){this.domNode.textContent.endsWith(`
|
|
131
|
+
`)||this.appendChild(S.default.create("text",`
|
|
132
|
+
`)),l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,A);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===R.statics.formats(R.domNode)&&(R.optimize(A),R.moveChildren(this),R.remove())}},{key:"replace",value:function(A){l(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replace",this).call(this,A),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(R){var F=S.default.find(R);F==null?R.parentNode.removeChild(R):F instanceof S.default.Embed?F.remove():F.unwrap()})}}],[{key:"create",value:function(A){var R=l(T.__proto__||Object.getPrototypeOf(T),"create",this).call(this,A);return R.setAttribute("spellcheck",!1),R}},{key:"formats",value:function(){return!0}}]),T}(h.default);x.blotName="code-block",x.tagName="PRE",x.TAB=" ",n.Code=P,n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},o=function(){function W(M,j){var B=[],N=!0,G=!1,K=void 0;try{for(var q=M[Symbol.iterator](),z;!(N=(z=q.next()).done)&&(B.push(z.value),!(j&&B.length===j));N=!0);}catch(X){G=!0,K=X}finally{try{!N&&q.return&&q.return()}finally{if(G)throw K}}return B}return function(M,j){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return W(M,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function W(M,j){for(var B=0;B<j.length;B++){var N=j[B];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(M,N.key,N)}}return function(M,j,B){return j&&W(M.prototype,j),B&&W(M,B),M}}(),u=i(2),f=R(u),v=i(20),S=R(v),_=i(0),h=R(_),E=i(13),m=R(E),p=i(24),y=R(p),g=i(4),d=R(g),b=i(16),O=R(b),P=i(21),x=R(P),w=i(11),T=R(w),k=i(3),A=R(k);function R(W){return W&&W.__esModule?W:{default:W}}function F(W,M,j){return M in W?Object.defineProperty(W,M,{value:j,enumerable:!0,configurable:!0,writable:!0}):W[M]=j,W}function H(W,M){if(!(W instanceof M))throw new TypeError("Cannot call a class as a function")}var Y=/^[ -~]*$/,$=function(){function W(M){H(this,W),this.scroll=M,this.delta=this.getDelta()}return l(W,[{key:"applyDelta",value:function(j){var B=this,N=!1;this.scroll.update();var G=this.scroll.length();return this.scroll.batchStart(),j=U(j),j.reduce(function(K,q){var z=q.retain||q.delete||q.insert.length||1,X=q.attributes||{};if(q.insert!=null){if(typeof q.insert=="string"){var Z=q.insert;Z.endsWith(`
|
|
133
|
+
`)&&N&&(N=!1,Z=Z.slice(0,-1)),K>=G&&!Z.endsWith(`
|
|
134
|
+
`)&&(N=!0),B.scroll.insertAt(K,Z);var J=B.scroll.line(K),te=o(J,2),ee=te[0],se=te[1],de=(0,A.default)({},(0,g.bubbleFormats)(ee));if(ee instanceof d.default){var he=ee.descendant(h.default.Leaf,se),ke=o(he,1),Ie=ke[0];de=(0,A.default)(de,(0,g.bubbleFormats)(Ie))}X=S.default.attributes.diff(de,X)||{}}else if(a(q.insert)==="object"){var ue=Object.keys(q.insert)[0];if(ue==null)return K;B.scroll.insertAt(K,ue,q.insert[ue])}G+=z}return Object.keys(X).forEach(function(ie){B.scroll.formatAt(K,z,ie,X[ie])}),K+z},0),j.reduce(function(K,q){return typeof q.delete=="number"?(B.scroll.deleteAt(K,q.delete),K):K+(q.retain||q.insert.length||1)},0),this.scroll.batchEnd(),this.update(j)}},{key:"deleteText",value:function(j,B){return this.scroll.deleteAt(j,B),this.update(new f.default().retain(j).delete(B))}},{key:"formatLine",value:function(j,B){var N=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(G).forEach(function(K){if(!(N.scroll.whitelist!=null&&!N.scroll.whitelist[K])){var q=N.scroll.lines(j,Math.max(B,1)),z=B;q.forEach(function(X){var Z=X.length();if(!(X instanceof m.default))X.format(K,G[K]);else{var J=j-X.offset(N.scroll),te=X.newlineIndex(J+z)-J+1;X.formatAt(J,te,K,G[K])}z-=Z})}}),this.scroll.optimize(),this.update(new f.default().retain(j).retain(B,(0,x.default)(G)))}},{key:"formatText",value:function(j,B){var N=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(G).forEach(function(K){N.scroll.formatAt(j,B,K,G[K])}),this.update(new f.default().retain(j).retain(B,(0,x.default)(G)))}},{key:"getContents",value:function(j,B){return this.delta.slice(j,j+B)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(j,B){return j.concat(B.delta())},new f.default)}},{key:"getFormat",value:function(j){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=[],G=[];B===0?this.scroll.path(j).forEach(function(q){var z=o(q,1),X=z[0];X instanceof d.default?N.push(X):X instanceof h.default.Leaf&&G.push(X)}):(N=this.scroll.lines(j,B),G=this.scroll.descendants(h.default.Leaf,j,B));var K=[N,G].map(function(q){if(q.length===0)return{};for(var z=(0,g.bubbleFormats)(q.shift());Object.keys(z).length>0;){var X=q.shift();if(X==null)return z;z=I((0,g.bubbleFormats)(X),z)}return z});return A.default.apply(A.default,K)}},{key:"getText",value:function(j,B){return this.getContents(j,B).filter(function(N){return typeof N.insert=="string"}).map(function(N){return N.insert}).join("")}},{key:"insertEmbed",value:function(j,B,N){return this.scroll.insertAt(j,B,N),this.update(new f.default().retain(j).insert(F({},B,N)))}},{key:"insertText",value:function(j,B){var N=this,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B=B.replace(/\r\n/g,`
|
|
135
|
+
`).replace(/\r/g,`
|
|
136
|
+
`),this.scroll.insertAt(j,B),Object.keys(G).forEach(function(K){N.scroll.formatAt(j,B.length,K,G[K])}),this.update(new f.default().retain(j).insert(B,(0,x.default)(G)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var j=this.scroll.children.head;return j.statics.blotName!==d.default.blotName||j.children.length>1?!1:j.children.head instanceof O.default}},{key:"removeFormat",value:function(j,B){var N=this.getText(j,B),G=this.scroll.line(j+B),K=o(G,2),q=K[0],z=K[1],X=0,Z=new f.default;q!=null&&(q instanceof m.default?X=q.newlineIndex(z)-z+1:X=q.length()-z,Z=q.delta().slice(z,z+X-1).insert(`
|
|
137
|
+
`));var J=this.getContents(j,B+X),te=J.diff(new f.default().insert(N).concat(Z)),ee=new f.default().retain(j).concat(te);return this.applyDelta(ee)}},{key:"update",value:function(j){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,G=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match(Y)&&h.default.find(B[0].target)){var K=h.default.find(B[0].target),q=(0,g.bubbleFormats)(K),z=K.offset(this.scroll),X=B[0].oldValue.replace(y.default.CONTENTS,""),Z=new f.default().insert(X),J=new f.default().insert(K.value()),te=new f.default().retain(z).concat(Z.diff(J,N));j=te.reduce(function(ee,se){return se.insert?ee.insert(se.insert,q):ee.push(se)},new f.default),this.delta=G.compose(j)}else this.delta=this.getDelta(),(!j||!(0,T.default)(G.compose(j),this.delta))&&(j=G.diff(this.delta,N));return j}}]),W}();function I(W,M){return Object.keys(M).reduce(function(j,B){return W[B]==null||(M[B]===W[B]?j[B]=M[B]:Array.isArray(M[B])?M[B].indexOf(W[B])<0&&(j[B]=M[B].concat([W[B]])):j[B]=[M[B],W[B]]),j},{})}function U(W){return W.reduce(function(M,j){if(j.insert===1){var B=(0,x.default)(j.attributes);return delete B.image,M.insert({image:j.attributes.image},B)}if(j.attributes!=null&&(j.attributes.list===!0||j.attributes.bullet===!0)&&(j=(0,x.default)(j),j.attributes.list?j.attributes.list="ordered":(j.attributes.list="bullet",delete j.attributes.bullet)),typeof j.insert=="string"){var N=j.insert.replace(/\r\n/g,`
|
|
138
|
+
`).replace(/\r/g,`
|
|
139
|
+
`);return M.insert(N,j.attributes)}return M.push(j)},new f.default)}n.default=$},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function w(T,k){var A=[],R=!0,F=!1,H=void 0;try{for(var Y=T[Symbol.iterator](),$;!(R=($=Y.next()).done)&&(A.push($.value),!(k&&A.length===k));R=!0);}catch(I){F=!0,H=I}finally{try{!R&&Y.return&&Y.return()}finally{if(F)throw H}}return A}return function(T,k){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return w(T,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function w(T,k){for(var A=0;A<k.length;A++){var R=k[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(T,R.key,R)}}return function(T,k,A){return k&&w(T.prototype,k),A&&w(T,A),T}}(),l=i(0),u=y(l),f=i(21),v=y(f),S=i(11),_=y(S),h=i(8),E=y(h),m=i(10),p=y(m);function y(w){return w&&w.__esModule?w:{default:w}}function g(w){if(Array.isArray(w)){for(var T=0,k=Array(w.length);T<w.length;T++)k[T]=w[T];return k}else return Array.from(w)}function d(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}var b=(0,p.default)("quill:selection"),O=function w(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,w),this.index=T,this.length=k},P=function(){function w(T,k){var A=this;d(this,w),this.emitter=k,this.scroll=T,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new O(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){A.mouseDown||setTimeout(A.update.bind(A,E.default.sources.USER),1)}),this.emitter.on(E.default.events.EDITOR_CHANGE,function(R,F){R===E.default.events.TEXT_CHANGE&&F.length()>0&&A.update(E.default.sources.SILENT)}),this.emitter.on(E.default.events.SCROLL_BEFORE_UPDATE,function(){if(A.hasFocus()){var R=A.getNativeRange();R!=null&&R.start.node!==A.cursor.textNode&&A.emitter.once(E.default.events.SCROLL_UPDATE,function(){try{A.setNativeRange(R.start.node,R.start.offset,R.end.node,R.end.offset)}catch{}})}}),this.emitter.on(E.default.events.SCROLL_OPTIMIZE,function(R,F){if(F.range){var H=F.range,Y=H.startNode,$=H.startOffset,I=H.endNode,U=H.endOffset;A.setNativeRange(Y,$,I,U)}}),this.update(E.default.sources.SILENT)}return o(w,[{key:"handleComposition",value:function(){var k=this;this.root.addEventListener("compositionstart",function(){k.composing=!0}),this.root.addEventListener("compositionend",function(){if(k.composing=!1,k.cursor.parent){var A=k.cursor.restore();if(!A)return;setTimeout(function(){k.setNativeRange(A.startNode,A.startOffset,A.endNode,A.endOffset)},1)}})}},{key:"handleDragging",value:function(){var k=this;this.emitter.listenDOM("mousedown",document.body,function(){k.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){k.mouseDown=!1,k.update(E.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(k,A){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[k])){this.scroll.update();var R=this.getNativeRange();if(!(R==null||!R.native.collapsed||u.default.query(k,u.default.Scope.BLOCK))){if(R.start.node!==this.cursor.textNode){var F=u.default.find(R.start.node,!1);if(F==null)return;if(F instanceof u.default.Leaf){var H=F.split(R.start.offset);F.parent.insertBefore(this.cursor,H)}else F.insertBefore(this.cursor,R.start.node);this.cursor.attach()}this.cursor.format(k,A),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(k){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=this.scroll.length();k=Math.min(k,R-1),A=Math.min(k+A,R-1)-k;var F=void 0,H=this.scroll.leaf(k),Y=a(H,2),$=Y[0],I=Y[1];if($==null)return null;var U=$.position(I,!0),W=a(U,2);F=W[0],I=W[1];var M=document.createRange();if(A>0){M.setStart(F,I);var j=this.scroll.leaf(k+A),B=a(j,2);if($=B[0],I=B[1],$==null)return null;var N=$.position(I,!0),G=a(N,2);return F=G[0],I=G[1],M.setEnd(F,I),M.getBoundingClientRect()}else{var K="left",q=void 0;return F instanceof Text?(I<F.data.length?(M.setStart(F,I),M.setEnd(F,I+1)):(M.setStart(F,I-1),M.setEnd(F,I),K="right"),q=M.getBoundingClientRect()):(q=$.domNode.getBoundingClientRect(),I>0&&(K="right")),{bottom:q.top+q.height,height:q.height,left:q[K],right:q[K],top:q.top,width:0}}}},{key:"getNativeRange",value:function(){var k=document.getSelection();if(k==null||k.rangeCount<=0)return null;var A=k.getRangeAt(0);if(A==null)return null;var R=this.normalizeNative(A);return b.info("getNativeRange",R),R}},{key:"getRange",value:function(){var k=this.getNativeRange();if(k==null)return[null,null];var A=this.normalizedToRange(k);return[A,k]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(k){var A=this,R=[[k.start.node,k.start.offset]];k.native.collapsed||R.push([k.end.node,k.end.offset]);var F=R.map(function($){var I=a($,2),U=I[0],W=I[1],M=u.default.find(U,!0),j=M.offset(A.scroll);return W===0?j:M instanceof u.default.Container?j+M.length():j+M.index(U,W)}),H=Math.min(Math.max.apply(Math,g(F)),this.scroll.length()-1),Y=Math.min.apply(Math,[H].concat(g(F)));return new O(Y,H-Y)}},{key:"normalizeNative",value:function(k){if(!x(this.root,k.startContainer)||!k.collapsed&&!x(this.root,k.endContainer))return null;var A={start:{node:k.startContainer,offset:k.startOffset},end:{node:k.endContainer,offset:k.endOffset},native:k};return[A.start,A.end].forEach(function(R){for(var F=R.node,H=R.offset;!(F instanceof Text)&&F.childNodes.length>0;)if(F.childNodes.length>H)F=F.childNodes[H],H=0;else if(F.childNodes.length===H)F=F.lastChild,H=F instanceof Text?F.data.length:F.childNodes.length+1;else break;R.node=F,R.offset=H}),A}},{key:"rangeToNative",value:function(k){var A=this,R=k.collapsed?[k.index]:[k.index,k.index+k.length],F=[],H=this.scroll.length();return R.forEach(function(Y,$){Y=Math.min(H-1,Y);var I=void 0,U=A.scroll.leaf(Y),W=a(U,2),M=W[0],j=W[1],B=M.position(j,$!==0),N=a(B,2);I=N[0],j=N[1],F.push(I,j)}),F.length<2&&(F=F.concat(F)),F}},{key:"scrollIntoView",value:function(k){var A=this.lastRange;if(A!=null){var R=this.getBounds(A.index,A.length);if(R!=null){var F=this.scroll.length()-1,H=this.scroll.line(Math.min(A.index,F)),Y=a(H,1),$=Y[0],I=$;if(A.length>0){var U=this.scroll.line(Math.min(A.index+A.length,F)),W=a(U,1);I=W[0]}if(!($==null||I==null)){var M=k.getBoundingClientRect();R.top<M.top?k.scrollTop-=M.top-R.top:R.bottom>M.bottom&&(k.scrollTop+=R.bottom-M.bottom)}}}}},{key:"setNativeRange",value:function(k,A){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:k,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A,H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(b.info("setNativeRange",k,A,R,F),!(k!=null&&(this.root.parentNode==null||k.parentNode==null||R.parentNode==null))){var Y=document.getSelection();if(Y!=null)if(k!=null){this.hasFocus()||this.root.focus();var $=(this.getNativeRange()||{}).native;if($==null||H||k!==$.startContainer||A!==$.startOffset||R!==$.endContainer||F!==$.endOffset){k.tagName=="BR"&&(A=[].indexOf.call(k.parentNode.childNodes,k),k=k.parentNode),R.tagName=="BR"&&(F=[].indexOf.call(R.parentNode.childNodes,R),R=R.parentNode);var I=document.createRange();I.setStart(k,A),I.setEnd(R,F),Y.removeAllRanges(),Y.addRange(I)}}else Y.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(k){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof A=="string"&&(R=A,A=!1),b.info("setRange",k),k!=null){var F=this.rangeToNative(k);this.setNativeRange.apply(this,g(F).concat([A]))}else this.setNativeRange(null);this.update(R)}},{key:"update",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E.default.sources.USER,A=this.lastRange,R=this.getRange(),F=a(R,2),H=F[0],Y=F[1];if(this.lastRange=H,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,_.default)(A,this.lastRange)){var $;!this.composing&&Y!=null&&Y.native.collapsed&&Y.start.node!==this.cursor.textNode&&this.cursor.restore();var I=[E.default.events.SELECTION_CHANGE,(0,v.default)(this.lastRange),(0,v.default)(A),k];if(($=this.emitter).emit.apply($,[E.default.events.EDITOR_CHANGE].concat(I)),k!==E.default.sources.SILENT){var U;(U=this.emitter).emit.apply(U,I)}}}}]),w}();function x(w,T){try{T.parentNode}catch{return!1}return T instanceof Text&&(T=T.parentNode),w.contains(T)}n.Range=O,n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,p){for(var y=0;y<p.length;y++){var g=p[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,p,y){return p&&E(m.prototype,p),y&&E(m,y),m}}(),o=function E(m,p,y){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,p);if(g===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,p,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=i(0),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function _(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var h=function(E){_(m,E);function m(){return v(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"insertInto",value:function(y,g){y.children.length===0?o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertInto",this).call(this,y,g):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),m}(u.default.Embed);h.blotName="break",h.tagName="BR",n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,h){_.__proto__=h}||function(_,h){for(var E in h)h.hasOwnProperty(E)&&(_[E]=h[E])};return function(_,h){S(_,h);function E(){this.constructor=_}_.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(S){a(_,S);function _(h){var E=S.call(this,h)||this;return E.build(),E}return _.prototype.appendChild=function(h){this.insertBefore(h)},_.prototype.attach=function(){S.prototype.attach.call(this),this.children.forEach(function(h){h.attach()})},_.prototype.build=function(){var h=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(E){try{var m=v(E);h.insertBefore(m,h.children.head||void 0)}catch(p){if(p instanceof u.ParchmentError)return;throw p}})},_.prototype.deleteAt=function(h,E){if(h===0&&E===this.length())return this.remove();this.children.forEachAt(h,E,function(m,p,y){m.deleteAt(p,y)})},_.prototype.descendant=function(h,E){var m=this.children.find(E),p=m[0],y=m[1];return h.blotName==null&&h(p)||h.blotName!=null&&p instanceof h?[p,y]:p instanceof _?p.descendant(h,y):[null,-1]},_.prototype.descendants=function(h,E,m){E===void 0&&(E=0),m===void 0&&(m=Number.MAX_VALUE);var p=[],y=m;return this.children.forEachAt(E,m,function(g,d,b){(h.blotName==null&&h(g)||h.blotName!=null&&g instanceof h)&&p.push(g),g instanceof _&&(p=p.concat(g.descendants(h,d,y))),y-=b}),p},_.prototype.detach=function(){this.children.forEach(function(h){h.detach()}),S.prototype.detach.call(this)},_.prototype.formatAt=function(h,E,m,p){this.children.forEachAt(h,E,function(y,g,d){y.formatAt(g,d,m,p)})},_.prototype.insertAt=function(h,E,m){var p=this.children.find(h),y=p[0],g=p[1];if(y)y.insertAt(g,E,m);else{var d=m==null?u.create("text",E):u.create(E,m);this.appendChild(d)}},_.prototype.insertBefore=function(h,E){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(m){return h instanceof m}))throw new u.ParchmentError("Cannot insert "+h.statics.blotName+" into "+this.statics.blotName);h.insertInto(this,E)},_.prototype.length=function(){return this.children.reduce(function(h,E){return h+E.length()},0)},_.prototype.moveChildren=function(h,E){this.children.forEach(function(m){h.insertBefore(m,E)})},_.prototype.optimize=function(h){if(S.prototype.optimize.call(this,h),this.children.length===0)if(this.statics.defaultChild!=null){var E=u.create(this.statics.defaultChild);this.appendChild(E),E.optimize(h)}else this.remove()},_.prototype.path=function(h,E){E===void 0&&(E=!1);var m=this.children.find(h,E),p=m[0],y=m[1],g=[[this,h]];return p instanceof _?g.concat(p.path(y,E)):(p!=null&&g.push([p,y]),g)},_.prototype.removeChild=function(h){this.children.remove(h)},_.prototype.replace=function(h){h instanceof _&&h.moveChildren(this),S.prototype.replace.call(this,h)},_.prototype.split=function(h,E){if(E===void 0&&(E=!1),!E){if(h===0)return this;if(h===this.length())return this.next}var m=this.clone();return this.parent.insertBefore(m,this.next),this.children.forEachAt(h,this.length(),function(p,y,g){p=p.split(y,E),m.appendChild(p)}),m},_.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},_.prototype.update=function(h,E){var m=this,p=[],y=[];h.forEach(function(g){g.target===m.domNode&&g.type==="childList"&&(p.push.apply(p,g.addedNodes),y.push.apply(y,g.removedNodes))}),y.forEach(function(g){if(!(g.parentNode!=null&&g.tagName!=="IFRAME"&&document.body.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(g);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===m.domNode)&&d.detach()}}),p.filter(function(g){return g.parentNode==m.domNode}).sort(function(g,d){return g===d?0:g.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(g){var d=null;g.nextSibling!=null&&(d=u.find(g.nextSibling));var b=v(g);(b.next!=d||b.next==null)&&(b.parent!=null&&b.parent.removeChild(m),m.insertBefore(b,d||void 0))})},_}(l.default);function v(S){var _=u.find(S);if(_==null)try{_=u.create(S)}catch{_=u.create(u.Scope.INLINE),[].slice.call(S.childNodes).forEach(function(E){_.domNode.appendChild(E)}),S.parentNode&&S.parentNode.replaceChild(_.domNode,S),_.attach()}return _}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,h){_.__proto__=h}||function(_,h){for(var E in h)h.hasOwnProperty(E)&&(_[E]=h[E])};return function(_,h){S(_,h);function E(){this.constructor=_}_.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),v=function(S){a(_,S);function _(h){var E=S.call(this,h)||this;return E.attributes=new l.default(E.domNode),E}return _.formats=function(h){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return h.tagName.toLowerCase()},_.prototype.format=function(h,E){var m=f.query(h);m instanceof o.default?this.attributes.attribute(m,E):E&&m!=null&&(h!==this.statics.blotName||this.formats()[h]!==E)&&this.replaceWith(h,E)},_.prototype.formats=function(){var h=this.attributes.values(),E=this.statics.formats(this.domNode);return E!=null&&(h[this.statics.blotName]=E),h},_.prototype.replaceWith=function(h,E){var m=S.prototype.replaceWith.call(this,h,E);return this.attributes.copy(m),m},_.prototype.update=function(h,E){var m=this;S.prototype.update.call(this,h,E),h.some(function(p){return p.target===m.domNode&&p.type==="attributes"})&&this.attributes.build()},_.prototype.wrap=function(h,E){var m=S.prototype.wrap.call(this,h,E);return m instanceof _&&m.statics.scope===this.statics.scope&&this.attributes.move(m),m},_}(u.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.value=function(S){return!0},v.prototype.index=function(S,_){return this.domNode===S||this.domNode.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(_,1):-1},v.prototype.position=function(S,_){var h=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return S>0&&(h+=1),[this.parent.domNode,h]},v.prototype.value=function(){var S;return S={},S[this.statics.blotName]=this.statics.value(this.domNode)||!0,S},v.scope=l.Scope.INLINE_BLOT,v}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,v,S){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var _=o(!0,{},v);S||(_=Object.keys(_).reduce(function(E,m){return _[m]!=null&&(E[m]=_[m]),E},{}));for(var h in f)f[h]!==void 0&&v[h]===void 0&&(_[h]=f[h]);return Object.keys(_).length>0?_:void 0},diff:function(f,v){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var S=Object.keys(f).concat(Object.keys(v)).reduce(function(_,h){return a(f[h],v[h])||(_[h]=v[h]===void 0?null:v[h]),_},{});return Object.keys(S).length>0?S:void 0},transform:function(f,v,S){if(typeof f!="object")return v;if(typeof v=="object"){if(!S)return v;var _=Object.keys(v).reduce(function(h,E){return f[E]===void 0&&(h[E]=v[E]),h},{});return Object.keys(_).length>0?_:void 0}}},iterator:function(f){return new u(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function u(f){this.ops=f,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(f){f||(f=1/0);var v=this.ops[this.index];if(v){var S=this.offset,_=l.length(v);if(f>=_-S?(f=_-S,this.index+=1,this.offset=0):this.offset+=f,typeof v.delete=="number")return{delete:f};var h={};return v.attributes&&(h.attributes=v.attributes),typeof v.retain=="number"?h.retain=f:typeof v.insert=="string"?h.insert=v.insert.substr(S,f):h.insert=v.insert,h}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,v=this.index,S=this.next(),_=this.ops.slice(this.index);return this.offset=f,this.index=v,[S].concat(_)}else return[]},r.exports=l},function(r,n){var i=function(){function a(m,p){return p!=null&&m 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(m,p,y,g,d){typeof p=="object"&&(y=p.depth,g=p.prototype,d=p.includeNonEnumerable,p=p.circular);var b=[],O=[],P=typeof Buffer<"u";typeof p>"u"&&(p=!0),typeof y>"u"&&(y=1/0);function x(w,T){if(w===null)return null;if(T===0)return w;var k,A;if(typeof w!="object")return w;if(a(w,o))k=new o;else if(a(w,l))k=new l;else if(a(w,u))k=new u(function(M,j){w.then(function(B){M(x(B,T-1))},function(B){j(x(B,T-1))})});else if(f.__isArray(w))k=[];else if(f.__isRegExp(w))k=new RegExp(w.source,E(w)),w.lastIndex&&(k.lastIndex=w.lastIndex);else if(f.__isDate(w))k=new Date(w.getTime());else{if(P&&Buffer.isBuffer(w))return Buffer.allocUnsafe?k=Buffer.allocUnsafe(w.length):k=new Buffer(w.length),w.copy(k),k;a(w,Error)?k=Object.create(w):typeof g>"u"?(A=Object.getPrototypeOf(w),k=Object.create(A)):(k=Object.create(g),A=g)}if(p){var R=b.indexOf(w);if(R!=-1)return O[R];b.push(w),O.push(k)}a(w,o)&&w.forEach(function(M,j){var B=x(j,T-1),N=x(M,T-1);k.set(B,N)}),a(w,l)&&w.forEach(function(M){var j=x(M,T-1);k.add(j)});for(var F in w){var H;A&&(H=Object.getOwnPropertyDescriptor(A,F)),!(H&&H.set==null)&&(k[F]=x(w[F],T-1))}if(Object.getOwnPropertySymbols)for(var Y=Object.getOwnPropertySymbols(w),F=0;F<Y.length;F++){var $=Y[F],I=Object.getOwnPropertyDescriptor(w,$);I&&!I.enumerable&&!d||(k[$]=x(w[$],T-1),I.enumerable||Object.defineProperty(k,$,{enumerable:!1}))}if(d)for(var U=Object.getOwnPropertyNames(w),F=0;F<U.length;F++){var W=U[F],I=Object.getOwnPropertyDescriptor(w,W);I&&I.enumerable||(k[W]=x(w[W],T-1),Object.defineProperty(k,W,{enumerable:!1}))}return k}return x(m,y)}f.clonePrototype=function(p){if(p===null)return null;var y=function(){};return y.prototype=p,new y};function v(m){return Object.prototype.toString.call(m)}f.__objToStr=v;function S(m){return typeof m=="object"&&v(m)==="[object Date]"}f.__isDate=S;function _(m){return typeof m=="object"&&v(m)==="[object Array]"}f.__isArray=_;function h(m){return typeof m=="object"&&v(m)==="[object RegExp]"}f.__isRegExp=h;function E(m){var p="";return m.global&&(p+="g"),m.ignoreCase&&(p+="i"),m.multiline&&(p+="m"),p}return f.__getRegExpFlags=E,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function k(A,R){var F=[],H=!0,Y=!1,$=void 0;try{for(var I=A[Symbol.iterator](),U;!(H=(U=I.next()).done)&&(F.push(U.value),!(R&&F.length===R));H=!0);}catch(W){Y=!0,$=W}finally{try{!H&&I.return&&I.return()}finally{if(Y)throw $}}return F}return function(A,R){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return k(A,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function k(A,R){for(var F=0;F<R.length;F++){var H=R[F];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(A,H.key,H)}}return function(A,R,F){return R&&k(A.prototype,R),F&&k(A,F),A}}(),l=function k(A,R,F){A===null&&(A=Function.prototype);var H=Object.getOwnPropertyDescriptor(A,R);if(H===void 0){var Y=Object.getPrototypeOf(A);return Y===null?void 0:k(Y,R,F)}else{if("value"in H)return H.value;var $=H.get;return $===void 0?void 0:$.call(F)}},u=i(0),f=b(u),v=i(8),S=b(v),_=i(4),h=b(_),E=i(16),m=b(E),p=i(13),y=b(p),g=i(25),d=b(g);function b(k){return k&&k.__esModule?k:{default:k}}function O(k,A){if(!(k instanceof A))throw new TypeError("Cannot call a class as a function")}function P(k,A){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:k}function x(k,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);k.prototype=Object.create(A&&A.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(k,A):k.__proto__=A)}function w(k){return k instanceof h.default||k instanceof _.BlockEmbed}var T=function(k){x(A,k);function A(R,F){O(this,A);var H=P(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R));return H.emitter=F.emitter,Array.isArray(F.whitelist)&&(H.whitelist=F.whitelist.reduce(function(Y,$){return Y[$]=!0,Y},{})),H.domNode.addEventListener("DOMNodeInserted",function(){}),H.optimize(),H.enable(),H}return o(A,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(F,H){var Y=this.line(F),$=a(Y,2),I=$[0],U=$[1],W=this.line(F+H),M=a(W,1),j=M[0];if(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,F,H),j!=null&&I!==j&&U>0){if(I instanceof _.BlockEmbed||j instanceof _.BlockEmbed){this.optimize();return}if(I instanceof y.default){var B=I.newlineIndex(I.length(),!0);if(B>-1&&(I=I.split(B+1),I===j)){this.optimize();return}}else if(j instanceof y.default){var N=j.newlineIndex(0);N>-1&&j.split(N+1)}var G=j.children.head instanceof m.default?null:j.children.head;I.moveChildren(j,G),I.remove()}this.optimize()}},{key:"enable",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",F)}},{key:"formatAt",value:function(F,H,Y,$){this.whitelist!=null&&!this.whitelist[Y]||(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,F,H,Y,$),this.optimize())}},{key:"insertAt",value:function(F,H,Y){if(!(Y!=null&&this.whitelist!=null&&!this.whitelist[H])){if(F>=this.length())if(Y==null||f.default.query(H,f.default.Scope.BLOCK)==null){var $=f.default.create(this.statics.defaultChild);this.appendChild($),Y==null&&H.endsWith(`
|
|
140
|
+
`)&&(H=H.slice(0,-1)),$.insertAt(0,H,Y)}else{var I=f.default.create(H,Y);this.appendChild(I)}else l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,F,H,Y);this.optimize()}}},{key:"insertBefore",value:function(F,H){if(F.statics.scope===f.default.Scope.INLINE_BLOT){var Y=f.default.create(this.statics.defaultChild);Y.appendChild(F),F=Y}l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,F,H)}},{key:"leaf",value:function(F){return this.path(F).pop()||[null,-1]}},{key:"line",value:function(F){return F===this.length()?this.line(F-1):this.descendant(w,F)}},{key:"lines",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,Y=function $(I,U,W){var M=[],j=W;return I.children.forEachAt(U,W,function(B,N,G){w(B)?M.push(B):B instanceof f.default.Container&&(M=M.concat($(B,N,j))),j-=G}),M};return Y(this,F,H)}},{key:"optimize",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,F,H),F.length>0&&this.emitter.emit(S.default.events.SCROLL_OPTIMIZE,F,H))}},{key:"path",value:function(F){return l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,F).slice(1)}},{key:"update",value:function(F){if(this.batch!==!0){var H=S.default.sources.USER;typeof F=="string"&&(H=F),Array.isArray(F)||(F=this.observer.takeRecords()),F.length>0&&this.emitter.emit(S.default.events.SCROLL_BEFORE_UPDATE,H,F),l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"update",this).call(this,F.concat([])),F.length>0&&this.emitter.emit(S.default.events.SCROLL_UPDATE,H,F)}}}]),A}(f.default.Scroll);T.blotName="scroll",T.className="ql-editor",T.tagName="DIV",T.defaultChild="block",T.allowedChildren=[h.default,_.BlockEmbed,d.default],n.default=T},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(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},o=function(){function q(z,X){var Z=[],J=!0,te=!1,ee=void 0;try{for(var se=z[Symbol.iterator](),de;!(J=(de=se.next()).done)&&(Z.push(de.value),!(X&&Z.length===X));J=!0);}catch(he){te=!0,ee=he}finally{try{!J&&se.return&&se.return()}finally{if(te)throw ee}}return Z}return function(z,X){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return q(z,X);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function q(z,X){for(var Z=0;Z<X.length;Z++){var J=X[Z];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(z,J.key,J)}}return function(z,X,Z){return X&&q(z.prototype,X),Z&&q(z,Z),z}}(),u=i(21),f=k(u),v=i(11),S=k(v),_=i(3),h=k(_),E=i(2),m=k(E),p=i(20),y=k(p),g=i(0),d=k(g),b=i(5),O=k(b),P=i(10),x=k(P),w=i(9),T=k(w);function k(q){return q&&q.__esModule?q:{default:q}}function A(q,z,X){return z in q?Object.defineProperty(q,z,{value:X,enumerable:!0,configurable:!0,writable:!0}):q[z]=X,q}function R(q,z){if(!(q instanceof z))throw new TypeError("Cannot call a class as a function")}function F(q,z){if(!q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:q}function H(q,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);q.prototype=Object.create(z&&z.prototype,{constructor:{value:q,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(q,z):q.__proto__=z)}var Y=(0,x.default)("quill:keyboard"),$=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",I=function(q){H(z,q),l(z,null,[{key:"match",value:function(Z,J){return J=K(J),["altKey","ctrlKey","metaKey","shiftKey"].some(function(te){return!!J[te]!==Z[te]&&J[te]!==null})?!1:J.key===(Z.which||Z.keyCode)}}]);function z(X,Z){R(this,z);var J=F(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,X,Z));return J.bindings={},Object.keys(J.options.bindings).forEach(function(te){te==="list autofill"&&X.scroll.whitelist!=null&&!X.scroll.whitelist.list||J.options.bindings[te]&&J.addBinding(J.options.bindings[te])}),J.addBinding({key:z.keys.ENTER,shiftKey:null},B),J.addBinding({key:z.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(J.addBinding({key:z.keys.BACKSPACE},{collapsed:!0},W),J.addBinding({key:z.keys.DELETE},{collapsed:!0},M)):(J.addBinding({key:z.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},W),J.addBinding({key:z.keys.DELETE},{collapsed:!0,suffix:/^.?$/},M)),J.addBinding({key:z.keys.BACKSPACE},{collapsed:!1},j),J.addBinding({key:z.keys.DELETE},{collapsed:!1},j),J.addBinding({key:z.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},W),J.listen(),J}return l(z,[{key:"addBinding",value:function(Z){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=K(Z);if(ee==null||ee.key==null)return Y.warn("Attempted to add invalid keyboard binding",ee);typeof J=="function"&&(J={handler:J}),typeof te=="function"&&(te={handler:te}),ee=(0,h.default)(ee,J,te),this.bindings[ee.key]=this.bindings[ee.key]||[],this.bindings[ee.key].push(ee)}},{key:"listen",value:function(){var Z=this;this.quill.root.addEventListener("keydown",function(J){if(!J.defaultPrevented){var te=J.which||J.keyCode,ee=(Z.bindings[te]||[]).filter(function(Ye){return z.match(J,Ye)});if(ee.length!==0){var se=Z.quill.getSelection();if(!(se==null||!Z.quill.hasFocus())){var de=Z.quill.getLine(se.index),he=o(de,2),ke=he[0],Ie=he[1],ue=Z.quill.getLeaf(se.index),ie=o(ue,2),_e=ie[0],Se=ie[1],re=se.length===0?[_e,Se]:Z.quill.getLeaf(se.index+se.length),ce=o(re,2),ge=ce[0],me=ce[1],we=_e instanceof d.default.Text?_e.value().slice(0,Se):"",Ee=ge instanceof d.default.Text?ge.value().slice(me):"",Te={collapsed:se.length===0,empty:se.length===0&&ke.length()<=1,format:Z.quill.getFormat(se),offset:Ie,prefix:we,suffix:Ee},Je=ee.some(function(Ye){if(Ye.collapsed!=null&&Ye.collapsed!==Te.collapsed||Ye.empty!=null&&Ye.empty!==Te.empty||Ye.offset!=null&&Ye.offset!==Te.offset)return!1;if(Array.isArray(Ye.format)){if(Ye.format.every(function(pt){return Te.format[pt]==null}))return!1}else if(a(Ye.format)==="object"&&!Object.keys(Ye.format).every(function(pt){return Ye.format[pt]===!0?Te.format[pt]!=null:Ye.format[pt]===!1?Te.format[pt]==null:(0,S.default)(Ye.format[pt],Te.format[pt])}))return!1;return Ye.prefix!=null&&!Ye.prefix.test(Te.prefix)||Ye.suffix!=null&&!Ye.suffix.test(Te.suffix)?!1:Ye.handler.call(Z,se,Te)!==!0});Je&&J.preventDefault()}}}})}}]),z}(T.default);I.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},I.DEFAULTS={bindings:{bold:G("bold"),italic:G("italic"),underline:G("underline"),indent:{key:I.keys.TAB,format:["blockquote","indent","list"],handler:function(z,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:I.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(z,X){if(X.collapsed&&X.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:I.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(z,X){X.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):X.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":N(!0),"outdent code-block":N(!1),"remove tab":{key:I.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(z){this.quill.deleteText(z.index-1,1,O.default.sources.USER)}},tab:{key:I.keys.TAB,handler:function(z){this.quill.history.cutoff();var X=new m.default().retain(z.index).delete(z.length).insert(" ");this.quill.updateContents(X,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(z.index+1,O.default.sources.SILENT)}},"list empty enter":{key:I.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(z,X){this.quill.format("list",!1,O.default.sources.USER),X.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:I.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(z){var X=this.quill.getLine(z.index),Z=o(X,2),J=Z[0],te=Z[1],ee=(0,h.default)({},J.formats(),{list:"checked"}),se=new m.default().retain(z.index).insert(`
|
|
141
|
+
`,ee).retain(J.length()-te-1).retain(1,{list:"unchecked"});this.quill.updateContents(se,O.default.sources.USER),this.quill.setSelection(z.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:I.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(z,X){var Z=this.quill.getLine(z.index),J=o(Z,2),te=J[0],ee=J[1],se=new m.default().retain(z.index).insert(`
|
|
142
|
+
`,X.format).retain(te.length()-ee-1).retain(1,{header:null});this.quill.updateContents(se,O.default.sources.USER),this.quill.setSelection(z.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(z,X){var Z=X.prefix.length,J=this.quill.getLine(z.index),te=o(J,2),ee=te[0],se=te[1];if(se>Z)return!0;var de=void 0;switch(X.prefix.trim()){case"[]":case"[ ]":de="unchecked";break;case"[x]":de="checked";break;case"-":case"*":de="bullet";break;default:de="ordered"}this.quill.insertText(z.index," ",O.default.sources.USER),this.quill.history.cutoff();var he=new m.default().retain(z.index-se).delete(Z+1).retain(ee.length()-2-se).retain(1,{list:de});this.quill.updateContents(he,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(z.index-Z,O.default.sources.SILENT)}},"code exit":{key:I.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(z){var X=this.quill.getLine(z.index),Z=o(X,2),J=Z[0],te=Z[1],ee=new m.default().retain(z.index+J.length()-te-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ee,O.default.sources.USER)}},"embed left":U(I.keys.LEFT,!1),"embed left shift":U(I.keys.LEFT,!0),"embed right":U(I.keys.RIGHT,!1),"embed right shift":U(I.keys.RIGHT,!0)}};function U(q,z){var X,Z=q===I.keys.LEFT?"prefix":"suffix";return X={key:q,shiftKey:z,altKey:null},A(X,Z,/^$/),A(X,"handler",function(te){var ee=te.index;q===I.keys.RIGHT&&(ee+=te.length+1);var se=this.quill.getLeaf(ee),de=o(se,1),he=de[0];return he instanceof d.default.Embed?(q===I.keys.LEFT?z?this.quill.setSelection(te.index-1,te.length+1,O.default.sources.USER):this.quill.setSelection(te.index-1,O.default.sources.USER):z?this.quill.setSelection(te.index,te.length+1,O.default.sources.USER):this.quill.setSelection(te.index+te.length+1,O.default.sources.USER),!1):!0}),X}function W(q,z){if(!(q.index===0||this.quill.getLength()<=1)){var X=this.quill.getLine(q.index),Z=o(X,1),J=Z[0],te={};if(z.offset===0){var ee=this.quill.getLine(q.index-1),se=o(ee,1),de=se[0];if(de!=null&&de.length()>1){var he=J.formats(),ke=this.quill.getFormat(q.index-1,1);te=y.default.attributes.diff(he,ke)||{}}}var Ie=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(z.prefix)?2:1;this.quill.deleteText(q.index-Ie,Ie,O.default.sources.USER),Object.keys(te).length>0&&this.quill.formatLine(q.index-Ie,Ie,te,O.default.sources.USER),this.quill.focus()}}function M(q,z){var X=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(z.suffix)?2:1;if(!(q.index>=this.quill.getLength()-X)){var Z={},J=0,te=this.quill.getLine(q.index),ee=o(te,1),se=ee[0];if(z.offset>=se.length()-1){var de=this.quill.getLine(q.index+1),he=o(de,1),ke=he[0];if(ke){var Ie=se.formats(),ue=this.quill.getFormat(q.index,1);Z=y.default.attributes.diff(Ie,ue)||{},J=ke.length()}}this.quill.deleteText(q.index,X,O.default.sources.USER),Object.keys(Z).length>0&&this.quill.formatLine(q.index+J-1,X,Z,O.default.sources.USER)}}function j(q){var z=this.quill.getLines(q),X={};if(z.length>1){var Z=z[0].formats(),J=z[z.length-1].formats();X=y.default.attributes.diff(J,Z)||{}}this.quill.deleteText(q,O.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(q.index,1,X,O.default.sources.USER),this.quill.setSelection(q.index,O.default.sources.SILENT),this.quill.focus()}function B(q,z){var X=this;q.length>0&&this.quill.scroll.deleteAt(q.index,q.length);var Z=Object.keys(z.format).reduce(function(J,te){return d.default.query(te,d.default.Scope.BLOCK)&&!Array.isArray(z.format[te])&&(J[te]=z.format[te]),J},{});this.quill.insertText(q.index,`
|
|
143
|
+
`,Z,O.default.sources.USER),this.quill.setSelection(q.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(z.format).forEach(function(J){Z[J]==null&&(Array.isArray(z.format[J])||J!=="link"&&X.quill.format(J,z.format[J],O.default.sources.USER))})}function N(q){return{key:I.keys.TAB,shiftKey:!q,format:{"code-block":!0},handler:function(X){var Z=d.default.query("code-block"),J=X.index,te=X.length,ee=this.quill.scroll.descendant(Z,J),se=o(ee,2),de=se[0],he=se[1];if(de!=null){var ke=this.quill.getIndex(de),Ie=de.newlineIndex(he,!0)+1,ue=de.newlineIndex(ke+he+te),ie=de.domNode.textContent.slice(Ie,ue).split(`
|
|
144
|
+
`);he=0,ie.forEach(function(_e,Se){q?(de.insertAt(Ie+he,Z.TAB),he+=Z.TAB.length,Se===0?J+=Z.TAB.length:te+=Z.TAB.length):_e.startsWith(Z.TAB)&&(de.deleteAt(Ie+he,Z.TAB.length),he-=Z.TAB.length,Se===0?J-=Z.TAB.length:te-=Z.TAB.length),he+=_e.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(J,te,O.default.sources.SILENT)}}}}function G(q){return{key:q[0].toUpperCase(),shortKey:!0,handler:function(X,Z){this.quill.format(q,!Z.format[q],O.default.sources.USER)}}}function K(q){if(typeof q=="string"||typeof q=="number")return K({key:q});if((typeof q>"u"?"undefined":a(q))==="object"&&(q=(0,f.default)(q,!1)),typeof q.key=="string")if(I.keys[q.key.toUpperCase()]!=null)q.key=I.keys[q.key.toUpperCase()];else if(q.key.length===1)q.key=q.key.toUpperCase().charCodeAt(0);else return null;return q.shortKey&&(q[$]=q.shortKey,delete q.shortKey),q}n.default=I,n.SHORTKEY=$},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(g,d){var b=[],O=!0,P=!1,x=void 0;try{for(var w=g[Symbol.iterator](),T;!(O=(T=w.next()).done)&&(b.push(T.value),!(d&&b.length===d));O=!0);}catch(k){P=!0,x=k}finally{try{!O&&w.return&&w.return()}finally{if(P)throw x}}return b}return function(g,d){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return y(g,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function y(g,d,b){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,d);if(O===void 0){var P=Object.getPrototypeOf(g);return P===null?void 0:y(P,d,b)}else{if("value"in O)return O.value;var x=O.get;return x===void 0?void 0:x.call(b)}},l=function(){function y(g,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,d,b){return d&&y(g.prototype,d),b&&y(g,b),g}}(),u=i(0),f=_(u),v=i(7),S=_(v);function _(y){return y&&y.__esModule?y:{default:y}}function h(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function E(y,g){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:y}function m(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);y.prototype=Object.create(g&&g.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(y,g):y.__proto__=g)}var p=function(y){m(g,y),l(g,null,[{key:"value",value:function(){}}]);function g(d,b){h(this,g);var O=E(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,d));return O.selection=b,O.textNode=document.createTextNode(g.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return l(g,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(b,O){if(this._length!==0)return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,b,O);for(var P=this,x=0;P!=null&&P.statics.scope!==f.default.Scope.BLOCK_BLOT;)x+=P.offset(P.parent),P=P.parent;P!=null&&(this._length=g.CONTENTS.length,P.optimize(),P.formatAt(x,g.CONTENTS.length,b,O),this._length=0)}},{key:"index",value:function(b,O){return b===this.textNode?0:o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,b,O)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var b=this.textNode,O=this.selection.getNativeRange(),P=void 0,x=void 0,w=void 0;if(O!=null&&O.start.node===b&&O.end.node===b){var T=[b,O.start.offset,O.end.offset];P=T[0],x=T[1],w=T[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==g.CONTENTS){var k=this.textNode.data.split(g.CONTENTS).join("");this.next instanceof S.default?(P=this.next.domNode,this.next.insertAt(0,k),this.textNode.data=g.CONTENTS):(this.textNode.data=k,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(g.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),x!=null){var A=[x,w].map(function(F){return Math.max(0,Math.min(P.data.length,F-1))}),R=a(A,2);return x=R[0],w=R[1],{startNode:P,startOffset:x,endNode:P,endOffset:w}}}}},{key:"update",value:function(b,O){var P=this;if(b.some(function(w){return w.type==="characterData"&&w.target===P.textNode})){var x=this.restore();x&&(O.range=x)}}},{key:"value",value:function(){return""}}]),g}(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(E){return E&&E.__esModule?E:{default:E}}function v(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function _(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var h=function(E){_(m,E);function m(){return v(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(o.default.Container);h.allowedChildren=[u.default,l.BlockEmbed,h],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function p(y,g){for(var d=0;d<g.length;d++){var b=g[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,d){return g&&p(y.prototype,g),d&&p(y,d),y}}(),o=function p(y,g,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:p(O,g,d)}else{if("value"in b)return b.value;var P=b.get;return P===void 0?void 0:P.call(d)}},l=i(0),u=f(l);function f(p){return p&&p.__esModule?p:{default:p}}function v(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function S(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function _(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var h=function(p){_(y,p);function y(){return v(this,y),S(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"value",value:function(d){var b=o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,d);return b.startsWith("rgb(")?(b=b.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+b.split(",").map(function(O){return("00"+parseInt(O).toString(16)).slice(-2)}).join("")):b}}]),y}(u.default.Attributor.Style),E=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),m=new h("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=h,n.ColorClass=E,n.ColorStyle=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function m(p,y){for(var g=0;g<y.length;g++){var d=y[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}return function(p,y,g){return y&&m(p.prototype,y),g&&m(p,g),p}}(),o=function m(p,y,g){p===null&&(p=Function.prototype);var d=Object.getOwnPropertyDescriptor(p,y);if(d===void 0){var b=Object.getPrototypeOf(p);return b===null?void 0:m(b,y,g)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(g)}},l=i(6),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function v(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function S(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function _(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var h=function(m){_(p,m);function p(){return v(this,p),S(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"format",value:function(g,d){if(g!==this.statics.blotName||!d)return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,g,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(g){var d=o(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,g);return g=this.sanitize(g),d.setAttribute("href",g),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(g){return g.getAttribute("href")}},{key:"sanitize",value:function(g){return E(g,this.PROTOCOL_WHITELIST)?g:this.SANITIZED_URL}}]),p}(u.default);h.blotName="link",h.tagName="A",h.SANITIZED_URL="about:blank",h.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function E(m,p){var y=document.createElement("a");y.href=m;var g=y.href.slice(0,y.href.indexOf(":"));return p.indexOf(g)>-1}n.default=h,n.sanitize=E},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(y,g){for(var d=0;d<g.length;d++){var b=g[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,d){return g&&p(y.prototype,g),d&&p(y,d),y}}(),l=i(23),u=S(l),f=i(107),v=S(f);function S(p){return p&&p.__esModule?p:{default:p}}function _(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}var h=0;function E(p,y){p.setAttribute(y,p.getAttribute(y)!=="true")}var m=function(){function p(y){var g=this;_(this,p),this.select=y,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){g.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:g.togglePicker();break;case u.default.keys.ESCAPE:g.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"),E(this.label,"aria-expanded"),E(this.options,"aria-hidden")}},{key:"buildItem",value:function(g){var d=this,b=document.createElement("span");return b.tabIndex="0",b.setAttribute("role","button"),b.classList.add("ql-picker-item"),g.hasAttribute("value")&&b.setAttribute("data-value",g.getAttribute("value")),g.textContent&&b.setAttribute("data-label",g.textContent),b.addEventListener("click",function(){d.selectItem(b,!0)}),b.addEventListener("keydown",function(O){switch(O.keyCode){case u.default.keys.ENTER:d.selectItem(b,!0),O.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),O.preventDefault();break}}),b}},{key:"buildLabel",value:function(){var g=document.createElement("span");return g.classList.add("ql-picker-label"),g.innerHTML=v.default,g.tabIndex="0",g.setAttribute("role","button"),g.setAttribute("aria-expanded","false"),this.container.appendChild(g),g}},{key:"buildOptions",value:function(){var g=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+h,h+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(b){var O=g.buildItem(b);d.appendChild(O),b.selected===!0&&g.selectItem(O)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var g=this;[].slice.call(this.select.attributes).forEach(function(d){g.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var g=this;this.close(),setTimeout(function(){return g.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(g){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,b=this.container.querySelector(".ql-selected");if(g!==b&&(b!=null&&b.classList.remove("ql-selected"),g!=null&&(g.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(g.parentNode.children,g),g.hasAttribute("data-value")?this.label.setAttribute("data-value",g.getAttribute("data-value")):this.label.removeAttribute("data-value"),g.hasAttribute("data-label")?this.label.setAttribute("data-label",g.getAttribute("data-label")):this.label.removeAttribute("data-label"),d))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var O=document.createEvent("Event");O.initEvent("change",!0,!0),this.select.dispatchEvent(O)}this.close()}}},{key:"update",value:function(){var g=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];g=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var b=g!=null&&g!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",b)}}]),p}();n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=Y(a),l=i(5),u=Y(l),f=i(4),v=Y(f),S=i(16),_=Y(S),h=i(25),E=Y(h),m=i(24),p=Y(m),y=i(35),g=Y(y),d=i(6),b=Y(d),O=i(22),P=Y(O),x=i(7),w=Y(x),T=i(55),k=Y(T),A=i(42),R=Y(A),F=i(23),H=Y(F);function Y($){return $&&$.__esModule?$:{default:$}}u.default.register({"blots/block":v.default,"blots/block/embed":f.BlockEmbed,"blots/break":_.default,"blots/container":E.default,"blots/cursor":p.default,"blots/embed":g.default,"blots/inline":b.default,"blots/scroll":P.default,"blots/text":w.default,"modules/clipboard":k.default,"modules/history":R.default,"modules/keyboard":H.default}),o.default.register(v.default,_.default,p.default,b.default,P.default,w.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?f=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?f=document.createElement(u):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(u,f){var v=this.isolate(u,f);v.remove()},l.prototype.formatAt=function(u,f,v,S){var _=this.isolate(u,f);if(a.query(v,a.Scope.BLOT)!=null&&S)_.wrap(v,S);else if(a.query(v,a.Scope.ATTRIBUTE)!=null){var h=a.create(this.statics.scope);_.wrap(h),h.format(v,S)}},l.prototype.insertAt=function(u,f,v){var S=v==null?a.create("text",f):a.create(f,v),_=this.split(u);this.parent.insertBefore(S,_)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var v=null;u.children.insertBefore(this,f),f!=null&&(v=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=v)&&u.domNode.insertBefore(this.domNode,v),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var v=this.split(u);return v.split(f),v},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,f){var v=typeof u=="string"?a.create(u,f):u;return v.replace(this),v},l.prototype.split=function(u,f){return u===0?this:this.next},l.prototype.update=function(u,f){},l.prototype.wrap=function(u,f){var v=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(v,this.next),v.appendChild(this),v},l.blotName="abstract",l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),l=i(33),u=i(1),f=function(){function v(S){this.attributes={},this.domNode=S,this.build()}return v.prototype.attribute=function(S,_){_?S.add(this.domNode,_)&&(S.value(this.domNode)!=null?this.attributes[S.attrName]=S:delete this.attributes[S.attrName]):(S.remove(this.domNode),delete this.attributes[S.attrName])},v.prototype.build=function(){var S=this;this.attributes={};var _=a.default.keys(this.domNode),h=o.default.keys(this.domNode),E=l.default.keys(this.domNode);_.concat(h).concat(E).forEach(function(m){var p=u.query(m,u.Scope.ATTRIBUTE);p instanceof a.default&&(S.attributes[p.attrName]=p)})},v.prototype.copy=function(S){var _=this;Object.keys(this.attributes).forEach(function(h){var E=_.attributes[h].value(_.domNode);S.format(h,E)})},v.prototype.move=function(S){var _=this;this.copy(S),Object.keys(this.attributes).forEach(function(h){_.attributes[h].remove(_.domNode)}),this.attributes={}},v.prototype.values=function(){var S=this;return Object.keys(this.attributes).reduce(function(_,h){return _[h]=S.attributes[h].value(S.domNode),_},{})},v}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,v){var S=f.getAttribute("class")||"";return S.split(/\s+/).filter(function(_){return _.indexOf(v+"-")===0})}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(S){return(S.getAttribute("class")||"").split(/\s+/).map(function(_){return _.split("-").slice(0,-1).join("-")})},v.prototype.add=function(S,_){return this.canAdd(S,_)?(this.remove(S),S.classList.add(this.keyName+"-"+_),!0):!1},v.prototype.remove=function(S){var _=l(S,this.keyName);_.forEach(function(h){S.classList.remove(h)}),S.classList.length===0&&S.removeAttribute("class")},v.prototype.value=function(S){var _=l(S,this.keyName)[0]||"",h=_.slice(this.keyName.length+1);return this.canAdd(S,h)?h:""},v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var v=f.split("-"),S=v.slice(1).map(function(_){return _[0].toUpperCase()+_.slice(1)}).join("");return v[0]+S}var u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(S){return(S.getAttribute("style")||"").split(";").map(function(_){var h=_.split(":");return h[0].trim()})},v.prototype.add=function(S,_){return this.canAdd(S,_)?(S.style[l(this.keyName)]=_,!0):!1},v.prototype.remove=function(S){S.style[l(this.keyName)]="",S.getAttribute("style")||S.removeAttribute("style")},v.prototype.value=function(S){var _=S.style[l(this.keyName)];return this.canAdd(S,_)?_:""},v}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var S=0;S<v.length;S++){var _=v[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(f,_.key,_)}}return function(f,v,S){return v&&u(f.prototype,v),S&&u(f,S),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,v){o(this,u),this.quill=f,this.options=v,this.modules={}}return a(u,[{key:"init",value:function(){var v=this;Object.keys(this.options.modules).forEach(function(S){v.modules[S]==null&&v.addModule(S)})}},{key:"addModule",value:function(v){var S=this.quill.constructor.import("modules/"+v);return this.modules[v]=new S(this.quill,this.options.modules[v]||{}),this.modules[v]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(g,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,d,b){return d&&y(g.prototype,d),b&&y(g,b),g}}(),o=function y(g,d,b){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,d);if(O===void 0){var P=Object.getPrototypeOf(g);return P===null?void 0:y(P,d,b)}else{if("value"in O)return O.value;var x=O.get;return x===void 0?void 0:x.call(b)}},l=i(0),u=S(l),f=i(7),v=S(f);function S(y){return y&&y.__esModule?y:{default:y}}function _(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function h(y,g){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:y}function E(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);y.prototype=Object.create(g&&g.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(y,g):y.__proto__=g)}var m="\uFEFF",p=function(y){E(g,y);function g(d){_(this,g);var b=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,d));return b.contentNode=document.createElement("span"),b.contentNode.setAttribute("contenteditable",!1),[].slice.call(b.domNode.childNodes).forEach(function(O){b.contentNode.appendChild(O)}),b.leftGuard=document.createTextNode(m),b.rightGuard=document.createTextNode(m),b.domNode.appendChild(b.leftGuard),b.domNode.appendChild(b.contentNode),b.domNode.appendChild(b.rightGuard),b}return a(g,[{key:"index",value:function(b,O){return b===this.leftGuard?0:b===this.rightGuard?1:o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,b,O)}},{key:"restore",value:function(b){var O=void 0,P=void 0,x=b.data.split(m).join("");if(b===this.leftGuard)if(this.prev instanceof v.default){var w=this.prev.length();this.prev.insertAt(w,x),O={startNode:this.prev.domNode,startOffset:w+x.length}}else P=document.createTextNode(x),this.parent.insertBefore(u.default.create(P),this),O={startNode:P,startOffset:x.length};else b===this.rightGuard&&(this.next instanceof v.default?(this.next.insertAt(0,x),O={startNode:this.next.domNode,startOffset:x.length}):(P=document.createTextNode(x),this.parent.insertBefore(u.default.create(P),this.next),O={startNode:P,startOffset:x.length}));return b.data=m,O}},{key:"update",value:function(b,O){var P=this;b.forEach(function(x){if(x.type==="characterData"&&(x.target===P.leftGuard||x.target===P.rightGuard)){var w=P.restore(x.target);w&&(O.range=w)}})}}]),g}(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(_){return _&&_.__esModule?_:{default:_}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),v=new o.default.Attributor.Class("align","ql-align",u),S=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=v,n.AlignStyle=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),l=i(26);function u(S){return S&&S.__esModule?S:{default:S}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),v=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),v=new o.default.Attributor.Class("direction","ql-direction",u),S=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=v,n.DirectionStyle=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function y(g,d){for(var b=0;b<d.length;b++){var O=d[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,d,b){return d&&y(g.prototype,d),b&&y(g,b),g}}(),o=function y(g,d,b){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,d);if(O===void 0){var P=Object.getPrototypeOf(g);return P===null?void 0:y(P,d,b)}else{if("value"in O)return O.value;var x=O.get;return x===void 0?void 0:x.call(b)}},l=i(0),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function v(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function S(y,g){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:y}function _(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);y.prototype=Object.create(g&&g.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(y,g):y.__proto__=g)}var h={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},E=new u.default.Attributor.Class("font","ql-font",h),m=function(y){_(g,y);function g(){return v(this,g),S(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,[{key:"value",value:function(b){return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,b).replace(/["']/g,"")}}]),g}(u.default.Attributor.Style),p=new m("font","font-family",h);n.FontStyle=p,n.FontClass=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=l(a);function l(v){return v&&v.__esModule?v:{default:v}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(b,O){for(var P=0;P<O.length;P++){var x=O[P];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,O,P){return O&&d(b.prototype,O),P&&d(b,P),b}}(),o=i(0),l=_(o),u=i(5),f=_(u),v=i(9),S=_(v);function _(d){return d&&d.__esModule?d:{default:d}}function h(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}function E(d,b){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:d}function m(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);d.prototype=Object.create(b&&b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(d,b):d.__proto__=b)}var p=function(d){m(b,d);function b(O,P){h(this,b);var x=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,O,P));return x.lastRecorded=0,x.ignoreChange=!1,x.clear(),x.quill.on(f.default.events.EDITOR_CHANGE,function(w,T,k,A){w!==f.default.events.TEXT_CHANGE||x.ignoreChange||(!x.options.userOnly||A===f.default.sources.USER?x.record(T,k):x.transform(T))}),x.quill.keyboard.addBinding({key:"Z",shortKey:!0},x.undo.bind(x)),x.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},x.redo.bind(x)),/Win/i.test(navigator.platform)&&x.quill.keyboard.addBinding({key:"Y",shortKey:!0},x.redo.bind(x)),x}return a(b,[{key:"change",value:function(P,x){if(this.stack[P].length!==0){var w=this.stack[P].pop();this.stack[x].push(w),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(w[P],f.default.sources.USER),this.ignoreChange=!1;var T=g(w[P]);this.quill.setSelection(T)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(P,x){if(P.ops.length!==0){this.stack.redo=[];var w=this.quill.getContents().diff(x),T=Date.now();if(this.lastRecorded+this.options.delay>T&&this.stack.undo.length>0){var k=this.stack.undo.pop();w=w.compose(k.undo),P=k.redo.compose(P)}else this.lastRecorded=T;this.stack.undo.push({redo:P,undo:w}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(P){this.stack.undo.forEach(function(x){x.undo=P.transform(x.undo,!0),x.redo=P.transform(x.redo,!0)}),this.stack.redo.forEach(function(x){x.undo=P.transform(x.undo,!0),x.redo=P.transform(x.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),b}(S.default);p.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function y(d){var b=d.ops[d.ops.length-1];return b==null?!1:b.insert!=null?typeof b.insert=="string"&&b.insert.endsWith(`
|
|
145
|
+
`):b.attributes!=null?Object.keys(b.attributes).some(function(O){return l.default.query(O,l.default.Scope.BLOCK)!=null}):!1}function g(d){var b=d.reduce(function(P,x){return P+=x.delete||0,P},0),O=d.length()-b;return y(d)&&(O-=1),O}n.default=p,n.getLastChangeIndex=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function B(N,G){for(var K=0;K<G.length;K++){var q=G[K];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(N,q.key,q)}}return function(N,G,K){return G&&B(N.prototype,G),K&&B(N,K),N}}(),o=function B(N,G,K){N===null&&(N=Function.prototype);var q=Object.getOwnPropertyDescriptor(N,G);if(q===void 0){var z=Object.getPrototypeOf(N);return z===null?void 0:B(z,G,K)}else{if("value"in q)return q.value;var X=q.get;return X===void 0?void 0:X.call(K)}},l=i(3),u=T(l),f=i(2),v=T(f),S=i(8),_=T(S),h=i(23),E=T(h),m=i(34),p=T(m),y=i(59),g=T(y),d=i(60),b=T(d),O=i(28),P=T(O),x=i(61),w=T(x);function T(B){return B&&B.__esModule?B:{default:B}}function k(B,N){if(!(B instanceof N))throw new TypeError("Cannot call a class as a function")}function A(B,N){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:B}function R(B,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);B.prototype=Object.create(N&&N.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(B,N):B.__proto__=N)}var F=[!1,"center","right","justify"],H=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Y=[!1,"serif","monospace"],$=["1","2","3",!1],I=["small",!1,"large","huge"],U=function(B){R(N,B);function N(G,K){k(this,N);var q=A(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,G,K)),z=function X(Z){if(!document.body.contains(G.root))return document.body.removeEventListener("click",X);q.tooltip!=null&&!q.tooltip.root.contains(Z.target)&&document.activeElement!==q.tooltip.textbox&&!q.quill.hasFocus()&&q.tooltip.hide(),q.pickers!=null&&q.pickers.forEach(function(J){J.container.contains(Z.target)||J.close()})};return G.emitter.listenDOM("click",document.body,z),q}return a(N,[{key:"addModule",value:function(K){var q=o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar(q),q}},{key:"buildButtons",value:function(K,q){K.forEach(function(z){var X=z.getAttribute("class")||"";X.split(/\s+/).forEach(function(Z){if(Z.startsWith("ql-")&&(Z=Z.slice(3),q[Z]!=null))if(Z==="direction")z.innerHTML=q[Z][""]+q[Z].rtl;else if(typeof q[Z]=="string")z.innerHTML=q[Z];else{var J=z.value||"";J!=null&&q[Z][J]&&(z.innerHTML=q[Z][J])}})})}},{key:"buildPickers",value:function(K,q){var z=this;this.pickers=K.map(function(Z){if(Z.classList.contains("ql-align"))return Z.querySelector("option")==null&&j(Z,F),new b.default(Z,q.align);if(Z.classList.contains("ql-background")||Z.classList.contains("ql-color")){var J=Z.classList.contains("ql-background")?"background":"color";return Z.querySelector("option")==null&&j(Z,H,J==="background"?"#ffffff":"#000000"),new g.default(Z,q[J])}else return Z.querySelector("option")==null&&(Z.classList.contains("ql-font")?j(Z,Y):Z.classList.contains("ql-header")?j(Z,$):Z.classList.contains("ql-size")&&j(Z,I)),new P.default(Z)});var X=function(){z.pickers.forEach(function(J){J.update()})};this.quill.on(_.default.events.EDITOR_CHANGE,X)}}]),N}(p.default);U.DEFAULTS=(0,u.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var N=this,G=this.container.querySelector("input.ql-image[type=file]");G==null&&(G=document.createElement("input"),G.setAttribute("type","file"),G.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),G.classList.add("ql-image"),G.addEventListener("change",function(){if(G.files!=null&&G.files[0]!=null){var K=new FileReader;K.onload=function(q){var z=N.quill.getSelection(!0);N.quill.updateContents(new v.default().retain(z.index).delete(z.length).insert({image:q.target.result}),_.default.sources.USER),N.quill.setSelection(z.index+1,_.default.sources.SILENT),G.value=""},K.readAsDataURL(G.files[0])}}),this.container.appendChild(G)),G.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var W=function(B){R(N,B);function N(G,K){k(this,N);var q=A(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,G,K));return q.textbox=q.root.querySelector('input[type="text"]'),q.listen(),q}return a(N,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function(q){E.default.match(q,"enter")?(K.save(),q.preventDefault()):E.default.match(q,"escape")&&(K.cancel(),q.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),q!=null?this.textbox.value=q:K!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+K)||""),this.root.setAttribute("data-mode",K)}},{key:"restoreFocus",value:function(){var K=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=K}},{key:"save",value:function(){var K=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var q=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,_.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,_.default.sources.USER)),this.quill.root.scrollTop=q;break}case"video":K=M(K);case"formula":{if(!K)break;var z=this.quill.getSelection(!0);if(z!=null){var X=z.index+z.length;this.quill.insertEmbed(X,this.root.getAttribute("data-mode"),K,_.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(X+1," ",_.default.sources.USER),this.quill.setSelection(X+2,_.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),N}(w.default);function M(B){var N=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 N?(N[1]||"https")+"://www.youtube.com/embed/"+N[2]+"?showinfo=0":(N=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(N[1]||"https")+"://player.vimeo.com/video/"+N[2]+"/":B}function j(B,N){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;N.forEach(function(K){var q=document.createElement("option");K===G?q.setAttribute("selected","selected"):q.setAttribute("value",K),B.appendChild(q)})}n.BaseTooltip=W,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,f=this.iterator();u=f();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var u=0,f=this.head;f!=null;){if(f===l)return u;u+=f.length(),f=f.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var f,v=this.iterator();f=v();){var S=f.length();if(l<S||u&&l===S&&(f.next==null||f.next.length()!==0))return[f,l];l-=S}return[null,0]},o.prototype.forEach=function(l){for(var u,f=this.iterator();u=f();)l(u)},o.prototype.forEachAt=function(l,u,f){if(!(u<=0))for(var v=this.find(l),S=v[0],_=v[1],h,E=l-_,m=this.iterator(S);(h=m())&&E<l+u;){var p=h.length();l>E?f(h,l-E,Math.min(u,E+p-l)):f(h,0,Math.min(p,l+u-E)),E+=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,v=this.iterator();f=v();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,h){_.__proto__=h}||function(_,h){for(var E in h)h.hasOwnProperty(E)&&(_[E]=h[E])};return function(_,h){S(_,h);function E(){this.constructor=_}_.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,v=function(S){a(_,S);function _(h){var E=S.call(this,h)||this;return E.scroll=E,E.observer=new MutationObserver(function(m){E.update(m)}),E.observer.observe(E.domNode,u),E.attach(),E}return _.prototype.detach=function(){S.prototype.detach.call(this),this.observer.disconnect()},_.prototype.deleteAt=function(h,E){this.update(),h===0&&E===this.length()?this.children.forEach(function(m){m.remove()}):S.prototype.deleteAt.call(this,h,E)},_.prototype.formatAt=function(h,E,m,p){this.update(),S.prototype.formatAt.call(this,h,E,m,p)},_.prototype.insertAt=function(h,E,m){this.update(),S.prototype.insertAt.call(this,h,E,m)},_.prototype.optimize=function(h,E){var m=this;h===void 0&&(h=[]),E===void 0&&(E={}),S.prototype.optimize.call(this,E);for(var p=[].slice.call(this.observer.takeRecords());p.length>0;)h.push(p.pop());for(var y=function(O,P){P===void 0&&(P=!0),!(O==null||O===m)&&O.domNode.parentNode!=null&&(O.domNode[l.DATA_KEY].mutations==null&&(O.domNode[l.DATA_KEY].mutations=[]),P&&y(O.parent))},g=function(O){O.domNode[l.DATA_KEY]==null||O.domNode[l.DATA_KEY].mutations==null||(O instanceof o.default&&O.children.forEach(g),O.optimize(E))},d=h,b=0;d.length>0;b+=1){if(b>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(O){var P=l.find(O.target,!0);P!=null&&(P.domNode===O.target&&(O.type==="childList"?(y(l.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(x){var w=l.find(x,!1);y(w,!1),w instanceof o.default&&w.children.forEach(function(T){y(T,!1)})})):O.type==="attributes"&&y(P.prev)),y(P))}),this.children.forEach(g),d=[].slice.call(this.observer.takeRecords()),p=d.slice();p.length>0;)h.push(p.pop())}},_.prototype.update=function(h,E){var m=this;E===void 0&&(E={}),h=h||this.observer.takeRecords(),h.map(function(p){var y=l.find(p.target,!0);return y==null?null:y.domNode[l.DATA_KEY].mutations==null?(y.domNode[l.DATA_KEY].mutations=[p],y):(y.domNode[l.DATA_KEY].mutations.push(p),null)}).forEach(function(p){p==null||p===m||p.domNode[l.DATA_KEY]==null||p.update(p.domNode[l.DATA_KEY].mutations||[],E)}),this.domNode[l.DATA_KEY].mutations!=null&&S.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,E),this.optimize(h,E)},_.blotName="scroll",_.defaultChild="block",_.scope=l.Scope.BLOCK_BLOT,_.tagName="DIV",_}(o.default);n.default=v},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,_){S.__proto__=_}||function(S,_){for(var h in _)_.hasOwnProperty(h)&&(S[h]=_[h])};return function(S,_){v(S,_);function h(){this.constructor=S}S.prototype=_===null?Object.create(_):(h.prototype=_.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(v,S){if(Object.keys(v).length!==Object.keys(S).length)return!1;for(var _ in v)if(v[_]!==S[_])return!1;return!0}var f=function(v){a(S,v);function S(){return v!==null&&v.apply(this,arguments)||this}return S.formats=function(_){if(_.tagName!==S.tagName)return v.formats.call(this,_)},S.prototype.format=function(_,h){var E=this;_===this.statics.blotName&&!h?(this.children.forEach(function(m){m instanceof o.default||(m=m.wrap(S.blotName,!0)),E.attributes.copy(m)}),this.unwrap()):v.prototype.format.call(this,_,h)},S.prototype.formatAt=function(_,h,E,m){if(this.formats()[E]!=null||l.query(E,l.Scope.ATTRIBUTE)){var p=this.isolate(_,h);p.format(E,m)}else v.prototype.formatAt.call(this,_,h,E,m)},S.prototype.optimize=function(_){v.prototype.optimize.call(this,_);var h=this.formats();if(Object.keys(h).length===0)return this.unwrap();var E=this.next;E instanceof S&&E.prev===this&&u(h,E.formats())&&(E.moveChildren(this),E.remove())},S.blotName="inline",S.scope=l.Scope.INLINE_BLOT,S.tagName="SPAN",S}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.formats=function(S){var _=l.query(v.blotName).tagName;if(S.tagName!==_)return f.formats.call(this,S)},v.prototype.format=function(S,_){l.query(S,l.Scope.BLOCK)!=null&&(S===this.statics.blotName&&!_?this.replaceWith(v.blotName):f.prototype.format.call(this,S,_))},v.prototype.formatAt=function(S,_,h,E){l.query(h,l.Scope.BLOCK)!=null?this.format(h,E):f.prototype.formatAt.call(this,S,_,h,E)},v.prototype.insertAt=function(S,_,h){if(h==null||l.query(_,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,S,_,h);else{var E=this.split(S),m=l.create(_,h);E.parent.insertBefore(m,E)}},v.prototype.update=function(S,_){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,S,_)},v.blotName="block",v.scope=l.Scope.BLOCK_BLOT,v.tagName="P",v}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var S in v)v.hasOwnProperty(S)&&(f[S]=v[S])};return function(f,v){u(f,v);function S(){this.constructor=f}f.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(v){},f.prototype.format=function(v,S){u.prototype.formatAt.call(this,0,this.length(),v,S)},f.prototype.formatAt=function(v,S,_,h){v===0&&S===this.length()?this.format(_,h):u.prototype.formatAt.call(this,v,S,_,h)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,S){v.__proto__=S}||function(v,S){for(var _ in S)S.hasOwnProperty(_)&&(v[_]=S[_])};return function(v,S){f(v,S);function _(){this.constructor=v}v.prototype=S===null?Object.create(S):(_.prototype=S.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(v,f);function v(S){var _=f.call(this,S)||this;return _.text=_.statics.value(_.domNode),_}return v.create=function(S){return document.createTextNode(S)},v.value=function(S){var _=S.data;return _.normalize&&(_=_.normalize()),_},v.prototype.deleteAt=function(S,_){this.domNode.data=this.text=this.text.slice(0,S)+this.text.slice(S+_)},v.prototype.index=function(S,_){return this.domNode===S?_:-1},v.prototype.insertAt=function(S,_,h){h==null?(this.text=this.text.slice(0,S)+_+this.text.slice(S),this.domNode.data=this.text):f.prototype.insertAt.call(this,S,_,h)},v.prototype.length=function(){return this.text.length},v.prototype.optimize=function(S){f.prototype.optimize.call(this,S),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof v&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},v.prototype.position=function(S,_){return[this.domNode,S]},v.prototype.split=function(S,_){if(_===void 0&&(_=!1),!_){if(S===0)return this;if(S===this.length())return this.next}var h=l.create(this.domNode.splitText(S));return this.parent.insertBefore(h,this.next),this.text=this.statics.value(this.domNode),h},v.prototype.update=function(S,_){var h=this;S.some(function(E){return E.type==="characterData"&&E.target===h.domNode})&&(this.text=this.statics.value(this.domNode))},v.prototype.value=function(){return this.text},v.blotName="text",v.scope=l.Scope.INLINE_BLOT,v}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var f=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>f.length)&&(u=f.length),u-=l.length;var v=f.indexOf(l,u);return v!==-1&&v===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),v=f.length>>>0,S=arguments[1],_,h=0;h<v;h++)if(_=f[h],u.call(S,_,h,f))return _}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(b,O,P){if(b==O)return b?[[o,b]]:[];(P<0||b.length<P)&&(P=null);var x=S(b,O),w=b.substring(0,x);b=b.substring(x),O=O.substring(x),x=_(b,O);var T=b.substring(b.length-x);b=b.substring(0,b.length-x),O=O.substring(0,O.length-x);var k=u(b,O);return w&&k.unshift([o,w]),T&&k.push([o,T]),E(k),P!=null&&(k=y(k,P)),k=g(k),k}function u(b,O){var P;if(!b)return[[a,O]];if(!O)return[[i,b]];var x=b.length>O.length?b:O,w=b.length>O.length?O:b,T=x.indexOf(w);if(T!=-1)return P=[[a,x.substring(0,T)],[o,w],[a,x.substring(T+w.length)]],b.length>O.length&&(P[0][0]=P[2][0]=i),P;if(w.length==1)return[[i,b],[a,O]];var k=h(b,O);if(k){var A=k[0],R=k[1],F=k[2],H=k[3],Y=k[4],$=l(A,F),I=l(R,H);return $.concat([[o,Y]],I)}return f(b,O)}function f(b,O){for(var P=b.length,x=O.length,w=Math.ceil((P+x)/2),T=w,k=2*w,A=new Array(k),R=new Array(k),F=0;F<k;F++)A[F]=-1,R[F]=-1;A[T+1]=0,R[T+1]=0;for(var H=P-x,Y=H%2!=0,$=0,I=0,U=0,W=0,M=0;M<w;M++){for(var j=-M+$;j<=M-I;j+=2){var B=T+j,N;j==-M||j!=M&&A[B-1]<A[B+1]?N=A[B+1]:N=A[B-1]+1;for(var G=N-j;N<P&&G<x&&b.charAt(N)==O.charAt(G);)N++,G++;if(A[B]=N,N>P)I+=2;else if(G>x)$+=2;else if(Y){var K=T+H-j;if(K>=0&&K<k&&R[K]!=-1){var q=P-R[K];if(N>=q)return v(b,O,N,G)}}}for(var z=-M+U;z<=M-W;z+=2){var K=T+z,q;z==-M||z!=M&&R[K-1]<R[K+1]?q=R[K+1]:q=R[K-1]+1;for(var X=q-z;q<P&&X<x&&b.charAt(P-q-1)==O.charAt(x-X-1);)q++,X++;if(R[K]=q,q>P)W+=2;else if(X>x)U+=2;else if(!Y){var B=T+H-z;if(B>=0&&B<k&&A[B]!=-1){var N=A[B],G=T+N-B;if(q=P-q,N>=q)return v(b,O,N,G)}}}}return[[i,b],[a,O]]}function v(b,O,P,x){var w=b.substring(0,P),T=O.substring(0,x),k=b.substring(P),A=O.substring(x),R=l(w,T),F=l(k,A);return R.concat(F)}function S(b,O){if(!b||!O||b.charAt(0)!=O.charAt(0))return 0;for(var P=0,x=Math.min(b.length,O.length),w=x,T=0;P<w;)b.substring(T,w)==O.substring(T,w)?(P=w,T=P):x=w,w=Math.floor((x-P)/2+P);return w}function _(b,O){if(!b||!O||b.charAt(b.length-1)!=O.charAt(O.length-1))return 0;for(var P=0,x=Math.min(b.length,O.length),w=x,T=0;P<w;)b.substring(b.length-w,b.length-T)==O.substring(O.length-w,O.length-T)?(P=w,T=P):x=w,w=Math.floor((x-P)/2+P);return w}function h(b,O){var P=b.length>O.length?b:O,x=b.length>O.length?O:b;if(P.length<4||x.length*2<P.length)return null;function w(I,U,W){for(var M=I.substring(W,W+Math.floor(I.length/4)),j=-1,B="",N,G,K,q;(j=U.indexOf(M,j+1))!=-1;){var z=S(I.substring(W),U.substring(j)),X=_(I.substring(0,W),U.substring(0,j));B.length<X+z&&(B=U.substring(j-X,j)+U.substring(j,j+z),N=I.substring(0,W-X),G=I.substring(W+z),K=U.substring(0,j-X),q=U.substring(j+z))}return B.length*2>=I.length?[N,G,K,q,B]:null}var T=w(P,x,Math.ceil(P.length/4)),k=w(P,x,Math.ceil(P.length/2)),A;if(!T&&!k)return null;k?T?A=T[4].length>k[4].length?T:k:A=k:A=T;var R,F,H,Y;b.length>O.length?(R=A[0],F=A[1],H=A[2],Y=A[3]):(H=A[0],Y=A[1],R=A[2],F=A[3]);var $=A[4];return[R,F,H,Y,$]}function E(b){b.push([o,""]);for(var O=0,P=0,x=0,w="",T="",k;O<b.length;)switch(b[O][0]){case a:x++,T+=b[O][1],O++;break;case i:P++,w+=b[O][1],O++;break;case o:P+x>1?(P!==0&&x!==0&&(k=S(T,w),k!==0&&(O-P-x>0&&b[O-P-x-1][0]==o?b[O-P-x-1][1]+=T.substring(0,k):(b.splice(0,0,[o,T.substring(0,k)]),O++),T=T.substring(k),w=w.substring(k)),k=_(T,w),k!==0&&(b[O][1]=T.substring(T.length-k)+b[O][1],T=T.substring(0,T.length-k),w=w.substring(0,w.length-k))),P===0?b.splice(O-x,P+x,[a,T]):x===0?b.splice(O-P,P+x,[i,w]):b.splice(O-P-x,P+x,[i,w],[a,T]),O=O-P-x+(P?1:0)+(x?1:0)+1):O!==0&&b[O-1][0]==o?(b[O-1][1]+=b[O][1],b.splice(O,1)):O++,x=0,P=0,w="",T="";break}b[b.length-1][1]===""&&b.pop();var A=!1;for(O=1;O<b.length-1;)b[O-1][0]==o&&b[O+1][0]==o&&(b[O][1].substring(b[O][1].length-b[O-1][1].length)==b[O-1][1]?(b[O][1]=b[O-1][1]+b[O][1].substring(0,b[O][1].length-b[O-1][1].length),b[O+1][1]=b[O-1][1]+b[O+1][1],b.splice(O-1,1),A=!0):b[O][1].substring(0,b[O+1][1].length)==b[O+1][1]&&(b[O-1][1]+=b[O+1][1],b[O][1]=b[O][1].substring(b[O+1][1].length)+b[O+1][1],b.splice(O+1,1),A=!0)),O++;A&&E(b)}var m=l;m.INSERT=a,m.DELETE=i,m.EQUAL=o,r.exports=m;function p(b,O){if(O===0)return[o,b];for(var P=0,x=0;x<b.length;x++){var w=b[x];if(w[0]===i||w[0]===o){var T=P+w[1].length;if(O===T)return[x+1,b];if(O<T){b=b.slice();var k=O-P,A=[w[0],w[1].slice(0,k)],R=[w[0],w[1].slice(k)];return b.splice(x,1,A,R),[x+1,b]}else P=T}}throw new Error("cursor_pos is out of bounds!")}function y(b,O){var P=p(b,O),x=P[1],w=P[0],T=x[w],k=x[w+1];if(T==null)return b;if(T[0]!==o)return b;if(k!=null&&T[1]+k[1]===k[1]+T[1])return x.splice(w,2,k,T),d(x,w,2);if(k!=null&&k[1].indexOf(T[1])===0){x.splice(w,2,[k[0],T[1]],[0,T[1]]);var A=k[1].slice(T[1].length);return A.length>0&&x.splice(w+2,0,[k[0],A]),d(x,w,3)}else return b}function g(b){for(var O=!1,P=function(k){return k.charCodeAt(0)>=56320&&k.charCodeAt(0)<=57343},x=function(k){return k.charCodeAt(k.length-1)>=55296&&k.charCodeAt(k.length-1)<=56319},w=2;w<b.length;w+=1)b[w-2][0]===o&&x(b[w-2][1])&&b[w-1][0]===i&&P(b[w-1][1])&&b[w][0]===a&&P(b[w][1])&&(O=!0,b[w-1][1]=b[w-2][1].slice(-1)+b[w-1][1],b[w][1]=b[w-2][1].slice(-1)+b[w][1],b[w-2][1]=b[w-2][1].slice(0,-1));if(!O)return b;for(var T=[],w=0;w<b.length;w+=1)b[w][1].length>0&&T.push(b[w]);return T}function d(b,O,P){for(var x=O+P-1;x>=0&&x>=O-1;x--)if(x+1<b.length){var w=b[x],T=b[x+1];w[0]===T[1]&&b.splice(x,2,[w[0],w[1]+T[1]])}return b}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,v,S){this.fn=f,this.context=v,this.once=S||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var v=[],S,_;if(this._eventsCount===0)return v;for(_ in S=this._events)i.call(S,_)&&v.push(a?_.slice(1):_);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(S)):v},u.prototype.listeners=function(v,S){var _=a?a+v:v,h=this._events[_];if(S)return!!h;if(!h)return[];if(h.fn)return[h.fn];for(var E=0,m=h.length,p=new Array(m);E<m;E++)p[E]=h[E].fn;return p},u.prototype.emit=function(v,S,_,h,E,m){var p=a?a+v:v;if(!this._events[p])return!1;var y=this._events[p],g=arguments.length,d,b;if(y.fn){switch(y.once&&this.removeListener(v,y.fn,void 0,!0),g){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,S),!0;case 3:return y.fn.call(y.context,S,_),!0;case 4:return y.fn.call(y.context,S,_,h),!0;case 5:return y.fn.call(y.context,S,_,h,E),!0;case 6:return y.fn.call(y.context,S,_,h,E,m),!0}for(b=1,d=new Array(g-1);b<g;b++)d[b-1]=arguments[b];y.fn.apply(y.context,d)}else{var O=y.length,P;for(b=0;b<O;b++)switch(y[b].once&&this.removeListener(v,y[b].fn,void 0,!0),g){case 1:y[b].fn.call(y[b].context);break;case 2:y[b].fn.call(y[b].context,S);break;case 3:y[b].fn.call(y[b].context,S,_);break;case 4:y[b].fn.call(y[b].context,S,_,h);break;default:if(!d)for(P=1,d=new Array(g-1);P<g;P++)d[P-1]=arguments[P];y[b].fn.apply(y[b].context,d)}}return!0},u.prototype.on=function(v,S,_){var h=new l(S,_||this),E=a?a+v:v;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],h]:this._events[E].push(h):(this._events[E]=h,this._eventsCount++),this},u.prototype.once=function(v,S,_){var h=new l(S,_||this,!0),E=a?a+v:v;return this._events[E]?this._events[E].fn?this._events[E]=[this._events[E],h]:this._events[E].push(h):(this._events[E]=h,this._eventsCount++),this},u.prototype.removeListener=function(v,S,_,h){var E=a?a+v:v;if(!this._events[E])return this;if(!S)return--this._eventsCount===0?this._events=new o:delete this._events[E],this;var m=this._events[E];if(m.fn)m.fn===S&&(!h||m.once)&&(!_||m.context===_)&&(--this._eventsCount===0?this._events=new o:delete this._events[E]);else{for(var p=0,y=[],g=m.length;p<g;p++)(m[p].fn!==S||h&&!m[p].once||_&&m[p].context!==_)&&y.push(m[p]);y.length?this._events[E]=y.length===1?y[0]:y:--this._eventsCount===0?this._events=new o:delete this._events[E]}return this},u.prototype.removeAllListeners=function(v){var S;return v?(S=a?a+v:v,this._events[S]&&(--this._eventsCount===0?this._events=new o:delete this._events[S])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},o=function(){function ue(ie,_e){var Se=[],re=!0,ce=!1,ge=void 0;try{for(var me=ie[Symbol.iterator](),we;!(re=(we=me.next()).done)&&(Se.push(we.value),!(_e&&Se.length===_e));re=!0);}catch(Ee){ce=!0,ge=Ee}finally{try{!re&&me.return&&me.return()}finally{if(ce)throw ge}}return Se}return function(ie,_e){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return ue(ie,_e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function ue(ie,_e){for(var Se=0;Se<_e.length;Se++){var re=_e[Se];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(ie,re.key,re)}}return function(ie,_e,Se){return _e&&ue(ie.prototype,_e),Se&&ue(ie,Se),ie}}(),u=i(3),f=R(u),v=i(2),S=R(v),_=i(0),h=R(_),E=i(5),m=R(E),p=i(10),y=R(p),g=i(9),d=R(g),b=i(36),O=i(37),P=i(13),x=R(P),w=i(26),T=i(38),k=i(39),A=i(40);function R(ue){return ue&&ue.__esModule?ue:{default:ue}}function F(ue,ie,_e){return ie in ue?Object.defineProperty(ue,ie,{value:_e,enumerable:!0,configurable:!0,writable:!0}):ue[ie]=_e,ue}function H(ue,ie){if(!(ue instanceof ie))throw new TypeError("Cannot call a class as a function")}function Y(ue,ie){if(!ue)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie&&(typeof ie=="object"||typeof ie=="function")?ie:ue}function $(ue,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ie);ue.prototype=Object.create(ie&&ie.prototype,{constructor:{value:ue,enumerable:!1,writable:!0,configurable:!0}}),ie&&(Object.setPrototypeOf?Object.setPrototypeOf(ue,ie):ue.__proto__=ie)}var I=(0,y.default)("quill:clipboard"),U="__ql-matcher",W=[[Node.TEXT_NODE,Ie],[Node.TEXT_NODE,de],["br",te],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,J],[Node.ELEMENT_NODE,he],[Node.ELEMENT_NODE,Z],[Node.ELEMENT_NODE,ke],["li",se],["b",X.bind(X,"bold")],["i",X.bind(X,"italic")],["style",ee]],M=[b.AlignAttribute,T.DirectionAttribute].reduce(function(ue,ie){return ue[ie.keyName]=ie,ue},{}),j=[b.AlignStyle,O.BackgroundStyle,w.ColorStyle,T.DirectionStyle,k.FontStyle,A.SizeStyle].reduce(function(ue,ie){return ue[ie.keyName]=ie,ue},{}),B=function(ue){$(ie,ue);function ie(_e,Se){H(this,ie);var re=Y(this,(ie.__proto__||Object.getPrototypeOf(ie)).call(this,_e,Se));return re.quill.root.addEventListener("paste",re.onPaste.bind(re)),re.container=re.quill.addContainer("ql-clipboard"),re.container.setAttribute("contenteditable",!0),re.container.setAttribute("tabindex",-1),re.matchers=[],W.concat(re.options.matchers).forEach(function(ce){var ge=o(ce,2),me=ge[0],we=ge[1];!Se.matchVisual&&we===he||re.addMatcher(me,we)}),re}return l(ie,[{key:"addMatcher",value:function(Se,re){this.matchers.push([Se,re])}},{key:"convert",value:function(Se){if(typeof Se=="string")return this.container.innerHTML=Se.replace(/\>\r?\n +\</g,"><"),this.convert();var re=this.quill.getFormat(this.quill.selection.savedRange.index);if(re[x.default.blotName]){var ce=this.container.innerText;return this.container.innerHTML="",new S.default().insert(ce,F({},x.default.blotName,re[x.default.blotName]))}var ge=this.prepareMatching(),me=o(ge,2),we=me[0],Ee=me[1],Te=z(this.container,we,Ee);return K(Te,`
|
|
146
|
+
`)&&Te.ops[Te.ops.length-1].attributes==null&&(Te=Te.compose(new S.default().retain(Te.length()-1).delete(1))),I.log("convert",this.container.innerHTML,Te),this.container.innerHTML="",Te}},{key:"dangerouslyPasteHTML",value:function(Se,re){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;if(typeof Se=="string")this.quill.setContents(this.convert(Se),re),this.quill.setSelection(0,m.default.sources.SILENT);else{var ge=this.convert(re);this.quill.updateContents(new S.default().retain(Se).concat(ge),ce),this.quill.setSelection(Se+ge.length(),m.default.sources.SILENT)}}},{key:"onPaste",value:function(Se){var re=this;if(!(Se.defaultPrevented||!this.quill.isEnabled())){var ce=this.quill.getSelection(),ge=new S.default().retain(ce.index),me=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(m.default.sources.SILENT),setTimeout(function(){ge=ge.concat(re.convert()).delete(ce.length),re.quill.updateContents(ge,m.default.sources.USER),re.quill.setSelection(ge.length()-ce.length,m.default.sources.SILENT),re.quill.scrollingContainer.scrollTop=me,re.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Se=this,re=[],ce=[];return this.matchers.forEach(function(ge){var me=o(ge,2),we=me[0],Ee=me[1];switch(we){case Node.TEXT_NODE:ce.push(Ee);break;case Node.ELEMENT_NODE:re.push(Ee);break;default:[].forEach.call(Se.container.querySelectorAll(we),function(Te){Te[U]=Te[U]||[],Te[U].push(Ee)});break}}),[re,ce]}}]),ie}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function N(ue,ie,_e){return(typeof ie>"u"?"undefined":a(ie))==="object"?Object.keys(ie).reduce(function(Se,re){return N(Se,re,ie[re])},ue):ue.reduce(function(Se,re){return re.attributes&&re.attributes[ie]?Se.push(re):Se.insert(re.insert,(0,f.default)({},F({},ie,_e),re.attributes))},new S.default)}function G(ue){if(ue.nodeType!==Node.ELEMENT_NODE)return{};var ie="__ql-computed-style";return ue[ie]||(ue[ie]=window.getComputedStyle(ue))}function K(ue,ie){for(var _e="",Se=ue.ops.length-1;Se>=0&&_e.length<ie.length;--Se){var re=ue.ops[Se];if(typeof re.insert!="string")break;_e=re.insert+_e}return _e.slice(-1*ie.length)===ie}function q(ue){if(ue.childNodes.length===0)return!1;var ie=G(ue);return["block","list-item"].indexOf(ie.display)>-1}function z(ue,ie,_e){return ue.nodeType===ue.TEXT_NODE?_e.reduce(function(Se,re){return re(ue,Se)},new S.default):ue.nodeType===ue.ELEMENT_NODE?[].reduce.call(ue.childNodes||[],function(Se,re){var ce=z(re,ie,_e);return re.nodeType===ue.ELEMENT_NODE&&(ce=ie.reduce(function(ge,me){return me(re,ge)},ce),ce=(re[U]||[]).reduce(function(ge,me){return me(re,ge)},ce)),Se.concat(ce)},new S.default):new S.default}function X(ue,ie,_e){return N(_e,ue,!0)}function Z(ue,ie){var _e=h.default.Attributor.Attribute.keys(ue),Se=h.default.Attributor.Class.keys(ue),re=h.default.Attributor.Style.keys(ue),ce={};return _e.concat(Se).concat(re).forEach(function(ge){var me=h.default.query(ge,h.default.Scope.ATTRIBUTE);me!=null&&(ce[me.attrName]=me.value(ue),ce[me.attrName])||(me=M[ge],me!=null&&(me.attrName===ge||me.keyName===ge)&&(ce[me.attrName]=me.value(ue)||void 0),me=j[ge],me!=null&&(me.attrName===ge||me.keyName===ge)&&(me=j[ge],ce[me.attrName]=me.value(ue)||void 0))}),Object.keys(ce).length>0&&(ie=N(ie,ce)),ie}function J(ue,ie){var _e=h.default.query(ue);if(_e==null)return ie;if(_e.prototype instanceof h.default.Embed){var Se={},re=_e.value(ue);re!=null&&(Se[_e.blotName]=re,ie=new S.default().insert(Se,_e.formats(ue)))}else typeof _e.formats=="function"&&(ie=N(ie,_e.blotName,_e.formats(ue)));return ie}function te(ue,ie){return K(ie,`
|
|
147
|
+
`)||ie.insert(`
|
|
148
|
+
`),ie}function ee(){return new S.default}function se(ue,ie){var _e=h.default.query(ue);if(_e==null||_e.blotName!=="list-item"||!K(ie,`
|
|
149
|
+
`))return ie;for(var Se=-1,re=ue.parentNode;!re.classList.contains("ql-clipboard");)(h.default.query(re)||{}).blotName==="list"&&(Se+=1),re=re.parentNode;return Se<=0?ie:ie.compose(new S.default().retain(ie.length()-1).retain(1,{indent:Se}))}function de(ue,ie){return K(ie,`
|
|
150
|
+
`)||(q(ue)||ie.length()>0&&ue.nextSibling&&q(ue.nextSibling))&&ie.insert(`
|
|
151
|
+
`),ie}function he(ue,ie){if(q(ue)&&ue.nextElementSibling!=null&&!K(ie,`
|
|
152
|
+
|
|
153
|
+
`)){var _e=ue.offsetHeight+parseFloat(G(ue).marginTop)+parseFloat(G(ue).marginBottom);ue.nextElementSibling.offsetTop>ue.offsetTop+_e*1.5&&ie.insert(`
|
|
154
|
+
`)}return ie}function ke(ue,ie){var _e={},Se=ue.style||{};return Se.fontStyle&&G(ue).fontStyle==="italic"&&(_e.italic=!0),Se.fontWeight&&(G(ue).fontWeight.startsWith("bold")||parseInt(G(ue).fontWeight)>=700)&&(_e.bold=!0),Object.keys(_e).length>0&&(ie=N(ie,_e)),parseFloat(Se.textIndent||0)>0&&(ie=new S.default().insert(" ").concat(ie)),ie}function Ie(ue,ie){var _e=ue.data;if(ue.parentNode.tagName==="O:P")return ie.insert(_e.trim());if(_e.trim().length===0&&ue.parentNode.classList.contains("ql-clipboard"))return ie;if(!G(ue.parentNode).whiteSpace.startsWith("pre")){var Se=function(ce,ge){return ge=ge.replace(/[^\u00a0]/g,""),ge.length<1&&ce?" ":ge};_e=_e.replace(/\r\n/g," ").replace(/\n/g," "),_e=_e.replace(/\s\s+/g,Se.bind(Se,!0)),(ue.previousSibling==null&&q(ue.parentNode)||ue.previousSibling!=null&&q(ue.previousSibling))&&(_e=_e.replace(/^\s+/,Se.bind(Se,!1))),(ue.nextSibling==null&&q(ue.parentNode)||ue.nextSibling!=null&&q(ue.nextSibling))&&(_e=_e.replace(/\s+$/,Se.bind(Se,!1)))}return ie.insert(_e)}n.default=B,n.matchAttributor=Z,n.matchBlot=J,n.matchNewline=de,n.matchSpacing=he,n.matchText=Ie},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,p){for(var y=0;y<p.length;y++){var g=p[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,p,y){return p&&E(m.prototype,p),y&&E(m,y),m}}(),o=function E(m,p,y){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,p);if(g===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,p,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function _(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var h=function(E){_(m,E);function m(){return v(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"optimize",value:function(y){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,y),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),m}(u.default);h.blotName="bold",h.tagName=["STRONG","B"],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function A(R,F){var H=[],Y=!0,$=!1,I=void 0;try{for(var U=R[Symbol.iterator](),W;!(Y=(W=U.next()).done)&&(H.push(W.value),!(F&&H.length===F));Y=!0);}catch(M){$=!0,I=M}finally{try{!Y&&U.return&&U.return()}finally{if($)throw I}}return H}return function(R,F){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return A(R,F);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(R,F){for(var H=0;H<F.length;H++){var Y=F[H];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(R,Y.key,Y)}}return function(R,F,H){return F&&A(R.prototype,F),H&&A(R,H),R}}(),l=i(2),u=y(l),f=i(0),v=y(f),S=i(5),_=y(S),h=i(10),E=y(h),m=i(9),p=y(m);function y(A){return A&&A.__esModule?A:{default:A}}function g(A,R,F){return R in A?Object.defineProperty(A,R,{value:F,enumerable:!0,configurable:!0,writable:!0}):A[R]=F,A}function d(A,R){if(!(A instanceof R))throw new TypeError("Cannot call a class as a function")}function b(A,R){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:A}function O(A,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);A.prototype=Object.create(R&&R.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(A,R):A.__proto__=R)}var P=(0,E.default)("quill:toolbar"),x=function(A){O(R,A);function R(F,H){d(this,R);var Y=b(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,F,H));if(Array.isArray(Y.options.container)){var $=document.createElement("div");T($,Y.options.container),F.container.parentNode.insertBefore($,F.container),Y.container=$}else typeof Y.options.container=="string"?Y.container=document.querySelector(Y.options.container):Y.container=Y.options.container;if(!(Y.container instanceof HTMLElement)){var I;return I=P.error("Container required for toolbar",Y.options),b(Y,I)}return Y.container.classList.add("ql-toolbar"),Y.controls=[],Y.handlers={},Object.keys(Y.options.handlers).forEach(function(U){Y.addHandler(U,Y.options.handlers[U])}),[].forEach.call(Y.container.querySelectorAll("button, select"),function(U){Y.attach(U)}),Y.quill.on(_.default.events.EDITOR_CHANGE,function(U,W){U===_.default.events.SELECTION_CHANGE&&Y.update(W)}),Y.quill.on(_.default.events.SCROLL_OPTIMIZE,function(){var U=Y.quill.selection.getRange(),W=a(U,1),M=W[0];Y.update(M)}),Y}return o(R,[{key:"addHandler",value:function(H,Y){this.handlers[H]=Y}},{key:"attach",value:function(H){var Y=this,$=[].find.call(H.classList,function(U){return U.indexOf("ql-")===0});if($){if($=$.slice(3),H.tagName==="BUTTON"&&H.setAttribute("type","button"),this.handlers[$]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[$]==null){P.warn("ignoring attaching to disabled format",$,H);return}if(v.default.query($)==null){P.warn("ignoring attaching to nonexistent format",$,H);return}}var I=H.tagName==="SELECT"?"change":"click";H.addEventListener(I,function(U){var W=void 0;if(H.tagName==="SELECT"){if(H.selectedIndex<0)return;var M=H.options[H.selectedIndex];M.hasAttribute("selected")?W=!1:W=M.value||!1}else H.classList.contains("ql-active")?W=!1:W=H.value||!H.hasAttribute("value"),U.preventDefault();Y.quill.focus();var j=Y.quill.selection.getRange(),B=a(j,1),N=B[0];if(Y.handlers[$]!=null)Y.handlers[$].call(Y,W);else if(v.default.query($).prototype instanceof v.default.Embed){if(W=prompt("Enter "+$),!W)return;Y.quill.updateContents(new u.default().retain(N.index).delete(N.length).insert(g({},$,W)),_.default.sources.USER)}else Y.quill.format($,W,_.default.sources.USER);Y.update(N)}),this.controls.push([$,H])}}},{key:"update",value:function(H){var Y=H==null?{}:this.quill.getFormat(H);this.controls.forEach(function($){var I=a($,2),U=I[0],W=I[1];if(W.tagName==="SELECT"){var M=void 0;if(H==null)M=null;else if(Y[U]==null)M=W.querySelector("option[selected]");else if(!Array.isArray(Y[U])){var j=Y[U];typeof j=="string"&&(j=j.replace(/\"/g,'\\"')),M=W.querySelector('option[value="'+j+'"]')}M==null?(W.value="",W.selectedIndex=-1):M.selected=!0}else if(H==null)W.classList.remove("ql-active");else if(W.hasAttribute("value")){var B=Y[U]===W.getAttribute("value")||Y[U]!=null&&Y[U].toString()===W.getAttribute("value")||Y[U]==null&&!W.getAttribute("value");W.classList.toggle("ql-active",B)}else W.classList.toggle("ql-active",Y[U]!=null)})}}]),R}(p.default);x.DEFAULTS={};function w(A,R,F){var H=document.createElement("button");H.setAttribute("type","button"),H.classList.add("ql-"+R),F!=null&&(H.value=F),A.appendChild(H)}function T(A,R){Array.isArray(R[0])||(R=[R]),R.forEach(function(F){var H=document.createElement("span");H.classList.add("ql-formats"),F.forEach(function(Y){if(typeof Y=="string")w(H,Y);else{var $=Object.keys(Y)[0],I=Y[$];Array.isArray(I)?k(H,$,I):w(H,$,I)}}),A.appendChild(H)})}function k(A,R,F){var H=document.createElement("select");H.classList.add("ql-"+R),F.forEach(function(Y){var $=document.createElement("option");Y!==!1?$.setAttribute("value",Y):$.setAttribute("selected","selected"),H.appendChild($)}),A.appendChild(H)}x.DEFAULTS={container:null,handlers:{clean:function(){var R=this,F=this.quill.getSelection();if(F!=null)if(F.length==0){var H=this.quill.getFormat();Object.keys(H).forEach(function(Y){v.default.query(Y,v.default.Scope.INLINE)!=null&&R.quill.format(Y,!1)})}else this.quill.removeFormat(F,_.default.sources.USER)},direction:function(R){var F=this.quill.getFormat().align;R==="rtl"&&F==null?this.quill.format("align","right",_.default.sources.USER):!R&&F==="right"&&this.quill.format("align",!1,_.default.sources.USER),this.quill.format("direction",R,_.default.sources.USER)},indent:function(R){var F=this.quill.getSelection(),H=this.quill.getFormat(F),Y=parseInt(H.indent||0);if(R==="+1"||R==="-1"){var $=R==="+1"?1:-1;H.direction==="rtl"&&($*=-1),this.quill.format("indent",Y+$,_.default.sources.USER)}},link:function(R){R===!0&&(R=prompt("Enter link URL:")),this.quill.format("link",R,_.default.sources.USER)},list:function(R){var F=this.quill.getSelection(),H=this.quill.getFormat(F);R==="check"?H.list==="checked"||H.list==="unchecked"?this.quill.format("list",!1,_.default.sources.USER):this.quill.format("list","unchecked",_.default.sources.USER):this.quill.format("list",R,_.default.sources.USER)}}},n.default=x,n.addControls=T},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,p){for(var y=0;y<p.length;y++){var g=p[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,p,y){return p&&E(m.prototype,p),y&&E(m,y),m}}(),o=function E(m,p,y){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,p);if(g===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,p,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function _(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var h=function(E){_(m,E);function m(p,y){v(this,m);var g=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,p));return g.label.innerHTML=y,g.container.classList.add("ql-color-picker"),[].slice.call(g.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),g}return a(m,[{key:"buildItem",value:function(y){var g=o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"buildItem",this).call(this,y);return g.style.backgroundColor=y.getAttribute("value")||"",g}},{key:"selectItem",value:function(y,g){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,y,g);var d=this.label.querySelector(".ql-color-label"),b=y&&y.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=b:d.style.fill=b)}}]),m}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,p){for(var y=0;y<p.length;y++){var g=p[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,p,y){return p&&E(m.prototype,p),y&&E(m,y),m}}(),o=function E(m,p,y){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,p);if(g===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,p,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=i(28),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function _(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var h=function(E){_(m,E);function m(p,y){v(this,m);var g=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,p));return g.container.classList.add("ql-icon-picker"),[].forEach.call(g.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=y[d.getAttribute("data-value")||""]}),g.defaultItem=g.container.querySelector(".ql-selected"),g.selectItem(g.defaultItem),g}return a(m,[{key:"selectItem",value:function(y,g){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,y,g),y=y||this.defaultItem,this.label.innerHTML=y.innerHTML}}]),m}(u.default);n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,v){for(var S=0;S<v.length;S++){var _=v[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(f,_.key,_)}}return function(f,v,S){return v&&u(f.prototype,v),S&&u(f,S),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,v){var S=this;o(this,u),this.quill=f,this.boundsContainer=v||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){S.root.style.marginTop=-1*S.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(v){var S=v.left+v.width/2-this.root.offsetWidth/2,_=v.bottom+this.quill.root.scrollTop;this.root.style.left=S+"px",this.root.style.top=_+"px",this.root.classList.remove("ql-flip");var h=this.boundsContainer.getBoundingClientRect(),E=this.root.getBoundingClientRect(),m=0;if(E.right>h.right&&(m=h.right-E.right,this.root.style.left=S+m+"px"),E.left<h.left&&(m=h.left-E.left,this.root.style.left=S+m+"px"),E.bottom>h.bottom){var p=E.bottom-E.top,y=v.bottom-v.top+p;this.root.style.top=_-y+"px",this.root.classList.add("ql-flip")}return m}},{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 k(A,R){var F=[],H=!0,Y=!1,$=void 0;try{for(var I=A[Symbol.iterator](),U;!(H=(U=I.next()).done)&&(F.push(U.value),!(R&&F.length===R));H=!0);}catch(W){Y=!0,$=W}finally{try{!H&&I.return&&I.return()}finally{if(Y)throw $}}return F}return function(A,R){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return k(A,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function k(A,R,F){A===null&&(A=Function.prototype);var H=Object.getOwnPropertyDescriptor(A,R);if(H===void 0){var Y=Object.getPrototypeOf(A);return Y===null?void 0:k(Y,R,F)}else{if("value"in H)return H.value;var $=H.get;return $===void 0?void 0:$.call(F)}},l=function(){function k(A,R){for(var F=0;F<R.length;F++){var H=R[F];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(A,H.key,H)}}return function(A,R,F){return R&&k(A.prototype,R),F&&k(A,F),A}}(),u=i(3),f=d(u),v=i(8),S=d(v),_=i(43),h=d(_),E=i(27),m=d(E),p=i(15),y=i(41),g=d(y);function d(k){return k&&k.__esModule?k:{default:k}}function b(k,A){if(!(k instanceof A))throw new TypeError("Cannot call a class as a function")}function O(k,A){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:k}function P(k,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);k.prototype=Object.create(A&&A.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(k,A):k.__proto__=A)}var x=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],w=function(k){P(A,k);function A(R,F){b(this,A),F.modules.toolbar!=null&&F.modules.toolbar.container==null&&(F.modules.toolbar.container=x);var H=O(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R,F));return H.quill.container.classList.add("ql-snow"),H}return l(A,[{key:"extendToolbar",value:function(F){F.container.classList.add("ql-snow"),this.buildButtons([].slice.call(F.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(F.container.querySelectorAll("select")),g.default),this.tooltip=new T(this.quill,this.options.bounds),F.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(H,Y){F.handlers.link.call(F,!Y.format.link)})}}]),A}(h.default);w.DEFAULTS=(0,f.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){if(A){var R=this.quill.getSelection();if(R==null||R.length==0)return;var F=this.quill.getText(R);/^\S+@\S+\.\S+$/.test(F)&&F.indexOf("mailto:")!==0&&(F="mailto:"+F);var H=this.quill.theme.tooltip;H.edit("link",F)}else this.quill.format("link",!1)}}}}});var T=function(k){P(A,k);function A(R,F){b(this,A);var H=O(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R,F));return H.preview=H.root.querySelector("a.ql-preview"),H}return l(A,[{key:"listen",value:function(){var F=this;o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(H){F.root.classList.contains("ql-editing")?F.save():F.edit("link",F.preview.textContent),H.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(H){if(F.linkRange!=null){var Y=F.linkRange;F.restoreFocus(),F.quill.formatText(Y,"link",!1,S.default.sources.USER),delete F.linkRange}H.preventDefault(),F.hide()}),this.quill.on(S.default.events.SELECTION_CHANGE,function(H,Y,$){if(H!=null){if(H.length===0&&$===S.default.sources.USER){var I=F.quill.scroll.descendant(m.default,H.index),U=a(I,2),W=U[0],M=U[1];if(W!=null){F.linkRange=new p.Range(H.index-M,W.length());var j=m.default.formats(W.domNode);F.preview.textContent=j,F.preview.setAttribute("href",j),F.show(),F.position(F.quill.getBounds(F.linkRange));return}}else delete F.linkRange;F.hide()}})}},{key:"show",value:function(){o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),A}(_.BaseTooltip);T.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=re(a),l=i(36),u=i(38),f=i(64),v=i(65),S=re(v),_=i(66),h=re(_),E=i(67),m=re(E),p=i(37),y=i(26),g=i(39),d=i(40),b=i(56),O=re(b),P=i(68),x=re(P),w=i(27),T=re(w),k=i(69),A=re(k),R=i(70),F=re(R),H=i(71),Y=re(H),$=i(72),I=re($),U=i(73),W=re(U),M=i(13),j=re(M),B=i(74),N=re(B),G=i(75),K=re(G),q=i(57),z=re(q),X=i(41),Z=re(X),J=i(28),te=re(J),ee=i(59),se=re(ee),de=i(60),he=re(de),ke=i(61),Ie=re(ke),ue=i(108),ie=re(ue),_e=i(62),Se=re(_e);function re(ce){return ce&&ce.__esModule?ce:{default:ce}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":p.BackgroundClass,"attributors/class/color":y.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":g.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":p.BackgroundStyle,"attributors/style/color":y.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":g.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":y.ColorStyle,"formats/font":g.FontClass,"formats/size":d.SizeClass,"formats/blockquote":S.default,"formats/code-block":j.default,"formats/header":h.default,"formats/list":m.default,"formats/bold":O.default,"formats/code":M.Code,"formats/italic":x.default,"formats/link":T.default,"formats/script":A.default,"formats/strike":F.default,"formats/underline":Y.default,"formats/image":I.default,"formats/video":W.default,"formats/list/item":E.ListItem,"modules/formula":N.default,"modules/syntax":K.default,"modules/toolbar":z.default,"themes/bubble":ie.default,"themes/snow":Se.default,"ui/icons":Z.default,"ui/picker":te.default,"ui/icon-picker":he.default,"ui/color-picker":se.default,"ui/tooltip":Ie.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function m(p,y){for(var g=0;g<y.length;g++){var d=y[g];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}return function(p,y,g){return y&&m(p.prototype,y),g&&m(p,g),p}}(),o=function m(p,y,g){p===null&&(p=Function.prototype);var d=Object.getOwnPropertyDescriptor(p,y);if(d===void 0){var b=Object.getPrototypeOf(p);return b===null?void 0:m(b,y,g)}else{if("value"in d)return d.value;var O=d.get;return O===void 0?void 0:O.call(g)}},l=i(0),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}function v(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function S(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function _(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var h=function(m){_(p,m);function p(){return v(this,p),S(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return a(p,[{key:"add",value:function(g,d){if(d==="+1"||d==="-1"){var b=this.value(g)||0;d=d==="+1"?b+1:b-1}return d===0?(this.remove(g),!0):o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"add",this).call(this,g,d)}},{key:"canAdd",value:function(g,d){return o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"canAdd",this).call(this,g,d)||o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"canAdd",this).call(this,g,parseInt(d))}},{key:"value",value:function(g){return parseInt(o(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,g))||void 0}}]),p}(u.default.Attributor.Class),E=new h("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function v(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){v(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="blockquote",S.tagName="blockquote",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function h(E,m){for(var p=0;p<m.length;p++){var y=m[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}return function(E,m,p){return m&&h(E.prototype,m),p&&h(E,p),E}}(),o=i(4),l=u(o);function u(h){return h&&h.__esModule?h:{default:h}}function f(h,E){if(!(h instanceof E))throw new TypeError("Cannot call a class as a function")}function v(h,E){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:h}function S(h,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);h.prototype=Object.create(E&&E.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(h,E):h.__proto__=E)}var _=function(h){S(E,h);function E(){return f(this,E),v(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"formats",value:function(p){return this.tagName.indexOf(p.tagName)+1}}]),E}(l.default);_.blotName="header",_.tagName=["H1","H2","H3","H4","H5","H6"],n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function b(O,P){for(var x=0;x<P.length;x++){var w=P[x];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(O,w.key,w)}}return function(O,P,x){return P&&b(O.prototype,P),x&&b(O,x),O}}(),o=function b(O,P,x){O===null&&(O=Function.prototype);var w=Object.getOwnPropertyDescriptor(O,P);if(w===void 0){var T=Object.getPrototypeOf(O);return T===null?void 0:b(T,P,x)}else{if("value"in w)return w.value;var k=w.get;return k===void 0?void 0:k.call(x)}},l=i(0),u=h(l),f=i(4),v=h(f),S=i(25),_=h(S);function h(b){return b&&b.__esModule?b:{default:b}}function E(b,O,P){return O in b?Object.defineProperty(b,O,{value:P,enumerable:!0,configurable:!0,writable:!0}):b[O]=P,b}function m(b,O){if(!(b instanceof O))throw new TypeError("Cannot call a class as a function")}function p(b,O){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:b}function y(b,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);b.prototype=Object.create(O&&O.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(b,O):b.__proto__=O)}var g=function(b){y(O,b);function O(){return m(this,O),p(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"format",value:function(x,w){x===d.blotName&&!w?this.replaceWith(u.default.create(this.statics.scope)):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,x,w)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(x,w){return this.parent.isolate(this.offset(this.parent),this.length()),x===this.parent.statics.blotName?(this.parent.replaceWith(x,w),this):(this.parent.unwrap(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,x,w))}}],[{key:"formats",value:function(x){return x.tagName===this.tagName?void 0:o(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,x)}}]),O}(v.default);g.blotName="list-item",g.tagName="LI";var d=function(b){y(O,b),a(O,null,[{key:"create",value:function(x){var w=x==="ordered"?"OL":"UL",T=o(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,w);return(x==="checked"||x==="unchecked")&&T.setAttribute("data-checked",x==="checked"),T}},{key:"formats",value:function(x){if(x.tagName==="OL")return"ordered";if(x.tagName==="UL")return x.hasAttribute("data-checked")?x.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function O(P){m(this,O);var x=p(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,P)),w=function(k){if(k.target.parentNode===P){var A=x.statics.formats(P),R=u.default.find(k.target);A==="checked"?R.format("list","unchecked"):A==="unchecked"&&R.format("list","checked")}};return P.addEventListener("touchstart",w),P.addEventListener("mousedown",w),x}return a(O,[{key:"format",value:function(x,w){this.children.length>0&&this.children.tail.format(x,w)}},{key:"formats",value:function(){return E({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(x,w){if(x instanceof g)o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,x,w);else{var T=w==null?this.length():w.offset(this),k=this.split(T);k.parent.insertBefore(x,k)}}},{key:"optimize",value:function(x){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,x);var w=this.next;w!=null&&w.prev===this&&w.statics.blotName===this.statics.blotName&&w.domNode.tagName===this.domNode.tagName&&w.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(w.moveChildren(this),w.remove())}},{key:"replace",value:function(x){if(x.statics.blotName!==this.statics.blotName){var w=u.default.create(this.statics.defaultChild);x.moveChildren(w),this.appendChild(w)}o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,x)}}]),O}(_.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[g],n.ListItem=g,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function v(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){v(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="italic",S.tagName=["EM","I"],n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(m,p){for(var y=0;y<p.length;y++){var g=p[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}return function(m,p,y){return p&&E(m.prototype,p),y&&E(m,y),m}}(),o=function E(m,p,y){m===null&&(m=Function.prototype);var g=Object.getOwnPropertyDescriptor(m,p);if(g===void 0){var d=Object.getPrototypeOf(m);return d===null?void 0:E(d,p,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=i(6),u=f(l);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function S(E,m){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:E}function _(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(E,m):E.__proto__=m)}var h=function(E){_(m,E);function m(){return v(this,m),S(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,null,[{key:"create",value:function(y){return y==="super"?document.createElement("sup"):y==="sub"?document.createElement("sub"):o(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,y)}},{key:"formats",value:function(y){if(y.tagName==="SUB")return"sub";if(y.tagName==="SUP")return"super"}}]),m}(u.default);h.blotName="script",h.tagName=["SUB","SUP"],n.default=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function v(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){v(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="strike",S.tagName="S",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(_){return _&&_.__esModule?_:{default:_}}function u(_,h){if(!(_ instanceof h))throw new TypeError("Cannot call a class as a function")}function f(_,h){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:_}function v(_,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);_.prototype=Object.create(h&&h.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(_,h):_.__proto__=h)}var S=function(_){v(h,_);function h(){return u(this,h),f(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return h}(o.default);S.blotName="underline",S.tagName="U",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(y,g){for(var d=0;d<g.length;d++){var b=g[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,d){return g&&p(y.prototype,g),d&&p(y,d),y}}(),o=function p(y,g,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:p(O,g,d)}else{if("value"in b)return b.value;var P=b.get;return P===void 0?void 0:P.call(d)}},l=i(0),u=v(l),f=i(27);function v(p){return p&&p.__esModule?p:{default:p}}function S(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function _(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function h(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var E=["alt","height","width"],m=function(p){h(y,p);function y(){return S(this,y),_(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(d,b){E.indexOf(d)>-1?b?this.domNode.setAttribute(d,b):this.domNode.removeAttribute(d):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,d,b)}}],[{key:"create",value:function(d){var b=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,d);return typeof d=="string"&&b.setAttribute("src",this.sanitize(d)),b}},{key:"formats",value:function(d){return E.reduce(function(b,O){return d.hasAttribute(O)&&(b[O]=d.getAttribute(O)),b},{})}},{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")}}]),y}(u.default.Embed);m.blotName="image",m.tagName="IMG",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(y,g){for(var d=0;d<g.length;d++){var b=g[d];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,d){return g&&p(y.prototype,g),d&&p(y,d),y}}(),o=function p(y,g,d){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:p(O,g,d)}else{if("value"in b)return b.value;var P=b.get;return P===void 0?void 0:P.call(d)}},l=i(4),u=i(27),f=v(u);function v(p){return p&&p.__esModule?p:{default:p}}function S(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function _(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function h(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var E=["height","width"],m=function(p){h(y,p);function y(){return S(this,y),_(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(d,b){E.indexOf(d)>-1?b?this.domNode.setAttribute(d,b):this.domNode.removeAttribute(d):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,d,b)}}],[{key:"create",value:function(d){var b=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,d);return b.setAttribute("frameborder","0"),b.setAttribute("allowfullscreen",!0),b.setAttribute("src",this.sanitize(d)),b}},{key:"formats",value:function(d){return E.reduce(function(b,O){return d.hasAttribute(O)&&(b[O]=d.getAttribute(O)),b},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),y}(l.BlockEmbed);m.blotName="video",m.className="ql-video",m.tagName="IFRAME",n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(b,O){for(var P=0;P<O.length;P++){var x=O[P];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,O,P){return O&&d(b.prototype,O),P&&d(b,P),b}}(),o=function d(b,O,P){b===null&&(b=Function.prototype);var x=Object.getOwnPropertyDescriptor(b,O);if(x===void 0){var w=Object.getPrototypeOf(b);return w===null?void 0:d(w,O,P)}else{if("value"in x)return x.value;var T=x.get;return T===void 0?void 0:T.call(P)}},l=i(35),u=h(l),f=i(5),v=h(f),S=i(9),_=h(S);function h(d){return d&&d.__esModule?d:{default:d}}function E(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}function m(d,b){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:d}function p(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);d.prototype=Object.create(b&&b.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(d,b):d.__proto__=b)}var y=function(d){p(b,d);function b(){return E(this,b),m(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"create",value:function(P){var x=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,P);return typeof P=="string"&&(window.katex.render(P,x,{throwOnError:!1,errorColor:"#f00"}),x.setAttribute("data-value",P)),x}},{key:"value",value:function(P){return P.getAttribute("data-value")}}]),b}(u.default);y.blotName="formula",y.className="ql-formula",y.tagName="SPAN";var g=function(d){p(b,d),a(b,null,[{key:"register",value:function(){v.default.register(y,!0)}}]);function b(){E(this,b);var O=m(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return b}(_.default);n.FormulaBlot=y,n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function P(x,w){for(var T=0;T<w.length;T++){var k=w[T];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,w,T){return w&&P(x.prototype,w),T&&P(x,T),x}}(),o=function P(x,w,T){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,w);if(k===void 0){var A=Object.getPrototypeOf(x);return A===null?void 0:P(A,w,T)}else{if("value"in k)return k.value;var R=k.get;return R===void 0?void 0:R.call(T)}},l=i(0),u=m(l),f=i(5),v=m(f),S=i(9),_=m(S),h=i(13),E=m(h);function m(P){return P&&P.__esModule?P:{default:P}}function p(P,x){if(!(P instanceof x))throw new TypeError("Cannot call a class as a function")}function y(P,x){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:P}function g(P,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);P.prototype=Object.create(x&&x.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(P,x):P.__proto__=x)}var d=function(P){g(x,P);function x(){return p(this,x),y(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"replaceWith",value:function(T){this.domNode.textContent=this.domNode.textContent,this.attach(),o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,T)}},{key:"highlight",value:function(T){var k=this.domNode.textContent;this.cachedText!==k&&((k.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=T(k),this.domNode.normalize(),this.attach()),this.cachedText=k)}}]),x}(E.default);d.className="ql-syntax";var b=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),O=function(P){g(x,P),a(x,null,[{key:"register",value:function(){v.default.register(b,!0),v.default.register(d,!0)}}]);function x(w,T){p(this,x);var k=y(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,w,T));if(typeof k.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return k.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){k.highlight(),A=null},k.options.interval)}),k.highlight(),k}return a(x,[{key:"highlight",value:function(){var T=this;if(!this.quill.selection.composing){this.quill.update(v.default.sources.USER);var k=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(A){A.highlight(T.options.highlight)}),this.quill.update(v.default.sources.SILENT),k!=null&&this.quill.setSelection(k,v.default.sources.SILENT)}}}]),x}(_.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(P){var x=window.hljs.highlightAuto(P);return x.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=b,n.default=O},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function x(w,T,k){w===null&&(w=Function.prototype);var A=Object.getOwnPropertyDescriptor(w,T);if(A===void 0){var R=Object.getPrototypeOf(w);return R===null?void 0:x(R,T,k)}else{if("value"in A)return A.value;var F=A.get;return F===void 0?void 0:F.call(k)}},o=function(){function x(w,T){for(var k=0;k<T.length;k++){var A=T[k];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(w,A.key,A)}}return function(w,T,k){return T&&x(w.prototype,T),k&&x(w,k),w}}(),l=i(3),u=p(l),f=i(8),v=p(f),S=i(43),_=p(S),h=i(15),E=i(41),m=p(E);function p(x){return x&&x.__esModule?x:{default:x}}function y(x,w){if(!(x instanceof w))throw new TypeError("Cannot call a class as a function")}function g(x,w){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:x}function d(x,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);x.prototype=Object.create(w&&w.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(x,w):x.__proto__=w)}var b=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(x){d(w,x);function w(T,k){y(this,w),k.modules.toolbar!=null&&k.modules.toolbar.container==null&&(k.modules.toolbar.container=b);var A=g(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,T,k));return A.quill.container.classList.add("ql-bubble"),A}return o(w,[{key:"extendToolbar",value:function(k){this.tooltip=new P(this.quill,this.options.bounds),this.tooltip.root.appendChild(k.container),this.buildButtons([].slice.call(k.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(k.container.querySelectorAll("select")),m.default)}}]),w}(_.default);O.DEFAULTS=(0,u.default)(!0,{},_.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(w){w?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var P=function(x){d(w,x);function w(T,k){y(this,w);var A=g(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,T,k));return A.quill.on(v.default.events.EDITOR_CHANGE,function(R,F,H,Y){if(R===v.default.events.SELECTION_CHANGE)if(F!=null&&F.length>0&&Y===v.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var $=A.quill.getLines(F.index,F.length);if($.length===1)A.position(A.quill.getBounds(F));else{var I=$[$.length-1],U=A.quill.getIndex(I),W=Math.min(I.length()-1,F.index+F.length-U),M=A.quill.getBounds(new h.Range(U,W));A.position(M)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return o(w,[{key:"listen",value:function(){var k=this;a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){k.root.classList.remove("ql-editing")}),this.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!k.root.classList.contains("ql-hidden")){var A=k.quill.getSelection();A!=null&&k.position(k.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(k){var A=a(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"position",this).call(this,k),R=this.root.querySelector(".ql-tooltip-arrow");if(R.style.marginLeft="",A===0)return A;R.style.marginLeft=-1*A-R.offsetWidth/2+"px"}}]),w}(S.BaseTooltip);P.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=P,n.default=O},function(r,n,i){r.exports=i(63)}]).default})})(A7);var XI=A7.exports,R7={},M7={exports:{}},jo={},Tu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Tu.exports;var h4;function ZI(){return h4||(h4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof be=="object"&&be;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,v=26,S=38,_=700,h=72,E=128,m="-",p=/^xn--/,y=/[^\x20-\x7E]/,g=/[\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"},b=u-f,O=Math.floor,P=String.fromCharCode,x;function w(M){throw new RangeError(d[M])}function T(M,j){for(var B=M.length,N=[];B--;)N[B]=j(M[B]);return N}function k(M,j){var B=M.split("@"),N="";B.length>1&&(N=B[0]+"@",M=B[1]),M=M.replace(g,".");var G=M.split("."),K=T(G,j).join(".");return N+K}function A(M){for(var j=[],B=0,N=M.length,G,K;B<N;)G=M.charCodeAt(B++),G>=55296&&G<=56319&&B<N?(K=M.charCodeAt(B++),(K&64512)==56320?j.push(((G&1023)<<10)+(K&1023)+65536):(j.push(G),B--)):j.push(G);return j}function R(M){return T(M,function(j){var B="";return j>65535&&(j-=65536,B+=P(j>>>10&1023|55296),j=56320|j&1023),B+=P(j),B}).join("")}function F(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:u}function H(M,j){return M+22+75*(M<26)-((j!=0)<<5)}function Y(M,j,B){var N=0;for(M=B?O(M/_):M>>1,M+=O(M/j);M>b*v>>1;N+=u)M=O(M/b);return O(N+(b+1)*M/(M+S))}function $(M){var j=[],B=M.length,N,G=0,K=E,q=h,z,X,Z,J,te,ee,se,de,he;for(z=M.lastIndexOf(m),z<0&&(z=0),X=0;X<z;++X)M.charCodeAt(X)>=128&&w("not-basic"),j.push(M.charCodeAt(X));for(Z=z>0?z+1:0;Z<B;){for(J=G,te=1,ee=u;Z>=B&&w("invalid-input"),se=F(M.charCodeAt(Z++)),(se>=u||se>O((l-G)/te))&&w("overflow"),G+=se*te,de=ee<=q?f:ee>=q+v?v:ee-q,!(se<de);ee+=u)he=u-de,te>O(l/he)&&w("overflow"),te*=he;N=j.length+1,q=Y(G-J,N,J==0),O(G/N)>l-K&&w("overflow"),K+=O(G/N),G%=N,j.splice(G++,0,K)}return R(j)}function I(M){var j,B,N,G,K,q,z,X,Z,J,te,ee=[],se,de,he,ke;for(M=A(M),se=M.length,j=E,B=0,K=h,q=0;q<se;++q)te=M[q],te<128&&ee.push(P(te));for(N=G=ee.length,G&&ee.push(m);N<se;){for(z=l,q=0;q<se;++q)te=M[q],te>=j&&te<z&&(z=te);for(de=N+1,z-j>O((l-B)/de)&&w("overflow"),B+=(z-j)*de,j=z,q=0;q<se;++q)if(te=M[q],te<j&&++B>l&&w("overflow"),te==j){for(X=B,Z=u;J=Z<=K?f:Z>=K+v?v:Z-K,!(X<J);Z+=u)ke=X-J,he=u-J,ee.push(P(H(J+ke%he,0))),X=O(ke/he);ee.push(P(H(X,0))),K=Y(B,de,N==G),B=0,++N}++B,++j}return ee.join("")}function U(M){return k(M,function(j){return p.test(j)?$(j.slice(4).toLowerCase()):j})}function W(M){return k(M,function(j){return y.test(j)?"xn--"+I(j):j})}if(o={version:"1.4.1",ucs2:{decode:A,encode:R},decode:$,encode:I,toASCII:W,toUnicode:U},n&&i)if(e.exports==n)i.exports=o;else for(x in o)o.hasOwnProperty(x)&&(n[x]=o[x]);else r.punycode=o})(be)}(Tu,Tu.exports)),Tu.exports}var W1,p4;function QI(){return p4||(p4=1,W1=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}),W1}var Y1,g4;function JI(){if(g4)return Y1;g4=1;var e=typeof Symbol<"u"&&Symbol,t=QI();return Y1=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Y1}var K1,v4;function ej(){if(v4)return K1;v4=1;var e={foo:{}},t=Object;return K1=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof t)},K1}var X1,m4;function tj(){if(m4)return X1;m4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var v=[],S=0;S<u.length;S+=1)v[S]=u[S];for(var _=0;_<f.length;_+=1)v[_+u.length]=f[_];return v},a=function(u,f){for(var v=[],S=f||0,_=0;S<u.length;S+=1,_+=1)v[_]=u[S];return v},o=function(l,u){for(var f="",v=0;v<l.length;v+=1)f+=l[v],v+1<l.length&&(f+=u);return f};return X1=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var v=a(arguments,1),S,_=function(){if(this instanceof S){var y=f.apply(this,i(v,arguments));return Object(y)===y?y:this}return f.apply(u,i(v,arguments))},h=r(0,f.length-v.length),E=[],m=0;m<h;m++)E[m]="$"+m;if(S=Function("binder","return function ("+o(E,",")+"){ return binder.apply(this,arguments); }")(_),f.prototype){var p=function(){};p.prototype=f.prototype,S.prototype=new p,p.prototype=null}return S},X1}var Z1,y4;function Wy(){if(y4)return Z1;y4=1;var e=tj();return Z1=Function.prototype.bind||e,Z1}var Q1,b4;function rj(){if(b4)return Q1;b4=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Wy();return Q1=r.call(e,t),Q1}var J1,_4;function El(){if(_4)return J1;_4=1;var e,t=SyntaxError,r=Function,n=TypeError,i=function(R){try{return r('"use strict"; return ('+R+").constructor;")()}catch{}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var o=function(){throw new n},l=a?function(){try{return arguments.callee,o}catch{try{return a(arguments,"callee").get}catch{return o}}}():o,u=JI()(),f=ej()(),v=Object.getPrototypeOf||(f?function(R){return R.__proto__}:null),S={},_=typeof Uint8Array>"u"||!v?e:v(Uint8Array),h={"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":u&&v?v([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":S,"%AsyncGenerator%":S,"%AsyncGeneratorFunction%":S,"%AsyncIteratorPrototype%":S,"%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%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":r,"%GeneratorFunction%":S,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u&&v?v(v([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!u||!v?e:v(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%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!u||!v?e:v(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u&&v?v(""[Symbol.iterator]()):e,"%Symbol%":u?Symbol:e,"%SyntaxError%":t,"%ThrowTypeError%":l,"%TypedArray%":_,"%TypeError%":n,"%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%":URIError,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(v)try{null.error}catch(R){var E=v(v(R));h["%Error.prototype%"]=E}var m=function R(F){var H;if(F==="%AsyncFunction%")H=i("async function () {}");else if(F==="%GeneratorFunction%")H=i("function* () {}");else if(F==="%AsyncGeneratorFunction%")H=i("async function* () {}");else if(F==="%AsyncGenerator%"){var Y=R("%AsyncGeneratorFunction%");Y&&(H=Y.prototype)}else if(F==="%AsyncIteratorPrototype%"){var $=R("%AsyncGenerator%");$&&v&&(H=v($.prototype))}return h[F]=H,H},p={"%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"]},y=Wy(),g=rj(),d=y.call(Function.call,Array.prototype.concat),b=y.call(Function.apply,Array.prototype.splice),O=y.call(Function.call,String.prototype.replace),P=y.call(Function.call,String.prototype.slice),x=y.call(Function.call,RegExp.prototype.exec),w=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,k=function(F){var H=P(F,0,1),Y=P(F,-1);if(H==="%"&&Y!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&H!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var $=[];return O(F,w,function(I,U,W,M){$[$.length]=W?O(M,T,"$1"):U||I}),$},A=function(F,H){var Y=F,$;if(g(p,Y)&&($=p[Y],Y="%"+$[0]+"%"),g(h,Y)){var I=h[Y];if(I===S&&(I=m(Y)),typeof I>"u"&&!H)throw new n("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:$,name:Y,value:I}}throw new t("intrinsic "+F+" does not exist!")};return J1=function(F,H){if(typeof F!="string"||F.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof H!="boolean")throw new n('"allowMissing" argument must be a boolean');if(x(/^%?[^%]*%?$/,F)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=k(F),$=Y.length>0?Y[0]:"",I=A("%"+$+"%",H),U=I.name,W=I.value,M=!1,j=I.alias;j&&($=j[0],b(Y,d([0,1],j)));for(var B=1,N=!0;B<Y.length;B+=1){var G=Y[B],K=P(G,0,1),q=P(G,-1);if((K==='"'||K==="'"||K==="`"||q==='"'||q==="'"||q==="`")&&K!==q)throw new t("property names with quotes must have matching quotes");if((G==="constructor"||!N)&&(M=!0),$+="."+G,U="%"+$+"%",g(h,U))W=h[U];else if(W!=null){if(!(G in W)){if(!H)throw new n("base intrinsic for "+F+" exists, but the property is not available.");return}if(a&&B+1>=Y.length){var z=a(W,G);N=!!z,N&&"get"in z&&!("originalValue"in z.get)?W=z.get:W=W[G]}else N=g(W,G),W=W[G];N&&!M&&(h[U]=W)}}return W},J1}var eg={exports:{}},tg,w4;function L7(){if(w4)return tg;w4=1;var e=El(),t=e("%Object.defineProperty%",!0),r=function(){if(t)try{return t({},"a",{value:1}),!0}catch{return!1}return!1};return r.hasArrayLengthDefineBug=function(){if(!r())return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},tg=r,tg}var rg,S4;function N7(){if(S4)return rg;S4=1;var e=El(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return rg=t,rg}var ng,E4;function nj(){if(E4)return ng;E4=1;var e=L7()(),t=El(),r=e&&t("%Object.defineProperty%",!0);if(r)try{r({},"a",{value:1})}catch{r=!1}var n=t("%SyntaxError%"),i=t("%TypeError%"),a=N7();return ng=function(l,u,f){if(!l||typeof l!="object"&&typeof l!="function")throw new i("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var v=arguments.length>3?arguments[3]:null,S=arguments.length>4?arguments[4]:null,_=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,E=!!a&&a(l,u);if(r)r(l,u,{configurable:_===null&&E?E.configurable:!_,enumerable:v===null&&E?E.enumerable:!v,value:f,writable:S===null&&E?E.writable:!S});else if(h||!v&&!S&&!_)l[u]=f;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ng}var ig,O4;function ij(){if(O4)return ig;O4=1;var e=El(),t=nj(),r=L7()(),n=N7(),i=e("%TypeError%"),a=e("%Math.floor%");return ig=function(l,u){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||a(u)!==u)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],v=!0,S=!0;if("length"in l&&n){var _=n(l,"length");_&&!_.configurable&&(v=!1),_&&!_.writable&&(S=!1)}return(v||S||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},ig}var P4;function aj(){return P4||(P4=1,function(e){var t=Wy(),r=El(),n=ij(),i=r("%TypeError%"),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=r("%Object.defineProperty%",!0),f=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}e.exports=function(_){if(typeof _!="function")throw new i("a function is required");var h=l(t,o,arguments);return n(h,1+f(0,_.length-(arguments.length-1)),!0)};var v=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:v}):e.exports.apply=v}(eg)),eg.exports}var ag,x4;function oj(){if(x4)return ag;x4=1;var e=El(),t=aj(),r=t(e("String.prototype.indexOf"));return ag=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},ag}const lj={},sj=Object.freeze(Object.defineProperty({__proto__:null,default:lj},Symbol.toStringTag,{value:"Module"})),uj=ao(sj);var og,C4;function cj(){if(C4)return og;C4=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,f=u?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,S=v?WeakSet.prototype.has:null,_=typeof WeakRef=="function"&&WeakRef.prototype,h=_?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,m=Object.prototype.toString,p=Function.prototype.toString,y=String.prototype.match,g=String.prototype.slice,d=String.prototype.replace,b=String.prototype.toUpperCase,O=String.prototype.toLowerCase,P=RegExp.prototype.test,x=Array.prototype.concat,w=Array.prototype.join,T=Array.prototype.slice,k=Math.floor,A=typeof BigInt=="function"?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,H=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Y=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===H||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,I=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(le){return le.__proto__}:null);function U(le,ne){if(le===1/0||le===-1/0||le!==le||le&&le>-1e3&&le<1e3||P.call(/e/,ne))return ne;var Re=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof le=="number"){var Me=le<0?-k(-le):k(le);if(Me!==le){var ye=String(Me),Le=g.call(ne,ye.length+1);return d.call(ye,Re,"$&_")+"."+d.call(d.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(ne,Re,"$&_")}var W=uj,M=W.custom,j=te(M)?M:null;og=function le(ne,Re,Me,ye){var Le=Re||{};if(de(Le,"quoteStyle")&&Le.quoteStyle!=="single"&&Le.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(de(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Oe=de(Le,"customInspect")?Le.customInspect:!0;if(typeof Oe!="boolean"&&Oe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(de(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(de(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var qe=Le.numericSeparator;if(typeof ne>"u")return"undefined";if(ne===null)return"null";if(typeof ne=="boolean")return ne?"true":"false";if(typeof ne=="string")return ge(ne,Le);if(typeof ne=="number"){if(ne===0)return 1/0/ne>0?"0":"-0";var Pt=String(ne);return qe?U(ne,Pt):Pt}if(typeof ne=="bigint"){var _t=String(ne)+"n";return qe?U(ne,_t):_t}var Ae=typeof Le.depth>"u"?5:Le.depth;if(typeof Me>"u"&&(Me=0),Me>=Ae&&Ae>0&&typeof ne=="object")return G(ne)?"[Array]":"[Object]";var $e=Ye(Le,Me);if(typeof ye>"u")ye=[];else if(Ie(ye,ne)>=0)return"[Circular]";function Xe(Pr,Qr,_i){if(Qr&&(ye=T.call(ye),ye.push(Qr)),_i){var Sa={depth:Le.depth};return de(Le,"quoteStyle")&&(Sa.quoteStyle=Le.quoteStyle),le(Pr,Sa,Me+1,ye)}return le(Pr,Le,Me+1,ye)}if(typeof ne=="function"&&!q(ne)){var xt=ke(ne),St=It(ne,Xe);return"[Function"+(xt?": "+xt:" (anonymous)")+"]"+(St.length>0?" { "+w.call(St,", ")+" }":"")}if(te(ne)){var mn=H?d.call(String(ne),/^(Symbol\(.*\))_[^)]*$/,"$1"):F.call(ne);return typeof ne=="object"&&!H?we(mn):mn}if(ce(ne)){for(var lr="<"+O.call(String(ne.nodeName)),Or=ne.attributes||[],yn=0;yn<Or.length;yn++)lr+=" "+Or[yn].name+"="+B(N(Or[yn].value),"double",Le);return lr+=">",ne.childNodes&&ne.childNodes.length&&(lr+="..."),lr+="</"+O.call(String(ne.nodeName))+">",lr}if(G(ne)){if(ne.length===0)return"[]";var Xn=It(ne,Xe);return $e&&!Je(Xn)?"["+pt(Xn,$e)+"]":"[ "+w.call(Xn,", ")+" ]"}if(z(ne)){var Ne=It(ne,Xe);return!("cause"in Error.prototype)&&"cause"in ne&&!$.call(ne,"cause")?"{ ["+String(ne)+"] "+w.call(x.call("[cause]: "+Xe(ne.cause),Ne),", ")+" }":Ne.length===0?"["+String(ne)+"]":"{ ["+String(ne)+"] "+w.call(Ne,", ")+" }"}if(typeof ne=="object"&&Oe){if(j&&typeof ne[j]=="function"&&W)return W(ne,{depth:Ae-Me});if(Oe!=="symbol"&&typeof ne.inspect=="function")return ne.inspect()}if(ue(ne)){var Ke=[];return n&&n.call(ne,function(Pr,Qr){Ke.push(Xe(Qr,ne,!0)+" => "+Xe(Pr,ne))}),Te("Map",r.call(ne),Ke,$e)}if(Se(ne)){var ft=[];return l&&l.call(ne,function(Pr){ft.push(Xe(Pr,ne))}),Te("Set",o.call(ne),ft,$e)}if(ie(ne))return Ee("WeakMap");if(re(ne))return Ee("WeakSet");if(_e(ne))return Ee("WeakRef");if(Z(ne))return we(Xe(Number(ne)));if(ee(ne))return we(Xe(A.call(ne)));if(J(ne))return we(E.call(ne));if(X(ne))return we(Xe(String(ne)));if(typeof window<"u"&&ne===window)return"{ [object Window] }";if(ne===be)return"{ [object globalThis] }";if(!K(ne)&&!q(ne)){var Ct=It(ne,Xe),gt=I?I(ne)===Object.prototype:ne instanceof Object||ne.constructor===Object,nr=ne instanceof Object?"":"null prototype",Zr=!gt&&Y&&Object(ne)===ne&&Y in ne?g.call(he(ne),8,-1):nr?"Object":"",sr=gt||typeof ne.constructor!="function"?"":ne.constructor.name?ne.constructor.name+" ":"",bn=sr+(Zr||nr?"["+w.call(x.call([],Zr||[],nr||[]),": ")+"] ":"");return Ct.length===0?bn+"{}":$e?bn+"{"+pt(Ct,$e)+"}":bn+"{ "+w.call(Ct,", ")+" }"}return String(ne)};function B(le,ne,Re){var Me=(Re.quoteStyle||ne)==="double"?'"':"'";return Me+le+Me}function N(le){return d.call(String(le),/"/g,""")}function G(le){return he(le)==="[object Array]"&&(!Y||!(typeof le=="object"&&Y in le))}function K(le){return he(le)==="[object Date]"&&(!Y||!(typeof le=="object"&&Y in le))}function q(le){return he(le)==="[object RegExp]"&&(!Y||!(typeof le=="object"&&Y in le))}function z(le){return he(le)==="[object Error]"&&(!Y||!(typeof le=="object"&&Y in le))}function X(le){return he(le)==="[object String]"&&(!Y||!(typeof le=="object"&&Y in le))}function Z(le){return he(le)==="[object Number]"&&(!Y||!(typeof le=="object"&&Y in le))}function J(le){return he(le)==="[object Boolean]"&&(!Y||!(typeof le=="object"&&Y in le))}function te(le){if(H)return le&&typeof le=="object"&&le instanceof Symbol;if(typeof le=="symbol")return!0;if(!le||typeof le!="object"||!F)return!1;try{return F.call(le),!0}catch{}return!1}function ee(le){if(!le||typeof le!="object"||!A)return!1;try{return A.call(le),!0}catch{}return!1}var se=Object.prototype.hasOwnProperty||function(le){return le in this};function de(le,ne){return se.call(le,ne)}function he(le){return m.call(le)}function ke(le){if(le.name)return le.name;var ne=y.call(p.call(le),/^function\s*([\w$]+)/);return ne?ne[1]:null}function Ie(le,ne){if(le.indexOf)return le.indexOf(ne);for(var Re=0,Me=le.length;Re<Me;Re++)if(le[Re]===ne)return Re;return-1}function ue(le){if(!r||!le||typeof le!="object")return!1;try{r.call(le);try{o.call(le)}catch{return!0}return le instanceof Map}catch{}return!1}function ie(le){if(!f||!le||typeof le!="object")return!1;try{f.call(le,f);try{S.call(le,S)}catch{return!0}return le instanceof WeakMap}catch{}return!1}function _e(le){if(!h||!le||typeof le!="object")return!1;try{return h.call(le),!0}catch{}return!1}function Se(le){if(!o||!le||typeof le!="object")return!1;try{o.call(le);try{r.call(le)}catch{return!0}return le instanceof Set}catch{}return!1}function re(le){if(!S||!le||typeof le!="object")return!1;try{S.call(le,S);try{f.call(le,f)}catch{return!0}return le instanceof WeakSet}catch{}return!1}function ce(le){return!le||typeof le!="object"?!1:typeof HTMLElement<"u"&&le instanceof HTMLElement?!0:typeof le.nodeName=="string"&&typeof le.getAttribute=="function"}function ge(le,ne){if(le.length>ne.maxStringLength){var Re=le.length-ne.maxStringLength,Me="... "+Re+" more character"+(Re>1?"s":"");return ge(g.call(le,0,ne.maxStringLength),ne)+Me}var ye=d.call(d.call(le,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,me);return B(ye,"single",ne)}function me(le){var ne=le.charCodeAt(0),Re={8:"b",9:"t",10:"n",12:"f",13:"r"}[ne];return Re?"\\"+Re:"\\x"+(ne<16?"0":"")+b.call(ne.toString(16))}function we(le){return"Object("+le+")"}function Ee(le){return le+" { ? }"}function Te(le,ne,Re,Me){var ye=Me?pt(Re,Me):w.call(Re,", ");return le+" ("+ne+") {"+ye+"}"}function Je(le){for(var ne=0;ne<le.length;ne++)if(Ie(le[ne],`
|
|
155
|
+
`)>=0)return!1;return!0}function Ye(le,ne){var Re;if(le.indent===" ")Re=" ";else if(typeof le.indent=="number"&&le.indent>0)Re=w.call(Array(le.indent+1)," ");else return null;return{base:Re,prev:w.call(Array(ne+1),Re)}}function pt(le,ne){if(le.length===0)return"";var Re=`
|
|
156
|
+
`+ne.prev+ne.base;return Re+w.call(le,","+Re)+`
|
|
157
|
+
`+ne.prev}function It(le,ne){var Re=G(le),Me=[];if(Re){Me.length=le.length;for(var ye=0;ye<le.length;ye++)Me[ye]=de(le,ye)?ne(le[ye],le):""}var Le=typeof R=="function"?R(le):[],Oe;if(H){Oe={};for(var qe=0;qe<Le.length;qe++)Oe["$"+Le[qe]]=Le[qe]}for(var Pt in le)de(le,Pt)&&(Re&&String(Number(Pt))===Pt&&Pt<le.length||H&&Oe["$"+Pt]instanceof Symbol||(P.call(/[^\w$]/,Pt)?Me.push(ne(Pt,le)+": "+ne(le[Pt],le)):Me.push(Pt+": "+ne(le[Pt],le))));if(typeof R=="function")for(var _t=0;_t<Le.length;_t++)$.call(le,Le[_t])&&Me.push("["+ne(Le[_t])+"]: "+ne(le[Le[_t]],le));return Me}return og}var lg,k4;function fj(){if(k4)return lg;k4=1;var e=El(),t=oj(),r=cj(),n=e("%TypeError%"),i=e("%WeakMap%",!0),a=e("%Map%",!0),o=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),f=t("Map.prototype.get",!0),v=t("Map.prototype.set",!0),S=t("Map.prototype.has",!0),_=function(p,y){for(var g=p,d;(d=g.next)!==null;g=d)if(d.key===y)return g.next=d.next,d.next=p.next,p.next=d,d},h=function(p,y){var g=_(p,y);return g&&g.value},E=function(p,y,g){var d=_(p,y);d?d.value=g:p.next={key:y,next:p.next,value:g}},m=function(p,y){return!!_(p,y)};return lg=function(){var y,g,d,b={assert:function(O){if(!b.has(O))throw new n("Side channel does not contain "+r(O))},get:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(y)return o(y,O)}else if(a){if(g)return f(g,O)}else if(d)return h(d,O)},has:function(O){if(i&&O&&(typeof O=="object"||typeof O=="function")){if(y)return u(y,O)}else if(a){if(g)return S(g,O)}else if(d)return m(d,O);return!1},set:function(O,P){i&&O&&(typeof O=="object"||typeof O=="function")?(y||(y=new i),l(y,O,P)):a?(g||(g=new a),v(g,O,P)):(d||(d={key:{},next:null}),E(d,O,P))}};return b},lg}var sg,T4;function Yy(){if(T4)return sg;T4=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return sg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},sg}var ug,A4;function I7(){if(A4)return ug;A4=1;var e=Yy(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var m=[],p=0;p<256;++p)m.push("%"+((p<16?"0":"")+p.toString(16)).toUpperCase());return m}(),i=function(p){for(;p.length>1;){var y=p.pop(),g=y.obj[y.prop];if(r(g)){for(var d=[],b=0;b<g.length;++b)typeof g[b]<"u"&&d.push(g[b]);y.obj[y.prop]=d}}},a=function(p,y){for(var g=y&&y.plainObjects?Object.create(null):{},d=0;d<p.length;++d)typeof p[d]<"u"&&(g[d]=p[d]);return g},o=function m(p,y,g){if(!y)return p;if(typeof y!="object"){if(r(p))p.push(y);else if(p&&typeof p=="object")(g&&(g.plainObjects||g.allowPrototypes)||!t.call(Object.prototype,y))&&(p[y]=!0);else return[p,y];return p}if(!p||typeof p!="object")return[p].concat(y);var d=p;return r(p)&&!r(y)&&(d=a(p,g)),r(p)&&r(y)?(y.forEach(function(b,O){if(t.call(p,O)){var P=p[O];P&&typeof P=="object"&&b&&typeof b=="object"?p[O]=m(P,b,g):p.push(b)}else p[O]=b}),p):Object.keys(y).reduce(function(b,O){var P=y[O];return t.call(b,O)?b[O]=m(b[O],P,g):b[O]=P,b},d)},l=function(p,y){return Object.keys(y).reduce(function(g,d){return g[d]=y[d],g},p)},u=function(m,p,y){var g=m.replace(/\+/g," ");if(y==="iso-8859-1")return g.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(g)}catch{return g}},f=function(p,y,g,d,b){if(p.length===0)return p;var O=p;if(typeof p=="symbol"?O=Symbol.prototype.toString.call(p):typeof p!="string"&&(O=String(p)),g==="iso-8859-1")return escape(O).replace(/%u[0-9a-f]{4}/gi,function(T){return"%26%23"+parseInt(T.slice(2),16)+"%3B"});for(var P="",x=0;x<O.length;++x){var w=O.charCodeAt(x);if(w===45||w===46||w===95||w===126||w>=48&&w<=57||w>=65&&w<=90||w>=97&&w<=122||b===e.RFC1738&&(w===40||w===41)){P+=O.charAt(x);continue}if(w<128){P=P+n[w];continue}if(w<2048){P=P+(n[192|w>>6]+n[128|w&63]);continue}if(w<55296||w>=57344){P=P+(n[224|w>>12]+n[128|w>>6&63]+n[128|w&63]);continue}x+=1,w=65536+((w&1023)<<10|O.charCodeAt(x)&1023),P+=n[240|w>>18]+n[128|w>>12&63]+n[128|w>>6&63]+n[128|w&63]}return P},v=function(p){for(var y=[{obj:{o:p},prop:"o"}],g=[],d=0;d<y.length;++d)for(var b=y[d],O=b.obj[b.prop],P=Object.keys(O),x=0;x<P.length;++x){var w=P[x],T=O[w];typeof T=="object"&&T!==null&&g.indexOf(T)===-1&&(y.push({obj:O,prop:w}),g.push(T))}return i(y),p},S=function(p){return Object.prototype.toString.call(p)==="[object RegExp]"},_=function(p){return!p||typeof p!="object"?!1:!!(p.constructor&&p.constructor.isBuffer&&p.constructor.isBuffer(p))},h=function(p,y){return[].concat(p,y)},E=function(p,y){if(r(p)){for(var g=[],d=0;d<p.length;d+=1)g.push(y(p[d]));return g}return y(p)};return ug={arrayToObject:a,assign:l,combine:h,compact:v,decode:u,encode:f,isBuffer:_,isRegExp:S,maybeMap:E,merge:o},ug}var cg,R4;function dj(){if(R4)return cg;R4=1;var e=fj(),t=I7(),r=Yy(),n=Object.prototype.hasOwnProperty,i={brackets:function(p){return p+"[]"},comma:"comma",indices:function(p,y){return p+"["+y+"]"},repeat:function(p){return p}},a=Array.isArray,o=Array.prototype.push,l=function(m,p){o.apply(m,a(p)?p:[p])},u=Date.prototype.toISOString,f=r.default,v={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(p){return u.call(p)},skipNulls:!1,strictNullHandling:!1},S=function(p){return typeof p=="string"||typeof p=="number"||typeof p=="boolean"||typeof p=="symbol"||typeof p=="bigint"},_={},h=function m(p,y,g,d,b,O,P,x,w,T,k,A,R,F,H,Y){for(var $=p,I=Y,U=0,W=!1;(I=I.get(_))!==void 0&&!W;){var M=I.get(p);if(U+=1,typeof M<"u"){if(M===U)throw new RangeError("Cyclic object value");W=!0}typeof I.get(_)>"u"&&(U=0)}if(typeof x=="function"?$=x(y,$):$ instanceof Date?$=k($):g==="comma"&&a($)&&($=t.maybeMap($,function(te){return te instanceof Date?k(te):te})),$===null){if(b)return P&&!F?P(y,v.encoder,H,"key",A):y;$=""}if(S($)||t.isBuffer($)){if(P){var j=F?y:P(y,v.encoder,H,"key",A);return[R(j)+"="+R(P($,v.encoder,H,"value",A))]}return[R(y)+"="+R(String($))]}var B=[];if(typeof $>"u")return B;var N;if(g==="comma"&&a($))F&&P&&($=t.maybeMap($,P)),N=[{value:$.length>0?$.join(",")||null:void 0}];else if(a(x))N=x;else{var G=Object.keys($);N=w?G.sort(w):G}for(var K=d&&a($)&&$.length===1?y+"[]":y,q=0;q<N.length;++q){var z=N[q],X=typeof z=="object"&&typeof z.value<"u"?z.value:$[z];if(!(O&&X===null)){var Z=a($)?typeof g=="function"?g(K,z):K:K+(T?"."+z:"["+z+"]");Y.set(p,U);var J=e();J.set(_,Y),l(B,m(X,Z,g,d,b,O,g==="comma"&&F&&a($)?null:P,x,w,T,k,A,R,F,H,J))}}return B},E=function(p){if(!p)return v;if(p.encoder!==null&&typeof p.encoder<"u"&&typeof p.encoder!="function")throw new TypeError("Encoder has to be a function.");var y=p.charset||v.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 g=r.default;if(typeof p.format<"u"){if(!n.call(r.formatters,p.format))throw new TypeError("Unknown format option provided.");g=p.format}var d=r.formatters[g],b=v.filter;return(typeof p.filter=="function"||a(p.filter))&&(b=p.filter),{addQueryPrefix:typeof p.addQueryPrefix=="boolean"?p.addQueryPrefix:v.addQueryPrefix,allowDots:typeof p.allowDots>"u"?v.allowDots:!!p.allowDots,charset:y,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:v.charsetSentinel,delimiter:typeof p.delimiter>"u"?v.delimiter:p.delimiter,encode:typeof p.encode=="boolean"?p.encode:v.encode,encoder:typeof p.encoder=="function"?p.encoder:v.encoder,encodeValuesOnly:typeof p.encodeValuesOnly=="boolean"?p.encodeValuesOnly:v.encodeValuesOnly,filter:b,format:g,formatter:d,serializeDate:typeof p.serializeDate=="function"?p.serializeDate:v.serializeDate,skipNulls:typeof p.skipNulls=="boolean"?p.skipNulls:v.skipNulls,sort:typeof p.sort=="function"?p.sort:null,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:v.strictNullHandling}};return cg=function(m,p){var y=m,g=E(p),d,b;typeof g.filter=="function"?(b=g.filter,y=b("",y)):a(g.filter)&&(b=g.filter,d=b);var O=[];if(typeof y!="object"||y===null)return"";var P;p&&p.arrayFormat in i?P=p.arrayFormat:p&&"indices"in p?P=p.indices?"indices":"repeat":P="indices";var x=i[P];if(p&&"commaRoundTrip"in p&&typeof p.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var w=x==="comma"&&p&&p.commaRoundTrip;d||(d=Object.keys(y)),g.sort&&d.sort(g.sort);for(var T=e(),k=0;k<d.length;++k){var A=d[k];g.skipNulls&&y[A]===null||l(O,h(y[A],A,x,w,g.strictNullHandling,g.skipNulls,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,T))}var R=O.join(g.delimiter),F=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?F+="utf8=%26%2310003%3B&":F+="utf8=%E2%9C%93&"),R.length>0?F+R:""},cg}var fg,M4;function hj(){if(M4)return fg;M4=1;var e=I7(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:e.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(_){return _.replace(/&#(\d+);/g,function(h,E){return String.fromCharCode(parseInt(E,10))})},a=function(_,h){return _&&typeof _=="string"&&h.comma&&_.indexOf(",")>-1?_.split(","):_},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(h,E){var m={__proto__:null},p=E.ignoreQueryPrefix?h.replace(/^\?/,""):h,y=E.parameterLimit===1/0?void 0:E.parameterLimit,g=p.split(E.delimiter,y),d=-1,b,O=E.charset;if(E.charsetSentinel)for(b=0;b<g.length;++b)g[b].indexOf("utf8=")===0&&(g[b]===l?O="utf-8":g[b]===o&&(O="iso-8859-1"),d=b,b=g.length);for(b=0;b<g.length;++b)if(b!==d){var P=g[b],x=P.indexOf("]="),w=x===-1?P.indexOf("="):x+1,T,k;w===-1?(T=E.decoder(P,n.decoder,O,"key"),k=E.strictNullHandling?null:""):(T=E.decoder(P.slice(0,w),n.decoder,O,"key"),k=e.maybeMap(a(P.slice(w+1),E),function(A){return E.decoder(A,n.decoder,O,"value")})),k&&E.interpretNumericEntities&&O==="iso-8859-1"&&(k=i(k)),P.indexOf("[]=")>-1&&(k=r(k)?[k]:k),t.call(m,T)?m[T]=e.combine(m[T],k):m[T]=k}return m},f=function(_,h,E,m){for(var p=m?h:a(h,E),y=_.length-1;y>=0;--y){var g,d=_[y];if(d==="[]"&&E.parseArrays)g=[].concat(p);else{g=E.plainObjects?Object.create(null):{};var b=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,O=parseInt(b,10);!E.parseArrays&&b===""?g={0:p}:!isNaN(O)&&d!==b&&String(O)===b&&O>=0&&E.parseArrays&&O<=E.arrayLimit?(g=[],g[O]=p):b!=="__proto__"&&(g[b]=p)}p=g}return p},v=function(h,E,m,p){if(h){var y=m.allowDots?h.replace(/\.([^.[]+)/g,"[$1]"):h,g=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,b=m.depth>0&&g.exec(y),O=b?y.slice(0,b.index):y,P=[];if(O){if(!m.plainObjects&&t.call(Object.prototype,O)&&!m.allowPrototypes)return;P.push(O)}for(var x=0;m.depth>0&&(b=d.exec(y))!==null&&x<m.depth;){if(x+=1,!m.plainObjects&&t.call(Object.prototype,b[1].slice(1,-1))&&!m.allowPrototypes)return;P.push(b[1])}return b&&P.push("["+y.slice(b.index)+"]"),f(P,E,m,p)}},S=function(h){if(!h)return n;if(h.decoder!==null&&h.decoder!==void 0&&typeof h.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof h.charset<"u"&&h.charset!=="utf-8"&&h.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=typeof h.charset>"u"?n.charset:h.charset;return{allowDots:typeof h.allowDots>"u"?n.allowDots:!!h.allowDots,allowPrototypes:typeof h.allowPrototypes=="boolean"?h.allowPrototypes:n.allowPrototypes,allowSparse:typeof h.allowSparse=="boolean"?h.allowSparse:n.allowSparse,arrayLimit:typeof h.arrayLimit=="number"?h.arrayLimit:n.arrayLimit,charset:E,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:n.charsetSentinel,comma:typeof h.comma=="boolean"?h.comma:n.comma,decoder:typeof h.decoder=="function"?h.decoder:n.decoder,delimiter:typeof h.delimiter=="string"||e.isRegExp(h.delimiter)?h.delimiter:n.delimiter,depth:typeof h.depth=="number"||h.depth===!1?+h.depth:n.depth,ignoreQueryPrefix:h.ignoreQueryPrefix===!0,interpretNumericEntities:typeof h.interpretNumericEntities=="boolean"?h.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof h.parameterLimit=="number"?h.parameterLimit:n.parameterLimit,parseArrays:h.parseArrays!==!1,plainObjects:typeof h.plainObjects=="boolean"?h.plainObjects:n.plainObjects,strictNullHandling:typeof h.strictNullHandling=="boolean"?h.strictNullHandling:n.strictNullHandling}};return fg=function(_,h){var E=S(h);if(_===""||_===null||typeof _>"u")return E.plainObjects?Object.create(null):{};for(var m=typeof _=="string"?u(_,E):_,p=E.plainObjects?Object.create(null):{},y=Object.keys(m),g=0;g<y.length;++g){var d=y[g],b=v(d,m[d],E,typeof _=="string");p=e.merge(p,b,E)}return E.allowSparse===!0?p:e.compact(p)},fg}var dg,L4;function pj(){if(L4)return dg;L4=1;var e=dj(),t=hj(),r=Yy();return dg={formats:r,parse:t,stringify:e},dg}var N4;function j7(){if(N4)return jo;N4=1;var e=ZI();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",`
|
|
158
|
+
`," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],v=255,S=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},p=pj();function y(O,P,x){if(O&&typeof O=="object"&&O instanceof t)return O;var w=new t;return w.parse(O,P,x),w}t.prototype.parse=function(O,P,x){if(typeof O!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof O);var w=O.indexOf("?"),T=w!==-1&&w<O.indexOf("#")?"?":"#",k=O.split(T),A=/\\/g;k[0]=k[0].replace(A,"/"),O=k.join(T);var R=O;if(R=R.trim(),!x&&O.split("#").length===1){var F=i.exec(R);if(F)return this.path=R,this.href=R,this.pathname=F[1],F[2]?(this.search=F[2],P?this.query=p.parse(this.search.substr(1)):this.query=this.search.substr(1)):P&&(this.search="",this.query={}),this}var H=r.exec(R);if(H){H=H[0];var Y=H.toLowerCase();this.protocol=Y,R=R.substr(H.length)}if(x||H||R.match(/^\/\/[^@/]+@[^@/]+/)){var $=R.substr(0,2)==="//";$&&!(H&&E[H])&&(R=R.substr(2),this.slashes=!0)}if(!E[H]&&($||H&&!m[H])){for(var I=-1,U=0;U<f.length;U++){var W=R.indexOf(f[U]);W!==-1&&(I===-1||W<I)&&(I=W)}var M,j;I===-1?j=R.lastIndexOf("@"):j=R.lastIndexOf("@",I),j!==-1&&(M=R.slice(0,j),R=R.slice(j+1),this.auth=decodeURIComponent(M)),I=-1;for(var U=0;U<u.length;U++){var W=R.indexOf(u[U]);W!==-1&&(I===-1||W<I)&&(I=W)}I===-1&&(I=R.length),this.host=R.slice(0,I),R=R.slice(I),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var N=this.hostname.split(/\./),U=0,G=N.length;U<G;U++){var K=N[U];if(K&&!K.match(S)){for(var q="",z=0,X=K.length;z<X;z++)K.charCodeAt(z)>127?q+="x":q+=K[z];if(!q.match(S)){var Z=N.slice(0,U),J=N.slice(U+1),te=K.match(_);te&&(Z.push(te[1]),J.unshift(te[2])),J.length&&(R="/"+J.join(".")+R),this.hostname=Z.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=e.toASCII(this.hostname));var ee=this.port?":"+this.port:"",se=this.hostname||"";this.host=se+ee,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!h[Y])for(var U=0,G=l.length;U<G;U++){var de=l[U];if(R.indexOf(de)!==-1){var he=encodeURIComponent(de);he===de&&(he=escape(de)),R=R.split(de).join(he)}}var ke=R.indexOf("#");ke!==-1&&(this.hash=R.substr(ke),R=R.slice(0,ke));var Ie=R.indexOf("?");if(Ie!==-1?(this.search=R.substr(Ie),this.query=R.substr(Ie+1),P&&(this.query=p.parse(this.query)),R=R.slice(0,Ie)):P&&(this.search="",this.query={}),R&&(this.pathname=R),m[Y]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ee=this.pathname||"",ue=this.search||"";this.path=ee+ue}return this.href=this.format(),this};function g(O){return typeof O=="string"&&(O=y(O)),O instanceof t?O.format():t.prototype.format.call(O)}t.prototype.format=function(){var O=this.auth||"";O&&(O=encodeURIComponent(O),O=O.replace(/%3A/i,":"),O+="@");var P=this.protocol||"",x=this.pathname||"",w=this.hash||"",T=!1,k="";this.host?T=O+this.host:this.hostname&&(T=O+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(T+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(k=p.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var A=this.search||k&&"?"+k||"";return P&&P.substr(-1)!==":"&&(P+=":"),this.slashes||(!P||m[P])&&T!==!1?(T="//"+(T||""),x&&x.charAt(0)!=="/"&&(x="/"+x)):T||(T=""),w&&w.charAt(0)!=="#"&&(w="#"+w),A&&A.charAt(0)!=="?"&&(A="?"+A),x=x.replace(/[?#]/g,function(R){return encodeURIComponent(R)}),A=A.replace("#","%23"),P+T+x+A+w};function d(O,P){return y(O,!1,!0).resolve(P)}t.prototype.resolve=function(O){return this.resolveObject(y(O,!1,!0)).format()};function b(O,P){return O?y(O,!1,!0).resolveObject(P):P}return t.prototype.resolveObject=function(O){if(typeof O=="string"){var P=new t;P.parse(O,!1,!0),O=P}for(var x=new t,w=Object.keys(this),T=0;T<w.length;T++){var k=w[T];x[k]=this[k]}if(x.hash=O.hash,O.href==="")return x.href=x.format(),x;if(O.slashes&&!O.protocol){for(var A=Object.keys(O),R=0;R<A.length;R++){var F=A[R];F!=="protocol"&&(x[F]=O[F])}return m[x.protocol]&&x.hostname&&!x.pathname&&(x.pathname="/",x.path=x.pathname),x.href=x.format(),x}if(O.protocol&&O.protocol!==x.protocol){if(!m[O.protocol]){for(var H=Object.keys(O),Y=0;Y<H.length;Y++){var $=H[Y];x[$]=O[$]}return x.href=x.format(),x}if(x.protocol=O.protocol,!O.host&&!E[O.protocol]){for(var G=(O.pathname||"").split("/");G.length&&!(O.host=G.shift()););O.host||(O.host=""),O.hostname||(O.hostname=""),G[0]!==""&&G.unshift(""),G.length<2&&G.unshift(""),x.pathname=G.join("/")}else x.pathname=O.pathname;if(x.search=O.search,x.query=O.query,x.host=O.host||"",x.auth=O.auth,x.hostname=O.hostname||O.host,x.port=O.port,x.pathname||x.search){var I=x.pathname||"",U=x.search||"";x.path=I+U}return x.slashes=x.slashes||O.slashes,x.href=x.format(),x}var W=x.pathname&&x.pathname.charAt(0)==="/",M=O.host||O.pathname&&O.pathname.charAt(0)==="/",j=M||W||x.host&&O.pathname,B=j,N=x.pathname&&x.pathname.split("/")||[],G=O.pathname&&O.pathname.split("/")||[],K=x.protocol&&!m[x.protocol];if(K&&(x.hostname="",x.port=null,x.host&&(N[0]===""?N[0]=x.host:N.unshift(x.host)),x.host="",O.protocol&&(O.hostname=null,O.port=null,O.host&&(G[0]===""?G[0]=O.host:G.unshift(O.host)),O.host=null),j=j&&(G[0]===""||N[0]==="")),M)x.host=O.host||O.host===""?O.host:x.host,x.hostname=O.hostname||O.hostname===""?O.hostname:x.hostname,x.search=O.search,x.query=O.query,N=G;else if(G.length)N||(N=[]),N.pop(),N=N.concat(G),x.search=O.search,x.query=O.query;else if(O.search!=null){if(K){x.host=N.shift(),x.hostname=x.host;var q=x.host&&x.host.indexOf("@")>0?x.host.split("@"):!1;q&&(x.auth=q.shift(),x.hostname=q.shift(),x.host=x.hostname)}return x.search=O.search,x.query=O.query,(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.href=x.format(),x}if(!N.length)return x.pathname=null,x.search?x.path="/"+x.search:x.path=null,x.href=x.format(),x;for(var z=N.slice(-1)[0],X=(x.host||O.host||N.length>1)&&(z==="."||z==="..")||z==="",Z=0,J=N.length;J>=0;J--)z=N[J],z==="."?N.splice(J,1):z===".."?(N.splice(J,1),Z++):Z&&(N.splice(J,1),Z--);if(!j&&!B)for(;Z--;Z)N.unshift("..");j&&N[0]!==""&&(!N[0]||N[0].charAt(0)!=="/")&&N.unshift(""),X&&N.join("/").substr(-1)!=="/"&&N.push("");var te=N[0]===""||N[0]&&N[0].charAt(0)==="/";if(K){x.hostname=te?"":N.length?N.shift():"",x.host=x.hostname;var q=x.host&&x.host.indexOf("@")>0?x.host.split("@"):!1;q&&(x.auth=q.shift(),x.hostname=q.shift(),x.host=x.hostname)}return j=j||x.host&&N.length,j&&!te&&N.unshift(""),N.length>0?x.pathname=N.join("/"):(x.pathname=null,x.path=null),(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.auth=O.auth||x.auth,x.slashes=x.slashes||O.slashes,x.href=x.format(),x},t.prototype.parseHost=function(){var O=this.host,P=n.exec(O);P&&(P=P[0],P!==":"&&(this.port=P.substr(1)),O=O.substr(0,O.length-P.length)),O&&(this.hostname=O)},jo.parse=y,jo.resolve=d,jo.resolveObject=b,jo.format=g,jo.Url=t,jo}var hg={exports:{}},I4;function gj(){return I4||(I4=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(be,function(){var t=function(h){return h.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(h){return h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(h){return h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},i=function(h){var E=h.value;return" "+h.name+'="'+r(E)+'"'},a=function(h){var E=h.tagName;return h.namespaceURI==="http://www.w3.org/1999/xhtml"&&(E=E.toLowerCase()),E},o=function(h,E){var m=Array.prototype.map.call(h.attributes||h.attrs,function(p){return p.name}).indexOf("xmlns")>=0;return!m&&(E||h.namespaceURI!==h.parentNode.namespaceURI)?' xmlns="'+h.namespaceURI+'"':""},l=function(h){return Array.prototype.map.call(h.childNodes,function(E){return _(E)}).join("")},u=function(h,E){var m="<"+a(h);return m+=o(h,E),Array.prototype.forEach.call(h.attributes||h.attrs,function(p){m+=i(p)}),h.childNodes.length>0?(m+=">",m+=l(h),m+="</"+a(h)+">"):m+="/>",m},f=function(h){var E=h.nodeValue||h.value||"";return n(E)},v=function(h){return"<!--"+h.data.replace(/-/g,"-")+"-->"},S=function(h){return"<![CDATA["+h.nodeValue+"]]>"},_=function(h,E){var m=E&&E.rootNode;if(h.nodeName==="#document"||h.nodeName==="#document-fragment")return l(h);if(h.tagName)return u(h,m);if(h.nodeName==="#text")return f(h);if(h.nodeName==="#comment")return v(h);if(h.nodeName==="#cdata-section")return S(h)};return{serializeToString:function(h){return t(_(h,{rootNode:!0}))}}})}(hg)),hg.exports}var pg={},j4;function vj(){if(j4)return pg;j4=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[^>]*>(.+?)
|
|
159
|
+
?</div>`),new RegExp(`^(.+)
|
|
160
|
+
`)],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 pg.failOnParseError=function(a){return i(a),a},pg}var gg={},vg={},D4;function Bp(){return D4||(D4=1,function(e){var t=j7();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},f;for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?t.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(f){return f.catch(function(v){u.push(v)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};e.ajax=function(l,u){return new Promise(function(f,v){var S=new window.XMLHttpRequest,_=e.joinUrl(u.baseUrl,l),h,E=function(){v({msg:"Unable to load url",url:_})};h=n(_,u.cache),S.addEventListener("load",function(){S.status===200||S.status===0?f(S.response):E()},!1),S.addEventListener("error",E,!1);try{S.open("GET",h,!0),S.overrideMimeType(u.mimeType),S.send(null)}catch{E()}})},e.binaryAjax=function(l,u){var f=e.clone(u);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(l,f).then(function(v){for(var S="",_=0;_<v.length;_++)S+=String.fromCharCode(v.charCodeAt(_)&255);return S})};var i=function(l){var u=function(f,v){return f.substring(0,v.length)===v};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(f){var v=btoa(f),S=i(f);return"data:"+S+";base64,"+v})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};e.memoize=function(l,u,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var v=Array.prototype.slice.call(arguments),S=u(v),_=o(l),h;return f[_]&&f[_][S]?f[_][S]:(h=l.apply(null,v),f[_]=f[_]||{},f[_][S]=h,h)}}}(vg)),vg}var mg={},F4;function mj(){if(F4)return mg;F4=1;var e=Bp(),t=function(a,o){var l=null;a.hasAttribute("src")?l=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(l=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.getDataURIForImageURL(l,f).then(function(v){return v},function(v){throw{resourceType:"image",url:v.url,msg:"Unable to load image "+v.url}})},r=function(a){return a.filter(function(o){var l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!e.isDataUri(l)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return mg.inline=function(a,o){var l=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),f=n(a.getElementsByTagName("input"));l=l.concat(u),l=l.concat(f);var v=r(l);return e.collectAndReportErrors(v.map(function(S){return t(S,o).then(function(_){S.attributes.src?S.attributes.src.value=_:S.attributes["xlink:href"]?S.attributes["xlink:href"].value=_:S.attributes.href&&(S.attributes.href.value=_)})}))},mg}var yg={},z4;function yj(){if(z4)return yg;z4=1;var e=Bp(),t=function(a,o){var l=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.ajax(l,f).catch(function(v){throw{resourceType:"script",url:v.url,msg:"Unable to load script "+v.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(l){return!!l.attributes.src})};return yg.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)})}))},yg}var bg={},_g={},B4;function Ky(){return B4||(B4=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)}}(_g)),_g}var wg={},U4;function bj(){return U4||(U4=1,function(e){var t=Ky(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],t.unquoteString(r(l))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",f="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",v=new RegExp(u,"g"),S,_=[],h=function(E){var m=new RegExp(l,"g"),p=[],y;for(y=m.exec(E);y;)p.push(y[1]),y=m.exec(E);return p};if(a.match(new RegExp(f))){for(S=v.exec(a);S;)_.push(h(S[0])),S=v.exec(a);return _}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(wg)),wg}function cd(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 Sg={exports:{}},H4;function _j(){return H4||(H4=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,v){if(!i[f]){if(!n[f]){var S=typeof cd=="function"&&cd;if(!v&&S)return S(f,!0);if(l)return l(f,!0);var _=new Error("Cannot find module '"+f+"'");throw _.code="MODULE_NOT_FOUND",_}var h=i[f]={exports:{}};n[f][0].call(h.exports,function(E){var m=n[f][1][E];return o(m||E)},h,h.exports,r,n,i,a)}return i[f].exports}for(var l=typeof cd=="function"&&cd,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function v(){this.constructor=u}v.prototype=f.prototype,u.prototype=new v}function o(u,f,v,S){this.message=u,this.expected=f,this.found=v,this.location=S,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var v={literal:function(y){return'"'+_(y.text)+'"'},class:function(y){var g="",d;for(d=0;d<y.parts.length;d++)g+=y.parts[d]instanceof Array?h(y.parts[d][0])+"-"+h(y.parts[d][1]):h(y.parts[d]);return"["+(y.inverted?"^":"")+g+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function S(y){return y.charCodeAt(0).toString(16).toUpperCase()}function _(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+S(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+S(g)})}function h(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+S(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+S(g)})}function E(y){return v[y.type](y)}function m(y){var g=new Array(y.length),d,b;for(d=0;d<y.length;d++)g[d]=E(y[d]);if(g.sort(),g.length>0){for(d=1,b=1;d<g.length;d++)g[d-1]!==g[d]&&(g[b]=g[d],b++);g.length=b}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function p(y){return y?'"'+_(y)+'"':"end of input"}return"Expected "+m(u)+" but "+p(f)+" found."};function l(u,f){f=f!==void 0?f:{};var v={},S={start:ee},_=ee,h="",E=function(){return[]},m=",",p=K(",",!1),y=function(re,ce){return[re].concat(ce)},g=function(re){return[re]},d=function(re,ce){return{url:re,format:ce}},b=function(re){return{url:re}},O="url(",P=K("url(",!1),x=")",w=K(")",!1),T=function(re){return re},k="format(",A=K("format(",!1),R="local(",F=K("local(",!1),H=function(re){return{local:re}},Y=/^[^)]/,$=q([")"],!0,!1),I=function(re){return Se.extractValue(re.join(""))},U=/^[ \t\r\n\f]/,W=q([" "," ","\r",`
|
|
161
|
+
`,"\f"],!1,!1),M=0,j=[{line:1,column:1}],B=0,N=[],G;if("startRule"in f){if(!(f.startRule in S))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');_=S[f.startRule]}function K(re,ce){return{type:"literal",text:re,ignoreCase:ce}}function q(re,ce,ge){return{type:"class",parts:re,inverted:ce,ignoreCase:ge}}function z(){return{type:"end"}}function X(re){var ce=j[re],ge;if(ce)return ce;for(ge=re-1;!j[ge];)ge--;for(ce=j[ge],ce={line:ce.line,column:ce.column};ge<re;)u.charCodeAt(ge)===10?(ce.line++,ce.column=1):ce.column++,ge++;return j[re]=ce,ce}function Z(re,ce){var ge=X(re),me=X(ce);return{start:{offset:re,line:ge.line,column:ge.column},end:{offset:ce,line:me.line,column:me.column}}}function J(re){M<B||(M>B&&(B=M,N=[]),N.push(re))}function te(re,ce,ge){return new o(o.buildMessage(re,ce),re,ce,ge)}function ee(){var re,ce;return re=se(),re===v&&(re=M,ce=h,ce!==v&&(ce=E()),re=ce),re}function se(){var re,ce,ge,me,we,Ee;if(re=M,ce=de(),ce!==v){for(ge=[],me=_e();me!==v;)ge.push(me),me=_e();if(ge!==v)if(u.charCodeAt(M)===44?(me=m,M++):(me=v,J(p)),me!==v){for(we=[],Ee=_e();Ee!==v;)we.push(Ee),Ee=_e();we!==v?(Ee=se(),Ee!==v?(ce=y(ce,Ee),re=ce):(M=re,re=v)):(M=re,re=v)}else M=re,re=v;else M=re,re=v}else M=re,re=v;return re===v&&(re=M,ce=de(),ce!==v&&(ce=g(ce)),re=ce),re}function de(){var re;return re=he(),re===v&&(re=ue()),re}function he(){var re,ce,ge,me;if(re=M,ce=ke(),ce!==v){if(ge=[],me=_e(),me!==v)for(;me!==v;)ge.push(me),me=_e();else ge=v;ge!==v?(me=Ie(),me!==v?(ce=d(ce,me),re=ce):(M=re,re=v)):(M=re,re=v)}else M=re,re=v;return re===v&&(re=M,ce=ke(),ce!==v&&(ce=b(ce)),re=ce),re}function ke(){var re,ce,ge,me;return re=M,u.substr(M,4)===O?(ce=O,M+=4):(ce=v,J(P)),ce!==v?(ge=ie(),ge!==v?(u.charCodeAt(M)===41?(me=x,M++):(me=v,J(w)),me!==v?(ce=T(ge),re=ce):(M=re,re=v)):(M=re,re=v)):(M=re,re=v),re}function Ie(){var re,ce,ge,me;return re=M,u.substr(M,7)===k?(ce=k,M+=7):(ce=v,J(A)),ce!==v?(ge=ie(),ge!==v?(u.charCodeAt(M)===41?(me=x,M++):(me=v,J(w)),me!==v?(ce=T(ge),re=ce):(M=re,re=v)):(M=re,re=v)):(M=re,re=v),re}function ue(){var re,ce,ge,me;return re=M,u.substr(M,6)===R?(ce=R,M+=6):(ce=v,J(F)),ce!==v?(ge=ie(),ge!==v?(u.charCodeAt(M)===41?(me=x,M++):(me=v,J(w)),me!==v?(ce=H(ge),re=ce):(M=re,re=v)):(M=re,re=v)):(M=re,re=v),re}function ie(){var re,ce,ge;if(re=M,ce=[],Y.test(u.charAt(M))?(ge=u.charAt(M),M++):(ge=v,J($)),ge!==v)for(;ge!==v;)ce.push(ge),Y.test(u.charAt(M))?(ge=u.charAt(M),M++):(ge=v,J($));else ce=v;return ce!==v&&(ce=I(ce)),re=ce,re}function _e(){var re;return U.test(u.charAt(M))?(re=u.charAt(M),M++):(re=v,J(W)),re}var Se=r("../util");if(G=_(),G!==v&&M===u.length)return G;throw G!==v&&M<u.length&&J(z()),te(N,B<u.length?u.charAt(B):null,B<u.length?Z(B,B+1):Z(B,B))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,l){this.message=o,this.offset=l},i.parse=function(o){try{return a.parse(o)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,f=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return o(a(l))}},{}]},{},[2])(2)})}(Sg)),Sg.exports}var $4;function wj(){return $4||($4=1,function(e){var t=Bp(),r=Ky(),n=bj(),i=_j(),a=function(g,d,b){g.style.setProperty(d,b,g.style.getPropertyPriority(d))},o=function(g){return g.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(g){var d=[];return g.forEach(function(b){b.style.getPropertyValue("background-image")?d.push({property:"background-image",value:b.style.getPropertyValue("background-image"),rule:b}):b.style.getPropertyValue("background")&&d.push({property:"background",value:b.style.getPropertyValue("background"),rule:b})}),d},u=function(g){return g.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(g){return g.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},v=function(g){var d=[];return g.forEach(function(b,O){b.url&&!t.isDataUri(b.url)&&d.push(O)}),d},S=function(g){var d=[];return g.forEach(function(b,O){b.url&&!t.isDataUri(b.url)&&d.push(O)}),d};e.adjustPathsOfCssResources=function(g,d){var b=o(d),O=l(b),P=!1;return O.forEach(function(x){var w=n.parse(x.value),T=v(w),k;T.length>0&&(T.forEach(function(A){var R=w[A].url,F=t.joinUrl(g,R);w[A].url=F}),k=n.serialize(w),a(x.rule,x.property,k),P=!0)}),u(d).forEach(function(x){var w=x.style.getPropertyValue("src"),T,k;try{T=i.parse(w)}catch{return}k=S(T),k.length>0&&(k.forEach(function(A){var R=T[A].url,F=t.joinUrl(g,R);T[A].url=F}),r.changeFontFaceRuleSrc(d,x,i.serialize(T)),P=!0)}),f(d).forEach(function(x){var w=x.href,T=t.joinUrl(g,w);r.exchangeRule(d,x,"@import url("+T+");"),P=!0}),P};var _=function(g,d,b){var O=g.indexOf(d);g.splice(O,1),b.forEach(function(P,x){g.splice(O+x,0,P)})},h=function(g,d,b,O){var P=d.href,x;return P=r.unquoteString(P),x=t.joinUrl(O.baseUrl,P),b.indexOf(x)>=0?(_(g,d,[]),Promise.resolve([])):(b.push(x),t.ajax(P,O).then(function(w){var T=r.rulesForCssText(w);return e.loadCSSImportsForRules(T,b,O).then(function(k){return e.adjustPathsOfCssResources(P,T),_(g,d,T),k.errors})},function(w){throw{resourceType:"stylesheet",url:w.url,msg:"Unable to load stylesheet "+w.url}}))};e.loadCSSImportsForRules=function(g,d,b){var O=f(g),P=[],x=!1;return Promise.all(O.map(function(w){return h(g,w,d,b).then(function(T){P=P.concat(T),x=!0},function(T){P.push(T)})})).then(function(){return{hasChanges:x,errors:P}})};var E=function(g,d){var b=n.parse(g),O=v(b),P=!1;return t.collectAndReportErrors(O.map(function(x){var w=b[x].url;return t.getDataURIForImageURL(w,d).then(function(T){b[x].url=T,P=!0},function(T){throw{resourceType:"backgroundImage",url:T.url,msg:"Unable to load background-image "+T.url}})})).then(function(x){return{backgroundValue:n.serialize(b),hasChanges:P,errors:x}})},m=function(g,d){var b=o(g),O=l(b),P=[],x=!1;return Promise.all(O.map(function(w){return E(w.value,d).then(function(T){T.hasChanges&&(a(w.rule,w.property,T.backgroundValue),x=!0),P=P.concat(T.errors)})})).then(function(){return{hasChanges:x,errors:P}})},p=function(g,d){var b=!1,O,P;try{O=i.parse(g)}catch{O=[]}return P=S(O),t.collectAndReportErrors(P.map(function(x){var w=O[x],T=w.format||"woff";return t.binaryAjax(w.url,d).then(function(k){var A=btoa(k);w.url="data:font/"+T+";base64,"+A,b=!0},function(k){throw{resourceType:"fontFace",url:k.url,msg:"Unable to load font-face "+k.url}})})).then(function(x){return{srcDeclarationValue:i.serialize(O),hasChanges:b,errors:x}})},y=function(g,d){var b=u(g),O=[],P=!1;return Promise.all(b.map(function(x){var w=x.style.getPropertyValue("src");return p(w,d).then(function(T){T.hasChanges&&(r.changeFontFaceRuleSrc(g,x,T.srcDeclarationValue),P=!0),O=O.concat(T.errors)})})).then(function(){return{hasChanges:P,errors:O}})};e.loadAndInlineCSSResourcesForRules=function(g,d){var b=!1,O=[];return Promise.all([m,y].map(function(P){return P(g,d).then(function(x){b=b||x.hasChanges,O=O.concat(x.errors)})})).then(function(){return{hasChanges:b,errors:O}})}}(bg)),bg}var G4;function Sj(){return G4||(G4=1,function(e){var t=Bp(),r=mj(),n=yj(),i=wj(),a=Ky(),o=function(p){return t.joinUrl(p,".")},l=function(p){var y=p.map(function(g,d){return d===p.length-1&&(g={baseUrl:o(g.baseUrl)}),JSON.stringify(g)});return y},u=function(p,y){return y.cache!==!1&&y.cache!=="none"&&y.cacheBucket?t.memoize(p,l,y.cacheBucket):p},f=function(p,y,g){var d=a.rulesForCssText(p);return i.loadCSSImportsForRules(d,y,g).then(function(b){return i.loadAndInlineCSSResourcesForRules(d,g).then(function(O){var P=b.errors.concat(O.errors),x=b.hasChanges||O.hasChanges;return x&&(p=a.cssRulesToText(d)),{hasChanges:x,content:p,errors:P}})})},v=function(p,y,g){var d=p.textContent,b=u(f,y);return b(d,g,y).then(function(O){return O.hasChanges&&(p.childNodes[0].nodeValue=O.content),t.cloneArray(O.errors)})},S=function(p){var y=p.getElementsByTagName("style");return Array.prototype.filter.call(y,function(g){return!g.attributes.type||g.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(p,y){var g=S(p),d=[],b=[],O;return O=t.clone(y),O.baseUrl=O.baseUrl||t.getDocumentBaseUrl(p),Promise.all(g.map(function(P){return v(P,O,b).then(function(x){d=d.concat(x)})})).then(function(){return d})};var _=function(p,y){var g=p.parentNode,d;y=y.trim(),y&&(d=p.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(p.ownerDocument.createTextNode(y)),g.insertBefore(d,p)),g.removeChild(p)},h=function(p,y){return t.ajax(p,y).then(function(g){var d=a.rulesForCssText(g);return{content:g,cssRules:d}}).then(function(g){var d=i.adjustPathsOfCssResources(p,g.cssRules);return{content:g.content,cssRules:g.cssRules,hasChanges:d}}).then(function(g){return i.loadCSSImportsForRules(g.cssRules,[],y).then(function(d){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(g){return i.loadAndInlineCSSResourcesForRules(g.cssRules,y).then(function(d){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||d.hasChanges,errors:g.errors.concat(d.errors)}})}).then(function(g){var d=g.content;return g.hasChanges&&(d=a.cssRulesToText(g.cssRules)),{content:d,errors:g.errors}})},E=function(p,y){var g=p.attributes.href.value,d=t.getDocumentBaseUrl(p.ownerDocument),b=t.clone(y);!b.baseUrl&&d&&(b.baseUrl=d);var O=u(h,y);return O(g,b).then(function(P){return{content:P.content,errors:t.cloneArray(P.errors)}})},m=function(p){var y=p.getElementsByTagName("link");return Array.prototype.filter.call(y,function(g){return g.attributes.rel&&g.attributes.rel.value==="stylesheet"&&(!g.attributes.type||g.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(p,y){var g=m(p),d=[];return Promise.all(g.map(function(b){return E(b,y).then(function(O){_(b,O.content+`
|
|
162
|
+
`),d=d.concat(O.errors)},function(O){d.push({resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(p,y){var g=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return y.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(b){return b(p,y).then(function(O){g=g.concat(O)})})).then(function(){return g})}}(gg)),gg}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
163
|
+
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
164
|
+
* 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(j7(),gj(),vj(),Sj()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(be,function(t,r,n,i){var a=function(E){var m={},p=[];m.joinUrl=function(d,b){return d?E.resolve(d,b):b},m.getConstantUniqueIdFor=function(d){return p.indexOf(d)<0&&p.push(d),p.indexOf(d)},m.clone=function(d){var b={},O;for(O in d)d.hasOwnProperty(O)&&(b[O]=d[O]);return b};var y=function(d){return typeof d=="object"&&d!==null},g=function(d){return y(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return m.parseOptionalParameters=function(d){var b={canvas:null,options:{}};return d[0]==null||g(d[0])?(b.canvas=d[0]||null,b.options=m.clone(d[1])):b.options=m.clone(d[0]),b},m}(t),o=function(E){var m={},p=function(y,g,d){var b=y[g];return y[g]=function(){var O=Array.prototype.slice.call(arguments);return d.apply(this,[O,b])},b};return m.baseUrlRespectingXhr=function(y,g){var d=function(){var b=new y;return p(b,"open",function(O,P){var x=O.shift(),w=O.shift(),T=E.joinUrl(g,w);return P.apply(this,[x,T].concat(O))}),b};return d},m.finishNotifyingXhr=function(y){var g=0,d=0,b=!1,O,P=new Promise(function(w){O=function(){var T=g-d;T<=0&&b&&w({totalCount:g})}}),x=function(){var w=new y;return p(w,"send",function(T,k){return g+=1,k.apply(this,arguments)}),w.addEventListener("load",function(){d+=1,O()}),w};return x.waitForRequestsToFinish=function(){return b=!0,O(),P},x},m}(a),l=function(){var E={},m=function(x){return Array.prototype.slice.call(x)};E.addClassName=function(x,w){x.className+=" "+w},E.addClassNameRecursively=function(x,w){E.addClassName(x,w),x.parentNode!==x.ownerDocument&&E.addClassNameRecursively(x.parentNode,w)};var p=function(x,w){var T=x.parentStyleSheet,k=m(T.cssRules).indexOf(x);T.insertRule(w,k+1),T.deleteRule(k)},y=function(x,w){var T=x.cssText.replace(/^[^\{]+/,""),k=w+" "+T;p(x,k)},g=function(x){return m(x).reduce(function(w,T){return w+T.cssText},"")},d=function(x){x.textContent=g(x.sheet.cssRules)},b=function(x){var w=document.implementation.createHTMLDocument(""),T=document.createElement("style");T.textContent=x.textContent,w.body.appendChild(T),x.sheet=T.sheet},O=function(x){return"((?:^|[^.#:\\w])|(?=\\W))("+x.join("|")+")(?=\\W|$)"},P=function(x,w,T){var k=O(w);m(x.querySelectorAll("style")).forEach(function(A){typeof A.sheet>"u"&&b(A);var R=m(A.sheet.cssRules).filter(function(F){return F.selectorText&&new RegExp(k,"i").test(F.selectorText)});R.length&&(R.forEach(function(F){var H=F.selectorText.replace(new RegExp(k,"gi"),function(Y,$,I){return $+T(I)});H!==F.selectorText&&y(F,H)}),d(A))})};return E.rewriteCssSelectorWith=function(x,w,T){P(x,[w],function(){return T})},E.lowercaseCssTypeSelectors=function(x,w){P(x,w,function(T){return T.toLowerCase()})},E.findHtmlOnlyNodeNames=function(x){var w=x.ownerDocument.createTreeWalker(x,NodeFilter.SHOW_ELEMENT),T={},k={},A;do A=w.currentNode.tagName.toLowerCase(),w.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?T[A]=!0:k[A]=!0;while(w.nextNode());return Object.keys(T).filter(function(R){return!k[R]})},E}(),u=function(E){var m={},p=function(g){return Array.prototype.slice.call(g)},y={active:!0,hover:!0,focus:!1,target:!1};return m.fakeUserAction=function(g,d,b){var O=g.querySelector(d),P=":"+b,x="rasterizehtml"+b;O&&(y[b]?E.addClassNameRecursively(O,x):E.addClassName(O,x),E.rewriteCssSelectorWith(g,P,"."+x))},m.persistInputValues=function(g){var d=g.querySelectorAll("input"),b=g.querySelectorAll("textarea"),O=function(P){return P.type==="checkbox"||P.type==="radio"};p(d).filter(O).forEach(function(P){P.checked?P.setAttribute("checked",""):P.removeAttribute("checked")}),p(d).filter(function(P){return!O(P)}).forEach(function(P){P.setAttribute("value",P.value)}),p(b).forEach(function(P){P.textContent=P.value})},m.rewriteTagNameSelectorsToLowerCase=function(g){E.lowercaseCssTypeSelectors(g,E.findHtmlOnlyNodeNames(g))},m}(l),f=function(E,m,p,y){var g={},d=function(I,U,W,M){var j=I.createElement(U);return j.style.visibility="hidden",j.style.width=W+"px",j.style.height=M+"px",j.style.position="absolute",j.style.top=-1e4-M+"px",j.style.left=-1e4-W+"px",I.getElementsByTagName("body")[0].appendChild(j),j},b=function(I){return I>0?new Promise(function(U){setTimeout(U,I)}):Promise.resolve()};g.executeJavascript=function(I,U){return new Promise(function(W){var M=d(y.document,"iframe",U.width,U.height),j=I.outerHTML,B=[],N=U.executeJsTimeout||0,G=function(){y.document.getElementsByTagName("body")[0].removeChild(M)},K=function(){var Z=M.contentDocument;W({document:Z,errors:B,cleanUp:G})},q=M.contentWindow.XMLHttpRequest,z=m.finishNotifyingXhr(q),X=m.baseUrlRespectingXhr(z,U.baseUrl);M.onload=function(){b(N).then(z.waitForRequestsToFinish).then(K)},M.contentDocument.open(),M.contentWindow.XMLHttpRequest=X,M.contentWindow.onerror=function(Z){B.push({resourceType:"scriptExecution",msg:Z})},M.contentDocument.write("<!DOCTYPE html>"),M.contentDocument.write(j),M.contentDocument.close()})};var O=function(I,U,W){var M=I.createElement("iframe");return M.style.width=U+"px",M.style.height=W+"px",M.style.visibility="hidden",M.style.position="absolute",M.style.top=-1e4-W+"px",M.style.left=-1e4-U+"px",M.style.borderWidth=0,M.sandbox="allow-same-origin",M.scrolling="no",M},P=function(I,U,W){var M=Math.floor(I/W),j=Math.floor(U/W);return O(y.document,M,j)},x=function(I,U,W,M){return{width:Math.max(I.width*M,U),height:Math.max(I.height*M,W)}},w=function(I,U){var W=I.querySelector(U);if(W)return W;if(I.ownerDocument.querySelector(U)===I)return I;throw{message:"Clipping selector not found"}},T=function(I,U,W,M,j){var B=Math.max(I.scrollWidth,I.clientWidth),N=Math.max(I.scrollHeight,I.clientHeight),G,K,q,z,X,Z,J,te;return U?(Z=w(I,U),J=Z.getBoundingClientRect(),G=J.top,K=J.left,q=J.width,z=J.height):(G=0,K=0,q=B,z=N),te=x({width:q,height:z},W,M,j),X=y.getComputedStyle(I.ownerDocument.documentElement).fontSize,{left:K,top:G,width:te.width,height:te.height,viewportWidth:B,viewportHeight:N,rootFontSize:X}},k=function(I,U){var W=I.tagName;return U.querySelector(W)},A=function(I){var U=I.tagName.toLowerCase();return U==="html"||U==="body"?I.outerHTML:'<body style="margin: 0;">'+I.outerHTML+"</body>"};g.calculateDocumentContentSize=function(I,U){return new Promise(function(W,M){var j=U.zoom||1,B;B=P(U.width,U.height,j),y.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var N=B.contentDocument,G;try{G=T(k(I,N),U.clip,U.width,U.height,j),W(G)}catch(K){M(K)}finally{y.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(A(I)),B.contentDocument.close()})},g.parseHtmlFragment=function(I){var U=y.document.implementation.createHTMLDocument("");U.documentElement.innerHTML=I;var W=U.querySelector("body").firstChild;if(!W)throw"Invalid source";return W};var R=function(I,U){var W=/<html((?:\s+[^>]*)?)>/im.exec(U),M=y.document.implementation.createHTMLDocument(""),j,B,N,G;if(W)for(j="<div"+W[1]+"></div>",M.documentElement.innerHTML=j,N=M.querySelector("div"),B=0;B<N.attributes.length;B++)G=N.attributes[B],I.documentElement.setAttribute(G.name,G.value)};g.parseHTML=function(I){var U=y.document.implementation.createHTMLDocument("");return U.documentElement.innerHTML=I,R(U,I),U};var F=function(I){try{return p.failOnParseError(I)}catch(U){throw{message:"Invalid source",originalError:U}}};g.validateXHTML=function(I){var U=new DOMParser,W=U.parseFromString(I,"application/xml");F(W)};var H=null,Y=function(I,U){return U==="none"||U==="repeated"?((H===null||U!=="repeated")&&(H=Date.now()),I+"?_="+H):I},$=function(I,U){return new Promise(function(W,M){var j=new window.XMLHttpRequest,B=E.joinUrl(U.baseUrl,I),N=Y(B,U.cache),G=function(K){M({message:"Unable to load page",originalError:K})};j.addEventListener("load",function(){j.status===200||j.status===0?W(j.responseXML):G(j.statusText)},!1),j.addEventListener("error",function(K){G(K)},!1);try{j.open("GET",N,!0),j.responseType="document",j.send(null)}catch(K){G(K)}})};return g.loadDocument=function(I,U){return $(I,U).then(function(W){return F(W)})},g}(a,o,n,window),v=function(E){var m={},p=function(k,A){return A?URL.createObjectURL(new Blob([k],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(k)},y=function(k){k instanceof Blob&&URL.revokeObjectURL(k)},g='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(k){return new Promise(function(A,R){var F=document.createElement("canvas"),H=new Image;H.onload=function(){var Y=F.getContext("2d");try{Y.drawImage(H,0,0),F.toDataURL("image/png"),A(!0)}catch{A(!1)}},H.onerror=R,H.src=k})},b=function(){var k=p(g,!0);return d(k).then(function(A){return y(k),A?!1:d(p(g,!1)).then(function(R){return R})},function(){return!1})},O=function(){if(E.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},P=function(){return new Promise(function(k,A){O()&&E.URL?b().then(function(R){k(!R)},function(){A()}):k(!1)})},x,w=function(){return x===void 0&&(x=P()),x},T=function(k){return w().then(function(A){return p(k,A)})};return m.renderSvg=function(k){return new Promise(function(A,R){var F,H,Y=function(){H.onload=null,H.onerror=null},$=function(){F&&y(F)};H=new Image,H.onload=function(){Y(),$(),A(H)},H.onerror=function(){$(),R()},T(k).then(function(I){F=I,H.src=F},R)})},m}(window),S=function(E,m,p,y){var g={},d=function(k,A){var R=A||1,F={width:k.width,height:k.height,"font-size":k.rootFontSize};return R!==1&&(F.style="transform:scale("+R+"); transform-origin: 0 0;"),F},b=function(k){var A,R,F,H;A=Math.round(k.viewportWidth),R=Math.round(k.viewportHeight),F=-k.left,H=-k.top;var Y={x:F,y:H,width:A,height:R};return Y},O=function(k){var A=k.style||"";k.style=A+"float: left;"},P=function(k){k.externalResourcesRequired=!0},x=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},w=function(k){var A=Object.keys(k);return A.length?" "+A.map(function(R){return R+'="'+k[R]+'"'}).join(" "):""},T=function(k,A,R){var F=y.serializeToString(k);m.validateXHTML(F);var H=b(A);return O(H),P(H),'<svg xmlns="http://www.w3.org/2000/svg"'+w(d(A,R))+">"+x()+"<foreignObject"+w(H)+">"+F+"</foreignObject></svg>"};return g.getSvgForDocument=function(k,A,R){return p.rewriteTagNameSelectorsToLowerCase(k),T(k,A,R)},g.drawDocumentAsSvg=function(k,A){return["hover","active","focus","target"].forEach(function(R){A[R]&&p.fakeUserAction(k,A[R],R)}),m.calculateDocumentContentSize(k,A).then(function(R){return g.getSvgForDocument(k,R,A.zoom)})},g}(a,f,u,r),_=function(E,m,p,y,g,d){var b={},O=function(k){return{message:"Error rendering page",originalError:k}},P=function(k){return g.renderSvg(k).then(function(A){return{image:A,svg:k}},function(A){throw O(A)})},x=function(k,A){try{A.getContext("2d").drawImage(k,0,0)}catch(R){throw O(R)}},w=function(k,A,R){return y.drawDocumentAsSvg(k,R).then(P).then(function(F){return A&&x(F.image,A),F})},T=function(k,A){return m.executeJavascript(k,A).then(function(R){var F=R.document;return p.persistInputValues(F),{document:F,errors:R.errors,cleanUp:R.cleanUp}})};return b.rasterize=function(k,A,R){var F;return F=E.clone(R),F.inlineScripts=R.executeJs===!0,d.inlineReferences(k,F).then(function(H){return R.executeJs?T(k,R).then(function(Y){return{element:Y.document.documentElement,errors:H.concat(Y.errors),cleanUp:Y.cleanUp}}):{element:k,errors:H,cleanUp:function(){}}}).then(function(H){return w(H.element,A,R).then(function(Y){return H.cleanUp(),{image:Y.image,svg:Y.svg,errors:H.errors}})})},b}(a,f,u,S,v,i),h=function(E,m,p){var y={},g=function(x,w){var T=300,k=200,A=x?x.width:T,R=x?x.height:k,F=w.width!==void 0?w.width:A,H=w.height!==void 0?w.height:R;return{width:F,height:H}},d=function(x){var w=g(x.canvas,x.options),T;return T=E.clone(x.options),T.width=w.width,T.height=w.height,T};y.drawDocument=function(){var x=arguments[0],w=Array.prototype.slice.call(arguments,1),T=E.parseOptionalParameters(w),k=x.documentElement?x.documentElement:x;return p.rasterize(k,T.canvas,d(T))};var b=function(x,w,T){var k=m.parseHTML(x);return y.drawDocument(k,w,T)};y.drawHTML=function(){var x=arguments[0],w=Array.prototype.slice.call(arguments,1),T=E.parseOptionalParameters(w);return b(x,T.canvas,T.options)};var O=function(x,w,T){var k=document.implementation.createHTMLDocument("");k.replaceChild(x.documentElement,k.documentElement);var A=T?E.clone(T):{};return T.baseUrl||(A.baseUrl=w),{document:k,options:A}},P=function(x,w,T){return m.loadDocument(x,T).then(function(k){var A=O(k,x,T);return y.drawDocument(A.document,w,A.options)})};return y.drawURL=function(){var x=arguments[0],w=Array.prototype.slice.call(arguments,1),T=E.parseOptionalParameters(w);return P(x,T.canvas,T.options)},y}(a,f,_);return h})})(M7);var Ej=M7.exports;(function(e){var t=be&&be.__createBinding||(Object.create?function(f,v,S,_){_===void 0&&(_=S);var h=Object.getOwnPropertyDescriptor(v,S);h&&!("get"in h?!v.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return v[S]}}),Object.defineProperty(f,_,h)}:function(f,v,S,_){_===void 0&&(_=S),f[_]=v[S]}),r=be&&be.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),n=be&&be.__importStar||function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var S in f)S!=="default"&&Object.prototype.hasOwnProperty.call(f,S)&&t(v,f,S);return r(v,f),v};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=void 0;const i=n(Ej),a=`
|
|
165
|
+
<style>
|
|
166
|
+
html, body {
|
|
167
|
+
padding: 0;
|
|
168
|
+
margin: 0;
|
|
169
|
+
}
|
|
170
|
+
p {
|
|
171
|
+
margin: 0;
|
|
172
|
+
padding: 0
|
|
173
|
+
}
|
|
174
|
+
ul {
|
|
175
|
+
list-style-position: inside;
|
|
176
|
+
margin: 0;
|
|
177
|
+
}
|
|
178
|
+
</style>
|
|
179
|
+
`,o=document.createElement("div");function l(f){const v=document.createElement("div");v.innerHTML=f,v.style.display="inline-block",v.style.position="fixed",v.style.top="0px",v.style.left="0px",v.style.zIndex="1000",o.appendChild(v);const S=v.getBoundingClientRect();return o.removeChild(v),{width:S.width,height:S.height}}async function u({html:f,width:v,height:S,fontFamily:_,padding:h,font:E,pixelRatio:m}){const p=document.createElement("canvas");_==="Arial"||E||(f+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${_}" rel="stylesheet">`),E&&(f+=`<style>@font-face {font-family: '${E.fontFamily}'; src: url("${E.url}")}</style>`),f+=a;const y=await i.drawHTML(`<div style="padding: ${h}px;">${f}</div>`,p,{width:v+2*h,height:S+2*h});p.width=(v+2*h)*m,p.height=(S+2*h)*m;const g=p.getContext("2d");return g==null||g.drawImage(y.image,0,0,y.image.width*m,y.image.height*m),p}o.id="polotno-hidden-do-not-touch",o.style.overflow="hidden",o.style.position="relative",document.body.appendChild(o),o.innerHTML=`<style>
|
|
180
|
+
#polotno-hidden-do-not-touch p {
|
|
181
|
+
margin: 0;
|
|
182
|
+
padding: 0
|
|
183
|
+
}
|
|
184
|
+
#polotno-hidden-do-not-touch ul {
|
|
185
|
+
list-style-position: inside;
|
|
186
|
+
margin: 0;
|
|
187
|
+
}
|
|
188
|
+
</style>`,e.detectSize=l,e.htmlToCanvas=u})(R7);var Xy={},D7={};(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 b=r(d),O=b.data;return b.data="",O},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,b)=>{let O="",P="",x="";for(let w in d){let T=d[w];w[0]=="@"?w[1]=="i"?O=w+" "+T+";":P+=w[1]=="f"?o(T,w):w+"{"+o(T,w[1]=="k"?"":b)+"}":typeof T=="object"?P+=o(T,b?b.replace(/([^,])+/g,k=>w.replace(/(^:.*)|([^,])+/g,A=>/&/.test(A)?A.replace(/&/g,k):k?k+" "+A:A)):w):T!=null&&(w=w.replace(/[A-Z]/g,"-$&").toLowerCase(),x+=o.p?o.p(w,T):w+":"+T+";")}return O+(b&&x?b+"{"+x+"}":x)+P},l={},u=d=>{if(typeof d=="object"){let b="";for(let O in d)b+=O+u(d[O]);return b}return d},f=(d,b,O,P,x)=>{let w=u(d),T=l[w]||(l[w]=(k=>{let A=0,R=11;for(;A<k.length;)R=101*R+k.charCodeAt(A++)>>>0;return"go"+R})(w));if(!l[T]){let k=w!==d?d:(A=>{let R,F=[{}];for(;R=i.exec(A.replace(a,""));)R[4]?F.shift():R[3]?F.unshift(F[0][R[3]]=F[0][R[3]]||{}):F[0][R[1]]=R[2];return F[0]})(d);l[T]=o(x?{["@keyframes "+T]:k}:k,O?"":"."+T)}return((k,A,R)=>{A.data.indexOf(k)==-1&&(A.data=R?k+A.data:A.data+k)})(l[T],b,P),T},v=(d,b,O)=>d.reduce((P,x,w)=>{let T=b[w];if(T&&T.call){let k=T(O),A=k&&k.props&&k.props.className||/^go/.test(k)&&k;T=A?"."+A:k&&typeof k=="object"?k.props?"":o(k,""):k===!1?"":k}return P+x+(T??"")},"");function S(d){let b=this||{},O=d.call?d(b.p):d;return f(O.unshift?O.raw?v(O,[].slice.call(arguments,1),b.p):O.reduce((P,x)=>Object.assign(P,x&&x.call?x(b.p):x),{}):O,r(b.target),b.g,b.o,b.k)}e.extractCss=n,e.css=S;let _,h,E,m=S.bind({g:1}),p=S.bind({k:1});function y(d,b,O,P){o.p=b,_=d,h=O,E=P}function g(d,b){let O=this||{};return function(){let P=arguments;function x(w,T){let k=Object.assign({},w),A=k.className||x.className;O.p=Object.assign({theme:h&&h()},k),O.o=/ *go\d+/.test(A),k.className=S.apply(O,P)+(A?" "+A:""),b&&(k.ref=T);let R=d;return d[0]&&(R=k.as||d,delete k.as),E&&R[0]&&E(k),_(R,k)}return b?b(x):x}}e.glob=m,e.keyframes=p,e.setup=y,e.styled=g})(D7);var Oj=be&&be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xy,"__esModule",{value:!0});const Pj=Oj(Qe),V4=D7;(0,V4.setup)(Pj.default.createElement),Xy.default=V4.styled;(function(e){var t=be&&be.__createBinding||(Object.create?function($,I,U,W){W===void 0&&(W=U);var M=Object.getOwnPropertyDescriptor(I,U);M&&!("get"in M?!I.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return I[U]}}),Object.defineProperty($,W,M)}:function($,I,U,W){W===void 0&&(W=U),$[W]=I[U]}),r=be&&be.__setModuleDefault||(Object.create?function($,I){Object.defineProperty($,"default",{enumerable:!0,value:I})}:function($,I){$.default=I}),n=be&&be.__importStar||function($){if($&&$.__esModule)return $;var I={};if($!=null)for(var U in $)U!=="default"&&Object.prototype.hasOwnProperty.call($,U)&&t(I,$,U);return r(I,$),I},i=be&&be.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.quillRef=void 0;const a=i(Qe),o=mi,l=_a,u=i(XI),f=i(Kn),v=n(ga),S=qn,_=Uc,h=Ry,E=zc,m=R7,p=_l,y=wl,g=Fc,d=i(Xy),b=da,O=Ny,P=n(Bc),x=yo;e.quillRef=v.observable({enabled:!1,currentFormat:{},editor:v.observable.object({instance:null},{},{deep:!1})});const w=(0,d.default)("div",a.default.forwardRef)`
|
|
189
|
+
.ql-editor {
|
|
190
|
+
outline: none;
|
|
191
|
+
}
|
|
192
|
+
ul {
|
|
193
|
+
list-style-position: inside;
|
|
194
|
+
margin: 0;
|
|
195
|
+
}
|
|
196
|
+
p {
|
|
197
|
+
line-height: auto;
|
|
198
|
+
margin: 0;
|
|
199
|
+
}
|
|
200
|
+
strong {
|
|
201
|
+
font-weight: 1800;
|
|
202
|
+
}
|
|
203
|
+
.ql-direction-rtl {
|
|
204
|
+
direction: rtl;
|
|
205
|
+
}
|
|
206
|
+
`,T=({html:$,onBlur:I,onChange:U,element:W})=>{const M=a.default.useRef(null);a.default.useEffect(()=>{if(!M.current)return;const B=new u.default(M.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["background","bold","color","font","italic","size","strike","underline","indent","align","direction"]});return e.quillRef.editor.instance=B,window.__polotnoQuill=B,B.on("text-change",()=>{B.getSelection()&&(e.quillRef.currentFormat=B.getFormat()),setTimeout(()=>{var N;U((N=M.current)===null||N===void 0?void 0:N.childNodes[0].innerHTML)},10)}),B.setSelection(0,0,"api"),B.on("selection-change",N=>{N||I(),N&&(e.quillRef.currentFormat=B.getFormat())}),M.current.childNodes[0].addEventListener("blur",N=>{var G;!((G=N.relatedTarget)===null||G===void 0)&&G.classList.contains("ql-clipboard")||I()}),()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={},delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var B;const N=e.quillRef.editor.instance;if(!N)return;const G=N.getSelection();if(((B=M.current)===null||B===void 0?void 0:B.childNodes[0].innerHTML)!==W.text){var K=N.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+$+"<p><br></p></div>");N.setContents(K),N.history.clear(),G&&(N.setSelection(G.index,G.length),e.quillRef.currentFormat=N.getFormat())}},[W.text]);const j=(0,E.useColor)(W).fill;return a.default.createElement(w,{ref:M,style:{fontSize:W.fontSize,color:j,width:W.width,fontFamily:W.fontFamily,lineHeight:W.lineHeight,letterSpacing:W.letterSpacing+"rem",textAlign:W.align},dir:(0,h.getDir)((0,O.removeTags)(W.text))})};function k($,I,U){return a.default.useMemo(()=>(0,m.detectSize)($),[$,I.width,U])}function A($){const I=$.getContext("2d").getImageData(0,0,$.width,$.height).data;for(let U=0;U<I.length;U+=4)if(I[U+3]!==0)return!0;return!1}function R($){return!A($)}function F($,{fontFamily:I="",color:U="black"}={}){let W=`color: ${U||$.fill}`;return`<div style="white-space: unset; width: ${Math.round($.width||100)}px; ${W}; font-size: ${$.fontSize}px; font-family: '${I}'; text-decoration: ${$.textDecoration}; text-align: ${$.align}; line-height: ${$.lineHeight}; letter-spacing: ${$.letterSpacing}rem; font-style: ${$.fontStyle}; font-weight: ${$.fontWeight}; -webkit-text-stroke: ${$.strokeWidth}px ${$.stroke};" contentEditable dir="${(0,h.getDir)((0,O.removeTags)($.text))}">${$.text}</div>`}const H=$=>{let I=$.fontSize;for(let U=1;U<50;U++){const W=F(Object.assign(Object.assign({},$.toJSON()),{fontSize:I}),{fontFamily:$.fontFamily}),{height:M}=(0,m.detectSize)(W);if(!($.height&&M>$.height))break;I-=.5}return I},Y=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:$,store:I})=>{const U=a.default.useRef(null),[W,M]=a.default.useState(),[j,B]=a.default.useState(!1),[N,G]=a.default.useState(!0),[K,q]=a.default.useState(!1),[z,X]=a.default.useState(!1),Z=a.default.useRef($.height),J=I.selectedElements.indexOf($)>=0,te=$.fontSize/3,{textVerticalResizeEnabled:ee}=S.flags,se=(0,h.usePrevious)($.fontFamily),[de]=(0,h.useFontLoader)(I,$.fontFamily);(0,p.useFadeIn)(U);const he=de?$.fontFamily:se!==$.fontFamily?se:"Arial",ke=(0,E.useColor)($).fill,Ie=F($,{fontFamily:he,color:ke}),{width:ue,height:ie}=k(Ie,$,de);a.default.useEffect(()=>{if(!de)return;if(!$.height)return void $.set({height:ie});const{textOverflow:me}=S.flags;if(me!=="change-font-size"||j)me==="resize"&&(ee&&$.height<ie&&I.history.ignore(()=>{$.set({height:ie})}),ee||$.height===ie||I.history.ignore(()=>{$.set({height:ie})}));else{const we=H($);we!==$.fontSize?I.history.ignore(()=>{$.set({fontSize:we})}):$.height!==ie&&(ee&&$.height<ie?I.history.ignore(()=>{$.set({height:ie})}):ee||I.history.ignore(()=>{$.set({height:ie})}))}});const _e=a.default.useRef(0);a.default.useEffect(()=>{j||K||(async()=>{_e.current++;const me=_e.current,we=(0,b.incrementLoader)(`text ${$.id}`);G(!0);let Ee=null;const Te=Y?5:1;for(let Je=0;Je<Te;Je++){if(Ee=await(0,m.htmlToCanvas)({html:Ie,width:$.width||1,height:$.height||ie||1,fontFamily:he,padding:te,pixelRatio:I._elementsPixelRatio,font:I.fonts.find(Ye=>Ye.fontFamily===he)||P.globalFonts.find(Ye=>Ye.fontFamily===he)}),me!==_e.current)return void we();R(Ee)&&Y&&await new Promise(Ye=>setTimeout(Ye,50*(Je+1)))}Ee?(M(Ee),G(!1),f.default.Util.requestAnimFrame(we)):we()})()},[Ie,j,ie,K,he,$.height,I._elementsPixelRatio]);const Se=j||N;a.default.useEffect(()=>v.autorun(()=>{const me=U.current;(0,_.applyFilter)(me,$)}),[W,Se,$.shadowColor,$.shadowOffsetX,$.shadowOffsetY,$.shadowOpacity]);let re=0;$.verticalAlign==="middle"&&(re=($.height-ie)/2),$.verticalAlign==="bottom"&&(re=$.height-ie);const ce=(0,h.getLineHeight)({fontLoaded:de,fontFamily:$.fontFamily,fontSize:$.fontSize,lineHeight:$.lineHeight}),ge=(0,x.useMobile)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:$.x,y:$.y,offsetX:$.backgroundPadding*($.fontSize*ce*.5),offsetY:$.backgroundPadding*($.fontSize*ce*.5),rotation:$.rotation,hideInExport:!$.showInExport||!$.text,listening:!1,visible:$.backgroundEnabled,opacity:$.backgroundOpacity,fill:$.backgroundColor,width:$.width+$.backgroundPadding*($.fontSize*ce),height:$.height+$.backgroundPadding*($.fontSize*ce),cornerRadius:$.backgroundCornerRadius*($.fontSize*ce*.5)}),a.default.createElement(l.Rect,{ref:U,name:"element",x:$.x,y:$.y,listening:$.selectable,rotation:$.rotation,width:$.width,height:$.height,visible:!Se,draggable:ge?$.draggable&&J:$.draggable,preventDefault:!ge||J,opacity:K?0:$.opacity,hideInExport:!$.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:me=>{$.set({x:me.target.x(),y:me.target.y()})},onDragEnd:me=>{$.set({x:me.target.x(),y:me.target.y()})},id:$.id,onDblClick:()=>{$.contentEditable&&q(!0)},onDblTap:()=>{$.contentEditable&&q(!0)},onTransformStart:me=>{B(!0),Z.current=$.height},onTransform:me=>{var we;const Ee=me.target,Te=((we=Ee.getStage())===null||we===void 0?void 0:we.findOne("Transformer")).getActiveAnchor(),Je=Te==="middle-left"||Te==="middle-right",Ye=Te==="top-center"||Te==="bottom-center",pt=Ee.scaleX();if(Je){const It=Ee.scaleX(),le=Math.max(Ee.width()*It,$.fontSize);if(Ee.width(le),Ee.scaleX(1),S.flags.textVerticalResizeEnabled){const ne=Math.max(ie,Z.current);$.set({height:ne})}$.set({width:le,x:Ee.x(),y:Ee.y()})}else if(Ye){let It=S.flags.textOverflow==="resize"?ie:$.lineHeight*$.fontSize;const le=Math.max(It,me.target.height()*me.target.scaleY());Ee.scaleY(1),$.set({x:Ee.x(),y:Ee.y(),height:le,rotation:Ee.rotation()})}else Ee.scaleX(1),Ee.scaleY(1),$.set({fontSize:$.fontSize*pt,width:Ee.width()*pt,x:Ee.x(),y:Ee.y(),rotation:Ee.rotation(),height:Ee.height()*pt})},onTransformEnd:me=>{B(!1),G(!0);const we=me.target.scaleX();me.target.scaleX(1),me.target.scaleY(1),$.set({fontSize:$.fontSize*we,width:me.target.width()*we,x:me.target.x(),y:me.target.y(),rotation:me.target.rotation(),shadowBlur:$.shadowBlur*we,shadowOffsetX:$.shadowOffsetX*we,shadowOffsetY:$.shadowOffsetY*we,strokeWidth:$.strokeWidth*we})}}),a.default.createElement(l.Image,{ref:U,image:W,x:$.x,y:$.y,offsetX:te,offsetY:te-re,listening:!1,rotation:$.rotation,width:$.width+2*te,height:$.height+2*te,visible:!Se,opacity:K?0:$.opacity,shadowEnabled:$.shadowEnabled,shadowBlur:$.shadowBlur,shadowOffsetX:$.shadowOffsetX,shadowOffsetY:$.shadowOffsetY,shadowColor:$.shadowColor,shadowOpacity:$.shadowOpacity,hideInExport:!$.showInExport}),Se&&a.default.createElement(l.Group,{x:$.x,y:$.y,rotation:$.rotation,offsetY:-re},a.default.createElement(g.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(w,{dangerouslySetInnerHTML:{__html:Ie},style:{pointerEvents:"none",display:"inline-block"}}))),K&&a.default.createElement(l.Group,{x:$.x,y:$.y,rotation:$.rotation,offsetY:-re},a.default.createElement(g.Html,null,a.default.createElement(T,{html:Ie,element:$,onChange:me=>{$.set({text:me})},onBlur:me=>{q(!1)}}))),(J||z)&&a.default.createElement(y.Highlighter,{element:$}))})})(T7);var F7={},Zy={},Up={};(function(e){var t=be&&be.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.getTotalClientRect=e.getClientRect=void 0;const r=t(Kn);function n(o,l,u,f,v){const S=Math.sqrt(u*u+f*f);return v+=Math.atan2(f,u),{x:o+S*Math.cos(v),y:l+S*Math.sin(v)}}function i(o){const{x:l,y:u,width:f,height:v}=o,S=r.default.Util.degToRad(o.rotation),_=n(l,u,0,0,S),h=n(l,u,f,0,S),E=n(l,u,f,v,S),m=n(l,u,0,v,S),p=Math.min(_.x,h.x,E.x,m.x),y=Math.min(_.y,h.y,E.y,m.y),g=Math.max(_.x,h.x,E.x,m.x),d=Math.max(_.y,h.y,E.y,m.y);return{x:p,y,width:g-p,height:d-y,minX:p,minY:y,maxX:g,maxY:d}}function a(o){const l=o.map(_=>i(_)),u=Math.min(...l.map(_=>_.minX)),f=Math.min(...l.map(_=>_.minY)),v=Math.max(...l.map(_=>_.maxX)),S=Math.max(...l.map(_=>_.maxY));return{x:u,y:f,width:v-u,height:S-f,minX:u,minY:f,maxX:v,maxY:S}}e.getClientRect=i,e.getTotalClientRect=a})(Up);(function(e){var t=be&&be.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=void 0;const r=t(Qe),n=t(Kn),i=Up;var a=5;function o(S){const _=S.__getNodeRect(),h=(0,i.getClientRect)(Object.assign(Object.assign({},_),{rotation:n.default.Util.radToDeg(_.rotation)})),E=S.getAbsolutePosition();return{vertical:[{guide:h.x,offset:E.x-h.x,snap:"start"},{guide:h.x+h.width/2,offset:E.x-h.x-h.width/2,snap:"center"},{guide:h.x+h.width,offset:E.x-h.x-h.width,snap:"end"}],horizontal:[{guide:h.y,offset:E.y-h.y,snap:"start"},{guide:h.y+h.height/2,offset:E.y-h.y-h.height/2,snap:"center"},{guide:h.y+h.height,offset:E.y-h.y-h.height,snap:"end"}]}}function l(S,_){var h=[],E=[];S.vertical.forEach(b=>{_.vertical.forEach(O=>{var P=Math.abs(b-O.guide);P<a&&h.push({lineGuide:b,diff:P,snap:O.snap,offset:O.offset})})}),S.horizontal.forEach(b=>{_.horizontal.forEach(O=>{var P=Math.abs(b-O.guide);P<a&&E.push({lineGuide:b,diff:P,snap:O.snap,offset:O.offset})})});var m=[];const p=h.sort((b,O)=>b.diff-O.diff),y=E.sort((b,O)=>b.diff-O.diff);var g=p[0],d=y[0];return g&&p.filter(b=>Math.abs(b.diff-g.diff)<.1).forEach(b=>{m.push(Object.assign({orientation:"V"},b))}),d&&y.filter(b=>Math.abs(b.diff-d.diff)<.1).forEach(b=>{m.push(Object.assign({orientation:"H"},b))}),m}function u(S){const _=g=>g.hasName("element")||g.hasName("page-background")||g.hasName("elements-area");function h(g){var d;const b=(d=S.current)===null||d===void 0?void 0:d.getStage();var O=[],P=[];return b.find(_).forEach(x=>{if(!(g.indexOf(x)>=0)){var w=x.getClientRect({skipShadow:!0,skipStroke:!0});O.push(w.x,w.x+w.width,w.x+w.width/2),P.push(w.y,w.y+w.height,w.y+w.height/2)}}),{vertical:O,horizontal:P}}function E(g){var d;const b=(d=S.current)===null||d===void 0?void 0:d.getLayer(),O=b==null?void 0:b.children.find(P=>P.name()==="line-guides");g.forEach(P=>{if(P.orientation==="H"){var x=new n.default.Line({points:[-6e3,P.lineGuide,6e3,P.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});O==null||O.add(x),b.batchDraw()}else P.orientation==="V"&&(x=new n.default.Line({points:[P.lineGuide,-6e3,P.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),O==null||O.add(x))})}const m=g=>{g.target.getLayer().children.find(w=>w.name()==="line-guides").destroyChildren();var d=l(h(g.target.nodes()),o(g.target));if(!d.length)return;E(d);const b=g.target.getAbsolutePosition(),O=Object.assign({},b);d.forEach(w=>{switch(w.snap){case"start":case"center":case"end":switch(w.orientation){case"V":O.x=w.lineGuide+w.offset;break;case"H":O.y=w.lineGuide+w.offset}}});const P=O.x-b.x,x=O.y-b.y;g.evt.ctrlKey||g.evt.metaKey||g.target.nodes().forEach(w=>{const T=w.getAbsolutePosition();w.setAbsolutePosition({x:T.x+P,y:T.y+x})})},p=(g,d,b)=>{const O=S.current,P=O.getLayer();if(P.children.find(R=>R.name()==="line-guides").destroyChildren(),O.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(d.x-g.x,2)+Math.pow(d.y-g.y,2))>50||!P)return d;var x=l(h(O.nodes()),{vertical:[{guide:d.x,offset:0,snap:"start"}],horizontal:[{guide:d.y,offset:0,snap:"start"}]});if(!x.length||(E(x),b.ctrlKey||b.metaKey))return d;let w=d.x,T=d.x;x.forEach(R=>{switch(R.orientation){case"V":w=R.lineGuide;break;case"H":T=R.lineGuide}});const k=Math.abs(d.x-w)<10,A=Math.abs(d.y-T)<10;return k&&!A?{x:w,y:g.y}:A&&!k?{x:g.x,y:T}:k&&A?{x:w,y:T}:d},y=g=>{if(!g.target)return;const d=g.target.getLayer();d.children.find(b=>b.name()==="line-guides").destroyChildren(),d.batchDraw()};r.default.useEffect(()=>{S.current&&(S.current.anchorDragBoundFunc(p),S.current.on("dragstart",()=>{setTimeout(()=>{const g=[...n.default.DD._dragElements.entries()];g.reverse(),n.default.DD._dragElements.clear(),g.forEach(([d,b])=>{n.default.DD._dragElements.set(d,b)})})}),S.current.on("dragmove",m),S.current.on("dragend",y),S.current.on("transformend",y),S.current.on("transform",g=>{var d,b;g.evt.ctrlKey||g.evt.metaKey?(d=S.current)===null||d===void 0||d.rotationSnapTolerance(0):(b=S.current)===null||b===void 0||b.rotationSnapTolerance(5)}))},[])}function f(S){return{vertical:[{guide:S.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:S.absolutePosition().y,offset:0,snap:"center"}]}}function v(S,_,h){const E=y=>y.hasName("element")||y.hasName("line-anchor")||y.hasName("page-background")||y.hasName("elements-area"),m=y=>{y.target.getLayer().children.find(x=>x.name()==="line-guides").destroyChildren();var g=l(function(x){var w;const T=(w=S.current)===null||w===void 0?void 0:w.getStage();var k=[],A=[];return T.find(E).forEach(R=>{if(!(x.indexOf(R)>=0)){var F=R.getClientRect({skipShadow:!0,skipStroke:!0});R.hasName("line-anchor")&&(F={x:R.absolutePosition().x,y:R.absolutePosition().y,width:0,height:0}),k.push(F.x,F.x+F.width,F.x+F.width/2),A.push(F.y,F.y+F.height,F.y+F.height/2)}}),{vertical:k,horizontal:A}}([y.target,..._.map(x=>x.current)]),f(y.target));if(!g.length)return;(function(x){var w;const T=(w=S.current)===null||w===void 0?void 0:w.getLayer(),k=T==null?void 0:T.children.find(A=>A.name()==="line-guides");x.forEach(A=>{if(A.orientation==="H"){var R=new n.default.Line({points:[-6e3,A.lineGuide,6e3,A.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});k==null||k.add(R),T.batchDraw()}else A.orientation==="V"&&(R=new n.default.Line({points:[A.lineGuide,-6e3,A.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),k==null||k.add(R))})})(g);const d=y.target.getAbsolutePosition(),b=Object.assign({},d);g.forEach(x=>{switch(x.snap){case"start":case"center":case"end":switch(x.orientation){case"V":b.x=x.lineGuide+x.offset;break;case"H":b.y=x.lineGuide+x.offset}}});const O=b.x-d.x,P=b.y-d.y;if(!(y.evt.ctrlKey||y.evt.metaKey)){const x=y.target.getAbsolutePosition();y.target.absolutePosition({x:x.x+O,y:x.y+P})}},p=y=>{if(!y.target)return;const g=y.target.getLayer();g.children.find(d=>d.name()==="line-guides").destroyChildren(),g.batchDraw()};r.default.useEffect(()=>{S.current&&(S.current.on("dragmove",m),S.current.on("dragend",p))},h)}e.useSnap=u,e.useAnchorSnap=v})(Zy);(function(e){var t=be&&be.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(Qe),n=mi,i=_a,a=zc,o=Fc,l=wl,u=Zy,f=yo;function v(E){const{x:m,y:p,width:y,height:g,rotation:d}=E.a,b=d*Math.PI/180,O={x:m+g/2*Math.cos(b+Math.PI/2),y:p+g/2*Math.sin(b+Math.PI/2)};return{middleLeft:O,middleRight:{x:O.x+y*Math.cos(b),y:O.y+y*Math.sin(b)}}}function S(E,m,p){const y=Math.sqrt(Math.pow(m.x-E.x,2)+Math.pow(m.y-E.y,2)),g=Math.atan2(m.y-E.y,m.x-E.x),d=180*g/Math.PI;return{x:E.x+Math.cos(g-Math.PI/2)*p/2,y:E.y+Math.sin(g-Math.PI/2)*p/2,width:y,height:p,rotation:d}}e.getMiddlePoints=v,e.getLinePositionFromMiddlePoints=S;const _=(E,m)=>({offsetX:5/E,offsetY:5/E,width:10/E,height:10/E,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:p=>{p.target.getStage().container().style.cursor="crosshair"},onMouseLeave:p=>{p.target.getStage().container().style.cursor=""},onDragStart:p=>{m.history.startTransaction()},onDragEnd:p=>{m.history.endTransaction()}}),h=(0,n.observer)(({element:E,type:m})=>{const p=(0,a.useColor)(E,E.a.color,"fill"),y=(0,a.useColor)(E,E.a.color,"stroke"),g=Object.assign(Object.assign(Object.assign({strokeWidth:E.height,lineCap:"round",lineJoin:"round"},y),p),{opacity:E.a.opacity,hideInExport:!E.showInExport});return r.default.createElement(r.default.Fragment,null,m==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height]},g)),m==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*E.height,2*-E.height,0,0,3*E.height,2*E.height],closed:!0},g)),m==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,0,2*E.height],closed:!0},g)),m==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-E.height,4*E.height,2*-E.height,4*E.height,2*E.height,0,2*E.height],closed:!0},g)),m==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*E.height,y:0,radius:2*E.height},g)))});e.LineElement=(0,n.observer)(({element:E,store:m})=>{const p=r.default.useRef(null),y=r.default.useRef(null),g=r.default.useRef(null),d=E.selectable||m.role==="admin",b=(0,f.useMobile)(),[O,P]=r.default.useState(!1),x=m.selectedElements.indexOf(E)>=0&&m.selectedElements.length===1,{middleLeft:w,middleRight:T}=v(E);(0,u.useAnchorSnap)(y,[p],[x]),(0,u.useAnchorSnap)(g,[p],[x]);const k=(0,a.useColor)(E,E.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:p,name:"element",id:E.id,x:E.a.x,y:E.a.y,points:[0,0,E.a.width,0],offsetY:-E.a.height/2,strokeWidth:E.a.height,hitStrokeWidth:Math.max(E.a.height,20),dash:E.dash.map(A=>A*E.a.height)},k,{rotation:E.a.rotation,opacity:E.animated("opacity"),shadowEnabled:E.shadowEnabled,shadowBlur:E.shadowBlur,shadowOffsetX:E.shadowOffsetX,shadowOffsetY:E.shadowOffsetY,shadowColor:E.shadowColor,shadowOpacity:E.shadowOpacity,listening:d,draggable:b?E.draggable&&x:E.draggable,preventDefault:!b||x,hideInExport:!E.showInExport,onMouseEnter:()=>{P(!0)},onMouseLeave:()=>{P(!1)},onDragMove:A=>{E.set({x:A.target.x(),y:A.target.y()})},onDragEnd:A=>{E.set({x:A.target.x(),y:A.target.y()})},onTransform:A=>{const R=A.target.scaleX();A.target.scaleX(1),A.target.scaleY(1),E.set({height:E.height*R,width:E.width*R,x:A.target.x(),y:A.target.y(),rotation:A.target.rotation()})}})),r.default.createElement(i.Group,{x:w.x,y:w.y,rotation:E.rotation,hideInExport:!E.showInExport},r.default.createElement(h,{element:E,type:E.startHead})),r.default.createElement(i.Group,{x:T.x,y:T.y,rotation:E.rotation+180},r.default.createElement(h,{element:E,type:E.endHead})),O&&!x&&r.default.createElement(l.Highlighter,{element:E}),x&&E.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:x},r.default.createElement(i.Rect,Object.assign({x:w.x,y:w.y,ref:y,name:"line-anchor"},_(m.scale,m),{onDragMove:A=>{const R=S(A.target.position(),T,E.height);E.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:T.x,y:T.y,ref:g,name:"line-anchor"},_(m.scale,m),{onDragMove:A=>{const R=S(w,A.target.position(),E.height);E.set({x:R.x,y:R.y,width:R.width,rotation:R.rotation})}})))))})})(F7);var z7={};(function(e){var t=be&&be.__createBinding||(Object.create?function(M,j,B,N){N===void 0&&(N=B);var G=Object.getOwnPropertyDescriptor(j,B);G&&!("get"in G?!j.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return j[B]}}),Object.defineProperty(M,N,G)}:function(M,j,B,N){N===void 0&&(N=B),M[N]=j[B]}),r=be&&be.__setModuleDefault||(Object.create?function(M,j){Object.defineProperty(M,"default",{enumerable:!0,value:j})}:function(M,j){M.default=j}),n=be&&be.__importStar||function(M){if(M&&M.__esModule)return M;var j={};if(M!=null)for(var B in M)B!=="default"&&Object.prototype.hasOwnProperty.call(M,B)&&t(j,M,B);return r(j,M),j},i=be&&be.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Qe),o=mi,l=ga,u=_a,f=i(jp),v=i(Kn),S=Fc,_=wl,h=da,E=n(qs),m=qn,p=Uc,y=_l,g=yo;function d(){return document.createElement("canvas")}async function b(M){if(!(M.indexOf("data:image/svg+xml")>=0||M.indexOf(".svg")>=0))return M;const j=await E.urlToString(M),B=E.fixSize(j);return E.svgToURL(B)}const O=M=>{const[j,B]=a.default.useState(M);return a.default.useEffect(()=>{(async()=>{const N=await b(M);N!==j&&B(N)})()},[M]),j},P=new window.Image;P.src=E.svgToURL(`
|
|
207
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
208
|
+
<path opacity="0.6" d="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"/>
|
|
209
|
+
<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"/>
|
|
210
|
+
</svg>
|
|
211
|
+
`);const x=new window.Image;x.src=E.svgToURL(`
|
|
212
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
213
|
+
<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"/>
|
|
214
|
+
<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"/>
|
|
215
|
+
<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"/>
|
|
216
|
+
<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"/>
|
|
217
|
+
</svg>
|
|
218
|
+
`);function w(M,j,B,N,G,K,q){for(var z=new ImageData(j,B),X=new Int32Array(M.data.buffer),Z=M.width,J=new Int32Array(z.data.buffer),te=z.width,ee=j/K,se=B/q,de=Math.round(1/ee),he=Math.round(1/se),ke=de*he,Ie=0;Ie<z.height;Ie++)for(var ue=0;ue<te;ue++){for(var ie=N+Math.round(ue/ee)+(G+Math.round(Ie/se))*Z,_e=0,Se=0,re=0,ce=0,ge=0;ge<he;ge++)for(var me=0;me<de;me++){var we=X[ie+me+ge*Z];_e+=we<<24>>>24,Se+=we<<16>>>24,re+=we<<8>>>24,ce+=we>>>24}_e=Math.round(_e/ke),Se=Math.round(Se/ke),re=Math.round(re/ke),ce=Math.round(ce/ke),J[ue+Ie*te]=ce<<24|re<<16|Se<<8|_e}return z}function T(M,j){var B,N;const G=d();G.width=M.width,G.height=M.height,(B=G.getContext("2d"))===null||B===void 0||B.drawImage(M,0,0,G.width,G.height);const K=w(G.getContext("2d").getImageData(0,0,G.width,G.height),Math.floor(G.width*j),Math.floor(G.height*j),0,0,G.width,G.height);return G.width=Math.floor(G.width*j),G.height=Math.floor(G.height*j),(N=G.getContext("2d"))===null||N===void 0||N.putImageData(K,0,0),G}const k=(M,j,B,N,G=0,K=!1)=>{const q=Math.floor(Math.max(M.width*N,1)),z=Math.floor(Math.max(M.height*N,1)),X=Math.min(G*N,q/2,z/2),Z=Math.max(M.width/B.width,M.height/B.height)*N,J=M.page._exporting&&m.flags.imageDownScalingEnabled&&Z<1&&!K,te=B.x===0&&B.y===0&&B.width===(j==null?void 0:j.width)&&B.height===(j==null?void 0:j.height),ee=a.default.useMemo(()=>{if(!(!j||!j.width||!j.height))return te&&X===0&&!J?void 0:d()},[j,X,J,te]);return a.default.useLayoutEffect(()=>{if(!ee||!j)return;ee.width=q,ee.height=z;const se=ee.getContext("2d");if(!se)return;X&&(se.beginPath(),se.moveTo(X,0),se.lineTo(q-X,0),se.arc(q-X,X,X,3*Math.PI/2,0,!1),se.lineTo(q,z-X),se.arc(q-X,z-X,X,0,Math.PI/2,!1),se.lineTo(X,z),se.arc(X,z-X,X,Math.PI/2,Math.PI,!1),se.lineTo(0,X),se.arc(X,X,X,Math.PI,3*Math.PI/2,!1),se.clip());const de=J?T(j,Z):j,he=J?{x:Math.floor(B.x*Z),y:Math.floor(B.y*Z),width:Math.floor(B.width*Z),height:Math.floor(B.height*Z)}:B;se.drawImage(de,he.x,he.y,he.width,he.height,0,0,ee.width,ee.height)},[ee,M.width,M.height,B.x,B.y,B.width,B.height,G,N,K,M.page._exporting,J]),a.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&v.default.Util.releaseCanvas(ee)},[ee]),ee||j},A=(M,j,B,N)=>{const G=O(M.clipSrc||""),[K,q]=Y(G,"anonymous"),z=M.clipSrc?q:"loaded";(0,e.useImageLoader)(z,M.id+"-clip");const X=a.default.useMemo(()=>{if(j&&K)return d()},[j,K]);return a.default.useLayoutEffect(()=>{var Z;if(!K||!j||!j.width||!j.height||!K||!K.width||!K.height||!X)return;const J=d(),te=Math.max(M.width/K.width*B,M.height/K.height*B);J.width=K.width*te,J.height=K.height*te,(Z=J.getContext("2d"))===null||Z===void 0||Z.drawImage(K,0,0,J.width,J.height),X.width=Math.max(j.width,1),X.height=Math.max(j.height,1);const ee=X.getContext("2d");ee&&(ee.save(),ee.drawImage(J,0,0,j.width,j.height),v.default.Util.releaseCanvas(J),ee.globalCompositeOperation="source-in",ee.drawImage(j,0,0,X.width,X.height),ee.restore())},[X,j,K,M.width,M.height,B,...N]),M.clipSrc&&K?X:j},R=d(),F=(0,o.observer)(({element:M})=>{const j=Math.min(30,M.width/4,M.height/4),B=a.default.useRef(null);return a.default.useEffect(()=>{const N=B.current;if(!N)return;const G=new v.default.Animation(K=>{N.rotate(((K==null?void 0:K.timeDiff)||0)/2)},N.getLayer());return G.start(),()=>{G.stop()}}),a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,listening:!1,opacity:M.a.opacity,hideInExport:!M.showInExport},a.default.createElement(u.Rect,{width:M.width,height:M.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:B,x:M.width/2,y:M.height/2,fill:"white",outerRadius:Math.abs(j),innerRadius:Math.max(1,j-5),angle:270}))}),H=(0,o.observer)(({element:M})=>{const j="Can not load the video...",B=Math.max(10,Math.min(30,M.width/25));return a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,listening:!1,opacity:M.a.opacity,hideInExport:!M.showInExport},a.default.createElement(u.Rect,{width:M.width,height:M.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:j,fontSize:B,width:M.width,height:M.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let Y=f.default;const $=M=>{Y=M};e.setImageLoaderHook=$;const I=(M,j)=>{const B=a.default.useRef(),N=()=>{var G;(G=B.current)===null||G===void 0||G.call(B),B.current=void 0};a.default.useEffect(()=>N,[]),a.default.useLayoutEffect(()=>{M!=="loading"||B.current||(B.current=(0,h.incrementLoader)(`video ${j}`)),M!=="loading"&&N(),M==="failed"&&(0,h.triggerLoadError)(`video ${j}`)},[M])};e.useImageLoader=I;function U(M,j){for(var B=M.buffered,N=0;N<B.length;N++)if(j>=B.start(N)&&j<=B.end(N))return!0;return!1}function W(M,j,B){const N=a.default.useRef("loading"),G=a.default.useRef(),[K,q]=a.default.useState(0),z=a.default.useRef(),X=a.default.useRef(),Z=a.default.useRef();return z.current===M&&X.current===j&&Z.current===B||(N.current="loading",G.current=void 0,z.current=M,X.current=j,Z.current=B),a.default.useLayoutEffect(function(){if(M){var J=document.createElement("video");return J.addEventListener("canplay",te),J.addEventListener("error",ee),j&&(J.crossOrigin=j),B&&(J.referrerpolicy=B),J.src=M,function(){J.removeEventListener("canplay",te),J.removeEventListener("error",ee)}}function te(){N.current="loaded",G.current=J,G.current.currentTime=0,q(Math.random()),G.current.removeEventListener("canplay",te)}function ee(se){N.current="failed",G.current=void 0,q(Math.random())}},[M,j,B]),[G.current,N.current]}e.VideoElement=(0,o.observer)(({element:M,store:j})=>{var B;const[N,G]=a.default.useState(!1),K=a.default.useRef(null),q=a.default.useRef(null),[z,X]=a.default.useState(!1),Z=j.selectedElements.indexOf(M)>=0,[J,te]=a.default.useState(!1),[ee,se]=W(M.src,"anonymous");(0,e.useImageLoader)(se,M.id+"-video"),ee&&(ee.muted=!0,ee.width=ee.videoWidth,ee.height=ee.videoHeight);const de=ee||R;a.default.useEffect(()=>{ee&&j.history.ignore(()=>{M.set({duration:1e3*ee.duration})})},[ee]),a.default.useEffect(()=>{var Ae;if(!ee)return;const $e=j.isPlaying||J;if(!$e)return void ee.pause();$e&&(ee.currentTime=M.startTime*ee.duration,ee.play());const Xe=new v.default.Animation(()=>{},(Ae=K.current)===null||Ae===void 0?void 0:Ae.getLayer());Xe.start();const xt=()=>{te(!1),ee.currentTime=M.startTime*ee.duration},St=()=>{ee.currentTime>=M.endTime*ee.duration&&(ee.pause(),ee.currentTime=M.startTime*ee.duration,te(!1))};return ee.addEventListener("ended",xt),ee.addEventListener("timeupdate",St),()=>{Xe.stop(),ee.removeEventListener("ended",xt),ee.removeEventListener("timeupdate",St)}},[ee,J,j.isPlaying]);const he=a.default.useRef();a.default.useEffect(()=>(0,l.autorun)(()=>{var Ae,$e;if(ee){const Xe=(j.currentTime-M.page.startTime)%M.duration;(Math.abs(1e3*ee.currentTime-Xe)>500||!j.isPlaying)&&(ee.currentTime=Xe/1e3,j.isPlaying||ee.currentTime===0||(he.current=(0,h.incrementLoader)(`video ${M.id}`))),($e=(Ae=K.current)===null||Ae===void 0?void 0:Ae.getLayer())===null||$e===void 0||$e.batchDraw()}}),[j,ee]),a.default.useEffect(()=>{if(!ee)return;let Ae=null;const $e=()=>{var xt,St;he.current&&((St=(xt=K.current)===null||xt===void 0?void 0:xt.getLayer())===null||St===void 0||St.batchDraw(),he.current(),he.current=null),U(ee,ee.currentTime)||(Ae&&console.error("finish already exists"),Ae=(0,h.incrementLoader)(`video ${M.id}`))},Xe=()=>{Ae&&(Ae(),Ae=null)};return ee.addEventListener("timeupdate",$e),ee.addEventListener("canplay",Xe),()=>{ee.removeEventListener("timeupdate",$e),ee.removeEventListener("canplay",Xe)}},[ee,M.id,h.incrementLoader]);let{cropX:ke,cropY:Ie,cropWidth:ue,cropHeight:ie}=M;se!=="loaded"&&(ke=Ie=0,ue=ie=1);const _e=de.width*ue,Se=de.height*ie,re=M.width/M.height;let ce,ge;const me=_e/Se,we=M.type==="svg";we?(ce=_e,ge=Se):re>=me?(ce=_e,ge=_e/re):(ce=Se*re,ge=Se);const Ee={x:de.width*ke,y:de.height*Ie,width:ce,height:ge},Te=(B=M.cornerRadius)!==null&&B!==void 0?B:0;let Je=A(M,k(M,de,Ee,j._elementsPixelRatio,Te,N||M._cropModeEnabled||M.type==="svg"),j._elementsPixelRatio,[Ee,Te,j._elementsPixelRatio]);const Ye=Math.max(M.width/ce,M.height/ge);a.default.useEffect(()=>{var Ae;if(!M._cropModeEnabled)return;const $e=(Ae=K.current)===null||Ae===void 0?void 0:Ae.getStage();function Xe(St){M._cropModeEnabled&&St.target!==q.current&&M.toggleCropMode(!1)}function xt(St){M._cropModeEnabled&&St.target.parentNode!==$e.content&&M.toggleCropMode(!1)}return document.body.addEventListener("click",xt),$e==null||$e.on("click",Xe),$e==null||$e.on("tap",Xe),()=>{document.body.removeEventListener("click",xt),document.body.removeEventListener("touchstart",xt),$e==null||$e.off("click",Xe),$e==null||$e.off("click",Xe)}},[M._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(N||M._cropModeEnabled))return(0,p.applyFilter)(K.current,M),(0,l.autorun)(()=>{(0,p.applyFilter)(K.current,M)},{delay:100})},[de,N,ue,ie,M._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ae;N||M._cropModeEnabled?(Ae=K.current)===null||Ae===void 0||Ae.clearCache():(0,p.applyFilter)(K.current,M)},[N,M.width,M.height,M._cropModeEnabled]),a.default.useEffect(()=>{(0,p.applyFilter)(K.current,M)},[M.shadowEnabled,M.shadowBlur,M.cornerRadius,M.shadowColor,M.shadowOffsetX,M.shadowOffsetY,M.shadowOpacity]);const pt=a.default.useRef(null),It=a.default.useRef(null),le=a.default.useRef(null);a.default.useLayoutEffect(()=>{M._cropModeEnabled&&(It.current.nodes([pt.current]),le.current.nodes([q.current]))},[M._cropModeEnabled]);const ne=Ae=>{Math.round(Ae.target.x())>0&&(Ae.target.x(0),Ae.target.scaleX(1)),Math.round(Ae.target.y())>0&&(Ae.target.y(0),Ae.target.scaleY(1));const $e=Ae.target.width()*Ae.target.scaleX(),Xe=Ae.target.height()*Ae.target.scaleY(),xt=Math.min(1,ce/$e),St=Math.min(1,ge/Xe),mn=1-xt,lr=Math.min(mn,Math.max(0,Math.round(-Ae.target.x())/$e)),Or=1-St,yn=Math.min(Or,Math.max(0,Math.round(-Ae.target.y())/Xe));Ae.target.setAttrs({x:-lr*de.width,y:-yn*de.height,scaleX:1,scaleY:1}),M.set({cropX:lr,cropY:yn,cropWidth:xt,cropHeight:St})},Re=()=>{M.type!=="svg"&&M.contentEditable&&setTimeout(()=>{M.toggleCropMode(!0)})},Me=se==="loading",ye=se==="failed",Le=!Me&&!ye,Oe=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),qe=Le?M.a.opacity:0;(0,y.useFadeIn)(K,qe);const Pt=M.selectable||j.role==="admin",_t=(0,g.useMobile)();return a.default.createElement(a.default.Fragment,null,Me&&a.default.createElement(F,{element:M}),ye&&a.default.createElement(H,{element:M}),a.default.createElement(u.Image,{ref:K,name:"element",id:M.id,image:de,x:M.x,y:M.y,width:M.width||1,height:M.height||1,rotation:M.rotation,opacity:qe,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,customCrop:Ee,listening:Pt,cropX:Ee.x,cropY:Ee.y,cropWidth:Ee.width,cropHeight:Ee.height,draggable:_t?M.draggable&&Z:M.draggable,preventDefault:!_t||Z,hideInExport:!M.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Ae=>{M.set({x:Ae.target.x(),y:Ae.target.y()})},onDragEnd:Ae=>{M.set({x:Ae.target.x(),y:Ae.target.y()})},onDblClick:Re,onDblTap:Re,onTransformStart:()=>{G(!0),Oe.current={cropX:M.cropX,cropY:M.cropY,cropWidth:M.cropWidth,cropHeight:M.cropHeight}},onTransform:Ae=>{var $e;const Xe=Ae.currentTarget,xt=Math.abs(Xe.scaleX()-1)<1e-7?1:Xe.scaleX(),St=Math.abs(Xe.scaleY()-1)<1e-7?1:Xe.scaleY();Xe.scaleX(1),Xe.scaleY(1);const mn=($e=Ae.target.getStage())===null||$e===void 0?void 0:$e.findOne("Transformer"),lr=1-ce/de.width,Or=Math.min(lr,Math.max(0,M.cropX)),yn=1-ge/de.height,Xn=Math.min(yn,Math.max(0,M.cropY)),Ne=mn.getActiveAnchor(),Ke=!(Ne.indexOf("middle")>=0||Ne.indexOf("center")>=0),ft=!Ke&&xt<1&&Oe.current.cropHeight>ge/de.height;let Ct=Ke?M.cropWidth:M.cropWidth*xt;ft&&(Ct=M.cropWidth);const gt=!Ke&&St<1&&Oe.current.cropWidth>ce/de.width;let nr=Ke?M.cropHeight:M.cropHeight*St;gt&&(nr=M.cropHeight),we&&(Ct=M.cropWidth,nr=M.cropHeight),M.set({cropX:Or,cropY:Xn,x:Xe.x(),y:Xe.y(),width:Xe.width()*xt,height:Xe.height()*St,rotation:Ae.target.rotation(),cropWidth:Math.min(Ct,1-Or),cropHeight:Math.min(nr,1-Xn)})},onTransformEnd:Ae=>{const $e=Ae.currentTarget;M.set({width:$e.width(),height:$e.height(),x:$e.x(),y:$e.y(),rotation:Ae.target.rotation(),cropWidth:ce/de.width,cropHeight:ge/de.height}),G(!1)}}),a.default.createElement(u.Rect,{x:M.x,y:M.y,width:Math.max(M.width-M.borderSize,0),height:Math.max(M.height-M.borderSize,0),opacity:qe,offsetX:-M.borderSize/2,offsetY:-M.borderSize/2,stroke:M.borderColor,strokeWidth:M.borderSize,listening:!1,visible:!!M.borderSize,rotation:M.rotation,cornerRadius:Math.max(0,Te-M.borderSize),hideInExport:!M.showInExport}),!J&&a.default.createElement(u.Image,{image:P,x:M.x+M.width/2-15/j.scale,y:M.y+M.height/2-15/j.scale,width:30/j.scale,height:30/j.scale,hideInExport:!0,onClick:()=>{te(!0)}}),J&&a.default.createElement(u.Image,{image:x,x:M.x+M.width/2-15/j.scale,y:M.y+M.height/2-15/j.scale,width:30/j.scale,height:30/j.scale,hideInExport:!0,onClick:()=>{te(!1)}}),M._cropModeEnabled&&a.default.createElement(S.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/j.scale,y:-window.innerWidth/j.scale,width:window.innerWidth/j.scale*3,height:window.innerWidth/j.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Je,x:M.x,y:M.y,width:M.width,height:M.height,rotation:M.rotation,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur}),a.default.createElement(u.Group,{x:M.x,y:M.y,rotation:M.rotation,scaleX:Ye,scaleY:Ye},a.default.createElement(u.Image,{image:de,ref:q,opacity:.4,draggable:!0,x:-M.cropX*de.width,y:-M.cropY*de.height,onDragMove:ne,onTransform:ne}),a.default.createElement(u.Transformer,{ref:le,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ae,$e)=>$e.width<5||$e.height<5?Ae:$e,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:ce,height:ge,ref:pt,listening:!1,onTransform:Ae=>{Ae.target.x()<-M.cropX*de.width-1e-9&&(Ae.target.x(-M.cropX*de.width),Ae.target.scaleX(1)),Ae.target.y()<-M.cropY*de.height-1e-9&&(Ae.target.y(-M.cropY*de.height),Ae.target.scaleY(1));const $e=Math.min(1,Math.max(0,M.cropX+Ae.target.x()/de.width)),Xe=Math.min(1,Math.max(0,Ae.target.y()/de.height+M.cropY)),xt=Ae.target.width()*Ae.target.scaleX(),St=Ae.target.height()*Ae.target.scaleY(),mn=Math.min(1-$e,xt/de.width),lr=Math.min(1-Xe,St/de.height),Or=Ae.target.getAbsolutePosition(Ae.target.getParent().getParent());Ae.target.scale({x:1,y:1}),Ae.target.position({x:0,y:0}),M.set({x:Or.x,y:Or.y,cropX:$e,cropY:Xe,cropWidth:mn,cropHeight:lr,width:Math.min(xt*Ye,de.width*(1-$e)*Ye),height:Math.min(St*Ye,de.height*(1-Xe)*Ye)})}}),a.default.createElement(u.Transformer,{ref:It,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ae,$e)=>$e.width<5||$e.height<5?Ae:$e,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(z||Z)&&a.default.createElement(_.Highlighter,{element:M}))})})(z7);var B7={},Qy={};(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:m,height:p,cornerRadius:y})=>{if(y>0){const g=Math.min(y,m/2,p/2);return`M 0 ${g} A ${g} ${g} 0 0 1 ${g} 0 L ${m-g} 0 A ${g} ${g} 0 0 1 ${m} ${g} L ${m} ${p-g} A ${g} ${g} 0 0 1 ${m-g} ${p} L ${g} ${p} A ${g} ${g} 0 0 1 0 ${p-g} Z`}return`M 0 0 L ${m} 0 L ${m} ${p} L 0 ${p} Z`};e.rectData=t;const r=({width:m,height:p})=>`M ${m/2} 0 L ${m} ${p} L 0 ${p} Z`;e.triangleData=r;const n=({width:m,height:p})=>`M 0 0 L ${m} 0 L 0 ${p} Z`;e.rightTriangleData=n;const i=({width:m,height:p})=>`M ${m/2} ${p/2} m -${m/2}, 0 a ${m/2},${p/2} 0 1,0 ${m},0 a ${m/2},${p/2} 0 1,0 -${m},0`;function a({width:m,height:p}){const y=m/2,g=p/2,d=m/2,b=p/2,O=d/2,P=b/2;let x="",w=Math.PI/5;for(let T=0;T<10;T++){const k=T%2==0?b:P,A=y+(T%2==0?d:O)*Math.sin(T*w),R=g-k*Math.cos(T*w);T===0?x=`M ${A} ${R}`:x+=` L ${A} ${R}`}return x+" Z"}function o({width:m,height:p}){const y=m/2,g=p/2;return`M ${y} 0 L ${m} ${g} L ${y} ${p} L 0 ${g} Z`}function l({width:m,height:p}){const y=m/2,g=p/2,d=m/2,b=p/2;let O="",P=2*Math.PI/5;for(let x=0;x<5;x++){const w=b,T=y+d*Math.sin(x*P),k=g-w*Math.cos(x*P);x===0?O=`M ${T} ${k}`:O+=` L ${T} ${k}`}return O+" Z"}function u({width:m,height:p}){const y=m/2,g=p/2,d=m/2,b=p/2;let O="",P=2*Math.PI/6;for(let x=0;x<6;x++){const w=b,T=y+d*Math.sin(x*P),k=g-w*Math.cos(x*P);x===0?O=`M ${T} ${k}`:O+=` L ${T} ${k}`}return O+" Z"}function f({path:m,aspectRatio:p,width:y,height:g}){return{path:m,scaleX:y/p.width,scaleY:g/p.height}}function v({width:m,height:p}){const y=.1*Math.min(m,p),g=.2*m,d=.2*p,b=.5*m;let O=`M ${y},0`;return O+=" H "+(m-y),O+=` A ${y},${y} 0 0 1 ${m},${y}`,O+=" V "+(p-y-d),O+=` A ${y},${y} 0 0 1 ${m-y},${p-d}`,O+=` H ${b+g/2}`,O+=` L ${b},${p}`,O+=` L ${b-g/2},${p-d}`,O+=` H ${y}`,O+=` A ${y},${y} 0 0 1 0,${p-y-d}`,O+=` V ${y}`,O+=` A ${y},${y} 0 0 1 ${y},0`,O+=" Z",O}function S({width:m,height:p}){const y=.3*m,g=.3*p,d=m/2,b=p/2,O=d-y/2,P=d+y/2,x=b-g/2,w=b+g/2;let T=`M ${O},0 `;return T+=`H ${P} `,T+=`V ${x} `,T+=`H ${m} `,T+=`V ${w} `,T+=`H ${P} `,T+=`V ${p} `,T+=`H ${O} `,T+=`V ${w} `,T+="H 0 ",T+=`V ${x} `,T+=`H ${O} `,T+="V 0 ",T+="Z",T}function _(m){return e.TYPES[m]||e.rectData}function h(m,p){const{width:y,height:g,fill:d,stroke:b,strokeWidth:O,dash:P}=m,x=(P||[]).map(R=>R*O);let w=p(m),T=1,k=1;typeof w!="string"&&(T=w.scaleX,k=w.scaleY,w=w.path);const A=`clip-${Math.random()}`;return`
|
|
219
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${y}" height="${g}">
|
|
220
|
+
<defs>
|
|
221
|
+
<clipPath id="${A}">
|
|
222
|
+
<path d="${w}" />
|
|
223
|
+
</clipPath>
|
|
224
|
+
</defs>
|
|
225
|
+
|
|
226
|
+
<!-- Path for the fill -->
|
|
227
|
+
<path d="${w}" fill="${d}" transform="scale(${T}, ${k})"/>
|
|
228
|
+
|
|
229
|
+
<!-- Path for the stroke, clipped by the star path -->
|
|
230
|
+
<path d="${w}" fill="none" stroke="${b}" stroke-width="${2*O}" clip-path="url(#${A})" transform="scale(${T}, ${k})" stroke-dasharray="${x.join(" ")}"/>
|
|
231
|
+
</svg>
|
|
232
|
+
`}function E(m){const{subType:p}=m,y=_(p);return y?h(m,y):(console.error(`Polotno error: Can not convert ${m.subType} figure to svg.`),(0,e.rectData)(m))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=v,e.crossPath=S,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:v,cross:S,arc:({width:m,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:m,height:p}),cloud:({width:m,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:m,height:p}),rightArrow:({width:m,height:p})=>{const y=.6*m;return`M 0 ${p/4} L ${y} ${p/4} L ${y} 0 L ${m} ${p/2} L ${y} ${p} L ${y} ${.75*p} L 0 ${.75*p} Z`},leftArrow:({width:m,height:p})=>{const y=.4*m;return`M ${m} ${p/4} L ${y} ${p/4} L ${y} 0 L 0 ${p/2} L ${y} ${p} L ${y} ${.75*p} L ${m} ${.75*p} Z`},downArrow:({width:m,height:p})=>{const y=.6*p;return`M ${m/4} 0 L ${m/4} ${y} L 0 ${y} L ${m/2} ${p} L ${m} ${y} L ${.75*m} ${y} L ${.75*m} 0 Z`},upArrow:({width:m,height:p})=>{const y=.4*p;return`M ${m/4} ${p} L ${m/4} ${y} L 0 ${y} L ${m/2} 0 L ${m} ${y} L ${.75*m} ${y} L ${.75*m} ${p} Z`},asterisk1:({width:m,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:m,height:p}),asterisk2:({width:m,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:m,height:p}),bookmark:({width:m,height:p})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:m,height:p}),butterfly:({width:m,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:m,height:p}),cylinder:({width:m,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:m,height:p}),diamond2:({width:m,height:p})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:m,height:p}),door:({width:m,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:m,height:p}),drop1:({width:m,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:m,height:p}),drop2:({width:m,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:m,height:p}),explosion:({width:m,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:m,height:p}),flag:({width:m,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:m,height:p}),flower:({width:m,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:m,height:p}),frame:({width:m,height:p})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:m,height:p}),heart1:({width:m,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:m,height:p}),home:({width:m,height:p})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:m,height:p}),home2:({width:m,height:p})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:m,height:p}),hourglass:({width:m,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:m,height:p}),house:({width:m,height:p})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:m,height:p}),keyhole:({width:m,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:m,height:p}),kiss:({width:m,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:m,height:p}),leaf:({width:m,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:m,height:p}),lightning1:({width:m,height:p})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:m,height:p}),lightning2:({width:m,height:p})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:m,height:p}),magnet:({width:m,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:m,height:p}),mithosis:({width:m,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:m,height:p}),orangeRicky:({width:m,height:p})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:m,height:p}),party:({width:m,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:m,height:p}),pillow:({width:m,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:m,height:p}),polygon:({width:m,height:p})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:m,height:p}),rainbow:({width:m,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:m,height:p}),rhodeIsland:({width:m,height:p})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:m,height:p}),shell:({width:m,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:m,height:p}),shield1:({width:m,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:m,height:p}),shield2:({width:m,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:m,height:p}),skewedRectangle:({width:m,height:p})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:m,height:p}),softFlower:({width:m,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:m,height:p}),softStar:({width:m,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:m,height:p}),stairs1:({width:m,height:p})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:m,height:p}),stairs2:({width:m,height:p})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:m,height:p}),teewee:({width:m,height:p})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:m,height:p}),blob1:({width:m,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:m,height:p}),blob10:({width:m,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:m,height:p}),blob11:({width:m,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:m,height:p}),blob12:({width:m,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:m,height:p}),blob13:({width:m,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:m,height:p}),blob14:({width:m,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:m,height:p}),blob15:({width:m,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:m,height:p}),blob16:({width:m,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:m,height:p}),blob17:({width:m,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:m,height:p}),blob18:({width:m,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:m,height:p}),blob19:({width:m,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:m,height:p}),blob2:({width:m,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:m,height:p}),blob20:({width:m,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:m,height:p}),blob21:({width:m,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:m,height:p}),blob22:({width:m,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:m,height:p}),blob23:({width:m,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:m,height:p}),blob24:({width:m,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:m,height:p}),blob25:({width:m,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:m,height:p}),blob26:({width:m,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:m,height:p}),blob27:({width:m,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:m,height:p}),blob28:({width:m,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:m,height:p}),blob29:({width:m,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:m,height:p}),blob3:({width:m,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:m,height:p}),blob30:({width:m,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:m,height:p}),blob31:({width:m,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:m,height:p}),blob32:({width:m,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:m,height:p}),blob4:({width:m,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:m,height:p}),blob5:({width:m,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:m,height:p}),blob6:({width:m,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:m,height:p}),blob7:({width:m,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:m,height:p}),blob8:({width:m,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:m,height:p}),blob9:({width:m,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:m,height:p})},e.subTypeToPathDataFunc=_,e.figureToSvg=E})(Qy);(function(e){var t=be&&be.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(Qe),n=mi,i=_a,a=Qy,o=wl,l=yo,u=zc,f={};e.FigureElement=(0,n.observer)(({element:v,store:S})=>{const _=v.selectable||S.role==="admin",h=(0,l.useMobile)(),[E,m]=r.default.useState(!1),p=S.selectedElements.indexOf(v)>=0&&S.selectedElements.length===1,y=Math.min(v.strokeWidth,v.width/2,v.height/2),g=Math.max(0,Math.min(v.width/2,v.height/2,v.cornerRadius)),d=(0,u.useColor)(v,v.a.fill,"fill"),b=Object.assign(Object.assign({width:v.a.width,height:v.a.height},d),{cornerRadius:g,opacity:v.animated("opacity"),shadowEnabled:v.shadowEnabled,shadowBlur:v.shadowBlur,shadowOffsetX:v.shadowOffsetX,shadowOffsetY:v.shadowOffsetY,shadowColor:v.shadowColor,shadowOpacity:v.shadowOpacity,listening:_,preventDefault:!h||p,hideInExport:!v.showInExport}),O=(0,u.useColor)(v,v.stroke,"stroke"),P=Object.assign(Object.assign({visible:y>0,x:y/2,y:y/2,width:v.a.width-y,height:v.a.height-y},O),{strokeWidth:y,cornerRadius:Math.max(0,g-y),dash:v.dash.map(k=>k*y),opacity:v.animated("opacity"),hideInExport:!v.showInExport,listening:!1}),x=(w=v.subType,f[w]||(f[w]=(T=(0,a.subTypeToPathDataFunc)(w),(0,n.observer)(({element:k,fillProps:A,strokeProps:R})=>{let F=T({width:k.a.width,height:k.a.height,cornerRadius:k.cornerRadius}),H=1,Y=1;typeof F!="string"&&(H=F.scaleX,Y=F.scaleY,F=F.path);const $=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:k.width,height:k.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},A,{ref:$,data:F,scaleX:H,scaleY:Y})),r.default.createElement(i.Group,{clipFunc:I=>{const U=$.current;if(U){var W=U.dataArray;I.beginPath();for(var M=0;M<W.length;M++){var j=W[M].command,B=W[M].points;switch(j){case"L":I.lineTo(B[0],B[1]);break;case"M":I.moveTo(B[0],B[1]);break;case"C":I.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case"Q":I.quadraticCurveTo(B[0],B[1],B[2],B[3]);break;case"A":var N=B[0],G=B[1],K=B[2],q=B[3],z=B[4],X=B[5],Z=B[6],J=B[7],te=K>q?K:q,ee=K>q?1:K/q,se=K>q?q/K:1;I.translate(N,G),I.rotate(Z),I.scale(ee,se),I.arc(0,0,te,z,z+X,1-J),I.scale(1/ee,1/se),I.rotate(-Z),I.translate(-N,-G);break;case"z":I.closePath()}}}},scaleX:H,scaleY:Y},r.default.createElement(i.Path,Object.assign({},R,{x:0,y:0,data:F,strokeWidth:2*R.strokeWidth,dash:R.dash.map(I=>I)}))))}))),f[w]||i.Group);var w,T;return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Group,{id:v.id,x:v.a.x,y:v.a.y,rotation:v.a.rotation,opacity:v.a.opacity,draggable:h?v.draggable&&p:v.draggable,name:"element",onMouseEnter:()=>{m(!0)},onMouseLeave:()=>{m(!1)},onDragMove:k=>{v.set({x:k.target.x(),y:k.target.y()})},onDragEnd:k=>{v.set({x:k.target.x(),y:k.target.y()})},onTransform:k=>{const A=k.target.scale();k.target.scaleX(1),k.target.scaleY(1),v.set({width:v.width*A.x,height:v.height*A.y,x:k.target.x(),y:k.target.y(),rotation:k.target.rotation()})}},r.default.createElement(x,{element:v,fillProps:b,strokeProps:P})),E&&!p&&r.default.createElement(o.Highlighter,{element:v}))})})(B7);(function(e){var t=be&&be.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(Qe),n=mi,i=Ry,a=qy,o=T7,l=F7,u=z7,f=B7,v=_a,S=qn,_=(0,n.observer)(p=>{const{element:y,store:g}=p,{children:d}=y,b=y.selectable||g.role==="admin";return r.default.createElement(v.Group,{opacity:y.opacity,listening:b},d.map(O=>r.default.createElement(m,Object.assign({},p,{key:O.id,store:g,element:O}))))}),h={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:_};function E(p,y){h[p]=y}e.registerShapeComponent=E;const m=(0,n.observer)(p=>{let y=h[p.element.type];return p.element.type==="text"&&S.flags.htmlRenderEnabled&&(y=o.HTMLElement),p.element.visible?y?r.default.createElement(y,Object.assign({},p)):(console.error("Can not find component for "+p.element.type),null):null});e.default=m})(O9);var U7={};(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})(U7);var Eg={},Og={},q4;function xj(){return q4||(q4=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.URL=e.API=void 0;const t=Jy();e.API="https://api.polotno.com/api",e.URL="https://api.polotno.com";const r={},n=(g,d)=>{r[g]||(r[g]=!0,console.error(d))},i=`API for iconscout is provided as a demonstration.
|
|
233
|
+
For production usage you have to use your own API endpoint.
|
|
234
|
+
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
235
|
+
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:g,page:d=1})=>`${e.API}/get-unsplash?query=${g}&per_page=20&page=${d}&KEY=${(0,t.getKey)()}`,unsplashDownload:g=>`${e.API}/download-unsplash?id=${g}&KEY=${(0,t.getKey)()}`,svgapiList:({query:g,page:d=0})=>`${e.API}/get-svgapi?query=${g}&page=${d}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:g=>`${e.API}/download-svgapi?path=${g}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:g,page:d=1})=>(n("iconscout",i),`${e.API}/get-iconscout?query=${g}&page=${d}&KEY=${(0,t.getKey)()}`),iconscoutDownload:g=>(n("iconscout",i),`${e.API}/download-iconscout?uuid=${g}&KEY=${(0,t.getKey)()}`),templateList:({query:g,page:d=1,sizeQuery:b})=>`${e.API}/get-templates?${b}&query=${g}&per_page=30&page=${d}&KEY=${(0,t.getKey)()}`};const a=()=>`${e.API}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=a;const o=g=>{return`${e.URL}/google-fonts-previews/black/${d=g,b=" ",O="-",d.replace(new RegExp(b,"g"),O)}.png`;var d,b,O};e.getGoogleFontImage=o;const l=()=>`${e.API}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=l;const u=()=>`${e.API}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=u;const f=g=>e.URLS.templateList(g);e.templateList=f;const v=()=>`${e.API}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=v;const S=g=>e.URLS.unsplashList(g);e.unsplashList=S;const _=g=>e.URLS.unsplashDownload(g);e.unsplashDownload=_;const h=g=>e.URLS.svgapiList(g);e.svgapiList=h;const E=g=>e.URLS.svgapiDownload(g);e.svgapiDownload=E;const m=g=>e.URLS.iconscoutList(g);e.iconscoutList=m;const p=g=>e.URLS.iconscoutDownload(g);e.iconscoutDownload=p;const y=(g,d)=>{e.URLS[g]=d};e.setAPI=y}(Og)),Og}var W4;function Jy(){return W4||(W4=1,function(e){var t=be&&be.__createBinding||(Object.create?function(P,x,w,T){T===void 0&&(T=w);var k=Object.getOwnPropertyDescriptor(x,w);k&&!("get"in k?!x.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return x[w]}}),Object.defineProperty(P,T,k)}:function(P,x,w,T){T===void 0&&(T=w),P[T]=x[w]}),r=be&&be.__setModuleDefault||(Object.create?function(P,x){Object.defineProperty(P,"default",{enumerable:!0,value:x})}:function(P,x){P.default=x}),n=be&&be.__importStar||function(P){if(P&&P.__esModule)return P;var x={};if(P!=null)for(var w in P)w!=="default"&&Object.prototype.hasOwnProperty.call(P,w)&&t(x,P,w);return r(x,P),x};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(ga),a=xj(),o=qn;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const v=5,S=3e3,_="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",h="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",E="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",m="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let p=window.location.origin;const y=navigator.userAgent.indexOf("Headless")>-1,g=navigator.userAgent.indexOf("Electron")>-1;p==="file://"&&y&&(p="headless"),p==="file://"&&g&&(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 b(P){for(let x=0;x<v;x++)try{const w=await fetch(a.API+"/validate-key",{method:"POST",body:JSON.stringify({key:P,site:location.host})});if(!P)return console.warn(_),!1;if(w.status!==200){await new Promise(k=>setTimeout(k,S));continue}const T=await w.json();return T.is_valid||console.warn(h),T.is_paid||console.log(m,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),T.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(T.remove_background_enabled),T.is_paid||!1}catch{await new Promise(T=>setTimeout(T,S))}return console.error(E),!0}async function O(P,x){u=P,await b(P)&&!x||l()}e.isKeyPaid=b,e.validateKey=O}(Eg)),Eg}var Hp={};(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})(Hp);(function(e){var t=be&&be.__rest||function(I,U){var W={};for(var M in I)Object.prototype.hasOwnProperty.call(I,M)&&U.indexOf(M)<0&&(W[M]=I[M]);if(I!=null&&typeof Object.getOwnPropertySymbols=="function"){var j=0;for(M=Object.getOwnPropertySymbols(I);j<M.length;j++)U.indexOf(M[j])<0&&Object.prototype.propertyIsEnumerable.call(I,M[j])&&(W[M[j]]=I[M[j]])}return W},r=be&&be.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(Qe),i=mi,a=ga,o=_a,l=r(jp),u=r(Kn),f=r(O9),v=Zy,S=qy,_=U7,h=Jy(),E=Up,m=Hp,p=qn,y=yo,g=new u.default.Group;g.add(new u.default.Rect({width:20,height:20,fill:"white"})),g.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 d=g.toCanvas({pixelRatio:2,width:20,height:20}),b={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:I=>{I.hasName("rotater")&&I.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:d,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},O=I=>{Object.assign(b,I)};e.setTransformerStyle=O;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 x(I,U){P[I]=P[I]||U,Object.assign(P[I],U)}e.registerTransformerAttrs=x;const w=I=>n.default.createElement(o.Rect,Object.assign({},I,{preventDefault:!1})),T=I=>{var{url:U}=I,W=t(I,["url"]);const[M,j]=(0,l.default)(U,"anonymous"),B=M?(0,_.getCrop)(M,{width:W.width,height:W.height},"center-middle"):{};return(0,S.useImageLoader)(j,"background"),n.default.createElement(o.Image,Object.assign({image:M},W,B))},k=I=>n.default.createElement(o.Rect,Object.assign({},I)),A=I=>{const{background:U,scale:W,borderColor:M}=I,j=t(I,["background","scale","borderColor"]),B=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(U),[U]),N=n.default.useMemo(()=>{const G=document.createElement("canvas"),K=30;G.width=60,G.height=60;const q=G.getContext("2d");return q&&(q.fillStyle="black",q.fillRect(K,0,K,K),q.fillRect(0,K,K,K)),G},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:N},j,{opacity:.1,hideInExport:!0})),B?n.default.createElement(k,Object.assign({fill:U},j)):n.default.createElement(T,Object.assign({url:U},j)))},R=(0,i.observer)(({selection:I})=>I.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(I.x1,I.x2),y:Math.min(I.y1,I.y2),width:Math.abs(I.x1-I.x2),height:Math.abs(I.y1-I.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),F=(0,i.observer)(({x:I,y:U,width:W,height:M,rotation:j,anchor:B,store:N})=>{const G=(0,E.getClientRect)({x:I,y:U,width:W,height:M,rotation:u.default.Util.radToDeg(j)});if(B===void 0)return null;const K=(M/2+70)*Math.cos(j-Math.PI/2),q=(M/2+70)*Math.sin(j-Math.PI/2),z=(0,m.pxToUnitRounded)({unit:N.unit,dpi:N.dpi,px:W/N.scale,precious:N.unit==="px"?0:1})+" x "+(0,m.pxToUnitRounded)({unit:N.unit,dpi:N.dpi,px:M/N.scale,precious:N.unit==="px"?0:1})+(N.unit==="px"?"":" "+N.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(G.minX+G.maxX)/2+K,y:(G.minY+G.maxY)/2+q,offsetX:14,offsetY:14,visible:B==="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(j)).toString()+"°"})),n.default.createElement(o.Label,{x:(G.minX+G.maxX)/2,y:G.maxY+20,visible:B!=="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:z})))}),H=(0,i.observer)(({elements:I,store:U})=>{const W=I.filter(j=>j.alwaysOnTop),M=I.filter(j=>!j.alwaysOnTop).concat(W);return n.default.createElement(n.default.Fragment,null,M.map(j=>n.default.createElement(f.default,{key:j.id,store:U,element:j,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Y=null;const $=I=>{Y=I};e.registerNextDomDrop=$,e.default=(0,i.observer)(({store:I,page:U,width:W,height:M,pageControlsEnabled:j,backColor:B,pageBorderColor:N,activePageBorderColor:G,components:K,bleedColor:q})=>{const z=I.bleedVisible?U.bleed:0,X=U.computedWidth+2*z,Z=U.computedHeight+2*z,J=(W-X*I.scale)/2,te=(M-Z*I.scale)/2,ee=n.default.useRef(null),se=n.default.useRef(null),de=n.default.useRef(null),he=j==null||j,[ke,Ie]=n.default.useState(null),[ue,ie]=n.default.useState({}),_e=I.selectedElements.find(ne=>ne._cropModeEnabled),Se=I.selectedShapes.filter(ne=>!ne.resizable).length>0,re=I.selectedShapes.filter(ne=>!ne.draggable).length>0,ce=I.selectedElements.filter(ne=>!ne.visible).length>0;n.default.useLayoutEffect(()=>{var ne,Re,Me;if(!ee.current)return;const ye=ee.current.getStage(),Le=I.selectedShapes.map(qe=>qe._cropModeEnabled?null:ye.findOne("#"+qe.id)).filter(qe=>qe),Oe=I.selectedElements.length===1&&((ne=I.selectedElements[0])===null||ne===void 0?void 0:ne.type)||"many";P[Oe]?(ee.current.setAttrs(Object.assign(Object.assign({},b),P[Oe])),Oe!=="svg"&&Oe!=="image"||I.selectedElements[0].keepRatio||ee.current.setAttrs({enabledAnchors:b.enabledAnchors}),Oe==="text"&&p.flags.textVerticalResizeEnabled&&ee.current.setAttrs({enabledAnchors:(Re=P.text.enabledAnchors)===null||Re===void 0?void 0:Re.concat(["bottom-center"])})):ee.current.setAttrs(b),Se&&ee.current.enabledAnchors([]),re&&ee.current.rotateEnabled(!1),Le.find(qe=>qe==null?void 0:qe.isDragging())&&Le.forEach(qe=>{qe.isDragging()||qe==null||qe.startDrag()}),ee.current.nodes(Le),(Me=ee.current.getLayer())===null||Me===void 0||Me.batchDraw()},[I.selectedElements,_e,Se,ce,re]);const ge=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),me=n.default.useRef(!1),we=(0,y.useMobile)(),Ee=(0,a.action)(ne=>{var Re,Me;if(we)return;me.current=!1;const ye=ne.target.findAncestor(".elements-container"),Le=ne.target.findAncestor("Transformer"),Oe=ne.target.findAncestor(".page-abs-container");if(ye||Le||Oe)return;const qe=(Re=ne.target.getStage())===null||Re===void 0?void 0:Re.getPointerPosition();qe&&(ge.visible=!0,ge.x1=qe.x,ge.y1=qe.y,ge.x2=qe.x,ge.y2=qe.y,((Me=ne.target.getStage())===null||Me===void 0?void 0:Me.getPointersPositions().length)>=2&&(ge.visible=!1))});n.default.useEffect(()=>{const ne=(0,a.action)(Me=>{var ye,Le;if(!ge.visible)return;(ye=se.current)===null||ye===void 0||ye.setPointersPositions(Me);let Oe=((Le=se.current)===null||Le===void 0?void 0:Le.getPointerPosition())||{x:ge.x2,y:ge.y2};ge.x2=Oe.x,ge.y2=Oe.y}),Re=(0,a.action)(()=>{if(!ge.visible||!se.current)return;const Me=se.current.findOne(".selection"),ye=Me?Me.getClientRect():{width:0,height:0,x:0,y:0};if(ye.width&&ye.height){const Le=[];se.current.find(".element").forEach(qe=>{const Pt=qe.getClientRect(),_t=I.getElementById(qe.id()),Ae=_t==null?void 0:_t.draggable,$e=_t==null?void 0:_t.selectable;u.default.Util.haveIntersection(ye,Pt)&&Ae&&$e&&Le.push(_t.top.id)});const Oe=[...new Set(Le)];I.selectElements(Oe)}ge.visible=!1,me.current=!0});return window.addEventListener("mousemove",ne),window.addEventListener("touchmove",ne),window.addEventListener("mouseup",Re),window.addEventListener("touchend",Re),()=>{window.removeEventListener("mousemove",ne),window.removeEventListener("touchmove",ne),window.removeEventListener("mouseup",Re),window.removeEventListener("touchend",Re)}},[]);const Te=ne=>{if(I.activePage!==U&&U.select(),me.current)return;const Re=ne.evt.ctrlKey||ne.evt.metaKey||ne.evt.shiftKey,Me=ne.target.findAncestor(".elements-container"),ye=ne.target.findAncestor(".page-abs-container"),Le=ne.target.findAncestor("Transformer");if(!(Re||Me||Le||ye))return void I.selectElements([]);const Oe=ne.target.findAncestor(".element",!0),qe=I.getElementById(Oe==null?void 0:Oe.id()),Pt=qe==null?void 0:qe.top,_t=Pt==null?void 0:Pt.id,Ae=I.selectedElementsIds.indexOf(_t)>=0;_t&&Re&&!Ae?I.selectElements(I.selectedElementsIds.concat([_t])):_t&&Re&&Ae?I.selectElements(I.selectedElementsIds.filter($e=>$e!==_t)):!_t||Re||Ae||I.selectElements([_t])};(0,v.useSnap)(ee);const Je=I.activePage===U,Ye=K==null?void 0:K.PageControls,pt=K==null?void 0:K.Tooltip,It=1/I.scale,le=0/I.scale;return n.default.createElement("div",{ref:de,onDragOver:ne=>ne.preventDefault(),onDrop:ne=>{if(ne.preventDefault(),!se.current)return;se.current.setPointersPositions(ne);const Re=se.current.findOne(".elements-container").getRelativePointerPosition(),Me=se.current.getPointerPosition(),ye=se.current.getAllIntersections(Me).map(qe=>qe.findAncestor(".element",!0)).filter(Boolean),Le=[...new Set(ye.reverse())].map(qe=>I.getElementById(qe.id())),Oe=Le[0];Y&&(Y(Re,Oe,{elements:Le,page:U}),Y=null)},style:{position:"relative",width:W+"px"},className:"polotno-page-container"+(Je?" active-page":"")},n.default.createElement(o.Stage,{ref:se,width:Math.min(W,4*window.innerWidth),height:Math.min(M,4*window.innerHeight),onClick:Te,onTap:Te,onMouseDown:Ee,onMouseMove:ne=>{if(!ne.evt.altKey&&ke)return void Ie(null);if(!ne.evt.altKey)return;const Re=ne.target.findAncestor(".element",!0),Me=Re==null?void 0:Re.id();if(!I.selectedElements[0]||I.selectedElementsIds.includes(Me))return;const ye=(0,E.getTotalClientRect)(I.selectedElements),Le=Me?I.getElementById(Me):{x:0,y:0,width:U.computedWidth,height:U.computedHeight,rotation:0},Oe=(0,E.getClientRect)(Le),qe=[];ye.minX>Oe.maxX&&qe.push({distance:ye.minX-Oe.maxX,box1:ye,box2:Oe,points:[{x:ye.minX,y:ye.minY+ye.height/2},{x:Oe.maxX,y:ye.minY+ye.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),ye.maxX<Oe.minX&&qe.push({distance:Oe.minX-ye.maxX,box1:ye,box2:Oe,points:[{x:ye.maxX,y:ye.minY+ye.height/2},{x:Oe.minX,y:ye.minY+ye.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),ye.minY>Oe.maxY&&qe.push({box1:ye,box2:Oe,distance:ye.minY-Oe.maxY,points:[{x:ye.minX+ye.width/2,y:ye.minY},{x:ye.minX+ye.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]}),ye.maxY<Oe.minY&&qe.push({box1:ye,box2:Oe,distance:Oe.minY-ye.maxY,points:[{x:ye.minX+ye.width/2,y:ye.maxY},{x:ye.minX+ye.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),ye.minX>=Oe.minX&&ye.maxX<=Oe.maxX&&ye.minY>=Oe.minY&&ye.maxY<=Oe.maxY&&(qe.push({distance:ye.minX-Oe.minX,box1:ye,box2:Oe,points:[{x:ye.minX,y:ye.minY+ye.height/2},{x:Oe.minX,y:ye.minY+ye.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),qe.push({distance:Oe.maxX-ye.maxX,box1:ye,box2:Oe,points:[{x:ye.maxX,y:ye.minY+ye.height/2},{x:Oe.maxX,y:ye.minY+ye.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),qe.push({box1:ye,box2:Oe,distance:ye.minY-Oe.minY,points:[{x:ye.minX+ye.width/2,y:ye.minY},{x:ye.minX+ye.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),qe.push({box1:ye,box2:Oe,distance:Oe.maxY-ye.maxY,points:[{x:ye.minX+ye.width/2,y:ye.maxY},{x:ye.minX+ye.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]})),JSON.stringify(ke)!==JSON.stringify(qe)&&Ie(qe)},onTouchStart:Ee,onDragStart:ne=>{var Re;const Me=ne.target.findAncestor(".element",!0);if(Me){const ye=I.getElementById(Me==null?void 0:Me.id()),Le=ye==null?void 0:ye.top,Oe=Le==null?void 0:Le.id;!(I.selectedElementsIds.indexOf(Oe)>=0)&&Oe&&(I.selectElements([Oe]),ne.target.stopDrag(),ne.target.startDrag(ne),(Re=ee.current)===null||Re===void 0||Re.startDrag(ne))}ke&&Ie(null)},pageId:U.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(w,{width:W,height:M,fill:B}),n.default.createElement(o.Group,{x:J,y:te,scaleX:I.scale,scaleY:I.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:z,y:z},n.default.createElement(A,{x:-U.bleed,y:-U.bleed,width:U.computedWidth+2*U.bleed,height:U.computedHeight+2*U.bleed,background:U.background,shadowBlur:10,shadowColor:"lightgrey",name:"page-background",preventDefault:!1,scale:I.scale})),n.default.createElement(o.Group,{x:z,y:z,name:"elements-container",listening:!I.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:U.computedWidth,height:U.computedHeight,listening:!1}),n.default.createElement(H,{elements:U.children,store:I})),n.default.createElement(o.Rect,{stroke:q,name:"bleed",strokeWidth:U.bleed,x:U.bleed/2,y:U.bleed/2,width:U.computedWidth+U.bleed,height:U.computedHeight+U.bleed,listening:!1,visible:U.bleed>0&&I.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,W,0,W,M,0,M,0,0,J,te,J,M-te,W-J,M-te,W-J,te,J,te],listening:!1,closed:!0,fill:B}),n.default.createElement(o.Group,{x:J,y:te,scaleX:I.scale,scaleY:I.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-It/2-le,y:-It/2-le,width:X+It+2*le,height:Z+It+2*le,stroke:Je&&I.pages.length>1?G:N,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:J+z*I.scale,y:te+z*I.scale,scaleX:I.scale,scaleY:I.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ee,onDragStart:ne=>{var Re;!((Re=ne.evt)===null||Re===void 0)&&Re.altKey&&I.selectedElements.forEach(Me=>{const ye=Me.clone({},{skipSelect:!0}),Le=U.children.indexOf(Me);U.setElementZIndex(ye.id,Le)}),I.history.startTransaction()},onDragEnd:()=>{I.history.endTransaction()},onTransformStart:()=>{I.history.startTransaction()},boundBoxFunc:(ne,Re)=>{const Me=Math.abs(Re.width)<1||Math.abs(Re.height)<1,ye=Math.abs(ne.width)<1||Math.abs(ne.height)<1;return Me&&!ye?ne:Re},onTransform:ne=>{var Re,Me;const ye=(Re=ee.current)===null||Re===void 0?void 0:Re.__getNodeRect(),Le=(Me=ee.current)===null||Me===void 0?void 0:Me.getActiveAnchor();ie({anchor:Le,x:ye.x,y:ye.y,rotation:ye.rotation,width:ye.width,height:ye.height})},onTransformEnd:ne=>{ie({}),I.history.endTransaction()},visible:!I.isPlaying}),ke&&ke.map(({points:ne,distance:Re,box1:Me,box2:ye},Le)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:Le,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({},ye,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[ne[0].x,ne[0].y,ne[1].x,ne[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[ne[1].x,ne[1].y,ne[2].x,ne[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(ne[0].x+ne[1].x)/2,y:(ne[0].y+ne[1].y)/2,offsetY:-10,scaleX:1/I.scale,scaleY:1/I.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,m.pxToUnitString)({unit:I.unit,dpi:I.dpi,px:Re})})))),U._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:X,height:Z,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:X,height:Z,align:"center",verticalAlign:"middle"})),pt&&n.default.createElement(pt,{components:K,store:I,page:U,stageRef:se})),n.default.createElement(F,Object.assign({},ue,{store:I})),n.default.createElement(R,{selection:ge}),h.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:W-170,y:M-18,onMouseEnter:ne=>{ne.target.getStage().container().style.cursor="pointer"},onMouseLeave:ne=>{ne.target.getStage().container().style.cursor=""},onTouchStart:ne=>{ne.cancelBubble=!0},onMouseDown:ne=>{ne.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),he&&Je&&Ye&&n.default.createElement(Ye,{store:I,page:U,xPadding:J,yPadding:te}))})})(Lw);var H7={};(function(e){var t=be&&be.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(Qe),n=Up,i=Hp,a=mi,o=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function l(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:u,width:f,height:v})=>{const S=r.default.useRef(null);if(!u.activePage)return null;const _=u.activePage,h=(u.bleedVisible&&_.bleed,_.computedWidth*u.scale),E=_.computedHeight*u.scale,m=(f-h)/2,p=(y=P=>(0,i.unitToPx)({unitVal:P,dpi:u.dpi,unit:u.unit})*u.scale,o.find(P=>y(P)>30)||1e4);var y;const g=(0,i.unitToPx)({unitVal:p,dpi:u.dpi,unit:u.unit})*u.scale,d=Math.round(h/g)+1,b=Math.round(E/g)+1,O=(0,n.getTotalClientRect)(u.selectedShapes);return r.default.createElement("div",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},ref:S},r.default.createElement("div",{style:{width:f+"px",height:"14px",position:"sticky",fontSize:"8px",lineHeight:"14px",top:"0px",left:"0px",color:"grey",borderBottom:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"}},[...Array(d)].map((P,x)=>r.default.createElement("div",{key:x,style:{position:"absolute",left:m+x*g+"px",borderLeft:"1px solid grey",paddingLeft:"2px",width:g+"px"}},u.unit==="px"||p>=1?Math.round(p*x):(p*x).toFixed(1))),!!u.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:m+O.x*u.scale+"px",height:"14px",width:O.width*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),u.pages.map((P,x)=>{var w;const T=P.computedHeight*u.scale,k=(v-T)/2;return r.default.createElement("div",{key:P.id,style:{left:"0px",width:"14px",height:v+"px",position:"sticky",fontSize:"8px",lineHeight:"14px",color:"grey",borderRight:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"}},[...Array(b)].map((A,R)=>r.default.createElement("div",{key:R,style:{position:"absolute",left:"14px",top:k+R*g-14+"px",borderLeft:"1px solid grey",paddingLeft:"2px",transform:"rotate(90deg)",transformOrigin:"left top",width:g+"px",overflow:"hidden"}},u.unit==="px"||p>=1?Math.round(p*R):(p*R).toFixed(1))),((w=u.selectedShapes[0])===null||w===void 0?void 0:w.page)===P&&r.default.createElement("div",{style:{position:"absolute",top:k+O.y*u.scale-14+"px",width:"14px",height:O.height*u.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=l})(H7);var $7={},Pg={},xg={};let Cj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",G7=e=>crypto.getRandomValues(new Uint8Array(e)),V7=(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}}},kj=(e,t=21)=>V7(e,t,G7),Tj=(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 Aj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:kj,customRandom:V7,nanoid:Tj,random:G7,urlAlphabet:Cj},Symbol.toStringTag,{value:"Module"})),e2=ao(Aj);var Cg={},q7={},t2={};(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})(t2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=bi,r=t2;Object.assign(t.types),e.UndoManager=t.types.model("UndoManager",{history:t.types.array(t.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let i,a,o=!1,l=null,u=0,f=0;const v=()=>f>0;function S(){const h=(0,t.getSnapshot)(i);return{pages:h.pages,width:h.width,height:h.height}}function _(h){const E=i.pages.map(p=>p.id),m=h.pages.map(p=>p.id);(0,r.deepEqual)(E,m)?i.pages.forEach((p,y)=>{(0,t.applySnapshot)(p,h.pages[y])}):(0,t.applySnapshot)(i.pages,h.pages),i.setSize(h.width,h.height)}return{startTransaction(){f++},endTransaction(h){f--,h||this.requestAddState(S())},async ignore(h,E=!1,m=!1){m&&await new Promise(b=>setTimeout(b,10)),u&&n.addUndoState();let p=v();n.startTransaction();let y=f;try{await h()}catch(b){setTimeout(()=>{throw b})}const g=y!==f,d=!g;n.endTransaction(d),E||p||n.replaceState(),g||(clearTimeout(u),u=0)},async transaction(h){await n.ignore(h,!0),this.addUndoState()},requestAddState(h){l=h,u||v()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),v()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const h=n.history[n.undoIdx];!(0,r.deepEqual)(l,h)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,t.resolvePath)(n,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");a=(0,t.onSnapshot)(i,()=>{this.requestAddState(S())}),n.history.length===0&&this.requestAddState(S())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(S())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,_(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,_(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=S()}}}),e.default=e.UndoManager})(q7);var W7={};(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})(W7);var Y7={};(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})(Y7);var K7={};(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
|
|
236
|
+
(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]);
|
|
237
|
+
`],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(K7);var X7={};(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})(X7);var Z7={},vc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=qs;function r(o){return new Promise(l=>{const u=document.createElement("img");u.onload=async()=>{u.width===0||u.height===0?l(await(0,t.getSvgSize)(o)):l({width:u.width,height:u.height})},u.crossOrigin="anonymous",u.src=o})}function n(o){return new Promise((l,u)=>{const f=document.createElement("img");f.onload=()=>{l(f)},f.onerror=v=>{u(v)},f.crossOrigin="anonymous",f.src=o})}async function i(o,l){const u=await n(o),f=document.createElement("canvas");f.width=2*u.width,f.height=2*u.height,f.getContext("2d").drawImage(u,0,0,f.width,f.height);const v=document.createElement("canvas");v.width=l.width,v.height=l.height;const S=v.getContext("2d");let{cropX:_,cropY:h}=l;const E=f.width*l.cropWidth,m=f.height*l.cropHeight,p=l.width/l.height;let y,g;const d=E/m;return l.type==="svg"?(y=E,g=m):p>=d?(y=E,g=E/p):(y=m*p,g=m),S.drawImage(f,_*f.width,h*f.height,y,g,0,0,v.width,v.height),v.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,v=u/f;let S,_;v>=l.width/l.height?(S=l.width,_=l.width/v):(S=l.height*v,_=l.height);const h=(l.width-S)/2,E=(l.height-_)/2;return{cropX:h/l.width,cropY:E/l.height,cropWidth:S/l.width,cropHeight:_/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(vc);(function(e){var t=be&&be.__createBinding||(Object.create?function(w,T,k,A){A===void 0&&(A=k);var R=Object.getOwnPropertyDescriptor(T,k);R&&!("get"in R?!T.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return T[k]}}),Object.defineProperty(w,A,R)}:function(w,T,k,A){A===void 0&&(A=k),w[A]=T[k]}),r=be&&be.__setModuleDefault||(Object.create?function(w,T){Object.defineProperty(w,"default",{enumerable:!0,value:T})}:function(w,T){w.default=T}),n=be&&be.__importStar||function(w){if(w&&w.__esModule)return w;var T={};if(w!=null)for(var k in w)k!=="default"&&Object.prototype.hasOwnProperty.call(w,k)&&t(T,w,k);return r(T,w),T},i=be&&be.__rest||function(w,T){var k={};for(var A in w)Object.prototype.hasOwnProperty.call(w,A)&&T.indexOf(A)<0&&(k[A]=w[A]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(A=Object.getOwnPropertySymbols(w);R<A.length;R++)T.indexOf(A[R])<0&&Object.prototype.propertyIsEnumerable.call(w,A[R])&&(k[A[R]]=w[A[R]])}return k};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=vc,o=n(qs),l=vc,u=Qy,f=(w,T,...k)=>({type:w,props:T,children:k||[]});function v(w){var T=new DOMParser().parseFromString(w,"image/svg+xml");return T.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(T)}e.fixRatio=v;const S=async({element:w,page:T,store:k})=>{let{src:A}=w;if(w.type==="svg"&&Object.keys(w.colorsReplace).length){const X=await o.urlToString(A);A=o.replaceColors(X,new Map(Object.entries(w.colorsReplace)))}let R="";w.flipX&&(R+="scaleX(-1)"),w.flipY&&(R+="scaleY(-1)"),R||(R="none");const F={};if(w.clipSrc){const X=await o.urlToBase64(w.clipSrc);F["clip-path"]=`url(${X})`}const H=await(0,l.loadImage)(A),Y=H.width*w.cropWidth,$=H.height*w.cropHeight,I=w.width/w.height;let U,W;const M=Y/$;w.type==="svg"?(U=Y,W=$):I>=M?(U=Y,W=Y/I):(U=$*I,W=$);const j=U/H.width,B=W/H.height,N=U/W>w.width/w.height?w.height/W:w.width/U,G=U*N/j,K=W*N/B,q=w.cropX*N*H.width,z=w.cropY*N*H.height;return f("div",{style:Object.assign(Object.assign({},F),{width:"100%",height:"100%","border-radius":w.cornerRadius+"px",border:w.borderSize?`${w.borderSize}px solid ${w.borderColor}`:"none",background:`url(${A})`,transform:R,"background-size":`${Math.round(G)}px ${Math.round(K)}px`,"background-position-x":-Math.round(q)+"px","background-position-y":-Math.round(z)+"px"})})},_=async({element:w,page:T,store:k})=>{let A={};w.fill.indexOf("gradient")>=0&&(A=Object.assign(Object.assign({},A),{"background-color":w.fill,"background-image":w.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const R=w.backgroundPadding*(w.fontSize*w.lineHeight),F=f("div",{style:{position:"absolute",top:-R/2+"px",left:-R/2+"px",display:w.backgroundEnabled?"block":"none",width:w.width+R+"px",height:w.height+R+"px","background-color":w.backgroundColor,"border-radius":w.backgroundCornerRadius*(w.fontSize*w.lineHeight*.5)+"px"}}),H=f("div",{style:Object.assign(Object.assign({},A),{position:"absolute",top:0,left:0,width:w.width+"px",color:w.fill,"white-space":"pre-wrap","font-size":w.fontSize+"px","text-align":w.align,"font-family":w.fontFamily,"text-decoration":w.textDecoration||"none","line-height":w.lineHeight,"letter-spacing":w.letterSpacing+"em","font-style":w.fontStyle,"font-weight":w.fontWeight,"-webkit-text-stroke":`${w.strokeWidth}px ${w.stroke}`,"text-stroke":`${w.strokeWidth}px ${w.stroke}`})},w.text.split(`
|
|
238
|
+
`).join("<br />"));return f("div",{style:{position:"relative"}},F,H)},h=({element:w,type:T})=>{const k={"stroke-width":w.height,stroke:w.color,"line-cap":"round","stroke-linejoin":"round",opacity:w.opacity};return T==="arrow"||T==="triangle"?f("polyline",Object.assign({points:`${3*w.height},${2*-w.height} 0,0 ${3*w.height},${2*w.height}`},k)):T==="bar"?f("polyline",Object.assign({points:`0,${2*-w.height} 0,${2*w.height}`},k)):T==="circle"?f("circle",Object.assign({r:w.height},k)):T==="square"?f("polyline",Object.assign({points:`${-w.height},${-w.height} ${-w.height},${w.height} ${w.height},${w.height} ${w.height},${-w.height}`},k)):null},E=async({element:w,page:T,store:k})=>f("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},f("rect",{x:0,y:0,width:w.width,height:w.height,fill:w.color}),f("g",{transform:`translate(0 ${w.height/2})`},h({element:w,type:w.startHead})),f("g",{transform:`translate(${w.width} ${w.height/2}) rotate(180)`},h({element:w,type:w.endHead}))),m=async({element:w,page:T,store:k,elementHook:A})=>{const R=await Promise.all(w.children.map(H=>g({element:H,page:T,store:k,elementHook:A}))),F=f("div",{style:{"transform-origin":"top left",opacity:w.opacity}},...R);return A&&A({dom:F,element:w})||F},p=async({element:w,page:T,store:k,elementHook:A})=>{const R=(0,u.figureToSvg)(w),F=f("div",{innerHTML:R});return A&&A({dom:F,element:w})||F},y={image:S,svg:S,text:_,line:E,figure:p,group:m};async function g({element:w,page:T,store:k,elementHook:A}){let R=await y[w.type];R||(R=()=>f("div",{}),console.error(`HTML export does not support ${w.type} type...`));const F=await R({element:w,page:T,store:k}),H=[];w.blurEnabled&&H.push(`blur(${w.blurRadius/2}px)`),w.brightnessEnabled&&H.push(`brightness(${100*w.brightness+100}%)`),w.sepiaEnabled&&H.push("sepia()"),w.grayscaleEnabled&&H.push("grayscale()"),w.shadowEnabled&&H.push(`drop-shadow(${w.shadowOffsetX}px ${w.shadowOffsetY}px ${w.shadowBlur}px ${w.shadowColor})`);const Y=f("div",{style:{position:"absolute",left:w.x+"px",top:w.y+"px",width:w.width+"px",height:w.height+"px",transform:`rotate(${w.rotation}deg)`,"transform-origin":"top left",opacity:w.opacity,filter:H.join(" ")||"none"}},F);return A&&A({dom:Y,element:w})||Y}async function d({page:w,store:T,elementHook:k}){const A=await Promise.all(w.children.map(F=>g({element:F,page:w,store:T,elementHook:k})));let R={};if(w.background.indexOf("url")>=0||w.background.indexOf("http")>=0||w.background.indexOf(".jpg")>=0||w.background.indexOf(".png")>=0||w.background.indexOf(".jpeg")>=0){const{width:F,height:H}=await(0,l.loadImage)(w.background),Y=await S({element:Object.assign({x:0,y:0,width:T.width,height:T.height,src:w.background,cornerRadius:0},(0,a.getCrop)({width:T.width,height:T.height},{width:F,height:H})),page:w,store:T});A.unshift(Y)}else R=Object.assign(Object.assign({},R),{"background-color":w.background});return f("div",{className:"page",style:Object.assign(Object.assign({},R),{width:T.width+"px",height:T.height+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...A)}async function b({json:w,elementHook:T}){const k=await Promise.all(w.pages.map(F=>d({page:F,store:w,elementHook:T}))),A=[];w.pages.forEach(F=>{F.children.forEach(H=>{H.type==="text"&&A.indexOf(H.fontFamily)===-1&&A.push(H.fontFamily)})});const R=A.map(F=>w.fonts.find(H=>H.fontFamily===F)?f("style",{},""):f("link",{href:`https://fonts.googleapis.com/css?family=${F}`,rel:"stylesheet"}));return f("div",{className:"design"},...R,...k)}e.jsonToDOM=b;const O=(w,T)=>typeof T=="object"?`${w}="${Object.keys(T).map(k=>`${k}:${T[k]};`).join(" ")}"`:`${w}="${T}"`,P=({dom:w})=>{if(typeof w=="string")return w;if(!w)return"";const T=w.props,{innerHTML:k}=T,A=i(T,["innerHTML"]);return`<${w.type} ${Object.keys(A).map(R=>O(R,w.props[R])).join(" ")}>${k||w.children.map(R=>P({dom:R})).join("")}</${w.type}>`};async function x({json:w,elementHook:T}){const k=await b({json:w,elementHook:T});return P({dom:k})}e.jsonToHTML=x})(Z7);var Q7={};(function(e){var t=be&&be.__createBinding||(Object.create?function(P,x,w,T){T===void 0&&(T=w);var k=Object.getOwnPropertyDescriptor(x,w);k&&!("get"in k?!x.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return x[w]}}),Object.defineProperty(P,T,k)}:function(P,x,w,T){T===void 0&&(T=w),P[T]=x[w]}),r=be&&be.__setModuleDefault||(Object.create?function(P,x){Object.defineProperty(P,"default",{enumerable:!0,value:x})}:function(P,x){P.default=x}),n=be&&be.__importStar||function(P){if(P&&P.__esModule)return P;var x={};if(P!=null)for(var w in P)w!=="default"&&Object.prototype.hasOwnProperty.call(P,w)&&t(x,P,w);return r(x,P),x};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const i=vc,a=n(qs),o=vc,l=(P,x,...w)=>({type:P,props:x,children:w||[]});function u(P){var x=new DOMParser().parseFromString(P,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=u;const f=async P=>{const x=await(0,o.loadImage)(P),w=document.createElement("canvas");return w.width=x.width,w.height=x.height,w.getContext("2d").drawImage(x,0,0),w.toDataURL("image/png")},v=async({element:P,page:x,store:w})=>{let{src:T}=P;if(P.type==="svg"){const z=await a.urlToString(T);T=a.replaceColors(z,new Map(Object.entries(P.colorsReplace)))}let k="";P.flipX&&(k+="scaleX(-1)"),P.flipY&&(k+="scaleY(-1)");const A={};if(P.clipSrc){const z=await a.urlToBase64(P.clipSrc);A["clip-path"]=`url(${z})`}const R=await(0,o.loadImage)(T),F=R.width*P.cropWidth,H=R.height*P.cropHeight,Y=P.width/P.height;let $,I;const U=F/H;P.type==="svg"?($=F,I=H):Y>=U?($=F,I=F/Y):($=H*Y,I=H);const W=$/R.width,M=I/R.height,j=$/I>P.width/P.height?P.height/I:P.width/$,B=$*j/W,N=I*j/M,G=P.cropX*j*R.width,K=P.cropY*j*R.height,q=`clip-${Math.random()}`;return l("g",{style:{"clip-path":A["clip-path"],transform:k}},l("defs",{},l("clipPath",{id:q},l("rect",{x:G,y:K,width:B,height:N}))),l("image",{"xlink:href":await f(T),width:P.width,height:P.height,preserveAspectRatio:"none","clip-path":`url(#${q})`}))},S=async({element:P,page:x,store:w})=>{let T={};P.fill.indexOf("gradient")>=0&&(T=Object.assign(Object.assign({},T),{"background-color":P.fill,"background-image":P.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const k=P.backgroundPadding*(P.fontSize*P.lineHeight),A=l("div",{style:{position:"absolute",top:-k/2+"px",left:-k/2+"px",display:P.backgroundEnabled?"block":"none",width:P.width+k+"px",height:P.height+k+"px","background-color":P.backgroundColor,"border-radius":P.backgroundCornerRadius*(P.fontSize*P.lineHeight*.5)+"px"}}),R=l("div",{style:Object.assign(Object.assign({},T),{position:"absolute",top:0,left:0,width:P.width+"px",color:P.fill,"white-space":"pre-wrap","font-size":P.fontSize+"px","text-align":P.align,"font-family":P.fontFamily,"text-decoration":P.textDecoration||"none","line-height":P.lineHeight,"letter-spacing":P.letterSpacing+"em","font-style":P.fontStyle,"font-weight":P.fontWeight,"-webkit-text-stroke":`${P.strokeWidth}px ${P.stroke}`,"text-stroke":`${P.strokeWidth}px ${P.stroke}`})},P.text.split(`
|
|
239
|
+
`).join("<br />"));return l("foreignObject",{width:P.width,height:P.height},l("div",{style:{position:"relative"},xmlns:"http://www.w3.org/1999/xhtml"},A,R))},_=({element:P,type:x})=>{const w={"stroke-width":P.height,stroke:P.color,"line-cap":"round","stroke-linejoin":"round",opacity:P.opacity};return x==="arrow"||x==="triangle"?l("polyline",Object.assign({points:`${3*P.height},${2*-P.height} 0,0 ${3*P.height},${2*P.height}`},w)):x==="bar"?l("polyline",Object.assign({points:`0,${2*-P.height} 0,${2*P.height}`},w)):x==="circle"?l("circle",Object.assign({r:P.height},w)):x==="square"?l("polyline",Object.assign({points:`${-P.height},${-P.height} ${-P.height},${P.height} ${P.height},${P.height} ${P.height},${-P.height}`},w)):null},h=async({element:P,page:x,store:w})=>l("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},l("rect",{x:0,y:0,width:P.width,height:P.height,fill:P.color}),l("g",{transform:`translate(0 ${P.height/2})`},_({element:P,type:P.startHead})),l("g",{transform:`translate(${P.width} ${P.height/2}) rotate(180)`},_({element:P,type:P.endHead}))),E=async({element:P,page:x,store:w,elementHook:T})=>{const k=await Promise.all(P.children.map(R=>p({element:R,page:x,store:w,elementHook:T}))),A=l("g",{opacity:P.opacity,style:{"transform-origin":"top left"}},...k);return T&&T({dom:A,element:P})||A},m={image:v,svg:v,text:S,line:h,group:E};async function p({element:P,page:x,store:w,elementHook:T}){let k=await m[P.type];k||(k=()=>l("div",{}),console.error(`HTML export does not support ${P.type} type...`));const A=await k({element:P,page:x,store:w}),R=[];P.blurEnabled&&R.push(`blur(${P.blurRadius/2}px)`),P.brightnessEnabled&&R.push(`brightness(${100*P.brightness+100}%)`),P.sepiaEnabled&&R.push("sepia()"),P.grayscaleEnabled&&R.push("grayscale()"),P.shadowEnabled&&R.push(`drop-shadow(${P.shadowOffsetX}px ${P.shadowOffsetY}px ${P.shadowBlur}px ${P.shadowColor})`);const F=l("g",{transform:`translate(${P.x}, ${P.y}) rotate(${P.rotation})`,rotation:P.rotation,width:P.width,height:P.height,opacity:P.opacity,style:{"transform-origin":"top left",filter:R.join(" ")}},A);return T&&T({dom:F,element:P})||F}async function y({page:P,store:x,elementHook:w}){const T=await Promise.all(P.children.map(A=>p({element:A,page:P,store:x,elementHook:w})));let k={};if(P.background.indexOf("url")>=0||P.background.indexOf("http")>=0||P.background.indexOf(".jpg")>=0||P.background.indexOf(".png")>=0||P.background.indexOf(".jpeg")>=0){const A=await(0,o.loadImage)(P.background),R=await(0,o.cropImage)(P.background,Object.assign({width:x.width,height:x.height,x:0,y:0},(0,i.getCrop)({width:x.width,height:x.height},{width:A.width,height:A.height})));k=Object.assign(Object.assign({},k),{"background-image":`url(${R})`})}return l("g",{className:"page",style:Object.assign(Object.assign({},k),{background:P.background})},l("rect",{x:0,y:0,width:x.width,height:x.height,fill:P.background}),...T)}async function g({json:P,elementHook:x}){const w=await Promise.all(P.pages.map(A=>y({page:A,store:P,elementHook:x}))),T=[];P.pages.forEach(A=>{A.children.forEach(R=>{R.type==="text"&&T.indexOf(R.fontFamily)===-1&&T.push(R.fontFamily)})});const k=T.map(A=>P.fonts.find(R=>R.fontFamily===A)?l("style",{},""):l("link",{href:`https://fonts.googleapis.com/css?family=${A}`,rel:"stylesheet"}));return l("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${P.width} ${P.height}`,preserveAspectRatio:"xMidYMin slice"},...k,...w)}e.jsonToDOM=g;const d=(P,x)=>typeof x=="object"?`${P}="${Object.keys(x).map(w=>`${w}:${x[w]};`).join(" ")}"`:`${P}="${x}"`,b=({dom:P})=>typeof P=="string"?P:P?`<${P.type} ${Object.keys(P.props).map(x=>d(x,P.props[x])).join(" ")}>${P.children.map(x=>b({dom:x})).join("")}</${P.type}>
|
|
240
|
+
`:"";async function O({json:P,elementHook:x}){const w=await g({json:P,elementHook:x});return b({dom:w})}e.jsonToSVG=O})(Q7);var kg={},Y4;function J7(){return Y4||(Y4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=bi,r=e2,n=mc(),i=r2(),a=mc();e.Page=t.types.model("Page",{id:t.types.identifier,children:t.types.array(t.types.late(()=>n.ElementTypes)),width:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),height:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),background:"white",bleed:0,custom:t.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get store(){return(0,t.getParentOfType)(o,i.Store)},get startTime(){let l=0;for(const u of o.store.pages){if(u.id===o.id)return l;l+=u.duration}return l}})).views(o=>({get computedWidth(){return o.width==="auto"?o.store.width:o.width},get computedHeight(){return o.height==="auto"?o.store.height:o.height}})).actions(o=>({toJSON:()=>JSON.parse(JSON.stringify((0,t.getSnapshot)(o))),_forEachElementUp(l,u){const f=l.map(v=>({id:v,index:o.children.findIndex(S=>S.id===v)}));f.sort((v,S)=>S.index-v.index);for(const{index:v}of f){if(v==-1)continue;const S=v<o.children.length-1&&o.children[v+1],_=l.indexOf(S==null?void 0:S.id)>=0;v===o.children.length-1||_||u(v)}},_forEachElementDown(l,u){const f=l.map(v=>({id:v,index:o.children.findIndex(S=>S.id===v)}));f.sort((v,S)=>v.index-S.index);for(const{index:v}of f){if(v==-1)continue;const S=v>0&&o.children[v-1],_=l.indexOf(S==null?void 0:S.id)>=0;v===0||_||u(v)}return!1}})).actions(o=>({clone(l={}){const u=o.toJSON();u.children.forEach(_=>{_.id=(0,r.nanoid)(10),(0,a.forEveryChild)(_,h=>{h.id=(0,r.nanoid)(10)})});const f=Object.assign(Object.assign(Object.assign({},u),{id:(0,r.nanoid)(10)}),l),v=o.store.addPage(f),S=o.store.pages.indexOf(o);v.setZIndex(S+1),v.select()},setZIndex(l){o.store.setPageZIndex(o.id,l)},set(l){Object.assign(o,l)},select(){o.store.selectPage(o.id)},addElement(l,{skipSelect:u=!1}={}){const f=a.TYPES_MAP[l.type];if(!f)return void console.error("Can not find model with type "+l.type);l.children&&l.children.forEach(S=>{S.id=(0,r.nanoid)(10)});const v=f.create(Object.assign({id:(0,r.nanoid)(10)},l));return o.children.push(v),v.selectable&&!u&&o.store.selectElements([v.id]),v},canMoveElementsUp(l){let u=!1;return o._forEachElementUp(l,()=>{u=u||!0}),u},moveElementsUp(l){o._forEachElementUp(l,u=>{const f=o.children[u];(0,t.detach)(f),o.children.splice(u+1,0,f)})},canMoveElementsTop(l){return this.canMoveElementsUp(l)},moveElementsTop(l){const u=[],f=[];o.children.forEach(v=>{l.indexOf(v.id)>=0?u.push(v):f.push(v)}),o.children.replace(f.concat(u))},canMoveElementsDown(l){let u=!1;return o._forEachElementDown(l,()=>{u=u||!0}),u},moveElementsDown(l){o._forEachElementDown(l,u=>{const f=o.children[u];(0,t.detach)(f),o.children.splice(u-1,0,f)})},canMoveElementsBottom(l){return this.canMoveElementsDown(l)},moveElementsBottom(l){const u=[],f=[];o.children.forEach(v=>{l.indexOf(v.id)>=0?u.push(v):f.push(v)}),o.children.replace(u.concat(f))},setElementZIndex(l,u){const f=o.children.find(v=>v.id===l);f&&((0,t.detach)(f),o.children.remove(f),o.children.splice(u,0,f))},setSize({width:l,height:u,useMagic:f,softChange:v}){if(f){const S=l/o.computedWidth,_=u/o.computedHeight,h=Math.min(S,_),E=Math.max(0,(l-o.computedWidth*h)/2),m=Math.max(0,(u-o.computedHeight*h)/2);(0,a.forEveryChild)(o,p=>{p.type!=="group"&&(p.type==="image"&&p.x<1&&p.y<1&&p.width>=o.computedWidth-2&&p.height>=o.computedHeight-2?p.set({x:p.x*h,y:p.y*h,width:p.width*S,height:p.height*_,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(p.set({x:E+p.x*h,y:m+p.y*h,width:p.width*h,height:p.height*h}),p.type==="text"?p.set({fontSize:p.fontSize*h}):p.type==="figure"&&p.set({strokeWidth:p.strokeWidth*h})))})}v||(o.width=l),v||(o.height=u)}})).actions(o=>({moveElementUp(l){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),o.moveElementsUp([l])},moveElementDown(l){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),o.moveElementsDown([l])},moveElementTop(l){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),o.moveElementsTop([l])},moveElementBottom(l){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),o.moveElementsBottom([l])}}))}(kg)),kg}var K4;function r2(){return K4||(K4=1,function(e){var t=be&&be.__createBinding||(Object.create?function(w,T,k,A){A===void 0&&(A=k);var R=Object.getOwnPropertyDescriptor(T,k);R&&!("get"in R?!T.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return T[k]}}),Object.defineProperty(w,A,R)}:function(w,T,k,A){A===void 0&&(A=k),w[A]=T[k]}),r=be&&be.__setModuleDefault||(Object.create?function(w,T){Object.defineProperty(w,"default",{enumerable:!0,value:T})}:function(w,T){w.default=T}),n=be&&be.__importStar||function(w){if(w&&w.__esModule)return w;var T={};if(w!=null)for(var k in w)k!=="default"&&Object.prototype.hasOwnProperty.call(w,k)&&t(T,w,k);return r(T,w),T},i=be&&be.__rest||function(w,T){var k={};for(var A in w)Object.prototype.hasOwnProperty.call(w,A)&&T.indexOf(A)<0&&(k[A]=w[A]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(A=Object.getOwnPropertySymbols(w);R<A.length;R++)T.indexOf(A[R])<0&&Object.prototype.propertyIsEnumerable.call(w,A[R])&&(k[A[R]]=w[A[R]])}return k},a=be&&be.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=bi,l=q7,u=e2,f=a(Kn),v=W7,S=Y7,_=K7,h=Jy(),E=n(Bc),m=da,p=Hp,y=t2,g=X7,d=Z7,b=Q7,O=J7(),P=mc();function x({key:w,showCredit:T}={key:"",showCredit:!1}){const k=e.Store.create();return(0,h.validateKey)(w,T),k}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(w=>Object.assign(Object.assign({},w),{fontFamily:w.fontFamily||w.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(O.Page),fonts:o.types.array(e.Font),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",selectedElementsIds:o.types.array(o.types.string),animatedElementsIds:o.types.array(o.types.string),history:o.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:2,_activePageId:""}).views(w=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),w.bleedVisible},get selectedElements(){return w.selectedElementsIds.map(T=>{for(const k of w.pages)for(const A of k.children)if(A.id===T)return A}).filter(T=>!!T)},get children(){return w.pages},get selectedShapes(){const T=[];return w.selectedElementsIds.forEach(k=>{for(const A of w.pages)for(const R of A.children)R.id===k&&R.type!=="group"&&T.push(R),R.type==="group"&&R.id===k&&T.push(...R.children)}),T},get activePage(){return w.pages.slice().find(T=>T.id===w._activePageId)||(w.pages.length?w.pages[0]:null)},get duration(){let T=0;return w.pages.forEach(k=>{T+=k.duration}),T},get _hasCroppedImages(){return w.find(T=>T.type==="image"&&T._cropModeEnabled)},find(T){let k;return(0,P.forEveryChild)({children:w.pages},A=>{if(!k&&T(A))return k=A,!0}),k},getElementById:T=>w.find(k=>k.id===T)})).actions(w=>{let T=0;return{afterCreate(){w.history.canUndo},setCurrentTime(k){w.currentTime=k},play({animatedElementsIds:k=[],currentTime:A=0}={}){w.animatedElementsIds=(0,o.cast)(k),w.currentTime=A,w.isPlaying=!0,T=Date.now(),requestAnimationFrame(w.seek)},seek(){if(!w.isPlaying)return;const k=Date.now(),A=k-T;T=k,w.currentTime+=A;let R=0;for(const F of w.pages){if(w.currentTime>=F.startTime&&w.currentTime<F.startTime+F.duration){w.selectPage(F.id);break}R+=F.duration}w.isPlaying&&w.currentTime<w.duration?requestAnimationFrame(w.seek):w.stop()},stop(){w.isPlaying=!1,w.currentTime=0,w.animatedElementsIds=(0,o.cast)([])}}}).actions(w=>({setUnit({unit:T,dpi:k}){w.unit=T||w.unit,w.dpi=k||w.dpi},setRole(T){w.role=T},addPage(T){const k=O.Page.create(Object.assign({id:(0,u.nanoid)(10)},T));return w.pages.push(k),w._activePageId=k.id,k},selectPage(T){w._activePageId=T},selectElements(T){const k=T.map(A=>w.getElementById(A)).sort((A,R)=>A.page.children.indexOf(A)-A.page.children.indexOf(R)).filter(A=>!!A).map(A=>A.id);w.selectedElementsIds=(0,o.cast)(k)},toggleBleed(T){w.bleedVisible=T??!w.bleedVisible},toggleRulers(T){w.rulesVisible=T??!w.rulesVisible},openSidePanel(T){w.openedSidePanel=T},setScale(T){w.scale=T},_setScaleToFit(T){w.scaleToFit=T},setElementsPixelRatio(T){w._elementsPixelRatio=T},setSize(T,k,A){w.pages.forEach(R=>{R.setSize({width:T,height:k,useMagic:A,softChange:!0})}),w.width=T,w.height=k},setPageZIndex(T,k){const A=w.pages.find(R=>R.id===T);A&&((0,o.detach)(A),w.pages.remove(A),w.pages.splice(k,0,A))},deletePages(T){const k=w.pages.indexOf(w.activePage);T.forEach(F=>{const H=w.pages.find(Y=>Y.id===F);(0,o.destroy)(H)});const A=Math.min(w.pages.length-1,k),R=w.pages[A];R&&(w._activePageId=R.id),w.selectedElementsIds=(0,o.cast)(w.selectedElementsIds.filter(F=>w.getElementById(F)))},groupElements(T){const k=T.map(F=>w.getElementById(F));k.forEach(F=>{F&&(0,o.detach)(F)});const A=w.activePage,R={id:(0,u.nanoid)(10),children:k,type:"group"};return A.children.push(R),w.selectedElementsIds=(0,o.cast)([R.id]),R},ungroupElements(T){const k=T.map(R=>w.getElementById(R)),A=[];k.forEach(R=>{if(R&&R.type==="group"){const F=R.page,H=F.children.indexOf(R);R.children.forEach(Y=>{A.push(Y.id)}),R.children.forEach(Y=>{(0,o.detach)(Y),F.children.push(Y)}),F.children.splice(H,1)}}),w.selectedElementsIds=(0,o.cast)(A)},deleteElements(T){T.forEach(k=>{w.pages.forEach(A=>{const R=A.children.find(F=>F.id===k);R&&(0,o.destroy)(R)})}),w.selectedElementsIds=(0,o.cast)(w.selectedElementsIds.filter(k=>w.getElementById(k)))},on(T,k){if(T==="change"){let A=w.toJSON();return(0,o.onSnapshot)(w,R=>{const F=w.toJSON();!(0,y.deepEqual)(A,F)&&(A=F,k(F))})}},async _toCanvas({pixelRatio:T,ignoreBackground:k,pageId:A,mimeType:R,includeBleed:F}={}){var H;const Y=T||1;A=A||((H=w.pages[0])===null||H===void 0?void 0:H.id);const $=w.pages.find(ee=>ee.id===A);if(!$)throw new Error(`No page for export with id ${A}`);$==null||$.set({_exporting:!0});const I=await(0,g.waitTillAvailable)(()=>f.default.stages.find(ee=>ee.getAttr("pageId")===A));if(!I)throw new Error(`Export is failed. Can not find stage for page ${A}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const U=!!I.findOne(".page-container");await w.waitLoading();const W=I.findOne(".page-container");if(!W)throw new Error(`Export is failed. Can't find page container. ${U}`);I.find("Transformer").forEach(ee=>ee.visible(!1)),W.find(".page-background").forEach(ee=>ee.shadowEnabled(!1)),W.find(".page-background").forEach(ee=>ee.strokeEnabled(!1)),W.find(".highlighter").forEach(ee=>ee.visible(!1));const M=W.findOne(".page-background-group"),j=M.clip();M.clip({x:null,y:null,width:null,height:null});const B=W.findOne(".elements-container"),N=B.clip();B.clip({x:null,y:null,width:null,height:null});const G=W.find(ee=>ee.getAttr("hideInExport"));G.forEach(ee=>{ee.setAttr("oldVisible",ee.visible()),ee.hide()});const K=W.find(ee=>!ee.visible()&&ee.getAttr("editModeEnabled"));K.forEach(ee=>{ee.setAttr("oldVisible",ee.visible()),ee.show()}),k&&W.find(".page-background").forEach(ee=>ee.hide());const q=F?$.bleed:0;let z=q;!w.bleedVisible&&F||(w.bleedVisible||F?w.bleedVisible&&F?z=0:w.bleedVisible&&!F&&(z=-$.bleed):z=0);const X=document.createElement("canvas");X.width=Math.round(($.computedWidth+2*q)*Y),X.height=Math.round(($.computedHeight+2*q)*Y);const Z=X.getContext("2d");R==="image/jpeg"&&(Z.fillStyle="white",Z.fillRect(0,0,X.width,X.height));const J=W.scale();W.scale({x:1,y:1});const te=W.toCanvas({x:W.x()-z,y:W.y()-z,width:$.computedWidth+2*q,height:$.computedHeight+2*q,pixelRatio:Y});return W.scale(J),Z.drawImage(te,0,0,X.width,X.height),f.default.Util.releaseCanvas(te),k&&W.find(".page-background").forEach(ee=>ee.show()),G.forEach(ee=>{ee.visible(ee.getAttr("oldVisible"))}),K.forEach(ee=>{ee.visible(ee.getAttr("oldVisible"))}),W.find(".page-background").forEach(ee=>ee.shadowEnabled(!0)),W.find(".page-background").forEach(ee=>ee.strokeEnabled(!0)),I.find("Transformer").forEach(ee=>ee.visible(!0)),W.find(".highlighter").forEach(ee=>ee.visible(!0)),M.clip(j),B.clip(N),$==null||$.set({_exporting:!1}),X},async toDataURL({pixelRatio:T,ignoreBackground:k,pageId:A,mimeType:R,includeBleed:F,quality:H}={}){const Y=await w._toCanvas({pixelRatio:T,ignoreBackground:k,pageId:A,mimeType:R,includeBleed:F}),$=Y.toDataURL(R,H);return f.default.Util.releaseCanvas(Y),$},async toBlob({pixelRatio:T,ignoreBackground:k,pageId:A,mimeType:R,includeBleed:F,quality:H}={}){const Y=await w._toCanvas({pixelRatio:T,ignoreBackground:k,pageId:A,mimeType:R,includeBleed:F}),$=new Promise(I=>{Y.toBlob(I,R,H)});return f.default.Util.releaseCanvas(Y),$},async saveAsImage(T={}){var{fileName:k}=T,A=i(T,["fileName"]);const R=A.mimeType||"image/png",F=R.split("/")[1];(0,v.downloadFile)(await w.toDataURL(A),k||"polotno."+F,R)},async _toPDF(T){const k=T.dpi||w.dpi,A=T.parallel||1,R=T.unit||(w.unit==="px"?"mm":w.unit),F=T.pixelRatio||1,H=T.pageIds||w.pages.map(q=>q.id),Y=w.pages.filter(q=>H.includes(q.id)),$=await(0,S.getJsPDF)(),I=q=>(0,p.pxToUnit)({px:q,unit:R,dpi:k}),U=I(T.cropMarkSize||0),W=Y[0]||{},M=T.includeBleed?W.bleed:0,j=I(W.computedWidth+2*M)+2*U,B=I(W.computedHeight+2*M)+2*U;var N=new $({unit:R,orientation:j>B?"landscape":"portrait",format:[j,B],compress:!0,putOnlyUsedFonts:!0});N.deletePage(1);const G=w._elementsPixelRatio;w.setElementsPixelRatio(F),await new Promise(q=>setTimeout(q));const K=((q,z)=>{for(var X=[],Z=0;Z<q.length;Z+=z)X.push(q.slice(Z,Z+z));return X})(Y,A);for(const q of K){const z=q.map(async X=>{const Z=T.includeBleed?X.bleed:0,J=I(X.computedWidth+2*Z)+2*U,te=I(X.computedHeight+2*Z)+2*U;let ee=0,se=F;for(;ee<10;){ee+=1,ee===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const de=await w.toDataURL(Object.assign(Object.assign({},T),{pageId:X.id,pixelRatio:se}));if(de.length>20)return{url:de,width:J,height:te};se*=.8}});(await Promise.all(z)).forEach(({url:X,width:Z,height:J})=>{N.addPage([Z,J],Z>J?"landscape":"portrait"),U&&(N.setLineWidth(I(1)),N.line(2*U,0,2*U,U),N.line(0,2*U,U,2*U),N.line(Z-2*U,0,Z-2*U,U),N.line(Z,2*U,Z-U,2*U),N.line(0,J-2*U,U,J-2*U),N.line(2*U,J,2*U,J-U),N.line(Z,J-2*U,Z-U,J-2*U),N.line(Z-2*U,J,Z-2*U,J-U)),N.addImage(X,U,U,Z-2*U,J-2*U,void 0,"FAST")})}return w.setElementsPixelRatio(G),N},toPDFDataURL:async T=>(await w._toPDF(Object.assign({mimeType:"image/jpeg"},T))).output("datauristring"),async toGIFDataURL(T={}){const k=T.pixelRatio||1,A=await(0,_.createGIF)({width:w.width*k,height:w.height*k}),R=1e3/(T.fps||10),F=w.duration/R;for(let H=0;H<F-1;H++){const Y=H*R||1;w.setCurrentTime(Y);let $=0,I="";for(const W of w.pages)if($+=W.duration,W.set({_rendering:$>Y}),$>Y){I=W.id;break}const U=await w._toCanvas({pixelRatio:k,pageId:I});A.addFrame(U.getContext("2d"),{delay:R,copy:!0})}for(const H of w.pages)H.set({_rendering:!1});return w.stop(),A.render(),new Promise(H=>{A.on("finished",function(Y){(function($,I){var U=new FileReader;U.onload=function(W){I(W.target.result)},U.readAsDataURL($)})(Y,H)})})},async saveAsGIF(T={}){var{fileName:k}=T,A=i(T,["fileName"]);const R=await w.toGIFDataURL(A);(0,v.downloadFile)(R,k||"polotno.gif")},async toHTML(){const T=w.toJSON();return(0,d.jsonToHTML)({json:T})},async saveAsHTML({fileName:T}={}){const k=await w.toHTML(),A="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,v.downloadFile)(A,T||"polotno.html")},async toSVG(){const T=w.toJSON();return(0,b.jsonToSVG)({json:T})},async saveAsSVG({fileName:T}={}){const k=await w.toSVG(),A="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,v.downloadFile)(A,T||"polotno.svg")},async saveAsPDF(T={}){var{fileName:k}=T,A=i(T,["fileName"]);(await w._toPDF(Object.assign({mimeType:"image/jpeg"},A))).save(k||"polotno.pdf")},async waitLoading(){await new Promise(T=>setTimeout(T,50)),await(0,m.whenLoaded)()},toJSON:()=>({width:w.width,height:w.height,fonts:(0,o.getSnapshot)(w.fonts),pages:(0,o.getSnapshot)(w.pages),unit:w.unit,dpi:w.dpi}),loadJSON(T,k=!1){var A;const R=Object.assign({},T),F=w.pages.indexOf(w.activePage);let H=(A=R.pages[F]||R.pages[0])===null||A===void 0?void 0:A.id;R._activePageId=H;const Y=Object.assign({},(0,o.getSnapshot)(w));Object.assign(Y,R),Y.history=k?w.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(w,Y)},clear({keepHistory:T=!1}={}){const k=w.pages.map(A=>A.id);w.deletePages(k),T||w.history.clear()},addFont(T){w.removeFont(T.fontFamily),w.fonts.push(T),w.loadFont(T.fontFamily)},removeFont(T){w.fonts.filter(k=>k.fontFamily===T).forEach(k=>(0,o.destroy)(k))},async loadFont(T){const k=w.fonts.find(A=>A.fontFamily===T)||E.globalFonts.find(A=>A.fontFamily===T);k?E.injectCustomFont(k):E.injectGoogleFont(T),await E.loadFont(T)},validate:T=>e.Store.validate(T,[{path:"",type:e.Store}]).map(k=>({path:"store"+k.context.map(A=>A.path).join("."),message:k.message}))})),e.createStore=x,e.default=x}(Cg)),Cg}var X4;function eS(){return X4||(X4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=bi,r=e2,n=r2(),i=J7(),a=mc();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}})).actions(o=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(o))})).actions(o=>({clone(l={},{skipSelect:u=!1}={}){const f=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(f,v=>{v.id=(0,r.nanoid)(10)}),Object.assign(f,l),o.page.addElement(f,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},beforeDestroy(){}}))}(xg)),xg}var Tg={},tS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}};e.animations={fade:({dTime:i,element:a,animation:o})=>{const l=i/o.duration;return o.type==="enter"?{opacity:l*a.opacity}:{opacity:(1-l)*a.opacity}},move:({dTime:i,element:a,animation:o})=>{const l=t[o.data.direction]||t.right,u={};for(var f in l.from){let v=a[f]+l.from[f],S=a[f]+l.to[f];if(o.type==="exit"){const h=v;v=S,S=-h}const _=S-v;u[f]=v+i/o.duration*_}return u},zoom:({dTime:i,element:a,animation:o})=>{const l={},u={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},f={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize};for(var v in u){let S=u[v],_=f[v];if(o.type==="exit"){const E=S;S=_,_=E}const h=_-S;l[v]=S+i/o.duration*h}return l}};const r=({element:i,dTime:a,animation:o})=>{const l=e.animations[o.name];return l?l({element:i,dTime:a,animation:o}):(console.error("Can not find animation type: "+o.name),{})};e.animate=r;const n=(i,a)=>{};e.registerAnimation=n})(tS);var Z4;function Ws(){return Z4||(Z4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=bi,r=tS,n=eS();e.Animation=t.types.model("Animation",{delay:0,duration:500,enabled:!0,type:t.types.enumeration("Type",["enter","exit"]),name:"none",data:t.types.frozen({})}),e.Shape=n.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(i=>{const a=Object.assign(Object.assign({},i),{x:i.x||0,y:i.y||0});return"width"in i&&(a.width=a.width||1),"height"in i&&(a.height=a.height||1),i.locked&&(a.draggable=!1,a.contentEditable=!1,a.styleEditable=!1,a.resizable=!1),a}).views(i=>({get a(){const{currentTime:a}=i.store,o={x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize};if(a===0)return o;const l=a-i.page.startTime;if(l>i.page.duration||l<0)return o;const u=i.store.animatedElementsIds;if(u.length&&!u.includes(i.id))return o;const f=i.animations.find(S=>S.type==="enter");if(f!=null&&f.enabled&&l<f.delay&&(o.opacity=0),f!=null&&f.enabled&&l>=f.delay&&l<=f.delay+f.duration){const S=l-f.delay,_=(0,r.animate)({element:i,animation:f,dTime:S});Object.assign(o,_)}const v=i.animations.find(S=>S.type==="exit");if(v!=null&&v.enabled&&l>=i.page.duration-v.duration){const S=l-(i.page.duration-v.duration),_=(0,r.animate)({element:i,animation:v,dTime:S});Object.assign(o,_)}return o},animated:a=>i.a[a]})).actions(i=>({setAnimation(a,o){const l=i.animations.find(u=>u.type===a);l?Object.assign(l,o):i.animations.push(Object.assign({type:a},o))}}))}(Tg)),Tg}var Ag={},Q4;function Rj(){return Q4||(Q4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=bi,r=Ws();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()}}))}(Ag)),Ag}var Rg={},J4;function rS(){return J4||(J4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=Ws();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()}}))}(Rg)),Rg}var Mg={},e_;function Mj(){return e_||(e_=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})}(Mg)),Mg}var Lg={},t_;function Lj(){return t_||(t_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=bi,r=Ws();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=>({}))}(Lg)),Lg}var Ng={},r_;function Nj(){return r_||(r_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=bi,r=Ws();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)}}))}(Ng)),Ng}var Ig={},n_;function Ij(){return n_||(n_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=bi,r=Ws();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})}(Ig)),Ig}var i_;function mc(){return i_||(i_=1,function(e){var t=be&&be.__rest||function(m,p){var y={};for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&p.indexOf(g)<0&&(y[g]=m[g]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var d=0;for(g=Object.getOwnPropertySymbols(m);d<g.length;d++)p.indexOf(g[d])<0&&Object.prototype.propertyIsEnumerable.call(m,g[d])&&(y[g[d]]=m[g[d]])}return y};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=bi,n=eS(),i=Ws(),a=Rj(),o=rS(),l=Mj(),u=Lj(),f=Nj(),v=Ij(),S=(m,p)=>{if(m.children)for(const y of m.children){if(p(y)===!0)break;(0,e.forEveryChild)(y,p)}};e.forEveryChild=S;const _=[...new Array(20)].map((m,p)=>r.types.late(()=>h[p]));e.ElementTypes=r.types.union({dispatcher:m=>{const p=e.TYPES_MAP[m.type];if(!p)throw new Error(`Unknown element type: "${m.type}"`);return p}},f.SVGElement,a.TextElement,o.ImageElement,u.LineElement,l.VideoElement,v.FigureElement,r.types.late(()=>e.GroupElement),..._),e.GroupElement=n.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(m=>({get draggable(){let p=!0;return(0,e.forEveryChild)(m,y=>{y.draggable||(p=!1)}),p},get resizable(){let p=!0;return(0,e.forEveryChild)(m,y=>{y.resizable||(p=!1)}),p},get contentEditable(){let p=!0;return(0,e.forEveryChild)(m,y=>{y.contentEditable||(p=!1)}),p},get styleEditable(){let p=!0;return(0,e.forEveryChild)(m,y=>{y.styleEditable||(p=!1)}),p},get locked(){let p=!0;return(0,e.forEveryChild)(m,y=>{y.locked||(p=!1)}),p}})).actions(m=>({set(p){var{draggable:y,contentEditable:g,styleEditable:d,resizable:b}=p,O=t(p,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,e.forEveryChild)(m,P=>{P.set({draggable:y})}),g!==void 0&&(0,e.forEveryChild)(m,P=>{P.set({contentEditable:g})}),d!==void 0&&(0,e.forEveryChild)(m,P=>{P.set({styleEditable:d})}),b!==void 0&&(0,e.forEveryChild)(m,P=>{P.set({resizable:b})}),Object.assign(m,O)}}));const h=[];function E(m,p){const y=m.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let g=i.Shape.named(y).props(m);p&&(g=p(g)),e.TYPES_MAP[y]=g,h.push(g)}e.TYPES_MAP={svg:f.SVGElement,text:a.TextElement,image:o.ImageElement,group:e.GroupElement,line:u.LineElement,video:l.VideoElement,figure:v.FigureElement},e.registerShapeModel=E}(Pg)),Pg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=mc();let r=[],n="";const i="polotno_clipboard",a=u=>{r=JSON.parse(JSON.stringify(u));try{localStorage.setItem(i,JSON.stringify(u))}catch{}},o=()=>{try{const u=localStorage.getItem(i);if(u)return JSON.parse(u)}catch{}return r};function l(u,f){var v,S,_,h,E,m,p,y;if(((v=document.activeElement)===null||v===void 0?void 0:v.tagName)==="INPUT"||((S=document.activeElement)===null||S===void 0?void 0:S.tagName)==="TEXTAREA"||((_=document.activeElement)===null||_===void 0?void 0:_.contentEditable)==="true")return;const g=f.selectedElements.filter(P=>P.removable),d=g.map(P=>P.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const b=u.ctrlKey||u.metaKey,O=u.shiftKey;if(b&&!O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),b&&O&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),b&&u.code==="KeyA"){u.preventDefault();const P=(h=f.activePage)===null||h===void 0?void 0:h.children.filter(w=>w.selectable),x=(P==null?void 0:P.map(w=>w.id))||[];f.selectElements(x)}if(b&&u.code==="KeyC"&&(u.preventDefault(),n=(E=f.activePage)===null||E===void 0?void 0:E.id,a(f.selectedElements.map(P=>P.toJSON()))),b&&u.code==="KeyX"&&(u.preventDefault(),n=(m=f.activePage)===null||m===void 0?void 0:m.id,a(f.selectedElements.map(P=>P.toJSON())),f.deleteElements(g)),b&&u.code==="KeyV"){u.preventDefault();let P=0;n===((p=f.activePage)===null||p===void 0?void 0:p.id)&&(P=f.width/20),n=(y=f.activePage)===null||y===void 0?void 0:y.id,f.history.transaction(()=>{const x=[],w=o();(0,t.forEveryChild)({children:w},T=>{delete T.id,T.type!=="group"&&(T.x+=P,T.y+=P)}),console.log(w),w.forEach(T=>{var k;const A=(k=f.activePage)===null||k===void 0?void 0:k.addElement(T);A&&x.push(A.id)}),a(w),f.selectElements(x)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(P=>{P.set({y:P.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(P=>{P.set({y:P.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(P=>{P.set({x:P.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(P=>{P.set({x:P.x+1})}))}e.handleHotkey=l})($7);var nS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=ga,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",removeClip:"Remove clip",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width"},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"}});function n(f,v){var S,_=v.split("."),h=f;for(S=0;S<_.length;++S){if(h[_[S]]==null)return;h=h[_[S]]}return h}const i=f=>f&&typeof f=="object";function a(f,v){Object.keys(v).forEach(S=>{const _=f[S],h=v[S];i(h)&&i(_)?a(_,h):f[S]=h})}e.setTranslations=(0,t.action)(f=>{a(r,f)});const o=()=>(0,t.toJS)(r);e.getTranslations=o;const l={},u=f=>{const v=n(r,f);if(v!==void 0)return v;l[f]||(l[f]=!0,console.warn(`Missing translation '${f}'`));const S=f.split("."),_=S[S.length-1]||" ";return _.charAt(0).toUpperCase()+_.slice(1)};e.t=u})(nS);(function(e){var t=be&&be.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(Qe),n=mi,i=t(Lw),a=H7,o=$7,l=nS,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
241
|
+
Width or height of parent elements is equal 0.
|
|
242
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
243
|
+
For simpler debugging here is the log of the parent element:`,f=(h,E,m,p,y,g)=>{const d=r.default.useRef({width:E,height:m}),b=r.default.useRef({top:0,left:0}),O=r.default.useRef(!1),P=r.default.useRef(y.pages.length);O.current=P.current!==y.pages.length,P.current=y.pages.length,r.default.useEffect(()=>{const x=h.current,w=T=>{b.current={top:x.scrollTop,left:x.scrollLeft}};return x.addEventListener("scroll",w),()=>{x.removeEventListener("scroll",w)}},[]),r.default.useLayoutEffect(()=>{if(!h.current||O.current)return;const x=h.current,w=(b.current.left+x.offsetWidth/2)/d.current.width,T=(b.current.top+x.offsetHeight/2)/d.current.height;g.current=!0,x.scrollLeft=w*E-x.offsetWidth/2,x.scrollTop=T*m-x.offsetHeight/2,d.current={width:E,height:m}},[p,E,m])},v=(h,E,m,p,y)=>{const g=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const O=h.current,P=()=>{y.current};return O.addEventListener("scroll",P),()=>{O.removeEventListener("scroll",P)}},[]);const b=m.pages.indexOf(m.activePage);return r.default.useLayoutEffect(()=>{if(!m.activePage||!h.current||g.current)return;const O=h.current,P=m.pages.indexOf(m.activePage)*E;Math.abs(P-O.scrollTop)>.5*E&&(y.current=!0,O.scrollTop=P)},[m.activePage,b]),{handleScroll:O=>{if(y.current)return void(y.current=!1);g.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{g.current=!1},300);const P=O.currentTarget.childNodes[0].offsetHeight,x=O.currentTarget.scrollTop,w=Math.floor((x+p.height/3)/P),T=m.pages[w];T&&T.select()}}},S=({store:h})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,l.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{h.addPage()}},(0,l.t)("workspace.addPage"))),_=({width:h,height:E,xPadding:m,yPadding:p,backgroundColor:y})=>r.default.createElement("div",{style:{width:h+"px",height:E+"px",backgroundColor:y,paddingLeft:m+"px",paddingRight:m+"px",paddingTop:p+"px",paddingBottom:p+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:h,pageControlsEnabled:E,backgroundColor:m,pageBorderColor:p,activePageBorderColor:y,bleedColor:g,components:d,onKeyDown:b,paddingX:O,paddingY:P})=>{const x=O??20,w=P??55,[T,k]=r.default.useState({width:100,height:100}),A=r.default.useRef(T),R=r.default.useRef(null),F=r.default.useRef(null),H=h.bleedVisible?Math.max(0,...h.pages.map(Z=>Z.bleed)):0,Y=Math.max(...h.pages.map(Z=>Z.computedWidth)),$=Math.max(...h.pages.map(Z=>Z.computedHeight)),I=Y+2*H,U=$+2*H,W=async({skipTimeout:Z}={skipTimeout:!1})=>{if(Z||await new Promise(ke=>setTimeout(ke,50)),R.current===null)return;const J=R.current.getBoundingClientRect();J.width!==0&&J.height!==0||(console.warn(u),console.log(R.current));const te=F.current.clientWidth||J.width,ee={width:te,height:J.height};(A.current.width!==ee.width||A.current.height!==ee.height)&&(k(ee),A.current=ee);const se=(te-2*x)/I,de=(J.height-2*w)/U,he=Math.max(Math.min(se,de),.01);h.scaleToFit!==he&&(h.setScale(he),h._setScaleToFit(he))};r.default.useLayoutEffect(()=>{W({skipTimeout:!0})},[]),r.default.useEffect(()=>{W()},[I,U]),r.default.useEffect(()=>{const Z=R.current;if(window.ResizeObserver){const J=new ResizeObserver(()=>{W({skipTimeout:!0})});return J.observe(Z),()=>J.unobserve(Z)}{const J=setInterval(()=>{W({skipTimeout:!0})},100);return()=>clearInterval(J)}},[I,U]);const M=Math.max(x,(T.width-I*h.scale)/2),j=U*h.scale*h.pages.length,B=Math.max(w,(T.height-j)/h.pages.length/2);r.default.useEffect(()=>{const Z=J=>{(b||o.handleHotkey)(J,h)};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[]),r.default.useEffect(()=>{var Z;const J=te=>{if(te.ctrlKey||te.metaKey){te.preventDefault();const he=Math.max(3,h.scaleToFit),ke=Math.min(.1,h.scaleToFit),Ie=(ee=te.deltaY<0?1.05*h.scale:h.scale/1.05,se=ke,de=he,Math.max(se,Math.min(de,ee)));h.setScale(Ie)}else var ee,se,de};return(Z=F.current)===null||Z===void 0||Z.addEventListener("wheel",J),()=>{var te;return(te=F.current)===null||te===void 0?void 0:te.removeEventListener("wheel",J)}},[]);const N=r.default.useRef(!1);f(F,I*h.scale+2*M,U*h.scale+2*B,h.scale,h,N);const{handleScroll:G}=v(F,U*h.scale+2*B,h,T,N),K=T.width>=I*h.scale+2*M,q=m||"rgba(232, 232, 232, 0.9)",z=h.pages.indexOf(h.activePage),X=(d==null?void 0:d.NoPages)||S;return r.default.createElement("div",{ref:R,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:q},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:F,onScroll:G,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:K?"hidden":"auto"},className:"polotno-workspace-inner"},h.pages.map((Z,J)=>Math.abs(J-z)<=1||Z._exporting?r.default.createElement(i.default,{key:Z.id,page:Z,xPadding:M,yPadding:B,width:I*h.scale+2*M,height:U*h.scale+2*B,store:h,pageControlsEnabled:E,backColor:q,pageBorderColor:p||"lightgrey",activePageBorderColor:y||"rgb(0, 161, 255)",bleedColor:g||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(_,{key:Z.id,width:I*h.scale+2*M,height:U*h.scale+2*B,backgroundColor:q,xPadding:M,yPadding:B})),h.rulesVisible&&r.default.createElement(a.TopRules,{store:h,xPadding:M,yPadding:B,width:I*h.scale+2*M,height:U*h.scale+2*B}),h.pages.length===0&&r.default.createElement(X,{store:h})))}),e.default=e.WorkspaceCanvas})(m8);var jj=r2();_l.toggleFadeInAnimation(!1);qn.setTextOverflow("change-font-size");const Dj=new URLSearchParams(location.search).get("key"),iS=jj.createStore({key:Dj});window.store=iS;window.config={addGlobalFont:Bc.addGlobalFont,unstable_useHtmlTextRender:qn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:qn.setTextVerticalResizeEnabled,unstable_setTextOverflow:qn.setTextOverflow,onLoadError:da.onLoadError,setAssetLoadTimeout:da.setAssetLoadTimeout};const Fj=Cd.createRoot(document.getElementById("root"));Fj.render(ut.createElement(m8.WorkspaceCanvas,{store:iS,components:{PageControls:()=>null,Tooltip:()=>null}}));
|