polotno-node 2.12.13 → 2.12.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=t(a);fetch(a.href,i)}})();var bh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zc(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var r=e.default;if(typeof r=="function"){var t=function n(){return this instanceof n?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var B0={exports:{}},Fr={};/**
|
|
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 py;function n7(){if(py)return Fr;py=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function y(U){return U===null||typeof U!="object"?null:(U=p&&U[p]||U["@@iterator"],typeof U=="function"?U:null)}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,S={};function w(U,z,D){this.props=U,this.context=z,this.refs=S,this.updater=D||f}w.prototype.isReactComponent={},w.prototype.setState=function(U,z){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,z,"setState")},w.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function x(){}x.prototype=w.prototype;function v(U,z,D){this.props=U,this.context=z,this.refs=S,this.updater=D||f}var g=v.prototype=new x;g.constructor=v,_(g,w.prototype),g.isPureReactComponent=!0;var E=Array.isArray,b=Object.prototype.hasOwnProperty,M={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function R(U,z,D){var Y,Q={},J=null,Z=null;if(z!=null)for(Y in z.ref!==void 0&&(Z=z.ref),z.key!==void 0&&(J=""+z.key),z)b.call(z,Y)&&!N.hasOwnProperty(Y)&&(Q[Y]=z[Y]);var ae=arguments.length-2;if(ae===1)Q.children=D;else if(1<ae){for(var se=Array(ae),ce=0;ce<ae;ce++)se[ce]=arguments[ce+2];Q.children=se}if(U&&U.defaultProps)for(Y in ae=U.defaultProps,ae)Q[Y]===void 0&&(Q[Y]=ae[Y]);return{$$typeof:e,type:U,key:J,ref:Z,props:Q,_owner:M.current}}function F(U,z){return{$$typeof:e,type:U.type,key:z,ref:U.ref,props:U.props,_owner:U._owner}}function j(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function O(U){var z={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(D){return z[D]})}var C=/\/+/g;function A(U,z){return typeof U=="object"&&U!==null&&U.key!=null?O(""+U.key):z.toString(36)}function k(U,z,D,Y,Q){var J=typeof U;(J==="undefined"||J==="boolean")&&(U=null);var Z=!1;if(U===null)Z=!0;else switch(J){case"string":case"number":Z=!0;break;case"object":switch(U.$$typeof){case e:case r:Z=!0}}if(Z)return Z=U,Q=Q(Z),U=Y===""?"."+A(Z,0):Y,E(Q)?(D="",U!=null&&(D=U.replace(C,"$&/")+"/"),k(Q,z,D,"",function(ce){return ce})):Q!=null&&(j(Q)&&(Q=F(Q,D+(!Q.key||Z&&Z.key===Q.key?"":(""+Q.key).replace(C,"$&/")+"/")+U)),z.push(Q)),1;if(Z=0,Y=Y===""?".":Y+":",E(U))for(var ae=0;ae<U.length;ae++){J=U[ae];var se=Y+A(J,ae);Z+=k(J,z,D,se,Q)}else if(se=y(U),typeof se=="function")for(U=se.call(U),ae=0;!(J=U.next()).done;)J=J.value,se=Y+A(J,ae++),Z+=k(J,z,D,se,Q);else if(J==="object")throw z=String(U),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return Z}function T(U,z,D){if(U==null)return U;var Y=[],Q=0;return k(U,Y,"","",function(J){return z.call(D,J,Q++)}),Y}function V(U){if(U._status===-1){var z=U._result;z=z(),z.then(function(D){(U._status===0||U._status===-1)&&(U._status=1,U._result=D)},function(D){(U._status===0||U._status===-1)&&(U._status=2,U._result=D)}),U._status===-1&&(U._status=0,U._result=z)}if(U._status===1)return U._result.default;throw U._result}var G={current:null},$={transition:null},te={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:$,ReactCurrentOwner:M};function W(){throw Error("act(...) is not supported in production builds of React.")}return Fr.Children={map:T,forEach:function(U,z,D){T(U,function(){z.apply(this,arguments)},D)},count:function(U){var z=0;return T(U,function(){z++}),z},toArray:function(U){return T(U,function(z){return z})||[]},only:function(U){if(!j(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},Fr.Component=w,Fr.Fragment=t,Fr.Profiler=a,Fr.PureComponent=v,Fr.StrictMode=n,Fr.Suspense=c,Fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Fr.act=W,Fr.cloneElement=function(U,z,D){if(U==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+U+".");var Y=_({},U.props),Q=U.key,J=U.ref,Z=U._owner;if(z!=null){if(z.ref!==void 0&&(J=z.ref,Z=M.current),z.key!==void 0&&(Q=""+z.key),U.type&&U.type.defaultProps)var ae=U.type.defaultProps;for(se in z)b.call(z,se)&&!N.hasOwnProperty(se)&&(Y[se]=z[se]===void 0&&ae!==void 0?ae[se]:z[se])}var se=arguments.length-2;if(se===1)Y.children=D;else if(1<se){ae=Array(se);for(var ce=0;ce<se;ce++)ae[ce]=arguments[ce+2];Y.children=ae}return{$$typeof:e,type:U.type,key:Q,ref:J,props:Y,_owner:Z}},Fr.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},U.Provider={$$typeof:i,_context:U},U.Consumer=U},Fr.createElement=R,Fr.createFactory=function(U){var z=R.bind(null,U);return z.type=U,z},Fr.createRef=function(){return{current:null}},Fr.forwardRef=function(U){return{$$typeof:s,render:U}},Fr.isValidElement=j,Fr.lazy=function(U){return{$$typeof:d,_payload:{_status:-1,_result:U},_init:V}},Fr.memo=function(U,z){return{$$typeof:u,type:U,compare:z===void 0?null:z}},Fr.startTransition=function(U){var z=$.transition;$.transition={};try{U()}finally{$.transition=z}},Fr.unstable_act=W,Fr.useCallback=function(U,z){return G.current.useCallback(U,z)},Fr.useContext=function(U){return G.current.useContext(U)},Fr.useDebugValue=function(){},Fr.useDeferredValue=function(U){return G.current.useDeferredValue(U)},Fr.useEffect=function(U,z){return G.current.useEffect(U,z)},Fr.useId=function(){return G.current.useId()},Fr.useImperativeHandle=function(U,z,D){return G.current.useImperativeHandle(U,z,D)},Fr.useInsertionEffect=function(U,z){return G.current.useInsertionEffect(U,z)},Fr.useLayoutEffect=function(U,z){return G.current.useLayoutEffect(U,z)},Fr.useMemo=function(U,z){return G.current.useMemo(U,z)},Fr.useReducer=function(U,z,D){return G.current.useReducer(U,z,D)},Fr.useRef=function(U){return G.current.useRef(U)},Fr.useState=function(U){return G.current.useState(U)},Fr.useSyncExternalStore=function(U,z,D){return G.current.useSyncExternalStore(U,z,D)},Fr.useTransition=function(){return G.current.useTransition()},Fr.version="18.3.1",Fr}var gy;function ni(){return gy||(gy=1,B0.exports=n7()),B0.exports}var ri=ni();const Vr=yp(ri);var r1={},q0={exports:{}},hs={},z0={exports:{}},U0={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var vy;function i7(){return vy||(vy=1,function(e){function r($,te){var W=$.length;$.push(te);e:for(;0<W;){var U=W-1>>>1,z=$[U];if(0<a(z,te))$[U]=te,$[W]=z,W=U;else break e}}function t($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var te=$[0],W=$.pop();if(W!==te){$[0]=W;e:for(var U=0,z=$.length,D=z>>>1;U<D;){var Y=2*(U+1)-1,Q=$[Y],J=Y+1,Z=$[J];if(0>a(Q,W))J<z&&0>a(Z,Q)?($[U]=Z,$[J]=W,U=J):($[U]=Q,$[Y]=W,U=Y);else if(J<z&&0>a(Z,W))$[U]=Z,$[J]=W,U=J;else break e}}return te}function a($,te){var W=$.sortIndex-te.sortIndex;return W!==0?W:$.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],u=[],d=1,p=null,y=3,f=!1,_=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g($){for(var te=t(u);te!==null;){if(te.callback===null)n(u);else if(te.startTime<=$)n(u),te.sortIndex=te.expirationTime,r(c,te);else break;te=t(u)}}function E($){if(S=!1,g($),!_)if(t(c)!==null)_=!0,V(b);else{var te=t(u);te!==null&&G(E,te.startTime-$)}}function b($,te){_=!1,S&&(S=!1,x(R),R=-1),f=!0;var W=y;try{for(g(te),p=t(c);p!==null&&(!(p.expirationTime>te)||$&&!O());){var U=p.callback;if(typeof U=="function"){p.callback=null,y=p.priorityLevel;var z=U(p.expirationTime<=te);te=e.unstable_now(),typeof z=="function"?p.callback=z:p===t(c)&&n(c),g(te)}else n(c);p=t(c)}if(p!==null)var D=!0;else{var Y=t(u);Y!==null&&G(E,Y.startTime-te),D=!1}return D}finally{p=null,y=W,f=!1}}var M=!1,N=null,R=-1,F=5,j=-1;function O(){return!(e.unstable_now()-j<F)}function C(){if(N!==null){var $=e.unstable_now();j=$;var te=!0;try{te=N(!0,$)}finally{te?A():(M=!1,N=null)}}else M=!1}var A;if(typeof v=="function")A=function(){v(C)};else if(typeof MessageChannel<"u"){var k=new MessageChannel,T=k.port2;k.port1.onmessage=C,A=function(){T.postMessage(null)}}else A=function(){w(C,0)};function V($){N=$,M||(M=!0,A())}function G($,te){R=w(function(){$(e.unstable_now())},te)}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($){$.callback=null},e.unstable_continueExecution=function(){_||f||(_=!0,V(b))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return t(c)},e.unstable_next=function($){switch(y){case 1:case 2:case 3:var te=3;break;default:te=y}var W=y;y=te;try{return $()}finally{y=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,te){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var W=y;y=$;try{return te()}finally{y=W}},e.unstable_scheduleCallback=function($,te,W){var U=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?U+W:U):W=U,$){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=W+z,$={id:d++,callback:te,priorityLevel:$,startTime:W,expirationTime:z,sortIndex:-1},W>U?($.sortIndex=W,r(u,$),t(c)===null&&$===t(u)&&(S?(x(R),R=-1):S=!0,G(E,W-U))):($.sortIndex=z,r(c,$),_||f||(_=!0,V(b))),$},e.unstable_shouldYield=O,e.unstable_wrapCallback=function($){var te=y;return function(){var W=y;y=te;try{return $.apply(this,arguments)}finally{y=W}}}}(U0)),U0}var my;function B2(){return my||(my=1,z0.exports=i7()),z0.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 yy;function a7(){if(yy)return hs;yy=1;var e=ni(),r=B2();function t(l){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+l,L=1;L<arguments.length;L++)h+="&args[]="+encodeURIComponent(arguments[L]);return"Minified React error #"+l+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,a={};function i(l,h){o(l,h),o(l+"Capture",h)}function o(l,h){for(a[l]=h,l=0;l<h.length;l++)n.add(h[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},p={};function y(l){return c.call(p,l)?!0:c.call(d,l)?!1:u.test(l)?p[l]=!0:(d[l]=!0,!1)}function f(l,h,L,q){if(L!==null&&L.type===0)return!1;switch(typeof h){case"function":case"symbol":return!0;case"boolean":return q?!1:L!==null?!L.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function _(l,h,L,q){if(h===null||typeof h>"u"||f(l,h,L,q))return!0;if(q)return!1;if(L!==null)switch(L.type){case 3:return!h;case 4:return h===!1;case 5:return isNaN(h);case 6:return isNaN(h)||1>h}return!1}function S(l,h,L,q,ee,ie,ge){this.acceptsBooleans=h===2||h===3||h===4,this.attributeName=q,this.attributeNamespace=ee,this.mustUseProperty=L,this.propertyName=l,this.type=h,this.sanitizeURL=ie,this.removeEmptyString=ge}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){w[l]=new S(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var h=l[0];w[h]=new S(h,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){w[l]=new S(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){w[l]=new S(l,2,!1,l,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(l){w[l]=new S(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){w[l]=new S(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){w[l]=new S(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){w[l]=new S(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){w[l]=new S(l,5,!1,l.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function v(l){return l[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(l){var h=l.replace(x,v);w[h]=new S(h,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var h=l.replace(x,v);w[h]=new S(h,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var h=l.replace(x,v);w[h]=new S(h,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){w[l]=new S(l,1,!1,l.toLowerCase(),null,!1,!1)}),w.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){w[l]=new S(l,1,!1,l.toLowerCase(),null,!0,!0)});function g(l,h,L,q){var ee=w.hasOwnProperty(h)?w[h]:null;(ee!==null?ee.type!==0:q||!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(_(h,L,ee,q)&&(L=null),q||ee===null?y(h)&&(L===null?l.removeAttribute(h):l.setAttribute(h,""+L)):ee.mustUseProperty?l[ee.propertyName]=L===null?ee.type===3?!1:"":L:(h=ee.attributeName,q=ee.attributeNamespace,L===null?l.removeAttribute(h):(ee=ee.type,L=ee===3||ee===4&&L===!0?"":""+L,q?l.setAttributeNS(q,h,L):l.setAttribute(h,L))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=Symbol.for("react.element"),M=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),O=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),$=Symbol.iterator;function te(l){return l===null||typeof l!="object"?null:(l=$&&l[$]||l["@@iterator"],typeof l=="function"?l:null)}var W=Object.assign,U;function z(l){if(U===void 0)try{throw Error()}catch(L){var h=L.stack.trim().match(/\n( *(at )?)/);U=h&&h[1]||""}return`
|
|
26
|
+
`+U+l}var D=!1;function Y(l,h){if(!l||D)return"";D=!0;var L=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(st){var q=st}Reflect.construct(l,[],h)}else{try{h.call()}catch(st){q=st}l.call(h.prototype)}else{try{throw Error()}catch(st){q=st}l()}}catch(st){if(st&&q&&typeof st.stack=="string"){for(var ee=st.stack.split(`
|
|
27
|
+
`),ie=q.stack.split(`
|
|
28
|
+
`),ge=ee.length-1,Ne=ie.length-1;1<=ge&&0<=Ne&&ee[ge]!==ie[Ne];)Ne--;for(;1<=ge&&0<=Ne;ge--,Ne--)if(ee[ge]!==ie[Ne]){if(ge!==1||Ne!==1)do if(ge--,Ne--,0>Ne||ee[ge]!==ie[Ne]){var De=`
|
|
29
|
+
`+ee[ge].replace(" at new "," at ");return l.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",l.displayName)),De}while(1<=ge&&0<=Ne);break}}}finally{D=!1,Error.prepareStackTrace=L}return(l=l?l.displayName||l.name:"")?z(l):""}function Q(l){switch(l.tag){case 5:return z(l.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return l=Y(l.type,!1),l;case 11:return l=Y(l.type.render,!1),l;case 1:return l=Y(l.type,!0),l;default:return""}}function J(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case N:return"Fragment";case M:return"Portal";case F:return"Profiler";case R:return"StrictMode";case A:return"Suspense";case k:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case O:return(l.displayName||"Context")+".Consumer";case j:return(l._context.displayName||"Context")+".Provider";case C:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case T:return h=l.displayName||null,h!==null?h:J(l.type)||"Memo";case V:h=l._payload,l=l._init;try{return J(l(h))}catch{}}return null}function Z(l){var h=l.type;switch(l.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=h.render,l=l.displayName||l.name||"",h.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return J(h);case 8:return h===R?"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 h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function ae(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function se(l){var h=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function ce(l){var h=se(l)?"checked":"value",L=Object.getOwnPropertyDescriptor(l.constructor.prototype,h),q=""+l[h];if(!l.hasOwnProperty(h)&&typeof L<"u"&&typeof L.get=="function"&&typeof L.set=="function"){var ee=L.get,ie=L.set;return Object.defineProperty(l,h,{configurable:!0,get:function(){return ee.call(this)},set:function(ge){q=""+ge,ie.call(this,ge)}}),Object.defineProperty(l,h,{enumerable:L.enumerable}),{getValue:function(){return q},setValue:function(ge){q=""+ge},stopTracking:function(){l._valueTracker=null,delete l[h]}}}}function de(l){l._valueTracker||(l._valueTracker=ce(l))}function Oe(l){if(!l)return!1;var h=l._valueTracker;if(!h)return!0;var L=h.getValue(),q="";return l&&(q=se(l)?l.checked?"true":"false":l.value),l=q,l!==L?(h.setValue(l),!0):!1}function Le(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function ke(l,h){var L=h.checked;return W({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:L??l._wrapperState.initialChecked})}function Se(l,h){var L=h.defaultValue==null?"":h.defaultValue,q=h.checked!=null?h.checked:h.defaultChecked;L=ae(h.value!=null?h.value:L),l._wrapperState={initialChecked:q,initialValue:L,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function ye(l,h){h=h.checked,h!=null&&g(l,"checked",h,!1)}function Je(l,h){ye(l,h);var L=ae(h.value),q=h.type;if(L!=null)q==="number"?(L===0&&l.value===""||l.value!=L)&&(l.value=""+L):l.value!==""+L&&(l.value=""+L);else if(q==="submit"||q==="reset"){l.removeAttribute("value");return}h.hasOwnProperty("value")?me(l,h.type,L):h.hasOwnProperty("defaultValue")&&me(l,h.type,ae(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(l.defaultChecked=!!h.defaultChecked)}function we(l,h,L){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var q=h.type;if(!(q!=="submit"&&q!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+l._wrapperState.initialValue,L||h===l.value||(l.value=h),l.defaultValue=h}L=l.name,L!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,L!==""&&(l.name=L)}function me(l,h,L){(h!=="number"||Le(l.ownerDocument)!==l)&&(L==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+L&&(l.defaultValue=""+L))}var Ee=Array.isArray;function Te(l,h,L,q){if(l=l.options,h){h={};for(var ee=0;ee<L.length;ee++)h["$"+L[ee]]=!0;for(L=0;L<l.length;L++)ee=h.hasOwnProperty("$"+l[L].value),l[L].selected!==ee&&(l[L].selected=ee),ee&&q&&(l[L].defaultSelected=!0)}else{for(L=""+ae(L),h=null,ee=0;ee<l.length;ee++){if(l[ee].value===L){l[ee].selected=!0,q&&(l[ee].defaultSelected=!0);return}h!==null||l[ee].disabled||(h=l[ee])}h!==null&&(h.selected=!0)}}function he(l,h){if(h.dangerouslySetInnerHTML!=null)throw Error(t(91));return W({},h,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Re(l,h){var L=h.value;if(L==null){if(L=h.children,h=h.defaultValue,L!=null){if(h!=null)throw Error(t(92));if(Ee(L)){if(1<L.length)throw Error(t(93));L=L[0]}h=L}h==null&&(h=""),L=h}l._wrapperState={initialValue:ae(L)}}function Ie(l,h){var L=ae(h.value),q=ae(h.defaultValue);L!=null&&(L=""+L,L!==l.value&&(l.value=L),h.defaultValue==null&&l.defaultValue!==L&&(l.defaultValue=L)),q!=null&&(l.defaultValue=""+q)}function Xe(l){var h=l.textContent;h===l._wrapperState.initialValue&&h!==""&&h!==null&&(l.value=h)}function rt(l){switch(l){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 vt(l,h){return l==null||l==="http://www.w3.org/1999/xhtml"?rt(h):l==="http://www.w3.org/2000/svg"&&h==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var et,yt=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(h,L,q,ee){MSApp.execUnsafeLocalFunction(function(){return l(h,L,q,ee)})}:l}(function(l,h){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=h;else{for(et=et||document.createElement("div"),et.innerHTML="<svg>"+h.valueOf().toString()+"</svg>",h=et.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;h.firstChild;)l.appendChild(h.firstChild)}});function mt(l,h){if(h){var L=l.firstChild;if(L&&L===l.lastChild&&L.nodeType===3){L.nodeValue=h;return}}l.textContent=h}var ct={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},Bt=["Webkit","ms","Moz","O"];Object.keys(ct).forEach(function(l){Bt.forEach(function(h){h=h+l.charAt(0).toUpperCase()+l.substring(1),ct[h]=ct[l]})});function Pt(l,h,L){return h==null||typeof h=="boolean"||h===""?"":L||typeof h!="number"||h===0||ct.hasOwnProperty(l)&&ct[l]?(""+h).trim():h+"px"}function Yt(l,h){l=l.style;for(var L in h)if(h.hasOwnProperty(L)){var q=L.indexOf("--")===0,ee=Pt(L,h[L],q);L==="float"&&(L="cssFloat"),q?l.setProperty(L,ee):l[L]=ee}}var Gt=W({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 Be(l,h){if(h){if(Gt[l]&&(h.children!=null||h.dangerouslySetInnerHTML!=null))throw Error(t(137,l));if(h.dangerouslySetInnerHTML!=null){if(h.children!=null)throw Error(t(60));if(typeof h.dangerouslySetInnerHTML!="object"||!("__html"in h.dangerouslySetInnerHTML))throw Error(t(61))}if(h.style!=null&&typeof h.style!="object")throw Error(t(62))}}function Ce(l,h){if(l.indexOf("-")===-1)return typeof h.is=="string";switch(l){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 ft=null;function Ct(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ot=null,Nt=null,Jt=null;function Xt(l){if(l=vu(l)){if(typeof Ot!="function")throw Error(t(280));var h=l.stateNode;h&&(h=bi(h),Ot(l.stateNode,l.type,h))}}function kt(l){Nt?Jt?Jt.push(l):Jt=[l]:Nt=l}function nt(){if(Nt){var l=Nt,h=Jt;if(Jt=Nt=null,Xt(l),h)for(l=0;l<h.length;l++)Xt(h[l])}}function We(l,h){return l(h)}function it(){}var He=!1;function wt(l,h,L){if(He)return l(h,L);He=!0;try{return We(l,h,L)}finally{He=!1,(Nt!==null||Jt!==null)&&(it(),nt())}}function ze(l,h){var L=l.stateNode;if(L===null)return null;var q=bi(L);if(q===null)return null;L=q[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(q=!q.disabled)||(l=l.type,q=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!q;break e;default:l=!1}if(l)return null;if(L&&typeof L!="function")throw Error(t(231,h,typeof L));return L}var _t=!1;if(s)try{var Ht={};Object.defineProperty(Ht,"passive",{get:function(){_t=!0}}),window.addEventListener("test",Ht,Ht),window.removeEventListener("test",Ht,Ht)}catch{_t=!1}function Dt(l,h,L,q,ee,ie,ge,Ne,De){var st=Array.prototype.slice.call(arguments,3);try{h.apply(L,st)}catch(Et){this.onError(Et)}}var Vt=!1,er=null,_r=!1,kr=null,Ur={onError:function(l){Vt=!0,er=l}};function on(l,h,L,q,ee,ie,ge,Ne,De){Vt=!1,er=null,Dt.apply(Ur,arguments)}function Wn(l,h,L,q,ee,ie,ge,Ne,De){if(on.apply(this,arguments),Vt){if(Vt){var st=er;Vt=!1,er=null}else throw Error(t(198));_r||(_r=!0,kr=st)}}function sn(l){var h=l,L=l;if(l.alternate)for(;h.return;)h=h.return;else{l=h;do h=l,(h.flags&4098)!==0&&(L=h.return),l=h.return;while(l)}return h.tag===3?L:null}function Li(l){if(l.tag===13){var h=l.memoizedState;if(h===null&&(l=l.alternate,l!==null&&(h=l.memoizedState)),h!==null)return h.dehydrated}return null}function wi(l){if(sn(l)!==l)throw Error(t(188))}function Ni(l){var h=l.alternate;if(!h){if(h=sn(l),h===null)throw Error(t(188));return h!==l?null:l}for(var L=l,q=h;;){var ee=L.return;if(ee===null)break;var ie=ee.alternate;if(ie===null){if(q=ee.return,q!==null){L=q;continue}break}if(ee.child===ie.child){for(ie=ee.child;ie;){if(ie===L)return wi(ee),l;if(ie===q)return wi(ee),h;ie=ie.sibling}throw Error(t(188))}if(L.return!==q.return)L=ee,q=ie;else{for(var ge=!1,Ne=ee.child;Ne;){if(Ne===L){ge=!0,L=ee,q=ie;break}if(Ne===q){ge=!0,q=ee,L=ie;break}Ne=Ne.sibling}if(!ge){for(Ne=ie.child;Ne;){if(Ne===L){ge=!0,L=ie,q=ee;break}if(Ne===q){ge=!0,q=ie,L=ee;break}Ne=Ne.sibling}if(!ge)throw Error(t(189))}}if(L.alternate!==q)throw Error(t(190))}if(L.tag!==3)throw Error(t(188));return L.stateNode.current===L?l:h}function _i(l){return l=Ni(l),l!==null?ao(l):null}function ao(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var h=ao(l);if(h!==null)return h;l=l.sibling}return null}var _s=r.unstable_scheduleCallback,Go=r.unstable_cancelCallback,tu=r.unstable_shouldYield,mc=r.unstable_requestPaint,Mn=r.unstable_now,Bu=r.unstable_getCurrentPriorityLevel,oo=r.unstable_ImmediatePriority,dl=r.unstable_UserBlockingPriority,Vs=r.unstable_NormalPriority,qu=r.unstable_LowPriority,ru=r.unstable_IdlePriority,so=null,di=null;function Xr(l){if(di&&typeof di.onCommitFiberRoot=="function")try{di.onCommitFiberRoot(so,l,void 0,(l.current.flags&128)===128)}catch{}}var Ar=Math.clz32?Math.clz32:Ti,ln=Math.log,pi=Math.LN2;function Ti(l){return l>>>=0,l===0?32:31-(ln(l)/pi|0)|0}var Ma=64,Ia=4194304;function ii(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Ri(l,h){var L=l.pendingLanes;if(L===0)return 0;var q=0,ee=l.suspendedLanes,ie=l.pingedLanes,ge=L&268435455;if(ge!==0){var Ne=ge&~ee;Ne!==0?q=ii(Ne):(ie&=ge,ie!==0&&(q=ii(ie)))}else ge=L&~ee,ge!==0?q=ii(ge):ie!==0&&(q=ii(ie));if(q===0)return 0;if(h!==0&&h!==q&&(h&ee)===0&&(ee=q&-q,ie=h&-h,ee>=ie||ee===16&&(ie&4194240)!==0))return h;if((q&4)!==0&&(q|=L&16),h=l.entangledLanes,h!==0)for(l=l.entanglements,h&=q;0<h;)L=31-Ar(h),ee=1<<L,q|=l[L],h&=~ee;return q}function pl(l,h){switch(l){case 1:case 2:case 4:return h+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 h+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 fa(l,h){for(var L=l.suspendedLanes,q=l.pingedLanes,ee=l.expirationTimes,ie=l.pendingLanes;0<ie;){var ge=31-Ar(ie),Ne=1<<ge,De=ee[ge];De===-1?((Ne&L)===0||(Ne&q)!==0)&&(ee[ge]=pl(Ne,h)):De<=h&&(l.expiredLanes|=Ne),ie&=~Ne}}function Wo(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function nu(){var l=Ma;return Ma<<=1,(Ma&4194240)===0&&(Ma=64),l}function ha(l){for(var h=[],L=0;31>L;L++)h.push(l);return h}function Gs(l,h,L){l.pendingLanes|=h,h!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,h=31-Ar(h),l[h]=L}function af(l,h){var L=l.pendingLanes&~h;l.pendingLanes=h,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=h,l.mutableReadLanes&=h,l.entangledLanes&=h,h=l.entanglements;var q=l.eventTimes;for(l=l.expirationTimes;0<L;){var ee=31-Ar(L),ie=1<<ee;h[ee]=0,q[ee]=-1,l[ee]=-1,L&=~ie}}function iu(l,h){var L=l.entangledLanes|=h;for(l=l.entanglements;L;){var q=31-Ar(L),ee=1<<q;ee&h|l[q]&h&&(l[q]|=h),L&=~ee}}var Rr=0;function Ss(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Ws,$s,yc,$o,xs,Es=!1,Ps=[],gn=null,Yo=null,ja=null,It=new Map,Ys=new Map,lo=[],Oo="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 zu(l,h){switch(l){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":Yo=null;break;case"mouseover":case"mouseout":ja=null;break;case"pointerover":case"pointerout":It.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(h.pointerId)}}function Xs(l,h,L,q,ee,ie){return l===null||l.nativeEvent!==ie?(l={blockedOn:h,domEventName:L,eventSystemFlags:q,nativeEvent:ie,targetContainers:[ee]},h!==null&&(h=vu(h),h!==null&&$s(h)),l):(l.eventSystemFlags|=q,h=l.targetContainers,ee!==null&&h.indexOf(ee)===-1&&h.push(ee),l)}function In(l,h,L,q,ee){switch(h){case"focusin":return gn=Xs(gn,l,h,L,q,ee),!0;case"dragenter":return Yo=Xs(Yo,l,h,L,q,ee),!0;case"mouseover":return ja=Xs(ja,l,h,L,q,ee),!0;case"pointerover":var ie=ee.pointerId;return It.set(ie,Xs(It.get(ie)||null,l,h,L,q,ee)),!0;case"gotpointercapture":return ie=ee.pointerId,Ys.set(ie,Xs(Ys.get(ie)||null,l,h,L,q,ee)),!0}return!1}function Ks(l){var h=Ns(l.target);if(h!==null){var L=sn(h);if(L!==null){if(h=L.tag,h===13){if(h=Li(L),h!==null){l.blockedOn=h,xs(l.priority,function(){yc(L)});return}}else if(h===3&&L.stateNode.current.memoizedState.isDehydrated){l.blockedOn=L.tag===3?L.stateNode.containerInfo:null;return}}}l.blockedOn=null}function au(l){if(l.blockedOn!==null)return!1;for(var h=l.targetContainers;0<h.length;){var L=gl(l.domEventName,l.eventSystemFlags,h[0],l.nativeEvent);if(L===null){L=l.nativeEvent;var q=new L.constructor(L.type,L);ft=q,L.target.dispatchEvent(q),ft=null}else return h=vu(L),h!==null&&$s(h),l.blockedOn=L,!1;h.shift()}return!0}function ou(l,h,L){au(l)&&L.delete(h)}function of(){Es=!1,gn!==null&&au(gn)&&(gn=null),Yo!==null&&au(Yo)&&(Yo=null),ja!==null&&au(ja)&&(ja=null),It.forEach(ou),Ys.forEach(ou)}function uo(l,h){l.blockedOn===h&&(l.blockedOn=null,Es||(Es=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,of)))}function ai(l){function h(ee){return uo(ee,l)}if(0<Ps.length){uo(Ps[0],l);for(var L=1;L<Ps.length;L++){var q=Ps[L];q.blockedOn===l&&(q.blockedOn=null)}}for(gn!==null&&uo(gn,l),Yo!==null&&uo(Yo,l),ja!==null&&uo(ja,l),It.forEach(h),Ys.forEach(h),L=0;L<lo.length;L++)q=lo[L],q.blockedOn===l&&(q.blockedOn=null);for(;0<lo.length&&(L=lo[0],L.blockedOn===null);)Ks(L),L.blockedOn===null&&lo.shift()}var Fa=E.ReactCurrentBatchConfig,su=!0;function Mi(l,h,L,q){var ee=Rr,ie=Fa.transition;Fa.transition=null;try{Rr=1,Ao(l,h,L,q)}finally{Rr=ee,Fa.transition=ie}}function Da(l,h,L,q){var ee=Rr,ie=Fa.transition;Fa.transition=null;try{Rr=4,Ao(l,h,L,q)}finally{Rr=ee,Fa.transition=ie}}function Ao(l,h,L,q){if(su){var ee=gl(l,h,L,q);if(ee===null)du(l,h,q,Os,L),zu(l,q);else if(In(ee,l,h,L,q))q.stopPropagation();else if(zu(l,q),h&4&&-1<Oo.indexOf(l)){for(;ee!==null;){var ie=vu(ee);if(ie!==null&&Ws(ie),ie=gl(l,h,L,q),ie===null&&du(l,h,q,Os,L),ie===ee)break;ee=ie}ee!==null&&q.stopPropagation()}else du(l,h,q,null,L)}}var Os=null;function gl(l,h,L,q){if(Os=null,l=Ct(q),l=Ns(l),l!==null)if(h=sn(l),h===null)l=null;else if(L=h.tag,L===13){if(l=Li(h),l!==null)return l;l=null}else if(L===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;l=null}else h!==l&&(l=null);return Os=l,null}function Uu(l){switch(l){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(Bu()){case oo:return 1;case dl:return 4;case Vs:case qu:return 16;case ru:return 536870912;default:return 16}default:return 16}}var oi=null,Ii=null,ji=null;function vl(){if(ji)return ji;var l,h=Ii,L=h.length,q,ee="value"in oi?oi.value:oi.textContent,ie=ee.length;for(l=0;l<L&&h[l]===ee[l];l++);var ge=L-l;for(q=1;q<=ge&&h[L-q]===ee[ie-q];q++);return ji=ee.slice(l,1<q?1-q:void 0)}function Sa(l){var h=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&h===13&&(l=13)):l=h,l===10&&(l=13),32<=l||l===13?l:0}function wn(){return!0}function Fi(){return!1}function _n(l){function h(L,q,ee,ie,ge){this._reactName=L,this._targetInst=ee,this.type=q,this.nativeEvent=ie,this.target=ge,this.currentTarget=null;for(var Ne in l)l.hasOwnProperty(Ne)&&(L=l[Ne],this[Ne]=L?L(ie):ie[Ne]);return this.isDefaultPrevented=(ie.defaultPrevented!=null?ie.defaultPrevented:ie.returnValue===!1)?wn:Fi,this.isPropagationStopped=Fi,this}return W(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var L=this.nativeEvent;L&&(L.preventDefault?L.preventDefault():typeof L.returnValue!="unknown"&&(L.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var L=this.nativeEvent;L&&(L.stopPropagation?L.stopPropagation():typeof L.cancelBubble!="unknown"&&(L.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),h}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ta=_n(ea),Ba=W({},ea,{view:0,detail:0}),lu=_n(Ba),As,Zs,$n,gi=W({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ft,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==$n&&($n&&l.type==="mousemove"?(As=l.screenX-$n.screenX,Zs=l.screenY-$n.screenY):Zs=As=0,$n=l),As)},movementY:function(l){return"movementY"in l?l.movementY:Zs}}),Jr=_n(gi),Qs=W({},gi,{dataTransfer:0}),qa=_n(Qs),ml=W({},Ba,{relatedTarget:0}),Xo=_n(ml),yl=W({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),Ko=_n(yl),uu=W({},ea,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),X=_n(uu),fe=W({},ea,{data:0}),Ae=_n(fe),je={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qe={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"},dt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function St(l){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(l):(l=dt[l])?!!h[l]:!1}function Ft(){return St}var ir=W({},Ba,{key:function(l){if(l.key){var h=je[l.key]||l.key;if(h!=="Unidentified")return h}return l.type==="keypress"?(l=Sa(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Qe[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ft,charCode:function(l){return l.type==="keypress"?Sa(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Sa(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),gr=_n(ir),dr=W({},gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sr=_n(dr),Cn=W({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ft}),Sn=_n(Cn),jn=W({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qn=_n(jn),si=W({},gi,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),za=_n(si),xa=[9,13,27,32],Ea=s&&"CompositionEvent"in window,Zo=null;s&&"documentMode"in document&&(Zo=document.documentMode);var Qo=s&&"TextEvent"in window&&!Zo,Di=s&&(!Ea||Zo&&8<Zo&&11>=Zo),Ua=" ",Js=!1;function bl(l,h){switch(l){case"keyup":return xa.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ra(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var en=!1;function el(l,h){switch(l){case"compositionend":return ra(h);case"keypress":return h.which!==32?null:(Js=!0,Ua);case"textInput":return l=h.data,l===Ua&&Js?null:l;default:return null}}function wl(l,h){if(en)return l==="compositionend"||!Ea&&bl(l,h)?(l=vl(),ji=Ii=oi=null,en=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return Di&&h.locale!=="ko"?null:h.data;default:return null}}var Pa={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 Ha(l){var h=l&&l.nodeName&&l.nodeName.toLowerCase();return h==="input"?!!Pa[l.type]:h==="textarea"}function Si(l,h,L,q){kt(q),h=bc(h,"onChange"),0<h.length&&(L=new ta("onChange","change",null,L,q),l.push({event:L,listeners:h}))}var tl=null,co=null;function Hu(l){fu(l,0)}function vi(l){var h=ui(l);if(Oe(h))return l}function Bi(l,h){if(l==="change")return h}var Cs=!1;if(s){var Co;if(s){var mi="oninput"in document;if(!mi){var Jo=document.createElement("div");Jo.setAttribute("oninput","return;"),mi=typeof Jo.oninput=="function"}Co=mi}else Co=!1;Cs=Co&&(!document.documentMode||9<document.documentMode)}function li(){tl&&(tl.detachEvent("onpropertychange",qi),co=tl=null)}function qi(l){if(l.propertyName==="value"&&vi(co)){var h=[];Si(h,co,l,Ct(l)),wt(Hu,h)}}function es(l,h,L){l==="focusin"?(li(),tl=h,co=L,tl.attachEvent("onpropertychange",qi)):l==="focusout"&&li()}function Wr(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return vi(co)}function fo(l,h){if(l==="click")return vi(h)}function rl(l,h){if(l==="input"||l==="change")return vi(h)}function ko(l,h){return l===h&&(l!==0||1/l===1/h)||l!==l&&h!==h}var Mr=typeof Object.is=="function"?Object.is:ko;function Lo(l,h){if(Mr(l,h))return!0;if(typeof l!="object"||l===null||typeof h!="object"||h===null)return!1;var L=Object.keys(l),q=Object.keys(h);if(L.length!==q.length)return!1;for(q=0;q<L.length;q++){var ee=L[q];if(!c.call(h,ee)||!Mr(l[ee],h[ee]))return!1}return!0}function Yn(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Lr(l,h){var L=Yn(l);l=0;for(var q;L;){if(L.nodeType===3){if(q=l+L.textContent.length,l<=h&&q>=h)return{node:L,offset:h-l};l=q}e:{for(;L;){if(L.nextSibling){L=L.nextSibling;break e}L=L.parentNode}L=void 0}L=Yn(L)}}function xn(l,h){return l&&h?l===h?!0:l&&l.nodeType===3?!1:h&&h.nodeType===3?xn(l,h.parentNode):"contains"in l?l.contains(h):l.compareDocumentPosition?!!(l.compareDocumentPosition(h)&16):!1:!1}function Xn(){for(var l=window,h=Le();h instanceof l.HTMLIFrameElement;){try{var L=typeof h.contentWindow.location.href=="string"}catch{L=!1}if(L)l=h.contentWindow;else break;h=Le(l.document)}return h}function ts(l){var h=l&&l.nodeName&&l.nodeName.toLowerCase();return h&&(h==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||h==="textarea"||l.contentEditable==="true")}function No(l){var h=Xn(),L=l.focusedElem,q=l.selectionRange;if(h!==L&&L&&L.ownerDocument&&xn(L.ownerDocument.documentElement,L)){if(q!==null&&ts(L)){if(h=q.start,l=q.end,l===void 0&&(l=h),"selectionStart"in L)L.selectionStart=h,L.selectionEnd=Math.min(l,L.value.length);else if(l=(h=L.ownerDocument||document)&&h.defaultView||window,l.getSelection){l=l.getSelection();var ee=L.textContent.length,ie=Math.min(q.start,ee);q=q.end===void 0?ie:Math.min(q.end,ee),!l.extend&&ie>q&&(ee=q,q=ie,ie=ee),ee=Lr(L,ie);var ge=Lr(L,q);ee&&ge&&(l.rangeCount!==1||l.anchorNode!==ee.node||l.anchorOffset!==ee.offset||l.focusNode!==ge.node||l.focusOffset!==ge.offset)&&(h=h.createRange(),h.setStart(ee.node,ee.offset),l.removeAllRanges(),ie>q?(l.addRange(h),l.extend(ge.node,ge.offset)):(h.setEnd(ge.node,ge.offset),l.addRange(h)))}}for(h=[],l=L;l=l.parentNode;)l.nodeType===1&&h.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<h.length;L++)l=h[L],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var To=s&&"documentMode"in document&&11>=document.documentMode,Va=null,kn=null,ho=null,Ro=!1;function Mo(l,h,L){var q=L.window===L?L.document:L.nodeType===9?L:L.ownerDocument;Ro||Va==null||Va!==Le(q)||(q=Va,"selectionStart"in q&&ts(q)?q={start:q.selectionStart,end:q.selectionEnd}:(q=(q.ownerDocument&&q.ownerDocument.defaultView||window).getSelection(),q={anchorNode:q.anchorNode,anchorOffset:q.anchorOffset,focusNode:q.focusNode,focusOffset:q.focusOffset}),ho&&Lo(ho,q)||(ho=q,q=bc(kn,"onSelect"),0<q.length&&(h=new ta("onSelect","select",null,h,L),l.push({event:h,listeners:q}),h.target=Va)))}function zi(l,h){var L={};return L[l.toLowerCase()]=h.toLowerCase(),L["Webkit"+l]="webkit"+h,L["Moz"+l]="moz"+h,L}var un={animationend:zi("Animation","AnimationEnd"),animationiteration:zi("Animation","AnimationIteration"),animationstart:zi("Animation","AnimationStart"),transitionend:zi("Transition","TransitionEnd")},xi={},tn={};s&&(tn=document.createElement("div").style,"AnimationEvent"in window||(delete un.animationend.animation,delete un.animationiteration.animation,delete un.animationstart.animation),"TransitionEvent"in window||delete un.transitionend.transition);function $r(l){if(xi[l])return xi[l];if(!un[l])return l;var h=un[l],L;for(L in h)if(h.hasOwnProperty(L)&&L in tn)return xi[l]=h[L];return l}var Fn=$r("animationend"),Jn=$r("animationiteration"),Io=$r("animationstart"),_l=$r("transitionend"),nl=new Map,cu="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 jo(l,h){nl.set(l,h),i(h,[l])}for(var Sl=0;Sl<cu.length;Sl++){var yi=cu[Sl],Ga=yi.toLowerCase(),xl=yi[0].toUpperCase()+yi.slice(1);jo(Ga,"on"+xl)}jo(Fn,"onAnimationEnd"),jo(Jn,"onAnimationIteration"),jo(Io,"onAnimationStart"),jo("dblclick","onDoubleClick"),jo("focusin","onFocus"),jo("focusout","onBlur"),jo(_l,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="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(" "),sf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fo));function El(l,h,L){var q=l.type||"unknown-event";l.currentTarget=L,Wn(q,h,void 0,l),l.currentTarget=null}function fu(l,h){h=(h&4)!==0;for(var L=0;L<l.length;L++){var q=l[L],ee=q.event;q=q.listeners;e:{var ie=void 0;if(h)for(var ge=q.length-1;0<=ge;ge--){var Ne=q[ge],De=Ne.instance,st=Ne.currentTarget;if(Ne=Ne.listener,De!==ie&&ee.isPropagationStopped())break e;El(ee,Ne,st),ie=De}else for(ge=0;ge<q.length;ge++){if(Ne=q[ge],De=Ne.instance,st=Ne.currentTarget,Ne=Ne.listener,De!==ie&&ee.isPropagationStopped())break e;El(ee,Ne,st),ie=De}}}if(_r)throw l=kr,_r=!1,kr=null,l}function cn(l,h){var L=h[da];L===void 0&&(L=h[da]=new Set);var q=l+"__bubble";L.has(q)||(hu(h,l,2,!1),L.add(q))}function Vu(l,h,L){var q=0;h&&(q|=4),hu(L,l,q,h)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function ks(l){if(!l[Pl]){l[Pl]=!0,n.forEach(function(L){L!=="selectionchange"&&(sf.has(L)||Vu(L,!1,l),Vu(L,!0,l))});var h=l.nodeType===9?l:l.ownerDocument;h===null||h[Pl]||(h[Pl]=!0,Vu("selectionchange",!1,h))}}function hu(l,h,L,q){switch(Uu(h)){case 1:var ee=Mi;break;case 4:ee=Da;break;default:ee=Ao}L=ee.bind(null,h,L,l),ee=void 0,!_t||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(ee=!0),q?ee!==void 0?l.addEventListener(h,L,{capture:!0,passive:ee}):l.addEventListener(h,L,!0):ee!==void 0?l.addEventListener(h,L,{passive:ee}):l.addEventListener(h,L,!1)}function du(l,h,L,q,ee){var ie=q;if((h&1)===0&&(h&2)===0&&q!==null)e:for(;;){if(q===null)return;var ge=q.tag;if(ge===3||ge===4){var Ne=q.stateNode.containerInfo;if(Ne===ee||Ne.nodeType===8&&Ne.parentNode===ee)break;if(ge===4)for(ge=q.return;ge!==null;){var De=ge.tag;if((De===3||De===4)&&(De=ge.stateNode.containerInfo,De===ee||De.nodeType===8&&De.parentNode===ee))return;ge=ge.return}for(;Ne!==null;){if(ge=Ns(Ne),ge===null)return;if(De=ge.tag,De===5||De===6){q=ie=ge;continue e}Ne=Ne.parentNode}}q=q.return}wt(function(){var st=ie,Et=Ct(L),At=[];e:{var xt=nl.get(l);if(xt!==void 0){var Wt=ta,tr=l;switch(l){case"keypress":if(Sa(L)===0)break e;case"keydown":case"keyup":Wt=gr;break;case"focusin":tr="focus",Wt=Xo;break;case"focusout":tr="blur",Wt=Xo;break;case"beforeblur":case"afterblur":Wt=Xo;break;case"click":if(L.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Wt=Jr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Wt=qa;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Wt=Sn;break;case Fn:case Jn:case Io:Wt=Ko;break;case _l:Wt=Qn;break;case"scroll":Wt=lu;break;case"wheel":Wt=za;break;case"copy":case"cut":case"paste":Wt=X;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Wt=Sr}var or=(h&4)!==0,Yi=!or&&l==="scroll",tt=or?xt!==null?xt+"Capture":null:xt;or=[];for(var Ve=st,at;Ve!==null;){at=Ve;var Tt=at.stateNode;if(at.tag===5&&Tt!==null&&(at=Tt,tt!==null&&(Tt=ze(Ve,tt),Tt!=null&&or.push(pu(Ve,Tt,at)))),Yi)break;Ve=Ve.return}0<or.length&&(xt=new Wt(xt,tr,null,L,Et),At.push({event:xt,listeners:or}))}}if((h&7)===0){e:{if(xt=l==="mouseover"||l==="pointerover",Wt=l==="mouseout"||l==="pointerout",xt&&L!==ft&&(tr=L.relatedTarget||L.fromElement)&&(Ns(tr)||tr[Vi]))break e;if((Wt||xt)&&(xt=Et.window===Et?Et:(xt=Et.ownerDocument)?xt.defaultView||xt.parentWindow:window,Wt?(tr=L.relatedTarget||L.toElement,Wt=st,tr=tr?Ns(tr):null,tr!==null&&(Yi=sn(tr),tr!==Yi||tr.tag!==5&&tr.tag!==6)&&(tr=null)):(Wt=null,tr=st),Wt!==tr)){if(or=Jr,Tt="onMouseLeave",tt="onMouseEnter",Ve="mouse",(l==="pointerout"||l==="pointerover")&&(or=Sr,Tt="onPointerLeave",tt="onPointerEnter",Ve="pointer"),Yi=Wt==null?xt:ui(Wt),at=tr==null?xt:ui(tr),xt=new or(Tt,Ve+"leave",Wt,L,Et),xt.target=Yi,xt.relatedTarget=at,Tt=null,Ns(Et)===st&&(or=new or(tt,Ve+"enter",tr,L,Et),or.target=at,or.relatedTarget=Yi,Tt=or),Yi=Tt,Wt&&tr)t:{for(or=Wt,tt=tr,Ve=0,at=or;at;at=il(at))Ve++;for(at=0,Tt=tt;Tt;Tt=il(Tt))at++;for(;0<Ve-at;)or=il(or),Ve--;for(;0<at-Ve;)tt=il(tt),at--;for(;Ve--;){if(or===tt||tt!==null&&or===tt.alternate)break t;or=il(or),tt=il(tt)}or=null}else or=null;Wt!==null&&Bf(At,xt,Wt,or,!1),tr!==null&&Yi!==null&&Bf(At,Yi,tr,or,!0)}}e:{if(xt=st?ui(st):window,Wt=xt.nodeName&&xt.nodeName.toLowerCase(),Wt==="select"||Wt==="input"&&xt.type==="file")var sr=Bi;else if(Ha(xt))if(Cs)sr=rl;else{sr=Wr;var cr=es}else(Wt=xt.nodeName)&&Wt.toLowerCase()==="input"&&(xt.type==="checkbox"||xt.type==="radio")&&(sr=fo);if(sr&&(sr=sr(l,st))){Si(At,sr,L,Et);break e}cr&&cr(l,xt,st),l==="focusout"&&(cr=xt._wrapperState)&&cr.controlled&&xt.type==="number"&&me(xt,"number",xt.value)}switch(cr=st?ui(st):window,l){case"focusin":(Ha(cr)||cr.contentEditable==="true")&&(Va=cr,kn=st,ho=null);break;case"focusout":ho=kn=Va=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,Mo(At,L,Et);break;case"selectionchange":if(To)break;case"keydown":case"keyup":Mo(At,L,Et)}var fr;if(Ea)e:{switch(l){case"compositionstart":var mr="onCompositionStart";break e;case"compositionend":mr="onCompositionEnd";break e;case"compositionupdate":mr="onCompositionUpdate";break e}mr=void 0}else en?bl(l,L)&&(mr="onCompositionEnd"):l==="keydown"&&L.keyCode===229&&(mr="onCompositionStart");mr&&(Di&&L.locale!=="ko"&&(en||mr!=="onCompositionStart"?mr==="onCompositionEnd"&&en&&(fr=vl()):(oi=Et,Ii="value"in oi?oi.value:oi.textContent,en=!0)),cr=bc(st,mr),0<cr.length&&(mr=new Ae(mr,l,null,L,Et),At.push({event:mr,listeners:cr}),fr?mr.data=fr:(fr=ra(L),fr!==null&&(mr.data=fr)))),(fr=Qo?el(l,L):wl(l,L))&&(st=bc(st,"onBeforeInput"),0<st.length&&(Et=new Ae("onBeforeInput","beforeinput",null,L,Et),At.push({event:Et,listeners:st}),Et.data=fr))}fu(At,h)})}function pu(l,h,L){return{instance:l,listener:h,currentTarget:L}}function bc(l,h){for(var L=h+"Capture",q=[];l!==null;){var ee=l,ie=ee.stateNode;ee.tag===5&&ie!==null&&(ee=ie,ie=ze(l,L),ie!=null&&q.unshift(pu(l,ie,ee)),ie=ze(l,h),ie!=null&&q.push(pu(l,ie,ee))),l=l.return}return q}function il(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Bf(l,h,L,q,ee){for(var ie=h._reactName,ge=[];L!==null&&L!==q;){var Ne=L,De=Ne.alternate,st=Ne.stateNode;if(De!==null&&De===q)break;Ne.tag===5&&st!==null&&(Ne=st,ee?(De=ze(L,ie),De!=null&&ge.unshift(pu(L,De,Ne))):ee||(De=ze(L,ie),De!=null&&ge.push(pu(L,De,Ne)))),L=L.return}ge.length!==0&&l.push({event:h,listeners:ge})}var qh=/\r\n?/g,qf=/\u0000|\uFFFD/g;function lf(l){return(typeof l=="string"?l:""+l).replace(qh,`
|
|
30
|
+
`).replace(qf,"")}function Gu(l,h,L){if(h=lf(h),lf(l)!==h&&L)throw Error(t(425))}function Ls(){}var Wu=null,Ol=null;function uf(l,h){return l==="textarea"||l==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var Wa=typeof setTimeout=="function"?setTimeout:void 0,wc=typeof clearTimeout=="function"?clearTimeout:void 0,$u=typeof Promise=="function"?Promise:void 0,zf=typeof queueMicrotask=="function"?queueMicrotask:typeof $u<"u"?function(l){return $u.resolve(null).then(l).catch(Uf)}:Wa;function Uf(l){setTimeout(function(){throw l})}function _c(l,h){var L=h,q=0;do{var ee=L.nextSibling;if(l.removeChild(L),ee&&ee.nodeType===8)if(L=ee.data,L==="/$"){if(q===0){l.removeChild(ee),ai(h);return}q--}else L!=="$"&&L!=="$?"&&L!=="$!"||q++;L=ee}while(L);ai(h)}function Ui(l){for(;l!=null;l=l.nextSibling){var h=l.nodeType;if(h===1||h===3)break;if(h===8){if(h=l.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return l}function Hi(l){l=l.previousSibling;for(var h=0;l;){if(l.nodeType===8){var L=l.data;if(L==="$"||L==="$!"||L==="$?"){if(h===0)return l;h--}else L==="/$"&&h++}l=l.previousSibling}return null}var na=Math.random().toString(36).slice(2),po="__reactFiber$"+na,gu="__reactProps$"+na,Vi="__reactContainer$"+na,da="__reactEvents$"+na,Hf="__reactListeners$"+na,Vf="__reactHandles$"+na;function Ns(l){var h=l[po];if(h)return h;for(var L=l.parentNode;L;){if(h=L[Vi]||L[po]){if(L=h.alternate,h.child!==null||L!==null&&L.child!==null)for(l=Hi(l);l!==null;){if(L=l[po])return L;l=Hi(l)}return h}l=L,L=l.parentNode}return null}function vu(l){return l=l[po]||l[Vi],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function ui(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(t(33))}function bi(l){return l[gu]||null}var Sc=[],rs=-1;function go(l){return{current:l}}function Kr(l){0>rs||(l.current=Sc[rs],Sc[rs]=null,rs--)}function rn(l,h){rs++,Sc[rs]=l.current,l.current=h}var ns={},Ei=go(ns),ia=go(!1),al=ns;function Al(l,h){var L=l.type.contextTypes;if(!L)return ns;var q=l.stateNode;if(q&&q.__reactInternalMemoizedUnmaskedChildContext===h)return q.__reactInternalMemoizedMaskedChildContext;var ee={},ie;for(ie in L)ee[ie]=h[ie];return q&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=h,l.__reactInternalMemoizedMaskedChildContext=ee),ee}function aa(l){return l=l.childContextTypes,l!=null}function mu(){Kr(ia),Kr(Ei)}function cf(l,h,L){if(Ei.current!==ns)throw Error(t(168));rn(Ei,h),rn(ia,L)}function Yu(l,h,L){var q=l.stateNode;if(h=h.childContextTypes,typeof q.getChildContext!="function")return L;q=q.getChildContext();for(var ee in q)if(!(ee in h))throw Error(t(108,Z(l)||"Unknown",ee));return W({},L,q)}function is(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ns,al=Ei.current,rn(Ei,l),rn(ia,ia.current),!0}function Gf(l,h,L){var q=l.stateNode;if(!q)throw Error(t(169));L?(l=Yu(l,h,al),q.__reactInternalMemoizedMergedChildContext=l,Kr(ia),Kr(Ei),rn(Ei,l)):Kr(ia),rn(ia,L)}var as=null,Cl=!1,I=!1;function H(l){as===null?as=[l]:as.push(l)}function re(l){Cl=!0,H(l)}function oe(){if(!I&&as!==null){I=!0;var l=0,h=Rr;try{var L=as;for(Rr=1;l<L.length;l++){var q=L[l];do q=q(!0);while(q!==null)}as=null,Cl=!1}catch(ee){throw as!==null&&(as=as.slice(l+1)),_s(oo,oe),ee}finally{Rr=h,I=!1}}return null}var ue=[],pe=0,ve=null,be=0,_e=[],Pe=0,Fe=null,Ze=1,$e="";function Ge(l,h){ue[pe++]=be,ue[pe++]=ve,ve=l,be=h}function bt(l,h,L){_e[Pe++]=Ze,_e[Pe++]=$e,_e[Pe++]=Fe,Fe=l;var q=Ze;l=$e;var ee=32-Ar(q)-1;q&=~(1<<ee),L+=1;var ie=32-Ar(h)+ee;if(30<ie){var ge=ee-ee%5;ie=(q&(1<<ge)-1).toString(32),q>>=ge,ee-=ge,Ze=1<<32-Ar(h)+ee|L<<ee|q,$e=ie+l}else Ze=1<<ie|L<<ee|q,$e=l}function lt(l){l.return!==null&&(Ge(l,1),bt(l,1,0))}function Me(l){for(;l===ve;)ve=ue[--pe],ue[pe]=null,be=ue[--pe],ue[pe]=null;for(;l===Fe;)Fe=_e[--Pe],_e[Pe]=null,$e=_e[--Pe],_e[Pe]=null,Ze=_e[--Pe],_e[Pe]=null}var qe=null,Ue=null,ht=!1,gt=null;function qt(l,h){var L=ul(5,null,null,0);L.elementType="DELETED",L.stateNode=h,L.return=l,h=l.deletions,h===null?(l.deletions=[L],l.flags|=16):h.push(L)}function jt(l,h){switch(l.tag){case 5:var L=l.type;return h=h.nodeType!==1||L.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(l.stateNode=h,qe=l,Ue=Ui(h.firstChild),!0):!1;case 6:return h=l.pendingProps===""||h.nodeType!==3?null:h,h!==null?(l.stateNode=h,qe=l,Ue=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(L=Fe!==null?{id:Ze,overflow:$e}:null,l.memoizedState={dehydrated:h,treeContext:L,retryLane:1073741824},L=ul(18,null,null,0),L.stateNode=h,L.return=l,l.child=L,qe=l,Ue=null,!0):!1;default:return!1}}function ar(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Mt(l){if(ht){var h=Ue;if(h){var L=h;if(!jt(l,h)){if(ar(l))throw Error(t(418));h=Ui(L.nextSibling);var q=qe;h&&jt(l,h)?qt(q,L):(l.flags=l.flags&-4097|2,ht=!1,qe=l)}}else{if(ar(l))throw Error(t(418));l.flags=l.flags&-4097|2,ht=!1,qe=l}}}function Ir(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;qe=l}function Dr(l){if(l!==qe)return!1;if(!ht)return Ir(l),ht=!0,!1;var h;if((h=l.tag!==3)&&!(h=l.tag!==5)&&(h=l.type,h=h!=="head"&&h!=="body"&&!uf(l.type,l.memoizedProps)),h&&(h=Ue)){if(ar(l))throw Nr(),Error(t(418));for(;h;)qt(l,h),h=Ui(h.nextSibling)}if(Ir(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(t(317));e:{for(l=l.nextSibling,h=0;l;){if(l.nodeType===8){var L=l.data;if(L==="/$"){if(h===0){Ue=Ui(l.nextSibling);break e}h--}else L!=="$"&&L!=="$!"&&L!=="$?"||h++}l=l.nextSibling}Ue=null}}else Ue=qe?Ui(l.stateNode.nextSibling):null;return!0}function Nr(){for(var l=Ue;l;)l=Ui(l.nextSibling)}function yr(){Ue=qe=null,ht=!1}function Yr(l){gt===null?gt=[l]:gt.push(l)}var Zr=E.ReactCurrentBatchConfig;function Zt(l,h,L){if(l=L.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(L._owner){if(L=L._owner,L){if(L.tag!==1)throw Error(t(309));var q=L.stateNode}if(!q)throw Error(t(147,l));var ee=q,ie=""+l;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===ie?h.ref:(h=function(ge){var Ne=ee.refs;ge===null?delete Ne[ie]:Ne[ie]=ge},h._stringRef=ie,h)}if(typeof l!="string")throw Error(t(284));if(!L._owner)throw Error(t(290,l))}return l}function Br(l,h){throw l=Object.prototype.toString.call(h),Error(t(31,l==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":l))}function Ln(l){var h=l._init;return h(l._payload)}function Dn(l){function h(tt,Ve){if(l){var at=tt.deletions;at===null?(tt.deletions=[Ve],tt.flags|=16):at.push(Ve)}}function L(tt,Ve){if(!l)return null;for(;Ve!==null;)h(tt,Ve),Ve=Ve.sibling;return null}function q(tt,Ve){for(tt=new Map;Ve!==null;)Ve.key!==null?tt.set(Ve.key,Ve):tt.set(Ve.index,Ve),Ve=Ve.sibling;return tt}function ee(tt,Ve){return tt=jc(tt,Ve),tt.index=0,tt.sibling=null,tt}function ie(tt,Ve,at){return tt.index=at,l?(at=tt.alternate,at!==null?(at=at.index,at<Ve?(tt.flags|=2,Ve):at):(tt.flags|=2,Ve)):(tt.flags|=1048576,Ve)}function ge(tt){return l&&tt.alternate===null&&(tt.flags|=2),tt}function Ne(tt,Ve,at,Tt){return Ve===null||Ve.tag!==6?(Ve=R0(at,tt.mode,Tt),Ve.return=tt,Ve):(Ve=ee(Ve,at),Ve.return=tt,Ve)}function De(tt,Ve,at,Tt){var sr=at.type;return sr===N?Et(tt,Ve,at.props.children,Tt,at.key):Ve!==null&&(Ve.elementType===sr||typeof sr=="object"&&sr!==null&&sr.$$typeof===V&&Ln(sr)===Ve.type)?(Tt=ee(Ve,at.props),Tt.ref=Zt(tt,Ve,at),Tt.return=tt,Tt):(Tt=Yp(at.type,at.key,at.props,null,tt.mode,Tt),Tt.ref=Zt(tt,Ve,at),Tt.return=tt,Tt)}function st(tt,Ve,at,Tt){return Ve===null||Ve.tag!==4||Ve.stateNode.containerInfo!==at.containerInfo||Ve.stateNode.implementation!==at.implementation?(Ve=M0(at,tt.mode,Tt),Ve.return=tt,Ve):(Ve=ee(Ve,at.children||[]),Ve.return=tt,Ve)}function Et(tt,Ve,at,Tt,sr){return Ve===null||Ve.tag!==7?(Ve=mf(at,tt.mode,Tt,sr),Ve.return=tt,Ve):(Ve=ee(Ve,at),Ve.return=tt,Ve)}function At(tt,Ve,at){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number")return Ve=R0(""+Ve,tt.mode,at),Ve.return=tt,Ve;if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case b:return at=Yp(Ve.type,Ve.key,Ve.props,null,tt.mode,at),at.ref=Zt(tt,null,Ve),at.return=tt,at;case M:return Ve=M0(Ve,tt.mode,at),Ve.return=tt,Ve;case V:var Tt=Ve._init;return At(tt,Tt(Ve._payload),at)}if(Ee(Ve)||te(Ve))return Ve=mf(Ve,tt.mode,at,null),Ve.return=tt,Ve;Br(tt,Ve)}return null}function xt(tt,Ve,at,Tt){var sr=Ve!==null?Ve.key:null;if(typeof at=="string"&&at!==""||typeof at=="number")return sr!==null?null:Ne(tt,Ve,""+at,Tt);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case b:return at.key===sr?De(tt,Ve,at,Tt):null;case M:return at.key===sr?st(tt,Ve,at,Tt):null;case V:return sr=at._init,xt(tt,Ve,sr(at._payload),Tt)}if(Ee(at)||te(at))return sr!==null?null:Et(tt,Ve,at,Tt,null);Br(tt,at)}return null}function Wt(tt,Ve,at,Tt,sr){if(typeof Tt=="string"&&Tt!==""||typeof Tt=="number")return tt=tt.get(at)||null,Ne(Ve,tt,""+Tt,sr);if(typeof Tt=="object"&&Tt!==null){switch(Tt.$$typeof){case b:return tt=tt.get(Tt.key===null?at:Tt.key)||null,De(Ve,tt,Tt,sr);case M:return tt=tt.get(Tt.key===null?at:Tt.key)||null,st(Ve,tt,Tt,sr);case V:var cr=Tt._init;return Wt(tt,Ve,at,cr(Tt._payload),sr)}if(Ee(Tt)||te(Tt))return tt=tt.get(at)||null,Et(Ve,tt,Tt,sr,null);Br(Ve,Tt)}return null}function tr(tt,Ve,at,Tt){for(var sr=null,cr=null,fr=Ve,mr=Ve=0,La=null;fr!==null&&mr<at.length;mr++){fr.index>mr?(La=fr,fr=null):La=fr.sibling;var dn=xt(tt,fr,at[mr],Tt);if(dn===null){fr===null&&(fr=La);break}l&&fr&&dn.alternate===null&&h(tt,fr),Ve=ie(dn,Ve,mr),cr===null?sr=dn:cr.sibling=dn,cr=dn,fr=La}if(mr===at.length)return L(tt,fr),ht&&Ge(tt,mr),sr;if(fr===null){for(;mr<at.length;mr++)fr=At(tt,at[mr],Tt),fr!==null&&(Ve=ie(fr,Ve,mr),cr===null?sr=fr:cr.sibling=fr,cr=fr);return ht&&Ge(tt,mr),sr}for(fr=q(tt,fr);mr<at.length;mr++)La=Wt(fr,tt,mr,at[mr],Tt),La!==null&&(l&&La.alternate!==null&&fr.delete(La.key===null?mr:La.key),Ve=ie(La,Ve,mr),cr===null?sr=La:cr.sibling=La,cr=La);return l&&fr.forEach(function(Fc){return h(tt,Fc)}),ht&&Ge(tt,mr),sr}function or(tt,Ve,at,Tt){var sr=te(at);if(typeof sr!="function")throw Error(t(150));if(at=sr.call(at),at==null)throw Error(t(151));for(var cr=sr=null,fr=Ve,mr=Ve=0,La=null,dn=at.next();fr!==null&&!dn.done;mr++,dn=at.next()){fr.index>mr?(La=fr,fr=null):La=fr.sibling;var Fc=xt(tt,fr,dn.value,Tt);if(Fc===null){fr===null&&(fr=La);break}l&&fr&&Fc.alternate===null&&h(tt,fr),Ve=ie(Fc,Ve,mr),cr===null?sr=Fc:cr.sibling=Fc,cr=Fc,fr=La}if(dn.done)return L(tt,fr),ht&&Ge(tt,mr),sr;if(fr===null){for(;!dn.done;mr++,dn=at.next())dn=At(tt,dn.value,Tt),dn!==null&&(Ve=ie(dn,Ve,mr),cr===null?sr=dn:cr.sibling=dn,cr=dn);return ht&&Ge(tt,mr),sr}for(fr=q(tt,fr);!dn.done;mr++,dn=at.next())dn=Wt(fr,tt,mr,dn.value,Tt),dn!==null&&(l&&dn.alternate!==null&&fr.delete(dn.key===null?mr:dn.key),Ve=ie(dn,Ve,mr),cr===null?sr=dn:cr.sibling=dn,cr=dn);return l&&fr.forEach(function(r7){return h(tt,r7)}),ht&&Ge(tt,mr),sr}function Yi(tt,Ve,at,Tt){if(typeof at=="object"&&at!==null&&at.type===N&&at.key===null&&(at=at.props.children),typeof at=="object"&&at!==null){switch(at.$$typeof){case b:e:{for(var sr=at.key,cr=Ve;cr!==null;){if(cr.key===sr){if(sr=at.type,sr===N){if(cr.tag===7){L(tt,cr.sibling),Ve=ee(cr,at.props.children),Ve.return=tt,tt=Ve;break e}}else if(cr.elementType===sr||typeof sr=="object"&&sr!==null&&sr.$$typeof===V&&Ln(sr)===cr.type){L(tt,cr.sibling),Ve=ee(cr,at.props),Ve.ref=Zt(tt,cr,at),Ve.return=tt,tt=Ve;break e}L(tt,cr);break}else h(tt,cr);cr=cr.sibling}at.type===N?(Ve=mf(at.props.children,tt.mode,Tt,at.key),Ve.return=tt,tt=Ve):(Tt=Yp(at.type,at.key,at.props,null,tt.mode,Tt),Tt.ref=Zt(tt,Ve,at),Tt.return=tt,tt=Tt)}return ge(tt);case M:e:{for(cr=at.key;Ve!==null;){if(Ve.key===cr)if(Ve.tag===4&&Ve.stateNode.containerInfo===at.containerInfo&&Ve.stateNode.implementation===at.implementation){L(tt,Ve.sibling),Ve=ee(Ve,at.children||[]),Ve.return=tt,tt=Ve;break e}else{L(tt,Ve);break}else h(tt,Ve);Ve=Ve.sibling}Ve=M0(at,tt.mode,Tt),Ve.return=tt,tt=Ve}return ge(tt);case V:return cr=at._init,Yi(tt,Ve,cr(at._payload),Tt)}if(Ee(at))return tr(tt,Ve,at,Tt);if(te(at))return or(tt,Ve,at,Tt);Br(tt,at)}return typeof at=="string"&&at!==""||typeof at=="number"?(at=""+at,Ve!==null&&Ve.tag===6?(L(tt,Ve.sibling),Ve=ee(Ve,at),Ve.return=tt,tt=Ve):(L(tt,Ve),Ve=R0(at,tt.mode,Tt),Ve.return=tt,tt=Ve),ge(tt)):L(tt,Ve)}return Yi}var ci=Dn(!0),xr=Dn(!1),Gi=go(null),En=null,Bn=null,fi=null;function Pi(){fi=Bn=En=null}function pa(l){var h=Gi.current;Kr(Gi),l._currentValue=h}function $a(l,h,L){for(;l!==null;){var q=l.alternate;if((l.childLanes&h)!==h?(l.childLanes|=h,q!==null&&(q.childLanes|=h)):q!==null&&(q.childLanes&h)!==h&&(q.childLanes|=h),l===L)break;l=l.return}}function yn(l,h){En=l,fi=Bn=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&h)!==0&&(le=!0),l.firstContext=null)}function qn(l){var h=l._currentValue;if(fi!==l)if(l={context:l,memoizedValue:h,next:null},Bn===null){if(En===null)throw Error(t(308));Bn=l,En.dependencies={lanes:0,firstContext:l}}else Bn=Bn.next=l;return h}var oa=null;function Do(l){oa===null?oa=[l]:oa.push(l)}function vo(l,h,L,q){var ee=h.interleaved;return ee===null?(L.next=L,Do(h)):(L.next=ee.next,ee.next=L),h.interleaved=L,jr(l,q)}function jr(l,h){l.lanes|=h;var L=l.alternate;for(L!==null&&(L.lanes|=h),L=l,l=l.return;l!==null;)l.childLanes|=h,L=l.alternate,L!==null&&(L.childLanes|=h),L=l,l=l.return;return L.tag===3?L.stateNode:null}var mo=!1;function yu(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xu(l,h){l=l.updateQueue,h.updateQueue===l&&(h.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Ya(l,h){return{eventTime:l,lane:h,tag:0,payload:null,callback:null,next:null}}function Oa(l,h,L){var q=l.updateQueue;if(q===null)return null;if(q=q.shared,(an&2)!==0){var ee=q.pending;return ee===null?h.next=h:(h.next=ee.next,ee.next=h),q.pending=h,jr(l,L)}return ee=q.interleaved,ee===null?(h.next=h,Do(q)):(h.next=ee.next,ee.next=h),q.interleaved=h,jr(l,L)}function kl(l,h,L){if(h=h.updateQueue,h!==null&&(h=h.shared,(L&4194240)!==0)){var q=h.lanes;q&=l.pendingLanes,L|=q,h.lanes=L,iu(l,L)}}function ga(l,h){var L=l.updateQueue,q=l.alternate;if(q!==null&&(q=q.updateQueue,L===q)){var ee=null,ie=null;if(L=L.firstBaseUpdate,L!==null){do{var ge={eventTime:L.eventTime,lane:L.lane,tag:L.tag,payload:L.payload,callback:L.callback,next:null};ie===null?ee=ie=ge:ie=ie.next=ge,L=L.next}while(L!==null);ie===null?ee=ie=h:ie=ie.next=h}else ee=ie=h;L={baseState:q.baseState,firstBaseUpdate:ee,lastBaseUpdate:ie,shared:q.shared,effects:q.effects},l.updateQueue=L;return}l=L.lastBaseUpdate,l===null?L.firstBaseUpdate=h:l.next=h,L.lastBaseUpdate=h}function Bo(l,h,L,q){var ee=l.updateQueue;mo=!1;var ie=ee.firstBaseUpdate,ge=ee.lastBaseUpdate,Ne=ee.shared.pending;if(Ne!==null){ee.shared.pending=null;var De=Ne,st=De.next;De.next=null,ge===null?ie=st:ge.next=st,ge=De;var Et=l.alternate;Et!==null&&(Et=Et.updateQueue,Ne=Et.lastBaseUpdate,Ne!==ge&&(Ne===null?Et.firstBaseUpdate=st:Ne.next=st,Et.lastBaseUpdate=De))}if(ie!==null){var At=ee.baseState;ge=0,Et=st=De=null,Ne=ie;do{var xt=Ne.lane,Wt=Ne.eventTime;if((q&xt)===xt){Et!==null&&(Et=Et.next={eventTime:Wt,lane:0,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null});e:{var tr=l,or=Ne;switch(xt=h,Wt=L,or.tag){case 1:if(tr=or.payload,typeof tr=="function"){At=tr.call(Wt,At,xt);break e}At=tr;break e;case 3:tr.flags=tr.flags&-65537|128;case 0:if(tr=or.payload,xt=typeof tr=="function"?tr.call(Wt,At,xt):tr,xt==null)break e;At=W({},At,xt);break e;case 2:mo=!0}}Ne.callback!==null&&Ne.lane!==0&&(l.flags|=64,xt=ee.effects,xt===null?ee.effects=[Ne]:xt.push(Ne))}else Wt={eventTime:Wt,lane:xt,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null},Et===null?(st=Et=Wt,De=At):Et=Et.next=Wt,ge|=xt;if(Ne=Ne.next,Ne===null){if(Ne=ee.shared.pending,Ne===null)break;xt=Ne,Ne=xt.next,xt.next=null,ee.lastBaseUpdate=xt,ee.shared.pending=null}}while(!0);if(Et===null&&(De=At),ee.baseState=De,ee.firstBaseUpdate=st,ee.lastBaseUpdate=Et,h=ee.shared.interleaved,h!==null){ee=h;do ge|=ee.lane,ee=ee.next;while(ee!==h)}else ie===null&&(ee.shared.lanes=0);df|=ge,l.lanes=ge,l.memoizedState=At}}function vn(l,h,L){if(l=h.effects,h.effects=null,l!==null)for(h=0;h<l.length;h++){var q=l[h],ee=q.callback;if(ee!==null){if(q.callback=null,q=L,typeof ee!="function")throw Error(t(191,ee));ee.call(q)}}}var vr={},Qr=go(vr),Pn=go(vr),Nn=go(vr);function ei(l){if(l===vr)throw Error(t(174));return l}function qo(l,h){switch(rn(Nn,h),rn(Pn,l),rn(Qr,vr),l=h.nodeType,l){case 9:case 11:h=(h=h.documentElement)?h.namespaceURI:vt(null,"");break;default:l=l===8?h.parentNode:h,h=l.namespaceURI||null,l=l.tagName,h=vt(h,l)}Kr(Qr),rn(Qr,h)}function fn(){Kr(Qr),Kr(Pn),Kr(Nn)}function bu(l){ei(Nn.current);var h=ei(Qr.current),L=vt(h,l.type);h!==L&&(rn(Pn,l),rn(Qr,L))}function Ts(l){Pn.current===l&&(Kr(Qr),Kr(Pn))}var hn=go(0);function Xa(l){for(var h=l;h!==null;){if(h.tag===13){var L=h.memoizedState;if(L!==null&&(L=L.dehydrated,L===null||L.data==="$?"||L.data==="$!"))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Ll=[];function sa(){for(var l=0;l<Ll.length;l++)Ll[l]._workInProgressVersionPrimary=null;Ll.length=0}var wu=E.ReactCurrentDispatcher,_u=E.ReactCurrentBatchConfig,Oi=0,nn=null,zn=null,Un=null,Ka=!1,yo=!1,Za=0,xc=0;function Hn(){throw Error(t(321))}function Su(l,h){if(h===null)return!1;for(var L=0;L<h.length&&L<l.length;L++)if(!Mr(l[L],h[L]))return!1;return!0}function ol(l,h,L,q,ee,ie){if(Oi=ie,nn=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,wu.current=l===null||l.memoizedState===null?p0:Eu,l=L(q,ee),yo){ie=0;do{if(yo=!1,Za=0,25<=ie)throw Error(t(301));ie+=1,Un=zn=null,h.updateQueue=null,wu.current=$f,l=L(q,ee)}while(yo)}if(wu.current=Ac,h=zn!==null&&zn.next!==null,Oi=0,Un=zn=nn=null,Ka=!1,h)throw Error(t(300));return l}function Qa(){var l=Za!==0;return Za=0,l}function bn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Un===null?nn.memoizedState=Un=l:Un=Un.next=l,Un}function hi(){if(zn===null){var l=nn.alternate;l=l!==null?l.memoizedState:null}else l=zn.next;var h=Un===null?nn.memoizedState:Un.next;if(h!==null)Un=h,zn=l;else{if(l===null)throw Error(t(310));zn=l,l={memoizedState:zn.memoizedState,baseState:zn.baseState,baseQueue:zn.baseQueue,queue:zn.queue,next:null},Un===null?nn.memoizedState=Un=l:Un=Un.next=l}return Un}function la(l,h){return typeof h=="function"?h(l):h}function Wi(l){var h=hi(),L=h.queue;if(L===null)throw Error(t(311));L.lastRenderedReducer=l;var q=zn,ee=q.baseQueue,ie=L.pending;if(ie!==null){if(ee!==null){var ge=ee.next;ee.next=ie.next,ie.next=ge}q.baseQueue=ee=ie,L.pending=null}if(ee!==null){ie=ee.next,q=q.baseState;var Ne=ge=null,De=null,st=ie;do{var Et=st.lane;if((Oi&Et)===Et)De!==null&&(De=De.next={lane:0,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null}),q=st.hasEagerState?st.eagerState:l(q,st.action);else{var At={lane:Et,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null};De===null?(Ne=De=At,ge=q):De=De.next=At,nn.lanes|=Et,df|=Et}st=st.next}while(st!==null&&st!==ie);De===null?ge=q:De.next=Ne,Mr(q,h.memoizedState)||(le=!0),h.memoizedState=q,h.baseState=ge,h.baseQueue=De,L.lastRenderedState=q}if(l=L.interleaved,l!==null){ee=l;do ie=ee.lane,nn.lanes|=ie,df|=ie,ee=ee.next;while(ee!==l)}else ee===null&&(L.lanes=0);return[h.memoizedState,L.dispatch]}function Rs(l){var h=hi(),L=h.queue;if(L===null)throw Error(t(311));L.lastRenderedReducer=l;var q=L.dispatch,ee=L.pending,ie=h.memoizedState;if(ee!==null){L.pending=null;var ge=ee=ee.next;do ie=l(ie,ge.action),ge=ge.next;while(ge!==ee);Mr(ie,h.memoizedState)||(le=!0),h.memoizedState=ie,h.baseQueue===null&&(h.baseState=ie),L.lastRenderedState=ie}return[ie,q]}function Ec(){}function Ku(l,h){var L=nn,q=hi(),ee=h(),ie=!Mr(q.memoizedState,ee);if(ie&&(q.memoizedState=ee,le=!0),q=q.queue,Oc(ff.bind(null,L,q,l),[l]),q.getSnapshot!==h||ie||Un!==null&&Un.memoizedState.tag&1){if(L.flags|=2048,Aa(9,os.bind(null,L,q,ee,h),void 0,null),ka===null)throw Error(t(349));(Oi&30)!==0||Wf(L,h,ee)}return ee}function Wf(l,h,L){l.flags|=16384,l={getSnapshot:h,value:L},h=nn.updateQueue,h===null?(h={lastEffect:null,stores:null},nn.updateQueue=h,h.stores=[l]):(L=h.stores,L===null?h.stores=[l]:L.push(l))}function os(l,h,L,q){h.value=L,h.getSnapshot=q,Nl(h)&&xu(l)}function ff(l,h,L){return L(function(){Nl(h)&&xu(l)})}function Nl(l){var h=l.getSnapshot;l=l.value;try{var L=h();return!Mr(l,L)}catch{return!0}}function xu(l){var h=jr(l,1);h!==null&&Il(h,l,1,-1)}function zo(l){var h=bn();return typeof l=="function"&&(l=l()),h.memoizedState=h.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:l},h.queue=l,l=l.dispatch=Mp.bind(null,nn,l),[h.memoizedState,l]}function Aa(l,h,L,q){return l={tag:l,create:h,destroy:L,deps:q,next:null},h=nn.updateQueue,h===null?(h={lastEffect:null,stores:null},nn.updateQueue=h,h.lastEffect=l.next=l):(L=h.lastEffect,L===null?h.lastEffect=l.next=l:(q=L.next,L.next=l,l.next=q,h.lastEffect=l)),l}function ss(){return hi().memoizedState}function Ja(l,h,L,q){var ee=bn();nn.flags|=l,ee.memoizedState=Aa(1|h,L,void 0,q===void 0?null:q)}function ls(l,h,L,q){var ee=hi();q=q===void 0?null:q;var ie=void 0;if(zn!==null){var ge=zn.memoizedState;if(ie=ge.destroy,q!==null&&Su(q,ge.deps)){ee.memoizedState=Aa(h,L,ie,q);return}}nn.flags|=l,ee.memoizedState=Aa(1|h,L,ie,q)}function Pc(l,h){return Ja(8390656,8,l,h)}function Oc(l,h){return ls(2048,8,l,h)}function hf(l,h){return ls(4,2,l,h)}function Zu(l,h){return ls(4,4,l,h)}function us(l,h){if(typeof h=="function")return l=l(),h(l),function(){h(null)};if(h!=null)return l=l(),h.current=l,function(){h.current=null}}function Lp(l,h,L){return L=L!=null?L.concat([l]):null,ls(4,4,us.bind(null,h,l),L)}function Tl(){}function zh(l,h){var L=hi();h=h===void 0?null:h;var q=L.memoizedState;return q!==null&&h!==null&&Su(h,q[1])?q[0]:(L.memoizedState=[l,h],l)}function Vn(l,h){var L=hi();h=h===void 0?null:h;var q=L.memoizedState;return q!==null&&h!==null&&Su(h,q[1])?q[0]:(l=l(),L.memoizedState=[l,h],l)}function Np(l,h,L){return(Oi&21)===0?(l.baseState&&(l.baseState=!1,le=!0),l.memoizedState=L):(Mr(L,h)||(L=nu(),nn.lanes|=L,df|=L,l.baseState=!0),h)}function Tp(l,h){var L=Rr;Rr=L!==0&&4>L?L:4,l(!0);var q=_u.transition;_u.transition={};try{l(!1),h()}finally{Rr=L,_u.transition=q}}function Rp(){return hi().memoizedState}function d0(l,h,L){var q=Mc(l);if(L={lane:q,action:L,hasEagerState:!1,eagerState:null,next:null},Uh(l))Ip(h,L);else if(L=vo(l,h,L,q),L!==null){var ee=Ho();Il(L,l,q,ee),Uo(L,h,q)}}function Mp(l,h,L){var q=Mc(l),ee={lane:q,action:L,hasEagerState:!1,eagerState:null,next:null};if(Uh(l))Ip(h,ee);else{var ie=l.alternate;if(l.lanes===0&&(ie===null||ie.lanes===0)&&(ie=h.lastRenderedReducer,ie!==null))try{var ge=h.lastRenderedState,Ne=ie(ge,L);if(ee.hasEagerState=!0,ee.eagerState=Ne,Mr(Ne,ge)){var De=h.interleaved;De===null?(ee.next=ee,Do(h)):(ee.next=De.next,De.next=ee),h.interleaved=ee;return}}catch{}finally{}L=vo(l,h,ee,q),L!==null&&(ee=Ho(),Il(L,l,q,ee),Uo(L,h,q))}}function Uh(l){var h=l.alternate;return l===nn||h!==null&&h===nn}function Ip(l,h){yo=Ka=!0;var L=l.pending;L===null?h.next=h:(h.next=L.next,L.next=h),l.pending=h}function Uo(l,h,L){if((L&4194240)!==0){var q=h.lanes;q&=l.pendingLanes,L|=q,h.lanes=L,iu(l,L)}}var Ac={readContext:qn,useCallback:Hn,useContext:Hn,useEffect:Hn,useImperativeHandle:Hn,useInsertionEffect:Hn,useLayoutEffect:Hn,useMemo:Hn,useReducer:Hn,useRef:Hn,useState:Hn,useDebugValue:Hn,useDeferredValue:Hn,useTransition:Hn,useMutableSource:Hn,useSyncExternalStore:Hn,useId:Hn,unstable_isNewReconciler:!1},p0={readContext:qn,useCallback:function(l,h){return bn().memoizedState=[l,h===void 0?null:h],l},useContext:qn,useEffect:Pc,useImperativeHandle:function(l,h,L){return L=L!=null?L.concat([l]):null,Ja(4194308,4,us.bind(null,h,l),L)},useLayoutEffect:function(l,h){return Ja(4194308,4,l,h)},useInsertionEffect:function(l,h){return Ja(4,2,l,h)},useMemo:function(l,h){var L=bn();return h=h===void 0?null:h,l=l(),L.memoizedState=[l,h],l},useReducer:function(l,h,L){var q=bn();return h=L!==void 0?L(h):h,q.memoizedState=q.baseState=h,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:h},q.queue=l,l=l.dispatch=d0.bind(null,nn,l),[q.memoizedState,l]},useRef:function(l){var h=bn();return l={current:l},h.memoizedState=l},useState:zo,useDebugValue:Tl,useDeferredValue:function(l){return bn().memoizedState=l},useTransition:function(){var l=zo(!1),h=l[0];return l=Tp.bind(null,l[1]),bn().memoizedState=l,[h,l]},useMutableSource:function(){},useSyncExternalStore:function(l,h,L){var q=nn,ee=bn();if(ht){if(L===void 0)throw Error(t(407));L=L()}else{if(L=h(),ka===null)throw Error(t(349));(Oi&30)!==0||Wf(q,h,L)}ee.memoizedState=L;var ie={value:L,getSnapshot:h};return ee.queue=ie,Pc(ff.bind(null,q,ie,l),[l]),q.flags|=2048,Aa(9,os.bind(null,q,ie,L,h),void 0,null),L},useId:function(){var l=bn(),h=ka.identifierPrefix;if(ht){var L=$e,q=Ze;L=(q&~(1<<32-Ar(q)-1)).toString(32)+L,h=":"+h+"R"+L,L=Za++,0<L&&(h+="H"+L.toString(32)),h+=":"}else L=xc++,h=":"+h+"r"+L.toString(32)+":";return l.memoizedState=h},unstable_isNewReconciler:!1},Eu={readContext:qn,useCallback:zh,useContext:qn,useEffect:Oc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:Vn,useReducer:Wi,useRef:ss,useState:function(){return Wi(la)},useDebugValue:Tl,useDeferredValue:function(l){var h=hi();return Np(h,zn.memoizedState,l)},useTransition:function(){var l=Wi(la)[0],h=hi().memoizedState;return[l,h]},useMutableSource:Ec,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1},$f={readContext:qn,useCallback:zh,useContext:qn,useEffect:Oc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:Vn,useReducer:Rs,useRef:ss,useState:function(){return Rs(la)},useDebugValue:Tl,useDeferredValue:function(l){var h=hi();return zn===null?h.memoizedState=l:Np(h,zn.memoizedState,l)},useTransition:function(){var l=Rs(la)[0],h=hi().memoizedState;return[l,h]},useMutableSource:Ec,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1};function va(l,h){if(l&&l.defaultProps){h=W({},h),l=l.defaultProps;for(var L in l)h[L]===void 0&&(h[L]=l[L]);return h}return h}function Cc(l,h,L,q){h=l.memoizedState,L=L(q,h),L=L==null?h:W({},h,L),l.memoizedState=L,l.lanes===0&&(l.updateQueue.baseState=L)}var kc={isMounted:function(l){return(l=l._reactInternals)?sn(l)===l:!1},enqueueSetState:function(l,h,L){l=l._reactInternals;var q=Ho(),ee=Mc(l),ie=Ya(q,ee);ie.payload=h,L!=null&&(ie.callback=L),h=Oa(l,ie,ee),h!==null&&(Il(h,l,ee,q),kl(h,l,ee))},enqueueReplaceState:function(l,h,L){l=l._reactInternals;var q=Ho(),ee=Mc(l),ie=Ya(q,ee);ie.tag=1,ie.payload=h,L!=null&&(ie.callback=L),h=Oa(l,ie,ee),h!==null&&(Il(h,l,ee,q),kl(h,l,ee))},enqueueForceUpdate:function(l,h){l=l._reactInternals;var L=Ho(),q=Mc(l),ee=Ya(L,q);ee.tag=2,h!=null&&(ee.callback=h),h=Oa(l,ee,q),h!==null&&(Il(h,l,q,L),kl(h,l,q))}};function Yf(l,h,L,q,ee,ie,ge){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(q,ie,ge):h.prototype&&h.prototype.isPureReactComponent?!Lo(L,q)||!Lo(ee,ie):!0}function jp(l,h,L){var q=!1,ee=ns,ie=h.contextType;return typeof ie=="object"&&ie!==null?ie=qn(ie):(ee=aa(h)?al:Ei.current,q=h.contextTypes,ie=(q=q!=null)?Al(l,ee):ns),h=new h(L,ie),l.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=kc,l.stateNode=h,h._reactInternals=l,q&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=ee,l.__reactInternalMemoizedMaskedChildContext=ie),h}function Hh(l,h,L,q){l=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(L,q),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(L,q),h.state!==l&&kc.enqueueReplaceState(h,h.state,null)}function Xf(l,h,L,q){var ee=l.stateNode;ee.props=L,ee.state=l.memoizedState,ee.refs={},yu(l);var ie=h.contextType;typeof ie=="object"&&ie!==null?ee.context=qn(ie):(ie=aa(h)?al:Ei.current,ee.context=Al(l,ie)),ee.state=l.memoizedState,ie=h.getDerivedStateFromProps,typeof ie=="function"&&(Cc(l,h,ie,L),ee.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof ee.getSnapshotBeforeUpdate=="function"||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(h=ee.state,typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount(),h!==ee.state&&kc.enqueueReplaceState(ee,ee.state,null),Bo(l,L,ee,q),ee.state=l.memoizedState),typeof ee.componentDidMount=="function"&&(l.flags|=4194308)}function Qu(l,h){try{var L="",q=h;do L+=Q(q),q=q.return;while(q);var ee=L}catch(ie){ee=`
|
|
31
|
+
Error generating stack: `+ie.message+`
|
|
32
|
+
`+ie.stack}return{value:l,source:h,stack:ee,digest:null}}function Kf(l,h,L){return{value:l,source:null,stack:L??null,digest:h??null}}function Lc(l,h){try{console.error(h.value)}catch(L){setTimeout(function(){throw L})}}var g0=typeof WeakMap=="function"?WeakMap:Map;function Fp(l,h,L){L=Ya(-1,L),L.tag=3,L.payload={element:null};var q=h.value;return L.callback=function(){Up||(Up=!0,P0=q),Lc(l,h)},L}function m(l,h,L){L=Ya(-1,L),L.tag=3;var q=l.type.getDerivedStateFromError;if(typeof q=="function"){var ee=h.value;L.payload=function(){return q(ee)},L.callback=function(){Lc(l,h)}}var ie=l.stateNode;return ie!==null&&typeof ie.componentDidCatch=="function"&&(L.callback=function(){Lc(l,h),typeof q!="function"&&(Tc===null?Tc=new Set([this]):Tc.add(this));var ge=h.stack;this.componentDidCatch(h.value,{componentStack:ge!==null?ge:""})}),L}function P(l,h,L){var q=l.pingCache;if(q===null){q=l.pingCache=new g0;var ee=new Set;q.set(h,ee)}else ee=q.get(h),ee===void 0&&(ee=new Set,q.set(h,ee));ee.has(L)||(ee.add(L),l=G_.bind(null,l,h,L),h.then(l,l))}function B(l){do{var h;if((h=l.tag===13)&&(h=l.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return l;l=l.return}while(l!==null);return null}function K(l,h,L,q,ee){return(l.mode&1)===0?(l===h?l.flags|=65536:(l.flags|=128,L.flags|=131072,L.flags&=-52805,L.tag===1&&(L.alternate===null?L.tag=17:(h=Ya(-1,1),h.tag=2,Oa(L,h,1))),L.lanes|=1),l):(l.flags|=65536,l.lanes=ee,l)}var ne=E.ReactCurrentOwner,le=!1;function xe(l,h,L,q){h.child=l===null?xr(h,null,L,q):ci(h,l.child,L,q)}function Ye(l,h,L,q,ee){L=L.render;var ie=h.ref;return yn(h,ee),q=ol(l,h,L,q,ie,ee),L=Qa(),l!==null&&!le?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~ee,Ca(l,h,ee)):(ht&&L&<(h),h.flags|=1,xe(l,h,q,ee),h.child)}function ut(l,h,L,q,ee){if(l===null){var ie=L.type;return typeof ie=="function"&&!T0(ie)&&ie.defaultProps===void 0&&L.compare===null&&L.defaultProps===void 0?(h.tag=15,h.type=ie,Lt(l,h,ie,q,ee)):(l=Yp(L.type,null,q,h,h.mode,ee),l.ref=h.ref,l.return=h,h.child=l)}if(ie=l.child,(l.lanes&ee)===0){var ge=ie.memoizedProps;if(L=L.compare,L=L!==null?L:Lo,L(ge,q)&&l.ref===h.ref)return Ca(l,h,ee)}return h.flags|=1,l=jc(ie,q),l.ref=h.ref,l.return=h,h.child=l}function Lt(l,h,L,q,ee){if(l!==null){var ie=l.memoizedProps;if(Lo(ie,q)&&l.ref===h.ref)if(le=!1,h.pendingProps=q=ie,(l.lanes&ee)!==0)(l.flags&131072)!==0&&(le=!0);else return h.lanes=l.lanes,Ca(l,h,ee)}return zt(l,h,L,q,ee)}function Kt(l,h,L){var q=h.pendingProps,ee=q.children,ie=l!==null?l.memoizedState:null;if(q.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},rn(Qf,Ms),Ms|=L;else{if((L&1073741824)===0)return l=ie!==null?ie.baseLanes|L:L,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:l,cachePool:null,transitions:null},h.updateQueue=null,rn(Qf,Ms),Ms|=l,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},q=ie!==null?ie.baseLanes:L,rn(Qf,Ms),Ms|=q}else ie!==null?(q=ie.baseLanes|L,h.memoizedState=null):q=L,rn(Qf,Ms),Ms|=q;return xe(l,h,ee,L),h.child}function br(l,h){var L=h.ref;(l===null&&L!==null||l!==null&&l.ref!==L)&&(h.flags|=512,h.flags|=2097152)}function zt(l,h,L,q,ee){var ie=aa(L)?al:Ei.current;return ie=Al(h,ie),yn(h,ee),L=ol(l,h,L,q,ie,ee),q=Qa(),l!==null&&!le?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~ee,Ca(l,h,ee)):(ht&&q&<(h),h.flags|=1,xe(l,h,L,ee),h.child)}function Tn(l,h,L,q,ee){if(aa(L)){var ie=!0;is(h)}else ie=!1;if(yn(h,ee),h.stateNode===null)qr(l,h),jp(h,L,q),Xf(h,L,q,ee),q=!0;else if(l===null){var ge=h.stateNode,Ne=h.memoizedProps;ge.props=Ne;var De=ge.context,st=L.contextType;typeof st=="object"&&st!==null?st=qn(st):(st=aa(L)?al:Ei.current,st=Al(h,st));var Et=L.getDerivedStateFromProps,At=typeof Et=="function"||typeof ge.getSnapshotBeforeUpdate=="function";At||typeof ge.UNSAFE_componentWillReceiveProps!="function"&&typeof ge.componentWillReceiveProps!="function"||(Ne!==q||De!==st)&&Hh(h,ge,q,st),mo=!1;var xt=h.memoizedState;ge.state=xt,Bo(h,q,ge,ee),De=h.memoizedState,Ne!==q||xt!==De||ia.current||mo?(typeof Et=="function"&&(Cc(h,L,Et,q),De=h.memoizedState),(Ne=mo||Yf(h,L,Ne,q,xt,De,st))?(At||typeof ge.UNSAFE_componentWillMount!="function"&&typeof ge.componentWillMount!="function"||(typeof ge.componentWillMount=="function"&&ge.componentWillMount(),typeof ge.UNSAFE_componentWillMount=="function"&&ge.UNSAFE_componentWillMount()),typeof ge.componentDidMount=="function"&&(h.flags|=4194308)):(typeof ge.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=q,h.memoizedState=De),ge.props=q,ge.state=De,ge.context=st,q=Ne):(typeof ge.componentDidMount=="function"&&(h.flags|=4194308),q=!1)}else{ge=h.stateNode,Xu(l,h),Ne=h.memoizedProps,st=h.type===h.elementType?Ne:va(h.type,Ne),ge.props=st,At=h.pendingProps,xt=ge.context,De=L.contextType,typeof De=="object"&&De!==null?De=qn(De):(De=aa(L)?al:Ei.current,De=Al(h,De));var Wt=L.getDerivedStateFromProps;(Et=typeof Wt=="function"||typeof ge.getSnapshotBeforeUpdate=="function")||typeof ge.UNSAFE_componentWillReceiveProps!="function"&&typeof ge.componentWillReceiveProps!="function"||(Ne!==At||xt!==De)&&Hh(h,ge,q,De),mo=!1,xt=h.memoizedState,ge.state=xt,Bo(h,q,ge,ee);var tr=h.memoizedState;Ne!==At||xt!==tr||ia.current||mo?(typeof Wt=="function"&&(Cc(h,L,Wt,q),tr=h.memoizedState),(st=mo||Yf(h,L,st,q,xt,tr,De)||!1)?(Et||typeof ge.UNSAFE_componentWillUpdate!="function"&&typeof ge.componentWillUpdate!="function"||(typeof ge.componentWillUpdate=="function"&&ge.componentWillUpdate(q,tr,De),typeof ge.UNSAFE_componentWillUpdate=="function"&&ge.UNSAFE_componentWillUpdate(q,tr,De)),typeof ge.componentDidUpdate=="function"&&(h.flags|=4),typeof ge.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof ge.componentDidUpdate!="function"||Ne===l.memoizedProps&&xt===l.memoizedState||(h.flags|=4),typeof ge.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&xt===l.memoizedState||(h.flags|=1024),h.memoizedProps=q,h.memoizedState=tr),ge.props=q,ge.state=tr,ge.context=De,q=st):(typeof ge.componentDidUpdate!="function"||Ne===l.memoizedProps&&xt===l.memoizedState||(h.flags|=4),typeof ge.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&xt===l.memoizedState||(h.flags|=1024),q=!1)}return mn(l,h,L,q,ie,ee)}function mn(l,h,L,q,ee,ie){br(l,h);var ge=(h.flags&128)!==0;if(!q&&!ge)return ee&&Gf(h,L,!1),Ca(l,h,ie);q=h.stateNode,ne.current=h;var Ne=ge&&typeof L.getDerivedStateFromError!="function"?null:q.render();return h.flags|=1,l!==null&&ge?(h.child=ci(h,l.child,null,ie),h.child=ci(h,null,Ne,ie)):xe(l,h,Ne,ie),h.memoizedState=q.state,ee&&Gf(h,L,!0),h.child}function eo(l){var h=l.stateNode;h.pendingContext?cf(l,h.pendingContext,h.pendingContext!==h.context):h.context&&cf(l,h.context,!1),qo(l,h.containerInfo)}function sl(l,h,L,q,ee){return yr(),Yr(ee),h.flags|=256,xe(l,h,L,q),h.child}var ot={dehydrated:null,treeContext:null,retryLane:0};function Ke(l){return{baseLanes:l,cachePool:null,transitions:null}}function pt(l,h,L){var q=h.pendingProps,ee=hn.current,ie=!1,ge=(h.flags&128)!==0,Ne;if((Ne=ge)||(Ne=l!==null&&l.memoizedState===null?!1:(ee&2)!==0),Ne?(ie=!0,h.flags&=-129):(l===null||l.memoizedState!==null)&&(ee|=1),rn(hn,ee&1),l===null)return Mt(h),l=h.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((h.mode&1)===0?h.lanes=1:l.data==="$!"?h.lanes=8:h.lanes=1073741824,null):(ge=q.children,l=q.fallback,ie?(q=h.mode,ie=h.child,ge={mode:"hidden",children:ge},(q&1)===0&&ie!==null?(ie.childLanes=0,ie.pendingProps=ge):ie=Xp(ge,q,0,null),l=mf(l,q,L,null),ie.return=h,l.return=h,ie.sibling=l,h.child=ie,h.child.memoizedState=Ke(L),h.memoizedState=ot,l):Ut(h,ge));if(ee=l.memoizedState,ee!==null&&(Ne=ee.dehydrated,Ne!==null))return Cr(l,h,ge,q,Ne,ee,L);if(ie){ie=q.fallback,ge=h.mode,ee=l.child,Ne=ee.sibling;var De={mode:"hidden",children:q.children};return(ge&1)===0&&h.child!==ee?(q=h.child,q.childLanes=0,q.pendingProps=De,h.deletions=null):(q=jc(ee,De),q.subtreeFlags=ee.subtreeFlags&14680064),Ne!==null?ie=jc(Ne,ie):(ie=mf(ie,ge,L,null),ie.flags|=2),ie.return=h,q.return=h,q.sibling=ie,h.child=q,q=ie,ie=h.child,ge=l.child.memoizedState,ge=ge===null?Ke(L):{baseLanes:ge.baseLanes|L,cachePool:null,transitions:ge.transitions},ie.memoizedState=ge,ie.childLanes=l.childLanes&~L,h.memoizedState=ot,q}return ie=l.child,l=ie.sibling,q=jc(ie,{mode:"visible",children:q.children}),(h.mode&1)===0&&(q.lanes=L),q.return=h,q.sibling=null,l!==null&&(L=h.deletions,L===null?(h.deletions=[l],h.flags|=16):L.push(l)),h.child=q,h.memoizedState=null,q}function Ut(l,h){return h=Xp({mode:"visible",children:h},l.mode,0,null),h.return=l,l.child=h}function ur(l,h,L,q){return q!==null&&Yr(q),ci(h,l.child,null,L),l=Ut(h,h.pendingProps.children),l.flags|=2,h.memoizedState=null,l}function Cr(l,h,L,q,ee,ie,ge){if(L)return h.flags&256?(h.flags&=-257,q=Kf(Error(t(422))),ur(l,h,ge,q)):h.memoizedState!==null?(h.child=l.child,h.flags|=128,null):(ie=q.fallback,ee=h.mode,q=Xp({mode:"visible",children:q.children},ee,0,null),ie=mf(ie,ee,ge,null),ie.flags|=2,q.return=h,ie.return=h,q.sibling=ie,h.child=q,(h.mode&1)!==0&&ci(h,l.child,null,ge),h.child.memoizedState=Ke(ge),h.memoizedState=ot,ie);if((h.mode&1)===0)return ur(l,h,ge,null);if(ee.data==="$!"){if(q=ee.nextSibling&&ee.nextSibling.dataset,q)var Ne=q.dgst;return q=Ne,ie=Error(t(419)),q=Kf(ie,q,void 0),ur(l,h,ge,q)}if(Ne=(ge&l.childLanes)!==0,le||Ne){if(q=ka,q!==null){switch(ge&-ge){case 4:ee=2;break;case 16:ee=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:ee=32;break;case 536870912:ee=268435456;break;default:ee=0}ee=(ee&(q.suspendedLanes|ge))!==0?0:ee,ee!==0&&ee!==ie.retryLane&&(ie.retryLane=ee,jr(l,ee),Il(q,l,ee,-1))}return N0(),q=Kf(Error(t(421))),ur(l,h,ge,q)}return ee.data==="$?"?(h.flags|=128,h.child=l.child,h=W_.bind(null,l),ee._reactRetry=h,null):(l=ie.treeContext,Ue=Ui(ee.nextSibling),qe=h,ht=!0,gt=null,l!==null&&(_e[Pe++]=Ze,_e[Pe++]=$e,_e[Pe++]=Fe,Ze=l.id,$e=l.overflow,Fe=h),h=Ut(h,q.children),h.flags|=4096,h)}function wr(l,h,L){l.lanes|=h;var q=l.alternate;q!==null&&(q.lanes|=h),$a(l.return,h,L)}function Hr(l,h,L,q,ee){var ie=l.memoizedState;ie===null?l.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:q,tail:L,tailMode:ee}:(ie.isBackwards=h,ie.rendering=null,ie.renderingStartTime=0,ie.last=q,ie.tail=L,ie.tailMode=ee)}function $i(l,h,L){var q=h.pendingProps,ee=q.revealOrder,ie=q.tail;if(xe(l,h,q.children,L),q=hn.current,(q&2)!==0)q=q&1|2,h.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=h.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&wr(l,L,h);else if(l.tag===19)wr(l,L,h);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===h)break e;for(;l.sibling===null;){if(l.return===null||l.return===h)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}q&=1}if(rn(hn,q),(h.mode&1)===0)h.memoizedState=null;else switch(ee){case"forwards":for(L=h.child,ee=null;L!==null;)l=L.alternate,l!==null&&Xa(l)===null&&(ee=L),L=L.sibling;L=ee,L===null?(ee=h.child,h.child=null):(ee=L.sibling,L.sibling=null),Hr(h,!1,ee,L,ie);break;case"backwards":for(L=null,ee=h.child,h.child=null;ee!==null;){if(l=ee.alternate,l!==null&&Xa(l)===null){h.child=ee;break}l=ee.sibling,ee.sibling=L,L=ee,ee=l}Hr(h,!0,L,null,ie);break;case"together":Hr(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function qr(l,h){(h.mode&1)===0&&l!==null&&(l.alternate=null,h.alternate=null,h.flags|=2)}function Ca(l,h,L){if(l!==null&&(h.dependencies=l.dependencies),df|=h.lanes,(L&h.childLanes)===0)return null;if(l!==null&&h.child!==l.child)throw Error(t(153));if(h.child!==null){for(l=h.child,L=jc(l,l.pendingProps),h.child=L,L.return=h;l.sibling!==null;)l=l.sibling,L=L.sibling=jc(l,l.pendingProps),L.return=h;L.sibling=null}return h.child}function v0(l,h,L){switch(h.tag){case 3:eo(h),yr();break;case 5:bu(h);break;case 1:aa(h.type)&&is(h);break;case 4:qo(h,h.stateNode.containerInfo);break;case 10:var q=h.type._context,ee=h.memoizedProps.value;rn(Gi,q._currentValue),q._currentValue=ee;break;case 13:if(q=h.memoizedState,q!==null)return q.dehydrated!==null?(rn(hn,hn.current&1),h.flags|=128,null):(L&h.child.childLanes)!==0?pt(l,h,L):(rn(hn,hn.current&1),l=Ca(l,h,L),l!==null?l.sibling:null);rn(hn,hn.current&1);break;case 19:if(q=(L&h.childLanes)!==0,(l.flags&128)!==0){if(q)return $i(l,h,L);h.flags|=128}if(ee=h.memoizedState,ee!==null&&(ee.rendering=null,ee.tail=null,ee.lastEffect=null),rn(hn,hn.current),q)break;return null;case 22:case 23:return h.lanes=0,Kt(l,h,L)}return Ca(l,h,L)}var Bm,m0,qm,zm;Bm=function(l,h){for(var L=h.child;L!==null;){if(L.tag===5||L.tag===6)l.appendChild(L.stateNode);else if(L.tag!==4&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===h)break;for(;L.sibling===null;){if(L.return===null||L.return===h)return;L=L.return}L.sibling.return=L.return,L=L.sibling}},m0=function(){},qm=function(l,h,L,q){var ee=l.memoizedProps;if(ee!==q){l=h.stateNode,ei(Qr.current);var ie=null;switch(L){case"input":ee=ke(l,ee),q=ke(l,q),ie=[];break;case"select":ee=W({},ee,{value:void 0}),q=W({},q,{value:void 0}),ie=[];break;case"textarea":ee=he(l,ee),q=he(l,q),ie=[];break;default:typeof ee.onClick!="function"&&typeof q.onClick=="function"&&(l.onclick=Ls)}Be(L,q);var ge;L=null;for(st in ee)if(!q.hasOwnProperty(st)&&ee.hasOwnProperty(st)&&ee[st]!=null)if(st==="style"){var Ne=ee[st];for(ge in Ne)Ne.hasOwnProperty(ge)&&(L||(L={}),L[ge]="")}else st!=="dangerouslySetInnerHTML"&&st!=="children"&&st!=="suppressContentEditableWarning"&&st!=="suppressHydrationWarning"&&st!=="autoFocus"&&(a.hasOwnProperty(st)?ie||(ie=[]):(ie=ie||[]).push(st,null));for(st in q){var De=q[st];if(Ne=ee!=null?ee[st]:void 0,q.hasOwnProperty(st)&&De!==Ne&&(De!=null||Ne!=null))if(st==="style")if(Ne){for(ge in Ne)!Ne.hasOwnProperty(ge)||De&&De.hasOwnProperty(ge)||(L||(L={}),L[ge]="");for(ge in De)De.hasOwnProperty(ge)&&Ne[ge]!==De[ge]&&(L||(L={}),L[ge]=De[ge])}else L||(ie||(ie=[]),ie.push(st,L)),L=De;else st==="dangerouslySetInnerHTML"?(De=De?De.__html:void 0,Ne=Ne?Ne.__html:void 0,De!=null&&Ne!==De&&(ie=ie||[]).push(st,De)):st==="children"?typeof De!="string"&&typeof De!="number"||(ie=ie||[]).push(st,""+De):st!=="suppressContentEditableWarning"&&st!=="suppressHydrationWarning"&&(a.hasOwnProperty(st)?(De!=null&&st==="onScroll"&&cn("scroll",l),ie||Ne===De||(ie=[])):(ie=ie||[]).push(st,De))}L&&(ie=ie||[]).push("style",L);var st=ie;(h.updateQueue=st)&&(h.flags|=4)}},zm=function(l,h,L,q){L!==q&&(h.flags|=4)};function Vh(l,h){if(!ht)switch(l.tailMode){case"hidden":h=l.tail;for(var L=null;h!==null;)h.alternate!==null&&(L=h),h=h.sibling;L===null?l.tail=null:L.sibling=null;break;case"collapsed":L=l.tail;for(var q=null;L!==null;)L.alternate!==null&&(q=L),L=L.sibling;q===null?h||l.tail===null?l.tail=null:l.tail.sibling=null:q.sibling=null}}function bo(l){var h=l.alternate!==null&&l.alternate.child===l.child,L=0,q=0;if(h)for(var ee=l.child;ee!==null;)L|=ee.lanes|ee.childLanes,q|=ee.subtreeFlags&14680064,q|=ee.flags&14680064,ee.return=l,ee=ee.sibling;else for(ee=l.child;ee!==null;)L|=ee.lanes|ee.childLanes,q|=ee.subtreeFlags,q|=ee.flags,ee.return=l,ee=ee.sibling;return l.subtreeFlags|=q,l.childLanes=L,h}function I_(l,h,L){var q=h.pendingProps;switch(Me(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bo(h),null;case 1:return aa(h.type)&&mu(),bo(h),null;case 3:return q=h.stateNode,fn(),Kr(ia),Kr(Ei),sa(),q.pendingContext&&(q.context=q.pendingContext,q.pendingContext=null),(l===null||l.child===null)&&(Dr(h)?h.flags|=4:l===null||l.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,gt!==null&&(C0(gt),gt=null))),m0(l,h),bo(h),null;case 5:Ts(h);var ee=ei(Nn.current);if(L=h.type,l!==null&&h.stateNode!=null)qm(l,h,L,q,ee),l.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!q){if(h.stateNode===null)throw Error(t(166));return bo(h),null}if(l=ei(Qr.current),Dr(h)){q=h.stateNode,L=h.type;var ie=h.memoizedProps;switch(q[po]=h,q[gu]=ie,l=(h.mode&1)!==0,L){case"dialog":cn("cancel",q),cn("close",q);break;case"iframe":case"object":case"embed":cn("load",q);break;case"video":case"audio":for(ee=0;ee<Fo.length;ee++)cn(Fo[ee],q);break;case"source":cn("error",q);break;case"img":case"image":case"link":cn("error",q),cn("load",q);break;case"details":cn("toggle",q);break;case"input":Se(q,ie),cn("invalid",q);break;case"select":q._wrapperState={wasMultiple:!!ie.multiple},cn("invalid",q);break;case"textarea":Re(q,ie),cn("invalid",q)}Be(L,ie),ee=null;for(var ge in ie)if(ie.hasOwnProperty(ge)){var Ne=ie[ge];ge==="children"?typeof Ne=="string"?q.textContent!==Ne&&(ie.suppressHydrationWarning!==!0&&Gu(q.textContent,Ne,l),ee=["children",Ne]):typeof Ne=="number"&&q.textContent!==""+Ne&&(ie.suppressHydrationWarning!==!0&&Gu(q.textContent,Ne,l),ee=["children",""+Ne]):a.hasOwnProperty(ge)&&Ne!=null&&ge==="onScroll"&&cn("scroll",q)}switch(L){case"input":de(q),we(q,ie,!0);break;case"textarea":de(q),Xe(q);break;case"select":case"option":break;default:typeof ie.onClick=="function"&&(q.onclick=Ls)}q=ee,h.updateQueue=q,q!==null&&(h.flags|=4)}else{ge=ee.nodeType===9?ee:ee.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=rt(L)),l==="http://www.w3.org/1999/xhtml"?L==="script"?(l=ge.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof q.is=="string"?l=ge.createElement(L,{is:q.is}):(l=ge.createElement(L),L==="select"&&(ge=l,q.multiple?ge.multiple=!0:q.size&&(ge.size=q.size))):l=ge.createElementNS(l,L),l[po]=h,l[gu]=q,Bm(l,h,!1,!1),h.stateNode=l;e:{switch(ge=Ce(L,q),L){case"dialog":cn("cancel",l),cn("close",l),ee=q;break;case"iframe":case"object":case"embed":cn("load",l),ee=q;break;case"video":case"audio":for(ee=0;ee<Fo.length;ee++)cn(Fo[ee],l);ee=q;break;case"source":cn("error",l),ee=q;break;case"img":case"image":case"link":cn("error",l),cn("load",l),ee=q;break;case"details":cn("toggle",l),ee=q;break;case"input":Se(l,q),ee=ke(l,q),cn("invalid",l);break;case"option":ee=q;break;case"select":l._wrapperState={wasMultiple:!!q.multiple},ee=W({},q,{value:void 0}),cn("invalid",l);break;case"textarea":Re(l,q),ee=he(l,q),cn("invalid",l);break;default:ee=q}Be(L,ee),Ne=ee;for(ie in Ne)if(Ne.hasOwnProperty(ie)){var De=Ne[ie];ie==="style"?Yt(l,De):ie==="dangerouslySetInnerHTML"?(De=De?De.__html:void 0,De!=null&&yt(l,De)):ie==="children"?typeof De=="string"?(L!=="textarea"||De!=="")&&mt(l,De):typeof De=="number"&&mt(l,""+De):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(a.hasOwnProperty(ie)?De!=null&&ie==="onScroll"&&cn("scroll",l):De!=null&&g(l,ie,De,ge))}switch(L){case"input":de(l),we(l,q,!1);break;case"textarea":de(l),Xe(l);break;case"option":q.value!=null&&l.setAttribute("value",""+ae(q.value));break;case"select":l.multiple=!!q.multiple,ie=q.value,ie!=null?Te(l,!!q.multiple,ie,!1):q.defaultValue!=null&&Te(l,!!q.multiple,q.defaultValue,!0);break;default:typeof ee.onClick=="function"&&(l.onclick=Ls)}switch(L){case"button":case"input":case"select":case"textarea":q=!!q.autoFocus;break e;case"img":q=!0;break e;default:q=!1}}q&&(h.flags|=4)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return bo(h),null;case 6:if(l&&h.stateNode!=null)zm(l,h,l.memoizedProps,q);else{if(typeof q!="string"&&h.stateNode===null)throw Error(t(166));if(L=ei(Nn.current),ei(Qr.current),Dr(h)){if(q=h.stateNode,L=h.memoizedProps,q[po]=h,(ie=q.nodeValue!==L)&&(l=qe,l!==null))switch(l.tag){case 3:Gu(q.nodeValue,L,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Gu(q.nodeValue,L,(l.mode&1)!==0)}ie&&(h.flags|=4)}else q=(L.nodeType===9?L:L.ownerDocument).createTextNode(q),q[po]=h,h.stateNode=q}return bo(h),null;case 13:if(Kr(hn),q=h.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ht&&Ue!==null&&(h.mode&1)!==0&&(h.flags&128)===0)Nr(),yr(),h.flags|=98560,ie=!1;else if(ie=Dr(h),q!==null&&q.dehydrated!==null){if(l===null){if(!ie)throw Error(t(318));if(ie=h.memoizedState,ie=ie!==null?ie.dehydrated:null,!ie)throw Error(t(317));ie[po]=h}else yr(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;bo(h),ie=!1}else gt!==null&&(C0(gt),gt=null),ie=!0;if(!ie)return h.flags&65536?h:null}return(h.flags&128)!==0?(h.lanes=L,h):(q=q!==null,q!==(l!==null&&l.memoizedState!==null)&&q&&(h.child.flags|=8192,(h.mode&1)!==0&&(l===null||(hn.current&1)!==0?ma===0&&(ma=3):N0())),h.updateQueue!==null&&(h.flags|=4),bo(h),null);case 4:return fn(),m0(l,h),l===null&&ks(h.stateNode.containerInfo),bo(h),null;case 10:return pa(h.type._context),bo(h),null;case 17:return aa(h.type)&&mu(),bo(h),null;case 19:if(Kr(hn),ie=h.memoizedState,ie===null)return bo(h),null;if(q=(h.flags&128)!==0,ge=ie.rendering,ge===null)if(q)Vh(ie,!1);else{if(ma!==0||l!==null&&(l.flags&128)!==0)for(l=h.child;l!==null;){if(ge=Xa(l),ge!==null){for(h.flags|=128,Vh(ie,!1),q=ge.updateQueue,q!==null&&(h.updateQueue=q,h.flags|=4),h.subtreeFlags=0,q=L,L=h.child;L!==null;)ie=L,l=q,ie.flags&=14680066,ge=ie.alternate,ge===null?(ie.childLanes=0,ie.lanes=l,ie.child=null,ie.subtreeFlags=0,ie.memoizedProps=null,ie.memoizedState=null,ie.updateQueue=null,ie.dependencies=null,ie.stateNode=null):(ie.childLanes=ge.childLanes,ie.lanes=ge.lanes,ie.child=ge.child,ie.subtreeFlags=0,ie.deletions=null,ie.memoizedProps=ge.memoizedProps,ie.memoizedState=ge.memoizedState,ie.updateQueue=ge.updateQueue,ie.type=ge.type,l=ge.dependencies,ie.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),L=L.sibling;return rn(hn,hn.current&1|2),h.child}l=l.sibling}ie.tail!==null&&Mn()>Jf&&(h.flags|=128,q=!0,Vh(ie,!1),h.lanes=4194304)}else{if(!q)if(l=Xa(ge),l!==null){if(h.flags|=128,q=!0,L=l.updateQueue,L!==null&&(h.updateQueue=L,h.flags|=4),Vh(ie,!0),ie.tail===null&&ie.tailMode==="hidden"&&!ge.alternate&&!ht)return bo(h),null}else 2*Mn()-ie.renderingStartTime>Jf&&L!==1073741824&&(h.flags|=128,q=!0,Vh(ie,!1),h.lanes=4194304);ie.isBackwards?(ge.sibling=h.child,h.child=ge):(L=ie.last,L!==null?L.sibling=ge:h.child=ge,ie.last=ge)}return ie.tail!==null?(h=ie.tail,ie.rendering=h,ie.tail=h.sibling,ie.renderingStartTime=Mn(),h.sibling=null,L=hn.current,rn(hn,q?L&1|2:L&1),h):(bo(h),null);case 22:case 23:return L0(),q=h.memoizedState!==null,l!==null&&l.memoizedState!==null!==q&&(h.flags|=8192),q&&(h.mode&1)!==0?(Ms&1073741824)!==0&&(bo(h),h.subtreeFlags&6&&(h.flags|=8192)):bo(h),null;case 24:return null;case 25:return null}throw Error(t(156,h.tag))}function j_(l,h){switch(Me(h),h.tag){case 1:return aa(h.type)&&mu(),l=h.flags,l&65536?(h.flags=l&-65537|128,h):null;case 3:return fn(),Kr(ia),Kr(Ei),sa(),l=h.flags,(l&65536)!==0&&(l&128)===0?(h.flags=l&-65537|128,h):null;case 5:return Ts(h),null;case 13:if(Kr(hn),l=h.memoizedState,l!==null&&l.dehydrated!==null){if(h.alternate===null)throw Error(t(340));yr()}return l=h.flags,l&65536?(h.flags=l&-65537|128,h):null;case 19:return Kr(hn),null;case 4:return fn(),null;case 10:return pa(h.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var Dp=!1,wo=!1,F_=typeof WeakSet=="function"?WeakSet:Set,Qt=null;function Zf(l,h){var L=l.ref;if(L!==null)if(typeof L=="function")try{L(null)}catch(q){Ai(l,h,q)}else L.current=null}function y0(l,h,L){try{L()}catch(q){Ai(l,h,q)}}var Um=!1;function D_(l,h){if(Wu=su,l=Xn(),ts(l)){if("selectionStart"in l)var L={start:l.selectionStart,end:l.selectionEnd};else e:{L=(L=l.ownerDocument)&&L.defaultView||window;var q=L.getSelection&&L.getSelection();if(q&&q.rangeCount!==0){L=q.anchorNode;var ee=q.anchorOffset,ie=q.focusNode;q=q.focusOffset;try{L.nodeType,ie.nodeType}catch{L=null;break e}var ge=0,Ne=-1,De=-1,st=0,Et=0,At=l,xt=null;t:for(;;){for(var Wt;At!==L||ee!==0&&At.nodeType!==3||(Ne=ge+ee),At!==ie||q!==0&&At.nodeType!==3||(De=ge+q),At.nodeType===3&&(ge+=At.nodeValue.length),(Wt=At.firstChild)!==null;)xt=At,At=Wt;for(;;){if(At===l)break t;if(xt===L&&++st===ee&&(Ne=ge),xt===ie&&++Et===q&&(De=ge),(Wt=At.nextSibling)!==null)break;At=xt,xt=At.parentNode}At=Wt}L=Ne===-1||De===-1?null:{start:Ne,end:De}}else L=null}L=L||{start:0,end:0}}else L=null;for(Ol={focusedElem:l,selectionRange:L},su=!1,Qt=h;Qt!==null;)if(h=Qt,l=h.child,(h.subtreeFlags&1028)!==0&&l!==null)l.return=h,Qt=l;else for(;Qt!==null;){h=Qt;try{var tr=h.alternate;if((h.flags&1024)!==0)switch(h.tag){case 0:case 11:case 15:break;case 1:if(tr!==null){var or=tr.memoizedProps,Yi=tr.memoizedState,tt=h.stateNode,Ve=tt.getSnapshotBeforeUpdate(h.elementType===h.type?or:va(h.type,or),Yi);tt.__reactInternalSnapshotBeforeUpdate=Ve}break;case 3:var at=h.stateNode.containerInfo;at.nodeType===1?at.textContent="":at.nodeType===9&&at.documentElement&&at.removeChild(at.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Tt){Ai(h,h.return,Tt)}if(l=h.sibling,l!==null){l.return=h.return,Qt=l;break}Qt=h.return}return tr=Um,Um=!1,tr}function Gh(l,h,L){var q=h.updateQueue;if(q=q!==null?q.lastEffect:null,q!==null){var ee=q=q.next;do{if((ee.tag&l)===l){var ie=ee.destroy;ee.destroy=void 0,ie!==void 0&&y0(h,L,ie)}ee=ee.next}while(ee!==q)}}function Bp(l,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var L=h=h.next;do{if((L.tag&l)===l){var q=L.create;L.destroy=q()}L=L.next}while(L!==h)}}function b0(l){var h=l.ref;if(h!==null){var L=l.stateNode;switch(l.tag){case 5:l=L;break;default:l=L}typeof h=="function"?h(l):h.current=l}}function Hm(l){var h=l.alternate;h!==null&&(l.alternate=null,Hm(h)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(h=l.stateNode,h!==null&&(delete h[po],delete h[gu],delete h[da],delete h[Hf],delete h[Vf])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Vm(l){return l.tag===5||l.tag===3||l.tag===4}function Gm(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Vm(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function w0(l,h,L){var q=l.tag;if(q===5||q===6)l=l.stateNode,h?L.nodeType===8?L.parentNode.insertBefore(l,h):L.insertBefore(l,h):(L.nodeType===8?(h=L.parentNode,h.insertBefore(l,L)):(h=L,h.appendChild(l)),L=L._reactRootContainer,L!=null||h.onclick!==null||(h.onclick=Ls));else if(q!==4&&(l=l.child,l!==null))for(w0(l,h,L),l=l.sibling;l!==null;)w0(l,h,L),l=l.sibling}function _0(l,h,L){var q=l.tag;if(q===5||q===6)l=l.stateNode,h?L.insertBefore(l,h):L.appendChild(l);else if(q!==4&&(l=l.child,l!==null))for(_0(l,h,L),l=l.sibling;l!==null;)_0(l,h,L),l=l.sibling}var to=null,Rl=!1;function Nc(l,h,L){for(L=L.child;L!==null;)Wm(l,h,L),L=L.sibling}function Wm(l,h,L){if(di&&typeof di.onCommitFiberUnmount=="function")try{di.onCommitFiberUnmount(so,L)}catch{}switch(L.tag){case 5:wo||Zf(L,h);case 6:var q=to,ee=Rl;to=null,Nc(l,h,L),to=q,Rl=ee,to!==null&&(Rl?(l=to,L=L.stateNode,l.nodeType===8?l.parentNode.removeChild(L):l.removeChild(L)):to.removeChild(L.stateNode));break;case 18:to!==null&&(Rl?(l=to,L=L.stateNode,l.nodeType===8?_c(l.parentNode,L):l.nodeType===1&&_c(l,L),ai(l)):_c(to,L.stateNode));break;case 4:q=to,ee=Rl,to=L.stateNode.containerInfo,Rl=!0,Nc(l,h,L),to=q,Rl=ee;break;case 0:case 11:case 14:case 15:if(!wo&&(q=L.updateQueue,q!==null&&(q=q.lastEffect,q!==null))){ee=q=q.next;do{var ie=ee,ge=ie.destroy;ie=ie.tag,ge!==void 0&&((ie&2)!==0||(ie&4)!==0)&&y0(L,h,ge),ee=ee.next}while(ee!==q)}Nc(l,h,L);break;case 1:if(!wo&&(Zf(L,h),q=L.stateNode,typeof q.componentWillUnmount=="function"))try{q.props=L.memoizedProps,q.state=L.memoizedState,q.componentWillUnmount()}catch(Ne){Ai(L,h,Ne)}Nc(l,h,L);break;case 21:Nc(l,h,L);break;case 22:L.mode&1?(wo=(q=wo)||L.memoizedState!==null,Nc(l,h,L),wo=q):Nc(l,h,L);break;default:Nc(l,h,L)}}function $m(l){var h=l.updateQueue;if(h!==null){l.updateQueue=null;var L=l.stateNode;L===null&&(L=l.stateNode=new F_),h.forEach(function(q){var ee=$_.bind(null,l,q);L.has(q)||(L.add(q),q.then(ee,ee))})}}function Ml(l,h){var L=h.deletions;if(L!==null)for(var q=0;q<L.length;q++){var ee=L[q];try{var ie=l,ge=h,Ne=ge;e:for(;Ne!==null;){switch(Ne.tag){case 5:to=Ne.stateNode,Rl=!1;break e;case 3:to=Ne.stateNode.containerInfo,Rl=!0;break e;case 4:to=Ne.stateNode.containerInfo,Rl=!0;break e}Ne=Ne.return}if(to===null)throw Error(t(160));Wm(ie,ge,ee),to=null,Rl=!1;var De=ee.alternate;De!==null&&(De.return=null),ee.return=null}catch(st){Ai(ee,h,st)}}if(h.subtreeFlags&12854)for(h=h.child;h!==null;)Ym(h,l),h=h.sibling}function Ym(l,h){var L=l.alternate,q=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ml(h,l),Pu(l),q&4){try{Gh(3,l,l.return),Bp(3,l)}catch(or){Ai(l,l.return,or)}try{Gh(5,l,l.return)}catch(or){Ai(l,l.return,or)}}break;case 1:Ml(h,l),Pu(l),q&512&&L!==null&&Zf(L,L.return);break;case 5:if(Ml(h,l),Pu(l),q&512&&L!==null&&Zf(L,L.return),l.flags&32){var ee=l.stateNode;try{mt(ee,"")}catch(or){Ai(l,l.return,or)}}if(q&4&&(ee=l.stateNode,ee!=null)){var ie=l.memoizedProps,ge=L!==null?L.memoizedProps:ie,Ne=l.type,De=l.updateQueue;if(l.updateQueue=null,De!==null)try{Ne==="input"&&ie.type==="radio"&&ie.name!=null&&ye(ee,ie),Ce(Ne,ge);var st=Ce(Ne,ie);for(ge=0;ge<De.length;ge+=2){var Et=De[ge],At=De[ge+1];Et==="style"?Yt(ee,At):Et==="dangerouslySetInnerHTML"?yt(ee,At):Et==="children"?mt(ee,At):g(ee,Et,At,st)}switch(Ne){case"input":Je(ee,ie);break;case"textarea":Ie(ee,ie);break;case"select":var xt=ee._wrapperState.wasMultiple;ee._wrapperState.wasMultiple=!!ie.multiple;var Wt=ie.value;Wt!=null?Te(ee,!!ie.multiple,Wt,!1):xt!==!!ie.multiple&&(ie.defaultValue!=null?Te(ee,!!ie.multiple,ie.defaultValue,!0):Te(ee,!!ie.multiple,ie.multiple?[]:"",!1))}ee[gu]=ie}catch(or){Ai(l,l.return,or)}}break;case 6:if(Ml(h,l),Pu(l),q&4){if(l.stateNode===null)throw Error(t(162));ee=l.stateNode,ie=l.memoizedProps;try{ee.nodeValue=ie}catch(or){Ai(l,l.return,or)}}break;case 3:if(Ml(h,l),Pu(l),q&4&&L!==null&&L.memoizedState.isDehydrated)try{ai(h.containerInfo)}catch(or){Ai(l,l.return,or)}break;case 4:Ml(h,l),Pu(l);break;case 13:Ml(h,l),Pu(l),ee=l.child,ee.flags&8192&&(ie=ee.memoizedState!==null,ee.stateNode.isHidden=ie,!ie||ee.alternate!==null&&ee.alternate.memoizedState!==null||(E0=Mn())),q&4&&$m(l);break;case 22:if(Et=L!==null&&L.memoizedState!==null,l.mode&1?(wo=(st=wo)||Et,Ml(h,l),wo=st):Ml(h,l),Pu(l),q&8192){if(st=l.memoizedState!==null,(l.stateNode.isHidden=st)&&!Et&&(l.mode&1)!==0)for(Qt=l,Et=l.child;Et!==null;){for(At=Qt=Et;Qt!==null;){switch(xt=Qt,Wt=xt.child,xt.tag){case 0:case 11:case 14:case 15:Gh(4,xt,xt.return);break;case 1:Zf(xt,xt.return);var tr=xt.stateNode;if(typeof tr.componentWillUnmount=="function"){q=xt,L=xt.return;try{h=q,tr.props=h.memoizedProps,tr.state=h.memoizedState,tr.componentWillUnmount()}catch(or){Ai(q,L,or)}}break;case 5:Zf(xt,xt.return);break;case 22:if(xt.memoizedState!==null){Zm(At);continue}}Wt!==null?(Wt.return=xt,Qt=Wt):Zm(At)}Et=Et.sibling}e:for(Et=null,At=l;;){if(At.tag===5){if(Et===null){Et=At;try{ee=At.stateNode,st?(ie=ee.style,typeof ie.setProperty=="function"?ie.setProperty("display","none","important"):ie.display="none"):(Ne=At.stateNode,De=At.memoizedProps.style,ge=De!=null&&De.hasOwnProperty("display")?De.display:null,Ne.style.display=Pt("display",ge))}catch(or){Ai(l,l.return,or)}}}else if(At.tag===6){if(Et===null)try{At.stateNode.nodeValue=st?"":At.memoizedProps}catch(or){Ai(l,l.return,or)}}else if((At.tag!==22&&At.tag!==23||At.memoizedState===null||At===l)&&At.child!==null){At.child.return=At,At=At.child;continue}if(At===l)break e;for(;At.sibling===null;){if(At.return===null||At.return===l)break e;Et===At&&(Et=null),At=At.return}Et===At&&(Et=null),At.sibling.return=At.return,At=At.sibling}}break;case 19:Ml(h,l),Pu(l),q&4&&$m(l);break;case 21:break;default:Ml(h,l),Pu(l)}}function Pu(l){var h=l.flags;if(h&2){try{e:{for(var L=l.return;L!==null;){if(Vm(L)){var q=L;break e}L=L.return}throw Error(t(160))}switch(q.tag){case 5:var ee=q.stateNode;q.flags&32&&(mt(ee,""),q.flags&=-33);var ie=Gm(l);_0(l,ie,ee);break;case 3:case 4:var ge=q.stateNode.containerInfo,Ne=Gm(l);w0(l,Ne,ge);break;default:throw Error(t(161))}}catch(De){Ai(l,l.return,De)}l.flags&=-3}h&4096&&(l.flags&=-4097)}function B_(l,h,L){Qt=l,Xm(l)}function Xm(l,h,L){for(var q=(l.mode&1)!==0;Qt!==null;){var ee=Qt,ie=ee.child;if(ee.tag===22&&q){var ge=ee.memoizedState!==null||Dp;if(!ge){var Ne=ee.alternate,De=Ne!==null&&Ne.memoizedState!==null||wo;Ne=Dp;var st=wo;if(Dp=ge,(wo=De)&&!st)for(Qt=ee;Qt!==null;)ge=Qt,De=ge.child,ge.tag===22&&ge.memoizedState!==null?Qm(ee):De!==null?(De.return=ge,Qt=De):Qm(ee);for(;ie!==null;)Qt=ie,Xm(ie),ie=ie.sibling;Qt=ee,Dp=Ne,wo=st}Km(l)}else(ee.subtreeFlags&8772)!==0&&ie!==null?(ie.return=ee,Qt=ie):Km(l)}}function Km(l){for(;Qt!==null;){var h=Qt;if((h.flags&8772)!==0){var L=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:wo||Bp(5,h);break;case 1:var q=h.stateNode;if(h.flags&4&&!wo)if(L===null)q.componentDidMount();else{var ee=h.elementType===h.type?L.memoizedProps:va(h.type,L.memoizedProps);q.componentDidUpdate(ee,L.memoizedState,q.__reactInternalSnapshotBeforeUpdate)}var ie=h.updateQueue;ie!==null&&vn(h,ie,q);break;case 3:var ge=h.updateQueue;if(ge!==null){if(L=null,h.child!==null)switch(h.child.tag){case 5:L=h.child.stateNode;break;case 1:L=h.child.stateNode}vn(h,ge,L)}break;case 5:var Ne=h.stateNode;if(L===null&&h.flags&4){L=Ne;var De=h.memoizedProps;switch(h.type){case"button":case"input":case"select":case"textarea":De.autoFocus&&L.focus();break;case"img":De.src&&(L.src=De.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(h.memoizedState===null){var st=h.alternate;if(st!==null){var Et=st.memoizedState;if(Et!==null){var At=Et.dehydrated;At!==null&&ai(At)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}wo||h.flags&512&&b0(h)}catch(xt){Ai(h,h.return,xt)}}if(h===l){Qt=null;break}if(L=h.sibling,L!==null){L.return=h.return,Qt=L;break}Qt=h.return}}function Zm(l){for(;Qt!==null;){var h=Qt;if(h===l){Qt=null;break}var L=h.sibling;if(L!==null){L.return=h.return,Qt=L;break}Qt=h.return}}function Qm(l){for(;Qt!==null;){var h=Qt;try{switch(h.tag){case 0:case 11:case 15:var L=h.return;try{Bp(4,h)}catch(De){Ai(h,L,De)}break;case 1:var q=h.stateNode;if(typeof q.componentDidMount=="function"){var ee=h.return;try{q.componentDidMount()}catch(De){Ai(h,ee,De)}}var ie=h.return;try{b0(h)}catch(De){Ai(h,ie,De)}break;case 5:var ge=h.return;try{b0(h)}catch(De){Ai(h,ge,De)}}}catch(De){Ai(h,h.return,De)}if(h===l){Qt=null;break}var Ne=h.sibling;if(Ne!==null){Ne.return=h.return,Qt=Ne;break}Qt=h.return}}var q_=Math.ceil,qp=E.ReactCurrentDispatcher,S0=E.ReactCurrentOwner,ll=E.ReactCurrentBatchConfig,an=0,ka=null,ua=null,ro=0,Ms=0,Qf=go(0),ma=0,Wh=null,df=0,zp=0,x0=0,$h=null,cs=null,E0=0,Jf=1/0,Ju=null,Up=!1,P0=null,Tc=null,Hp=!1,Rc=null,Vp=0,Yh=0,O0=null,Gp=-1,Wp=0;function Ho(){return(an&6)!==0?Mn():Gp!==-1?Gp:Gp=Mn()}function Mc(l){return(l.mode&1)===0?1:(an&2)!==0&&ro!==0?ro&-ro:Zr.transition!==null?(Wp===0&&(Wp=nu()),Wp):(l=Rr,l!==0||(l=window.event,l=l===void 0?16:Uu(l.type)),l)}function Il(l,h,L,q){if(50<Yh)throw Yh=0,O0=null,Error(t(185));Gs(l,L,q),((an&2)===0||l!==ka)&&(l===ka&&((an&2)===0&&(zp|=L),ma===4&&Ic(l,ro)),fs(l,q),L===1&&an===0&&(h.mode&1)===0&&(Jf=Mn()+500,Cl&&oe()))}function fs(l,h){var L=l.callbackNode;fa(l,h);var q=Ri(l,l===ka?ro:0);if(q===0)L!==null&&Go(L),l.callbackNode=null,l.callbackPriority=0;else if(h=q&-q,l.callbackPriority!==h){if(L!=null&&Go(L),h===1)l.tag===0?re(ey.bind(null,l)):H(ey.bind(null,l)),zf(function(){(an&6)===0&&oe()}),L=null;else{switch(Ss(q)){case 1:L=oo;break;case 4:L=dl;break;case 16:L=Vs;break;case 536870912:L=ru;break;default:L=Vs}L=ly(L,Jm.bind(null,l))}l.callbackPriority=h,l.callbackNode=L}}function Jm(l,h){if(Gp=-1,Wp=0,(an&6)!==0)throw Error(t(327));var L=l.callbackNode;if(eh()&&l.callbackNode!==L)return null;var q=Ri(l,l===ka?ro:0);if(q===0)return null;if((q&30)!==0||(q&l.expiredLanes)!==0||h)h=$p(l,q);else{h=q;var ee=an;an|=2;var ie=ry();(ka!==l||ro!==h)&&(Ju=null,Jf=Mn()+500,gf(l,h));do try{H_();break}catch(Ne){ty(l,Ne)}while(!0);Pi(),qp.current=ie,an=ee,ua!==null?h=0:(ka=null,ro=0,h=ma)}if(h!==0){if(h===2&&(ee=Wo(l),ee!==0&&(q=ee,h=A0(l,ee))),h===1)throw L=Wh,gf(l,0),Ic(l,q),fs(l,Mn()),L;if(h===6)Ic(l,q);else{if(ee=l.current.alternate,(q&30)===0&&!z_(ee)&&(h=$p(l,q),h===2&&(ie=Wo(l),ie!==0&&(q=ie,h=A0(l,ie))),h===1))throw L=Wh,gf(l,0),Ic(l,q),fs(l,Mn()),L;switch(l.finishedWork=ee,l.finishedLanes=q,h){case 0:case 1:throw Error(t(345));case 2:vf(l,cs,Ju);break;case 3:if(Ic(l,q),(q&130023424)===q&&(h=E0+500-Mn(),10<h)){if(Ri(l,0)!==0)break;if(ee=l.suspendedLanes,(ee&q)!==q){Ho(),l.pingedLanes|=l.suspendedLanesⅇbreak}l.timeoutHandle=Wa(vf.bind(null,l,cs,Ju),h);break}vf(l,cs,Ju);break;case 4:if(Ic(l,q),(q&4194240)===q)break;for(h=l.eventTimes,ee=-1;0<q;){var ge=31-Ar(q);ie=1<<ge,ge=h[ge],ge>ee&&(ee=ge),q&=~ie}if(q=ee,q=Mn()-q,q=(120>q?120:480>q?480:1080>q?1080:1920>q?1920:3e3>q?3e3:4320>q?4320:1960*q_(q/1960))-q,10<q){l.timeoutHandle=Wa(vf.bind(null,l,cs,Ju),q);break}vf(l,cs,Ju);break;case 5:vf(l,cs,Ju);break;default:throw Error(t(329))}}}return fs(l,Mn()),l.callbackNode===L?Jm.bind(null,l):null}function A0(l,h){var L=$h;return l.current.memoizedState.isDehydrated&&(gf(l,h).flags|=256),l=$p(l,h),l!==2&&(h=cs,cs=L,h!==null&&C0(h)),l}function C0(l){cs===null?cs=l:cs.push.apply(cs,l)}function z_(l){for(var h=l;;){if(h.flags&16384){var L=h.updateQueue;if(L!==null&&(L=L.stores,L!==null))for(var q=0;q<L.length;q++){var ee=L[q],ie=ee.getSnapshot;ee=ee.value;try{if(!Mr(ie(),ee))return!1}catch{return!1}}}if(L=h.child,h.subtreeFlags&16384&&L!==null)L.return=h,h=L;else{if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function Ic(l,h){for(h&=~x0,h&=~zp,l.suspendedLanes|=h,l.pingedLanes&=~h,l=l.expirationTimes;0<h;){var L=31-Ar(h),q=1<<L;l[L]=-1,h&=~q}}function ey(l){if((an&6)!==0)throw Error(t(327));eh();var h=Ri(l,0);if((h&1)===0)return fs(l,Mn()),null;var L=$p(l,h);if(l.tag!==0&&L===2){var q=Wo(l);q!==0&&(h=q,L=A0(l,q))}if(L===1)throw L=Wh,gf(l,0),Ic(l,h),fs(l,Mn()),L;if(L===6)throw Error(t(345));return l.finishedWork=l.current.alternate,l.finishedLanes=h,vf(l,cs,Ju),fs(l,Mn()),null}function k0(l,h){var L=an;an|=1;try{return l(h)}finally{an=L,an===0&&(Jf=Mn()+500,Cl&&oe())}}function pf(l){Rc!==null&&Rc.tag===0&&(an&6)===0&&eh();var h=an;an|=1;var L=ll.transition,q=Rr;try{if(ll.transition=null,Rr=1,l)return l()}finally{Rr=q,ll.transition=L,an=h,(an&6)===0&&oe()}}function L0(){Ms=Qf.current,Kr(Qf)}function gf(l,h){l.finishedWork=null,l.finishedLanes=0;var L=l.timeoutHandle;if(L!==-1&&(l.timeoutHandle=-1,wc(L)),ua!==null)for(L=ua.return;L!==null;){var q=L;switch(Me(q),q.tag){case 1:q=q.type.childContextTypes,q!=null&&mu();break;case 3:fn(),Kr(ia),Kr(Ei),sa();break;case 5:Ts(q);break;case 4:fn();break;case 13:Kr(hn);break;case 19:Kr(hn);break;case 10:pa(q.type._context);break;case 22:case 23:L0()}L=L.return}if(ka=l,ua=l=jc(l.current,null),ro=Ms=h,ma=0,Wh=null,x0=zp=df=0,cs=$h=null,oa!==null){for(h=0;h<oa.length;h++)if(L=oa[h],q=L.interleaved,q!==null){L.interleaved=null;var ee=q.next,ie=L.pending;if(ie!==null){var ge=ie.next;ie.next=ee,q.next=ge}L.pending=q}oa=null}return l}function ty(l,h){do{var L=ua;try{if(Pi(),wu.current=Ac,Ka){for(var q=nn.memoizedState;q!==null;){var ee=q.queue;ee!==null&&(ee.pending=null),q=q.next}Ka=!1}if(Oi=0,Un=zn=nn=null,yo=!1,Za=0,S0.current=null,L===null||L.return===null){ma=1,Wh=h,ua=null;break}e:{var ie=l,ge=L.return,Ne=L,De=h;if(h=ro,Ne.flags|=32768,De!==null&&typeof De=="object"&&typeof De.then=="function"){var st=De,Et=Ne,At=Et.tag;if((Et.mode&1)===0&&(At===0||At===11||At===15)){var xt=Et.alternate;xt?(Et.updateQueue=xt.updateQueue,Et.memoizedState=xt.memoizedState,Et.lanes=xt.lanes):(Et.updateQueue=null,Et.memoizedState=null)}var Wt=B(ge);if(Wt!==null){Wt.flags&=-257,K(Wt,ge,Ne,ie,h),Wt.mode&1&&P(ie,st,h),h=Wt,De=st;var tr=h.updateQueue;if(tr===null){var or=new Set;or.add(De),h.updateQueue=or}else tr.add(De);break e}else{if((h&1)===0){P(ie,st,h),N0();break e}De=Error(t(426))}}else if(ht&&Ne.mode&1){var Yi=B(ge);if(Yi!==null){(Yi.flags&65536)===0&&(Yi.flags|=256),K(Yi,ge,Ne,ie,h),Yr(Qu(De,Ne));break e}}ie=De=Qu(De,Ne),ma!==4&&(ma=2),$h===null?$h=[ie]:$h.push(ie),ie=ge;do{switch(ie.tag){case 3:ie.flags|=65536,h&=-h,ie.lanes|=h;var tt=Fp(ie,De,h);ga(ie,tt);break e;case 1:Ne=De;var Ve=ie.type,at=ie.stateNode;if((ie.flags&128)===0&&(typeof Ve.getDerivedStateFromError=="function"||at!==null&&typeof at.componentDidCatch=="function"&&(Tc===null||!Tc.has(at)))){ie.flags|=65536,h&=-h,ie.lanes|=h;var Tt=m(ie,Ne,h);ga(ie,Tt);break e}}ie=ie.return}while(ie!==null)}iy(L)}catch(sr){h=sr,ua===L&&L!==null&&(ua=L=L.return);continue}break}while(!0)}function ry(){var l=qp.current;return qp.current=Ac,l===null?Ac:l}function N0(){(ma===0||ma===3||ma===2)&&(ma=4),ka===null||(df&268435455)===0&&(zp&268435455)===0||Ic(ka,ro)}function $p(l,h){var L=an;an|=2;var q=ry();(ka!==l||ro!==h)&&(Ju=null,gf(l,h));do try{U_();break}catch(ee){ty(l,ee)}while(!0);if(Pi(),an=L,qp.current=q,ua!==null)throw Error(t(261));return ka=null,ro=0,ma}function U_(){for(;ua!==null;)ny(ua)}function H_(){for(;ua!==null&&!tu();)ny(ua)}function ny(l){var h=sy(l.alternate,l,Ms);l.memoizedProps=l.pendingProps,h===null?iy(l):ua=h,S0.current=null}function iy(l){var h=l;do{var L=h.alternate;if(l=h.return,(h.flags&32768)===0){if(L=I_(L,h,Ms),L!==null){ua=L;return}}else{if(L=j_(L,h),L!==null){L.flags&=32767,ua=L;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{ma=6,ua=null;return}}if(h=h.sibling,h!==null){ua=h;return}ua=h=l}while(h!==null);ma===0&&(ma=5)}function vf(l,h,L){var q=Rr,ee=ll.transition;try{ll.transition=null,Rr=1,V_(l,h,L,q)}finally{ll.transition=ee,Rr=q}return null}function V_(l,h,L,q){do eh();while(Rc!==null);if((an&6)!==0)throw Error(t(327));L=l.finishedWork;var ee=l.finishedLanes;if(L===null)return null;if(l.finishedWork=null,l.finishedLanes=0,L===l.current)throw Error(t(177));l.callbackNode=null,l.callbackPriority=0;var ie=L.lanes|L.childLanes;if(af(l,ie),l===ka&&(ua=ka=null,ro=0),(L.subtreeFlags&2064)===0&&(L.flags&2064)===0||Hp||(Hp=!0,ly(Vs,function(){return eh(),null})),ie=(L.flags&15990)!==0,(L.subtreeFlags&15990)!==0||ie){ie=ll.transition,ll.transition=null;var ge=Rr;Rr=1;var Ne=an;an|=4,S0.current=null,D_(l,L),Ym(L,l),No(Ol),su=!!Wu,Ol=Wu=null,l.current=L,B_(L),mc(),an=Ne,Rr=ge,ll.transition=ie}else l.current=L;if(Hp&&(Hp=!1,Rc=l,Vp=ee),ie=l.pendingLanes,ie===0&&(Tc=null),Xr(L.stateNode),fs(l,Mn()),h!==null)for(q=l.onRecoverableError,L=0;L<h.length;L++)ee=h[L],q(ee.value,{componentStack:ee.stack,digest:ee.digest});if(Up)throw Up=!1,l=P0,P0=null,l;return(Vp&1)!==0&&l.tag!==0&&eh(),ie=l.pendingLanes,(ie&1)!==0?l===O0?Yh++:(Yh=0,O0=l):Yh=0,oe(),null}function eh(){if(Rc!==null){var l=Ss(Vp),h=ll.transition,L=Rr;try{if(ll.transition=null,Rr=16>l?16:l,Rc===null)var q=!1;else{if(l=Rc,Rc=null,Vp=0,(an&6)!==0)throw Error(t(331));var ee=an;for(an|=4,Qt=l.current;Qt!==null;){var ie=Qt,ge=ie.child;if((Qt.flags&16)!==0){var Ne=ie.deletions;if(Ne!==null){for(var De=0;De<Ne.length;De++){var st=Ne[De];for(Qt=st;Qt!==null;){var Et=Qt;switch(Et.tag){case 0:case 11:case 15:Gh(8,Et,ie)}var At=Et.child;if(At!==null)At.return=Et,Qt=At;else for(;Qt!==null;){Et=Qt;var xt=Et.sibling,Wt=Et.return;if(Hm(Et),Et===st){Qt=null;break}if(xt!==null){xt.return=Wt,Qt=xt;break}Qt=Wt}}}var tr=ie.alternate;if(tr!==null){var or=tr.child;if(or!==null){tr.child=null;do{var Yi=or.sibling;or.sibling=null,or=Yi}while(or!==null)}}Qt=ie}}if((ie.subtreeFlags&2064)!==0&&ge!==null)ge.return=ie,Qt=ge;else e:for(;Qt!==null;){if(ie=Qt,(ie.flags&2048)!==0)switch(ie.tag){case 0:case 11:case 15:Gh(9,ie,ie.return)}var tt=ie.sibling;if(tt!==null){tt.return=ie.return,Qt=tt;break e}Qt=ie.return}}var Ve=l.current;for(Qt=Ve;Qt!==null;){ge=Qt;var at=ge.child;if((ge.subtreeFlags&2064)!==0&&at!==null)at.return=ge,Qt=at;else e:for(ge=Ve;Qt!==null;){if(Ne=Qt,(Ne.flags&2048)!==0)try{switch(Ne.tag){case 0:case 11:case 15:Bp(9,Ne)}}catch(sr){Ai(Ne,Ne.return,sr)}if(Ne===ge){Qt=null;break e}var Tt=Ne.sibling;if(Tt!==null){Tt.return=Ne.return,Qt=Tt;break e}Qt=Ne.return}}if(an=ee,oe(),di&&typeof di.onPostCommitFiberRoot=="function")try{di.onPostCommitFiberRoot(so,l)}catch{}q=!0}return q}finally{Rr=L,ll.transition=h}}return!1}function ay(l,h,L){h=Qu(L,h),h=Fp(l,h,1),l=Oa(l,h,1),h=Ho(),l!==null&&(Gs(l,1,h),fs(l,h))}function Ai(l,h,L){if(l.tag===3)ay(l,l,L);else for(;h!==null;){if(h.tag===3){ay(h,l,L);break}else if(h.tag===1){var q=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof q.componentDidCatch=="function"&&(Tc===null||!Tc.has(q))){l=Qu(L,l),l=m(h,l,1),h=Oa(h,l,1),l=Ho(),h!==null&&(Gs(h,1,l),fs(h,l));break}}h=h.return}}function G_(l,h,L){var q=l.pingCache;q!==null&&q.delete(h),h=Ho(),l.pingedLanes|=l.suspendedLanes&L,ka===l&&(ro&L)===L&&(ma===4||ma===3&&(ro&130023424)===ro&&500>Mn()-E0?gf(l,0):x0|=L),fs(l,h)}function oy(l,h){h===0&&((l.mode&1)===0?h=1:(h=Ia,Ia<<=1,(Ia&130023424)===0&&(Ia=4194304)));var L=Ho();l=jr(l,h),l!==null&&(Gs(l,h,L),fs(l,L))}function W_(l){var h=l.memoizedState,L=0;h!==null&&(L=h.retryLane),oy(l,L)}function $_(l,h){var L=0;switch(l.tag){case 13:var q=l.stateNode,ee=l.memoizedState;ee!==null&&(L=ee.retryLane);break;case 19:q=l.stateNode;break;default:throw Error(t(314))}q!==null&&q.delete(h),oy(l,L)}var sy;sy=function(l,h,L){if(l!==null)if(l.memoizedProps!==h.pendingProps||ia.current)le=!0;else{if((l.lanes&L)===0&&(h.flags&128)===0)return le=!1,v0(l,h,L);le=(l.flags&131072)!==0}else le=!1,ht&&(h.flags&1048576)!==0&&bt(h,be,h.index);switch(h.lanes=0,h.tag){case 2:var q=h.type;qr(l,h),l=h.pendingProps;var ee=Al(h,Ei.current);yn(h,L),ee=ol(null,h,q,l,ee,L);var ie=Qa();return h.flags|=1,typeof ee=="object"&&ee!==null&&typeof ee.render=="function"&&ee.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,aa(q)?(ie=!0,is(h)):ie=!1,h.memoizedState=ee.state!==null&&ee.state!==void 0?ee.state:null,yu(h),ee.updater=kc,h.stateNode=ee,ee._reactInternals=h,Xf(h,q,l,L),h=mn(null,h,q,!0,ie,L)):(h.tag=0,ht&&ie&<(h),xe(null,h,ee,L),h=h.child),h;case 16:q=h.elementType;e:{switch(qr(l,h),l=h.pendingProps,ee=q._init,q=ee(q._payload),h.type=q,ee=h.tag=X_(q),l=va(q,l),ee){case 0:h=zt(null,h,q,l,L);break e;case 1:h=Tn(null,h,q,l,L);break e;case 11:h=Ye(null,h,q,l,L);break e;case 14:h=ut(null,h,q,va(q.type,l),L);break e}throw Error(t(306,q,""))}return h;case 0:return q=h.type,ee=h.pendingProps,ee=h.elementType===q?ee:va(q,ee),zt(l,h,q,ee,L);case 1:return q=h.type,ee=h.pendingProps,ee=h.elementType===q?ee:va(q,ee),Tn(l,h,q,ee,L);case 3:e:{if(eo(h),l===null)throw Error(t(387));q=h.pendingProps,ie=h.memoizedState,ee=ie.element,Xu(l,h),Bo(h,q,null,L);var ge=h.memoizedState;if(q=ge.element,ie.isDehydrated)if(ie={element:q,isDehydrated:!1,cache:ge.cache,pendingSuspenseBoundaries:ge.pendingSuspenseBoundaries,transitions:ge.transitions},h.updateQueue.baseState=ie,h.memoizedState=ie,h.flags&256){ee=Qu(Error(t(423)),h),h=sl(l,h,q,L,ee);break e}else if(q!==ee){ee=Qu(Error(t(424)),h),h=sl(l,h,q,L,ee);break e}else for(Ue=Ui(h.stateNode.containerInfo.firstChild),qe=h,ht=!0,gt=null,L=xr(h,null,q,L),h.child=L;L;)L.flags=L.flags&-3|4096,L=L.sibling;else{if(yr(),q===ee){h=Ca(l,h,L);break e}xe(l,h,q,L)}h=h.child}return h;case 5:return bu(h),l===null&&Mt(h),q=h.type,ee=h.pendingProps,ie=l!==null?l.memoizedProps:null,ge=ee.children,uf(q,ee)?ge=null:ie!==null&&uf(q,ie)&&(h.flags|=32),br(l,h),xe(l,h,ge,L),h.child;case 6:return l===null&&Mt(h),null;case 13:return pt(l,h,L);case 4:return qo(h,h.stateNode.containerInfo),q=h.pendingProps,l===null?h.child=ci(h,null,q,L):xe(l,h,q,L),h.child;case 11:return q=h.type,ee=h.pendingProps,ee=h.elementType===q?ee:va(q,ee),Ye(l,h,q,ee,L);case 7:return xe(l,h,h.pendingProps,L),h.child;case 8:return xe(l,h,h.pendingProps.children,L),h.child;case 12:return xe(l,h,h.pendingProps.children,L),h.child;case 10:e:{if(q=h.type._context,ee=h.pendingProps,ie=h.memoizedProps,ge=ee.value,rn(Gi,q._currentValue),q._currentValue=ge,ie!==null)if(Mr(ie.value,ge)){if(ie.children===ee.children&&!ia.current){h=Ca(l,h,L);break e}}else for(ie=h.child,ie!==null&&(ie.return=h);ie!==null;){var Ne=ie.dependencies;if(Ne!==null){ge=ie.child;for(var De=Ne.firstContext;De!==null;){if(De.context===q){if(ie.tag===1){De=Ya(-1,L&-L),De.tag=2;var st=ie.updateQueue;if(st!==null){st=st.shared;var Et=st.pending;Et===null?De.next=De:(De.next=Et.next,Et.next=De),st.pending=De}}ie.lanes|=L,De=ie.alternate,De!==null&&(De.lanes|=L),$a(ie.return,L,h),Ne.lanes|=L;break}De=De.next}}else if(ie.tag===10)ge=ie.type===h.type?null:ie.child;else if(ie.tag===18){if(ge=ie.return,ge===null)throw Error(t(341));ge.lanes|=L,Ne=ge.alternate,Ne!==null&&(Ne.lanes|=L),$a(ge,L,h),ge=ie.sibling}else ge=ie.child;if(ge!==null)ge.return=ie;else for(ge=ie;ge!==null;){if(ge===h){ge=null;break}if(ie=ge.sibling,ie!==null){ie.return=ge.return,ge=ie;break}ge=ge.return}ie=ge}xe(l,h,ee.children,L),h=h.child}return h;case 9:return ee=h.type,q=h.pendingProps.children,yn(h,L),ee=qn(ee),q=q(ee),h.flags|=1,xe(l,h,q,L),h.child;case 14:return q=h.type,ee=va(q,h.pendingProps),ee=va(q.type,ee),ut(l,h,q,ee,L);case 15:return Lt(l,h,h.type,h.pendingProps,L);case 17:return q=h.type,ee=h.pendingProps,ee=h.elementType===q?ee:va(q,ee),qr(l,h),h.tag=1,aa(q)?(l=!0,is(h)):l=!1,yn(h,L),jp(h,q,ee),Xf(h,q,ee,L),mn(null,h,q,!0,l,L);case 19:return $i(l,h,L);case 22:return Kt(l,h,L)}throw Error(t(156,h.tag))};function ly(l,h){return _s(l,h)}function Y_(l,h,L,q){this.tag=l,this.key=L,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=q,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ul(l,h,L,q){return new Y_(l,h,L,q)}function T0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function X_(l){if(typeof l=="function")return T0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===C)return 11;if(l===T)return 14}return 2}function jc(l,h){var L=l.alternate;return L===null?(L=ul(l.tag,h,l.key,l.mode),L.elementType=l.elementType,L.type=l.type,L.stateNode=l.stateNode,L.alternate=l,l.alternate=L):(L.pendingProps=h,L.type=l.type,L.flags=0,L.subtreeFlags=0,L.deletions=null),L.flags=l.flags&14680064,L.childLanes=l.childLanes,L.lanes=l.lanes,L.child=l.child,L.memoizedProps=l.memoizedProps,L.memoizedState=l.memoizedState,L.updateQueue=l.updateQueue,h=l.dependencies,L.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},L.sibling=l.sibling,L.index=l.index,L.ref=l.ref,L}function Yp(l,h,L,q,ee,ie){var ge=2;if(q=l,typeof l=="function")T0(l)&&(ge=1);else if(typeof l=="string")ge=5;else e:switch(l){case N:return mf(L.children,ee,ie,h);case R:ge=8,ee|=8;break;case F:return l=ul(12,L,h,ee|2),l.elementType=F,l.lanes=ie,l;case A:return l=ul(13,L,h,ee),l.elementType=A,l.lanes=ie,l;case k:return l=ul(19,L,h,ee),l.elementType=k,l.lanes=ie,l;case G:return Xp(L,ee,ie,h);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case j:ge=10;break e;case O:ge=9;break e;case C:ge=11;break e;case T:ge=14;break e;case V:ge=16,q=null;break e}throw Error(t(130,l==null?l:typeof l,""))}return h=ul(ge,L,h,ee),h.elementType=l,h.type=q,h.lanes=ie,h}function mf(l,h,L,q){return l=ul(7,l,q,h),l.lanes=L,l}function Xp(l,h,L,q){return l=ul(22,l,q,h),l.elementType=G,l.lanes=L,l.stateNode={isHidden:!1},l}function R0(l,h,L){return l=ul(6,l,null,h),l.lanes=L,l}function M0(l,h,L){return h=ul(4,l.children!==null?l.children:[],l.key,h),h.lanes=L,h.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},h}function K_(l,h,L,q,ee){this.tag=h,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ha(0),this.expirationTimes=ha(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ha(0),this.identifierPrefix=q,this.onRecoverableError=ee,this.mutableSourceEagerHydrationData=null}function I0(l,h,L,q,ee,ie,ge,Ne,De){return l=new K_(l,h,L,Ne,De),h===1?(h=1,ie===!0&&(h|=8)):h=0,ie=ul(3,null,null,h),l.current=ie,ie.stateNode=l,ie.memoizedState={element:q,isDehydrated:L,cache:null,transitions:null,pendingSuspenseBoundaries:null},yu(ie),l}function Z_(l,h,L){var q=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:q==null?null:""+q,children:l,containerInfo:h,implementation:L}}function uy(l){if(!l)return ns;l=l._reactInternals;e:{if(sn(l)!==l||l.tag!==1)throw Error(t(170));var h=l;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(aa(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(t(171))}if(l.tag===1){var L=l.type;if(aa(L))return Yu(l,L,h)}return h}function cy(l,h,L,q,ee,ie,ge,Ne,De){return l=I0(L,q,!0,l,ee,ie,ge,Ne,De),l.context=uy(null),L=l.current,q=Ho(),ee=Mc(L),ie=Ya(q,ee),ie.callback=h??null,Oa(L,ie,ee),l.current.lanes=ee,Gs(l,ee,q),fs(l,q),l}function Kp(l,h,L,q){var ee=h.current,ie=Ho(),ge=Mc(ee);return L=uy(L),h.context===null?h.context=L:h.pendingContext=L,h=Ya(ie,ge),h.payload={element:l},q=q===void 0?null:q,q!==null&&(h.callback=q),l=Oa(ee,h,ge),l!==null&&(Il(l,ee,ge,ie),kl(l,ee,ge)),ge}function Zp(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function fy(l,h){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var L=l.retryLane;l.retryLane=L!==0&&L<h?L:h}}function j0(l,h){fy(l,h),(l=l.alternate)&&fy(l,h)}function Q_(){return null}var hy=typeof reportError=="function"?reportError:function(l){console.error(l)};function F0(l){this._internalRoot=l}Qp.prototype.render=F0.prototype.render=function(l){var h=this._internalRoot;if(h===null)throw Error(t(409));Kp(l,h,null,null)},Qp.prototype.unmount=F0.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var h=l.containerInfo;pf(function(){Kp(null,l,null,null)}),h[Vi]=null}};function Qp(l){this._internalRoot=l}Qp.prototype.unstable_scheduleHydration=function(l){if(l){var h=$o();l={blockedOn:null,target:l,priority:h};for(var L=0;L<lo.length&&h!==0&&h<lo[L].priority;L++);lo.splice(L,0,l),L===0&&Ks(l)}};function D0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Jp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function dy(){}function J_(l,h,L,q,ee){if(ee){if(typeof q=="function"){var ie=q;q=function(){var st=Zp(ge);ie.call(st)}}var ge=cy(h,q,l,0,null,!1,!1,"",dy);return l._reactRootContainer=ge,l[Vi]=ge.current,ks(l.nodeType===8?l.parentNode:l),pf(),ge}for(;ee=l.lastChild;)l.removeChild(ee);if(typeof q=="function"){var Ne=q;q=function(){var st=Zp(De);Ne.call(st)}}var De=I0(l,0,!1,null,null,!1,!1,"",dy);return l._reactRootContainer=De,l[Vi]=De.current,ks(l.nodeType===8?l.parentNode:l),pf(function(){Kp(h,De,L,q)}),De}function e1(l,h,L,q,ee){var ie=L._reactRootContainer;if(ie){var ge=ie;if(typeof ee=="function"){var Ne=ee;ee=function(){var De=Zp(ge);Ne.call(De)}}Kp(h,ge,l,ee)}else ge=J_(L,h,l,ee,q);return Zp(ge)}Ws=function(l){switch(l.tag){case 3:var h=l.stateNode;if(h.current.memoizedState.isDehydrated){var L=ii(h.pendingLanes);L!==0&&(iu(h,L|1),fs(h,Mn()),(an&6)===0&&(Jf=Mn()+500,oe()))}break;case 13:pf(function(){var q=jr(l,1);if(q!==null){var ee=Ho();Il(q,l,1,ee)}}),j0(l,1)}},$s=function(l){if(l.tag===13){var h=jr(l,134217728);if(h!==null){var L=Ho();Il(h,l,134217728,L)}j0(l,134217728)}},yc=function(l){if(l.tag===13){var h=Mc(l),L=jr(l,h);if(L!==null){var q=Ho();Il(L,l,h,q)}j0(l,h)}},$o=function(){return Rr},xs=function(l,h){var L=Rr;try{return Rr=l,h()}finally{Rr=L}},Ot=function(l,h,L){switch(h){case"input":if(Je(l,L),h=L.name,L.type==="radio"&&h!=null){for(L=l;L.parentNode;)L=L.parentNode;for(L=L.querySelectorAll("input[name="+JSON.stringify(""+h)+'][type="radio"]'),h=0;h<L.length;h++){var q=L[h];if(q!==l&&q.form===l.form){var ee=bi(q);if(!ee)throw Error(t(90));Oe(q),Je(q,ee)}}}break;case"textarea":Ie(l,L);break;case"select":h=L.value,h!=null&&Te(l,!!L.multiple,h,!1)}},We=k0,it=pf;var e7={usingClientEntryPoint:!1,Events:[vu,ui,bi,kt,nt,k0]},Xh={findFiberByHostInstance:Ns,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t7={bundleType:Xh.bundleType,version:Xh.version,rendererPackageName:Xh.rendererPackageName,rendererConfig:Xh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=_i(l),l===null?null:l.stateNode},findFiberByHostInstance:Xh.findFiberByHostInstance||Q_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var t1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t1.isDisabled&&t1.supportsFiber)try{so=t1.inject(t7),di=t1}catch{}}return hs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e7,hs.createPortal=function(l,h){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!D0(h))throw Error(t(200));return Z_(l,h,null,L)},hs.createRoot=function(l,h){if(!D0(l))throw Error(t(299));var L=!1,q="",ee=hy;return h!=null&&(h.unstable_strictMode===!0&&(L=!0),h.identifierPrefix!==void 0&&(q=h.identifierPrefix),h.onRecoverableError!==void 0&&(ee=h.onRecoverableError)),h=I0(l,1,!1,null,null,L,!1,q,ee),l[Vi]=h.current,ks(l.nodeType===8?l.parentNode:l),new F0(h)},hs.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var h=l._reactInternals;if(h===void 0)throw typeof l.render=="function"?Error(t(188)):(l=Object.keys(l).join(","),Error(t(268,l)));return l=_i(h),l=l===null?null:l.stateNode,l},hs.flushSync=function(l){return pf(l)},hs.hydrate=function(l,h,L){if(!Jp(h))throw Error(t(200));return e1(null,l,h,!0,L)},hs.hydrateRoot=function(l,h,L){if(!D0(l))throw Error(t(405));var q=L!=null&&L.hydratedSources||null,ee=!1,ie="",ge=hy;if(L!=null&&(L.unstable_strictMode===!0&&(ee=!0),L.identifierPrefix!==void 0&&(ie=L.identifierPrefix),L.onRecoverableError!==void 0&&(ge=L.onRecoverableError)),h=cy(h,null,l,1,L??null,ee,!1,ie,ge),l[Vi]=h.current,ks(l),q)for(l=0;l<q.length;l++)L=q[l],ee=L._getVersion,ee=ee(L._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[L,ee]:h.mutableSourceEagerHydrationData.push(L,ee);return new Qp(h)},hs.render=function(l,h,L){if(!Jp(h))throw Error(t(200));return e1(null,l,h,!1,L)},hs.unmountComponentAtNode=function(l){if(!Jp(l))throw Error(t(40));return l._reactRootContainer?(pf(function(){e1(null,null,l,!1,function(){l._reactRootContainer=null,l[Vi]=null})}),!0):!1},hs.unstable_batchedUpdates=k0,hs.unstable_renderSubtreeIntoContainer=function(l,h,L,q){if(!Jp(L))throw Error(t(200));if(l==null||l._reactInternals===void 0)throw Error(t(38));return e1(l,h,L,!1,q)},hs.version="18.3.1-next-f1338f8080-20240426",hs}var by;function pw(){if(by)return q0.exports;by=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),q0.exports=a7(),q0.exports}var wy;function o7(){if(wy)return r1;wy=1;var e=pw();return r1.createRoot=e.createRoot,r1.hydrateRoot=e.hydrateRoot,r1}var s7=o7();const gw=yp(s7);var Kh={};function Pr(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var l7={};function z1(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:l7}var vw=Object.assign,P1=Object.getOwnPropertyDescriptor,Nu=Object.defineProperty,bp=Object.prototype,h2=[];Object.freeze(h2);var q2={};Object.freeze(q2);var u7=typeof Proxy<"u",c7=Object.toString();function mw(){u7||Pr("Proxy not available")}function yw(e){var r=!1;return function(){if(!r)return r=!0,e.apply(this,arguments)}}var ch=function(){};function qs(e){return typeof e=="function"}function Af(e){var r=typeof e;switch(r){case"string":case"symbol":case"number":return!0}return!1}function U1(e){return e!==null&&typeof e=="object"}function dc(e){if(!U1(e))return!1;var r=Object.getPrototypeOf(e);if(r==null)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t.toString()===c7}function bw(e){var r=e==null?void 0:e.constructor;return r?r.name==="GeneratorFunction"||r.displayName==="GeneratorFunction":!1}function wp(e,r,t){Nu(e,r,{enumerable:!1,writable:!0,configurable:!0,value:t})}function ww(e,r,t){Nu(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Qc(e,r){var t="isMobX"+e;return r.prototype[t]=!0,function(n){return U1(n)&&n[t]===!0}}function Th(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function f7(e){var r=Object.getPrototypeOf(e),t=Object.getPrototypeOf(r),n=Object.getPrototypeOf(t);return n===null}function uc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var _w=typeof Object.getOwnPropertySymbols<"u";function h7(e){var r=Object.keys(e);if(!_w)return r;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(r,t.filter(function(n){return bp.propertyIsEnumerable.call(e,n)})):r}var wh=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:_w?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Sw(e){return e===null?null:typeof e=="object"?""+e:e}function cc(e,r){return bp.hasOwnProperty.call(e,r)}var d7=Object.getOwnPropertyDescriptors||function(r){var t={};return wh(r).forEach(function(n){t[n]=P1(r,n)}),t};function Fs(e,r){return!!(e&r)}function Ds(e,r,t){return t?e|=r:e&=~r,e}function _y(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function p7(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v7(n.key),n)}}function Rh(e,r,t){return r&&p7(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fh(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=m7(e))||r){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},$c.apply(null,arguments)}function xw(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,d2(e,r)}function d2(e,r){return d2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},d2(e,r)}function g7(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function v7(e){var r=g7(e,"string");return typeof r=="symbol"?r:r+""}function m7(e,r){if(e){if(typeof e=="string")return _y(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_y(e,r):void 0}}var ku=Symbol("mobx-stored-annotations");function Wl(e){function r(t,n){if(Sp(n))return e.decorate_20223_(t,n);_p(t,n,e)}return Object.assign(r,e)}function _p(e,r,t){cc(e,ku)||wp(e,ku,$c({},e[ku])),O7(t)||(e[ku][r]=t)}function y7(e){return cc(e,ku)||wp(e,ku,$c({},e[ku])),e[ku]}function Sp(e){return typeof e=="object"&&typeof e.kind=="string"}var lr=Symbol("mobx administration"),Jc=function(){function e(t){t===void 0&&(t="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=pn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var r=e.prototype;return r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},r.reportObserved=function(){return Uw(this)},r.reportChanged=function(){ps(),Hw(this),gs()},r.toString=function(){return this.name_},Rh(e,[{key:"isBeingObserved",get:function(){return Fs(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Fs(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Jc.isBeingObservedMask_=1;Jc.isPendingUnobservationMask_=2;Jc.diffValueMask_=4;var z2=Qc("Atom",Jc);function fp(e,r,t){r===void 0&&(r=ch),t===void 0&&(t=ch);var n=new Jc(e);return r!==ch&&Qw(n,r),t!==ch&&$2(n,t),n}function b7(e,r){return e===r}function w7(e,r){return nm(e,r)}function _7(e,r){return nm(e,r,1)}function S7(e,r){return Object.is?Object.is(e,r):e===r?e!==0||1/e===1/r:e!==e&&r!==r}var Cf={identity:b7,structural:w7,default:S7,shallow:_7};function kf(e,r,t){return K1(e)?e:Array.isArray(e)?Rn.array(e,{name:t}):dc(e)?Rn.object(e,void 0,{name:t}):Th(e)?Rn.map(e,{name:t}):uc(e)?Rn.set(e,{name:t}):typeof e=="function"&&!xh(e)&&!Eh(e)?bw(e)?Nf(e):_h(t,e):e}function x7(e,r,t){if(e==null||Ta(e)||Vo(e)||io(e)||ya(e))return e;if(Array.isArray(e))return Rn.array(e,{name:t,deep:!1});if(dc(e))return Rn.object(e,void 0,{name:t,deep:!1});if(Th(e))return Rn.map(e,{name:t,deep:!1});if(uc(e))return Rn.set(e,{name:t,deep:!1})}function H1(e){return e}function E7(e,r){return nm(e,r)?r:e}var Ew="override",P7=Wl({annotationType_:Ew,make_:A7,extend_:C7,decorate_20223_:k7});function O7(e){return e.annotationType_===Ew}function A7(e,r){return 0}function C7(e,r,t,n){Pr("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function k7(e,r){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function xp(e,r){return{annotationType_:e,options_:r,make_:L7,extend_:N7,decorate_20223_:T7}}function L7(e,r,t,n){var a;if((a=this.options_)!=null&&a.bound)return this.extend_(e,r,t,!1)===null?0:1;if(n===e.target_)return this.extend_(e,r,t,!1)===null?0:2;if(xh(t.value))return 1;var i=Pw(e,this,r,t,!1);return Nu(n,r,i),2}function N7(e,r,t,n){var a=Pw(e,this,r,t);return e.defineProperty_(r,a,n)}function T7(e,r){var t=r.kind,n=r.name,a=r.addInitializer,i=this,o=function(u){var d,p,y,f;return Yc((d=(p=i.options_)==null?void 0:p.name)!=null?d:n.toString(),u,(y=(f=i.options_)==null?void 0:f.autoAction)!=null?y:!1)};if(t=="field")return function(c){var u,d=c;return xh(d)||(d=o(d)),(u=i.options_)!=null&&u.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(t=="method"){var s;return xh(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&a(function(){var c=this,u=c[n].bind(c);u.isMobxAction=!0,c[n]=u}),e}Pr("Cannot apply '"+i.annotationType_+"' to '"+String(n)+"' (kind: "+t+"):"+(`
|
|
34
|
+
'`+i.annotationType_+"' can only be used on properties with a function value."))}function R7(e,r,t,n){r.annotationType_,n.value}function Pw(e,r,t,n,a){var i,o,s,c,u,d,p;a===void 0&&(a=Rt.safeDescriptors),R7(e,r,t,n);var y=n.value;if((i=r.options_)!=null&&i.bound){var f;y=y.bind((f=e.proxy_)!=null?f:e.target_)}return{value:Yc((o=(s=r.options_)==null?void 0:s.name)!=null?o:t.toString(),y,(c=(u=r.options_)==null?void 0:u.autoAction)!=null?c:!1,(d=r.options_)!=null&&d.bound?(p=e.proxy_)!=null?p:e.target_:void 0),configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Ow(e,r){return{annotationType_:e,options_:r,make_:M7,extend_:I7,decorate_20223_:j7}}function M7(e,r,t,n){var a;if(n===e.target_)return this.extend_(e,r,t,!1)===null?0:2;if((a=this.options_)!=null&&a.bound&&(!cc(e.target_,r)||!Eh(e.target_[r]))&&this.extend_(e,r,t,!1)===null)return 0;if(Eh(t.value))return 1;var i=Aw(e,this,r,t,!1,!1);return Nu(n,r,i),2}function I7(e,r,t,n){var a,i=Aw(e,this,r,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(r,i,n)}function j7(e,r){var t,n=r.name,a=r.addInitializer;return Eh(e)||(e=Nf(e)),(t=this.options_)!=null&&t.bound&&a(function(){var i=this,o=i[n].bind(i);o.isMobXFlow=!0,i[n]=o}),e}function F7(e,r,t,n){r.annotationType_,n.value}function Aw(e,r,t,n,a,i){i===void 0&&(i=Rt.safeDescriptors),F7(e,r,t,n);var o=n.value;if(Eh(o)||(o=Nf(o)),a){var s;o=o.bind((s=e.proxy_)!=null?s:e.target_),o.isMobXFlow=!0}return{value:o,configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function U2(e,r){return{annotationType_:e,options_:r,make_:D7,extend_:B7,decorate_20223_:q7}}function D7(e,r,t){return this.extend_(e,r,t,!1)===null?0:1}function B7(e,r,t,n){return z7(e,this,r,t),e.defineComputedProperty_(r,$c({},this.options_,{get:t.get,set:t.set}),n)}function q7(e,r){var t=this,n=r.name,a=r.addInitializer;return a(function(){var i=Mf(this)[lr],o=$c({},t.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),i.values_.set(n,new Xl(o))}),function(){return this[lr].getObservablePropValue_(n)}}function z7(e,r,t,n){r.annotationType_,n.get}function V1(e,r){return{annotationType_:e,options_:r,make_:U7,extend_:H7,decorate_20223_:V7}}function U7(e,r,t){return this.extend_(e,r,t,!1)===null?0:1}function H7(e,r,t,n){var a,i;return G7(e,this),e.defineObservableProperty_(r,t.value,(a=(i=this.options_)==null?void 0:i.enhancer)!=null?a:kf,n)}function V7(e,r){var t=this,n=r.kind,a=r.name,i=new WeakSet;function o(s,c){var u,d,p=Mf(s)[lr],y=new Gc(c,(u=(d=t.options_)==null?void 0:d.enhancer)!=null?u:kf,"ObservableObject."+a.toString(),!1);p.values_.set(a,y),i.add(s)}if(n=="accessor")return{get:function(){return i.has(this)||o(this,e.get.call(this)),this[lr].getObservablePropValue_(a)},set:function(c){return i.has(this)||o(this,c),this[lr].setObservablePropValue_(a,c)},init:function(c){return i.has(this)||o(this,c),c}}}function G7(e,r,t,n){r.annotationType_}var W7="true",$7=Cw();function Cw(e){return{annotationType_:W7,options_:e,make_:Y7,extend_:X7,decorate_20223_:K7}}function Y7(e,r,t,n){var a,i;if(t.get)return Tf.make_(e,r,t,n);if(t.set){var o=Yc(r.toString(),t.set);return n===e.target_?e.defineProperty_(r,{configurable:Rt.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Nu(n,r,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof t.value=="function"){var s;if(bw(t.value)){var c,u=(c=this.options_)!=null&&c.autoBind?Nf.bound:Nf;return u.make_(e,r,t,n)}var d=(s=this.options_)!=null&&s.autoBind?_h.bound:_h;return d.make_(e,r,t,n)}var p=((a=this.options_)==null?void 0:a.deep)===!1?Rn.ref:Rn;if(typeof t.value=="function"&&(i=this.options_)!=null&&i.autoBind){var y;t.value=t.value.bind((y=e.proxy_)!=null?y:e.target_)}return p.make_(e,r,t,n)}function X7(e,r,t,n){var a,i;if(t.get)return Tf.extend_(e,r,t,n);if(t.set)return e.defineProperty_(r,{configurable:Rt.safeDescriptors?e.isPlainObject_:!0,set:Yc(r.toString(),t.set)},n);if(typeof t.value=="function"&&(a=this.options_)!=null&&a.autoBind){var o;t.value=t.value.bind((o=e.proxy_)!=null?o:e.target_)}var s=((i=this.options_)==null?void 0:i.deep)===!1?Rn.ref:Rn;return s.extend_(e,r,t,n)}function K7(e,r){Pr("'"+this.annotationType_+"' cannot be used as a decorator")}var Z7="observable",Q7="observable.ref",J7="observable.shallow",e9="observable.struct",kw={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(kw);function n1(e){return e||kw}var p2=V1(Z7),t9=V1(Q7,{enhancer:H1}),r9=V1(J7,{enhancer:x7}),n9=V1(e9,{enhancer:E7}),Lw=Wl(p2);function i1(e){return e.deep===!0?kf:e.deep===!1?H1:a9(e.defaultDecorator)}function i9(e){var r;return e?(r=e.defaultDecorator)!=null?r:Cw(e):void 0}function a9(e){var r,t;return e&&(r=(t=e.options_)==null?void 0:t.enhancer)!=null?r:kf}function Nw(e,r,t){if(Sp(r))return p2.decorate_20223_(e,r);if(Af(r)){_p(e,r,p2);return}return K1(e)?e:dc(e)?Rn.object(e,r,t):Array.isArray(e)?Rn.array(e,r):Th(e)?Rn.map(e,r):uc(e)?Rn.set(e,r):typeof e=="object"&&e!==null?e:Rn.box(e,r)}vw(Nw,Lw);var o9={box:function(r,t){var n=n1(t);return new Gc(r,i1(n),n.name,!0,n.equals)},array:function(r,t){var n=n1(t);return(Rt.useProxies===!1||n.proxy===!1?hS:rS)(r,i1(n),n.name)},map:function(r,t){var n=n1(t);return new Q1(r,i1(n),n.name)},set:function(r,t){var n=n1(t);return new tm(r,i1(n),n.name)},object:function(r,t,n){return ef(function(){return Y2(Rt.useProxies===!1||(n==null?void 0:n.proxy)===!1?Mf({},n):Q9({},n),r,t)})},ref:Wl(t9),shallow:Wl(r9),deep:Lw,struct:Wl(n9)},Rn=vw(Nw,o9),Tw="computed",s9="computed.struct",g2=U2(Tw),l9=U2(s9,{equals:Cf.structural}),Tf=function(r,t){if(Sp(t))return g2.decorate_20223_(r,t);if(Af(t))return _p(r,t,g2);if(dc(r))return Wl(U2(Tw,r));var n=dc(t)?t:{};return n.get=r,n.name||(n.name=r.name||""),new Xl(n)};Object.assign(Tf,g2);Tf.struct=Wl(l9);var Sy,xy,O1=0,u9=1,c9=(Sy=(xy=P1(function(){},"name"))==null?void 0:xy.configurable)!=null?Sy:!1,Ey={value:"action",configurable:!0,writable:!1,enumerable:!1};function Yc(e,r,t,n){t===void 0&&(t=!1);function a(){return Rw(e,t,r,n||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return r.toString()},c9&&(Ey.value=e,Nu(a,"name",Ey)),a}function Rw(e,r,t,n,a){var i=Mw(e,r);try{return t.apply(n,a)}catch(o){throw i.error_=o,o}finally{Iw(i)}}function Mw(e,r,t,n){var a=!1,i=0,o=Rt.trackingDerivation,s=!r||!o;ps();var c=Rt.allowStateChanges;s&&(Rf(),c=G1(!0));var u=$1(!0),d={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:u,notifySpy_:a,startTime_:i,actionId_:u9++,parentActionId_:O1};return O1=d.actionId_,d}function Iw(e){O1!==e.actionId_&&Pr(30),O1=e.parentActionId_,e.error_!==void 0&&(Rt.suppressReactionErrors=!0),W1(e.prevAllowStateChanges_),ph(e.prevAllowStateReads_),gs(),e.runAsAction_&&fc(e.prevDerivation_),Rt.suppressReactionErrors=!1}function H2(e,r){var t=G1(e);try{return r()}finally{W1(t)}}function G1(e){var r=Rt.allowStateChanges;return Rt.allowStateChanges=e,r}function W1(e){Rt.allowStateChanges=e}var Gc=function(e){function r(n,a,i,o,s){var c;return i===void 0&&(i="ObservableValue"),s===void 0&&(s=Cf.default),c=e.call(this,i)||this,c.enhancer=void 0,c.name_=void 0,c.equals=void 0,c.hasUnreportedChange_=!1,c.interceptors_=void 0,c.changeListeners_=void 0,c.value_=void 0,c.dehancer=void 0,c.enhancer=a,c.name_=i,c.equals=s,c.value_=a(n,void 0,i),c}xw(r,e);var t=r.prototype;return t.dehanceValue=function(a){return this.dehancer!==void 0?this.dehancer(a):a},t.set=function(a){this.value_,a=this.prepareNewValue_(a),a!==Rt.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(cl(this)){var i=fl(this,{object:this,type:Tu,newValue:a});if(!i)return Rt.UNCHANGED;a=i.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?Rt.UNCHANGED:a},t.setNewValue_=function(a){var i=this.value_;this.value_=a,this.reportChanged(),$l(this)&&Yl(this,{type:Tu,object:this,newValue:a,oldValue:i})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(a){return Ep(this,a)},t.observe_=function(a,i){return i&&a({observableKind:"value",debugObjectName:this.name_,object:this,type:Tu,newValue:this.value_,oldValue:void 0}),Pp(this,a)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return Sw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},r}(Jc),V2=Qc("ObservableValue",Gc),Xl=function(){function e(t){this.dependenciesState_=pn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=pn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new C1(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=A1.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||Pr(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Yc("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?Cf.structural:Cf.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var r=e.prototype;return r.onBecomeStale_=function(){w9(this)},r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},r.get=function(){if(this.isComputing&&Pr(32,this.name_,this.derivation),Rt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)v2(this)&&(this.warnAboutUntrackedRead_(),ps(),this.value_=this.computeValue_(!1),gs());else if(Uw(this),v2(this)){var n=Rt.trackingContext;this.keepAlive_&&!n&&(Rt.trackingContext=this),this.trackAndCompute()&&b9(this),Rt.trackingContext=n}var a=this.value_;if(g1(a))throw a.cause;return a},r.set=function(n){if(this.setter_){this.isRunningSetter&&Pr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else Pr(34,this.name_)},r.trackAndCompute=function(){var n=this.value_,a=this.dependenciesState_===pn.NOT_TRACKING_,i=this.computeValue_(!0),o=a||g1(n)||g1(i)||!this.equals_(n,i);return o&&(this.value_=i),o},r.computeValue_=function(n){this.isComputing=!0;var a=G1(!1),i;if(n)i=jw(this,this.derivation,this.scope_);else if(Rt.disableErrorBoundaries===!0)i=this.derivation.call(this.scope_);else try{i=this.derivation.call(this.scope_)}catch(o){i=new C1(o)}return W1(a),this.isComputing=!1,i},r.suspend_=function(){this.keepAlive_||(m2(this),this.value_=void 0)},r.observe_=function(n,a){var i=this,o=!0,s=void 0;return W2(function(){var c=i.get();if(!o||a){var u=Rf();n({observableKind:"computed",debugObjectName:i.name_,type:Tu,object:i,newValue:c,oldValue:s}),fc(u)}o=!1,s=c})},r.warnAboutUntrackedRead_=function(){},r.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},r.valueOf=function(){return Sw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},Rh(e,[{key:"isComputing",get:function(){return Fs(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Fs(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Fs(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Fs(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Xl.isComputingMask_=1;Xl.isRunningSetterMask_=2;Xl.isBeingObservedMask_=4;Xl.isPendingUnobservationMask_=8;Xl.diffValueMask_=16;var Lf=Qc("ComputedValue",Xl),pn;(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_"})(pn||(pn={}));var A1;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(A1||(A1={}));var C1=function(r){this.cause=void 0,this.cause=r};function g1(e){return e instanceof C1}function v2(e){switch(e.dependenciesState_){case pn.UP_TO_DATE_:return!1;case pn.NOT_TRACKING_:case pn.STALE_:return!0;case pn.POSSIBLY_STALE_:{for(var r=$1(!0),t=Rf(),n=e.observing_,a=n.length,i=0;i<a;i++){var o=n[i];if(Lf(o)){if(Rt.disableErrorBoundaries)o.get();else try{o.get()}catch{return fc(t),ph(r),!0}if(e.dependenciesState_===pn.STALE_)return fc(t),ph(r),!0}}return Fw(e),fc(t),ph(r),!1}}}function f9(){return Rt.trackingDerivation!==null}function jw(e,r,t){var n=$1(!0);Fw(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Rt.runId;var a=Rt.trackingDerivation;Rt.trackingDerivation=e,Rt.inBatch++;var i;if(Rt.disableErrorBoundaries===!0)i=r.call(t);else try{i=r.call(t)}catch(o){i=new C1(o)}return Rt.inBatch--,Rt.trackingDerivation=a,h9(e),ph(n),i}function h9(e){for(var r=e.observing_,t=e.observing_=e.newObserving_,n=pn.UP_TO_DATE_,a=0,i=e.unboundDepsCount_,o=0;o<i;o++){var s=t[o];s.diffValue===0&&(s.diffValue=1,a!==o&&(t[a]=s),a++),s.dependenciesState_>n&&(n=s.dependenciesState_)}for(t.length=a,e.newObserving_=null,i=r.length;i--;){var c=r[i];c.diffValue===0&&qw(c,e),c.diffValue=0}for(;a--;){var u=t[a];u.diffValue===1&&(u.diffValue=0,y9(u,e))}n!==pn.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function m2(e){var r=e.observing_;e.observing_=[];for(var t=r.length;t--;)qw(r[t],e);e.dependenciesState_=pn.NOT_TRACKING_}function G2(e){var r=Rf();try{return e()}finally{fc(r)}}function Rf(){var e=Rt.trackingDerivation;return Rt.trackingDerivation=null,e}function fc(e){Rt.trackingDerivation=e}function $1(e){var r=Rt.allowStateReads;return Rt.allowStateReads=e,r}function ph(e){Rt.allowStateReads=e}function Fw(e){if(e.dependenciesState_!==pn.UP_TO_DATE_){e.dependenciesState_=pn.UP_TO_DATE_;for(var r=e.observing_,t=r.length;t--;)r[t].lowestObserverState_=pn.UP_TO_DATE_}}var d9=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],op=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},v1=!0,Dw=!1,Rt=function(){var e=z1();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(v1=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new op().version&&(v1=!1),v1?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new op):(setTimeout(function(){Dw||Pr(35)},1),new op)}();function p9(){if((Rt.pendingReactions.length||Rt.inBatch||Rt.isRunningReactions)&&Pr(36),Dw=!0,v1){var e=z1();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Rt=new op}}function Bw(){return Rt}function g9(){var e=new op;for(var r in e)d9.indexOf(r)===-1&&(Rt[r]=e[r]);Rt.allowStateChanges=!Rt.enforceActions}function v9(e){return e.observers_&&e.observers_.size>0}function m9(e){return e.observers_}function y9(e,r){e.observers_.add(r),e.lowestObserverState_>r.dependenciesState_&&(e.lowestObserverState_=r.dependenciesState_)}function qw(e,r){e.observers_.delete(r),e.observers_.size===0&&zw(e)}function zw(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Rt.pendingUnobservations.push(e))}function ps(){Rt.inBatch++}function gs(){if(--Rt.inBatch===0){Vw();for(var e=Rt.pendingUnobservations,r=0;r<e.length;r++){var t=e[r];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof Xl&&t.suspend_())}Rt.pendingUnobservations=[]}}function Uw(e){var r=Rt.trackingDerivation;return r!==null?(r.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=r.runId_,r.newObserving_[r.unboundDepsCount_++]=e,!e.isBeingObserved&&Rt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Rt.inBatch>0&&zw(e),!1)}function Hw(e){e.lowestObserverState_!==pn.STALE_&&(e.lowestObserverState_=pn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===pn.UP_TO_DATE_&&r.onBecomeStale_(),r.dependenciesState_=pn.STALE_}))}function b9(e){e.lowestObserverState_!==pn.STALE_&&(e.lowestObserverState_=pn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===pn.POSSIBLY_STALE_?r.dependenciesState_=pn.STALE_:r.dependenciesState_===pn.UP_TO_DATE_&&(e.lowestObserverState_=pn.UP_TO_DATE_)}))}function w9(e){e.lowestObserverState_===pn.UP_TO_DATE_&&(e.lowestObserverState_=pn.POSSIBLY_STALE_,e.observers_.forEach(function(r){r.dependenciesState_===pn.UP_TO_DATE_&&(r.dependenciesState_=pn.POSSIBLY_STALE_,r.onBecomeStale_())}))}var Kl=function(){function e(t,n,a,i){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=pn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=A1.NONE,this.name_=t,this.onInvalidate_=n,this.errorHandler_=a,this.requiresObservable_=i}var r=e.prototype;return r.onBecomeStale_=function(){this.schedule_()},r.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Rt.pendingReactions.push(this),Vw())},r.runReaction_=function(){if(!this.isDisposed){ps(),this.isScheduled=!1;var n=Rt.trackingContext;if(Rt.trackingContext=this,v2(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}Rt.trackingContext=n,gs()}},r.track=function(n){if(!this.isDisposed){ps(),this.isRunning=!0;var a=Rt.trackingContext;Rt.trackingContext=this;var i=jw(this,n,void 0);Rt.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&m2(this),g1(i)&&this.reportExceptionInDerivation_(i.cause),gs()}},r.reportExceptionInDerivation_=function(n){var a=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Rt.disableErrorBoundaries)throw n;var i="[mobx] uncaught error in '"+this+"'";Rt.suppressReactionErrors||console.error(i,n),Rt.globalReactionErrorHandlers.forEach(function(o){return o(n,a)})},r.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(ps(),m2(this),gs()))},r.getDisposer_=function(n){var a=this,i=function o(){a.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",i),i[lr]=this,i},r.toString=function(){return"Reaction["+this.name_+"]"},r.trace=function(n){},Rh(e,[{key:"isDisposed",get:function(){return Fs(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Fs(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Fs(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Fs(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Kl.isDisposedMask_=1;Kl.isScheduledMask_=2;Kl.isTrackPendingMask_=4;Kl.isRunningMask_=8;Kl.diffValueMask_=16;function _9(e){return Rt.globalReactionErrorHandlers.push(e),function(){var r=Rt.globalReactionErrorHandlers.indexOf(e);r>=0&&Rt.globalReactionErrorHandlers.splice(r,1)}}var S9=100,y2=function(r){return r()};function Vw(){Rt.inBatch>0||Rt.isRunningReactions||y2(x9)}function x9(){Rt.isRunningReactions=!0;for(var e=Rt.pendingReactions,r=0;e.length>0;){++r===S9&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),n=0,a=t.length;n<a;n++)t[n].runReaction_()}Rt.isRunningReactions=!1}var k1=Qc("Reaction",Kl);function E9(e){var r=y2;y2=function(n){return e(function(){return r(n)})}}function sp(){return!1}function Gw(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Ww="action",P9="action.bound",$w="autoAction",O9="autoAction.bound",Yw="<unnamed action>",b2=xp(Ww),A9=xp(P9,{bound:!0}),w2=xp($w,{autoAction:!0}),C9=xp(O9,{autoAction:!0,bound:!0});function Xw(e){var r=function(n,a){if(qs(n))return Yc(n.name||Yw,n,e);if(qs(a))return Yc(n,a,e);if(Sp(a))return(e?w2:b2).decorate_20223_(n,a);if(Af(a))return _p(n,a,e?w2:b2);if(Af(n))return Wl(xp(e?$w:Ww,{name:n,autoAction:e}))};return r}var ca=Xw(!1);Object.assign(ca,b2);var _h=Xw(!0);Object.assign(_h,w2);ca.bound=Wl(A9);_h.bound=Wl(C9);function Sh(e){return Rw(e.name||Yw,!1,e,this,void 0)}function xh(e){return qs(e)&&e.isMobxAction===!0}function W2(e,r){var t,n,a,i;r===void 0&&(r=q2);var o=(t=(n=r)==null?void 0:n.name)!=null?t:"Autorun",s=!r.scheduler&&!r.delay,c;if(s)c=new Kl(o,function(){this.track(p)},r.onError,r.requiresObservable);else{var u=Kw(r),d=!1;c=new Kl(o,function(){d||(d=!0,u(function(){d=!1,c.isDisposed||c.track(p)}))},r.onError,r.requiresObservable)}function p(){e(c)}return(a=r)!=null&&(a=a.signal)!=null&&a.aborted||c.schedule_(),c.getDisposer_((i=r)==null?void 0:i.signal)}var k9=function(r){return r()};function Kw(e){return e.scheduler?e.scheduler:e.delay?function(r){return setTimeout(r,e.delay)}:k9}function Zw(e,r,t){var n,a,i;t===void 0&&(t=q2);var o=(n=t.name)!=null?n:"Reaction",s=ca(o,t.onError?L9(t.onError,r):r),c=!t.scheduler&&!t.delay,u=Kw(t),d=!0,p=!1,y,f=t.compareStructural?Cf.structural:t.equals||Cf.default,_=new Kl(o,function(){d||c?S():p||(p=!0,u(S))},t.onError,t.requiresObservable);function S(){if(p=!1,!_.isDisposed){var w=!1,x=y;_.track(function(){var v=H2(!1,function(){return e(_)});w=d||!f(y,v),y=v}),(d&&t.fireImmediately||!d&&w)&&s(y,x,_),d=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||_.schedule_(),_.getDisposer_((i=t)==null?void 0:i.signal)}function L9(e,r){return function(){try{return r.apply(this,arguments)}catch(t){e.call(this,t)}}}var N9="onBO",T9="onBUO";function Qw(e,r,t){return Jw(N9,e,r,t)}function $2(e,r,t){return Jw(T9,e,r,t)}function Jw(e,r,t,n){var a=typeof n=="function"?Mu(r,t):Mu(r),i=qs(n)?n:t,o=e+"L";return a[o]?a[o].add(i):a[o]=new Set([i]),function(){var s=a[o];s&&(s.delete(i),s.size===0&&delete a[o])}}var R9="never",a1="always",M9="observed";function e6(e){e.isolateGlobalState===!0&&p9();var r=e.useProxies,t=e.enforceActions;if(r!==void 0&&(Rt.useProxies=r===a1?!0:r===R9?!1:typeof Proxy<"u"),r==="ifavailable"&&(Rt.verifyProxies=!0),t!==void 0){var n=t===a1?a1:t===M9;Rt.enforceActions=n,Rt.allowStateChanges=!(n===!0||n===a1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(Rt[a]=!!e[a])}),Rt.allowStateReads=!Rt.observableRequiresReaction,e.reactionScheduler&&E9(e.reactionScheduler)}function Y2(e,r,t,n){var a=d7(r);return ef(function(){var i=Mf(e,n)[lr];wh(a).forEach(function(o){i.extend_(o,a[o],t&&o in t?t[o]:!0)})}),e}function t6(e,r){return r6(Mu(e,r))}function r6(e){var r={name:e.name_};return e.observing_&&e.observing_.length>0&&(r.dependencies=j9(e.observing_).map(r6)),r}function I9(e,r){return n6(Mu(e,r))}function n6(e){var r={name:e.name_};return v9(e)&&(r.observers=Array.from(m9(e)).map(n6)),r}function j9(e){return Array.from(new Set(e))}var F9=0;function Y1(){this.message="FLOW_CANCELLED"}Y1.prototype=Object.create(Error.prototype);function D9(e){return e instanceof Y1}var H0=Ow("flow"),B9=Ow("flow.bound",{bound:!0}),Nf=Object.assign(function(r,t){if(Sp(t))return H0.decorate_20223_(r,t);if(Af(t))return _p(r,t,H0);var n=r,a=n.name||"<unnamed flow>",i=function(){var s=this,c=arguments,u=++F9,d=ca(a+" - runid: "+u+" - init",n).apply(s,c),p,y=void 0,f=new Promise(function(_,S){var w=0;p=S;function x(E){y=void 0;var b;try{b=ca(a+" - runid: "+u+" - yield "+w++,d.next).call(d,E)}catch(M){return S(M)}g(b)}function v(E){y=void 0;var b;try{b=ca(a+" - runid: "+u+" - yield "+w++,d.throw).call(d,E)}catch(M){return S(M)}g(b)}function g(E){if(qs(E==null?void 0:E.then)){E.then(g,S);return}return E.done?_(E.value):(y=Promise.resolve(E.value),y.then(x,v))}x(void 0)});return f.cancel=ca(a+" - runid: "+u+" - cancel",function(){try{y&&Py(y);var _=d.return(void 0),S=Promise.resolve(_.value);S.then(ch,ch),Py(S),p(new Y1)}catch(w){p(w)}}),f};return i.isMobXFlow=!0,i},H0);Nf.bound=Wl(B9);function Py(e){qs(e.cancel)&&e.cancel()}function q9(e){return e}function Eh(e){return(e==null?void 0:e.isMobXFlow)===!0}function X2(e,r,t){var n;return io(e)||Vo(e)||V2(e)?n=Zl(e):Ta(e)&&(n=Zl(e,r)),n.dehancer=typeof r=="function"?r:t,function(){n.dehancer=void 0}}function X1(e,r,t){return qs(t)?U9(e,r,t):z9(e,r)}function z9(e,r){return Zl(e).intercept_(r)}function U9(e,r,t){return Zl(e,r).intercept_(t)}function i6(e,r){if(r===void 0)return Lf(e);if(Ta(e)===!1||!e[lr].values_.has(r))return!1;var t=Mu(e,r);return Lf(t)}function H9(e){return i6(e)}function a6(e,r){return i6(e,r)}function o6(e,r){return e?r!==void 0?Ta(e)?e[lr].values_.has(r):!1:Ta(e)||!!e[lr]||z2(e)||k1(e)||Lf(e):!1}function K1(e){return o6(e)}function s6(e,r){return o6(e,r)}function hp(e){if(Ta(e))return e[lr].keys_();if(io(e)||ya(e))return Array.from(e.keys());if(Vo(e))return e.map(function(r,t){return t});Pr(5)}function K2(e){if(Ta(e))return hp(e).map(function(r){return e[r]});if(io(e))return hp(e).map(function(r){return e.get(r)});if(ya(e))return Array.from(e.values());if(Vo(e))return e.slice();Pr(6)}function l6(e){if(Ta(e))return hp(e).map(function(r){return[r,e[r]]});if(io(e))return hp(e).map(function(r){return[r,e.get(r)]});if(ya(e))return Array.from(e.entries());if(Vo(e))return e.map(function(r,t){return[t,r]});Pr(7)}function Z2(e,r,t){if(arguments.length===2&&!ya(e)){ps();var n=r;try{for(var a in n)Z2(e,a,n[a])}finally{gs()}return}Ta(e)?e[lr].set_(r,t):io(e)?e.set(r,t):ya(e)?e.add(r):Vo(e)?(typeof r!="number"&&(r=parseInt(r,10)),r<0&&Pr("Invalid index: '"+r+"'"),ps(),r>=e.length&&(e.length=r+1),e[r]=t,gs()):Pr(8)}function V9(e,r){Ta(e)?e[lr].delete_(r):io(e)||ya(e)?e.delete(r):Vo(e)?(typeof r!="number"&&(r=parseInt(r,10)),e.splice(r,1)):Pr(9)}function u6(e,r){if(Ta(e))return e[lr].has_(r);if(io(e))return e.has(r);if(ya(e))return e.has(r);if(Vo(e))return r>=0&&r<e.length;Pr(10)}function G9(e,r){if(u6(e,r)){if(Ta(e))return e[lr].get_(r);if(io(e))return e.get(r);if(Vo(e))return e[r];Pr(11)}}function Q2(e,r,t){if(Ta(e))return e[lr].defineProperty_(r,t);Pr(39)}function c6(e){if(Ta(e))return e[lr].ownKeys_();Pr(38)}function Z1(e,r,t,n){return qs(t)?$9(e,r,t,n):W9(e,r,t)}function W9(e,r,t){return Zl(e).observe_(r,t)}function $9(e,r,t,n){return Zl(e,r).observe_(t,n)}function o1(e,r,t){return e.set(r,t),t}function oh(e,r){if(e==null||typeof e!="object"||e instanceof Date||!K1(e))return e;if(V2(e)||Lf(e))return oh(e.get(),r);if(r.has(e))return r.get(e);if(Vo(e)){var t=o1(r,e,new Array(e.length));return e.forEach(function(o,s){t[s]=oh(o,r)}),t}if(ya(e)){var n=o1(r,e,new Set);return e.forEach(function(o){n.add(oh(o,r))}),n}if(io(e)){var a=o1(r,e,new Map);return e.forEach(function(o,s){a.set(s,oh(o,r))}),a}else{var i=o1(r,e,{});return c6(e).forEach(function(o){bp.propertyIsEnumerable.call(e,o)&&(i[o]=oh(e[o],r))}),i}}function Y9(e,r){return oh(e,new Map)}function X9(){}function Cu(e,r){r===void 0&&(r=void 0),ps();try{return e.apply(r)}finally{gs()}}function _2(e,r,t){return arguments.length===1||r&&typeof r=="object"?K9(e,r):f6(e,r,t||{})}function f6(e,r,t){var n;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[lr].isDisposed)if(o(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var i=Yc("When-effect",r),o=W2(function(s){var c=H2(!1,e);c&&(s.dispose(),n&&clearTimeout(n),i())},t);return o}function K9(e,r){var t;if(r!=null&&(t=r.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,a,i=new Promise(function(o,s){var c,u=f6(e,o,$c({},r,{onError:s}));n=function(){u(),s(new Error("WHEN_CANCELLED"))},a=function(){u(),s(new Error("WHEN_ABORTED"))},r==null||(c=r.signal)==null||c.addEventListener==null||c.addEventListener("abort",a)}).finally(function(){var o;return r==null||(o=r.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",a)});return i.cancel=n,i}function th(e){return e[lr]}var Z9={has:function(r,t){return th(r).has_(t)},get:function(r,t){return th(r).get_(t)},set:function(r,t,n){var a;return Af(t)?(a=th(r).set_(t,n,!0))!=null?a:!0:!1},deleteProperty:function(r,t){var n;return Af(t)?(n=th(r).delete_(t,!0))!=null?n:!0:!1},defineProperty:function(r,t,n){var a;return(a=th(r).defineProperty_(t,n))!=null?a:!0},ownKeys:function(r){return th(r).ownKeys_()},preventExtensions:function(r){Pr(13)}};function Q9(e,r){var t,n;return mw(),e=Mf(e,r),(n=(t=e[lr]).proxy_)!=null?n:t.proxy_=new Proxy(e,Z9)}function cl(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ep(e,r){var t=e.interceptors_||(e.interceptors_=[]);return t.push(r),yw(function(){var n=t.indexOf(r);n!==-1&&t.splice(n,1)})}function fl(e,r){var t=Rf();try{for(var n=[].concat(e.interceptors_||[]),a=0,i=n.length;a<i&&(r=n[a](r),r&&!r.type&&Pr(14),!!r);a++);return r}finally{fc(t)}}function $l(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Pp(e,r){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(r),yw(function(){var n=t.indexOf(r);n!==-1&&t.splice(n,1)})}function Yl(e,r){var t=Rf(),n=e.changeListeners_;if(n){n=n.slice();for(var a=0,i=n.length;a<i;a++)n[a](r);fc(t)}}function J2(e,r,t){return ef(function(){var n,a=Mf(e,t)[lr];(n=r)!=null||(r=y7(e)),wh(r).forEach(function(i){return a.make_(i,r[i])})}),e}var V0=Symbol("mobx-keys");function J9(e,r,t){return dc(e)?Y2(e,e,r,t):(ef(function(){var n=Mf(e,t)[lr];if(!e[V0]){var a=Object.getPrototypeOf(e),i=new Set([].concat(wh(e),wh(a)));i.delete("constructor"),i.delete(lr),wp(a,V0,i)}e[V0].forEach(function(o){return n.make_(o,r&&o in r?r[o]:!0)})}),e)}var Oy="splice",Tu="update",eS=1e4,tS={get:function(r,t){var n=r[lr];return t===lr?n:t==="length"?n.getArrayLength_():typeof t=="string"&&!isNaN(t)?n.get_(parseInt(t)):cc(L1,t)?L1[t]:r[t]},set:function(r,t,n){var a=r[lr];return t==="length"&&a.setArrayLength_(n),typeof t=="symbol"||isNaN(t)?r[t]=n:a.set_(parseInt(t),n),!0},preventExtensions:function(){Pr(15)}},em=function(){function e(t,n,a,i){t===void 0&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=a,this.legacyMode_=i,this.atom_=new Jc(t),this.enhancer_=function(o,s){return n(o,s,"ObservableArray[..]")}}var r=e.prototype;return r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},r.intercept_=function(n){return Ep(this,n)},r.observe_=function(n,a){return a===void 0&&(a=!1),a&&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}),Pp(this,n)},r.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},r.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&Pr("Out of range: "+n);var a=this.values_.length;if(n!==a)if(n>a){for(var i=new Array(n-a),o=0;o<n-a;o++)i[o]=void 0;this.spliceWithArray_(a,0,i)}else this.spliceWithArray_(n,a-n)},r.updateArrayLength_=function(n,a){n!==this.lastKnownLength_&&Pr(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&v6(n+a+1)},r.spliceWithArray_=function(n,a,i){var o=this;this.atom_;var s=this.values_.length;if(n===void 0?n=0:n>s?n=s:n<0&&(n=Math.max(0,s+n)),arguments.length===1?a=s-n:a==null?a=0:a=Math.max(0,Math.min(a,s-n)),i===void 0&&(i=h2),cl(this)){var c=fl(this,{object:this.proxy_,type:Oy,index:n,removedCount:a,added:i});if(!c)return h2;a=c.removedCount,i=c.added}if(i=i.length===0?i:i.map(function(p){return o.enhancer_(p,void 0)}),this.legacyMode_){var u=i.length-a;this.updateArrayLength_(s,u)}var d=this.spliceItemsIntoValues_(n,a,i);return(a!==0||i.length!==0)&&this.notifyArraySplice_(n,i,d),this.dehanceValues_(d)},r.spliceItemsIntoValues_=function(n,a,i){if(i.length<eS){var o;return(o=this.values_).splice.apply(o,[n,a].concat(i))}else{var s=this.values_.slice(n,n+a),c=this.values_.slice(n+a);this.values_.length+=i.length-a;for(var u=0;u<i.length;u++)this.values_[n+u]=i[u];for(var d=0;d<c.length;d++)this.values_[n+i.length+d]=c[d];return s}},r.notifyArrayChildUpdate_=function(n,a,i){var o=!this.owned_&&sp(),s=$l(this),c=s||o?{observableKind:"array",object:this.proxy_,type:Tu,debugObjectName:this.atom_.name_,index:n,newValue:a,oldValue:i}:null;this.atom_.reportChanged(),s&&Yl(this,c)},r.notifyArraySplice_=function(n,a,i){var o=!this.owned_&&sp(),s=$l(this),c=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Oy,index:n,removed:i,added:a,removedCount:i.length,addedCount:a.length}:null;this.atom_.reportChanged(),s&&Yl(this,c)},r.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])},r.set_=function(n,a){var i=this.values_;if(this.legacyMode_&&n>i.length&&Pr(17,n,i.length),n<i.length){this.atom_;var o=i[n];if(cl(this)){var s=fl(this,{type:Tu,object:this.proxy_,index:n,newValue:a});if(!s)return;a=s.newValue}a=this.enhancer_(a,o);var c=a!==o;c&&(i[n]=a,this.notifyArrayChildUpdate_(n,a,o))}else{for(var u=new Array(n+1-i.length),d=0;d<u.length-1;d++)u[d]=void 0;u[u.length-1]=a,this.spliceWithArray_(i.length,0,u)}},e}();function rS(e,r,t,n){return t===void 0&&(t="ObservableArray"),n===void 0&&(n=!1),mw(),ef(function(){var a=new em(t,r,n,!1);ww(a.values_,lr,a);var i=new Proxy(a.values_,tS);return a.proxy_=i,e&&e.length&&a.spliceWithArray_(0,0,e),i})}var L1={clear:function(){return this.splice(0)},replace:function(r){var t=this[lr];return t.spliceWithArray_(0,t.values_.length,r)},toJSON:function(){return this.slice()},splice:function(r,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o=this[lr];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(r);case 2:return o.spliceWithArray_(r,t)}return o.spliceWithArray_(r,t,a)},spliceWithArray:function(r,t,n){return this[lr].spliceWithArray_(r,t,n)},push:function(){for(var r=this[lr],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r.spliceWithArray_(r.values_.length,0,n),r.values_.length},pop:function(){return this.splice(Math.max(this[lr].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var r=this[lr],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r.spliceWithArray_(0,0,n),r.values_.length},reverse:function(){return Rt.trackingDerivation&&Pr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Rt.trackingDerivation&&Pr(37,"sort");var r=this.slice();return r.sort.apply(r,arguments),this.replace(r),this},remove:function(r){var t=this[lr],n=t.dehanceValues_(t.values_).indexOf(r);return n>-1?(this.splice(n,1),!0):!1}};Kn("at",zs);Kn("concat",zs);Kn("flat",zs);Kn("includes",zs);Kn("indexOf",zs);Kn("join",zs);Kn("lastIndexOf",zs);Kn("slice",zs);Kn("toString",zs);Kn("toLocaleString",zs);Kn("toSorted",zs);Kn("toSpliced",zs);Kn("with",zs);Kn("every",Ql);Kn("filter",Ql);Kn("find",Ql);Kn("findIndex",Ql);Kn("findLast",Ql);Kn("findLastIndex",Ql);Kn("flatMap",Ql);Kn("forEach",Ql);Kn("map",Ql);Kn("some",Ql);Kn("toReversed",Ql);Kn("reduce",h6);Kn("reduceRight",h6);function Kn(e,r){typeof Array.prototype[e]=="function"&&(L1[e]=r(e))}function zs(e){return function(){var r=this[lr];r.atom_.reportObserved();var t=r.dehanceValues_(r.values_);return t[e].apply(t,arguments)}}function Ql(e){return function(r,t){var n=this,a=this[lr];a.atom_.reportObserved();var i=a.dehanceValues_(a.values_);return i[e](function(o,s){return r.call(t,o,s,n)})}}function h6(e){return function(){var r=this,t=this[lr];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(i,o,s){return a(i,o,s,r)},n[e].apply(n,arguments)}}var nS=Qc("ObservableArrayAdministration",em);function Vo(e){return U1(e)&&nS(e[lr])}var iS={},Hc="add",N1="delete",Q1=function(){function e(t,n,a){var i=this;n===void 0&&(n=kf),a===void 0&&(a="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[lr]=iS,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_=a,qs(Map)||Pr(18),ef(function(){i.keysAtom_=fp("ObservableMap.keys()"),i.data_=new Map,i.hasMap_=new Map,t&&i.merge(t)})}var r=e.prototype;return r.has_=function(n){return this.data_.has(n)},r.has=function(n){var a=this;if(!Rt.trackingDerivation)return this.has_(n);var i=this.hasMap_.get(n);if(!i){var o=i=new Gc(this.has_(n),H1,"ObservableMap.key?",!1);this.hasMap_.set(n,o),$2(o,function(){return a.hasMap_.delete(n)})}return i.get()},r.set=function(n,a){var i=this.has_(n);if(cl(this)){var o=fl(this,{type:i?Tu:Hc,object:this,newValue:a,name:n});if(!o)return this;a=o.newValue}return i?this.updateValue_(n,a):this.addValue_(n,a),this},r.delete=function(n){var a=this;if(this.keysAtom_,cl(this)){var i=fl(this,{type:N1,object:this,name:n});if(!i)return!1}if(this.has_(n)){var o=sp(),s=$l(this),c=s||o?{observableKind:"map",debugObjectName:this.name_,type:N1,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Cu(function(){var u;a.keysAtom_.reportChanged(),(u=a.hasMap_.get(n))==null||u.setNewValue_(!1);var d=a.data_.get(n);d.setNewValue_(void 0),a.data_.delete(n)}),s&&Yl(this,c),!0}return!1},r.updateValue_=function(n,a){var i=this.data_.get(n);if(a=i.prepareNewValue_(a),a!==Rt.UNCHANGED){var o=sp(),s=$l(this),c=s||o?{observableKind:"map",debugObjectName:this.name_,type:Tu,object:this,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),s&&Yl(this,c)}},r.addValue_=function(n,a){var i=this;this.keysAtom_,Cu(function(){var u,d=new Gc(a,i.enhancer_,"ObservableMap.key",!1);i.data_.set(n,d),a=d.value_,(u=i.hasMap_.get(n))==null||u.setNewValue_(!0),i.keysAtom_.reportChanged()});var o=sp(),s=$l(this),c=s||o?{observableKind:"map",debugObjectName:this.name_,type:Hc,object:this,name:n,newValue:a}:null;s&&Yl(this,c)},r.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},r.values=function(){var n=this,a=this.keys();return Ay({next:function(){var o=a.next(),s=o.done,c=o.value;return{done:s,value:s?void 0:n.get(c)}}})},r.entries=function(){var n=this,a=this.keys();return Ay({next:function(){var o=a.next(),s=o.done,c=o.value;return{done:s,value:s?void 0:[c,n.get(c)]}}})},r[Symbol.iterator]=function(){return this.entries()},r.forEach=function(n,a){for(var i=fh(this),o;!(o=i()).done;){var s=o.value,c=s[0],u=s[1];n.call(a,u,c,this)}},r.merge=function(n){var a=this;return io(n)&&(n=new Map(n)),Cu(function(){dc(n)?h7(n).forEach(function(i){return a.set(i,n[i])}):Array.isArray(n)?n.forEach(function(i){var o=i[0],s=i[1];return a.set(o,s)}):Th(n)?(f7(n)||Pr(19,n),n.forEach(function(i,o){return a.set(o,i)})):n!=null&&Pr(20,n)}),this},r.clear=function(){var n=this;Cu(function(){G2(function(){for(var a=fh(n.keys()),i;!(i=a()).done;){var o=i.value;n.delete(o)}})})},r.replace=function(n){var a=this;return Cu(function(){for(var i=aS(n),o=new Map,s=!1,c=fh(a.data_.keys()),u;!(u=c()).done;){var d=u.value;if(!i.has(d)){var p=a.delete(d);if(p)s=!0;else{var y=a.data_.get(d);o.set(d,y)}}}for(var f=fh(i.entries()),_;!(_=f()).done;){var S=_.value,w=S[0],x=S[1],v=a.data_.has(w);if(a.set(w,x),a.data_.has(w)){var g=a.data_.get(w);o.set(w,g),v||(s=!0)}}if(!s)if(a.data_.size!==o.size)a.keysAtom_.reportChanged();else for(var E=a.data_.keys(),b=o.keys(),M=E.next(),N=b.next();!M.done;){if(M.value!==N.value){a.keysAtom_.reportChanged();break}M=E.next(),N=b.next()}a.data_=o}),this},r.toString=function(){return"[object ObservableMap]"},r.toJSON=function(){return Array.from(this)},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},Rh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),io=Qc("ObservableMap",Q1);function Ay(e){return e[Symbol.toStringTag]="MapIterator",im(e)}function aS(e){if(Th(e)||io(e))return e;if(Array.isArray(e))return new Map(e);if(dc(e)){var r=new Map;for(var t in e)r.set(t,e[t]);return r}else return Pr(21,e)}var oS={},tm=function(){function e(t,n,a){var i=this;n===void 0&&(n=kf),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[lr]=oS,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_=a,qs(Set)||Pr(22),this.enhancer_=function(o,s){return n(o,s,a)},ef(function(){i.atom_=fp(i.name_),t&&i.replace(t)})}var r=e.prototype;return r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.clear=function(){var n=this;Cu(function(){G2(function(){for(var a=fh(n.data_.values()),i;!(i=a()).done;){var o=i.value;n.delete(o)}})})},r.forEach=function(n,a){for(var i=fh(this),o;!(o=i()).done;){var s=o.value;n.call(a,s,s,this)}},r.add=function(n){var a=this;if(this.atom_,cl(this)){var i=fl(this,{type:Hc,object:this,newValue:n});if(!i)return this;n=i.newValue}if(!this.has(n)){Cu(function(){a.data_.add(a.enhancer_(n,void 0)),a.atom_.reportChanged()});var o=!1,s=$l(this),c=s||o?{observableKind:"set",debugObjectName:this.name_,type:Hc,object:this,newValue:n}:null;s&&Yl(this,c)}return this},r.delete=function(n){var a=this;if(cl(this)){var i=fl(this,{type:N1,object:this,oldValue:n});if(!i)return!1}if(this.has(n)){var o=!1,s=$l(this),c=s||o?{observableKind:"set",debugObjectName:this.name_,type:N1,object:this,oldValue:n}:null;return Cu(function(){a.atom_.reportChanged(),a.data_.delete(n)}),s&&Yl(this,c),!0}return!1},r.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},r.entries=function(){var n=this.values();return Cy({next:function(){var i=n.next(),o=i.value,s=i.done;return s?{value:void 0,done:s}:{value:[o,o],done:s}}})},r.keys=function(){return this.values()},r.values=function(){this.atom_.reportObserved();var n=this,a=this.data_.values();return Cy({next:function(){var o=a.next(),s=o.value,c=o.done;return c?{value:void 0,done:c}:{value:n.dehanceValue_(s),done:c}}})},r.intersection=function(n){if(uc(n)&&!ya(n))return n.intersection(this);var a=new Set(this);return a.intersection(n)},r.union=function(n){if(uc(n)&&!ya(n))return n.union(this);var a=new Set(this);return a.union(n)},r.difference=function(n){return new Set(this).difference(n)},r.symmetricDifference=function(n){if(uc(n)&&!ya(n))return n.symmetricDifference(this);var a=new Set(this);return a.symmetricDifference(n)},r.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},r.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},r.isDisjointFrom=function(n){if(uc(n)&&!ya(n))return n.isDisjointFrom(this);var a=new Set(this);return a.isDisjointFrom(n)},r.replace=function(n){var a=this;return ya(n)&&(n=new Set(n)),Cu(function(){Array.isArray(n)?(a.clear(),n.forEach(function(i){return a.add(i)})):uc(n)?(a.clear(),n.forEach(function(i){return a.add(i)})):n!=null&&Pr("Cannot initialize set from "+n)}),this},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},r.toJSON=function(){return Array.from(this)},r.toString=function(){return"[object ObservableSet]"},r[Symbol.iterator]=function(){return this.values()},Rh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),ya=Qc("ObservableSet",tm);function Cy(e){return e[Symbol.toStringTag]="SetIterator",im(e)}var ky=Object.create(null),Ly="remove",d6=function(){function e(t,n,a,i){n===void 0&&(n=new Map),i===void 0&&(i=$7),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=n,this.name_=a,this.defaultAnnotation_=i,this.keysAtom_=new Jc("ObservableObject.keys"),this.isPlainObject_=dc(this.target_)}var r=e.prototype;return r.getObservablePropValue_=function(n){return this.values_.get(n).get()},r.setObservablePropValue_=function(n,a){var i=this.values_.get(n);if(i instanceof Xl)return i.set(a),!0;if(cl(this)){var o=fl(this,{type:Tu,object:this.proxy_||this.target_,name:n,newValue:a});if(!o)return null;a=o.newValue}if(a=i.prepareNewValue_(a),a!==Rt.UNCHANGED){var s=$l(this),c=!1,u=s||c?{type:Tu,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),s&&Yl(this,u)}return!0},r.get_=function(n){return Rt.trackingDerivation&&!cc(this.target_,n)&&this.has_(n),this.target_[n]},r.set_=function(n,a,i){return i===void 0&&(i=!1),cc(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,a):i?Reflect.set(this.target_,n,a):(this.target_[n]=a,!0):this.extend_(n,{value:a,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,i)},r.has_=function(n){if(!Rt.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var a=this.pendingKeys_.get(n);return a||(a=new Gc(n in this.target_,H1,"ObservableObject.key?",!1),this.pendingKeys_.set(n,a)),a.get()},r.make_=function(n,a){if(a===!0&&(a=this.defaultAnnotation_),a!==!1){if(!(n in this.target_)){var i;if((i=this.target_[ku])!=null&&i[n])return;Pr(1,a.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==bp;){var s=P1(o,n);if(s){var c=a.make_(this,n,s,o);if(c===0)return;if(c===1)break}o=Object.getPrototypeOf(o)}Ty(this,a,n)}},r.extend_=function(n,a,i,o){if(o===void 0&&(o=!1),i===!0&&(i=this.defaultAnnotation_),i===!1)return this.defineProperty_(n,a,o);var s=i.extend_(this,n,a,o);return s&&Ty(this,i,n),s},r.defineProperty_=function(n,a,i){i===void 0&&(i=!1),this.keysAtom_;try{ps();var o=this.delete_(n);if(!o)return o;if(cl(this)){var s=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:a.value});if(!s)return null;var c=s.newValue;a.value!==c&&(a=$c({},a,{value:c}))}if(i){if(!Reflect.defineProperty(this.target_,n,a))return!1}else Nu(this.target_,n,a);this.notifyPropertyAddition_(n,a.value)}finally{gs()}return!0},r.defineObservableProperty_=function(n,a,i,o){o===void 0&&(o=!1),this.keysAtom_;try{ps();var s=this.delete_(n);if(!s)return s;if(cl(this)){var c=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:a});if(!c)return null;a=c.newValue}var u=Ny(n),d={configurable:Rt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(o){if(!Reflect.defineProperty(this.target_,n,d))return!1}else Nu(this.target_,n,d);var p=new Gc(a,i,"ObservableObject.key",!1);this.values_.set(n,p),this.notifyPropertyAddition_(n,p.value_)}finally{gs()}return!0},r.defineComputedProperty_=function(n,a,i){i===void 0&&(i=!1),this.keysAtom_;try{ps();var o=this.delete_(n);if(!o)return o;if(cl(this)){var s=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:void 0});if(!s)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var c=Ny(n),u={configurable:Rt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:c.get,set:c.set};if(i){if(!Reflect.defineProperty(this.target_,n,u))return!1}else Nu(this.target_,n,u);this.values_.set(n,new Xl(a)),this.notifyPropertyAddition_(n,void 0)}finally{gs()}return!0},r.delete_=function(n,a){if(a===void 0&&(a=!1),this.keysAtom_,!cc(this.target_,n))return!0;if(cl(this)){var i=fl(this,{object:this.proxy_||this.target_,name:n,type:Ly});if(!i)return null}try{var o;ps();var s=$l(this),c=!1,u=this.values_.get(n),d=void 0;if(!u&&(s||c)){var p;d=(p=P1(this.target_,n))==null?void 0:p.value}if(a){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(u&&(this.values_.delete(n),u instanceof Gc&&(d=u.value_),Hw(u)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),s||c){var y={type:Ly,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:n};s&&Yl(this,y)}}finally{gs()}return!0},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},r.notifyPropertyAddition_=function(n,a){var i,o=$l(this),s=!1;if(o||s){var c=o||s?{type:Hc,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:a}:null;o&&Yl(this,c)}(i=this.pendingKeys_)==null||(i=i.get(n))==null||i.set(!0),this.keysAtom_.reportChanged()},r.ownKeys_=function(){return this.keysAtom_.reportObserved(),wh(this.target_)},r.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Mf(e,r){var t;if(cc(e,lr))return e;var n=(t=r==null?void 0:r.name)!=null?t:"ObservableObject",a=new d6(e,new Map,String(n),i9(r));return wp(e,lr,a),e}var sS=Qc("ObservableObjectAdministration",d6);function Ny(e){return ky[e]||(ky[e]={get:function(){return this[lr].getObservablePropValue_(e)},set:function(t){return this[lr].setObservablePropValue_(e,t)}})}function Ta(e){return U1(e)?sS(e[lr]):!1}function Ty(e,r,t){var n;(n=e.target_[ku])==null||delete n[t]}var lS=g6(0),uS=function(){var e=!1,r={};return Object.defineProperty(r,"0",{set:function(){e=!0}}),Object.create(r)[0]=1,e===!1}(),G0=0,p6=function(){};function cS(e,r){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,r):e.prototype.__proto__!==void 0?e.prototype.__proto__=r:e.prototype=r}cS(p6,Array.prototype);var rm=function(e){function r(n,a,i,o){var s;return i===void 0&&(i="ObservableArray"),o===void 0&&(o=!1),s=e.call(this)||this,ef(function(){var c=new em(i,a,o,!0);c.proxy_=s,ww(s,lr,c),n&&n.length&&s.spliceWithArray(0,0,n),uS&&Object.defineProperty(s,"0",lS)}),s}xw(r,e);var t=r.prototype;return t.concat=function(){this[lr].atom_.reportObserved();for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),i.map(function(s){return Vo(s)?s.slice():s}))},t[Symbol.iterator]=function(){var n=this,a=0;return im({next:function(){return a<n.length?{value:n[a++],done:!1}:{done:!0,value:void 0}}})},Rh(r,[{key:"length",get:function(){return this[lr].getArrayLength_()},set:function(a){this[lr].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(p6);Object.entries(L1).forEach(function(e){var r=e[0],t=e[1];r!=="concat"&&wp(rm.prototype,r,t)});function g6(e){return{enumerable:!1,configurable:!0,get:function(){return this[lr].get_(e)},set:function(t){this[lr].set_(e,t)}}}function fS(e){Nu(rm.prototype,""+e,g6(e))}function v6(e){if(e>G0){for(var r=G0;r<e+100;r++)fS(r);G0=e}}v6(1e3);function hS(e,r,t){return new rm(e,r,t)}function Mu(e,r){if(typeof e=="object"&&e!==null){if(Vo(e))return r!==void 0&&Pr(23),e[lr].atom_;if(ya(e))return e.atom_;if(io(e)){if(r===void 0)return e.keysAtom_;var t=e.data_.get(r)||e.hasMap_.get(r);return t||Pr(25,r,T1(e)),t}if(Ta(e)){if(!r)return Pr(26);var n=e[lr].values_.get(r);return n||Pr(27,r,T1(e)),n}if(z2(e)||Lf(e)||k1(e))return e}else if(qs(e)&&k1(e[lr]))return e[lr];Pr(28)}function Zl(e,r){if(e||Pr(29),r!==void 0)return Zl(Mu(e,r));if(z2(e)||Lf(e)||k1(e)||io(e)||ya(e))return e;if(e[lr])return e[lr];Pr(24,e)}function T1(e,r){var t;if(r!==void 0)t=Mu(e,r);else{if(xh(e))return e.name;Ta(e)||io(e)||ya(e)?t=Zl(e):t=Mu(e)}return t.name_}function ef(e){var r=Rf(),t=G1(!0);ps();try{return e()}finally{gs(),W1(t),fc(r)}}var Ry=bp.toString;function nm(e,r,t){return t===void 0&&(t=-1),S2(e,r,t)}function S2(e,r,t,n,a){if(e===r)return e!==0||1/e===1/r;if(e==null||r==null)return!1;if(e!==e)return r!==r;var i=typeof e;if(i!=="function"&&i!=="object"&&typeof r!="object")return!1;var o=Ry.call(e);if(o!==Ry.call(r))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+r;case"[object Number]":return+e!=+e?+r!=+r:+e==0?1/+e===1/r:+e==+r;case"[object Date]":case"[object Boolean]":return+e==+r;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(r);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=My(e),r=My(r);var s=o==="[object Array]";if(!s){if(typeof e!="object"||typeof r!="object")return!1;var c=e.constructor,u=r.constructor;if(c!==u&&!(qs(c)&&c instanceof c&&qs(u)&&u instanceof u)&&"constructor"in e&&"constructor"in r)return!1}if(t===0)return!1;t<0&&(t=-1),n=n||[],a=a||[];for(var d=n.length;d--;)if(n[d]===e)return a[d]===r;if(n.push(e),a.push(r),s){if(d=e.length,d!==r.length)return!1;for(;d--;)if(!S2(e[d],r[d],t-1,n,a))return!1}else{var p=Object.keys(e),y=p.length;if(Object.keys(r).length!==y)return!1;for(var f=0;f<y;f++){var _=p[f];if(!(cc(r,_)&&S2(e[_],r[_],t-1,n,a)))return!1}}return n.pop(),a.pop(),!0}function My(e){return Vo(e)?e.slice():Th(e)||io(e)||uc(e)||ya(e)?Array.from(e.entries()):e}var Iy,dS=((Iy=z1().Iterator)==null?void 0:Iy.prototype)||{};function im(e){return e[Symbol.iterator]=pS,Object.assign(Object.create(dS),e)}function pS(){return this}["Symbol","Map","Set"].forEach(function(e){var r=z1();typeof r[e]>"u"&&Pr("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Gw,extras:{getDebugName:T1},$mobx:lr});const gS=Object.freeze(Object.defineProperty({__proto__:null,$mobx:lr,FlowCancellationError:Y1,ObservableMap:Q1,ObservableSet:tm,Reaction:Kl,_allowStateChanges:H2,_allowStateChangesInsideComputed:Sh,_allowStateReadsEnd:ph,_allowStateReadsStart:$1,_autoAction:_h,_endAction:Iw,_getAdministration:Zl,_getGlobalState:Bw,_interceptReads:X2,_isComputingDerivation:f9,_resetGlobalState:g9,_startAction:Mw,action:ca,autorun:W2,comparer:Cf,computed:Tf,configure:e6,createAtom:fp,defineProperty:Q2,entries:l6,extendObservable:Y2,flow:Nf,flowResult:q9,get:G9,getAtom:Mu,getDebugName:T1,getDependencyTree:t6,getObserverTree:I9,has:u6,intercept:X1,isAction:xh,isBoxedObservable:V2,isComputed:H9,isComputedProp:a6,isFlow:Eh,isFlowCancellationError:D9,isObservable:K1,isObservableArray:Vo,isObservableMap:io,isObservableObject:Ta,isObservableProp:s6,isObservableSet:ya,keys:hp,makeAutoObservable:J9,makeObservable:J2,observable:Rn,observe:Z1,onBecomeObserved:Qw,onBecomeUnobserved:$2,onReactionError:_9,override:P7,ownKeys:c6,reaction:Zw,remove:V9,runInAction:Sh,set:Z2,spy:Gw,toJS:Y9,trace:X9,transaction:Cu,untracked:G2,values:K2,when:_2},Symbol.toStringTag,{value:"Module"}));if(!ri.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!J2)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var vS=pw();function mS(e){e()}function m6(e){e||(e=mS),e6({reactionScheduler:e})}var yS=function(){return!0};function bS(e){return t6(e)}var y6=!1;function b6(e){y6=e}function am(){return y6}var wS=1e4,_S=1e4,SS=function(){function e(r){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:r}),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=wS),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var a=Date.now();t.registrations.forEach(function(i,o){a-i.registeredAt>=n&&(t.finalize(i.value),t.registrations.delete(o))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.registrations.delete(r)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,_S))}}),e}(),xS=typeof FinalizationRegistry<"u"?FinalizationRegistry:SS,R1=new xS(function(e){var r;(r=e.reaction)===null||r===void 0||r.dispose(),e.reaction=null}),W0={exports:{}},$0={};/**
|
|
35
|
+
* @license React
|
|
36
|
+
* use-sync-external-store-shim.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var jy;function ES(){if(jy)return $0;jy=1;var e=ni();function r(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var t=typeof Object.is=="function"?Object.is:r,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function s(p,y){var f=y(),_=n({inst:{value:f,getSnapshot:y}}),S=_[0].inst,w=_[1];return i(function(){S.value=f,S.getSnapshot=y,c(S)&&w({inst:S})},[p,f,y]),a(function(){return c(S)&&w({inst:S}),p(function(){c(S)&&w({inst:S})})},[p]),o(f),f}function c(p){var y=p.getSnapshot;p=p.value;try{var f=y();return!t(p,f)}catch{return!0}}function u(p,y){return y()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return $0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,$0}var Fy;function PS(){return Fy||(Fy=1,W0.exports=ES()),W0.exports}var OS=PS();function Dy(e){e.reaction=new Kl("observer".concat(e.name),function(){var r;e.stateVersion=Symbol(),(r=e.onStoreChange)===null||r===void 0||r.call(e)})}function om(e,r){if(r===void 0&&(r="observed"),am())return e();var t=Vr.useRef(null);if(!t.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:r,subscribe:function(s){return R1.unregister(n),n.onStoreChange=s,n.reaction||(Dy(n),n.stateVersion=Symbol()),function(){var c;n.onStoreChange=null,(c=n.reaction)===null||c===void 0||c.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};t.current=n}var a=t.current;a.reaction||(Dy(a),R1.register(t,a,a)),Vr.useDebugValue(a.reaction,bS),OS.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var i,o;if(a.reaction.track(function(){try{i=e()}catch(s){o=s}}),o)throw o;return i}var Y0,X0,w6=typeof Symbol=="function"&&Symbol.for,AS=(X0=(Y0=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Y0===void 0?void 0:Y0.configurable)!==null&&X0!==void 0?X0:!1,By=w6?Symbol.for("react.forward_ref"):typeof ri.forwardRef=="function"&&ri.forwardRef(function(e){return null}).$$typeof,qy=w6?Symbol.for("react.memo"):typeof ri.memo=="function"&&ri.memo(function(e){return null}).$$typeof;function CS(e,r){var t;if(qy&&e.$$typeof===qy)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(am())return e;var n=(t=r==null?void 0:r.forwardRef)!==null&&t!==void 0?t:!1,a=e,i=e.displayName||e.name;if(By&&e.$$typeof===By&&(n=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(s,c){return om(function(){return a(s,c)},i)};return o.displayName=e.displayName,AS&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=ri.forwardRef(o)),o=ri.memo(o),LS(e,o),o}var kS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function LS(e,r){Object.keys(e).forEach(function(t){kS[t]||Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}function _6(e){var r=e.children,t=e.render;r&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var n=r||t;return typeof n!="function"?null:om(n)}_6.displayName="Observer";function NS(e,r){return ri.useState(function(){return Rn(e(),r,{autoBind:!0})})[0]}function S6(e){var r=ri.useState(function(){return Rn(e,{},{deep:!1})})[0];return Sh(function(){Object.assign(r,e)}),r}function TS(e,r){var t=r&&S6(r);return ri.useState(function(){return Rn(e(t),void 0,{autoBind:!0})})[0]}var K0;m6(vS.unstable_batchedUpdates);var RS=(K0=R1.finalizeAllImmediately)!==null&&K0!==void 0?K0:function(){};function MS(e,r){return r===void 0&&(r="observed"),om(e,r)}function IS(e){b6(e)}const jS=Object.freeze(Object.defineProperty({__proto__:null,Observer:_6,_observerFinalizationRegistry:R1,clearTimers:RS,enableStaticRendering:b6,isObserverBatched:yS,isUsingStaticRendering:am,observer:CS,observerBatching:m6,useAsObservableSource:S6,useLocalObservable:NS,useLocalStore:TS,useObserver:MS,useStaticRendering:IS},Symbol.toStringTag,{value:"Module"})),Us=Zc(jS);var yf={};const vs=Zc(gS);var m1={exports:{}},Zh={},Z0={},Q0={},zy;function Tr(){return zy||(zy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const r=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof bh<"u"?bh:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.20",isBrowser:t(),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle(a){return e.Konva.angleDeg?a*r:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var a;return(a=e.Konva.Transformer)===null||a===void 0?void 0:a.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(a){e.glob.Konva=a}};const n=a=>{e.Konva[a.prototype.getClassName()]=a};e._registerNode=n,e.Konva._injectGlobal(e.Konva)}(Q0)),Q0}var J0={},Uy;function ki(){return Uy||(Uy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const r=Tr();class t{constructor(E=[1,0,0,1,0,0]){this.dirty=!1,this.m=E&&E.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t(this.m)}copyInto(E){E.m[0]=this.m[0],E.m[1]=this.m[1],E.m[2]=this.m[2],E.m[3]=this.m[3],E.m[4]=this.m[4],E.m[5]=this.m[5]}point(E){const b=this.m;return{x:b[0]*E.x+b[2]*E.y+b[4],y:b[1]*E.x+b[3]*E.y+b[5]}}translate(E,b){return this.m[4]+=this.m[0]*E+this.m[2]*b,this.m[5]+=this.m[1]*E+this.m[3]*b,this}scale(E,b){return this.m[0]*=E,this.m[1]*=E,this.m[2]*=b,this.m[3]*=b,this}rotate(E){const b=Math.cos(E),M=Math.sin(E),N=this.m[0]*b+this.m[2]*M,R=this.m[1]*b+this.m[3]*M,F=this.m[0]*-M+this.m[2]*b,j=this.m[1]*-M+this.m[3]*b;return this.m[0]=N,this.m[1]=R,this.m[2]=F,this.m[3]=j,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(E,b){const M=this.m[0]+this.m[2]*b,N=this.m[1]+this.m[3]*b,R=this.m[2]+this.m[0]*E,F=this.m[3]+this.m[1]*E;return this.m[0]=M,this.m[1]=N,this.m[2]=R,this.m[3]=F,this}multiply(E){const b=this.m[0]*E.m[0]+this.m[2]*E.m[1],M=this.m[1]*E.m[0]+this.m[3]*E.m[1],N=this.m[0]*E.m[2]+this.m[2]*E.m[3],R=this.m[1]*E.m[2]+this.m[3]*E.m[3],F=this.m[0]*E.m[4]+this.m[2]*E.m[5]+this.m[4],j=this.m[1]*E.m[4]+this.m[3]*E.m[5]+this.m[5];return this.m[0]=b,this.m[1]=M,this.m[2]=N,this.m[3]=R,this.m[4]=F,this.m[5]=j,this}invert(){const E=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),b=this.m[3]*E,M=-this.m[1]*E,N=-this.m[2]*E,R=this.m[0]*E,F=E*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),j=E*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=b,this.m[1]=M,this.m[2]=N,this.m[3]=R,this.m[4]=F,this.m[5]=j,this}getMatrix(){return this.m}decompose(){const E=this.m[0],b=this.m[1],M=this.m[2],N=this.m[3],R=this.m[4],F=this.m[5],j=E*N-b*M,O={x:R,y:F,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(E!=0||b!=0){const C=Math.sqrt(E*E+b*b);O.rotation=b>0?Math.acos(E/C):-Math.acos(E/C),O.scaleX=C,O.scaleY=j/C,O.skewX=(E*M+b*N)/j,O.skewY=0}else if(M!=0||N!=0){const C=Math.sqrt(M*M+N*N);O.rotation=Math.PI/2-(N>0?Math.acos(-M/C):-Math.acos(M/C)),O.scaleX=j/C,O.scaleY=C,O.skewX=0,O.skewY=(E*M+b*N)/j}return O.rotation=e.Util._getRotation(O.rotation),O}}e.Transform=t;const n="[object Array]",a="[object Number]",i="[object String]",o="[object Boolean]",s=Math.PI/180,c=180/Math.PI,u="#",d="",p="0",y="Konva warning: ",f="Konva error: ",_="rgb(",S={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]},w=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let x=[];const v=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(g){setTimeout(g,60)};e.Util={_isElement(g){return!!(g&&g.nodeType==1)},_isFunction(g){return!!(g&&g.constructor&&g.call&&g.apply)},_isPlainObject(g){return!!g&&g.constructor===Object},_isArray(g){return Object.prototype.toString.call(g)===n},_isNumber(g){return Object.prototype.toString.call(g)===a&&!isNaN(g)&&isFinite(g)},_isString(g){return Object.prototype.toString.call(g)===i},_isBoolean(g){return Object.prototype.toString.call(g)===o},isObject(g){return g instanceof Object},isValidSelector(g){if(typeof g!="string")return!1;const E=g[0];return E==="#"||E==="."||E===E.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){x.push(g),x.length===1&&v(function(){const E=x;x=[],E.forEach(function(b){b()})})},createCanvasElement(){const g=document.createElement("canvas");try{g.style=g.style||{}}catch{}return g},createImageElement(){return document.createElement("img")},_isInDocument(g){for(;g=g.parentNode;)if(g==document)return!0;return!1},_urlToImage(g,E){const b=e.Util.createImageElement();b.onload=function(){E(b)},b.src=g},_rgbToHex(g,E,b){return((1<<24)+(g<<16)+(E<<8)+b).toString(16).slice(1)},_hexToRgb(g){g=g.replace(u,d);const E=parseInt(g,16);return{r:E>>16&255,g:E>>8&255,b:E&255}},getRandomColor(){let g=(Math.random()*16777215<<0).toString(16);for(;g.length<6;)g=p+g;return u+g},getRGB(g){let E;return g in S?(E=S[g],{r:E[0],g:E[1],b:E[2]}):g[0]===u?this._hexToRgb(g.substring(1)):g.substr(0,4)===_?(E=w.exec(g.replace(/ /g,"")),{r:parseInt(E[1],10),g:parseInt(E[2],10),b:parseInt(E[3],10)}):{r:0,g:0,b:0}},colorToRGBA(g){return g=g||"black",e.Util._namedColorToRBA(g)||e.Util._hex3ColorToRGBA(g)||e.Util._hex4ColorToRGBA(g)||e.Util._hex6ColorToRGBA(g)||e.Util._hex8ColorToRGBA(g)||e.Util._rgbColorToRGBA(g)||e.Util._rgbaColorToRGBA(g)||e.Util._hslColorToRGBA(g)},_namedColorToRBA(g){const E=S[g.toLowerCase()];return E?{r:E[0],g:E[1],b:E[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];const E=g.split(/ *, */).map(Number);return{r:E[0],g:E[1],b:E[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];const E=g.split(/ *, */).map((b,M)=>b.slice(-1)==="%"?M===3?parseInt(b)/100:parseInt(b)/100*255:Number(b));return{r:E[0],g:E[1],b:E[2],a:E[3]}}},_hex8ColorToRGBA(g){if(g[0]==="#"&&g.length===9)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:parseInt(g.slice(7,9),16)/255}},_hex6ColorToRGBA(g){if(g[0]==="#"&&g.length===7)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:1}},_hex4ColorToRGBA(g){if(g[0]==="#"&&g.length===5)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:parseInt(g[4]+g[4],16)/255}},_hex3ColorToRGBA(g){if(g[0]==="#"&&g.length===4)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:1}},_hslColorToRGBA(g){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(g)){const[E,...b]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(g),M=Number(b[0])/360,N=Number(b[1])/100,R=Number(b[2])/100;let F,j,O;if(N===0)return O=R*255,{r:Math.round(O),g:Math.round(O),b:Math.round(O),a:1};R<.5?F=R*(1+N):F=R+N-R*N;const C=2*R-F,A=[0,0,0];for(let k=0;k<3;k++)j=M+1/3*-(k-1),j<0&&j++,j>1&&j--,6*j<1?O=C+(F-C)*6*j:2*j<1?O=F:3*j<2?O=C+(F-C)*(2/3-j)*6:O=C,A[k]=O*255;return{r:Math.round(A[0]),g:Math.round(A[1]),b:Math.round(A[2]),a:1}}},haveIntersection(g,E){return!(E.x>g.x+g.width||E.x+E.width<g.x||E.y>g.y+g.height||E.y+E.height<g.y)},cloneObject(g){const E={};for(const b in g)this._isPlainObject(g[b])?E[b]=this.cloneObject(g[b]):this._isArray(g[b])?E[b]=this.cloneArray(g[b]):E[b]=g[b];return E},cloneArray(g){return g.slice(0)},degToRad(g){return g*s},radToDeg(g){return g*c},_degToRad(g){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(g)},_radToDeg(g){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(g)},_getRotation(g){return r.Konva.angleDeg?e.Util.radToDeg(g):g},_capitalize(g){return g.charAt(0).toUpperCase()+g.slice(1)},throw(g){throw new Error(f+g)},error(g){console.error(f+g)},warn(g){r.Konva.showWarnings&&console.warn(y+g)},each(g,E){for(const b in g)E(b,g[b])},_inRange(g,E,b){return E<=g&&g<b},_getProjectionToSegment(g,E,b,M,N,R){let F,j,O;const C=(g-b)*(g-b)+(E-M)*(E-M);if(C==0)F=g,j=E,O=(N-b)*(N-b)+(R-M)*(R-M);else{const A=((N-g)*(b-g)+(R-E)*(M-E))/C;A<0?(F=g,j=E,O=(g-N)*(g-N)+(E-R)*(E-R)):A>1?(F=b,j=M,O=(b-N)*(b-N)+(M-R)*(M-R)):(F=g+A*(b-g),j=E+A*(M-E),O=(F-N)*(F-N)+(j-R)*(j-R))}return[F,j,O]},_getProjectionToLine(g,E,b){const M=e.Util.cloneObject(g);let N=Number.MAX_VALUE;return E.forEach(function(R,F){if(!b&&F===E.length-1)return;const j=E[(F+1)%E.length],O=e.Util._getProjectionToSegment(R.x,R.y,j.x,j.y,g.x,g.y),C=O[0],A=O[1],k=O[2];k<N&&(M.x=C,M.y=A,N=k)}),M},_prepareArrayForTween(g,E,b){const M=[],N=[];if(g.length>E.length){const F=E;E=g,g=F}for(let F=0;F<g.length;F+=2)M.push({x:g[F],y:g[F+1]});for(let F=0;F<E.length;F+=2)N.push({x:E[F],y:E[F+1]});const R=[];return N.forEach(function(F){const j=e.Util._getProjectionToLine(F,M,b);R.push(j.x),R.push(j.y)}),R},_prepareToStringify(g){let E;g.visitedByCircularReferenceRemoval=!0;for(const b in g)if(g.hasOwnProperty(b)&&g[b]&&typeof g[b]=="object"){if(E=Object.getOwnPropertyDescriptor(g,b),g[b].visitedByCircularReferenceRemoval||e.Util._isElement(g[b]))if(E.configurable)delete g[b];else return null;else if(e.Util._prepareToStringify(g[b])===null)if(E.configurable)delete g[b];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,E){for(const b in E)g[b]=E[b];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){r.Konva.releaseCanvasOnDestroy&&g.forEach(E=>{E.width=0,E.height=0})},drawRoundedRectPath(g,E,b,M){let N=0,R=0,F=0,j=0;typeof M=="number"?N=R=F=j=Math.min(M,E/2,b/2):(N=Math.min(M[0]||0,E/2,b/2),R=Math.min(M[1]||0,E/2,b/2),j=Math.min(M[2]||0,E/2,b/2),F=Math.min(M[3]||0,E/2,b/2)),g.moveTo(N,0),g.lineTo(E-R,0),g.arc(E-R,R,R,Math.PI*3/2,0,!1),g.lineTo(E,b-j),g.arc(E-j,b-j,j,0,Math.PI/2,!1),g.lineTo(F,b),g.arc(F,b-F,F,Math.PI/2,Math.PI,!1),g.lineTo(0,N),g.arc(N,N,N,Math.PI,Math.PI*3/2,!1)}}}(J0)),J0}var Qh={},eg={},ds={},Hy;function Gr(){if(Hy)return ds;Hy=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.RGBComponent=n,ds.alphaComponent=a,ds.getNumberValidator=i,ds.getNumberOrArrayOfNumbersValidator=o,ds.getNumberOrAutoValidator=s,ds.getStringValidator=c,ds.getStringOrGradientValidator=u,ds.getFunctionValidator=d,ds.getNumberArrayValidator=p,ds.getBooleanValidator=y,ds.getComponentValidator=f;const e=Tr(),r=ki();function t(_){return r.Util._isString(_)?'"'+_+'"':Object.prototype.toString.call(_)==="[object Number]"||r.Util._isBoolean(_)?_:Object.prototype.toString.call(_)}function n(_){return _>255?255:_<0?0:Math.round(_)}function a(_){return _>1?1:_<1e-4?1e-4:_}function i(){if(e.Konva.isUnminified)return function(_,S){return r.Util._isNumber(_)||r.Util.warn(t(_)+' is a not valid value for "'+S+'" attribute. The value should be a number.'),_}}function o(_){if(e.Konva.isUnminified)return function(S,w){let x=r.Util._isNumber(S),v=r.Util._isArray(S)&&S.length==_;return!x&&!v&&r.Util.warn(t(S)+' is a not valid value for "'+w+'" attribute. The value should be a number or Array<number>('+_+")"),S}}function s(){if(e.Konva.isUnminified)return function(_,S){var w=r.Util._isNumber(_),x=_==="auto";return w||x||r.Util.warn(t(_)+' is a not valid value for "'+S+'" attribute. The value should be a number or "auto".'),_}}function c(){if(e.Konva.isUnminified)return function(_,S){return r.Util._isString(_)||r.Util.warn(t(_)+' is a not valid value for "'+S+'" attribute. The value should be a string.'),_}}function u(){if(e.Konva.isUnminified)return function(_,S){const w=r.Util._isString(_),x=Object.prototype.toString.call(_)==="[object CanvasGradient]"||_&&_.addColorStop;return w||x||r.Util.warn(t(_)+' is a not valid value for "'+S+'" attribute. The value should be a string or a native gradient.'),_}}function d(){if(e.Konva.isUnminified)return function(_,S){return r.Util._isFunction(_)||r.Util.warn(t(_)+' is a not valid value for "'+S+'" attribute. The value should be a function.'),_}}function p(){if(e.Konva.isUnminified)return function(_,S){const w=Int8Array?Object.getPrototypeOf(Int8Array):null;return w&&_ instanceof w||(r.Util._isArray(_)?_.forEach(function(x){r.Util._isNumber(x)||r.Util.warn('"'+S+'" attribute has non numeric element '+x+". Make sure that all elements are numbers.")}):r.Util.warn(t(_)+' is a not valid value for "'+S+'" attribute. The value should be a array of numbers.')),_}}function y(){if(e.Konva.isUnminified)return function(_,S){var w=_===!0||_===!1;return w||r.Util.warn(t(_)+' is a not valid value for "'+S+'" attribute. The value should be a boolean.'),_}}function f(_){if(e.Konva.isUnminified)return function(S,w){return S==null||r.Util.isObject(S)||r.Util.warn(t(S)+' is a not valid value for "'+w+'" attribute. The value should be an object with properties '+_),S}}return ds}var Vy;function zr(){return Vy||(Vy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const r=ki(),t=Gr(),n="get",a="set";e.Factory={addGetterSetter(i,o,s,c,u){e.Factory.addGetter(i,o,s),e.Factory.addSetter(i,o,c,u),e.Factory.addOverloadedGetterSetter(i,o)},addGetter(i,o,s){var c=n+r.Util._capitalize(o);i.prototype[c]=i.prototype[c]||function(){const u=this.attrs[o];return u===void 0?s:u}},addSetter(i,o,s,c){var u=a+r.Util._capitalize(o);i.prototype[u]||e.Factory.overWriteSetter(i,o,s,c)},overWriteSetter(i,o,s,c){var u=a+r.Util._capitalize(o);i.prototype[u]=function(d){return s&&d!==void 0&&d!==null&&(d=s.call(this,d,o)),this._setAttr(o,d),c&&c.call(this),this}},addComponentsGetterSetter(i,o,s,c,u){const d=s.length,p=r.Util._capitalize,y=n+p(o),f=a+p(o);i.prototype[y]=function(){const S={};for(let w=0;w<d;w++){const x=s[w];S[x]=this.getAttr(o+p(x))}return S};const _=(0,t.getComponentValidator)(s);i.prototype[f]=function(S){const w=this.attrs[o];c&&(S=c.call(this,S,o)),_&&_.call(this,S,o);for(const x in S)S.hasOwnProperty(x)&&this._setAttr(o+p(x),S[x]);return S||s.forEach(x=>{this._setAttr(o+p(x),void 0)}),this._fireChangeEvent(o,w,S),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(i,o)},addOverloadedGetterSetter(i,o){var s=r.Util._capitalize(o),c=a+s,u=n+s;i.prototype[o]=function(){return arguments.length?(this[c](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(i,o,s,c){r.Util.error("Adding deprecated "+o);const u=n+r.Util._capitalize(o),d=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";i.prototype[u]=function(){r.Util.error(d);const p=this.attrs[o];return p===void 0?s:p},e.Factory.addSetter(i,o,c,function(){r.Util.error(d)}),e.Factory.addOverloadedGetterSetter(i,o)},backCompat(i,o){r.Util.each(o,function(s,c){const u=i.prototype[c],d=n+r.Util._capitalize(s),p=a+r.Util._capitalize(s);function y(){u.apply(this,arguments),r.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+c+'" instead.')}i.prototype[s]=y,i.prototype[d]=y,i.prototype[p]=y})},afterSetFilter(){this._filterUpToDate=!1}}}(eg)),eg}var ec={},tc={},Gy;function x6(){if(Gy)return tc;Gy=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.HitContext=tc.SceneContext=tc.Context=void 0;const e=ki(),r=Tr();function t(x){const v=[],g=x.length,E=e.Util;for(let b=0;b<g;b++){let M=x[b];E._isNumber(M)?M=Math.round(M*1e3)/1e3:E._isString(M)||(M=M+""),v.push(M)}return v}const n=",",a="(",i=")",o="([",s="])",c=";",u="()",d="=",p=["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"],y=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],f=100;let _=class{constructor(v){this.canvas=v,r.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(v){v.fillEnabled()&&this._fill(v)}_fill(v){}strokeShape(v){v.hasStroke()&&this._stroke(v)}_stroke(v){}fillStrokeShape(v){v.attrs.fillAfterStrokeEnabled?(this.strokeShape(v),this.fillShape(v)):(this.fillShape(v),this.strokeShape(v))}getTrace(v,g){let E=this.traceArr,b=E.length,M="",N,R,F,j;for(N=0;N<b;N++)R=E[N],F=R.method,F?(j=R.args,M+=F,v?M+=u:e.Util._isArray(j[0])?M+=o+j.join(n)+s:(g&&(j=j.map(O=>typeof O=="number"?Math.floor(O):O)),M+=a+j.join(n)+i)):(M+=R.property,v||(M+=d+R.val)),M+=c;return M}clearTrace(){this.traceArr=[]}_trace(v){let g=this.traceArr,E;g.push(v),E=g.length,E>=f&&g.shift()}reset(){const v=this.getCanvas().getPixelRatio();this.setTransform(1*v,0,0,1*v,0,0)}getCanvas(){return this.canvas}clear(v){const g=this.getCanvas();v?this.clearRect(v.x||0,v.y||0,v.width||0,v.height||0):this.clearRect(0,0,g.getWidth()/g.pixelRatio,g.getHeight()/g.pixelRatio)}_applyLineCap(v){const g=v.attrs.lineCap;g&&this.setAttr("lineCap",g)}_applyOpacity(v){const g=v.getAbsoluteOpacity();g!==1&&this.setAttr("globalAlpha",g)}_applyLineJoin(v){const g=v.attrs.lineJoin;g&&this.setAttr("lineJoin",g)}setAttr(v,g){this._context[v]=g}arc(v,g,E,b,M,N){this._context.arc(v,g,E,b,M,N)}arcTo(v,g,E,b,M){this._context.arcTo(v,g,E,b,M)}beginPath(){this._context.beginPath()}bezierCurveTo(v,g,E,b,M,N){this._context.bezierCurveTo(v,g,E,b,M,N)}clearRect(v,g,E,b){this._context.clearRect(v,g,E,b)}clip(...v){this._context.clip.apply(this._context,v)}closePath(){this._context.closePath()}createImageData(v,g){const E=arguments;if(E.length===2)return this._context.createImageData(v,g);if(E.length===1)return this._context.createImageData(v)}createLinearGradient(v,g,E,b){return this._context.createLinearGradient(v,g,E,b)}createPattern(v,g){return this._context.createPattern(v,g)}createRadialGradient(v,g,E,b,M,N){return this._context.createRadialGradient(v,g,E,b,M,N)}drawImage(v,g,E,b,M,N,R,F,j){const O=arguments,C=this._context;O.length===3?C.drawImage(v,g,E):O.length===5?C.drawImage(v,g,E,b,M):O.length===9&&C.drawImage(v,g,E,b,M,N,R,F,j)}ellipse(v,g,E,b,M,N,R,F){this._context.ellipse(v,g,E,b,M,N,R,F)}isPointInPath(v,g,E,b){return E?this._context.isPointInPath(E,v,g,b):this._context.isPointInPath(v,g,b)}fill(...v){this._context.fill.apply(this._context,v)}fillRect(v,g,E,b){this._context.fillRect(v,g,E,b)}strokeRect(v,g,E,b){this._context.strokeRect(v,g,E,b)}fillText(v,g,E,b){b?this._context.fillText(v,g,E,b):this._context.fillText(v,g,E)}measureText(v){return this._context.measureText(v)}getImageData(v,g,E,b){return this._context.getImageData(v,g,E,b)}lineTo(v,g){this._context.lineTo(v,g)}moveTo(v,g){this._context.moveTo(v,g)}rect(v,g,E,b){this._context.rect(v,g,E,b)}roundRect(v,g,E,b,M){this._context.roundRect(v,g,E,b,M)}putImageData(v,g,E){this._context.putImageData(v,g,E)}quadraticCurveTo(v,g,E,b){this._context.quadraticCurveTo(v,g,E,b)}restore(){this._context.restore()}rotate(v){this._context.rotate(v)}save(){this._context.save()}scale(v,g){this._context.scale(v,g)}setLineDash(v){this._context.setLineDash?this._context.setLineDash(v):"mozDash"in this._context?this._context.mozDash=v:"webkitLineDash"in this._context&&(this._context.webkitLineDash=v)}getLineDash(){return this._context.getLineDash()}setTransform(v,g,E,b,M,N){this._context.setTransform(v,g,E,b,M,N)}stroke(v){v?this._context.stroke(v):this._context.stroke()}strokeText(v,g,E,b){this._context.strokeText(v,g,E,b)}transform(v,g,E,b,M,N){this._context.transform(v,g,E,b,M,N)}translate(v,g){this._context.translate(v,g)}_enableTrace(){let v=this,g=p.length,E=this.setAttr,b,M;const N=function(R){let F=v[R],j;v[R]=function(){return M=t(Array.prototype.slice.call(arguments,0)),j=F.apply(v,arguments),v._trace({method:R,args:M}),j}};for(b=0;b<g;b++)N(p[b]);v.setAttr=function(){E.apply(v,arguments);const R=arguments[0];let F=arguments[1];(R==="shadowOffsetX"||R==="shadowOffsetY"||R==="shadowBlur")&&(F=F/this.canvas.getPixelRatio()),v._trace({property:R,val:F})}}_applyGlobalCompositeOperation(v){const g=v.attrs.globalCompositeOperation;!g||g==="source-over"||this.setAttr("globalCompositeOperation",g)}};tc.Context=_,y.forEach(function(x){Object.defineProperty(_.prototype,x,{get(){return this._context[x]},set(v){this._context[x]=v}})});class S extends _{constructor(v,{willReadFrequently:g=!1}={}){super(v),this._context=v._canvas.getContext("2d",{willReadFrequently:g})}_fillColor(v){const g=v.fill();this.setAttr("fillStyle",g),v._fillFunc(this)}_fillPattern(v){this.setAttr("fillStyle",v._getFillPattern()),v._fillFunc(this)}_fillLinearGradient(v){const g=v._getLinearGradient();g&&(this.setAttr("fillStyle",g),v._fillFunc(this))}_fillRadialGradient(v){const g=v._getRadialGradient();g&&(this.setAttr("fillStyle",g),v._fillFunc(this))}_fill(v){const g=v.fill(),E=v.getFillPriority();if(g&&E==="color"){this._fillColor(v);return}const b=v.getFillPatternImage();if(b&&E==="pattern"){this._fillPattern(v);return}const M=v.getFillLinearGradientColorStops();if(M&&E==="linear-gradient"){this._fillLinearGradient(v);return}const N=v.getFillRadialGradientColorStops();if(N&&E==="radial-gradient"){this._fillRadialGradient(v);return}g?this._fillColor(v):b?this._fillPattern(v):M?this._fillLinearGradient(v):N&&this._fillRadialGradient(v)}_strokeLinearGradient(v){const g=v.getStrokeLinearGradientStartPoint(),E=v.getStrokeLinearGradientEndPoint(),b=v.getStrokeLinearGradientColorStops(),M=this.createLinearGradient(g.x,g.y,E.x,E.y);if(b){for(let N=0;N<b.length;N+=2)M.addColorStop(b[N],b[N+1]);this.setAttr("strokeStyle",M)}}_stroke(v){const g=v.dash(),E=v.getStrokeScaleEnabled();if(v.hasStroke()){if(!E){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(v),g&&v.dashEnabled()&&(this.setLineDash(g),this.setAttr("lineDashOffset",v.dashOffset())),this.setAttr("lineWidth",v.strokeWidth()),v.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),v.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(v):this.setAttr("strokeStyle",v.stroke()),v._strokeFunc(this),E||this.restore()}}_applyShadow(v){var g,E,b;const M=(g=v.getShadowRGBA())!==null&&g!==void 0?g:"black",N=(E=v.getShadowBlur())!==null&&E!==void 0?E:5,R=(b=v.getShadowOffset())!==null&&b!==void 0?b:{x:0,y:0},F=v.getAbsoluteScale(),j=this.canvas.getPixelRatio(),O=F.x*j,C=F.y*j;this.setAttr("shadowColor",M),this.setAttr("shadowBlur",N*Math.min(Math.abs(O),Math.abs(C))),this.setAttr("shadowOffsetX",R.x*O),this.setAttr("shadowOffsetY",R.y*C)}}tc.SceneContext=S;class w extends _{constructor(v){super(v),this._context=v._canvas.getContext("2d",{willReadFrequently:!0})}_fill(v){this.save(),this.setAttr("fillStyle",v.colorKey),v._fillFuncHit(this),this.restore()}strokeShape(v){v.hasHitStroke()&&this._stroke(v)}_stroke(v){if(v.hasHitStroke()){const g=v.getStrokeScaleEnabled();if(!g){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(v);const E=v.hitStrokeWidth(),b=E==="auto"?v.strokeWidth():E;this.setAttr("lineWidth",b),this.setAttr("strokeStyle",v.colorKey),v._strokeFuncHit(this),g||this.restore()}}}return tc.HitContext=w,tc}var Wy;function J1(){if(Wy)return ec;Wy=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.HitCanvas=ec.SceneCanvas=ec.Canvas=void 0;const e=ki(),r=x6(),t=Tr();let n;function a(){if(n)return n;const c=e.Util.createCanvasElement(),u=c.getContext("2d");return n=function(){const d=t.Konva._global.devicePixelRatio||1,p=u.webkitBackingStorePixelRatio||u.mozBackingStorePixelRatio||u.msBackingStorePixelRatio||u.oBackingStorePixelRatio||u.backingStorePixelRatio||1;return d/p}(),e.Util.releaseCanvas(c),n}let i=class{constructor(u){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const p=(u||{}).pixelRatio||t.Konva.pixelRatio||a();this.pixelRatio=p,this._canvas=e.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(u){const d=this.pixelRatio;this.pixelRatio=u,this.setSize(this.getWidth()/d,this.getHeight()/d)}setWidth(u){this.width=this._canvas.width=u*this.pixelRatio,this._canvas.style.width=u+"px";const d=this.pixelRatio;this.getContext()._context.scale(d,d)}setHeight(u){this.height=this._canvas.height=u*this.pixelRatio,this._canvas.style.height=u+"px";const d=this.pixelRatio;this.getContext()._context.scale(d,d)}getWidth(){return this.width}getHeight(){return this.height}setSize(u,d){this.setWidth(u||0),this.setHeight(d||0)}toDataURL(u,d){try{return this._canvas.toDataURL(u,d)}catch{try{return this._canvas.toDataURL()}catch(y){return e.Util.error("Unable to get data URL. "+y.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};ec.Canvas=i;class o extends i{constructor(u={width:0,height:0,willReadFrequently:!1}){super(u),this.context=new r.SceneContext(this,{willReadFrequently:u.willReadFrequently}),this.setSize(u.width,u.height)}}ec.SceneCanvas=o;class s extends i{constructor(u={width:0,height:0}){super(u),this.hitCanvas=!0,this.context=new r.HitContext(this),this.setSize(u.width,u.height)}}return ec.HitCanvas=s,ec}var tg={},$y;function sm(){return $y||($y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const r=Tr(),t=ki();e.DD={get isDragging(){let n=!1;return e.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return e.DD._dragElements.forEach(a=>{n=a.node}),n},_dragElements:new Map,_drag(n){const a=[];e.DD._dragElements.forEach((i,o)=>{const{node:s}=i,c=s.getStage();c.setPointersPositions(n),i.pointerId===void 0&&(i.pointerId=t.Util._getFirstPointerId(n));const u=c._changedPointerPositions.find(d=>d.id===i.pointerId);if(u){if(i.dragStatus!=="dragging"){const d=s.dragDistance();if(Math.max(Math.abs(u.x-i.startPointerPos.x),Math.abs(u.y-i.startPointerPos.y))<d||(s.startDrag({evt:n}),!s.isDragging()))return}s._setDragPosition(n,i),a.push(s)}}),a.forEach(i=>{i.fire("dragmove",{type:"dragmove",target:i,evt:n},!0)})},_endDragBefore(n){const a=[];e.DD._dragElements.forEach(i=>{const{node:o}=i,s=o.getStage();if(n&&s.setPointersPositions(n),!s._changedPointerPositions.find(d=>d.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(e.DD.justDragged=!0,r.Konva._mouseListenClick=!1,r.Konva._touchListenClick=!1,r.Konva._pointerListenClick=!1,i.dragStatus="stopped");const u=i.node.getLayer()||i.node instanceof r.Konva.Stage&&i.node;u&&a.indexOf(u)===-1&&a.push(u)}),a.forEach(i=>{i.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((a,i)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:n},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(i)})}},r.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(tg)),tg}var Yy;function Ji(){if(Yy)return Qh;Yy=1,Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.Node=void 0;const e=ki(),r=zr(),t=J1(),n=Tr(),a=sm(),i=Gr(),o="absoluteOpacity",s="allEventListeners",c="absoluteTransform",u="absoluteScale",d="canvas",p="Change",y="children",f="konva",_="listening",S="mouseenter",w="mouseleave",x="set",v="Shape",g=" ",E="stage",b="transform",M="Stage",N="visible",R=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(g);let F=1;class j{constructor(A){this._id=F++,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(A),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(A){(A===b||A===c)&&this._cache.get(A)?this._cache.get(A).dirty=!0:A?this._cache.delete(A):this._cache.clear()}_getCache(A,k){let T=this._cache.get(A);return(T===void 0||(A===b||A===c)&&T.dirty===!0)&&(T=k.call(this),this._cache.set(A,T)),T}_calculate(A,k,T){if(!this._attachedDepsListeners.get(A)){const V=k.map(G=>G+"Change.konva").join(g);this.on(V,()=>{this._clearCache(A)}),this._attachedDepsListeners.set(A,!0)}return this._getCache(A,T)}_getCanvasCache(){return this._cache.get(d)}_clearSelfAndDescendantCache(A){this._clearCache(A),A===c&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(d)){const{scene:A,filter:k,hit:T}=this._cache.get(d);e.Util.releaseCanvas(A,k,T),this._cache.delete(d)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(A){const k=A||{};let T={};(k.x===void 0||k.y===void 0||k.width===void 0||k.height===void 0)&&(T=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let V=Math.ceil(k.width||T.width),G=Math.ceil(k.height||T.height),$=k.pixelRatio,te=k.x===void 0?Math.floor(T.x):k.x,W=k.y===void 0?Math.floor(T.y):k.y,U=k.offset||0,z=k.drawBorder||!1,D=k.hitCanvasPixelRatio||1;if(!V||!G){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const Y=Math.abs(Math.round(T.x)-te)>.5?1:0,Q=Math.abs(Math.round(T.y)-W)>.5?1:0;V+=U*2+Y,G+=U*2+Q,te-=U,W-=U;const J=new t.SceneCanvas({pixelRatio:$,width:V,height:G}),Z=new t.SceneCanvas({pixelRatio:$,width:0,height:0,willReadFrequently:!0}),ae=new t.HitCanvas({pixelRatio:D,width:V,height:G}),se=J.getContext(),ce=ae.getContext();return ae.isCache=!0,J.isCache=!0,this._cache.delete(d),this._filterUpToDate=!1,k.imageSmoothingEnabled===!1&&(J.getContext()._context.imageSmoothingEnabled=!1,Z.getContext()._context.imageSmoothingEnabled=!1),se.save(),ce.save(),se.translate(-te,-W),ce.translate(-te,-W),this._isUnderCache=!0,this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(u),this.drawScene(J,this),this.drawHit(ae,this),this._isUnderCache=!1,se.restore(),ce.restore(),z&&(se.save(),se.beginPath(),se.rect(0,0,V,G),se.closePath(),se.setAttr("strokeStyle","red"),se.setAttr("lineWidth",5),se.stroke(),se.restore()),this._cache.set(d,{scene:J,filter:Z,hit:ae,x:te,y:W}),this._requestDraw(),this}isCached(){return this._cache.has(d)}getClientRect(A){throw new Error('abstract "getClientRect" method call')}_transformedRect(A,k){const T=[{x:A.x,y:A.y},{x:A.x+A.width,y:A.y},{x:A.x+A.width,y:A.y+A.height},{x:A.x,y:A.y+A.height}];let V=1/0,G=1/0,$=-1/0,te=-1/0;const W=this.getAbsoluteTransform(k);return T.forEach(function(U){const z=W.point(U);V===void 0&&(V=$=z.x,G=te=z.y),V=Math.min(V,z.x),G=Math.min(G,z.y),$=Math.max($,z.x),te=Math.max(te,z.y)}),{x:V,y:G,width:$-V,height:te-G}}_drawCachedSceneCanvas(A){A.save(),A._applyOpacity(this),A._applyGlobalCompositeOperation(this);const k=this._getCanvasCache();A.translate(k.x,k.y);const T=this._getCachedSceneCanvas(),V=T.pixelRatio;A.drawImage(T._canvas,0,0,T.width/V,T.height/V),A.restore()}_drawCachedHitCanvas(A){const k=this._getCanvasCache(),T=k.hit;A.save(),A.translate(k.x,k.y),A.drawImage(T._canvas,0,0,T.width/T.pixelRatio,T.height/T.pixelRatio),A.restore()}_getCachedSceneCanvas(){let A=this.filters(),k=this._getCanvasCache(),T=k.scene,V=k.filter,G=V.getContext(),$,te,W,U;if(A){if(!this._filterUpToDate){const z=T.pixelRatio;V.setSize(T.width/T.pixelRatio,T.height/T.pixelRatio);try{for($=A.length,G.clear(),G.drawImage(T._canvas,0,0,T.getWidth()/z,T.getHeight()/z),te=G.getImageData(0,0,V.getWidth(),V.getHeight()),W=0;W<$;W++){if(U=A[W],typeof U!="function"){e.Util.error("Filter should be type of function, but got "+typeof U+" instead. Please check correct filters");continue}U.call(this,te),G.putImageData(te,0,0)}}catch(D){e.Util.error("Unable to apply filter. "+D.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return V}return T}on(A,k){if(this._cache&&this._cache.delete(s),arguments.length===3)return this._delegate.apply(this,arguments);let T=A.split(g),V=T.length,G,$,te,W,U;for(G=0;G<V;G++)$=T[G],te=$.split("."),W=te[0],U=te[1]||"",this.eventListeners[W]||(this.eventListeners[W]=[]),this.eventListeners[W].push({name:U,handler:k});return this}off(A,k){let T=(A||"").split(g),V=T.length,G,$,te,W,U,z;if(this._cache&&this._cache.delete(s),!A)for($ in this.eventListeners)this._off($);for(G=0;G<V;G++)if(te=T[G],W=te.split("."),U=W[0],z=W[1],U)this.eventListeners[U]&&this._off(U,z,k);else for($ in this.eventListeners)this._off($,z,k);return this}dispatchEvent(A){const k={target:this,type:A.type,evt:A};return this.fire(A.type,k),this}addEventListener(A,k){return this.on(A,function(T){k.call(this,T.evt)}),this}removeEventListener(A){return this.off(A),this}_delegate(A,k,T){const V=this;this.on(A,function(G){const $=G.target.findAncestors(k,!0,V);for(let te=0;te<$.length;te++)G=e.Util.cloneObject(G),G.currentTarget=$[te],T.call($[te],G)})}remove(){return this.isDragging()&&this.stopDrag(),a.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(c),this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(E),this._clearSelfAndDescendantCache(N),this._clearSelfAndDescendantCache(_)}_remove(){this._clearCaches();const A=this.getParent();A&&A.children&&(A.children.splice(this.index,1),A._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(A){const k="get"+e.Util._capitalize(A);return e.Util._isFunction(this[k])?this[k]():this.attrs[A]}getAncestors(){let A=this.getParent(),k=[];for(;A;)k.push(A),A=A.getParent();return k}getAttrs(){return this.attrs||{}}setAttrs(A){return this._batchTransformChanges(()=>{let k,T;if(!A)return this;for(k in A)k!==y&&(T=x+e.Util._capitalize(k),e.Util._isFunction(this[T])?this[T](A[k]):this._setAttr(k,A[k]))}),this}isListening(){return this._getCache(_,this._isListening)}_isListening(A){if(!this.listening())return!1;const T=this.getParent();return T&&T!==A&&this!==A?T._isListening(A):!0}isVisible(){return this._getCache(N,this._isVisible)}_isVisible(A){if(!this.visible())return!1;const T=this.getParent();return T&&T!==A&&this!==A?T._isVisible(A):!0}shouldDrawHit(A,k=!1){if(A)return this._isVisible(A)&&this._isListening(A);const T=this.getLayer();let V=!1;a.DD._dragElements.forEach($=>{$.dragStatus==="dragging"&&($.node.nodeType==="Stage"||$.node.getLayer()===T)&&(V=!0)});const G=!k&&!n.Konva.hitOnDragEnabled&&(V||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!G}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let A=this.getDepth(),k=this,T=0,V,G,$,te;function W(z){for(V=[],G=z.length,$=0;$<G;$++)te=z[$],T++,te.nodeType!==v&&(V=V.concat(te.getChildren().slice())),te._id===k._id&&($=G);V.length>0&&V[0].getDepth()<=A&&W(V)}const U=this.getStage();return k.nodeType!==M&&U&&W(U.getChildren()),T}getDepth(){let A=0,k=this.parent;for(;k;)A++,k=k.parent;return A}_batchTransformChanges(A){this._batchingTransformChange=!0,A(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(b),this._clearSelfAndDescendantCache(c)),this._needClearTransformCache=!1}setPosition(A){return this._batchTransformChanges(()=>{this.x(A.x),this.y(A.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const A=this.getStage();if(!A)return null;const k=A.getPointerPosition();if(!k)return null;const T=this.getAbsoluteTransform().copy();return T.invert(),T.point(k)}getAbsolutePosition(A){let k=!1,T=this.parent;for(;T;){if(T.isCached()){k=!0;break}T=T.parent}k&&!A&&(A=!0);const V=this.getAbsoluteTransform(A).getMatrix(),G=new e.Transform,$=this.offset();return G.m=V.slice(),G.translate($.x,$.y),G.getTranslation()}setAbsolutePosition(A){const{x:k,y:T,...V}=this._clearTransform();this.attrs.x=k,this.attrs.y=T,this._clearCache(b);const G=this._getAbsoluteTransform().copy();return G.invert(),G.translate(A.x,A.y),A={x:this.attrs.x+G.getTranslation().x,y:this.attrs.y+G.getTranslation().y},this._setTransform(V),this.setPosition({x:A.x,y:A.y}),this._clearCache(b),this._clearSelfAndDescendantCache(c),this}_setTransform(A){let k;for(k in A)this.attrs[k]=A[k]}_clearTransform(){const A={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,A}move(A){let k=A.x,T=A.y,V=this.x(),G=this.y();return k!==void 0&&(V+=k),T!==void 0&&(G+=T),this.setPosition({x:V,y:G}),this}_eachAncestorReverse(A,k){let T=[],V=this.getParent(),G,$;if(!(k&&k._id===this._id)){for(T.unshift(this);V&&(!k||V._id!==k._id);)T.unshift(V),V=V.parent;for(G=T.length,$=0;$<G;$++)A(T[$])}}rotate(A){return this.rotation(this.rotation()+A),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const A=this.index,k=this.parent.getChildren().length;return A<k-1?(this.parent.children.splice(A,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return e.Util.warn("Node has no parent. moveUp function is ignored."),!1;const A=this.index,k=this.parent.getChildren().length;return A<k-1?(this.parent.children.splice(A,1),this.parent.children.splice(A+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return e.Util.warn("Node has no parent. moveDown function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.splice(A-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return e.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(A){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(A<0||A>=this.parent.children.length)&&e.Util.warn("Unexpected value "+A+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const k=this.index;return this.parent.children.splice(k,1),this.parent.children.splice(A,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(o,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let A=this.opacity();const k=this.getParent();return k&&!k._isUnderCache&&(A*=k.getAbsoluteOpacity()),A}moveTo(A){return this.getParent()!==A&&(this._remove(),A.add(this)),this}toObject(){let A=this.getAttrs(),k,T,V,G,$;const te={attrs:{},className:this.getClassName()};for(k in A)T=A[k],$=e.Util.isObject(T)&&!e.Util._isPlainObject(T)&&!e.Util._isArray(T),!$&&(V=typeof this[k]=="function"&&this[k],delete A[k],G=V?V.call(this):null,A[k]=T,G!==T&&(te.attrs[k]=T));return e.Util._prepareToStringify(te)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(A,k,T){const V=[];k&&this._isMatch(A)&&V.push(this);let G=this.parent;for(;G;){if(G===T)return V;G._isMatch(A)&&V.push(G),G=G.parent}return V}isAncestorOf(A){return!1}findAncestor(A,k,T){return this.findAncestors(A,k,T)[0]}_isMatch(A){if(!A)return!1;if(typeof A=="function")return A(this);let k=A.replace(/ /g,"").split(","),T=k.length,V,G;for(V=0;V<T;V++)if(G=k[V],e.Util.isValidSelector(G)||(e.Util.warn('Selector "'+G+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),e.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),e.Util.warn("Konva is awesome, right?")),G.charAt(0)==="#"){if(this.id()===G.slice(1))return!0}else if(G.charAt(0)==="."){if(this.hasName(G.slice(1)))return!0}else if(this.className===G||this.nodeType===G)return!0;return!1}getLayer(){const A=this.getParent();return A?A.getLayer():null}getStage(){return this._getCache(E,this._getStage)}_getStage(){const A=this.getParent();return A?A.getStage():null}fire(A,k={},T){return k.target=k.target||this,T?this._fireAndBubble(A,k):this._fire(A,k),this}getAbsoluteTransform(A){return A?this._getAbsoluteTransform(A):this._getCache(c,this._getAbsoluteTransform)}_getAbsoluteTransform(A){let k;if(A)return k=new e.Transform,this._eachAncestorReverse(function(T){const V=T.transformsEnabled();V==="all"?k.multiply(T.getTransform()):V==="position"&&k.translate(T.x()-T.offsetX(),T.y()-T.offsetY())},A),k;{k=this._cache.get(c)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(k):k.reset();const T=this.transformsEnabled();if(T==="all")k.multiply(this.getTransform());else if(T==="position"){const V=this.attrs.x||0,G=this.attrs.y||0,$=this.attrs.offsetX||0,te=this.attrs.offsetY||0;k.translate(V-$,G-te)}return k.dirty=!1,k}}getAbsoluteScale(A){let k=this;for(;k;)k._isUnderCache&&(A=k),k=k.getParent();const V=this.getAbsoluteTransform(A).decompose();return{x:V.scaleX,y:V.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(b,this._getTransform)}_getTransform(){var A,k;const T=this._cache.get(b)||new e.Transform;T.reset();const V=this.x(),G=this.y(),$=n.Konva.getAngle(this.rotation()),te=(A=this.attrs.scaleX)!==null&&A!==void 0?A:1,W=(k=this.attrs.scaleY)!==null&&k!==void 0?k:1,U=this.attrs.skewX||0,z=this.attrs.skewY||0,D=this.attrs.offsetX||0,Y=this.attrs.offsetY||0;return(V!==0||G!==0)&&T.translate(V,G),$!==0&&T.rotate($),(U!==0||z!==0)&&T.skew(U,z),(te!==1||W!==1)&&T.scale(te,W),(D!==0||Y!==0)&&T.translate(-1*D,-1*Y),T.dirty=!1,T}clone(A){let k=e.Util.cloneObject(this.attrs),T,V,G,$,te;for(T in A)k[T]=A[T];const W=new this.constructor(k);for(T in this.eventListeners)for(V=this.eventListeners[T],G=V.length,$=0;$<G;$++)te=V[$],te.name.indexOf(f)<0&&(W.eventListeners[T]||(W.eventListeners[T]=[]),W.eventListeners[T].push(te));return W}_toKonvaCanvas(A){A=A||{};const k=this.getClientRect(),T=this.getStage(),V=A.x!==void 0?A.x:Math.floor(k.x),G=A.y!==void 0?A.y:Math.floor(k.y),$=A.pixelRatio||1,te=new t.SceneCanvas({width:A.width||Math.ceil(k.width)||(T?T.width():0),height:A.height||Math.ceil(k.height)||(T?T.height():0),pixelRatio:$}),W=te.getContext(),U=new t.SceneCanvas({width:te.width/te.pixelRatio+Math.abs(V),height:te.height/te.pixelRatio+Math.abs(G),pixelRatio:te.pixelRatio});return A.imageSmoothingEnabled===!1&&(W._context.imageSmoothingEnabled=!1),W.save(),(V||G)&&W.translate(-1*V,-1*G),this.drawScene(te,void 0,U),W.restore(),te}toCanvas(A){return this._toKonvaCanvas(A)._canvas}toDataURL(A){A=A||{};const k=A.mimeType||null,T=A.quality||null,V=this._toKonvaCanvas(A).toDataURL(k,T);return A.callback&&A.callback(V),V}toImage(A){return new Promise((k,T)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,e.Util._urlToImage(this.toDataURL(A),function(G){k(G),V==null||V(G)})}catch(V){T(V)}})}toBlob(A){return new Promise((k,T)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,this.toCanvas(A).toBlob(G=>{k(G),V==null||V(G)},A==null?void 0:A.mimeType,A==null?void 0:A.quality)}catch(V){T(V)}})}setSize(A){return this.width(A.width),this.height(A.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():n.Konva.dragDistance}_off(A,k,T){let V=this.eventListeners[A],G,$,te;for(G=0;G<V.length;G++)if($=V[G].name,te=V[G].handler,($!=="konva"||k==="konva")&&(!k||$===k)&&(!T||T===te)){if(V.splice(G,1),V.length===0){delete this.eventListeners[A];break}G--}}_fireChangeEvent(A,k,T){this._fire(A+p,{oldVal:k,newVal:T})}addName(A){if(!this.hasName(A)){const k=this.name(),T=k?k+" "+A:A;this.name(T)}return this}hasName(A){if(!A)return!1;const k=this.name();return k?(k||"").split(/\s/g).indexOf(A)!==-1:!1}removeName(A){const k=(this.name()||"").split(/\s/g),T=k.indexOf(A);return T!==-1&&(k.splice(T,1),this.name(k.join(" "))),this}setAttr(A,k){const T=this[x+e.Util._capitalize(A)];return e.Util._isFunction(T)?T.call(this,k):this._setAttr(A,k),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const A=this.getLayer()||this.getStage();A==null||A.batchDraw()}}_setAttr(A,k){const T=this.attrs[A];T===k&&!e.Util.isObject(k)||(k==null?delete this.attrs[A]:this.attrs[A]=k,this._shouldFireChangeEvents&&this._fireChangeEvent(A,T,k),this._requestDraw())}_setComponentAttr(A,k,T){let V;T!==void 0&&(V=this.attrs[A],V||(this.attrs[A]=this.getAttr(A)),this.attrs[A][k]=T,this._fireChangeEvent(A,V,T))}_fireAndBubble(A,k,T){if(k&&this.nodeType===v&&(k.target=this),!((A===S||A===w)&&(T&&(this===T||this.isAncestorOf&&this.isAncestorOf(T))||this.nodeType==="Stage"&&!T))){this._fire(A,k);const G=(A===S||A===w)&&T&&T.isAncestorOf&&T.isAncestorOf(this)&&!T.isAncestorOf(this.parent);(k&&!k.cancelBubble||!k)&&this.parent&&this.parent.isListening()&&!G&&(T&&T.parent?this._fireAndBubble.call(this.parent,A,k,T):this._fireAndBubble.call(this.parent,A,k))}}_getProtoListeners(A){var k,T,V;const G=(k=this._cache.get(s))!==null&&k!==void 0?k:{};let $=G==null?void 0:G[A];if($===void 0){$=[];let te=Object.getPrototypeOf(this);for(;te;){const W=(V=(T=te.eventListeners)===null||T===void 0?void 0:T[A])!==null&&V!==void 0?V:[];$.push(...W),te=Object.getPrototypeOf(te)}G[A]=$,this._cache.set(s,G)}return $}_fire(A,k){k=k||{},k.currentTarget=this,k.type=A;const T=this._getProtoListeners(A);if(T)for(var V=0;V<T.length;V++)T[V].handler.call(this,k);const G=this.eventListeners[A];if(G)for(var V=0;V<G.length;V++)G[V].handler.call(this,k)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(A){const k=A?A.pointerId:void 0,T=this.getStage(),V=this.getAbsolutePosition();if(!T)return;const G=T._getPointerById(k)||T._changedPointerPositions[0]||V;a.DD._dragElements.set(this._id,{node:this,startPointerPos:G,offset:{x:G.x-V.x,y:G.y-V.y},dragStatus:"ready",pointerId:k})}startDrag(A,k=!0){a.DD._dragElements.has(this._id)||this._createDragElement(A);const T=a.DD._dragElements.get(this._id);T.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:A&&A.evt},k)}_setDragPosition(A,k){const T=this.getStage()._getPointerById(k.pointerId);if(!T)return;let V={x:T.x-k.offset.x,y:T.y-k.offset.y};const G=this.dragBoundFunc();if(G!==void 0){const $=G.call(this,V,A);$?V=$:e.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==V.x||this._lastPos.y!==V.y)&&(this.setAbsolutePosition(V),this._requestDraw()),this._lastPos=V}stopDrag(A){const k=a.DD._dragElements.get(this._id);k&&(k.dragStatus="stopped"),a.DD._endDragBefore(A),a.DD._endDragAfter(A)}setDraggable(A){this._setAttr("draggable",A),this._dragChange()}isDragging(){const A=a.DD._dragElements.get(this._id);return A?A.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(A){if(!(!(A.evt.button!==void 0)||n.Konva.dragButtons.indexOf(A.evt.button)>=0)||this.isDragging())return;let V=!1;a.DD._dragElements.forEach(G=>{this.isAncestorOf(G.node)&&(V=!0)}),V||this._createDragElement(A)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const k=a.DD._dragElements.get(this._id),T=k&&k.dragStatus==="dragging",V=k&&k.dragStatus==="ready";T?this.stopDrag():V&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(A={x:0,y:0}){const k=this.getStage();if(!k)return!1;const T={x:-A.x,y:-A.y,width:k.width()+2*A.x,height:k.height()+2*A.y};return e.Util.haveIntersection(T,this.getClientRect())}static create(A,k){return e.Util._isString(A)&&(A=JSON.parse(A)),this._createNode(A,k)}static _createNode(A,k){let T=j.prototype.getClassName.call(A),V=A.children,G,$,te;k&&(A.attrs.container=k),n.Konva[T]||(e.Util.warn('Can not find a node with class name "'+T+'". Fallback to "Shape".'),T="Shape");const W=n.Konva[T];if(G=new W(A.attrs),V)for($=V.length,te=0;te<$;te++)G.add(j._createNode(V[te]));return G}}Qh.Node=j,j.prototype.nodeType="Node",j.prototype._attrsAffectingSize=[],j.prototype.eventListeners={},j.prototype.on.call(j.prototype,R,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(b),this._clearSelfAndDescendantCache(c)}),j.prototype.on.call(j.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(N)}),j.prototype.on.call(j.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(_)}),j.prototype.on.call(j.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(o)});const O=r.Factory.addGetterSetter;return O(j,"zIndex"),O(j,"absolutePosition"),O(j,"position"),O(j,"x",0,(0,i.getNumberValidator)()),O(j,"y",0,(0,i.getNumberValidator)()),O(j,"globalCompositeOperation","source-over",(0,i.getStringValidator)()),O(j,"opacity",1,(0,i.getNumberValidator)()),O(j,"name","",(0,i.getStringValidator)()),O(j,"id","",(0,i.getStringValidator)()),O(j,"rotation",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,"scale",["x","y"]),O(j,"scaleX",1,(0,i.getNumberValidator)()),O(j,"scaleY",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,"skew",["x","y"]),O(j,"skewX",0,(0,i.getNumberValidator)()),O(j,"skewY",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,"offset",["x","y"]),O(j,"offsetX",0,(0,i.getNumberValidator)()),O(j,"offsetY",0,(0,i.getNumberValidator)()),O(j,"dragDistance",void 0,(0,i.getNumberValidator)()),O(j,"width",0,(0,i.getNumberValidator)()),O(j,"height",0,(0,i.getNumberValidator)()),O(j,"listening",!0,(0,i.getBooleanValidator)()),O(j,"preventDefault",!0,(0,i.getBooleanValidator)()),O(j,"filters",void 0,function(C){return this._filterUpToDate=!1,C}),O(j,"visible",!0,(0,i.getBooleanValidator)()),O(j,"transformsEnabled","all",(0,i.getStringValidator)()),O(j,"size"),O(j,"dragBoundFunc"),O(j,"draggable",!1,(0,i.getBooleanValidator)()),r.Factory.backCompat(j,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),Qh}var Jh={},Xy;function e0(){if(Xy)return Jh;Xy=1,Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.Container=void 0;const e=zr(),r=Ji(),t=Gr();let n=class extends r.Node{constructor(){super(...arguments),this.children=[]}getChildren(i){if(!i)return this.children||[];const o=this.children||[],s=[];return o.forEach(function(c){i(c)&&s.push(c)}),s}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(i=>{i.parent=null,i.index=0,i.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(i=>{i.parent=null,i.index=0,i.destroy()}),this.children=[],this._requestDraw(),this}add(...i){if(i.length===0)return this;if(i.length>1){for(let s=0;s<i.length;s++)this.add(i[s]);return this}const o=i[0];return o.getParent()?(o.moveTo(this),this):(this._validateAdd(o),o.index=this.getChildren().length,o.parent=this,o._clearCaches(),this.getChildren().push(o),this._fire("add",{child:o}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(i){return this._generalFind(i,!1)}findOne(i){const o=this._generalFind(i,!0);return o.length>0?o[0]:void 0}_generalFind(i,o){const s=[];return this._descendants(c=>{const u=c._isMatch(i);return u&&s.push(c),!!(u&&o)}),s}_descendants(i){let o=!1;const s=this.getChildren();for(const c of s){if(o=i(c),o)return!0;if(c.hasChildren()&&(o=c._descendants(i),o))return!0}return!1}toObject(){const i=r.Node.prototype.toObject.call(this);return i.children=[],this.getChildren().forEach(o=>{i.children.push(o.toObject())}),i}isAncestorOf(i){let o=i.getParent();for(;o;){if(o._id===this._id)return!0;o=o.getParent()}return!1}clone(i){const o=r.Node.prototype.clone.call(this,i);return this.getChildren().forEach(function(s){o.add(s.clone())}),o}getAllIntersections(i){const o=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(i)&&o.push(s)}),o}_clearSelfAndDescendantCache(i){var o;super._clearSelfAndDescendantCache(i),!this.isCached()&&((o=this.children)===null||o===void 0||o.forEach(function(s){s._clearSelfAndDescendantCache(i)}))}_setChildrenIndices(){var i;(i=this.children)===null||i===void 0||i.forEach(function(o,s){o.index=s}),this._requestDraw()}drawScene(i,o,s){const c=this.getLayer(),u=i||c&&c.getCanvas(),d=u&&u.getContext(),p=this._getCanvasCache(),y=p&&p.scene,f=u&&u.isCache;if(!this.isVisible()&&!f)return this;if(y){d.save();const _=this.getAbsoluteTransform(o).getMatrix();d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedSceneCanvas(d),d.restore()}else this._drawChildren("drawScene",u,o,s);return this}drawHit(i,o){if(!this.shouldDrawHit(o))return this;const s=this.getLayer(),c=i||s&&s.hitCanvas,u=c&&c.getContext(),d=this._getCanvasCache();if(d&&d.hit){u.save();const y=this.getAbsoluteTransform(o).getMatrix();u.transform(y[0],y[1],y[2],y[3],y[4],y[5]),this._drawCachedHitCanvas(u),u.restore()}else this._drawChildren("drawHit",c,o);return this}_drawChildren(i,o,s,c){var u;const d=o&&o.getContext(),p=this.clipWidth(),y=this.clipHeight(),f=this.clipFunc(),_=typeof p=="number"&&typeof y=="number"||f,S=s===this;if(_){d.save();const x=this.getAbsoluteTransform(s);let v=x.getMatrix();d.transform(v[0],v[1],v[2],v[3],v[4],v[5]),d.beginPath();let g;if(f)g=f.call(this,d,this);else{const E=this.clipX(),b=this.clipY();d.rect(E||0,b||0,p,y)}d.clip.apply(d,g),v=x.copy().invert().getMatrix(),d.transform(v[0],v[1],v[2],v[3],v[4],v[5])}const w=!S&&this.globalCompositeOperation()!=="source-over"&&i==="drawScene";w&&(d.save(),d._applyGlobalCompositeOperation(this)),(u=this.children)===null||u===void 0||u.forEach(function(x){x[i](o,s,c)}),w&&d.restore(),_&&d.restore()}getClientRect(i={}){var o;const s=i.skipTransform,c=i.relativeTo;let u,d,p,y,f={x:1/0,y:1/0,width:0,height:0};const _=this;(o=this.children)===null||o===void 0||o.forEach(function(x){if(!x.visible())return;const v=x.getClientRect({relativeTo:_,skipShadow:i.skipShadow,skipStroke:i.skipStroke});v.width===0&&v.height===0||(u===void 0?(u=v.x,d=v.y,p=v.x+v.width,y=v.y+v.height):(u=Math.min(u,v.x),d=Math.min(d,v.y),p=Math.max(p,v.x+v.width),y=Math.max(y,v.y+v.height)))});const S=this.find("Shape");let w=!1;for(let x=0;x<S.length;x++)if(S[x]._isVisible(this)){w=!0;break}return w&&u!==void 0?f={x:u,y:d,width:p-u,height:y-d}:f={x:0,y:0,width:0,height:0},s?f:this._transformedRect(f,c)}};return Jh.Container=n,e.Factory.addComponentsGetterSetter(n,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(n,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipFunc"),Jh}var rg={},Dc={},Ky;function E6(){if(Ky)return Dc;Ky=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.getCapturedShape=n,Dc.createEvent=a,Dc.hasPointerCapture=i,Dc.setPointerCapture=o,Dc.releaseCapture=s;const e=Tr(),r=new Map,t=e.Konva._global.PointerEvent!==void 0;function n(c){return r.get(c)}function a(c){return{evt:c,pointerId:c.pointerId}}function i(c,u){return r.get(c)===u}function o(c,u){s(c),u.getStage()&&(r.set(c,u),t&&u._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function s(c,u){const d=r.get(c);if(!d)return;const p=d.getStage();p&&p.content,r.delete(c),t&&d._fire("lostpointercapture",a(new PointerEvent("lostpointercapture")))}return Dc}var Zy;function FS(){return Zy||(Zy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const r=ki(),t=zr(),n=e0(),a=Tr(),i=J1(),o=sm(),s=Tr(),c=E6(),u="Stage",d="string",p="px",y="mouseout",f="mouseleave",_="mouseover",S="mouseenter",w="mousemove",x="mousedown",v="mouseup",g="pointermove",E="pointerdown",b="pointerup",M="pointercancel",N="lostpointercapture",R="pointerout",F="pointerleave",j="pointerover",O="pointerenter",C="contextmenu",A="touchstart",k="touchend",T="touchmove",V="touchcancel",G="wheel",$=5,te=[[S,"_pointerenter"],[x,"_pointerdown"],[w,"_pointermove"],[v,"_pointerup"],[f,"_pointerleave"],[A,"_pointerdown"],[T,"_pointermove"],[k,"_pointerup"],[V,"_pointercancel"],[_,"_pointerover"],[G,"_wheel"],[C,"_contextmenu"],[E,"_pointerdown"],[g,"_pointermove"],[b,"_pointerup"],[M,"_pointercancel"],[N,"_lostpointercapture"]],W={mouse:{[R]:y,[F]:f,[j]:_,[O]:S,[g]:w,[E]:x,[b]:v,[M]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[R]:"touchout",[F]:"touchleave",[j]:"touchover",[O]:"touchenter",[g]:T,[E]:A,[b]:k,[M]:V,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[R]:R,[F]:F,[j]:j,[O]:O,[g]:g,[E]:E,[b]:b,[M]:M,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},U=J=>J.indexOf("pointer")>=0?"pointer":J.indexOf("touch")>=0?"touch":"mouse",z=J=>{const Z=U(J);if(Z==="pointer")return a.Konva.pointerEventsEnabled&&W.pointer;if(Z==="touch")return W.touch;if(Z==="mouse")return W.mouse};function D(J={}){return(J.clipFunc||J.clipWidth||J.clipHeight)&&r.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),J}const Y="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 Q extends n.Container{constructor(Z){super(D(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",()=>{D(this.attrs)}),this._checkVisibility()}_validateAdd(Z){const ae=Z.getType()==="Layer",se=Z.getType()==="FastLayer";ae||se||r.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===d){if(Z.charAt(0)==="."){const se=Z.slice(1);Z=document.getElementsByClassName(se)[0]}else{var ae;Z.charAt(0)!=="#"?ae=Z:ae=Z.slice(1),Z=document.getElementById(ae)}if(!Z)throw"Can not find container in document with id "+ae}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(){const Z=this.children,ae=Z.length;for(let se=0;se<ae;se++)Z[se].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();const Z=this.content;Z&&r.Util._isInDocument(Z)&&this.container().removeChild(Z);const ae=e.stages.indexOf(this);return ae>-1&&e.stages.splice(ae,1),r.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}:(r.Util.warn(Y),null)}_getPointerById(Z){return this._pointerPositions.find(ae=>ae.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();const ae=new i.SceneCanvas({width:Z.width,height:Z.height,pixelRatio:Z.pixelRatio||1}),se=ae.getContext()._context,ce=this.children;return(Z.x||Z.y)&&se.translate(-1*Z.x,-1*Z.y),ce.forEach(function(de){if(!de.isVisible())return;const Oe=de._toKonvaCanvas(Z);se.drawImage(Oe._canvas,Z.x,Z.y,Oe.getWidth()/Oe.getPixelRatio(),Oe.getHeight()/Oe.getPixelRatio())}),ae}getIntersection(Z){if(!Z)return null;const ae=this.children,se=ae.length,ce=se-1;for(let de=ce;de>=0;de--){const Oe=ae[de].getIntersection(Z);if(Oe)return Oe}return null}_resizeDOM(){const Z=this.width(),ae=this.height();this.content&&(this.content.style.width=Z+p,this.content.style.height=ae+p),this.bufferCanvas.setSize(Z,ae),this.bufferHitCanvas.setSize(Z,ae),this.children.forEach(se=>{se.setSize({width:Z,height:ae}),se.draw()})}add(Z,...ae){if(arguments.length>1){for(let ce=0;ce<arguments.length;ce++)this.add(arguments[ce]);return this}super.add(Z);const se=this.children.length;return se>$&&r.Util.warn("The stage has "+se+" 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(),a.Konva.isBrowser&&this.content.appendChild(Z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(Z){return c.hasPointerCapture(Z,this)}setPointerCapture(Z){c.setPointerCapture(Z,this)}releaseCapture(Z){c.releaseCapture(Z,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&te.forEach(([Z,ae])=>{this.content.addEventListener(Z,se=>{this[ae](se)},{passive:!1})})}_pointerenter(Z){this.setPointersPositions(Z);const ae=z(Z.type);ae&&this._fire(ae.pointerenter,{evt:Z,target:this,currentTarget:this})}_pointerover(Z){this.setPointersPositions(Z);const ae=z(Z.type);ae&&this._fire(ae.pointerover,{evt:Z,target:this,currentTarget:this})}_getTargetShape(Z){let ae=this[Z+"targetShape"];return ae&&!ae.getStage()&&(ae=null),ae}_pointerleave(Z){const ae=z(Z.type),se=U(Z.type);if(!ae)return;this.setPointersPositions(Z);const ce=this._getTargetShape(se),de=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;ce&&de?(ce._fireAndBubble(ae.pointerout,{evt:Z}),ce._fireAndBubble(ae.pointerleave,{evt:Z}),this._fire(ae.pointerleave,{evt:Z,target:this,currentTarget:this}),this[se+"targetShape"]=null):de&&(this._fire(ae.pointerleave,{evt:Z,target:this,currentTarget:this}),this._fire(ae.pointerout,{evt:Z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(Z){const ae=z(Z.type),se=U(Z.type);if(!ae)return;this.setPointersPositions(Z);let ce=!1;this._changedPointerPositions.forEach(de=>{const Oe=this.getIntersection(de);if(o.DD.justDragged=!1,a.Konva["_"+se+"ListenClick"]=!0,!Oe||!Oe.isListening()){this[se+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&Oe.setPointerCapture(de.id),this[se+"ClickStartShape"]=Oe,Oe._fireAndBubble(ae.pointerdown,{evt:Z,pointerId:de.id}),ce=!0;const Le=Z.type.indexOf("touch")>=0;Oe.preventDefault()&&Z.cancelable&&Le&&Z.preventDefault()}),ce||this._fire(ae.pointerdown,{evt:Z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(Z){const ae=z(Z.type),se=U(Z.type);if(!ae||(a.Konva.isDragging()&&o.DD.node.preventDefault()&&Z.cancelable&&Z.preventDefault(),this.setPointersPositions(Z),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const de={};let Oe=!1;const Le=this._getTargetShape(se);this._changedPointerPositions.forEach(ke=>{const Se=c.getCapturedShape(ke.id)||this.getIntersection(ke),ye=ke.id,Je={evt:Z,pointerId:ye},we=Le!==Se;if(we&&Le&&(Le._fireAndBubble(ae.pointerout,{...Je},Se),Le._fireAndBubble(ae.pointerleave,{...Je},Se)),Se){if(de[Se._id])return;de[Se._id]=!0}Se&&Se.isListening()?(Oe=!0,we&&(Se._fireAndBubble(ae.pointerover,{...Je},Le),Se._fireAndBubble(ae.pointerenter,{...Je},Le),this[se+"targetShape"]=Se),Se._fireAndBubble(ae.pointermove,{...Je})):Le&&(this._fire(ae.pointerover,{evt:Z,target:this,currentTarget:this,pointerId:ye}),this[se+"targetShape"]=null)}),Oe||this._fire(ae.pointermove,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(Z){const ae=z(Z.type),se=U(Z.type);if(!ae)return;this.setPointersPositions(Z);const ce=this[se+"ClickStartShape"],de=this[se+"ClickEndShape"],Oe={};let Le=!1;this._changedPointerPositions.forEach(ke=>{const Se=c.getCapturedShape(ke.id)||this.getIntersection(ke);if(Se){if(Se.releaseCapture(ke.id),Oe[Se._id])return;Oe[Se._id]=!0}const ye=ke.id,Je={evt:Z,pointerId:ye};let we=!1;a.Konva["_"+se+"InDblClickWindow"]?(we=!0,clearTimeout(this[se+"DblTimeout"])):o.DD.justDragged||(a.Konva["_"+se+"InDblClickWindow"]=!0,clearTimeout(this[se+"DblTimeout"])),this[se+"DblTimeout"]=setTimeout(function(){a.Konva["_"+se+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),Se&&Se.isListening()?(Le=!0,this[se+"ClickEndShape"]=Se,Se._fireAndBubble(ae.pointerup,{...Je}),a.Konva["_"+se+"ListenClick"]&&ce&&ce===Se&&(Se._fireAndBubble(ae.pointerclick,{...Je}),we&&de&&de===Se&&Se._fireAndBubble(ae.pointerdblclick,{...Je}))):(this[se+"ClickEndShape"]=null,a.Konva["_"+se+"ListenClick"]&&this._fire(ae.pointerclick,{evt:Z,target:this,currentTarget:this,pointerId:ye}),we&&this._fire(ae.pointerdblclick,{evt:Z,target:this,currentTarget:this,pointerId:ye}))}),Le||this._fire(ae.pointerup,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+se+"ListenClick"]=!1,Z.cancelable&&se!=="touch"&&se!=="pointer"&&Z.preventDefault()}_contextmenu(Z){this.setPointersPositions(Z);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(C,{evt:Z}):this._fire(C,{evt:Z,target:this,currentTarget:this})}_wheel(Z){this.setPointersPositions(Z);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(G,{evt:Z}):this._fire(G,{evt:Z,target:this,currentTarget:this})}_pointercancel(Z){this.setPointersPositions(Z);const ae=c.getCapturedShape(Z.pointerId)||this.getIntersection(this.getPointerPosition());ae&&ae._fireAndBubble(b,c.createEvent(Z)),c.releaseCapture(Z.pointerId)}_lostpointercapture(Z){c.releaseCapture(Z.pointerId)}setPointersPositions(Z){const ae=this._getContentPosition();let se=null,ce=null;Z=Z||window.event,Z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(Z.touches,de=>{this._pointerPositions.push({id:de.identifier,x:(de.clientX-ae.left)/ae.scaleX,y:(de.clientY-ae.top)/ae.scaleY})}),Array.prototype.forEach.call(Z.changedTouches||Z.touches,de=>{this._changedPointerPositions.push({id:de.identifier,x:(de.clientX-ae.left)/ae.scaleX,y:(de.clientY-ae.top)/ae.scaleY})})):(se=(Z.clientX-ae.left)/ae.scaleX,ce=(Z.clientY-ae.top)/ae.scaleY,this.pointerPos={x:se,y:ce},this._pointerPositions=[{x:se,y:ce,id:r.Util._getFirstPointerId(Z)}],this._changedPointerPositions=[{x:se,y:ce,id:r.Util._getFirstPointerId(Z)}])}_setPointerPosition(Z){r.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};const 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 i.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new i.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!a.Konva.isBrowser)return;const 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 r.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=Q,Q.prototype.nodeType=u,(0,s._registerNode)(Q),t.Factory.addGetterSetter(Q,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(J=>{J.batchDraw()})})}(rg)),rg}var ed={},ng={},Qy;function Ra(){return Qy||(Qy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const r=Tr(),t=ki(),n=zr(),a=Ji(),i=Gr(),o=Tr(),s=E6(),c="hasShadow",u="shadowRGBA",d="patternImage",p="linearGradient",y="radialGradient";let f;function _(){return f||(f=t.Util.createCanvasElement().getContext("2d"),f)}e.shapes={};function S(F){const j=this.attrs.fillRule;j?F.fill(j):F.fill()}function w(F){F.stroke()}function x(F){const j=this.attrs.fillRule;j?F.fill(j):F.fill()}function v(F){F.stroke()}function g(){this._clearCache(c)}function E(){this._clearCache(u)}function b(){this._clearCache(d)}function M(){this._clearCache(p)}function N(){this._clearCache(y)}class R extends a.Node{constructor(j){super(j);let O;for(;O=t.Util.getRandomColor(),!(O&&!(O in e.shapes)););this.colorKey=O,e.shapes[O]=this}getContext(){return t.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return t.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(c,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(d,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const O=_().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(O&&O.setTransform){const C=new t.Transform;C.translate(this.fillPatternX(),this.fillPatternY()),C.rotate(r.Konva.getAngle(this.fillPatternRotation())),C.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),C.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const A=C.getMatrix(),k=typeof DOMMatrix>"u"?{a:A[0],b:A[1],c:A[2],d:A[3],e:A[4],f:A[5]}:new DOMMatrix(A);O.setTransform(k)}return O}}_getLinearGradient(){return this._getCache(p,this.__getLinearGradient)}__getLinearGradient(){const j=this.fillLinearGradientColorStops();if(j){const O=_(),C=this.fillLinearGradientStartPoint(),A=this.fillLinearGradientEndPoint(),k=O.createLinearGradient(C.x,C.y,A.x,A.y);for(let T=0;T<j.length;T+=2)k.addColorStop(j[T],j[T+1]);return k}}_getRadialGradient(){return this._getCache(y,this.__getRadialGradient)}__getRadialGradient(){const j=this.fillRadialGradientColorStops();if(j){const O=_(),C=this.fillRadialGradientStartPoint(),A=this.fillRadialGradientEndPoint(),k=O.createRadialGradient(C.x,C.y,this.fillRadialGradientStartRadius(),A.x,A.y,this.fillRadialGradientEndRadius());for(let T=0;T<j.length;T+=2)k.addColorStop(j[T],j[T+1]);return k}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const j=t.Util.colorToRGBA(this.shadowColor());if(j)return"rgba("+j.r+","+j.g+","+j.b+","+j.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 j=this.hitStrokeWidth();return j==="auto"?this.hasStroke():this.strokeEnabled()&&!!j}intersects(j){const O=this.getStage();if(!O)return!1;const C=O.bufferHitCanvas;return C.getContext().clear(),this.drawHit(C,void 0,!0),C.context.getImageData(Math.round(j.x),Math.round(j.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(j){var O;if(!((O=this.attrs.perfectDrawEnabled)!==null&&O!==void 0?O:!0))return!1;const A=j||this.hasFill(),k=this.hasStroke(),T=this.getAbsoluteOpacity()!==1;if(A&&k&&T)return!0;const V=this.hasShadow(),G=this.shadowForStrokeEnabled();return!!(A&&k&&V&&G)}setStrokeHitEnabled(j){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),j?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const j=this.size();return{x:this._centroid?-j.width/2:0,y:this._centroid?-j.height/2:0,width:j.width,height:j.height}}getClientRect(j={}){let O=!1,C=this.getParent();for(;C;){if(C.isCached()){O=!0;break}C=C.getParent()}const A=j.skipTransform,k=j.relativeTo||O&&this.getStage()||void 0,T=this.getSelfRect(),G=!j.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,$=T.width+G,te=T.height+G,W=!j.skipShadow&&this.hasShadow(),U=W?this.shadowOffsetX():0,z=W?this.shadowOffsetY():0,D=$+Math.abs(U),Y=te+Math.abs(z),Q=W&&this.shadowBlur()||0,J=D+Q*2,Z=Y+Q*2,ae={width:J,height:Z,x:-(G/2+Q)+Math.min(U,0)+T.x,y:-(G/2+Q)+Math.min(z,0)+T.y};return A?ae:this._transformedRect(ae,k)}drawScene(j,O,C){const A=this.getLayer();let k=j||A.getCanvas(),T=k.getContext(),V=this._getCanvasCache(),G=this.getSceneFunc(),$=this.hasShadow(),te,W;const U=k.isCache,z=O===this;if(!this.isVisible()&&!z)return this;if(V){T.save();const Y=this.getAbsoluteTransform(O).getMatrix();return T.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),this._drawCachedSceneCanvas(T),T.restore(),this}if(!G)return this;if(T.save(),this._useBufferCanvas()&&!U){te=this.getStage();const Y=C||te.bufferCanvas;W=Y.getContext(),W.clear(),W.save(),W._applyLineJoin(this);var D=this.getAbsoluteTransform(O).getMatrix();W.transform(D[0],D[1],D[2],D[3],D[4],D[5]),G.call(this,W,this),W.restore();const Q=Y.pixelRatio;$&&T._applyShadow(this),T._applyOpacity(this),T._applyGlobalCompositeOperation(this),T.drawImage(Y._canvas,0,0,Y.width/Q,Y.height/Q)}else{if(T._applyLineJoin(this),!z){var D=this.getAbsoluteTransform(O).getMatrix();T.transform(D[0],D[1],D[2],D[3],D[4],D[5]),T._applyOpacity(this),T._applyGlobalCompositeOperation(this)}$&&T._applyShadow(this),G.call(this,T,this)}return T.restore(),this}drawHit(j,O,C=!1){if(!this.shouldDrawHit(O,C))return this;const A=this.getLayer(),k=j||A.hitCanvas,T=k&&k.getContext(),V=this.hitFunc()||this.sceneFunc(),G=this._getCanvasCache(),$=G&&G.hit;if(this.colorKey||t.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),$){T.save();const W=this.getAbsoluteTransform(O).getMatrix();return T.transform(W[0],W[1],W[2],W[3],W[4],W[5]),this._drawCachedHitCanvas(T),T.restore(),this}if(!V)return this;if(T.save(),T._applyLineJoin(this),!(this===O)){const W=this.getAbsoluteTransform(O).getMatrix();T.transform(W[0],W[1],W[2],W[3],W[4],W[5])}return V.call(this,T,this),T.restore(),this}drawHitFromCache(j=0){const O=this._getCanvasCache(),C=this._getCachedSceneCanvas(),A=O.hit,k=A.getContext(),T=A.getWidth(),V=A.getHeight();k.clear(),k.drawImage(C._canvas,0,0,T,V);try{const G=k.getImageData(0,0,T,V),$=G.data,te=$.length,W=t.Util._hexToRgb(this.colorKey);for(let U=0;U<te;U+=4)$[U+3]>j?($[U]=W.r,$[U+1]=W.g,$[U+2]=W.b,$[U+3]=255):$[U+3]=0;k.putImageData(G,0,0)}catch(G){t.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(j){return s.hasPointerCapture(j,this)}setPointerCapture(j){s.setPointerCapture(j,this)}releaseCapture(j){s.releaseCapture(j,this)}}e.Shape=R,R.prototype._fillFunc=S,R.prototype._strokeFunc=w,R.prototype._fillFuncHit=x,R.prototype._strokeFuncHit=v,R.prototype._centroid=!1,R.prototype.nodeType="Shape",(0,o._registerNode)(R),R.prototype.eventListeners={},R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",E),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",b),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",N),n.Factory.addGetterSetter(R,"stroke",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(R,"strokeWidth",2,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(R,"hitStrokeWidth","auto",(0,i.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(R,"strokeHitEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(R,"perfectDrawEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(R,"shadowForStrokeEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(R,"lineJoin"),n.Factory.addGetterSetter(R,"lineCap"),n.Factory.addGetterSetter(R,"sceneFunc"),n.Factory.addGetterSetter(R,"hitFunc"),n.Factory.addGetterSetter(R,"dash"),n.Factory.addGetterSetter(R,"dashOffset",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"shadowColor",void 0,(0,i.getStringValidator)()),n.Factory.addGetterSetter(R,"shadowBlur",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"shadowOpacity",1,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(R,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(R,"shadowOffsetX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"shadowOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"fillPatternImage"),n.Factory.addGetterSetter(R,"fill",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(R,"fillPatternX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"fillPatternY",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(R,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(R,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(R,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(R,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(R,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(R,"fillEnabled",!0),n.Factory.addGetterSetter(R,"strokeEnabled",!0),n.Factory.addGetterSetter(R,"shadowEnabled",!0),n.Factory.addGetterSetter(R,"dashEnabled",!0),n.Factory.addGetterSetter(R,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(R,"fillPriority","color"),n.Factory.addComponentsGetterSetter(R,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(R,"fillPatternOffsetX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"fillPatternOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(R,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(R,"fillPatternScaleX",1,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(R,"fillPatternScaleY",1,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(R,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(R,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(R,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(R,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(R,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(R,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(R,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(R,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(R,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(R,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(R,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(R,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(R,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(R,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(R,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(R,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(R,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(R,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(R,"fillPatternRotation",0),n.Factory.addGetterSetter(R,"fillRule",void 0,(0,i.getStringValidator)()),n.Factory.backCompat(R,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(ng)),ng}var Jy;function P6(){if(Jy)return ed;Jy=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Layer=void 0;const e=ki(),r=e0(),t=Ji(),n=zr(),a=J1(),i=Gr(),o=Ra(),s=Tr(),c="#",u="beforeDraw",d="draw",p=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],y=p.length;class f extends r.Container{constructor(S){super(S),this.canvas=new a.SceneCanvas,this.hitCanvas=new a.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(S){return this.getContext().clear(S),this.getHitCanvas().getContext().clear(S),this}setZIndex(S){super.setZIndex(S);const w=this.getStage();return w&&w.content&&(w.content.removeChild(this.getNativeCanvasElement()),S<w.children.length-1?w.content.insertBefore(this.getNativeCanvasElement(),w.children[S+1].getCanvas()._canvas):w.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.Node.prototype.moveToTop.call(this);const S=this.getStage();return S&&S.content&&(S.content.removeChild(this.getNativeCanvasElement()),S.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!t.Node.prototype.moveUp.call(this))return!1;const w=this.getStage();return!w||!w.content?!1:(w.content.removeChild(this.getNativeCanvasElement()),this.index<w.children.length-1?w.content.insertBefore(this.getNativeCanvasElement(),w.children[this.index+1].getCanvas()._canvas):w.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const S=this.getStage();if(S){const w=S.children;S.content&&(S.content.removeChild(this.getNativeCanvasElement()),S.content.insertBefore(this.getNativeCanvasElement(),w[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const S=this.getStage();if(S){const w=S.children;S.content&&(S.content.removeChild(this.getNativeCanvasElement()),S.content.insertBefore(this.getNativeCanvasElement(),w[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const S=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),S&&S.parentNode&&e.Util._isInDocument(S)&&S.parentNode.removeChild(S),this}getStage(){return this.parent}setSize({width:S,height:w}){return this.canvas.setSize(S,w),this.hitCanvas.setSize(S,w),this._setSmoothEnabled(),this}_validateAdd(S){const w=S.getType();w!=="Group"&&w!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(S){return S=S||{},S.width=S.width||this.getWidth(),S.height=S.height||this.getHeight(),S.x=S.x!==void 0?S.x:this.x(),S.y=S.y!==void 0?S.y:this.y(),t.Node.prototype._toKonvaCanvas.call(this,S)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(S){if(!this.isListening()||!this.isVisible())return null;let w=1,x=!1;for(;;){for(let v=0;v<y;v++){const g=p[v],E=this._getIntersection({x:S.x+g.x*w,y:S.y+g.y*w}),b=E.shape;if(b)return b;if(x=!!E.antialiased,!E.antialiased)break}if(x)w+=1;else return null}}_getIntersection(S){const w=this.hitCanvas.pixelRatio,x=this.hitCanvas.context.getImageData(Math.round(S.x*w),Math.round(S.y*w),1,1).data,v=x[3];if(v===255){const g=e.Util._rgbToHex(x[0],x[1],x[2]),E=o.shapes[c+g];return E?{shape:E}:{antialiased:!0}}else if(v>0)return{antialiased:!0};return{}}drawScene(S,w){const x=this.getLayer(),v=S||x&&x.getCanvas();return this._fire(u,{node:this}),this.clearBeforeDraw()&&v.getContext().clear(),r.Container.prototype.drawScene.call(this,v,w),this._fire(d,{node:this}),this}drawHit(S,w){const x=this.getLayer(),v=S||x&&x.hitCanvas;return x&&x.clearBeforeDraw()&&x.getHitCanvas().getContext().clear(),r.Container.prototype.drawHit.call(this,v,w),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(S){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(S)}getHitGraphEnabled(S){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const S=this.parent;!!this.hitCanvas._canvas.parentNode?S.content.removeChild(this.hitCanvas._canvas):S.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return ed.Layer=f,f.prototype.nodeType="Layer",(0,s._registerNode)(f),n.Factory.addGetterSetter(f,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(f,"clearBeforeDraw",!0),n.Factory.addGetterSetter(f,"hitGraphEnabled",!0,(0,i.getBooleanValidator)()),ed}var td={},e5;function DS(){if(e5)return td;e5=1,Object.defineProperty(td,"__esModule",{value:!0}),td.FastLayer=void 0;const e=ki(),r=P6(),t=Tr();class n extends r.Layer{constructor(i){super(i),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return td.FastLayer=n,n.prototype.nodeType="FastLayer",(0,t._registerNode)(n),td}var rd={},t5;function lm(){if(t5)return rd;t5=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Group=void 0;const e=ki(),r=e0(),t=Tr();class n extends r.Container{_validateAdd(i){const o=i.getType();o!=="Group"&&o!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return rd.Group=n,n.prototype.nodeType="Group",(0,t._registerNode)(n),rd}var nd={},r5;function um(){if(r5)return nd;r5=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Animation=void 0;const e=Tr(),r=ki(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let n=class sh{constructor(i,o){this.id=sh.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=i,this.setLayers(o)}setLayers(i){let o=[];return i&&(o=Array.isArray(i)?i:[i]),this.layers=o,this}getLayers(){return this.layers}addLayer(i){const o=this.layers,s=o.length;for(let c=0;c<s;c++)if(o[c]._id===i._id)return!1;return this.layers.push(i),!0}isRunning(){const o=sh.animations,s=o.length;for(let c=0;c<s;c++)if(o[c].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),sh._addAnimation(this),this}stop(){return sh._removeAnimation(this),this}_updateFrameObject(i){this.frame.timeDiff=i-this.frame.lastTime,this.frame.lastTime=i,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(i){this.animations.push(i),this._handleAnimation()}static _removeAnimation(i){const o=i.id,s=this.animations,c=s.length;for(let u=0;u<c;u++)if(s[u].id===o){this.animations.splice(u,1);break}}static _runFrames(){const i={},o=this.animations;for(let s=0;s<o.length;s++){const c=o[s],u=c.layers,d=c.func;c._updateFrameObject(t());const p=u.length;let y;if(d?y=d.call(c,c.frame)!==!1:y=!0,!!y)for(let f=0;f<p;f++){const _=u[f];_._id!==void 0&&(i[_._id]=_)}}for(const s in i)i.hasOwnProperty(s)&&i[s].batchDraw()}static _animationLoop(){const i=sh;i.animations.length?(i._runFrames(),r.Util.requestAnimFrame(i._animationLoop)):i.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,r.Util.requestAnimFrame(this._animationLoop))}};return nd.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,nd}var ig={},n5;function BS(){return n5||(n5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const r=ki(),t=um(),n=Ji(),a=Tr(),i={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,s=2,c=3,u=["fill","stroke","shadowColor"];let d=0;class p{constructor(_,S,w,x,v,g,E){this.prop=_,this.propFunc=S,this.begin=x,this._pos=x,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=E,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=w,this._change=v-this.begin,this.pause()}fire(_){const S=this[_];S&&S()}setTime(_){_>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():_<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=_,this.update())}getTime(){return this._time}setPosition(_){this.prevPos=this._pos,this.propFunc(_),this._pos=_}getPosition(_){return _===void 0&&(_=this._time),this.func(_,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=c,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(_){this.pause(),this._time=_,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const _=this.getTimer()-this._startTime;this.state===s?this.setTime(_):this.state===c&&this.setTime(this.duration-_)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class y{constructor(_){const S=this,w=_.node,x=w._id,v=_.easing||e.Easings.Linear,g=!!_.yoyo;let E,b;typeof _.duration>"u"?E=.3:_.duration===0?E=.001:E=_.duration,this.node=w,this._id=d++;const M=w.getLayer()||(w instanceof a.Konva.Stage?w.getLayers():null);M||r.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){S.tween.onEnterFrame()},M),this.tween=new p(b,function(N){S._tweenFunc(N)},v,0,1,E*1e3,g),this._addListeners(),y.attrs[x]||(y.attrs[x]={}),y.attrs[x][this._id]||(y.attrs[x][this._id]={}),y.tweens[x]||(y.tweens[x]={});for(b in _)i[b]===void 0&&this._addAttr(b,_[b]);this.reset(),this.onFinish=_.onFinish,this.onReset=_.onReset,this.onUpdate=_.onUpdate}_addAttr(_,S){const w=this.node,x=w._id;let v,g,E,b,M;const N=y.tweens[x][_];N&&delete y.attrs[x][N][_];let R=w.getAttr(_);if(r.Util._isArray(S))if(v=[],g=Math.max(S.length,R.length),_==="points"&&S.length!==R.length&&(S.length>R.length?(b=R,R=r.Util._prepareArrayForTween(R,S,w.closed())):(E=S,S=r.Util._prepareArrayForTween(S,R,w.closed()))),_.indexOf("fill")===0)for(let F=0;F<g;F++)if(F%2===0)v.push(S[F]-R[F]);else{const j=r.Util.colorToRGBA(R[F]);M=r.Util.colorToRGBA(S[F]),R[F]=j,v.push({r:M.r-j.r,g:M.g-j.g,b:M.b-j.b,a:M.a-j.a})}else for(let F=0;F<g;F++)v.push(S[F]-R[F]);else u.indexOf(_)!==-1?(R=r.Util.colorToRGBA(R),M=r.Util.colorToRGBA(S),v={r:M.r-R.r,g:M.g-R.g,b:M.b-R.b,a:M.a-R.a}):v=S-R;y.attrs[x][this._id][_]={start:R,diff:v,end:S,trueEnd:E,trueStart:b},y.tweens[x][_]=this._id}_tweenFunc(_){const S=this.node,w=y.attrs[S._id][this._id];let x,v,g,E,b,M,N,R;for(x in w){if(v=w[x],g=v.start,E=v.diff,R=v.end,r.Util._isArray(g))if(b=[],N=Math.max(g.length,R.length),x.indexOf("fill")===0)for(M=0;M<N;M++)M%2===0?b.push((g[M]||0)+E[M]*_):b.push("rgba("+Math.round(g[M].r+E[M].r*_)+","+Math.round(g[M].g+E[M].g*_)+","+Math.round(g[M].b+E[M].b*_)+","+(g[M].a+E[M].a*_)+")");else for(M=0;M<N;M++)b.push((g[M]||0)+E[M]*_);else u.indexOf(x)!==-1?b="rgba("+Math.round(g.r+E.r*_)+","+Math.round(g.g+E.g*_)+","+Math.round(g.b+E.b*_)+","+(g.a+E.a*_)+")":b=g+E*_;S.setAttr(x,b)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const _=this.node,S=y.attrs[_._id][this._id];S.points&&S.points.trueEnd&&_.setAttr("points",S.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const _=this.node,S=y.attrs[_._id][this._id];S.points&&S.points.trueStart&&_.points(S.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(_){return this.tween.seek(_*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const _=this.node._id,S=this._id,w=y.tweens[_];this.pause();for(const x in w)delete y.tweens[_][x];delete y.attrs[_][S]}}e.Tween=y,y.attrs={},y.tweens={},n.Node.prototype.to=function(f){const _=f.onFinish;f.node=this,f.onFinish=function(){this.destroy(),_&&_()},new y(f).play()},e.Easings={BackEaseIn(f,_,S,w){return S*(f/=w)*f*((1.70158+1)*f-1.70158)+_},BackEaseOut(f,_,S,w){return S*((f=f/w-1)*f*((1.70158+1)*f+1.70158)+1)+_},BackEaseInOut(f,_,S,w){let x=1.70158;return(f/=w/2)<1?S/2*(f*f*(((x*=1.525)+1)*f-x))+_:S/2*((f-=2)*f*(((x*=1.525)+1)*f+x)+2)+_},ElasticEaseIn(f,_,S,w,x,v){let g=0;return f===0?_:(f/=w)===1?_+S:(v||(v=w*.3),!x||x<Math.abs(S)?(x=S,g=v/4):g=v/(2*Math.PI)*Math.asin(S/x),-(x*Math.pow(2,10*(f-=1))*Math.sin((f*w-g)*(2*Math.PI)/v))+_)},ElasticEaseOut(f,_,S,w,x,v){let g=0;return f===0?_:(f/=w)===1?_+S:(v||(v=w*.3),!x||x<Math.abs(S)?(x=S,g=v/4):g=v/(2*Math.PI)*Math.asin(S/x),x*Math.pow(2,-10*f)*Math.sin((f*w-g)*(2*Math.PI)/v)+S+_)},ElasticEaseInOut(f,_,S,w,x,v){let g=0;return f===0?_:(f/=w/2)===2?_+S:(v||(v=w*(.3*1.5)),!x||x<Math.abs(S)?(x=S,g=v/4):g=v/(2*Math.PI)*Math.asin(S/x),f<1?-.5*(x*Math.pow(2,10*(f-=1))*Math.sin((f*w-g)*(2*Math.PI)/v))+_:x*Math.pow(2,-10*(f-=1))*Math.sin((f*w-g)*(2*Math.PI)/v)*.5+S+_)},BounceEaseOut(f,_,S,w){return(f/=w)<1/2.75?S*(7.5625*f*f)+_:f<2/2.75?S*(7.5625*(f-=1.5/2.75)*f+.75)+_:f<2.5/2.75?S*(7.5625*(f-=2.25/2.75)*f+.9375)+_:S*(7.5625*(f-=2.625/2.75)*f+.984375)+_},BounceEaseIn(f,_,S,w){return S-e.Easings.BounceEaseOut(w-f,0,S,w)+_},BounceEaseInOut(f,_,S,w){return f<w/2?e.Easings.BounceEaseIn(f*2,0,S,w)*.5+_:e.Easings.BounceEaseOut(f*2-w,0,S,w)*.5+S*.5+_},EaseIn(f,_,S,w){return S*(f/=w)*f+_},EaseOut(f,_,S,w){return-S*(f/=w)*(f-2)+_},EaseInOut(f,_,S,w){return(f/=w/2)<1?S/2*f*f+_:-S/2*(--f*(f-2)-1)+_},StrongEaseIn(f,_,S,w){return S*(f/=w)*f*f*f*f+_},StrongEaseOut(f,_,S,w){return S*((f=f/w-1)*f*f*f*f+1)+_},StrongEaseInOut(f,_,S,w){return(f/=w/2)<1?S/2*f*f*f*f*f+_:S/2*((f-=2)*f*f*f*f+2)+_},Linear(f,_,S,w){return S*f/w+_}}}(ig)),ig}var i5;function x2(){return i5||(i5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const r=Tr(),t=ki(),n=Ji(),a=e0(),i=FS(),o=P6(),s=DS(),c=lm(),u=sm(),d=Ra(),p=um(),y=BS(),f=x6(),_=J1();e.Konva=t.Util._assign(r.Konva,{Util:t.Util,Transform:t.Transform,Node:n.Node,Container:a.Container,Stage:i.Stage,stages:i.stages,Layer:o.Layer,FastLayer:s.FastLayer,Group:c.Group,DD:u.DD,Shape:d.Shape,shapes:d.shapes,Animation:p.Animation,Tween:y.Tween,Easings:y.Easings,Context:f.Context,Canvas:_.Canvas}),e.default=e.Konva}(Z0)),Z0}var id={},a5;function qS(){if(a5)return id;a5=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Arc=void 0;const e=zr(),r=Ra(),t=Tr(),n=Gr(),a=Tr();class i extends r.Shape{_sceneFunc(s){const c=t.Konva.getAngle(this.angle()),u=this.clockwise();s.beginPath(),s.arc(0,0,this.outerRadius(),0,c,u),s.arc(0,0,this.innerRadius(),c,0,!u),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}getSelfRect(){const s=this.innerRadius(),c=this.outerRadius(),u=this.clockwise(),d=t.Konva.getAngle(u?360-this.angle():this.angle()),p=Math.cos(Math.min(d,Math.PI)),y=1,f=Math.sin(Math.min(Math.max(Math.PI,d),3*Math.PI/2)),_=Math.sin(Math.min(d,Math.PI/2)),S=p*(p>0?s:c),w=y*c,x=f*(f>0?s:c),v=_*(_>0?c:s);return{x:S,y:u?-1*v:x,width:w-S,height:v-x}}}return id.Arc=i,i.prototype._centroid=!0,i.prototype.className="Arc",i.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"innerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"clockwise",!1,(0,n.getBooleanValidator)()),id}var ad={},od={},o5;function O6(){if(o5)return od;o5=1,Object.defineProperty(od,"__esModule",{value:!0}),od.Line=void 0;const e=zr(),r=Tr(),t=Ra(),n=Gr();function a(s,c,u,d,p,y,f){const _=Math.sqrt(Math.pow(u-s,2)+Math.pow(d-c,2)),S=Math.sqrt(Math.pow(p-u,2)+Math.pow(y-d,2)),w=f*_/(_+S),x=f*S/(_+S),v=u-w*(p-s),g=d-w*(y-c),E=u+x*(p-s),b=d+x*(y-c);return[v,g,E,b]}function i(s,c){const u=s.length,d=[];for(let p=2;p<u-2;p+=2){const y=a(s[p-2],s[p-1],s[p],s[p+1],s[p+2],s[p+3],c);isNaN(y[0])||(d.push(y[0]),d.push(y[1]),d.push(s[p]),d.push(s[p+1]),d.push(y[2]),d.push(y[3]))}return d}class o extends t.Shape{constructor(c){super(c),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(c){let u=this.points(),d=u.length,p=this.tension(),y=this.closed(),f=this.bezier(),_,S,w;if(d){if(c.beginPath(),c.moveTo(u[0],u[1]),p!==0&&d>4){for(_=this.getTensionPoints(),S=_.length,w=y?0:4,y||c.quadraticCurveTo(_[0],_[1],_[2],_[3]);w<S-2;)c.bezierCurveTo(_[w++],_[w++],_[w++],_[w++],_[w++],_[w++]);y||c.quadraticCurveTo(_[S-2],_[S-1],u[d-2],u[d-1])}else if(f)for(w=2;w<d;)c.bezierCurveTo(u[w++],u[w++],u[w++],u[w++],u[w++],u[w++]);else for(w=2;w<d;w+=2)c.lineTo(u[w],u[w+1]);y?(c.closePath(),c.fillStrokeShape(this)):c.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():i(this.points(),this.tension())}_getTensionPointsClosed(){const c=this.points(),u=c.length,d=this.tension(),p=a(c[u-2],c[u-1],c[0],c[1],c[2],c[3],d),y=a(c[u-4],c[u-3],c[u-2],c[u-1],c[0],c[1],d),f=i(c,d);return[p[2],p[3]].concat(f).concat([y[0],y[1],c[u-2],c[u-1],y[2],y[3],p[0],p[1],c[0],c[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let c=this.points();if(c.length<4)return{x:c[0]||0,y:c[1]||0,width:0,height:0};this.tension()!==0?c=[c[0],c[1],...this._getTensionPoints(),c[c.length-2],c[c.length-1]]:c=this.points();let u=c[0],d=c[0],p=c[1],y=c[1],f,_;for(let S=0;S<c.length/2;S++)f=c[S*2],_=c[S*2+1],u=Math.min(u,f),d=Math.max(d,f),p=Math.min(p,_),y=Math.max(y,_);return{x:u,y:p,width:d-u,height:y-p}}}return od.Line=o,o.prototype.className="Line",o.prototype._attrsAffectingSize=["points","bezier","tension"],(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"closed",!1),e.Factory.addGetterSetter(o,"bezier",!1),e.Factory.addGetterSetter(o,"tension",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(o,"points",[],(0,n.getNumberArrayValidator)()),od}var sd={},ag={},s5;function zS(){return s5||(s5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const r=(o,s,c)=>{let u,d;const y=c/2;u=0;for(let f=0;f<20;f++)d=y*e.tValues[20][f]+y,u+=e.cValues[20][f]*n(o,s,d);return y*u};e.getCubicArcLength=r;const t=(o,s,c)=>{c===void 0&&(c=1);const u=o[0]-2*o[1]+o[2],d=s[0]-2*s[1]+s[2],p=2*o[1]-2*o[0],y=2*s[1]-2*s[0],f=4*(u*u+d*d),_=4*(u*p+d*y),S=p*p+y*y;if(f===0)return c*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(s[2]-s[0],2));const w=_/(2*f),x=S/f,v=c+w,g=x-w*w,E=v*v+g>0?Math.sqrt(v*v+g):0,b=w*w+g>0?Math.sqrt(w*w+g):0,M=w+Math.sqrt(w*w+g)!==0?g*Math.log(Math.abs((v+E)/(w+b))):0;return Math.sqrt(f)/2*(v*E-w*b+M)};e.getQuadraticArcLength=t;function n(o,s,c){const u=a(1,c,o),d=a(1,c,s),p=u*u+d*d;return Math.sqrt(p)}const a=(o,s,c)=>{const u=c.length-1;let d,p;if(u===0)return 0;if(o===0){p=0;for(let y=0;y<=u;y++)p+=e.binomialCoefficients[u][y]*Math.pow(1-s,u-y)*Math.pow(s,y)*c[y];return p}else{d=new Array(u);for(let y=0;y<u;y++)d[y]=u*(c[y+1]-c[y]);return a(o-1,s,d)}},i=(o,s,c)=>{let u=1,d=o/s,p=(o-c(d))/s,y=0;for(;u>.001;){const f=c(d+p),_=Math.abs(o-f)/s;if(_<u)u=_,d+=p;else{const S=c(d-p),w=Math.abs(o-S)/s;w<u?(u=w,d-=p):p/=2}if(y++,y>500)break}return d};e.t2length=i}(ag)),ag}var l5;function cm(){if(l5)return sd;l5=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.Path=void 0;const e=zr(),r=Ra(),t=Tr(),n=zS();class a extends r.Shape{constructor(o){super(o),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=a.parsePathData(this.data()),this.pathLength=a.getPathLength(this.dataArray)}_sceneFunc(o){const s=this.dataArray;o.beginPath();let c=!1;for(let E=0;E<s.length;E++){const b=s[E].command,M=s[E].points;switch(b){case"L":o.lineTo(M[0],M[1]);break;case"M":o.moveTo(M[0],M[1]);break;case"C":o.bezierCurveTo(M[0],M[1],M[2],M[3],M[4],M[5]);break;case"Q":o.quadraticCurveTo(M[0],M[1],M[2],M[3]);break;case"A":var u=M[0],d=M[1],p=M[2],y=M[3],f=M[4],_=M[5],S=M[6],w=M[7],x=p>y?p:y,v=p>y?1:p/y,g=p>y?y/p:1;o.translate(u,d),o.rotate(S),o.scale(v,g),o.arc(0,0,x,f,f+_,1-w),o.scale(1/v,1/g),o.rotate(-S),o.translate(-u,-d);break;case"z":c=!0,o.closePath();break}}!c&&!this.hasFill()?o.strokeShape(this):o.fillStrokeShape(this)}getSelfRect(){let o=[];this.dataArray.forEach(function(f){if(f.command==="A"){const _=f.points[4],S=f.points[5],w=f.points[4]+S;let x=Math.PI/180;if(Math.abs(_-w)<x&&(x=Math.abs(_-w)),S<0)for(let v=_-x;v>w;v-=x){const g=a.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],v,0);o.push(g.x,g.y)}else for(let v=_+x;v<w;v+=x){const g=a.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],v,0);o.push(g.x,g.y)}}else if(f.command==="C")for(let _=0;_<=1;_+=.01){const S=a.getPointOnCubicBezier(_,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);o.push(S.x,S.y)}else o=o.concat(f.points)});let s=o[0],c=o[0],u=o[1],d=o[1],p,y;for(let f=0;f<o.length/2;f++)p=o[f*2],y=o[f*2+1],isNaN(p)||(s=Math.min(s,p),c=Math.max(c,p)),isNaN(y)||(u=Math.min(u,y),d=Math.max(d,y));return{x:s,y:u,width:c-s,height:d-u}}getLength(){return this.pathLength}getPointAtLength(o){return a.getPointAtLengthOfDataArray(o,this.dataArray)}static getLineLength(o,s,c,u){return Math.sqrt((c-o)*(c-o)+(u-s)*(u-s))}static getPathLength(o){let s=0;for(let c=0;c<o.length;++c)s+=o[c].pathLength;return s}static getPointAtLengthOfDataArray(o,s){let c,u=0,d=s.length;if(!d)return null;for(;u<d&&o>s[u].pathLength;)o-=s[u].pathLength,++u;if(u===d)return c=s[u-1].points.slice(-2),{x:c[0],y:c[1]};if(o<.01)return c=s[u].points.slice(0,2),{x:c[0],y:c[1]};const p=s[u],y=p.points;switch(p.command){case"L":return a.getPointOnLine(o,p.start.x,p.start.y,y[0],y[1]);case"C":return a.getPointOnCubicBezier((0,n.t2length)(o,a.getPathLength(s),E=>(0,n.getCubicArcLength)([p.start.x,y[0],y[2],y[4]],[p.start.y,y[1],y[3],y[5]],E)),p.start.x,p.start.y,y[0],y[1],y[2],y[3],y[4],y[5]);case"Q":return a.getPointOnQuadraticBezier((0,n.t2length)(o,a.getPathLength(s),E=>(0,n.getQuadraticArcLength)([p.start.x,y[0],y[2]],[p.start.y,y[1],y[3]],E)),p.start.x,p.start.y,y[0],y[1],y[2],y[3]);case"A":var f=y[0],_=y[1],S=y[2],w=y[3],x=y[4],v=y[5],g=y[6];return x+=v*o/p.pathLength,a.getPointOnEllipticalArc(f,_,S,w,x,g)}return null}static getPointOnLine(o,s,c,u,d,p,y){p=p??s,y=y??c;const f=this.getLineLength(s,c,u,d);if(f<1e-10)return{x:s,y:c};if(u===s)return{x:p,y:y+(d>c?o:-o)};const _=(d-c)/(u-s),S=Math.sqrt(o*o/(1+_*_))*(u<s?-1:1),w=_*S;if(Math.abs(y-c-_*(p-s))<1e-10)return{x:p+S,y:y+w};const x=((p-s)*(u-s)+(y-c)*(d-c))/(f*f),v=s+x*(u-s),g=c+x*(d-c),E=this.getLineLength(p,y,v,g),b=Math.sqrt(o*o-E*E),M=Math.sqrt(b*b/(1+_*_))*(u<s?-1:1),N=_*M;return{x:v+M,y:g+N}}static getPointOnCubicBezier(o,s,c,u,d,p,y,f,_){function S(b){return b*b*b}function w(b){return 3*b*b*(1-b)}function x(b){return 3*b*(1-b)*(1-b)}function v(b){return(1-b)*(1-b)*(1-b)}const g=f*S(o)+p*w(o)+u*x(o)+s*v(o),E=_*S(o)+y*w(o)+d*x(o)+c*v(o);return{x:g,y:E}}static getPointOnQuadraticBezier(o,s,c,u,d,p,y){function f(v){return v*v}function _(v){return 2*v*(1-v)}function S(v){return(1-v)*(1-v)}const w=p*f(o)+u*_(o)+s*S(o),x=y*f(o)+d*_(o)+c*S(o);return{x:w,y:x}}static getPointOnEllipticalArc(o,s,c,u,d,p){const y=Math.cos(p),f=Math.sin(p),_={x:c*Math.cos(d),y:u*Math.sin(d)};return{x:o+(_.x*y-_.y*f),y:s+(_.x*f+_.y*y)}}static parsePathData(o){if(!o)return[];let s=o;const c=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];s=s.replace(new RegExp(" ","g"),",");for(var u=0;u<c.length;u++)s=s.replace(new RegExp(c[u],"g"),"|"+c[u]);const d=s.split("|"),p=[],y=[];let f=0,_=0;const S=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let w;for(u=1;u<d.length;u++){let A=d[u],k=A.charAt(0);for(A=A.slice(1),y.length=0;w=S.exec(A);)y.push(w[0]);const T=[];for(let V=0,G=y.length;V<G;V++){if(y[V]==="00"){T.push(0,0);continue}const $=parseFloat(y[V]);isNaN($)?T.push(0):T.push($)}for(;T.length>0&&!isNaN(T[0]);){let V="",G=[];const $=f,te=_;var x,v,g,E,b,M,N,R,F,j;switch(k){case"l":f+=T.shift(),_+=T.shift(),V="L",G.push(f,_);break;case"L":f=T.shift(),_=T.shift(),G.push(f,_);break;case"m":var O=T.shift(),C=T.shift();if(f+=O,_+=C,V="M",p.length>2&&p[p.length-1].command==="z"){for(let W=p.length-2;W>=0;W--)if(p[W].command==="M"){f=p[W].points[0]+O,_=p[W].points[1]+C;break}}G.push(f,_),k="l";break;case"M":f=T.shift(),_=T.shift(),V="M",G.push(f,_),k="L";break;case"h":f+=T.shift(),V="L",G.push(f,_);break;case"H":f=T.shift(),V="L",G.push(f,_);break;case"v":_+=T.shift(),V="L",G.push(f,_);break;case"V":_=T.shift(),V="L",G.push(f,_);break;case"C":G.push(T.shift(),T.shift(),T.shift(),T.shift()),f=T.shift(),_=T.shift(),G.push(f,_);break;case"c":G.push(f+T.shift(),_+T.shift(),f+T.shift(),_+T.shift()),f+=T.shift(),_+=T.shift(),V="C",G.push(f,_);break;case"S":v=f,g=_,x=p[p.length-1],x.command==="C"&&(v=f+(f-x.points[2]),g=_+(_-x.points[3])),G.push(v,g,T.shift(),T.shift()),f=T.shift(),_=T.shift(),V="C",G.push(f,_);break;case"s":v=f,g=_,x=p[p.length-1],x.command==="C"&&(v=f+(f-x.points[2]),g=_+(_-x.points[3])),G.push(v,g,f+T.shift(),_+T.shift()),f+=T.shift(),_+=T.shift(),V="C",G.push(f,_);break;case"Q":G.push(T.shift(),T.shift()),f=T.shift(),_=T.shift(),G.push(f,_);break;case"q":G.push(f+T.shift(),_+T.shift()),f+=T.shift(),_+=T.shift(),V="Q",G.push(f,_);break;case"T":v=f,g=_,x=p[p.length-1],x.command==="Q"&&(v=f+(f-x.points[0]),g=_+(_-x.points[1])),f=T.shift(),_=T.shift(),V="Q",G.push(v,g,f,_);break;case"t":v=f,g=_,x=p[p.length-1],x.command==="Q"&&(v=f+(f-x.points[0]),g=_+(_-x.points[1])),f+=T.shift(),_+=T.shift(),V="Q",G.push(v,g,f,_);break;case"A":E=T.shift(),b=T.shift(),M=T.shift(),N=T.shift(),R=T.shift(),F=f,j=_,f=T.shift(),_=T.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,j,f,_,N,R,E,b,M);break;case"a":E=T.shift(),b=T.shift(),M=T.shift(),N=T.shift(),R=T.shift(),F=f,j=_,f+=T.shift(),_+=T.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,j,f,_,N,R,E,b,M);break}p.push({command:V||k,points:G,start:{x:$,y:te},pathLength:this.calcLength($,te,V||k,G)})}(k==="z"||k==="Z")&&p.push({command:"z",points:[],start:void 0,pathLength:0})}return p}static calcLength(o,s,c,u){let d,p,y,f;const _=a;switch(c){case"L":return _.getLineLength(o,s,u[0],u[1]);case"C":return(0,n.getCubicArcLength)([o,u[0],u[2],u[4]],[s,u[1],u[3],u[5]],1);case"Q":return(0,n.getQuadraticArcLength)([o,u[0],u[2]],[s,u[1],u[3]],1);case"A":d=0;var S=u[4],w=u[5],x=u[4]+w,v=Math.PI/180;if(Math.abs(S-x)<v&&(v=Math.abs(S-x)),p=_.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],S,0),w<0)for(f=S-v;f>x;f-=v)y=_.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],f,0),d+=_.getLineLength(p.x,p.y,y.x,y.y),p=y;else for(f=S+v;f<x;f+=v)y=_.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],f,0),d+=_.getLineLength(p.x,p.y,y.x,y.y),p=y;return y=_.getPointOnEllipticalArc(u[0],u[1],u[2],u[3],x,0),d+=_.getLineLength(p.x,p.y,y.x,y.y),d}return 0}static convertEndpointToCenterParameterization(o,s,c,u,d,p,y,f,_){const S=_*(Math.PI/180),w=Math.cos(S)*(o-c)/2+Math.sin(S)*(s-u)/2,x=-1*Math.sin(S)*(o-c)/2+Math.cos(S)*(s-u)/2,v=w*w/(y*y)+x*x/(f*f);v>1&&(y*=Math.sqrt(v),f*=Math.sqrt(v));let g=Math.sqrt((y*y*(f*f)-y*y*(x*x)-f*f*(w*w))/(y*y*(x*x)+f*f*(w*w)));d===p&&(g*=-1),isNaN(g)&&(g=0);const E=g*y*x/f,b=g*-f*w/y,M=(o+c)/2+Math.cos(S)*E-Math.sin(S)*b,N=(s+u)/2+Math.sin(S)*E+Math.cos(S)*b,R=function(T){return Math.sqrt(T[0]*T[0]+T[1]*T[1])},F=function(T,V){return(T[0]*V[0]+T[1]*V[1])/(R(T)*R(V))},j=function(T,V){return(T[0]*V[1]<T[1]*V[0]?-1:1)*Math.acos(F(T,V))},O=j([1,0],[(w-E)/y,(x-b)/f]),C=[(w-E)/y,(x-b)/f],A=[(-1*w-E)/y,(-1*x-b)/f];let k=j(C,A);return F(C,A)<=-1&&(k=Math.PI),F(C,A)>=1&&(k=0),p===0&&k>0&&(k=k-2*Math.PI),p===1&&k<0&&(k=k+2*Math.PI),[M,N,y,f,O,k,S,p]}}return sd.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(a),e.Factory.addGetterSetter(a,"data"),sd}var u5;function US(){if(u5)return ad;u5=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Arrow=void 0;const e=zr(),r=O6(),t=Gr(),n=Tr(),a=cm();class i extends r.Line{_sceneFunc(s){super._sceneFunc(s);const c=Math.PI*2,u=this.points();let d=u;const p=this.tension()!==0&&u.length>4;p&&(d=this.getTensionPoints());const y=this.pointerLength(),f=u.length;let _,S;if(p){const v=[d[d.length-4],d[d.length-3],d[d.length-2],d[d.length-1],u[f-2],u[f-1]],g=a.Path.calcLength(d[d.length-4],d[d.length-3],"C",v),E=a.Path.getPointOnQuadraticBezier(Math.min(1,1-y/g),v[0],v[1],v[2],v[3],v[4],v[5]);_=u[f-2]-E.x,S=u[f-1]-E.y}else _=u[f-2]-u[f-4],S=u[f-1]-u[f-3];const w=(Math.atan2(S,_)+c)%c,x=this.pointerWidth();this.pointerAtEnding()&&(s.save(),s.beginPath(),s.translate(u[f-2],u[f-1]),s.rotate(w),s.moveTo(0,0),s.lineTo(-y,x/2),s.lineTo(-y,-x/2),s.closePath(),s.restore(),this.__fillStroke(s)),this.pointerAtBeginning()&&(s.save(),s.beginPath(),s.translate(u[0],u[1]),p?(_=(d[0]+d[2])/2-u[0],S=(d[1]+d[3])/2-u[1]):(_=u[2]-u[0],S=u[3]-u[1]),s.rotate((Math.atan2(-S,-_)+c)%c),s.moveTo(0,0),s.lineTo(-y,x/2),s.lineTo(-y,-x/2),s.closePath(),s.restore(),this.__fillStroke(s))}__fillStroke(s){const c=this.dashEnabled();c&&(this.attrs.dashEnabled=!1,s.setLineDash([])),s.fillStrokeShape(this),c&&(this.attrs.dashEnabled=!0)}getSelfRect(){const s=super.getSelfRect(),c=this.pointerWidth()/2;return{x:s.x,y:s.y-c,width:s.width,height:s.height+c*2}}}return ad.Arrow=i,i.prototype.className="Arrow",(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"pointerAtBeginning",!1),e.Factory.addGetterSetter(i,"pointerAtEnding",!0),ad}var ld={},c5;function HS(){if(c5)return ld;c5=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.Circle=void 0;const e=zr(),r=Ra(),t=Gr(),n=Tr();class a extends r.Shape{_sceneFunc(o){o.beginPath(),o.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius()!==o/2&&this.radius(o/2)}setHeight(o){this.radius()!==o/2&&this.radius(o/2)}}return ld.Circle=a,a.prototype._centroid=!0,a.prototype.className="Circle",a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),ld}var ud={},f5;function VS(){if(f5)return ud;f5=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.Ellipse=void 0;const e=zr(),r=Ra(),t=Gr(),n=Tr();class a extends r.Shape{_sceneFunc(o){const s=this.radiusX(),c=this.radiusY();o.beginPath(),o.save(),s!==c&&o.scale(1,c/s),o.arc(0,0,s,0,Math.PI*2,!1),o.restore(),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(o){this.radiusX(o/2)}setHeight(o){this.radiusY(o/2)}}return ud.Ellipse=a,a.prototype.className="Ellipse",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,n._registerNode)(a),e.Factory.addComponentsGetterSetter(a,"radius",["x","y"]),e.Factory.addGetterSetter(a,"radiusX",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"radiusY",0,(0,t.getNumberValidator)()),ud}var cd={},h5;function GS(){if(h5)return cd;h5=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.Image=void 0;const e=ki(),r=zr(),t=Ra(),n=Tr(),a=Gr();class i extends t.Shape{constructor(s){super(s),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",c=>{this._removeImageLoad(c.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const s=this.image();s&&s.complete||s&&s.readyState===4||s&&s.addEventListener&&s.addEventListener("load",this._loadListener)}_removeImageLoad(s){s&&s.removeEventListener&&s.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const s=!!this.cornerRadius(),c=this.hasShadow();return s&&c?!0:super._useBufferCanvas(!0)}_sceneFunc(s){const c=this.getWidth(),u=this.getHeight(),d=this.cornerRadius(),p=this.attrs.image;let y;if(p){const f=this.attrs.cropWidth,_=this.attrs.cropHeight;f&&_?y=[p,this.cropX(),this.cropY(),f,_,0,0,c,u]:y=[p,0,0,c,u]}(this.hasFill()||this.hasStroke()||d)&&(s.beginPath(),d?e.Util.drawRoundedRectPath(s,c,u,d):s.rect(0,0,c,u),s.closePath(),s.fillStrokeShape(this)),p&&(d&&s.clip(),s.drawImage.apply(s,y))}_hitFunc(s){const c=this.width(),u=this.height(),d=this.cornerRadius();s.beginPath(),d?e.Util.drawRoundedRectPath(s,c,u,d):s.rect(0,0,c,u),s.closePath(),s.fillStrokeShape(this)}getWidth(){var s,c;return(s=this.attrs.width)!==null&&s!==void 0?s:(c=this.image())===null||c===void 0?void 0:c.width}getHeight(){var s,c;return(s=this.attrs.height)!==null&&s!==void 0?s:(c=this.image())===null||c===void 0?void 0:c.height}static fromURL(s,c,u=null){const d=e.Util.createImageElement();d.onload=function(){const p=new i({image:d});c(p)},d.onerror=u,d.crossOrigin="Anonymous",d.src=s}}return cd.Image=i,i.prototype.className="Image",(0,n._registerNode)(i),r.Factory.addGetterSetter(i,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),r.Factory.addGetterSetter(i,"image"),r.Factory.addComponentsGetterSetter(i,"crop",["x","y","width","height"]),r.Factory.addGetterSetter(i,"cropX",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropY",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropWidth",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropHeight",0,(0,a.getNumberValidator)()),cd}var bf={},d5;function WS(){if(d5)return bf;d5=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Tag=bf.Label=void 0;const e=zr(),r=Ra(),t=lm(),n=Gr(),a=Tr(),i=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],o="Change.konva",s="none",c="up",u="right",d="down",p="left",y=i.length;class f extends t.Group{constructor(w){super(w),this.on("add.konva",function(x){this._addListeners(x.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(w){let x=this,v;const g=function(){x._sync()};for(v=0;v<y;v++)w.on(i[v]+o,g)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let w=this.getText(),x=this.getTag(),v,g,E,b,M,N,R;if(w&&x){switch(v=w.width(),g=w.height(),E=x.pointerDirection(),b=x.pointerWidth(),R=x.pointerHeight(),M=0,N=0,E){case c:M=v/2,N=-1*R;break;case u:M=v+b,N=g/2;break;case d:M=v/2,N=g+R;break;case p:M=-1*b,N=g/2;break}x.setAttrs({x:-1*M,y:-1*N,width:v,height:g}),w.setAttrs({x:-1*M,y:-1*N})}}}bf.Label=f,f.prototype.className="Label",(0,a._registerNode)(f);class _ extends r.Shape{_sceneFunc(w){const x=this.width(),v=this.height(),g=this.pointerDirection(),E=this.pointerWidth(),b=this.pointerHeight(),M=this.cornerRadius();let N=0,R=0,F=0,j=0;typeof M=="number"?N=R=F=j=Math.min(M,x/2,v/2):(N=Math.min(M[0]||0,x/2,v/2),R=Math.min(M[1]||0,x/2,v/2),j=Math.min(M[2]||0,x/2,v/2),F=Math.min(M[3]||0,x/2,v/2)),w.beginPath(),w.moveTo(N,0),g===c&&(w.lineTo((x-E)/2,0),w.lineTo(x/2,-1*b),w.lineTo((x+E)/2,0)),w.lineTo(x-R,0),w.arc(x-R,R,R,Math.PI*3/2,0,!1),g===u&&(w.lineTo(x,(v-b)/2),w.lineTo(x+E,v/2),w.lineTo(x,(v+b)/2)),w.lineTo(x,v-j),w.arc(x-j,v-j,j,0,Math.PI/2,!1),g===d&&(w.lineTo((x+E)/2,v),w.lineTo(x/2,v+b),w.lineTo((x-E)/2,v)),w.lineTo(F,v),w.arc(F,v-F,F,Math.PI/2,Math.PI,!1),g===p&&(w.lineTo(0,(v+b)/2),w.lineTo(-1*E,v/2),w.lineTo(0,(v-b)/2)),w.lineTo(0,N),w.arc(N,N,N,Math.PI,Math.PI*3/2,!1),w.closePath(),w.fillStrokeShape(this)}getSelfRect(){let w=0,x=0,v=this.pointerWidth(),g=this.pointerHeight(),E=this.pointerDirection(),b=this.width(),M=this.height();return E===c?(x-=g,M+=g):E===d?M+=g:E===p?(w-=v*1.5,b+=v):E===u&&(b+=v*1.5),{x:w,y:x,width:b,height:M}}}return bf.Tag=_,_.prototype.className="Tag",(0,a._registerNode)(_),e.Factory.addGetterSetter(_,"pointerDirection",s),e.Factory.addGetterSetter(_,"pointerWidth",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(_,"pointerHeight",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(_,"cornerRadius",0,(0,n.getNumberOrArrayOfNumbersValidator)(4)),bf}var fd={},p5;function A6(){if(p5)return fd;p5=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.Rect=void 0;const e=zr(),r=Ra(),t=Tr(),n=ki(),a=Gr();class i extends r.Shape{_sceneFunc(s){const c=this.cornerRadius(),u=this.width(),d=this.height();s.beginPath(),c?n.Util.drawRoundedRectPath(s,u,d,c):s.rect(0,0,u,d),s.closePath(),s.fillStrokeShape(this)}}return fd.Rect=i,i.prototype.className="Rect",(0,t._registerNode)(i),e.Factory.addGetterSetter(i,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),fd}var hd={},g5;function $S(){if(g5)return hd;g5=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.RegularPolygon=void 0;const e=zr(),r=Ra(),t=Gr(),n=Tr();class a extends r.Shape{_sceneFunc(o){const s=this._getPoints();o.beginPath(),o.moveTo(s[0].x,s[0].y);for(let c=1;c<s.length;c++)o.lineTo(s[c].x,s[c].y);o.closePath(),o.fillStrokeShape(this)}_getPoints(){const o=this.attrs.sides,s=this.attrs.radius||0,c=[];for(let u=0;u<o;u++)c.push({x:s*Math.sin(u*2*Math.PI/o),y:-1*s*Math.cos(u*2*Math.PI/o)});return c}getSelfRect(){const o=this._getPoints();let s=o[0].x,c=o[0].y,u=o[0].x,d=o[0].y;return o.forEach(p=>{s=Math.min(s,p.x),c=Math.max(c,p.x),u=Math.min(u,p.y),d=Math.max(d,p.y)}),{x:s,y:u,width:c-s,height:d-u}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius(o/2)}setHeight(o){this.radius(o/2)}}return hd.RegularPolygon=a,a.prototype.className="RegularPolygon",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"sides",0,(0,t.getNumberValidator)()),hd}var dd={},v5;function YS(){if(v5)return dd;v5=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.Ring=void 0;const e=zr(),r=Ra(),t=Gr(),n=Tr(),a=Math.PI*2;class i extends r.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.innerRadius(),0,a,!1),s.moveTo(this.outerRadius(),0),s.arc(0,0,this.outerRadius(),a,0,!0),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}}return dd.Ring=i,i.prototype.className="Ring",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,t.getNumberValidator)()),dd}var pd={},m5;function XS(){if(m5)return pd;m5=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.Sprite=void 0;const e=zr(),r=Ra(),t=um(),n=Gr(),a=Tr();class i extends r.Shape{constructor(s){super(s),this._updated=!0,this.anim=new t.Animation(()=>{const c=this._updated;return this._updated=!1,c}),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(s){const c=this.animation(),u=this.frameIndex(),d=u*4,p=this.animations()[c],y=this.frameOffsets(),f=p[d+0],_=p[d+1],S=p[d+2],w=p[d+3],x=this.image();if((this.hasFill()||this.hasStroke())&&(s.beginPath(),s.rect(0,0,S,w),s.closePath(),s.fillStrokeShape(this)),x)if(y){const v=y[c],g=u*2;s.drawImage(x,f,_,S,w,v[g+0],v[g+1],S,w)}else s.drawImage(x,f,_,S,w,0,0,S,w)}_hitFunc(s){const c=this.animation(),u=this.frameIndex(),d=u*4,p=this.animations()[c],y=this.frameOffsets(),f=p[d+2],_=p[d+3];if(s.beginPath(),y){const S=y[c],w=u*2;s.rect(S[w+0],S[w+1],f,_)}else s.rect(0,0,f,_);s.closePath(),s.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const s=this;this.interval=setInterval(function(){s._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const s=this.getLayer();this.anim.setLayers(s),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const s=this.frameIndex(),c=this.animation(),u=this.animations(),d=u[c],p=d.length/4;s<p-1?this.frameIndex(s+1):this.frameIndex(0)}}return pd.Sprite=i,i.prototype.className="Sprite",(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"animation"),e.Factory.addGetterSetter(i,"animations"),e.Factory.addGetterSetter(i,"frameOffsets"),e.Factory.addGetterSetter(i,"image"),e.Factory.addGetterSetter(i,"frameIndex",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"frameRate",17,(0,n.getNumberValidator)()),e.Factory.backCompat(i,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),pd}var gd={},y5;function KS(){if(y5)return gd;y5=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.Star=void 0;const e=zr(),r=Ra(),t=Gr(),n=Tr();class a extends r.Shape{_sceneFunc(o){const s=this.innerRadius(),c=this.outerRadius(),u=this.numPoints();o.beginPath(),o.moveTo(0,0-c);for(let d=1;d<u*2;d++){const p=d%2===0?c:s,y=p*Math.sin(d*Math.PI/u),f=-1*p*Math.cos(d*Math.PI/u);o.lineTo(y,f)}o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(o){this.outerRadius(o/2)}setHeight(o){this.outerRadius(o/2)}}return gd.Star=a,a.prototype.className="Star",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"numPoints",5,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,t.getNumberValidator)()),gd}var rh={},b5;function C6(){if(b5)return rh;b5=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.Text=void 0,rh.stringToArray=o;const e=ki(),r=zr(),t=Ra(),n=Tr(),a=Gr(),i=Tr();function o(z){return[...z].reduce((D,Y,Q,J)=>{if(new RegExp("\\p{Emoji}","u").test(Y)){const Z=J[Q+1];Z&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(Z)?(D.push(Y+Z),J[Q+1]=""):D.push(Y)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(Y+(J[Q+1]||""))?D.push(Y+J[Q+1]):Q>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(Y)?D[D.length-1]+=Y:Y&&D.push(Y);return D},[])}const s="auto",c="center",u="inherit",d="justify",p="Change.konva",y="2d",f="-",_="left",S="text",w="Text",x="top",v="bottom",g="middle",E="normal",b="px ",M=" ",N="right",R="rtl",F="word",j="char",O="none",C="…",A=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],k=A.length;function T(z){return z.split(",").map(D=>{D=D.trim();const Y=D.indexOf(" ")>=0,Q=D.indexOf('"')>=0||D.indexOf("'")>=0;return Y&&!Q&&(D=`"${D}"`),D}).join(", ")}let V;function G(){return V||(V=e.Util.createCanvasElement().getContext(y),V)}function $(z){z.fillText(this._partialText,this._partialTextX,this._partialTextY)}function te(z){z.setAttr("miterLimit",2),z.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function W(z){return z=z||{},!z.fillLinearGradientColorStops&&!z.fillRadialGradientColorStops&&!z.fillPatternImage&&(z.fill=z.fill||"black"),z}class U extends t.Shape{constructor(D){super(W(D)),this._partialTextX=0,this._partialTextY=0;for(let Y=0;Y<k;Y++)this.on(A[Y]+p,this._setTextData);this._setTextData()}_sceneFunc(D){const Y=this.textArr,Q=Y.length;if(!this.text())return;let J=this.padding(),Z=this.fontSize(),ae=this.lineHeight()*Z,se=this.verticalAlign(),ce=this.direction(),de=0,Oe=this.align(),Le=this.getWidth(),ke=this.letterSpacing(),Se=this.fill(),ye=this.textDecoration(),Je=ye.indexOf("underline")!==-1,we=ye.indexOf("line-through")!==-1,me;ce=ce===u?D.direction:ce;let Ee=ae/2,Te=g;if(n.Konva._fixTextRendering){const mt=this.measureSize("M");Te="alphabetic",Ee=(mt.fontBoundingBoxAscent-mt.fontBoundingBoxDescent)/2+ae/2}var he=0,Re=0;for(ce===R&&D.setAttr("direction",ce),D.setAttr("font",this._getContextFont()),D.setAttr("textBaseline",Te),D.setAttr("textAlign",_),se===g?de=(this.getHeight()-Q*ae-J*2)/2:se===v&&(de=this.getHeight()-Q*ae-J*2),D.translate(J,de+J),me=0;me<Q;me++){var he=0,Re=0,Ie=Y[me],Xe=Ie.text,rt=Ie.width,vt=Ie.lastInParagraph,et,yt;if(D.save(),Oe===N?he+=Le-rt-J*2:Oe===c&&(he+=(Le-rt-J*2)/2),Je){D.save(),D.beginPath();const Bt=n.Konva._fixTextRendering?Math.round(Z/4):Math.round(Z/2),Pt=he,Yt=Ee+Re+Bt;D.moveTo(Pt,Yt),et=Xe.split(" ").length-1,yt=Oe===d&&!vt?Le-J*2:rt,D.lineTo(Pt+Math.round(yt),Yt),D.lineWidth=Z/15;const Gt=this._getLinearGradient();D.strokeStyle=Gt||Se,D.stroke(),D.restore()}if(we){D.save(),D.beginPath();const Bt=n.Konva._fixTextRendering?-Math.round(Z/4):0;D.moveTo(he,Ee+Re+Bt),et=Xe.split(" ").length-1,yt=Oe===d&&!vt?Le-J*2:rt,D.lineTo(he+Math.round(yt),Ee+Re+Bt),D.lineWidth=Z/15;const Pt=this._getLinearGradient();D.strokeStyle=Pt||Se,D.stroke(),D.restore()}if(ce!==R&&(ke!==0||Oe===d)){et=Xe.split(" ").length-1;const Bt=o(Xe);for(let Pt=0;Pt<Bt.length;Pt++){const Yt=Bt[Pt];Yt===" "&&!vt&&Oe===d&&(he+=(Le-J*2-rt)/et),this._partialTextX=he,this._partialTextY=Ee+Re,this._partialText=Yt,D.fillStrokeShape(this),he+=this.measureSize(Yt).width+ke}}else ke!==0&&D.setAttr("letterSpacing",`${ke}px`),this._partialTextX=he,this._partialTextY=Ee+Re,this._partialText=Xe,D.fillStrokeShape(this);D.restore(),Q>1&&(Ee+=ae)}}_hitFunc(D){const Y=this.getWidth(),Q=this.getHeight();D.beginPath(),D.rect(0,0,Y,Q),D.closePath(),D.fillStrokeShape(this)}setText(D){const Y=e.Util._isString(D)?D:D==null?"":D+"";return this._setAttr(S,Y),this}getWidth(){return this.attrs.width===s||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===s||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(D){var Y,Q,J,Z,ae,se,ce,de,Oe,Le,ke;let Se=G(),ye=this.fontSize(),Je;Se.save(),Se.font=this._getContextFont(),Je=Se.measureText(D),Se.restore();const we=ye/100;return{actualBoundingBoxAscent:(Y=Je.actualBoundingBoxAscent)!==null&&Y!==void 0?Y:71.58203125*we,actualBoundingBoxDescent:(Q=Je.actualBoundingBoxDescent)!==null&&Q!==void 0?Q:0,actualBoundingBoxLeft:(J=Je.actualBoundingBoxLeft)!==null&&J!==void 0?J:-7.421875*we,actualBoundingBoxRight:(Z=Je.actualBoundingBoxRight)!==null&&Z!==void 0?Z:75.732421875*we,alphabeticBaseline:(ae=Je.alphabeticBaseline)!==null&&ae!==void 0?ae:0,emHeightAscent:(se=Je.emHeightAscent)!==null&&se!==void 0?se:100*we,emHeightDescent:(ce=Je.emHeightDescent)!==null&&ce!==void 0?ce:-20*we,fontBoundingBoxAscent:(de=Je.fontBoundingBoxAscent)!==null&&de!==void 0?de:91*we,fontBoundingBoxDescent:(Oe=Je.fontBoundingBoxDescent)!==null&&Oe!==void 0?Oe:21*we,hangingBaseline:(Le=Je.hangingBaseline)!==null&&Le!==void 0?Le:72.80000305175781*we,ideographicBaseline:(ke=Je.ideographicBaseline)!==null&&ke!==void 0?ke:-21*we,width:Je.width,height:ye}}_getContextFont(){return this.fontStyle()+M+this.fontVariant()+M+(this.fontSize()+b)+T(this.fontFamily())}_addTextLine(D){this.align()===d&&(D=D.trim());const Q=this._getTextWidth(D);return this.textArr.push({text:D,width:Q,lastInParagraph:!1})}_getTextWidth(D){const Y=this.letterSpacing(),Q=D.length;return G().measureText(D).width+Y*Q}_setTextData(){let D=this.text().split(`
|
|
43
|
+
`),Y=+this.fontSize(),Q=0,J=this.lineHeight()*Y,Z=this.attrs.width,ae=this.attrs.height,se=Z!==s&&Z!==void 0,ce=ae!==s&&ae!==void 0,de=this.padding(),Oe=Z-de*2,Le=ae-de*2,ke=0,Se=this.wrap(),ye=Se!==O,Je=Se!==j&&ye,we=this.ellipsis();this.textArr=[],G().font=this._getContextFont();const me=we?this._getTextWidth(C):0;for(let Ee=0,Te=D.length;Ee<Te;++Ee){let he=D[Ee],Re=this._getTextWidth(he);if(se&&Re>Oe)for(;he.length>0;){let Ie=0,Xe=o(he).length,rt="",vt=0;for(;Ie<Xe;){const et=Ie+Xe>>>1,yt=o(he),mt=yt.slice(0,et+1).join(""),ct=this._getTextWidth(mt);(we&&ce&&ke+J>Le?ct+me:ct)<=Oe?(Ie=et+1,rt=mt,vt=ct):Xe=et}if(rt){if(Je){const mt=o(he),ct=o(rt),Bt=mt[ct.length],Pt=Bt===M||Bt===f;let Yt;if(Pt&&vt<=Oe)Yt=ct.length;else{const Gt=ct.lastIndexOf(M),Be=ct.lastIndexOf(f);Yt=Math.max(Gt,Be)+1}Yt>0&&(Ie=Yt,rt=mt.slice(0,Ie).join(""),vt=this._getTextWidth(rt))}if(rt=rt.trimRight(),this._addTextLine(rt),Q=Math.max(Q,vt),ke+=J,this._shouldHandleEllipsis(ke)){this._tryToAddEllipsisToLastLine();break}if(he=o(he).slice(Ie).join("").trimLeft(),he.length>0&&(Re=this._getTextWidth(he),Re<=Oe)){this._addTextLine(he),ke+=J,Q=Math.max(Q,Re);break}}else break}else this._addTextLine(he),ke+=J,Q=Math.max(Q,Re),this._shouldHandleEllipsis(ke)&&Ee<Te-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ce&&ke+J>Le)break}this.textHeight=Y,this.textWidth=Q}_shouldHandleEllipsis(D){const Y=+this.fontSize(),Q=this.lineHeight()*Y,J=this.attrs.height,Z=J!==s&&J!==void 0,ae=this.padding(),se=J-ae*2;return!(this.wrap()!==O)||Z&&D+Q>se}_tryToAddEllipsisToLastLine(){const D=this.attrs.width,Y=D!==s&&D!==void 0,Q=this.padding(),J=D-Q*2,Z=this.ellipsis(),ae=this.textArr[this.textArr.length-1];!ae||!Z||(Y&&(this._getTextWidth(ae.text+C)<J||(ae.text=ae.text.slice(0,ae.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(ae.text+C))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const D=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,Y=this.hasShadow();return D&&Y?!0:super._useBufferCanvas()}}return rh.Text=U,U.prototype._fillFunc=$,U.prototype._strokeFunc=te,U.prototype.className=w,U.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,i._registerNode)(U),r.Factory.overWriteSetter(U,"width",(0,a.getNumberOrAutoValidator)()),r.Factory.overWriteSetter(U,"height",(0,a.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(U,"direction",u),r.Factory.addGetterSetter(U,"fontFamily","Arial"),r.Factory.addGetterSetter(U,"fontSize",12,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(U,"fontStyle",E),r.Factory.addGetterSetter(U,"fontVariant",E),r.Factory.addGetterSetter(U,"padding",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(U,"align",_),r.Factory.addGetterSetter(U,"verticalAlign",x),r.Factory.addGetterSetter(U,"lineHeight",1,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(U,"wrap",F),r.Factory.addGetterSetter(U,"ellipsis",!1,(0,a.getBooleanValidator)()),r.Factory.addGetterSetter(U,"letterSpacing",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(U,"text","",(0,a.getStringValidator)()),r.Factory.addGetterSetter(U,"textDecoration",""),rh}var vd={},w5;function ZS(){if(w5)return vd;w5=1,Object.defineProperty(vd,"__esModule",{value:!0}),vd.TextPath=void 0;const e=ki(),r=zr(),t=Ra(),n=cm(),a=C6(),i=Gr(),o=Tr(),s="",c="normal";function u(y){y.fillText(this.partialText,0,0)}function d(y){y.strokeText(this.partialText,0,0)}class p extends t.Shape{constructor(f){super(f),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return n.Path.getPathLength(this.dataArray)}_getPointAtLength(f){if(!this.attrs.data)return null;const _=this.pathLength;return f-1>_?null:n.Path.getPointAtLengthOfDataArray(f,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(f){f.setAttr("font",this._getContextFont()),f.setAttr("textBaseline",this.textBaseline()),f.setAttr("textAlign","left"),f.save();const _=this.textDecoration(),S=this.fill(),w=this.fontSize(),x=this.glyphInfo;_==="underline"&&f.beginPath();for(let v=0;v<x.length;v++){f.save();const g=x[v].p0;f.translate(g.x,g.y),f.rotate(x[v].rotation),this.partialText=x[v].text,f.fillStrokeShape(this),_==="underline"&&(v===0&&f.moveTo(0,w/2+1),f.lineTo(w,w/2+1)),f.restore()}_==="underline"&&(f.strokeStyle=S,f.lineWidth=w/20,f.stroke()),f.restore()}_hitFunc(f){f.beginPath();const _=this.glyphInfo;if(_.length>=1){const S=_[0].p0;f.moveTo(S.x,S.y)}for(let S=0;S<_.length;S++){const w=_[S].p1;f.lineTo(w.x,w.y)}f.setAttr("lineWidth",this.fontSize()),f.setAttr("strokeStyle",this.colorKey),f.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(f){return a.Text.prototype.setText.call(this,f)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(f){const S=this.dummyCanvas.getContext("2d");S.save(),S.font=this._getContextFont();const w=S.measureText(f);return S.restore(),{width:w.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:f,height:_}=this._getTextSize(this.attrs.text);if(this.textWidth=f,this.textHeight=_,this.glyphInfo=[],!this.attrs.data)return null;const S=this.letterSpacing(),w=this.align(),x=this.kerningFunc(),v=Math.max(this.textWidth+((this.attrs.text||"").length-1)*S,0);let g=0;w==="center"&&(g=Math.max(0,this.pathLength/2-v/2)),w==="right"&&(g=Math.max(0,this.pathLength-v));const E=(0,a.stringToArray)(this.text());let b=g;for(let M=0;M<E.length;M++){const N=this._getPointAtLength(b);if(!N)return;let R=this._getTextSize(E[M]).width+S;if(E[M]===" "&&w==="justify"){const k=this.text().split(" ").length-1;R+=(this.pathLength-v)/k}const F=this._getPointAtLength(b+R);if(!F)return;const j=n.Path.getLineLength(N.x,N.y,F.x,F.y);let O=0;if(x)try{O=x(E[M-1],E[M])*this.fontSize()}catch{O=0}N.x+=O,F.x+=O,this.textWidth+=O;const C=n.Path.getPointOnLine(O+j/2,N.x,N.y,F.x,F.y),A=Math.atan2(F.y-N.y,F.x-N.x);this.glyphInfo.push({transposeX:C.x,transposeY:C.y,text:E[M],rotation:A,p0:N,p1:F}),b+=R}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const f=[];this.glyphInfo.forEach(function(b){f.push(b.p0.x),f.push(b.p0.y),f.push(b.p1.x),f.push(b.p1.y)});let _=f[0]||0,S=f[0]||0,w=f[1]||0,x=f[1]||0,v,g;for(let b=0;b<f.length/2;b++)v=f[b*2],g=f[b*2+1],_=Math.min(_,v),S=Math.max(S,v),w=Math.min(w,g),x=Math.max(x,g);const E=this.fontSize();return{x:_-E/2,y:w-E/2,width:S-_+E,height:x-w+E}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return vd.TextPath=p,p.prototype._fillFunc=u,p.prototype._strokeFunc=d,p.prototype._fillFuncHit=u,p.prototype._strokeFuncHit=d,p.prototype.className="TextPath",p.prototype._attrsAffectingSize=["text","fontSize","data"],(0,o._registerNode)(p),r.Factory.addGetterSetter(p,"data"),r.Factory.addGetterSetter(p,"fontFamily","Arial"),r.Factory.addGetterSetter(p,"fontSize",12,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(p,"fontStyle",c),r.Factory.addGetterSetter(p,"align","left"),r.Factory.addGetterSetter(p,"letterSpacing",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(p,"textBaseline","middle"),r.Factory.addGetterSetter(p,"fontVariant",c),r.Factory.addGetterSetter(p,"text",s),r.Factory.addGetterSetter(p,"textDecoration",""),r.Factory.addGetterSetter(p,"kerningFunc",void 0),vd}var md={},_5;function QS(){if(_5)return md;_5=1,Object.defineProperty(md,"__esModule",{value:!0}),md.Transformer=void 0;const e=ki(),r=zr(),t=Ji(),n=Ra(),a=A6(),i=lm(),o=Tr(),s=Gr(),c=Tr(),u="tr-konva",d=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(R=>R+`.${u}`).join(" "),p="nodesRect",y=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],f={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},_="ontouchstart"in o.Konva._global;function S(R,F,j){if(R==="rotater")return j;F+=e.Util.degToRad(f[R]||0);const O=(e.Util.radToDeg(F)%360+360)%360;return e.Util._inRange(O,315+22.5,360)||e.Util._inRange(O,0,22.5)?"ns-resize":e.Util._inRange(O,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(O,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(O,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(O,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(O,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(O,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(O,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+O),"pointer")}const w=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function x(R){return{x:R.x+R.width/2*Math.cos(R.rotation)+R.height/2*Math.sin(-R.rotation),y:R.y+R.height/2*Math.cos(R.rotation)+R.width/2*Math.sin(R.rotation)}}function v(R,F,j){const O=j.x+(R.x-j.x)*Math.cos(F)-(R.y-j.y)*Math.sin(F),C=j.y+(R.x-j.x)*Math.sin(F)+(R.y-j.y)*Math.cos(F);return{...R,rotation:R.rotation+F,x:O,y:C}}function g(R,F){const j=x(R);return v(R,F,j)}function E(R,F,j){let O=F;for(let C=0;C<R.length;C++){const A=o.Konva.getAngle(R[C]),k=Math.abs(A-F)%(Math.PI*2);Math.min(k,Math.PI*2-k)<j&&(O=A)}return O}let b=0;class M extends i.Group{constructor(F){super(F),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(d,this.update),this.getNode()&&this.update()}attachTo(F){return this.setNode(F),this}setNode(F){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([F])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return u+this._id}setNodes(F=[]){this._nodes&&this._nodes.length&&this.detach();const j=F.filter(C=>C.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=F=j,F.length===1&&this.useSingleNodeRotation()?this.rotation(F[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(C=>{const A=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(C._attrsAffectingSize.length){const k=C._attrsAffectingSize.map(T=>T+"Change."+this._getEventNamespace()).join(" ");C.on(k,A)}C.on(y.map(k=>k+`.${this._getEventNamespace()}`).join(" "),A),C.on(`absoluteTransformChange.${this._getEventNamespace()}`,A),this._proxyDrag(C)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(F){let j;F.on(`dragstart.${this._getEventNamespace()}`,O=>{j=F.getAbsolutePosition(),!this.isDragging()&&F!==this.findOne(".back")&&this.startDrag(O,!1)}),F.on(`dragmove.${this._getEventNamespace()}`,O=>{if(!j)return;const C=F.getAbsolutePosition(),A=C.x-j.x,k=C.y-j.y;this.nodes().forEach(T=>{if(T===F||T.isDragging())return;const V=T.getAbsolutePosition();T.setAbsolutePosition({x:V.x+A,y:V.y+k}),T.startDrag(O)}),j=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(F=>{F.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(p),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(p,this.__getNodeRect)}__getNodeShape(F,j=this.rotation(),O){const C=F.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),A=F.getAbsoluteScale(O),k=F.getAbsolutePosition(O),T=C.x*A.x-F.offsetX()*A.x,V=C.y*A.y-F.offsetY()*A.y,G=(o.Konva.getAngle(F.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),$={x:k.x+T*Math.cos(G)+V*Math.sin(-G),y:k.y+V*Math.cos(G)+T*Math.sin(G),width:C.width*A.x,height:C.height*A.y,rotation:G};return v($,-o.Konva.getAngle(j),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const j=[];this.nodes().map(G=>{const $=G.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),te=[{x:$.x,y:$.y},{x:$.x+$.width,y:$.y},{x:$.x+$.width,y:$.y+$.height},{x:$.x,y:$.y+$.height}],W=G.getAbsoluteTransform();te.forEach(function(U){const z=W.point(U);j.push(z)})});const O=new e.Transform;O.rotate(-o.Konva.getAngle(this.rotation()));let C=1/0,A=1/0,k=-1/0,T=-1/0;j.forEach(function(G){const $=O.point(G);C===void 0&&(C=k=$.x,A=T=$.y),C=Math.min(C,$.x),A=Math.min(A,$.y),k=Math.max(k,$.x),T=Math.max(T,$.y)}),O.invert();const V=O.point({x:C,y:A});return{x:V.x,y:V.y,width:k-C,height:T-A,rotation:o.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(),w.forEach(F=>{this._createAnchor(F)}),this._createAnchor("rotater")}_createAnchor(F){const j=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:F+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:_?10:"auto"}),O=this;j.on("mousedown touchstart",function(C){O._handleMouseDown(C)}),j.on("dragstart",C=>{j.stopDrag(),C.cancelBubble=!0}),j.on("dragend",C=>{C.cancelBubble=!0}),j.on("mouseenter",()=>{const C=o.Konva.getAngle(this.rotation()),A=this.rotateAnchorCursor(),k=S(F,C,A);j.getStage().content&&(j.getStage().content.style.cursor=k),this._cursorChange=!0}),j.on("mouseout",()=>{j.getStage().content&&(j.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(j)}_createBack(){const F=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(j,O){const C=O.getParent(),A=C.padding();j.beginPath(),j.rect(-A,-A,O.width()+A*2,O.height()+A*2),j.moveTo(O.width()/2,-A),C.rotateEnabled()&&C.rotateLineVisible()&&j.lineTo(O.width()/2,-C.rotateAnchorOffset()*e.Util._sign(O.height())-A),j.fillStrokeShape(O)},hitFunc:(j,O)=>{if(!this.shouldOverdrawWholeArea())return;const C=this.padding();j.beginPath(),j.rect(-C,-C,O.width()+C*2,O.height()+C*2),j.fillStrokeShape(O)}});this.add(F),this._proxyDrag(F),F.on("dragstart",j=>{j.cancelBubble=!0}),F.on("dragmove",j=>{j.cancelBubble=!0}),F.on("dragend",j=>{j.cancelBubble=!0}),this.on("dragmove",j=>{this.update()})}_handleMouseDown(F){if(this._transforming)return;this._movingAnchorName=F.target.name().split(" ")[0];const j=this._getNodeRect(),O=j.width,C=j.height,A=Math.sqrt(Math.pow(O,2)+Math.pow(C,2));this.sin=Math.abs(C/A),this.cos=Math.abs(O/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;const k=F.target.getAbsolutePosition(),T=F.target.getStage().getPointerPosition();this._anchorDragOffset={x:T.x-k.x,y:T.y-k.y},b++,this._fire("transformstart",{evt:F.evt,target:this.getNode()}),this._nodes.forEach(V=>{V._fire("transformstart",{evt:F.evt,target:V})})}_handleMouseMove(F){let j,O,C;const A=this.findOne("."+this._movingAnchorName),k=A.getStage();k.setPointersPositions(F);const T=k.getPointerPosition();let V={x:T.x-this._anchorDragOffset.x,y:T.y-this._anchorDragOffset.y};const G=A.getAbsolutePosition();this.anchorDragBoundFunc()&&(V=this.anchorDragBoundFunc()(G,V,F)),A.setAbsolutePosition(V);const $=A.getAbsolutePosition();if(G.x===$.x&&G.y===$.y)return;if(this._movingAnchorName==="rotater"){const se=this._getNodeRect();j=A.x()-se.width/2,O=-A.y()+se.height/2;let ce=Math.atan2(-O,j)+Math.PI/2;se.height<0&&(ce-=Math.PI);const Oe=o.Konva.getAngle(this.rotation())+ce,Le=o.Konva.getAngle(this.rotationSnapTolerance()),Se=E(this.rotationSnaps(),Oe,Le)-se.rotation,ye=g(se,Se);this._fitNodesInto(ye,F);return}const te=this.shiftBehavior();let W;te==="inverted"?W=this.keepRatio()&&!F.shiftKey:te==="none"?W=this.keepRatio():W=this.keepRatio()||F.shiftKey;var Q=this.centeredScaling()||F.altKey;if(this._movingAnchorName==="top-left"){if(W){var U=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};C=Math.sqrt(Math.pow(U.x-A.x(),2)+Math.pow(U.y-A.y(),2));var z=this.findOne(".top-left").x()>U.x?-1:1,D=this.findOne(".top-left").y()>U.y?-1:1;j=C*this.cos*z,O=C*this.sin*D,this.findOne(".top-left").x(U.x-j),this.findOne(".top-left").y(U.y-O)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(A.y());else if(this._movingAnchorName==="top-right"){if(W){var U=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};C=Math.sqrt(Math.pow(A.x()-U.x,2)+Math.pow(U.y-A.y(),2));var z=this.findOne(".top-right").x()<U.x?-1:1,D=this.findOne(".top-right").y()>U.y?-1:1;j=C*this.cos*z,O=C*this.sin*D,this.findOne(".top-right").x(U.x+j),this.findOne(".top-right").y(U.y-O)}var Y=A.position();this.findOne(".top-left").y(Y.y),this.findOne(".bottom-right").x(Y.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(W){var U=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};C=Math.sqrt(Math.pow(U.x-A.x(),2)+Math.pow(A.y()-U.y,2));var z=U.x<A.x()?-1:1,D=A.y()<U.y?-1:1;j=C*this.cos*z,O=C*this.sin*D,A.x(U.x-j),A.y(U.y+O)}Y=A.position(),this.findOne(".top-left").x(Y.x),this.findOne(".bottom-right").y(Y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(A.y());else if(this._movingAnchorName==="bottom-right"){if(W){var U=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};C=Math.sqrt(Math.pow(A.x()-U.x,2)+Math.pow(A.y()-U.y,2));var z=this.findOne(".bottom-right").x()<U.x?-1:1,D=this.findOne(".bottom-right").y()<U.y?-1:1;j=C*this.cos*z,O=C*this.sin*D,this.findOne(".bottom-right").x(U.x+j),this.findOne(".bottom-right").y(U.y+O)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var Q=this.centeredScaling()||F.altKey;if(Q){const se=this.findOne(".top-left"),ce=this.findOne(".bottom-right"),de=se.x(),Oe=se.y(),Le=this.getWidth()-ce.x(),ke=this.getHeight()-ce.y();ce.move({x:-de,y:-Oe}),se.move({x:Le,y:ke})}const J=this.findOne(".top-left").getAbsolutePosition();j=J.x,O=J.y;const Z=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),ae=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:j,y:O,width:Z,height:ae,rotation:o.Konva.getAngle(this.rotation())},F)}_handleMouseUp(F){this._removeEvents(F)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(F){var j;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const O=this.getNode();b--,this._fire("transformend",{evt:F,target:O}),(j=this.getLayer())===null||j===void 0||j.batchDraw(),O&&this._nodes.forEach(C=>{var A;C._fire("transformend",{evt:F,target:C}),(A=C.getLayer())===null||A===void 0||A.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(F,j){const O=this._getNodeRect(),C=1;if(e.Util._inRange(F.width,-this.padding()*2-C,C)){this.update();return}if(e.Util._inRange(F.height,-this.padding()*2-C,C)){this.update();return}const A=new e.Transform;if(A.rotate(o.Konva.getAngle(this.rotation())),this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("left")>=0){const W=A.point({x:-this.padding()*2,y:0});F.x+=W.x,F.y+=W.y,F.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=W.x,this._anchorDragOffset.y-=W.y}else if(this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("right")>=0){const W=A.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=W.x,this._anchorDragOffset.y-=W.y,F.width+=this.padding()*2}if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("top")>=0){const W=A.point({x:0,y:-this.padding()*2});F.x+=W.x,F.y+=W.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=W.x,this._anchorDragOffset.y-=W.y,F.height+=this.padding()*2}else if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const W=A.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=W.x,this._anchorDragOffset.y-=W.y,F.height+=this.padding()*2}if(this.boundBoxFunc()){const W=this.boundBoxFunc()(O,F);W?F=W:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const k=1e7,T=new e.Transform;T.translate(O.x,O.y),T.rotate(O.rotation),T.scale(O.width/k,O.height/k);const V=new e.Transform,G=F.width/k,$=F.height/k;this.flipEnabled()===!1?(V.translate(F.x,F.y),V.rotate(F.rotation),V.translate(F.width<0?F.width:0,F.height<0?F.height:0),V.scale(Math.abs(G),Math.abs($))):(V.translate(F.x,F.y),V.rotate(F.rotation),V.scale(G,$));const te=V.multiply(T.invert());this._nodes.forEach(W=>{var U;const z=W.getParent().getAbsoluteTransform(),D=W.getTransform().copy();D.translate(W.offsetX(),W.offsetY());const Y=new e.Transform;Y.multiply(z.copy().invert()).multiply(te).multiply(z).multiply(D);const Q=Y.decompose();W.setAttrs(Q),(U=W.getLayer())===null||U===void 0||U.batchDraw()}),this.rotation(e.Util._getRotation(F.rotation)),this._nodes.forEach(W=>{this._fire("transform",{evt:j,target:W}),W._fire("transform",{evt:j,target:W})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(F,j){this.findOne(F).setAttrs(j)}update(){var F;const j=this._getNodeRect();this.rotation(e.Util._getRotation(j.rotation));const O=j.width,C=j.height,A=this.enabledAnchors(),k=this.resizeEnabled(),T=this.padding(),V=this.anchorSize(),G=this.find("._anchor");G.forEach(te=>{te.setAttrs({width:V,height:V,offsetX:V/2,offsetY:V/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:V/2+T,offsetY:V/2+T,visible:k&&A.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:O/2,y:0,offsetY:V/2+T,visible:k&&A.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:O,y:0,offsetX:V/2-T,offsetY:V/2+T,visible:k&&A.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:C/2,offsetX:V/2+T,visible:k&&A.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:O,y:C/2,offsetX:V/2-T,visible:k&&A.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:C,offsetX:V/2+T,offsetY:V/2-T,visible:k&&A.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:O/2,y:C,offsetY:V/2-T,visible:k&&A.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:O,y:C,offsetX:V/2-T,offsetY:V/2-T,visible:k&&A.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:O/2,y:-this.rotateAnchorOffset()*e.Util._sign(C)-T,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:O,height:C,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const $=this.anchorStyleFunc();$&&G.forEach(te=>{$(te)}),(F=this.getLayer())===null||F===void 0||F.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const F=this.findOne("."+this._movingAnchorName);F&&F.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),i.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(F){return t.Node.prototype.clone.call(this,F)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}md.Transformer=M,M.isTransforming=()=>b>0;function N(R){return R instanceof Array||e.Util.warn("enabledAnchors value should be an array"),R instanceof Array&&R.forEach(function(F){w.indexOf(F)===-1&&e.Util.warn("Unknown anchor name: "+F+". Available names are: "+w.join(", "))}),R||[]}return M.prototype.className="Transformer",(0,c._registerNode)(M),r.Factory.addGetterSetter(M,"enabledAnchors",w,N),r.Factory.addGetterSetter(M,"flipEnabled",!0,(0,s.getBooleanValidator)()),r.Factory.addGetterSetter(M,"resizeEnabled",!0),r.Factory.addGetterSetter(M,"anchorSize",10,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(M,"rotateEnabled",!0),r.Factory.addGetterSetter(M,"rotateLineVisible",!0),r.Factory.addGetterSetter(M,"rotationSnaps",[]),r.Factory.addGetterSetter(M,"rotateAnchorOffset",50,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(M,"rotateAnchorCursor","crosshair"),r.Factory.addGetterSetter(M,"rotationSnapTolerance",5,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(M,"borderEnabled",!0),r.Factory.addGetterSetter(M,"anchorStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(M,"anchorStrokeWidth",1,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(M,"anchorFill","white"),r.Factory.addGetterSetter(M,"anchorCornerRadius",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(M,"borderStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(M,"borderStrokeWidth",1,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(M,"borderDash"),r.Factory.addGetterSetter(M,"keepRatio",!0),r.Factory.addGetterSetter(M,"shiftBehavior","default"),r.Factory.addGetterSetter(M,"centeredScaling",!1),r.Factory.addGetterSetter(M,"ignoreStroke",!1),r.Factory.addGetterSetter(M,"padding",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(M,"nodes"),r.Factory.addGetterSetter(M,"node"),r.Factory.addGetterSetter(M,"boundBoxFunc"),r.Factory.addGetterSetter(M,"anchorDragBoundFunc"),r.Factory.addGetterSetter(M,"anchorStyleFunc"),r.Factory.addGetterSetter(M,"shouldOverdrawWholeArea",!1),r.Factory.addGetterSetter(M,"useSingleNodeRotation",!0),r.Factory.backCompat(M,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),md}var yd={},S5;function JS(){if(S5)return yd;S5=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.Wedge=void 0;const e=zr(),r=Ra(),t=Tr(),n=Gr(),a=Tr();class i extends r.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),s.lineTo(0,0),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return yd.Wedge=i,i.prototype.className="Wedge",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["radius"],(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"radius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"clockwise",!1),e.Factory.backCompat(i,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),yd}var bd={},x5;function ex(){if(x5)return bd;x5=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.Blur=void 0;const e=zr(),r=Ji(),t=Gr();function n(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const a=[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],i=[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 o(c,u){const d=c.data,p=c.width,y=c.height;let f,_,S,w,x,v,g,E,b,M,N,R,F,j,O,C,A,k,T,V,G,$,te,W;const U=u+u+1,z=p-1,D=y-1,Y=u+1,Q=Y*(Y+1)/2,J=new n,Z=a[u],ae=i[u];let se=null,ce=J,de=null,Oe=null;for(S=1;S<U;S++)ce=ce.next=new n,S===Y&&(se=ce);for(ce.next=J,g=v=0,_=0;_<y;_++){for(C=A=k=T=E=b=M=N=0,R=Y*(V=d[v]),F=Y*(G=d[v+1]),j=Y*($=d[v+2]),O=Y*(te=d[v+3]),E+=Q*V,b+=Q*G,M+=Q*$,N+=Q*te,ce=J,S=0;S<Y;S++)ce.r=V,ce.g=G,ce.b=$,ce.a=te,ce=ce.next;for(S=1;S<Y;S++)w=v+((z<S?z:S)<<2),E+=(ce.r=V=d[w])*(W=Y-S),b+=(ce.g=G=d[w+1])*W,M+=(ce.b=$=d[w+2])*W,N+=(ce.a=te=d[w+3])*W,C+=V,A+=G,k+=$,T+=te,ce=ce.next;for(de=J,Oe=se,f=0;f<p;f++)d[v+3]=te=N*Z>>ae,te!==0?(te=255/te,d[v]=(E*Z>>ae)*te,d[v+1]=(b*Z>>ae)*te,d[v+2]=(M*Z>>ae)*te):d[v]=d[v+1]=d[v+2]=0,E-=R,b-=F,M-=j,N-=O,R-=de.r,F-=de.g,j-=de.b,O-=de.a,w=g+((w=f+u+1)<z?w:z)<<2,C+=de.r=d[w],A+=de.g=d[w+1],k+=de.b=d[w+2],T+=de.a=d[w+3],E+=C,b+=A,M+=k,N+=T,de=de.next,R+=V=Oe.r,F+=G=Oe.g,j+=$=Oe.b,O+=te=Oe.a,C-=V,A-=G,k-=$,T-=te,Oe=Oe.next,v+=4;g+=p}for(f=0;f<p;f++){for(A=k=T=C=b=M=N=E=0,v=f<<2,R=Y*(V=d[v]),F=Y*(G=d[v+1]),j=Y*($=d[v+2]),O=Y*(te=d[v+3]),E+=Q*V,b+=Q*G,M+=Q*$,N+=Q*te,ce=J,S=0;S<Y;S++)ce.r=V,ce.g=G,ce.b=$,ce.a=te,ce=ce.next;for(x=p,S=1;S<=u;S++)v=x+f<<2,E+=(ce.r=V=d[v])*(W=Y-S),b+=(ce.g=G=d[v+1])*W,M+=(ce.b=$=d[v+2])*W,N+=(ce.a=te=d[v+3])*W,C+=V,A+=G,k+=$,T+=te,ce=ce.next,S<D&&(x+=p);for(v=f,de=J,Oe=se,_=0;_<y;_++)w=v<<2,d[w+3]=te=N*Z>>ae,te>0?(te=255/te,d[w]=(E*Z>>ae)*te,d[w+1]=(b*Z>>ae)*te,d[w+2]=(M*Z>>ae)*te):d[w]=d[w+1]=d[w+2]=0,E-=R,b-=F,M-=j,N-=O,R-=de.r,F-=de.g,j-=de.b,O-=de.a,w=f+((w=_+Y)<D?w:D)*p<<2,E+=C+=de.r=d[w],b+=A+=de.g=d[w+1],M+=k+=de.b=d[w+2],N+=T+=de.a=d[w+3],de=de.next,R+=V=Oe.r,F+=G=Oe.g,j+=$=Oe.b,O+=te=Oe.a,C-=V,A-=G,k-=$,T-=te,Oe=Oe.next,v+=p}}const s=function(u){const d=Math.round(this.blurRadius());d>0&&o(u,d)};return bd.Blur=s,e.Factory.addGetterSetter(r.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),bd}var wd={},E5;function tx(){if(E5)return wd;E5=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.Brighten=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=this.brightness()*255,o=a.data,s=o.length;for(let c=0;c<s;c+=4)o[c]+=i,o[c+1]+=i,o[c+2]+=i};return wd.Brighten=n,e.Factory.addGetterSetter(r.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),wd}var _d={},P5;function rx(){if(P5)return _d;P5=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.Contrast=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=Math.pow((this.contrast()+100)/100,2),o=a.data,s=o.length;let c=150,u=150,d=150;for(let p=0;p<s;p+=4)c=o[p],u=o[p+1],d=o[p+2],c/=255,c-=.5,c*=i,c+=.5,c*=255,u/=255,u-=.5,u*=i,u+=.5,u*=255,d/=255,d-=.5,d*=i,d+=.5,d*=255,c=c<0?0:c>255?255:c,u=u<0?0:u>255?255:u,d=d<0?0:d>255?255:d,o[p]=c,o[p+1]=u,o[p+2]=d};return _d.Contrast=n,e.Factory.addGetterSetter(r.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),_d}var Sd={},O5;function nx(){if(O5)return Sd;O5=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.Emboss=void 0;const e=zr(),r=Ji(),t=ki(),n=Gr(),a=function(i){const o=this.embossStrength()*10,s=this.embossWhiteLevel()*255,c=this.embossDirection(),u=this.embossBlend(),d=i.data,p=i.width,y=i.height,f=p*4;let _=0,S=0,w=y;switch(c){case"top-left":_=-1,S=-1;break;case"top":_=-1,S=0;break;case"top-right":_=-1,S=1;break;case"right":_=0,S=1;break;case"bottom-right":_=1,S=1;break;case"bottom":_=1,S=0;break;case"bottom-left":_=1,S=-1;break;case"left":_=0,S=-1;break;default:t.Util.error("Unknown emboss direction: "+c)}do{const x=(w-1)*f;let v=_;w+v<1&&(v=0),w+v>y&&(v=0);const g=(w-1+v)*p*4;let E=p;do{const b=x+(E-1)*4;let M=S;E+M<1&&(M=0),E+M>p&&(M=0);const N=g+(E-1+M)*4,R=d[b]-d[N],F=d[b+1]-d[N+1],j=d[b+2]-d[N+2];let O=R;const C=O>0?O:-O,A=F>0?F:-F,k=j>0?j:-j;if(A>C&&(O=F),k>C&&(O=j),O*=o,u){const T=d[b]+O,V=d[b+1]+O,G=d[b+2]+O;d[b]=T>255?255:T<0?0:T,d[b+1]=V>255?255:V<0?0:V,d[b+2]=G>255?255:G<0?0:G}else{let T=s-O;T<0?T=0:T>255&&(T=255),d[b]=d[b+1]=d[b+2]=T}}while(--E)}while(--w)};return Sd.Emboss=a,e.Factory.addGetterSetter(r.Node,"embossStrength",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossWhiteLevel",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),Sd}var xd={},A5;function ix(){if(A5)return xd;A5=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.Enhance=void 0;const e=zr(),r=Ji(),t=Gr();function n(i,o,s,c,u){const d=s-o,p=u-c;if(d===0)return c+p/2;if(p===0)return c;let y=(i-o)/d;return y=p*y+c,y}const a=function(i){const o=i.data,s=o.length;let c=o[0],u=c,d,p=o[1],y=p,f,_=o[2],S=_,w;const x=this.enhance();if(x===0)return;for(let O=0;O<s;O+=4)d=o[O+0],d<c?c=d:d>u&&(u=d),f=o[O+1],f<p?p=f:f>y&&(y=f),w=o[O+2],w<_?_=w:w>S&&(S=w);u===c&&(u=255,c=0),y===p&&(y=255,p=0),S===_&&(S=255,_=0);let v,g,E,b,M,N,R,F,j;x>0?(g=u+x*(255-u),E=c-x*(c-0),M=y+x*(255-y),N=p-x*(p-0),F=S+x*(255-S),j=_-x*(_-0)):(v=(u+c)*.5,g=u+x*(u-v),E=c+x*(c-v),b=(y+p)*.5,M=y+x*(y-b),N=p+x*(p-b),R=(S+_)*.5,F=S+x*(S-R),j=_+x*(_-R));for(let O=0;O<s;O+=4)o[O+0]=n(o[O+0],c,u,E,g),o[O+1]=n(o[O+1],p,y,N,M),o[O+2]=n(o[O+2],_,S,j,F)};return xd.Enhance=a,e.Factory.addGetterSetter(r.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),xd}var Ed={},C5;function ax(){if(C5)return Ed;C5=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.Grayscale=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4){const i=.34*t[a]+.5*t[a+1]+.16*t[a+2];t[a]=i,t[a+1]=i,t[a+2]=i}};return Ed.Grayscale=e,Ed}var Pd={},k5;function ox(){if(k5)return Pd;k5=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.HSL=void 0;const e=zr(),r=Ji(),t=Gr();e.Factory.addGetterSetter(r.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const n=function(a){const i=a.data,o=i.length,s=1,c=Math.pow(2,this.saturation()),u=Math.abs(this.hue()+360)%360,d=this.luminance()*127,p=s*c*Math.cos(u*Math.PI/180),y=s*c*Math.sin(u*Math.PI/180),f=.299*s+.701*p+.167*y,_=.587*s-.587*p+.33*y,S=.114*s-.114*p-.497*y,w=.299*s-.299*p-.328*y,x=.587*s+.413*p+.035*y,v=.114*s-.114*p+.293*y,g=.299*s-.3*p+1.25*y,E=.587*s-.586*p-1.05*y,b=.114*s+.886*p-.2*y;let M,N,R,F;for(let j=0;j<o;j+=4)M=i[j+0],N=i[j+1],R=i[j+2],F=i[j+3],i[j+0]=f*M+_*N+S*R+d,i[j+1]=w*M+x*N+v*R+d,i[j+2]=g*M+E*N+b*R+d,i[j+3]=F};return Pd.HSL=n,Pd}var Od={},L5;function sx(){if(L5)return Od;L5=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.HSV=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=a.data,o=i.length,s=Math.pow(2,this.value()),c=Math.pow(2,this.saturation()),u=Math.abs(this.hue()+360)%360,d=s*c*Math.cos(u*Math.PI/180),p=s*c*Math.sin(u*Math.PI/180),y=.299*s+.701*d+.167*p,f=.587*s-.587*d+.33*p,_=.114*s-.114*d-.497*p,S=.299*s-.299*d-.328*p,w=.587*s+.413*d+.035*p,x=.114*s-.114*d+.293*p,v=.299*s-.3*d+1.25*p,g=.587*s-.586*d-1.05*p,E=.114*s+.886*d-.2*p;let b,M,N,R;for(let F=0;F<o;F+=4)b=i[F+0],M=i[F+1],N=i[F+2],R=i[F+3],i[F+0]=y*b+f*M+_*N,i[F+1]=S*b+w*M+x*N,i[F+2]=v*b+g*M+E*N,i[F+3]=R};return Od.HSV=n,e.Factory.addGetterSetter(r.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Od}var Ad={},N5;function lx(){if(N5)return Ad;N5=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.Invert=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4)t[a]=255-t[a],t[a+1]=255-t[a+1],t[a+2]=255-t[a+2]};return Ad.Invert=e,Ad}var Cd={},T5;function ux(){if(T5)return Cd;T5=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.Kaleidoscope=void 0;const e=zr(),r=Ji(),t=ki(),n=Gr(),a=function(s,c,u){const d=s.data,p=c.data,y=s.width,f=s.height,_=u.polarCenterX||y/2,S=u.polarCenterY||f/2;let w=Math.sqrt(_*_+S*S),x=y-_,v=f-S;const g=Math.sqrt(x*x+v*v);w=g>w?g:w;const E=f,b=y,M=360/b*Math.PI/180;for(let N=0;N<b;N+=1){const R=Math.sin(N*M),F=Math.cos(N*M);for(let j=0;j<E;j+=1){x=Math.floor(_+w*j/E*F),v=Math.floor(S+w*j/E*R);let O=(v*y+x)*4;const C=d[O+0],A=d[O+1],k=d[O+2],T=d[O+3];O=(N+j*y)*4,p[O+0]=C,p[O+1]=A,p[O+2]=k,p[O+3]=T}}},i=function(s,c,u){const d=s.data,p=c.data,y=s.width,f=s.height,_=u.polarCenterX||y/2,S=u.polarCenterY||f/2;let w=Math.sqrt(_*_+S*S),x=y-_,v=f-S;const g=Math.sqrt(x*x+v*v);w=g>w?g:w;const E=f,b=y,M=0;let N,R;for(x=0;x<y;x+=1)for(v=0;v<f;v+=1){const F=x-_,j=v-S,O=Math.sqrt(F*F+j*j)*E/w;let C=(Math.atan2(j,F)*180/Math.PI+360+M)%360;C=C*b/360,N=Math.floor(C),R=Math.floor(O);let A=(R*y+N)*4;const k=d[A+0],T=d[A+1],V=d[A+2],G=d[A+3];A=(v*y+x)*4,p[A+0]=k,p[A+1]=T,p[A+2]=V,p[A+3]=G}},o=function(s){const c=s.width,u=s.height;let d,p,y,f,_,S,w,x,v,g,E=Math.round(this.kaleidoscopePower());const b=Math.round(this.kaleidoscopeAngle()),M=Math.floor(c*(b%360)/360);if(E<1)return;const N=t.Util.createCanvasElement();N.width=c,N.height=u;const R=N.getContext("2d").getImageData(0,0,c,u);t.Util.releaseCanvas(N),a(s,R,{polarCenterX:c/2,polarCenterY:u/2});let F=c/Math.pow(2,E);for(;F<=8;)F=F*2,E-=1;F=Math.ceil(F);let j=F,O=0,C=j,A=1;for(M+F>c&&(O=j,C=0,A=-1),p=0;p<u;p+=1)for(d=O;d!==C;d+=A)y=Math.round(d+M)%c,v=(c*p+y)*4,_=R.data[v+0],S=R.data[v+1],w=R.data[v+2],x=R.data[v+3],g=(c*p+d)*4,R.data[g+0]=_,R.data[g+1]=S,R.data[g+2]=w,R.data[g+3]=x;for(p=0;p<u;p+=1)for(j=Math.floor(F),f=0;f<E;f+=1){for(d=0;d<j+1;d+=1)v=(c*p+d)*4,_=R.data[v+0],S=R.data[v+1],w=R.data[v+2],x=R.data[v+3],g=(c*p+j*2-d-1)*4,R.data[g+0]=_,R.data[g+1]=S,R.data[g+2]=w,R.data[g+3]=x;j*=2}i(R,s,{})};return Cd.Kaleidoscope=o,e.Factory.addGetterSetter(r.Node,"kaleidoscopePower",2,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"kaleidoscopeAngle",0,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Cd}var kd={},R5;function cx(){if(R5)return kd;R5=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.Mask=void 0;const e=zr(),r=Ji(),t=Gr();function n(y,f,_){let S=(_*y.width+f)*4;const w=[];return w.push(y.data[S++],y.data[S++],y.data[S++],y.data[S++]),w}function a(y,f){return Math.sqrt(Math.pow(y[0]-f[0],2)+Math.pow(y[1]-f[1],2)+Math.pow(y[2]-f[2],2))}function i(y){const f=[0,0,0];for(let _=0;_<y.length;_++)f[0]+=y[_][0],f[1]+=y[_][1],f[2]+=y[_][2];return f[0]/=y.length,f[1]/=y.length,f[2]/=y.length,f}function o(y,f){const _=n(y,0,0),S=n(y,y.width-1,0),w=n(y,0,y.height-1),x=n(y,y.width-1,y.height-1),v=f||10;if(a(_,S)<v&&a(S,x)<v&&a(x,w)<v&&a(w,_)<v){const g=i([S,_,x,w]),E=[];for(let b=0;b<y.width*y.height;b++){const M=a(g,[y.data[b*4],y.data[b*4+1],y.data[b*4+2]]);E[b]=M<v?0:255}return E}}function s(y,f){for(let _=0;_<y.width*y.height;_++)y.data[4*_+3]=f[_]}function c(y,f,_){const S=[1,1,1,1,0,1,1,1,1],w=Math.round(Math.sqrt(S.length)),x=Math.floor(w/2),v=[];for(let g=0;g<_;g++)for(let E=0;E<f;E++){const b=g*f+E;let M=0;for(let N=0;N<w;N++)for(let R=0;R<w;R++){const F=g+N-x,j=E+R-x;if(F>=0&&F<_&&j>=0&&j<f){const O=F*f+j,C=S[N*w+R];M+=y[O]*C}}v[b]=M===255*8?255:0}return v}function u(y,f,_){const S=[1,1,1,1,1,1,1,1,1],w=Math.round(Math.sqrt(S.length)),x=Math.floor(w/2),v=[];for(let g=0;g<_;g++)for(let E=0;E<f;E++){const b=g*f+E;let M=0;for(let N=0;N<w;N++)for(let R=0;R<w;R++){const F=g+N-x,j=E+R-x;if(F>=0&&F<_&&j>=0&&j<f){const O=F*f+j,C=S[N*w+R];M+=y[O]*C}}v[b]=M>=255*4?255:0}return v}function d(y,f,_){const S=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],w=Math.round(Math.sqrt(S.length)),x=Math.floor(w/2),v=[];for(let g=0;g<_;g++)for(let E=0;E<f;E++){const b=g*f+E;let M=0;for(let N=0;N<w;N++)for(let R=0;R<w;R++){const F=g+N-x,j=E+R-x;if(F>=0&&F<_&&j>=0&&j<f){const O=F*f+j,C=S[N*w+R];M+=y[O]*C}}v[b]=M}return v}const p=function(y){const f=this.threshold();let _=o(y,f);return _&&(_=c(_,y.width,y.height),_=u(_,y.width,y.height),_=d(_,y.width,y.height),s(y,_)),y};return kd.Mask=p,e.Factory.addGetterSetter(r.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),kd}var Ld={},M5;function fx(){if(M5)return Ld;M5=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.Noise=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=this.noise()*255,o=a.data,s=o.length,c=i/2;for(let u=0;u<s;u+=4)o[u+0]+=c-2*c*Math.random(),o[u+1]+=c-2*c*Math.random(),o[u+2]+=c-2*c*Math.random()};return Ld.Noise=n,e.Factory.addGetterSetter(r.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Ld}var Nd={},I5;function hx(){if(I5)return Nd;I5=1,Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Pixelate=void 0;const e=zr(),r=ki(),t=Ji(),n=Gr(),a=function(i){let o=Math.ceil(this.pixelSize()),s=i.width,c=i.height,u,d,p,y,f,_,S,w=Math.ceil(s/o),x=Math.ceil(c/o),v,g,E,b,M,N,R,F=i.data;if(o<=0){r.Util.error("pixelSize value can not be <= 0");return}for(M=0;M<w;M+=1)for(N=0;N<x;N+=1){for(y=0,f=0,_=0,S=0,v=M*o,g=v+o,E=N*o,b=E+o,R=0,u=v;u<g;u+=1)if(!(u>=s))for(d=E;d<b;d+=1)d>=c||(p=(s*d+u)*4,y+=F[p+0],f+=F[p+1],_+=F[p+2],S+=F[p+3],R+=1);for(y=y/R,f=f/R,_=_/R,S=S/R,u=v;u<g;u+=1)if(!(u>=s))for(d=E;d<b;d+=1)d>=c||(p=(s*d+u)*4,F[p+0]=y,F[p+1]=f,F[p+2]=_,F[p+3]=S)}};return Nd.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Nd}var Td={},j5;function dx(){if(j5)return Td;j5=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.Posterize=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=Math.round(this.levels()*254)+1,o=a.data,s=o.length,c=255/i;for(let u=0;u<s;u+=1)o[u]=Math.floor(o[u]/c)*c};return Td.Posterize=n,e.Factory.addGetterSetter(r.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Td}var Rd={},F5;function px(){if(F5)return Rd;F5=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.RGB=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=a.data,o=i.length,s=this.red(),c=this.green(),u=this.blue();for(let d=0;d<o;d+=4){const p=(.34*i[d]+.5*i[d+1]+.16*i[d+2])/255;i[d]=p*s,i[d+1]=p*c,i[d+2]=p*u,i[d+3]=i[d+3]}};return Rd.RGB=n,e.Factory.addGetterSetter(r.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),Rd}var Md={},D5;function gx(){if(D5)return Md;D5=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.RGBA=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=a.data,o=i.length,s=this.red(),c=this.green(),u=this.blue(),d=this.alpha();for(let p=0;p<o;p+=4){const y=1-d;i[p]=s*d+i[p]*y,i[p+1]=c*d+i[p+1]*y,i[p+2]=u*d+i[p+2]*y}};return Md.RGBA=n,e.Factory.addGetterSetter(r.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"alpha",1,function(a){return this._filterUpToDate=!1,a>1?1:a<0?0:a}),Md}var Id={},B5;function vx(){if(B5)return Id;B5=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.Sepia=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4){const i=t[a+0],o=t[a+1],s=t[a+2];t[a+0]=Math.min(255,i*.393+o*.769+s*.189),t[a+1]=Math.min(255,i*.349+o*.686+s*.168),t[a+2]=Math.min(255,i*.272+o*.534+s*.131)}};return Id.Sepia=e,Id}var jd={},q5;function mx(){if(q5)return jd;q5=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.Solarize=void 0;const e=function(r){const t=r.data,n=r.width,a=r.height,i=n*4;let o=a;do{const s=(o-1)*i;let c=n;do{const u=s+(c-1)*4;let d=t[u],p=t[u+1],y=t[u+2];d>127&&(d=255-d),p>127&&(p=255-p),y>127&&(y=255-y),t[u]=d,t[u+1]=p,t[u+2]=y}while(--c)}while(--o)};return jd.Solarize=e,jd}var Fd={},z5;function yx(){if(z5)return Fd;z5=1,Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.Threshold=void 0;const e=zr(),r=Ji(),t=Gr(),n=function(a){const i=this.threshold()*255,o=a.data,s=o.length;for(let c=0;c<s;c+=1)o[c]=o[c]<i?0:255};return Fd.Threshold=n,e.Factory.addGetterSetter(r.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Fd}var U5;function bx(){if(U5)return Zh;U5=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.Konva=void 0;const e=x2(),r=qS(),t=US(),n=HS(),a=VS(),i=GS(),o=WS(),s=O6(),c=cm(),u=A6(),d=$S(),p=YS(),y=XS(),f=KS(),_=C6(),S=ZS(),w=QS(),x=JS(),v=ex(),g=tx(),E=rx(),b=nx(),M=ix(),N=ax(),R=ox(),F=sx(),j=lx(),O=ux(),C=cx(),A=fx(),k=hx(),T=dx(),V=px(),G=gx(),$=vx(),te=mx(),W=yx();return Zh.Konva=e.Konva.Util._assign(e.Konva,{Arc:r.Arc,Arrow:t.Arrow,Circle:n.Circle,Ellipse:a.Ellipse,Image:i.Image,Label:o.Label,Tag:o.Tag,Line:s.Line,Path:c.Path,Rect:u.Rect,RegularPolygon:d.RegularPolygon,Ring:p.Ring,Sprite:y.Sprite,Star:f.Star,Text:_.Text,TextPath:S.TextPath,Transformer:w.Transformer,Wedge:x.Wedge,Filters:{Blur:v.Blur,Brighten:g.Brighten,Contrast:E.Contrast,Emboss:b.Emboss,Enhance:M.Enhance,Grayscale:N.Grayscale,HSL:R.HSL,HSV:F.HSV,Invert:j.Invert,Kaleidoscope:O.Kaleidoscope,Mask:C.Mask,Noise:A.Noise,Pixelate:k.Pixelate,Posterize:T.Posterize,RGB:V.RGB,RGBA:G.RGBA,Sepia:$.Sepia,Solarize:te.Solarize,Threshold:W.Threshold}}),Zh}var wx=m1.exports,H5;function Hs(){if(H5)return m1.exports;H5=1,Object.defineProperty(wx,"__esModule",{value:!0});const e=bx();return m1.exports=e.Konva,m1.exports}Hs();var s1={exports:{}},V5;function _x(){return V5||(V5=1,function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Konva=void 0;var t=x2();Object.defineProperty(r,"Konva",{enumerable:!0,get:function(){return t.Konva}});const n=x2();e.exports=n.Konva}(s1,s1.exports)),s1.exports}var Sx=_x();const dp=yp(Sx);var og={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 sg,G5;function xx(){return G5||(G5=1,sg=function(r){var t={},n=ni(),a=B2(),i=Object.assign;function o(m){for(var P="https://reactjs.org/docs/error-decoder.html?invariant="+m,B=1;B<arguments.length;B++)P+="&args[]="+encodeURIComponent(arguments[B]);return"Minified React error #"+m+"; visit "+P+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=Symbol.for("react.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),_=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),b=Symbol.iterator;function M(m){return m===null||typeof m!="object"?null:(m=b&&m[b]||m["@@iterator"],typeof m=="function"?m:null)}function N(m){if(m==null)return null;if(typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case d:return"Fragment";case u:return"Portal";case y:return"Profiler";case p:return"StrictMode";case w:return"Suspense";case x:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case _:return(m.displayName||"Context")+".Consumer";case f:return(m._context.displayName||"Context")+".Provider";case S:var P=m.render;return m=m.displayName,m||(m=P.displayName||P.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case v:return P=m.displayName||null,P!==null?P:N(m.type)||"Memo";case g:P=m._payload,m=m._init;try{return N(m(P))}catch{}}return null}function R(m){var P=m.type;switch(m.tag){case 24:return"Cache";case 9:return(P.displayName||"Context")+".Consumer";case 10:return(P._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return m=P.render,m=m.displayName||m.name||"",P.displayName||(m!==""?"ForwardRef("+m+")":"ForwardRef");case 7:return"Fragment";case 5:return P;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return N(P);case 8:return P===p?"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 P=="function")return P.displayName||P.name||null;if(typeof P=="string")return P}return null}function F(m){var P=m,B=m;if(m.alternate)for(;P.return;)P=P.return;else{m=P;do P=m,(P.flags&4098)!==0&&(B=P.return),m=P.return;while(m)}return P.tag===3?B:null}function j(m){if(F(m)!==m)throw Error(o(188))}function O(m){var P=m.alternate;if(!P){if(P=F(m),P===null)throw Error(o(188));return P!==m?null:m}for(var B=m,K=P;;){var ne=B.return;if(ne===null)break;var le=ne.alternate;if(le===null){if(K=ne.return,K!==null){B=K;continue}break}if(ne.child===le.child){for(le=ne.child;le;){if(le===B)return j(ne),m;if(le===K)return j(ne),P;le=le.sibling}throw Error(o(188))}if(B.return!==K.return)B=ne,K=le;else{for(var xe=!1,Ye=ne.child;Ye;){if(Ye===B){xe=!0,B=ne,K=le;break}if(Ye===K){xe=!0,K=ne,B=le;break}Ye=Ye.sibling}if(!xe){for(Ye=le.child;Ye;){if(Ye===B){xe=!0,B=le,K=ne;break}if(Ye===K){xe=!0,K=le,B=ne;break}Ye=Ye.sibling}if(!xe)throw Error(o(189))}}if(B.alternate!==K)throw Error(o(190))}if(B.tag!==3)throw Error(o(188));return B.stateNode.current===B?m:P}function C(m){return m=O(m),m!==null?A(m):null}function A(m){if(m.tag===5||m.tag===6)return m;for(m=m.child;m!==null;){var P=A(m);if(P!==null)return P;m=m.sibling}return null}function k(m){if(m.tag===5||m.tag===6)return m;for(m=m.child;m!==null;){if(m.tag!==4){var P=k(m);if(P!==null)return P}m=m.sibling}return null}var T=Array.isArray,V=r.getPublicInstance,G=r.getRootHostContext,$=r.getChildHostContext,te=r.prepareForCommit,W=r.resetAfterCommit,U=r.createInstance,z=r.appendInitialChild,D=r.finalizeInitialChildren,Y=r.prepareUpdate,Q=r.shouldSetTextContent,J=r.createTextInstance,Z=r.scheduleTimeout,ae=r.cancelTimeout,se=r.noTimeout,ce=r.isPrimaryRenderer,de=r.supportsMutation,Oe=r.supportsPersistence,Le=r.supportsHydration,ke=r.getInstanceFromNode,Se=r.preparePortalMount,ye=r.getCurrentEventPriority,Je=r.detachDeletedInstance,we=r.supportsMicrotasks,me=r.scheduleMicrotask,Ee=r.supportsTestSelectors,Te=r.findFiberRoot,he=r.getBoundingRect,Re=r.getTextContent,Ie=r.isHiddenSubtree,Xe=r.matchAccessibilityRole,rt=r.setFocusIfFocusable,vt=r.setupIntersectionObserver,et=r.appendChild,yt=r.appendChildToContainer,mt=r.commitTextUpdate,ct=r.commitMount,Bt=r.commitUpdate,Pt=r.insertBefore,Yt=r.insertInContainerBefore,Gt=r.removeChild,Be=r.removeChildFromContainer,Ce=r.resetTextContent,ft=r.hideInstance,Ct=r.hideTextInstance,Ot=r.unhideInstance,Nt=r.unhideTextInstance,Jt=r.clearContainer,Xt=r.cloneInstance,kt=r.createContainerChildSet,nt=r.appendChildToContainerChildSet,We=r.finalizeContainerChildren,it=r.replaceContainerChildren,He=r.cloneHiddenInstance,wt=r.cloneHiddenTextInstance,ze=r.canHydrateInstance,_t=r.canHydrateTextInstance,Ht=r.canHydrateSuspenseInstance,Dt=r.isSuspenseInstancePending,Vt=r.isSuspenseInstanceFallback,er=r.getSuspenseInstanceFallbackErrorDetails,_r=r.registerSuspenseInstanceRetry,kr=r.getNextHydratableSibling,Ur=r.getFirstHydratableChild,on=r.getFirstHydratableChildWithinContainer,Wn=r.getFirstHydratableChildWithinSuspenseInstance,sn=r.hydrateInstance,Li=r.hydrateTextInstance,wi=r.hydrateSuspenseInstance,Ni=r.getNextHydratableInstanceAfterSuspenseInstance,_i=r.commitHydratedContainer,ao=r.commitHydratedSuspenseInstance,_s=r.clearSuspenseBoundary,Go=r.clearSuspenseBoundaryFromContainer,tu=r.shouldDeleteUnhydratedTailInstances,mc=r.didNotMatchHydratedContainerTextInstance,Mn=r.didNotMatchHydratedTextInstance,Bu;function oo(m){if(Bu===void 0)try{throw Error()}catch(B){var P=B.stack.trim().match(/\n( *(at )?)/);Bu=P&&P[1]||""}return`
|
|
52
|
+
`+Bu+m}var dl=!1;function Vs(m,P){if(!m||dl)return"";dl=!0;var B=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(P)if(P=function(){throw Error()},Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(Lt){var K=Lt}Reflect.construct(m,[],P)}else{try{P.call()}catch(Lt){K=Lt}m.call(P.prototype)}else{try{throw Error()}catch(Lt){K=Lt}m()}}catch(Lt){if(Lt&&K&&typeof Lt.stack=="string"){for(var ne=Lt.stack.split(`
|
|
53
|
+
`),le=K.stack.split(`
|
|
54
|
+
`),xe=ne.length-1,Ye=le.length-1;1<=xe&&0<=Ye&&ne[xe]!==le[Ye];)Ye--;for(;1<=xe&&0<=Ye;xe--,Ye--)if(ne[xe]!==le[Ye]){if(xe!==1||Ye!==1)do if(xe--,Ye--,0>Ye||ne[xe]!==le[Ye]){var ut=`
|
|
55
|
+
`+ne[xe].replace(" at new "," at ");return m.displayName&&ut.includes("<anonymous>")&&(ut=ut.replace("<anonymous>",m.displayName)),ut}while(1<=xe&&0<=Ye);break}}}finally{dl=!1,Error.prepareStackTrace=B}return(m=m?m.displayName||m.name:"")?oo(m):""}var qu=Object.prototype.hasOwnProperty,ru=[],so=-1;function di(m){return{current:m}}function Xr(m){0>so||(m.current=ru[so],ru[so]=null,so--)}function Ar(m,P){so++,ru[so]=m.current,m.current=P}var ln={},pi=di(ln),Ti=di(!1),Ma=ln;function Ia(m,P){var B=m.type.contextTypes;if(!B)return ln;var K=m.stateNode;if(K&&K.__reactInternalMemoizedUnmaskedChildContext===P)return K.__reactInternalMemoizedMaskedChildContext;var ne={},le;for(le in B)ne[le]=P[le];return K&&(m=m.stateNode,m.__reactInternalMemoizedUnmaskedChildContext=P,m.__reactInternalMemoizedMaskedChildContext=ne),ne}function ii(m){return m=m.childContextTypes,m!=null}function Ri(){Xr(Ti),Xr(pi)}function pl(m,P,B){if(pi.current!==ln)throw Error(o(168));Ar(pi,P),Ar(Ti,B)}function fa(m,P,B){var K=m.stateNode;if(P=P.childContextTypes,typeof K.getChildContext!="function")return B;K=K.getChildContext();for(var ne in K)if(!(ne in P))throw Error(o(108,R(m)||"Unknown",ne));return i({},B,K)}function Wo(m){return m=(m=m.stateNode)&&m.__reactInternalMemoizedMergedChildContext||ln,Ma=pi.current,Ar(pi,m),Ar(Ti,Ti.current),!0}function nu(m,P,B){var K=m.stateNode;if(!K)throw Error(o(169));B?(m=fa(m,P,Ma),K.__reactInternalMemoizedMergedChildContext=m,Xr(Ti),Xr(pi),Ar(pi,m)):Xr(Ti),Ar(Ti,B)}var ha=Math.clz32?Math.clz32:iu,Gs=Math.log,af=Math.LN2;function iu(m){return m>>>=0,m===0?32:31-(Gs(m)/af|0)|0}var Rr=64,Ss=4194304;function Ws(m){switch(m&-m){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 m&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return m&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return m}}function $s(m,P){var B=m.pendingLanes;if(B===0)return 0;var K=0,ne=m.suspendedLanes,le=m.pingedLanes,xe=B&268435455;if(xe!==0){var Ye=xe&~ne;Ye!==0?K=Ws(Ye):(le&=xe,le!==0&&(K=Ws(le)))}else xe=B&~ne,xe!==0?K=Ws(xe):le!==0&&(K=Ws(le));if(K===0)return 0;if(P!==0&&P!==K&&(P&ne)===0&&(ne=K&-K,le=P&-P,ne>=le||ne===16&&(le&4194240)!==0))return P;if((K&4)!==0&&(K|=B&16),P=m.entangledLanes,P!==0)for(m=m.entanglements,P&=K;0<P;)B=31-ha(P),ne=1<<B,K|=m[B],P&=~ne;return K}function yc(m,P){switch(m){case 1:case 2:case 4:return P+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 P+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 $o(m,P){for(var B=m.suspendedLanes,K=m.pingedLanes,ne=m.expirationTimes,le=m.pendingLanes;0<le;){var xe=31-ha(le),Ye=1<<xe,ut=ne[xe];ut===-1?((Ye&B)===0||(Ye&K)!==0)&&(ne[xe]=yc(Ye,P)):ut<=P&&(m.expiredLanes|=Ye),le&=~Ye}}function xs(m){return m=m.pendingLanes&-1073741825,m!==0?m:m&1073741824?1073741824:0}function Es(){var m=Rr;return Rr<<=1,(Rr&4194240)===0&&(Rr=64),m}function Ps(m){for(var P=[],B=0;31>B;B++)P.push(m);return P}function gn(m,P,B){m.pendingLanes|=P,P!==536870912&&(m.suspendedLanes=0,m.pingedLanes=0),m=m.eventTimes,P=31-ha(P),m[P]=B}function Yo(m,P){var B=m.pendingLanes&~P;m.pendingLanes=P,m.suspendedLanes=0,m.pingedLanes=0,m.expiredLanes&=P,m.mutableReadLanes&=P,m.entangledLanes&=P,P=m.entanglements;var K=m.eventTimes;for(m=m.expirationTimes;0<B;){var ne=31-ha(B),le=1<<ne;P[ne]=0,K[ne]=-1,m[ne]=-1,B&=~le}}function ja(m,P){var B=m.entangledLanes|=P;for(m=m.entanglements;B;){var K=31-ha(B),ne=1<<K;ne&P|m[K]&P&&(m[K]|=P),B&=~ne}}var It=0;function Ys(m){return m&=-m,1<m?4<m?(m&268435455)!==0?16:536870912:4:1}var lo=a.unstable_scheduleCallback,Oo=a.unstable_cancelCallback,zu=a.unstable_shouldYield,Xs=a.unstable_requestPaint,In=a.unstable_now,Ks=a.unstable_ImmediatePriority,au=a.unstable_UserBlockingPriority,ou=a.unstable_NormalPriority,of=a.unstable_IdlePriority,uo=null,ai=null;function Fa(m){if(ai&&typeof ai.onCommitFiberRoot=="function")try{ai.onCommitFiberRoot(uo,m,void 0,(m.current.flags&128)===128)}catch{}}function su(m,P){return m===P&&(m!==0||1/m===1/P)||m!==m&&P!==P}var Mi=typeof Object.is=="function"?Object.is:su,Da=null,Ao=!1,Os=!1;function gl(m){Da===null?Da=[m]:Da.push(m)}function Uu(m){Ao=!0,gl(m)}function oi(){if(!Os&&Da!==null){Os=!0;var m=0,P=It;try{var B=Da;for(It=1;m<B.length;m++){var K=B[m];do K=K(!0);while(K!==null)}Da=null,Ao=!1}catch(ne){throw Da!==null&&(Da=Da.slice(m+1)),lo(Ks,oi),ne}finally{It=P,Os=!1}}return null}var Ii=[],ji=0,vl=null,Sa=0,wn=[],Fi=0,_n=null,ea=1,ta="";function Ba(m,P){Ii[ji++]=Sa,Ii[ji++]=vl,vl=m,Sa=P}function lu(m,P,B){wn[Fi++]=ea,wn[Fi++]=ta,wn[Fi++]=_n,_n=m;var K=ea;m=ta;var ne=32-ha(K)-1;K&=~(1<<ne),B+=1;var le=32-ha(P)+ne;if(30<le){var xe=ne-ne%5;le=(K&(1<<xe)-1).toString(32),K>>=xe,ne-=xe,ea=1<<32-ha(P)+ne|B<<ne|K,ta=le+m}else ea=1<<le|B<<ne|K,ta=m}function As(m){m.return!==null&&(Ba(m,1),lu(m,1,0))}function Zs(m){for(;m===vl;)vl=Ii[--ji],Ii[ji]=null,Sa=Ii[--ji],Ii[ji]=null;for(;m===_n;)_n=wn[--Fi],wn[Fi]=null,ta=wn[--Fi],wn[Fi]=null,ea=wn[--Fi],wn[Fi]=null}var $n=null,gi=null,Jr=!1,Qs=!1,qa=null;function ml(m,P){var B=Uo(5,null,null,0);B.elementType="DELETED",B.stateNode=P,B.return=m,P=m.deletions,P===null?(m.deletions=[B],m.flags|=16):P.push(B)}function Xo(m,P){switch(m.tag){case 5:return P=ze(P,m.type,m.pendingProps),P!==null?(m.stateNode=P,$n=m,gi=Ur(P),!0):!1;case 6:return P=_t(P,m.pendingProps),P!==null?(m.stateNode=P,$n=m,gi=null,!0):!1;case 13:if(P=Ht(P),P!==null){var B=_n!==null?{id:ea,overflow:ta}:null;return m.memoizedState={dehydrated:P,treeContext:B,retryLane:1073741824},B=Uo(18,null,null,0),B.stateNode=P,B.return=m,m.child=B,$n=m,gi=null,!0}return!1;default:return!1}}function yl(m){return(m.mode&1)!==0&&(m.flags&128)===0}function Ko(m){if(Jr){var P=gi;if(P){var B=P;if(!Xo(m,P)){if(yl(m))throw Error(o(418));P=kr(B);var K=$n;P&&Xo(m,P)?ml(K,B):(m.flags=m.flags&-4097|2,Jr=!1,$n=m)}}else{if(yl(m))throw Error(o(418));m.flags=m.flags&-4097|2,Jr=!1,$n=m}}}function uu(m){for(m=m.return;m!==null&&m.tag!==5&&m.tag!==3&&m.tag!==13;)m=m.return;$n=m}function X(m){if(!Le||m!==$n)return!1;if(!Jr)return uu(m),Jr=!0,!1;if(m.tag!==3&&(m.tag!==5||tu(m.type)&&!Q(m.type,m.memoizedProps))){var P=gi;if(P){if(yl(m))throw fe(),Error(o(418));for(;P;)ml(m,P),P=kr(P)}}if(uu(m),m.tag===13){if(!Le)throw Error(o(316));if(m=m.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(o(317));gi=Ni(m)}else gi=$n?kr(m.stateNode):null;return!0}function fe(){for(var m=gi;m;)m=kr(m)}function Ae(){Le&&(gi=$n=null,Qs=Jr=!1)}function je(m){qa===null?qa=[m]:qa.push(m)}var Qe=s.ReactCurrentBatchConfig;function dt(m,P){if(Mi(m,P))return!0;if(typeof m!="object"||m===null||typeof P!="object"||P===null)return!1;var B=Object.keys(m),K=Object.keys(P);if(B.length!==K.length)return!1;for(K=0;K<B.length;K++){var ne=B[K];if(!qu.call(P,ne)||!Mi(m[ne],P[ne]))return!1}return!0}function St(m){switch(m.tag){case 5:return oo(m.type);case 16:return oo("Lazy");case 13:return oo("Suspense");case 19:return oo("SuspenseList");case 0:case 2:case 15:return m=Vs(m.type,!1),m;case 11:return m=Vs(m.type.render,!1),m;case 1:return m=Vs(m.type,!0),m;default:return""}}function Ft(m,P,B){if(m=B.ref,m!==null&&typeof m!="function"&&typeof m!="object"){if(B._owner){if(B=B._owner,B){if(B.tag!==1)throw Error(o(309));var K=B.stateNode}if(!K)throw Error(o(147,m));var ne=K,le=""+m;return P!==null&&P.ref!==null&&typeof P.ref=="function"&&P.ref._stringRef===le?P.ref:(P=function(xe){var Ye=ne.refs;xe===null?delete Ye[le]:Ye[le]=xe},P._stringRef=le,P)}if(typeof m!="string")throw Error(o(284));if(!B._owner)throw Error(o(290,m))}return m}function ir(m,P){throw m=Object.prototype.toString.call(P),Error(o(31,m==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":m))}function gr(m){var P=m._init;return P(m._payload)}function dr(m){function P(ot,Ke){if(m){var pt=ot.deletions;pt===null?(ot.deletions=[Ke],ot.flags|=16):pt.push(Ke)}}function B(ot,Ke){if(!m)return null;for(;Ke!==null;)P(ot,Ke),Ke=Ke.sibling;return null}function K(ot,Ke){for(ot=new Map;Ke!==null;)Ke.key!==null?ot.set(Ke.key,Ke):ot.set(Ke.index,Ke),Ke=Ke.sibling;return ot}function ne(ot,Ke){return ot=Eu(ot,Ke),ot.index=0,ot.sibling=null,ot}function le(ot,Ke,pt){return ot.index=pt,m?(pt=ot.alternate,pt!==null?(pt=pt.index,pt<Ke?(ot.flags|=2,Ke):pt):(ot.flags|=2,Ke)):(ot.flags|=1048576,Ke)}function xe(ot){return m&&ot.alternate===null&&(ot.flags|=2),ot}function Ye(ot,Ke,pt,Ut){return Ke===null||Ke.tag!==6?(Ke=kc(pt,ot.mode,Ut),Ke.return=ot,Ke):(Ke=ne(Ke,pt),Ke.return=ot,Ke)}function ut(ot,Ke,pt,Ut){var ur=pt.type;return ur===d?Kt(ot,Ke,pt.props.children,Ut,pt.key):Ke!==null&&(Ke.elementType===ur||typeof ur=="object"&&ur!==null&&ur.$$typeof===g&&gr(ur)===Ke.type)?(Ut=ne(Ke,pt.props),Ut.ref=Ft(ot,Ke,pt),Ut.return=ot,Ut):(Ut=$f(pt.type,pt.key,pt.props,null,ot.mode,Ut),Ut.ref=Ft(ot,Ke,pt),Ut.return=ot,Ut)}function Lt(ot,Ke,pt,Ut){return Ke===null||Ke.tag!==4||Ke.stateNode.containerInfo!==pt.containerInfo||Ke.stateNode.implementation!==pt.implementation?(Ke=Yf(pt,ot.mode,Ut),Ke.return=ot,Ke):(Ke=ne(Ke,pt.children||[]),Ke.return=ot,Ke)}function Kt(ot,Ke,pt,Ut,ur){return Ke===null||Ke.tag!==7?(Ke=va(pt,ot.mode,Ut,ur),Ke.return=ot,Ke):(Ke=ne(Ke,pt),Ke.return=ot,Ke)}function br(ot,Ke,pt){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number")return Ke=kc(""+Ke,ot.mode,pt),Ke.return=ot,Ke;if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case c:return pt=$f(Ke.type,Ke.key,Ke.props,null,ot.mode,pt),pt.ref=Ft(ot,null,Ke),pt.return=ot,pt;case u:return Ke=Yf(Ke,ot.mode,pt),Ke.return=ot,Ke;case g:var Ut=Ke._init;return br(ot,Ut(Ke._payload),pt)}if(T(Ke)||M(Ke))return Ke=va(Ke,ot.mode,pt,null),Ke.return=ot,Ke;ir(ot,Ke)}return null}function zt(ot,Ke,pt,Ut){var ur=Ke!==null?Ke.key:null;if(typeof pt=="string"&&pt!==""||typeof pt=="number")return ur!==null?null:Ye(ot,Ke,""+pt,Ut);if(typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case c:return pt.key===ur?ut(ot,Ke,pt,Ut):null;case u:return pt.key===ur?Lt(ot,Ke,pt,Ut):null;case g:return ur=pt._init,zt(ot,Ke,ur(pt._payload),Ut)}if(T(pt)||M(pt))return ur!==null?null:Kt(ot,Ke,pt,Ut,null);ir(ot,pt)}return null}function Tn(ot,Ke,pt,Ut,ur){if(typeof Ut=="string"&&Ut!==""||typeof Ut=="number")return ot=ot.get(pt)||null,Ye(Ke,ot,""+Ut,ur);if(typeof Ut=="object"&&Ut!==null){switch(Ut.$$typeof){case c:return ot=ot.get(Ut.key===null?pt:Ut.key)||null,ut(Ke,ot,Ut,ur);case u:return ot=ot.get(Ut.key===null?pt:Ut.key)||null,Lt(Ke,ot,Ut,ur);case g:var Cr=Ut._init;return Tn(ot,Ke,pt,Cr(Ut._payload),ur)}if(T(Ut)||M(Ut))return ot=ot.get(pt)||null,Kt(Ke,ot,Ut,ur,null);ir(Ke,Ut)}return null}function mn(ot,Ke,pt,Ut){for(var ur=null,Cr=null,wr=Ke,Hr=Ke=0,$i=null;wr!==null&&Hr<pt.length;Hr++){wr.index>Hr?($i=wr,wr=null):$i=wr.sibling;var qr=zt(ot,wr,pt[Hr],Ut);if(qr===null){wr===null&&(wr=$i);break}m&&wr&&qr.alternate===null&&P(ot,wr),Ke=le(qr,Ke,Hr),Cr===null?ur=qr:Cr.sibling=qr,Cr=qr,wr=$i}if(Hr===pt.length)return B(ot,wr),Jr&&Ba(ot,Hr),ur;if(wr===null){for(;Hr<pt.length;Hr++)wr=br(ot,pt[Hr],Ut),wr!==null&&(Ke=le(wr,Ke,Hr),Cr===null?ur=wr:Cr.sibling=wr,Cr=wr);return Jr&&Ba(ot,Hr),ur}for(wr=K(ot,wr);Hr<pt.length;Hr++)$i=Tn(wr,ot,Hr,pt[Hr],Ut),$i!==null&&(m&&$i.alternate!==null&&wr.delete($i.key===null?Hr:$i.key),Ke=le($i,Ke,Hr),Cr===null?ur=$i:Cr.sibling=$i,Cr=$i);return m&&wr.forEach(function(Ca){return P(ot,Ca)}),Jr&&Ba(ot,Hr),ur}function eo(ot,Ke,pt,Ut){var ur=M(pt);if(typeof ur!="function")throw Error(o(150));if(pt=ur.call(pt),pt==null)throw Error(o(151));for(var Cr=ur=null,wr=Ke,Hr=Ke=0,$i=null,qr=pt.next();wr!==null&&!qr.done;Hr++,qr=pt.next()){wr.index>Hr?($i=wr,wr=null):$i=wr.sibling;var Ca=zt(ot,wr,qr.value,Ut);if(Ca===null){wr===null&&(wr=$i);break}m&&wr&&Ca.alternate===null&&P(ot,wr),Ke=le(Ca,Ke,Hr),Cr===null?ur=Ca:Cr.sibling=Ca,Cr=Ca,wr=$i}if(qr.done)return B(ot,wr),Jr&&Ba(ot,Hr),ur;if(wr===null){for(;!qr.done;Hr++,qr=pt.next())qr=br(ot,qr.value,Ut),qr!==null&&(Ke=le(qr,Ke,Hr),Cr===null?ur=qr:Cr.sibling=qr,Cr=qr);return Jr&&Ba(ot,Hr),ur}for(wr=K(ot,wr);!qr.done;Hr++,qr=pt.next())qr=Tn(wr,ot,Hr,qr.value,Ut),qr!==null&&(m&&qr.alternate!==null&&wr.delete(qr.key===null?Hr:qr.key),Ke=le(qr,Ke,Hr),Cr===null?ur=qr:Cr.sibling=qr,Cr=qr);return m&&wr.forEach(function(v0){return P(ot,v0)}),Jr&&Ba(ot,Hr),ur}function sl(ot,Ke,pt,Ut){if(typeof pt=="object"&&pt!==null&&pt.type===d&&pt.key===null&&(pt=pt.props.children),typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case c:e:{for(var ur=pt.key,Cr=Ke;Cr!==null;){if(Cr.key===ur){if(ur=pt.type,ur===d){if(Cr.tag===7){B(ot,Cr.sibling),Ke=ne(Cr,pt.props.children),Ke.return=ot,ot=Ke;break e}}else if(Cr.elementType===ur||typeof ur=="object"&&ur!==null&&ur.$$typeof===g&&gr(ur)===Cr.type){B(ot,Cr.sibling),Ke=ne(Cr,pt.props),Ke.ref=Ft(ot,Cr,pt),Ke.return=ot,ot=Ke;break e}B(ot,Cr);break}else P(ot,Cr);Cr=Cr.sibling}pt.type===d?(Ke=va(pt.props.children,ot.mode,Ut,pt.key),Ke.return=ot,ot=Ke):(Ut=$f(pt.type,pt.key,pt.props,null,ot.mode,Ut),Ut.ref=Ft(ot,Ke,pt),Ut.return=ot,ot=Ut)}return xe(ot);case u:e:{for(Cr=pt.key;Ke!==null;){if(Ke.key===Cr)if(Ke.tag===4&&Ke.stateNode.containerInfo===pt.containerInfo&&Ke.stateNode.implementation===pt.implementation){B(ot,Ke.sibling),Ke=ne(Ke,pt.children||[]),Ke.return=ot,ot=Ke;break e}else{B(ot,Ke);break}else P(ot,Ke);Ke=Ke.sibling}Ke=Yf(pt,ot.mode,Ut),Ke.return=ot,ot=Ke}return xe(ot);case g:return Cr=pt._init,sl(ot,Ke,Cr(pt._payload),Ut)}if(T(pt))return mn(ot,Ke,pt,Ut);if(M(pt))return eo(ot,Ke,pt,Ut);ir(ot,pt)}return typeof pt=="string"&&pt!==""||typeof pt=="number"?(pt=""+pt,Ke!==null&&Ke.tag===6?(B(ot,Ke.sibling),Ke=ne(Ke,pt),Ke.return=ot,ot=Ke):(B(ot,Ke),Ke=kc(pt,ot.mode,Ut),Ke.return=ot,ot=Ke),xe(ot)):B(ot,Ke)}return sl}var Sr=dr(!0),Cn=dr(!1),Sn=di(null),jn=null,Qn=null,si=null;function za(){si=Qn=jn=null}function xa(m,P,B){ce?(Ar(Sn,P._currentValue),P._currentValue=B):(Ar(Sn,P._currentValue2),P._currentValue2=B)}function Ea(m){var P=Sn.current;Xr(Sn),ce?m._currentValue=P:m._currentValue2=P}function Zo(m,P,B){for(;m!==null;){var K=m.alternate;if((m.childLanes&P)!==P?(m.childLanes|=P,K!==null&&(K.childLanes|=P)):K!==null&&(K.childLanes&P)!==P&&(K.childLanes|=P),m===B)break;m=m.return}}function Qo(m,P){jn=m,si=Qn=null,m=m.dependencies,m!==null&&m.firstContext!==null&&((m.lanes&P)!==0&&(ui=!0),m.firstContext=null)}function Di(m){var P=ce?m._currentValue:m._currentValue2;if(si!==m)if(m={context:m,memoizedValue:P,next:null},Qn===null){if(jn===null)throw Error(o(308));Qn=m,jn.dependencies={lanes:0,firstContext:m}}else Qn=Qn.next=m;return P}var Ua=null;function Js(m){Ua===null?Ua=[m]:Ua.push(m)}function bl(m,P,B,K){var ne=P.interleaved;return ne===null?(B.next=B,Js(P)):(B.next=ne.next,ne.next=B),P.interleaved=B,ra(m,K)}function ra(m,P){m.lanes|=P;var B=m.alternate;for(B!==null&&(B.lanes|=P),B=m,m=m.return;m!==null;)m.childLanes|=P,B=m.alternate,B!==null&&(B.childLanes|=P),B=m,m=m.return;return B.tag===3?B.stateNode:null}var en=!1;function el(m){m.updateQueue={baseState:m.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wl(m,P){m=m.updateQueue,P.updateQueue===m&&(P.updateQueue={baseState:m.baseState,firstBaseUpdate:m.firstBaseUpdate,lastBaseUpdate:m.lastBaseUpdate,shared:m.shared,effects:m.effects})}function Pa(m,P){return{eventTime:m,lane:P,tag:0,payload:null,callback:null,next:null}}function Ha(m,P,B){var K=m.updateQueue;if(K===null)return null;if(K=K.shared,(vr&2)!==0){var ne=K.pending;return ne===null?P.next=P:(P.next=ne.next,ne.next=P),K.pending=P,ra(m,B)}return ne=K.interleaved,ne===null?(P.next=P,Js(K)):(P.next=ne.next,ne.next=P),K.interleaved=P,ra(m,B)}function Si(m,P,B){if(P=P.updateQueue,P!==null&&(P=P.shared,(B&4194240)!==0)){var K=P.lanes;K&=m.pendingLanes,B|=K,P.lanes=B,ja(m,B)}}function tl(m,P){var B=m.updateQueue,K=m.alternate;if(K!==null&&(K=K.updateQueue,B===K)){var ne=null,le=null;if(B=B.firstBaseUpdate,B!==null){do{var xe={eventTime:B.eventTime,lane:B.lane,tag:B.tag,payload:B.payload,callback:B.callback,next:null};le===null?ne=le=xe:le=le.next=xe,B=B.next}while(B!==null);le===null?ne=le=P:le=le.next=P}else ne=le=P;B={baseState:K.baseState,firstBaseUpdate:ne,lastBaseUpdate:le,shared:K.shared,effects:K.effects},m.updateQueue=B;return}m=B.lastBaseUpdate,m===null?B.firstBaseUpdate=P:m.next=P,B.lastBaseUpdate=P}function co(m,P,B,K){var ne=m.updateQueue;en=!1;var le=ne.firstBaseUpdate,xe=ne.lastBaseUpdate,Ye=ne.shared.pending;if(Ye!==null){ne.shared.pending=null;var ut=Ye,Lt=ut.next;ut.next=null,xe===null?le=Lt:xe.next=Lt,xe=ut;var Kt=m.alternate;Kt!==null&&(Kt=Kt.updateQueue,Ye=Kt.lastBaseUpdate,Ye!==xe&&(Ye===null?Kt.firstBaseUpdate=Lt:Ye.next=Lt,Kt.lastBaseUpdate=ut))}if(le!==null){var br=ne.baseState;xe=0,Kt=Lt=ut=null,Ye=le;do{var zt=Ye.lane,Tn=Ye.eventTime;if((K&zt)===zt){Kt!==null&&(Kt=Kt.next={eventTime:Tn,lane:0,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null});e:{var mn=m,eo=Ye;switch(zt=P,Tn=B,eo.tag){case 1:if(mn=eo.payload,typeof mn=="function"){br=mn.call(Tn,br,zt);break e}br=mn;break e;case 3:mn.flags=mn.flags&-65537|128;case 0:if(mn=eo.payload,zt=typeof mn=="function"?mn.call(Tn,br,zt):mn,zt==null)break e;br=i({},br,zt);break e;case 2:en=!0}}Ye.callback!==null&&Ye.lane!==0&&(m.flags|=64,zt=ne.effects,zt===null?ne.effects=[Ye]:zt.push(Ye))}else Tn={eventTime:Tn,lane:zt,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null},Kt===null?(Lt=Kt=Tn,ut=br):Kt=Kt.next=Tn,xe|=zt;if(Ye=Ye.next,Ye===null){if(Ye=ne.shared.pending,Ye===null)break;zt=Ye,Ye=zt.next,zt.next=null,ne.lastBaseUpdate=zt,ne.shared.pending=null}}while(!0);if(Kt===null&&(ut=br),ne.baseState=ut,ne.firstBaseUpdate=Lt,ne.lastBaseUpdate=Kt,P=ne.shared.interleaved,P!==null){ne=P;do xe|=ne.lane,ne=ne.next;while(ne!==P)}else le===null&&(ne.shared.lanes=0);Ts|=xe,m.lanes=xe,m.memoizedState=br}}function Hu(m,P,B){if(m=P.effects,P.effects=null,m!==null)for(P=0;P<m.length;P++){var K=m[P],ne=K.callback;if(ne!==null){if(K.callback=null,K=B,typeof ne!="function")throw Error(o(191,ne));ne.call(K)}}}var vi={},Bi=di(vi),Cs=di(vi),Co=di(vi);function mi(m){if(m===vi)throw Error(o(174));return m}function Jo(m,P){Ar(Co,P),Ar(Cs,m),Ar(Bi,vi),m=G(P),Xr(Bi),Ar(Bi,m)}function li(){Xr(Bi),Xr(Cs),Xr(Co)}function qi(m){var P=mi(Co.current),B=mi(Bi.current);P=$(B,m.type,P),B!==P&&(Ar(Cs,m),Ar(Bi,P))}function es(m){Cs.current===m&&(Xr(Bi),Xr(Cs))}var Wr=di(0);function fo(m){for(var P=m;P!==null;){if(P.tag===13){var B=P.memoizedState;if(B!==null&&(B=B.dehydrated,B===null||Dt(B)||Vt(B)))return P}else if(P.tag===19&&P.memoizedProps.revealOrder!==void 0){if((P.flags&128)!==0)return P}else if(P.child!==null){P.child.return=P,P=P.child;continue}if(P===m)break;for(;P.sibling===null;){if(P.return===null||P.return===m)return null;P=P.return}P.sibling.return=P.return,P=P.sibling}return null}var rl=[];function ko(){for(var m=0;m<rl.length;m++){var P=rl[m];ce?P._workInProgressVersionPrimary=null:P._workInProgressVersionSecondary=null}rl.length=0}var Mr=s.ReactCurrentDispatcher,Lo=s.ReactCurrentBatchConfig,Yn=0,Lr=null,xn=null,Xn=null,ts=!1,No=!1,To=0,Va=0;function kn(){throw Error(o(321))}function ho(m,P){if(P===null)return!1;for(var B=0;B<P.length&&B<m.length;B++)if(!Mi(m[B],P[B]))return!1;return!0}function Ro(m,P,B,K,ne,le){if(Yn=le,Lr=P,P.memoizedState=null,P.updateQueue=null,P.lanes=0,Mr.current=m===null||m.memoizedState===null?Wu:Ol,m=B(K,ne),No){le=0;do{if(No=!1,To=0,25<=le)throw Error(o(301));le+=1,Xn=xn=null,P.updateQueue=null,Mr.current=uf,m=B(K,ne)}while(No)}if(Mr.current=Ls,P=xn!==null&&xn.next!==null,Yn=0,Xn=xn=Lr=null,ts=!1,P)throw Error(o(300));return m}function Mo(){var m=To!==0;return To=0,m}function zi(){var m={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?Lr.memoizedState=Xn=m:Xn=Xn.next=m,Xn}function un(){if(xn===null){var m=Lr.alternate;m=m!==null?m.memoizedState:null}else m=xn.next;var P=Xn===null?Lr.memoizedState:Xn.next;if(P!==null)Xn=P,xn=m;else{if(m===null)throw Error(o(310));xn=m,m={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},Xn===null?Lr.memoizedState=Xn=m:Xn=Xn.next=m}return Xn}function xi(m,P){return typeof P=="function"?P(m):P}function tn(m){var P=un(),B=P.queue;if(B===null)throw Error(o(311));B.lastRenderedReducer=m;var K=xn,ne=K.baseQueue,le=B.pending;if(le!==null){if(ne!==null){var xe=ne.next;ne.next=le.next,le.next=xe}K.baseQueue=ne=le,B.pending=null}if(ne!==null){le=ne.next,K=K.baseState;var Ye=xe=null,ut=null,Lt=le;do{var Kt=Lt.lane;if((Yn&Kt)===Kt)ut!==null&&(ut=ut.next={lane:0,action:Lt.action,hasEagerState:Lt.hasEagerState,eagerState:Lt.eagerState,next:null}),K=Lt.hasEagerState?Lt.eagerState:m(K,Lt.action);else{var br={lane:Kt,action:Lt.action,hasEagerState:Lt.hasEagerState,eagerState:Lt.eagerState,next:null};ut===null?(Ye=ut=br,xe=K):ut=ut.next=br,Lr.lanes|=Kt,Ts|=Kt}Lt=Lt.next}while(Lt!==null&&Lt!==le);ut===null?xe=K:ut.next=Ye,Mi(K,P.memoizedState)||(ui=!0),P.memoizedState=K,P.baseState=xe,P.baseQueue=ut,B.lastRenderedState=K}if(m=B.interleaved,m!==null){ne=m;do le=ne.lane,Lr.lanes|=le,Ts|=le,ne=ne.next;while(ne!==m)}else ne===null&&(B.lanes=0);return[P.memoizedState,B.dispatch]}function $r(m){var P=un(),B=P.queue;if(B===null)throw Error(o(311));B.lastRenderedReducer=m;var K=B.dispatch,ne=B.pending,le=P.memoizedState;if(ne!==null){B.pending=null;var xe=ne=ne.next;do le=m(le,xe.action),xe=xe.next;while(xe!==ne);Mi(le,P.memoizedState)||(ui=!0),P.memoizedState=le,P.baseQueue===null&&(P.baseState=le),B.lastRenderedState=le}return[le,K]}function Fn(){}function Jn(m,P){var B=Lr,K=un(),ne=P(),le=!Mi(K.memoizedState,ne);if(le&&(K.memoizedState=ne,ui=!0),K=K.queue,El(nl.bind(null,B,K,m),[m]),K.getSnapshot!==P||le||Xn!==null&&Xn.memoizedState.tag&1){if(B.flags|=2048,yi(9,_l.bind(null,B,K,ne,P),void 0,null),Qr===null)throw Error(o(349));(Yn&30)!==0||Io(B,P,ne)}return ne}function Io(m,P,B){m.flags|=16384,m={getSnapshot:P,value:B},P=Lr.updateQueue,P===null?(P={lastEffect:null,stores:null},Lr.updateQueue=P,P.stores=[m]):(B=P.stores,B===null?P.stores=[m]:B.push(m))}function _l(m,P,B,K){P.value=B,P.getSnapshot=K,cu(P)&&jo(m)}function nl(m,P,B){return B(function(){cu(P)&&jo(m)})}function cu(m){var P=m.getSnapshot;m=m.value;try{var B=P();return!Mi(m,B)}catch{return!0}}function jo(m){var P=ra(m,1);P!==null&&la(P,m,1,-1)}function Sl(m){var P=zi();return typeof m=="function"&&(m=m()),P.memoizedState=P.baseState=m,m={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:m},P.queue=m,m=m.dispatch=qh.bind(null,Lr,m),[P.memoizedState,m]}function yi(m,P,B,K){return m={tag:m,create:P,destroy:B,deps:K,next:null},P=Lr.updateQueue,P===null?(P={lastEffect:null,stores:null},Lr.updateQueue=P,P.lastEffect=m.next=m):(B=P.lastEffect,B===null?P.lastEffect=m.next=m:(K=B.next,B.next=m,m.next=K,P.lastEffect=m)),m}function Ga(){return un().memoizedState}function xl(m,P,B,K){var ne=zi();Lr.flags|=m,ne.memoizedState=yi(1|P,B,void 0,K===void 0?null:K)}function Fo(m,P,B,K){var ne=un();K=K===void 0?null:K;var le=void 0;if(xn!==null){var xe=xn.memoizedState;if(le=xe.destroy,K!==null&&ho(K,xe.deps)){ne.memoizedState=yi(P,B,le,K);return}}Lr.flags|=m,ne.memoizedState=yi(1|P,B,le,K)}function sf(m,P){return xl(8390656,8,m,P)}function El(m,P){return Fo(2048,8,m,P)}function fu(m,P){return Fo(4,2,m,P)}function cn(m,P){return Fo(4,4,m,P)}function Vu(m,P){if(typeof P=="function")return m=m(),P(m),function(){P(null)};if(P!=null)return m=m(),P.current=m,function(){P.current=null}}function Pl(m,P,B){return B=B!=null?B.concat([m]):null,Fo(4,4,Vu.bind(null,P,m),B)}function ks(){}function hu(m,P){var B=un();P=P===void 0?null:P;var K=B.memoizedState;return K!==null&&P!==null&&ho(P,K[1])?K[0]:(B.memoizedState=[m,P],m)}function du(m,P){var B=un();P=P===void 0?null:P;var K=B.memoizedState;return K!==null&&P!==null&&ho(P,K[1])?K[0]:(m=m(),B.memoizedState=[m,P],m)}function pu(m,P,B){return(Yn&21)===0?(m.baseState&&(m.baseState=!1,ui=!0),m.memoizedState=B):(Mi(B,P)||(B=Es(),Lr.lanes|=B,Ts|=B,m.baseState=!0),P)}function bc(m,P){var B=It;It=B!==0&&4>B?B:4,m(!0);var K=Lo.transition;Lo.transition={};try{m(!1),P()}finally{It=B,Lo.transition=K}}function il(){return un().memoizedState}function Bf(m,P,B){var K=hi(m);if(B={lane:K,action:B,hasEagerState:!1,eagerState:null,next:null},qf(m))lf(P,B);else if(B=bl(m,P,B,K),B!==null){var ne=bn();la(B,m,K,ne),Gu(B,P,K)}}function qh(m,P,B){var K=hi(m),ne={lane:K,action:B,hasEagerState:!1,eagerState:null,next:null};if(qf(m))lf(P,ne);else{var le=m.alternate;if(m.lanes===0&&(le===null||le.lanes===0)&&(le=P.lastRenderedReducer,le!==null))try{var xe=P.lastRenderedState,Ye=le(xe,B);if(ne.hasEagerState=!0,ne.eagerState=Ye,Mi(Ye,xe)){var ut=P.interleaved;ut===null?(ne.next=ne,Js(P)):(ne.next=ut.next,ut.next=ne),P.interleaved=ne;return}}catch{}finally{}B=bl(m,P,ne,K),B!==null&&(ne=bn(),la(B,m,K,ne),Gu(B,P,K))}}function qf(m){var P=m.alternate;return m===Lr||P!==null&&P===Lr}function lf(m,P){No=ts=!0;var B=m.pending;B===null?P.next=P:(P.next=B.next,B.next=P),m.pending=P}function Gu(m,P,B){if((B&4194240)!==0){var K=P.lanes;K&=m.pendingLanes,B|=K,P.lanes=B,ja(m,B)}}var Ls={readContext:Di,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useInsertionEffect:kn,useLayoutEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useMutableSource:kn,useSyncExternalStore:kn,useId:kn,unstable_isNewReconciler:!1},Wu={readContext:Di,useCallback:function(m,P){return zi().memoizedState=[m,P===void 0?null:P],m},useContext:Di,useEffect:sf,useImperativeHandle:function(m,P,B){return B=B!=null?B.concat([m]):null,xl(4194308,4,Vu.bind(null,P,m),B)},useLayoutEffect:function(m,P){return xl(4194308,4,m,P)},useInsertionEffect:function(m,P){return xl(4,2,m,P)},useMemo:function(m,P){var B=zi();return P=P===void 0?null:P,m=m(),B.memoizedState=[m,P],m},useReducer:function(m,P,B){var K=zi();return P=B!==void 0?B(P):P,K.memoizedState=K.baseState=P,m={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:m,lastRenderedState:P},K.queue=m,m=m.dispatch=Bf.bind(null,Lr,m),[K.memoizedState,m]},useRef:function(m){var P=zi();return m={current:m},P.memoizedState=m},useState:Sl,useDebugValue:ks,useDeferredValue:function(m){return zi().memoizedState=m},useTransition:function(){var m=Sl(!1),P=m[0];return m=bc.bind(null,m[1]),zi().memoizedState=m,[P,m]},useMutableSource:function(){},useSyncExternalStore:function(m,P,B){var K=Lr,ne=zi();if(Jr){if(B===void 0)throw Error(o(407));B=B()}else{if(B=P(),Qr===null)throw Error(o(349));(Yn&30)!==0||Io(K,P,B)}ne.memoizedState=B;var le={value:B,getSnapshot:P};return ne.queue=le,sf(nl.bind(null,K,le,m),[m]),K.flags|=2048,yi(9,_l.bind(null,K,le,B,P),void 0,null),B},useId:function(){var m=zi(),P=Qr.identifierPrefix;if(Jr){var B=ta,K=ea;B=(K&~(1<<32-ha(K)-1)).toString(32)+B,P=":"+P+"R"+B,B=To++,0<B&&(P+="H"+B.toString(32)),P+=":"}else B=Va++,P=":"+P+"r"+B.toString(32)+":";return m.memoizedState=P},unstable_isNewReconciler:!1},Ol={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:cn,useMemo:du,useReducer:tn,useRef:Ga,useState:function(){return tn(xi)},useDebugValue:ks,useDeferredValue:function(m){var P=un();return pu(P,xn.memoizedState,m)},useTransition:function(){var m=tn(xi)[0],P=un().memoizedState;return[m,P]},useMutableSource:Fn,useSyncExternalStore:Jn,useId:il,unstable_isNewReconciler:!1},uf={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:cn,useMemo:du,useReducer:$r,useRef:Ga,useState:function(){return $r(xi)},useDebugValue:ks,useDeferredValue:function(m){var P=un();return xn===null?P.memoizedState=m:pu(P,xn.memoizedState,m)},useTransition:function(){var m=$r(xi)[0],P=un().memoizedState;return[m,P]},useMutableSource:Fn,useSyncExternalStore:Jn,useId:il,unstable_isNewReconciler:!1};function Wa(m,P){if(m&&m.defaultProps){P=i({},P),m=m.defaultProps;for(var B in m)P[B]===void 0&&(P[B]=m[B]);return P}return P}function wc(m,P,B,K){P=m.memoizedState,B=B(K,P),B=B==null?P:i({},P,B),m.memoizedState=B,m.lanes===0&&(m.updateQueue.baseState=B)}var $u={isMounted:function(m){return(m=m._reactInternals)?F(m)===m:!1},enqueueSetState:function(m,P,B){m=m._reactInternals;var K=bn(),ne=hi(m),le=Pa(K,ne);le.payload=P,B!=null&&(le.callback=B),P=Ha(m,le,ne),P!==null&&(la(P,m,ne,K),Si(P,m,ne))},enqueueReplaceState:function(m,P,B){m=m._reactInternals;var K=bn(),ne=hi(m),le=Pa(K,ne);le.tag=1,le.payload=P,B!=null&&(le.callback=B),P=Ha(m,le,ne),P!==null&&(la(P,m,ne,K),Si(P,m,ne))},enqueueForceUpdate:function(m,P){m=m._reactInternals;var B=bn(),K=hi(m),ne=Pa(B,K);ne.tag=2,P!=null&&(ne.callback=P),P=Ha(m,ne,K),P!==null&&(la(P,m,K,B),Si(P,m,K))}};function zf(m,P,B,K,ne,le,xe){return m=m.stateNode,typeof m.shouldComponentUpdate=="function"?m.shouldComponentUpdate(K,le,xe):P.prototype&&P.prototype.isPureReactComponent?!dt(B,K)||!dt(ne,le):!0}function Uf(m,P,B){var K=!1,ne=ln,le=P.contextType;return typeof le=="object"&&le!==null?le=Di(le):(ne=ii(P)?Ma:pi.current,K=P.contextTypes,le=(K=K!=null)?Ia(m,ne):ln),P=new P(B,le),m.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,P.updater=$u,m.stateNode=P,P._reactInternals=m,K&&(m=m.stateNode,m.__reactInternalMemoizedUnmaskedChildContext=ne,m.__reactInternalMemoizedMaskedChildContext=le),P}function _c(m,P,B,K){m=P.state,typeof P.componentWillReceiveProps=="function"&&P.componentWillReceiveProps(B,K),typeof P.UNSAFE_componentWillReceiveProps=="function"&&P.UNSAFE_componentWillReceiveProps(B,K),P.state!==m&&$u.enqueueReplaceState(P,P.state,null)}function Ui(m,P,B,K){var ne=m.stateNode;ne.props=B,ne.state=m.memoizedState,ne.refs={},el(m);var le=P.contextType;typeof le=="object"&&le!==null?ne.context=Di(le):(le=ii(P)?Ma:pi.current,ne.context=Ia(m,le)),ne.state=m.memoizedState,le=P.getDerivedStateFromProps,typeof le=="function"&&(wc(m,P,le,B),ne.state=m.memoizedState),typeof P.getDerivedStateFromProps=="function"||typeof ne.getSnapshotBeforeUpdate=="function"||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(P=ne.state,typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount(),P!==ne.state&&$u.enqueueReplaceState(ne,ne.state,null),co(m,B,ne,K),ne.state=m.memoizedState),typeof ne.componentDidMount=="function"&&(m.flags|=4194308)}function Hi(m,P){try{var B="",K=P;do B+=St(K),K=K.return;while(K);var ne=B}catch(le){ne=`
|
|
56
|
+
Error generating stack: `+le.message+`
|
|
57
|
+
`+le.stack}return{value:m,source:P,stack:ne,digest:null}}function na(m,P,B){return{value:m,source:null,stack:B??null,digest:P??null}}function po(m,P){try{console.error(P.value)}catch(B){setTimeout(function(){throw B})}}var gu=typeof WeakMap=="function"?WeakMap:Map;function Vi(m,P,B){B=Pa(-1,B),B.tag=3,B.payload={element:null};var K=P.value;return B.callback=function(){zn||(zn=!0,Un=K),po(m,P)},B}function da(m,P,B){B=Pa(-1,B),B.tag=3;var K=m.type.getDerivedStateFromError;if(typeof K=="function"){var ne=P.value;B.payload=function(){return K(ne)},B.callback=function(){po(m,P)}}var le=m.stateNode;return le!==null&&typeof le.componentDidCatch=="function"&&(B.callback=function(){po(m,P),typeof K!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var xe=P.stack;this.componentDidCatch(P.value,{componentStack:xe!==null?xe:""})}),B}function Hf(m,P,B){var K=m.pingCache;if(K===null){K=m.pingCache=new gu;var ne=new Set;K.set(P,ne)}else ne=K.get(P),ne===void 0&&(ne=new Set,K.set(P,ne));ne.has(B)||(ne.add(B),m=Np.bind(null,m,P,B),P.then(m,m))}function Vf(m){do{var P;if((P=m.tag===13)&&(P=m.memoizedState,P=P!==null?P.dehydrated!==null:!0),P)return m;m=m.return}while(m!==null);return null}function Ns(m,P,B,K,ne){return(m.mode&1)===0?(m===P?m.flags|=65536:(m.flags|=128,B.flags|=131072,B.flags&=-52805,B.tag===1&&(B.alternate===null?B.tag=17:(P=Pa(-1,1),P.tag=2,Ha(B,P,1))),B.lanes|=1),m):(m.flags|=65536,m.lanes=ne,m)}var vu=s.ReactCurrentOwner,ui=!1;function bi(m,P,B,K){P.child=m===null?Cn(P,null,B,K):Sr(P,m.child,B,K)}function Sc(m,P,B,K,ne){B=B.render;var le=P.ref;return Qo(P,ne),K=Ro(m,P,B,K,le,ne),B=Mo(),m!==null&&!ui?(P.updateQueue=m.updateQueue,P.flags&=-2053,m.lanes&=~ne,re(m,P,ne)):(Jr&&B&&As(P),P.flags|=1,bi(m,P,K,ne),P.child)}function rs(m,P,B,K,ne){if(m===null){var le=B.type;return typeof le=="function"&&!Ac(le)&&le.defaultProps===void 0&&B.compare===null&&B.defaultProps===void 0?(P.tag=15,P.type=le,go(m,P,le,K,ne)):(m=$f(B.type,null,K,P,P.mode,ne),m.ref=P.ref,m.return=P,P.child=m)}if(le=m.child,(m.lanes&ne)===0){var xe=le.memoizedProps;if(B=B.compare,B=B!==null?B:dt,B(xe,K)&&m.ref===P.ref)return re(m,P,ne)}return P.flags|=1,m=Eu(le,K),m.ref=P.ref,m.return=P,P.child=m}function go(m,P,B,K,ne){if(m!==null){var le=m.memoizedProps;if(dt(le,K)&&m.ref===P.ref)if(ui=!1,P.pendingProps=K=le,(m.lanes&ne)!==0)(m.flags&131072)!==0&&(ui=!0);else return P.lanes=m.lanes,re(m,P,ne)}return ns(m,P,B,K,ne)}function Kr(m,P,B){var K=P.pendingProps,ne=K.children,le=m!==null?m.memoizedState:null;if(K.mode==="hidden")if((P.mode&1)===0)P.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ar(qo,ei),ei|=B;else{if((B&1073741824)===0)return m=le!==null?le.baseLanes|B:B,P.lanes=P.childLanes=1073741824,P.memoizedState={baseLanes:m,cachePool:null,transitions:null},P.updateQueue=null,Ar(qo,ei),ei|=m,null;P.memoizedState={baseLanes:0,cachePool:null,transitions:null},K=le!==null?le.baseLanes:B,Ar(qo,ei),ei|=K}else le!==null?(K=le.baseLanes|B,P.memoizedState=null):K=B,Ar(qo,ei),ei|=K;return bi(m,P,ne,B),P.child}function rn(m,P){var B=P.ref;(m===null&&B!==null||m!==null&&m.ref!==B)&&(P.flags|=512,P.flags|=2097152)}function ns(m,P,B,K,ne){var le=ii(B)?Ma:pi.current;return le=Ia(P,le),Qo(P,ne),B=Ro(m,P,B,K,le,ne),K=Mo(),m!==null&&!ui?(P.updateQueue=m.updateQueue,P.flags&=-2053,m.lanes&=~ne,re(m,P,ne)):(Jr&&K&&As(P),P.flags|=1,bi(m,P,B,ne),P.child)}function Ei(m,P,B,K,ne){if(ii(B)){var le=!0;Wo(P)}else le=!1;if(Qo(P,ne),P.stateNode===null)H(m,P),Uf(P,B,K),Ui(P,B,K,ne),K=!0;else if(m===null){var xe=P.stateNode,Ye=P.memoizedProps;xe.props=Ye;var ut=xe.context,Lt=B.contextType;typeof Lt=="object"&&Lt!==null?Lt=Di(Lt):(Lt=ii(B)?Ma:pi.current,Lt=Ia(P,Lt));var Kt=B.getDerivedStateFromProps,br=typeof Kt=="function"||typeof xe.getSnapshotBeforeUpdate=="function";br||typeof xe.UNSAFE_componentWillReceiveProps!="function"&&typeof xe.componentWillReceiveProps!="function"||(Ye!==K||ut!==Lt)&&_c(P,xe,K,Lt),en=!1;var zt=P.memoizedState;xe.state=zt,co(P,K,xe,ne),ut=P.memoizedState,Ye!==K||zt!==ut||Ti.current||en?(typeof Kt=="function"&&(wc(P,B,Kt,K),ut=P.memoizedState),(Ye=en||zf(P,B,Ye,K,zt,ut,Lt))?(br||typeof xe.UNSAFE_componentWillMount!="function"&&typeof xe.componentWillMount!="function"||(typeof xe.componentWillMount=="function"&&xe.componentWillMount(),typeof xe.UNSAFE_componentWillMount=="function"&&xe.UNSAFE_componentWillMount()),typeof xe.componentDidMount=="function"&&(P.flags|=4194308)):(typeof xe.componentDidMount=="function"&&(P.flags|=4194308),P.memoizedProps=K,P.memoizedState=ut),xe.props=K,xe.state=ut,xe.context=Lt,K=Ye):(typeof xe.componentDidMount=="function"&&(P.flags|=4194308),K=!1)}else{xe=P.stateNode,wl(m,P),Ye=P.memoizedProps,Lt=P.type===P.elementType?Ye:Wa(P.type,Ye),xe.props=Lt,br=P.pendingProps,zt=xe.context,ut=B.contextType,typeof ut=="object"&&ut!==null?ut=Di(ut):(ut=ii(B)?Ma:pi.current,ut=Ia(P,ut));var Tn=B.getDerivedStateFromProps;(Kt=typeof Tn=="function"||typeof xe.getSnapshotBeforeUpdate=="function")||typeof xe.UNSAFE_componentWillReceiveProps!="function"&&typeof xe.componentWillReceiveProps!="function"||(Ye!==br||zt!==ut)&&_c(P,xe,K,ut),en=!1,zt=P.memoizedState,xe.state=zt,co(P,K,xe,ne);var mn=P.memoizedState;Ye!==br||zt!==mn||Ti.current||en?(typeof Tn=="function"&&(wc(P,B,Tn,K),mn=P.memoizedState),(Lt=en||zf(P,B,Lt,K,zt,mn,ut)||!1)?(Kt||typeof xe.UNSAFE_componentWillUpdate!="function"&&typeof xe.componentWillUpdate!="function"||(typeof xe.componentWillUpdate=="function"&&xe.componentWillUpdate(K,mn,ut),typeof xe.UNSAFE_componentWillUpdate=="function"&&xe.UNSAFE_componentWillUpdate(K,mn,ut)),typeof xe.componentDidUpdate=="function"&&(P.flags|=4),typeof xe.getSnapshotBeforeUpdate=="function"&&(P.flags|=1024)):(typeof xe.componentDidUpdate!="function"||Ye===m.memoizedProps&&zt===m.memoizedState||(P.flags|=4),typeof xe.getSnapshotBeforeUpdate!="function"||Ye===m.memoizedProps&&zt===m.memoizedState||(P.flags|=1024),P.memoizedProps=K,P.memoizedState=mn),xe.props=K,xe.state=mn,xe.context=ut,K=Lt):(typeof xe.componentDidUpdate!="function"||Ye===m.memoizedProps&&zt===m.memoizedState||(P.flags|=4),typeof xe.getSnapshotBeforeUpdate!="function"||Ye===m.memoizedProps&&zt===m.memoizedState||(P.flags|=1024),K=!1)}return ia(m,P,B,K,le,ne)}function ia(m,P,B,K,ne,le){rn(m,P);var xe=(P.flags&128)!==0;if(!K&&!xe)return ne&&nu(P,B,!1),re(m,P,le);K=P.stateNode,vu.current=P;var Ye=xe&&typeof B.getDerivedStateFromError!="function"?null:K.render();return P.flags|=1,m!==null&&xe?(P.child=Sr(P,m.child,null,le),P.child=Sr(P,null,Ye,le)):bi(m,P,Ye,le),P.memoizedState=K.state,ne&&nu(P,B,!0),P.child}function al(m){var P=m.stateNode;P.pendingContext?pl(m,P.pendingContext,P.pendingContext!==P.context):P.context&&pl(m,P.context,!1),Jo(m,P.containerInfo)}function Al(m,P,B,K,ne){return Ae(),je(ne),P.flags|=256,bi(m,P,B,K),P.child}var aa={dehydrated:null,treeContext:null,retryLane:0};function mu(m){return{baseLanes:m,cachePool:null,transitions:null}}function cf(m,P,B){var K=P.pendingProps,ne=Wr.current,le=!1,xe=(P.flags&128)!==0,Ye;if((Ye=xe)||(Ye=m!==null&&m.memoizedState===null?!1:(ne&2)!==0),Ye?(le=!0,P.flags&=-129):(m===null||m.memoizedState!==null)&&(ne|=1),Ar(Wr,ne&1),m===null)return Ko(P),m=P.memoizedState,m!==null&&(m=m.dehydrated,m!==null)?((P.mode&1)===0?P.lanes=1:Vt(m)?P.lanes=8:P.lanes=1073741824,null):(xe=K.children,m=K.fallback,le?(K=P.mode,le=P.child,xe={mode:"hidden",children:xe},(K&1)===0&&le!==null?(le.childLanes=0,le.pendingProps=xe):le=Cc(xe,K,0,null),m=va(m,K,B,null),le.return=P,m.return=P,le.sibling=m,P.child=le,P.child.memoizedState=mu(B),P.memoizedState=aa,m):Yu(P,xe));if(ne=m.memoizedState,ne!==null&&(Ye=ne.dehydrated,Ye!==null))return Gf(m,P,xe,K,Ye,ne,B);if(le){le=K.fallback,xe=P.mode,ne=m.child,Ye=ne.sibling;var ut={mode:"hidden",children:K.children};return(xe&1)===0&&P.child!==ne?(K=P.child,K.childLanes=0,K.pendingProps=ut,P.deletions=null):(K=Eu(ne,ut),K.subtreeFlags=ne.subtreeFlags&14680064),Ye!==null?le=Eu(Ye,le):(le=va(le,xe,B,null),le.flags|=2),le.return=P,K.return=P,K.sibling=le,P.child=K,K=le,le=P.child,xe=m.child.memoizedState,xe=xe===null?mu(B):{baseLanes:xe.baseLanes|B,cachePool:null,transitions:xe.transitions},le.memoizedState=xe,le.childLanes=m.childLanes&~B,P.memoizedState=aa,K}return le=m.child,m=le.sibling,K=Eu(le,{mode:"visible",children:K.children}),(P.mode&1)===0&&(K.lanes=B),K.return=P,K.sibling=null,m!==null&&(B=P.deletions,B===null?(P.deletions=[m],P.flags|=16):B.push(m)),P.child=K,P.memoizedState=null,K}function Yu(m,P){return P=Cc({mode:"visible",children:P},m.mode,0,null),P.return=m,m.child=P}function is(m,P,B,K){return K!==null&&je(K),Sr(P,m.child,null,B),m=Yu(P,P.pendingProps.children),m.flags|=2,P.memoizedState=null,m}function Gf(m,P,B,K,ne,le,xe){if(B)return P.flags&256?(P.flags&=-257,K=na(Error(o(422))),is(m,P,xe,K)):P.memoizedState!==null?(P.child=m.child,P.flags|=128,null):(le=K.fallback,ne=P.mode,K=Cc({mode:"visible",children:K.children},ne,0,null),le=va(le,ne,xe,null),le.flags|=2,K.return=P,le.return=P,K.sibling=le,P.child=K,(P.mode&1)!==0&&Sr(P,m.child,null,xe),P.child.memoizedState=mu(xe),P.memoizedState=aa,le);if((P.mode&1)===0)return is(m,P,xe,null);if(Vt(ne))return K=er(ne).digest,le=Error(o(419)),K=na(le,K,void 0),is(m,P,xe,K);if(B=(xe&m.childLanes)!==0,ui||B){if(K=Qr,K!==null){switch(xe&-xe){case 4:ne=2;break;case 16:ne=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:ne=32;break;case 536870912:ne=268435456;break;default:ne=0}ne=(ne&(K.suspendedLanes|xe))!==0?0:ne,ne!==0&&ne!==le.retryLane&&(le.retryLane=ne,ra(m,ne),la(K,m,ne,-1))}return Ja(),K=na(Error(o(421))),is(m,P,xe,K)}return Dt(ne)?(P.flags|=128,P.child=m.child,P=Rp.bind(null,m),_r(ne,P),null):(m=le.treeContext,Le&&(gi=Wn(ne),$n=P,Jr=!0,qa=null,Qs=!1,m!==null&&(wn[Fi++]=ea,wn[Fi++]=ta,wn[Fi++]=_n,ea=m.id,ta=m.overflow,_n=P)),P=Yu(P,K.children),P.flags|=4096,P)}function as(m,P,B){m.lanes|=P;var K=m.alternate;K!==null&&(K.lanes|=P),Zo(m.return,P,B)}function Cl(m,P,B,K,ne){var le=m.memoizedState;le===null?m.memoizedState={isBackwards:P,rendering:null,renderingStartTime:0,last:K,tail:B,tailMode:ne}:(le.isBackwards=P,le.rendering=null,le.renderingStartTime=0,le.last=K,le.tail=B,le.tailMode=ne)}function I(m,P,B){var K=P.pendingProps,ne=K.revealOrder,le=K.tail;if(bi(m,P,K.children,B),K=Wr.current,(K&2)!==0)K=K&1|2,P.flags|=128;else{if(m!==null&&(m.flags&128)!==0)e:for(m=P.child;m!==null;){if(m.tag===13)m.memoizedState!==null&&as(m,B,P);else if(m.tag===19)as(m,B,P);else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===P)break e;for(;m.sibling===null;){if(m.return===null||m.return===P)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}K&=1}if(Ar(Wr,K),(P.mode&1)===0)P.memoizedState=null;else switch(ne){case"forwards":for(B=P.child,ne=null;B!==null;)m=B.alternate,m!==null&&fo(m)===null&&(ne=B),B=B.sibling;B=ne,B===null?(ne=P.child,P.child=null):(ne=B.sibling,B.sibling=null),Cl(P,!1,ne,B,le);break;case"backwards":for(B=null,ne=P.child,P.child=null;ne!==null;){if(m=ne.alternate,m!==null&&fo(m)===null){P.child=ne;break}m=ne.sibling,ne.sibling=B,B=ne,ne=m}Cl(P,!0,B,null,le);break;case"together":Cl(P,!1,null,null,void 0);break;default:P.memoizedState=null}return P.child}function H(m,P){(P.mode&1)===0&&m!==null&&(m.alternate=null,P.alternate=null,P.flags|=2)}function re(m,P,B){if(m!==null&&(P.dependencies=m.dependencies),Ts|=P.lanes,(B&P.childLanes)===0)return null;if(m!==null&&P.child!==m.child)throw Error(o(153));if(P.child!==null){for(m=P.child,B=Eu(m,m.pendingProps),P.child=B,B.return=P;m.sibling!==null;)m=m.sibling,B=B.sibling=Eu(m,m.pendingProps),B.return=P;B.sibling=null}return P.child}function oe(m,P,B){switch(P.tag){case 3:al(P),Ae();break;case 5:qi(P);break;case 1:ii(P.type)&&Wo(P);break;case 4:Jo(P,P.stateNode.containerInfo);break;case 10:xa(P,P.type._context,P.memoizedProps.value);break;case 13:var K=P.memoizedState;if(K!==null)return K.dehydrated!==null?(Ar(Wr,Wr.current&1),P.flags|=128,null):(B&P.child.childLanes)!==0?cf(m,P,B):(Ar(Wr,Wr.current&1),m=re(m,P,B),m!==null?m.sibling:null);Ar(Wr,Wr.current&1);break;case 19:if(K=(B&P.childLanes)!==0,(m.flags&128)!==0){if(K)return I(m,P,B);P.flags|=128}var ne=P.memoizedState;if(ne!==null&&(ne.rendering=null,ne.tail=null,ne.lastEffect=null),Ar(Wr,Wr.current),K)break;return null;case 22:case 23:return P.lanes=0,Kr(m,P,B)}return re(m,P,B)}function ue(m){m.flags|=4}function pe(m,P){if(m!==null&&m.child===P.child)return!0;if((P.flags&16)!==0)return!1;for(m=P.child;m!==null;){if((m.flags&12854)!==0||(m.subtreeFlags&12854)!==0)return!1;m=m.sibling}return!0}var ve,be,_e,Pe;if(de)ve=function(m,P){for(var B=P.child;B!==null;){if(B.tag===5||B.tag===6)z(m,B.stateNode);else if(B.tag!==4&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===P)break;for(;B.sibling===null;){if(B.return===null||B.return===P)return;B=B.return}B.sibling.return=B.return,B=B.sibling}},be=function(){},_e=function(m,P,B,K,ne){if(m=m.memoizedProps,m!==K){var le=P.stateNode,xe=mi(Bi.current);B=Y(le,B,m,K,ne,xe),(P.updateQueue=B)&&ue(P)}},Pe=function(m,P,B,K){B!==K&&ue(P)};else if(Oe){ve=function(m,P,B,K){for(var ne=P.child;ne!==null;){if(ne.tag===5){var le=ne.stateNode;B&&K&&(le=He(le,ne.type,ne.memoizedProps,ne)),z(m,le)}else if(ne.tag===6)le=ne.stateNode,B&&K&&(le=wt(le,ne.memoizedProps,ne)),z(m,le);else if(ne.tag!==4){if(ne.tag===22&&ne.memoizedState!==null)le=ne.child,le!==null&&(le.return=ne),ve(m,ne,!0,!0);else if(ne.child!==null){ne.child.return=ne,ne=ne.child;continue}}if(ne===P)break;for(;ne.sibling===null;){if(ne.return===null||ne.return===P)return;ne=ne.return}ne.sibling.return=ne.return,ne=ne.sibling}};var Fe=function(m,P,B,K){for(var ne=P.child;ne!==null;){if(ne.tag===5){var le=ne.stateNode;B&&K&&(le=He(le,ne.type,ne.memoizedProps,ne)),nt(m,le)}else if(ne.tag===6)le=ne.stateNode,B&&K&&(le=wt(le,ne.memoizedProps,ne)),nt(m,le);else if(ne.tag!==4){if(ne.tag===22&&ne.memoizedState!==null)le=ne.child,le!==null&&(le.return=ne),Fe(m,ne,!0,!0);else if(ne.child!==null){ne.child.return=ne,ne=ne.child;continue}}if(ne===P)break;for(;ne.sibling===null;){if(ne.return===null||ne.return===P)return;ne=ne.return}ne.sibling.return=ne.return,ne=ne.sibling}};be=function(m,P){var B=P.stateNode;if(!pe(m,P)){m=B.containerInfo;var K=kt(m);Fe(K,P,!1,!1),B.pendingChildren=K,ue(P),We(m,K)}},_e=function(m,P,B,K,ne){var le=m.stateNode,xe=m.memoizedProps;if((m=pe(m,P))&&xe===K)P.stateNode=le;else{var Ye=P.stateNode,ut=mi(Bi.current),Lt=null;xe!==K&&(Lt=Y(Ye,B,xe,K,ne,ut)),m&&Lt===null?P.stateNode=le:(le=Xt(le,Lt,B,xe,K,P,m,Ye),D(le,B,K,ne,ut)&&ue(P),P.stateNode=le,m?ue(P):ve(le,P,!1,!1))}},Pe=function(m,P,B,K){B!==K?(m=mi(Co.current),B=mi(Bi.current),P.stateNode=J(K,m,B,P),ue(P)):P.stateNode=m.stateNode}}else be=function(){},_e=function(){},Pe=function(){};function Ze(m,P){if(!Jr)switch(m.tailMode){case"hidden":P=m.tail;for(var B=null;P!==null;)P.alternate!==null&&(B=P),P=P.sibling;B===null?m.tail=null:B.sibling=null;break;case"collapsed":B=m.tail;for(var K=null;B!==null;)B.alternate!==null&&(K=B),B=B.sibling;K===null?P||m.tail===null?m.tail=null:m.tail.sibling=null:K.sibling=null}}function $e(m){var P=m.alternate!==null&&m.alternate.child===m.child,B=0,K=0;if(P)for(var ne=m.child;ne!==null;)B|=ne.lanes|ne.childLanes,K|=ne.subtreeFlags&14680064,K|=ne.flags&14680064,ne.return=m,ne=ne.sibling;else for(ne=m.child;ne!==null;)B|=ne.lanes|ne.childLanes,K|=ne.subtreeFlags,K|=ne.flags,ne.return=m,ne=ne.sibling;return m.subtreeFlags|=K,m.childLanes=B,P}function Ge(m,P,B){var K=P.pendingProps;switch(Zs(P),P.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(P),null;case 1:return ii(P.type)&&Ri(),$e(P),null;case 3:return B=P.stateNode,li(),Xr(Ti),Xr(pi),ko(),B.pendingContext&&(B.context=B.pendingContext,B.pendingContext=null),(m===null||m.child===null)&&(X(P)?ue(P):m===null||m.memoizedState.isDehydrated&&(P.flags&256)===0||(P.flags|=1024,qa!==null&&(Ku(qa),qa=null))),be(m,P),$e(P),null;case 5:es(P),B=mi(Co.current);var ne=P.type;if(m!==null&&P.stateNode!=null)_e(m,P,ne,K,B),m.ref!==P.ref&&(P.flags|=512,P.flags|=2097152);else{if(!K){if(P.stateNode===null)throw Error(o(166));return $e(P),null}if(m=mi(Bi.current),X(P)){if(!Le)throw Error(o(175));m=sn(P.stateNode,P.type,P.memoizedProps,B,m,P,!Qs),P.updateQueue=m,m!==null&&ue(P)}else{var le=U(ne,K,B,m,P);ve(le,P,!1,!1),P.stateNode=le,D(le,ne,K,B,m)&&ue(P)}P.ref!==null&&(P.flags|=512,P.flags|=2097152)}return $e(P),null;case 6:if(m&&P.stateNode!=null)Pe(m,P,m.memoizedProps,K);else{if(typeof K!="string"&&P.stateNode===null)throw Error(o(166));if(m=mi(Co.current),B=mi(Bi.current),X(P)){if(!Le)throw Error(o(176));if(m=P.stateNode,B=P.memoizedProps,(K=Li(m,B,P,!Qs))&&(ne=$n,ne!==null))switch(ne.tag){case 3:mc(ne.stateNode.containerInfo,m,B,(ne.mode&1)!==0);break;case 5:Mn(ne.type,ne.memoizedProps,ne.stateNode,m,B,(ne.mode&1)!==0)}K&&ue(P)}else P.stateNode=J(K,m,B,P)}return $e(P),null;case 13:if(Xr(Wr),K=P.memoizedState,m===null||m.memoizedState!==null&&m.memoizedState.dehydrated!==null){if(Jr&&gi!==null&&(P.mode&1)!==0&&(P.flags&128)===0)fe(),Ae(),P.flags|=98560,ne=!1;else if(ne=X(P),K!==null&&K.dehydrated!==null){if(m===null){if(!ne)throw Error(o(318));if(!Le)throw Error(o(344));if(ne=P.memoizedState,ne=ne!==null?ne.dehydrated:null,!ne)throw Error(o(317));wi(ne,P)}else Ae(),(P.flags&128)===0&&(P.memoizedState=null),P.flags|=4;$e(P),ne=!1}else qa!==null&&(Ku(qa),qa=null),ne=!0;if(!ne)return P.flags&65536?P:null}return(P.flags&128)!==0?(P.lanes=B,P):(B=K!==null,B!==(m!==null&&m.memoizedState!==null)&&B&&(P.child.flags|=8192,(P.mode&1)!==0&&(m===null||(Wr.current&1)!==0?fn===0&&(fn=3):Ja())),P.updateQueue!==null&&(P.flags|=4),$e(P),null);case 4:return li(),be(m,P),m===null&&Se(P.stateNode.containerInfo),$e(P),null;case 10:return Ea(P.type._context),$e(P),null;case 17:return ii(P.type)&&Ri(),$e(P),null;case 19:if(Xr(Wr),ne=P.memoizedState,ne===null)return $e(P),null;if(K=(P.flags&128)!==0,le=ne.rendering,le===null)if(K)Ze(ne,!1);else{if(fn!==0||m!==null&&(m.flags&128)!==0)for(m=P.child;m!==null;){if(le=fo(m),le!==null){for(P.flags|=128,Ze(ne,!1),m=le.updateQueue,m!==null&&(P.updateQueue=m,P.flags|=4),P.subtreeFlags=0,m=B,B=P.child;B!==null;)K=B,ne=m,K.flags&=14680066,le=K.alternate,le===null?(K.childLanes=0,K.lanes=ne,K.child=null,K.subtreeFlags=0,K.memoizedProps=null,K.memoizedState=null,K.updateQueue=null,K.dependencies=null,K.stateNode=null):(K.childLanes=le.childLanes,K.lanes=le.lanes,K.child=le.child,K.subtreeFlags=0,K.deletions=null,K.memoizedProps=le.memoizedProps,K.memoizedState=le.memoizedState,K.updateQueue=le.updateQueue,K.type=le.type,ne=le.dependencies,K.dependencies=ne===null?null:{lanes:ne.lanes,firstContext:ne.firstContext}),B=B.sibling;return Ar(Wr,Wr.current&1|2),P.child}m=m.sibling}ne.tail!==null&&In()>_u&&(P.flags|=128,K=!0,Ze(ne,!1),P.lanes=4194304)}else{if(!K)if(m=fo(le),m!==null){if(P.flags|=128,K=!0,m=m.updateQueue,m!==null&&(P.updateQueue=m,P.flags|=4),Ze(ne,!0),ne.tail===null&&ne.tailMode==="hidden"&&!le.alternate&&!Jr)return $e(P),null}else 2*In()-ne.renderingStartTime>_u&&B!==1073741824&&(P.flags|=128,K=!0,Ze(ne,!1),P.lanes=4194304);ne.isBackwards?(le.sibling=P.child,P.child=le):(m=ne.last,m!==null?m.sibling=le:P.child=le,ne.last=le)}return ne.tail!==null?(P=ne.tail,ne.rendering=P,ne.tail=P.sibling,ne.renderingStartTime=In(),P.sibling=null,m=Wr.current,Ar(Wr,K?m&1|2:m&1),P):($e(P),null);case 22:case 23:return xu(),B=P.memoizedState!==null,m!==null&&m.memoizedState!==null!==B&&(P.flags|=8192),B&&(P.mode&1)!==0?(ei&1073741824)!==0&&($e(P),de&&P.subtreeFlags&6&&(P.flags|=8192)):$e(P),null;case 24:return null;case 25:return null}throw Error(o(156,P.tag))}function bt(m,P){switch(Zs(P),P.tag){case 1:return ii(P.type)&&Ri(),m=P.flags,m&65536?(P.flags=m&-65537|128,P):null;case 3:return li(),Xr(Ti),Xr(pi),ko(),m=P.flags,(m&65536)!==0&&(m&128)===0?(P.flags=m&-65537|128,P):null;case 5:return es(P),null;case 13:if(Xr(Wr),m=P.memoizedState,m!==null&&m.dehydrated!==null){if(P.alternate===null)throw Error(o(340));Ae()}return m=P.flags,m&65536?(P.flags=m&-65537|128,P):null;case 19:return Xr(Wr),null;case 4:return li(),null;case 10:return Ea(P.type._context),null;case 22:case 23:return xu(),null;case 24:return null;default:return null}}var lt=!1,Me=!1,qe=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function ht(m,P){var B=m.ref;if(B!==null)if(typeof B=="function")try{B(null)}catch(K){Vn(m,P,K)}else B.current=null}function gt(m,P,B){try{B()}catch(K){Vn(m,P,K)}}var qt=!1;function jt(m,P){for(te(m.containerInfo),Ue=P;Ue!==null;)if(m=Ue,P=m.child,(m.subtreeFlags&1028)!==0&&P!==null)P.return=m,Ue=P;else for(;Ue!==null;){m=Ue;try{var B=m.alternate;if((m.flags&1024)!==0)switch(m.tag){case 0:case 11:case 15:break;case 1:if(B!==null){var K=B.memoizedProps,ne=B.memoizedState,le=m.stateNode,xe=le.getSnapshotBeforeUpdate(m.elementType===m.type?K:Wa(m.type,K),ne);le.__reactInternalSnapshotBeforeUpdate=xe}break;case 3:de&&Jt(m.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ye){Vn(m,m.return,Ye)}if(P=m.sibling,P!==null){P.return=m.return,Ue=P;break}Ue=m.return}return B=qt,qt=!1,B}function ar(m,P,B){var K=P.updateQueue;if(K=K!==null?K.lastEffect:null,K!==null){var ne=K=K.next;do{if((ne.tag&m)===m){var le=ne.destroy;ne.destroy=void 0,le!==void 0&>(P,B,le)}ne=ne.next}while(ne!==K)}}function Mt(m,P){if(P=P.updateQueue,P=P!==null?P.lastEffect:null,P!==null){var B=P=P.next;do{if((B.tag&m)===m){var K=B.create;B.destroy=K()}B=B.next}while(B!==P)}}function Ir(m){var P=m.ref;if(P!==null){var B=m.stateNode;switch(m.tag){case 5:m=V(B);break;default:m=B}typeof P=="function"?P(m):P.current=m}}function Dr(m){var P=m.alternate;P!==null&&(m.alternate=null,Dr(P)),m.child=null,m.deletions=null,m.sibling=null,m.tag===5&&(P=m.stateNode,P!==null&&Je(P)),m.stateNode=null,m.return=null,m.dependencies=null,m.memoizedProps=null,m.memoizedState=null,m.pendingProps=null,m.stateNode=null,m.updateQueue=null}function Nr(m){return m.tag===5||m.tag===3||m.tag===4}function yr(m){e:for(;;){for(;m.sibling===null;){if(m.return===null||Nr(m.return))return null;m=m.return}for(m.sibling.return=m.return,m=m.sibling;m.tag!==5&&m.tag!==6&&m.tag!==18;){if(m.flags&2||m.child===null||m.tag===4)continue e;m.child.return=m,m=m.child}if(!(m.flags&2))return m.stateNode}}function Yr(m,P,B){var K=m.tag;if(K===5||K===6)m=m.stateNode,P?Yt(B,m,P):yt(B,m);else if(K!==4&&(m=m.child,m!==null))for(Yr(m,P,B),m=m.sibling;m!==null;)Yr(m,P,B),m=m.sibling}function Zr(m,P,B){var K=m.tag;if(K===5||K===6)m=m.stateNode,P?Pt(B,m,P):et(B,m);else if(K!==4&&(m=m.child,m!==null))for(Zr(m,P,B),m=m.sibling;m!==null;)Zr(m,P,B),m=m.sibling}var Zt=null,Br=!1;function Ln(m,P,B){for(B=B.child;B!==null;)Dn(m,P,B),B=B.sibling}function Dn(m,P,B){if(ai&&typeof ai.onCommitFiberUnmount=="function")try{ai.onCommitFiberUnmount(uo,B)}catch{}switch(B.tag){case 5:Me||ht(B,P);case 6:if(de){var K=Zt,ne=Br;Zt=null,Ln(m,P,B),Zt=K,Br=ne,Zt!==null&&(Br?Be(Zt,B.stateNode):Gt(Zt,B.stateNode))}else Ln(m,P,B);break;case 18:de&&Zt!==null&&(Br?Go(Zt,B.stateNode):_s(Zt,B.stateNode));break;case 4:de?(K=Zt,ne=Br,Zt=B.stateNode.containerInfo,Br=!0,Ln(m,P,B),Zt=K,Br=ne):(Oe&&(K=B.stateNode.containerInfo,ne=kt(K),it(K,ne)),Ln(m,P,B));break;case 0:case 11:case 14:case 15:if(!Me&&(K=B.updateQueue,K!==null&&(K=K.lastEffect,K!==null))){ne=K=K.next;do{var le=ne,xe=le.destroy;le=le.tag,xe!==void 0&&((le&2)!==0||(le&4)!==0)&>(B,P,xe),ne=ne.next}while(ne!==K)}Ln(m,P,B);break;case 1:if(!Me&&(ht(B,P),K=B.stateNode,typeof K.componentWillUnmount=="function"))try{K.props=B.memoizedProps,K.state=B.memoizedState,K.componentWillUnmount()}catch(Ye){Vn(B,P,Ye)}Ln(m,P,B);break;case 21:Ln(m,P,B);break;case 22:B.mode&1?(Me=(K=Me)||B.memoizedState!==null,Ln(m,P,B),Me=K):Ln(m,P,B);break;default:Ln(m,P,B)}}function ci(m){var P=m.updateQueue;if(P!==null){m.updateQueue=null;var B=m.stateNode;B===null&&(B=m.stateNode=new qe),P.forEach(function(K){var ne=d0.bind(null,m,K);B.has(K)||(B.add(K),K.then(ne,ne))})}}function xr(m,P){var B=P.deletions;if(B!==null)for(var K=0;K<B.length;K++){var ne=B[K];try{var le=m,xe=P;if(de){var Ye=xe;e:for(;Ye!==null;){switch(Ye.tag){case 5:Zt=Ye.stateNode,Br=!1;break e;case 3:Zt=Ye.stateNode.containerInfo,Br=!0;break e;case 4:Zt=Ye.stateNode.containerInfo,Br=!0;break e}Ye=Ye.return}if(Zt===null)throw Error(o(160));Dn(le,xe,ne),Zt=null,Br=!1}else Dn(le,xe,ne);var ut=ne.alternate;ut!==null&&(ut.return=null),ne.return=null}catch(Lt){Vn(ne,P,Lt)}}if(P.subtreeFlags&12854)for(P=P.child;P!==null;)Gi(P,m),P=P.sibling}function Gi(m,P){var B=m.alternate,K=m.flags;switch(m.tag){case 0:case 11:case 14:case 15:if(xr(P,m),En(m),K&4){try{ar(3,m,m.return),Mt(3,m)}catch(zt){Vn(m,m.return,zt)}try{ar(5,m,m.return)}catch(zt){Vn(m,m.return,zt)}}break;case 1:xr(P,m),En(m),K&512&&B!==null&&ht(B,B.return);break;case 5:if(xr(P,m),En(m),K&512&&B!==null&&ht(B,B.return),de){if(m.flags&32){var ne=m.stateNode;try{Ce(ne)}catch(zt){Vn(m,m.return,zt)}}if(K&4&&(ne=m.stateNode,ne!=null)){var le=m.memoizedProps;if(B=B!==null?B.memoizedProps:le,K=m.type,P=m.updateQueue,m.updateQueue=null,P!==null)try{Bt(ne,P,K,B,le,m)}catch(zt){Vn(m,m.return,zt)}}}break;case 6:if(xr(P,m),En(m),K&4&&de){if(m.stateNode===null)throw Error(o(162));ne=m.stateNode,le=m.memoizedProps,B=B!==null?B.memoizedProps:le;try{mt(ne,B,le)}catch(zt){Vn(m,m.return,zt)}}break;case 3:if(xr(P,m),En(m),K&4){if(de&&Le&&B!==null&&B.memoizedState.isDehydrated)try{_i(P.containerInfo)}catch(zt){Vn(m,m.return,zt)}if(Oe){ne=P.containerInfo,le=P.pendingChildren;try{it(ne,le)}catch(zt){Vn(m,m.return,zt)}}}break;case 4:if(xr(P,m),En(m),K&4&&Oe){le=m.stateNode,ne=le.containerInfo,le=le.pendingChildren;try{it(ne,le)}catch(zt){Vn(m,m.return,zt)}}break;case 13:xr(P,m),En(m),ne=m.child,ne.flags&8192&&(le=ne.memoizedState!==null,ne.stateNode.isHidden=le,!le||ne.alternate!==null&&ne.alternate.memoizedState!==null||(wu=In())),K&4&&ci(m);break;case 22:var xe=B!==null&&B.memoizedState!==null;if(m.mode&1?(Me=(B=Me)||xe,xr(P,m),Me=B):xr(P,m),En(m),K&8192){if(B=m.memoizedState!==null,(m.stateNode.isHidden=B)&&!xe&&(m.mode&1)!==0)for(Ue=m,K=m.child;K!==null;){for(P=Ue=K;Ue!==null;){xe=Ue;var Ye=xe.child;switch(xe.tag){case 0:case 11:case 14:case 15:ar(4,xe,xe.return);break;case 1:ht(xe,xe.return);var ut=xe.stateNode;if(typeof ut.componentWillUnmount=="function"){var Lt=xe,Kt=xe.return;try{var br=Lt;ut.props=br.memoizedProps,ut.state=br.memoizedState,ut.componentWillUnmount()}catch(zt){Vn(Lt,Kt,zt)}}break;case 5:ht(xe,xe.return);break;case 22:if(xe.memoizedState!==null){pa(P);continue}}Ye!==null?(Ye.return=xe,Ue=Ye):pa(P)}K=K.sibling}if(de){e:if(K=null,de)for(P=m;;){if(P.tag===5){if(K===null){K=P;try{ne=P.stateNode,B?ft(ne):Ot(P.stateNode,P.memoizedProps)}catch(zt){Vn(m,m.return,zt)}}}else if(P.tag===6){if(K===null)try{le=P.stateNode,B?Ct(le):Nt(le,P.memoizedProps)}catch(zt){Vn(m,m.return,zt)}}else if((P.tag!==22&&P.tag!==23||P.memoizedState===null||P===m)&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===m)break e;for(;P.sibling===null;){if(P.return===null||P.return===m)break e;K===P&&(K=null),P=P.return}K===P&&(K=null),P.sibling.return=P.return,P=P.sibling}}}break;case 19:xr(P,m),En(m),K&4&&ci(m);break;case 21:break;default:xr(P,m),En(m)}}function En(m){var P=m.flags;if(P&2){try{if(de){e:{for(var B=m.return;B!==null;){if(Nr(B)){var K=B;break e}B=B.return}throw Error(o(160))}switch(K.tag){case 5:var ne=K.stateNode;K.flags&32&&(Ce(ne),K.flags&=-33);var le=yr(m);Zr(m,le,ne);break;case 3:case 4:var xe=K.stateNode.containerInfo,Ye=yr(m);Yr(m,Ye,xe);break;default:throw Error(o(161))}}}catch(ut){Vn(m,m.return,ut)}m.flags&=-3}P&4096&&(m.flags&=-4097)}function Bn(m,P,B){Ue=m,fi(m)}function fi(m,P,B){for(var K=(m.mode&1)!==0;Ue!==null;){var ne=Ue,le=ne.child;if(ne.tag===22&&K){var xe=ne.memoizedState!==null||lt;if(!xe){var Ye=ne.alternate,ut=Ye!==null&&Ye.memoizedState!==null||Me;Ye=lt;var Lt=Me;if(lt=xe,(Me=ut)&&!Lt)for(Ue=ne;Ue!==null;)xe=Ue,ut=xe.child,xe.tag===22&&xe.memoizedState!==null?$a(ne):ut!==null?(ut.return=xe,Ue=ut):$a(ne);for(;le!==null;)Ue=le,fi(le),le=le.sibling;Ue=ne,lt=Ye,Me=Lt}Pi(m)}else(ne.subtreeFlags&8772)!==0&&le!==null?(le.return=ne,Ue=le):Pi(m)}}function Pi(m){for(;Ue!==null;){var P=Ue;if((P.flags&8772)!==0){var B=P.alternate;try{if((P.flags&8772)!==0)switch(P.tag){case 0:case 11:case 15:Me||Mt(5,P);break;case 1:var K=P.stateNode;if(P.flags&4&&!Me)if(B===null)K.componentDidMount();else{var ne=P.elementType===P.type?B.memoizedProps:Wa(P.type,B.memoizedProps);K.componentDidUpdate(ne,B.memoizedState,K.__reactInternalSnapshotBeforeUpdate)}var le=P.updateQueue;le!==null&&Hu(P,le,K);break;case 3:var xe=P.updateQueue;if(xe!==null){if(B=null,P.child!==null)switch(P.child.tag){case 5:B=V(P.child.stateNode);break;case 1:B=P.child.stateNode}Hu(P,xe,B)}break;case 5:var Ye=P.stateNode;B===null&&P.flags&4&&ct(Ye,P.type,P.memoizedProps,P);break;case 6:break;case 4:break;case 12:break;case 13:if(Le&&P.memoizedState===null){var ut=P.alternate;if(ut!==null){var Lt=ut.memoizedState;if(Lt!==null){var Kt=Lt.dehydrated;Kt!==null&&ao(Kt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Me||P.flags&512&&Ir(P)}catch(br){Vn(P,P.return,br)}}if(P===m){Ue=null;break}if(B=P.sibling,B!==null){B.return=P.return,Ue=B;break}Ue=P.return}}function pa(m){for(;Ue!==null;){var P=Ue;if(P===m){Ue=null;break}var B=P.sibling;if(B!==null){B.return=P.return,Ue=B;break}Ue=P.return}}function $a(m){for(;Ue!==null;){var P=Ue;try{switch(P.tag){case 0:case 11:case 15:var B=P.return;try{Mt(4,P)}catch(ut){Vn(P,B,ut)}break;case 1:var K=P.stateNode;if(typeof K.componentDidMount=="function"){var ne=P.return;try{K.componentDidMount()}catch(ut){Vn(P,ne,ut)}}var le=P.return;try{Ir(P)}catch(ut){Vn(P,le,ut)}break;case 5:var xe=P.return;try{Ir(P)}catch(ut){Vn(P,xe,ut)}}}catch(ut){Vn(P,P.return,ut)}if(P===m){Ue=null;break}var Ye=P.sibling;if(Ye!==null){Ye.return=P.return,Ue=Ye;break}Ue=P.return}}var yn=0,qn=1,oa=2,Do=3,vo=4;if(typeof Symbol=="function"&&Symbol.for){var jr=Symbol.for;yn=jr("selector.component"),qn=jr("selector.has_pseudo_class"),oa=jr("selector.role"),Do=jr("selector.test_id"),vo=jr("selector.text")}function mo(m){var P=ke(m);if(P!=null){if(typeof P.memoizedProps["data-testname"]!="string")throw Error(o(364));return P}if(m=Te(m),m===null)throw Error(o(362));return m.stateNode.current}function yu(m,P){switch(P.$$typeof){case yn:if(m.type===P.value)return!0;break;case qn:e:{P=P.value,m=[m,0];for(var B=0;B<m.length;){var K=m[B++],ne=m[B++],le=P[ne];if(K.tag!==5||!Ie(K)){for(;le!=null&&yu(K,le);)ne++,le=P[ne];if(ne===P.length){P=!0;break e}else for(K=K.child;K!==null;)m.push(K,ne),K=K.sibling}}P=!1}return P;case oa:if(m.tag===5&&Xe(m.stateNode,P.value))return!0;break;case vo:if((m.tag===5||m.tag===6)&&(m=Re(m),m!==null&&0<=m.indexOf(P.value)))return!0;break;case Do:if(m.tag===5&&(m=m.memoizedProps["data-testname"],typeof m=="string"&&m.toLowerCase()===P.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function Xu(m){switch(m.$$typeof){case yn:return"<"+(N(m.value)||"Unknown")+">";case qn:return":has("+(Xu(m)||"")+")";case oa:return'[role="'+m.value+'"]';case vo:return'"'+m.value+'"';case Do:return'[data-testname="'+m.value+'"]';default:throw Error(o(365))}}function Ya(m,P){var B=[];m=[m,0];for(var K=0;K<m.length;){var ne=m[K++],le=m[K++],xe=P[le];if(ne.tag!==5||!Ie(ne)){for(;xe!=null&&yu(ne,xe);)le++,xe=P[le];if(le===P.length)B.push(ne);else for(ne=ne.child;ne!==null;)m.push(ne,le),ne=ne.sibling}}return B}function Oa(m,P){if(!Ee)throw Error(o(363));m=mo(m),m=Ya(m,P),P=[],m=Array.from(m);for(var B=0;B<m.length;){var K=m[B++];if(K.tag===5)Ie(K)||P.push(K.stateNode);else for(K=K.child;K!==null;)m.push(K),K=K.sibling}return P}var kl=Math.ceil,ga=s.ReactCurrentDispatcher,Bo=s.ReactCurrentOwner,vn=s.ReactCurrentBatchConfig,vr=0,Qr=null,Pn=null,Nn=0,ei=0,qo=di(0),fn=0,bu=null,Ts=0,hn=0,Xa=0,Ll=null,sa=null,wu=0,_u=1/0,Oi=null;function nn(){_u=In()+500}var zn=!1,Un=null,Ka=null,yo=!1,Za=null,xc=0,Hn=0,Su=null,ol=-1,Qa=0;function bn(){return(vr&6)!==0?In():ol!==-1?ol:ol=In()}function hi(m){return(m.mode&1)===0?1:(vr&2)!==0&&Nn!==0?Nn&-Nn:Qe.transition!==null?(Qa===0&&(Qa=Es()),Qa):(m=It,m!==0?m:ye())}function la(m,P,B,K){if(50<Hn)throw Hn=0,Su=null,Error(o(185));gn(m,B,K),((vr&2)===0||m!==Qr)&&(m===Qr&&((vr&2)===0&&(hn|=B),fn===4&&os(m,Nn)),Wi(m,K),B===1&&vr===0&&(P.mode&1)===0&&(nn(),Ao&&oi()))}function Wi(m,P){var B=m.callbackNode;$o(m,P);var K=$s(m,m===Qr?Nn:0);if(K===0)B!==null&&Oo(B),m.callbackNode=null,m.callbackPriority=0;else if(P=K&-K,m.callbackPriority!==P){if(B!=null&&Oo(B),P===1)m.tag===0?Uu(ff.bind(null,m)):gl(ff.bind(null,m)),we?me(function(){(vr&6)===0&&oi()}):lo(Ks,oi),B=null;else{switch(Ys(K)){case 1:B=Ks;break;case 4:B=au;break;case 16:B=ou;break;case 536870912:B=of;break;default:B=ou}B=Uh(B,Rs.bind(null,m))}m.callbackPriority=P,m.callbackNode=B}}function Rs(m,P){if(ol=-1,Qa=0,(vr&6)!==0)throw Error(o(327));var B=m.callbackNode;if(Tl()&&m.callbackNode!==B)return null;var K=$s(m,m===Qr?Nn:0);if(K===0)return null;if((K&30)!==0||(K&m.expiredLanes)!==0||P)P=ls(m,K);else{P=K;var ne=vr;vr|=2;var le=ss();(Qr!==m||Nn!==P)&&(Oi=null,nn(),zo(m,P));do try{Oc();break}catch(Ye){Aa(m,Ye)}while(!0);za(),ga.current=le,vr=ne,Pn!==null?P=0:(Qr=null,Nn=0,P=fn)}if(P!==0){if(P===2&&(ne=xs(m),ne!==0&&(K=ne,P=Ec(m,ne))),P===1)throw B=bu,zo(m,0),os(m,K),Wi(m,In()),B;if(P===6)os(m,K);else{if(ne=m.current.alternate,(K&30)===0&&!Wf(ne)&&(P=ls(m,K),P===2&&(le=xs(m),le!==0&&(K=le,P=Ec(m,le))),P===1))throw B=bu,zo(m,0),os(m,K),Wi(m,In()),B;switch(m.finishedWork=ne,m.finishedLanes=K,P){case 0:case 1:throw Error(o(345));case 2:us(m,sa,Oi);break;case 3:if(os(m,K),(K&130023424)===K&&(P=wu+500-In(),10<P)){if($s(m,0)!==0)break;if(ne=m.suspendedLanes,(ne&K)!==K){bn(),m.pingedLanes|=m.suspendedLanes≠break}m.timeoutHandle=Z(us.bind(null,m,sa,Oi),P);break}us(m,sa,Oi);break;case 4:if(os(m,K),(K&4194240)===K)break;for(P=m.eventTimes,ne=-1;0<K;){var xe=31-ha(K);le=1<<xe,xe=P[xe],xe>ne&&(ne=xe),K&=~le}if(K=ne,K=In()-K,K=(120>K?120:480>K?480:1080>K?1080:1920>K?1920:3e3>K?3e3:4320>K?4320:1960*kl(K/1960))-K,10<K){m.timeoutHandle=Z(us.bind(null,m,sa,Oi),K);break}us(m,sa,Oi);break;case 5:us(m,sa,Oi);break;default:throw Error(o(329))}}}return Wi(m,In()),m.callbackNode===B?Rs.bind(null,m):null}function Ec(m,P){var B=Ll;return m.current.memoizedState.isDehydrated&&(zo(m,P).flags|=256),m=ls(m,P),m!==2&&(P=sa,sa=B,P!==null&&Ku(P)),m}function Ku(m){sa===null?sa=m:sa.push.apply(sa,m)}function Wf(m){for(var P=m;;){if(P.flags&16384){var B=P.updateQueue;if(B!==null&&(B=B.stores,B!==null))for(var K=0;K<B.length;K++){var ne=B[K],le=ne.getSnapshot;ne=ne.value;try{if(!Mi(le(),ne))return!1}catch{return!1}}}if(B=P.child,P.subtreeFlags&16384&&B!==null)B.return=P,P=B;else{if(P===m)break;for(;P.sibling===null;){if(P.return===null||P.return===m)return!0;P=P.return}P.sibling.return=P.return,P=P.sibling}}return!0}function os(m,P){for(P&=~Xa,P&=~hn,m.suspendedLanes|=P,m.pingedLanes&=~P,m=m.expirationTimes;0<P;){var B=31-ha(P),K=1<<B;m[B]=-1,P&=~K}}function ff(m){if((vr&6)!==0)throw Error(o(327));Tl();var P=$s(m,0);if((P&1)===0)return Wi(m,In()),null;var B=ls(m,P);if(m.tag!==0&&B===2){var K=xs(m);K!==0&&(P=K,B=Ec(m,K))}if(B===1)throw B=bu,zo(m,0),os(m,P),Wi(m,In()),B;if(B===6)throw Error(o(345));return m.finishedWork=m.current.alternate,m.finishedLanes=P,us(m,sa,Oi),Wi(m,In()),null}function Nl(m){Za!==null&&Za.tag===0&&(vr&6)===0&&Tl();var P=vr;vr|=1;var B=vn.transition,K=It;try{if(vn.transition=null,It=1,m)return m()}finally{It=K,vn.transition=B,vr=P,(vr&6)===0&&oi()}}function xu(){ei=qo.current,Xr(qo)}function zo(m,P){m.finishedWork=null,m.finishedLanes=0;var B=m.timeoutHandle;if(B!==se&&(m.timeoutHandle=se,ae(B)),Pn!==null)for(B=Pn.return;B!==null;){var K=B;switch(Zs(K),K.tag){case 1:K=K.type.childContextTypes,K!=null&&Ri();break;case 3:li(),Xr(Ti),Xr(pi),ko();break;case 5:es(K);break;case 4:li();break;case 13:Xr(Wr);break;case 19:Xr(Wr);break;case 10:Ea(K.type._context);break;case 22:case 23:xu()}B=B.return}if(Qr=m,Pn=m=Eu(m.current,null),Nn=ei=P,fn=0,bu=null,Xa=hn=Ts=0,sa=Ll=null,Ua!==null){for(P=0;P<Ua.length;P++)if(B=Ua[P],K=B.interleaved,K!==null){B.interleaved=null;var ne=K.next,le=B.pending;if(le!==null){var xe=le.next;le.next=ne,K.next=xe}B.pending=K}Ua=null}return m}function Aa(m,P){do{var B=Pn;try{if(za(),Mr.current=Ls,ts){for(var K=Lr.memoizedState;K!==null;){var ne=K.queue;ne!==null&&(ne.pending=null),K=K.next}ts=!1}if(Yn=0,Xn=xn=Lr=null,No=!1,To=0,Bo.current=null,B===null||B.return===null){fn=1,bu=P,Pn=null;break}e:{var le=m,xe=B.return,Ye=B,ut=P;if(P=Nn,Ye.flags|=32768,ut!==null&&typeof ut=="object"&&typeof ut.then=="function"){var Lt=ut,Kt=Ye,br=Kt.tag;if((Kt.mode&1)===0&&(br===0||br===11||br===15)){var zt=Kt.alternate;zt?(Kt.updateQueue=zt.updateQueue,Kt.memoizedState=zt.memoizedState,Kt.lanes=zt.lanes):(Kt.updateQueue=null,Kt.memoizedState=null)}var Tn=Vf(xe);if(Tn!==null){Tn.flags&=-257,Ns(Tn,xe,Ye,le,P),Tn.mode&1&&Hf(le,Lt,P),P=Tn,ut=Lt;var mn=P.updateQueue;if(mn===null){var eo=new Set;eo.add(ut),P.updateQueue=eo}else mn.add(ut);break e}else{if((P&1)===0){Hf(le,Lt,P),Ja();break e}ut=Error(o(426))}}else if(Jr&&Ye.mode&1){var sl=Vf(xe);if(sl!==null){(sl.flags&65536)===0&&(sl.flags|=256),Ns(sl,xe,Ye,le,P),je(Hi(ut,Ye));break e}}le=ut=Hi(ut,Ye),fn!==4&&(fn=2),Ll===null?Ll=[le]:Ll.push(le),le=xe;do{switch(le.tag){case 3:le.flags|=65536,P&=-P,le.lanes|=P;var ot=Vi(le,ut,P);tl(le,ot);break e;case 1:Ye=ut;var Ke=le.type,pt=le.stateNode;if((le.flags&128)===0&&(typeof Ke.getDerivedStateFromError=="function"||pt!==null&&typeof pt.componentDidCatch=="function"&&(Ka===null||!Ka.has(pt)))){le.flags|=65536,P&=-P,le.lanes|=P;var Ut=da(le,Ye,P);tl(le,Ut);break e}}le=le.return}while(le!==null)}Zu(B)}catch(ur){P=ur,Pn===B&&B!==null&&(Pn=B=B.return);continue}break}while(!0)}function ss(){var m=ga.current;return ga.current=Ls,m===null?Ls:m}function Ja(){(fn===0||fn===3||fn===2)&&(fn=4),Qr===null||(Ts&268435455)===0&&(hn&268435455)===0||os(Qr,Nn)}function ls(m,P){var B=vr;vr|=2;var K=ss();(Qr!==m||Nn!==P)&&(Oi=null,zo(m,P));do try{Pc();break}catch(ne){Aa(m,ne)}while(!0);if(za(),vr=B,ga.current=K,Pn!==null)throw Error(o(261));return Qr=null,Nn=0,fn}function Pc(){for(;Pn!==null;)hf(Pn)}function Oc(){for(;Pn!==null&&!zu();)hf(Pn)}function hf(m){var P=Mp(m.alternate,m,ei);m.memoizedProps=m.pendingProps,P===null?Zu(m):Pn=P,Bo.current=null}function Zu(m){var P=m;do{var B=P.alternate;if(m=P.return,(P.flags&32768)===0){if(B=Ge(B,P,ei),B!==null){Pn=B;return}}else{if(B=bt(B,P),B!==null){B.flags&=32767,Pn=B;return}if(m!==null)m.flags|=32768,m.subtreeFlags=0,m.deletions=null;else{fn=6,Pn=null;return}}if(P=P.sibling,P!==null){Pn=P;return}Pn=P=m}while(P!==null);fn===0&&(fn=5)}function us(m,P,B){var K=It,ne=vn.transition;try{vn.transition=null,It=1,Lp(m,P,B,K)}finally{vn.transition=ne,It=K}return null}function Lp(m,P,B,K){do Tl();while(Za!==null);if((vr&6)!==0)throw Error(o(327));B=m.finishedWork;var ne=m.finishedLanes;if(B===null)return null;if(m.finishedWork=null,m.finishedLanes=0,B===m.current)throw Error(o(177));m.callbackNode=null,m.callbackPriority=0;var le=B.lanes|B.childLanes;if(Yo(m,le),m===Qr&&(Pn=Qr=null,Nn=0),(B.subtreeFlags&2064)===0&&(B.flags&2064)===0||yo||(yo=!0,Uh(ou,function(){return Tl(),null})),le=(B.flags&15990)!==0,(B.subtreeFlags&15990)!==0||le){le=vn.transition,vn.transition=null;var xe=It;It=1;var Ye=vr;vr|=4,Bo.current=null,jt(m,B),Gi(B,m),W(m.containerInfo),m.current=B,Bn(B),Xs(),vr=Ye,It=xe,vn.transition=le}else m.current=B;if(yo&&(yo=!1,Za=m,xc=ne),le=m.pendingLanes,le===0&&(Ka=null),Fa(B.stateNode),Wi(m,In()),P!==null)for(K=m.onRecoverableError,B=0;B<P.length;B++)ne=P[B],K(ne.value,{componentStack:ne.stack,digest:ne.digest});if(zn)throw zn=!1,m=Un,Un=null,m;return(xc&1)!==0&&m.tag!==0&&Tl(),le=m.pendingLanes,(le&1)!==0?m===Su?Hn++:(Hn=0,Su=m):Hn=0,oi(),null}function Tl(){if(Za!==null){var m=Ys(xc),P=vn.transition,B=It;try{if(vn.transition=null,It=16>m?16:m,Za===null)var K=!1;else{if(m=Za,Za=null,xc=0,(vr&6)!==0)throw Error(o(331));var ne=vr;for(vr|=4,Ue=m.current;Ue!==null;){var le=Ue,xe=le.child;if((Ue.flags&16)!==0){var Ye=le.deletions;if(Ye!==null){for(var ut=0;ut<Ye.length;ut++){var Lt=Ye[ut];for(Ue=Lt;Ue!==null;){var Kt=Ue;switch(Kt.tag){case 0:case 11:case 15:ar(8,Kt,le)}var br=Kt.child;if(br!==null)br.return=Kt,Ue=br;else for(;Ue!==null;){Kt=Ue;var zt=Kt.sibling,Tn=Kt.return;if(Dr(Kt),Kt===Lt){Ue=null;break}if(zt!==null){zt.return=Tn,Ue=zt;break}Ue=Tn}}}var mn=le.alternate;if(mn!==null){var eo=mn.child;if(eo!==null){mn.child=null;do{var sl=eo.sibling;eo.sibling=null,eo=sl}while(eo!==null)}}Ue=le}}if((le.subtreeFlags&2064)!==0&&xe!==null)xe.return=le,Ue=xe;else e:for(;Ue!==null;){if(le=Ue,(le.flags&2048)!==0)switch(le.tag){case 0:case 11:case 15:ar(9,le,le.return)}var ot=le.sibling;if(ot!==null){ot.return=le.return,Ue=ot;break e}Ue=le.return}}var Ke=m.current;for(Ue=Ke;Ue!==null;){xe=Ue;var pt=xe.child;if((xe.subtreeFlags&2064)!==0&&pt!==null)pt.return=xe,Ue=pt;else e:for(xe=Ke;Ue!==null;){if(Ye=Ue,(Ye.flags&2048)!==0)try{switch(Ye.tag){case 0:case 11:case 15:Mt(9,Ye)}}catch(ur){Vn(Ye,Ye.return,ur)}if(Ye===xe){Ue=null;break e}var Ut=Ye.sibling;if(Ut!==null){Ut.return=Ye.return,Ue=Ut;break e}Ue=Ye.return}}if(vr=ne,oi(),ai&&typeof ai.onPostCommitFiberRoot=="function")try{ai.onPostCommitFiberRoot(uo,m)}catch{}K=!0}return K}finally{It=B,vn.transition=P}}return!1}function zh(m,P,B){P=Hi(B,P),P=Vi(m,P,1),m=Ha(m,P,1),P=bn(),m!==null&&(gn(m,1,P),Wi(m,P))}function Vn(m,P,B){if(m.tag===3)zh(m,m,B);else for(;P!==null;){if(P.tag===3){zh(P,m,B);break}else if(P.tag===1){var K=P.stateNode;if(typeof P.type.getDerivedStateFromError=="function"||typeof K.componentDidCatch=="function"&&(Ka===null||!Ka.has(K))){m=Hi(B,m),m=da(P,m,1),P=Ha(P,m,1),m=bn(),P!==null&&(gn(P,1,m),Wi(P,m));break}}P=P.return}}function Np(m,P,B){var K=m.pingCache;K!==null&&K.delete(P),P=bn(),m.pingedLanes|=m.suspendedLanes&B,Qr===m&&(Nn&B)===B&&(fn===4||fn===3&&(Nn&130023424)===Nn&&500>In()-wu?zo(m,0):Xa|=B),Wi(m,P)}function Tp(m,P){P===0&&((m.mode&1)===0?P=1:(P=Ss,Ss<<=1,(Ss&130023424)===0&&(Ss=4194304)));var B=bn();m=ra(m,P),m!==null&&(gn(m,P,B),Wi(m,B))}function Rp(m){var P=m.memoizedState,B=0;P!==null&&(B=P.retryLane),Tp(m,B)}function d0(m,P){var B=0;switch(m.tag){case 13:var K=m.stateNode,ne=m.memoizedState;ne!==null&&(B=ne.retryLane);break;case 19:K=m.stateNode;break;default:throw Error(o(314))}K!==null&&K.delete(P),Tp(m,B)}var Mp;Mp=function(m,P,B){if(m!==null)if(m.memoizedProps!==P.pendingProps||Ti.current)ui=!0;else{if((m.lanes&B)===0&&(P.flags&128)===0)return ui=!1,oe(m,P,B);ui=(m.flags&131072)!==0}else ui=!1,Jr&&(P.flags&1048576)!==0&&lu(P,Sa,P.index);switch(P.lanes=0,P.tag){case 2:var K=P.type;H(m,P),m=P.pendingProps;var ne=Ia(P,pi.current);Qo(P,B),ne=Ro(null,P,K,m,ne,B);var le=Mo();return P.flags|=1,typeof ne=="object"&&ne!==null&&typeof ne.render=="function"&&ne.$$typeof===void 0?(P.tag=1,P.memoizedState=null,P.updateQueue=null,ii(K)?(le=!0,Wo(P)):le=!1,P.memoizedState=ne.state!==null&&ne.state!==void 0?ne.state:null,el(P),ne.updater=$u,P.stateNode=ne,ne._reactInternals=P,Ui(P,K,m,B),P=ia(null,P,K,!0,le,B)):(P.tag=0,Jr&&le&&As(P),bi(null,P,ne,B),P=P.child),P;case 16:K=P.elementType;e:{switch(H(m,P),m=P.pendingProps,ne=K._init,K=ne(K._payload),P.type=K,ne=P.tag=p0(K),m=Wa(K,m),ne){case 0:P=ns(null,P,K,m,B);break e;case 1:P=Ei(null,P,K,m,B);break e;case 11:P=Sc(null,P,K,m,B);break e;case 14:P=rs(null,P,K,Wa(K.type,m),B);break e}throw Error(o(306,K,""))}return P;case 0:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:Wa(K,ne),ns(m,P,K,ne,B);case 1:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:Wa(K,ne),Ei(m,P,K,ne,B);case 3:e:{if(al(P),m===null)throw Error(o(387));K=P.pendingProps,le=P.memoizedState,ne=le.element,wl(m,P),co(P,K,null,B);var xe=P.memoizedState;if(K=xe.element,Le&&le.isDehydrated)if(le={element:K,isDehydrated:!1,cache:xe.cache,pendingSuspenseBoundaries:xe.pendingSuspenseBoundaries,transitions:xe.transitions},P.updateQueue.baseState=le,P.memoizedState=le,P.flags&256){ne=Hi(Error(o(423)),P),P=Al(m,P,K,B,ne);break e}else if(K!==ne){ne=Hi(Error(o(424)),P),P=Al(m,P,K,B,ne);break e}else for(Le&&(gi=on(P.stateNode.containerInfo),$n=P,Jr=!0,qa=null,Qs=!1),B=Cn(P,null,K,B),P.child=B;B;)B.flags=B.flags&-3|4096,B=B.sibling;else{if(Ae(),K===ne){P=re(m,P,B);break e}bi(m,P,K,B)}P=P.child}return P;case 5:return qi(P),m===null&&Ko(P),K=P.type,ne=P.pendingProps,le=m!==null?m.memoizedProps:null,xe=ne.children,Q(K,ne)?xe=null:le!==null&&Q(K,le)&&(P.flags|=32),rn(m,P),bi(m,P,xe,B),P.child;case 6:return m===null&&Ko(P),null;case 13:return cf(m,P,B);case 4:return Jo(P,P.stateNode.containerInfo),K=P.pendingProps,m===null?P.child=Sr(P,null,K,B):bi(m,P,K,B),P.child;case 11:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:Wa(K,ne),Sc(m,P,K,ne,B);case 7:return bi(m,P,P.pendingProps,B),P.child;case 8:return bi(m,P,P.pendingProps.children,B),P.child;case 12:return bi(m,P,P.pendingProps.children,B),P.child;case 10:e:{if(K=P.type._context,ne=P.pendingProps,le=P.memoizedProps,xe=ne.value,xa(P,K,xe),le!==null)if(Mi(le.value,xe)){if(le.children===ne.children&&!Ti.current){P=re(m,P,B);break e}}else for(le=P.child,le!==null&&(le.return=P);le!==null;){var Ye=le.dependencies;if(Ye!==null){xe=le.child;for(var ut=Ye.firstContext;ut!==null;){if(ut.context===K){if(le.tag===1){ut=Pa(-1,B&-B),ut.tag=2;var Lt=le.updateQueue;if(Lt!==null){Lt=Lt.shared;var Kt=Lt.pending;Kt===null?ut.next=ut:(ut.next=Kt.next,Kt.next=ut),Lt.pending=ut}}le.lanes|=B,ut=le.alternate,ut!==null&&(ut.lanes|=B),Zo(le.return,B,P),Ye.lanes|=B;break}ut=ut.next}}else if(le.tag===10)xe=le.type===P.type?null:le.child;else if(le.tag===18){if(xe=le.return,xe===null)throw Error(o(341));xe.lanes|=B,Ye=xe.alternate,Ye!==null&&(Ye.lanes|=B),Zo(xe,B,P),xe=le.sibling}else xe=le.child;if(xe!==null)xe.return=le;else for(xe=le;xe!==null;){if(xe===P){xe=null;break}if(le=xe.sibling,le!==null){le.return=xe.return,xe=le;break}xe=xe.return}le=xe}bi(m,P,ne.children,B),P=P.child}return P;case 9:return ne=P.type,K=P.pendingProps.children,Qo(P,B),ne=Di(ne),K=K(ne),P.flags|=1,bi(m,P,K,B),P.child;case 14:return K=P.type,ne=Wa(K,P.pendingProps),ne=Wa(K.type,ne),rs(m,P,K,ne,B);case 15:return go(m,P,P.type,P.pendingProps,B);case 17:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:Wa(K,ne),H(m,P),P.tag=1,ii(K)?(m=!0,Wo(P)):m=!1,Qo(P,B),Uf(P,K,ne),Ui(P,K,ne,B),ia(null,P,K,!0,m,B);case 19:return I(m,P,B);case 22:return Kr(m,P,B)}throw Error(o(156,P.tag))};function Uh(m,P){return lo(m,P)}function Ip(m,P,B,K){this.tag=m,this.key=B,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=P,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=K,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Uo(m,P,B,K){return new Ip(m,P,B,K)}function Ac(m){return m=m.prototype,!(!m||!m.isReactComponent)}function p0(m){if(typeof m=="function")return Ac(m)?1:0;if(m!=null){if(m=m.$$typeof,m===S)return 11;if(m===v)return 14}return 2}function Eu(m,P){var B=m.alternate;return B===null?(B=Uo(m.tag,P,m.key,m.mode),B.elementType=m.elementType,B.type=m.type,B.stateNode=m.stateNode,B.alternate=m,m.alternate=B):(B.pendingProps=P,B.type=m.type,B.flags=0,B.subtreeFlags=0,B.deletions=null),B.flags=m.flags&14680064,B.childLanes=m.childLanes,B.lanes=m.lanes,B.child=m.child,B.memoizedProps=m.memoizedProps,B.memoizedState=m.memoizedState,B.updateQueue=m.updateQueue,P=m.dependencies,B.dependencies=P===null?null:{lanes:P.lanes,firstContext:P.firstContext},B.sibling=m.sibling,B.index=m.index,B.ref=m.ref,B}function $f(m,P,B,K,ne,le){var xe=2;if(K=m,typeof m=="function")Ac(m)&&(xe=1);else if(typeof m=="string")xe=5;else e:switch(m){case d:return va(B.children,ne,le,P);case p:xe=8,ne|=8;break;case y:return m=Uo(12,B,P,ne|2),m.elementType=y,m.lanes=le,m;case w:return m=Uo(13,B,P,ne),m.elementType=w,m.lanes=le,m;case x:return m=Uo(19,B,P,ne),m.elementType=x,m.lanes=le,m;case E:return Cc(B,ne,le,P);default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case f:xe=10;break e;case _:xe=9;break e;case S:xe=11;break e;case v:xe=14;break e;case g:xe=16,K=null;break e}throw Error(o(130,m==null?m:typeof m,""))}return P=Uo(xe,B,P,ne),P.elementType=m,P.type=K,P.lanes=le,P}function va(m,P,B,K){return m=Uo(7,m,K,P),m.lanes=B,m}function Cc(m,P,B,K){return m=Uo(22,m,K,P),m.elementType=E,m.lanes=B,m.stateNode={isHidden:!1},m}function kc(m,P,B){return m=Uo(6,m,null,P),m.lanes=B,m}function Yf(m,P,B){return P=Uo(4,m.children!==null?m.children:[],m.key,P),P.lanes=B,P.stateNode={containerInfo:m.containerInfo,pendingChildren:null,implementation:m.implementation},P}function jp(m,P,B,K,ne){this.tag=P,this.containerInfo=m,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=se,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ps(0),this.expirationTimes=Ps(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ps(0),this.identifierPrefix=K,this.onRecoverableError=ne,Le&&(this.mutableSourceEagerHydrationData=null)}function Hh(m,P,B,K,ne,le,xe,Ye,ut){return m=new jp(m,P,B,Ye,ut),P===1?(P=1,le===!0&&(P|=8)):P=0,le=Uo(3,null,null,P),m.current=le,le.stateNode=m,le.memoizedState={element:K,isDehydrated:B,cache:null,transitions:null,pendingSuspenseBoundaries:null},el(le),m}function Xf(m){if(!m)return ln;m=m._reactInternals;e:{if(F(m)!==m||m.tag!==1)throw Error(o(170));var P=m;do{switch(P.tag){case 3:P=P.stateNode.context;break e;case 1:if(ii(P.type)){P=P.stateNode.__reactInternalMemoizedMergedChildContext;break e}}P=P.return}while(P!==null);throw Error(o(171))}if(m.tag===1){var B=m.type;if(ii(B))return fa(m,B,P)}return P}function Qu(m){var P=m._reactInternals;if(P===void 0)throw typeof m.render=="function"?Error(o(188)):(m=Object.keys(m).join(","),Error(o(268,m)));return m=C(P),m===null?null:m.stateNode}function Kf(m,P){if(m=m.memoizedState,m!==null&&m.dehydrated!==null){var B=m.retryLane;m.retryLane=B!==0&&B<P?B:P}}function Lc(m,P){Kf(m,P),(m=m.alternate)&&Kf(m,P)}function g0(m){return m=C(m),m===null?null:m.stateNode}function Fp(){return null}return t.attemptContinuousHydration=function(m){if(m.tag===13){var P=ra(m,134217728);if(P!==null){var B=bn();la(P,m,134217728,B)}Lc(m,134217728)}},t.attemptDiscreteHydration=function(m){if(m.tag===13){var P=ra(m,1);if(P!==null){var B=bn();la(P,m,1,B)}Lc(m,1)}},t.attemptHydrationAtCurrentPriority=function(m){if(m.tag===13){var P=hi(m),B=ra(m,P);if(B!==null){var K=bn();la(B,m,P,K)}Lc(m,P)}},t.attemptSynchronousHydration=function(m){switch(m.tag){case 3:var P=m.stateNode;if(P.current.memoizedState.isDehydrated){var B=Ws(P.pendingLanes);B!==0&&(ja(P,B|1),Wi(P,In()),(vr&6)===0&&(nn(),oi()))}break;case 13:Nl(function(){var K=ra(m,1);if(K!==null){var ne=bn();la(K,m,1,ne)}}),Lc(m,1)}},t.batchedUpdates=function(m,P){var B=vr;vr|=1;try{return m(P)}finally{vr=B,vr===0&&(nn(),Ao&&oi())}},t.createComponentSelector=function(m){return{$$typeof:yn,value:m}},t.createContainer=function(m,P,B,K,ne,le,xe){return Hh(m,P,!1,null,B,K,ne,le,xe)},t.createHasPseudoClassSelector=function(m){return{$$typeof:qn,value:m}},t.createHydrationContainer=function(m,P,B,K,ne,le,xe,Ye,ut){return m=Hh(B,K,!0,m,ne,le,xe,Ye,ut),m.context=Xf(null),B=m.current,K=bn(),ne=hi(B),le=Pa(K,ne),le.callback=P??null,Ha(B,le,ne),m.current.lanes=ne,gn(m,ne,K),Wi(m,K),m},t.createPortal=function(m,P,B){var K=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:K==null?null:""+K,children:m,containerInfo:P,implementation:B}},t.createRoleSelector=function(m){return{$$typeof:oa,value:m}},t.createTestNameSelector=function(m){return{$$typeof:Do,value:m}},t.createTextSelector=function(m){return{$$typeof:vo,value:m}},t.deferredUpdates=function(m){var P=It,B=vn.transition;try{return vn.transition=null,It=16,m()}finally{It=P,vn.transition=B}},t.discreteUpdates=function(m,P,B,K,ne){var le=It,xe=vn.transition;try{return vn.transition=null,It=1,m(P,B,K,ne)}finally{It=le,vn.transition=xe,vr===0&&nn()}},t.findAllNodes=Oa,t.findBoundingRects=function(m,P){if(!Ee)throw Error(o(363));P=Oa(m,P),m=[];for(var B=0;B<P.length;B++)m.push(he(P[B]));for(P=m.length-1;0<P;P--){B=m[P];for(var K=B.x,ne=K+B.width,le=B.y,xe=le+B.height,Ye=P-1;0<=Ye;Ye--)if(P!==Ye){var ut=m[Ye],Lt=ut.x,Kt=Lt+ut.width,br=ut.y,zt=br+ut.height;if(K>=Lt&&le>=br&&ne<=Kt&&xe<=zt){m.splice(P,1);break}else if(K!==Lt||B.width!==ut.width||zt<le||br>xe){if(!(le!==br||B.height!==ut.height||Kt<K||Lt>ne)){Lt>K&&(ut.width+=Lt-K,ut.x=K),Kt<ne&&(ut.width=ne-Lt),m.splice(P,1);break}}else{br>le&&(ut.height+=br-le,ut.y=le),zt<xe&&(ut.height=xe-br),m.splice(P,1);break}}}return m},t.findHostInstance=Qu,t.findHostInstanceWithNoPortals=function(m){return m=O(m),m=m!==null?k(m):null,m===null?null:m.stateNode},t.findHostInstanceWithWarning=function(m){return Qu(m)},t.flushControlled=function(m){var P=vr;vr|=1;var B=vn.transition,K=It;try{vn.transition=null,It=1,m()}finally{It=K,vn.transition=B,vr=P,vr===0&&(nn(),oi())}},t.flushPassiveEffects=Tl,t.flushSync=Nl,t.focusWithin=function(m,P){if(!Ee)throw Error(o(363));for(m=mo(m),P=Ya(m,P),P=Array.from(P),m=0;m<P.length;){var B=P[m++];if(!Ie(B)){if(B.tag===5&&rt(B.stateNode))return!0;for(B=B.child;B!==null;)P.push(B),B=B.sibling}}return!1},t.getCurrentUpdatePriority=function(){return It},t.getFindAllNodesFailureDescription=function(m,P){if(!Ee)throw Error(o(363));var B=0,K=[];m=[mo(m),0];for(var ne=0;ne<m.length;){var le=m[ne++],xe=m[ne++],Ye=P[xe];if((le.tag!==5||!Ie(le))&&(yu(le,Ye)&&(K.push(Xu(Ye)),xe++,xe>B&&(B=xe)),xe<P.length))for(le=le.child;le!==null;)m.push(le,xe),le=le.sibling}if(B<P.length){for(m=[];B<P.length;B++)m.push(Xu(P[B]));return`findAllNodes was able to match part of the selector:
|
|
58
|
+
`+(K.join(" > ")+`
|
|
59
|
+
|
|
60
|
+
No matching component was found for:
|
|
61
|
+
`)+m.join(" > ")}return null},t.getPublicRootInstance=function(m){if(m=m.current,!m.child)return null;switch(m.child.tag){case 5:return V(m.child.stateNode);default:return m.child.stateNode}},t.injectIntoDevTools=function(m){if(m={bundleType:m.bundleType,version:m.version,rendererPackageName:m.rendererPackageName,rendererConfig:m.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:g0,findFiberByHostInstance:m.findFiberByHostInstance||Fp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")m=!1;else{var P=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(P.isDisabled||!P.supportsFiber)m=!0;else{try{uo=P.inject(m),ai=P}catch{}m=!!P.checkDCE}}return m},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(m,P,B,K){if(!Ee)throw Error(o(363));m=Oa(m,P);var ne=vt(m,B,K).disconnect;return{disconnect:function(){ne()}}},t.registerMutableSourceForHydration=function(m,P){var B=P._getVersion;B=B(P._source),m.mutableSourceEagerHydrationData==null?m.mutableSourceEagerHydrationData=[P,B]:m.mutableSourceEagerHydrationData.push(P,B)},t.runWithPriority=function(m,P){var B=It;try{return It=m,P()}finally{It=B}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(m,P,B,K){var ne=P.current,le=bn(),xe=hi(ne);return B=Xf(B),P.context===null?P.context=B:P.pendingContext=B,P=Pa(le,xe),P.payload={element:m},K=K===void 0?null:K,K!==null&&(P.callback=K),m=Ha(ne,P,xe),m!==null&&(la(m,ne,xe,le),Si(m,ne,xe)),xe},t}),sg}var W5;function Ex(){return W5||(W5=1,og.exports=xx()),og.exports}var Px=Ex();const Ox=yp(Px);var lg={exports:{}},Bc={};/**
|
|
62
|
+
* @license React
|
|
63
|
+
* react-reconciler-constants.production.min.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/var $5;function Ax(){return $5||($5=1,Bc.ConcurrentRoot=1,Bc.ContinuousEventPriority=4,Bc.DefaultEventPriority=16,Bc.DiscreteEventPriority=1,Bc.IdleEventPriority=536870912,Bc.LegacyRoot=0),Bc}var Y5;function Cx(){return Y5||(Y5=1,lg.exports=Ax()),lg.exports}var k6=Cx(),kx=Tr();const X5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let K5=!1,Z5=!1;const fm=".react-konva-event";let L6=!1;function Lx(e){L6=e}const Nx=`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
|
+
`,Tx=`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
|
+
`,Rx={};function t0(e,r,t=Rx){if(!K5&&"zIndex"in r&&(console.warn(Tx),K5=!0),!Z5&&r.draggable){var n=r.x!==void 0||r.y!==void 0,a=r.onDragEnd||r.onDragMove;n&&!a&&(console.warn(Nx),Z5=!0)}for(var i in t)if(!X5[i]){var o=i.slice(0,2)==="on",s=t[i]!==r[i];if(o&&s){var c=i.substr(2).toLowerCase();c.substr(0,7)==="content"&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),e.off(c,t[i])}var u=!r.hasOwnProperty(i);u&&e.setAttr(i,void 0)}var d=L6||r._useStrictMode,p={},y=!1;const f={};for(var i in r)if(!X5[i]){var o=i.slice(0,2)==="on",_=t[i]!==r[i];if(o&&_){var c=i.substr(2).toLowerCase();c.substr(0,7)==="content"&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),r[i]&&(f[c]=r[i])}!o&&(r[i]!==t[i]||d&&r[i]!==e.getAttr(i))&&(y=!0,p[i]=r[i])}y&&(e.setAttrs(p),tf(e));for(var c in f)e.on(c+fm,f[c])}function tf(e){if(!kx.Konva.autoDrawEnabled){var r=e.getLayer()||e.getStage();r&&r.batchDraw()}}var ug=B2();const N6={},Mx={};dp.Node.prototype._applyProps=t0;function Ix(e,r){if(typeof r=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${r}`);return}e.add(r),tf(e)}function jx(e,r,t){let n=dp[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=dp.Group);const a={},i={};for(var o in r){var s=o.slice(0,2)==="on";s?i[o]=r[o]:a[o]=r[o]}const c=new n(a);return t0(c,i),c}function Fx(e,r,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Dx(e,r,t){return!1}function Bx(e){return e}function qx(){return null}function zx(){return null}function Ux(e,r,t,n){return Mx}function Hx(){}function Vx(e){}function Gx(e,r){return!1}function Wx(){return N6}function $x(){return N6}const Yx=setTimeout,Xx=clearTimeout,Kx=-1;function Zx(e,r){return!1}const Qx=!1,Jx=!0,eE=!0;function tE(e,r){r.parent===e?r.moveToTop():e.add(r),tf(e)}function rE(e,r){r.parent===e?r.moveToTop():e.add(r),tf(e)}function T6(e,r,t){r._remove(),e.add(r),r.setZIndex(t.getZIndex()),tf(e)}function nE(e,r,t){T6(e,r,t)}function iE(e,r){r.destroy(),r.off(fm),tf(e)}function aE(e,r){r.destroy(),r.off(fm),tf(e)}function oE(e,r,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function sE(e,r,t){}function lE(e,r,t,n,a){t0(e,a,n)}function uE(e){e.hide(),tf(e)}function cE(e){}function fE(e,r){(r.visible==null||r.visible)&&e.show()}function hE(e,r){}function dE(e){}function pE(){}const gE=()=>k6.DefaultEventPriority,vE=Object.freeze(Object.defineProperty({__proto__:null,appendChild:tE,appendChildToContainer:rE,appendInitialChild:Ix,cancelTimeout:Xx,clearContainer:dE,commitMount:sE,commitTextUpdate:oE,commitUpdate:lE,createInstance:jx,createTextInstance:Fx,detachDeletedInstance:pE,finalizeInitialChildren:Dx,getChildHostContext:$x,getCurrentEventPriority:gE,getPublicInstance:Bx,getRootHostContext:Wx,hideInstance:uE,hideTextInstance:cE,idlePriority:ug.unstable_IdlePriority,insertBefore:T6,insertInContainerBefore:nE,isPrimaryRenderer:Qx,noTimeout:Kx,now:ug.unstable_now,prepareForCommit:qx,preparePortalMount:zx,prepareUpdate:Ux,removeChild:iE,removeChildFromContainer:aE,resetAfterCommit:Hx,resetTextContent:Vx,run:ug.unstable_runWithPriority,scheduleTimeout:Yx,shouldDeprioritizeSubtree:Gx,shouldSetTextContent:Zx,supportsMutation:eE,unhideInstance:fE,unhideTextInstance:hE,warnsIfNotActing:Jx},Symbol.toStringTag,{value:"Module"}));var mE=Object.defineProperty,yE=Object.defineProperties,bE=Object.getOwnPropertyDescriptors,Q5=Object.getOwnPropertySymbols,wE=Object.prototype.hasOwnProperty,_E=Object.prototype.propertyIsEnumerable,J5=(e,r,t)=>r in e?mE(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,eb=(e,r)=>{for(var t in r||(r={}))wE.call(r,t)&&J5(e,t,r[t]);if(Q5)for(var t of Q5(r))_E.call(r,t)&&J5(e,t,r[t]);return e},SE=(e,r)=>yE(e,bE(r)),tb,rb;typeof window<"u"&&((tb=window.document)!=null&&tb.createElement||((rb=window.navigator)==null?void 0:rb.product)==="ReactNative")?ri.useLayoutEffect:ri.useEffect;function R6(e,r,t){if(!e)return;if(t(e)===!0)return e;let n=e.child;for(;n;){const a=R6(n,r,t);if(a)return a;n=n.sibling}}function M6(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const nb=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=nb;return}return nb.apply(this,arguments)};const hm=M6(ri.createContext(null));class I6 extends ri.Component{render(){return ri.createElement(hm.Provider,{value:this._reactInternals},this.props.children)}}function xE(){const e=ri.useContext(hm);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const r=ri.useId();return ri.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const a=R6(n,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===r)return!0;o=o.next}});if(a)return a}},[e,r])}function EE(){const e=xE(),[r]=ri.useState(()=>new Map);r.clear();let t=e;for(;t;){if(t.type&&typeof t.type=="object"){const a=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;a&&a!==hm&&!r.has(a)&&r.set(a,ri.useContext(M6(a)))}t=t.return}return r}function j6(){const e=EE();return ri.useMemo(()=>Array.from(e.keys()).reduce((r,t)=>n=>ri.createElement(r,null,ri.createElement(t.Provider,SE(eb({},n),{value:e.get(t)}))),r=>ri.createElement(I6,eb({},r))),[e])}function PE(e){const r=Vr.useRef({});return Vr.useLayoutEffect(()=>{r.current=e}),Vr.useLayoutEffect(()=>()=>{r.current={}},[]),r.current}const OE=e=>{const r=Vr.useRef(),t=Vr.useRef(),n=Vr.useRef(),a=PE(e),i=j6(),o=s=>{const{forwardedRef:c}=e;c&&(typeof c=="function"?c(s):c.current=s)};return Vr.useLayoutEffect(()=>(t.current=new dp.Stage({width:e.width,height:e.height,container:r.current}),o(t.current),n.current=hh.createContainer(t.current,k6.LegacyRoot,!1,null),hh.updateContainer(Vr.createElement(i,{},e.children),n.current),()=>{dp.isBrowser&&(o(null),hh.updateContainer(null,n.current,null),t.current.destroy())}),[]),Vr.useLayoutEffect(()=>{o(t.current),t0(t.current,e,a),hh.updateContainer(Vr.createElement(i,{},e.children),n.current,null)}),Vr.createElement("div",{ref:r,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},AE="Layer",CE="FastLayer",M1="Group",kE="Label",LE="Rect",NE="Circle",TE="Ellipse",RE="Wedge",ME="Line",IE="Sprite",jE="Image",FE="Text",DE="TextPath",BE="Star",qE="Ring",zE="Arc",UE="Tag",HE="Path",VE="RegularPolygon",GE="Arrow",WE="Shape",$E="Transformer",hh=Ox(vE);hh.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Vr.version,rendererPackageName:"react-konva"});const YE=Vr.forwardRef((e,r)=>Vr.createElement(I6,{},Vr.createElement(OE,{...e,forwardedRef:r}))),XE=Lx,KE=Object.freeze(Object.defineProperty({__proto__:null,Arc:zE,Arrow:GE,Circle:NE,Ellipse:TE,FastLayer:CE,Group:M1,Image:jE,KonvaRenderer:hh,Label:kE,Layer:AE,Line:ME,Path:HE,Rect:LE,RegularPolygon:VE,Ring:qE,Shape:WE,Sprite:IE,Stage:YE,Star:BE,Tag:UE,Text:FE,TextPath:DE,Transformer:$E,Wedge:RE,useStrictMode:XE},Symbol.toStringTag,{value:"Module"})),Fu=Zc(KE);var cg,ib;function r0(){if(ib)return cg;ib=1;var e=ni();return cg=function(t,n,a){const i=e.useRef("loading"),o=e.useRef(),[s,c]=e.useState(0),u=e.useRef(),d=e.useRef(),p=e.useRef();return(u.current!==t||d.current!==n||p.current!==a)&&(i.current="loading",o.current=void 0,u.current=t,d.current=n,p.current=a),e.useLayoutEffect(function(){if(!t)return;var y=document.createElement("img");function f(){y.decode().catch(()=>{}).finally(()=>{i.current="loaded",o.current=y,c(Math.random())})}function _(){i.current="failed",o.current=void 0,c(Math.random())}return y.addEventListener("load",f),y.addEventListener("error",_),n&&(y.crossOrigin=n),a&&(y.referrerPolicy=a),y.src=t,function(){y.removeEventListener("load",f),y.removeEventListener("error",_)}},[t,n,a]),[o.current,i.current]},cg}var Dd={},Bd={},ZE=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t};const QE=e=>{const r=window.getComputedStyle(e).position;return!(r==="absolute"||r==="relative")};function F6(e=()=>{}){const r=Vr.useRef(e);return r.current=e,Vr.useCallback((...t)=>r.current.apply(null,t),[])}const JE=({children:e,groupProps:r,divProps:t,transform:n,transformFunc:a,parentNodeFunc:i})=>{const o=j6(),s=Vr.useRef(null),[c]=Vr.useState(()=>document.createElement("div")),u=Vr.useMemo(()=>gw.createRoot(c),[c]),d=n??!0,p=F6(()=>{if(d&&s.current){let w=s.current.getAbsoluteTransform().decompose();a&&(w=a(w)),c.style.position="absolute",c.style.zIndex="10",c.style.top="0px",c.style.left="0px",c.style.transform=`translate(${w.x}px, ${w.y}px) rotate(${w.rotation}deg) scaleX(${w.scaleX}) scaleY(${w.scaleY})`,c.style.transformOrigin="top left"}else c.style.position="",c.style.zIndex="",c.style.top="",c.style.left="",c.style.transform="",c.style.transformOrigin="";const y=t||{},{style:f}=y,_=ZE(y,["style"]);Object.assign(c.style,f),Object.assign(c,_)});return Vr.useLayoutEffect(()=>{var y;const f=s.current;if(!f)return;const _=i?i({stage:f.getStage()}):(y=f.getStage())===null||y===void 0?void 0:y.container();if(_)return _.appendChild(c),d&&QE(_)&&(_.style.position="relative"),f.on("absoluteTransformChange",p),p(),()=>{var S;f.off("absoluteTransformChange",p),(S=c.parentNode)===null||S===void 0||S.removeChild(c)}},[d,i]),Vr.useLayoutEffect(()=>{p()},[t,a]),Vr.useLayoutEffect(()=>{u.render(Vr.createElement(o,null,e))}),Vr.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),Vr.createElement(M1,Object.assign({ref:s},r))},eP=({selector:e,enabled:r,children:t})=>{const n=Vr.useRef(null),a=Vr.useRef(null),i=Vr.useRef(null),o=r??!0;return Vr.useLayoutEffect(()=>{if(!n.current||!a.current)return;i.current=a.current;const c=n.current.getStage().findOne(e);o&&c?a.current.moveTo(c):a.current.moveTo(n.current);const u=n.current.getLayer();if(u&&(u.batchDraw(),c)){const d=c.getLayer();if(!d)return;d.batchDraw()}},[e,o]),Vr.useEffect(()=>()=>{var s;(s=i.current)===null||s===void 0||s.destroy()},[]),Vr.createElement(M1,{name:"_outer_portal",ref:n},Vr.createElement(M1,{name:"_inner_portal",ref:a},t))};var tP=r0();const rP=yp(tP),nP=Object.freeze(Object.defineProperty({__proto__:null,Html:JE,Portal:eP,useEvent:F6,useImage:rP},Symbol.toStringTag,{value:"Module"})),Mh=Zc(nP);function iP(e,r){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(r))),e}function D6(e,r,t){const n=r-1,a=t[q6(n,t.length)];return a.marker!=="Z"?a:D6(e,n,t)}function B6(e,r,t){const n=r+1,a=t[q6(n,t.length)];return a.marker==="Z"?B6(e,n,t):a}function aP(e,r,t){let n=t[r-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(o,s){return o[s].marker==="M"?o[s]:a(o,s-1)},i=a(t,r);e.values.x=i.values.x,e.values.y=i.values.y}return e}function oP(e,r){const t=[];switch(e.toUpperCase()){case"M":for(let n=0;n<r.length;n+=2){let a;e===e.toUpperCase()?a=n===0?"M":"L":a=n===0?"m":"l",t.push({marker:a,values:{x:r[n],y:r[n+1]}})}break;case"L":for(let n=0;n<r.length;n+=2)t.push({marker:e,values:{x:r[n],y:r[n+1]}});break;case"H":for(let n=0;n<r.length;n++)t.push({marker:e,values:{x:r[n],y:0}});break;case"V":for(let n=0;n<r.length;n++)t.push({marker:e,values:{x:0,y:r[n]}});break;case"C":for(let n=0;n<r.length;n+=6)t.push({marker:e,values:{x1:r[n],y1:r[n+1],x2:r[n+2],y2:r[n+3],x:r[n+4],y:r[n+5]}});break;case"S":for(let n=0;n<r.length;n+=4)t.push({marker:e,values:{x2:r[n],y2:r[n+1],x:r[n+2],y:r[n+3]}});break;case"Q":for(let n=0;n<r.length;n+=4)t.push({marker:e,values:{x1:r[n],y1:r[n+1],x:r[n+2],y:r[n+3]}});break;case"T":for(let n=0;n<r.length;n+=2)t.push({marker:e,values:{x:r[n],y:r[n+1]}});break;case"A":for(let n=0;n<r.length;n+=7)t.push({marker:e,values:{radiusX:r[n],radiusY:r[n+1],rotation:r[n+2],largeArc:r[n+3],sweep:r[n+4],x:r[n+5],y:r[n+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function q6(e,r){return(e%r+r)%r}function sP(e,r,t){if(r!==0&&e.marker==="L"){let n=t[r-1];["x","y"].every(i=>Math.round(Math.abs(n.values[i]-e.values[i]))===0)&&(e.overlap=!0)}return e}function E2(e,r){const t=["x","y"].every(n=>Math.round(Math.abs(e[r].values[n]-e[0].values[n]))===0);e[r].marker==="L"&&t&&(e[r].overlap=!0,E2(e,r-1)),e[r].marker==="Z"&&E2(e,r-1)}function lP(e,r,t){const n=ob(e.values,t.values),a=ob(r.values,e.values);return Math.min(a,n)}function ab(e,r){return Math.atan2(r.x-e.x,r.y-e.y)}function ob(e,r){const t=e.x-r.x,n=e.y-r.y;return Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}function sb(e,r){return Math.sin(e)*r}function lb(e,r){return Math.cos(e)*r}function ub(e,r){const t=r/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?r:t}function uP(e,r){return r*Math.tan(e)}function cP(e,r){let t,n=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=ub(e/2,-r):(t=ub(e/2,r),n=1,t===1/0&&(t=r)),{offset:t,sweepFlag:n}}function fP(e){const r=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let n="";if(t.marker!=="Z"){const a=Object.keys(t.values);n=r.filter(i=>a.indexOf(i)!==-1).map(i=>t.values[i]).join()}return`${t.marker}${n}`}).join("").trim()}function z6(e){const r=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(r)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,a)=>{const i=e.substring(a.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:a.marker,index:a.index,chunk:i.length>0?i.substr(1,i.length-1):i}])},[]).reverse().flatMap(n=>{const a=n.chunk.match(t),i=a?a.map(parseFloat):[];return oP(n.marker,i)}).map(aP)}function U6(e,r,t){let n=[],a=[];return t&&e.forEach(i=>iP(i,t)),e.forEach(i=>{i.marker==="M"&&n.push([]),n[n.length-1].push(i)}),n.forEach(i=>{i.map(sP),E2(i,i.length-1);const o=i[i.length-1].marker=="Z";i.filter(s=>!s.overlap).map((s,c,u)=>{const p=D6(s,c,u),y=B6(s,c,u),f=ab(s.values,p.values),_=ab(s.values,y.values),S=_-f,w=S*(180/Math.PI),x=lP(s,p,y),v=Math.abs(uP(S/2,x/2)),g=Math.min(r,v),E=cP(S,g),b=E.offset,M=E.sweepFlag,N=(c==0||c==u.length-1)&&!o;switch(s.marker){case"M":case"L":const R=[s.values.x+sb(f,b),s.values.y+lb(f,b)],F=[s.values.x+sb(_,b),s.values.y+lb(_,b)];N?a.push({marker:s.marker,values:s.values}):a.push({marker:s.marker,values:{x:parseFloat(R[0].toFixed(3)),y:parseFloat(R[1].toFixed(3))}}),!N&&(y.marker==="L"||y.marker==="M")&&a.push({marker:"A",radius:g,values:{radiusX:parseFloat(g.toFixed(3)),radiusY:parseFloat(g.toFixed(3)),rotation:w,largeArc:0,sweep:M,x:parseFloat(F[0].toFixed(3)),y:parseFloat(F[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":a.push({marker:s.marker,values:s.values});break}})}),{path:fP(a),commands:a}}function hP(e,r,t){return U6([...z6(e)],r,t)}const dP=Object.freeze(Object.defineProperty({__proto__:null,parsePath:z6,roundCommands:U6,roundCorners:hP},Symbol.toStringTag,{value:"Module"})),pP=Zc(dP);var jl={},qd={},l1={},cb;function gP(){if(cb)return l1;cb=1;var e=e||{};e.stringify=function(){var r={"visit_linear-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return r.visit_gradient(t)},"visit_radial-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return r.visit_gradient(t)},visit_gradient:function(t){var n=r.visit(t.orientation);return n&&(n+=", "),t.type+"("+n+r.visit(t.colorStops)+")"},visit_shape:function(t){var n=t.value,a=r.visit(t.at),i=r.visit(t.style);return i&&(n+=" "+i),a&&(n+=" at "+a),n},"visit_default-radial":function(t){var n="",a=r.visit(t.at);return a&&(n+=a),n},"visit_extent-keyword":function(t){var n=t.value,a=r.visit(t.at);return a&&(n+=" at "+a),n},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return r.visit(t.value.x)+" "+r.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_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return r.visit_color(t.value,t)},visit_hex:function(t){return r.visit_color("#"+t.value,t)},visit_rgb:function(t){return r.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return r.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return r.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return r.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return r.visit_color("var("+t.value+")",t)},visit_color:function(t,n){var a=t,i=r.visit(n.length);return i&&(a+=" "+i),a},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var n="",a=t.length;return t.forEach(function(i,o){n+=r.visit(i),o<a-1&&(n+=", ")}),n},visit_object:function(t){return t.width&&t.height?r.visit(t.width)+" "+r.visit(t.height):""},visit:function(t){if(!t)return"";if(t instanceof Array)return r.visit_array(t);if(typeof t=="object"&&!t.type)return r.visit_object(t);if(t.type){var n=r["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return r.visit(t)}}();var e=e||{};return e.parse=function(){var r={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)|top (left|right)|bottom (left|right)|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/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},t="";function n(D){var Y=new Error(t+": "+D);throw Y.source=t,Y}function a(){var D=i();return t.length>0&&n("Invalid input not EOF"),D}function i(){return E(o)}function o(){return s("linear-gradient",r.linearGradient,u)||s("repeating-linear-gradient",r.repeatingLinearGradient,u)||s("radial-gradient",r.radialGradient,y)||s("repeating-radial-gradient",r.repeatingRadialGradient,y)}function s(D,Y,Q){return c(Y,function(J){var Z=Q();return Z&&(U(r.comma)||n("Missing comma before color stops")),{type:D,orientation:Z,colorStops:E(b)}})}function c(D,Y){var Q=U(D);if(Q){U(r.startCall)||n("Missing (");var J=Y(Q);return U(r.endCall)||n("Missing )"),J}}function u(){var D=d();if(D)return D;var Y=W("position-keyword",r.positionKeywords,1);return Y?{type:"directional",value:Y.value}:p()}function d(){return W("directional",r.sideOrCorner,1)}function p(){return W("angular",r.angleValue,1)||W("angular",r.radianValue,1)}function y(){var D,Y=f(),Q;return Y&&(D=[],D.push(Y),Q=t,U(r.comma)&&(Y=f(),Y?D.push(Y):t=Q)),D}function f(){var D=_()||S();if(D)D.at=x();else{var Y=w();if(Y){D=Y;var Q=x();Q&&(D.at=Q)}else{var J=x();if(J)D={type:"default-radial",at:J};else{var Z=v();Z&&(D={type:"default-radial",at:Z})}}}return D}function _(){var D=W("shape",/^(circle)/i,0);return D&&(D.style=te()||w()),D}function S(){var D=W("shape",/^(ellipse)/i,0);return D&&(D.style=v()||V()||w()),D}function w(){return W("extent-keyword",r.extentKeywords,1)}function x(){if(W("position",/^at/,0)){var D=v();return D||n("Missing positioning value"),D}}function v(){var D=g();if(D.x||D.y)return{type:"position",value:D}}function g(){return{x:V(),y:V()}}function E(D){var Y=D(),Q=[];if(Y)for(Q.push(Y);U(r.comma);)Y=D(),Y?Q.push(Y):n("One extra comma");return Q}function b(){var D=M();return D||n("Expected color definition"),D.length=V(),D}function M(){return R()||A()||C()||j()||F()||O()||N()}function N(){return W("literal",r.literalColor,0)}function R(){return W("hex",r.hexColor,1)}function F(){return c(r.rgbColor,function(){return{type:"rgb",value:E(T)}})}function j(){return c(r.rgbaColor,function(){return{type:"rgba",value:E(T)}})}function O(){return c(r.varColor,function(){return{type:"var",value:k()}})}function C(){return c(r.hslColor,function(){var D=U(r.percentageValue);D&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var Y=T();U(r.comma);var Q=U(r.percentageValue),J=Q?Q[1]:null;U(r.comma),Q=U(r.percentageValue);var Z=Q?Q[1]:null;return(!J||!Z)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[Y,J,Z]}})}function A(){return c(r.hslaColor,function(){var D=T();U(r.comma);var Y=U(r.percentageValue),Q=Y?Y[1]:null;U(r.comma),Y=U(r.percentageValue);var J=Y?Y[1]:null;U(r.comma);var Z=T();return(!Q||!J)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[D,Q,J,Z]}})}function k(){return U(r.variableName)[1]}function T(){return U(r.number)[1]}function V(){return W("%",r.percentageValue,1)||G()||$()||te()}function G(){return W("position-keyword",r.positionKeywords,1)}function $(){return c(r.calcValue,function(){for(var D=1,Y=0;D>0&&Y<t.length;){var Q=t.charAt(Y);Q==="("?D++:Q===")"&&D--,Y++}D>0&&n("Missing closing parenthesis in calc() expression");var J=t.substring(0,Y-1);return z(Y-1),{type:"calc",value:J}})}function te(){return W("px",r.pixelValue,1)||W("em",r.emValue,1)}function W(D,Y,Q){var J=U(Y);if(J)return{type:D,value:J[Q]}}function U(D){var Y,Q;return Q=/^[\n\r\t\s]+/.exec(t),Q&&z(Q[0].length),Y=D.exec(t),Y&&z(Y[0].length),Y}function z(D){t=t.substr(D)}return function(D){return t=D.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),a()}}(),l1.parse=e.parse,l1.stringify=e.stringify,l1}var fb;function dm(){return fb||(fb=1,function(e){var r=qd&&qd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=r(gP());e.isGradient=a=>a.indexOf("linear-gradient")>=0;const n=a=>a.type==="hex"?"#"+a.value:a.type==="literal"?a.value:`${a.type}(${a.value.join(",")})`;e.parseColor=a=>{if(!(0,e.isGradient)(a))return{rotation:0,stops:[{offset:0,color:a},{offset:1,color:a}]};const i=t.default.parse(a)[0];return{rotation:parseFloat(i.orientation.value),stops:i.colorStops.map((o,s)=>({color:n(o),offset:o.length?parseFloat(o.length.value)/100:s/(i.colorStops.length-1)}))}}}(qd)),qd}var hb;function Op(){return hb||(hb=1,function(e){var r,t=jl&&jl.__createBinding||(Object.create?function(u,d,p,y){y===void 0&&(y=p);var f=Object.getOwnPropertyDescriptor(d,p);f&&!("get"in f?!d.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(u,y,f)}:function(u,d,p,y){y===void 0&&(y=p),u[y]=d[p]}),n=jl&&jl.__setModuleDefault||(Object.create?function(u,d){Object.defineProperty(u,"default",{enumerable:!0,value:d})}:function(u,d){u.default=d}),a=jl&&jl.__importStar||(r=function(u){return r=Object.getOwnPropertyNames||function(d){var p=[];for(var y in d)Object.prototype.hasOwnProperty.call(d,y)&&(p[p.length]=y);return p},r(u)},function(u){if(u&&u.__esModule)return u;var d={};if(u!=null)for(var p=r(u),y=0;y<p.length;y++)p[y]!=="default"&&t(d,u,p[y]);return n(d,u),d}),i=jl&&jl.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const o=i(ni()),s=a(dm()),c=i(Hs());e.useColor=(u,d=u.fill,p="fill")=>o.default.useMemo(()=>{if(!s.isGradient(d))return{[p]:d};const{stops:y,rotation:f}=s.parseColor(d),_=u.a.width/2,S=u.a.height/2,w=(f%180+180)%180,x=w>45&&w<135?u.a.width:u.a.height,v=c.default.Util.degToRad(f)-Math.PI/2,g=[];return y.forEach(({offset:E,color:b})=>{g.push(E,b)}),p==="fill"?{fillLinearGradientStartPointX:_-x/2*Math.cos(v),fillLinearGradientStartPointY:S-x/2*Math.sin(v),fillLinearGradientColorStops:g,fillLinearGradientEndPointX:_+x/2*Math.cos(v),fillLinearGradientEndPointY:S+x/2*Math.sin(v),fill:y[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:_-x/2*Math.cos(v),strokeLinearGradientStartPointY:S-x/2*Math.sin(v),strokeLinearGradientColorStops:g,strokeLinearGradientEndPointX:_+x/2*Math.cos(v),strokeLinearGradientEndPointY:S+x/2*Math.sin(v)}},[d,u.width,u.height])}(jl)),jl}var fg={},zd={},db;function If(){return db||(db=1,function(e){var r=zd&&zd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=function(i,o){const s=t.default.useRef();t.default.useLayoutEffect(()=>{s.current&&s.current.destroy()},[o]),t.default.useLayoutEffect(()=>{if(!a)return;const c=i.current.opacity();return c?(i.current.opacity(0),s.current=new n.default.Tween({node:i.current,opacity:c,onFinish:()=>{var u;(u=s.current)===null||u===void 0||u.destroy()}}),s.current.play(),()=>{var u;(u=s.current)===null||u===void 0||u.destroy()}):void 0},[])};const t=r(ni()),n=r(Hs());let a=!1;e.toggleFadeInAnimation=(i=!a)=>{a=i},e.isAnimationUsed=()=>a}(zd)),zd}var pb;function jf(){return pb||(pb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=function(u){t+=1;let d=!1,p=!1;const y=setTimeout(()=>{d||(c(`Timeout loading asset ${u}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",u),d=!0,o())},a);return()=>{p?console.error("Finish called twice! That is not expected. id: ",u):(p=!0,d||(clearTimeout(y),o()))}},e.decrementLoader=o,e.whenLoaded=function(){return new Promise(u=>{return d=()=>{(0,r.isAnimationUsed)()?setTimeout(u,300):u(!0)},void(t===0?d():n.push(d));var d})},e.onLoadError=function(u){s.push(u)},e.triggerLoadError=c;const r=If();let t=0,n=[],a=3e4;e.setAssetLoadTimeout=u=>{a=u},e.getAssetLoadTimeout=()=>a;let i=6e3;function o(){t-=1,t===0&&(n.forEach(u=>u()),n=[])}e.setFontLoadTimeout=u=>{i=u},e.getFontLoadTimeout=()=>i;let s=[];function c(u){s.forEach(d=>d(u))}}(fg)),fg}var rc={},gb;function Ih(){return gb||(gb=1,function(e){var r,t=rc&&rc.__createBinding||(Object.create?function(g,E,b,M){M===void 0&&(M=b);var N=Object.getOwnPropertyDescriptor(E,b);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[b]}}),Object.defineProperty(g,M,N)}:function(g,E,b,M){M===void 0&&(M=b),g[M]=E[b]}),n=rc&&rc.__setModuleDefault||(Object.create?function(g,E){Object.defineProperty(g,"default",{enumerable:!0,value:E})}:function(g,E){g.default=E}),a=rc&&rc.__importStar||(r=function(g){return r=Object.getOwnPropertyNames||function(E){var b=[];for(var M in E)Object.prototype.hasOwnProperty.call(E,M)&&(b[b.length]=M);return b},r(g)},function(g){if(g&&g.__esModule)return g;var E={};if(g!=null)for(var b=r(g),M=0;M<b.length;M++)b[M]!=="default"&&t(E,g,b[M]);return n(E,g),E});Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=function(){return c.value},e.setGoogleFonts=function(g){g!=="default"?(c.value=!0,s.splice(0,s.length),s.push(...g)):c.value=!1},e.getFontsList=function(){return s},e.addGlobalFont=function(g){e.globalFonts.push(g)},e.removeGlobalFont=function(g){const E=e.globalFonts.findIndex(b=>b.fontFamily===g);E!==-1&&e.globalFonts.splice(E,1)},e.replaceGlobalFonts=function(g){e.globalFonts.replace(g)},e.loadFont=async function(g,E,b){var M;if(y[g])return;const N=!!(!((M=document.fonts)===null||M===void 0)&&M.load),R=p("Arial","Arial",E,b);if(N)try{if(await document.fonts.load(`16px '${g}', ${E} ${b}`),R!==p(g,"Arial",E,b))return void(y[g]=!0)}catch{}const F=p("Times","Times",E,b),j=p(g,"Arial",E,b),O=Math.min(6e3,(0,o.getFontLoadTimeout)())/60;for(let C=0;C<O;C++){const A=p(g,"Arial",E,b),k=p(g,"Times",E,b);if(A!==j||A!==R||k!==F)return void(y[g]=!0);await new Promise(T=>setTimeout(T,60))}console.warn(`Timeout for loading font "${g}". Looks like polotno can't load it. Is it a correct font family?`),(0,o.triggerLoadError)(`Timeout for loading font "${g}"`)},e.setGoogleFontsVariants=function(g){_=g},e.getGoogleFontsVariants=function(){return _},e.getGoogleFontsUrl=S,e.injectGoogleFont=function(g){if(f[g])return;const E=S(g),b=document.createElement("link");b.type="text/css",b.href=E,b.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(b),f[g]=!0},e.injectCustomFont=function(g){const E=g.fontFamily;if(w[E]||!g.url&&!g.styles)return;const b=g.styles||(g.url?[{src:`url("${g.url}")`}]:[]);let M="";b.forEach(N=>{M+=`
|
|
77
|
+
@font-face {
|
|
78
|
+
font-family: '${E}';
|
|
79
|
+
src: ${N.src};
|
|
80
|
+
font-style: ${N.fontStyle||"normal"};
|
|
81
|
+
font-weight: ${N.fontWeight||"normal"};
|
|
82
|
+
}
|
|
83
|
+
`}),v().innerHTML+=M,w[g.fontFamily]=!0};const i=a(vs),o=jf();let s=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),c=i.observable({value:!1});e.globalFonts=i.observable([]);var u="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",d=document.createElement("canvas");function p(g,E="Arial",b="normal",M="normal"){var N=d.getContext("2d");return N.font=`${b} ${M} 40px '${g}', ${E}`,N.measureText(u).width}const y={Arial:!0};e.isFontLoaded=g=>!!y[g];const f={};let _="400,400italic,700,700italic";function S(g){return`https://fonts.googleapis.com/css?family=${g.replace(/ /g,"+")}:${_}`}const w={};let x;function v(){return x||(x=document.getElementById("polotno-font-style"),x||(x=document.createElement("style"),x.id="polotno-font-style",document.head.appendChild(x)),x)}}(rc)),rc}var nc={},vb;function gc(){return vb||(vb=1,function(e){var r,t=nc&&nc.__createBinding||(Object.create?function(o,s,c,u){u===void 0&&(u=c);var d=Object.getOwnPropertyDescriptor(s,c);d&&!("get"in d?!s.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return s[c]}}),Object.defineProperty(o,u,d)}:function(o,s,c,u){u===void 0&&(u=c),o[u]=s[c]}),n=nc&&nc.__setModuleDefault||(Object.create?function(o,s){Object.defineProperty(o,"default",{enumerable:!0,value:s})}:function(o,s){o.default=s}),a=nc&&nc.__importStar||(r=function(o){return r=Object.getOwnPropertyNames||function(s){var c=[];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(c[c.length]=u);return c},r(o)},function(o){if(o&&o.__esModule)return o;var s={};if(o!=null)for(var c=r(o),u=0;u<c.length;u++)c[u]!=="default"&&t(s,o,c[u]);return n(s,o),s});Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextSplitAllowed=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=a(vs);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(o=>{e.flags.textVerticalResizeEnabled=o}),e.useRemoveBackground=i.action(o=>{e.flags.removeBackgroundEnabled=o}),e.useHtmlTextRender=i.action(o=>{e.flags.htmlRenderEnabled=o}),e.setDownScalingEnabled=i.action(o=>{e.flags.imageDownScalingEnabled=o}),e.useDownScaling=i.action(o=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(o)}),e.setForceTextFit=i.action(o=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(o=>{e.flags.textOverflow=o}),e.setTextSplitAllowed=i.action(o=>{e.flags.textSplitAllowed=o}),e.setAnimationsEnabled=i.action(o=>{e.flags.animationsEnabled=o})}(nc)),nc}var hg={},mb;function pm(){return mb||(mb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=function(r=""){return(r.match(/<\/p>/gi)||[]).length>1&&(r=r.replace(/<\/p>/gi,(t,n,a)=>(a.slice(n+t.length).match(/<\/p>/gi)||[]).length>0?`
|
|
84
|
+
`:t)),r.replace(/(<([^>]+)>)/gi,"")},e.sanitizeHtml=function(r){return r?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(r)?(r=r.replace(/<(?![a-z/!])/gi,"<")).replace(/([^a-z0-9"'\s/])>/gi,"$1>"):r.replace(/</g,"<").replace(/>/g,">"):""}}(hg)),hg}var Ud={},yb;function Ap(){return yb||(yb=1,function(e){var r=Ud&&Ud.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=function(a,i){var o;const s={filters:[]},c={};i.brightnessEnabled&&(s.filters.push(t.default.Filters.Brighten),s.brightness=i.brightness),i.blurEnabled&&(s.filters.push(t.default.Filters.Blur),s.blurRadius=i.blurRadius,i.type==="text"&&i.lineHeight<1&&(c.offset=i.fontSize)),i.sepiaEnabled&&s.filters.push(t.default.Filters.Sepia),i.grayscaleEnabled&&s.filters.push(t.default.Filters.Grayscale),i.filters.forEach((u,d)=>{const p=n[d];p&&s.filters.push(p(u.intensity))}),a.setAttrs(s),s.filters.length?a.cache(Object.assign(Object.assign({},c),{pixelRatio:i.store._elementsPixelRatio})):a.clearCache(),(o=a.getLayer())===null||o===void 0||o.batchDraw()};const t=r(Hs()),n={warm:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4)o[s]=Math.min(o[s]+30*a,255),o[s+1]=Math.min(o[s+1]+15*a,255);return i},cold:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4)o[s]=Math.min(o[s]-15*a,255),o[s+1]=Math.min(o[s+1]-10*a,255),o[s+2]=Math.min(o[s+2]+15*a,255);return i},natural:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4){o[s]=Math.min(o[s]*(1+.1*a),255),o[s+1]=Math.min(o[s+1]*(1+.1*a),255),o[s+2]=Math.min(o[s+2]*(1+.1*a),255);const c=(o[s]+o[s+1]+o[s+2])/3;o[s]=Math.min((o[s]-c)*(1+.2*a)+c,255),o[s+1]=Math.min((o[s+1]-c)*(1+.2*a)+c,255),o[s+2]=Math.min((o[s+2]-c)*(1+.2*a)+c,255)}return i},temperature:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const c=o[s],u=(o[s+1],o[s+2]);o[s]=Math.min(Math.max(c+15*a,0),255),o[s+2]=Math.min(Math.max(u-15*a,0),255)}return i},contrast:a=>i=>{const o=i.data,s=100*(a=Math.max(-1,Math.min(1,a))),c=259*(s+255)/(255*(259-s));for(let u=0;u<o.length;u+=4)o[u]=Math.min(Math.max(c*(o[u]-128)+128,0),255),o[u+1]=Math.min(Math.max(c*(o[u+1]-128)+128,0),255),o[u+2]=Math.min(Math.max(c*(o[u+2]-128)+128,0),255);return i},shadows:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const c=(o[s]+o[s+1]+o[s+2])/3;if(c<128){const u=1+a*(1-c/128)*2;o[s]=Math.min(Math.max(o[s]*u,0),255),o[s+1]=Math.min(Math.max(o[s+1]*u,0),255),o[s+2]=Math.min(Math.max(o[s+2]*u,0),255)}}return i},white:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const c=o[s],u=o[s+1],d=o[s+2],p=(c+u+d)/3;if(p>128){const y=1+a*((p-128)/127);o[s]=Math.min(Math.max(c*y,0),255),o[s+1]=Math.min(Math.max(u*y,0),255),o[s+2]=Math.min(Math.max(d*y,0),255)}}return i},black:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const c=o[s],u=o[s+1],d=o[s+2],p=(c+u+d)/3;if(p<128){const y=1+a*((128-p)/128);o[s]=Math.min(Math.max(c*y,0),255),o[s+1]=Math.min(Math.max(u*y,0),255),o[s+2]=Math.min(Math.max(d*y,0),255)}}return i},vibrance:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const c=o[s],u=o[s+1],d=o[s+2],p=Math.max(c,u,d),y=a<0?(1-(p===0?0:(p-(c+u+d)/3)/p))*a*1.5:.5*a;o[s]=Math.min(Math.max(c-(p-c)*y,0),255),o[s+1]=Math.min(Math.max(u-(p-u)*y,0),255),o[s+2]=Math.min(Math.max(d-(p-d)*y,0),255)}return i},saturation:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const c=o[s],u=o[s+1],d=o[s+2],p=.2126*c+.7152*u+.0722*d;o[s]=Math.min(Math.max(p+(c-p)*(1+a),0),255),o[s+1]=Math.min(Math.max(p+(u-p)*(1+a),0),255),o[s+2]=Math.min(Math.max(p+(d-p)*(1+a),0),255)}return i}}}(Ud)),Ud}var Hd={},bb;function rf(){return bb||(bb=1,function(e){var r=Hd&&Hd.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const t=r(ni());e.MOBILE_BREAKPOINT=800,e.isMobile=()=>window.innerWidth<=e.MOBILE_BREAKPOINT,e.mobileStyle=n=>`
|
|
85
|
+
@media (max-width: ${e.MOBILE_BREAKPOINT}px) {
|
|
86
|
+
${n}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.polotno-mobile & {
|
|
90
|
+
${n}
|
|
91
|
+
}
|
|
92
|
+
`,e.isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,e.useMobile=()=>{const[n,a]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const i=()=>{a((0,e.isMobile)())};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),n}}(Hd)),Hd}var wb={},H6="warn";function V6(e){H6=e}function G6(){return H6}function vP(e){V6(e)}var ba;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(ba||(ba={}));var P2=function(e,r){return P2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},P2(e,r)};function Zn(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");P2(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var wa=function(){return wa=Object.assign||function(r){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},wa.apply(this,arguments)};function mP(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t}function W6(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(n=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,a=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1],i=u;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(u);break}i[2]&&t.ops.pop(),t.trys.pop();continue}u=r.call(e,t)}catch(d){u=[6,d],a=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function lp(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Iu(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),a,i=[],o;try{for(;(r===void 0||r-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(s){o={error:s}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return i}function ju(e,r,t){if(arguments.length===2)for(var n=0,a=r.length,i;n<a;n++)(i||!(n in r))&&(i||(i=Array.prototype.slice.call(r,0,n)),i[n]=r[n]);return e.concat(i||Array.prototype.slice.call(r))}function Cp(e){return nr(e).type}function yP(e,r){return nr(e).getChildType(r)}function $6(e,r){return nr(e).onPatch(r)}function bP(e,r){return nr(e).onSnapshot(r)}function Ph(e,r){nr(e).applyPatches(Sm(r))}function wP(e,r){var t={patches:[],inversePatches:[]},n={},a,i={get recording(){return!!a},get patches(){return n.patches||(n.patches=t.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=t.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=t.inversePatches.slice()),n.inversePatches},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=$6(e,function(o,s){r&&!r(o,s,ym())||(t.patches.push(o),t.inversePatches.push(s),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ph(o||e,t.patches)},undo:function(o){Ph(o||e,t.inversePatches.slice().reverse())}};return i.resume(),i}function _P(e){var r=nr(e);if(!r.isRoot)throw new $t("`protect` can only be invoked on root nodes");r.isProtectionEnabled=!0}function SP(e){var r=nr(e);if(!r.isRoot)throw new $t("`unprotect` can only be invoked on root nodes");r.isProtectionEnabled=!1}function xP(e){return nr(e).isProtected}function Y6(e,r){return nr(e).applySnapshot(r)}function gm(e,r){r===void 0&&(r=!0);var t=nr(e);return r?t.snapshot:t.type.getSnapshot(t,!1)}function EP(e,r){r===void 0&&(r=1);for(var t=nr(e).parent;t;){if(--r===0)return!0;t=t.parent}return!1}function PP(e,r){r===void 0&&(r=1);for(var t=r,n=nr(e).parent;n;){if(--t===0)return n.storedValue;n=n.parent}throw new $t("Failed to find the parent of ".concat(nr(e)," at depth ").concat(r))}function OP(e,r){for(var t=nr(e).parent;t;){if(r.is(t.storedValue))return!0;t=t.parent}return!1}function AP(e,r){for(var t=nr(e).parent;t;){if(r.is(t.storedValue))return t.storedValue;t=t.parent}throw new $t("Failed to find the parent of ".concat(nr(e)," of a given type"))}function X6(e){return nr(e).root.storedValue}function K6(e){return nr(e).path}function CP(e){return Lh(nr(e).path)}function kP(e){return nr(e).isRoot}function LP(e,r){var t=p8(nr(e),r);return t?t.value:void 0}function NP(e,r,t){var n=nr(r).root.identifierCache.resolve(e,jh(t));return n==null?void 0:n.value}function Z6(e){return nr(e).identifier}function TP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return;if(An(t))return r?vm(t)?t:void 0:t;throw new $t("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof xm)return;throw n}}function RP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return!1;if(An(t))return r?vm(t):!0;throw new $t("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof xm)return!1;throw n}}function Q6(e,r){var t=p8(nr(e),r,!1);if(t!==void 0)try{return t.value}catch{return}}function MP(e,r){return d8(nr(e),nr(r))}function IP(e,r){r===void 0&&(r=!0);var t=nr(e);return t.type.create(t.snapshot,r===!0?t.root.environment:r===!1?void 0:r)}function jP(e){return nr(e).detach(),e}function FP(e){var r=nr(e);r.isRoot?r.die():r.parent.removeChild(r.subpath)}function vm(e){return nr(e).observableIsAlive}function DP(e,r){var t=nr(e);return t.addDisposer(r),r}function BP(e){var r=nr(e),t=r.root.environment;if(!t)throw new $t("Failed to find the environment of ".concat(r," ").concat(r.path));return t}function qP(e){var r=nr(e),t=r.root.environment;return!!t}function J6(e,r){var t=nr(e);t.getChildren().forEach(function(n){An(n.storedValue)&&J6(n.storedValue,r)}),r(t.storedValue)}function e8(e){var r;return An(e)?r=Cp(e):r=e,{name:r.name,properties:wa({},r.properties)}}function zP(e){var r=nr(e).type,t=wa(wa({},e8(r)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(a){if(!(a in t.properties)){var i=Object.getOwnPropertyDescriptor(e,a);if(i.get){a6(e,a)?t.views.push(a):t.volatile.push(a);return}i.value._isFlowAction===!0&&t.flowActions.push(a),i.value._isMSTAction===!0?t.actions.push(a):s6(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function UP(e){return e}function HP(e){return e}function VP(e){return e}function GP(e){return nr(e).nodeId}var t8=function(){function e(r,t,n,a){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:a}),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:no.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=a,this.baseSetParent(t,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(r){var t=this.isAlive;this._state=r;var n=this.isAlive;this.aliveAtom&&t!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._hookSubscribers&&this._hookSubscribers.emit(r,this,r)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){return this._hookSubscribers||(this._hookSubscribers=new b8),this._hookSubscribers.register(r,t)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){this._parent=r,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.pathAtom||(this.pathAtom=fp("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Wc(this._subpath):""),this.parent.getEscapedPath(r)+"/"+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!==no.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===no.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=fp("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.state===no.CREATED){if(this.parent){if(this.parent.state!==no.FINALIZED)return;this.fireHook(ba.afterAttach)}this.state=no.FINALIZED,r&&r()}}}),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=no.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(ba.beforeDestroy)}}),e}(),pp=function(e){Zn(r,e);function r(t,n,a,i,o){var s=e.call(this,t,n,a,i)||this;try{s.storedValue=t.createNewInstance(o)}catch(c){throw s.state=no.DEAD,c}return s.state=no.CREATED,s.finalizeCreation(),s}return Object.defineProperty(r.prototype,"root",{get:function(){if(!this.parent)throw new $t("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.parent!==t,i=this.subpath!==n;!a&&!i||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(r.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(r.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(r.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===no.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(r.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(r.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(r.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(r.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),r}(t8);pp.prototype.die=ca(pp.prototype.die);var WP=1,Vl;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Vl||(Vl={}));var js;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(js||(js={}));var $P={onError:function(e){throw e}},ms=function(e){Zn(r,e);function r(t,n,a,i,o){var s=e.call(this,t,n,a,i)||this;if(Object.defineProperty(s,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++WP}),Object.defineProperty(s,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Vl.UNINITIALIZED}),Object.defineProperty(s,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._snapshotComputed=Tf(function(){return s.getSnapshot()}),s.unbox=s.unbox.bind(s),s._initialSnapshot=o,s.identifierAttribute=t.identifierAttribute,n||(s.identifierCache=new dO),s._childNodes=t.initializeChildNodes(s,s._initialSnapshot),s.identifier=null,s.unnormalizedIdentifier=null,s.identifierAttribute&&s._initialSnapshot){var c=s._initialSnapshot[s.identifierAttribute];if(c===void 0){var u=s._childNodes[s.identifierAttribute];u&&(c=u.value)}if(typeof c!="string"&&typeof c!="number")throw new $t("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=jh(c),s.unnormalizedIdentifier=c}return n?n.root.identifierCache.addNodeToCache(s):s.identifierCache.addNodeToCache(s),s}return Object.defineProperty(r.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(r.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===Vl.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(r.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n,a,i,o;t===void 0&&(t=!0),this._observableInstanceState=Vl.CREATING;for(var s=[],c=this.parent;c&&c._observableInstanceState===Vl.UNINITIALIZED;)s.unshift(c),c=c.parent;try{for(var u=lp(s),d=u.next();!d.done;d=u.next()){var p=d.value;p.createObservableInstanceIfNeeded(!1)}}catch(S){n={error:S}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}var y=this.type;try{this.storedValue=y.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,y.finalizeNewInstance(this,this.storedValue)}catch(S){throw this.state=no.DEAD,S}finally{this._isRunningAction=!1}if(this._observableInstanceState=Vl.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Ch,this.state=no.CREATED,t){this.fireHook(ba.afterCreate),this.finalizeCreation();try{for(var f=lp(s.reverse()),_=f.next();!_.done;_=f.next()){var p=_.value;p.fireHook(ba.afterCreate),p.finalizeCreation()}}catch(S){i={error:S}}finally{try{_&&!_.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}}}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(ba.beforeDetach);var t=this.state;this.state=no.DETACHING;var n=this.root,a=n.environment,i=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=a,this.identifierCache=i}finally{this.state=t}}}}),Object.defineProperty(r.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t!==this.parent,i=n!==this.subpath;!a&&!i||(a?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,n),this.fireHook(ba.afterAttach)):i&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(r.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.fireInternalHook(t);var a=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof a=="function"&&(Sh?Sh(function(){a.apply(n.storedValue)}):a.apply(this.storedValue))}}),Object.defineProperty(r.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Vl.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(r.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(r.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,n=this._childNodes,a=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(n,a),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(r.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(r.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=G6();if(!this.isAlive&&n!=="ignore"){var a=this._getAssertAliveError(t);switch(n){case"error":throw new $t(a);case"warn":OO(a)}}}}),Object.defineProperty(r.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",a=t.subpath&&Wc(t.subpath)||"",i=t.actionContext||mm();i&&i.type!=="action"&&i.parentActionEvent&&(i=i.parentActionEvent);var o="";if(i&&i.name!=null){var s=i&&i.context&&K6(i.context)||n;o="".concat(s,".").concat(i.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(a,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===Vl.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Ch),this._autoUnbox=!1;try{return this._observableInstanceState===Vl.CREATED?this.type.getChildren(this):v8(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(r.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new $t("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(r.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.assertAlive({subpath:t.subpath||t.subpathUponDeath}),this._autoUnbox?t.value:t)}}),Object.defineProperty(r.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(r.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var n,a;try{for(var i=lp(t.getChildren()),o=i.next();!o.done;o=i.next()){var s=o.value;s.finalizeCreation()}}catch(c){n={error:c}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}t.fireInternalHook(ba.afterCreationFinalization)})}}),Object.defineProperty(r.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new $t("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(r.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=gp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var i=Lh(a.path),o=g8(t,i.slice(0,-1));o.applyPatchLocally(i[i.length-1],a)})}),this._applySnapshot=gp(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==t.snapshot)return t.type.applySnapshot(t,n)}),Ef(this.storedValue,"$treenode",this),Ef(this.storedValue,"toJSON",gO)}}),Object.defineProperty(r.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===no.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(r.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Vl.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(js.Dispose),this._internalEventsClear(js.Dispose))}}),Object.defineProperty(r.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(r.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(js.Snapshot,t)}}),Object.defineProperty(r.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(js.Snapshot,t)}}),Object.defineProperty(r.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(js.Patch,t)}}),Object.defineProperty(r.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._internalEventsHasSubscribers(js.Patch)){var a=n.path.substr(this.path.length)+(t.path?"/"+t.path:""),i=xO({},t,{path:a}),o=Iu(TO(i),2),s=o[0],c=o[1];this._internalEventsEmit(js.Patch,s,c)}this.parent&&this.parent.emitPatch(t,n)}}),Object.defineProperty(r.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(js.Dispose,t)}}),Object.defineProperty(r.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(js.Dispose,t,!0);return}throw new $t("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(r.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(js.Dispose,t))throw new $t("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(js.Dispose,t)}}),Object.defineProperty(r.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var n=this.middlewares.indexOf(t);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(r.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var i={handler:t,includeHooks:n};return this.middlewares?this.middlewares.push(i):this.middlewares=[i],function(){a.removeMiddleware(i)}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,n)}}),Object.defineProperty(r.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var n=Zw(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},$P);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(r.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(r.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){return a===void 0&&(a=!1),this._internalEvents||(this._internalEvents=new b8),this._internalEvents.register(t,n,a)}}),Object.defineProperty(r.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!!this._internalEvents&&this._internalEvents.has(t,n)}}),Object.defineProperty(r.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._internalEvents&&this._internalEvents.unregister(t,n)}}),Object.defineProperty(r.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var n,a=[],i=1;i<arguments.length;i++)a[i-1]=arguments[i];this._internalEvents&&(n=this._internalEvents).emit.apply(n,ju([t],Iu(a),!1))}}),Object.defineProperty(r.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(r.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),r}(t8);ms.prototype.createObservableInstance=ca(ms.prototype.createObservableInstance);ms.prototype.detach=ca(ms.prototype.detach);ms.prototype.die=ca(ms.prototype.die);var r8,Or;(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"})(Or||(Or={}));var n8="cannotDetermine",YP=Symbol("$type"),pc=function(){function e(r){Object.defineProperty(this,r8,{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=r}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){return hc(this,r),this.instantiate(null,"",t,r).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){throw new $t("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=h8(r);if(n){var a=Cp(r);return this.isAssignableFrom(a)?ys():bs(t,r)}return this.isValidSnapshot(r,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.validate(r,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new $t("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new $t("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new $t("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new $t("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}();r8=YP;pc.prototype.create=ca(pc.prototype.create);var Oh=function(e){Zn(r,e);function r(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(r.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,n)}}),Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(r.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!t.identifierAttribute||t.identifier===jh(n[t.identifierAttribute])}}),Object.defineProperty(r.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t.isDetaching?!1:t.snapshot===n||An(n)&&nr(n)===t?!0:t.type===this&&m8(n)&&!An(n)&&this.isMatchingSnapshotId(t,n)?(t.applySnapshot(n),!0):!1}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.tryToReconcileNode(t,n);if(o)return t.setParent(a,i),t;if(t.die(),An(n)&&this.isAssignableFrom(Cp(n))){var s=nr(n);return s.setParent(a,i),s}return this.instantiate(a,i,void 0,n)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),r}(pc);Oh.prototype.create=ca(Oh.prototype.create);var Ff=function(e){Zn(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t.isDetaching&&t.type===this&&t.storedValue===n)return t;var o=this.instantiate(a,i,void 0,n);return t.die(),o}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),r}(pc);function _a(e){return typeof e=="object"&&e&&e.isType===!0}var Ou=new Map;function XP(e){return function(t,n,a){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var i=e.onStart(t);e.onResume(t,i),Ou.set(t.id,{call:t,context:i,async:!1});try{var o=n(t);return e.onSuspend(t,i),Ou.get(t.id).async===!1&&(Ou.delete(t.id),e.onSuccess(t,i,o)),o}catch(c){throw Ou.delete(t.id),e.onFail(t,i,c),c}}else return n(t);case"flow_spawn":{var s=Ou.get(t.rootId);return s.async=!0,n(t)}case"flow_resume":case"flow_resume_error":{var s=Ou.get(t.rootId);e.onResume(t,s.context);try{return n(t)}finally{e.onSuspend(t,s.context)}}case"flow_throw":{var s=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onFail(t,s.context,t.args[0]),n(t)}case"flow_return":{var s=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onSuccess(t,s.context,t.args[0]),n(t)}}}}var KP=function(){function e(r,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),r&&r.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,r))}}),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 ZP(e){var r=new Map;return function(n,a){var i=n.parentActionEvent?r.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=wa(wa({},n),{env:i&&i.call.env,parentCall:i&&i.call}),s=!e.filter||e.filter(o),c=s?e:void 0,u=new KP(c,o);r.set(n.id,u);var d=void 0;try{d=a(n)}catch(y){throw r.delete(n.id),u.finish(y),y}return u.hasFlowsPending||(r.delete(n.id),u.finish()),d}else{if(!i)return a(n);switch(n.type){case"flow_spawn":return i.incFlowsPending(),a(n);case"flow_resume":case"flow_resume_error":return a(n);case"flow_throw":{var p=n.args[0];try{return a(n)}finally{i.decFlowsPending(),i.hasFlowsPending||(r.delete(n.parentActionEvent.id),i.finish(p))}}case"flow_return":try{return a(n)}finally{i.decFlowsPending(),i.hasFlowsPending||(r.delete(n.parentActionEvent.id),i.finish())}}}}}function QP(e,r,t,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(kh(n))return n;if(An(n))return u1("[MSTNode: ".concat(Cp(n).name,"]"));if(typeof n=="function")return u1("[function]");if(typeof n=="object"&&!xf(n)&&!_m(n))return u1("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(a){return u1(""+a)}}function JP(e,r){return r&&typeof r=="object"&&"$MST_DATE"in r?new Date(r.$MST_DATE):r}function u1(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function i8(e,r){Sh(function(){Sm(r).forEach(function(t){return eO(e,t)})})}function eO(e,r){var t=Q6(e,r.path||"");if(!t)throw new $t("Invalid action path: ".concat(r.path||""));var n=nr(t);if(r.name==="@APPLY_PATCHES")return Ph.call(null,t,r.args[0]);if(r.name==="@APPLY_SNAPSHOT")return Y6.call(null,t,r.args[0]);if(typeof t[r.name]!="function")throw new $t("Action '".concat(r.name,"' does not exist in '").concat(n.path,"'"));return t[r.name].apply(t,r.args?r.args.map(function(a){return JP(n,a)}):[])}function tO(e,r){var t=[],n=function(o){var s=r?r(o,ym()):!0;s&&t.push(o)},a,i={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=a8(e,n))},replay:function(o){i8(o,t)}};return i.resume(),i}function a8(e,r,t){return t===void 0&&(t=!1),l8(e,function(a,i){if(a.type==="action"&&a.id===a.rootId){var o=nr(a.context),s={name:a.name,path:d8(nr(e),o),args:a.args.map(function(u,d){return QP(o,a.name,d,u)})};if(t){var c=i(a);return r(s),c}else return r(s),i(a)}else return i(a)})}var rO=1,up;function mm(){return up}function o8(){return rO++}function O2(e,r){var t=nr(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var n=t._isRunningAction;t._isRunningAction=!0;var a=up;up=e;try{return aO(t,e,r)}finally{up=a,t._isRunningAction=n}}function s8(e){if(e)return e.type==="action"?e:e.parentActionEvent}function gp(e,r,t){var n=function(){var a=o8(),i=up,o=s8(i);return O2({type:"action",name:r,id:a,args:w8(arguments),context:e,tree:X6(e),rootId:i?i.rootId:a,parentId:i?i.id:0,allParentIds:i?ju(ju([],Iu(i.allParentIds),!1),[i.id],!1):[],parentEvent:i,parentActionEvent:o},t)};return n._isMSTAction=!0,n._isFlowAction=t._isFlowAction,n}function l8(e,r,t){t===void 0&&(t=!0);var n=nr(e);return n.addMiddleWare(r,t)}function nO(e,r,t){t===void 0&&(t=!0);var n={handler:e,includeHooks:t};return r.$mst_middleware=r.$mst_middleware||[],r.$mst_middleware.push(n),r}var iO=function(){function e(r,t){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var n=r;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 r=this.middlewares[this.arrayIndex];if(r){var t=r[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function aO(e,r,t){var n=new iO(e,t);if(n.isEmpty)return ca(t).apply(null,r.args);var a=null;function i(o){var s=n.getNextMiddleware(),c=s&&s.handler;if(!c)return ca(t).apply(null,o.args);if(!s.includeHooks&&ba[o.name])return i(o);function u(p,y){a=i(p),y&&(a=y(a))}function d(p){a=p}return c(o,u,d),a}return i(r)}function ym(){for(var e=mm();e&&e.type!=="action";)e=e.parentActionEvent;return e}function u8(e,r,t){for(var n=typeof r=="number"?r:r.id,a=t?e:e.parentActionEvent;a;){if(a.id===n)return!0;a=a.parentActionEvent}return!1}function oO(e,r){return u8(e,r,!1)}function sO(e,r){return u8(e,r,!0)}function lO(e){try{return JSON.stringify(e)}catch(r){return"<Unserializable: ".concat(r,">")}}function c8(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):An(e)?"<".concat(e,">"):"`".concat(lO(e),"`")}function uO(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function cO(e){var r=e.value,t=e.context[e.context.length-1].type,n=e.context.map(function(s){var c=s.path;return c}).filter(function(s){return s.length>0}).join("/"),a=n.length>0?'at path "/'.concat(n,'" '):"",i=An(r)?"value of type ".concat(nr(r).type.name,":"):kh(r)?"value":"snapshot",o=t&&An(r)&&t.is(nr(r).snapshot);return"".concat(a).concat(i," ").concat(c8(r)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?T8(t)||kh(r)?".":", expected an instance of `".concat(t.name,"` or a snapshot like `").concat(t.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function bm(e,r,t){return e.concat([{path:r,type:t}])}function ys(){return Ah}function bs(e,r,t){return[{context:e,value:r,message:t}]}function n0(e){return e.reduce(function(r,t){return r.concat(t)},[])}function hc(e,r){AO()&&f8(e,r)}function f8(e,r){var t=e.validate(r,[{path:"",type:e}]);if(t.length>0)throw new $t(fO(e,r,t))}function fO(e,r,t){if(t.length!==0)return"Error while converting ".concat(uO(c8(r))," to `").concat(e.name,`\`:
|
|
93
|
+
|
|
94
|
+
`)+t.map(cO).join(`
|
|
95
|
+
`)}var hO=0,dO=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:hO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Rn.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Rn.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.lastCacheModificationPerId.get(r);this.lastCacheModificationPerId.set(r,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.lastCacheModificationPerId.get(r)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){if(t===void 0&&(t=!0),r.identifierAttribute){var n=r.identifier;this.cache.has(n)||this.cache.set(n,Rn.array([],i0));var a=this.cache.get(n);if(a.indexOf(r)!==-1)throw new $t("Already registered");a.push(r),t&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this;K2(r.identifierCache.cache).forEach(function(n){return n.forEach(function(a){t.addNodeToCache(a)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.identifierAttribute){var t=r.identifier,n=this.cache.get(t);n&&(n.remove(r),n.length||this.cache.delete(t),this.updateLastCacheModificationPerId(r.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this,n=new e,a=r.path+"/";return l6(this.cache).forEach(function(i){for(var o=Iu(i,2),s=o[0],c=o[1],u=!1,d=c.length-1;d>=0;d--){var p=c[d];(p===r||p.path.indexOf(a)===0)&&(n.addNodeToCache(p,!1),c.splice(d,1),c.length||t.cache.delete(s),u=!0)}u&&t.updateLastCacheModificationPerId(s)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.cache.get(t);return n?n.some(function(a){return r.isAssignableFrom(a.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.cache.get(t);if(!n)return null;var a=n.filter(function(i){return r.isAssignableFrom(i.type)});switch(a.length){case 0:return null;case 1:return a[0];default:throw new $t("Cannot resolve a reference to type '".concat(r.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(a.map(function(i){return i.path}).join(", ")))}}}),e}();function wm(e,r,t,n,a){var i=h8(a);if(i){if(i.parent)throw new $t("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(r?r.path:"","/").concat(t,"', but it lives already at '").concat(i.path,"'"));return r&&i.setParent(r,t),i}return new ms(e,r,t,n,a)}function nf(e,r,t,n,a){return new pp(e,r,t,n,a)}function pO(e){return e instanceof pp||e instanceof ms}var no;(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"})(no||(no={}));function An(e){return!!(e&&e.$treenode)}function nr(e){if(!An(e))throw new $t("Value ".concat(e," is no MST Node"));return e.$treenode}function h8(e){return e&&e.$treenode||null}function gO(){return nr(this).snapshot}var vO=function(e){return".."};function d8(e,r){if(e.root!==r.root)throw new $t("Cannot calculate relative path: objects '".concat(e,"' and '").concat(r,"' are not part of the same object tree"));for(var t=Lh(e.path),n=Lh(r.path),a=0;a<t.length&&t[a]===n[a];a++);return t.slice(a).map(vO).join("/")+I1(n.slice(a))}function p8(e,r,t){return t===void 0&&(t=!0),g8(e,Lh(r),t)}function g8(e,r,t){t===void 0&&(t=!0);var n=e;try{for(var a=0;a<r.length;a++){var i=r[a];if(i===".."){if(n=n.parent,n)continue}else{if(i===".")continue;if(n){if(n instanceof pp){var o=n.value;An(o)&&(n=nr(o))}if(n instanceof ms){var s=n.getChildType(i);if(s&&(n=n.getChildNode(i),n))continue}}}throw new $t("Could not resolve '".concat(i,"' in path '").concat(I1(r.slice(0,a))||"/","' while resolving '").concat(I1(r),"'"))}}catch(c){if(!t)return;throw c}return n}function v8(e){if(!e)return Ah;var r=Object.keys(e);if(!r.length)return Ah;var t=new Array(r.length);return r.forEach(function(n,a){t[a]=e[n]}),t}function mO(e){return _8(e)}var yO=Object.toString(),Ah=Object.freeze([]),Ch=Object.freeze({}),i0=Bw().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(i0);var $t=function(e){Zn(r,e);function r(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return r}(Error);function bO(e){return e}var wO=Number.isInteger;function _O(e){return Number(e)===e&&e%1!==0}function SO(e){return Number.isFinite(e)}function _m(e){return Array.isArray(e)||Vo(e)}function Sm(e){return e?_m(e)?e:[e]:Ah}function xO(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=0;n<r.length;n++){var a=r[n];for(var i in a)e[i]=a[i]}return e}function xf(e){var r;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((r=t.constructor)===null||r===void 0?void 0:r.toString())===yO}function m8(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function kh(e,r){return r===void 0&&(r=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||r&&e instanceof Date}function y8(e){return typeof e!="function"}function EO(e,r,t){Ta(e)?Q2(e,r,t):Object.defineProperty(e,r,t)}function Ef(e,r,t){EO(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}var PO=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(r,t){var n=this;return t===void 0&&(t=!1),t?this.handlers.unshift(r):this.handlers.push(r),function(){n.unregister(r)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.handlers.indexOf(r)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.handlers.indexOf(r);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=this.handlers.slice();n.forEach(function(a){return a.apply(void 0,ju([],Iu(r),!1))})}}),e}(),b8=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(r){var t=this.eventHandlers&&this.eventHandlers[r];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var a=this.eventHandlers[r];return a||(a=this.eventHandlers[r]=new PO),a.register(t,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.eventHandlers&&this.eventHandlers[r];return!!n&&n.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.eventHandlers&&this.eventHandlers[r];n&&n.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.eventHandlers&&delete this.eventHandlers[r]}}),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(r){for(var t,n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var i=this.eventHandlers&&this.eventHandlers[r];i&&(t=i).emit.apply(t,ju([],Iu(n),!1))}}),e}();function w8(e){for(var r=new Array(e.length),t=0;t<e.length;t++)r[t]=e[t];return r}function dg(e,r){return e.indexOf(r)===0}function OO(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function AO(){return typeof process<"u"&&wb&&wb.ENABLE_TYPE_CHECK==="true"}function pg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function _8(e){return NO(e.name,e)}function CO(e){return e}function kO(e){return function(){var r,t=[];for(r=0;r<arguments.length;r++)t[r]=arguments[r];return W6(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,ju([],Iu(t),!1))];case 1:return[2,n.sent()]}})}}function LO(e){return W6(this,function(r){switch(r.label){case 0:return[4,e];case 1:return[2,r.sent()]}})}function NO(e,r){var t=function(){var a=o8(),i=mm();if(!i)throw new $t("a mst flow must always have a parent context");var o=s8(i);if(!o)throw new $t("a mst flow must always have a parent action context");var s={name:e,id:a,tree:i.tree,context:i.context,parentId:i.id,allParentIds:ju(ju([],Iu(i.allParentIds),!1),[i.id],!1),rootId:i.rootId,parentEvent:i,parentActionEvent:o},c=arguments;function u(d,p,y){return d.$mst_middleware=t.$mst_middleware,O2(wa(wa({},s),{type:p,args:[y]}),d)}return new Promise(function(d,p){var y,f=function(){y=r.apply(null,arguments),_(void 0)};f.$mst_middleware=t.$mst_middleware,O2(wa(wa({},s),{type:"flow_spawn",args:w8(c)}),f);function _(x){var v;try{var g=u(function(E){v=y.next(E)},"flow_resume",x);g instanceof Error&&(v=y.throw(g))}catch(E){pg(function(){u(function(b){p(E)},"flow_throw",E)});return}w(v)}function S(x){var v;try{u(function(g){v=y.throw(g)},"flow_resume_error",x)}catch(g){pg(function(){u(function(E){p(g)},"flow_throw",g)});return}w(v)}function w(x){if(x.done){pg(function(){u(function(v){d(v)},"flow_return",x.value)});return}if(!x.value||typeof x.value.then!="function")throw new $t("Only promises can be yielded to `async`, got: "+x);return x.value.then(_,S)}})};return t._isFlowAction=!0,t}function TO(e){if(!("oldValue"in e))throw new $t("Patches without `oldValue` field cannot be inversed");return[RO(e),MO(e)]}function RO(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 MO(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 IO(e){return typeof e=="number"}function Wc(e){return IO(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function S8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function I1(e){if(e.length===0)return"";var r=function(t){return t.map(Wc).join("/")};return e[0]==="."||e[0]===".."?r(e):"/"+r(e)}function Lh(e){var r=e.split("/").map(S8),t=e===""||e==="."||e===".."||dg(e,"/")||dg(e,"./")||dg(e,"../");if(!t)throw new $t("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return r[0]===""&&r.shift(),r}var gg=Symbol("$preProcessorFailed"),jO=function(e){Zn(r,e);function r(t,n,a){var i=e.call(this,a||t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Or.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(r.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(r.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return gg}}}),Object.defineProperty(r.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,n.storedValue):t}}),Object.defineProperty(r.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;FO(t.type,this,"create"),t instanceof ms&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return n.postProcessSnapshot(a.call(t),t)},M8(this._subtype)||(t.getReconciliationType=function(){return n})}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=An(i)?i:this.preProcessSnapshot(i),s=this._subtype.instantiate(t,n,a,o);return this._fixNode(s),s}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this._subtype.reconcile(t,An(n)?n:this.preProcessSnapshot(n),a,i);return o!==t&&this._fixNode(o),o}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=!0);var a=this._subtype.getSnapshot(t);return n?this.postProcessSnapshot(a,t):a}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.preProcessSnapshotSafe(t);return a===gg?bs(n,t,"Failed to preprocess value"):this._subtype.validate(a,n)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(r.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=_a(t)?this._subtype:An(t)?gm(t,!1):this.preProcessSnapshotSafe(t);return n===gg?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!(this._subtype instanceof Oh))return!1;var a=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(t,a)}}),r}(pc);function FO(e,r){for(var t,n,a=[],i=2;i<arguments.length;i++)a[i-2]=arguments[i];try{for(var o=lp(a),s=o.next();!s.done;s=o.next()){var c=s.value;e[c]=r[c].bind(r)}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}function DO(e,r,t){return new jO(e,r,t)}var _b="Map.put can only be used to store complex values that have an identifier type attribute";function x8(e,r){var t,n,a=e.getSubTypes();if(a===n8)return!1;if(a){var i=Sm(a);try{for(var o=lp(i),s=o.next();!s.done;s=o.next()){var c=s.value;if(!x8(c,r))return!1}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}return e instanceof vp&&r.push(e),!0}var Uc;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Uc||(Uc={}));var BO=function(e){Zn(r,e);function r(t,n){return e.call(this,t,Rn.ref.enhancer,n)||this}return Object.defineProperty(r.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(r.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(r.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(r.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.set.call(this,""+t,n)}}),Object.defineProperty(r.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new $t("Map.put cannot be used to set empty values");if(An(t)){var n=nr(t);if(n.identifier===null)throw new $t(_b);return this.set(n.identifier,t),t}else if(m8(t)){var a=nr(this),i=a.type;if(i.identifierMode!==Uc.YES)throw new $t(_b);var o=i.mapIdentifierAttribute,s=t[o];if(!Em(s)){var c=this.put(i.getChildType().create(t,a.environment));return this.put(gm(c))}var u=jh(s);return this.set(u,t),this.get(u)}else throw new $t("Map.put can only be used to store complex values")}}),r}(Q1),j1=function(e){Zn(r,e);function r(t,n,a){a===void 0&&(a=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Uc.UNKNOWN}),Object.defineProperty(i,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Map}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i._determineIdentifierMode(),i.hookInitializers=a,i}return Object.defineProperty(r.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new r(this.name,this._subType,n)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._determineIdentifierMode(),wm(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Uc.UNKNOWN){var t=[];if(x8(this._subType,t)){var n=t.reduce(function(a,i){if(!i.identifierAttribute)return a;if(a&&a!==i.identifierAttribute)throw new $t("The objects in a map should all have the same identifier attribute, expected '".concat(a,"', but child of type '").concat(i.name,"' declared attribute '").concat(i.identifierAttribute,"' as identifier"));return i.identifierAttribute},void 0);n?(this.identifierMode=Uc.YES,this.mapIdentifierAttribute=n):this.identifierMode=Uc.NO}}}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type._subType,i={};return Object.keys(n).forEach(function(o){i[o]=a.instantiate(t,o,void 0,n[o])}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new BO(t,this.name)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){X2(n,t.unbox);var a=t.type;a.hookInitializers.forEach(function(i){var o=i(n);Object.keys(o).forEach(function(s){var c=o[s],u=gp(n,s,c);Ef(n,s,u)})}),X1(n,this.willChange),Z1(n,this.didChange)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return K2(t.storedValue)}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t.storedValue.get(""+n);if(!a)throw new $t("Not a child "+n);return a}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=nr(t.object),a=t.name;n.assertWritable({subpath:a});var i=n.type,o=i._subType;switch(t.type){case"update":{var s=t.newValue,c=t.object.get(a);if(s===c)return null;hc(o,s),t.newValue=o.reconcile(n.getChildNode(a),t.newValue,n,a),i.processIdentifier(a,t.newValue)}break;case"add":hc(o,t.newValue),t.newValue=o.instantiate(n,a,void 0,t.newValue),i.processIdentifier(a,t.newValue);break}return t}}),Object.defineProperty(r.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.identifierMode===Uc.YES&&n instanceof ms){var a=n.identifier;if(a!==t)throw new $t("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(a,"', but expected: '").concat(t,"'"))}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return t.getChildren().forEach(function(a){n[a.subpath]=a.snapshot}),n}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=nr(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:Wc(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Wc(t.name),value:t.newValue.snapshot,oldValue:void 0},n);case"delete":var a=t.oldValue.snapshot;return t.oldValue.die(),void n.emitPatch({op:"remove",path:Wc(t.name),oldValue:a},n)}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=t.storedValue;switch(a.op){case"add":case"replace":i.set(n,a.value);break;case"remove":i.delete(n);break}}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=t.storedValue,i={};if(Array.from(a.keys()).forEach(function(s){i[s]=!1}),n)for(var o in n)a.set(o,n[o]),i[""+o]=!0;Object.keys(i).forEach(function(s){i[s]===!1&&a.delete(s)})}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return xf(t)?n0(Object.keys(t).map(function(i){return a._subType.validate(t[i],bm(n,i,a._subType))})):bs(n,t,"Value is not a plain object")}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ch}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.delete(n)}}),r}(Oh);j1.prototype.applySnapshot=ca(j1.prototype.applySnapshot);function qO(e){return new j1("Map<string, ".concat(e.name,">"),e)}function zO(e){return _a(e)&&(e.flags&Or.Map)>0}var F1=function(e){Zn(r,e);function r(t,n,a){a===void 0&&(a=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Array}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i.hookInitializers=a,i}return Object.defineProperty(r.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new r(this.name,this._subType,n)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return wm(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=[]);var a=t.type._subType,i={};return n.forEach(function(o,s){var c=""+s;i[c]=a.instantiate(t,c,void 0,o)}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=wa(wa({},i0),{name:this.name});return Rn.array(v8(t),n)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Zl(n).dehancer=t.unbox;var a=t.type;a.hookInitializers.forEach(function(i){var o=i(n);Object.keys(o).forEach(function(s){var c=o[s],u=gp(n,s,c);Ef(n,s,u)})}),X1(n,this.willChange),Z1(n,this.didChange)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=Number(n);if(a<t.storedValue.length)return t.storedValue[a];throw new $t("Not a child: "+n)}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=nr(t.object);n.assertWritable({subpath:""+t.index});var a=n.type._subType,i=n.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var o=Sb(n,a,[i[t.index]],[t.newValue],[t.index]);if(!o)return null;t.newValue=o[0]}break;case"splice":{var s=t.index,c=t.removedCount,u=t.added,d=Sb(n,a,i.slice(s,s+c),u,u.map(function(y,f){return s+f}));if(!d)return null;t.added=d;for(var p=s+c;p<i.length;p++)i[p].setParent(n,""+(p+u.length-c))}break}return t}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=[];return Object.keys(t).forEach(function(a){n.push(t[a].getSnapshot())}),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=nr(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:t.removed.map(function(i){return i.snapshot})},n);for(var a=t.removedCount-1;a>=0;a--)n.emitPatch({op:"remove",path:""+(t.index+a),oldValue:t.removed[a].snapshot},n);for(var a=0;a<t.addedCount;a++)n.emitPatch({op:"add",path:""+(t.index+a),value:t.added[a].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=t.storedValue,o=n==="-"?i.length:Number(n);switch(a.op){case"replace":i[o]=a.value;break;case"add":i.splice(o,0,a.value);break;case"remove":i.splice(o,1);break}}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=t.storedValue;a.replace(n)}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return _m(t)?n0(t.map(function(i,o){return a._subType.validate(i,bm(n,""+o,a._subType))})):bs(n,t,"Value is not an array")}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ah}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.splice(Number(n),1)}}),r}(Oh);F1.prototype.applySnapshot=ca(F1.prototype.applySnapshot);function UO(e){return new F1("".concat(e.name,"[]"),e)}function Sb(e,r,t,n,a){for(var i=!0,o=0;;o++){var s=o<=n.length-1,c=t[o],u=s?n[o]:void 0,d=""+a[o];if(pO(u)&&(u=u.storedValue),!c&&!s)break;if(!s)i=!1,t.splice(o,1),c instanceof ms&&c.createObservableInstanceIfNeeded(),c.die(),o--;else if(c)if(xb(c,u))t[o]=vg(r,e,d,u,c);else{for(var y=void 0,f=o;f<t.length;f++)if(xb(t[f],u)){y=t.splice(f,1)[0];break}i=!1;var p=vg(r,e,d,u,y);t.splice(o,0,p)}else{if(An(u)&&nr(u).parent===e)throw new $t("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(d,"', but it lives already at '").concat(nr(u).path,"'"));i=!1;var p=vg(r,e,d,u);t.splice(o,0,p)}}return i?null:t}function vg(e,r,t,n,a){hc(e,n);function i(){if(An(n)){var s=nr(n);if(s.assertAlive(Ch),s.parent!==null&&s.parent===r)return s.setParent(r,t),s}return a?e.reconcile(a,n,r,t):e.instantiate(r,t,void 0,n)}var o=i();return a&&a!==o&&(a instanceof ms&&a.createObservableInstanceIfNeeded(),a.die()),o}function xb(e,r){if(!e.isAlive)return!1;if(An(r)){var t=nr(r);return t.isAlive&&t===e}if(e.snapshot===r)return!0;if(!(e instanceof ms))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&xf(r)&&n.is(r)&&n.isMatchingSnapshotId(e,r)}function HO(e){return _a(e)&&(e.flags&Or.Array)>0}var Eb="preProcessSnapshot",Pb="postProcessSnapshot";function VO(){return nr(this).toString()}var Ob={name:"AnonymousModel",properties:{},initializers:Ah};function GO(e){var r=Object.keys(e),t=new Set;return r.forEach(function(n){if(t.has(n))throw new $t("".concat(n," is declared twice in the model. Model should not contain the same keys"));t.add(n)}),r.reduce(function(n,a){if(a in ba)throw new $t("Hook '".concat(a,"' was defined as property. Hooks should be defined as part of the actions"));var i=Object.getOwnPropertyDescriptor(e,a);if("get"in i)throw new $t("Getters are not supported as properties. Please use views instead");var o=i.value;if(o==null)throw new $t("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(kh(o))n[a]=Pf(ZO(o),o);else if(o instanceof j1)n[a]=Pf(o,{});else if(o instanceof F1)n[a]=Pf(o,[]);else if(!_a(o))throw new $t("Invalid type definition for property '".concat(a,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},wa({},e))}var vp=function(e){Zn(r,e);function r(t){var n=e.call(this,t.name||Ob.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.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(a){return n.cloneAndEnhance({name:a})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return n.cloneAndEnhance({properties:a})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var i=n.preProcessor;return i?n.cloneAndEnhance({preProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({preProcessor:a})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var i=n.postProcessor;return i?n.cloneAndEnhance({postProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({postProcessor:a})}}),Object.assign(n,Ob,t),n.properties=GO(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(r.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(n,a){if(a.flags&Or.Identifier){if(t)throw new $t("Cannot define property '".concat(n,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=n}}),t}}),Object.defineProperty(r.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new r({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})}}),Object.defineProperty(r.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){return n.instantiateActions(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new $t("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(a){if(a===Eb)throw new $t("Cannot define action '".concat(Eb,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===Pb)throw new $t("Cannot define action '".concat(Pb,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var i=n[a],o=t[a];if(a in ba&&o){var s=i;i=function(){o.apply(null,arguments),s.apply(null,arguments)}}var c=i.$mst_middleware,u=i.bind(n);u._isFlowAction=i._isFlowAction||!1,u.$mst_middleware=c;var d=gp(t,a,u);n[a]=d,Ef(t,a,d)})}}),Object.defineProperty(r.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;if(typeof t!="function")throw new $t("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var a=function(i){return n.instantiateVolatileState(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new $t("volatile state initializer should return a plain object containing state");Z2(t,n)}}),Object.defineProperty(r.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){var o=t(i),s=o.actions,c=o.views,u=o.state,d=mP(o,["actions","views","state"]);for(var p in d)throw new $t("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(p,"'"));return u&&n.instantiateVolatileState(i,u),c&&n.instantiateViews(i,c),s&&n.instantiateActions(i,s),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){return n.instantiateViews(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new $t("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(a){var i,o=Object.getOwnPropertyDescriptor(n,a);if("get"in o)Q2(t,a,o),J2(t,(i={},i[a]=Tf,i));else if(typeof o.value=="function")Ef(t,a,o.value);else throw new $t("A view member should either be a function or getter based property")})}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=An(i)?i:this.applySnapshotPreProcessor(i);return wm(this,t,n,a,o)}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type,i={};return a.forAllProps(function(o,s){i[o]=s.instantiate(t,o,void 0,n[o])}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=wa(wa({},i0),{name:this.name});return Rn.object(t,Ch,n)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Ef(n,"toString",VO),this.forAllProps(function(a){X2(n,a,t.unbox)}),this.initializers.reduce(function(a,i){return i(a)},n),X1(n,this.willChange),Z1(n,this.didChange)}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=nr(n.object),i=n.name;a.assertWritable({subpath:i});var o=a.type.properties[i];return o&&(hc(o,n.newValue),n.newValue=o.reconcile(a.getChildNode(i),n.newValue,a,i)),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=nr(n.object),i=a.type.properties[n.name];if(i){var o=n.oldValue?n.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Wc(n.name),value:n.newValue.snapshot,oldValue:o},a)}}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=[];return this.forAllProps(function(i){a.push(n.getChildNode(t,i))}),a}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a;if(!(n in this.properties))throw new $t("Not a value property: "+n);var i=Zl(t.storedValue,n),o=(a=i.raw)===null||a===void 0?void 0:a.call(i);if(!o)throw new $t("Node not available for property "+n);return o}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var i={};return this.forAllProps(function(o,s){try{var c=Mu(t.storedValue,o);c.reportObserved()}catch{throw new $t("".concat(o," property is declared twice"))}i[o]=a.getChildNode(t,o).snapshot}),n?this.applySnapshotPostProcessor(i):i}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){if(!(a.op==="replace"||a.op==="add"))throw new $t("object does not support operation ".concat(a.op));t.storedValue[n]=a.value}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=this.applySnapshotPreProcessor(n);this.forAllProps(function(i){t.storedValue[i]=a[i]})}}),Object.defineProperty(r.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.preProcessor;return n?n.call(null,t):t}}),Object.defineProperty(r.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.postProcessor;return n?n.call(null,t):t}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,i=this.applySnapshotPreProcessor(t);return xf(i)?n0(this.propertyNames.map(function(o){return a.properties[o].validate(i[o],bm(n,o,a.properties[o]))})):bs(n,i,"Value is not a plain object")}}),Object.defineProperty(r.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.propertyNames.forEach(function(a){return t(a,n.properties[a])})}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(n){return n+": "+t.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ch}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue[n]=void 0}}),r}(Oh);vp.prototype.applySnapshot=ca(vp.prototype.applySnapshot);function WO(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new vp({name:t,properties:n})}function $O(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string",n=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(a,i){return a.cloneAndEnhance({name:a.name+"_"+i.name,properties:i.properties,initializers:i.initializers,preProcessor:function(o){return i.applySnapshotPreProcessor(a.applySnapshotPreProcessor(o))},postProcessor:function(o){return i.applySnapshotPostProcessor(a.applySnapshotPostProcessor(o))}})}).named(n)}function E8(e){return _a(e)&&(e.flags&Or.Object)>0}var vc=function(e){Zn(r,e);function r(t,n,a,i){i===void 0&&(i=bO);var o=e.call(this,t)||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:a}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:i}),o.flags=n,o}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(kh(t)&&this.checker(t))return ys();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return bs(n,t,"Value is not a ".concat(a))}}),r}(Ff),P8=new vc("string",Or.String,function(e){return typeof e=="string"}),O8=new vc("number",Or.Number,function(e){return typeof e=="number"}),YO=new vc("integer",Or.Integer,function(e){return wO(e)}),XO=new vc("float",Or.Float,function(e){return _O(e)}),KO=new vc("finite",Or.Finite,function(e){return SO(e)}),A8=new vc("boolean",Or.Boolean,function(e){return typeof e=="boolean"}),C8=new vc("null",Or.Null,function(e){return e===null}),k8=new vc("undefined",Or.Undefined,function(e){return e===void 0}),L8=new vc("Date",Or.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});L8.getSnapshot=function(e){return e.storedValue.getTime()};var N8=L8;function ZO(e){switch(typeof e){case"string":return P8;case"number":return O8;case"boolean":return A8;case"object":if(e instanceof Date)return N8}throw new $t("Cannot determine primitive type from value "+e)}function T8(e){return _a(e)&&(e.flags&(Or.String|Or.Number|Or.Integer|Or.Boolean|Or.Date))>0}var QO=function(e){Zn(r,e);function r(t){var n=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Literal}),n.value=t,n}return Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return kh(t)&&t===this.value?ys():bs(n,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),r}(Ff);function R8(e){return new QO(e)}function JO(e){return _a(e)&&(e.flags&Or.Literal)>0}var eA=function(e){Zn(r,e);function r(t,n,a,i){var o=e.call(this,t)||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:a}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:i}),o}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Or.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this._subtype.validate(t,n);if(a.length>0)return a;var i=An(t)?nr(t).snapshot:t;return this._predicate(i)?ys():bs(n,t,this._message(t))}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),r}(pc);function tA(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string"?e.shift():_a(e[0])?e[0].name:null,n=e[0],a=e[1],i=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new eA(t,n,a,i)}function rA(e){return _a(e)&&(e.flags&Or.Refinement)>0}function nA(e,r){var t=typeof e=="string"?r:e,n=a0.apply(void 0,ju([],Iu(t.map(function(a){return R8(""+a)})),!1));return typeof e=="string"&&(n.name=e),n}var iA=function(e){Zn(r,e);function r(t,n,a){var i=e.call(this,t)||this;return Object.defineProperty(i,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),a=wa({eager:!0,dispatcher:void 0},a),i._dispatcher=a.dispatcher,a.eager||(i._eager=!1),i}return Object.defineProperty(r.prototype,"flags",{get:function(){var t=Or.Union;return this._types.forEach(function(n){t|=n.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(n){return n.isAssignableFrom(t)})}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.determineType(i,void 0);if(!o)throw new $t("No matching type for union "+this.describe());return o.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.determineType(n,t.getReconciliationType());if(!o)throw new $t("No matching type for union "+this.describe());return o.reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._dispatcher?this._dispatcher(t):n?n.is(t)?n:this._types.filter(function(a){return a!==n}).find(function(a){return a.is(t)}):this._types.find(function(a){return a.is(t)})}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._dispatcher)return this._dispatcher(t).validate(t,n);for(var a=[],i=0,o=0;o<this._types.length;o++){var s=this._types[o],c=s.validate(t,n);if(c.length===0){if(this._eager)return ys();i++}else a.push(c)}return i===1?ys():bs(n,t,"No type is applicable for the union").concat(n0(a))}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),r}(pc);function a0(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var n=_a(e)?void 0:e,a=_a(e)?ju([e],Iu(r),!1):r,i="("+a.map(function(o){return o.name}).join(" | ")+")";return new iA(i,a,n)}function M8(e){return _a(e)&&(e.flags&Or.Union)>0}var aA=function(e){Zn(r,e);function r(t,n,a){var i=e.call(this,t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:a}),i}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Or.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(this.optionalValues.indexOf(i)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,n,a,o)}return this._subtype.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.reconcile(t,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),a,i)}}),Object.defineProperty(r.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&hc(this,t),t}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.optionalValues.indexOf(t)>=0?ys():this._subtype.validate(t,n)}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),r}(pc);function oA(e,r){if(typeof r!="function"&&An(r))throw new $t("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Pf(e,r,t){return oA(e,r),new aA(e,r,t||sA)}var sA=[void 0];function lA(e){return _a(e)&&(e.flags&Or.Optional)>0}var uA=Pf(k8,void 0),cA=Pf(C8,null);function I8(e){return a0(e,uA)}function fA(e){return a0(e,cA)}var hA=function(e){Zn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Object.defineProperty(r.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Or.Late},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var n=void 0;try{n=this._definition()}catch(a){if(a instanceof ReferenceError)n=void 0;else throw a}if(t&&n===void 0)throw new $t("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.getSubType(!0).instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.getSubType(!0).reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.getSubType(!1);return a?a.validate(t,n):ys()}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getSubType(!1);return n?n.isAssignableFrom(t):!1}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||n8}}),r}(pc);function dA(e,r){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?r:e;return new hA(t,n)}function pA(e){return _a(e)&&(e.flags&Or.Late)>0}function gA(e,r){return new vA(e,r)}var vA=function(e){Zn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Rn.array()}),_2(function(){return a.pendingNodeList.length>0&&a.pendingNodeList.some(function(i){return i.isAlive&&a.options.shouldLoadPredicate(i.parent?i.parent.value:null)})},function(){a.options.loadType().then(ca(function(i){a.loadedType=i,a.pendingNodeList.forEach(function(o){o.parent&&a.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),a}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this;if(this.loadedType)return this.loadedType.instantiate(t,n,a,i);var s=nf(this,t,n,a,i);return this.pendingNodeList.push(s),_2(function(){return!s.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(s),1)}),s}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.loadedType?this.loadedType.validate(t,n):y8(t)?ys():bs(n,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.loadedType?(t.die(),this.loadedType.instantiate(a,i,a.environment,n)):e.prototype.reconcile.call(this,t,n,a,i)}}),r}(Ff),j8=function(e){Zn(r,e);function r(t){var n=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Frozen}),n}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return y8(t)?this.subType?this.subType.validate(t,n):ys():bs(n,t,"Value is not serializable and cannot be frozen")}}),r}(Ff),Ab=new j8;function mA(e){return arguments.length===0?Ab:_a(e)?new j8(e):Pf(Ab,e)}function yA(e){return _a(e)&&(e.flags&Or.Frozen)>0}function bA(e){switch(e){case ba.beforeDestroy:return"destroy";case ba.beforeDetach:return"detach";default:return}}var wA=function(){function e(r,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Em(r))this.identifier=r;else if(An(r)){var n=nr(r);if(!n.identifierAttribute)throw new $t("Can only store references with a defined identifier attribute.");var a=n.unnormalizedIdentifier;if(a==null)throw new $t("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new $t("Can only store references to tree nodes or identifiers, got: '".concat(r,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=jh(this.identifier),n=r.root,a=n.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==a){var i=this.targetType,o=n.identifierCache.resolve(i,t);if(!o)throw new xm("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(r.path,")"));this.resolvedReference={node:o,lastCacheModification:a}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),xm=function(e){Zn(r,e);function r(t){var n=e.call(this,t)||this;return Object.setPrototypeOf(n,r.prototype),n}return r}(Error),F8=function(e){Zn(r,e);function r(t,n){var a=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(a,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Reference}),a}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return Em(t)?ys():bs(n,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(r.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=n.parent;if(!(!o||!o.isAlive)){var s=o.storedValue;s&&this.onInvalidated({cause:t,parent:s,invalidTarget:i?i.storedValue:void 0,invalidId:a,replaceRef:function(c){Ph(n.root.storedValue,{op:"replace",value:c,path:n.path})},removeRef:function(){E8(o.type)?this.replaceRef(void 0):Ph(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(r.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,i=this.getValue(t);if(i){var o=nr(i),s=function(d,p){var y=bA(p);y&&a.fireInvalidated(y,t,n,o)},c=o.registerHook(ba.beforeDetach,s),u=o.registerHook(ba.beforeDestroy,s);return function(){c(),u()}}}}),Object.defineProperty(r.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=this;if(this.onInvalidated){var o;t.registerHook(ba.beforeDestroy,function(){o&&o()});var s=function(c){o&&o();var u=t.parent,d=u&&u.storedValue;if(u&&u.isAlive&&d){var p=void 0;a?p=!!a.get(n,d):p=t.root.identifierCache.has(i.targetType,jh(n)),p?o=i.addTargetNodeWatcher(t,n):c||i.fireInvalidated("invalidSnapshotReference",t,n,null)}};t.state===no.FINALIZED?s(!0):(t.isRoot||t.root.registerHook(ba.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(ba.afterAttach,function(){s(!1)}))}}}),r}(Ff),_A=function(e){Zn(r,e);function r(t,n){return e.call(this,t,n)||this}return Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=t.storedValue;return n.resolvedValue}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t.storedValue;return n.identifier}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=An(i)?Z6(i):i,s=new wA(i,this.targetType),c=nf(this,t,n,a,s);return s.node=c,this.watchTargetNodeForInvalidations(c,o,void 0),c}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t.isDetaching&&t.type===this){var o=An(n),s=t.storedValue;if(!o&&s.identifier===n||o&&s.resolvedValue===n)return t.setParent(a,i),t}var c=this.instantiate(a,i,void 0,n);return t.die(),c}}),r}(F8),SA=function(e){Zn(r,e);function r(t,n,a){var i=e.call(this,t,a)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return n}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=An(i)?this.options.set(i,t?t.storedValue:null):i,s=nf(this,t,n,a,o);return this.watchTargetNodeForInvalidations(s,o,this.options),s}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=An(n)?this.options.set(n,t?t.storedValue:null):n;if(!t.isDetaching&&t.type===this&&t.storedValue===o)return t.setParent(a,i),t;var s=this.instantiate(a,i,void 0,o);return t.die(),s}}),r}(F8);function D8(e,r){var t=r||void 0,n=r?r.onInvalidated:void 0;return t&&(t.get||t.set)?new SA(e,{get:t.get,set:t.set},n):new _A(e,n)}function xA(e){return _a(e)&&(e.flags&Or.Reference)>0}function EA(e,r){var t=D8(e,wa(wa({},r),{onInvalidated:function(n){r&&r.onInvalidated&&r.onInvalidated(n),n.removeRef()}}));return r&&r.acceptsUndefined===!1?t:I8(t)}var B8=function(e){Zn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Identifier}),a}return Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t||!(t.type instanceof vp))throw new $t("Identifier types can only be instantiated as direct child of a model type");return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(t.storedValue!==n)throw new $t("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return t.setParent(a,i),t}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return typeof t!==this.validType?bs(n,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):ys()}}),r}(Ff),PA=function(e){Zn(r,e);function r(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Identifier}),t}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),r}(B8),OA=function(e){Zn(r,e);function r(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),r}(B8),AA=new PA,CA=new OA;function kA(e){return _a(e)&&(e.flags&Or.Identifier)>0}function jh(e){return""+e}function Em(e){return typeof e=="string"||typeof e=="number"}function LA(e){return new NA(e)}var NA=function(e){Zn(r,e);function r(t){var n=e.call(this,t.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Custom}),n}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.options.isTargetType(t))return ys();var a=this.options.getValidationMessage(t);return a?bs(n,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):ys()}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.options.isTargetType(i)?i:this.options.fromSnapshot(i,t&&t.root.environment);return nf(this,t,n,a,o)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=!this.options.isTargetType(n);if(!t.isDetaching){var s=t.type===this&&(o?n===t.snapshot:n===t.storedValue);if(s)return t.setParent(a,i),t}var c=o?this.options.fromSnapshot(n,a.root.environment):n,u=this.instantiate(a,i,void 0,c);return t.die(),u}}),r}(Ff),Cb={enumeration:nA,model:WO,compose:$O,custom:LA,reference:D8,safeReference:EA,union:a0,optional:Pf,literal:R8,maybe:I8,maybeNull:fA,refinement:tA,string:P8,boolean:A8,number:O8,integer:YO,float:XO,finite:KO,Date:N8,map:qO,array:UO,frozen:mA,identifier:AA,identifierNumber:CA,late:dA,lazy:gA,undefined:k8,null:C8,snapshotProcessor:DO};const TA=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:DP,addMiddleware:l8,applyAction:i8,applyPatch:Ph,applySnapshot:Y6,cast:UP,castFlowReturn:CO,castToReferenceSnapshot:VP,castToSnapshot:HP,clone:IP,createActionTrackingMiddleware:XP,createActionTrackingMiddleware2:ZP,decorate:nO,destroy:FP,detach:jP,escapeJsonPath:Wc,flow:_8,getChildType:yP,getEnv:BP,getIdentifier:Z6,getLivelinessChecking:G6,getMembers:zP,getNodeId:GP,getParent:PP,getParentOfType:AP,getPath:K6,getPathParts:CP,getPropertyMembers:e8,getRelativePath:MP,getRoot:X6,getRunningActionContext:ym,getSnapshot:gm,getType:Cp,hasEnv:qP,hasParent:EP,hasParentOfType:OP,isActionContextChildOf:oO,isActionContextThisOrChildOf:sO,isAlive:vm,isArrayType:HO,isFrozenType:yA,isIdentifierType:kA,isLateType:pA,isLiteralType:JO,isMapType:zO,isModelType:E8,isOptionalType:lA,isPrimitiveType:T8,isProtected:xP,isReferenceType:xA,isRefinementType:rA,isRoot:kP,isStateTreeNode:An,isType:_a,isUnionType:M8,isValidReference:RP,joinJsonPath:I1,onAction:a8,onPatch:$6,onSnapshot:bP,process:mO,protect:_P,recordActions:tO,recordPatches:wP,resolveIdentifier:NP,resolvePath:LP,setLivelinessChecking:V6,setLivelynessChecking:vP,splitJsonPath:Lh,t:Cb,toGenerator:LO,toGeneratorFunction:kO,tryReference:TP,tryResolve:Q6,typecheck:f8,types:Cb,unescapeJsonPath:S8,unprotect:SP,walk:J6},Symbol.toStringTag,{value:"Module"})),hl=Zc(TA);var mg={},kb;function q8(){return kb||(kb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=function({oldText:r,newText:t,element:n}){if(!(t.length/Math.max(20,r.length)>=4))return n.fontSize;const a=n.width*n.page.computedHeight/t.length,i=1.5*Math.sqrt(a),o=n.fontSize;return Math.min(o,Math.max(5,Math.round(i)))}}(mg)),mg}var Lb;function z8(){return Lb||(Lb=1,function(e){var r=Bd&&Bd.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=M,e.getDir=N,e.usePrevious=j;const t=r(ni()),n=Us,a=Fu,i=Mh,o=vs,s=r(Hs()),c=pP,u=Op(),d=jf(),p=Ih(),y=gc(),f=pm(),_=Ap(),S=If(),w=rf(),x=hl,v=q8();let g;function E(){return g||(g=document.getElementById("polotno-text-style"),g||(g=document.createElement("style"),g.id="polotno-text-style",document.head.appendChild(g)),g)}s.default._fixTextRendering=!0;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 M(O){O=O.replace(/\s/g,"");let C=0;for(var A=0;A<O.length;A++)k=O[A],T="֑-߿יִ-﷽ﹰ-ﻼ",new RegExp("^[^"+T+"]*?["+T+"]").test(k)&&(C+=1);var k,T;return C>O.length/2}function N(O){return M(O)?"rtl":"ltr"}const R=(0,n.observer)(({textNodeRef:O,element:C,onBlur:A,selectAll:k,cursorPosition:T})=>{const[V,G]=t.default.useState(b),$=O.current;t.default.useLayoutEffect(()=>{const D={};D.width=$.width()-2*$.padding()+"px",D.height=$.height()-2*$.padding()+$.fontSize()*$.lineHeight()+"px",D.fontSize=$.fontSize()+"px",D.lineHeight=$.lineHeight()+.01,D.fontFamily=$.fontFamily(),D.textAlign=$.align(),D.color=$.fill(),D.fontWeight=C.fontWeight,D.fontStyle=C.fontStyle,D.letterSpacing=C.letterSpacing+"em",D.opacity=Math.max(C.a.opacity,.2);const Y=`
|
|
96
|
+
.polotno-input::placeholder {
|
|
97
|
+
color: ${V.color};
|
|
98
|
+
opacity: 0.6;
|
|
99
|
+
}
|
|
100
|
+
`,Q=E();Q.innerHTML="",Q.appendChild(document.createTextNode(Y)),JSON.stringify(D)!==JSON.stringify(V)&&G(D)});const te=t.default.useRef(null);t.default.useLayoutEffect(()=>{var D;const Y=te.current;if(!Y)return;(D=te.current)===null||D===void 0||D.focus();const Q=T||Y.value.length;Y.selectionStart=Y.selectionEnd=Q,k&&(Y==null||Y.select(),document.execCommand("selectAll",!1,null))},[]),t.default.useEffect(()=>{window.addEventListener("blur",A);const D=Y=>{var Q;!((Q=te.current)===null||Q===void 0)&&Q.contains(Y.target)||A()};return window.addEventListener("touchstart",D),()=>{window.removeEventListener("blur",A),window.removeEventListener("touchstart",D)}},[]);let W=0;const U=$.textArr.length*$.lineHeight()*$.fontSize();C.verticalAlign==="middle"&&(W=(C.a.height-U)/2),C.verticalAlign==="bottom"&&(W=C.a.height-U);const z=(0,f.removeTags)(C.text);return t.default.createElement("textarea",{className:"polotno-input",ref:te,dir:N(z),style:Object.assign(Object.assign(Object.assign({},b),V),{paddingTop:W+"px"}),value:z,onChange:D=>{const Y=(0,v.getLimitedFontSize)({oldText:C.text,newText:D.target.value,element:C});C.set({text:D.target.value,fontSize:Y})},placeholder:C.placeholder,onBlur:A})}),F=O=>t.default.createElement(i.Html,null,t.default.createElement(R,Object.assign({},O)));function j(O){const C=t.default.useRef(O),A=t.default.useRef(O);return t.default.useMemo(()=>{A.current=C.current,C.current=O},[O]),A.current}e.useFontLoader=(O,C)=>{const[A,k]=t.default.useReducer(V=>V+1,0),T=t.default.useRef((0,p.isFontLoaded)(C));return t.default.useLayoutEffect(()=>{if(T.current=(0,p.isFontLoaded)(C),T.current)return;let V=!0;return(async()=>{T.current=!1,k();const G=(0,d.incrementLoader)(`text ${C}`);await O.loadFont(C),setTimeout(G,100),V&&(T.current=!0,k())})(),()=>{V=!1}},[C]),[T.current]},e.getLineHeight=({fontLoaded:O,fontFamily:C,fontSize:A,lineHeight:k})=>t.default.useMemo(()=>{if(typeof k=="number")return k;const T=document.createElement("div");T.style.fontFamily=C,T.style.fontSize=A+"px",T.style.lineHeight=k,T.innerText="Test text",document.body.appendChild(T);const V=T.offsetHeight;return document.body.removeChild(T),V/A},[O,C,A,k]),e.TextElement=(0,n.observer)(({element:O,store:C})=>{const A=t.default.useRef(null),k=t.default.useRef(null),{editorEnabled:T,selectAll:V}=(we=>{const[me,Ee]=t.default.useState(!1),Te=t.default.useRef(!1);return t.default.useEffect(()=>{var he=!0;return setTimeout(()=>{he&&(we._editModeEnabled&&(Te.current=!0),Ee(!0),setTimeout(()=>{Te.current=!1},50))},50),()=>{he=!1}},[]),{editorEnabled:me&&we._editModeEnabled,selectAll:Te.current}})(O),[G,$]=t.default.useState(!1),te=t.default.useRef(O.a.height),W=C.selectedShapes.indexOf(O)>=0&&O.selectable,{textVerticalResizeEnabled:U}=y.flags,z=j(O.fontFamily),[D,Y]=t.default.useState([]);t.default.useEffect(()=>{var we,me;const Ee=(me=(we=A.current)===null||we===void 0?void 0:we.textArr)!==null&&me!==void 0?me:[];JSON.stringify(Ee)!==JSON.stringify(D)&&Y(Ee)}),t.default.useEffect(()=>{if(O.a.width)return;const we=A.current;we.width(600),O.set({width:1.4*we.getTextWidth()})},[]),t.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const we=A.current;(0,_.applyFilter)(we,O)}));const[Q]=(0,e.useFontLoader)(C,O.fontFamily),J=(0,f.removeTags)(O.text),Z=()=>{const we=A.current.clone({height:void 0}),me=Math.ceil(we.fontSize()*we.lineHeight()*we.textArr.length+1);return we.destroy(),me};t.default.useLayoutEffect(()=>{if(!Q)return;const{textOverflow:we,textSplitAllowed:me}=y.flags;if(O.a.height){if(!C.isPlaying)if(we!=="change-font-size"||G){if(we==="resize"){const Ee=Z();U&&O.a.height<Ee&&C.history.ignore(()=>{var Te;(0,x.isAlive)(O)&&O.set({height:Ee}),(Te=A.current)===null||Te===void 0||Te.height(Ee)},!1,!0),U||O.a.height===Ee||G||C.history.ignore(()=>{var Te;(0,x.isAlive)(O)&&O.set({height:Ee}),(Te=A.current)===null||Te===void 0||Te.height(Ee)},!1,!0)}}else{const Ee=function(he,Re,Ie=!1){const Xe=he.fontSize(),rt=he.height(),vt=(0,f.removeTags)(Re.text);let et=Re.a.fontSize;he.height(void 0);const yt=Math.round(2*Re.a.fontSize)-1;for(let mt=1;mt<yt;mt++){const ct=Re.a.height&&he.height()>Re.a.height;let Bt=vt.split(`
|
|
101
|
+
`).join(" ").split(/[\s-]+/).reduce((Gt,Be)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(Be)?Gt.concat(Be.split("")):Gt.concat(Be),[]),Pt=he.textArr.map(Gt=>Gt.text).join(";");const Yt=Bt.find(Gt=>!Pt.includes(Gt)||(Pt=Pt.replace(Gt,""),!1));if(!(ct||Yt&&!Ie))break;et-=.5,he.fontSize(et)}return he.fontSize(Xe),he.height(rt),et}(A.current,O,me);if(Ee!==O.a.fontSize)return void C.history.ignore(()=>{O.set({fontSize:Ee})},!1,!0);const Te=Z();O.a.height===Te||U||C.history.ignore(()=>{O.set({height:Te})},!1,!0)}}else{const Ee=Z();C.history.ignore(()=>{O.set({height:Ee})},!1,!0)}}),t.default.useLayoutEffect(()=>{const we=A.current;we&&(we.width(we.width()+1e-8),we._setTextData(),(0,_.applyFilter)(we,O))},[Q]);const ae=t.default.useRef(null),se=t.default.useRef(0),ce=we=>{we.evt.preventDefault(),C.selectedShapes.find(Ee=>Ee===O)&&O.contentEditable&&(se.current=function(Ee){var Te;const he=Ee.target,Re=function(yt){var mt=yt.getAbsoluteTransform().copy();mt.invert();var ct=yt.getStage().getPointerPosition();return mt.point(ct)}(he),Ie=he.textArr,Xe=Math.floor(Re.y/(he.fontSize()*he.lineHeight())),rt=Ie.slice(0,Xe).reduce((yt,mt)=>yt+mt.text.length,Xe),vt=(Te=Ie[Xe])!==null&&Te!==void 0?Te:Ie[0];let et=0;return he.align()==="right"?et=he.width()-vt.width:he.align()==="center"&&(et=he.width()/2-vt.width/2),rt+Math.round((Re.x-et)/vt.width*vt.text.length)}(we),O.toggleEditMode())},de=!J&&O.placeholder?.6:O.a.opacity;(0,S.useFadeIn)(A,de);const Oe=(0,e.getLineHeight)({fontLoaded:Q,fontFamily:O.fontFamily,fontSize:O.a.fontSize,lineHeight:O.lineHeight}),Le=O.selectable||C.role==="admin",ke=(0,u.useColor)(O),Se=t.default.useMemo(()=>O.backgroundEnabled?function({lines:we,lineHeight:me,width:Ee,align:Te="left",padding:he=0,cornerRadius:Re=0}){var Ie;we.forEach((et,yt)=>{et.cx=Ee/2,Te==="right"?et.cx=Ee-et.width/2:Te==="left"&&(et.cx=et.width/2),Te!=="justify"||et.lastInParagraph||(et.width=Ee),Te==="justify"&&(et.cx=et.width/2)});let Xe=`M ${(Ie=we[0])===null||Ie===void 0?void 0:Ie.cx} ${-he}`;we.forEach((et,yt)=>{const{cx:mt}=et,ct=we[yt-1];ct&&ct.width>et.width?Xe+=` L ${mt+et.width/2+he} ${yt*me+he}`:Xe+=` L ${mt+et.width/2+he} ${yt*me-he}`;const Bt=we[yt+1];Bt&&Bt.width>et.width?Xe+=` L ${mt+et.width/2+he} ${(yt+1)*me-he}`:Xe+=` L ${mt+et.width/2+he} ${(yt+1)*me+he}`});for(var rt=we.length-1;rt>=0;rt--){const et=we[rt],{cx:yt}=et,mt=we[rt+1];mt&&mt.width>et.width?Xe+=` L ${yt-et.width/2-he} ${(rt+1)*me-he}`:Xe+=` L ${yt-et.width/2-he} ${(rt+1)*me+he}`;const ct=we[rt-1];ct&&ct.width>et.width?Xe+=` L ${yt-et.width/2-he} ${rt*me+he}`:Xe+=` L ${yt-et.width/2-he} ${rt*me-he}`}Xe+=" Z";const vt=(0,c.parsePath)(Xe);return(0,c.roundCommands)(vt,Re).path}({lines:JSON.parse(JSON.stringify(D)),cornerRadius:O.backgroundCornerRadius*(O.a.fontSize*Oe*.5),lineHeight:Oe*O.a.fontSize,padding:O.backgroundPadding*(O.a.fontSize*Oe*.5),width:O.a.width,align:O.align}):"",[O.backgroundEnabled,O.backgroundCornerRadius,O.a.fontSize,Oe,O.backgroundPadding,O.a.width,O.align,D]),ye=(0,w.isTouchDevice)();let Je=0;return O.verticalAlign==="middle"?Je=(O.a.height-D.length*Oe*O.a.fontSize)/2:O.verticalAlign==="bottom"&&(Je=O.a.height-D.length*Oe*O.a.fontSize),t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Path,{ref:k,x:O.a.x,y:O.a.y,rotation:O.a.rotation,hideInExport:!O.showInExport,listening:!1,visible:O.backgroundEnabled,opacity:O.backgroundOpacity*de,data:Se,fill:O.backgroundColor,offsetY:-Je}),t.default.createElement(a.Text,Object.assign({ref:A,id:O.id,name:"element",hideInExport:!O.showInExport,editModeEnabled:O._editModeEnabled,x:O.a.x,y:O.a.y,rotation:O.a.rotation,width:O.a.width,height:O.a.height,text:J||O.placeholder,direction:N(J)},ke,{stroke:O.stroke,lineJoin:"round",strokeWidth:O.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:O.a.fontSize,fontFamily:`"${O.fontFamily}", "${z}"`,fontStyle:O.fontStyle+" "+O.fontWeight,textDecoration:O.textDecoration,align:O.align,verticalAlign:O.verticalAlign,draggable:ye?O.draggable&&W:O.draggable,preventDefault:!ye||W,opacity:de,visible:!O._editModeEnabled,ellipsis:y.flags.textOverflow==="ellipsis",shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,lineHeight:Oe,letterSpacing:O.letterSpacing*O.a.fontSize,listening:Le,onDragMove:we=>{O.set({x:we.target.x(),y:we.target.y()})},onDragEnd:we=>{O.set({x:we.target.x(),y:we.target.y()})},onClick:ce,onTap:ce,onTransformStart:()=>{$(!0),te.current=A.current.height()},onTransform:we=>{var me,Ee,Te;const he=we.target;(me=k.current)===null||me===void 0||me.setAttrs({x:he.x(),y:he.y(),rotation:he.rotation(),scale:he.scale()});const Re=((Ee=he.getStage())===null||Ee===void 0?void 0:Ee.findOne("Transformer")).getActiveAnchor();if(Re==="middle-left"||Re==="middle-right"){const Xe=he.scaleX(),rt=he.width()*Xe,vt=O.a.fontSize;let et=rt;rt<vt&&(et=vt,ae.current&&he.position(ae.current)),he.width(et),he.scaleX(1),he.scaleY(1);const yt=Z();if(y.flags.textOverflow!=="ellipsis"){const ct=Math.max(yt,te.current);he.height(ct),O.set({height:he.height()})}const mt=y.flags.textVerticalResizeEnabled?Math.max(yt,te.current):Z();O.set({x:he.x(),width:he.width(),rotation:he.rotation(),height:mt}),(0,_.applyFilter)(he,O)}if(Re==="top-center"||Re==="bottom-center"){let Xe=y.flags.textOverflow==="resize"?Z():Oe*O.a.fontSize;we.target.height(Math.max(Xe,we.target.height()*we.target.scaleY())),we.target.scaleY(1)}ae.current=we.target.position();const Ie=we.target.scaleX();(Te=k.current)===null||Te===void 0||Te.setAttrs({scaleX:1,scaleY:1}),we.target.scaleX(1),we.target.scaleY(1),O.set({fontSize:O.a.fontSize*Ie,width:we.target.width()*Ie,x:we.target.x(),y:we.target.y(),rotation:we.target.rotation(),height:we.target.height()*Ie,shadowBlur:O.shadowBlur*Ie,shadowOffsetX:O.shadowOffsetX*Ie,shadowOffsetY:O.shadowOffsetY*Ie,strokeWidth:O.strokeWidth*Ie})},onTransformEnd:we=>{var me;const Ee=we.target.scaleX();we.target.scaleX(1),we.target.scaleY(1),O.set({fontSize:Math.round(O.a.fontSize*Ee),width:Math.ceil(we.target.width()*Ee),x:we.target.x(),y:we.target.y(),rotation:we.target.rotation(),height:we.target.height()*Ee,shadowBlur:O.shadowBlur*Ee,shadowOffsetX:O.shadowOffsetX*Ee,shadowOffsetY:O.shadowOffsetY*Ee,strokeWidth:O.strokeWidth*Ee}),(me=k.current)===null||me===void 0||me.setAttrs({scaleX:1,scaleY:1}),$(!1)}})),T&&t.default.createElement(a.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation},t.default.createElement(F,{textNodeRef:A,element:O,selectAll:V,cursorPosition:se.current,onBlur:()=>{O.toggleEditMode(!1),O.text===""&&O.removable&&!O.placeholder&&C.deleteElements([O.id])}})))})}(Bd)),Bd}var Fl={},Vd={},yg={exports:{}},bg={exports:{}},Nb;function Pm(){return Nb||(Nb=1,function(e,r){e.exports=t;function t(a){return n.bind(null,a)}function n(a){var i=[].slice.call(arguments,1);i.unshift("["+a+"]"),process.stderr.write(i.join(" ")+`
|
|
102
|
+
`)}}(bg)),bg.exports}var Tb;function U8(){return Tb||(Tb=1,function(e,r){Pm()("lex"),e.exports=t;function t(n){var a="",i,o=0,s=-1,c=0,u=1,d="before-selector",p=[d],y={},f=[],_=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function S(){return R(),n[s]}function w(G){return G?p[p.length-1-G]:d}function x(G){var $=s+1;return G===n.slice($,$+G.length)}function v(G){var $=n.slice(s).indexOf(G);return $>0?$:!1}function g(G){return G===E(1)}function E(G){return n[s+(G||1)]}function b(){var G=p.pop();return d=p[p.length-1],G}function M(G){return d=G,p.push(d),p.length}function N(G){var $=d;return p[p.length-1]=d=G,$}function R(G){if((G||1)==1)n[s]==`
|
|
103
|
+
`?(u++,o=1):o++,s++;else{var $=n.slice(s,s+G).split(`
|
|
104
|
+
`);$.length>1&&(u+=$.length-1,o=1),o+=$[$.length-1].length,s=s+G}}function F(){y.end={line:u,col:o},f.push(y),a="",y={}}function j(G){y={type:G,start:{line:u,col:o}}}for(;i=S();)switch(i){case" ":switch(w()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":a+=i;break}break;case`
|
|
105
|
+
`:case" ":case"\r":case"\f":switch(w()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":a+=i;break;case"at-value":i===`
|
|
106
|
+
`&&(y.value=a.trim(),F(),b());break}break;case":":switch(w()){case"name":y.name=a.trim(),a="",N("before-value");break;case"before-selector":a+=i,j("selector"),M("selector");break;case"before-value":N("value"),a+=i;break;default:a+=i;break}break;case";":switch(w()){case"name":case"before-value":case"value":a.trim().length>0&&(y.value=a.trim(),F()),N("before-name");break;case"value-paren":a+=i;break;case"at-value":y.value=a.trim(),F(),b();break;case"before-name":break;default:a+=i;break}break;case"{":switch(w()){case"selector":if(E(-1)==="\\"){a+=i;break}y.text=a.trim(),F(),N("before-name"),c=c+1;break;case"at-group":switch(y.name=a.trim(),y.type){case"font-face":case"viewport":case"page":M("before-name");break;default:M("before-selector")}F(),c=c+1;break;case"name":case"at-rule":y.name=a.trim(),F(),M("before-name"),c=c+1;break;case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":N("value"),a+=i;break}break;case"}":switch(w()){case"before-name":case"name":case"before-value":case"value":a&&(y.value=a.trim()),y.name&&y.value&&F(),j("end"),F(),b(),w()==="at-group"&&(j("at-group-end"),F(),b()),c>0&&(c=c-1);break;case"at-group":case"before-selector":case"selector":if(E(-1)==="\\"){a+=i;break}c>0&&w(1)==="at-group"&&(j("at-group-end"),F()),c>1&&b(),c>0&&(c=c-1);break;case"double-string":case"single-string":case"comment":a+=i;break}break;case'"':case"'":switch(w()){case"double-string":i==='"'&&E(-1)!=="\\"&&b();break;case"single-string":i==="'"&&E(-1)!=="\\"&&b();break;case"before-at-value":N("at-value"),M(i==='"'?"double-string":"single-string");break;case"before-value":N("value"),M(i==='"'?"double-string":"single-string");break;case"comment":break;default:E(-1)!=="\\"&&M(i==='"'?"double-string":"single-string")}a+=i;break;case"/":switch(w()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":case"selector":case"name":case"value":if(g("*")){var O=v("*/");O&&R(O+1)}else w()=="before-value"&&N("value"),a+=i;break;default:g("*")?(j("comment"),M("comment"),R()):a+=i;break}break;case"*":switch(w()){case"comment":g("/")?(y.text=a,R(),F(),b()):a+=i;break;case"before-selector":a+=i,j("selector"),M("selector");break;case"before-value":N("value"),a+=i;break;default:a+=i}break;case"@":switch(w()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":N("value"),a+=i;break;default:for(var C=!1,A,k,T=0,V=_.length;!C&&T<V;++T)k=_[T],A=k.name||k,x(A)&&(C=!0,j(A),M(k.state||"at-group"),R(A.length),k.prefix&&(y.prefix=k.prefix),k.type&&(y.type=k.type));C||(a+=i);break}break;case"(":switch(w()){case"value":M("value-paren");break;case"before-value":N("value");break}a+=i;break;case")":switch(w()){case"value-paren":b();break;case"before-value":N("value");break}a+=i;break;default:switch(w()){case"before-selector":j("selector"),M("selector");break;case"before-name":j("property"),N("name");break;case"before-value":N("value");break;case"before-at-value":N("at-value");break}a+=i;break}return f}}(yg)),yg.exports}var wg={exports:{}},Rb;function RA(){return Rb||(Rb=1,function(e,r){Pm()("parse");var t=U8();e.exports=s;var n,a,i,o;function s(b,M){M||(M={}),n=!!M.comments,i=!!M.position,a=0,o=Array.isArray(b)?b.slice():t(b);for(var N,R=[],F;F=u();)N=x(F),N&&R.push(N);return{type:"stylesheet",stylesheet:{rules:R}}}function c(b,M){M||(M={});for(var N,R=["type","name","value"],F={},j=0;j<R.length;++j)N=R[j],b[N]&&(F[N]=M[N]||b[N]);for(R=Object.keys(M),j=0;j<R.length;++j)N=R[j],F[N]||(F[N]=M[N]);return i&&(F.position={start:b.start,end:b.end}),F}function u(){var b=o.shift();return b}function d(b){a=a+1;var M={};switch(b.type){case"font-face":case"viewport":M.declarations=g();break;case"page":M.prefix=b.prefix,M.declarations=g();break;default:M.prefix=b.prefix,M.rules=E()}return c(b,M)}function p(b){return c(b)}function y(b){return c(b)}function f(b){return c(b,{text:b.text})}function _(b){return c(b)}function S(b){return c(b)}function w(b){function M(N){return N.trim()}return c(b,{type:"rule",selectors:b.text.split(",").map(M),declarations:g()})}function x(b){switch(b.type){case"property":return S(b);case"selector":return w(b);case"at-group-end":a=a-1;return;case"media":case"keyframes":return d(b);case"comment":if(n)return f(b);break;case"charset":return y(b);case"import":return p(b);case"namespace":return _(b);case"font-face":case"supports":case"viewport":case"document":case"page":return d(b)}}function v(b){for(var M,N=[],R;(R=u())&&b&&b(R);)M=x(R),M&&N.push(M);return R&&R.type!=="end"&&o.unshift(R),N}function g(){return v(function(b){return b.type==="property"||b.type==="comment"})}function E(){return v(function(){return a})}}(wg)),wg.exports}var _g={exports:{}},Mb;function MA(){return Mb||(Mb=1,function(e,r){Pm()("stringify");var t,n,a,i,o,s;e.exports=c;function c(E,b){b||(b={}),a=b.indentation||"",n=!!b.compress,t=!!b.comments,i=1,n?o=s="":(o=`
|
|
107
|
+
`,s=" ");var M=_(E.stylesheet.rules,v).join(`
|
|
108
|
+
`).trim();return M}function u(E){if(E){i+=E;return}return n?"":Array(i).join(a||"")}function d(E){return"@"+E.type+" "+E.value+";"+o}function p(E){var b="",M=E.prefix||"";E.name&&(b=" "+E.name);var N=E.type!=="page";return"@"+M+E.type+b+s+S(E,N)+o}function y(E){return t?"/*"+(E.text||"")+"*/"+o:""}function f(E){var b;return E.selectors?b=E.selectors.join(","+o):(b="@"+E.type,b+=E.name?" "+E.name:""),u()+b+s+S(E)+o}function _(E,b){return E.reduce(function(M,N){var R=N.type==="comment"?y(N):b(N);return R&&M.push(R),M},[])}function S(E,b){var M=E.declarations,N=x;return E.rules&&(M=E.rules,N=f),M=w(M,N),M&&(M=o+M+(b?"":o)),"{"+M+u()+"}"}function w(E,b){if(!E)return"";u(1);var M=_(E,b);return u(-1),M.length?M.join(o):""}function x(E){if(E.type==="property")return g(E)}function v(E){switch(E.type){case"rule":return f(E);case"media":case"keyframes":return p(E);case"comment":return y(E);case"import":case"charset":case"namespace":return d(E);case"font-face":case"supports":case"viewport":case"document":case"page":return p(E)}}function g(E){var b=E.name?E.name+":"+s:"";return u()+b+E.value+";"}}(_g)),_g.exports}var Sg,Ib;function IA(){return Ib||(Ib=1,Sg={lex:U8(),parse:RA(),stringify:MA()}),Sg}var jb;function kp(){return jb||(jb=1,function(e){var r=Vd&&Vd.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.sameColors=void 0,e.urlToBase64=async function(_){const S=await fetch(_);return f(await S.text())},e.urlToString=p,e.getColors=y,e.svgToURL=f,e.getSvgSize=async function(_){const S=await p(_),w=new DOMParser().parseFromString(S,"image/svg+xml").documentElement.getAttribute("viewBox"),[x,v,g,E]=(w==null?void 0:w.split(" "))||[];return{width:parseFloat(g),height:parseFloat(E)}},e.fixSize=function(_){var S=new DOMParser().parseFromString(_,"image/svg+xml");const w=S.documentElement.getAttribute("viewBox"),[x,v,g,E]=(w==null?void 0:w.split(" "))||[],b=S.documentElement.getAttribute("width");b||S.documentElement.setAttribute("width",g+"px");const M=S.documentElement.getAttribute("height");if((!M||M.indexOf("%")>=0)&&S.documentElement.setAttribute("height",E+"px"),b&&b.indexOf("%")>=0&&M&&M.indexOf("%")===-1){const N=parseFloat(M)/parseFloat(E);S.documentElement.setAttribute("width",N*parseFloat(g)+"px")}if(M&&M.indexOf("%")>=0&&b&&b.indexOf("%")===-1){const N=parseFloat(b)/parseFloat(g);S.documentElement.setAttribute("height",N*parseFloat(E)+"px")}return b==="100%"&&M==="100%"&&(S.documentElement.setAttribute("width",g+"px"),S.documentElement.setAttribute("height",E+"px")),new XMLSerializer().serializeToString(S)},e.replaceColors=function(_,S){var w=new DOMParser().parseFromString(_,"image/svg+xml");const x=d(w),v=Array.from(S.keys()),g=s(w);return x.forEach(E=>{const{fill:b,stroke:M}=c(E,g);[{prop:"fill",color:b},{prop:"stroke",color:M}].forEach(({prop:N,color:R})=>{const F=v.find(j=>(0,e.sameColors)(j,R));if(F){const j=S.get(F);if((0,a.isGradient)(j)){const{rotation:O,stops:C}=(0,a.parseColor)(j),A=C.map(T=>({offset:100*T.offset+"%","stop-color":T.color})),k="color"+Math.round(1e8*Math.random());(function(T,V,G,$){var te=T.namespaceURI,W=document.createElementNS(te,"linearGradient");const U=t.default.Util.degToRad(G+90),z=(Math.cos(U)+1)/2,D=(Math.sin(U)+1)/2,Y=(Math.cos(U+Math.PI)+1)/2,Q=(Math.sin(U+Math.PI)+1)/2;W.setAttribute("x1",100*z+"%"),W.setAttribute("y1",100*D+"%"),W.setAttribute("x2",100*Y+"%"),W.setAttribute("y2",100*Q+"%"),W.setAttribute("gradientUnits","userSpaceOnUse"),W.setAttribute("id",V);for(var J=0;J<$.length;J++){var Z=$[J],ae=document.createElementNS(te,"stop");for(var se in Z)Z.hasOwnProperty(se)&&ae.setAttribute(se,Z[se]);W.appendChild(ae)}(T.querySelector("defs")||T.insertBefore(document.createElementNS(te,"defs"),T.firstChild)).appendChild(W)})(w.children[0],k,O,A),E.style[N]=null,E.setAttribute(N,`url('#${k}')`)}else E.style[N]=S.get(F)}})}),f(new XMLSerializer().serializeToString(w))};const t=r(Hs()),n=r(ni()),a=dm(),i=r(IA());function o(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function s(_){const S={};return _.querySelectorAll("style").forEach(w=>{const x=i.default.parse(w.textContent).stylesheet.rules;for(let v of x)v.selectors&&v.selectors.forEach(g=>{const E=S[g]||{};v.declarations.forEach(b=>{E[b.name]=b.value}),S[g]=E})}),S}function c(_,S){var w;const x={fill:"",stroke:""},v=((w=_.getAttribute("class"))===null||w===void 0?void 0:w.split(" "))||[],g=_.getAttribute("id");let E={};if(g&&S[`#${g}`]?E=S[`#${g}`]:v.forEach(b=>{S[`.${b}`]&&(E=Object.assign(Object.assign({},E),S[`.${b}`]))}),S[_.nodeName]&&(E=Object.assign(Object.assign({},E),S[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?x.fill=_.getAttribute("fill"):E.fill&&E.fill!=="none"&&(x.fill=E.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?x.stroke=_.getAttribute("stroke"):E.stroke&&E.stroke!=="none"&&(x.stroke=E.stroke),!x.fill&&_.style.fill&&_.style.fill!=="none"&&(x.fill=_.style.fill),!x.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(x.stroke=_.style.stroke),!x.stroke&&!x.fill){const b=_.ownerSVGElement,M=b&&b!==_&&c(b,S);(M==null?void 0:M.fill)==="currentColor"||(M==null?void 0:M.stroke)==="currentColor"||(x.fill="black")}return x}const u=["path","rect","circle","line","polygon","polyline","ellipse","text"];function d(_){for(var S=[],w=_.getElementsByTagName("*"),x=0,v=w.length;x<v;x++){const g=w[x];o(g)||(g.getAttribute("fill")!==null&&S.push(g),(g.getAttribute("stroke")!==null||g.style&&g.style.fill||u.indexOf(g.nodeName)>=0)&&S.push(g))}return S}async function p(_){return await(await fetch(_,{mode:"cors"})).text()}function y(_){var S=new DOMParser().parseFromString(_,"image/svg+xml");const w=s(S),x=d(S),v=[];return x.forEach(g=>{const{fill:E,stroke:b}=c(g,w);[E,b].forEach(M=>{M&&(M==="currentColor"&&(M="black"),t.default.Util.colorToRGBA(M)&&v.indexOf(M)===-1&&v.push(M))})}),v}function f(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}e.sameColors=(_,S)=>{if(!_||!S)return!1;if(S==="currentColor"&&_==="black")return!0;const w=t.default.Util.colorToRGBA(_),x=t.default.Util.colorToRGBA(S);return w&&x?w.r===x.r&&w.g===x.g&&w.b===x.b&&w.a===x.a:void 0},e.useSvgColors=_=>{const[S,w]=n.default.useState([]);return n.default.useEffect(()=>{let x=!1;return(async()=>{w([]);const v=y(await p(_));x||w(v)})(),()=>{x=!0}},[_]),S}}(Vd)),Vd}var xg={},Fb;function H8(){return Fb||(Fb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0,e.trySetCanvasSize=(r,t,n)=>{let a=t,i=n,o=1;for(;a>0&&i>0;){r.width=a,r.height=i;const s=r.getContext("2d");if(!s)return;if(s.fillStyle="rgba(0,0,0,0.1)",s.fillRect(0,0,1,1),s.getImageData(0,0,1,1).data[3]!==0)return void s.clearRect(0,0,r.width,r.height);if(o*=.9,a=Math.floor(t*o),i=Math.floor(n*o),a=Math.max(a,1),i=Math.max(i,1),a<=1&&i<=1)return r.width=1,void(r.height=1)}}}(xg)),xg}var Gd={},Db;function V8(){return Db||(Db=1,function(e){var r=Gd&&Gd.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.useDelayer=void 0;const t=r(ni());e.useDelayer=(n,a=100,i=!1,o)=>{const s=t.default.useRef(o??n),[,c]=t.default.useReducer(p=>p+1,0),u=t.default.useCallback(p=>{s.current!==p&&(s.current=p,c())},[s]),d=t.default.useRef(null);return n===i&&(d.current&&(clearTimeout(d.current),d.current=null),s.current=i),t.default.useEffect(()=>(d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(n),d.current=null},a),()=>{d.current&&clearTimeout(d.current)}),[n,a,i]),[s.current,u]}}(Gd)),Gd}var Bb;function Om(){return Bb||(Bb=1,function(e){var r,t=Fl&&Fl.__createBinding||(Object.create?function(k,T,V,G){G===void 0&&(G=V);var $=Object.getOwnPropertyDescriptor(T,V);$&&!("get"in $?!T.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return T[V]}}),Object.defineProperty(k,G,$)}:function(k,T,V,G){G===void 0&&(G=V),k[G]=T[V]}),n=Fl&&Fl.__setModuleDefault||(Object.create?function(k,T){Object.defineProperty(k,"default",{enumerable:!0,value:T})}:function(k,T){k.default=T}),a=Fl&&Fl.__importStar||(r=function(k){return r=Object.getOwnPropertyNames||function(T){var V=[];for(var G in T)Object.prototype.hasOwnProperty.call(T,G)&&(V[V.length]=G);return V},r(k)},function(k){if(k&&k.__esModule)return k;var T={};if(k!=null)for(var V=r(k),G=0;G<V.length;G++)V[G]!=="default"&&t(T,k,V[G]);return n(T,k),T}),i=Fl&&Fl.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=e.useCornerRadiusAndCrop=e.setOuterImageCropTransformerStyle=e.setInnerImageCropTransformerStyle=e.useSizeFixer=void 0;const o=i(ni()),s=Us,c=vs,u=Fu,d=i(r0()),p=i(Hs()),y=Mh,f=jf(),_=a(kp()),S=gc(),w=H8(),x=Ap(),v=If(),g=rf(),E=V8();function b(){return document.createElement("canvas")}function M(k,T){return{x:(k.x+T.x)/2,y:(k.y+T.y)/2}}e.useSizeFixer=k=>{const[T,V]=o.default.useState(k);return o.default.useEffect(()=>{(async()=>{const G=await async function($){if(!($.indexOf("data:image/svg+xml")>=0||$.indexOf(".svg")>=0))return $;const te=await _.urlToString($),W=_.fixSize(te);return _.svgToURL(W)}(k);G!==T&&V(G)})()},[k]),T};const N={boundBoxFunc:(k,T)=>T.width<5||T.height<5?k:T,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2};e.setInnerImageCropTransformerStyle=k=>{Object.assign(N,k)};const R={boundBoxFunc:(k,T)=>T.width<5||T.height<5?k:T,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2};e.setOuterImageCropTransformerStyle=k=>{Object.assign(R,k)};const F=(k,T,V)=>Math.max(T,Math.min(V,k));e.useCornerRadiusAndCrop=(k,T,V,G,$=0,te=!1,W=!0)=>{const U=Math.floor(F(k.a.width*G,1,1e4)),z=Math.floor(F(k.a.height*G,1,1e4)),D=Math.min($*G,U/2,z/2),Y=Math.max(k.a.width/V.width,k.a.height/V.height)*G,Q=k.page._exportingOrRendering&&S.flags.imageDownScalingEnabled&&Y<1&&!te,J=V.x===0&&V.y===0&&V.width===(T==null?void 0:T.width)&&V.height===(T==null?void 0:T.height),Z=o.default.useMemo(()=>{if(T&&T.width&&T.height)return J&&D===0&&!Q?void 0:b()},[T,D,Q,J]);return o.default.useLayoutEffect(()=>{if(!Z||!T)return;(0,w.trySetCanvasSize)(Z,U,z);const ae=Z.getContext("2d");if(!ae)return;D&&(ae.beginPath(),ae.moveTo(D,0),ae.lineTo(U-D,0),ae.arc(U-D,D,D,3*Math.PI/2,0,!1),ae.lineTo(U,z-D),ae.arc(U-D,z-D,D,0,Math.PI/2,!1),ae.lineTo(D,z),ae.arc(D,z-D,D,Math.PI/2,Math.PI,!1),ae.lineTo(0,D),ae.arc(D,D,D,Math.PI,3*Math.PI/2,!1),ae.clip());const se=Q?function(de,Oe){var Le,ke;const Se=b();Se.width=de.width,Se.height=de.height;const ye=Math.max(1,Math.floor(Se.width*Oe)),Je=Math.max(1,Math.floor(Se.height*Oe));(Le=Se.getContext("2d"))===null||Le===void 0||Le.drawImage(de,0,0,Se.width,Se.height);const we=function(me,Ee,Te,he,Re,Ie,Xe){for(var rt=new ImageData(Ee,Te),vt=new Int32Array(me.data.buffer),et=me.width,yt=new Int32Array(rt.data.buffer),mt=rt.width,ct=Ee/Ie,Bt=Te/Xe,Pt=Math.round(1/ct),Yt=Math.round(1/Bt),Gt=Pt*Yt,Be=0;Be<rt.height;Be++)for(var Ce=0;Ce<mt;Ce++){for(var ft=0+Math.round(Ce/ct)+(0+Math.round(Be/Bt))*et,Ct=0,Ot=0,Nt=0,Jt=0,Xt=0;Xt<Yt;Xt++)for(var kt=0;kt<Pt;kt++){var nt=vt[ft+kt+Xt*et];Ct+=nt<<24>>>24,Ot+=nt<<16>>>24,Nt+=nt<<8>>>24,Jt+=nt>>>24}Ct=Math.round(Ct/Gt),Ot=Math.round(Ot/Gt),Nt=Math.round(Nt/Gt),Jt=Math.round(Jt/Gt),yt[Ce+Be*mt]=Jt<<24|Nt<<16|Ot<<8|Ct}return rt}(Se.getContext("2d").getImageData(0,0,Se.width,Se.height),ye,Je,0,0,Se.width,Se.height);return Se.width=ye,Se.height=Je,(ke=Se.getContext("2d"))===null||ke===void 0||ke.putImageData(we,0,0),Se}(T,Y):T,ce=Q?{x:Math.floor(V.x*Y),y:Math.floor(V.y*Y),width:Math.floor(V.width*Y),height:Math.floor(V.height*Y)}:V;ae.drawImage(se,ce.x,ce.y,ce.width,ce.height,0,0,Z.width,Z.height)},[Z,k.a.width,k.a.height,V.x,V.y,V.width,V.height,$,G,te,k.page._exportingOrRendering,Q]),o.default.useEffect(()=>()=>{Z&&Z.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(Z)},[Z]),Z||T};const j=b(),O=(0,s.observer)(({element:k})=>{const T=Math.min(30,k.a.width/4,k.a.height/4),V=o.default.useRef(null);return o.default.useEffect(()=>{const G=V.current;if(!G)return;const $=new p.default.Animation(te=>{G.rotate(((te==null?void 0:te.timeDiff)||0)/2)},G.getLayer());return $.start(),()=>{$.stop()}}),o.default.createElement(u.Group,{x:k.x,y:k.y,rotation:k.rotation,listening:!1,opacity:k.a.opacity,hideInExport:!k.showInExport},o.default.createElement(u.Rect,{width:k.a.width,height:k.a.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(u.Arc,{ref:V,x:k.a.width/2,y:k.a.height/2,fill:"white",outerRadius:Math.abs(T),innerRadius:Math.max(1,T-5),angle:270}))}),C=(0,s.observer)(({element:k})=>{const T=Math.max(10,Math.min(30,k.a.width/25));return o.default.createElement(u.Group,{x:k.x,y:k.y,rotation:k.rotation,listening:!1,opacity:k.a.opacity,hideInExport:!k.showInExport},o.default.createElement(u.Rect,{width:k.a.width,height:k.a.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(u.Text,{text:"Can not load the image...",fontSize:T,width:k.a.width,height:k.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let A=d.default;e.setImageLoaderHook=k=>{A=k},e.useImageLoader=(k,T="",V="")=>{const G=o.default.useRef(),$=()=>{var te;(te=G.current)===null||te===void 0||te.call(G),G.current=void 0};o.default.useEffect(()=>$,[]),o.default.useLayoutEffect(()=>{const te=T.slice(0,200),W=`image with id ${V} url: ${te}`;k!=="loading"||G.current||(G.current=(0,f.incrementLoader)(W)),k!=="loading"&&$(),k==="failed"&&(0,f.triggerLoadError)(W)},[k])},e.ImageElement=(0,s.observer)(({element:k,store:T})=>{var V;const[G,$]=o.default.useState(!1),te=o.default.useRef(null),W=o.default.useRef(null),U=T.selectedShapes.indexOf(k)>=0&&k.selectable,[z,D]=(We=>{const[it,He]=o.default.useReducer(Ht=>Ht+1,0),wt=o.default.useRef("loading"),ze=o.default.useRef(We.src),_t=o.default.useRef(We.src);return _t.current!==We.src&&(_t.current=We.src,wt.current="loading"),o.default.useEffect(()=>{if(We.type!=="svg"||!We.src)return;let Ht=!1;return(async()=>{wt.current="loading",He();const Dt=await _.urlToString(We.src),Vt=_.fixSize(Dt),er=_.replaceColors(Vt,We.colorsReplace);Ht||(ze.current=er,wt.current="loaded",He())})(),()=>{Ht=!0}},[We.src,JSON.stringify(We.colorsReplace)]),We.type!=="svg"?[We.src,"loaded"]:[ze.current,wt.current]})(k),[Y,Q]=A(z,"anonymous"),J=k.type!=="svg"||D==="loaded"?Q:"loading";(0,e.useImageLoader)(J,k.src,k.id);const Z=k.page._exportingOrRendering?1:Math.max(1,T.scale),ae=T._elementsPixelRatio*Z,se=(({image:We,status:it,type:He})=>{const wt=o.default.useRef();return o.default.useEffect(()=>{wt.current=We||wt.current},[We]),it!=="failed"||it!=="failed"&&He==="svg"?wt.current:void 0})({image:Y,status:Q,type:k.type}),ce=((We,it,He)=>{const wt=o.default.useMemo(()=>{var ze,_t;const{flipX:Ht,flipY:Dt}=We,Vt=We.type==="svg"||We.src.indexOf("data:image/svg+xml")>=0||We.src.indexOf(".svg")>=0,er=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,_r=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||er)&&Vt||We.maskSrc;if(!Ht&&!Dt&&!_r)return it;if(!it||!it.width||!it.height)return null;const kr=b();let Ur=1;We.type==="svg"&&(Ur=Math.max(We.a.width/it.width*He,We.a.height/it.height*He)),(0,w.trySetCanvasSize)(kr,Math.max(it.width*Ur,1),Math.max(it.height*Ur,1));let on=Ht?-kr.width:0,Wn=Dt?-kr.height:0;return(ze=kr.getContext("2d"))===null||ze===void 0||ze.scale(Ht?-1:1,Dt?-1:1),(_t=kr.getContext("2d"))===null||_t===void 0||_t.drawImage(it,on,Wn,kr.width,kr.height),kr},[We.maskSrc,We.flipX,We.flipY,it,We.a.width,We.a.height,He]);return o.default.useEffect(()=>()=>{wt&&wt.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(wt)},[wt]),wt})(k,Y||se,ae),de=((We,it)=>{const He=(0,e.useSizeFixer)(We.maskSrc||""),[wt,ze]=A(He,"anonymous"),_t=He?ze:"loaded";return(0,e.useImageLoader)(_t,He||"",We.id),o.default.useMemo(()=>{if(!wt||!it||!it.width||!it.height)return it;const Ht=b();Ht.width=Math.max(it.width,1),Ht.height=Math.max(it.height,1);const Dt=Ht.getContext("2d");if(!Dt)return it;Dt.drawImage(it,0,0),Dt.globalCompositeOperation="source-in";const Vt=function(er,_r){const kr=_r.width/_r.height;let Ur,on;return kr>=er.width/er.height?(Ur=er.width,on=er.width/kr):(Ur=er.height*kr,on=er.height),{x:(er.width-Ur)/2,y:(er.height-on)/2,width:Ur,height:on}}(wt,We);return Dt.drawImage(wt,Vt.x,Vt.y,Vt.width,Vt.height,0,0,it.width,it.height),Ht},[it,wt,We.a.width,We.a.height])})(k,ce)||j;let{cropX:Oe,cropY:Le,cropWidth:ke,cropHeight:Se}=k.a;Q!=="loaded"&&(Oe=Le=0,ke=Se=1);const ye=de.width*ke,Je=de.height*Se,we=k.a.width/k.a.height;let me,Ee;const Te=ye/Je,he=k.stretchEnabled;he?(me=ye,Ee=Je):we>=Te?(me=ye,Ee=ye/we):(me=Je*we,Ee=Je);const Re={x:de.width*Oe,y:de.height*Le,width:me,height:Ee},Ie=(V=k.cornerRadius)!==null&&V!==void 0?V:0,Xe=k.page._exportingOrRendering?1:Math.min(2,T.scale),rt=T._elementsPixelRatio*Xe;let vt=((We,it,He,wt)=>{const ze=(0,e.useSizeFixer)(We.clipSrc||""),[_t,Ht]=A(ze,"anonymous"),Dt=We.clipSrc?Ht:"loaded";(0,e.useImageLoader)(Dt,We.clipSrc,We.id);const Vt=o.default.useMemo(()=>{if(it&&_t)return b()},[it,_t]);return o.default.useLayoutEffect(()=>{var er;if(!_t||!it||!it.width||!it.height||!_t||!_t.width||!_t.height||!Vt)return;const _r=b(),kr=Math.max(We.a.width/_t.width*He,We.a.height/_t.height*He);_r.width=Math.max(_t.width*kr,1),_r.height=Math.max(_t.height*kr,1),(er=_r.getContext("2d"))===null||er===void 0||er.drawImage(_t,0,0,_r.width,_r.height),Vt.width=Math.max(it.width,1),Vt.height=Math.max(it.height,1);const Ur=Vt.getContext("2d");Ur&&(Ur.save(),Ur.drawImage(_r,0,0,it.width,it.height),p.default.Util.releaseCanvas(_r),Ur.globalCompositeOperation="source-in",Ur.drawImage(it,0,0,Vt.width,Vt.height),Ur.restore())},[Vt,it,_t,We.a.width,We.a.height,He,...wt]),We.clipSrc&&_t?Vt:it})(k,(0,e.useCornerRadiusAndCrop)(k,de,Re,rt,Ie,G||k._cropModeEnabled||k.type==="svg",!0),rt,[Re,Ie,rt]);const et=Math.max(k.a.width/me,k.a.height/Ee);o.default.useEffect(()=>{var We;if(!k._cropModeEnabled)return;const it=(We=te.current)===null||We===void 0?void 0:We.getStage();function He(ze){k._cropModeEnabled&&ze.target!==W.current&&k.toggleCropMode(!1)}function wt(ze){k._cropModeEnabled&&ze.target.parentNode!==it.content&&k.toggleCropMode(!1)}return document.body.addEventListener("click",wt),it==null||it.on("click",He),it==null||it.on("tap",He),()=>{document.body.removeEventListener("click",wt),document.body.removeEventListener("touchstart",wt),it==null||it.off("click",He),it==null||it.off("click",He)}},[k._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!G&&!k._cropModeEnabled)return(0,x.applyFilter)(te.current,k),(0,c.autorun)(()=>{(0,x.applyFilter)(te.current,k)},{delay:100})},[vt,k.page._exportingOrRendering,G,ke,Se,k._cropModeEnabled]),o.default.useLayoutEffect(()=>{var We;G||k._cropModeEnabled?(We=te.current)===null||We===void 0||We.clearCache():(0,x.applyFilter)(te.current,k)},[G,k.a.width,k.a.height,k._cropModeEnabled]),o.default.useEffect(()=>{(0,x.applyFilter)(te.current,k)},[k.shadowEnabled,k.shadowBlur,k.cornerRadius,k.shadowColor,k.shadowOffsetX,k.shadowOffsetY,k.shadowOpacity]);const yt=o.default.useRef(null),mt=o.default.useRef(null),ct=o.default.useRef(null);o.default.useLayoutEffect(()=>{k._cropModeEnabled&&(mt.current.nodes([yt.current]),ct.current.nodes([W.current]))},[k._cropModeEnabled]);var Bt=o.default.useRef(null),Pt=o.default.useRef(0),Yt=o.default.useRef(!1);const Gt=We=>{var it;((it=We.evt.touches)===null||it===void 0?void 0:it.length)>2&&We.target.stopDrag(),Math.round(We.target.x())>0&&(We.target.x(0),We.target.scaleX(1)),Math.round(We.target.y())>0&&(We.target.y(0),We.target.scaleY(1));const He=We.target.width()*We.target.scaleX(),wt=We.target.height()*We.target.scaleY(),ze=Math.min(1,me/He),_t=Math.min(1,Ee/wt),Ht=1-ze,Dt=Math.min(Ht,Math.max(0,Math.round(-We.target.x())/He)),Vt=1-_t,er=Math.min(Vt,Math.max(0,Math.round(-We.target.y())/wt));We.target.setAttrs({x:-Dt*de.width,y:-er*de.height,scaleX:1,scaleY:1}),k.set({cropX:Dt,cropY:er,cropWidth:ze,cropHeight:_t})},Be=()=>{k.type!=="svg"&&k.contentEditable&&(k.stretchEnabled||setTimeout(()=>{k.toggleCropMode(!0)}))},Ce=k.type==="svg"&&se,ft=Q==="loading"&&!Ce,[Ct]=(0,E.useDelayer)(ft,100,!1,!1),Ot=Q==="failed",Nt=!Ct&&!Ot,Jt=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Xt=Nt?k.a.opacity:0;(0,v.useFadeIn)(te,Xt);const kt=k.selectable||T.role==="admin",nt=(0,g.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,Ct&&o.default.createElement(O,{element:k}),Ot&&o.default.createElement(C,{element:k}),o.default.createElement(u.Image,{ref:te,name:"element",id:k.id,image:vt,x:k.a.x,y:k.a.y,width:k.a.width||1,height:k.a.height||1,rotation:k.a.rotation,opacity:Xt,shadowEnabled:k.shadowEnabled,shadowBlur:k.shadowBlur,shadowOffsetX:k.shadowOffsetX,shadowOffsetY:k.shadowOffsetY,shadowColor:k.shadowColor,shadowOpacity:k.shadowOpacity,customCrop:Re,listening:kt,draggable:nt?k.draggable&&U:k.draggable,preventDefault:!nt||U,hideInExport:!k.showInExport,onDragMove:We=>{k.set({x:We.target.x(),y:We.target.y()})},onDragEnd:We=>{k.set({x:We.target.x(),y:We.target.y()})},onDblClick:Be,onDblTap:Be,onTransformStart:()=>{$(!0),Jt.current={cropX:k.cropX,cropY:k.cropY,cropWidth:k.cropWidth,cropHeight:k.cropHeight}},onTransform:We=>{var it;const He=We.currentTarget,wt=Math.abs(He.scaleX()-1)<1e-7?1:He.scaleX(),ze=Math.abs(He.scaleY()-1)<1e-7?1:He.scaleY();He.scaleX(1),He.scaleY(1);const _t=(it=We.target.getStage())===null||it===void 0?void 0:it.findOne("Transformer"),Ht=1-me/de.width,Dt=Math.min(Ht,Math.max(0,k.cropX)),Vt=1-Ee/de.height,er=Math.min(Vt,Math.max(0,k.cropY)),_r=_t.getActiveAnchor(),kr=!(_r.indexOf("middle")>=0||_r.indexOf("center")>=0),Ur=!kr&&wt<1&&Jt.current.cropHeight>Ee/de.height;let on=kr?k.cropWidth:k.cropWidth*wt;Ur&&(on=k.cropWidth);const Wn=!kr&&ze<1&&Jt.current.cropWidth>me/de.width;let sn=kr?k.cropHeight:k.cropHeight*ze;Wn&&(sn=k.cropHeight),he&&(on=k.cropWidth,sn=k.cropHeight),k.set({cropX:Dt,cropY:er,x:He.x(),y:He.y(),width:He.width()*wt,height:He.height()*ze,rotation:We.target.rotation(),cropWidth:Math.min(on,1-Dt),cropHeight:Math.min(sn,1-er)})},onTransformEnd:We=>{const it=We.currentTarget;k.set({width:it.width(),height:it.height(),x:it.x(),y:it.y(),rotation:We.target.rotation(),cropWidth:me/de.width,cropHeight:Ee/de.height}),$(!1)}}),o.default.createElement(u.Rect,{x:k.x,y:k.y,width:Math.max(k.a.width-k.borderSize,0),height:Math.max(k.a.height-k.borderSize,0),opacity:Xt,offsetX:-k.borderSize/2,offsetY:-k.borderSize/2,stroke:k.borderColor,strokeWidth:k.borderSize,listening:!1,visible:!!k.borderSize,rotation:k.rotation,cornerRadius:Math.max(0,Ie-k.borderSize),hideInExport:!k.showInExport}),k._cropModeEnabled&&o.default.createElement(y.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(u.Rect,{x:-window.innerWidth/T.scale,y:-window.innerWidth/T.scale,width:window.innerWidth/T.scale*3,height:window.innerWidth/T.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(u.Image,{listening:!1,image:vt,x:k.x,y:k.y,width:k.a.width,height:k.a.height,rotation:k.rotation,shadowEnabled:k.shadowEnabled,shadowBlur:k.shadowBlur}),o.default.createElement(u.Group,{x:k.x,y:k.y,rotation:k.rotation,scaleX:et,scaleY:et},o.default.createElement(u.Image,{image:de,ref:W,opacity:.4,draggable:!0,x:-k.cropX*de.width,y:-k.cropY*de.height,onDragMove:Gt,onTransform:Gt,onTouchMove:We=>{We.evt.preventDefault();const it=We.target.getStage().getPointersPositions();var He=it[0],wt=it[1];const ze=We.target;if(He&&!wt&&!ze.isDragging()&&Yt.current&&(ze.startDrag(),Yt.current=!1),He&&wt){p.default.hitOnDragEnabled=!0,ze.isDragging()&&(Yt.current=!0,ze.stopDrag());const Wn=We.target.getAbsoluteTransform().copy();Wn.invert();var _t={x:He.x,y:He.y},Ht={x:wt.x,y:wt.y};if(!Bt.current)return void(Bt.current=M(_t,Ht));var Dt=M(_t,Ht),Vt=function(Ni,_i){return Math.sqrt(Math.pow(_i.x-Ni.x,2)+Math.pow(_i.y-Ni.y,2))}(_t,Ht);Pt.current||(Pt.current=Vt);const sn=ze.position();var er={x:Dt.x-sn.x,y:Dt.y-sn.y},_r=Vt/Pt.current;ze.scaleX(_r),ze.scaleY(_r);const Li=Wn.point(Dt),wi=Wn.point(Bt.current);var kr=Li.x-wi.x,Ur=Li.y-wi.y,on={x:Math.min(0,Dt.x-er.x*_r+kr),y:Math.min(0,Dt.y-er.y*_r+Ur)};ze.position(on),Pt.current=Vt,Bt.current=Dt,Gt(We)}},onTouchEnd:We=>{Pt.current=0,Bt.current=null,p.default.hitOnDragEnabled=!1}}),o.default.createElement(u.Transformer,Object.assign({ref:ct},R)),o.default.createElement(u.Rect,{width:me,height:Ee,ref:yt,listening:!1,onTransform:We=>{if(k.cropX<Math.abs(We.target.x()/de.width)&&We.target.x()<0&&k.cropX>0){const Vt=(k.cropWidth+k.cropX)*de.width;We.target.scaleX(1),We.target.width(Vt)}if(k.cropY<Math.abs(We.target.y()/de.height)&&We.target.y()<0&&k.cropY>0){const Vt=(k.cropHeight+k.cropY)*de.height;We.target.scaleY(1),We.target.height(Vt)}We.target.x()<-k.cropX*de.width-1e-9&&(We.target.x(-k.cropX*de.width),We.target.scaleX(1)),We.target.y()<-k.cropY*de.height-1e-9&&(We.target.y(-k.cropY*de.height),We.target.scaleY(1));const it=Math.min(1,Math.max(0,k.cropX+We.target.x()/de.width)),He=Math.min(1,Math.max(0,We.target.y()/de.height+k.cropY)),wt=We.target.width()*We.target.scaleX(),ze=We.target.height()*We.target.scaleY(),_t=Math.min(1-it,wt/de.width),Ht=Math.min(1-He,ze/de.height),Dt=We.target.getAbsolutePosition(We.target.getParent().getParent());We.target.scale({x:1,y:1}),We.target.position({x:0,y:0}),k.set({x:Dt.x,y:Dt.y,cropX:it,cropY:He,cropWidth:_t,cropHeight:Ht,width:Math.min(wt*et,de.width*(1-it)*et),height:Math.min(ze*et,de.height*(1-He)*et)})}}),o.default.createElement(u.Transformer,Object.assign({ref:mt},N,{visible:k.resizable})))))})}(Fl)),Fl}var Dl={},y1={exports:{}};/*!
|
|
109
|
+
* Quill Editor v1.3.7
|
|
110
|
+
* https://quilljs.com/
|
|
111
|
+
* Copyright (c) 2014, Jason Chen
|
|
112
|
+
* Copyright (c) 2013, salesforce.com
|
|
113
|
+
*/var jA=y1.exports,qb;function FA(){return qb||(qb=1,function(e,r){(function(n,a){e.exports=a()})(typeof self<"u"?self:jA,function(){return function(t){var n={};function a(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=t,a.c=n,a.d=function(i,o,s){a.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:s})},a.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(o,"a",o),o},a.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},a.p="",a(a.s=109)}([function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(17),o=a(18),s=a(19),c=a(45),u=a(46),d=a(47),p=a(48),y=a(49),f=a(12),_=a(32),S=a(33),w=a(31),x=a(1),v={Scope:x.Scope,create:x.create,find:x.find,query:x.query,register:x.register,Container:i.default,Format:o.default,Leaf:s.default,Embed:p.default,Scroll:c.default,Block:d.default,Inline:u.default,Text:y.default,Attributor:{Attribute:f.default,Class:_.default,Style:S.default,Store:w.default}};n.default=v},function(t,n,a){var i=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,v){x.__proto__=v}||function(x,v){for(var g in v)v.hasOwnProperty(g)&&(x[g]=v[g])};return function(x,v){w(x,v);function g(){this.constructor=x}x.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(w){i(x,w);function x(v){var g=this;return v="[Parchment] "+v,g=w.call(this,v)||this,g.message=v,g.name=g.constructor.name,g}return x}(Error);n.ParchmentError=o;var s={},c={},u={},d={};n.DATA_KEY="__blot";var p;(function(w){w[w.TYPE=3]="TYPE",w[w.LEVEL=12]="LEVEL",w[w.ATTRIBUTE=13]="ATTRIBUTE",w[w.BLOT=14]="BLOT",w[w.INLINE=7]="INLINE",w[w.BLOCK=11]="BLOCK",w[w.BLOCK_BLOT=10]="BLOCK_BLOT",w[w.INLINE_BLOT=6]="INLINE_BLOT",w[w.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",w[w.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",w[w.ANY=15]="ANY"})(p=n.Scope||(n.Scope={}));function y(w,x){var v=_(w);if(v==null)throw new o("Unable to create "+w+" blot");var g=v,E=w instanceof Node||w.nodeType===Node.TEXT_NODE?w:g.create(x);return new g(E,x)}n.create=y;function f(w,x){return x===void 0&&(x=!1),w==null?null:w[n.DATA_KEY]!=null?w[n.DATA_KEY].blot:x?f(w.parentNode,x):null}n.find=f;function _(w,x){x===void 0&&(x=p.ANY);var v;if(typeof w=="string")v=d[w]||s[w];else if(w instanceof Text||w.nodeType===Node.TEXT_NODE)v=d.text;else if(typeof w=="number")w&p.LEVEL&p.BLOCK?v=d.block:w&p.LEVEL&p.INLINE&&(v=d.inline);else if(w instanceof HTMLElement){var g=(w.getAttribute("class")||"").split(/\s+/);for(var E in g)if(v=c[g[E]],v)break;v=v||u[w.tagName]}return v==null?null:x&p.LEVEL&v.scope&&x&p.TYPE&v.scope?v:null}n.query=_;function S(){for(var w=[],x=0;x<arguments.length;x++)w[x]=arguments[x];if(w.length>1)return w.map(function(E){return S(E)});var v=w[0];if(typeof v.blotName!="string"&&typeof v.attrName!="string")throw new o("Invalid definition");if(v.blotName==="abstract")throw new o("Cannot register abstract class");if(d[v.blotName||v.attrName]=v,typeof v.keyName=="string")s[v.keyName]=v;else if(v.className!=null&&(c[v.className]=v),v.tagName!=null){Array.isArray(v.tagName)?v.tagName=v.tagName.map(function(E){return E.toUpperCase()}):v.tagName=v.tagName.toUpperCase();var g=Array.isArray(v.tagName)?v.tagName:[v.tagName];g.forEach(function(E){(u[E]==null||v.className==null)&&(u[E]=v)})}return v}n.register=S},function(t,n,a){var i=a(51),o=a(11),s=a(3),c=a(20),u="\0",d=function(p){Array.isArray(p)?this.ops=p:p!=null&&Array.isArray(p.ops)?this.ops=p.ops:this.ops=[]};d.prototype.insert=function(p,y){var f={};return p.length===0?this:(f.insert=p,y!=null&&typeof y=="object"&&Object.keys(y).length>0&&(f.attributes=y),this.push(f))},d.prototype.delete=function(p){return p<=0?this:this.push({delete:p})},d.prototype.retain=function(p,y){if(p<=0)return this;var f={retain:p};return y!=null&&typeof y=="object"&&Object.keys(y).length>0&&(f.attributes=y),this.push(f)},d.prototype.push=function(p){var y=this.ops.length,f=this.ops[y-1];if(p=s(!0,{},p),typeof f=="object"){if(typeof p.delete=="number"&&typeof f.delete=="number")return this.ops[y-1]={delete:f.delete+p.delete},this;if(typeof f.delete=="number"&&p.insert!=null&&(y-=1,f=this.ops[y-1],typeof f!="object"))return this.ops.unshift(p),this;if(o(p.attributes,f.attributes)){if(typeof p.insert=="string"&&typeof f.insert=="string")return this.ops[y-1]={insert:f.insert+p.insert},typeof p.attributes=="object"&&(this.ops[y-1].attributes=p.attributes),this;if(typeof p.retain=="number"&&typeof f.retain=="number")return this.ops[y-1]={retain:f.retain+p.retain},typeof p.attributes=="object"&&(this.ops[y-1].attributes=p.attributes),this}}return y===this.ops.length?this.ops.push(p):this.ops.splice(y,0,p),this},d.prototype.chop=function(){var p=this.ops[this.ops.length-1];return p&&p.retain&&!p.attributes&&this.ops.pop(),this},d.prototype.filter=function(p){return this.ops.filter(p)},d.prototype.forEach=function(p){this.ops.forEach(p)},d.prototype.map=function(p){return this.ops.map(p)},d.prototype.partition=function(p){var y=[],f=[];return this.forEach(function(_){var S=p(_)?y:f;S.push(_)}),[y,f]},d.prototype.reduce=function(p,y){return this.ops.reduce(p,y)},d.prototype.changeLength=function(){return this.reduce(function(p,y){return y.insert?p+c.length(y):y.delete?p-y.delete:p},0)},d.prototype.length=function(){return this.reduce(function(p,y){return p+c.length(y)},0)},d.prototype.slice=function(p,y){p=p||0,typeof y!="number"&&(y=1/0);for(var f=[],_=c.iterator(this.ops),S=0;S<y&&_.hasNext();){var w;S<p?w=_.next(p-S):(w=_.next(y-S),f.push(w)),S+=c.length(w)}return new d(f)},d.prototype.compose=function(p){var y=c.iterator(this.ops),f=c.iterator(p.ops),_=[],S=f.peek();if(S!=null&&typeof S.retain=="number"&&S.attributes==null){for(var w=S.retain;y.peekType()==="insert"&&y.peekLength()<=w;)w-=y.peekLength(),_.push(y.next());S.retain-w>0&&f.next(S.retain-w)}for(var x=new d(_);y.hasNext()||f.hasNext();)if(f.peekType()==="insert")x.push(f.next());else if(y.peekType()==="delete")x.push(y.next());else{var v=Math.min(y.peekLength(),f.peekLength()),g=y.next(v),E=f.next(v);if(typeof E.retain=="number"){var b={};typeof g.retain=="number"?b.retain=v:b.insert=g.insert;var M=c.attributes.compose(g.attributes,E.attributes,typeof g.retain=="number");if(M&&(b.attributes=M),x.push(b),!f.hasNext()&&o(x.ops[x.ops.length-1],b)){var N=new d(y.rest());return x.concat(N).chop()}}else typeof E.delete=="number"&&typeof g.retain=="number"&&x.push(E)}return x.chop()},d.prototype.concat=function(p){var y=new d(this.ops.slice());return p.ops.length>0&&(y.push(p.ops[0]),y.ops=y.ops.concat(p.ops.slice(1))),y},d.prototype.diff=function(p,y){if(this.ops===p.ops)return new d;var f=[this,p].map(function(v){return v.map(function(g){if(g.insert!=null)return typeof g.insert=="string"?g.insert:u;var E=v===p?"on":"with";throw new Error("diff() called "+E+" non-document")}).join("")}),_=new d,S=i(f[0],f[1],y),w=c.iterator(this.ops),x=c.iterator(p.ops);return S.forEach(function(v){for(var g=v[1].length;g>0;){var E=0;switch(v[0]){case i.INSERT:E=Math.min(x.peekLength(),g),_.push(x.next(E));break;case i.DELETE:E=Math.min(g,w.peekLength()),w.next(E),_.delete(E);break;case i.EQUAL:E=Math.min(w.peekLength(),x.peekLength(),g);var b=w.next(E),M=x.next(E);o(b.insert,M.insert)?_.retain(E,c.attributes.diff(b.attributes,M.attributes)):_.push(M).delete(E);break}g-=E}}),_.chop()},d.prototype.eachLine=function(p,y){y=y||`
|
|
114
|
+
`;for(var f=c.iterator(this.ops),_=new d,S=0;f.hasNext();){if(f.peekType()!=="insert")return;var w=f.peek(),x=c.length(w)-f.peekLength(),v=typeof w.insert=="string"?w.insert.indexOf(y,x)-x:-1;if(v<0)_.push(f.next());else if(v>0)_.push(f.next(v));else{if(p(_,f.next(1).attributes||{},S)===!1)return;S+=1,_=new d}}_.length()>0&&p(_,{},S)},d.prototype.transform=function(p,y){if(y=!!y,typeof p=="number")return this.transformPosition(p,y);for(var f=c.iterator(this.ops),_=c.iterator(p.ops),S=new d;f.hasNext()||_.hasNext();)if(f.peekType()==="insert"&&(y||_.peekType()!=="insert"))S.retain(c.length(f.next()));else if(_.peekType()==="insert")S.push(_.next());else{var w=Math.min(f.peekLength(),_.peekLength()),x=f.next(w),v=_.next(w);if(x.delete)continue;v.delete?S.push(v):S.retain(w,c.attributes.transform(x.attributes,v.attributes,y))}return S.chop()},d.prototype.transformPosition=function(p,y){y=!!y;for(var f=c.iterator(this.ops),_=0;f.hasNext()&&_<=p;){var S=f.peekLength(),w=f.peekType();if(f.next(),w==="delete"){p-=Math.min(S,p-_);continue}else w==="insert"&&(_<p||!y)&&(p+=S);_+=S}return p},t.exports=d},function(t,n){var a=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=function(f){return typeof Array.isArray=="function"?Array.isArray(f):i.call(f)==="[object Array]"},u=function(f){if(!f||i.call(f)!=="[object Object]")return!1;var _=a.call(f,"constructor"),S=f.constructor&&f.constructor.prototype&&a.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!_&&!S)return!1;var w;for(w in f);return typeof w>"u"||a.call(f,w)},d=function(f,_){o&&_.name==="__proto__"?o(f,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):f[_.name]=_.newValue},p=function(f,_){if(_==="__proto__")if(a.call(f,_)){if(s)return s(f,_).value}else return;return f[_]};t.exports=function y(){var f,_,S,w,x,v,g=arguments[0],E=1,b=arguments.length,M=!1;for(typeof g=="boolean"&&(M=g,g=arguments[1]||{},E=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});E<b;++E)if(f=arguments[E],f!=null)for(_ in f)S=p(g,_),w=p(f,_),g!==w&&(M&&w&&(u(w)||(x=c(w)))?(x?(x=!1,v=S&&c(S)?S:[]):v=S&&u(S)?S:{},d(g,{name:_,newValue:y(M,v,w)})):typeof w<"u"&&d(g,{name:_,newValue:w}));return g}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var i=function(){function O(C,A){for(var k=0;k<A.length;k++){var T=A[k];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(C,T.key,T)}}return function(C,A,k){return A&&O(C.prototype,A),k&&O(C,k),C}}(),o=function O(C,A,k){C===null&&(C=Function.prototype);var T=Object.getOwnPropertyDescriptor(C,A);if(T===void 0){var V=Object.getPrototypeOf(C);return V===null?void 0:O(V,A,k)}else{if("value"in T)return T.value;var G=T.get;return G===void 0?void 0:G.call(k)}},s=a(3),c=g(s),u=a(2),d=g(u),p=a(0),y=g(p),f=a(16),_=g(f),S=a(6),w=g(S),x=a(7),v=g(x);function g(O){return O&&O.__esModule?O:{default:O}}function E(O,C){if(!(O instanceof C))throw new TypeError("Cannot call a class as a function")}function b(O,C){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:O}function M(O,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);O.prototype=Object.create(C&&C.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(O,C):O.__proto__=C)}var N=1,R=function(O){M(C,O);function C(){return E(this,C),b(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return i(C,[{key:"attach",value:function(){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"attach",this).call(this),this.attributes=new y.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new d.default().insert(this.value(),(0,c.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(k,T){var V=y.default.query(k,y.default.Scope.BLOCK_ATTRIBUTE);V!=null&&this.attributes.attribute(V,T)}},{key:"formatAt",value:function(k,T,V,G){this.format(V,G)}},{key:"insertAt",value:function(k,T,V){if(typeof T=="string"&&T.endsWith(`
|
|
115
|
+
`)){var G=y.default.create(F.blotName);this.parent.insertBefore(G,k===0?this:this.next),G.insertAt(0,T.slice(0,-1))}else o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,k,T,V)}}]),C}(y.default.Embed);R.scope=y.default.Scope.BLOCK_BLOT;var F=function(O){M(C,O);function C(A){E(this,C);var k=b(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,A));return k.cache={},k}return i(C,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(y.default.Leaf).reduce(function(k,T){return T.length()===0?k:k.insert(T.value(),j(T))},new d.default).insert(`
|
|
116
|
+
`,j(this))),this.cache.delta}},{key:"deleteAt",value:function(k,T){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,k,T),this.cache={}}},{key:"formatAt",value:function(k,T,V,G){T<=0||(y.default.query(V,y.default.Scope.BLOCK)?k+T===this.length()&&this.format(V,G):o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,k,Math.min(T,this.length()-k-1),V,G),this.cache={})}},{key:"insertAt",value:function(k,T,V){if(V!=null)return o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,k,T,V);if(T.length!==0){var G=T.split(`
|
|
117
|
+
`),$=G.shift();$.length>0&&(k<this.length()-1||this.children.tail==null?o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,Math.min(k,this.length()-1),$):this.children.tail.insertAt(this.children.tail.length(),$),this.cache={});var te=this;G.reduce(function(W,U){return te=te.split(W,!0),te.insertAt(0,U),U.length},k+$.length)}}},{key:"insertBefore",value:function(k,T){var V=this.children.head;o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,k,T),V instanceof _.default&&V.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"length",this).call(this)+N),this.cache.length}},{key:"moveChildren",value:function(k,T){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"moveChildren",this).call(this,k,T),this.cache={}}},{key:"optimize",value:function(k){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,k),this.cache={}}},{key:"path",value:function(k){return o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,k,!0)}},{key:"removeChild",value:function(k){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"removeChild",this).call(this,k),this.cache={}}},{key:"split",value:function(k){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(T&&(k===0||k>=this.length()-N)){var V=this.clone();return k===0?(this.parent.insertBefore(V,this),this):(this.parent.insertBefore(V,this.next),V)}else{var G=o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"split",this).call(this,k,T);return this.cache={},G}}}]),C}(y.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[w.default,y.default.Embed,v.default];function j(O){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O==null||(typeof O.formats=="function"&&(C=(0,c.default)(C,O.formats())),O.parent==null||O.parent.blotName=="scroll"||O.parent.statics.scope!==O.statics.scope)?C:j(O.parent,C)}n.bubbleFormats=j,n.BlockEmbed=R,n.default=F},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},o=function(){function te(W,U){var z=[],D=!0,Y=!1,Q=void 0;try{for(var J=W[Symbol.iterator](),Z;!(D=(Z=J.next()).done)&&(z.push(Z.value),!(U&&z.length===U));D=!0);}catch(ae){Y=!0,Q=ae}finally{try{!D&&J.return&&J.return()}finally{if(Y)throw Q}}return z}return function(W,U){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return te(W,U);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function te(W,U){for(var z=0;z<U.length;z++){var D=U[z];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(W,D.key,D)}}return function(W,U,z){return U&&te(W.prototype,U),z&&te(W,z),W}}();a(50);var c=a(2),u=j(c),d=a(14),p=j(d),y=a(8),f=j(y),_=a(9),S=j(_),w=a(0),x=j(w),v=a(15),g=j(v),E=a(3),b=j(E),M=a(10),N=j(M),R=a(34),F=j(R);function j(te){return te&&te.__esModule?te:{default:te}}function O(te,W,U){return W in te?Object.defineProperty(te,W,{value:U,enumerable:!0,configurable:!0,writable:!0}):te[W]=U,te}function C(te,W){if(!(te instanceof W))throw new TypeError("Cannot call a class as a function")}var A=(0,N.default)("quill"),k=function(){s(te,null,[{key:"debug",value:function(U){U===!0&&(U="log"),N.default.level(U)}},{key:"find",value:function(U){return U.__quill||x.default.find(U)}},{key:"import",value:function(U){return this.imports[U]==null&&A.error("Cannot import "+U+". Are you sure it was registered?"),this.imports[U]}},{key:"register",value:function(U,z){var D=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof U!="string"){var Q=U.attrName||U.blotName;typeof Q=="string"?this.register("formats/"+Q,U,z):Object.keys(U).forEach(function(J){D.register(J,U[J],z)})}else this.imports[U]!=null&&!Y&&A.warn("Overwriting "+U+" with",z),this.imports[U]=z,(U.startsWith("blots/")||U.startsWith("formats/"))&&z.blotName!=="abstract"?x.default.register(z):U.startsWith("modules")&&typeof z.register=="function"&&z.register()}}]);function te(W){var U=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(C(this,te),this.options=T(W,z),this.container=this.options.container,this.container==null)return A.error("Invalid Quill container",W);this.options.debug&&te.debug(this.options.debug);var D=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new f.default,this.scroll=x.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new p.default(this.scroll),this.selection=new g.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(f.default.events.EDITOR_CHANGE,function(Q){Q===f.default.events.TEXT_CHANGE&&U.root.classList.toggle("ql-blank",U.editor.isBlank())}),this.emitter.on(f.default.events.SCROLL_UPDATE,function(Q,J){var Z=U.selection.lastRange,ae=Z&&Z.length===0?Z.index:void 0;V.call(U,function(){return U.editor.update(null,J,ae)},Q)});var Y=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+D+"<p><br></p></div>");this.setContents(Y),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return s(te,[{key:"addContainer",value:function(U){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof U=="string"){var D=U;U=document.createElement("div"),U.classList.add(D)}return this.container.insertBefore(U,z),U}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(U,z,D){var Y=this,Q=G(U,z,D),J=o(Q,4);return U=J[0],z=J[1],D=J[3],V.call(this,function(){return Y.editor.deleteText(U,z)},D,U,-1*z)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(U),this.container.classList.toggle("ql-disabled",!U)}},{key:"focus",value:function(){var U=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=U,this.scrollIntoView()}},{key:"format",value:function(U,z){var D=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;return V.call(this,function(){var Q=D.getSelection(!0),J=new u.default;if(Q==null)return J;if(x.default.query(U,x.default.Scope.BLOCK))J=D.editor.formatLine(Q.index,Q.length,O({},U,z));else{if(Q.length===0)return D.selection.format(U,z),J;J=D.editor.formatText(Q.index,Q.length,O({},U,z))}return D.setSelection(Q,f.default.sources.SILENT),J},Y)}},{key:"formatLine",value:function(U,z,D,Y,Q){var J=this,Z=void 0,ae=G(U,z,D,Y,Q),se=o(ae,4);return U=se[0],z=se[1],Z=se[2],Q=se[3],V.call(this,function(){return J.editor.formatLine(U,z,Z)},Q,U,0)}},{key:"formatText",value:function(U,z,D,Y,Q){var J=this,Z=void 0,ae=G(U,z,D,Y,Q),se=o(ae,4);return U=se[0],z=se[1],Z=se[2],Q=se[3],V.call(this,function(){return J.editor.formatText(U,z,Z)},Q,U,0)}},{key:"getBounds",value:function(U){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=void 0;typeof U=="number"?D=this.selection.getBounds(U,z):D=this.selection.getBounds(U.index,U.length);var Y=this.container.getBoundingClientRect();return{bottom:D.bottom-Y.top,height:D.height,left:D.left-Y.left,right:D.right-Y.left,top:D.top-Y.top,width:D.width}}},{key:"getContents",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-U,D=G(U,z),Y=o(D,2);return U=Y[0],z=Y[1],this.editor.getContents(U,z)}},{key:"getFormat",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof U=="number"?this.editor.getFormat(U,z):this.editor.getFormat(U.index,U.length)}},{key:"getIndex",value:function(U){return U.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(U){return this.scroll.leaf(U)}},{key:"getLine",value:function(U){return this.scroll.line(U)}},{key:"getLines",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof U!="number"?this.scroll.lines(U.index,U.length):this.scroll.lines(U,z)}},{key:"getModule",value:function(U){return this.theme.modules[U]}},{key:"getSelection",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return U&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-U,D=G(U,z),Y=o(D,2);return U=Y[0],z=Y[1],this.editor.getText(U,z)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(U,z,D){var Y=this,Q=arguments.length>3&&arguments[3]!==void 0?arguments[3]:te.sources.API;return V.call(this,function(){return Y.editor.insertEmbed(U,z,D)},Q,U)}},{key:"insertText",value:function(U,z,D,Y,Q){var J=this,Z=void 0,ae=G(U,0,D,Y,Q),se=o(ae,4);return U=se[0],Z=se[2],Q=se[3],V.call(this,function(){return J.editor.insertText(U,z,Z)},Q,U,z.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(U,z,D){this.clipboard.dangerouslyPasteHTML(U,z,D)}},{key:"removeFormat",value:function(U,z,D){var Y=this,Q=G(U,z,D),J=o(Q,4);return U=J[0],z=J[1],D=J[3],V.call(this,function(){return Y.editor.removeFormat(U,z)},D,U)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(U){var z=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return V.call(this,function(){U=new u.default(U);var Y=z.getLength(),Q=z.editor.deleteText(0,Y),J=z.editor.applyDelta(U),Z=J.ops[J.ops.length-1];Z!=null&&typeof Z.insert=="string"&&Z.insert[Z.insert.length-1]===`
|
|
118
|
+
`&&(z.editor.deleteText(z.getLength()-1,1),J.delete(1));var ae=Q.compose(J);return ae},D)}},{key:"setSelection",value:function(U,z,D){if(U==null)this.selection.setRange(null,z||te.sources.API);else{var Y=G(U,z,D),Q=o(Y,4);U=Q[0],z=Q[1],D=Q[3],this.selection.setRange(new v.Range(U,z),D),D!==f.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(U){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API,D=new u.default().insert(U);return this.setContents(D,z)}},{key:"update",value:function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.default.sources.USER,z=this.scroll.update(U);return this.selection.update(U),z}},{key:"updateContents",value:function(U){var z=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return V.call(this,function(){return U=new u.default(U),z.editor.applyDelta(U,D)},D,!0)}}]),te}();k.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},k.events=f.default.events,k.sources=f.default.sources,k.version="1.3.7",k.imports={delta:u.default,parchment:x.default,"core/module":S.default,"core/theme":F.default};function T(te,W){if(W=(0,b.default)(!0,{container:te,modules:{clipboard:!0,keyboard:!0,history:!0}},W),!W.theme||W.theme===k.DEFAULTS.theme)W.theme=F.default;else if(W.theme=k.import("themes/"+W.theme),W.theme==null)throw new Error("Invalid theme "+W.theme+". Did you register it?");var U=(0,b.default)(!0,{},W.theme.DEFAULTS);[U,W].forEach(function(Y){Y.modules=Y.modules||{},Object.keys(Y.modules).forEach(function(Q){Y.modules[Q]===!0&&(Y.modules[Q]={})})});var z=Object.keys(U.modules).concat(Object.keys(W.modules)),D=z.reduce(function(Y,Q){var J=k.import("modules/"+Q);return J==null?A.error("Cannot load "+Q+" module. Are you sure you registered it?"):Y[Q]=J.DEFAULTS||{},Y},{});return W.modules!=null&&W.modules.toolbar&&W.modules.toolbar.constructor!==Object&&(W.modules.toolbar={container:W.modules.toolbar}),W=(0,b.default)(!0,{},k.DEFAULTS,{modules:D},U,W),["bounds","container","scrollingContainer"].forEach(function(Y){typeof W[Y]=="string"&&(W[Y]=document.querySelector(W[Y]))}),W.modules=Object.keys(W.modules).reduce(function(Y,Q){return W.modules[Q]&&(Y[Q]=W.modules[Q]),Y},{}),W}function V(te,W,U,z){if(this.options.strict&&!this.isEnabled()&&W===f.default.sources.USER)return new u.default;var D=U==null?null:this.getSelection(),Y=this.editor.delta,Q=te();if(D!=null&&(U===!0&&(U=D.index),z==null?D=$(D,Q,W):z!==0&&(D=$(D,U,z,W)),this.setSelection(D,f.default.sources.SILENT)),Q.length()>0){var J,Z=[f.default.events.TEXT_CHANGE,Q,Y,W];if((J=this.emitter).emit.apply(J,[f.default.events.EDITOR_CHANGE].concat(Z)),W!==f.default.sources.SILENT){var ae;(ae=this.emitter).emit.apply(ae,Z)}}return Q}function G(te,W,U,z,D){var Y={};return typeof te.index=="number"&&typeof te.length=="number"?typeof W!="number"?(D=z,z=U,U=W,W=te.length,te=te.index):(W=te.length,te=te.index):typeof W!="number"&&(D=z,z=U,U=W,W=0),(typeof U>"u"?"undefined":i(U))==="object"?(Y=U,D=z):typeof U=="string"&&(z!=null?Y[U]=z:D=U),D=D||f.default.sources.API,[te,W,Y,D]}function $(te,W,U,z){if(te==null)return null;var D=void 0,Y=void 0;if(W instanceof u.default){var Q=[te.index,te.index+te.length].map(function(se){return W.transformPosition(se,z!==f.default.sources.USER)}),J=o(Q,2);D=J[0],Y=J[1]}else{var Z=[te.index,te.index+te.length].map(function(se){return se<W||se===W&&z===f.default.sources.USER?se:U>=0?se+U:Math.max(W,se+U)}),ae=o(Z,2);D=ae[0],Y=ae[1]}return new v.Range(D,Y-D)}n.expandConfig=T,n.overload=G,n.default=k},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(x,v){for(var g=0;g<v.length;g++){var E=v[g];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,v,g){return v&&w(x.prototype,v),g&&w(x,g),x}}(),o=function w(x,v,g){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,v);if(E===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,v,g)}else{if("value"in E)return E.value;var M=E.get;return M===void 0?void 0:M.call(g)}},s=a(7),c=p(s),u=a(0),d=p(u);function p(w){return w&&w.__esModule?w:{default:w}}function y(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function f(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function _(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var S=function(w){_(x,w);function x(){return y(this,x),f(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"formatAt",value:function(g,E,b,M){if(x.compare(this.statics.blotName,b)<0&&d.default.query(b,d.default.Scope.BLOT)){var N=this.isolate(g,E);M&&N.wrap(b,M)}else o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"formatAt",this).call(this,g,E,b,M)}},{key:"optimize",value:function(g){if(o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,g),this.parent instanceof x&&x.compare(this.statics.blotName,this.parent.statics.blotName)>0){var E=this.parent.isolate(this.offset(),this.length());this.moveChildren(E),E.wrap(this)}}}],[{key:"compare",value:function(g,E){var b=x.order.indexOf(g),M=x.order.indexOf(E);return b>=0||M>=0?b-M:g===E?0:g<E?-1:1}}]),x}(d.default.Inline);S.allowedChildren=[S,d.default.Embed,c.default],S.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=s(i);function s(y){return y&&y.__esModule?y:{default:y}}function c(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}function u(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:y}function d(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}var p=function(y){d(f,y);function f(){return c(this,f),u(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default.Text);n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function v(g,E){for(var b=0;b<E.length;b++){var M=E[b];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(g,M.key,M)}}return function(g,E,b){return E&&v(g.prototype,E),b&&v(g,b),g}}(),o=function v(g,E,b){g===null&&(g=Function.prototype);var M=Object.getOwnPropertyDescriptor(g,E);if(M===void 0){var N=Object.getPrototypeOf(g);return N===null?void 0:v(N,E,b)}else{if("value"in M)return M.value;var R=M.get;return R===void 0?void 0:R.call(b)}},s=a(54),c=p(s),u=a(10),d=p(u);function p(v){return v&&v.__esModule?v:{default:v}}function y(v,g){if(!(v instanceof g))throw new TypeError("Cannot call a class as a function")}function f(v,g){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:v}function _(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);v.prototype=Object.create(g&&g.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(v,g):v.__proto__=g)}var S=(0,d.default)("quill:events"),w=["selectionchange","mousedown","mouseup","click"];w.forEach(function(v){document.addEventListener(v,function(){for(var g=arguments.length,E=Array(g),b=0;b<g;b++)E[b]=arguments[b];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(M){if(M.__quill&&M.__quill.emitter){var N;(N=M.__quill.emitter).handleDOM.apply(N,E)}})})});var x=function(v){_(g,v);function g(){y(this,g);var E=f(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return E.listeners={},E.on("error",S.error),E}return i(g,[{key:"emit",value:function(){S.log.apply(S,arguments),o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(b){for(var M=arguments.length,N=Array(M>1?M-1:0),R=1;R<M;R++)N[R-1]=arguments[R];(this.listeners[b.type]||[]).forEach(function(F){var j=F.node,O=F.handler;(b.target===j||j.contains(b.target))&&O.apply(void 0,[b].concat(N))})}},{key:"listenDOM",value:function(b,M,N){this.listeners[b]||(this.listeners[b]=[]),this.listeners[b].push({node:M,handler:N})}}]),g}(c.default);x.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"},x.sources={API:"api",SILENT:"silent",USER:"user"},n.default=x},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});function i(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")}var o=function s(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i(this,s),this.quill=c,this.options=u};o.DEFAULTS={},n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=["error","warn","log","info"],o="warn";function s(u){if(i.indexOf(u)<=i.indexOf(o)){for(var d,p=arguments.length,y=Array(p>1?p-1:0),f=1;f<p;f++)y[f-1]=arguments[f];(d=console)[u].apply(d,y)}}function c(u){return i.reduce(function(d,p){return d[p]=s.bind(console,p,u),d},{})}s.level=c.level=function(u){o=u},n.default=c},function(t,n,a){var i=Array.prototype.slice,o=a(52),s=a(53),c=t.exports=function(y,f,_){return _||(_={}),y===f?!0:y instanceof Date&&f instanceof Date?y.getTime()===f.getTime():!y||!f||typeof y!="object"&&typeof f!="object"?_.strict?y===f:y==f:p(y,f,_)};function u(y){return y==null}function d(y){return!(!y||typeof y!="object"||typeof y.length!="number"||typeof y.copy!="function"||typeof y.slice!="function"||y.length>0&&typeof y[0]!="number")}function p(y,f,_){var S,w;if(u(y)||u(f)||y.prototype!==f.prototype)return!1;if(s(y))return s(f)?(y=i.call(y),f=i.call(f),c(y,f,_)):!1;if(d(y)){if(!d(f)||y.length!==f.length)return!1;for(S=0;S<y.length;S++)if(y[S]!==f[S])return!1;return!0}try{var x=o(y),v=o(f)}catch{return!1}if(x.length!=v.length)return!1;for(x.sort(),v.sort(),S=x.length-1;S>=0;S--)if(x[S]!=v[S])return!1;for(S=x.length-1;S>=0;S--)if(w=x[S],!c(y[w],f[w],_))return!1;return typeof y==typeof f}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function s(c,u,d){d===void 0&&(d={}),this.attrName=c,this.keyName=u;var p=i.Scope.TYPE&i.Scope.ATTRIBUTE;d.scope!=null?this.scope=d.scope&i.Scope.LEVEL|p:this.scope=i.Scope.ATTRIBUTE,d.whitelist!=null&&(this.whitelist=d.whitelist)}return s.keys=function(c){return[].map.call(c.attributes,function(u){return u.name})},s.prototype.add=function(c,u){return this.canAdd(c,u)?(c.setAttribute(this.keyName,u),!0):!1},s.prototype.canAdd=function(c,u){var d=i.query(c,i.Scope.BLOT&(this.scope|i.Scope.TYPE));return d==null?!1:this.whitelist==null?!0:typeof u=="string"?this.whitelist.indexOf(u.replace(/["']/g,""))>-1:this.whitelist.indexOf(u)>-1},s.prototype.remove=function(c){c.removeAttribute(this.keyName)},s.prototype.value=function(c){var u=c.getAttribute(this.keyName);return this.canAdd(c,u)&&u?u:""},s}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var i=function(){function R(F,j){var O=[],C=!0,A=!1,k=void 0;try{for(var T=F[Symbol.iterator](),V;!(C=(V=T.next()).done)&&(O.push(V.value),!(j&&O.length===j));C=!0);}catch(G){A=!0,k=G}finally{try{!C&&T.return&&T.return()}finally{if(A)throw k}}return O}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return R(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function R(F,j){for(var O=0;O<j.length;O++){var C=j[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(F,C.key,C)}}return function(F,j,O){return j&&R(F.prototype,j),O&&R(F,O),F}}(),s=function R(F,j,O){F===null&&(F=Function.prototype);var C=Object.getOwnPropertyDescriptor(F,j);if(C===void 0){var A=Object.getPrototypeOf(F);return A===null?void 0:R(A,j,O)}else{if("value"in C)return C.value;var k=C.get;return k===void 0?void 0:k.call(O)}},c=a(2),u=v(c),d=a(0),p=v(d),y=a(4),f=v(y),_=a(6),S=v(_),w=a(7),x=v(w);function v(R){return R&&R.__esModule?R:{default:R}}function g(R,F){if(!(R instanceof F))throw new TypeError("Cannot call a class as a function")}function E(R,F){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:R}function b(R,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);R.prototype=Object.create(F&&F.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(R,F):R.__proto__=F)}var M=function(R){b(F,R);function F(){return g(this,F),E(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F}(S.default);M.blotName="code",M.tagName="CODE";var N=function(R){b(F,R);function F(){return g(this,F),E(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return o(F,[{key:"delta",value:function(){var O=this,C=this.domNode.textContent;return C.endsWith(`
|
|
119
|
+
`)&&(C=C.slice(0,-1)),C.split(`
|
|
120
|
+
`).reduce(function(A,k){return A.insert(k).insert(`
|
|
121
|
+
`,O.formats())},new u.default)}},{key:"format",value:function(O,C){if(!(O===this.statics.blotName&&C)){var A=this.descendant(x.default,this.length()-1),k=i(A,1),T=k[0];T!=null&&T.deleteAt(T.length()-1,1),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,O,C)}}},{key:"formatAt",value:function(O,C,A,k){if(C!==0&&!(p.default.query(A,p.default.Scope.BLOCK)==null||A===this.statics.blotName&&k===this.statics.formats(this.domNode))){var T=this.newlineIndex(O);if(!(T<0||T>=O+C)){var V=this.newlineIndex(O,!0)+1,G=T-V+1,$=this.isolate(V,G),te=$.next;$.format(A,k),te instanceof F&&te.formatAt(0,O-V+C-G,A,k)}}}},{key:"insertAt",value:function(O,C,A){if(A==null){var k=this.descendant(x.default,O),T=i(k,2),V=T[0],G=T[1];V.insertAt(G,C)}}},{key:"length",value:function(){var O=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
122
|
+
`)?O:O+1}},{key:"newlineIndex",value:function(O){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(C)return this.domNode.textContent.slice(0,O).lastIndexOf(`
|
|
123
|
+
`);var A=this.domNode.textContent.slice(O).indexOf(`
|
|
124
|
+
`);return A>-1?O+A:-1}},{key:"optimize",value:function(O){this.domNode.textContent.endsWith(`
|
|
125
|
+
`)||this.appendChild(p.default.create("text",`
|
|
126
|
+
`)),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,O);var C=this.next;C!=null&&C.prev===this&&C.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===C.statics.formats(C.domNode)&&(C.optimize(O),C.moveChildren(this),C.remove())}},{key:"replace",value:function(O){s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,O),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(C){var A=p.default.find(C);A==null?C.parentNode.removeChild(C):A instanceof p.default.Embed?A.remove():A.unwrap()})}}],[{key:"create",value:function(O){var C=s(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,O);return C.setAttribute("spellcheck",!1),C}},{key:"formats",value:function(){return!0}}]),F}(f.default);N.blotName="code-block",N.tagName="PRE",N.TAB=" ",n.Code=M,n.default=N},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},o=function(){function te(W,U){var z=[],D=!0,Y=!1,Q=void 0;try{for(var J=W[Symbol.iterator](),Z;!(D=(Z=J.next()).done)&&(z.push(Z.value),!(U&&z.length===U));D=!0);}catch(ae){Y=!0,Q=ae}finally{try{!D&&J.return&&J.return()}finally{if(Y)throw Q}}return z}return function(W,U){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return te(W,U);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function te(W,U){for(var z=0;z<U.length;z++){var D=U[z];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(W,D.key,D)}}return function(W,U,z){return U&&te(W.prototype,U),z&&te(W,z),W}}(),c=a(2),u=C(c),d=a(20),p=C(d),y=a(0),f=C(y),_=a(13),S=C(_),w=a(24),x=C(w),v=a(4),g=C(v),E=a(16),b=C(E),M=a(21),N=C(M),R=a(11),F=C(R),j=a(3),O=C(j);function C(te){return te&&te.__esModule?te:{default:te}}function A(te,W,U){return W in te?Object.defineProperty(te,W,{value:U,enumerable:!0,configurable:!0,writable:!0}):te[W]=U,te}function k(te,W){if(!(te instanceof W))throw new TypeError("Cannot call a class as a function")}var T=/^[ -~]*$/,V=function(){function te(W){k(this,te),this.scroll=W,this.delta=this.getDelta()}return s(te,[{key:"applyDelta",value:function(U){var z=this,D=!1;this.scroll.update();var Y=this.scroll.length();return this.scroll.batchStart(),U=$(U),U.reduce(function(Q,J){var Z=J.retain||J.delete||J.insert.length||1,ae=J.attributes||{};if(J.insert!=null){if(typeof J.insert=="string"){var se=J.insert;se.endsWith(`
|
|
127
|
+
`)&&D&&(D=!1,se=se.slice(0,-1)),Q>=Y&&!se.endsWith(`
|
|
128
|
+
`)&&(D=!0),z.scroll.insertAt(Q,se);var ce=z.scroll.line(Q),de=o(ce,2),Oe=de[0],Le=de[1],ke=(0,O.default)({},(0,v.bubbleFormats)(Oe));if(Oe instanceof g.default){var Se=Oe.descendant(f.default.Leaf,Le),ye=o(Se,1),Je=ye[0];ke=(0,O.default)(ke,(0,v.bubbleFormats)(Je))}ae=p.default.attributes.diff(ke,ae)||{}}else if(i(J.insert)==="object"){var we=Object.keys(J.insert)[0];if(we==null)return Q;z.scroll.insertAt(Q,we,J.insert[we])}Y+=Z}return Object.keys(ae).forEach(function(me){z.scroll.formatAt(Q,Z,me,ae[me])}),Q+Z},0),U.reduce(function(Q,J){return typeof J.delete=="number"?(z.scroll.deleteAt(Q,J.delete),Q):Q+(J.retain||J.insert.length||1)},0),this.scroll.batchEnd(),this.update(U)}},{key:"deleteText",value:function(U,z){return this.scroll.deleteAt(U,z),this.update(new u.default().retain(U).delete(z))}},{key:"formatLine",value:function(U,z){var D=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Y).forEach(function(Q){if(!(D.scroll.whitelist!=null&&!D.scroll.whitelist[Q])){var J=D.scroll.lines(U,Math.max(z,1)),Z=z;J.forEach(function(ae){var se=ae.length();if(!(ae instanceof S.default))ae.format(Q,Y[Q]);else{var ce=U-ae.offset(D.scroll),de=ae.newlineIndex(ce+Z)-ce+1;ae.formatAt(ce,de,Q,Y[Q])}Z-=se})}}),this.scroll.optimize(),this.update(new u.default().retain(U).retain(z,(0,N.default)(Y)))}},{key:"formatText",value:function(U,z){var D=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Y).forEach(function(Q){D.scroll.formatAt(U,z,Q,Y[Q])}),this.update(new u.default().retain(U).retain(z,(0,N.default)(Y)))}},{key:"getContents",value:function(U,z){return this.delta.slice(U,U+z)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(U,z){return U.concat(z.delta())},new u.default)}},{key:"getFormat",value:function(U){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=[],Y=[];z===0?this.scroll.path(U).forEach(function(J){var Z=o(J,1),ae=Z[0];ae instanceof g.default?D.push(ae):ae instanceof f.default.Leaf&&Y.push(ae)}):(D=this.scroll.lines(U,z),Y=this.scroll.descendants(f.default.Leaf,U,z));var Q=[D,Y].map(function(J){if(J.length===0)return{};for(var Z=(0,v.bubbleFormats)(J.shift());Object.keys(Z).length>0;){var ae=J.shift();if(ae==null)return Z;Z=G((0,v.bubbleFormats)(ae),Z)}return Z});return O.default.apply(O.default,Q)}},{key:"getText",value:function(U,z){return this.getContents(U,z).filter(function(D){return typeof D.insert=="string"}).map(function(D){return D.insert}).join("")}},{key:"insertEmbed",value:function(U,z,D){return this.scroll.insertAt(U,z,D),this.update(new u.default().retain(U).insert(A({},z,D)))}},{key:"insertText",value:function(U,z){var D=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z=z.replace(/\r\n/g,`
|
|
129
|
+
`).replace(/\r/g,`
|
|
130
|
+
`),this.scroll.insertAt(U,z),Object.keys(Y).forEach(function(Q){D.scroll.formatAt(U,z.length,Q,Y[Q])}),this.update(new u.default().retain(U).insert(z,(0,N.default)(Y)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var U=this.scroll.children.head;return U.statics.blotName!==g.default.blotName||U.children.length>1?!1:U.children.head instanceof b.default}},{key:"removeFormat",value:function(U,z){var D=this.getText(U,z),Y=this.scroll.line(U+z),Q=o(Y,2),J=Q[0],Z=Q[1],ae=0,se=new u.default;J!=null&&(J instanceof S.default?ae=J.newlineIndex(Z)-Z+1:ae=J.length()-Z,se=J.delta().slice(Z,Z+ae-1).insert(`
|
|
131
|
+
`));var ce=this.getContents(U,z+ae),de=ce.diff(new u.default().insert(D).concat(se)),Oe=new u.default().retain(U).concat(de);return this.applyDelta(Oe)}},{key:"update",value:function(U){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Y=this.delta;if(z.length===1&&z[0].type==="characterData"&&z[0].target.data.match(T)&&f.default.find(z[0].target)){var Q=f.default.find(z[0].target),J=(0,v.bubbleFormats)(Q),Z=Q.offset(this.scroll),ae=z[0].oldValue.replace(x.default.CONTENTS,""),se=new u.default().insert(ae),ce=new u.default().insert(Q.value()),de=new u.default().retain(Z).concat(se.diff(ce,D));U=de.reduce(function(Oe,Le){return Le.insert?Oe.insert(Le.insert,J):Oe.push(Le)},new u.default),this.delta=Y.compose(U)}else this.delta=this.getDelta(),(!U||!(0,F.default)(Y.compose(U),this.delta))&&(U=Y.diff(this.delta,D));return U}}]),te}();function G(te,W){return Object.keys(W).reduce(function(U,z){return te[z]==null||(W[z]===te[z]?U[z]=W[z]:Array.isArray(W[z])?W[z].indexOf(te[z])<0&&(U[z]=W[z].concat([te[z]])):U[z]=[W[z],te[z]]),U},{})}function $(te){return te.reduce(function(W,U){if(U.insert===1){var z=(0,N.default)(U.attributes);return delete z.image,W.insert({image:U.attributes.image},z)}if(U.attributes!=null&&(U.attributes.list===!0||U.attributes.bullet===!0)&&(U=(0,N.default)(U),U.attributes.list?U.attributes.list="ordered":(U.attributes.list="bullet",delete U.attributes.bullet)),typeof U.insert=="string"){var D=U.insert.replace(/\r\n/g,`
|
|
132
|
+
`).replace(/\r/g,`
|
|
133
|
+
`);return W.insert(D,U.attributes)}return W.push(U)},new u.default)}n.default=V},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var i=function(){function R(F,j){var O=[],C=!0,A=!1,k=void 0;try{for(var T=F[Symbol.iterator](),V;!(C=(V=T.next()).done)&&(O.push(V.value),!(j&&O.length===j));C=!0);}catch(G){A=!0,k=G}finally{try{!C&&T.return&&T.return()}finally{if(A)throw k}}return O}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return R(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function R(F,j){for(var O=0;O<j.length;O++){var C=j[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(F,C.key,C)}}return function(F,j,O){return j&&R(F.prototype,j),O&&R(F,O),F}}(),s=a(0),c=x(s),u=a(21),d=x(u),p=a(11),y=x(p),f=a(8),_=x(f),S=a(10),w=x(S);function x(R){return R&&R.__esModule?R:{default:R}}function v(R){if(Array.isArray(R)){for(var F=0,j=Array(R.length);F<R.length;F++)j[F]=R[F];return j}else return Array.from(R)}function g(R,F){if(!(R instanceof F))throw new TypeError("Cannot call a class as a function")}var E=(0,w.default)("quill:selection"),b=function R(F){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;g(this,R),this.index=F,this.length=j},M=function(){function R(F,j){var O=this;g(this,R),this.emitter=j,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new b(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){O.mouseDown||setTimeout(O.update.bind(O,_.default.sources.USER),1)}),this.emitter.on(_.default.events.EDITOR_CHANGE,function(C,A){C===_.default.events.TEXT_CHANGE&&A.length()>0&&O.update(_.default.sources.SILENT)}),this.emitter.on(_.default.events.SCROLL_BEFORE_UPDATE,function(){if(O.hasFocus()){var C=O.getNativeRange();C!=null&&C.start.node!==O.cursor.textNode&&O.emitter.once(_.default.events.SCROLL_UPDATE,function(){try{O.setNativeRange(C.start.node,C.start.offset,C.end.node,C.end.offset)}catch{}})}}),this.emitter.on(_.default.events.SCROLL_OPTIMIZE,function(C,A){if(A.range){var k=A.range,T=k.startNode,V=k.startOffset,G=k.endNode,$=k.endOffset;O.setNativeRange(T,V,G,$)}}),this.update(_.default.sources.SILENT)}return o(R,[{key:"handleComposition",value:function(){var j=this;this.root.addEventListener("compositionstart",function(){j.composing=!0}),this.root.addEventListener("compositionend",function(){if(j.composing=!1,j.cursor.parent){var O=j.cursor.restore();if(!O)return;setTimeout(function(){j.setNativeRange(O.startNode,O.startOffset,O.endNode,O.endOffset)},1)}})}},{key:"handleDragging",value:function(){var j=this;this.emitter.listenDOM("mousedown",document.body,function(){j.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){j.mouseDown=!1,j.update(_.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(j,O){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[j])){this.scroll.update();var C=this.getNativeRange();if(!(C==null||!C.native.collapsed||c.default.query(j,c.default.Scope.BLOCK))){if(C.start.node!==this.cursor.textNode){var A=c.default.find(C.start.node,!1);if(A==null)return;if(A instanceof c.default.Leaf){var k=A.split(C.start.offset);A.parent.insertBefore(this.cursor,k)}else A.insertBefore(this.cursor,C.start.node);this.cursor.attach()}this.cursor.format(j,O),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(j){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=this.scroll.length();j=Math.min(j,C-1),O=Math.min(j+O,C-1)-j;var A=void 0,k=this.scroll.leaf(j),T=i(k,2),V=T[0],G=T[1];if(V==null)return null;var $=V.position(G,!0),te=i($,2);A=te[0],G=te[1];var W=document.createRange();if(O>0){W.setStart(A,G);var U=this.scroll.leaf(j+O),z=i(U,2);if(V=z[0],G=z[1],V==null)return null;var D=V.position(G,!0),Y=i(D,2);return A=Y[0],G=Y[1],W.setEnd(A,G),W.getBoundingClientRect()}else{var Q="left",J=void 0;return A instanceof Text?(G<A.data.length?(W.setStart(A,G),W.setEnd(A,G+1)):(W.setStart(A,G-1),W.setEnd(A,G),Q="right"),J=W.getBoundingClientRect()):(J=V.domNode.getBoundingClientRect(),G>0&&(Q="right")),{bottom:J.top+J.height,height:J.height,left:J[Q],right:J[Q],top:J.top,width:0}}}},{key:"getNativeRange",value:function(){var j=document.getSelection();if(j==null||j.rangeCount<=0)return null;var O=j.getRangeAt(0);if(O==null)return null;var C=this.normalizeNative(O);return E.info("getNativeRange",C),C}},{key:"getRange",value:function(){var j=this.getNativeRange();if(j==null)return[null,null];var O=this.normalizedToRange(j);return[O,j]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(j){var O=this,C=[[j.start.node,j.start.offset]];j.native.collapsed||C.push([j.end.node,j.end.offset]);var A=C.map(function(V){var G=i(V,2),$=G[0],te=G[1],W=c.default.find($,!0),U=W.offset(O.scroll);return te===0?U:W instanceof c.default.Container?U+W.length():U+W.index($,te)}),k=Math.min(Math.max.apply(Math,v(A)),this.scroll.length()-1),T=Math.min.apply(Math,[k].concat(v(A)));return new b(T,k-T)}},{key:"normalizeNative",value:function(j){if(!N(this.root,j.startContainer)||!j.collapsed&&!N(this.root,j.endContainer))return null;var O={start:{node:j.startContainer,offset:j.startOffset},end:{node:j.endContainer,offset:j.endOffset},native:j};return[O.start,O.end].forEach(function(C){for(var A=C.node,k=C.offset;!(A instanceof Text)&&A.childNodes.length>0;)if(A.childNodes.length>k)A=A.childNodes[k],k=0;else if(A.childNodes.length===k)A=A.lastChild,k=A instanceof Text?A.data.length:A.childNodes.length+1;else break;C.node=A,C.offset=k}),O}},{key:"rangeToNative",value:function(j){var O=this,C=j.collapsed?[j.index]:[j.index,j.index+j.length],A=[],k=this.scroll.length();return C.forEach(function(T,V){T=Math.min(k-1,T);var G=void 0,$=O.scroll.leaf(T),te=i($,2),W=te[0],U=te[1],z=W.position(U,V!==0),D=i(z,2);G=D[0],U=D[1],A.push(G,U)}),A.length<2&&(A=A.concat(A)),A}},{key:"scrollIntoView",value:function(j){var O=this.lastRange;if(O!=null){var C=this.getBounds(O.index,O.length);if(C!=null){var A=this.scroll.length()-1,k=this.scroll.line(Math.min(O.index,A)),T=i(k,1),V=T[0],G=V;if(O.length>0){var $=this.scroll.line(Math.min(O.index+O.length,A)),te=i($,1);G=te[0]}if(!(V==null||G==null)){var W=j.getBoundingClientRect();C.top<W.top?j.scrollTop-=W.top-C.top:C.bottom>W.bottom&&(j.scrollTop+=C.bottom-W.bottom)}}}}},{key:"setNativeRange",value:function(j,O){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:j,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:O,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(E.info("setNativeRange",j,O,C,A),!(j!=null&&(this.root.parentNode==null||j.parentNode==null||C.parentNode==null))){var T=document.getSelection();if(T!=null)if(j!=null){this.hasFocus()||this.root.focus();var V=(this.getNativeRange()||{}).native;if(V==null||k||j!==V.startContainer||O!==V.startOffset||C!==V.endContainer||A!==V.endOffset){j.tagName=="BR"&&(O=[].indexOf.call(j.parentNode.childNodes,j),j=j.parentNode),C.tagName=="BR"&&(A=[].indexOf.call(C.parentNode.childNodes,C),C=C.parentNode);var G=document.createRange();G.setStart(j,O),G.setEnd(C,A),T.removeAllRanges(),T.addRange(G)}}else T.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(j){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof O=="string"&&(C=O,O=!1),E.info("setRange",j),j!=null){var A=this.rangeToNative(j);this.setNativeRange.apply(this,v(A).concat([O]))}else this.setNativeRange(null);this.update(C)}},{key:"update",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_.default.sources.USER,O=this.lastRange,C=this.getRange(),A=i(C,2),k=A[0],T=A[1];if(this.lastRange=k,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,y.default)(O,this.lastRange)){var V;!this.composing&&T!=null&&T.native.collapsed&&T.start.node!==this.cursor.textNode&&this.cursor.restore();var G=[_.default.events.SELECTION_CHANGE,(0,d.default)(this.lastRange),(0,d.default)(O),j];if((V=this.emitter).emit.apply(V,[_.default.events.EDITOR_CHANGE].concat(G)),j!==_.default.sources.SILENT){var $;($=this.emitter).emit.apply($,G)}}}}]),R}();function N(R,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),R.contains(F)}n.Range=b,n.default=M},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(S,w){for(var x=0;x<w.length;x++){var v=w[x];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,w,x){return w&&_(S.prototype,w),x&&_(S,x),S}}(),o=function _(S,w,x){S===null&&(S=Function.prototype);var v=Object.getOwnPropertyDescriptor(S,w);if(v===void 0){var g=Object.getPrototypeOf(S);return g===null?void 0:_(g,w,x)}else{if("value"in v)return v.value;var E=v.get;return E===void 0?void 0:E.call(x)}},s=a(0),c=u(s);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function p(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function y(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){y(S,_);function S(){return d(this,S),p(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,[{key:"insertInto",value:function(x,v){x.children.length===0?o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertInto",this).call(this,x,v):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),S}(c.default.Embed);f.blotName="break",f.tagName="BR",n.default=f},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var _ in f)f.hasOwnProperty(_)&&(y[_]=f[_])};return function(y,f){p(y,f);function _(){this.constructor=y}y.prototype=f===null?Object.create(f):(_.prototype=f.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(44),s=a(30),c=a(1),u=function(p){i(y,p);function y(f){var _=p.call(this,f)||this;return _.build(),_}return y.prototype.appendChild=function(f){this.insertBefore(f)},y.prototype.attach=function(){p.prototype.attach.call(this),this.children.forEach(function(f){f.attach()})},y.prototype.build=function(){var f=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(_){try{var S=d(_);f.insertBefore(S,f.children.head||void 0)}catch(w){if(w instanceof c.ParchmentError)return;throw w}})},y.prototype.deleteAt=function(f,_){if(f===0&&_===this.length())return this.remove();this.children.forEachAt(f,_,function(S,w,x){S.deleteAt(w,x)})},y.prototype.descendant=function(f,_){var S=this.children.find(_),w=S[0],x=S[1];return f.blotName==null&&f(w)||f.blotName!=null&&w instanceof f?[w,x]:w instanceof y?w.descendant(f,x):[null,-1]},y.prototype.descendants=function(f,_,S){_===void 0&&(_=0),S===void 0&&(S=Number.MAX_VALUE);var w=[],x=S;return this.children.forEachAt(_,S,function(v,g,E){(f.blotName==null&&f(v)||f.blotName!=null&&v instanceof f)&&w.push(v),v instanceof y&&(w=w.concat(v.descendants(f,g,x))),x-=E}),w},y.prototype.detach=function(){this.children.forEach(function(f){f.detach()}),p.prototype.detach.call(this)},y.prototype.formatAt=function(f,_,S,w){this.children.forEachAt(f,_,function(x,v,g){x.formatAt(v,g,S,w)})},y.prototype.insertAt=function(f,_,S){var w=this.children.find(f),x=w[0],v=w[1];if(x)x.insertAt(v,_,S);else{var g=S==null?c.create("text",_):c.create(_,S);this.appendChild(g)}},y.prototype.insertBefore=function(f,_){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(S){return f instanceof S}))throw new c.ParchmentError("Cannot insert "+f.statics.blotName+" into "+this.statics.blotName);f.insertInto(this,_)},y.prototype.length=function(){return this.children.reduce(function(f,_){return f+_.length()},0)},y.prototype.moveChildren=function(f,_){this.children.forEach(function(S){f.insertBefore(S,_)})},y.prototype.optimize=function(f){if(p.prototype.optimize.call(this,f),this.children.length===0)if(this.statics.defaultChild!=null){var _=c.create(this.statics.defaultChild);this.appendChild(_),_.optimize(f)}else this.remove()},y.prototype.path=function(f,_){_===void 0&&(_=!1);var S=this.children.find(f,_),w=S[0],x=S[1],v=[[this,f]];return w instanceof y?v.concat(w.path(x,_)):(w!=null&&v.push([w,x]),v)},y.prototype.removeChild=function(f){this.children.remove(f)},y.prototype.replace=function(f){f instanceof y&&f.moveChildren(this),p.prototype.replace.call(this,f)},y.prototype.split=function(f,_){if(_===void 0&&(_=!1),!_){if(f===0)return this;if(f===this.length())return this.next}var S=this.clone();return this.parent.insertBefore(S,this.next),this.children.forEachAt(f,this.length(),function(w,x,v){w=w.split(x,_),S.appendChild(w)}),S},y.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},y.prototype.update=function(f,_){var S=this,w=[],x=[];f.forEach(function(v){v.target===S.domNode&&v.type==="childList"&&(w.push.apply(w,v.addedNodes),x.push.apply(x,v.removedNodes))}),x.forEach(function(v){if(!(v.parentNode!=null&&v.tagName!=="IFRAME"&&document.body.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var g=c.find(v);g!=null&&(g.domNode.parentNode==null||g.domNode.parentNode===S.domNode)&&g.detach()}}),w.filter(function(v){return v.parentNode==S.domNode}).sort(function(v,g){return v===g?0:v.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(v){var g=null;v.nextSibling!=null&&(g=c.find(v.nextSibling));var E=d(v);(E.next!=g||E.next==null)&&(E.parent!=null&&E.parent.removeChild(S),S.insertBefore(E,g||void 0))})},y}(s.default);function d(p){var y=c.find(p);if(y==null)try{y=c.create(p)}catch{y=c.create(c.Scope.INLINE),[].slice.call(p.childNodes).forEach(function(_){y.domNode.appendChild(_)}),p.parentNode&&p.parentNode.replaceChild(y.domNode,p),y.attach()}return y}n.default=u},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var _ in f)f.hasOwnProperty(_)&&(y[_]=f[_])};return function(y,f){p(y,f);function _(){this.constructor=y}y.prototype=f===null?Object.create(f):(_.prototype=f.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12),s=a(31),c=a(17),u=a(1),d=function(p){i(y,p);function y(f){var _=p.call(this,f)||this;return _.attributes=new s.default(_.domNode),_}return y.formats=function(f){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return f.tagName.toLowerCase()},y.prototype.format=function(f,_){var S=u.query(f);S instanceof o.default?this.attributes.attribute(S,_):_&&S!=null&&(f!==this.statics.blotName||this.formats()[f]!==_)&&this.replaceWith(f,_)},y.prototype.formats=function(){var f=this.attributes.values(),_=this.statics.formats(this.domNode);return _!=null&&(f[this.statics.blotName]=_),f},y.prototype.replaceWith=function(f,_){var S=p.prototype.replaceWith.call(this,f,_);return this.attributes.copy(S),S},y.prototype.update=function(f,_){var S=this;p.prototype.update.call(this,f,_),f.some(function(w){return w.target===S.domNode&&w.type==="attributes"})&&this.attributes.build()},y.prototype.wrap=function(f,_){var S=p.prototype.wrap.call(this,f,_);return S instanceof y&&S.statics.scope===this.statics.scope&&this.attributes.move(S),S},y}(c.default);n.default=d},function(t,n,a){var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var y in p)p.hasOwnProperty(y)&&(d[y]=p[y])};return function(d,p){u(d,p);function y(){this.constructor=d}d.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(30),s=a(1),c=function(u){i(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.value=function(p){return!0},d.prototype.index=function(p,y){return this.domNode===p||this.domNode.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(y,1):-1},d.prototype.position=function(p,y){var f=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return p>0&&(f+=1),[this.parent.domNode,f]},d.prototype.value=function(){var p;return p={},p[this.statics.blotName]=this.statics.value(this.domNode)||!0,p},d.scope=s.Scope.INLINE_BLOT,d}(o.default);n.default=c},function(t,n,a){var i=a(11),o=a(3),s={attributes:{compose:function(u,d,p){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});var y=o(!0,{},d);p||(y=Object.keys(y).reduce(function(_,S){return y[S]!=null&&(_[S]=y[S]),_},{}));for(var f in u)u[f]!==void 0&&d[f]===void 0&&(y[f]=u[f]);return Object.keys(y).length>0?y:void 0},diff:function(u,d){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});var p=Object.keys(u).concat(Object.keys(d)).reduce(function(y,f){return i(u[f],d[f])||(y[f]=d[f]===void 0?null:d[f]),y},{});return Object.keys(p).length>0?p:void 0},transform:function(u,d,p){if(typeof u!="object")return d;if(typeof d=="object"){if(!p)return d;var y=Object.keys(d).reduce(function(f,_){return u[_]===void 0&&(f[_]=d[_]),f},{});return Object.keys(y).length>0?y:void 0}}},iterator:function(u){return new c(u)},length:function(u){return typeof u.delete=="number"?u.delete:typeof u.retain=="number"?u.retain:typeof u.insert=="string"?u.insert.length:1}};function c(u){this.ops=u,this.index=0,this.offset=0}c.prototype.hasNext=function(){return this.peekLength()<1/0},c.prototype.next=function(u){u||(u=1/0);var d=this.ops[this.index];if(d){var p=this.offset,y=s.length(d);if(u>=y-p?(u=y-p,this.index+=1,this.offset=0):this.offset+=u,typeof d.delete=="number")return{delete:u};var f={};return d.attributes&&(f.attributes=d.attributes),typeof d.retain=="number"?f.retain=u:typeof d.insert=="string"?f.insert=d.insert.substr(p,u):f.insert=d.insert,f}else return{retain:1/0}},c.prototype.peek=function(){return this.ops[this.index]},c.prototype.peekLength=function(){return this.ops[this.index]?s.length(this.ops[this.index])-this.offset:1/0},c.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"},c.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var u=this.offset,d=this.index,p=this.next(),y=this.ops.slice(this.index);return this.offset=u,this.index=d,[p].concat(y)}else return[]},t.exports=s},function(t,n){var a=function(){function i(S,w){return w!=null&&S instanceof w}var o;try{o=Map}catch{o=function(){}}var s;try{s=Set}catch{s=function(){}}var c;try{c=Promise}catch{c=function(){}}function u(S,w,x,v,g){typeof w=="object"&&(x=w.depth,v=w.prototype,g=w.includeNonEnumerable,w=w.circular);var E=[],b=[],M=typeof Buffer<"u";typeof w>"u"&&(w=!0),typeof x>"u"&&(x=1/0);function N(R,F){if(R===null)return null;if(F===0)return R;var j,O;if(typeof R!="object")return R;if(i(R,o))j=new o;else if(i(R,s))j=new s;else if(i(R,c))j=new c(function(W,U){R.then(function(z){W(N(z,F-1))},function(z){U(N(z,F-1))})});else if(u.__isArray(R))j=[];else if(u.__isRegExp(R))j=new RegExp(R.source,_(R)),R.lastIndex&&(j.lastIndex=R.lastIndex);else if(u.__isDate(R))j=new Date(R.getTime());else{if(M&&Buffer.isBuffer(R))return Buffer.allocUnsafe?j=Buffer.allocUnsafe(R.length):j=new Buffer(R.length),R.copy(j),j;i(R,Error)?j=Object.create(R):typeof v>"u"?(O=Object.getPrototypeOf(R),j=Object.create(O)):(j=Object.create(v),O=v)}if(w){var C=E.indexOf(R);if(C!=-1)return b[C];E.push(R),b.push(j)}i(R,o)&&R.forEach(function(W,U){var z=N(U,F-1),D=N(W,F-1);j.set(z,D)}),i(R,s)&&R.forEach(function(W){var U=N(W,F-1);j.add(U)});for(var A in R){var k;O&&(k=Object.getOwnPropertyDescriptor(O,A)),!(k&&k.set==null)&&(j[A]=N(R[A],F-1))}if(Object.getOwnPropertySymbols)for(var T=Object.getOwnPropertySymbols(R),A=0;A<T.length;A++){var V=T[A],G=Object.getOwnPropertyDescriptor(R,V);G&&!G.enumerable&&!g||(j[V]=N(R[V],F-1),G.enumerable||Object.defineProperty(j,V,{enumerable:!1}))}if(g)for(var $=Object.getOwnPropertyNames(R),A=0;A<$.length;A++){var te=$[A],G=Object.getOwnPropertyDescriptor(R,te);G&&G.enumerable||(j[te]=N(R[te],F-1),Object.defineProperty(j,te,{enumerable:!1}))}return j}return N(S,x)}u.clonePrototype=function(w){if(w===null)return null;var x=function(){};return x.prototype=w,new x};function d(S){return Object.prototype.toString.call(S)}u.__objToStr=d;function p(S){return typeof S=="object"&&d(S)==="[object Date]"}u.__isDate=p;function y(S){return typeof S=="object"&&d(S)==="[object Array]"}u.__isArray=y;function f(S){return typeof S=="object"&&d(S)==="[object RegExp]"}u.__isRegExp=f;function _(S){var w="";return S.global&&(w+="g"),S.ignoreCase&&(w+="i"),S.multiline&&(w+="m"),w}return u.__getRegExpFlags=_,u}();typeof t=="object"&&t.exports&&(t.exports=a)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function j(O,C){var A=[],k=!0,T=!1,V=void 0;try{for(var G=O[Symbol.iterator](),$;!(k=($=G.next()).done)&&(A.push($.value),!(C&&A.length===C));k=!0);}catch(te){T=!0,V=te}finally{try{!k&&G.return&&G.return()}finally{if(T)throw V}}return A}return function(O,C){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return j(O,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(O,C){for(var A=0;A<C.length;A++){var k=C[A];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(O,k.key,k)}}return function(O,C,A){return C&&j(O.prototype,C),A&&j(O,A),O}}(),s=function j(O,C,A){O===null&&(O=Function.prototype);var k=Object.getOwnPropertyDescriptor(O,C);if(k===void 0){var T=Object.getPrototypeOf(O);return T===null?void 0:j(T,C,A)}else{if("value"in k)return k.value;var V=k.get;return V===void 0?void 0:V.call(A)}},c=a(0),u=E(c),d=a(8),p=E(d),y=a(4),f=E(y),_=a(16),S=E(_),w=a(13),x=E(w),v=a(25),g=E(v);function E(j){return j&&j.__esModule?j:{default:j}}function b(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function M(j,O){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:j}function N(j,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);j.prototype=Object.create(O&&O.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(j,O):j.__proto__=O)}function R(j){return j instanceof f.default||j instanceof y.BlockEmbed}var F=function(j){N(O,j);function O(C,A){b(this,O);var k=M(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,C));return k.emitter=A.emitter,Array.isArray(A.whitelist)&&(k.whitelist=A.whitelist.reduce(function(T,V){return T[V]=!0,T},{})),k.domNode.addEventListener("DOMNodeInserted",function(){}),k.optimize(),k.enable(),k}return o(O,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(A,k){var T=this.line(A),V=i(T,2),G=V[0],$=V[1],te=this.line(A+k),W=i(te,1),U=W[0];if(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,A,k),U!=null&&G!==U&&$>0){if(G instanceof y.BlockEmbed||U instanceof y.BlockEmbed){this.optimize();return}if(G instanceof x.default){var z=G.newlineIndex(G.length(),!0);if(z>-1&&(G=G.split(z+1),G===U)){this.optimize();return}}else if(U instanceof x.default){var D=U.newlineIndex(0);D>-1&&U.split(D+1)}var Y=U.children.head instanceof S.default?null:U.children.head;G.moveChildren(U,Y),G.remove()}this.optimize()}},{key:"enable",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",A)}},{key:"formatAt",value:function(A,k,T,V){this.whitelist!=null&&!this.whitelist[T]||(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,A,k,T,V),this.optimize())}},{key:"insertAt",value:function(A,k,T){if(!(T!=null&&this.whitelist!=null&&!this.whitelist[k])){if(A>=this.length())if(T==null||u.default.query(k,u.default.Scope.BLOCK)==null){var V=u.default.create(this.statics.defaultChild);this.appendChild(V),T==null&&k.endsWith(`
|
|
134
|
+
`)&&(k=k.slice(0,-1)),V.insertAt(0,k,T)}else{var G=u.default.create(k,T);this.appendChild(G)}else s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,A,k,T);this.optimize()}}},{key:"insertBefore",value:function(A,k){if(A.statics.scope===u.default.Scope.INLINE_BLOT){var T=u.default.create(this.statics.defaultChild);T.appendChild(A),A=T}s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,A,k)}},{key:"leaf",value:function(A){return this.path(A).pop()||[null,-1]}},{key:"line",value:function(A){return A===this.length()?this.line(A-1):this.descendant(R,A)}},{key:"lines",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,T=function V(G,$,te){var W=[],U=te;return G.children.forEachAt($,te,function(z,D,Y){R(z)?W.push(z):z instanceof u.default.Container&&(W=W.concat(V(z,D,U))),U-=Y}),W};return T(this,A,k)}},{key:"optimize",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,A,k),A.length>0&&this.emitter.emit(p.default.events.SCROLL_OPTIMIZE,A,k))}},{key:"path",value:function(A){return s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,A).slice(1)}},{key:"update",value:function(A){if(this.batch!==!0){var k=p.default.sources.USER;typeof A=="string"&&(k=A),Array.isArray(A)||(A=this.observer.takeRecords()),A.length>0&&this.emitter.emit(p.default.events.SCROLL_BEFORE_UPDATE,k,A),s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"update",this).call(this,A.concat([])),A.length>0&&this.emitter.emit(p.default.events.SCROLL_UPDATE,k,A)}}}]),O}(u.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[f.default,y.BlockEmbed,g.default],n.default=F},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},o=function(){function J(Z,ae){var se=[],ce=!0,de=!1,Oe=void 0;try{for(var Le=Z[Symbol.iterator](),ke;!(ce=(ke=Le.next()).done)&&(se.push(ke.value),!(ae&&se.length===ae));ce=!0);}catch(Se){de=!0,Oe=Se}finally{try{!ce&&Le.return&&Le.return()}finally{if(de)throw Oe}}return se}return function(Z,ae){if(Array.isArray(Z))return Z;if(Symbol.iterator in Object(Z))return J(Z,ae);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function J(Z,ae){for(var se=0;se<ae.length;se++){var ce=ae[se];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(Z,ce.key,ce)}}return function(Z,ae,se){return ae&&J(Z.prototype,ae),se&&J(Z,se),Z}}(),c=a(21),u=j(c),d=a(11),p=j(d),y=a(3),f=j(y),_=a(2),S=j(_),w=a(20),x=j(w),v=a(0),g=j(v),E=a(5),b=j(E),M=a(10),N=j(M),R=a(9),F=j(R);function j(J){return J&&J.__esModule?J:{default:J}}function O(J,Z,ae){return Z in J?Object.defineProperty(J,Z,{value:ae,enumerable:!0,configurable:!0,writable:!0}):J[Z]=ae,J}function C(J,Z){if(!(J instanceof Z))throw new TypeError("Cannot call a class as a function")}function A(J,Z){if(!J)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Z&&(typeof Z=="object"||typeof Z=="function")?Z:J}function k(J,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Z);J.prototype=Object.create(Z&&Z.prototype,{constructor:{value:J,enumerable:!1,writable:!0,configurable:!0}}),Z&&(Object.setPrototypeOf?Object.setPrototypeOf(J,Z):J.__proto__=Z)}var T=(0,N.default)("quill:keyboard"),V=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",G=function(J){k(Z,J),s(Z,null,[{key:"match",value:function(se,ce){return ce=Q(ce),["altKey","ctrlKey","metaKey","shiftKey"].some(function(de){return!!ce[de]!==se[de]&&ce[de]!==null})?!1:ce.key===(se.which||se.keyCode)}}]);function Z(ae,se){C(this,Z);var ce=A(this,(Z.__proto__||Object.getPrototypeOf(Z)).call(this,ae,se));return ce.bindings={},Object.keys(ce.options.bindings).forEach(function(de){de==="list autofill"&&ae.scroll.whitelist!=null&&!ae.scroll.whitelist.list||ce.options.bindings[de]&&ce.addBinding(ce.options.bindings[de])}),ce.addBinding({key:Z.keys.ENTER,shiftKey:null},z),ce.addBinding({key:Z.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ce.addBinding({key:Z.keys.BACKSPACE},{collapsed:!0},te),ce.addBinding({key:Z.keys.DELETE},{collapsed:!0},W)):(ce.addBinding({key:Z.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},te),ce.addBinding({key:Z.keys.DELETE},{collapsed:!0,suffix:/^.?$/},W)),ce.addBinding({key:Z.keys.BACKSPACE},{collapsed:!1},U),ce.addBinding({key:Z.keys.DELETE},{collapsed:!1},U),ce.addBinding({key:Z.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},te),ce.listen(),ce}return s(Z,[{key:"addBinding",value:function(se){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Oe=Q(se);if(Oe==null||Oe.key==null)return T.warn("Attempted to add invalid keyboard binding",Oe);typeof ce=="function"&&(ce={handler:ce}),typeof de=="function"&&(de={handler:de}),Oe=(0,f.default)(Oe,ce,de),this.bindings[Oe.key]=this.bindings[Oe.key]||[],this.bindings[Oe.key].push(Oe)}},{key:"listen",value:function(){var se=this;this.quill.root.addEventListener("keydown",function(ce){if(!ce.defaultPrevented){var de=ce.which||ce.keyCode,Oe=(se.bindings[de]||[]).filter(function(mt){return Z.match(ce,mt)});if(Oe.length!==0){var Le=se.quill.getSelection();if(!(Le==null||!se.quill.hasFocus())){var ke=se.quill.getLine(Le.index),Se=o(ke,2),ye=Se[0],Je=Se[1],we=se.quill.getLeaf(Le.index),me=o(we,2),Ee=me[0],Te=me[1],he=Le.length===0?[Ee,Te]:se.quill.getLeaf(Le.index+Le.length),Re=o(he,2),Ie=Re[0],Xe=Re[1],rt=Ee instanceof g.default.Text?Ee.value().slice(0,Te):"",vt=Ie instanceof g.default.Text?Ie.value().slice(Xe):"",et={collapsed:Le.length===0,empty:Le.length===0&&ye.length()<=1,format:se.quill.getFormat(Le),offset:Je,prefix:rt,suffix:vt},yt=Oe.some(function(mt){if(mt.collapsed!=null&&mt.collapsed!==et.collapsed||mt.empty!=null&&mt.empty!==et.empty||mt.offset!=null&&mt.offset!==et.offset)return!1;if(Array.isArray(mt.format)){if(mt.format.every(function(ct){return et.format[ct]==null}))return!1}else if(i(mt.format)==="object"&&!Object.keys(mt.format).every(function(ct){return mt.format[ct]===!0?et.format[ct]!=null:mt.format[ct]===!1?et.format[ct]==null:(0,p.default)(mt.format[ct],et.format[ct])}))return!1;return mt.prefix!=null&&!mt.prefix.test(et.prefix)||mt.suffix!=null&&!mt.suffix.test(et.suffix)?!1:mt.handler.call(se,Le,et)!==!0});yt&&ce.preventDefault()}}}})}}]),Z}(F.default);G.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},G.DEFAULTS={bindings:{bold:Y("bold"),italic:Y("italic"),underline:Y("underline"),indent:{key:G.keys.TAB,format:["blockquote","indent","list"],handler:function(Z,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","+1",b.default.sources.USER)}},outdent:{key:G.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(Z,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","-1",b.default.sources.USER)}},"outdent backspace":{key:G.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(Z,ae){ae.format.indent!=null?this.quill.format("indent","-1",b.default.sources.USER):ae.format.list!=null&&this.quill.format("list",!1,b.default.sources.USER)}},"indent code-block":D(!0),"outdent code-block":D(!1),"remove tab":{key:G.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(Z){this.quill.deleteText(Z.index-1,1,b.default.sources.USER)}},tab:{key:G.keys.TAB,handler:function(Z){this.quill.history.cutoff();var ae=new S.default().retain(Z.index).delete(Z.length).insert(" ");this.quill.updateContents(ae,b.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Z.index+1,b.default.sources.SILENT)}},"list empty enter":{key:G.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(Z,ae){this.quill.format("list",!1,b.default.sources.USER),ae.format.indent&&this.quill.format("indent",!1,b.default.sources.USER)}},"checklist enter":{key:G.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(Z){var ae=this.quill.getLine(Z.index),se=o(ae,2),ce=se[0],de=se[1],Oe=(0,f.default)({},ce.formats(),{list:"checked"}),Le=new S.default().retain(Z.index).insert(`
|
|
135
|
+
`,Oe).retain(ce.length()-de-1).retain(1,{list:"unchecked"});this.quill.updateContents(Le,b.default.sources.USER),this.quill.setSelection(Z.index+1,b.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:G.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(Z,ae){var se=this.quill.getLine(Z.index),ce=o(se,2),de=ce[0],Oe=ce[1],Le=new S.default().retain(Z.index).insert(`
|
|
136
|
+
`,ae.format).retain(de.length()-Oe-1).retain(1,{header:null});this.quill.updateContents(Le,b.default.sources.USER),this.quill.setSelection(Z.index+1,b.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(Z,ae){var se=ae.prefix.length,ce=this.quill.getLine(Z.index),de=o(ce,2),Oe=de[0],Le=de[1];if(Le>se)return!0;var ke=void 0;switch(ae.prefix.trim()){case"[]":case"[ ]":ke="unchecked";break;case"[x]":ke="checked";break;case"-":case"*":ke="bullet";break;default:ke="ordered"}this.quill.insertText(Z.index," ",b.default.sources.USER),this.quill.history.cutoff();var Se=new S.default().retain(Z.index-Le).delete(se+1).retain(Oe.length()-2-Le).retain(1,{list:ke});this.quill.updateContents(Se,b.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Z.index-se,b.default.sources.SILENT)}},"code exit":{key:G.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(Z){var ae=this.quill.getLine(Z.index),se=o(ae,2),ce=se[0],de=se[1],Oe=new S.default().retain(Z.index+ce.length()-de-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Oe,b.default.sources.USER)}},"embed left":$(G.keys.LEFT,!1),"embed left shift":$(G.keys.LEFT,!0),"embed right":$(G.keys.RIGHT,!1),"embed right shift":$(G.keys.RIGHT,!0)}};function $(J,Z){var ae,se=J===G.keys.LEFT?"prefix":"suffix";return ae={key:J,shiftKey:Z,altKey:null},O(ae,se,/^$/),O(ae,"handler",function(de){var Oe=de.index;J===G.keys.RIGHT&&(Oe+=de.length+1);var Le=this.quill.getLeaf(Oe),ke=o(Le,1),Se=ke[0];return Se instanceof g.default.Embed?(J===G.keys.LEFT?Z?this.quill.setSelection(de.index-1,de.length+1,b.default.sources.USER):this.quill.setSelection(de.index-1,b.default.sources.USER):Z?this.quill.setSelection(de.index,de.length+1,b.default.sources.USER):this.quill.setSelection(de.index+de.length+1,b.default.sources.USER),!1):!0}),ae}function te(J,Z){if(!(J.index===0||this.quill.getLength()<=1)){var ae=this.quill.getLine(J.index),se=o(ae,1),ce=se[0],de={};if(Z.offset===0){var Oe=this.quill.getLine(J.index-1),Le=o(Oe,1),ke=Le[0];if(ke!=null&&ke.length()>1){var Se=ce.formats(),ye=this.quill.getFormat(J.index-1,1);de=x.default.attributes.diff(Se,ye)||{}}}var Je=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(Z.prefix)?2:1;this.quill.deleteText(J.index-Je,Je,b.default.sources.USER),Object.keys(de).length>0&&this.quill.formatLine(J.index-Je,Je,de,b.default.sources.USER),this.quill.focus()}}function W(J,Z){var ae=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(Z.suffix)?2:1;if(!(J.index>=this.quill.getLength()-ae)){var se={},ce=0,de=this.quill.getLine(J.index),Oe=o(de,1),Le=Oe[0];if(Z.offset>=Le.length()-1){var ke=this.quill.getLine(J.index+1),Se=o(ke,1),ye=Se[0];if(ye){var Je=Le.formats(),we=this.quill.getFormat(J.index,1);se=x.default.attributes.diff(Je,we)||{},ce=ye.length()}}this.quill.deleteText(J.index,ae,b.default.sources.USER),Object.keys(se).length>0&&this.quill.formatLine(J.index+ce-1,ae,se,b.default.sources.USER)}}function U(J){var Z=this.quill.getLines(J),ae={};if(Z.length>1){var se=Z[0].formats(),ce=Z[Z.length-1].formats();ae=x.default.attributes.diff(ce,se)||{}}this.quill.deleteText(J,b.default.sources.USER),Object.keys(ae).length>0&&this.quill.formatLine(J.index,1,ae,b.default.sources.USER),this.quill.setSelection(J.index,b.default.sources.SILENT),this.quill.focus()}function z(J,Z){var ae=this;J.length>0&&this.quill.scroll.deleteAt(J.index,J.length);var se=Object.keys(Z.format).reduce(function(ce,de){return g.default.query(de,g.default.Scope.BLOCK)&&!Array.isArray(Z.format[de])&&(ce[de]=Z.format[de]),ce},{});this.quill.insertText(J.index,`
|
|
137
|
+
`,se,b.default.sources.USER),this.quill.setSelection(J.index+1,b.default.sources.SILENT),this.quill.focus(),Object.keys(Z.format).forEach(function(ce){se[ce]==null&&(Array.isArray(Z.format[ce])||ce!=="link"&&ae.quill.format(ce,Z.format[ce],b.default.sources.USER))})}function D(J){return{key:G.keys.TAB,shiftKey:!J,format:{"code-block":!0},handler:function(ae){var se=g.default.query("code-block"),ce=ae.index,de=ae.length,Oe=this.quill.scroll.descendant(se,ce),Le=o(Oe,2),ke=Le[0],Se=Le[1];if(ke!=null){var ye=this.quill.getIndex(ke),Je=ke.newlineIndex(Se,!0)+1,we=ke.newlineIndex(ye+Se+de),me=ke.domNode.textContent.slice(Je,we).split(`
|
|
138
|
+
`);Se=0,me.forEach(function(Ee,Te){J?(ke.insertAt(Je+Se,se.TAB),Se+=se.TAB.length,Te===0?ce+=se.TAB.length:de+=se.TAB.length):Ee.startsWith(se.TAB)&&(ke.deleteAt(Je+Se,se.TAB.length),Se-=se.TAB.length,Te===0?ce-=se.TAB.length:de-=se.TAB.length),Se+=Ee.length+1}),this.quill.update(b.default.sources.USER),this.quill.setSelection(ce,de,b.default.sources.SILENT)}}}}function Y(J){return{key:J[0].toUpperCase(),shortKey:!0,handler:function(ae,se){this.quill.format(J,!se.format[J],b.default.sources.USER)}}}function Q(J){if(typeof J=="string"||typeof J=="number")return Q({key:J});if((typeof J>"u"?"undefined":i(J))==="object"&&(J=(0,u.default)(J,!1)),typeof J.key=="string")if(G.keys[J.key.toUpperCase()]!=null)J.key=G.keys[J.key.toUpperCase()];else if(J.key.length===1)J.key=J.key.toUpperCase().charCodeAt(0);else return null;return J.shortKey&&(J[V]=J.shortKey,delete J.shortKey),J}n.default=G,n.SHORTKEY=V},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function x(v,g){var E=[],b=!0,M=!1,N=void 0;try{for(var R=v[Symbol.iterator](),F;!(b=(F=R.next()).done)&&(E.push(F.value),!(g&&E.length===g));b=!0);}catch(j){M=!0,N=j}finally{try{!b&&R.return&&R.return()}finally{if(M)throw N}}return E}return function(v,g){if(Array.isArray(v))return v;if(Symbol.iterator in Object(v))return x(v,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(v,g,E){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var M=Object.getPrototypeOf(v);return M===null?void 0:x(M,g,E)}else{if("value"in b)return b.value;var N=b.get;return N===void 0?void 0:N.call(E)}},s=function(){function x(v,g){for(var E=0;E<g.length;E++){var b=g[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,E){return g&&x(v.prototype,g),E&&x(v,E),v}}(),c=a(0),u=y(c),d=a(7),p=y(d);function y(x){return x&&x.__esModule?x:{default:x}}function f(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function _(x,v){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:x}function S(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);x.prototype=Object.create(v&&v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(x,v):x.__proto__=v)}var w=function(x){S(v,x),s(v,null,[{key:"value",value:function(){}}]);function v(g,E){f(this,v);var b=_(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,g));return b.selection=E,b.textNode=document.createTextNode(v.CONTENTS),b.domNode.appendChild(b.textNode),b._length=0,b}return s(v,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(E,b){if(this._length!==0)return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,E,b);for(var M=this,N=0;M!=null&&M.statics.scope!==u.default.Scope.BLOCK_BLOT;)N+=M.offset(M.parent),M=M.parent;M!=null&&(this._length=v.CONTENTS.length,M.optimize(),M.formatAt(N,v.CONTENTS.length,E,b),this._length=0)}},{key:"index",value:function(E,b){return E===this.textNode?0:o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"index",this).call(this,E,b)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var E=this.textNode,b=this.selection.getNativeRange(),M=void 0,N=void 0,R=void 0;if(b!=null&&b.start.node===E&&b.end.node===E){var F=[E,b.start.offset,b.end.offset];M=F[0],N=F[1],R=F[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==v.CONTENTS){var j=this.textNode.data.split(v.CONTENTS).join("");this.next instanceof p.default?(M=this.next.domNode,this.next.insertAt(0,j),this.textNode.data=v.CONTENTS):(this.textNode.data=j,this.parent.insertBefore(u.default.create(this.textNode),this),this.textNode=document.createTextNode(v.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),N!=null){var O=[N,R].map(function(A){return Math.max(0,Math.min(M.data.length,A-1))}),C=i(O,2);return N=C[0],R=C[1],{startNode:M,startOffset:N,endNode:M,endOffset:R}}}}},{key:"update",value:function(E,b){var M=this;if(E.some(function(R){return R.type==="characterData"&&R.target===M.textNode})){var N=this.restore();N&&(b.range=N)}}},{key:"value",value:function(){return""}}]),v}(u.default.Embed);w.blotName="cursor",w.className="ql-cursor",w.tagName="span",w.CONTENTS="\uFEFF",n.default=w},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=u(i),s=a(4),c=u(s);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function p(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function y(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){y(S,_);function S(){return d(this,S),p(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return S}(o.default.Container);f.allowedChildren=[c.default,s.BlockEmbed,f],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var i=function(){function w(x,v){for(var g=0;g<v.length;g++){var E=v[g];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,v,g){return v&&w(x.prototype,v),g&&w(x,g),x}}(),o=function w(x,v,g){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,v);if(E===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,v,g)}else{if("value"in E)return E.value;var M=E.get;return M===void 0?void 0:M.call(g)}},s=a(0),c=u(s);function u(w){return w&&w.__esModule?w:{default:w}}function d(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function p(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function y(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var f=function(w){y(x,w);function x(){return d(this,x),p(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"value",value:function(g){var E=o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,g);return E.startsWith("rgb(")?(E=E.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+E.split(",").map(function(b){return("00"+parseInt(b).toString(16)).slice(-2)}).join("")):E}}]),x}(c.default.Attributor.Style),_=new c.default.Attributor.Class("color","ql-color",{scope:c.default.Scope.INLINE}),S=new f("color","color",{scope:c.default.Scope.INLINE});n.ColorAttributor=f,n.ColorClass=_,n.ColorStyle=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var i=function(){function S(w,x){for(var v=0;v<x.length;v++){var g=x[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(w,g.key,g)}}return function(w,x,v){return x&&S(w.prototype,x),v&&S(w,v),w}}(),o=function S(w,x,v){w===null&&(w=Function.prototype);var g=Object.getOwnPropertyDescriptor(w,x);if(g===void 0){var E=Object.getPrototypeOf(w);return E===null?void 0:S(E,x,v)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(v)}},s=a(6),c=u(s);function u(S){return S&&S.__esModule?S:{default:S}}function d(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function p(S,w){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:S}function y(S,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);S.prototype=Object.create(w&&w.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(S,w):S.__proto__=w)}var f=function(S){y(w,S);function w(){return d(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return i(w,[{key:"format",value:function(v,g){if(v!==this.statics.blotName||!g)return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,v,g);g=this.constructor.sanitize(g),this.domNode.setAttribute("href",g)}}],[{key:"create",value:function(v){var g=o(w.__proto__||Object.getPrototypeOf(w),"create",this).call(this,v);return v=this.sanitize(v),g.setAttribute("href",v),g.setAttribute("rel","noopener noreferrer"),g.setAttribute("target","_blank"),g}},{key:"formats",value:function(v){return v.getAttribute("href")}},{key:"sanitize",value:function(v){return _(v,this.PROTOCOL_WHITELIST)?v:this.SANITIZED_URL}}]),w}(c.default);f.blotName="link",f.tagName="A",f.SANITIZED_URL="about:blank",f.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function _(S,w){var x=document.createElement("a");x.href=S;var v=x.href.slice(0,x.href.indexOf(":"));return w.indexOf(v)>-1}n.default=f,n.sanitize=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=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(x,v){for(var g=0;g<v.length;g++){var E=v[g];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,v,g){return v&&w(x.prototype,v),g&&w(x,g),x}}(),s=a(23),c=p(s),u=a(107),d=p(u);function p(w){return w&&w.__esModule?w:{default:w}}function y(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}var f=0;function _(w,x){w.setAttribute(x,w.getAttribute(x)!=="true")}var S=function(){function w(x){var v=this;y(this,w),this.select=x,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){v.togglePicker()}),this.label.addEventListener("keydown",function(g){switch(g.keyCode){case c.default.keys.ENTER:v.togglePicker();break;case c.default.keys.ESCAPE:v.escape(),g.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(w,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),_(this.label,"aria-expanded"),_(this.options,"aria-hidden")}},{key:"buildItem",value:function(v){var g=this,E=document.createElement("span");return E.tabIndex="0",E.setAttribute("role","button"),E.classList.add("ql-picker-item"),v.hasAttribute("value")&&E.setAttribute("data-value",v.getAttribute("value")),v.textContent&&E.setAttribute("data-label",v.textContent),E.addEventListener("click",function(){g.selectItem(E,!0)}),E.addEventListener("keydown",function(b){switch(b.keyCode){case c.default.keys.ENTER:g.selectItem(E,!0),b.preventDefault();break;case c.default.keys.ESCAPE:g.escape(),b.preventDefault();break}}),E}},{key:"buildLabel",value:function(){var v=document.createElement("span");return v.classList.add("ql-picker-label"),v.innerHTML=d.default,v.tabIndex="0",v.setAttribute("role","button"),v.setAttribute("aria-expanded","false"),this.container.appendChild(v),v}},{key:"buildOptions",value:function(){var v=this,g=document.createElement("span");g.classList.add("ql-picker-options"),g.setAttribute("aria-hidden","true"),g.tabIndex="-1",g.id="ql-picker-options-"+f,f+=1,this.label.setAttribute("aria-controls",g.id),this.options=g,[].slice.call(this.select.options).forEach(function(E){var b=v.buildItem(E);g.appendChild(b),E.selected===!0&&v.selectItem(b)}),this.container.appendChild(g)}},{key:"buildPicker",value:function(){var v=this;[].slice.call(this.select.attributes).forEach(function(g){v.container.setAttribute(g.name,g.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var v=this;this.close(),setTimeout(function(){return v.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(v){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,E=this.container.querySelector(".ql-selected");if(v!==E&&(E!=null&&E.classList.remove("ql-selected"),v!=null&&(v.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(v.parentNode.children,v),v.hasAttribute("data-value")?this.label.setAttribute("data-value",v.getAttribute("data-value")):this.label.removeAttribute("data-value"),v.hasAttribute("data-label")?this.label.setAttribute("data-label",v.getAttribute("data-label")):this.label.removeAttribute("data-label"),g))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":i(Event))==="object"){var b=document.createEvent("Event");b.initEvent("change",!0,!0),this.select.dispatchEvent(b)}this.close()}}},{key:"update",value:function(){var v=void 0;if(this.select.selectedIndex>-1){var g=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];v=this.select.options[this.select.selectedIndex],this.selectItem(g)}else this.selectItem(null);var E=v!=null&&v!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",E)}}]),w}();n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=T(i),s=a(5),c=T(s),u=a(4),d=T(u),p=a(16),y=T(p),f=a(25),_=T(f),S=a(24),w=T(S),x=a(35),v=T(x),g=a(6),E=T(g),b=a(22),M=T(b),N=a(7),R=T(N),F=a(55),j=T(F),O=a(42),C=T(O),A=a(23),k=T(A);function T(V){return V&&V.__esModule?V:{default:V}}c.default.register({"blots/block":d.default,"blots/block/embed":u.BlockEmbed,"blots/break":y.default,"blots/container":_.default,"blots/cursor":w.default,"blots/embed":v.default,"blots/inline":E.default,"blots/scroll":M.default,"blots/text":R.default,"modules/clipboard":j.default,"modules/history":C.default,"modules/keyboard":k.default}),o.default.register(d.default,y.default,w.default,E.default,M.default,R.default),n.default=c.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function s(c){this.domNode=c,this.domNode[i.DATA_KEY]={blot:this}}return Object.defineProperty(s.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),s.create=function(c){if(this.tagName==null)throw new i.ParchmentError("Blot definition missing tagName");var u;return Array.isArray(this.tagName)?(typeof c=="string"&&(c=c.toUpperCase(),parseInt(c).toString()===c&&(c=parseInt(c))),typeof c=="number"?u=document.createElement(this.tagName[c-1]):this.tagName.indexOf(c)>-1?u=document.createElement(c):u=document.createElement(this.tagName[0])):u=document.createElement(this.tagName),this.className&&u.classList.add(this.className),u},s.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},s.prototype.clone=function(){var c=this.domNode.cloneNode(!1);return i.create(c)},s.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[i.DATA_KEY]},s.prototype.deleteAt=function(c,u){var d=this.isolate(c,u);d.remove()},s.prototype.formatAt=function(c,u,d,p){var y=this.isolate(c,u);if(i.query(d,i.Scope.BLOT)!=null&&p)y.wrap(d,p);else if(i.query(d,i.Scope.ATTRIBUTE)!=null){var f=i.create(this.statics.scope);y.wrap(f),f.format(d,p)}},s.prototype.insertAt=function(c,u,d){var p=d==null?i.create("text",u):i.create(u,d),y=this.split(c);this.parent.insertBefore(p,y)},s.prototype.insertInto=function(c,u){u===void 0&&(u=null),this.parent!=null&&this.parent.children.remove(this);var d=null;c.children.insertBefore(this,u),u!=null&&(d=u.domNode),(this.domNode.parentNode!=c.domNode||this.domNode.nextSibling!=d)&&c.domNode.insertBefore(this.domNode,d),this.parent=c,this.attach()},s.prototype.isolate=function(c,u){var d=this.split(c);return d.split(u),d},s.prototype.length=function(){return 1},s.prototype.offset=function(c){return c===void 0&&(c=this.parent),this.parent==null||this==c?0:this.parent.children.offset(this)+this.parent.offset(c)},s.prototype.optimize=function(c){this.domNode[i.DATA_KEY]!=null&&delete this.domNode[i.DATA_KEY].mutations},s.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},s.prototype.replace=function(c){c.parent!=null&&(c.parent.insertBefore(this,c.next),c.remove())},s.prototype.replaceWith=function(c,u){var d=typeof c=="string"?i.create(c,u):c;return d.replace(this),d},s.prototype.split=function(c,u){return c===0?this:this.next},s.prototype.update=function(c,u){},s.prototype.wrap=function(c,u){var d=typeof c=="string"?i.create(c,u):c;return this.parent!=null&&this.parent.insertBefore(d,this.next),d.appendChild(this),d},s.blotName="abstract",s}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(12),o=a(32),s=a(33),c=a(1),u=function(){function d(p){this.attributes={},this.domNode=p,this.build()}return d.prototype.attribute=function(p,y){y?p.add(this.domNode,y)&&(p.value(this.domNode)!=null?this.attributes[p.attrName]=p:delete this.attributes[p.attrName]):(p.remove(this.domNode),delete this.attributes[p.attrName])},d.prototype.build=function(){var p=this;this.attributes={};var y=i.default.keys(this.domNode),f=o.default.keys(this.domNode),_=s.default.keys(this.domNode);y.concat(f).concat(_).forEach(function(S){var w=c.query(S,c.Scope.ATTRIBUTE);w instanceof i.default&&(p.attributes[w.attrName]=w)})},d.prototype.copy=function(p){var y=this;Object.keys(this.attributes).forEach(function(f){var _=y.attributes[f].value(y.domNode);p.format(f,_)})},d.prototype.move=function(p){var y=this;this.copy(p),Object.keys(this.attributes).forEach(function(f){y.attributes[f].remove(y.domNode)}),this.attributes={}},d.prototype.values=function(){var p=this;return Object.keys(this.attributes).reduce(function(y,f){return y[f]=p.attributes[f].value(p.domNode),y},{})},d}();n.default=u},function(t,n,a){var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var y in p)p.hasOwnProperty(y)&&(d[y]=p[y])};return function(d,p){u(d,p);function y(){this.constructor=d}d.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function s(u,d){var p=u.getAttribute("class")||"";return p.split(/\s+/).filter(function(y){return y.indexOf(d+"-")===0})}var c=function(u){i(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.keys=function(p){return(p.getAttribute("class")||"").split(/\s+/).map(function(y){return y.split("-").slice(0,-1).join("-")})},d.prototype.add=function(p,y){return this.canAdd(p,y)?(this.remove(p),p.classList.add(this.keyName+"-"+y),!0):!1},d.prototype.remove=function(p){var y=s(p,this.keyName);y.forEach(function(f){p.classList.remove(f)}),p.classList.length===0&&p.removeAttribute("class")},d.prototype.value=function(p){var y=s(p,this.keyName)[0]||"",f=y.slice(this.keyName.length+1);return this.canAdd(p,f)?f:""},d}(o.default);n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var y in p)p.hasOwnProperty(y)&&(d[y]=p[y])};return function(d,p){u(d,p);function y(){this.constructor=d}d.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function s(u){var d=u.split("-"),p=d.slice(1).map(function(y){return y[0].toUpperCase()+y.slice(1)}).join("");return d[0]+p}var c=function(u){i(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.keys=function(p){return(p.getAttribute("style")||"").split(";").map(function(y){var f=y.split(":");return f[0].trim()})},d.prototype.add=function(p,y){return this.canAdd(p,y)?(p.style[s(this.keyName)]=y,!0):!1},d.prototype.remove=function(p){p.style[s(this.keyName)]="",p.getAttribute("style")||p.removeAttribute("style")},d.prototype.value=function(p){var y=p.style[s(this.keyName)];return this.canAdd(p,y)?y:""},d}(o.default);n.default=c},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function c(u,d){for(var p=0;p<d.length;p++){var y=d[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(u,y.key,y)}}return function(u,d,p){return d&&c(u.prototype,d),p&&c(u,p),u}}();function o(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}var s=function(){function c(u,d){o(this,c),this.quill=u,this.options=d,this.modules={}}return i(c,[{key:"init",value:function(){var d=this;Object.keys(this.options.modules).forEach(function(p){d.modules[p]==null&&d.addModule(p)})}},{key:"addModule",value:function(d){var p=this.quill.constructor.import("modules/"+d);return this.modules[d]=new p(this.quill,this.options.modules[d]||{}),this.modules[d]}}]),c}();s.DEFAULTS={modules:{}},s.themes={default:s},n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function x(v,g){for(var E=0;E<g.length;E++){var b=g[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,E){return g&&x(v.prototype,g),E&&x(v,E),v}}(),o=function x(v,g,E){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var M=Object.getPrototypeOf(v);return M===null?void 0:x(M,g,E)}else{if("value"in b)return b.value;var N=b.get;return N===void 0?void 0:N.call(E)}},s=a(0),c=p(s),u=a(7),d=p(u);function p(x){return x&&x.__esModule?x:{default:x}}function y(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function f(x,v){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:x}function _(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);x.prototype=Object.create(v&&v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(x,v):x.__proto__=v)}var S="\uFEFF",w=function(x){_(v,x);function v(g){y(this,v);var E=f(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,g));return E.contentNode=document.createElement("span"),E.contentNode.setAttribute("contenteditable",!1),[].slice.call(E.domNode.childNodes).forEach(function(b){E.contentNode.appendChild(b)}),E.leftGuard=document.createTextNode(S),E.rightGuard=document.createTextNode(S),E.domNode.appendChild(E.leftGuard),E.domNode.appendChild(E.contentNode),E.domNode.appendChild(E.rightGuard),E}return i(v,[{key:"index",value:function(E,b){return E===this.leftGuard?0:E===this.rightGuard?1:o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"index",this).call(this,E,b)}},{key:"restore",value:function(E){var b=void 0,M=void 0,N=E.data.split(S).join("");if(E===this.leftGuard)if(this.prev instanceof d.default){var R=this.prev.length();this.prev.insertAt(R,N),b={startNode:this.prev.domNode,startOffset:R+N.length}}else M=document.createTextNode(N),this.parent.insertBefore(c.default.create(M),this),b={startNode:M,startOffset:N.length};else E===this.rightGuard&&(this.next instanceof d.default?(this.next.insertAt(0,N),b={startNode:this.next.domNode,startOffset:N.length}):(M=document.createTextNode(N),this.parent.insertBefore(c.default.create(M),this.next),b={startNode:M,startOffset:N.length}));return E.data=S,b}},{key:"update",value:function(E,b){var M=this;E.forEach(function(N){if(N.type==="characterData"&&(N.target===M.leftGuard||N.target===M.rightGuard)){var R=M.restore(N.target);R&&(b.range=R)}})}}]),v}(c.default.Embed);n.default=w},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var i=a(0),o=s(i);function s(y){return y&&y.__esModule?y:{default:y}}var c={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},u=new o.default.Attributor.Attribute("align","align",c),d=new o.default.Attributor.Class("align","ql-align",c),p=new o.default.Attributor.Style("align","text-align",c);n.AlignAttribute=u,n.AlignClass=d,n.AlignStyle=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var i=a(0),o=c(i),s=a(26);function c(p){return p&&p.__esModule?p:{default:p}}var u=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),d=new s.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=u,n.BackgroundStyle=d},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var i=a(0),o=s(i);function s(y){return y&&y.__esModule?y:{default:y}}var c={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},u=new o.default.Attributor.Attribute("direction","dir",c),d=new o.default.Attributor.Class("direction","ql-direction",c),p=new o.default.Attributor.Style("direction","direction",c);n.DirectionAttribute=u,n.DirectionClass=d,n.DirectionStyle=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var i=function(){function x(v,g){for(var E=0;E<g.length;E++){var b=g[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(v,b.key,b)}}return function(v,g,E){return g&&x(v.prototype,g),E&&x(v,E),v}}(),o=function x(v,g,E){v===null&&(v=Function.prototype);var b=Object.getOwnPropertyDescriptor(v,g);if(b===void 0){var M=Object.getPrototypeOf(v);return M===null?void 0:x(M,g,E)}else{if("value"in b)return b.value;var N=b.get;return N===void 0?void 0:N.call(E)}},s=a(0),c=u(s);function u(x){return x&&x.__esModule?x:{default:x}}function d(x,v){if(!(x instanceof v))throw new TypeError("Cannot call a class as a function")}function p(x,v){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:x}function y(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);x.prototype=Object.create(v&&v.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(x,v):x.__proto__=v)}var f={scope:c.default.Scope.INLINE,whitelist:["serif","monospace"]},_=new c.default.Attributor.Class("font","ql-font",f),S=function(x){y(v,x);function v(){return d(this,v),p(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return i(v,[{key:"value",value:function(E){return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,E).replace(/["']/g,"")}}]),v}(c.default.Attributor.Style),w=new S("font","font-family",f);n.FontStyle=w,n.FontClass=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var i=a(0),o=s(i);function s(d){return d&&d.__esModule?d:{default:d}}var c=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),u=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=c,n.SizeStyle=u},function(t,n,a){t.exports={align:{"":a(76),center:a(77),right:a(78),justify:a(79)},background:a(80),blockquote:a(81),bold:a(82),clean:a(83),code:a(58),"code-block":a(58),color:a(84),direction:{"":a(85),rtl:a(86)},float:{center:a(87),full:a(88),left:a(89),right:a(90)},formula:a(91),header:{1:a(92),2:a(93)},italic:a(94),image:a(95),indent:{"+1":a(96),"-1":a(97)},link:a(98),list:{ordered:a(99),bullet:a(100),check:a(101)},script:{sub:a(102),super:a(103)},strike:a(104),underline:a(105),video:a(106)}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var i=function(){function g(E,b){for(var M=0;M<b.length;M++){var N=b[M];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(E,N.key,N)}}return function(E,b,M){return b&&g(E.prototype,b),M&&g(E,M),E}}(),o=a(0),s=y(o),c=a(5),u=y(c),d=a(9),p=y(d);function y(g){return g&&g.__esModule?g:{default:g}}function f(g,E){if(!(g instanceof E))throw new TypeError("Cannot call a class as a function")}function _(g,E){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:g}function S(g,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);g.prototype=Object.create(E&&E.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(g,E):g.__proto__=E)}var w=function(g){S(E,g);function E(b,M){f(this,E);var N=_(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,b,M));return N.lastRecorded=0,N.ignoreChange=!1,N.clear(),N.quill.on(u.default.events.EDITOR_CHANGE,function(R,F,j,O){R!==u.default.events.TEXT_CHANGE||N.ignoreChange||(!N.options.userOnly||O===u.default.sources.USER?N.record(F,j):N.transform(F))}),N.quill.keyboard.addBinding({key:"Z",shortKey:!0},N.undo.bind(N)),N.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},N.redo.bind(N)),/Win/i.test(navigator.platform)&&N.quill.keyboard.addBinding({key:"Y",shortKey:!0},N.redo.bind(N)),N}return i(E,[{key:"change",value:function(M,N){if(this.stack[M].length!==0){var R=this.stack[M].pop();this.stack[N].push(R),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(R[M],u.default.sources.USER),this.ignoreChange=!1;var F=v(R[M]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(M,N){if(M.ops.length!==0){this.stack.redo=[];var R=this.quill.getContents().diff(N),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var j=this.stack.undo.pop();R=R.compose(j.undo),M=j.redo.compose(M)}else this.lastRecorded=F;this.stack.undo.push({redo:M,undo:R}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(M){this.stack.undo.forEach(function(N){N.undo=M.transform(N.undo,!0),N.redo=M.transform(N.redo,!0)}),this.stack.redo.forEach(function(N){N.undo=M.transform(N.undo,!0),N.redo=M.transform(N.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),E}(p.default);w.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function x(g){var E=g.ops[g.ops.length-1];return E==null?!1:E.insert!=null?typeof E.insert=="string"&&E.insert.endsWith(`
|
|
139
|
+
`):E.attributes!=null?Object.keys(E.attributes).some(function(b){return s.default.query(b,s.default.Scope.BLOCK)!=null}):!1}function v(g){var E=g.reduce(function(M,N){return M+=N.delete||0,M},0),b=g.length()-E;return x(g)&&(b-=1),b}n.default=w,n.getLastChangeIndex=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var i=function(){function z(D,Y){for(var Q=0;Q<Y.length;Q++){var J=Y[Q];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(D,J.key,J)}}return function(D,Y,Q){return Y&&z(D.prototype,Y),Q&&z(D,Q),D}}(),o=function z(D,Y,Q){D===null&&(D=Function.prototype);var J=Object.getOwnPropertyDescriptor(D,Y);if(J===void 0){var Z=Object.getPrototypeOf(D);return Z===null?void 0:z(Z,Y,Q)}else{if("value"in J)return J.value;var ae=J.get;return ae===void 0?void 0:ae.call(Q)}},s=a(3),c=F(s),u=a(2),d=F(u),p=a(8),y=F(p),f=a(23),_=F(f),S=a(34),w=F(S),x=a(59),v=F(x),g=a(60),E=F(g),b=a(28),M=F(b),N=a(61),R=F(N);function F(z){return z&&z.__esModule?z:{default:z}}function j(z,D){if(!(z instanceof D))throw new TypeError("Cannot call a class as a function")}function O(z,D){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:z}function C(z,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);z.prototype=Object.create(D&&D.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(z,D):z.__proto__=D)}var A=[!1,"center","right","justify"],k=["#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"],T=[!1,"serif","monospace"],V=["1","2","3",!1],G=["small",!1,"large","huge"],$=function(z){C(D,z);function D(Y,Q){j(this,D);var J=O(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,Y,Q)),Z=function ae(se){if(!document.body.contains(Y.root))return document.body.removeEventListener("click",ae);J.tooltip!=null&&!J.tooltip.root.contains(se.target)&&document.activeElement!==J.tooltip.textbox&&!J.quill.hasFocus()&&J.tooltip.hide(),J.pickers!=null&&J.pickers.forEach(function(ce){ce.container.contains(se.target)||ce.close()})};return Y.emitter.listenDOM("click",document.body,Z),J}return i(D,[{key:"addModule",value:function(Q){var J=o(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"addModule",this).call(this,Q);return Q==="toolbar"&&this.extendToolbar(J),J}},{key:"buildButtons",value:function(Q,J){Q.forEach(function(Z){var ae=Z.getAttribute("class")||"";ae.split(/\s+/).forEach(function(se){if(se.startsWith("ql-")&&(se=se.slice(3),J[se]!=null))if(se==="direction")Z.innerHTML=J[se][""]+J[se].rtl;else if(typeof J[se]=="string")Z.innerHTML=J[se];else{var ce=Z.value||"";ce!=null&&J[se][ce]&&(Z.innerHTML=J[se][ce])}})})}},{key:"buildPickers",value:function(Q,J){var Z=this;this.pickers=Q.map(function(se){if(se.classList.contains("ql-align"))return se.querySelector("option")==null&&U(se,A),new E.default(se,J.align);if(se.classList.contains("ql-background")||se.classList.contains("ql-color")){var ce=se.classList.contains("ql-background")?"background":"color";return se.querySelector("option")==null&&U(se,k,ce==="background"?"#ffffff":"#000000"),new v.default(se,J[ce])}else return se.querySelector("option")==null&&(se.classList.contains("ql-font")?U(se,T):se.classList.contains("ql-header")?U(se,V):se.classList.contains("ql-size")&&U(se,G)),new M.default(se)});var ae=function(){Z.pickers.forEach(function(ce){ce.update()})};this.quill.on(y.default.events.EDITOR_CHANGE,ae)}}]),D}(w.default);$.DEFAULTS=(0,c.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var D=this,Y=this.container.querySelector("input.ql-image[type=file]");Y==null&&(Y=document.createElement("input"),Y.setAttribute("type","file"),Y.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Y.classList.add("ql-image"),Y.addEventListener("change",function(){if(Y.files!=null&&Y.files[0]!=null){var Q=new FileReader;Q.onload=function(J){var Z=D.quill.getSelection(!0);D.quill.updateContents(new d.default().retain(Z.index).delete(Z.length).insert({image:J.target.result}),y.default.sources.USER),D.quill.setSelection(Z.index+1,y.default.sources.SILENT),Y.value=""},Q.readAsDataURL(Y.files[0])}}),this.container.appendChild(Y)),Y.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var te=function(z){C(D,z);function D(Y,Q){j(this,D);var J=O(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,Y,Q));return J.textbox=J.root.querySelector('input[type="text"]'),J.listen(),J}return i(D,[{key:"listen",value:function(){var Q=this;this.textbox.addEventListener("keydown",function(J){_.default.match(J,"enter")?(Q.save(),J.preventDefault()):_.default.match(J,"escape")&&(Q.cancel(),J.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),J!=null?this.textbox.value=J:Q!==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-"+Q)||""),this.root.setAttribute("data-mode",Q)}},{key:"restoreFocus",value:function(){var Q=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=Q}},{key:"save",value:function(){var Q=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var J=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",Q,y.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",Q,y.default.sources.USER)),this.quill.root.scrollTop=J;break}case"video":Q=W(Q);case"formula":{if(!Q)break;var Z=this.quill.getSelection(!0);if(Z!=null){var ae=Z.index+Z.length;this.quill.insertEmbed(ae,this.root.getAttribute("data-mode"),Q,y.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(ae+1," ",y.default.sources.USER),this.quill.setSelection(ae+2,y.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),D}(R.default);function W(z){var D=z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return D?(D[1]||"https")+"://www.youtube.com/embed/"+D[2]+"?showinfo=0":(D=z.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(D[1]||"https")+"://player.vimeo.com/video/"+D[2]+"/":z}function U(z,D){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;D.forEach(function(Q){var J=document.createElement("option");Q===Y?J.setAttribute("selected","selected"):J.setAttribute("value",Q),z.appendChild(J)})}n.BaseTooltip=te,n.default=$},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];this.insertBefore(s[0],null),s.length>1&&this.append.apply(this,s.slice(1))},o.prototype.contains=function(s){for(var c,u=this.iterator();c=u();)if(c===s)return!0;return!1},o.prototype.insertBefore=function(s,c){s&&(s.next=c,c!=null?(s.prev=c.prev,c.prev!=null&&(c.prev.next=s),c.prev=s,c===this.head&&(this.head=s)):this.tail!=null?(this.tail.next=s,s.prev=this.tail,this.tail=s):(s.prev=null,this.head=this.tail=s),this.length+=1)},o.prototype.offset=function(s){for(var c=0,u=this.head;u!=null;){if(u===s)return c;c+=u.length(),u=u.next}return-1},o.prototype.remove=function(s){this.contains(s)&&(s.prev!=null&&(s.prev.next=s.next),s.next!=null&&(s.next.prev=s.prev),s===this.head&&(this.head=s.next),s===this.tail&&(this.tail=s.prev),this.length-=1)},o.prototype.iterator=function(s){return s===void 0&&(s=this.head),function(){var c=s;return s!=null&&(s=s.next),c}},o.prototype.find=function(s,c){c===void 0&&(c=!1);for(var u,d=this.iterator();u=d();){var p=u.length();if(s<p||c&&s===p&&(u.next==null||u.next.length()!==0))return[u,s];s-=p}return[null,0]},o.prototype.forEach=function(s){for(var c,u=this.iterator();c=u();)s(c)},o.prototype.forEachAt=function(s,c,u){if(!(c<=0))for(var d=this.find(s),p=d[0],y=d[1],f,_=s-y,S=this.iterator(p);(f=S())&&_<s+c;){var w=f.length();s>_?u(f,s-_,Math.min(c,_+w-s)):u(f,0,Math.min(w,s+c-_)),_+=w}},o.prototype.map=function(s){return this.reduce(function(c,u){return c.push(s(u)),c},[])},o.prototype.reduce=function(s,c){for(var u,d=this.iterator();u=d();)c=s(c,u);return c},o}();n.default=i},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var _ in f)f.hasOwnProperty(_)&&(y[_]=f[_])};return function(y,f){p(y,f);function _(){this.constructor=y}y.prototype=f===null?Object.create(f):(_.prototype=f.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(17),s=a(1),c={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},u=100,d=function(p){i(y,p);function y(f){var _=p.call(this,f)||this;return _.scroll=_,_.observer=new MutationObserver(function(S){_.update(S)}),_.observer.observe(_.domNode,c),_.attach(),_}return y.prototype.detach=function(){p.prototype.detach.call(this),this.observer.disconnect()},y.prototype.deleteAt=function(f,_){this.update(),f===0&&_===this.length()?this.children.forEach(function(S){S.remove()}):p.prototype.deleteAt.call(this,f,_)},y.prototype.formatAt=function(f,_,S,w){this.update(),p.prototype.formatAt.call(this,f,_,S,w)},y.prototype.insertAt=function(f,_,S){this.update(),p.prototype.insertAt.call(this,f,_,S)},y.prototype.optimize=function(f,_){var S=this;f===void 0&&(f=[]),_===void 0&&(_={}),p.prototype.optimize.call(this,_);for(var w=[].slice.call(this.observer.takeRecords());w.length>0;)f.push(w.pop());for(var x=function(b,M){M===void 0&&(M=!0),!(b==null||b===S)&&b.domNode.parentNode!=null&&(b.domNode[s.DATA_KEY].mutations==null&&(b.domNode[s.DATA_KEY].mutations=[]),M&&x(b.parent))},v=function(b){b.domNode[s.DATA_KEY]==null||b.domNode[s.DATA_KEY].mutations==null||(b instanceof o.default&&b.children.forEach(v),b.optimize(_))},g=f,E=0;g.length>0;E+=1){if(E>=u)throw new Error("[Parchment] Maximum optimize iterations reached");for(g.forEach(function(b){var M=s.find(b.target,!0);M!=null&&(M.domNode===b.target&&(b.type==="childList"?(x(s.find(b.previousSibling,!1)),[].forEach.call(b.addedNodes,function(N){var R=s.find(N,!1);x(R,!1),R instanceof o.default&&R.children.forEach(function(F){x(F,!1)})})):b.type==="attributes"&&x(M.prev)),x(M))}),this.children.forEach(v),g=[].slice.call(this.observer.takeRecords()),w=g.slice();w.length>0;)f.push(w.pop())}},y.prototype.update=function(f,_){var S=this;_===void 0&&(_={}),f=f||this.observer.takeRecords(),f.map(function(w){var x=s.find(w.target,!0);return x==null?null:x.domNode[s.DATA_KEY].mutations==null?(x.domNode[s.DATA_KEY].mutations=[w],x):(x.domNode[s.DATA_KEY].mutations.push(w),null)}).forEach(function(w){w==null||w===S||w.domNode[s.DATA_KEY]==null||w.update(w.domNode[s.DATA_KEY].mutations||[],_)}),this.domNode[s.DATA_KEY].mutations!=null&&p.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,_),this.optimize(f,_)},y.blotName="scroll",y.defaultChild="block",y.scope=s.Scope.BLOCK_BLOT,y.tagName="DIV",y}(o.default);n.default=d},function(t,n,a){var i=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var f in y)y.hasOwnProperty(f)&&(p[f]=y[f])};return function(p,y){d(p,y);function f(){this.constructor=p}p.prototype=y===null?Object.create(y):(f.prototype=y.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),s=a(1);function c(d,p){if(Object.keys(d).length!==Object.keys(p).length)return!1;for(var y in d)if(d[y]!==p[y])return!1;return!0}var u=function(d){i(p,d);function p(){return d!==null&&d.apply(this,arguments)||this}return p.formats=function(y){if(y.tagName!==p.tagName)return d.formats.call(this,y)},p.prototype.format=function(y,f){var _=this;y===this.statics.blotName&&!f?(this.children.forEach(function(S){S instanceof o.default||(S=S.wrap(p.blotName,!0)),_.attributes.copy(S)}),this.unwrap()):d.prototype.format.call(this,y,f)},p.prototype.formatAt=function(y,f,_,S){if(this.formats()[_]!=null||s.query(_,s.Scope.ATTRIBUTE)){var w=this.isolate(y,f);w.format(_,S)}else d.prototype.formatAt.call(this,y,f,_,S)},p.prototype.optimize=function(y){d.prototype.optimize.call(this,y);var f=this.formats();if(Object.keys(f).length===0)return this.unwrap();var _=this.next;_ instanceof p&&_.prev===this&&c(f,_.formats())&&(_.moveChildren(this),_.remove())},p.blotName="inline",p.scope=s.Scope.INLINE_BLOT,p.tagName="SPAN",p}(o.default);n.default=u},function(t,n,a){var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var y in p)p.hasOwnProperty(y)&&(d[y]=p[y])};return function(d,p){u(d,p);function y(){this.constructor=d}d.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),s=a(1),c=function(u){i(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.formats=function(p){var y=s.query(d.blotName).tagName;if(p.tagName!==y)return u.formats.call(this,p)},d.prototype.format=function(p,y){s.query(p,s.Scope.BLOCK)!=null&&(p===this.statics.blotName&&!y?this.replaceWith(d.blotName):u.prototype.format.call(this,p,y))},d.prototype.formatAt=function(p,y,f,_){s.query(f,s.Scope.BLOCK)!=null?this.format(f,_):u.prototype.formatAt.call(this,p,y,f,_)},d.prototype.insertAt=function(p,y,f){if(f==null||s.query(y,s.Scope.INLINE)!=null)u.prototype.insertAt.call(this,p,y,f);else{var _=this.split(p),S=s.create(y,f);_.parent.insertBefore(S,_)}},d.prototype.update=function(p,y){navigator.userAgent.match(/Trident/)?this.build():u.prototype.update.call(this,p,y)},d.blotName="block",d.scope=s.Scope.BLOCK_BLOT,d.tagName="P",d}(o.default);n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var p in d)d.hasOwnProperty(p)&&(u[p]=d[p])};return function(u,d){c(u,d);function p(){this.constructor=u}u.prototype=d===null?Object.create(d):(p.prototype=d.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(19),s=function(c){i(u,c);function u(){return c!==null&&c.apply(this,arguments)||this}return u.formats=function(d){},u.prototype.format=function(d,p){c.prototype.formatAt.call(this,0,this.length(),d,p)},u.prototype.formatAt=function(d,p,y,f){d===0&&p===this.length()?this.format(y,f):c.prototype.formatAt.call(this,d,p,y,f)},u.prototype.formats=function(){return this.statics.formats(this.domNode)},u}(o.default);n.default=s},function(t,n,a){var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var y in p)p.hasOwnProperty(y)&&(d[y]=p[y])};return function(d,p){u(d,p);function y(){this.constructor=d}d.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(19),s=a(1),c=function(u){i(d,u);function d(p){var y=u.call(this,p)||this;return y.text=y.statics.value(y.domNode),y}return d.create=function(p){return document.createTextNode(p)},d.value=function(p){var y=p.data;return y.normalize&&(y=y.normalize()),y},d.prototype.deleteAt=function(p,y){this.domNode.data=this.text=this.text.slice(0,p)+this.text.slice(p+y)},d.prototype.index=function(p,y){return this.domNode===p?y:-1},d.prototype.insertAt=function(p,y,f){f==null?(this.text=this.text.slice(0,p)+y+this.text.slice(p),this.domNode.data=this.text):u.prototype.insertAt.call(this,p,y,f)},d.prototype.length=function(){return this.text.length},d.prototype.optimize=function(p){u.prototype.optimize.call(this,p),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof d&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},d.prototype.position=function(p,y){return[this.domNode,p]},d.prototype.split=function(p,y){if(y===void 0&&(y=!1),!y){if(p===0)return this;if(p===this.length())return this.next}var f=s.create(this.domNode.splitText(p));return this.parent.insertBefore(f,this.next),this.text=this.statics.value(this.domNode),f},d.prototype.update=function(p,y){var f=this;p.some(function(_){return _.type==="characterData"&&_.target===f.domNode})&&(this.text=this.statics.value(this.domNode))},d.prototype.value=function(){return this.text},d.blotName="text",d.scope=s.Scope.INLINE_BLOT,d}(o.default);n.default=c},function(t,n,a){var i=document.createElement("div");if(i.classList.toggle("test-class",!1),i.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(s,c){return arguments.length>1&&!this.contains(s)==!c?c:o.call(this,s)}}String.prototype.startsWith||(String.prototype.startsWith=function(s,c){return c=c||0,this.substr(c,s.length)===s}),String.prototype.endsWith||(String.prototype.endsWith=function(s,c){var u=this.toString();(typeof c!="number"||!isFinite(c)||Math.floor(c)!==c||c>u.length)&&(c=u.length),c-=s.length;var d=u.indexOf(s,c);return d!==-1&&d===c}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(c){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof c!="function")throw new TypeError("predicate must be a function");for(var u=Object(this),d=u.length>>>0,p=arguments[1],y,f=0;f<d;f++)if(y=u[f],c.call(p,y,f,u))return y}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,n){var a=-1,i=1,o=0;function s(E,b,M){if(E==b)return E?[[o,E]]:[];(M<0||E.length<M)&&(M=null);var N=p(E,b),R=E.substring(0,N);E=E.substring(N),b=b.substring(N),N=y(E,b);var F=E.substring(E.length-N);E=E.substring(0,E.length-N),b=b.substring(0,b.length-N);var j=c(E,b);return R&&j.unshift([o,R]),F&&j.push([o,F]),_(j),M!=null&&(j=x(j,M)),j=v(j),j}function c(E,b){var M;if(!E)return[[i,b]];if(!b)return[[a,E]];var N=E.length>b.length?E:b,R=E.length>b.length?b:E,F=N.indexOf(R);if(F!=-1)return M=[[i,N.substring(0,F)],[o,R],[i,N.substring(F+R.length)]],E.length>b.length&&(M[0][0]=M[2][0]=a),M;if(R.length==1)return[[a,E],[i,b]];var j=f(E,b);if(j){var O=j[0],C=j[1],A=j[2],k=j[3],T=j[4],V=s(O,A),G=s(C,k);return V.concat([[o,T]],G)}return u(E,b)}function u(E,b){for(var M=E.length,N=b.length,R=Math.ceil((M+N)/2),F=R,j=2*R,O=new Array(j),C=new Array(j),A=0;A<j;A++)O[A]=-1,C[A]=-1;O[F+1]=0,C[F+1]=0;for(var k=M-N,T=k%2!=0,V=0,G=0,$=0,te=0,W=0;W<R;W++){for(var U=-W+V;U<=W-G;U+=2){var z=F+U,D;U==-W||U!=W&&O[z-1]<O[z+1]?D=O[z+1]:D=O[z-1]+1;for(var Y=D-U;D<M&&Y<N&&E.charAt(D)==b.charAt(Y);)D++,Y++;if(O[z]=D,D>M)G+=2;else if(Y>N)V+=2;else if(T){var Q=F+k-U;if(Q>=0&&Q<j&&C[Q]!=-1){var J=M-C[Q];if(D>=J)return d(E,b,D,Y)}}}for(var Z=-W+$;Z<=W-te;Z+=2){var Q=F+Z,J;Z==-W||Z!=W&&C[Q-1]<C[Q+1]?J=C[Q+1]:J=C[Q-1]+1;for(var ae=J-Z;J<M&&ae<N&&E.charAt(M-J-1)==b.charAt(N-ae-1);)J++,ae++;if(C[Q]=J,J>M)te+=2;else if(ae>N)$+=2;else if(!T){var z=F+k-Z;if(z>=0&&z<j&&O[z]!=-1){var D=O[z],Y=F+D-z;if(J=M-J,D>=J)return d(E,b,D,Y)}}}}return[[a,E],[i,b]]}function d(E,b,M,N){var R=E.substring(0,M),F=b.substring(0,N),j=E.substring(M),O=b.substring(N),C=s(R,F),A=s(j,O);return C.concat(A)}function p(E,b){if(!E||!b||E.charAt(0)!=b.charAt(0))return 0;for(var M=0,N=Math.min(E.length,b.length),R=N,F=0;M<R;)E.substring(F,R)==b.substring(F,R)?(M=R,F=M):N=R,R=Math.floor((N-M)/2+M);return R}function y(E,b){if(!E||!b||E.charAt(E.length-1)!=b.charAt(b.length-1))return 0;for(var M=0,N=Math.min(E.length,b.length),R=N,F=0;M<R;)E.substring(E.length-R,E.length-F)==b.substring(b.length-R,b.length-F)?(M=R,F=M):N=R,R=Math.floor((N-M)/2+M);return R}function f(E,b){var M=E.length>b.length?E:b,N=E.length>b.length?b:E;if(M.length<4||N.length*2<M.length)return null;function R(G,$,te){for(var W=G.substring(te,te+Math.floor(G.length/4)),U=-1,z="",D,Y,Q,J;(U=$.indexOf(W,U+1))!=-1;){var Z=p(G.substring(te),$.substring(U)),ae=y(G.substring(0,te),$.substring(0,U));z.length<ae+Z&&(z=$.substring(U-ae,U)+$.substring(U,U+Z),D=G.substring(0,te-ae),Y=G.substring(te+Z),Q=$.substring(0,U-ae),J=$.substring(U+Z))}return z.length*2>=G.length?[D,Y,Q,J,z]:null}var F=R(M,N,Math.ceil(M.length/4)),j=R(M,N,Math.ceil(M.length/2)),O;if(!F&&!j)return null;j?F?O=F[4].length>j[4].length?F:j:O=j:O=F;var C,A,k,T;E.length>b.length?(C=O[0],A=O[1],k=O[2],T=O[3]):(k=O[0],T=O[1],C=O[2],A=O[3]);var V=O[4];return[C,A,k,T,V]}function _(E){E.push([o,""]);for(var b=0,M=0,N=0,R="",F="",j;b<E.length;)switch(E[b][0]){case i:N++,F+=E[b][1],b++;break;case a:M++,R+=E[b][1],b++;break;case o:M+N>1?(M!==0&&N!==0&&(j=p(F,R),j!==0&&(b-M-N>0&&E[b-M-N-1][0]==o?E[b-M-N-1][1]+=F.substring(0,j):(E.splice(0,0,[o,F.substring(0,j)]),b++),F=F.substring(j),R=R.substring(j)),j=y(F,R),j!==0&&(E[b][1]=F.substring(F.length-j)+E[b][1],F=F.substring(0,F.length-j),R=R.substring(0,R.length-j))),M===0?E.splice(b-N,M+N,[i,F]):N===0?E.splice(b-M,M+N,[a,R]):E.splice(b-M-N,M+N,[a,R],[i,F]),b=b-M-N+(M?1:0)+(N?1:0)+1):b!==0&&E[b-1][0]==o?(E[b-1][1]+=E[b][1],E.splice(b,1)):b++,N=0,M=0,R="",F="";break}E[E.length-1][1]===""&&E.pop();var O=!1;for(b=1;b<E.length-1;)E[b-1][0]==o&&E[b+1][0]==o&&(E[b][1].substring(E[b][1].length-E[b-1][1].length)==E[b-1][1]?(E[b][1]=E[b-1][1]+E[b][1].substring(0,E[b][1].length-E[b-1][1].length),E[b+1][1]=E[b-1][1]+E[b+1][1],E.splice(b-1,1),O=!0):E[b][1].substring(0,E[b+1][1].length)==E[b+1][1]&&(E[b-1][1]+=E[b+1][1],E[b][1]=E[b][1].substring(E[b+1][1].length)+E[b+1][1],E.splice(b+1,1),O=!0)),b++;O&&_(E)}var S=s;S.INSERT=i,S.DELETE=a,S.EQUAL=o,t.exports=S;function w(E,b){if(b===0)return[o,E];for(var M=0,N=0;N<E.length;N++){var R=E[N];if(R[0]===a||R[0]===o){var F=M+R[1].length;if(b===F)return[N+1,E];if(b<F){E=E.slice();var j=b-M,O=[R[0],R[1].slice(0,j)],C=[R[0],R[1].slice(j)];return E.splice(N,1,O,C),[N+1,E]}else M=F}}throw new Error("cursor_pos is out of bounds!")}function x(E,b){var M=w(E,b),N=M[1],R=M[0],F=N[R],j=N[R+1];if(F==null)return E;if(F[0]!==o)return E;if(j!=null&&F[1]+j[1]===j[1]+F[1])return N.splice(R,2,j,F),g(N,R,2);if(j!=null&&j[1].indexOf(F[1])===0){N.splice(R,2,[j[0],F[1]],[0,F[1]]);var O=j[1].slice(F[1].length);return O.length>0&&N.splice(R+2,0,[j[0],O]),g(N,R,3)}else return E}function v(E){for(var b=!1,M=function(j){return j.charCodeAt(0)>=56320&&j.charCodeAt(0)<=57343},N=function(j){return j.charCodeAt(j.length-1)>=55296&&j.charCodeAt(j.length-1)<=56319},R=2;R<E.length;R+=1)E[R-2][0]===o&&N(E[R-2][1])&&E[R-1][0]===a&&M(E[R-1][1])&&E[R][0]===i&&M(E[R][1])&&(b=!0,E[R-1][1]=E[R-2][1].slice(-1)+E[R-1][1],E[R][1]=E[R-2][1].slice(-1)+E[R][1],E[R-2][1]=E[R-2][1].slice(0,-1));if(!b)return E;for(var F=[],R=0;R<E.length;R+=1)E[R][1].length>0&&F.push(E[R]);return F}function g(E,b,M){for(var N=b+M-1;N>=0&&N>=b-1;N--)if(N+1<E.length){var R=E[N],F=E[N+1];R[0]===F[1]&&E.splice(N,2,[R[0],R[1]+F[1]])}return E}},function(t,n){n=t.exports=typeof Object.keys=="function"?Object.keys:a,n.shim=a;function a(i){var o=[];for(var s in i)o.push(s);return o}},function(t,n){var a=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=t.exports=a?i:o,n.supported=i;function i(s){return Object.prototype.toString.call(s)=="[object Arguments]"}n.unsupported=o;function o(s){return s&&typeof s=="object"&&typeof s.length=="number"&&Object.prototype.hasOwnProperty.call(s,"callee")&&!Object.prototype.propertyIsEnumerable.call(s,"callee")||!1}},function(t,n){var a=Object.prototype.hasOwnProperty,i="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(i=!1));function s(u,d,p){this.fn=u,this.context=d,this.once=p||!1}function c(){this._events=new o,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],p,y;if(this._eventsCount===0)return d;for(y in p=this._events)a.call(p,y)&&d.push(i?y.slice(1):y);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},c.prototype.listeners=function(d,p){var y=i?i+d:d,f=this._events[y];if(p)return!!f;if(!f)return[];if(f.fn)return[f.fn];for(var _=0,S=f.length,w=new Array(S);_<S;_++)w[_]=f[_].fn;return w},c.prototype.emit=function(d,p,y,f,_,S){var w=i?i+d:d;if(!this._events[w])return!1;var x=this._events[w],v=arguments.length,g,E;if(x.fn){switch(x.once&&this.removeListener(d,x.fn,void 0,!0),v){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,p),!0;case 3:return x.fn.call(x.context,p,y),!0;case 4:return x.fn.call(x.context,p,y,f),!0;case 5:return x.fn.call(x.context,p,y,f,_),!0;case 6:return x.fn.call(x.context,p,y,f,_,S),!0}for(E=1,g=new Array(v-1);E<v;E++)g[E-1]=arguments[E];x.fn.apply(x.context,g)}else{var b=x.length,M;for(E=0;E<b;E++)switch(x[E].once&&this.removeListener(d,x[E].fn,void 0,!0),v){case 1:x[E].fn.call(x[E].context);break;case 2:x[E].fn.call(x[E].context,p);break;case 3:x[E].fn.call(x[E].context,p,y);break;case 4:x[E].fn.call(x[E].context,p,y,f);break;default:if(!g)for(M=1,g=new Array(v-1);M<v;M++)g[M-1]=arguments[M];x[E].fn.apply(x[E].context,g)}}return!0},c.prototype.on=function(d,p,y){var f=new s(p,y||this),_=i?i+d:d;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],f]:this._events[_].push(f):(this._events[_]=f,this._eventsCount++),this},c.prototype.once=function(d,p,y){var f=new s(p,y||this,!0),_=i?i+d:d;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],f]:this._events[_].push(f):(this._events[_]=f,this._eventsCount++),this},c.prototype.removeListener=function(d,p,y,f){var _=i?i+d:d;if(!this._events[_])return this;if(!p)return--this._eventsCount===0?this._events=new o:delete this._events[_],this;var S=this._events[_];if(S.fn)S.fn===p&&(!f||S.once)&&(!y||S.context===y)&&(--this._eventsCount===0?this._events=new o:delete this._events[_]);else{for(var w=0,x=[],v=S.length;w<v;w++)(S[w].fn!==p||f&&!S[w].once||y&&S[w].context!==y)&&x.push(S[w]);x.length?this._events[_]=x.length===1?x[0]:x:--this._eventsCount===0?this._events=new o:delete this._events[_]}return this},c.prototype.removeAllListeners=function(d){var p;return d?(p=i?i+d:d,this._events[p]&&(--this._eventsCount===0?this._events=new o:delete this._events[p])):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prototype.setMaxListeners=function(){return this},c.prefixed=i,c.EventEmitter=c,typeof t<"u"&&(t.exports=c)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(we){return typeof we}:function(we){return we&&typeof Symbol=="function"&&we.constructor===Symbol&&we!==Symbol.prototype?"symbol":typeof we},o=function(){function we(me,Ee){var Te=[],he=!0,Re=!1,Ie=void 0;try{for(var Xe=me[Symbol.iterator](),rt;!(he=(rt=Xe.next()).done)&&(Te.push(rt.value),!(Ee&&Te.length===Ee));he=!0);}catch(vt){Re=!0,Ie=vt}finally{try{!he&&Xe.return&&Xe.return()}finally{if(Re)throw Ie}}return Te}return function(me,Ee){if(Array.isArray(me))return me;if(Symbol.iterator in Object(me))return we(me,Ee);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function we(me,Ee){for(var Te=0;Te<Ee.length;Te++){var he=Ee[Te];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(me,he.key,he)}}return function(me,Ee,Te){return Ee&&we(me.prototype,Ee),Te&&we(me,Te),me}}(),c=a(3),u=C(c),d=a(2),p=C(d),y=a(0),f=C(y),_=a(5),S=C(_),w=a(10),x=C(w),v=a(9),g=C(v),E=a(36),b=a(37),M=a(13),N=C(M),R=a(26),F=a(38),j=a(39),O=a(40);function C(we){return we&&we.__esModule?we:{default:we}}function A(we,me,Ee){return me in we?Object.defineProperty(we,me,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):we[me]=Ee,we}function k(we,me){if(!(we instanceof me))throw new TypeError("Cannot call a class as a function")}function T(we,me){if(!we)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return me&&(typeof me=="object"||typeof me=="function")?me:we}function V(we,me){if(typeof me!="function"&&me!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof me);we.prototype=Object.create(me&&me.prototype,{constructor:{value:we,enumerable:!1,writable:!0,configurable:!0}}),me&&(Object.setPrototypeOf?Object.setPrototypeOf(we,me):we.__proto__=me)}var G=(0,x.default)("quill:clipboard"),$="__ql-matcher",te=[[Node.TEXT_NODE,Je],[Node.TEXT_NODE,ke],["br",de],[Node.ELEMENT_NODE,ke],[Node.ELEMENT_NODE,ce],[Node.ELEMENT_NODE,Se],[Node.ELEMENT_NODE,se],[Node.ELEMENT_NODE,ye],["li",Le],["b",ae.bind(ae,"bold")],["i",ae.bind(ae,"italic")],["style",Oe]],W=[E.AlignAttribute,F.DirectionAttribute].reduce(function(we,me){return we[me.keyName]=me,we},{}),U=[E.AlignStyle,b.BackgroundStyle,R.ColorStyle,F.DirectionStyle,j.FontStyle,O.SizeStyle].reduce(function(we,me){return we[me.keyName]=me,we},{}),z=function(we){V(me,we);function me(Ee,Te){k(this,me);var he=T(this,(me.__proto__||Object.getPrototypeOf(me)).call(this,Ee,Te));return he.quill.root.addEventListener("paste",he.onPaste.bind(he)),he.container=he.quill.addContainer("ql-clipboard"),he.container.setAttribute("contenteditable",!0),he.container.setAttribute("tabindex",-1),he.matchers=[],te.concat(he.options.matchers).forEach(function(Re){var Ie=o(Re,2),Xe=Ie[0],rt=Ie[1];!Te.matchVisual&&rt===Se||he.addMatcher(Xe,rt)}),he}return s(me,[{key:"addMatcher",value:function(Te,he){this.matchers.push([Te,he])}},{key:"convert",value:function(Te){if(typeof Te=="string")return this.container.innerHTML=Te.replace(/\>\r?\n +\</g,"><"),this.convert();var he=this.quill.getFormat(this.quill.selection.savedRange.index);if(he[N.default.blotName]){var Re=this.container.innerText;return this.container.innerHTML="",new p.default().insert(Re,A({},N.default.blotName,he[N.default.blotName]))}var Ie=this.prepareMatching(),Xe=o(Ie,2),rt=Xe[0],vt=Xe[1],et=Z(this.container,rt,vt);return Q(et,`
|
|
140
|
+
`)&&et.ops[et.ops.length-1].attributes==null&&(et=et.compose(new p.default().retain(et.length()-1).delete(1))),G.log("convert",this.container.innerHTML,et),this.container.innerHTML="",et}},{key:"dangerouslyPasteHTML",value:function(Te,he){var Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.default.sources.API;if(typeof Te=="string")this.quill.setContents(this.convert(Te),he),this.quill.setSelection(0,S.default.sources.SILENT);else{var Ie=this.convert(he);this.quill.updateContents(new p.default().retain(Te).concat(Ie),Re),this.quill.setSelection(Te+Ie.length(),S.default.sources.SILENT)}}},{key:"onPaste",value:function(Te){var he=this;if(!(Te.defaultPrevented||!this.quill.isEnabled())){var Re=this.quill.getSelection(),Ie=new p.default().retain(Re.index),Xe=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(S.default.sources.SILENT),setTimeout(function(){Ie=Ie.concat(he.convert()).delete(Re.length),he.quill.updateContents(Ie,S.default.sources.USER),he.quill.setSelection(Ie.length()-Re.length,S.default.sources.SILENT),he.quill.scrollingContainer.scrollTop=Xe,he.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Te=this,he=[],Re=[];return this.matchers.forEach(function(Ie){var Xe=o(Ie,2),rt=Xe[0],vt=Xe[1];switch(rt){case Node.TEXT_NODE:Re.push(vt);break;case Node.ELEMENT_NODE:he.push(vt);break;default:[].forEach.call(Te.container.querySelectorAll(rt),function(et){et[$]=et[$]||[],et[$].push(vt)});break}}),[he,Re]}}]),me}(g.default);z.DEFAULTS={matchers:[],matchVisual:!0};function D(we,me,Ee){return(typeof me>"u"?"undefined":i(me))==="object"?Object.keys(me).reduce(function(Te,he){return D(Te,he,me[he])},we):we.reduce(function(Te,he){return he.attributes&&he.attributes[me]?Te.push(he):Te.insert(he.insert,(0,u.default)({},A({},me,Ee),he.attributes))},new p.default)}function Y(we){if(we.nodeType!==Node.ELEMENT_NODE)return{};var me="__ql-computed-style";return we[me]||(we[me]=window.getComputedStyle(we))}function Q(we,me){for(var Ee="",Te=we.ops.length-1;Te>=0&&Ee.length<me.length;--Te){var he=we.ops[Te];if(typeof he.insert!="string")break;Ee=he.insert+Ee}return Ee.slice(-1*me.length)===me}function J(we){if(we.childNodes.length===0)return!1;var me=Y(we);return["block","list-item"].indexOf(me.display)>-1}function Z(we,me,Ee){return we.nodeType===we.TEXT_NODE?Ee.reduce(function(Te,he){return he(we,Te)},new p.default):we.nodeType===we.ELEMENT_NODE?[].reduce.call(we.childNodes||[],function(Te,he){var Re=Z(he,me,Ee);return he.nodeType===we.ELEMENT_NODE&&(Re=me.reduce(function(Ie,Xe){return Xe(he,Ie)},Re),Re=(he[$]||[]).reduce(function(Ie,Xe){return Xe(he,Ie)},Re)),Te.concat(Re)},new p.default):new p.default}function ae(we,me,Ee){return D(Ee,we,!0)}function se(we,me){var Ee=f.default.Attributor.Attribute.keys(we),Te=f.default.Attributor.Class.keys(we),he=f.default.Attributor.Style.keys(we),Re={};return Ee.concat(Te).concat(he).forEach(function(Ie){var Xe=f.default.query(Ie,f.default.Scope.ATTRIBUTE);Xe!=null&&(Re[Xe.attrName]=Xe.value(we),Re[Xe.attrName])||(Xe=W[Ie],Xe!=null&&(Xe.attrName===Ie||Xe.keyName===Ie)&&(Re[Xe.attrName]=Xe.value(we)||void 0),Xe=U[Ie],Xe!=null&&(Xe.attrName===Ie||Xe.keyName===Ie)&&(Xe=U[Ie],Re[Xe.attrName]=Xe.value(we)||void 0))}),Object.keys(Re).length>0&&(me=D(me,Re)),me}function ce(we,me){var Ee=f.default.query(we);if(Ee==null)return me;if(Ee.prototype instanceof f.default.Embed){var Te={},he=Ee.value(we);he!=null&&(Te[Ee.blotName]=he,me=new p.default().insert(Te,Ee.formats(we)))}else typeof Ee.formats=="function"&&(me=D(me,Ee.blotName,Ee.formats(we)));return me}function de(we,me){return Q(me,`
|
|
141
|
+
`)||me.insert(`
|
|
142
|
+
`),me}function Oe(){return new p.default}function Le(we,me){var Ee=f.default.query(we);if(Ee==null||Ee.blotName!=="list-item"||!Q(me,`
|
|
143
|
+
`))return me;for(var Te=-1,he=we.parentNode;!he.classList.contains("ql-clipboard");)(f.default.query(he)||{}).blotName==="list"&&(Te+=1),he=he.parentNode;return Te<=0?me:me.compose(new p.default().retain(me.length()-1).retain(1,{indent:Te}))}function ke(we,me){return Q(me,`
|
|
144
|
+
`)||(J(we)||me.length()>0&&we.nextSibling&&J(we.nextSibling))&&me.insert(`
|
|
145
|
+
`),me}function Se(we,me){if(J(we)&&we.nextElementSibling!=null&&!Q(me,`
|
|
146
|
+
|
|
147
|
+
`)){var Ee=we.offsetHeight+parseFloat(Y(we).marginTop)+parseFloat(Y(we).marginBottom);we.nextElementSibling.offsetTop>we.offsetTop+Ee*1.5&&me.insert(`
|
|
148
|
+
`)}return me}function ye(we,me){var Ee={},Te=we.style||{};return Te.fontStyle&&Y(we).fontStyle==="italic"&&(Ee.italic=!0),Te.fontWeight&&(Y(we).fontWeight.startsWith("bold")||parseInt(Y(we).fontWeight)>=700)&&(Ee.bold=!0),Object.keys(Ee).length>0&&(me=D(me,Ee)),parseFloat(Te.textIndent||0)>0&&(me=new p.default().insert(" ").concat(me)),me}function Je(we,me){var Ee=we.data;if(we.parentNode.tagName==="O:P")return me.insert(Ee.trim());if(Ee.trim().length===0&&we.parentNode.classList.contains("ql-clipboard"))return me;if(!Y(we.parentNode).whiteSpace.startsWith("pre")){var Te=function(Re,Ie){return Ie=Ie.replace(/[^\u00a0]/g,""),Ie.length<1&&Re?" ":Ie};Ee=Ee.replace(/\r\n/g," ").replace(/\n/g," "),Ee=Ee.replace(/\s\s+/g,Te.bind(Te,!0)),(we.previousSibling==null&&J(we.parentNode)||we.previousSibling!=null&&J(we.previousSibling))&&(Ee=Ee.replace(/^\s+/,Te.bind(Te,!1))),(we.nextSibling==null&&J(we.parentNode)||we.nextSibling!=null&&J(we.nextSibling))&&(Ee=Ee.replace(/\s+$/,Te.bind(Te,!1)))}return me.insert(Ee)}n.default=z,n.matchAttributor=se,n.matchBlot=ce,n.matchNewline=ke,n.matchSpacing=Se,n.matchText=Je},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(S,w){for(var x=0;x<w.length;x++){var v=w[x];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,w,x){return w&&_(S.prototype,w),x&&_(S,x),S}}(),o=function _(S,w,x){S===null&&(S=Function.prototype);var v=Object.getOwnPropertyDescriptor(S,w);if(v===void 0){var g=Object.getPrototypeOf(S);return g===null?void 0:_(g,w,x)}else{if("value"in v)return v.value;var E=v.get;return E===void 0?void 0:E.call(x)}},s=a(6),c=u(s);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function p(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function y(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){y(S,_);function S(){return d(this,S),p(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,[{key:"optimize",value:function(x){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,x),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),S}(c.default);f.blotName="bold",f.tagName=["STRONG","B"],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var i=function(){function O(C,A){var k=[],T=!0,V=!1,G=void 0;try{for(var $=C[Symbol.iterator](),te;!(T=(te=$.next()).done)&&(k.push(te.value),!(A&&k.length===A));T=!0);}catch(W){V=!0,G=W}finally{try{!T&&$.return&&$.return()}finally{if(V)throw G}}return k}return function(C,A){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return O(C,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function O(C,A){for(var k=0;k<A.length;k++){var T=A[k];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(C,T.key,T)}}return function(C,A,k){return A&&O(C.prototype,A),k&&O(C,k),C}}(),s=a(2),c=x(s),u=a(0),d=x(u),p=a(5),y=x(p),f=a(10),_=x(f),S=a(9),w=x(S);function x(O){return O&&O.__esModule?O:{default:O}}function v(O,C,A){return C in O?Object.defineProperty(O,C,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[C]=A,O}function g(O,C){if(!(O instanceof C))throw new TypeError("Cannot call a class as a function")}function E(O,C){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:O}function b(O,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);O.prototype=Object.create(C&&C.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(O,C):O.__proto__=C)}var M=(0,_.default)("quill:toolbar"),N=function(O){b(C,O);function C(A,k){g(this,C);var T=E(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,A,k));if(Array.isArray(T.options.container)){var V=document.createElement("div");F(V,T.options.container),A.container.parentNode.insertBefore(V,A.container),T.container=V}else typeof T.options.container=="string"?T.container=document.querySelector(T.options.container):T.container=T.options.container;if(!(T.container instanceof HTMLElement)){var G;return G=M.error("Container required for toolbar",T.options),E(T,G)}return T.container.classList.add("ql-toolbar"),T.controls=[],T.handlers={},Object.keys(T.options.handlers).forEach(function($){T.addHandler($,T.options.handlers[$])}),[].forEach.call(T.container.querySelectorAll("button, select"),function($){T.attach($)}),T.quill.on(y.default.events.EDITOR_CHANGE,function($,te){$===y.default.events.SELECTION_CHANGE&&T.update(te)}),T.quill.on(y.default.events.SCROLL_OPTIMIZE,function(){var $=T.quill.selection.getRange(),te=i($,1),W=te[0];T.update(W)}),T}return o(C,[{key:"addHandler",value:function(k,T){this.handlers[k]=T}},{key:"attach",value:function(k){var T=this,V=[].find.call(k.classList,function($){return $.indexOf("ql-")===0});if(V){if(V=V.slice(3),k.tagName==="BUTTON"&&k.setAttribute("type","button"),this.handlers[V]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[V]==null){M.warn("ignoring attaching to disabled format",V,k);return}if(d.default.query(V)==null){M.warn("ignoring attaching to nonexistent format",V,k);return}}var G=k.tagName==="SELECT"?"change":"click";k.addEventListener(G,function($){var te=void 0;if(k.tagName==="SELECT"){if(k.selectedIndex<0)return;var W=k.options[k.selectedIndex];W.hasAttribute("selected")?te=!1:te=W.value||!1}else k.classList.contains("ql-active")?te=!1:te=k.value||!k.hasAttribute("value"),$.preventDefault();T.quill.focus();var U=T.quill.selection.getRange(),z=i(U,1),D=z[0];if(T.handlers[V]!=null)T.handlers[V].call(T,te);else if(d.default.query(V).prototype instanceof d.default.Embed){if(te=prompt("Enter "+V),!te)return;T.quill.updateContents(new c.default().retain(D.index).delete(D.length).insert(v({},V,te)),y.default.sources.USER)}else T.quill.format(V,te,y.default.sources.USER);T.update(D)}),this.controls.push([V,k])}}},{key:"update",value:function(k){var T=k==null?{}:this.quill.getFormat(k);this.controls.forEach(function(V){var G=i(V,2),$=G[0],te=G[1];if(te.tagName==="SELECT"){var W=void 0;if(k==null)W=null;else if(T[$]==null)W=te.querySelector("option[selected]");else if(!Array.isArray(T[$])){var U=T[$];typeof U=="string"&&(U=U.replace(/\"/g,'\\"')),W=te.querySelector('option[value="'+U+'"]')}W==null?(te.value="",te.selectedIndex=-1):W.selected=!0}else if(k==null)te.classList.remove("ql-active");else if(te.hasAttribute("value")){var z=T[$]===te.getAttribute("value")||T[$]!=null&&T[$].toString()===te.getAttribute("value")||T[$]==null&&!te.getAttribute("value");te.classList.toggle("ql-active",z)}else te.classList.toggle("ql-active",T[$]!=null)})}}]),C}(w.default);N.DEFAULTS={};function R(O,C,A){var k=document.createElement("button");k.setAttribute("type","button"),k.classList.add("ql-"+C),A!=null&&(k.value=A),O.appendChild(k)}function F(O,C){Array.isArray(C[0])||(C=[C]),C.forEach(function(A){var k=document.createElement("span");k.classList.add("ql-formats"),A.forEach(function(T){if(typeof T=="string")R(k,T);else{var V=Object.keys(T)[0],G=T[V];Array.isArray(G)?j(k,V,G):R(k,V,G)}}),O.appendChild(k)})}function j(O,C,A){var k=document.createElement("select");k.classList.add("ql-"+C),A.forEach(function(T){var V=document.createElement("option");T!==!1?V.setAttribute("value",T):V.setAttribute("selected","selected"),k.appendChild(V)}),O.appendChild(k)}N.DEFAULTS={container:null,handlers:{clean:function(){var C=this,A=this.quill.getSelection();if(A!=null)if(A.length==0){var k=this.quill.getFormat();Object.keys(k).forEach(function(T){d.default.query(T,d.default.Scope.INLINE)!=null&&C.quill.format(T,!1)})}else this.quill.removeFormat(A,y.default.sources.USER)},direction:function(C){var A=this.quill.getFormat().align;C==="rtl"&&A==null?this.quill.format("align","right",y.default.sources.USER):!C&&A==="right"&&this.quill.format("align",!1,y.default.sources.USER),this.quill.format("direction",C,y.default.sources.USER)},indent:function(C){var A=this.quill.getSelection(),k=this.quill.getFormat(A),T=parseInt(k.indent||0);if(C==="+1"||C==="-1"){var V=C==="+1"?1:-1;k.direction==="rtl"&&(V*=-1),this.quill.format("indent",T+V,y.default.sources.USER)}},link:function(C){C===!0&&(C=prompt("Enter link URL:")),this.quill.format("link",C,y.default.sources.USER)},list:function(C){var A=this.quill.getSelection(),k=this.quill.getFormat(A);C==="check"?k.list==="checked"||k.list==="unchecked"?this.quill.format("list",!1,y.default.sources.USER):this.quill.format("list","unchecked",y.default.sources.USER):this.quill.format("list",C,y.default.sources.USER)}}},n.default=N,n.addControls=F},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(S,w){for(var x=0;x<w.length;x++){var v=w[x];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,w,x){return w&&_(S.prototype,w),x&&_(S,x),S}}(),o=function _(S,w,x){S===null&&(S=Function.prototype);var v=Object.getOwnPropertyDescriptor(S,w);if(v===void 0){var g=Object.getPrototypeOf(S);return g===null?void 0:_(g,w,x)}else{if("value"in v)return v.value;var E=v.get;return E===void 0?void 0:E.call(x)}},s=a(28),c=u(s);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function p(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function y(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){y(S,_);function S(w,x){d(this,S);var v=p(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,w));return v.label.innerHTML=x,v.container.classList.add("ql-color-picker"),[].slice.call(v.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(g){g.classList.add("ql-primary")}),v}return i(S,[{key:"buildItem",value:function(x){var v=o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"buildItem",this).call(this,x);return v.style.backgroundColor=x.getAttribute("value")||"",v}},{key:"selectItem",value:function(x,v){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"selectItem",this).call(this,x,v);var g=this.label.querySelector(".ql-color-label"),E=x&&x.getAttribute("data-value")||"";g&&(g.tagName==="line"?g.style.stroke=E:g.style.fill=E)}}]),S}(c.default);n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(S,w){for(var x=0;x<w.length;x++){var v=w[x];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,w,x){return w&&_(S.prototype,w),x&&_(S,x),S}}(),o=function _(S,w,x){S===null&&(S=Function.prototype);var v=Object.getOwnPropertyDescriptor(S,w);if(v===void 0){var g=Object.getPrototypeOf(S);return g===null?void 0:_(g,w,x)}else{if("value"in v)return v.value;var E=v.get;return E===void 0?void 0:E.call(x)}},s=a(28),c=u(s);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function p(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function y(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){y(S,_);function S(w,x){d(this,S);var v=p(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,w));return v.container.classList.add("ql-icon-picker"),[].forEach.call(v.container.querySelectorAll(".ql-picker-item"),function(g){g.innerHTML=x[g.getAttribute("data-value")||""]}),v.defaultItem=v.container.querySelector(".ql-selected"),v.selectItem(v.defaultItem),v}return i(S,[{key:"selectItem",value:function(x,v){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"selectItem",this).call(this,x,v),x=x||this.defaultItem,this.label.innerHTML=x.innerHTML}}]),S}(c.default);n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function c(u,d){for(var p=0;p<d.length;p++){var y=d[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(u,y.key,y)}}return function(u,d,p){return d&&c(u.prototype,d),p&&c(u,p),u}}();function o(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}var s=function(){function c(u,d){var p=this;o(this,c),this.quill=u,this.boundsContainer=d||document.body,this.root=u.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){p.root.style.marginTop=-1*p.quill.root.scrollTop+"px"}),this.hide()}return i(c,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(d){var p=d.left+d.width/2-this.root.offsetWidth/2,y=d.bottom+this.quill.root.scrollTop;this.root.style.left=p+"px",this.root.style.top=y+"px",this.root.classList.remove("ql-flip");var f=this.boundsContainer.getBoundingClientRect(),_=this.root.getBoundingClientRect(),S=0;if(_.right>f.right&&(S=f.right-_.right,this.root.style.left=p+S+"px"),_.left<f.left&&(S=f.left-_.left,this.root.style.left=p+S+"px"),_.bottom>f.bottom){var w=_.bottom-_.top,x=d.bottom-d.top+w;this.root.style.top=y-x+"px",this.root.classList.add("ql-flip")}return S}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),c}();n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function j(O,C){var A=[],k=!0,T=!1,V=void 0;try{for(var G=O[Symbol.iterator](),$;!(k=($=G.next()).done)&&(A.push($.value),!(C&&A.length===C));k=!0);}catch(te){T=!0,V=te}finally{try{!k&&G.return&&G.return()}finally{if(T)throw V}}return A}return function(O,C){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return j(O,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function j(O,C,A){O===null&&(O=Function.prototype);var k=Object.getOwnPropertyDescriptor(O,C);if(k===void 0){var T=Object.getPrototypeOf(O);return T===null?void 0:j(T,C,A)}else{if("value"in k)return k.value;var V=k.get;return V===void 0?void 0:V.call(A)}},s=function(){function j(O,C){for(var A=0;A<C.length;A++){var k=C[A];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(O,k.key,k)}}return function(O,C,A){return C&&j(O.prototype,C),A&&j(O,A),O}}(),c=a(3),u=g(c),d=a(8),p=g(d),y=a(43),f=g(y),_=a(27),S=g(_),w=a(15),x=a(41),v=g(x);function g(j){return j&&j.__esModule?j:{default:j}}function E(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function b(j,O){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:j}function M(j,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);j.prototype=Object.create(O&&O.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(j,O):j.__proto__=O)}var N=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],R=function(j){M(O,j);function O(C,A){E(this,O),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=N);var k=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,C,A));return k.quill.container.classList.add("ql-snow"),k}return s(O,[{key:"extendToolbar",value:function(A){A.container.classList.add("ql-snow"),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),v.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),v.default),this.tooltip=new F(this.quill,this.options.bounds),A.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(k,T){A.handlers.link.call(A,!T.format.link)})}}]),O}(f.default);R.DEFAULTS=(0,u.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(O){if(O){var C=this.quill.getSelection();if(C==null||C.length==0)return;var A=this.quill.getText(C);/^\S+@\S+\.\S+$/.test(A)&&A.indexOf("mailto:")!==0&&(A="mailto:"+A);var k=this.quill.theme.tooltip;k.edit("link",A)}else this.quill.format("link",!1)}}}}});var F=function(j){M(O,j);function O(C,A){E(this,O);var k=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,C,A));return k.preview=k.root.querySelector("a.ql-preview"),k}return s(O,[{key:"listen",value:function(){var A=this;o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(k){A.root.classList.contains("ql-editing")?A.save():A.edit("link",A.preview.textContent),k.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(k){if(A.linkRange!=null){var T=A.linkRange;A.restoreFocus(),A.quill.formatText(T,"link",!1,p.default.sources.USER),delete A.linkRange}k.preventDefault(),A.hide()}),this.quill.on(p.default.events.SELECTION_CHANGE,function(k,T,V){if(k!=null){if(k.length===0&&V===p.default.sources.USER){var G=A.quill.scroll.descendant(S.default,k.index),$=i(G,2),te=$[0],W=$[1];if(te!=null){A.linkRange=new w.Range(k.index-W,te.length());var U=S.default.formats(te.domNode);A.preview.textContent=U,A.preview.setAttribute("href",U),A.show(),A.position(A.quill.getBounds(A.linkRange));return}}else delete A.linkRange;A.hide()}})}},{key:"show",value:function(){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),O}(y.BaseTooltip);F.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=R},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(29),o=he(i),s=a(36),c=a(38),u=a(64),d=a(65),p=he(d),y=a(66),f=he(y),_=a(67),S=he(_),w=a(37),x=a(26),v=a(39),g=a(40),E=a(56),b=he(E),M=a(68),N=he(M),R=a(27),F=he(R),j=a(69),O=he(j),C=a(70),A=he(C),k=a(71),T=he(k),V=a(72),G=he(V),$=a(73),te=he($),W=a(13),U=he(W),z=a(74),D=he(z),Y=a(75),Q=he(Y),J=a(57),Z=he(J),ae=a(41),se=he(ae),ce=a(28),de=he(ce),Oe=a(59),Le=he(Oe),ke=a(60),Se=he(ke),ye=a(61),Je=he(ye),we=a(108),me=he(we),Ee=a(62),Te=he(Ee);function he(Re){return Re&&Re.__esModule?Re:{default:Re}}o.default.register({"attributors/attribute/direction":c.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":w.BackgroundClass,"attributors/class/color":x.ColorClass,"attributors/class/direction":c.DirectionClass,"attributors/class/font":v.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":w.BackgroundStyle,"attributors/style/color":x.ColorStyle,"attributors/style/direction":c.DirectionStyle,"attributors/style/font":v.FontStyle,"attributors/style/size":g.SizeStyle},!0),o.default.register({"formats/align":s.AlignClass,"formats/direction":c.DirectionClass,"formats/indent":u.IndentClass,"formats/background":w.BackgroundStyle,"formats/color":x.ColorStyle,"formats/font":v.FontClass,"formats/size":g.SizeClass,"formats/blockquote":p.default,"formats/code-block":U.default,"formats/header":f.default,"formats/list":S.default,"formats/bold":b.default,"formats/code":W.Code,"formats/italic":N.default,"formats/link":F.default,"formats/script":O.default,"formats/strike":A.default,"formats/underline":T.default,"formats/image":G.default,"formats/video":te.default,"formats/list/item":_.ListItem,"modules/formula":D.default,"modules/syntax":Q.default,"modules/toolbar":Z.default,"themes/bubble":me.default,"themes/snow":Te.default,"ui/icons":se.default,"ui/picker":de.default,"ui/icon-picker":Se.default,"ui/color-picker":Le.default,"ui/tooltip":Je.default},!0),n.default=o.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var i=function(){function S(w,x){for(var v=0;v<x.length;v++){var g=x[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(w,g.key,g)}}return function(w,x,v){return x&&S(w.prototype,x),v&&S(w,v),w}}(),o=function S(w,x,v){w===null&&(w=Function.prototype);var g=Object.getOwnPropertyDescriptor(w,x);if(g===void 0){var E=Object.getPrototypeOf(w);return E===null?void 0:S(E,x,v)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(v)}},s=a(0),c=u(s);function u(S){return S&&S.__esModule?S:{default:S}}function d(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function p(S,w){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:S}function y(S,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);S.prototype=Object.create(w&&w.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(S,w):S.__proto__=w)}var f=function(S){y(w,S);function w(){return d(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return i(w,[{key:"add",value:function(v,g){if(g==="+1"||g==="-1"){var E=this.value(v)||0;g=g==="+1"?E+1:E-1}return g===0?(this.remove(v),!0):o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"add",this).call(this,v,g)}},{key:"canAdd",value:function(v,g){return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"canAdd",this).call(this,v,g)||o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"canAdd",this).call(this,v,parseInt(g))}},{key:"value",value:function(v){return parseInt(o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"value",this).call(this,v))||void 0}}]),w}(c.default.Attributor.Class),_=new f("indent","ql-indent",{scope:c.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(4),o=s(i);function s(y){return y&&y.__esModule?y:{default:y}}function c(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}function u(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:y}function d(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}var p=function(y){d(f,y);function f(){return c(this,f),u(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="blockquote",p.tagName="blockquote",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function f(_,S){for(var w=0;w<S.length;w++){var x=S[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,S,w){return S&&f(_.prototype,S),w&&f(_,w),_}}(),o=a(4),s=c(o);function c(f){return f&&f.__esModule?f:{default:f}}function u(f,_){if(!(f instanceof _))throw new TypeError("Cannot call a class as a function")}function d(f,_){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:f}function p(f,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);f.prototype=Object.create(_&&_.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(f,_):f.__proto__=_)}var y=function(f){p(_,f);function _(){return u(this,_),d(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return i(_,null,[{key:"formats",value:function(w){return this.tagName.indexOf(w.tagName)+1}}]),_}(s.default);y.blotName="header",y.tagName=["H1","H2","H3","H4","H5","H6"],n.default=y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var i=function(){function E(b,M){for(var N=0;N<M.length;N++){var R=M[N];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(b,R.key,R)}}return function(b,M,N){return M&&E(b.prototype,M),N&&E(b,N),b}}(),o=function E(b,M,N){b===null&&(b=Function.prototype);var R=Object.getOwnPropertyDescriptor(b,M);if(R===void 0){var F=Object.getPrototypeOf(b);return F===null?void 0:E(F,M,N)}else{if("value"in R)return R.value;var j=R.get;return j===void 0?void 0:j.call(N)}},s=a(0),c=f(s),u=a(4),d=f(u),p=a(25),y=f(p);function f(E){return E&&E.__esModule?E:{default:E}}function _(E,b,M){return b in E?Object.defineProperty(E,b,{value:M,enumerable:!0,configurable:!0,writable:!0}):E[b]=M,E}function S(E,b){if(!(E instanceof b))throw new TypeError("Cannot call a class as a function")}function w(E,b){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:E}function x(E,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);E.prototype=Object.create(b&&b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(E,b):E.__proto__=b)}var v=function(E){x(b,E);function b(){return S(this,b),w(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return i(b,[{key:"format",value:function(N,R){N===g.blotName&&!R?this.replaceWith(c.default.create(this.statics.scope)):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,N,R)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(N,R){return this.parent.isolate(this.offset(this.parent),this.length()),N===this.parent.statics.blotName?(this.parent.replaceWith(N,R),this):(this.parent.unwrap(),o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"replaceWith",this).call(this,N,R))}}],[{key:"formats",value:function(N){return N.tagName===this.tagName?void 0:o(b.__proto__||Object.getPrototypeOf(b),"formats",this).call(this,N)}}]),b}(d.default);v.blotName="list-item",v.tagName="LI";var g=function(E){x(b,E),i(b,null,[{key:"create",value:function(N){var R=N==="ordered"?"OL":"UL",F=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,R);return(N==="checked"||N==="unchecked")&&F.setAttribute("data-checked",N==="checked"),F}},{key:"formats",value:function(N){if(N.tagName==="OL")return"ordered";if(N.tagName==="UL")return N.hasAttribute("data-checked")?N.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function b(M){S(this,b);var N=w(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,M)),R=function(j){if(j.target.parentNode===M){var O=N.statics.formats(M),C=c.default.find(j.target);O==="checked"?C.format("list","unchecked"):O==="unchecked"&&C.format("list","checked")}};return M.addEventListener("touchstart",R),M.addEventListener("mousedown",R),N}return i(b,[{key:"format",value:function(N,R){this.children.length>0&&this.children.tail.format(N,R)}},{key:"formats",value:function(){return _({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(N,R){if(N instanceof v)o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"insertBefore",this).call(this,N,R);else{var F=R==null?this.length():R.offset(this),j=this.split(F);j.parent.insertBefore(N,j)}}},{key:"optimize",value:function(N){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,N);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&R.domNode.tagName===this.domNode.tagName&&R.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(R.moveChildren(this),R.remove())}},{key:"replace",value:function(N){if(N.statics.blotName!==this.statics.blotName){var R=c.default.create(this.statics.defaultChild);N.moveChildren(R),this.appendChild(R)}o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"replace",this).call(this,N)}}]),b}(y.default);g.blotName="list",g.scope=c.default.Scope.BLOCK_BLOT,g.tagName=["OL","UL"],g.defaultChild="list-item",g.allowedChildren=[v],n.ListItem=v,n.default=g},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(56),o=s(i);function s(y){return y&&y.__esModule?y:{default:y}}function c(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}function u(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:y}function d(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}var p=function(y){d(f,y);function f(){return c(this,f),u(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="italic",p.tagName=["EM","I"],n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(S,w){for(var x=0;x<w.length;x++){var v=w[x];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,w,x){return w&&_(S.prototype,w),x&&_(S,x),S}}(),o=function _(S,w,x){S===null&&(S=Function.prototype);var v=Object.getOwnPropertyDescriptor(S,w);if(v===void 0){var g=Object.getPrototypeOf(S);return g===null?void 0:_(g,w,x)}else{if("value"in v)return v.value;var E=v.get;return E===void 0?void 0:E.call(x)}},s=a(6),c=u(s);function u(_){return _&&_.__esModule?_:{default:_}}function d(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function p(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function y(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){y(S,_);function S(){return d(this,S),p(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,null,[{key:"create",value:function(x){return x==="super"?document.createElement("sup"):x==="sub"?document.createElement("sub"):o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,x)}},{key:"formats",value:function(x){if(x.tagName==="SUB")return"sub";if(x.tagName==="SUP")return"super"}}]),S}(c.default);f.blotName="script",f.tagName=["SUB","SUP"],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(6),o=s(i);function s(y){return y&&y.__esModule?y:{default:y}}function c(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}function u(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:y}function d(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}var p=function(y){d(f,y);function f(){return c(this,f),u(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="strike",p.tagName="S",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(6),o=s(i);function s(y){return y&&y.__esModule?y:{default:y}}function c(y,f){if(!(y instanceof f))throw new TypeError("Cannot call a class as a function")}function u(y,f){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:y}function d(y,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);y.prototype=Object.create(f&&f.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(y,f):y.__proto__=f)}var p=function(y){d(f,y);function f(){return c(this,f),u(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="underline",p.tagName="U",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(x,v){for(var g=0;g<v.length;g++){var E=v[g];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,v,g){return v&&w(x.prototype,v),g&&w(x,g),x}}(),o=function w(x,v,g){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,v);if(E===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,v,g)}else{if("value"in E)return E.value;var M=E.get;return M===void 0?void 0:M.call(g)}},s=a(0),c=d(s),u=a(27);function d(w){return w&&w.__esModule?w:{default:w}}function p(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function y(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function f(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var _=["alt","height","width"],S=function(w){f(x,w);function x(){return p(this,x),y(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"format",value:function(g,E){_.indexOf(g)>-1?E?this.domNode.setAttribute(g,E):this.domNode.removeAttribute(g):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,g,E)}}],[{key:"create",value:function(g){var E=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,g);return typeof g=="string"&&E.setAttribute("src",this.sanitize(g)),E}},{key:"formats",value:function(g){return _.reduce(function(E,b){return g.hasAttribute(b)&&(E[b]=g.getAttribute(b)),E},{})}},{key:"match",value:function(g){return/\.(jpe?g|gif|png)$/.test(g)||/^data:image\/.+;base64/.test(g)}},{key:"sanitize",value:function(g){return(0,u.sanitize)(g,["http","https","data"])?g:"//:0"}},{key:"value",value:function(g){return g.getAttribute("src")}}]),x}(c.default.Embed);S.blotName="image",S.tagName="IMG",n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(x,v){for(var g=0;g<v.length;g++){var E=v[g];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,v,g){return v&&w(x.prototype,v),g&&w(x,g),x}}(),o=function w(x,v,g){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,v);if(E===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,v,g)}else{if("value"in E)return E.value;var M=E.get;return M===void 0?void 0:M.call(g)}},s=a(4),c=a(27),u=d(c);function d(w){return w&&w.__esModule?w:{default:w}}function p(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function y(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function f(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var _=["height","width"],S=function(w){f(x,w);function x(){return p(this,x),y(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"format",value:function(g,E){_.indexOf(g)>-1?E?this.domNode.setAttribute(g,E):this.domNode.removeAttribute(g):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,g,E)}}],[{key:"create",value:function(g){var E=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,g);return E.setAttribute("frameborder","0"),E.setAttribute("allowfullscreen",!0),E.setAttribute("src",this.sanitize(g)),E}},{key:"formats",value:function(g){return _.reduce(function(E,b){return g.hasAttribute(b)&&(E[b]=g.getAttribute(b)),E},{})}},{key:"sanitize",value:function(g){return u.default.sanitize(g)}},{key:"value",value:function(g){return g.getAttribute("src")}}]),x}(s.BlockEmbed);S.blotName="video",S.className="ql-video",S.tagName="IFRAME",n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var i=function(){function g(E,b){for(var M=0;M<b.length;M++){var N=b[M];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(E,N.key,N)}}return function(E,b,M){return b&&g(E.prototype,b),M&&g(E,M),E}}(),o=function g(E,b,M){E===null&&(E=Function.prototype);var N=Object.getOwnPropertyDescriptor(E,b);if(N===void 0){var R=Object.getPrototypeOf(E);return R===null?void 0:g(R,b,M)}else{if("value"in N)return N.value;var F=N.get;return F===void 0?void 0:F.call(M)}},s=a(35),c=f(s),u=a(5),d=f(u),p=a(9),y=f(p);function f(g){return g&&g.__esModule?g:{default:g}}function _(g,E){if(!(g instanceof E))throw new TypeError("Cannot call a class as a function")}function S(g,E){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:g}function w(g,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);g.prototype=Object.create(E&&E.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(g,E):g.__proto__=E)}var x=function(g){w(E,g);function E(){return _(this,E),S(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return i(E,null,[{key:"create",value:function(M){var N=o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,M);return typeof M=="string"&&(window.katex.render(M,N,{throwOnError:!1,errorColor:"#f00"}),N.setAttribute("data-value",M)),N}},{key:"value",value:function(M){return M.getAttribute("data-value")}}]),E}(c.default);x.blotName="formula",x.className="ql-formula",x.tagName="SPAN";var v=function(g){w(E,g),i(E,null,[{key:"register",value:function(){d.default.register(x,!0)}}]);function E(){_(this,E);var b=S(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return b}return E}(y.default);n.FormulaBlot=x,n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var i=function(){function M(N,R){for(var F=0;F<R.length;F++){var j=R[F];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(N,j.key,j)}}return function(N,R,F){return R&&M(N.prototype,R),F&&M(N,F),N}}(),o=function M(N,R,F){N===null&&(N=Function.prototype);var j=Object.getOwnPropertyDescriptor(N,R);if(j===void 0){var O=Object.getPrototypeOf(N);return O===null?void 0:M(O,R,F)}else{if("value"in j)return j.value;var C=j.get;return C===void 0?void 0:C.call(F)}},s=a(0),c=S(s),u=a(5),d=S(u),p=a(9),y=S(p),f=a(13),_=S(f);function S(M){return M&&M.__esModule?M:{default:M}}function w(M,N){if(!(M instanceof N))throw new TypeError("Cannot call a class as a function")}function x(M,N){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:M}function v(M,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);M.prototype=Object.create(N&&N.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(M,N):M.__proto__=N)}var g=function(M){v(N,M);function N(){return w(this,N),x(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return i(N,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var j=this.domNode.textContent;this.cachedText!==j&&((j.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(j),this.domNode.normalize(),this.attach()),this.cachedText=j)}}]),N}(_.default);g.className="ql-syntax";var E=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),b=function(M){v(N,M),i(N,null,[{key:"register",value:function(){d.default.register(E,!0),d.default.register(g,!0)}}]);function N(R,F){w(this,N);var j=x(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,R,F));if(typeof j.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var O=null;return j.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(O),O=setTimeout(function(){j.highlight(),O=null},j.options.interval)}),j.highlight(),j}return i(N,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(d.default.sources.USER);var j=this.quill.getSelection();this.quill.scroll.descendants(g).forEach(function(O){O.highlight(F.options.highlight)}),this.quill.update(d.default.sources.SILENT),j!=null&&this.quill.setSelection(j,d.default.sources.SILENT)}}}]),N}(y.default);b.DEFAULTS={highlight:function(){return window.hljs==null?null:function(M){var N=window.hljs.highlightAuto(M);return N.value}}(),interval:1e3},n.CodeBlock=g,n.CodeToken=E,n.default=b},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(t,n){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(t,n){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(t,n){t.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(t,n){t.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(t,n){t.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var i=function N(R,F,j){R===null&&(R=Function.prototype);var O=Object.getOwnPropertyDescriptor(R,F);if(O===void 0){var C=Object.getPrototypeOf(R);return C===null?void 0:N(C,F,j)}else{if("value"in O)return O.value;var A=O.get;return A===void 0?void 0:A.call(j)}},o=function(){function N(R,F){for(var j=0;j<F.length;j++){var O=F[j];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(R,O.key,O)}}return function(R,F,j){return F&&N(R.prototype,F),j&&N(R,j),R}}(),s=a(3),c=w(s),u=a(8),d=w(u),p=a(43),y=w(p),f=a(15),_=a(41),S=w(_);function w(N){return N&&N.__esModule?N:{default:N}}function x(N,R){if(!(N instanceof R))throw new TypeError("Cannot call a class as a function")}function v(N,R){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:N}function g(N,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);N.prototype=Object.create(R&&R.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(N,R):N.__proto__=R)}var E=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],b=function(N){g(R,N);function R(F,j){x(this,R),j.modules.toolbar!=null&&j.modules.toolbar.container==null&&(j.modules.toolbar.container=E);var O=v(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,F,j));return O.quill.container.classList.add("ql-bubble"),O}return o(R,[{key:"extendToolbar",value:function(j){this.tooltip=new M(this.quill,this.options.bounds),this.tooltip.root.appendChild(j.container),this.buildButtons([].slice.call(j.container.querySelectorAll("button")),S.default),this.buildPickers([].slice.call(j.container.querySelectorAll("select")),S.default)}}]),R}(y.default);b.DEFAULTS=(0,c.default)(!0,{},y.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){R?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var M=function(N){g(R,N);function R(F,j){x(this,R);var O=v(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,F,j));return O.quill.on(d.default.events.EDITOR_CHANGE,function(C,A,k,T){if(C===d.default.events.SELECTION_CHANGE)if(A!=null&&A.length>0&&T===d.default.sources.USER){O.show(),O.root.style.left="0px",O.root.style.width="",O.root.style.width=O.root.offsetWidth+"px";var V=O.quill.getLines(A.index,A.length);if(V.length===1)O.position(O.quill.getBounds(A));else{var G=V[V.length-1],$=O.quill.getIndex(G),te=Math.min(G.length()-1,A.index+A.length-$),W=O.quill.getBounds(new f.Range($,te));O.position(W)}}else document.activeElement!==O.textbox&&O.quill.hasFocus()&&O.hide()}),O}return o(R,[{key:"listen",value:function(){var j=this;i(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){j.root.classList.remove("ql-editing")}),this.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!j.root.classList.contains("ql-hidden")){var O=j.quill.getSelection();O!=null&&j.position(j.quill.getBounds(O))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(j){var O=i(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"position",this).call(this,j),C=this.root.querySelector(".ql-tooltip-arrow");if(C.style.marginLeft="",O===0)return O;C.style.marginLeft=-1*O-C.offsetWidth/2+"px"}}]),R}(p.BaseTooltip);M.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=M,n.default=b},function(t,n,a){t.exports=a(63)}]).default})}(y1)),y1.exports}var ic={},b1={exports:{}},wf={},ip={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var DA=ip.exports,zb;function BA(){return zb||(zb=1,function(e,r){(function(t){var n=r&&!r.nodeType&&r,a=e&&!e.nodeType&&e,i=typeof bh=="object"&&bh;(i.global===i||i.window===i||i.self===i)&&(t=i);var o,s=2147483647,c=36,u=1,d=26,p=38,y=700,f=72,_=128,S="-",w=/^xn--/,x=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=c-u,b=Math.floor,M=String.fromCharCode,N;function R(W){throw new RangeError(g[W])}function F(W,U){for(var z=W.length,D=[];z--;)D[z]=U(W[z]);return D}function j(W,U){var z=W.split("@"),D="";z.length>1&&(D=z[0]+"@",W=z[1]),W=W.replace(v,".");var Y=W.split("."),Q=F(Y,U).join(".");return D+Q}function O(W){for(var U=[],z=0,D=W.length,Y,Q;z<D;)Y=W.charCodeAt(z++),Y>=55296&&Y<=56319&&z<D?(Q=W.charCodeAt(z++),(Q&64512)==56320?U.push(((Y&1023)<<10)+(Q&1023)+65536):(U.push(Y),z--)):U.push(Y);return U}function C(W){return F(W,function(U){var z="";return U>65535&&(U-=65536,z+=M(U>>>10&1023|55296),U=56320|U&1023),z+=M(U),z}).join("")}function A(W){return W-48<10?W-22:W-65<26?W-65:W-97<26?W-97:c}function k(W,U){return W+22+75*(W<26)-((U!=0)<<5)}function T(W,U,z){var D=0;for(W=z?b(W/y):W>>1,W+=b(W/U);W>E*d>>1;D+=c)W=b(W/E);return b(D+(E+1)*W/(W+p))}function V(W){var U=[],z=W.length,D,Y=0,Q=_,J=f,Z,ae,se,ce,de,Oe,Le,ke,Se;for(Z=W.lastIndexOf(S),Z<0&&(Z=0),ae=0;ae<Z;++ae)W.charCodeAt(ae)>=128&&R("not-basic"),U.push(W.charCodeAt(ae));for(se=Z>0?Z+1:0;se<z;){for(ce=Y,de=1,Oe=c;se>=z&&R("invalid-input"),Le=A(W.charCodeAt(se++)),(Le>=c||Le>b((s-Y)/de))&&R("overflow"),Y+=Le*de,ke=Oe<=J?u:Oe>=J+d?d:Oe-J,!(Le<ke);Oe+=c)Se=c-ke,de>b(s/Se)&&R("overflow"),de*=Se;D=U.length+1,J=T(Y-ce,D,ce==0),b(Y/D)>s-Q&&R("overflow"),Q+=b(Y/D),Y%=D,U.splice(Y++,0,Q)}return C(U)}function G(W){var U,z,D,Y,Q,J,Z,ae,se,ce,de,Oe=[],Le,ke,Se,ye;for(W=O(W),Le=W.length,U=_,z=0,Q=f,J=0;J<Le;++J)de=W[J],de<128&&Oe.push(M(de));for(D=Y=Oe.length,Y&&Oe.push(S);D<Le;){for(Z=s,J=0;J<Le;++J)de=W[J],de>=U&&de<Z&&(Z=de);for(ke=D+1,Z-U>b((s-z)/ke)&&R("overflow"),z+=(Z-U)*ke,U=Z,J=0;J<Le;++J)if(de=W[J],de<U&&++z>s&&R("overflow"),de==U){for(ae=z,se=c;ce=se<=Q?u:se>=Q+d?d:se-Q,!(ae<ce);se+=c)ye=ae-ce,Se=c-ce,Oe.push(M(k(ce+ye%Se,0))),ae=b(ye/Se);Oe.push(M(k(ae,0))),Q=T(z,ke,D==Y),z=0,++D}++z,++U}return Oe.join("")}function $(W){return j(W,function(U){return w.test(U)?V(U.slice(4).toLowerCase()):U})}function te(W){return j(W,function(U){return x.test(U)?"xn--"+G(U):U})}if(o={version:"1.4.1",ucs2:{decode:O,encode:C},decode:V,encode:G,toASCII:te,toUnicode:$},n&&a)if(e.exports==n)a.exports=o;else for(N in o)o.hasOwnProperty(N)&&(n[N]=o[N]);else t.punycode=o})(DA)}(ip,ip.exports)),ip.exports}var Eg,Ub;function Fh(){return Ub||(Ub=1,Eg=TypeError),Eg}const qA={},zA=Object.freeze(Object.defineProperty({__proto__:null,default:qA},Symbol.toStringTag,{value:"Module"})),UA=Zc(zA);var Pg,Hb;function o0(){if(Hb)return Pg;Hb=1;var e=typeof Map=="function"&&Map.prototype,r=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=e&&r&&typeof r.get=="function"?r.get:null,n=e&&Map.prototype.forEach,a=typeof Set=="function"&&Set.prototype,i=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=a&&i&&typeof i.get=="function"?i.get:null,s=a&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,u=c?WeakMap.prototype.has:null,d=typeof WeakSet=="function"&&WeakSet.prototype,p=d?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,f=y?WeakRef.prototype.deref:null,_=Boolean.prototype.valueOf,S=Object.prototype.toString,w=Function.prototype.toString,x=String.prototype.match,v=String.prototype.slice,g=String.prototype.replace,E=String.prototype.toUpperCase,b=String.prototype.toLowerCase,M=RegExp.prototype.test,N=Array.prototype.concat,R=Array.prototype.join,F=Array.prototype.slice,j=Math.floor,O=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,k=typeof Symbol=="function"&&typeof Symbol.iterator=="object",T=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===k||!0)?Symbol.toStringTag:null,V=Object.prototype.propertyIsEnumerable,G=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Be){return Be.__proto__}:null);function $(Be,Ce){if(Be===1/0||Be===-1/0||Be!==Be||Be&&Be>-1e3&&Be<1e3||M.call(/e/,Ce))return Ce;var ft=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Be=="number"){var Ct=Be<0?-j(-Be):j(Be);if(Ct!==Be){var Ot=String(Ct),Nt=v.call(Ce,Ot.length+1);return g.call(Ot,ft,"$&_")+"."+g.call(g.call(Nt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(Ce,ft,"$&_")}var te=UA,W=te.custom,U=ke(W)?W:null,z={__proto__:null,double:'"',single:"'"},D={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Pg=function Be(Ce,ft,Ct,Ot){var Nt=ft||{};if(Je(Nt,"quoteStyle")&&!Je(z,Nt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Je(Nt,"maxStringLength")&&(typeof Nt.maxStringLength=="number"?Nt.maxStringLength<0&&Nt.maxStringLength!==1/0:Nt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Jt=Je(Nt,"customInspect")?Nt.customInspect:!0;if(typeof Jt!="boolean"&&Jt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Je(Nt,"indent")&&Nt.indent!==null&&Nt.indent!==" "&&!(parseInt(Nt.indent,10)===Nt.indent&&Nt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Je(Nt,"numericSeparator")&&typeof Nt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Xt=Nt.numericSeparator;if(typeof Ce>"u")return"undefined";if(Ce===null)return"null";if(typeof Ce=="boolean")return Ce?"true":"false";if(typeof Ce=="string")return vt(Ce,Nt);if(typeof Ce=="number"){if(Ce===0)return 1/0/Ce>0?"0":"-0";var kt=String(Ce);return Xt?$(Ce,kt):kt}if(typeof Ce=="bigint"){var nt=String(Ce)+"n";return Xt?$(Ce,nt):nt}var We=typeof Nt.depth>"u"?5:Nt.depth;if(typeof Ct>"u"&&(Ct=0),Ct>=We&&We>0&&typeof Ce=="object")return Z(Ce)?"[Array]":"[Object]";var it=Pt(Nt,Ct);if(typeof Ot>"u")Ot=[];else if(Ee(Ot,Ce)>=0)return"[Circular]";function He(_i,ao,_s){if(ao&&(Ot=F.call(Ot),Ot.push(ao)),_s){var Go={depth:Nt.depth};return Je(Nt,"quoteStyle")&&(Go.quoteStyle=Nt.quoteStyle),Be(_i,Go,Ct+1,Ot)}return Be(_i,Nt,Ct+1,Ot)}if(typeof Ce=="function"&&!se(Ce)){var wt=me(Ce),ze=Gt(Ce,He);return"[Function"+(wt?": "+wt:" (anonymous)")+"]"+(ze.length>0?" { "+R.call(ze,", ")+" }":"")}if(ke(Ce)){var _t=k?g.call(String(Ce),/^(Symbol\(.*\))_[^)]*$/,"$1"):A.call(Ce);return typeof Ce=="object"&&!k?yt(_t):_t}if(rt(Ce)){for(var Ht="<"+b.call(String(Ce.nodeName)),Dt=Ce.attributes||[],Vt=0;Vt<Dt.length;Vt++)Ht+=" "+Dt[Vt].name+"="+Y(Q(Dt[Vt].value),"double",Nt);return Ht+=">",Ce.childNodes&&Ce.childNodes.length&&(Ht+="..."),Ht+="</"+b.call(String(Ce.nodeName))+">",Ht}if(Z(Ce)){if(Ce.length===0)return"[]";var er=Gt(Ce,He);return it&&!Bt(er)?"["+Yt(er,it)+"]":"[ "+R.call(er,", ")+" ]"}if(ce(Ce)){var _r=Gt(Ce,He);return!("cause"in Error.prototype)&&"cause"in Ce&&!V.call(Ce,"cause")?"{ ["+String(Ce)+"] "+R.call(N.call("[cause]: "+He(Ce.cause),_r),", ")+" }":_r.length===0?"["+String(Ce)+"]":"{ ["+String(Ce)+"] "+R.call(_r,", ")+" }"}if(typeof Ce=="object"&&Jt){if(U&&typeof Ce[U]=="function"&&te)return te(Ce,{depth:We-Ct});if(Jt!=="symbol"&&typeof Ce.inspect=="function")return Ce.inspect()}if(Te(Ce)){var kr=[];return n&&n.call(Ce,function(_i,ao){kr.push(He(ao,Ce,!0)+" => "+He(_i,Ce))}),ct("Map",t.call(Ce),kr,it)}if(Ie(Ce)){var Ur=[];return s&&s.call(Ce,function(_i){Ur.push(He(_i,Ce))}),ct("Set",o.call(Ce),Ur,it)}if(he(Ce))return mt("WeakMap");if(Xe(Ce))return mt("WeakSet");if(Re(Ce))return mt("WeakRef");if(Oe(Ce))return yt(He(Number(Ce)));if(Se(Ce))return yt(He(O.call(Ce)));if(Le(Ce))return yt(_.call(Ce));if(de(Ce))return yt(He(String(Ce)));if(typeof window<"u"&&Ce===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Ce===globalThis||typeof bh<"u"&&Ce===bh)return"{ [object globalThis] }";if(!ae(Ce)&&!se(Ce)){var on=Gt(Ce,He),Wn=G?G(Ce)===Object.prototype:Ce instanceof Object||Ce.constructor===Object,sn=Ce instanceof Object?"":"null prototype",Li=!Wn&&T&&Object(Ce)===Ce&&T in Ce?v.call(we(Ce),8,-1):sn?"Object":"",wi=Wn||typeof Ce.constructor!="function"?"":Ce.constructor.name?Ce.constructor.name+" ":"",Ni=wi+(Li||sn?"["+R.call(N.call([],Li||[],sn||[]),": ")+"] ":"");return on.length===0?Ni+"{}":it?Ni+"{"+Yt(on,it)+"}":Ni+"{ "+R.call(on,", ")+" }"}return String(Ce)};function Y(Be,Ce,ft){var Ct=ft.quoteStyle||Ce,Ot=z[Ct];return Ot+Be+Ot}function Q(Be){return g.call(String(Be),/"/g,""")}function J(Be){return!T||!(typeof Be=="object"&&(T in Be||typeof Be[T]<"u"))}function Z(Be){return we(Be)==="[object Array]"&&J(Be)}function ae(Be){return we(Be)==="[object Date]"&&J(Be)}function se(Be){return we(Be)==="[object RegExp]"&&J(Be)}function ce(Be){return we(Be)==="[object Error]"&&J(Be)}function de(Be){return we(Be)==="[object String]"&&J(Be)}function Oe(Be){return we(Be)==="[object Number]"&&J(Be)}function Le(Be){return we(Be)==="[object Boolean]"&&J(Be)}function ke(Be){if(k)return Be&&typeof Be=="object"&&Be instanceof Symbol;if(typeof Be=="symbol")return!0;if(!Be||typeof Be!="object"||!A)return!1;try{return A.call(Be),!0}catch{}return!1}function Se(Be){if(!Be||typeof Be!="object"||!O)return!1;try{return O.call(Be),!0}catch{}return!1}var ye=Object.prototype.hasOwnProperty||function(Be){return Be in this};function Je(Be,Ce){return ye.call(Be,Ce)}function we(Be){return S.call(Be)}function me(Be){if(Be.name)return Be.name;var Ce=x.call(w.call(Be),/^function\s*([\w$]+)/);return Ce?Ce[1]:null}function Ee(Be,Ce){if(Be.indexOf)return Be.indexOf(Ce);for(var ft=0,Ct=Be.length;ft<Ct;ft++)if(Be[ft]===Ce)return ft;return-1}function Te(Be){if(!t||!Be||typeof Be!="object")return!1;try{t.call(Be);try{o.call(Be)}catch{return!0}return Be instanceof Map}catch{}return!1}function he(Be){if(!u||!Be||typeof Be!="object")return!1;try{u.call(Be,u);try{p.call(Be,p)}catch{return!0}return Be instanceof WeakMap}catch{}return!1}function Re(Be){if(!f||!Be||typeof Be!="object")return!1;try{return f.call(Be),!0}catch{}return!1}function Ie(Be){if(!o||!Be||typeof Be!="object")return!1;try{o.call(Be);try{t.call(Be)}catch{return!0}return Be instanceof Set}catch{}return!1}function Xe(Be){if(!p||!Be||typeof Be!="object")return!1;try{p.call(Be,p);try{u.call(Be,u)}catch{return!0}return Be instanceof WeakSet}catch{}return!1}function rt(Be){return!Be||typeof Be!="object"?!1:typeof HTMLElement<"u"&&Be instanceof HTMLElement?!0:typeof Be.nodeName=="string"&&typeof Be.getAttribute=="function"}function vt(Be,Ce){if(Be.length>Ce.maxStringLength){var ft=Be.length-Ce.maxStringLength,Ct="... "+ft+" more character"+(ft>1?"s":"");return vt(v.call(Be,0,Ce.maxStringLength),Ce)+Ct}var Ot=D[Ce.quoteStyle||"single"];Ot.lastIndex=0;var Nt=g.call(g.call(Be,Ot,"\\$1"),/[\x00-\x1f]/g,et);return Y(Nt,"single",Ce)}function et(Be){var Ce=Be.charCodeAt(0),ft={8:"b",9:"t",10:"n",12:"f",13:"r"}[Ce];return ft?"\\"+ft:"\\x"+(Ce<16?"0":"")+E.call(Ce.toString(16))}function yt(Be){return"Object("+Be+")"}function mt(Be){return Be+" { ? }"}function ct(Be,Ce,ft,Ct){var Ot=Ct?Yt(ft,Ct):R.call(ft,", ");return Be+" ("+Ce+") {"+Ot+"}"}function Bt(Be){for(var Ce=0;Ce<Be.length;Ce++)if(Ee(Be[Ce],`
|
|
149
|
+
`)>=0)return!1;return!0}function Pt(Be,Ce){var ft;if(Be.indent===" ")ft=" ";else if(typeof Be.indent=="number"&&Be.indent>0)ft=R.call(Array(Be.indent+1)," ");else return null;return{base:ft,prev:R.call(Array(Ce+1),ft)}}function Yt(Be,Ce){if(Be.length===0)return"";var ft=`
|
|
150
|
+
`+Ce.prev+Ce.base;return ft+R.call(Be,","+ft)+`
|
|
151
|
+
`+Ce.prev}function Gt(Be,Ce){var ft=Z(Be),Ct=[];if(ft){Ct.length=Be.length;for(var Ot=0;Ot<Be.length;Ot++)Ct[Ot]=Je(Be,Ot)?Ce(Be[Ot],Be):""}var Nt=typeof C=="function"?C(Be):[],Jt;if(k){Jt={};for(var Xt=0;Xt<Nt.length;Xt++)Jt["$"+Nt[Xt]]=Nt[Xt]}for(var kt in Be)Je(Be,kt)&&(ft&&String(Number(kt))===kt&&kt<Be.length||k&&Jt["$"+kt]instanceof Symbol||(M.call(/[^\w$]/,kt)?Ct.push(Ce(kt,Be)+": "+Ce(Be[kt],Be)):Ct.push(kt+": "+Ce(Be[kt],Be))));if(typeof C=="function")for(var nt=0;nt<Nt.length;nt++)V.call(Be,Nt[nt])&&Ct.push("["+Ce(Nt[nt])+"]: "+Ce(Be[Nt[nt]],Be));return Ct}return Pg}var Og,Vb;function HA(){if(Vb)return Og;Vb=1;var e=o0(),r=Fh(),t=function(s,c,u){for(var d=s,p;(p=d.next)!=null;d=p)if(p.key===c)return d.next=p.next,u||(p.next=s.next,s.next=p),p},n=function(s,c){if(s){var u=t(s,c);return u&&u.value}},a=function(s,c,u){var d=t(s,c);d?d.value=u:s.next={key:c,next:s.next,value:u}},i=function(s,c){return s?!!t(s,c):!1},o=function(s,c){if(s)return t(s,c,!0)};return Og=function(){var c,u={assert:function(d){if(!u.has(d))throw new r("Side channel does not contain "+e(d))},delete:function(d){var p=c&&c.next,y=o(c,d);return y&&p&&p===y&&(c=void 0),!!y},get:function(d){return n(c,d)},has:function(d){return i(c,d)},set:function(d,p){c||(c={next:void 0}),a(c,d,p)}};return u},Og}var Ag,Gb;function G8(){return Gb||(Gb=1,Ag=Object),Ag}var Cg,Wb;function VA(){return Wb||(Wb=1,Cg=Error),Cg}var kg,$b;function GA(){return $b||($b=1,kg=EvalError),kg}var Lg,Yb;function WA(){return Yb||(Yb=1,Lg=RangeError),Lg}var Ng,Xb;function $A(){return Xb||(Xb=1,Ng=ReferenceError),Ng}var Tg,Kb;function YA(){return Kb||(Kb=1,Tg=SyntaxError),Tg}var Rg,Zb;function XA(){return Zb||(Zb=1,Rg=URIError),Rg}var Mg,Qb;function KA(){return Qb||(Qb=1,Mg=Math.abs),Mg}var Ig,Jb;function ZA(){return Jb||(Jb=1,Ig=Math.floor),Ig}var jg,e3;function QA(){return e3||(e3=1,jg=Math.max),jg}var Fg,t3;function JA(){return t3||(t3=1,Fg=Math.min),Fg}var Dg,r3;function eC(){return r3||(r3=1,Dg=Math.pow),Dg}var Bg,n3;function tC(){return n3||(n3=1,Bg=Math.round),Bg}var qg,i3;function rC(){return i3||(i3=1,qg=Number.isNaN||function(r){return r!==r}),qg}var zg,a3;function nC(){if(a3)return zg;a3=1;var e=rC();return zg=function(t){return e(t)||t===0?t:t<0?-1:1},zg}var Ug,o3;function iC(){return o3||(o3=1,Ug=Object.getOwnPropertyDescriptor),Ug}var Hg,s3;function W8(){if(s3)return Hg;s3=1;var e=iC();if(e)try{e([],"length")}catch{e=null}return Hg=e,Hg}var Vg,l3;function aC(){if(l3)return Vg;l3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Vg=e,Vg}var Gg,u3;function oC(){return u3||(u3=1,Gg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(var i in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var o=Object.getOwnPropertySymbols(r);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(r,t);if(s.value!==a||s.enumerable!==!0)return!1}return!0}),Gg}var Wg,c3;function sC(){if(c3)return Wg;c3=1;var e=typeof Symbol<"u"&&Symbol,r=oC();return Wg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()},Wg}var $g,f3;function $8(){return f3||(f3=1,$g=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),$g}var Yg,h3;function Y8(){if(h3)return Yg;h3=1;var e=G8();return Yg=e.getPrototypeOf||null,Yg}var Xg,d3;function lC(){if(d3)return Xg;d3=1;var e="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,t=Math.max,n="[object Function]",a=function(c,u){for(var d=[],p=0;p<c.length;p+=1)d[p]=c[p];for(var y=0;y<u.length;y+=1)d[y+c.length]=u[y];return d},i=function(c,u){for(var d=[],p=u,y=0;p<c.length;p+=1,y+=1)d[y]=c[p];return d},o=function(s,c){for(var u="",d=0;d<s.length;d+=1)u+=s[d],d+1<s.length&&(u+=c);return u};return Xg=function(c){var u=this;if(typeof u!="function"||r.apply(u)!==n)throw new TypeError(e+u);for(var d=i(arguments,1),p,y=function(){if(this instanceof p){var x=u.apply(this,a(d,arguments));return Object(x)===x?x:this}return u.apply(c,a(d,arguments))},f=t(0,u.length-d.length),_=[],S=0;S<f;S++)_[S]="$"+S;if(p=Function("binder","return function ("+o(_,",")+"){ return binder.apply(this,arguments); }")(y),u.prototype){var w=function(){};w.prototype=u.prototype,p.prototype=new w,w.prototype=null}return p},Xg}var Kg,p3;function s0(){if(p3)return Kg;p3=1;var e=lC();return Kg=Function.prototype.bind||e,Kg}var Zg,g3;function Am(){return g3||(g3=1,Zg=Function.prototype.call),Zg}var Qg,v3;function X8(){return v3||(v3=1,Qg=Function.prototype.apply),Qg}var Jg,m3;function uC(){return m3||(m3=1,Jg=typeof Reflect<"u"&&Reflect&&Reflect.apply),Jg}var ev,y3;function cC(){if(y3)return ev;y3=1;var e=s0(),r=X8(),t=Am(),n=uC();return ev=n||e.call(t,r),ev}var tv,b3;function K8(){if(b3)return tv;b3=1;var e=s0(),r=Fh(),t=Am(),n=cC();return tv=function(i){if(i.length<1||typeof i[0]!="function")throw new r("a function is required");return n(e,t,i)},tv}var rv,w3;function fC(){if(w3)return rv;w3=1;var e=K8(),r=W8(),t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&r&&r(Object.prototype,"__proto__"),a=Object,i=a.getPrototypeOf;return rv=n&&typeof n.get=="function"?e([n.get]):typeof i=="function"?function(s){return i(s==null?s:a(s))}:!1,rv}var nv,_3;function hC(){if(_3)return nv;_3=1;var e=$8(),r=Y8(),t=fC();return nv=e?function(a){return e(a)}:r?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return r(a)}:t?function(a){return t(a)}:null,nv}var iv,S3;function dC(){if(S3)return iv;S3=1;var e=Function.prototype.call,r=Object.prototype.hasOwnProperty,t=s0();return iv=t.call(e,r),iv}var av,x3;function Cm(){if(x3)return av;x3=1;var e,r=G8(),t=VA(),n=GA(),a=WA(),i=$A(),o=YA(),s=Fh(),c=XA(),u=KA(),d=ZA(),p=QA(),y=JA(),f=eC(),_=tC(),S=nC(),w=Function,x=function(se){try{return w('"use strict"; return ('+se+").constructor;")()}catch{}},v=W8(),g=aC(),E=function(){throw new s},b=v?function(){try{return arguments.callee,E}catch{try{return v(arguments,"callee").get}catch{return E}}}():E,M=sC()(),N=hC(),R=Y8(),F=$8(),j=X8(),O=Am(),C={},A=typeof Uint8Array>"u"||!N?e:N(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&N?N([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&N?N(N([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!N?e:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!N?e:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&N?N(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":b,"%TypedArray%":A,"%TypeError%":s,"%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%":c,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":j,"%Object.defineProperty%":g,"%Object.getPrototypeOf%":R,"%Math.abs%":u,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":f,"%Math.round%":_,"%Math.sign%":S,"%Reflect.getPrototypeOf%":F};if(N)try{null.error}catch(se){var T=N(N(se));k["%Error.prototype%"]=T}var V=function se(ce){var de;if(ce==="%AsyncFunction%")de=x("async function () {}");else if(ce==="%GeneratorFunction%")de=x("function* () {}");else if(ce==="%AsyncGeneratorFunction%")de=x("async function* () {}");else if(ce==="%AsyncGenerator%"){var Oe=se("%AsyncGeneratorFunction%");Oe&&(de=Oe.prototype)}else if(ce==="%AsyncIteratorPrototype%"){var Le=se("%AsyncGenerator%");Le&&N&&(de=N(Le.prototype))}return k[ce]=de,de},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$=s0(),te=dC(),W=$.call(O,Array.prototype.concat),U=$.call(j,Array.prototype.splice),z=$.call(O,String.prototype.replace),D=$.call(O,String.prototype.slice),Y=$.call(O,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,J=/\\(\\)?/g,Z=function(ce){var de=D(ce,0,1),Oe=D(ce,-1);if(de==="%"&&Oe!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Oe==="%"&&de!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Le=[];return z(ce,Q,function(ke,Se,ye,Je){Le[Le.length]=ye?z(Je,J,"$1"):Se||ke}),Le},ae=function(ce,de){var Oe=ce,Le;if(te(G,Oe)&&(Le=G[Oe],Oe="%"+Le[0]+"%"),te(k,Oe)){var ke=k[Oe];if(ke===C&&(ke=V(Oe)),typeof ke>"u"&&!de)throw new s("intrinsic "+ce+" exists, but is not available. Please file an issue!");return{alias:Le,name:Oe,value:ke}}throw new o("intrinsic "+ce+" does not exist!")};return av=function(ce,de){if(typeof ce!="string"||ce.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof de!="boolean")throw new s('"allowMissing" argument must be a boolean');if(Y(/^%?[^%]*%?$/,ce)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Oe=Z(ce),Le=Oe.length>0?Oe[0]:"",ke=ae("%"+Le+"%",de),Se=ke.name,ye=ke.value,Je=!1,we=ke.alias;we&&(Le=we[0],U(Oe,W([0,1],we)));for(var me=1,Ee=!0;me<Oe.length;me+=1){var Te=Oe[me],he=D(Te,0,1),Re=D(Te,-1);if((he==='"'||he==="'"||he==="`"||Re==='"'||Re==="'"||Re==="`")&&he!==Re)throw new o("property names with quotes must have matching quotes");if((Te==="constructor"||!Ee)&&(Je=!0),Le+="."+Te,Se="%"+Le+"%",te(k,Se))ye=k[Se];else if(ye!=null){if(!(Te in ye)){if(!de)throw new s("base intrinsic for "+ce+" exists, but the property is not available.");return}if(v&&me+1>=Oe.length){var Ie=v(ye,Te);Ee=!!Ie,Ee&&"get"in Ie&&!("originalValue"in Ie.get)?ye=Ie.get:ye=ye[Te]}else Ee=te(ye,Te),ye=ye[Te];Ee&&!Je&&(k[Se]=ye)}}return ye},av}var ov,E3;function Z8(){if(E3)return ov;E3=1;var e=Cm(),r=K8(),t=r([e("%String.prototype.indexOf%")]);return ov=function(a,i){var o=e(a,!!i);return typeof o=="function"&&t(a,".prototype.")>-1?r([o]):o},ov}var sv,P3;function Q8(){if(P3)return sv;P3=1;var e=Cm(),r=Z8(),t=o0(),n=Fh(),a=e("%Map%",!0),i=r("Map.prototype.get",!0),o=r("Map.prototype.set",!0),s=r("Map.prototype.has",!0),c=r("Map.prototype.delete",!0),u=r("Map.prototype.size",!0);return sv=!!a&&function(){var p,y={assert:function(f){if(!y.has(f))throw new n("Side channel does not contain "+t(f))},delete:function(f){if(p){var _=c(p,f);return u(p)===0&&(p=void 0),_}return!1},get:function(f){if(p)return i(p,f)},has:function(f){return p?s(p,f):!1},set:function(f,_){p||(p=new a),o(p,f,_)}};return y},sv}var lv,O3;function pC(){if(O3)return lv;O3=1;var e=Cm(),r=Z8(),t=o0(),n=Q8(),a=Fh(),i=e("%WeakMap%",!0),o=r("WeakMap.prototype.get",!0),s=r("WeakMap.prototype.set",!0),c=r("WeakMap.prototype.has",!0),u=r("WeakMap.prototype.delete",!0);return lv=i?function(){var p,y,f={assert:function(_){if(!f.has(_))throw new a("Side channel does not contain "+t(_))},delete:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return u(p,_)}else if(n&&y)return y.delete(_);return!1},get:function(_){return i&&_&&(typeof _=="object"||typeof _=="function")&&p?o(p,_):y&&y.get(_)},has:function(_){return i&&_&&(typeof _=="object"||typeof _=="function")&&p?c(p,_):!!y&&y.has(_)},set:function(_,S){i&&_&&(typeof _=="object"||typeof _=="function")?(p||(p=new i),s(p,_,S)):n&&(y||(y=n()),y.set(_,S))}};return f}:n,lv}var uv,A3;function gC(){if(A3)return uv;A3=1;var e=Fh(),r=o0(),t=HA(),n=Q8(),a=pC(),i=a||n||t;return uv=function(){var s,c={assert:function(u){if(!c.has(u))throw new e("Side channel does not contain "+r(u))},delete:function(u){return!!s&&s.delete(u)},get:function(u){return s&&s.get(u)},has:function(u){return!!s&&s.has(u)},set:function(u,d){s||(s=i()),s.set(u,d)}};return c},uv}var cv,C3;function km(){if(C3)return cv;C3=1;var e=String.prototype.replace,r=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return cv={default:t.RFC3986,formatters:{RFC1738:function(n){return e.call(n,r,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},cv}var fv,k3;function J8(){if(k3)return fv;k3=1;var e=km(),r=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var w=[],x=0;x<256;++x)w.push("%"+((x<16?"0":"")+x.toString(16)).toUpperCase());return w}(),a=function(x){for(;x.length>1;){var v=x.pop(),g=v.obj[v.prop];if(t(g)){for(var E=[],b=0;b<g.length;++b)typeof g[b]<"u"&&E.push(g[b]);v.obj[v.prop]=E}}},i=function(x,v){for(var g=v&&v.plainObjects?{__proto__:null}:{},E=0;E<x.length;++E)typeof x[E]<"u"&&(g[E]=x[E]);return g},o=function w(x,v,g){if(!v)return x;if(typeof v!="object"&&typeof v!="function"){if(t(x))x.push(v);else if(x&&typeof x=="object")(g&&(g.plainObjects||g.allowPrototypes)||!r.call(Object.prototype,v))&&(x[v]=!0);else return[x,v];return x}if(!x||typeof x!="object")return[x].concat(v);var E=x;return t(x)&&!t(v)&&(E=i(x,g)),t(x)&&t(v)?(v.forEach(function(b,M){if(r.call(x,M)){var N=x[M];N&&typeof N=="object"&&b&&typeof b=="object"?x[M]=w(N,b,g):x.push(b)}else x[M]=b}),x):Object.keys(v).reduce(function(b,M){var N=v[M];return r.call(b,M)?b[M]=w(b[M],N,g):b[M]=N,b},E)},s=function(x,v){return Object.keys(v).reduce(function(g,E){return g[E]=v[E],g},x)},c=function(w,x,v){var g=w.replace(/\+/g," ");if(v==="iso-8859-1")return g.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(g)}catch{return g}},u=1024,d=function(x,v,g,E,b){if(x.length===0)return x;var M=x;if(typeof x=="symbol"?M=Symbol.prototype.toString.call(x):typeof x!="string"&&(M=String(x)),g==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function(A){return"%26%23"+parseInt(A.slice(2),16)+"%3B"});for(var N="",R=0;R<M.length;R+=u){for(var F=M.length>=u?M.slice(R,R+u):M,j=[],O=0;O<F.length;++O){var C=F.charCodeAt(O);if(C===45||C===46||C===95||C===126||C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||b===e.RFC1738&&(C===40||C===41)){j[j.length]=F.charAt(O);continue}if(C<128){j[j.length]=n[C];continue}if(C<2048){j[j.length]=n[192|C>>6]+n[128|C&63];continue}if(C<55296||C>=57344){j[j.length]=n[224|C>>12]+n[128|C>>6&63]+n[128|C&63];continue}O+=1,C=65536+((C&1023)<<10|F.charCodeAt(O)&1023),j[j.length]=n[240|C>>18]+n[128|C>>12&63]+n[128|C>>6&63]+n[128|C&63]}N+=j.join("")}return N},p=function(x){for(var v=[{obj:{o:x},prop:"o"}],g=[],E=0;E<v.length;++E)for(var b=v[E],M=b.obj[b.prop],N=Object.keys(M),R=0;R<N.length;++R){var F=N[R],j=M[F];typeof j=="object"&&j!==null&&g.indexOf(j)===-1&&(v.push({obj:M,prop:F}),g.push(j))}return a(v),x},y=function(x){return Object.prototype.toString.call(x)==="[object RegExp]"},f=function(x){return!x||typeof x!="object"?!1:!!(x.constructor&&x.constructor.isBuffer&&x.constructor.isBuffer(x))},_=function(x,v){return[].concat(x,v)},S=function(x,v){if(t(x)){for(var g=[],E=0;E<x.length;E+=1)g.push(v(x[E]));return g}return v(x)};return fv={arrayToObject:i,assign:s,combine:_,compact:p,decode:c,encode:d,isBuffer:f,isRegExp:y,maybeMap:S,merge:o},fv}var hv,L3;function vC(){if(L3)return hv;L3=1;var e=gC(),r=J8(),t=km(),n=Object.prototype.hasOwnProperty,a={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,x){return w+"["+x+"]"},repeat:function(w){return w}},i=Array.isArray,o=Array.prototype.push,s=function(S,w){o.apply(S,i(w)?w:[w])},c=Date.prototype.toISOString,u=t.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:u,formatter:t.formatters[u],indices:!1,serializeDate:function(w){return c.call(w)},skipNulls:!1,strictNullHandling:!1},p=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},y={},f=function S(w,x,v,g,E,b,M,N,R,F,j,O,C,A,k,T,V,G){for(var $=w,te=G,W=0,U=!1;(te=te.get(y))!==void 0&&!U;){var z=te.get(w);if(W+=1,typeof z<"u"){if(z===W)throw new RangeError("Cyclic object value");U=!0}typeof te.get(y)>"u"&&(W=0)}if(typeof F=="function"?$=F(x,$):$ instanceof Date?$=C($):v==="comma"&&i($)&&($=r.maybeMap($,function(Se){return Se instanceof Date?C(Se):Se})),$===null){if(b)return R&&!T?R(x,d.encoder,V,"key",A):x;$=""}if(p($)||r.isBuffer($)){if(R){var D=T?x:R(x,d.encoder,V,"key",A);return[k(D)+"="+k(R($,d.encoder,V,"value",A))]}return[k(x)+"="+k(String($))]}var Y=[];if(typeof $>"u")return Y;var Q;if(v==="comma"&&i($))T&&R&&($=r.maybeMap($,R)),Q=[{value:$.length>0?$.join(",")||null:void 0}];else if(i(F))Q=F;else{var J=Object.keys($);Q=j?J.sort(j):J}var Z=N?String(x).replace(/\./g,"%2E"):String(x),ae=g&&i($)&&$.length===1?Z+"[]":Z;if(E&&i($)&&$.length===0)return ae+"[]";for(var se=0;se<Q.length;++se){var ce=Q[se],de=typeof ce=="object"&&ce&&typeof ce.value<"u"?ce.value:$[ce];if(!(M&&de===null)){var Oe=O&&N?String(ce).replace(/\./g,"%2E"):String(ce),Le=i($)?typeof v=="function"?v(ae,Oe):ae:ae+(O?"."+Oe:"["+Oe+"]");G.set(w,W);var ke=e();ke.set(y,G),s(Y,S(de,Le,v,g,E,b,M,N,v==="comma"&&T&&i($)?null:R,F,j,O,C,A,k,T,V,ke))}}return Y},_=function(w){if(!w)return d;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var x=w.charset||d.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var v=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");v=w.format}var g=t.formatters[v],E=d.filter;(typeof w.filter=="function"||i(w.filter))&&(E=w.filter);var b;if(w.arrayFormat in a?b=w.arrayFormat:"indices"in w?b=w.indices?"indices":"repeat":b=d.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var M=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:d.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:d.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:b,charset:x,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:d.charsetSentinel,commaRoundTrip:!!w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?d.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:d.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:d.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:d.encodeValuesOnly,filter:E,format:v,formatter:g,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:d.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:d.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:d.strictNullHandling}};return hv=function(S,w){var x=S,v=_(w),g,E;typeof v.filter=="function"?(E=v.filter,x=E("",x)):i(v.filter)&&(E=v.filter,g=E);var b=[];if(typeof x!="object"||x===null)return"";var M=a[v.arrayFormat],N=M==="comma"&&v.commaRoundTrip;g||(g=Object.keys(x)),v.sort&&g.sort(v.sort);for(var R=e(),F=0;F<g.length;++F){var j=g[F],O=x[j];v.skipNulls&&O===null||s(b,f(O,j,M,N,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,R))}var C=b.join(v.delimiter),A=v.addQueryPrefix===!0?"?":"";return v.charsetSentinel&&(v.charset==="iso-8859-1"?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),C.length>0?A+C:""},hv}var dv,N3;function mC(){if(N3)return dv;N3=1;var e=J8(),r=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(y){return y.replace(/&#(\d+);/g,function(f,_){return String.fromCharCode(parseInt(_,10))})},i=function(y,f,_){if(y&&typeof y=="string"&&f.comma&&y.indexOf(",")>-1)return y.split(",");if(f.throwOnLimitExceeded&&_>=f.arrayLimit)throw new RangeError("Array limit exceeded. Only "+f.arrayLimit+" element"+(f.arrayLimit===1?"":"s")+" allowed in an array.");return y},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",c=function(f,_){var S={__proto__:null},w=_.ignoreQueryPrefix?f.replace(/^\?/,""):f;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var x=_.parameterLimit===1/0?void 0:_.parameterLimit,v=w.split(_.delimiter,_.throwOnLimitExceeded?x+1:x);if(_.throwOnLimitExceeded&&v.length>x)throw new RangeError("Parameter limit exceeded. Only "+x+" parameter"+(x===1?"":"s")+" allowed.");var g=-1,E,b=_.charset;if(_.charsetSentinel)for(E=0;E<v.length;++E)v[E].indexOf("utf8=")===0&&(v[E]===s?b="utf-8":v[E]===o&&(b="iso-8859-1"),g=E,E=v.length);for(E=0;E<v.length;++E)if(E!==g){var M=v[E],N=M.indexOf("]="),R=N===-1?M.indexOf("="):N+1,F,j;R===-1?(F=_.decoder(M,n.decoder,b,"key"),j=_.strictNullHandling?null:""):(F=_.decoder(M.slice(0,R),n.decoder,b,"key"),j=e.maybeMap(i(M.slice(R+1),_,t(S[F])?S[F].length:0),function(C){return _.decoder(C,n.decoder,b,"value")})),j&&_.interpretNumericEntities&&b==="iso-8859-1"&&(j=a(String(j))),M.indexOf("[]=")>-1&&(j=t(j)?[j]:j);var O=r.call(S,F);O&&_.duplicates==="combine"?S[F]=e.combine(S[F],j):(!O||_.duplicates==="last")&&(S[F]=j)}return S},u=function(y,f,_,S){var w=0;if(y.length>0&&y[y.length-1]==="[]"){var x=y.slice(0,-1).join("");w=Array.isArray(f)&&f[x]?f[x].length:0}for(var v=S?f:i(f,_,w),g=y.length-1;g>=0;--g){var E,b=y[g];if(b==="[]"&&_.parseArrays)E=_.allowEmptyArrays&&(v===""||_.strictNullHandling&&v===null)?[]:e.combine([],v);else{E=_.plainObjects?{__proto__:null}:{};var M=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,N=_.decodeDotInKeys?M.replace(/%2E/g,"."):M,R=parseInt(N,10);!_.parseArrays&&N===""?E={0:v}:!isNaN(R)&&b!==N&&String(R)===N&&R>=0&&_.parseArrays&&R<=_.arrayLimit?(E=[],E[R]=v):N!=="__proto__"&&(E[N]=v)}v=E}return v},d=function(f,_,S,w){if(f){var x=S.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,v=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,E=S.depth>0&&v.exec(x),b=E?x.slice(0,E.index):x,M=[];if(b){if(!S.plainObjects&&r.call(Object.prototype,b)&&!S.allowPrototypes)return;M.push(b)}for(var N=0;S.depth>0&&(E=g.exec(x))!==null&&N<S.depth;){if(N+=1,!S.plainObjects&&r.call(Object.prototype,E[1].slice(1,-1))&&!S.allowPrototypes)return;M.push(E[1])}if(E){if(S.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+S.depth+" and strictDepth is true");M.push("["+x.slice(E.index)+"]")}return u(M,_,S,w)}},p=function(f){if(!f)return n;if(typeof f.allowEmptyArrays<"u"&&typeof f.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof f.decodeDotInKeys<"u"&&typeof f.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(f.decoder!==null&&typeof f.decoder<"u"&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof f.charset<"u"&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof f.throwOnLimitExceeded<"u"&&typeof f.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var _=typeof f.charset>"u"?n.charset:f.charset,S=typeof f.duplicates>"u"?n.duplicates:f.duplicates;if(S!=="combine"&&S!=="first"&&S!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:n.allowDots:!!f.allowDots;return{allowDots:w,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:n.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:n.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:n.arrayLimit,charset:_,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:n.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:n.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:n.decoder,delimiter:typeof f.delimiter=="string"||e.isRegExp(f.delimiter)?f.delimiter:n.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:n.depth,duplicates:S,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:n.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:n.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:n.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof f.throwOnLimitExceeded=="boolean"?f.throwOnLimitExceeded:!1}};return dv=function(y,f){var _=p(f);if(y===""||y===null||typeof y>"u")return _.plainObjects?{__proto__:null}:{};for(var S=typeof y=="string"?c(y,_):y,w=_.plainObjects?{__proto__:null}:{},x=Object.keys(S),v=0;v<x.length;++v){var g=x[v],E=d(g,S[g],_,typeof y=="string");w=e.merge(w,E,_)}return _.allowSparse===!0?w:e.compact(w)},dv}var pv,T3;function yC(){if(T3)return pv;T3=1;var e=vC(),r=mC(),t=km();return pv={formats:t,parse:r,stringify:e},pv}var R3;function e_(){if(R3)return wf;R3=1;var e=BA();function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var t=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,i=["<",">",'"',"`"," ","\r",`
|
|
152
|
+
`," "],o=["{","}","|","\\","^","`"].concat(i),s=["'"].concat(o),c=["%","/","?",";","#"].concat(s),u=["/","?","#"],d=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,y=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=yC();function x(b,M,N){if(b&&typeof b=="object"&&b instanceof r)return b;var R=new r;return R.parse(b,M,N),R}r.prototype.parse=function(b,M,N){if(typeof b!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof b);var R=b.indexOf("?"),F=R!==-1&&R<b.indexOf("#")?"?":"#",j=b.split(F),O=/\\/g;j[0]=j[0].replace(O,"/"),b=j.join(F);var C=b;if(C=C.trim(),!N&&b.split("#").length===1){var A=a.exec(C);if(A)return this.path=C,this.href=C,this.pathname=A[1],A[2]?(this.search=A[2],M?this.query=w.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var k=t.exec(C);if(k){k=k[0];var T=k.toLowerCase();this.protocol=T,C=C.substr(k.length)}if(N||k||C.match(/^\/\/[^@/]+@[^@/]+/)){var V=C.substr(0,2)==="//";V&&!(k&&_[k])&&(C=C.substr(2),this.slashes=!0)}if(!_[k]&&(V||k&&!S[k])){for(var G=-1,$=0;$<u.length;$++){var te=C.indexOf(u[$]);te!==-1&&(G===-1||te<G)&&(G=te)}var W,U;G===-1?U=C.lastIndexOf("@"):U=C.lastIndexOf("@",G),U!==-1&&(W=C.slice(0,U),C=C.slice(U+1),this.auth=decodeURIComponent(W)),G=-1;for(var $=0;$<c.length;$++){var te=C.indexOf(c[$]);te!==-1&&(G===-1||te<G)&&(G=te)}G===-1&&(G=C.length),this.host=C.slice(0,G),C=C.slice(G),this.parseHost(),this.hostname=this.hostname||"";var z=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!z)for(var D=this.hostname.split(/\./),$=0,Y=D.length;$<Y;$++){var Q=D[$];if(Q&&!Q.match(p)){for(var J="",Z=0,ae=Q.length;Z<ae;Z++)Q.charCodeAt(Z)>127?J+="x":J+=Q[Z];if(!J.match(p)){var se=D.slice(0,$),ce=D.slice($+1),de=Q.match(y);de&&(se.push(de[1]),ce.unshift(de[2])),ce.length&&(C="/"+ce.join(".")+C),this.hostname=se.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),z||(this.hostname=e.toASCII(this.hostname));var Oe=this.port?":"+this.port:"",Le=this.hostname||"";this.host=Le+Oe,this.href+=this.host,z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!f[T])for(var $=0,Y=s.length;$<Y;$++){var ke=s[$];if(C.indexOf(ke)!==-1){var Se=encodeURIComponent(ke);Se===ke&&(Se=escape(ke)),C=C.split(ke).join(Se)}}var ye=C.indexOf("#");ye!==-1&&(this.hash=C.substr(ye),C=C.slice(0,ye));var Je=C.indexOf("?");if(Je!==-1?(this.search=C.substr(Je),this.query=C.substr(Je+1),M&&(this.query=w.parse(this.query)),C=C.slice(0,Je)):M&&(this.search="",this.query={}),C&&(this.pathname=C),S[T]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Oe=this.pathname||"",we=this.search||"";this.path=Oe+we}return this.href=this.format(),this};function v(b){return typeof b=="string"&&(b=x(b)),b instanceof r?b.format():r.prototype.format.call(b)}r.prototype.format=function(){var b=this.auth||"";b&&(b=encodeURIComponent(b),b=b.replace(/%3A/i,":"),b+="@");var M=this.protocol||"",N=this.pathname||"",R=this.hash||"",F=!1,j="";this.host?F=b+this.host:this.hostname&&(F=b+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(F+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(j=w.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var O=this.search||j&&"?"+j||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||S[M])&&F!==!1?(F="//"+(F||""),N&&N.charAt(0)!=="/"&&(N="/"+N)):F||(F=""),R&&R.charAt(0)!=="#"&&(R="#"+R),O&&O.charAt(0)!=="?"&&(O="?"+O),N=N.replace(/[?#]/g,function(C){return encodeURIComponent(C)}),O=O.replace("#","%23"),M+F+N+O+R};function g(b,M){return x(b,!1,!0).resolve(M)}r.prototype.resolve=function(b){return this.resolveObject(x(b,!1,!0)).format()};function E(b,M){return b?x(b,!1,!0).resolveObject(M):M}return r.prototype.resolveObject=function(b){if(typeof b=="string"){var M=new r;M.parse(b,!1,!0),b=M}for(var N=new r,R=Object.keys(this),F=0;F<R.length;F++){var j=R[F];N[j]=this[j]}if(N.hash=b.hash,b.href==="")return N.href=N.format(),N;if(b.slashes&&!b.protocol){for(var O=Object.keys(b),C=0;C<O.length;C++){var A=O[C];A!=="protocol"&&(N[A]=b[A])}return S[N.protocol]&&N.hostname&&!N.pathname&&(N.pathname="/",N.path=N.pathname),N.href=N.format(),N}if(b.protocol&&b.protocol!==N.protocol){if(!S[b.protocol]){for(var k=Object.keys(b),T=0;T<k.length;T++){var V=k[T];N[V]=b[V]}return N.href=N.format(),N}if(N.protocol=b.protocol,!b.host&&!_[b.protocol]){for(var Y=(b.pathname||"").split("/");Y.length&&!(b.host=Y.shift()););b.host||(b.host=""),b.hostname||(b.hostname=""),Y[0]!==""&&Y.unshift(""),Y.length<2&&Y.unshift(""),N.pathname=Y.join("/")}else N.pathname=b.pathname;if(N.search=b.search,N.query=b.query,N.host=b.host||"",N.auth=b.auth,N.hostname=b.hostname||b.host,N.port=b.port,N.pathname||N.search){var G=N.pathname||"",$=N.search||"";N.path=G+$}return N.slashes=N.slashes||b.slashes,N.href=N.format(),N}var te=N.pathname&&N.pathname.charAt(0)==="/",W=b.host||b.pathname&&b.pathname.charAt(0)==="/",U=W||te||N.host&&b.pathname,z=U,D=N.pathname&&N.pathname.split("/")||[],Y=b.pathname&&b.pathname.split("/")||[],Q=N.protocol&&!S[N.protocol];if(Q&&(N.hostname="",N.port=null,N.host&&(D[0]===""?D[0]=N.host:D.unshift(N.host)),N.host="",b.protocol&&(b.hostname=null,b.port=null,b.host&&(Y[0]===""?Y[0]=b.host:Y.unshift(b.host)),b.host=null),U=U&&(Y[0]===""||D[0]==="")),W)N.host=b.host||b.host===""?b.host:N.host,N.hostname=b.hostname||b.hostname===""?b.hostname:N.hostname,N.search=b.search,N.query=b.query,D=Y;else if(Y.length)D||(D=[]),D.pop(),D=D.concat(Y),N.search=b.search,N.query=b.query;else if(b.search!=null){if(Q){N.host=D.shift(),N.hostname=N.host;var J=N.host&&N.host.indexOf("@")>0?N.host.split("@"):!1;J&&(N.auth=J.shift(),N.hostname=J.shift(),N.host=N.hostname)}return N.search=b.search,N.query=b.query,(N.pathname!==null||N.search!==null)&&(N.path=(N.pathname?N.pathname:"")+(N.search?N.search:"")),N.href=N.format(),N}if(!D.length)return N.pathname=null,N.search?N.path="/"+N.search:N.path=null,N.href=N.format(),N;for(var Z=D.slice(-1)[0],ae=(N.host||b.host||D.length>1)&&(Z==="."||Z==="..")||Z==="",se=0,ce=D.length;ce>=0;ce--)Z=D[ce],Z==="."?D.splice(ce,1):Z===".."?(D.splice(ce,1),se++):se&&(D.splice(ce,1),se--);if(!U&&!z)for(;se--;se)D.unshift("..");U&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),ae&&D.join("/").substr(-1)!=="/"&&D.push("");var de=D[0]===""||D[0]&&D[0].charAt(0)==="/";if(Q){N.hostname=de?"":D.length?D.shift():"",N.host=N.hostname;var J=N.host&&N.host.indexOf("@")>0?N.host.split("@"):!1;J&&(N.auth=J.shift(),N.hostname=J.shift(),N.host=N.hostname)}return U=U||N.host&&D.length,U&&!de&&D.unshift(""),D.length>0?N.pathname=D.join("/"):(N.pathname=null,N.path=null),(N.pathname!==null||N.search!==null)&&(N.path=(N.pathname?N.pathname:"")+(N.search?N.search:"")),N.auth=b.auth||N.auth,N.slashes=N.slashes||b.slashes,N.href=N.format(),N},r.prototype.parseHost=function(){var b=this.host,M=n.exec(b);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),b=b.substr(0,b.length-M.length)),b&&(this.hostname=b)},wf.parse=x,wf.resolve=g,wf.resolveObject=E,wf.format=v,wf.Url=r,wf}var w1={exports:{}},bC=w1.exports,M3;function wC(){return M3||(M3=1,function(e){(function(r,t){e.exports?e.exports=t():r.xmlserializer=t()})(bC,function(){var r=function(f){return f.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},t=function(f){return f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(f){return f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},a=function(f){var _=f.value;return" "+f.name+'="'+t(_)+'"'},i=function(f){var _=f.tagName;return f.namespaceURI==="http://www.w3.org/1999/xhtml"&&(_=_.toLowerCase()),_},o=function(f,_){var S=Array.prototype.map.call(f.attributes||f.attrs,function(w){return w.name}).indexOf("xmlns")>=0;return!S&&(_||f.namespaceURI!==f.parentNode.namespaceURI)?' xmlns="'+f.namespaceURI+'"':""},s=function(f){return Array.prototype.map.call(f.childNodes,function(_){return y(_)}).join("")},c=function(f,_){var S="<"+i(f);return S+=o(f,_),Array.prototype.forEach.call(f.attributes||f.attrs,function(w){S+=a(w)}),f.childNodes.length>0?(S+=">",S+=s(f),S+="</"+i(f)+">"):S+="/>",S},u=function(f){var _=f.nodeValue||f.value||"";return n(_)},d=function(f){return"<!--"+f.data.replace(/-/g,"-")+"-->"},p=function(f){return"<![CDATA["+f.nodeValue+"]]>"},y=function(f,_){var S=_&&_.rootNode;if(f.nodeName==="#document"||f.nodeName==="#document-fragment")return s(f);if(f.tagName)return c(f,S);if(f.nodeName==="#text")return u(f);if(f.nodeName==="#comment")return d(f);if(f.nodeName==="#cdata-section")return p(f)};return{serializeToString:function(f){return r(y(f,{rootNode:!0}))}}})}(w1)),w1.exports}var gv={},I3;function _C(){if(I3)return gv;I3=1;var e=function(i){var o=new XMLSerializer;return Array.prototype.map.call(i.childNodes,function(s){return o.serializeToString(s)}).join("")},r=function(i){if(i.documentElement.tagName==="parsererror"&&i.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return i.documentElement;if((i.documentElement.tagName==="xml"||i.documentElement.tagName==="html")&&i.documentElement.childNodes&&i.documentElement.childNodes.length>0&&i.documentElement.childNodes[0].nodeName==="parsererror")return i.documentElement.childNodes[0];if(i.documentElement.tagName==="html"&&i.documentElement.childNodes&&i.documentElement.childNodes.length>0&&i.documentElement.childNodes[0].nodeName==="body"&&i.documentElement.childNodes[0].childNodes&&i.documentElement.childNodes[0].childNodes.length&&i.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return i.documentElement.childNodes[0].childNodes[0]},t=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
153
|
+
?</div>`),new RegExp(`^(.+)
|
|
154
|
+
`)],n=function(i){var o=e(i),s,c;for(s=0;s<t.length;s++)if(c=t[s].exec(o),c)return c[1]},a=function(i){var o;if(i===null)throw new Error("Parse error");var s=r(i);if(s!==void 0)throw o=n(s)||"Parse error",new Error(o)};return gv.failOnParseError=function(i){return a(i),i},gv}var vv={},mv={},j3;function l0(){return j3||(j3=1,function(e){var r=e_();e.getDocumentBaseUrl=function(s){return s.baseURI!=="about:blank"?s.baseURI:null},e.clone=function(s){var c={},u;for(u in s)s.hasOwnProperty(u)&&(c[u]=s[u]);return c},e.cloneArray=function(s){return Array.prototype.slice.apply(s,[0])},e.joinUrl=function(s,c){return s?r.resolve(s,c):c},e.isDataUri=function(s){return/^data:/.test(s)},e.collectAndReportErrors=function(s){var c=[];return Promise.all(s.map(function(u){return u.catch(function(d){c.push(d)})})).then(function(){return c})};var t=null,n=function(s,c){return c===!1||c==="none"||c==="repeated"?((t===null||c!=="repeated")&&(t=Date.now()),s+"?_="+t):s};e.ajax=function(s,c){return new Promise(function(u,d){var p=new window.XMLHttpRequest,y=e.joinUrl(c.baseUrl,s),f,_=function(){d({msg:"Unable to load url",url:y})};f=n(y,c.cache),p.addEventListener("load",function(){p.status===200||p.status===0?u(p.response):_()},!1),p.addEventListener("error",_,!1);try{p.open("GET",f,!0),p.overrideMimeType(c.mimeType),p.send(null)}catch{_()}})},e.binaryAjax=function(s,c){var u=e.clone(c);return u.mimeType="text/plain; charset=x-user-defined",e.ajax(s,u).then(function(d){for(var p="",y=0;y<d.length;y++)p+=String.fromCharCode(d.charCodeAt(y)&255);return p})};var a=function(s){var c=function(u,d){return u.substring(0,d.length)===d};return c(s,"<?xml")||c(s,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(s,c){return e.binaryAjax(s,c).then(function(u){var d=btoa(u),p=a(u);return"data:"+p+";base64,"+d})};var i=[],o=function(s){return i.indexOf(s)<0&&i.push(s),i.indexOf(s)};e.memoize=function(s,c,u){if(typeof u!="object")throw new Error("cacheBucket is not an object");return function(){var d=Array.prototype.slice.call(arguments),p=c(d),y=o(s),f;return u[y]&&u[y][p]?u[y][p]:(f=s.apply(null,d),u[y]=u[y]||{},u[y][p]=f,f)}}}(mv)),mv}var yv={},F3;function SC(){if(F3)return yv;F3=1;var e=l0(),r=function(i,o){var s=null;i.hasAttribute("src")?s=i.getAttribute("src"):i.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=i.getAttributeNS("http://www.w3.org/1999/xlink","href"):i.hasAttribute("href")&&(s=i.getAttribute("href"));var c=e.getDocumentBaseUrl(i.ownerDocument),u=e.clone(o);return!u.baseUrl&&c&&(u.baseUrl=c),e.getDataURIForImageURL(s,u).then(function(d){return d},function(d){throw{resourceType:"image",url:d.url,msg:"Unable to load image "+d.url}})},t=function(i){return i.filter(function(o){var s=null;return o.hasAttribute("src")?s=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(s=o.getAttribute("href")),s!==null&&!e.isDataUri(s)})},n=function(i){return Array.prototype.filter.call(i,function(o){return o.type==="image"})},a=function(i){return Array.prototype.slice.call(i)};return yv.inline=function(i,o){var s=a(i.getElementsByTagName("img")),c=a(i.getElementsByTagName("image")),u=n(i.getElementsByTagName("input"));s=s.concat(c),s=s.concat(u);var d=t(s);return e.collectAndReportErrors(d.map(function(p){return r(p,o).then(function(y){p.attributes.src?p.attributes.src.value=y:p.attributes["xlink:href"]?p.attributes["xlink:href"].value=y:p.attributes.href&&(p.attributes.href.value=y)})}))},yv}var bv={},D3;function xC(){if(D3)return bv;D3=1;var e=l0(),r=function(i,o){var s=i.attributes.src.value,c=e.getDocumentBaseUrl(i.ownerDocument),u=e.clone(o);return!u.baseUrl&&c&&(u.baseUrl=c),e.ajax(s,u).catch(function(d){throw{resourceType:"script",url:d.url,msg:"Unable to load script "+d.url}})},t=function(i){return i.replace(/<\//g,"<\\/")},n=function(i,o){i.attributes.removeNamedItem("src"),i.textContent=t(o)},a=function(i){var o=i.getElementsByTagName("script");return Array.prototype.filter.call(o,function(s){return!!s.attributes.src})};return bv.inline=function(i,o){var s=a(i);return e.collectAndReportErrors(s.map(function(c){return r(c,o).then(function(u){n(c,u)})}))},bv}var wv={},_v={},B3;function Lm(){return B3||(B3=1,function(e){e.unquoteString=function(r){var t=/^"(.*)"$/,n=/^'(.*)'$/;return t.test(r)?r.replace(t,"$1"):n.test(r)?r.replace(n,"$1"):r},e.rulesForCssText=function(r){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style"),a;return n.textContent=r,t.body.appendChild(n),a=n.sheet.cssRules,Array.prototype.slice.call(a)},e.cssRulesToText=function(r){return r.reduce(function(t,n){return t+n.cssText},"")},e.exchangeRule=function(r,t,n){var a=r.indexOf(t);r[a]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(r,t,n){var a="@font-face { font-family: "+t.style.getPropertyValue("font-family")+"; ";t.style.getPropertyValue("font-style")&&(a+="font-style: "+t.style.getPropertyValue("font-style")+"; "),t.style.getPropertyValue("font-weight")&&(a+="font-weight: "+t.style.getPropertyValue("font-weight")+"; "),t.style.getPropertyValue("unicode-range")&&(a+="unicode-range: "+t.style.getPropertyValue("unicode-range")+"; "),a+="src: "+n+"}",e.exchangeRule(r,t,a)}}(_v)),_v}var Sv={},q3;function EC(){return q3||(q3=1,function(e){var r=Lm(),t=function(i){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return i.replace(o,"$1")};e.extractCssUrl=function(i){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,s;if(!o.test(i))throw new Error("Invalid url");return s=o.exec(i)[1],r.unquoteString(t(s))};var n=function(i){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,s="(url\\("+o+"\\)|[^,\\s]+)",c="(?:\\s*"+s+")+",u="^\\s*("+c+")(?:\\s*,\\s*("+c+"))*\\s*$",d=new RegExp(c,"g"),p,y=[],f=function(_){var S=new RegExp(s,"g"),w=[],x;for(x=S.exec(_);x;)w.push(x[1]),x=S.exec(_);return w};if(i.match(new RegExp(u))){for(p=d.exec(i);p;)y.push(f(p[0])),p=d.exec(i);return y}return[]},a=function(i){var o,s;for(o=0;o<i.length;o++)try{return s=e.extractCssUrl(i[o]),{url:s,idx:o}}catch{}};e.parse=function(i){var o=n(i);return o.map(function(s){var c=a(s);return c?{preUrl:s.slice(0,c.idx),url:c.url,postUrl:s.slice(c.idx+1)}:{preUrl:s}})},e.serialize=function(i){var o=i.map(function(s){var c=[].concat(s.preUrl);return s.url&&c.push('url("'+s.url+'")'),s.postUrl&&(c=c.concat(s.postUrl)),c.join(" ")});return o.join(", ")}}(Sv)),Sv}function c1(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 xv={exports:{}},z3;function PC(){return z3||(z3=1,function(e,r){(function(t){e.exports=t()})(function(){return function t(n,a,i){function o(u,d){if(!a[u]){if(!n[u]){var p=typeof c1=="function"&&c1;if(!d&&p)return p(u,!0);if(s)return s(u,!0);var y=new Error("Cannot find module '"+u+"'");throw y.code="MODULE_NOT_FOUND",y}var f=a[u]={exports:{}};n[u][0].call(f.exports,function(_){var S=n[u][1][_];return o(S||_)},f,f.exports,t,n,a,i)}return a[u].exports}for(var s=typeof c1=="function"&&c1,c=0;c<i.length;c++)o(i[c]);return o}({1:[function(t,n,a){function i(c,u){function d(){this.constructor=c}d.prototype=u.prototype,c.prototype=new d}function o(c,u,d,p){this.message=c,this.expected=u,this.found=d,this.location=p,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}i(o,Error),o.buildMessage=function(c,u){var d={literal:function(x){return'"'+y(x.text)+'"'},class:function(x){var v="",g;for(g=0;g<x.parts.length;g++)v+=x.parts[g]instanceof Array?f(x.parts[g][0])+"-"+f(x.parts[g][1]):f(x.parts[g]);return"["+(x.inverted?"^":"")+v+"]"},any:function(x){return"any character"},end:function(x){return"end of input"},other:function(x){return x.description}};function p(x){return x.charCodeAt(0).toString(16).toUpperCase()}function y(x){return x.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+p(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+p(v)})}function f(x){return x.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+p(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+p(v)})}function _(x){return d[x.type](x)}function S(x){var v=new Array(x.length),g,E;for(g=0;g<x.length;g++)v[g]=_(x[g]);if(v.sort(),v.length>0){for(g=1,E=1;g<v.length;g++)v[g-1]!==v[g]&&(v[E]=v[g],E++);v.length=E}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function w(x){return x?'"'+y(x)+'"':"end of input"}return"Expected "+S(c)+" but "+w(u)+" found."};function s(c,u){u=u!==void 0?u:{};var d={},p={start:Oe},y=Oe,f="",_=function(){return[]},S=",",w=Q(",",!1),x=function(he,Re){return[he].concat(Re)},v=function(he){return[he]},g=function(he,Re){return{url:he,format:Re}},E=function(he){return{url:he}},b="url(",M=Q("url(",!1),N=")",R=Q(")",!1),F=function(he){return he},j="format(",O=Q("format(",!1),C="local(",A=Q("local(",!1),k=function(he){return{local:he}},T=/^[^)]/,V=J([")"],!0,!1),G=function(he){return Te.extractValue(he.join(""))},$=/^[ \t\r\n\f]/,te=J([" "," ","\r",`
|
|
155
|
+
`,"\f"],!1,!1),W=0,U=[{line:1,column:1}],z=0,D=[],Y;if("startRule"in u){if(!(u.startRule in p))throw new Error(`Can't start parsing from rule "`+u.startRule+'".');y=p[u.startRule]}function Q(he,Re){return{type:"literal",text:he,ignoreCase:Re}}function J(he,Re,Ie){return{type:"class",parts:he,inverted:Re,ignoreCase:Ie}}function Z(){return{type:"end"}}function ae(he){var Re=U[he],Ie;if(Re)return Re;for(Ie=he-1;!U[Ie];)Ie--;for(Re=U[Ie],Re={line:Re.line,column:Re.column};Ie<he;)c.charCodeAt(Ie)===10?(Re.line++,Re.column=1):Re.column++,Ie++;return U[he]=Re,Re}function se(he,Re){var Ie=ae(he),Xe=ae(Re);return{start:{offset:he,line:Ie.line,column:Ie.column},end:{offset:Re,line:Xe.line,column:Xe.column}}}function ce(he){W<z||(W>z&&(z=W,D=[]),D.push(he))}function de(he,Re,Ie){return new o(o.buildMessage(he,Re),he,Re,Ie)}function Oe(){var he,Re;return he=Le(),he===d&&(he=W,Re=f,Re!==d&&(Re=_()),he=Re),he}function Le(){var he,Re,Ie,Xe,rt,vt;if(he=W,Re=ke(),Re!==d){for(Ie=[],Xe=Ee();Xe!==d;)Ie.push(Xe),Xe=Ee();if(Ie!==d)if(c.charCodeAt(W)===44?(Xe=S,W++):(Xe=d,ce(w)),Xe!==d){for(rt=[],vt=Ee();vt!==d;)rt.push(vt),vt=Ee();rt!==d?(vt=Le(),vt!==d?(Re=x(Re,vt),he=Re):(W=he,he=d)):(W=he,he=d)}else W=he,he=d;else W=he,he=d}else W=he,he=d;return he===d&&(he=W,Re=ke(),Re!==d&&(Re=v(Re)),he=Re),he}function ke(){var he;return he=Se(),he===d&&(he=we()),he}function Se(){var he,Re,Ie,Xe;if(he=W,Re=ye(),Re!==d){if(Ie=[],Xe=Ee(),Xe!==d)for(;Xe!==d;)Ie.push(Xe),Xe=Ee();else Ie=d;Ie!==d?(Xe=Je(),Xe!==d?(Re=g(Re,Xe),he=Re):(W=he,he=d)):(W=he,he=d)}else W=he,he=d;return he===d&&(he=W,Re=ye(),Re!==d&&(Re=E(Re)),he=Re),he}function ye(){var he,Re,Ie,Xe;return he=W,c.substr(W,4)===b?(Re=b,W+=4):(Re=d,ce(M)),Re!==d?(Ie=me(),Ie!==d?(c.charCodeAt(W)===41?(Xe=N,W++):(Xe=d,ce(R)),Xe!==d?(Re=F(Ie),he=Re):(W=he,he=d)):(W=he,he=d)):(W=he,he=d),he}function Je(){var he,Re,Ie,Xe;return he=W,c.substr(W,7)===j?(Re=j,W+=7):(Re=d,ce(O)),Re!==d?(Ie=me(),Ie!==d?(c.charCodeAt(W)===41?(Xe=N,W++):(Xe=d,ce(R)),Xe!==d?(Re=F(Ie),he=Re):(W=he,he=d)):(W=he,he=d)):(W=he,he=d),he}function we(){var he,Re,Ie,Xe;return he=W,c.substr(W,6)===C?(Re=C,W+=6):(Re=d,ce(A)),Re!==d?(Ie=me(),Ie!==d?(c.charCodeAt(W)===41?(Xe=N,W++):(Xe=d,ce(R)),Xe!==d?(Re=k(Ie),he=Re):(W=he,he=d)):(W=he,he=d)):(W=he,he=d),he}function me(){var he,Re,Ie;if(he=W,Re=[],T.test(c.charAt(W))?(Ie=c.charAt(W),W++):(Ie=d,ce(V)),Ie!==d)for(;Ie!==d;)Re.push(Ie),T.test(c.charAt(W))?(Ie=c.charAt(W),W++):(Ie=d,ce(V));else Re=d;return Re!==d&&(Re=G(Re)),he=Re,he}function Ee(){var he;return $.test(c.charAt(W))?(he=c.charAt(W),W++):(he=d,ce(te)),he}var Te=t("../util");if(Y=y(),Y!==d&&W===c.length)return Y;throw Y!==d&&W<c.length&&ce(Z()),de(D,z<c.length?c.charAt(z):null,z<c.length?se(z,z+1):se(z,z))}n.exports={SyntaxError:o,parse:s}},{"../util":3}],2:[function(t,n,a){var i=t("./grammar");a.SyntaxError=function(o,s){this.message=o,this.offset=s},a.parse=function(o){try{return i.parse(o)}catch(s){throw new a.SyntaxError(s.message,s.offset)}},a.serialize=function(o){return o.map(function(s){var c;return s.url?(c='url("'+s.url+'")',s.format&&(c+=' format("'+s.format+'")')):c='local("'+s.local+'")',c}).join(", ")}},{"./grammar":1}],3:[function(t,n,a){var i=function(s){var c=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return s.replace(c,"$1")},o=function(s){var c=/^"(.*)"$/,u=/^'(.*)'$/;return c.test(s)?s.replace(c,"$1"):u.test(s)?s.replace(u,"$1"):s};a.extractValue=function(s){return o(i(s))}},{}]},{},[2])(2)})}(xv)),xv.exports}var U3;function OC(){return U3||(U3=1,function(e){var r=l0(),t=Lm(),n=EC(),a=PC(),i=function(v,g,E){v.style.setProperty(g,E,v.style.getPropertyPriority(g))},o=function(v){return v.filter(function(g){return g.type===window.CSSRule.STYLE_RULE&&(g.style.getPropertyValue("background-image")||g.style.getPropertyValue("background"))})},s=function(v){var g=[];return v.forEach(function(E){E.style.getPropertyValue("background-image")?g.push({property:"background-image",value:E.style.getPropertyValue("background-image"),rule:E}):E.style.getPropertyValue("background")&&g.push({property:"background",value:E.style.getPropertyValue("background"),rule:E})}),g},c=function(v){return v.filter(function(g){return g.type===window.CSSRule.FONT_FACE_RULE&&g.style.getPropertyValue("src")})},u=function(v){return v.filter(function(g){return g.type===window.CSSRule.IMPORT_RULE&&g.href})},d=function(v){var g=[];return v.forEach(function(E,b){E.url&&!r.isDataUri(E.url)&&g.push(b)}),g},p=function(v){var g=[];return v.forEach(function(E,b){E.url&&!r.isDataUri(E.url)&&g.push(b)}),g};e.adjustPathsOfCssResources=function(v,g){var E=o(g),b=s(E),M=!1;return b.forEach(function(N){var R=n.parse(N.value),F=d(R),j;F.length>0&&(F.forEach(function(O){var C=R[O].url,A=r.joinUrl(v,C);R[O].url=A}),j=n.serialize(R),i(N.rule,N.property,j),M=!0)}),c(g).forEach(function(N){var R=N.style.getPropertyValue("src"),F,j;try{F=a.parse(R)}catch{return}j=p(F),j.length>0&&(j.forEach(function(O){var C=F[O].url,A=r.joinUrl(v,C);F[O].url=A}),t.changeFontFaceRuleSrc(g,N,a.serialize(F)),M=!0)}),u(g).forEach(function(N){var R=N.href,F=r.joinUrl(v,R);t.exchangeRule(g,N,"@import url("+F+");"),M=!0}),M};var y=function(v,g,E){var b=v.indexOf(g);v.splice(b,1),E.forEach(function(M,N){v.splice(b+N,0,M)})},f=function(v,g,E,b){var M=g.href,N;return M=t.unquoteString(M),N=r.joinUrl(b.baseUrl,M),E.indexOf(N)>=0?(y(v,g,[]),Promise.resolve([])):(E.push(N),r.ajax(M,b).then(function(R){var F=t.rulesForCssText(R);return e.loadCSSImportsForRules(F,E,b).then(function(j){return e.adjustPathsOfCssResources(M,F),y(v,g,F),j.errors})},function(R){throw{resourceType:"stylesheet",url:R.url,msg:"Unable to load stylesheet "+R.url}}))};e.loadCSSImportsForRules=function(v,g,E){var b=u(v),M=[],N=!1;return Promise.all(b.map(function(R){return f(v,R,g,E).then(function(F){M=M.concat(F),N=!0},function(F){M.push(F)})})).then(function(){return{hasChanges:N,errors:M}})};var _=function(v,g){var E=n.parse(v),b=d(E),M=!1;return r.collectAndReportErrors(b.map(function(N){var R=E[N].url;return r.getDataURIForImageURL(R,g).then(function(F){E[N].url=F,M=!0},function(F){throw{resourceType:"backgroundImage",url:F.url,msg:"Unable to load background-image "+F.url}})})).then(function(N){return{backgroundValue:n.serialize(E),hasChanges:M,errors:N}})},S=function(v,g){var E=o(v),b=s(E),M=[],N=!1;return Promise.all(b.map(function(R){return _(R.value,g).then(function(F){F.hasChanges&&(i(R.rule,R.property,F.backgroundValue),N=!0),M=M.concat(F.errors)})})).then(function(){return{hasChanges:N,errors:M}})},w=function(v,g){var E=!1,b,M;try{b=a.parse(v)}catch{b=[]}return M=p(b),r.collectAndReportErrors(M.map(function(N){var R=b[N],F=R.format||"woff";return r.binaryAjax(R.url,g).then(function(j){var O=btoa(j);R.url="data:font/"+F+";base64,"+O,E=!0},function(j){throw{resourceType:"fontFace",url:j.url,msg:"Unable to load font-face "+j.url}})})).then(function(N){return{srcDeclarationValue:a.serialize(b),hasChanges:E,errors:N}})},x=function(v,g){var E=c(v),b=[],M=!1;return Promise.all(E.map(function(N){var R=N.style.getPropertyValue("src");return w(R,g).then(function(F){F.hasChanges&&(t.changeFontFaceRuleSrc(v,N,F.srcDeclarationValue),M=!0),b=b.concat(F.errors)})})).then(function(){return{hasChanges:M,errors:b}})};e.loadAndInlineCSSResourcesForRules=function(v,g){var E=!1,b=[];return Promise.all([S,x].map(function(M){return M(v,g).then(function(N){E=E||N.hasChanges,b=b.concat(N.errors)})})).then(function(){return{hasChanges:E,errors:b}})}}(wv)),wv}var H3;function AC(){return H3||(H3=1,function(e){var r=l0(),t=SC(),n=xC(),a=OC(),i=Lm(),o=function(w){return r.joinUrl(w,".")},s=function(w){var x=w.map(function(v,g){return g===w.length-1&&(v={baseUrl:o(v.baseUrl)}),JSON.stringify(v)});return x},c=function(w,x){return x.cache!==!1&&x.cache!=="none"&&x.cacheBucket?r.memoize(w,s,x.cacheBucket):w},u=function(w,x,v){var g=i.rulesForCssText(w);return a.loadCSSImportsForRules(g,x,v).then(function(E){return a.loadAndInlineCSSResourcesForRules(g,v).then(function(b){var M=E.errors.concat(b.errors),N=E.hasChanges||b.hasChanges;return N&&(w=i.cssRulesToText(g)),{hasChanges:N,content:w,errors:M}})})},d=function(w,x,v){var g=w.textContent,E=c(u,x);return E(g,v,x).then(function(b){return b.hasChanges&&(w.childNodes[0].nodeValue=b.content),r.cloneArray(b.errors)})},p=function(w){var x=w.getElementsByTagName("style");return Array.prototype.filter.call(x,function(v){return!v.attributes.type||v.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(w,x){var v=p(w),g=[],E=[],b;return b=r.clone(x),b.baseUrl=b.baseUrl||r.getDocumentBaseUrl(w),Promise.all(v.map(function(M){return d(M,b,E).then(function(N){g=g.concat(N)})})).then(function(){return g})};var y=function(w,x){var v=w.parentNode,g;x=x.trim(),x&&(g=w.ownerDocument.createElement("style"),g.type="text/css",g.appendChild(w.ownerDocument.createTextNode(x)),v.insertBefore(g,w)),v.removeChild(w)},f=function(w,x){return r.ajax(w,x).then(function(v){var g=i.rulesForCssText(v);return{content:v,cssRules:g}}).then(function(v){var g=a.adjustPathsOfCssResources(w,v.cssRules);return{content:v.content,cssRules:v.cssRules,hasChanges:g}}).then(function(v){return a.loadCSSImportsForRules(v.cssRules,[],x).then(function(g){return{content:v.content,cssRules:v.cssRules,hasChanges:v.hasChanges||g.hasChanges,errors:g.errors}})}).then(function(v){return a.loadAndInlineCSSResourcesForRules(v.cssRules,x).then(function(g){return{content:v.content,cssRules:v.cssRules,hasChanges:v.hasChanges||g.hasChanges,errors:v.errors.concat(g.errors)}})}).then(function(v){var g=v.content;return v.hasChanges&&(g=i.cssRulesToText(v.cssRules)),{content:g,errors:v.errors}})},_=function(w,x){var v=w.attributes.href.value,g=r.getDocumentBaseUrl(w.ownerDocument),E=r.clone(x);!E.baseUrl&&g&&(E.baseUrl=g);var b=c(f,x);return b(v,E).then(function(M){return{content:M.content,errors:r.cloneArray(M.errors)}})},S=function(w){var x=w.getElementsByTagName("link");return Array.prototype.filter.call(x,function(v){return v.attributes.rel&&v.attributes.rel.value==="stylesheet"&&(!v.attributes.type||v.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(w,x){var v=S(w),g=[];return Promise.all(v.map(function(E){return _(E,x).then(function(b){y(E,b.content+`
|
|
156
|
+
`),g=g.concat(b.errors)},function(b){g.push({resourceType:"stylesheet",url:b.url,msg:"Unable to load stylesheet "+b.url})})})).then(function(){return g})},e.loadAndInlineImages=t.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(w,x){var v=[],g=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return x.inlineScripts!==!1&&g.push(e.loadAndInlineScript),Promise.all(g.map(function(E){return E(w,x).then(function(b){v=v.concat(b)})})).then(function(){return v})}}(vv)),vv}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
157
|
+
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
158
|
+
* Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var CC=b1.exports,V3;function kC(){return V3||(V3=1,function(e){(function(r,t){r===void 0&&window!==void 0&&(r=window),e.exports?e.exports=t(e_(),wC(),_C(),AC()):r.rasterizeHTML=t(r.url,r.xmlserializer,r.sanedomparsererror,r.inlineresources)})(CC,function(r,t,n,a){var i=function(_){var S={},w=[];S.joinUrl=function(g,E){return g?_.resolve(g,E):E},S.getConstantUniqueIdFor=function(g){return w.indexOf(g)<0&&w.push(g),w.indexOf(g)},S.clone=function(g){var E={},b;for(b in g)g.hasOwnProperty(b)&&(E[b]=g[b]);return E};var x=function(g){return typeof g=="object"&&g!==null},v=function(g){return x(g)&&Object.prototype.toString.apply(g).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return S.parseOptionalParameters=function(g){var E={canvas:null,options:{}};return g[0]==null||v(g[0])?(E.canvas=g[0]||null,E.options=S.clone(g[1])):E.options=S.clone(g[0]),E},S}(r),o=function(_){var S={},w=function(x,v,g){var E=x[v];return x[v]=function(){var b=Array.prototype.slice.call(arguments);return g.apply(this,[b,E])},E};return S.baseUrlRespectingXhr=function(x,v){var g=function(){var E=new x;return w(E,"open",function(b,M){var N=b.shift(),R=b.shift(),F=_.joinUrl(v,R);return M.apply(this,[N,F].concat(b))}),E};return g},S.finishNotifyingXhr=function(x){var v=0,g=0,E=!1,b,M=new Promise(function(R){b=function(){var F=v-g;F<=0&&E&&R({totalCount:v})}}),N=function(){var R=new x;return w(R,"send",function(F,j){return v+=1,j.apply(this,arguments)}),R.addEventListener("load",function(){g+=1,b()}),R};return N.waitForRequestsToFinish=function(){return E=!0,b(),M},N},S}(i),s=function(){var _={},S=function(N){return Array.prototype.slice.call(N)};_.addClassName=function(N,R){N.className+=" "+R},_.addClassNameRecursively=function(N,R){_.addClassName(N,R),N.parentNode!==N.ownerDocument&&_.addClassNameRecursively(N.parentNode,R)};var w=function(N,R){var F=N.parentStyleSheet,j=S(F.cssRules).indexOf(N);F.insertRule(R,j+1),F.deleteRule(j)},x=function(N,R){var F=N.cssText.replace(/^[^\{]+/,""),j=R+" "+F;w(N,j)},v=function(N){return S(N).reduce(function(R,F){return R+F.cssText},"")},g=function(N){N.textContent=v(N.sheet.cssRules)},E=function(N){var R=document.implementation.createHTMLDocument(""),F=document.createElement("style");F.textContent=N.textContent,R.body.appendChild(F),N.sheet=F.sheet},b=function(N){return"((?:^|[^.#:\\w])|(?=\\W))("+N.join("|")+")(?=\\W|$)"},M=function(N,R,F){var j=b(R);S(N.querySelectorAll("style")).forEach(function(O){typeof O.sheet>"u"&&E(O);var C=S(O.sheet.cssRules).filter(function(A){return A.selectorText&&new RegExp(j,"i").test(A.selectorText)});C.length&&(C.forEach(function(A){var k=A.selectorText.replace(new RegExp(j,"gi"),function(T,V,G){return V+F(G)});k!==A.selectorText&&x(A,k)}),g(O))})};return _.rewriteCssSelectorWith=function(N,R,F){M(N,[R],function(){return F})},_.lowercaseCssTypeSelectors=function(N,R){M(N,R,function(F){return F.toLowerCase()})},_.findHtmlOnlyNodeNames=function(N){var R=N.ownerDocument.createTreeWalker(N,NodeFilter.SHOW_ELEMENT),F={},j={},O;do O=R.currentNode.tagName.toLowerCase(),R.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?F[O]=!0:j[O]=!0;while(R.nextNode());return Object.keys(F).filter(function(C){return!j[C]})},_}(),c=function(_){var S={},w=function(v){return Array.prototype.slice.call(v)},x={active:!0,hover:!0,focus:!1,target:!1};return S.fakeUserAction=function(v,g,E){var b=v.querySelector(g),M=":"+E,N="rasterizehtml"+E;b&&(x[E]?_.addClassNameRecursively(b,N):_.addClassName(b,N),_.rewriteCssSelectorWith(v,M,"."+N))},S.persistInputValues=function(v){var g=v.querySelectorAll("input"),E=v.querySelectorAll("textarea"),b=function(M){return M.type==="checkbox"||M.type==="radio"};w(g).filter(b).forEach(function(M){M.checked?M.setAttribute("checked",""):M.removeAttribute("checked")}),w(g).filter(function(M){return!b(M)}).forEach(function(M){M.setAttribute("value",M.value)}),w(E).forEach(function(M){M.textContent=M.value})},S.rewriteTagNameSelectorsToLowerCase=function(v){_.lowercaseCssTypeSelectors(v,_.findHtmlOnlyNodeNames(v))},S}(s),u=function(_,S,w,x){var v={},g=function(G,$,te,W){var U=G.createElement($);return U.style.visibility="hidden",U.style.width=te+"px",U.style.height=W+"px",U.style.position="absolute",U.style.top=-1e4-W+"px",U.style.left=-1e4-te+"px",G.getElementsByTagName("body")[0].appendChild(U),U},E=function(G){return G>0?new Promise(function($){setTimeout($,G)}):Promise.resolve()};v.executeJavascript=function(G,$){return new Promise(function(te){var W=g(x.document,"iframe",$.width,$.height),U=G.outerHTML,z=[],D=$.executeJsTimeout||0,Y=function(){x.document.getElementsByTagName("body")[0].removeChild(W)},Q=function(){var se=W.contentDocument;te({document:se,errors:z,cleanUp:Y})},J=W.contentWindow.XMLHttpRequest,Z=S.finishNotifyingXhr(J),ae=S.baseUrlRespectingXhr(Z,$.baseUrl);W.onload=function(){E(D).then(Z.waitForRequestsToFinish).then(Q)},W.contentDocument.open(),W.contentWindow.XMLHttpRequest=ae,W.contentWindow.onerror=function(se){z.push({resourceType:"scriptExecution",msg:se})},W.contentDocument.write("<!DOCTYPE html>"),W.contentDocument.write(U),W.contentDocument.close()})};var b=function(G,$,te){var W=G.createElement("iframe");return W.style.width=$+"px",W.style.height=te+"px",W.style.visibility="hidden",W.style.position="absolute",W.style.top=-1e4-te+"px",W.style.left=-1e4-$+"px",W.style.borderWidth=0,W.sandbox="allow-same-origin",W.scrolling="no",W},M=function(G,$,te){var W=Math.floor(G/te),U=Math.floor($/te);return b(x.document,W,U)},N=function(G,$,te,W){return{width:Math.max(G.width*W,$),height:Math.max(G.height*W,te)}},R=function(G,$){var te=G.querySelector($);if(te)return te;if(G.ownerDocument.querySelector($)===G)return G;throw{message:"Clipping selector not found"}},F=function(G,$,te,W,U){var z=Math.max(G.scrollWidth,G.clientWidth),D=Math.max(G.scrollHeight,G.clientHeight),Y,Q,J,Z,ae,se,ce,de;return $?(se=R(G,$),ce=se.getBoundingClientRect(),Y=ce.top,Q=ce.left,J=ce.width,Z=ce.height):(Y=0,Q=0,J=z,Z=D),de=N({width:J,height:Z},te,W,U),ae=x.getComputedStyle(G.ownerDocument.documentElement).fontSize,{left:Q,top:Y,width:de.width,height:de.height,viewportWidth:z,viewportHeight:D,rootFontSize:ae}},j=function(G,$){var te=G.tagName;return $.querySelector(te)},O=function(G){var $=G.tagName.toLowerCase();return $==="html"||$==="body"?G.outerHTML:'<body style="margin: 0;">'+G.outerHTML+"</body>"};v.calculateDocumentContentSize=function(G,$){return new Promise(function(te,W){var U=$.zoom||1,z;z=M($.width,$.height,U),x.document.getElementsByTagName("body")[0].appendChild(z),z.onload=function(){var D=z.contentDocument,Y;try{Y=F(j(G,D),$.clip,$.width,$.height,U),te(Y)}catch(Q){W(Q)}finally{x.document.getElementsByTagName("body")[0].removeChild(z)}},z.contentDocument.open(),z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(O(G)),z.contentDocument.close()})},v.parseHtmlFragment=function(G){var $=x.document.implementation.createHTMLDocument("");$.documentElement.innerHTML=G;var te=$.querySelector("body").firstChild;if(!te)throw"Invalid source";return te};var C=function(G,$){var te=/<html((?:\s+[^>]*)?)>/im.exec($),W=x.document.implementation.createHTMLDocument(""),U,z,D,Y;if(te)for(U="<div"+te[1]+"></div>",W.documentElement.innerHTML=U,D=W.querySelector("div"),z=0;z<D.attributes.length;z++)Y=D.attributes[z],G.documentElement.setAttribute(Y.name,Y.value)};v.parseHTML=function(G){var $=x.document.implementation.createHTMLDocument("");return $.documentElement.innerHTML=G,C($,G),$};var A=function(G){try{return w.failOnParseError(G)}catch($){throw{message:"Invalid source",originalError:$}}};v.validateXHTML=function(G){var $=new DOMParser,te=$.parseFromString(G,"application/xml");A(te)};var k=null,T=function(G,$){return $==="none"||$==="repeated"?((k===null||$!=="repeated")&&(k=Date.now()),G+"?_="+k):G},V=function(G,$){return new Promise(function(te,W){var U=new window.XMLHttpRequest,z=_.joinUrl($.baseUrl,G),D=T(z,$.cache),Y=function(Q){W({message:"Unable to load page",originalError:Q})};U.addEventListener("load",function(){U.status===200||U.status===0?te(U.responseXML):Y(U.statusText)},!1),U.addEventListener("error",function(Q){Y(Q)},!1);try{U.open("GET",D,!0),U.responseType="document",U.send(null)}catch(Q){Y(Q)}})};return v.loadDocument=function(G,$){return V(G,$).then(function(te){return A(te)})},v}(i,o,n,window),d=function(_){var S={},w=function(j,O){return O?URL.createObjectURL(new Blob([j],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(j)},x=function(j){j instanceof Blob&&URL.revokeObjectURL(j)},v='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',g=function(j){return new Promise(function(O,C){var A=document.createElement("canvas"),k=new Image;k.onload=function(){var T=A.getContext("2d");try{T.drawImage(k,0,0),A.toDataURL("image/png"),O(!0)}catch{O(!1)}},k.onerror=C,k.src=j})},E=function(){var j=w(v,!0);return g(j).then(function(O){return x(j),O?!1:g(w(v,!1)).then(function(C){return C})},function(){return!1})},b=function(){if(_.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},M=function(){return new Promise(function(j,O){b()&&_.URL?E().then(function(C){j(!C)},function(){O()}):j(!1)})},N,R=function(){return N===void 0&&(N=M()),N},F=function(j){return R().then(function(O){return w(j,O)})};return S.renderSvg=function(j){return new Promise(function(O,C){var A,k,T=function(){k.onload=null,k.onerror=null},V=function(){A&&x(A)};k=new Image,k.onload=function(){T(),V(),O(k)},k.onerror=function(){V(),C()},F(j).then(function(G){A=G,k.src=A},C)})},S}(window),p=function(_,S,w,x){var v={},g=function(j,O){var C=O||1,A={width:j.width,height:j.height,"font-size":j.rootFontSize};return C!==1&&(A.style="transform:scale("+C+"); transform-origin: 0 0;"),A},E=function(j){var O,C,A,k;O=Math.round(j.viewportWidth),C=Math.round(j.viewportHeight),A=-j.left,k=-j.top;var T={x:A,y:k,width:O,height:C};return T},b=function(j){var O=j.style||"";j.style=O+"float: left;"},M=function(j){j.externalResourcesRequired=!0},N=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},R=function(j){var O=Object.keys(j);return O.length?" "+O.map(function(C){return C+'="'+j[C]+'"'}).join(" "):""},F=function(j,O,C){var A=x.serializeToString(j);S.validateXHTML(A);var k=E(O);return b(k),M(k),'<svg xmlns="http://www.w3.org/2000/svg"'+R(g(O,C))+">"+N()+"<foreignObject"+R(k)+">"+A+"</foreignObject></svg>"};return v.getSvgForDocument=function(j,O,C){return w.rewriteTagNameSelectorsToLowerCase(j),F(j,O,C)},v.drawDocumentAsSvg=function(j,O){return["hover","active","focus","target"].forEach(function(C){O[C]&&w.fakeUserAction(j,O[C],C)}),S.calculateDocumentContentSize(j,O).then(function(C){return v.getSvgForDocument(j,C,O.zoom)})},v}(i,u,c,t),y=function(_,S,w,x,v,g){var E={},b=function(j){return{message:"Error rendering page",originalError:j}},M=function(j){return v.renderSvg(j).then(function(O){return{image:O,svg:j}},function(O){throw b(O)})},N=function(j,O){try{O.getContext("2d").drawImage(j,0,0)}catch(C){throw b(C)}},R=function(j,O,C){return x.drawDocumentAsSvg(j,C).then(M).then(function(A){return O&&N(A.image,O),A})},F=function(j,O){return S.executeJavascript(j,O).then(function(C){var A=C.document;return w.persistInputValues(A),{document:A,errors:C.errors,cleanUp:C.cleanUp}})};return E.rasterize=function(j,O,C){var A;return A=_.clone(C),A.inlineScripts=C.executeJs===!0,g.inlineReferences(j,A).then(function(k){return C.executeJs?F(j,C).then(function(T){return{element:T.document.documentElement,errors:k.concat(T.errors),cleanUp:T.cleanUp}}):{element:j,errors:k,cleanUp:function(){}}}).then(function(k){return R(k.element,O,C).then(function(T){return k.cleanUp(),{image:T.image,svg:T.svg,errors:k.errors}})})},E}(i,u,c,p,d,a),f=function(_,S,w){var x={},v=function(N,R){var F=300,j=200,O=N?N.width:F,C=N?N.height:j,A=R.width!==void 0?R.width:O,k=R.height!==void 0?R.height:C;return{width:A,height:k}},g=function(N){var R=v(N.canvas,N.options),F;return F=_.clone(N.options),F.width=R.width,F.height=R.height,F};x.drawDocument=function(){var N=arguments[0],R=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(R),j=N.documentElement?N.documentElement:N;return w.rasterize(j,F.canvas,g(F))};var E=function(N,R,F){var j=S.parseHTML(N);return x.drawDocument(j,R,F)};x.drawHTML=function(){var N=arguments[0],R=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(R);return E(N,F.canvas,F.options)};var b=function(N,R,F){var j=document.implementation.createHTMLDocument("");j.replaceChild(N.documentElement,j.documentElement);var O=F?_.clone(F):{};return F.baseUrl||(O.baseUrl=R),{document:j,options:O}},M=function(N,R,F){return S.loadDocument(N,F).then(function(j){var O=b(j,N,F);return x.drawDocument(O.document,R,O.options)})};return x.drawURL=function(){var N=arguments[0],R=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(R);return M(N,F.canvas,F.options)},x}(i,u,y);return f})}(b1)),b1.exports}var Ev={},G3;function LC(){return G3||(G3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.optimizeCss=function(t,n){if(!t.includes("@font-face"))return"";const a=new Set,i=new Set;n&&((n.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(p=>{const y=p.split(":")[1].trim();y==="bold"?a.add("700"):y==="normal"?a.add("400"):/^\d+$/.test(y)&&a.add(y)}),(n.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(p=>{p.split(":")[1].trim().toLowerCase()==="italic"&&i.add("italic")}),/<(b|strong)\b/i.test(n)&&a.add("700"),/<(i|em)\b/i.test(n)&&i.add("italic"));const o=(0,r.removeTags)(n);o&&o.trim()&&a.add("400"),a.size===0&&a.add("400");const s=a,c=i.has("italic"),u=Array.from(new Set(o)).map(p=>p.codePointAt(0)).filter(p=>p!==void 0),d=t.split(/}\s*/).map(p=>p&&p+"}").filter(p=>/@font-face/.test(p)&&(y=>{const f=(y.match(/font-weight:\s*(\d+)/)||[])[1];if(f&&!s.has(f)||/font-style:\s*italic/.test(y)&&!c)return!1;const _=y.match(/unicode-range:\s*([^;]+);/);if(!_)return!0;const S=_[1].split(",").map(w=>{const[x,v=x]=w.replace("U+","").split("-").map(g=>parseInt(g,16));return[x,v]});return u.some(w=>S.some(([x,v])=>w>=x&&w<=v))})(p)).join(`
|
|
159
|
+
`);return d?`<style>${d}</style>`:""};const r=pm()}(Ev)),Ev}var W3;function t_(){return W3||(W3=1,function(e){var r,t=ic&&ic.__createBinding||(Object.create?function(v,g,E,b){b===void 0&&(b=E);var M=Object.getOwnPropertyDescriptor(g,E);M&&!("get"in M?!g.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return g[E]}}),Object.defineProperty(v,b,M)}:function(v,g,E,b){b===void 0&&(b=E),v[b]=g[E]}),n=ic&&ic.__setModuleDefault||(Object.create?function(v,g){Object.defineProperty(v,"default",{enumerable:!0,value:g})}:function(v,g){v.default=g}),a=ic&&ic.__importStar||(r=function(v){return r=Object.getOwnPropertyNames||function(g){var E=[];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(E[E.length]=b);return E},r(v)},function(v){if(v&&v.__esModule)return v;var g={};if(v!=null)for(var E=r(v),b=0;b<E.length;b++)E[b]!=="default"&&t(g,v,E[b]);return n(g,v),g});Object.defineProperty(e,"__esModule",{value:!0}),e.prerenderFont=e.resetStyleContent=void 0,e.isContentWrapping=function({html:v}){const g=document.createElement("div");g.innerHTML=v,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000",g.style.whiteSpace="nowrap",g.style.visibility="hidden";const E=p();E.appendChild(g);const b=g.textContent,M=g.childNodes[0],N=(b==null?void 0:b.split(/\s+/))||[];let R=!1;for(let F=0;F<N.length;F++){const j=N[F];if(M&&(M.textContent=j,R=M.scrollWidth>g.clientWidth,R))break}return E.removeChild(g),R},e.detectSize=function(v){const g=document.createElement("div");g.innerHTML=v,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000";const E=p();E.appendChild(g);const b=g.getBoundingClientRect();return E.removeChild(g),{width:b.width,height:b.height}},e.htmlToCanvas=async function({html:v,width:g,height:E,fontFamily:b,padding:M,font:N,pixelRatio:R}){let F="";if(b!=="Arial"&&!N){const V=(0,o.getGoogleFontsVariants)();F=await async function(G,$){const te=`${G}|${$}`;if(x.has(te))return x.get(te);const W=`https://fonts.googleapis.com/css?family=${G}:${$}&display=swap`,U=await(await fetch(W)).text();return x.set(te,U),U}(b,V)}if(N){const V=N.styles||(N.url?[{src:`url("${N.url}")`}]:w(b));F="",V.forEach(G=>{F+=`
|
|
160
|
+
@font-face {
|
|
161
|
+
font-family: '${b}';
|
|
162
|
+
src: ${G.src};
|
|
163
|
+
font-style: ${G.fontStyle||"normal"};
|
|
164
|
+
font-weight: ${G.fontWeight||"normal"};
|
|
165
|
+
}
|
|
166
|
+
`})}let j="";F&&(j=(0,c.optimizeCss)(F,v)),v+=j+u;const O=g+2*M,C=E+2*M,A=document.createElement("canvas"),k=await i.drawHTML(`<div style="padding: ${M}px;" dir="auto">${v}</div>`,A,{width:O,height:C,cacheBucket:_});(0,s.trySetCanvasSize)(A,O*R,C*R);const T=A.getContext("2d");return T==null||T.drawImage(k.image,0,0,O,C,0,0,A.width,A.height),A};const i=a(kC()),o=Ih(),s=H8(),c=LC();e.resetStyleContent=`
|
|
167
|
+
p {
|
|
168
|
+
margin: 0;
|
|
169
|
+
padding: 0;
|
|
170
|
+
word-wrap: break-word; /* Required for Firefox */
|
|
171
|
+
/* a text may have several spaces, we need to preserve them */
|
|
172
|
+
white-space: pre-wrap;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Reset default list styles and setup counters */
|
|
176
|
+
ul, ol {
|
|
177
|
+
list-style: none; /* Remove default markers */
|
|
178
|
+
padding-inline-start: 0; /* Reset padding */
|
|
179
|
+
margin: 0;
|
|
180
|
+
display: block; /* Use block instead of inline-block for better text wrapping */
|
|
181
|
+
width: 100%;
|
|
182
|
+
text-decoration: inherit;
|
|
183
|
+
counter-reset: ol-counter; /* Initialize counter for ol */
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
li {
|
|
187
|
+
position: relative; /* Needed for absolute positioning of ::before */
|
|
188
|
+
padding-inline-start: 2.1em; /* Space for the marker (start side) */
|
|
189
|
+
margin: 0; /* Reset default li margins */
|
|
190
|
+
word-wrap: break-word; /* Required for Firefox text wrapping */
|
|
191
|
+
white-space: pre-wrap; /* Preserve spaces and allow wrapping */
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
li::before {
|
|
195
|
+
content: ''; /* Base content */
|
|
196
|
+
position: absolute;
|
|
197
|
+
/* Use logical properties for positioning */
|
|
198
|
+
inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
|
|
199
|
+
top: 0; /* Adjust vertical alignment */
|
|
200
|
+
/* Prevent letter-spacing from affecting the marker */
|
|
201
|
+
letter-spacing: normal;
|
|
202
|
+
/* Define width to ensure consistent spacing and alignment */
|
|
203
|
+
display: inline-block;
|
|
204
|
+
width: 2em; /* Width for the marker container */
|
|
205
|
+
/* Align multi-digit numbers to the end (right in LTR, left in RTL) */
|
|
206
|
+
text-align: end;
|
|
207
|
+
/* Space between marker and text (using logical property) */
|
|
208
|
+
margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
|
|
209
|
+
/* Prevent marker style from inheriting list item styles */
|
|
210
|
+
font-weight: normal;
|
|
211
|
+
font-style: normal;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* Style for bullet points */
|
|
215
|
+
ul > li::before {
|
|
216
|
+
content: '•'; /* Literal bullet character */
|
|
217
|
+
/* Center the bullet within its allocated width */
|
|
218
|
+
text-align: center; /* Override text-align: end for bullets */
|
|
219
|
+
font-size: 1.2em;
|
|
220
|
+
top: 0em; /* Re-adjust vertical alignment for bullet */
|
|
221
|
+
/* Bullets don't need number alignment, width can be tighter */
|
|
222
|
+
width: 2em;
|
|
223
|
+
/* Adjust margin to maintain overall padding */
|
|
224
|
+
margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Style for numbers using counter */
|
|
228
|
+
ol > li {
|
|
229
|
+
counter-increment: ol-counter; /* Increment counter for each li in ol */
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
ol > li::before {
|
|
233
|
+
content: counter(ol-counter) "."; /* Display counter value + dot */
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.ql-indent-1 {
|
|
237
|
+
margin-inline-start: 0.5em;
|
|
238
|
+
}
|
|
239
|
+
.ql-indent-2 {
|
|
240
|
+
margin-inline-start: 1em;
|
|
241
|
+
}
|
|
242
|
+
.ql-indent-3 {
|
|
243
|
+
margin-inline-start: 1.5em;
|
|
244
|
+
}
|
|
245
|
+
`;const u=`
|
|
246
|
+
<style>
|
|
247
|
+
html, body {
|
|
248
|
+
padding: 0;
|
|
249
|
+
margin: 0;
|
|
250
|
+
}
|
|
251
|
+
${e.resetStyleContent}
|
|
252
|
+
</style>
|
|
253
|
+
`;let d;const p=()=>(d||(d=document.createElement("div"),d.id="polotno-hidden-do-not-touch",d.style.overflow="hidden",d.style.position="relative",document.body.appendChild(d),d.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),d),y=new Map,f=navigator.userAgent.includes("Firefox");e.prerenderFont=async v=>{if(y.has(v))return y.get(v);const g=(async()=>{const E=`<div style="font-family: ${v}; font-size: 100px;">${v}<strong>${v}</strong></div>`,b=document.createElement("div");b.innerHTML=E,b.style.visibility="hidden",b.style.position="absolute";const M=p();M.appendChild(b);const N=f?180:50;await new Promise(R=>setTimeout(R,N)),M.removeChild(b)})();return y.set(v,g),g};const _={},S={},w=v=>{if(S[v])return S[v];const g=function(b){const M=[];for(let N=0;N<document.styleSheets.length;N++){const R=document.styleSheets[N];try{const F=R.cssRules;if(F)for(let j=0;j<F.length;j++){const O=F[j];O instanceof CSSFontFaceRule&&O.style.fontFamily.replace(/['"]/g,"")===b&&M.push(O)}}catch(F){console.warn(`Could not access stylesheet: ${R.href}`,F)}}return M}(v),E=g.filter(b=>b.style.fontFamily.replace(/['"]/g,"")===v).map(b=>({src:b.style.getPropertyValue("src"),fontStyle:b.style.getPropertyValue("font-style")||"normal",fontWeight:b.style.getPropertyValue("font-weight")||"normal"}));return S[v]=E,E},x=new Map}(ic)),ic}var nh={},Pv={},$3;function r_(){return $3||($3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=d,e.setup=function(w,x,v,g){i.p=x,p=w,y=v,f=g},e.styled=function(w,x){let v=this||{};return function(){let g=arguments;function E(b,M){let N=Object.assign({},b),R=N.className||E.className;v.p=Object.assign({theme:y&&y()},N),v.o=/ *go\d+/.test(R),N.className=d.apply(v,g)+(R?" "+R:""),x&&(N.ref=M);let F=w;return w[0]&&(F=N.as||w,delete N.as),f&&F[0]&&f(N),p(F,N)}return x?x(E):E}};let r={data:""},t=w=>typeof window=="object"?((w?w.querySelector("#_goober"):window._goober)||Object.assign((w||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:w||r,n=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,i=(w,x)=>{let v="",g="",E="";for(let b in w){let M=w[b];b[0]=="@"?b[1]=="i"?v=b+" "+M+";":g+=b[1]=="f"?i(M,b):b+"{"+i(M,b[1]=="k"?"":x)+"}":typeof M=="object"?g+=i(M,x?x.replace(/([^,])+/g,N=>b.replace(/(^:.*)|([^,])+/g,R=>/&/.test(R)?R.replace(/&/g,N):N?N+" "+R:R)):b):M!=null&&(b=b.replace(/[A-Z]/g,"-$&").toLowerCase(),E+=i.p?i.p(b,M):b+":"+M+";")}return v+(x&&E?x+"{"+E+"}":E)+g},o={},s=w=>{if(typeof w=="object"){let x="";for(let v in w)x+=v+s(w[v]);return x}return w},c=(w,x,v,g,E)=>{let b=s(w),M=o[b]||(o[b]=(N=>{let R=0,F=11;for(;R<N.length;)F=101*F+N.charCodeAt(R++)>>>0;return"go"+F})(b));if(!o[M]){let N=b!==w?w:(R=>{let F,j=[{}];for(;F=n.exec(R.replace(a,""));)F[4]?j.shift():F[3]?j.unshift(j[0][F[3]]=j[0][F[3]]||{}):j[0][F[1]]=F[2];return j[0]})(w);o[M]=i(E?{["@keyframes "+M]:N}:N,v?"":"."+M)}return((N,R,F)=>{R.data.indexOf(N)==-1&&(R.data=F?N+R.data:R.data+N)})(o[M],x,g),M},u=(w,x,v)=>w.reduce((g,E,b)=>{let M=x[b];if(M&&M.call){let N=M(v),R=N&&N.props&&N.props.className||/^go/.test(N)&&N;M=R?"."+R:N&&typeof N=="object"?N.props?"":i(N,""):N===!1?"":N}return g+E+(M??"")},"");function d(w){let x=this||{},v=w.call?w(x.p):w;return c(v.unshift?v.raw?u(v,[].slice.call(arguments,1),x.p):v.reduce((g,E)=>Object.assign(g,E&&E.call?E(x.p):E),{}):v,t(x.target),x.g,x.o,x.k)}e.extractCss=w=>{let x=t(w),v=x.data;return x.data="",v};let p,y,f,_=d.bind({g:1}),S=d.bind({k:1});e.glob=_,e.keyframes=S}(Pv)),Pv}var Y3;function NC(){if(Y3)return nh;Y3=1;var e=nh&&nh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(nh,"__esModule",{value:!0});const r=e(ni()),t=r_();return(0,t.setup)(r.default.createElement),nh.default=t.styled,nh}var X3;function TC(){return X3||(X3=1,function(e){var r,t=Dl&&Dl.__createBinding||(Object.create?function(T,V,G,$){$===void 0&&($=G);var te=Object.getOwnPropertyDescriptor(V,G);te&&!("get"in te?!V.__esModule:te.writable||te.configurable)||(te={enumerable:!0,get:function(){return V[G]}}),Object.defineProperty(T,$,te)}:function(T,V,G,$){$===void 0&&($=G),T[$]=V[G]}),n=Dl&&Dl.__setModuleDefault||(Object.create?function(T,V){Object.defineProperty(T,"default",{enumerable:!0,value:V})}:function(T,V){T.default=V}),a=Dl&&Dl.__importStar||(r=function(T){return r=Object.getOwnPropertyNames||function(V){var G=[];for(var $ in V)Object.prototype.hasOwnProperty.call(V,$)&&(G[G.length]=$);return G},r(T)},function(T){if(T&&T.__esModule)return T;var V={};if(T!=null)for(var G=r(T),$=0;$<G.length;$++)G[$]!=="default"&&t(V,T,G[$]);return n(V,T),V}),i=Dl&&Dl.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0;const o=i(ni()),s=Us,c=Fu,u=i(FA()),d=a(vs),p=gc(),y=Ap(),f=z8(),_=Op(),S=t_(),w=If(),x=Mh,v=i(NC()),g=jf(),E=pm(),b=a(Ih()),M=rf(),N=q8(),R=vs,F=V8();e.quillRef=d.observable({enabled:!1,currentFormat:{},editor:d.observable.object({instance:null},{},{deep:!1})});const j=(0,v.default)("div",o.default.forwardRef)`
|
|
254
|
+
.ql-editor {
|
|
255
|
+
outline: none;
|
|
256
|
+
}
|
|
257
|
+
.ql-clipboard {
|
|
258
|
+
pointer-events: none;
|
|
259
|
+
}
|
|
260
|
+
${S.resetStyleContent}
|
|
261
|
+
strong {
|
|
262
|
+
font-weight: 700;
|
|
263
|
+
}
|
|
264
|
+
.ql-direction-rtl {
|
|
265
|
+
direction: rtl;
|
|
266
|
+
}
|
|
267
|
+
`;let O=["bold","color","font","italic","size","strike","underline","indent","list","direction"];e.setQuillFormats=T=>{O=T},e.createQuill=T=>new u.default(T,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:O}),e.setQuillContent=(T,V)=>{var G=T.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+V+"<p><br></p></div>");T.setContents(G),T.history.clear()};const C=({html:T,onBlur:V,onChange:G,element:$})=>{const te=o.default.useRef(null);o.default.useEffect(()=>{if(!te.current)return;const U=(0,e.createQuill)(te.current);return d.runInAction(()=>{e.quillRef.editor.instance=U}),window.__polotnoQuill=U,U.on("text-change",()=>{U.getSelection()&&d.runInAction(()=>{e.quillRef.currentFormat=U.getFormat()}),setTimeout(()=>{var z;const D=(z=te.current)===null||z===void 0?void 0:z.childNodes[0];G(D.innerHTML)},10)}),U.setSelection(0,0,"api"),U.on("selection-change",(z,D,Y)=>{z&&d.runInAction(()=>{e.quillRef.currentFormat=U.getFormat()})}),te.current.childNodes[0].addEventListener("blur",z=>{var D;if(!((D=z.relatedTarget)===null||D===void 0)&&D.classList.contains("ql-clipboard"))return;(function(Q){return!!Q&&!!Q.closest(".sketch-picker")})(z.relatedTarget)||V()}),()=>{d.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),o.default.useEffect(()=>(0,R.reaction)(()=>$.text,()=>{var U;const z=e.quillRef.editor.instance;if(!z)return;const D=z.getSelection();((U=te.current)===null||U===void 0?void 0:U.childNodes[0].innerHTML)===$.text||((0,e.setQuillContent)(z,T),D&&(z.setSelection(D.index,D.length),d.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()})))},{fireImmediately:!0}),[]);const W={color:$.fill};return $.fill.indexOf("gradient")>=0&&(W.backgroundColor=$.fill,W.backgroundImage=$.fill,W.backgroundSize="100% 100%",W.backgroundRepeat="repeat",W.webkitBackgroundClip="text",W.MozBackgroundClip="text",W.WebkitTextFillColor="transparent",W.MozTextFillColor="transparent"),o.default.createElement(j,{ref:te,style:Object.assign(Object.assign({},W),{fontSize:$.fontSize,fontWeight:$.fontWeight,width:$.a.width,fontFamily:'"'+$.fontFamily+'"',lineHeight:$.lineHeight,letterSpacing:$.letterSpacing*$.fontSize+"px",textAlign:$.align,opacity:Math.max($.a.opacity,.2)}),dir:(0,f.getDir)((0,E.removeTags)($.text))})};function A(T,{fontFamily:V="",color:G="black"}={}){let $=`color: ${G||T.fill}`;return T.fill.indexOf("gradient")>=0&&($=`
|
|
268
|
+
background-color: ${G};
|
|
269
|
+
background-image: ${T.fill};
|
|
270
|
+
background-size: 100% 100%;
|
|
271
|
+
background-repeat: repeat;
|
|
272
|
+
-webkit-background-clip: text;
|
|
273
|
+
-moz-background-clip: text;
|
|
274
|
+
-webkit-text-fill-color: transparent;
|
|
275
|
+
-moz-text-fill-color: transparent;
|
|
276
|
+
`),`<div style="${["white-space: pre-wrap",`width: ${Math.round(T.width||100)}px`,$,`font-size: ${T.fontSize}px`,`font-family: '${V}'`,`text-align: ${T.align}`,T.textDecoration?`text-decoration: ${T.textDecoration}; text-decoration-color: ${G||T.fill}; text-decoration-layer: over`:"",T.lineHeight?`line-height: ${T.lineHeight}`:"",T.letterSpacing?`letter-spacing: ${T.letterSpacing*T.fontSize}px`:"",T.fontStyle?`font-style: ${T.fontStyle}`:"",T.fontWeight?`font-weight: ${T.fontWeight}`:"",T.strokeWidth?`-webkit-text-stroke: ${T.strokeWidth}px ${T.stroke}`:"",T.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,f.getDir)((0,E.removeTags)(T.text))}">${(0,E.sanitizeHtml)(T.text).replace(/\n/g,"</br>")}</div>`}const k=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,s.observer)(({element:T,store:V})=>{const G=o.default.useRef(null),[$,te]=o.default.useState(),[W,U]=o.default.useState(!1),[z,D]=o.default.useState(!1),Y=o.default.useRef(T.height),Q=V.selectedShapes.indexOf(T)>=0&&T.selectable,J=T.fontSize/3,{textVerticalResizeEnabled:Z}=p.flags,ae=(0,f.usePrevious)(T.fontFamily),[se]=(0,f.useFontLoader)(V,T.fontFamily),ce=T._editModeEnabled;(0,w.useFadeIn)(G);const de=se?T.fontFamily:ae!==T.fontFamily?ae:"Arial",Oe=(0,_.useColor)(T).fill,Le=A(T,{fontFamily:de,color:Oe}),{width:ke,height:Se}=function(rt,vt,et){return o.default.useMemo(()=>(0,S.detectSize)(rt),[rt,vt.width,et])}(Le,T,se);o.default.useEffect(()=>{if(!se)return;if(!T.height)return void T.set({height:Se});const{textOverflow:rt}=p.flags;if(rt!=="change-font-size"||W)rt==="resize"&&(Z&&T.height<Se&&V.history.ignore(()=>{T.set({height:Se})}),Z||T.height===Se||V.history.ignore(()=>{T.set({height:Se})}));else{const vt=(et=>{let yt=et.fontSize;for(let mt=1;mt<50;mt++){const ct=A(Object.assign(Object.assign({},et.toJSON()),{fontSize:yt}),{fontFamily:et.fontFamily}),{height:Bt}=(0,S.detectSize)(ct),Pt=et.height&&Bt>et.height,Yt=(0,S.isContentWrapping)({html:ct});if(!Pt&&!Yt)break;yt-=.5}return yt})(T);vt!==T.fontSize?V.history.ignore(()=>{T.set({fontSize:vt})}):T.height!==Se&&(Z&&T.height<Se?V.history.ignore(()=>{T.set({height:Se})}):Z||V.history.ignore(()=>{T.set({height:Se})}))}});const ye=o.default.useMemo(()=>{const rt={lastArgs:null,lastResult:null};return async function(vt){return rt.lastArgs&&rt.lastResult&&(et=rt.lastArgs,yt=vt,JSON.stringify(et)===JSON.stringify(yt))||(rt.lastResult=await(0,S.htmlToCanvas)(vt),rt.lastArgs=Object.assign({},vt)),rt.lastResult;var et,yt}},[]),Je=o.default.useRef(0),we=o.default.useRef(null);o.default.useEffect(()=>{W||ce||(async()=>{Je.current++;const rt=Je.current;let vt=(0,g.incrementLoader)(`text ${T.id} ${rt}`);we.current&&we.current(),we.current=vt,D(!0);let et=null;const yt=k?5:1;for(let mt=0;mt<yt;mt++){const ct=mt>0?ye:S.htmlToCanvas;try{if(et=await ct({skipCache:mt>0,html:Le,width:T.width||1,height:T.height||Se||1,fontFamily:de,padding:J,pixelRatio:V._elementsPixelRatio,font:V.fonts.find(Bt=>Bt.fontFamily===de)||b.globalFonts.find(Bt=>Bt.fontFamily===de)}),rt!==Je.current)return;if(!function(Bt){const Pt=Bt.getContext("2d").getImageData(0,0,Bt.width,Bt.height).data;for(let Yt=0;Yt<Pt.length;Yt+=4)if(Pt[Yt+3]!==0)return!0;return!1}(et)&&k){await new Promise(Bt=>setTimeout(Bt,50*(mt+1)));continue}break}catch(Bt){console.error(Bt),(0,g.triggerLoadError)(`Error rendering rich text with id ${T.id}`);break}}et?te(et):vt?(vt(),vt=null):console.error("Finish function is called twice!"),D(!1)})()},[Le,W,Se,ce,de,T.height,V._elementsPixelRatio,se]);const[me,Ee]=(0,F.useDelayer)(z,300),[Te]=(0,F.useDelayer)(W,300,!0),he=Te||me;o.default.useEffect(()=>{if(!he)return d.autorun(()=>{const rt=G.current;(0,y.applyFilter)(rt,T)})},[$,he,T.shadowColor,T.shadowOffsetX,T.shadowOffsetY,T.shadowOpacity]),o.default.useEffect(()=>{$&&!z&&we.current&&(we.current(),we.current=null)},[$,z]),o.default.useEffect(()=>()=>{we.current&&we.current()},[]);let Re=0;T.verticalAlign==="middle"&&(Re=(T.height-Se)/2),T.verticalAlign==="bottom"&&(Re=T.height-Se);const Ie=(0,f.getLineHeight)({fontLoaded:se,fontFamily:T.fontFamily,fontSize:T.fontSize,lineHeight:T.lineHeight}),Xe=(0,M.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,o.default.createElement(c.Rect,{x:T.a.x,y:T.a.y,offsetX:T.backgroundPadding*(T.fontSize*Ie*.5),offsetY:T.backgroundPadding*(T.fontSize*Ie*.5),rotation:T.a.rotation,hideInExport:!T.showInExport,listening:!1,visible:T.backgroundEnabled,opacity:T.backgroundOpacity*T.a.opacity,fill:T.backgroundColor,width:T.a.width+T.backgroundPadding*(T.fontSize*Ie),height:T.a.height+T.backgroundPadding*(T.fontSize*Ie),cornerRadius:T.backgroundCornerRadius*(T.fontSize*Ie*.5)}),o.default.createElement(c.Rect,{ref:G,name:"element",x:T.a.x,y:T.a.y,listening:T.selectable,rotation:T.a.rotation,width:T.a.width,height:T.a.height,visible:!he,draggable:Xe?T.draggable&&Q:T.draggable,preventDefault:!Xe||Q,opacity:ce?0:T.a.opacity,hideInExport:!T.showInExport,onDragMove:rt=>{T.set({x:rt.target.x(),y:rt.target.y()})},onDragEnd:rt=>{T.set({x:rt.target.x(),y:rt.target.y()})},id:T.id,onDblClick:()=>{T.contentEditable&&T.toggleEditMode(!0)},onDblTap:()=>{T.contentEditable&&T.toggleEditMode(!0)},onTransformStart:rt=>{U(!0),Y.current=T.height},onTransform:rt=>{var vt;const et=rt.target,yt=((vt=et.getStage())===null||vt===void 0?void 0:vt.findOne("Transformer")).getActiveAnchor(),mt=yt==="middle-left"||yt==="middle-right",ct=yt==="top-center"||yt==="bottom-center",Bt=et.scaleX();if(mt){const Pt=et.scaleX(),Yt=Math.max(et.width()*Pt,T.fontSize);if(et.width(Yt),et.scaleX(1),p.flags.textVerticalResizeEnabled){const Gt=Math.max(Se,Y.current);T.set({height:Gt})}T.set({width:Yt,x:et.x(),y:et.y()})}else if(ct){let Pt=p.flags.textOverflow==="resize"?Se:T.lineHeight*T.fontSize;const Yt=Math.max(Pt,rt.target.height()*rt.target.scaleY());et.scaleY(1),T.set({x:et.x(),y:et.y(),height:Yt,rotation:et.rotation()})}else et.scaleX(1),et.scaleY(1),T.set({fontSize:T.fontSize*Bt,letterSpacing:T.letterSpacing,width:et.width()*Bt,x:et.x(),y:et.y(),rotation:et.rotation(),height:et.height()*Bt})},onTransformEnd:rt=>{U(!1),D(!0);const vt=rt.target.scaleX();rt.target.scaleX(1),rt.target.scaleY(1),T.set({fontSize:T.fontSize*vt,width:rt.target.width()*vt,x:rt.target.x(),y:rt.target.y(),rotation:rt.target.rotation(),shadowBlur:T.shadowBlur*vt,shadowOffsetX:T.shadowOffsetX*vt,shadowOffsetY:T.shadowOffsetY*vt,strokeWidth:T.strokeWidth*vt})}}),o.default.createElement(c.Image,{ref:G,image:$,x:T.a.x,y:T.a.y,offsetX:J,offsetY:J-Re,listening:!1,rotation:T.a.rotation,width:T.a.width+2*J,height:T.a.height+2*J,visible:!he,opacity:ce?0:T.a.opacity,shadowEnabled:T.shadowEnabled,shadowBlur:T.shadowBlur,shadowOffsetX:T.shadowOffsetX,shadowOffsetY:T.shadowOffsetY,shadowColor:T.shadowColor,shadowOpacity:T.shadowOpacity,hideInExport:!T.showInExport}),he&&o.default.createElement(c.Group,{x:T.a.x,y:T.a.y,rotation:T.a.rotation,offsetY:-Re},o.default.createElement(x.Html,{divProps:{style:{pointerEvents:"none"}}},o.default.createElement(j,{dangerouslySetInnerHTML:{__html:Le},style:{pointerEvents:"none",opacity:T.a.opacity}}))),ce&&o.default.createElement(c.Group,{x:T.a.x,y:T.a.y,rotation:T.a.rotation,offsetY:-Re},o.default.createElement(x.Html,null,o.default.createElement(C,{html:Le,element:T,onChange:rt=>{const vt=(0,N.getLimitedFontSize)({oldText:(0,E.removeTags)(T.text),newText:(0,E.removeTags)(rt),element:T});T.set({text:rt,fontSize:vt})},onBlur:rt=>{T.toggleEditMode(!1),Ee(!0),(0,E.removeTags)(T.text)===""&&T.removable&&!T.placeholder&&V.deleteElements([T.id])}}))))})}(Dl)),Dl}var Wd={},$d={},Ov={},K3;function Dh(){return K3||(K3=1,function(e){function r(o){return o/180*Math.PI}function t(o,s,c,u,d){const p=Math.sqrt(c*c+u*u);return d+=Math.atan2(u,c),{x:o+p*Math.cos(d),y:s+p*Math.sin(d)}}function n(o){const{x:s,y:c,width:u,height:d}=o,p=r(o.rotation),y=t(s,c,0,0,p),f=t(s,c,u,0,p),_=t(s,c,u,d,p),S=t(s,c,0,d,p),w=Math.min(y.x,f.x,_.x,S.x),x=Math.min(y.y,f.y,_.y,S.y),v=Math.max(y.x,f.x,_.x,S.x),g=Math.max(y.y,f.y,_.y,S.y);return{x:w,y:x,width:v-w,height:g-x,minX:w,minY:x,maxX:v,maxY:g}}function a(o){const s=r(o.rotation||0);return{x:o.x+o.width/2*Math.cos(s)+o.height/2*Math.sin(-s),y:o.y+o.height/2*Math.cos(s)+o.width/2*Math.sin(s)}}function i(o,s,c){const u=r(s),d=c.x+(o.x-c.x)*Math.cos(u)-(o.y-c.y)*Math.sin(u),p=c.y+(o.x-c.x)*Math.sin(u)+(o.y-c.y)*Math.cos(u);return Object.assign(Object.assign({},o),{rotation:o.rotation+s,x:d,y:p})}Object.defineProperty(e,"__esModule",{value:!0}),e.degToRad=r,e.getClientRect=n,e.getTotalClientRect=function(o){const s=o.map(y=>n(y)),c=Math.min(...s.map(y=>y.minX)),u=Math.min(...s.map(y=>y.minY)),d=Math.max(...s.map(y=>y.maxX)),p=Math.max(...s.map(y=>y.maxY));return{x:c,y:u,width:d-c,height:p-u,minX:c,minY:u,maxX:d,maxY:p}},e.getCenter=a,e.rotateAroundPoint=i,e.rotateAroundCenter=function(o,s){return i(o,s,a(o))}}(Ov)),Ov}var Z3;function n_(){return Z3||(Z3=1,function(e){var r=$d&&$d.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.setSnapFilterFunc=void 0,e.useSnap=function(u,d){const p=t.default.useRef(null),y=v=>v.hasName("element")||v.hasName("page-background")||!p.current&&v.hasName("elements-area");function f(v){var g;const E=(g=u.current)===null||g===void 0?void 0:g.getStage(),b=[],M=[];return E.find(y).forEach(N=>{if(!(v.indexOf(N)>=0)){var R=N.getClientRect({skipShadow:!0,skipStroke:!0});b.push({offset:R.x,node:N,snap:"start"},{offset:R.x+R.width,node:N,snap:"end"},{offset:R.x+R.width/2,node:N,snap:"center"}),M.push({offset:R.y,node:N,snap:"start"},{offset:R.y+R.height,node:N,snap:"end"},{offset:R.y+R.height/2,node:N,snap:"center"})}}),{vertical:b,horizontal:M}}function _(v){var g;const E=(g=u.current)===null||g===void 0?void 0:g.getLayer(),b=E==null?void 0:E.children.find(M=>M.name()==="line-guides");v.forEach(M=>{if(M.orientation==="H"){var N=new n.default.Line({x:-E.getStage().x(),y:-E.getStage().y(),points:[-6e3,M.lineGuide,6e3,M.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});b==null||b.add(N),E.batchDraw()}else M.orientation==="V"&&(N=new n.default.Line({x:-E.getStage().x(),y:-E.getStage().y(),points:[M.lineGuide,-6e3,M.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),b==null||b.add(N))})}const S=v=>{const g=v.target.getLayer().children.find(O=>O.name()==="line-guides");g==null||g.destroyChildren();var E=f(v.target.nodes()),b=function(O){const C=O.__getNodeRect(),A=(0,a.getClientRect)(Object.assign(Object.assign({},C),{rotation:n.default.Util.radToDeg(C.rotation)})),k=O.getAbsolutePosition();return{vertical:[{guide:A.x,offset:k.x-A.x,snap:"start",nodes:O.nodes()},{guide:A.x+A.width/2,offset:k.x-A.x-A.width/2,snap:"center",nodes:O.nodes()},{guide:A.x+A.width,offset:k.x-A.x-A.width,snap:"end",nodes:O.nodes()}],horizontal:[{guide:A.y,offset:k.y-A.y,snap:"start",nodes:O.nodes()},{guide:A.y+A.height/2,offset:k.y-A.y-A.height/2,snap:"center",nodes:O.nodes()},{guide:A.y+A.height,offset:k.y-A.y-A.height,snap:"end",nodes:O.nodes()}]}}(v.target),M=o(E,b);if(!M.length)return;_(M);const N=v.target.getAbsolutePosition(),R=(v.target.nodes().map(O=>O.getAbsolutePosition()),Object.assign({},N));M.forEach(O=>{switch(O.snap){case"start":case"center":case"end":switch(O.orientation){case"V":R.x=O.lineGuide+O.offset;break;case"H":R.y=O.lineGuide+O.offset}}});const F=R.x-N.x,j=R.y-N.y;v.evt.ctrlKey||v.evt.metaKey||v.target.nodes().forEach(O=>{const C=O.getAbsolutePosition();O.setAbsolutePosition({x:C.x+F,y:C.y+j})})},w=(v,g,E)=>{var b;const M=u.current,N=M.getLayer().children.find(V=>V.name()==="line-guides");if(N==null||N.destroyChildren(),M.getActiveAnchor()==="rotater")return g;const R=M.getActiveAnchor(),F=c[R],j=(b=M.findOne(`.${F}`))===null||b===void 0?void 0:b.getAbsolutePosition();if(!j)return g;const O={x:v.x-j.x,y:v.y-j.y},C=function(V,G){const $=s(V,G)/s(G,G);return{x:$*G.x,y:$*G.y}}({x:g.x-v.x,y:g.y-v.y},O),A={x:v.x+C.x,y:v.y+C.y};var k=o(f(M.nodes()),{vertical:[{guide:A.x,offset:0,snap:"start",nodes:M.nodes()}],horizontal:[{guide:A.y,offset:0,snap:"start",nodes:M.nodes()}]});if(!k.length||(_(k),E.ctrlKey||E.metaKey))return g;const T=[];if(k.forEach(V=>{const G=function($,te,W){if(W.orientation==="V"){const U=W.lineGuide;if(Math.abs(te.x-$.x)<1e-4)return null;const z=(te.y-$.y)/(te.x-$.x);return{x:U,y:z*U+($.y-z*$.x)}}{const U=W.lineGuide;if(Math.abs(te.y-$.y)<1e-4)return null;const z=(te.y-$.y)/(te.x-$.x);return{x:(U-$.y)/z+$.x,y:U}}}(A,j,{orientation:V.orientation,lineGuide:V.lineGuide});G&&T.push(G)}),T.length>0){let V=T[0],G=Math.sqrt(Math.pow(A.x-V.x,2)+Math.pow(A.y-V.y,2));if(T.forEach($=>{const te=Math.sqrt(Math.pow(A.x-$.x,2)+Math.pow(A.y-$.y,2));te<G&&(G=te,V=$)}),G<10)return V}return A},x=v=>{if(!v.target)return;const g=v.target.getLayer(),E=g.children.find(b=>b.name()==="line-guides");E==null||E.destroyChildren(),g.batchDraw()};t.default.useEffect(()=>{u.current&&(u.current.anchorDragBoundFunc(w),u.current.on("dragstart",v=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const g=[...n.default.DD._dragElements.entries()],E=g.find(([b,M])=>M.node instanceof n.default.Transformer);E&&(g.splice(g.indexOf(E),1),g.unshift(E),n.default.DD._dragElements.clear(),g.forEach(([b,M])=>{n.default.DD._dragElements.set(b,M)}))})}),u.current.on("dragmove",S),u.current.on("dragend",x),u.current.on("transformend",x),u.current.on("transform",v=>{var g,E;v.evt.ctrlKey||v.evt.metaKey?(g=u.current)===null||g===void 0||g.rotationSnapTolerance(0):(E=u.current)===null||E===void 0||E.rotationSnapTolerance(5)}))},[])},e.useAnchorSnap=function(u,d,p){const y=S=>S.hasName("element")||S.hasName("line-anchor")||S.hasName("page-background")||S.hasName("elements-area"),f=S=>{const w=S.target.getLayer().children.find(N=>N.name()==="line-guides");w==null||w.destroyChildren();var x,v=o(function(N){var R;const F=(R=u.current)===null||R===void 0?void 0:R.getStage();var j=[],O=[];return F.find(y).forEach(C=>{if(!(N.indexOf(C)>=0)){var A=C.getClientRect({skipShadow:!0,skipStroke:!0});C.hasName("line-anchor")&&(A={x:C.absolutePosition().x,y:C.absolutePosition().y,width:0,height:0}),j.push({offset:A.x,node:C,snap:"start"},{offset:A.x+A.width,node:C,snap:"end"},{offset:A.x+A.width/2,node:C,snap:"center"}),O.push({offset:A.y,node:C,snap:"start"},{offset:A.y+A.height,node:C,snap:"end"},{offset:A.y+A.height/2,node:C,snap:"center"})}}),{vertical:j,horizontal:O}}([S.target,...d.map(N=>N.current)]),{vertical:[{guide:(x=S.target).absolutePosition().x,offset:0,snap:"center",nodes:[x]}],horizontal:[{guide:x.absolutePosition().y,offset:0,snap:"center",nodes:[x]}]});if(!v.length)return;(function(N){var R;const F=(R=u.current)===null||R===void 0?void 0:R.getLayer(),j=F==null?void 0:F.children.find(O=>O.name()==="line-guides");N.forEach(O=>{if(O.orientation==="H"){var C=new n.default.Line({points:[-6e3,O.lineGuide,6e3,O.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});j==null||j.add(C),F.batchDraw()}else O.orientation==="V"&&(C=new n.default.Line({points:[O.lineGuide,-6e3,O.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),j==null||j.add(C))})})(v);const g=S.target.getAbsolutePosition(),E=Object.assign({},g);v.forEach(N=>{switch(N.snap){case"start":case"center":case"end":switch(N.orientation){case"V":E.x=N.lineGuide+N.offset;break;case"H":E.y=N.lineGuide+N.offset}}});const b=E.x-g.x,M=E.y-g.y;if(!S.evt.ctrlKey&&!S.evt.metaKey){const N=S.target.getAbsolutePosition();S.target.absolutePosition({x:N.x+b,y:N.y+M})}},_=S=>{if(!S.target)return;const w=S.target.getLayer(),x=w.children.find(v=>v.name()==="line-guides");x==null||x.destroyChildren(),w.batchDraw()};t.default.useEffect(()=>{u.current&&(u.current.on("dragmove",f),u.current.on("dragend",_))},p)};const t=r(ni()),n=r(Hs()),a=Dh();let i=({targetKonvaNodes:u,guideKonvaNode:d,distance:p,snapDirection:y})=>p<5;function o(u,d){var p=[],y=[];u.vertical.forEach(v=>{d.vertical.forEach(g=>{var E=Math.abs(v.offset-g.guide);i({targetKonvaNodes:g.nodes,guideKonvaNode:v.node,distance:E,snapDirection:v.snap})&&p.push({lineGuide:v.offset,diff:E,snap:g.snap,offset:g.offset})})}),u.horizontal.forEach(v=>{d.horizontal.forEach(g=>{var E=Math.abs(v.offset-g.guide);i({targetKonvaNodes:g.nodes,guideKonvaNode:v.node,distance:E,snapDirection:v.snap})&&y.push({lineGuide:v.offset,diff:E,snap:g.snap,offset:g.offset})})});var f=[];const _=p.sort((v,g)=>v.diff-g.diff),S=y.sort((v,g)=>v.diff-g.diff);var w=_[0],x=S[0];return w&&_.filter(v=>Math.abs(v.diff-w.diff)<.1).forEach(v=>{f.push(Object.assign({orientation:"V"},v))}),x&&S.filter(v=>Math.abs(v.diff-x.diff)<.1).forEach(v=>{f.push(Object.assign({orientation:"H"},v))}),f}function s(u,d){return u.x*d.x+u.y*d.y}e.setSnapFilterFunc=u=>{i=u};const c={"top-left":"bottom-right","top-center":"bottom-center","top-right":"bottom-left","middle-right":"middle-left","bottom-right":"top-left","bottom-center":"top-center","bottom-left":"top-right","middle-left":"middle-right"}}($d)),$d}var Q3;function RC(){return Q3||(Q3=1,function(e){var r=Wd&&Wd.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0,e.getMiddlePoints=u,e.getLinePositionFromMiddlePoints=d;const t=r(ni()),n=Us,a=Fu,i=Op(),o=Mh,s=n_(),c=rf();function u(f){const{x:_,y:S,width:w,height:x,rotation:v}=f.a,g=v*Math.PI/180,E={x:_+x/2*Math.cos(g+Math.PI/2),y:S+x/2*Math.sin(g+Math.PI/2)};return{middleLeft:E,middleRight:{x:E.x+w*Math.cos(g),y:E.y+w*Math.sin(g)}}}function d(f,_,S){const w=Math.sqrt(Math.pow(_.x-f.x,2)+Math.pow(_.y-f.y,2)),x=Math.atan2(_.y-f.y,_.x-f.x),v=180*x/Math.PI;return{x:f.x+Math.cos(x-Math.PI/2)*S/2,y:f.y+Math.sin(x-Math.PI/2)*S/2,width:w,height:S,rotation:v}}const p=(f,_)=>({offsetX:5/f,offsetY:5/f,width:10/f,height:10/f,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:S=>{S.target.getStage().container().style.cursor="crosshair"},onMouseLeave:S=>{S.target.getStage().container().style.cursor=""},onDragStart:S=>{_.history.startTransaction()},onDragEnd:S=>{_.history.endTransaction()}}),y=(0,n.observer)(({element:f,type:_})=>{const S=(0,i.useColor)(f,f.a.color,"fill"),w=(0,i.useColor)(f,f.a.color,"stroke"),x=Object.assign(Object.assign(Object.assign({strokeWidth:f.height,lineCap:"round",lineJoin:"round"},w),S),{opacity:f.a.opacity,hideInExport:!f.showInExport});return t.default.createElement(t.default.Fragment,null,_==="arrow"&&t.default.createElement(a.Line,Object.assign({points:[3*f.height,2*-f.height,0,0,3*f.height,2*f.height]},x)),_==="triangle"&&t.default.createElement(a.Line,Object.assign({points:[3*f.height,2*-f.height,0,0,3*f.height,2*f.height],closed:!0},x)),_==="bar"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-f.height,0,2*f.height],closed:!0},x)),_==="square"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-f.height,4*f.height,2*-f.height,4*f.height,2*f.height,0,2*f.height],closed:!0},x)),_==="circle"&&t.default.createElement(a.Circle,Object.assign({x:2*f.height,y:0,radius:2*f.height},x)))});e.LineElement=(0,n.observer)(({element:f,store:_})=>{const S=t.default.useRef(null),w=t.default.useRef(null),x=t.default.useRef(null),v=f.selectable||_.role==="admin",g=(0,c.isTouchDevice)(),E=_.selectedElements.indexOf(f)>=0&&_.selectedElements.length===1,b=_.selectedShapes.indexOf(f)>=0&&f.selectable,{middleLeft:M,middleRight:N}=u(f);(0,s.useAnchorSnap)(w,[S],[E]),(0,s.useAnchorSnap)(x,[S],[E]);const R=(0,i.useColor)(f,f.a.color,"stroke");return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Line,Object.assign({ref:S,name:"element",id:f.id,x:f.a.x,y:f.a.y,points:[0,0,f.a.width,0],offsetY:-f.a.height/2,strokeWidth:f.a.height,hitStrokeWidth:Math.max(f.a.height,20),dash:f.dash.map(F=>F*f.a.height)},R,{rotation:f.a.rotation,opacity:f.animated("opacity"),shadowEnabled:f.shadowEnabled,shadowBlur:f.shadowBlur,shadowOffsetX:f.shadowOffsetX,shadowOffsetY:f.shadowOffsetY,shadowColor:f.shadowColor,shadowOpacity:f.shadowOpacity,listening:v,draggable:g?f.draggable&&b:f.draggable,preventDefault:!g||b,hideInExport:!f.showInExport,onDragMove:F=>{f.set({x:F.target.x(),y:F.target.y()})},onDragEnd:F=>{f.set({x:F.target.x(),y:F.target.y()})},onTransform:F=>{const j=F.target.scaleX();F.target.scaleX(1),F.target.scaleY(1),f.set({height:f.height*j,width:f.width*j,x:F.target.x(),y:F.target.y(),rotation:F.target.rotation()})}})),t.default.createElement(a.Group,{x:M.x,y:M.y,rotation:f.rotation,hideInExport:!f.showInExport},t.default.createElement(y,{element:f,type:f.startHead})),t.default.createElement(a.Group,{x:N.x,y:N.y,rotation:f.rotation+180},t.default.createElement(y,{element:f,type:f.endHead})),E&&f.resizable&&t.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},t.default.createElement(a.Group,{visible:E},t.default.createElement(a.Rect,Object.assign({x:M.x,y:M.y,ref:w,name:"line-anchor"},p(_.scale,_),{onDragMove:F=>{const j=d(F.target.position(),N,f.height);f.set({x:j.x,y:j.y,width:j.width,rotation:j.rotation})}})),t.default.createElement(a.Rect,Object.assign({x:N.x,y:N.y,ref:x,name:"line-anchor"},p(_.scale,_),{onDragMove:F=>{const j=d(M,F.target.position(),f.height);f.set({x:j.x,y:j.y,width:j.width,rotation:j.rotation})}})))))})}(Wd)),Wd}var Bl={},J3;function i_(){return J3||(J3=1,function(e){var r,t=Bl&&Bl.__createBinding||(Object.create?function(O,C,A,k){k===void 0&&(k=A);var T=Object.getOwnPropertyDescriptor(C,A);T&&!("get"in T?!C.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return C[A]}}),Object.defineProperty(O,k,T)}:function(O,C,A,k){k===void 0&&(k=A),O[k]=C[A]}),n=Bl&&Bl.__setModuleDefault||(Object.create?function(O,C){Object.defineProperty(O,"default",{enumerable:!0,value:C})}:function(O,C){O.default=C}),a=Bl&&Bl.__importStar||(r=function(O){return r=Object.getOwnPropertyNames||function(C){var A=[];for(var k in C)Object.prototype.hasOwnProperty.call(C,k)&&(A[A.length]=k);return A},r(O)},function(O){if(O&&O.__esModule)return O;var C={};if(O!=null)for(var A=r(O),k=0;k<A.length;k++)A[k]!=="default"&&t(C,O,A[k]);return n(C,O),C}),i=Bl&&Bl.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useLoader=e.setVideoLoaderHook=e.useCornerRadiusAndCrop=void 0;const o=i(ni()),s=Us,c=vs,u=Fu,d=i(r0()),p=i(Hs()),y=Mh,f=jf(),_=a(kp()),S=gc(),w=Ap(),x=If(),v=rf();function g(){return document.createElement("canvas")}const E=new window.Image;E.src=_.svgToURL(`
|
|
277
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
278
|
+
<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"/>
|
|
279
|
+
<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"/>
|
|
280
|
+
</svg>
|
|
281
|
+
`);const b=new window.Image;b.src=_.svgToURL(`
|
|
282
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
283
|
+
<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"/>
|
|
284
|
+
<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"/>
|
|
285
|
+
<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"/>
|
|
286
|
+
<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"/>
|
|
287
|
+
</svg>
|
|
288
|
+
`),e.useCornerRadiusAndCrop=(O,C,A,k,T=0,V=!1)=>{const G=Math.floor(Math.max(O.width*k,1)),$=Math.floor(Math.max(O.height*k,1)),te=Math.min(T*k,G/2,$/2),W=Math.max(O.width/A.width,O.height/A.height)*k,U=O.page._exportingOrRendering&&S.flags.imageDownScalingEnabled&&W<1&&!V,z=A.x===0&&A.y===0&&A.width===(C==null?void 0:C.width)&&A.height===(C==null?void 0:C.height),D=o.default.useMemo(()=>{if(C&&C.width&&C.height)return z&&te===0&&!U?void 0:g()},[C,te,U,z]),Y=()=>{if(!D||!C)return;D.width=G,D.height=$;const Q=D.getContext("2d");if(!Q)return;te&&(Q.beginPath(),Q.moveTo(te,0),Q.lineTo(G-te,0),Q.arc(G-te,te,te,3*Math.PI/2,0,!1),Q.lineTo(G,$-te),Q.arc(G-te,$-te,te,0,Math.PI/2,!1),Q.lineTo(te,$),Q.arc(te,$-te,te,Math.PI/2,Math.PI,!1),Q.lineTo(0,te),Q.arc(te,te,te,Math.PI,3*Math.PI/2,!1),Q.clip());const J=U?function(ae,se){var ce,de;const Oe=g();Oe.width=ae.width,Oe.height=ae.height,(ce=Oe.getContext("2d"))===null||ce===void 0||ce.drawImage(ae,0,0,Oe.width,Oe.height);const Le=function(ke,Se,ye,Je,we,me,Ee){for(var Te=new ImageData(Se,ye),he=new Int32Array(ke.data.buffer),Re=ke.width,Ie=new Int32Array(Te.data.buffer),Xe=Te.width,rt=Se/me,vt=ye/Ee,et=Math.round(1/rt),yt=Math.round(1/vt),mt=et*yt,ct=0;ct<Te.height;ct++)for(var Bt=0;Bt<Xe;Bt++){for(var Pt=0+Math.round(Bt/rt)+(0+Math.round(ct/vt))*Re,Yt=0,Gt=0,Be=0,Ce=0,ft=0;ft<yt;ft++)for(var Ct=0;Ct<et;Ct++){var Ot=he[Pt+Ct+ft*Re];Yt+=Ot<<24>>>24,Gt+=Ot<<16>>>24,Be+=Ot<<8>>>24,Ce+=Ot>>>24}Yt=Math.round(Yt/mt),Gt=Math.round(Gt/mt),Be=Math.round(Be/mt),Ce=Math.round(Ce/mt),Ie[Bt+ct*Xe]=Ce<<24|Be<<16|Gt<<8|Yt}return Te}(Oe.getContext("2d").getImageData(0,0,Oe.width,Oe.height),Math.floor(Oe.width*se),Math.floor(Oe.height*se),0,0,Oe.width,Oe.height);return Oe.width=Math.floor(Oe.width*se),Oe.height=Math.floor(Oe.height*se),(de=Oe.getContext("2d"))===null||de===void 0||de.putImageData(Le,0,0),Oe}(C,W):C,Z=U?{x:Math.floor(A.x*W),y:Math.floor(A.y*W),width:Math.floor(A.width*W),height:Math.floor(A.height*W)}:A;Q.drawImage(J,Z.x,Z.y,Z.width,Z.height,0,0,D.width,D.height)};return o.default.useLayoutEffect(()=>{Y()},[D,O.width,O.height,A.x,A.y,A.width,A.height,T,k,V,O.page._exportingOrRendering,U]),o.default.useEffect(()=>()=>{D&&D.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(D)},[D]),[D||C,Y]};const M=g(),N=(0,s.observer)(({element:O})=>{const C=Math.min(30,O.width/4,O.height/4),A=o.default.useRef(null);return o.default.useEffect(()=>{const k=A.current;if(!k)return;const T=new p.default.Animation(V=>{k.rotate(((V==null?void 0:V.timeDiff)||0)/2)},k.getLayer());return T.start(),()=>{T.stop()}}),o.default.createElement(u.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,listening:!1,opacity:O.a.opacity,hideInExport:!O.showInExport},o.default.createElement(u.Rect,{width:O.width,height:O.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(u.Arc,{ref:A,x:O.width/2,y:O.height/2,fill:"white",outerRadius:Math.abs(C),innerRadius:Math.max(1,C-5),angle:270}))}),R=(0,s.observer)(({element:O})=>{const C=Math.max(10,Math.min(30,O.width/25));return o.default.createElement(u.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,listening:!1,opacity:O.a.opacity,hideInExport:!O.showInExport},o.default.createElement(u.Rect,{width:O.width,height:O.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(u.Text,{text:"Can not load the video...",fontSize:C,width:O.width,height:O.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let F=function(O,C,A){const k=o.default.useRef("loading"),T=o.default.useRef(null),[V,G]=o.default.useState(0),$=o.default.useRef(),te=o.default.useRef(),W=o.default.useRef();return $.current===O&&te.current===C&&W.current===A||(k.current="loading",T.current=void 0,$.current=O,te.current=C,W.current=A),o.default.useLayoutEffect(function(){if(O){var U=document.createElement("video");return U.addEventListener("canplay",z),U.addEventListener("error",D),C&&(U.crossOrigin=C),A&&(U.referrerpolicy=A),U.src=O,U.load(),function(){U.removeEventListener("canplay",z),U.removeEventListener("error",D)}}function z(){k.current="loaded",T.current=U,T.current.currentTime=0,G(Math.random()),T.current.removeEventListener("canplay",z)}function D(Y){var Q,J;const Z=U.readyState===4,ae=U.buffered&&U.buffered.length>0&&U.buffered.end(U.buffered.length-1)/U.duration*100>=100;if(Z&&ae)return;let se=Y.message||((Q=U.error)===null||Q===void 0?void 0:Q.message)||"Unknown error";if(se+=`, isReady: ${Z}, isFullyLoaded: ${ae}, readyState: ${U.readyState}, buffered: ${(J=U.buffered)===null||J===void 0?void 0:J.length}, duration: ${U.duration}. Time: ${U.currentTime}`,se.indexOf("PIPELINE_ERROR_DECODE")>=0)return;const ce=new Error("Video failed to load: "+se);console.error(ce),k.current="failed",T.current=void 0,G(Math.random())}},[O,C,A]),[T.current,k.current]};function j(O){return O.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}e.setVideoLoaderHook=O=>{F=O},e.useLoader=(O,C,A)=>{const k=o.default.useRef(),T=()=>{var V;(V=k.current)===null||V===void 0||V.call(k),k.current=void 0};o.default.useEffect(()=>T,[]),o.default.useLayoutEffect(()=>{const V=C.slice(0,200),G=`video with id ${A} url: ${V}`;O!=="loading"||k.current||(k.current=(0,f.incrementLoader)(G)),O!=="loading"&&T(),O==="failed"&&(0,f.triggerLoadError)(G)},[O])},e.VideoElement=(0,s.observer)(({element:O,store:C})=>{var A;const[k,T]=o.default.useState(!1),V=o.default.useRef(null),G=o.default.useRef(null),$=C.selectedShapes.indexOf(O)>=0&&O.selectable,[te,W]=o.default.useState(!1),[U,z]=F(O.src,"anonymous"),D=C.activePage===O.page;(0,e.useLoader)(z,O.src,O.id),U&&(U.width=U.videoWidth,U.height=U.videoHeight,U.playsInline=!0);const Y=U||M;o.default.useEffect(()=>{U&&C.history.ignore(()=>{O.set({duration:1e3*U.duration})})},[U]),o.default.useEffect(()=>{var Ce;if(!U)return;const ft=C.animatedElementsIds,Ct=(!ft.length||ft.includes(O.id))&&C.isPlaying,Ot=D&&(Ct||te);if(!Ot)return void U.pause();Ot&&(U.currentTime=O.startTime*U.duration,U.play());const Nt=new p.default.Animation(()=>{Re()},(Ce=V.current)===null||Ce===void 0?void 0:Ce.getLayer());Nt.start();const Jt=()=>{W(!1),U.currentTime=O.startTime*U.duration},Xt=()=>{U.currentTime>=O.endTime*U.duration&&(U.pause(),U.currentTime=O.startTime*U.duration,W(!1))};return U.addEventListener("ended",Jt),U.addEventListener("timeupdate",Xt),()=>{U.pause(),Nt.stop(),U.removeEventListener("ended",Jt),U.removeEventListener("timeupdate",Xt)}},[U,te,C.isPlaying,D]),o.default.useEffect(()=>{U&&(U.volume=O.volume)},[U,O.volume]);const Q=o.default.useRef();o.default.useEffect(()=>{const Ce=(0,c.autorun)(()=>{var ft,Ct;if(U){const Ot=C.animatedElementsIds;if(Ot.length&&!Ot.includes(O.id))return;const Nt=O.startTime*U.duration*1e3,Jt=U.duration*(O.endTime-O.startTime)*1e3,Xt=((C.currentTime||O.page.startTime)-O.page.startTime)%Jt+Nt;if(Math.abs(1e3*U.currentTime-Xt)>500||!C.isPlaying){const kt=Xt/1e3;kt!==U.currentTime&&(U.currentTime=kt),!j(U)&&!C.isPlaying&&!Q.current&&(Q.current=(0,f.incrementLoader)(`video ${O.id}`))}Re(),(Ct=(ft=V.current)===null||ft===void 0?void 0:ft.getLayer())===null||Ct===void 0||Ct.batchDraw()}});return()=>{Ce(),Q.current&&(Q.current(),Q.current=null)}},[C,U]),o.default.useEffect(()=>{if(!U)return;const Ce=()=>{var Ct,Ot;!j(U)&&O.page._exportingOrRendering||Q.current&&(Re(),(Ot=(Ct=V.current)===null||Ct===void 0?void 0:Ct.getLayer())===null||Ot===void 0||Ot.batchDraw(),Q.current(),Q.current=null)};let ft;return O.page._exportingOrRendering&&(ft=setInterval(Ce,50)),U.addEventListener("timeupdate",Ce),U.addEventListener("canplay",Ce),()=>{clearInterval(ft),U.removeEventListener("timeupdate",Ce),U.removeEventListener("canplay",Ce)}},[O.page._exportingOrRendering,U,O.id,f.incrementLoader]);let{cropX:J,cropY:Z,cropWidth:ae,cropHeight:se}=O;z!=="loaded"&&(J=Z=0,ae=se=1);const ce=Y.width*ae,de=Y.height*se,Oe=O.width/O.height;let Le,ke;const Se=ce/de,ye=O.type==="svg";ye?(Le=ce,ke=de):Oe>=Se?(Le=ce,ke=ce/Oe):(Le=de*Oe,ke=de);const Je={x:Y.width*J,y:Y.height*Z,width:Le,height:ke},we=(A=O.cornerRadius)!==null&&A!==void 0?A:0,[me,Ee]=(0,e.useCornerRadiusAndCrop)(O,Y,Je,C._elementsPixelRatio,we,k||O._cropModeEnabled||O.type==="svg");let[Te,he]=((Ce,ft,Ct,Ot)=>{const Nt=(it=>{const[He,wt]=o.default.useState(it);return o.default.useEffect(()=>{(async()=>{const ze=await async function(_t){if(!(_t.indexOf("data:image/svg+xml")>=0||_t.indexOf(".svg")>=0))return _t;const Ht=await _.urlToString(_t),Dt=_.fixSize(Ht);return _.svgToURL(Dt)}(it);ze!==He&&wt(ze)})()},[it]),He})(Ce.clipSrc||""),[Jt,Xt]=(0,d.default)(Nt,"anonymous"),kt=Ce.clipSrc?Xt:"loaded";(0,e.useLoader)(kt,Ce.clipSrc,Ce.id);const nt=o.default.useMemo(()=>{if(ft&&Jt)return g()},[ft,Jt]);function We(){var it;if(!Jt||!ft||!ft.width||!ft.height||!Jt||!Jt.width||!Jt.height||!nt)return;const He=g(),wt=Math.max(Ce.width/Jt.width*Ct,Ce.height/Jt.height*Ct);He.width=Jt.width*wt,He.height=Jt.height*wt,(it=He.getContext("2d"))===null||it===void 0||it.drawImage(Jt,0,0,He.width,He.height),nt.width=Math.max(ft.width,1),nt.height=Math.max(ft.height,1);const ze=nt.getContext("2d");ze&&(ze.save(),ze.drawImage(He,0,0,ft.width,ft.height),p.default.Util.releaseCanvas(He),ze.globalCompositeOperation="source-in",ze.drawImage(ft,0,0,nt.width,nt.height),ze.restore())}return o.default.useLayoutEffect(()=>{We()},[nt,ft,Jt,Ce.width,Ce.height,Ct,...Ot]),[Ce.clipSrc&&Jt?nt:ft,We]})(O,me,C._elementsPixelRatio,[Je,we,C._elementsPixelRatio]);function Re(){Ee(),he()}const Ie=Math.max(O.width/Le,O.height/ke);o.default.useEffect(()=>{var Ce;if(!O._cropModeEnabled)return;const ft=(Ce=V.current)===null||Ce===void 0?void 0:Ce.getStage();function Ct(Nt){O._cropModeEnabled&&Nt.target!==G.current&&O.toggleCropMode(!1)}function Ot(Nt){O._cropModeEnabled&&Nt.target.parentNode!==ft.content&&O.toggleCropMode(!1)}return document.body.addEventListener("click",Ot),ft==null||ft.on("click",Ct),ft==null||ft.on("tap",Ct),()=>{document.body.removeEventListener("click",Ot),document.body.removeEventListener("touchstart",Ot),ft==null||ft.off("click",Ct),ft==null||ft.off("click",Ct)}},[O._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!k&&!O._cropModeEnabled)return(0,w.applyFilter)(V.current,O),(0,c.autorun)(()=>{(0,w.applyFilter)(V.current,O)},{delay:100})},[Y,k,ae,se,O._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Ce;k||O._cropModeEnabled?(Ce=V.current)===null||Ce===void 0||Ce.clearCache():(0,w.applyFilter)(V.current,O)},[k,O.width,O.height,O._cropModeEnabled]),o.default.useEffect(()=>{(0,w.applyFilter)(V.current,O)},[O.shadowEnabled,O.shadowBlur,O.cornerRadius,O.shadowColor,O.shadowOffsetX,O.shadowOffsetY,O.shadowOpacity]);const Xe=o.default.useRef(null),rt=o.default.useRef(null),vt=o.default.useRef(null);o.default.useLayoutEffect(()=>{O._cropModeEnabled&&(rt.current.nodes([Xe.current]),vt.current.nodes([G.current]))},[O._cropModeEnabled]);const et=Ce=>{Math.round(Ce.target.x())>0&&(Ce.target.x(0),Ce.target.scaleX(1)),Math.round(Ce.target.y())>0&&(Ce.target.y(0),Ce.target.scaleY(1));const ft=Ce.target.width()*Ce.target.scaleX(),Ct=Ce.target.height()*Ce.target.scaleY(),Ot=Math.min(1,Le/ft),Nt=Math.min(1,ke/Ct),Jt=1-Ot,Xt=Math.min(Jt,Math.max(0,Math.round(-Ce.target.x())/ft)),kt=1-Nt,nt=Math.min(kt,Math.max(0,Math.round(-Ce.target.y())/Ct));Ce.target.setAttrs({x:-Xt*Y.width,y:-nt*Y.height,scaleX:1,scaleY:1}),O.set({cropX:Xt,cropY:nt,cropWidth:Ot,cropHeight:Nt})},yt=()=>{O.type!=="svg"&&O.contentEditable&&setTimeout(()=>{O.toggleCropMode(!0)})},mt=z==="loading",ct=z==="failed",Bt=!mt&&!ct,Pt=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Yt=Bt?O.a.opacity:0;(0,x.useFadeIn)(V,Yt);const Gt=O.selectable||C.role==="admin",Be=(0,v.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,mt&&o.default.createElement(N,{element:O}),ct&&o.default.createElement(R,{element:O}),o.default.createElement(u.Image,{ref:V,name:"element",id:O.id,image:Te,x:O.a.x,y:O.a.y,width:O.a.width||1,height:O.a.height||1,rotation:O.a.rotation,opacity:Yt,shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,customCrop:Je,listening:Gt,draggable:Be?O.draggable&&$:O.draggable,preventDefault:!Be||$,hideInExport:!O.showInExport,onDragMove:Ce=>{O.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{O.set({x:Ce.target.x(),y:Ce.target.y()})},onDblClick:yt,onDblTap:yt,onTransformStart:()=>{T(!0),Pt.current={cropX:O.cropX,cropY:O.cropY,cropWidth:O.cropWidth,cropHeight:O.cropHeight}},onTransform:Ce=>{var ft;const Ct=Ce.currentTarget,Ot=Math.abs(Ct.scaleX()-1)<1e-7?1:Ct.scaleX(),Nt=Math.abs(Ct.scaleY()-1)<1e-7?1:Ct.scaleY();Ct.scaleX(1),Ct.scaleY(1);const Jt=(ft=Ce.target.getStage())===null||ft===void 0?void 0:ft.findOne("Transformer"),Xt=1-Le/Y.width,kt=Math.min(Xt,Math.max(0,O.cropX)),nt=1-ke/Y.height,We=Math.min(nt,Math.max(0,O.cropY)),it=Jt.getActiveAnchor(),He=!(it.indexOf("middle")>=0||it.indexOf("center")>=0),wt=!He&&Ot<1&&Pt.current.cropHeight>ke/Y.height;let ze=He?O.cropWidth:O.cropWidth*Ot;wt&&(ze=O.cropWidth);const _t=!He&&Nt<1&&Pt.current.cropWidth>Le/Y.width;let Ht=He?O.cropHeight:O.cropHeight*Nt;_t&&(Ht=O.cropHeight),ye&&(ze=O.cropWidth,Ht=O.cropHeight),O.set({cropX:kt,cropY:We,x:Ct.x(),y:Ct.y(),width:Ct.width()*Ot,height:Ct.height()*Nt,rotation:Ce.target.rotation(),cropWidth:Math.min(ze,1-kt),cropHeight:Math.min(Ht,1-We)})},onTransformEnd:Ce=>{const ft=Ce.currentTarget;O.set({width:ft.width(),height:ft.height(),x:ft.x(),y:ft.y(),rotation:Ce.target.rotation(),cropWidth:Le/Y.width,cropHeight:ke/Y.height}),T(!1)}}),o.default.createElement(u.Rect,{x:O.a.x,y:O.a.y,width:Math.max(O.a.width-O.borderSize,0),height:Math.max(O.a.height-O.borderSize,0),opacity:Yt,offsetX:-O.borderSize/2,offsetY:-O.borderSize/2,stroke:O.borderColor,strokeWidth:O.borderSize,listening:!1,visible:!!O.borderSize,rotation:O.rotation,cornerRadius:Math.max(0,we-O.borderSize),hideInExport:!O.showInExport}),!C.isPlaying&&o.default.createElement(u.Image,{image:te?b:E,x:O.a.x,y:O.a.y,offsetX:-O.a.width/2+15/C.scale,offsetY:-O.a.height/2+15/C.scale,rotation:O.a.rotation,width:30/C.scale,height:30/C.scale,hideInExport:!0,onClick:()=>W(!te),onTap:()=>W(!te)}),O._cropModeEnabled&&o.default.createElement(y.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(u.Rect,{x:-window.innerWidth/C.scale,y:-window.innerWidth/C.scale,width:window.innerWidth/C.scale*3,height:window.innerWidth/C.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(u.Image,{listening:!1,image:Te,x:O.a.x,y:O.a.y,width:O.a.width,height:O.a.height,rotation:O.a.rotation,shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur}),o.default.createElement(u.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,scaleX:Ie,scaleY:Ie},o.default.createElement(u.Image,{image:Y,ref:G,opacity:.4,draggable:!0,x:-O.cropX*Y.width,y:-O.cropY*Y.height,onDragMove:et,onTransform:et}),o.default.createElement(u.Transformer,{ref:vt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ce,ft)=>ft.width<5||ft.height<5?Ce:ft,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(u.Rect,{width:Le,height:ke,ref:Xe,listening:!1,onTransform:Ce=>{Ce.target.x()<-O.cropX*Y.width-1e-9&&(Ce.target.x(-O.cropX*Y.width),Ce.target.scaleX(1)),Ce.target.y()<-O.cropY*Y.height-1e-9&&(Ce.target.y(-O.cropY*Y.height),Ce.target.scaleY(1));const ft=Math.min(1,Math.max(0,O.cropX+Ce.target.x()/Y.width)),Ct=Math.min(1,Math.max(0,Ce.target.y()/Y.height+O.cropY)),Ot=Ce.target.width()*Ce.target.scaleX(),Nt=Ce.target.height()*Ce.target.scaleY(),Jt=Math.min(1-ft,Ot/Y.width),Xt=Math.min(1-Ct,Nt/Y.height),kt=Ce.target.getAbsolutePosition(Ce.target.getParent().getParent());Ce.target.scale({x:1,y:1}),Ce.target.position({x:0,y:0}),O.set({x:kt.x,y:kt.y,cropX:ft,cropY:Ct,cropWidth:Jt,cropHeight:Xt,width:Math.min(Ot*Ie,Y.width*(1-ft)*Ie),height:Math.min(Nt*Ie,Y.height*(1-Ct)*Ie)})}}),o.default.createElement(u.Transformer,{ref:rt,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ce,ft)=>ft.width<5||ft.height<5?Ce:ft,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:O.resizable}))))})}(Bl)),Bl}var Yd={},Av={},e4;function Nm(){return e4||(e4=1,function(e){function r({width:u,height:d}){const p=u/2,y=d/2,f=u/2,_=d/2,S=f/2,w=_/2;let x="",v=Math.PI/5;for(let g=0;g<10;g++){const E=g%2==0?_:w,b=p+(g%2==0?f:S)*Math.sin(g*v),M=y-E*Math.cos(g*v);g===0?x=`M ${b} ${M}`:x+=` L ${b} ${M}`}return x+" Z"}function t({width:u,height:d}){const p=u/2,y=d/2;return`M ${p} 0 L ${u} ${y} L ${p} ${d} L 0 ${y} Z`}function n({width:u,height:d}){const p=u/2,y=d/2,f=u/2,_=d/2;let S="",w=2*Math.PI/5;for(let x=0;x<5;x++){const v=_,g=p+f*Math.sin(x*w),E=y-v*Math.cos(x*w);x===0?S=`M ${g} ${E}`:S+=` L ${g} ${E}`}return S+" Z"}function a({width:u,height:d}){const p=u/2,y=d/2,f=u/2,_=d/2;let S="",w=2*Math.PI/6;for(let x=0;x<6;x++){const v=_,g=p+f*Math.sin(x*w),E=y-v*Math.cos(x*w);x===0?S=`M ${g} ${E}`:S+=` L ${g} ${E}`}return S+" Z"}function i({path:u,aspectRatio:d,width:p,height:y}){return{path:u,scaleX:p/d.width,scaleY:y/d.height}}function o({width:u,height:d}){const p=.1*Math.min(u,d),y=.2*u,f=.2*d,_=.5*u;let S=`M ${p},0`;return S+=" H "+(u-p),S+=` A ${p},${p} 0 0 1 ${u},${p}`,S+=" V "+(d-p-f),S+=` A ${p},${p} 0 0 1 ${u-p},${d-f}`,S+=` H ${_+y/2}`,S+=` L ${_},${d}`,S+=` L ${_-y/2},${d-f}`,S+=` H ${p}`,S+=` A ${p},${p} 0 0 1 0,${d-p-f}`,S+=` V ${p}`,S+=` A ${p},${p} 0 0 1 ${p},0`,S+=" Z",S}function s({width:u,height:d}){const p=.3*u,y=.3*d,f=u/2,_=d/2,S=f-p/2,w=f+p/2,x=_-y/2,v=_+y/2;let g=`M ${S},0 `;return g+=`H ${w} `,g+=`V ${x} `,g+=`H ${u} `,g+=`V ${v} `,g+=`H ${w} `,g+=`V ${d} `,g+=`H ${S} `,g+=`V ${v} `,g+="H 0 ",g+=`V ${x} `,g+=`H ${S} `,g+="V 0 ",g+="Z",g}function c(u){return e.TYPES[u]||e.rectData}Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0,e.starPath=r,e.diamondPath=t,e.pentagonPath=n,e.hexagonPath=a,e.speechBubblePath=o,e.crossPath=s,e.subTypeToPathDataFunc=c,e.figureToSvg=function(u){const{subType:d}=u,p=c(d);return p?function(y,f){const{width:_,height:S,fill:w,stroke:x,strokeWidth:v,dash:g}=y,E=(g||[]).map(F=>F*v);let b=f(y),M=1,N=1;typeof b!="string"&&(M=b.scaleX,N=b.scaleY,b=b.path);const R=`clip-${y.id||Math.random()}`;return`
|
|
289
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${_}" height="${S}">
|
|
290
|
+
<defs>
|
|
291
|
+
<clipPath id="${R}">
|
|
292
|
+
<path d="${b}" />
|
|
293
|
+
</clipPath>
|
|
294
|
+
</defs>
|
|
295
|
+
|
|
296
|
+
<!-- Path for the fill -->
|
|
297
|
+
<path d="${b}" fill="${w}" transform="scale(${M}, ${N})"/>
|
|
298
|
+
|
|
299
|
+
<!-- Path for the stroke, clipped by the star path -->
|
|
300
|
+
<path d="${b}" fill="none" stroke="${x}" stroke-width="${2*v}" clip-path="url(#${R})" transform="scale(${M}, ${N})" stroke-dasharray="${E.join(" ")}"/>
|
|
301
|
+
</svg>
|
|
302
|
+
`}(u,p):(console.error(`Polotno error: Can not convert ${u.subType} figure to svg.`),(0,e.rectData)(u))},e.rectData=({width:u,height:d,cornerRadius:p})=>{if(p>0){const y=Math.min(p,u/2,d/2);return`M 0 ${y} A ${y} ${y} 0 0 1 ${y} 0 L ${u-y} 0 A ${y} ${y} 0 0 1 ${u} ${y} L ${u} ${d-y} A ${y} ${y} 0 0 1 ${u-y} ${d} L ${y} ${d} A ${y} ${y} 0 0 1 0 ${d-y} Z`}return`M 0 0 L ${u} 0 L ${u} ${d} L 0 ${d} Z`},e.triangleData=({width:u,height:d})=>`M ${u/2} 0 L ${u} ${d} L 0 ${d} Z`,e.rightTriangleData=({width:u,height:d})=>`M 0 0 L ${u} 0 L 0 ${d} Z`,e.circleData=({width:u,height:d})=>`M ${u/2} ${d/2} m -${u/2}, 0 a ${u/2},${d/2} 0 1,0 ${u},0 a ${u/2},${d/2} 0 1,0 -${u},0`,e.TYPES={rect:e.rectData,circle:e.circleData,star:r,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:t,pentagon:n,hexagon:a,speechBubble:o,cross:s,arc:({width:u,height:d})=>i({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:u,height:d}),cloud:({width:u,height:d})=>i({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:u,height:d}),rightArrow:({width:u,height:d})=>{const p=.6*u;return`M 0 ${d/4} L ${p} ${d/4} L ${p} 0 L ${u} ${d/2} L ${p} ${d} L ${p} ${.75*d} L 0 ${.75*d} Z`},leftArrow:({width:u,height:d})=>{const p=.4*u;return`M ${u} ${d/4} L ${p} ${d/4} L ${p} 0 L 0 ${d/2} L ${p} ${d} L ${p} ${.75*d} L ${u} ${.75*d} Z`},downArrow:({width:u,height:d})=>{const p=.6*d;return`M ${u/4} 0 L ${u/4} ${p} L 0 ${p} L ${u/2} ${d} L ${u} ${p} L ${.75*u} ${p} L ${.75*u} 0 Z`},upArrow:({width:u,height:d})=>{const p=.4*d;return`M ${u/4} ${d} L ${u/4} ${p} L 0 ${p} L ${u/2} 0 L ${u} ${p} L ${.75*u} ${p} L ${.75*u} ${d} Z`},asterisk1:({width:u,height:d})=>i({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:u,height:d}),asterisk2:({width:u,height:d})=>i({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:u,height:d}),bookmark:({width:u,height:d})=>i({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:u,height:d}),butterfly:({width:u,height:d})=>i({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:u,height:d}),cylinder:({width:u,height:d})=>i({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:u,height:d}),diamond2:({width:u,height:d})=>i({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:u,height:d}),door:({width:u,height:d})=>i({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:u,height:d}),drop1:({width:u,height:d})=>i({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:u,height:d}),drop2:({width:u,height:d})=>i({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:u,height:d}),explosion:({width:u,height:d})=>i({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:u,height:d}),flag:({width:u,height:d})=>i({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:u,height:d}),flower:({width:u,height:d})=>i({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:u,height:d}),frame:({width:u,height:d})=>i({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:u,height:d}),heart1:({width:u,height:d})=>i({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:u,height:d}),home:({width:u,height:d})=>i({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:u,height:d}),home2:({width:u,height:d})=>i({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:u,height:d}),hourglass:({width:u,height:d})=>i({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:u,height:d}),house:({width:u,height:d})=>i({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:u,height:d}),keyhole:({width:u,height:d})=>i({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:u,height:d}),kiss:({width:u,height:d})=>i({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:u,height:d}),leaf:({width:u,height:d})=>i({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:u,height:d}),lightning1:({width:u,height:d})=>i({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:u,height:d}),lightning2:({width:u,height:d})=>i({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:u,height:d}),magnet:({width:u,height:d})=>i({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:u,height:d}),mithosis:({width:u,height:d})=>i({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:u,height:d}),orangeRicky:({width:u,height:d})=>i({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:u,height:d}),party:({width:u,height:d})=>i({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:u,height:d}),pillow:({width:u,height:d})=>i({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:u,height:d}),polygon:({width:u,height:d})=>i({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:u,height:d}),rainbow:({width:u,height:d})=>i({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:u,height:d}),rhodeIsland:({width:u,height:d})=>i({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:u,height:d}),shell:({width:u,height:d})=>i({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:u,height:d}),shield1:({width:u,height:d})=>i({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:u,height:d}),shield2:({width:u,height:d})=>i({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:u,height:d}),skewedRectangle:({width:u,height:d})=>i({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:u,height:d}),softFlower:({width:u,height:d})=>i({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:u,height:d}),softStar:({width:u,height:d})=>i({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:u,height:d}),stairs1:({width:u,height:d})=>i({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:u,height:d}),stairs2:({width:u,height:d})=>i({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:u,height:d}),teewee:({width:u,height:d})=>i({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:u,height:d}),blob1:({width:u,height:d})=>i({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:u,height:d}),blob10:({width:u,height:d})=>i({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:u,height:d}),blob11:({width:u,height:d})=>i({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:u,height:d}),blob12:({width:u,height:d})=>i({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:u,height:d}),blob13:({width:u,height:d})=>i({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:u,height:d}),blob14:({width:u,height:d})=>i({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:u,height:d}),blob15:({width:u,height:d})=>i({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:u,height:d}),blob16:({width:u,height:d})=>i({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:u,height:d}),blob17:({width:u,height:d})=>i({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:u,height:d}),blob18:({width:u,height:d})=>i({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:u,height:d}),blob19:({width:u,height:d})=>i({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:u,height:d}),blob2:({width:u,height:d})=>i({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:u,height:d}),blob20:({width:u,height:d})=>i({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:u,height:d}),blob21:({width:u,height:d})=>i({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:u,height:d}),blob22:({width:u,height:d})=>i({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:u,height:d}),blob23:({width:u,height:d})=>i({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:u,height:d}),blob24:({width:u,height:d})=>i({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:u,height:d}),blob25:({width:u,height:d})=>i({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:u,height:d}),blob26:({width:u,height:d})=>i({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:u,height:d}),blob27:({width:u,height:d})=>i({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:u,height:d}),blob28:({width:u,height:d})=>i({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:u,height:d}),blob29:({width:u,height:d})=>i({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:u,height:d}),blob3:({width:u,height:d})=>i({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:u,height:d}),blob30:({width:u,height:d})=>i({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:u,height:d}),blob31:({width:u,height:d})=>i({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:u,height:d}),blob32:({width:u,height:d})=>i({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:u,height:d}),blob4:({width:u,height:d})=>i({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:u,height:d}),blob5:({width:u,height:d})=>i({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:u,height:d}),blob6:({width:u,height:d})=>i({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:u,height:d}),blob7:({width:u,height:d})=>i({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:u,height:d}),blob8:({width:u,height:d})=>i({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:u,height:d}),blob9:({width:u,height:d})=>i({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:u,height:d})}}(Av)),Av}var t4;function MC(){return t4||(t4=1,function(e){var r=Yd&&Yd.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=r(ni()),n=Us,a=Fu,i=Nm(),o=rf(),s=Op(),c={};e.FigureElement=(0,n.observer)(({element:u,store:d})=>{const p=u.selectable||d.role==="admin",y=(0,o.isTouchDevice)(),f=d.selectedShapes.indexOf(u)>=0&&u.selectable,_=Math.min(u.strokeWidth,u.width/2,u.height/2),S=Math.max(0,Math.min(u.width/2,u.height/2,u.cornerRadius)),w=(0,s.useColor)(u,u.a.fill,"fill"),x=Object.assign(Object.assign({width:u.a.width,height:u.a.height},w),{cornerRadius:S,opacity:u.animated("opacity"),shadowEnabled:u.shadowEnabled,shadowBlur:u.shadowBlur,shadowOffsetX:u.shadowOffsetX,shadowOffsetY:u.shadowOffsetY,shadowColor:u.shadowColor,shadowOpacity:u.shadowOpacity,preventDefault:!y||f,hideInExport:!u.showInExport}),v=(0,s.useColor)(u,u.stroke,"stroke"),g=Object.assign(Object.assign({visible:_>0,x:_/2,y:_/2,width:u.a.width-_,height:u.a.height-_},v),{strokeWidth:_,cornerRadius:Math.max(0,S-_),dash:u.dash.map(N=>N*_),opacity:u.animated("opacity"),hideInExport:!u.showInExport,listening:!1}),E=(b=u.subType,c[b]||(c[b]=(M=(0,i.subTypeToPathDataFunc)(b),(0,n.observer)(({element:N,fillProps:R,strokeProps:F})=>{let j=M({width:N.a.width,height:N.a.height,cornerRadius:N.cornerRadius}),O=1,C=1;typeof j!="string"&&(O=j.scaleX,C=j.scaleY,j=j.path);const A=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Rect,{width:N.width,height:N.height,fill:"transparent"}),t.default.createElement(a.Path,Object.assign({},R,{ref:A,data:j,scaleX:O,scaleY:C})),t.default.createElement(a.Group,{clipFunc:k=>{const T=A.current;if(T){var V=T.dataArray;k.beginPath();for(var G=0;G<V.length;G++){var $=V[G].command,te=V[G].points;switch($){case"L":k.lineTo(te[0],te[1]);break;case"M":k.moveTo(te[0],te[1]);break;case"C":k.bezierCurveTo(te[0],te[1],te[2],te[3],te[4],te[5]);break;case"Q":k.quadraticCurveTo(te[0],te[1],te[2],te[3]);break;case"A":var W=te[0],U=te[1],z=te[2],D=te[3],Y=te[4],Q=te[5],J=te[6],Z=te[7],ae=z>D?z:D,se=z>D?1:z/D,ce=z>D?D/z:1;k.translate(W,U),k.rotate(J),k.scale(se,ce),k.arc(0,0,ae,Y,Y+Q,1-Z),k.scale(1/se,1/ce),k.rotate(-J),k.translate(-W,-U);break;case"z":k.closePath()}}}},scaleX:O,scaleY:C},t.default.createElement(a.Path,Object.assign({},F,{x:0,y:0,data:j,strokeWidth:2*F.strokeWidth,dash:F.dash.map(k=>k)}))))}))),c[b]||a.Group);var b,M;return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Group,{id:u.id,x:u.a.x,y:u.a.y,rotation:u.a.rotation,opacity:u.a.opacity,listening:p,draggable:y?u.draggable&&f:u.draggable,name:"element",onDragMove:N=>{u.set({x:N.target.x(),y:N.target.y()})},onDragEnd:N=>{u.set({x:N.target.x(),y:N.target.y()})},onTransform:N=>{const R=N.target.scale();N.target.scaleX(1),N.target.scaleY(1),u.set({width:u.width*R.x,height:u.height*R.y,x:N.target.x(),y:N.target.y(),rotation:N.target.rotation()})}},t.default.createElement(E,{element:u,fillProps:x,strokeProps:g})))})}(Yd)),Yd}var Xd={},ac={},Cv={},oc={},r4;function a_(){if(r4)return oc;r4=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.loop=oc.conditional=oc.parse=void 0;var e=function n(a,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(i))i.forEach(function(u){return n(a,u,o,s)});else if(typeof i=="function")i(a,o,s,n);else{var c=Object.keys(i)[0];Array.isArray(i[c])?(s[c]={},n(a,i[c],o,s[c])):s[c]=i[c](a,o,s,n)}return o};oc.parse=e;var r=function(a,i){return function(o,s,c,u){i(o,s,c)&&u(o,a,s,c)}};oc.conditional=r;var t=function(a,i){return function(o,s,c,u){for(var d=[],p=o.pos;i(o,s,c);){var y={};if(u(o,a,s,y),o.pos===p)break;p=o.pos,d.push(y)}return d}};return oc.loop=t,oc}var Xi={},n4;function o_(){if(n4)return Xi;n4=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.readBits=Xi.readArray=Xi.readUnsigned=Xi.readString=Xi.peekBytes=Xi.readBytes=Xi.peekByte=Xi.readByte=Xi.buildStream=void 0;var e=function(p){return{data:p,pos:0}};Xi.buildStream=e;var r=function(){return function(p){return p.data[p.pos++]}};Xi.readByte=r;var t=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(y){return y.data[y.pos+p]}};Xi.peekByte=t;var n=function(p){return function(y){return y.data.subarray(y.pos,y.pos+=p)}};Xi.readBytes=n;var a=function(p){return function(y){return y.data.subarray(y.pos,y.pos+p)}};Xi.peekBytes=a;var i=function(p){return function(y){return Array.from(n(p)(y)).map(function(f){return String.fromCharCode(f)}).join("")}};Xi.readString=i;var o=function(p){return function(y){var f=n(2)(y);return p?(f[1]<<8)+f[0]:(f[0]<<8)+f[1]}};Xi.readUnsigned=o;var s=function(p,y){return function(f,_,S){for(var w=typeof y=="function"?y(f,_,S):y,x=n(p),v=new Array(w),g=0;g<w;g++)v[g]=x(f);return v}};Xi.readArray=s;var c=function(p,y,f){for(var _=0,S=0;S<f;S++)_+=p[y+S]&&Math.pow(2,f-S-1);return _},u=function(p){return function(y){for(var f=r()(y),_=new Array(8),S=0;S<8;S++)_[7-S]=!!(f&1<<S);return Object.keys(p).reduce(function(w,x){var v=p[x];return v.length?w[x]=c(_,v.index,v.length):w[x]=_[v.index],w},{})}};return Xi.readBits=u,Xi}var i4;function IC(){return i4||(i4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a_(),t=o_(),n={blocks:function(y){for(var f=0,_=[],S=y.data.length,w=0,x=(0,t.readByte)()(y);x!==f&&x;x=(0,t.readByte)()(y)){if(y.pos+x>=S){var v=S-y.pos;_.push((0,t.readBytes)(v)(y)),w+=v;break}_.push((0,t.readBytes)(x)(y)),w+=x}for(var g=new Uint8Array(w),E=0,b=0;b<_.length;b++)g.set(_[b],E),E+=_[b].length;return g}},a=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(p){var y=(0,t.peekBytes)(2)(p);return y[0]===33&&y[1]===249}),i=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,function(p,y,f){return Math.pow(2,f.descriptor.lct.size+1)})},function(p,y,f){return f.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(p){return(0,t.peekByte)()(p)===44}),o=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(y,f,_){return(0,t.readBytes)(_.text.blockSize)(y)}},n]},function(p){var y=(0,t.peekBytes)(2)(p);return y[0]===33&&y[1]===1}),s=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(y,f,_){return(0,t.readString)(_.blockSize)(y)}},n]},function(p){var y=(0,t.peekBytes)(2)(p);return y[0]===33&&y[1]===255}),c=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(p){var y=(0,t.peekBytes)(2)(p);return y[0]===33&&y[1]===254}),u=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,function(p,y){return Math.pow(2,y.lsd.gct.size+1)})},function(p,y){return y.lsd.gct.exists}),{frames:(0,r.loop)([a,s,c,i,o],function(p){var y=(0,t.peekByte)()(p);return y===33||y===44})}],d=u;e.default=d}(Cv)),Cv}var Kd={},a4;function jC(){if(a4)return Kd;a4=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.deinterlace=void 0;var e=function(t,n){for(var a=new Array(t.length),i=t.length/n,o=function(f,_){var S=t.slice(_*n,(_+1)*n);a.splice.apply(a,[f*n,n].concat(S))},s=[0,4,2,1],c=[8,8,4,2],u=0,d=0;d<4;d++)for(var p=s[d];p<i;p+=c[d])o(p,u),u++;return a};return Kd.deinterlace=e,Kd}var Zd={},o4;function FC(){if(o4)return Zd;o4=1,Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.lzw=void 0;var e=function(t,n,a){var i=4096,o=-1,s=a,c,u,d,p,y,f,_,N,S,w,M,x,R,F,O,j,v=new Array(a),g=new Array(i),E=new Array(i),b=new Array(i+1);for(x=t,u=1<<x,y=u+1,c=u+2,_=o,p=x+1,d=(1<<p)-1,S=0;S<u;S++)g[S]=0,E[S]=S;var M,N,R,F,j,O;for(M=N=R=F=j=O=0,w=0;w<s;){if(F===0){if(N<p){M+=n[O]<<N,N+=8,O++;continue}if(S=M&d,M>>=p,N-=p,S>c||S==y)break;if(S==u){p=x+1,d=(1<<p)-1,c=u+2,_=o;continue}if(_==o){b[F++]=E[S],_=S,R=S;continue}for(f=S,S==c&&(b[F++]=R,S=_);S>u;)b[F++]=E[S],S=g[S];R=E[S]&255,b[F++]=R,c<i&&(g[c]=_,E[c]=R,c++,(c&d)===0&&c<i&&(p++,d+=c)),_=f}F--,v[j++]=b[F],w++}for(w=j;w<s;w++)v[w]=0;return v};return Zd.lzw=e,Zd}var s4;function DC(){if(s4)return ac;s4=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.decompressFrames=ac.decompressFrame=ac.parseGIF=void 0;var e=i(IC()),r=a_(),t=o_(),n=jC(),a=FC();function i(d){return d&&d.__esModule?d:{default:d}}var o=function(p){var y=new Uint8Array(p);return(0,r.parse)((0,t.buildStream)(y),e.default)};ac.parseGIF=o;var s=function(p){for(var y=p.pixels.length,f=new Uint8ClampedArray(y*4),_=0;_<y;_++){var S=_*4,w=p.pixels[_],x=p.colorTable[w]||[0,0,0];f[S]=x[0],f[S+1]=x[1],f[S+2]=x[2],f[S+3]=w!==p.transparentIndex?255:0}return f},c=function(p,y,f){if(!p.image){console.warn("gif frame does not have associated image.");return}var _=p.image,S=_.descriptor.width*_.descriptor.height,w=(0,a.lzw)(_.data.minCodeSize,_.data.blocks,S);_.descriptor.lct.interlaced&&(w=(0,n.deinterlace)(w,_.descriptor.width));var x={pixels:w,dims:{top:p.image.descriptor.top,left:p.image.descriptor.left,width:p.image.descriptor.width,height:p.image.descriptor.height}};return _.descriptor.lct&&_.descriptor.lct.exists?x.colorTable=_.lct:x.colorTable=y,p.gce&&(x.delay=(p.gce.delay||10)*10,x.disposalType=p.gce.extras.disposal,p.gce.extras.transparentColorGiven&&(x.transparentIndex=p.gce.transparentColorIndex)),f&&(x.patch=s(x)),x};ac.decompressFrame=c;var u=function(p,y){return p.frames.filter(function(f){return f.image}).map(function(f){return c(f,p.gct,y)})};return ac.decompressFrames=u,ac}var l4;function BC(){return l4||(l4=1,function(e){var r=Xd&&Xd.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const t=r(ni()),n=Us,a=vs,i=Fu,o=r(Hs()),s=DC(),c=i_(),u=Om(),d=Ap(),p=If(),y=rf();function f(w,x,v){const g=x.getContext("2d"),E=v.getContext("2d");if(!g||!E)return;w.disposalType===2&&g.clearRect(0,0,x.width,x.height),v.width=w.width,v.height=w.height;const b=E.createImageData(w.width,w.height);b.data.set(w.patch),E.putImageData(b,0,0),g.drawImage(v,w.left,w.top)}const _=(0,n.observer)(({element:w})=>{const x=Math.min(30,w.width/4,w.height/4),v=t.default.useRef(null);return t.default.useEffect(()=>{const g=v.current;if(!g)return;const E=new o.default.Animation(b=>{g.rotate(((b==null?void 0:b.timeDiff)||0)/2)},g.getLayer());return E.start(),()=>{E.stop()}},[]),t.default.createElement(i.Group,{x:w.a.x,y:w.a.y,rotation:w.a.rotation,listening:!1,opacity:w.a.opacity,hideInExport:!w.showInExport},t.default.createElement(i.Rect,{width:w.width,height:w.height,fill:"rgba(124, 173, 212, 0.8)"}),t.default.createElement(i.Arc,{ref:v,x:w.width/2,y:w.height/2,fill:"white",outerRadius:Math.abs(x),innerRadius:Math.max(1,x-5),angle:270}))}),S=(0,n.observer)(({element:w})=>{const x=Math.max(10,Math.min(30,w.width/22));return t.default.createElement(i.Group,{x:w.a.x,y:w.a.y,rotation:w.a.rotation,listening:!1,opacity:w.a.opacity,hideInExport:!w.showInExport},t.default.createElement(i.Rect,{width:w.width,height:w.height,fill:"rgba(223, 102, 102, 0.8)"}),t.default.createElement(i.Text,{text:"Cannot load the GIF...",fontSize:x,width:w.width,height:w.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});e.GifElement=(0,n.observer)(({element:w,store:x})=>{var v;const[g,E]=t.default.useState(!1),b=x.selectedShapes.indexOf(w)>=0&&w.selectable,M=t.default.useRef(null),N=t.default.useRef(),[R,F,j,O]=function(Q){const[J,Z]=t.default.useState([]),[ae,se]=t.default.useState(0),[ce,de]=t.default.useState("loading"),[Oe,Le]=t.default.useState({width:0,height:0});return t.default.useEffect(()=>{(async()=>{try{const ke=await fetch(Q),Se=await ke.arrayBuffer(),ye=(0,s.parseGIF)(Se),Je=(0,s.decompressFrames)(ye,!0),we=ye.lsd.width,me=ye.lsd.height;Le({width:we,height:me});const Ee=Je.map(he=>({patch:new Uint8ClampedArray(he.patch),delay:he.delay,width:he.dims.width,height:he.dims.height,left:he.dims.left,top:he.dims.top,disposalType:he.disposalType})),Te=Ee.reduce((he,Re)=>he+Re.delay,0);Z(Ee),se(Te),de("loaded")}catch(ke){console.error("Failed to load GIF:",ke),de("failed")}})()},[Q]),[J,ae,Oe,ce]}(w.src);(0,u.useImageLoader)(O,w.src,w.id),t.default.useEffect(()=>(N.current=document.createElement("canvas"),()=>{N.current&&o.default.Util.releaseCanvas(N.current)}),[]),t.default.useEffect(()=>{if(O==="loaded"&&N.current&&(N.current.width=j.width,N.current.height=j.height,R.length>0)){const Q=N.current.getContext("2d");if(Q){Q.clearRect(0,0,j.width,j.height);const J=document.createElement("canvas");f(R[0],N.current,J)}}},[j,O,R]),t.default.useEffect(()=>{if(!R.length||!N.current)return;const Q=N.current;Q.width=j.width,Q.height=j.height;const J=document.createElement("canvas"),Z=Q.getContext("2d");Z&&Z.clearRect(0,0,Q.width,Q.height);let ae=-1;f(R[0],Q,J),te(),ae=0;const se=ce=>{const de=(Oe=>{const Le=Oe%F;let ke=0;for(let Se=0;Se<R.length;Se++)if(ke+=R[Se].delay,ke>Le)return Se;return 0})(ce);de!==ae&&(f(R[de],Q,J),te(),M.current.getLayer().draw(),ae=de)};if(x.isPlaying||w.page._exportingOrRendering)return(0,a.autorun)(()=>{se(x.currentTime-w.page.startTime)});{const ce=window.setInterval(()=>{se(x.currentTime||performance.now())},16);return()=>{clearInterval(ce)}}},[x.isPlaying,R,F,w.page._exportingOrRendering]),t.default.useEffect(()=>{F&&x.history.ignore(()=>{w.set({duration:F})})},[F]);let{cropX:C,cropY:A,cropWidth:k,cropHeight:T}=w;O!=="loaded"&&(C=A=0,k=T=1);const V={x:j.width*C,y:j.height*A,width:j.width*k,height:j.height*T},G=(v=w.cornerRadius)!==null&&v!==void 0?v:0,[$,te]=(0,c.useCornerRadiusAndCrop)(w,N.current,V,x._elementsPixelRatio,G,g||w._cropModeEnabled);t.default.useLayoutEffect(()=>{if(!g&&!w._cropModeEnabled&&M.current)return(0,d.applyFilter)(M.current,w),(0,a.autorun)(()=>{(0,d.applyFilter)(M.current,w)},{delay:100})},[N.current,g,k,T,w._cropModeEnabled,j.width,j.height]);const W=O==="loading",U=O==="failed",z=W||U?0:w.a.opacity;(0,p.useFadeIn)(M,z);const D=w.selectable||x.role==="admin",Y=(0,y.isTouchDevice)();return t.default.createElement(t.default.Fragment,null,W&&t.default.createElement(_,{element:w}),U&&t.default.createElement(S,{element:w}),t.default.createElement(i.Image,{ref:M,name:"element",id:w.id,image:$,x:w.a.x,y:w.a.y,width:w.a.width||1,height:w.a.height||1,rotation:w.a.rotation,opacity:z,shadowEnabled:w.shadowEnabled,shadowBlur:w.shadowBlur,shadowOffsetX:w.shadowOffsetX,shadowOffsetY:w.shadowOffsetY,shadowColor:w.shadowColor,shadowOpacity:w.shadowOpacity,customCrop:V,listening:D,draggable:Y?w.draggable&&b:w.draggable,preventDefault:!Y||b,hideInExport:!w.showInExport,onDragMove:Q=>{w.set({x:Q.target.x(),y:Q.target.y()})},onDragEnd:Q=>{w.set({x:Q.target.x(),y:Q.target.y()})},onTransformStart:()=>E(!0),onTransform:Q=>{const J=Q.currentTarget,Z=Math.abs(J.scaleX()-1)<1e-7?1:J.scaleX(),ae=Math.abs(J.scaleY()-1)<1e-7?1:J.scaleY();J.scaleX(1),J.scaleY(1),w.set({x:J.x(),y:J.y(),width:J.width()*Z,height:J.height()*ae,rotation:J.rotation()})},onTransformEnd:()=>E(!1)}),t.default.createElement(i.Rect,{x:w.a.x,y:w.a.y,width:Math.max(w.a.width-w.borderSize,0),height:Math.max(w.a.height-w.borderSize,0),opacity:z,offsetX:-w.borderSize/2,offsetY:-w.borderSize/2,stroke:w.borderColor,strokeWidth:w.borderSize,listening:!1,visible:!!w.borderSize,rotation:w.rotation,cornerRadius:Math.max(0,G-w.borderSize),hideInExport:!w.showInExport}))})}(Xd)),Xd}var Qd={},u4;function qC(){return u4||(u4=1,function(e){var r=Qd&&Qd.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const t=r(ni()),n=Us,a=Fu,i={stroke:"rgb(0, 161, 255)",strokeWidth:2};e.setHighlighterStyle=o=>{Object.assign(i,o)},e.Highlighter=(0,n.observer)(({element:o})=>t.default.createElement(a.Rect,Object.assign({name:"highlighter",x:o.a.x,y:o.a.y,rotation:o.a.rotation,width:o.a.width,height:o.a.height,listening:!1,strokeScaleEnabled:!1},i)))}(Qd)),Qd}var Jd={};let zC="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",s_=e=>crypto.getRandomValues(new Uint8Array(e)),l_=(e,r,t)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,a=-~(1.6*n*r/e.length);return(i=r)=>{let o="";for(;;){let s=t(a),c=a;for(;c--;)if(o+=e[s[c]&n]||"",o.length===i)return o}}},UC=(e,r=21)=>l_(e,r,s_),HC=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((r,t)=>(t&=63,t<36?r+=t.toString(36):t<62?r+=(t-26).toString(36).toUpperCase():t>62?r+="-":r+="_",r),"");const VC=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:UC,customRandom:l_,nanoid:HC,random:s_,urlAlphabet:zC},Symbol.toStringTag,{value:"Module"})),u0=Zc(VC);var kv={},Is={},Lv={},Nv={},c4;function u_(){return c4||(c4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0,e.deepEqual=function(r,t){if(r===t)return!0;if(typeof r=="object"&&r!=null&&typeof t=="object"&&t!=null){if(Object.keys(r).length!=Object.keys(t).length)return!1;for(var n in r)if(!t.hasOwnProperty(n)||!(0,e.deepEqual)(r[n],t[n]))return!1;return!0}return!1}}(Nv)),Nv}var f4;function GC(){return f4||(f4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const r=hl,t=u_();Object.assign(r.types),e.UndoManager=r.types.model("UndoManager",{history:r.types.array(r.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 a,i,o=!1,s=null,c=0,u=0;const d=()=>u>0;function p(){const f=(0,r.getSnapshot)(a);return{pages:f.pages,width:f.width,height:f.height,custom:f.custom,audios:f.audios}}function y(f){const _=a.pages.map(v=>v.id),S=f.pages.map(v=>v.id),w=!(0,t.deepEqual)(_,S),x=!(0,t.deepEqual)(a.custom,f.custom);w?(0,r.applySnapshot)(a.pages,f.pages):a.pages.forEach((v,g)=>{(0,r.applySnapshot)(v,f.pages[g])}),x&&a.set({custom:f.custom}),a.setSize(f.width,f.height)}return{startTransaction(){u++},endTransaction(f){u--,f||this.requestAddState(p())},async ignore(f,_=!1,S=!1){S&&await new Promise(E=>setTimeout(E,10)),c&&n.addUndoState();let w=d();n.startTransaction();let x=u;try{await f()}catch(E){setTimeout(()=>{throw E})}const v=x!==u,g=!v;n.endTransaction(g),_||w||n.replaceState(),v||(clearTimeout(c),c=0)},async transaction(f){await n.ignore(f,!0),this.addUndoState()},requestAddState(f){s=f,c||d()||(o?o=!1:c=setTimeout(()=>{c=0,clearTimeout(c),d()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const f=n.history[n.undoIdx];!(0,t.deepEqual)(s,f)&&(clearTimeout(c),c=0,n.history.splice(n.undoIdx+1),n.history.push(s),n.undoIdx=n.history.length-1)},afterCreate(){if(a=(0,r.resolvePath)(n,".."),!a)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");i=(0,r.onSnapshot)(a,()=>{this.requestAddState(p())}),n.history.length===0&&this.requestAddState(p())},clear(){clearTimeout(c),c=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(p())},beforeDestroy(){i()},undo(){c&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,y(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){c&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,y(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=p()}}}),e.default=e.UndoManager}(Lv)),Lv}var Tv={},h4;function WC(){return h4||(h4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=async function(r,t){const n=await(await fetch(r)).blob(),a=document.createElement("a"),i=URL.createObjectURL(n);a.href=i,a.download=t,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(i)},0)}}(Tv)),Tv}var Rv={},d4;function $C(){return d4||(d4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=function(){var n;return!((n=window.jspdf)===null||n===void 0)&&n.jsPDF?Promise.resolve(window.jspdf.jsPDF):t||(t=new Promise(a=>{var i=document.createElement("script");i.onload=function(){a(window.jspdf.jsPDF)},i.src=r,document.head.appendChild(i)}),t)};const r="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js";let t=null}(Rv)),Rv}var Mv={},p4;function YC(){return p4||(p4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getGIF=t,e.createGIF=async function({width:n,height:a}){return new(await t())({workers:4,width:n,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
303
|
+
(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]);
|
|
304
|
+
`],{type:"application/javascript"}))})};const r="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function t(){return window.GIF?Promise.resolve(window.GIF):new Promise(n=>{var a=document.createElement("script");a.onload=function(){n(window.GIF)},a.src=r,document.head.appendChild(a)})}}(Mv)),Mv}var sc={},Iv={},g4;function XC(){return g4||(g4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const r=Tm();e.URL="https://api.polotno.com",e.API=`${e.URL}/api`,e.getAPI=()=>e.URL+"/api";const t={},n=(i,o)=>{t[i]||(t[i]=!0,console.error(o))},a=`API for iconscout is provided as a demonstration.
|
|
305
|
+
For production usage you have to use your own API endpoint.
|
|
306
|
+
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
307
|
+
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:i,page:o=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${i}&per_page=20&page=${o}&KEY=${(0,r.getKey)()}`,unsplashDownload:i=>`${(0,e.getAPI)()}/download-unsplash?id=${i}&KEY=${(0,r.getKey)()}`,svgapiList:({query:i,page:o=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${i}&page=${o}&per_page=20&KEY=${(0,r.getKey)()}`,svgapiDownload:i=>`${(0,e.getAPI)()}/download-svgapi?path=${i}&KEY=${(0,r.getKey)()}`,iconscoutList:({query:i,page:o=1})=>(n("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${i}&page=${o}&KEY=${(0,r.getKey)()}`),iconscoutDownload:i=>(n("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${i}&KEY=${(0,r.getKey)()}`),nounProjectList:({query:i,page:o=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${i}&page=${o}&KEY=${(0,r.getKey)()}`,nounProjectDownload:i=>`${(0,e.getAPI)()}/download-nounproject?id=${i}&KEY=${(0,r.getKey)()}`,templateList:({query:i,page:o=1,sizeQuery:s})=>`${(0,e.getAPI)()}/get-templates?${s}&query=${i}&per_page=30&page=${o}&KEY=${(0,r.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,r.getKey)()}`,googleFontImage:i=>{return`${e.URL}/google-fonts-previews/black/${o=i,o.replace(new RegExp(" ","g"),"-")}.png`;var o},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,r.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,r.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,r.getKey)()}`},e.getGoogleFontsListAPI=()=>e.URLS.googleFontsList(),e.getGoogleFontImage=i=>e.URLS.googleFontImage(i),e.polotnoShapesList=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,r.getKey)()}`,e.removeBackground=()=>e.URLS.removeBackground(),e.templateList=i=>e.URLS.templateList(i),e.textTemplateList=()=>e.URLS.textTemplateList(),e.unsplashList=i=>e.URLS.unsplashList(i),e.unsplashDownload=i=>e.URLS.unsplashDownload(i),e.svgapiList=i=>e.URLS.svgapiList(i),e.svgapiDownload=i=>e.URLS.svgapiDownload(i),e.iconscoutList=i=>e.URLS.iconscoutList(i),e.iconscoutDownload=i=>e.URLS.iconscoutDownload(i),e.setAPI=(i,o)=>{e.URLS[i]=o}}(Iv)),Iv}var v4;function Tm(){return v4||(v4=1,function(e){var r,t=sc&&sc.__createBinding||(Object.create?function(R,F,j,O){O===void 0&&(O=j);var C=Object.getOwnPropertyDescriptor(F,j);C&&!("get"in C?!F.__esModule:C.writable||C.configurable)||(C={enumerable:!0,get:function(){return F[j]}}),Object.defineProperty(R,O,C)}:function(R,F,j,O){O===void 0&&(O=j),R[O]=F[j]}),n=sc&&sc.__setModuleDefault||(Object.create?function(R,F){Object.defineProperty(R,"default",{enumerable:!0,value:F})}:function(R,F){R.default=F}),a=sc&&sc.__importStar||(r=function(R){return r=Object.getOwnPropertyNames||function(F){var j=[];for(var O in F)Object.prototype.hasOwnProperty.call(F,O)&&(j[j.length]=O);return j},r(R)},function(R){if(R&&R.__esModule)return R;var F={};if(R!=null)for(var j=r(R),O=0;O<j.length;O++)j[O]!=="default"&&t(F,R,j[O]);return n(F,R),F});Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=e.___=void 0,e.isKeyPaid=N,e.validateKey=async function(R,F){p=R,await N(R)&&!F||d()};const i=a(vs),o=XC(),s=gc(),c=i.observable({value:!1}),u=i.observable({value:"v1"});e.___=()=>u.value,e.isCreditVisible=()=>c.value;const d=i.action(()=>{c.value=!0});let p="";e.getKey=()=>p||"";const y=5,f=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",S="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",w="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",x="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let v=window.location.origin;const g=navigator.userAgent.indexOf("Headless")>-1,E=navigator.userAgent.indexOf("Electron")>-1;v==="file://"&&g&&(v="headless"),v==="file://"&&E&&(v="electron");const b=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${v}" here: https://polotno.com/cabinet`;let M=fetch;async function N(R){for(let F=0;F<y;F++)try{const j=await M((0,o.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:R,site:location.host,skdVersion:"2.23.12"})});if(i.runInAction(()=>{u.value=j.headers.get("x-api-version")}),!R)return console.warn(_),!1;if(j.status!==200){await new Promise(C=>setTimeout(C,f));continue}const O=await j.json();return O.is_valid||console.warn(S),O.is_paid||console.log(x,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),O.is_domain_valid||console.log(b,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,s.useRemoveBackground)(O.remove_background_enabled),O.is_paid||!1}catch{await new Promise(O=>setTimeout(O,f))}return console.error(w),!0}e.__=R=>{M=R}}(sc)),sc}var jv={},m4;function Rm(){return m4||(m4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0,e.pxToUnit=({px:r,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return r;case"mm":return r/(n/25.4);case"cm":return r/(n/2.54);case"in":return r/n}},e.pxToUnitRounded=({px:r,precious:t=2,dpi:n=72,unit:a="px"})=>parseFloat((0,e.pxToUnit)({px:r,dpi:n,unit:a}).toFixed(t)),e.unitToPx=({unitVal:r,dpi:t,unit:n})=>r/(0,e.pxToUnit)({px:1,unit:n,dpi:t}),e.pxToUnitString=r=>{const t=parseFloat((0,e.pxToUnit)(r).toFixed(1));switch(r.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}}}(jv)),jv}var Fv={},y4;function KC(){return y4||(y4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=async function(r){for(let t=0;t<30;t++){const n=await r();if(n)return n;await new Promise(a=>setTimeout(a,50))}}}(Fv)),Fv}var ql={},Dv={},b4;function D1(){return b4||(b4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getImageSize=function(n){return new Promise(a=>{const i=document.createElement("img");i.onload=async()=>{i.width===0||i.height===0?a(await(0,r.getSvgSize)(n)):a({width:i.width,height:i.height})},i.crossOrigin="anonymous",i.src=n})},e.loadImage=t,e.cropImage=async function(n,a){const i=await t(n),o=document.createElement("canvas");o.width=2*i.width,o.height=2*i.height,o.getContext("2d").drawImage(i,0,0,o.width,o.height);const s=document.createElement("canvas");s.width=a.width,s.height=a.height;const c=s.getContext("2d");let{cropX:u,cropY:d}=a;const p=o.width*a.cropWidth,y=o.height*a.cropHeight,f=a.width/a.height;let _,S;const w=p/y;return a.type==="svg"?(_=p,S=y):f>=w?(_=p,S=p/f):(_=y*f,S=y),c.drawImage(o,u*o.width,d*o.height,_,S,0,0,s.width,s.height),s.toDataURL("image/png")},e.getCrop=function(n,a){const{width:i,height:o}=n,s=i/o;let c,u;s>=a.width/a.height?(c=a.width,u=a.width/s):(c=a.height*s,u=a.height);const d=(a.width-c)/2,p=(a.height-u)/2;return{cropX:d/a.width,cropY:p/a.height,cropWidth:c/a.width,cropHeight:u/a.height}};const r=kp();function t(n){return new Promise((a,i)=>{const o=document.createElement("img");o.onload=()=>{a(o)},o.onerror=s=>{i(s)},o.crossOrigin="anonymous",o.src=n})}}(Dv)),Dv}var Bv={},w4;function c_(){return w4||(w4=1,function(e){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=function(t,n){let a={filter:"",html:void 0};switch(t){case r.warm:{const i=Math.max(0,Math.min(1,n??.5)),o=1+.3*i,s=1+.15*i,c=1;return a.filter="url(#warm-filter)",a.html=`
|
|
308
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
309
|
+
<filter id="warm-filter" color-interpolation-filters="sRGB">
|
|
310
|
+
<feColorMatrix type="matrix" values="
|
|
311
|
+
${o} 0 0 0 0
|
|
312
|
+
0 ${s} 0 0 0
|
|
313
|
+
0 0 ${c} 0 0
|
|
314
|
+
0 0 0 1 0" />
|
|
315
|
+
</filter>
|
|
316
|
+
</svg>`,a}case r.cold:{const i=Math.max(0,Math.min(1,n??.5)),o=1-.15*i,s=1-.1*i,c=1+.15*i;return a.filter="url(#cold-filter)",a.html=`
|
|
317
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
318
|
+
<filter id="cold-filter" color-interpolation-filters="sRGB">
|
|
319
|
+
<feColorMatrix type="matrix" values="
|
|
320
|
+
${o} 0 0 0 0
|
|
321
|
+
0 ${s} 0 0 0
|
|
322
|
+
0 0 ${c} 0 0
|
|
323
|
+
0 0 0 1 0" />
|
|
324
|
+
</filter>
|
|
325
|
+
</svg>`,a}case"natural":{const i=Math.max(0,Math.min(1,n??.5)),o=1+.1*i,s=1+.3*i,c=1+.2*i;return a.filter=`saturate(${s}) brightness(${o}) contrast(${c})`,a}case r.temperature:{const i=Math.max(-1,Math.min(1,n??0)),o=1+.15*i,s=1,c=1-.15*i;return a.filter="url(#temperature-filter)",a.html=`
|
|
326
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
327
|
+
<filter id="temperature-filter" color-interpolation-filters="sRGB">
|
|
328
|
+
<feColorMatrix type="matrix" values="
|
|
329
|
+
${o} 0 0 0 0
|
|
330
|
+
0 ${s} 0 0 0
|
|
331
|
+
0 0 ${c} 0 0
|
|
332
|
+
0 0 0 1 0" />
|
|
333
|
+
</filter>
|
|
334
|
+
</svg>
|
|
335
|
+
`,a}case r.contrast:{const i=100*Math.max(-1,Math.min(1,n??0)),o=259*(i+255)/(255*(259-i)),s=.5*(1-o);return a.filter="url(#contrast-filter)",a.html=`
|
|
336
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
337
|
+
<filter id="contrast-filter" color-interpolation-filters="sRGB">
|
|
338
|
+
<feComponentTransfer>
|
|
339
|
+
<feFuncR type="linear" slope="${o}" intercept="${s}" />
|
|
340
|
+
<feFuncG type="linear" slope="${o}" intercept="${s}" />
|
|
341
|
+
<feFuncB type="linear" slope="${o}" intercept="${s}" />
|
|
342
|
+
</feComponentTransfer>
|
|
343
|
+
</filter>
|
|
344
|
+
</svg>
|
|
345
|
+
`,a}case r.shadows:{const i=Math.max(-1,Math.min(1,n??0)),o=Math.min(Math.max(1-.6*i,.4),2.5);return a.filter="url(#shadows-filter)",a.html=`
|
|
346
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
347
|
+
<filter id="shadows-filter" color-interpolation-filters="sRGB">
|
|
348
|
+
<feComponentTransfer>
|
|
349
|
+
<feFuncR type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
350
|
+
<feFuncG type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
351
|
+
<feFuncB type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
352
|
+
</feComponentTransfer>
|
|
353
|
+
</filter>
|
|
354
|
+
</svg>
|
|
355
|
+
`,a}case r.white:case r.black:return null;case r.vibrance:{const i=Math.max(-1,Math.min(1,n??0)),o=.299,s=.587,c=.114;let u;u=i>=0?1+1.5*i:1+i;const d=1-u,p=d*o+u,y=d*s,f=d*c,_=d*o,S=d*s+u,w=d*c,x=d*o,v=d*s,g=d*c+u;return a.filter="url(#vibrance-filter)",a.html=`
|
|
356
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
357
|
+
<filter id="vibrance-filter" color-interpolation-filters="sRGB">
|
|
358
|
+
<feColorMatrix type="matrix" values="
|
|
359
|
+
${p} ${y} ${f} 0 0
|
|
360
|
+
${_} ${S} ${w} 0 0
|
|
361
|
+
${x} ${v} ${g} 0 0
|
|
362
|
+
0 0 0 1 0" />
|
|
363
|
+
</filter>
|
|
364
|
+
</svg>
|
|
365
|
+
`,a}case r.saturation:{const c=1+Math.max(-1,Math.min(1,n??0)),u=1-c,d=u*.2126+c,p=u*.7152,y=u*.0722,f=u*.2126,_=u*.7152+c,S=u*.0722,w=u*.2126,x=u*.7152,v=u*.0722+c;return a.filter="url(#saturation-filter)",a.html=`
|
|
366
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
367
|
+
<filter id="saturation-filter" color-interpolation-filters="sRGB">
|
|
368
|
+
<feColorMatrix type="matrix" values="
|
|
369
|
+
${d} ${p} ${y} 0 0
|
|
370
|
+
${f} ${_} ${S} 0 0
|
|
371
|
+
${w} ${x} ${v} 0 0
|
|
372
|
+
0 0 0 1 0" />
|
|
373
|
+
</filter>
|
|
374
|
+
</svg>
|
|
375
|
+
`,a}default:return null}},function(t){t.sepia="sepia",t.grayscale="grayscale",t.natural="natural",t.warm="warm",t.cold="cold",t.temperature="temperature",t.contrast="contrast",t.shadows="shadows",t.white="white",t.black="black",t.vibrance="vibrance",t.saturation="saturation"}(r||(e.Effects=r={}))}(Bv)),Bv}var qv={},_4;function ZC(){return _4||(_4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getVideoSize=async function(r){return new Promise((t,n)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.src=r,a.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:o}=a;t({width:i,height:o})}),a.addEventListener("error",i=>{const o=r.slice(0,100);n(new Error(`Failed to load video: ${o}`))})})},e.getVideoDuration=async function(r){return new Promise(t=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=r,n.addEventListener("loadedmetadata",()=>{const{duration:a}=n;t(a)})})},e.getVideoPreview=async function(r,t=5){return new Promise((n,a)=>{var i=document.createElement("video"),o=document.createElement("canvas");o.width=480,o.height=360;var s=o.getContext("2d");i.crossOrigin="anonymous",i.src=r,i.addEventListener("error",c=>{a(c)}),i.addEventListener("loadeddata",function(){const c=i.videoWidth/i.videoHeight;o.width=480,o.height=480/c,i.currentTime=t}),i.addEventListener("seeked",function(){s.drawImage(i,0,0,o.width,o.height);try{var c=o.toDataURL();n(c)}catch(u){a(u)}})})},e.getVideoObjectPreview=async function(r,t,n){return new Promise((a,i)=>{const o=t.getContext("2d"),s=()=>{try{o.drawImage(r,0,0,t.width,t.height);const c=t.toDataURL();a(c),r.removeEventListener("seeked",s)}catch(c){i(c),r.removeEventListener("seeked",s)}};r.addEventListener("seeked",s),r.currentTime=n})}}(qv)),qv}var S4;function QC(){return S4||(S4=1,function(e){var r,t=ql&&ql.__createBinding||(Object.create?function(b,M,N,R){R===void 0&&(R=N);var F=Object.getOwnPropertyDescriptor(M,N);F&&!("get"in F?!M.__esModule:F.writable||F.configurable)||(F={enumerable:!0,get:function(){return M[N]}}),Object.defineProperty(b,R,F)}:function(b,M,N,R){R===void 0&&(R=N),b[R]=M[N]}),n=ql&&ql.__setModuleDefault||(Object.create?function(b,M){Object.defineProperty(b,"default",{enumerable:!0,value:M})}:function(b,M){b.default=M}),a=ql&&ql.__importStar||(r=function(b){return r=Object.getOwnPropertyNames||function(M){var N=[];for(var R in M)Object.prototype.hasOwnProperty.call(M,R)&&(N[N.length]=R);return N},r(b)},function(b){if(b&&b.__esModule)return b;var M={};if(b!=null)for(var N=r(b),R=0;R<N.length;R++)N[R]!=="default"&&t(M,b,N[R]);return n(M,b),M}),i=ql&&ql.__rest||function(b,M){var N={};for(var R in b)Object.prototype.hasOwnProperty.call(b,R)&&M.indexOf(R)<0&&(N[R]=b[R]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var F=0;for(R=Object.getOwnPropertySymbols(b);F<R.length;F++)M.indexOf(R[F])<0&&Object.prototype.propertyIsEnumerable.call(b,R[F])&&(N[R[F]]=b[R[F]])}return N};Object.defineProperty(e,"__esModule",{value:!0}),e.fixRatio=function(b){var M=new DOMParser().parseFromString(b,"image/svg+xml");return M.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(M)},e.jsonToDOM=g,e.jsonToHTML=async function({json:b,elementHook:M}){const N=await g({json:b,elementHook:M});return E({dom:N})};const o=D1(),s=a(kp()),c=D1(),u=Nm(),d=t_(),p=c_(),y=ZC(),f=Ih(),_=(b,M,...N)=>({type:b,props:M,children:N||[]}),S=async({element:b,page:M,store:N})=>{let{src:R}=b;if(b.type==="svg"&&Object.keys(b.colorsReplace).length){const Q=await s.urlToString(R);R=s.replaceColors(Q,new Map(Object.entries(b.colorsReplace)))}let F="";b.flipX&&(F+="scaleX(-1)"),b.flipY&&(F+="scaleY(-1)"),F||(F="none");const j={};if(b.clipSrc){const Q=await s.urlToBase64(b.clipSrc);j["clip-path"]=`url(${Q})`}const O=await(0,c.loadImage)(R),C=O.width*b.cropWidth,A=O.height*b.cropHeight,k=b.width/b.height;let T,V;const G=C/A;b.type==="svg"?(T=C,V=A):k>=G?(T=C,V=C/k):(T=A*k,V=A);const $=T/O.width,te=V/O.height,W=T/V>b.width/b.height?b.height/V:b.width/T,U=T*W/$,z=V*W/te,D=b.cropX*W*O.width,Y=b.cropY*W*O.height;return _("div",{style:Object.assign(Object.assign({},j),{width:"100%",height:"100%","border-radius":b.cornerRadius+"px",border:b.borderSize?`${b.borderSize}px solid ${b.borderColor}`:"none",backgroundRepeat:"no-repeat",background:`url(${R})`,transform:F,"background-size":`${Math.round(U)}px ${Math.round(z)}px`,"background-position-x":-Math.round(D)+"px","background-position-y":-Math.round(Y)+"px"})})},w=({element:b,type:M})=>{const N={"stroke-width":b.height,stroke:b.color,"line-cap":"round","stroke-linejoin":"round",opacity:b.opacity};return M==="arrow"||M==="triangle"?_("polyline",Object.assign({points:`${3*b.height},${2*-b.height} 0,0 ${3*b.height},${2*b.height}`},N)):M==="bar"?_("polyline",Object.assign({points:`0,${2*-b.height} 0,${2*b.height}`},N)):M==="circle"?_("circle",Object.assign({r:b.height},N)):M==="square"?_("polyline",Object.assign({points:`${-b.height},${-b.height} ${-b.height},${b.height} ${b.height},${b.height} ${b.height},${-b.height}`},N)):null},x={image:S,svg:S,text:async({element:b,page:M,store:N})=>{let R={top:0,left:0};b.fill.indexOf("gradient")>=0&&(R=Object.assign(Object.assign({},R),{"background-color":b.fill,"background-image":b.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const F=b.backgroundPadding*(b.fontSize*b.lineHeight),j=_("div",{style:{position:"absolute",top:-F/2+"px",left:-F/2+"px",display:b.backgroundEnabled?"block":"none",width:b.width+F+"px",height:b.height+F+"px","background-color":b.backgroundColor,"border-radius":b.backgroundCornerRadius*(b.fontSize*b.lineHeight*.5)+"px"}});b.verticalAlign==="middle"?(R.top="50%",R.transform="translateY(-50%)"):b.verticalAlign==="bottom"&&(R.bottom=0);const O=/<[a-z][\s\S]*>/i.test(b.text),C=Object.assign(Object.assign({},R),{position:"absolute",width:b.width+"px",color:b.fill,"white-space":"pre-wrap","font-size":b.fontSize+"px","text-align":b.align,"font-family":b.fontFamily,"text-decoration":b.textDecoration||"none","line-height":b.lineHeight,"letter-spacing":b.letterSpacing+"em","font-style":b.fontStyle,"font-weight":b.fontWeight,"-webkit-text-stroke":`${b.strokeWidth}px ${b.stroke}`,"text-stroke":`${b.strokeWidth}px ${b.stroke}`}),A="el-"+b.id,k=O?{id:A}:{},T=`<style>#${A} {${d.resetStyleContent}}</style>`,V=_("div",Object.assign(Object.assign({style:C},k),{innerHTML:O?`${T}${b.text}`:b.text.split(`
|
|
376
|
+
`).join("<br />")}));return _("div",{style:{position:"relative",width:"100%",height:"100%"}},j,V)},line:async({element:b,page:M,store:N})=>_("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},_("rect",{x:0,y:0,width:b.width,height:b.height,fill:b.color}),_("g",{transform:`translate(0 ${b.height/2})`},w({element:b,type:b.startHead})),_("g",{transform:`translate(${b.width} ${b.height/2}) rotate(180)`},w({element:b,type:b.endHead}))),figure:async({element:b,page:M,store:N,elementHook:R})=>{const F=(0,u.figureToSvg)(b),j=_("div",{innerHTML:F});return R&&R({dom:j,element:b})||j},group:async({element:b,page:M,store:N,elementHook:R})=>{const F=await Promise.all(b.children.map(O=>v({element:O,page:M,store:N,elementHook:R}))),j=_("div",{style:{"transform-origin":"top left",opacity:b.opacity}},...F);return R&&R({dom:j,element:b})||j},video:async({element:b,page:M,store:N,elementHook:R})=>{const{cropX:F,cropY:j,cropWidth:O,cropHeight:C}=b,A=await(0,y.getVideoSize)(b.src),k=A.width*O,T=A.height*C,V=b.width/b.height;let G,$;V>=k/T?(G=k,$=k/V):(G=T*V,$=T);const te=G/O,W=$/C,U=F*A.width,z=j*A.height,D=Math.max(b.width/A.width,b.height/A.height),Y={position:"absolute",width:`${Math.round(te*D)}px`,height:`${Math.round(W*D)}px`,left:-Math.round(U*D)+"px",top:-Math.round(z*D)+"px","object-fit":"fill"},Q=`video-${b.id}`,J=_("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden","border-radius":b.cornerRadius+"px",border:b.borderSize?`${b.borderSize}px solid ${b.borderColor}`:"none"}},_("video",{id:Q,src:b.src,style:Y,controls:!0,playsInline:!0,muted:!0,volume:b.volume}));return R&&R({dom:J,element:b})||J},gif:S};async function v({element:b,page:M,store:N,elementHook:R}){let F=await x[b.type];if(F||(F=()=>_("div",{}),console.error(`HTML export does not support ${b.type} type...`)),!b.visible)return null;const j=await F({element:b,page:M,store:N}),O=[],C=[];if(b.blurEnabled&&O.push(`blur(${b.blurRadius/2}px)`),b.brightnessEnabled&&O.push(`brightness(${100*b.brightness+100}%)`),b.sepiaEnabled&&O.push("sepia()"),b.grayscaleEnabled&&O.push("grayscale()"),b.filters)for(const[k,T]of Object.entries(b.filters)){const V=(0,p.shapeFilterToCSS)(p.Effects[k],T.intensity);V&&(O.push(V.filter),V.html&&C.push(V.html))}b.shadowEnabled&&O.push(`drop-shadow(${b.shadowOffsetX}px ${b.shadowOffsetY}px ${b.shadowBlur}px ${b.shadowColor})`);const A=_("div",{id:b.id,style:{position:"absolute",left:b.x+"px",top:b.y+"px",width:b.width+"px",height:b.height+"px",transform:`rotate(${b.rotation}deg)`,"transform-origin":"top left",opacity:b.opacity,display:b.visible&&b.showInExport?"block":"none",filter:O.join(" ")||"none"}},j,...C);return R&&R({dom:A,element:b})||A}async function g({json:b,elementHook:M}){const N=await Promise.all(b.pages.map(j=>async function({page:O,store:C,elementHook:A}){const k=await Promise.all(O.children.map($=>v({element:$,page:O,store:C,elementHook:A}))),T=O.width==="auto"?C.width:O.width,V=O.height==="auto"?C.height:O.height;let G={};if(O.background.indexOf("url")>=0||O.background.indexOf("http")>=0||O.background.indexOf(".jpg")>=0||O.background.indexOf(".png")>=0||O.background.indexOf(".jpeg")>=0){const{width:$,height:te}=await(0,c.loadImage)(O.background),W=await S({element:Object.assign({x:0,y:0,width:$,height:te,src:O.background,cornerRadius:0},(0,o.getCrop)({width:$,height:te},{width:$,height:te})),page:O,store:C});k.unshift(W)}else G=Object.assign(Object.assign({},G),{"background-color":O.background});return _("div",{className:"page",id:O.id,style:Object.assign(Object.assign({},G),{width:T+"px",height:V+"px",overflow:"hidden",position:"relative"})},...k)}({page:j,store:b,elementHook:M}))),R=[];b.pages.forEach(j=>{j.children.forEach(O=>{O.type==="text"&&R.indexOf(O.fontFamily)===-1&&R.push(O.fontFamily)})});const F=R.map(j=>b.fonts.find(O=>O.fontFamily===j)?_("style",{},""):_("link",{href:(0,f.getGoogleFontsUrl)(j),rel:"stylesheet"}));return _("div",{className:"design"},...F,...N)}const E=({dom:b})=>{if(typeof b=="string")return b;if(!b)return"";const M=b.props,{innerHTML:N}=M,R=i(M,["innerHTML"]);return`<${b.type} ${Object.keys(R).map(F=>((j,O)=>typeof O=="object"?`${j}="${Object.keys(O).map(C=>`${C}:${O[C]};`).join(" ")}"`:`${j}="${O}"`)(F,b.props[F])).join(" ")}>${N||b.children.map(F=>E({dom:F})).join("")}</${b.type}>`}}(ql)),ql}var zl={},x4;function JC(){return x4||(x4=1,function(e){var r,t=zl&&zl.__createBinding||(Object.create?function(g,E,b,M){M===void 0&&(M=b);var N=Object.getOwnPropertyDescriptor(E,b);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[b]}}),Object.defineProperty(g,M,N)}:function(g,E,b,M){M===void 0&&(M=b),g[M]=E[b]}),n=zl&&zl.__setModuleDefault||(Object.create?function(g,E){Object.defineProperty(g,"default",{enumerable:!0,value:E})}:function(g,E){g.default=E}),a=zl&&zl.__importStar||(r=function(g){return r=Object.getOwnPropertyNames||function(E){var b=[];for(var M in E)Object.prototype.hasOwnProperty.call(E,M)&&(b[b.length]=M);return b},r(g)},function(g){if(g&&g.__esModule)return g;var E={};if(g!=null)for(var b=r(g),M=0;M<b.length;M++)b[M]!=="default"&&t(E,g,b[M]);return n(E,g),E}),i=zl&&zl.__rest||function(g,E){var b={};for(var M in g)Object.prototype.hasOwnProperty.call(g,M)&&E.indexOf(M)<0&&(b[M]=g[M]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(M=Object.getOwnPropertySymbols(g);N<M.length;N++)E.indexOf(M[N])<0&&Object.prototype.propertyIsEnumerable.call(g,M[N])&&(b[M[N]]=g[M[N]])}return b};Object.defineProperty(e,"__esModule",{value:!0}),e.forEveryChild=void 0,e.fixRatio=function(g){var E=new DOMParser().parseFromString(g,"image/svg+xml");return E.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(E)},e.jsonToDOM=x,e.jsonToSVG=async function({json:g,elementHook:E}){const b=await x({json:g,elementHook:E});return v({dom:b})};const o=D1(),s=a(kp()),c=D1(),u=Nm(),d=c_();e.forEveryChild=(g,E)=>{if(g.children)for(const b of g.children){if(E(b)===!0)break;(0,e.forEveryChild)(b,E)}};const p=(g,E,...b)=>({type:g,props:E,children:b||[]}),y=async({element:g,page:E,store:b})=>{let{src:M}=g;if(g.type==="svg"){const Y=await s.urlToString(M);M=s.replaceColors(Y,new Map(Object.entries(g.colorsReplace)))}else M=await(async Y=>{try{const Q=await fetch(Y);if(typeof Buffer<"u"){const J=await Q.arrayBuffer(),Z=Buffer.from(J).toString("base64");return`data:${Q.headers.get("content-type")||"image/png"};base64,${Z}`}{const J=await Q.blob();return new Promise((Z,ae)=>{const se=new FileReader;se.onloadend=()=>Z(se.result),se.onerror=ae,se.readAsDataURL(J)})}}catch(Q){return console.error("Error converting URL to data URL:",Q),Y}})(M);let N="";g.flipX&&(N+="scaleX(-1)"),g.flipY&&(N+="scaleY(-1)"),g.clipSrc&&await s.urlToBase64(g.clipSrc);const R=await(0,c.loadImage)(M),F=R.width*g.cropWidth,j=R.height*g.cropHeight,O=g.width/g.height;let C,A;const k=F/j;g.type==="svg"?(C=F,A=j):O>=k?(C=F,A=F/O):(C=j*O,A=j);const T=C/R.width,V=A/R.height,G=C/A>g.width/g.height?g.height/A:g.width/C,$=C*G/T,te=A*G/V,W=g.cropX*R.width*G,U=g.cropY*R.height*G,z=`clip-${g.id}`,D=M.replace(/&/g,"&");return p("g",{style:{transform:N}},p("defs",{},p("clipPath",{id:z},p("rect",{x:0,y:0,width:g.width,height:g.height}))),p("image",{href:D,x:-W,y:-U,width:$,height:te,preserveAspectRatio:"none","clip-path":`url(#${z})`}))},f=({element:g,type:E})=>{const b={"stroke-width":g.height,stroke:g.color,"line-cap":"round","stroke-linejoin":"round",opacity:g.opacity};return E==="arrow"||E==="triangle"?p("polyline",Object.assign({points:`${3*g.height},${2*-g.height} 0,0 ${3*g.height},${2*g.height}`},b)):E==="bar"?p("polyline",Object.assign({points:`0,${2*-g.height} 0,${2*g.height}`},b)):E==="circle"?p("circle",Object.assign({r:g.height},b)):E==="square"?p("polyline",Object.assign({points:`${-g.height},${-g.height} ${-g.height},${g.height} ${g.height},${g.height} ${g.height},${-g.height}`},b)):null},_={image:y,svg:y,text:async({element:g,page:E,store:b})=>{const M=(O,C,A,k,T)=>{const V=document.createElement("canvas").getContext("2d");return V.font=`${T} ${k} ${C}px ${A}`,V.measureText(O).width},N=((O,C,A,k,T,V)=>{const G=[];return O.split(`
|
|
377
|
+
`).forEach($=>{const te=$.split(" ");let W="";for(let U=0;U<te.length;U++){const z=W+te[U]+" ";M(z,A,k,T,V)>C+.5&&U>0?(G.push(W.trim()),W=te[U]+" "):W=z}G.push(W.trim())}),G})(g.text,g.width,g.fontSize,g.fontFamily,g.fontWeight,g.fontStyle),R=g.fontSize*g.lineHeight,F=g.align==="center"?"middle":g.align==="right"?"end":"start",j=N.map((O,C)=>p("tspan",{x:g.align==="center"?g.width/2:g.align==="right"?g.width:0,dy:C===0?0:R,innerHTML:O}));return p("g",{},p("text",{fill:g.fill,y:g.fontSize,"font-size":g.fontSize+"px","text-anchor":F,"font-family":g.fontFamily,"font-style":g.fontStyle,"font-weight":g.fontWeight,"text-decoration":g.textDecoration,"line-height":g.lineHeight,"letter-spacing":g.letterSpacing+"em","stroke-width":g.strokeWidth,stroke:g.stroke},...j))},line:async({element:g,page:E,store:b})=>p("g",{},p("line",{x1:0,y1:g.height/2,x2:g.width,y2:g.height/2,stroke:g.color,"stroke-width":g.height}),p("g",{transform:`translate(0 ${g.height/2})`},f({element:g,type:g.startHead})),p("g",{transform:`translate(${g.width} ${g.height/2}) rotate(180)`},f({element:g,type:g.endHead}))),figure:async({element:g,page:E,store:b,elementHook:M})=>{const N=function(F){let j=F.replace(/<svg[^>]*>/,"");return j=j.replace(/<\/svg>/,""),j}((0,u.figureToSvg)(g)),R=p("g",{innerHTML:N});return M&&M({dom:R,element:g})||R},group:async({element:g,page:E,store:b,elementHook:M})=>{const N=await Promise.all(g.children.map(F=>S({element:F,page:E,store:b,elementHook:M}))),R=p("g",{opacity:g.opacity,style:{"transform-origin":"top left"}},...N);return M&&M({dom:R,element:g})||R},gif:y};async function S({element:g,page:E,store:b,elementHook:M}){let N=await _[g.type];N||(N=()=>p("g",{}),console.error(`SVG export does not support ${g.type} type...`));const R=await N({element:g,page:E,store:b}),F=[],j=[];if(g.blurEnabled&&F.push(`blur(${g.blurRadius/2}px)`),g.brightnessEnabled&&F.push(`brightness(${100*g.brightness+100}%)`),g.sepiaEnabled&&F.push("sepia()"),g.grayscaleEnabled&&F.push("grayscale()"),g.shadowEnabled&&F.push(`drop-shadow(${g.shadowOffsetX}px ${g.shadowOffsetY}px ${g.shadowBlur}px ${g.shadowColor})`),g.filters)for(const[C,A]of Object.entries(g.filters)){const k=(0,d.shapeFilterToCSS)(d.Effects[C],A.intensity);if(k&&(F.push(k.filter),k.html)){const T=k.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");j.push(T)}}const O=p("g",{className:"element",id:g.id,transform:g.type!=="group"?`translate(${g.x}, ${g.y}) rotate(${g.rotation})`:void 0,display:g.visible?void 0:"none",style:{"transform-origin":"top left",filter:F.join(" ")}},R,...j);return M&&M({dom:O,element:g})||O}async function w(g){try{const E=await fetch(g),b=await E.blob();return new Promise((M,N)=>{const R=new FileReader;R.onloadend=()=>M(R.result),R.onerror=N,R.readAsDataURL(b)})}catch(E){return console.error("Error embedding font:",E),g}}async function x({json:g,elementHook:E}){const b=await Promise.all(g.pages.map(R=>async function({page:F,store:j,elementHook:O}){const C=await Promise.all(F.children.map(T=>S({element:T,page:F,store:j,elementHook:O}))),A=F.background.indexOf("url")>=0||F.background.indexOf("http")>=0||F.background.indexOf(".jpg")>=0||F.background.indexOf(".png")>=0||F.background.indexOf(".jpeg")>=0;let k;if(A){const T=await(0,c.loadImage)(F.background);k=await(0,c.cropImage)(F.background,Object.assign({width:j.width,height:j.height,x:0,y:0},(0,o.getCrop)({width:j.width,height:j.height},{width:T.width,height:T.height})))}return p("g",{className:"page",style:{}},A?p("image",{"xlink:href":k,x:0,y:0,width:j.width,height:j.height,preserveAspectRatio:"none"}):p("rect",{x:0,y:0,width:j.width,height:j.height,fill:A?void 0:F.background}),...C)}({page:R,store:g,elementHook:E}))),M=[];(0,e.forEveryChild)({children:g.pages},R=>{R.type==="text"&&M.indexOf(R.fontFamily)===-1&&M.push(R.fontFamily)});const N=await async function(R,F){return await Promise.all(R.map(async j=>{var O,C;const A=F.find(k=>k.fontFamily===j);if(A){const k=await w(A.url);return p("style",{},`@font-face { font-family: ${j}; src: url(${k}); }`)}{const k=`https://fonts.googleapis.com/css?family=${j}:bi,normal,i,b`;try{const T=await fetch(k),V=await T.text(),G=(C=(O=V.match(/url\((.*?)\)/g))===null||O===void 0?void 0:O.map(te=>te.replace(/url\((.*?)\)/,"$1")))===null||C===void 0?void 0:C.filter(te=>te.startsWith("https"));if(!(G!=null&&G.length))throw new Error("No font URLs found");const $=await Promise.all(G.map(async te=>{const W=await w(te),U=V.match(/font-style:\s*(.*?);/),z=V.match(/font-weight:\s*(.*?);/),D=U?U[1]:"normal",Y=z?z[1]:"normal";return`@font-face {
|
|
378
|
+
font-family: ${j};
|
|
379
|
+
font-style: ${D};
|
|
380
|
+
font-weight: ${Y};
|
|
381
|
+
src: url(${W});
|
|
382
|
+
}`}));return p("style",{},$.join(`
|
|
383
|
+
`))}catch(T){return console.error("Error embedding Google Font:",T),p("defs",{},p("style",{type:"text/css",innerHTML:`@import url('${k}');`.replace(/&/g,"&")}))}}}))}(M,g.fonts);return p("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${g.width} ${g.height}`,width:g.width,height:g.height},...N,...b)}const v=({dom:g,nestLevel:E=0})=>{if(typeof g=="string")return g;if(!g)return"";const b=g.props,{innerHTML:M}=b,N=i(b,["innerHTML"]),R=" ".repeat(E);return`${R}<${g.type} ${Object.keys(N).map(F=>((j,O)=>typeof O=="object"?`${j}="${Object.keys(O).map(C=>`${C}:${O[C]};`).join(" ")}"`:O==null||O===""?"":`${j}="${O}"`)(F,N[F])).join(" ")}>${M||`
|
|
384
|
+
`+g.children.map(F=>v({dom:F,nestLevel:E+1})).join("")}${R}</${g.type}>
|
|
385
|
+
`}}(zl)),zl}var zv={},E4;function f_(){return E4||(E4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const r=hl,t=u0,n=Nh(),a=Mm(),i=Nh(),o=Dh();e.Page=r.types.model("Page",{id:r.types.identifier,children:r.types.array(r.types.late(()=>n.ElementTypes)),width:r.types.optional(r.types.union(r.types.number,r.types.literal("auto")),"auto"),height:r.types.optional(r.types.union(r.types.number,r.types.literal("auto")),"auto"),background:"white",bleed:0,custom:r.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(s=>{const c=Object.assign({},s),u={};for(var d in c)d[0]!=="_"&&(u[d]=s[d]);return u}).views(s=>({get store(){return(0,r.getParentOfType)(s,a.Store)}})).views(s=>({get startTime(){let c=0;for(const u of s.store.pages){if(u.id===s.id)return c;c+=u.duration}return c},get _exportingOrRendering(){return s._exporting||s._rendering}})).views(s=>({get computedWidth(){return s.width==="auto"?s.store.width:s.width},get computedHeight(){return s.height==="auto"?s.store.height:s.height}})).actions(s=>({toJSON:()=>JSON.parse(JSON.stringify((0,r.getSnapshot)(s))),_forEachElementUp(c,u){const d=c.map(p=>({id:p,index:s.children.findIndex(y=>y.id===p)}));d.sort((p,y)=>y.index-p.index);for(const{index:p}of d){if(p==-1)continue;const y=p<s.children.length-1&&s.children[p+1],f=c.indexOf(y==null?void 0:y.id)>=0;p===s.children.length-1||f||u(p)}},_forEachElementDown(c,u){const d=c.map(p=>({id:p,index:s.children.findIndex(y=>y.id===p)}));d.sort((p,y)=>p.index-y.index);for(const{index:p}of d){if(p==-1)continue;const y=p>0&&s.children[p-1],f=c.indexOf(y==null?void 0:y.id)>=0;p===0||f||u(p)}return!1}})).actions(s=>({clone(c={}){const u=s.toJSON();u.children.forEach(f=>{f.id=(0,t.nanoid)(10),(0,i.forEveryChild)(f,_=>{_.id=(0,t.nanoid)(10)})});const d=Object.assign(Object.assign(Object.assign({},u),{id:(0,t.nanoid)(10)}),c),p=s.store.addPage(d),y=s.store.pages.indexOf(s);return p.setZIndex(y+1),p.select(),p},setZIndex(c){s.store.setPageZIndex(s.id,c)},set(c){Object.assign(s,c)},select(){s.store.selectPage(s.id)},addElement(c,{skipSelect:u=!1}={}){const d=i.TYPES_MAP[c.type];if(!d)return void console.error("Can not find model with type "+c.type);"children"in c&&Array.isArray(c.children)&&(0,i.forEveryChild)(c,y=>{y.id=y.id||(0,t.nanoid)(10)});const p=d.create(Object.assign({id:(0,t.nanoid)(10)},c));return s.children.push(p),p.selectable&&!u&&s.store.selectElements([p.id]),p},canMoveElementsUp(c){let u=!1;return s._forEachElementUp(c,()=>{u=u||!0}),u},moveElementsUp(c){s._forEachElementUp(c,u=>{const d=s.children[u];(0,r.detach)(d),s.children.splice(u+1,0,d)})},canMoveElementsTop(c){return this.canMoveElementsUp(c)},moveElementsTop(c){const u=[],d=[];s.children.forEach(p=>{c.indexOf(p.id)>=0?u.push(p):d.push(p)}),s.children.replace(d.concat(u))},canMoveElementsDown(c){let u=!1;return s._forEachElementDown(c,()=>{u=u||!0}),u},moveElementsDown(c){s._forEachElementDown(c,u=>{const d=s.children[u];(0,r.detach)(d),s.children.splice(u-1,0,d)})},canMoveElementsBottom(c){return this.canMoveElementsDown(c)},moveElementsBottom(c){const u=[],d=[];s.children.forEach(p=>{c.indexOf(p.id)>=0?u.push(p):d.push(p)}),s.children.replace(u.concat(d))},setElementZIndex(c,u){const d=s.children.find(p=>p.id===c);d&&((0,r.detach)(d),s.children.remove(d),s.children.splice(u,0,d))},setSize({width:c,height:u,useMagic:d,softChange:p}){if(d){const y=[],f=A=>A.type==="image"&&A.x<1&&A.y<1&&A.width>=s.computedWidth-2&&A.height>=s.computedHeight-2;(0,i.forEveryChild)(s,A=>{A.type!=="group"&&(f(A)||y.push(A))});const _=y.length?(0,o.getTotalClientRect)(y):{x:0,y:0,width:s.computedWidth,height:s.computedHeight},S=1/4,w=Math.max(0,Math.min(_.x,s.computedWidth-_.x-_.width)),x=s.computedWidth*S,v=Math.max(0,w-x),g=Math.max(0,Math.min(_.y,s.computedHeight-_.y-_.height)),E=s.computedHeight*S,b=Math.max(0,g-E),M=s.computedWidth-2*v,N=s.computedHeight-2*b,R=c/M,F=u/N,j=Math.min(R,F),O=(c-M*j)/2-v*j,C=(u-N*j)/2-b*j;(0,i.forEveryChild)(s,A=>{A.type!=="group"&&(f(A)?A.set({x:A.x*j,y:A.y*j,width:A.width*R,height:A.height*F,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(A.set({x:O+A.x*j,y:C+A.y*j,width:A.width*j,height:A.height*j}),A.type==="text"?A.set({fontSize:A.fontSize*j}):A.type==="figure"&&A.set({strokeWidth:A.strokeWidth*j})))})}p||(s.width=c),p||(s.height=u)}})).actions(s=>({moveElementUp(c){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),s.moveElementsUp([c])},moveElementDown(c){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),s.moveElementsDown([c])},moveElementTop(c){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),s.moveElementsTop([c])},moveElementBottom(c){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),s.moveElementsBottom([c])},play(){s.store.play({startTime:s.startTime,endTime:s.startTime+s.duration})}}))}(zv)),zv}var Uv={},P4;function ek(){return P4||(P4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const r=hl;e.Audio=r.types.model("Audio",{id:r.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,r.getSnapshot)(t))})).actions(t=>({set(n){Object.assign(t,n)}}))}(Uv)),Uv}var O4;function Mm(){return O4||(O4=1,function(e){var r,t=Is&&Is.__createBinding||(Object.create?function(C,A,k,T){T===void 0&&(T=k);var V=Object.getOwnPropertyDescriptor(A,k);V&&!("get"in V?!A.__esModule:V.writable||V.configurable)||(V={enumerable:!0,get:function(){return A[k]}}),Object.defineProperty(C,T,V)}:function(C,A,k,T){T===void 0&&(T=k),C[T]=A[k]}),n=Is&&Is.__setModuleDefault||(Object.create?function(C,A){Object.defineProperty(C,"default",{enumerable:!0,value:A})}:function(C,A){C.default=A}),a=Is&&Is.__importStar||(r=function(C){return r=Object.getOwnPropertyNames||function(A){var k=[];for(var T in A)Object.prototype.hasOwnProperty.call(A,T)&&(k[k.length]=T);return k},r(C)},function(C){if(C&&C.__esModule)return C;var A={};if(C!=null)for(var k=r(C),T=0;T<k.length;T++)k[T]!=="default"&&t(A,C,k[T]);return n(A,C),A}),i=Is&&Is.__rest||function(C,A){var k={};for(var T in C)Object.prototype.hasOwnProperty.call(C,T)&&A.indexOf(T)<0&&(k[T]=C[T]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function"){var V=0;for(T=Object.getOwnPropertySymbols(C);V<T.length;V++)A.indexOf(T[V])<0&&Object.prototype.propertyIsEnumerable.call(C,T[V])&&(k[T[V]]=C[T[V]])}return k},o=Is&&Is.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=O;const s=hl,c=GC(),u=u0,d=o(Hs()),p=vs,y=WC(),f=$C(),_=YC(),S=Tm(),w=a(Ih()),x=gc(),v=jf(),g=Rm(),E=u_(),b=KC(),M=QC(),N=JC(),R=f_(),F=Nh(),j=ek();function O({key:C,showCredit:A}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:A,_key:C})}(0,s.setLivelinessChecking)("ignore"),e.Font=s.types.model("Font",{fontFamily:s.types.string,url:s.types.optional(s.types.string,""),styles:s.types.frozen()}).preProcessSnapshot(C=>Object.assign(Object.assign({},C),{fontFamily:C.fontFamily||C.name})),e.Store=s.types.model("Store",{role:"",pages:s.types.array(R.Page),fonts:s.types.array(e.Font),audios:s.types.array(j.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,schemaVersion:2,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:s.types.frozen(),selectedElementsIds:s.types.array(s.types.string),animatedElementsIds:s.types.array(s.types.string),history:s.types.optional(c.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(C=>{const A=(0,p.computed)(()=>{const k={};return(0,F.forEveryChild)({children:C.pages},T=>(k[T.id]=T,!1)),k},{keepAlive:!0});return{get _idsMap(){return A.get()}}}).views(C=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),C.bleedVisible},get selectedElements(){return C.selectedElementsIds.map(A=>{for(const k of C.pages)for(const T of k.children)if(T.id===A)return T}).filter(A=>!!A)},get children(){return C.pages},get selectedShapes(){const A=[];return(0,F.forEveryChild)({children:C.selectedElements},k=>{k.type!=="group"&&A.push(k)}),A},get activePage(){return C.pages.slice().find(A=>A.id===C._activePageId)||(C.pages.length?C.pages[0]:null)},get duration(){let A=0;return C.pages.forEach(k=>{A+=k.duration}),A},get _hasCroppedImages(){return C.find(A=>A.type==="image"&&A._cropModeEnabled)},find(A){let k;return(0,F.forEveryChild)({children:C.pages},T=>{if(!k&&A(T))return k=T,!0}),k},getElementById:A=>C._idsMap[A]})).actions(C=>{let A=0,k=null,T=!1;return{afterCreate(){C.history.canUndo},setCurrentTime(V){C.currentTime=V},_togglePlaying(V=!C.isPlaying){C.isPlaying=V},play({animatedElementsIds:V=[],startTime:G=0,currentTime:$=0,endTime:te=C.duration,repeat:W=!1}={}){$&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),G=$),C.animatedElementsIds=(0,s.cast)(V),C.currentTime=G,C.isPlaying=!0,A=Date.now(),k=te,T=W,requestAnimationFrame(C.seek)},checkActivePage(){let V=0;for(const G of C.pages){if(C.currentTime>=G.startTime&&C.currentTime<G.startTime+G.duration){C.selectPage(G.id);break}V+=G.duration}},seek(){if(!C.isPlaying)return;const V=Date.now(),G=V-A;A=V,C.currentTime+=G,C.checkActivePage();const $=k||C.duration;C.isPlaying&&C.currentTime<$?requestAnimationFrame(C.seek):C.isPlaying&&T?(C.currentTime=0,requestAnimationFrame(C.seek)):C.stop()},stop(){C.isPlaying=!1,C.currentTime=0,C.animatedElementsIds=(0,s.cast)([]),C.checkActivePage()}}}).actions(C=>({__(){C._validated||((0,S.validateKey)(C._key,C._forceShowCredit),C._validated=!0)},set(A){Object.assign(C,A)},setUnit({unit:A,dpi:k}){C.unit=A||C.unit,C.dpi=k||C.dpi},setRole(A){C.role=A},addPage(A){const k=R.Page.create(Object.assign({id:(0,u.nanoid)(10)},A));return C.pages.push(k),C._activePageId=k.id,k},selectPage(A){C._activePageId=A},selectElements(A){const k=A.map(T=>C.getElementById(T)).sort((T,V)=>T.page.children.indexOf(T)-T.page.children.indexOf(V)).filter(T=>!!T).map(T=>T.id);C.selectedElementsIds=(0,s.cast)(k)},toggleBleed(A){C.bleedVisible=A??!C.bleedVisible},toggleRulers(A){C.rulesVisible=A??!C.rulesVisible},openSidePanel(A){C.openedSidePanel!==A&&(C.previousOpenedSidePanel=C.openedSidePanel,C.openedSidePanel=A)},setScale(A){C.scale=A},_setScaleToFit(A){C.scaleToFit=A},setElementsPixelRatio(A){C._elementsPixelRatio=A},setSize(A,k,T){C.pages.forEach(V=>{V.setSize({width:A,height:k,useMagic:T,softChange:!0})}),C.width=A,C.height=k},setPageZIndex(A,k){const T=C.pages.find(V=>V.id===A);T&&((0,s.detach)(T),C.pages.remove(T),C.pages.splice(k,0,T))},deletePages(A){const k=C.pages.indexOf(C.activePage);A.forEach(G=>{const $=C.pages.find(te=>te.id===G);(0,s.destroy)($)});const T=Math.min(C.pages.length-1,k),V=C.pages[T];V&&(C._activePageId=V.id),C.selectedElementsIds=(0,s.cast)(C.selectedElementsIds.filter(G=>C.getElementById(G)))},groupElements(A,k={}){const T=A.map($=>C.getElementById($)),V=T[0].page;if(T.forEach($=>{$&&(0,s.detach)($)}),!T.length)return;const G=Object.assign({id:(0,u.nanoid)(10),children:T,type:"group"},k);return V.children.push(G),C.selectedElementsIds=(0,s.cast)([G.id]),V.children.find($=>$.id===G.id)},ungroupElements(A){const k=A.map(V=>C.getElementById(V)),T=[];k.forEach(V=>{if(V&&V.type==="group"){const G=V.page,$=G.children.indexOf(V);V.children.forEach(te=>{T.push(te.id)}),V.children.forEach(te=>{(0,s.detach)(te),G.children.push(te)}),G.children.splice($,1)}}),C.selectedElementsIds=(0,s.cast)(T)},deleteElements(A){const k=[];C.find(T=>(A.includes(T.id)&&k.push(T),!1)),k.forEach(T=>{(0,s.destroy)(T)}),C.selectedElementsIds=(0,s.cast)(C.selectedElementsIds.filter(T=>C.getElementById(T)))},on(A,k){if(A==="change"){let T=C.toJSON();return(0,s.onSnapshot)(C,V=>{const G=C.toJSON();!(0,E.deepEqual)(T,G)&&(T=G,k(G))})}},async _toCanvas({pixelRatio:A,ignoreBackground:k,pageId:T,mimeType:V,includeBleed:G,_skipTimeout:$,quickMode:te=!1}={}){var W;const U=A||1;T=T||((W=C.pages[0])===null||W===void 0?void 0:W.id);const z=C.pages.find(me=>me.id===T);if(!z)throw new Error(`No page for export with id ${T}`);const D=C._elementsPixelRatio;U>C._elementsPixelRatio&&C.setElementsPixelRatio(U),te?z==null||z.set({_forceMount:!0}):z==null||z.set({_exporting:!0});const Y=await(0,b.waitTillAvailable)(()=>d.default.stages.find(me=>me.getAttr("pageId")===T));if(!Y)throw z==null||z.set({_forceMount:!1,_exporting:!1}),C.setElementsPixelRatio(D),new Error(`Export is failed. Can not find stage for page ${T}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);await C.waitLoading({_skipTimeout:$});const Q=Y.findOne(".page-container");if(!Q)throw C.setElementsPixelRatio(D),z==null||z.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const J=Y.position();Y.position({x:0,y:0}),Y.find("Transformer").forEach(me=>{me.setAttr("oldVisible",me.visible()),me.visible(!1)}),Q.find(".page-background").forEach(me=>me.shadowEnabled(!1)),Q.find(".page-background").forEach(me=>me.strokeEnabled(!1)),Q.find(".highlighter").forEach(me=>me.visible(!1));const Z=Q.findOne(".page-background-group"),ae=Z.clip();Z.clip({x:null,y:null,width:null,height:null});const se=Q.findOne(".elements-container"),ce=se.clip();se.clip({x:null,y:null,width:null,height:null});const de=Q.find(me=>me.getAttr("hideInExport"));de.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.hide()});const Oe=Q.find(me=>!me.visible()&&me.getAttr("editModeEnabled"));Oe.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.show()}),k&&Q.find(".page-background").forEach(me=>me.hide());const Le=G?z.bleed:0;let ke=Le;!C.bleedVisible&&G||(C.bleedVisible||G?C.bleedVisible&&G?ke=0:C.bleedVisible&&!G&&(ke=-z.bleed):ke=0);const Se=document.createElement("canvas");Se.width=Math.round((z.computedWidth+2*Le)*U),Se.height=Math.round((z.computedHeight+2*Le)*U);const ye=Se.getContext("2d");V==="image/jpeg"&&(ye.fillStyle="white",ye.fillRect(0,0,Se.width,Se.height));const Je=Q.scale();Q.scale({x:1,y:1});const we=Q.toCanvas({x:Q.x()-ke,y:Q.y()-ke,width:z.computedWidth+2*Le,height:z.computedHeight+2*Le,pixelRatio:U});return Q.scale(Je),ye.drawImage(we,0,0,Se.width,Se.height),d.default.Util.releaseCanvas(we),k&&Q.find(".page-background").forEach(me=>me.show()),de.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),Oe.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),Q.find(".page-background").forEach(me=>me.shadowEnabled(!0)),Q.find(".page-background").forEach(me=>me.strokeEnabled(!0)),Y.find("Transformer").forEach(me=>{me.visible(me.getAttr("oldVisible"))}),Q.find(".highlighter").forEach(me=>me.visible(!0)),Z.clip(ae),se.clip(ce),Y.position(J),z==null||z.set({_exporting:!1,_forceMount:!1}),await new Promise(me=>setTimeout(me)),C.setElementsPixelRatio(D),Se},async toDataURL(A={}){var{mimeType:k,quality:T}=A,V=i(A,["mimeType","quality"]);const G=await C._toCanvas(Object.assign({mimeType:k},V)),$=G.toDataURL(k,T);return d.default.Util.releaseCanvas(G),$},async toBlob(A={}){var{mimeType:k,quality:T}=A,V=i(A,["mimeType","quality"]);const G=await C._toCanvas(Object.assign({mimeType:k},V)),$=await new Promise(te=>{G.toBlob(te,k,T)});return d.default.Util.releaseCanvas(G),$},async saveAsImage(A={}){var{fileName:k}=A,T=i(A,["fileName"]);const V=T.mimeType||"image/png",G=V.split("/")[1];(0,y.downloadFile)(await C.toDataURL(T),k||"polotno."+G,V)},async _toPDF(A){const k=A.dpi||C.dpi,T=A.parallel||1,V=A.unit||(C.unit==="px"?"mm":C.unit),G=A.pixelRatio||1,$=A.pageIds||C.pages.map(de=>de.id),te=C.pages.filter(de=>$.includes(de.id)),W=await(0,f.getJsPDF)(),U=de=>(0,g.pxToUnit)({px:de,unit:V,dpi:k}),z=A.cropMarkSize||0,D=U(z),Y=te[0]||{},Q=A.includeBleed?Y.bleed:0,J=U(Y.computedWidth+2*Q+2*D),Z=U(Y.computedHeight+2*Q+2*D);var ae=new W({unit:V,orientation:J>Z?"landscape":"portrait",format:[J,Z],compress:!0,putOnlyUsedFonts:!0});ae.deletePage(1);const se=((de,Oe)=>{for(var Le=[],ke=0;ke<de.length;ke+=Oe)Le.push(de.slice(ke,ke+Oe));return Le})(te,T);let ce=0;for(const de of se){const Oe=de.map(async Le=>{const ke=A.includeBleed?Le.bleed:0,Se=Le.computedWidth+2*ke+2*z,ye=Le.computedHeight+2*ke+2*z,Je=U(Se),we=U(ye);let me=0,Ee=G;for(;me<10;){me+=1,me===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const Te=await C.toDataURL(Object.assign(Object.assign({},A),{pageId:Le.id,pixelRatio:Ee}));if(Te.length>20)return A.onProgress&&A.onProgress(++ce/$.length*.9),{url:Te,width:Je,height:we,widthPx:Se,heightPx:ye};Ee*=.8}});(await Promise.all(Oe)).forEach(({url:Le,width:ke,height:Se,widthPx:ye,heightPx:Je})=>{ae.addPage([ke,Se],ke>Se?"landscape":"portrait");const we=ae.getCurrentPageInfo();var me;switch(V){case"pt":me=1;break;case"mm":me=72/25.4;break;case"cm":me=72/2.54;break;case"in":me=72;break;case"px":me=.75;break;case"pc":case"em":me=12;break;case"ex":me=6;break;default:throw"Invalid unit: "+V}if(we.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:ke*me,topRightY:Se*me},we.pageContext.artBox={bottomLeftX:U(z+Q)*me,bottomLeftY:U(z+Q)*me,topRightX:U(ye-z-Q)*me,topRightY:U(Je-z-Q)*me},we.pageContext.bleedBox={bottomLeftX:U(z+Q)*me,bottomLeftY:U(z+Q)*me,topRightX:U(ye-z-Q)*me,topRightY:U(Je-z-Q)*me},D){ae.setLineWidth(U(1));const Ee=D+U(Q);ae.line(Ee,0,Ee,D),ae.line(0,Ee,D,Ee),ae.line(ke-Ee,0,ke-Ee,D),ae.line(ke,Ee,ke-D,Ee),ae.line(0,Se-Ee,D,Se-Ee),ae.line(Ee,Se,Ee,Se-D),ae.line(ke,Se-Ee,ke-D,Se-Ee),ae.line(ke-Ee,Se,ke-Ee,Se-D)}ae.addImage(Le,D,D,ke-2*D,Se-2*D,void 0,"FAST")})}return ae},toPDFDataURL:async A=>(await C._toPDF(Object.assign({mimeType:"image/jpeg"},A))).output("datauristring"),async toGIFDataURL(A={}){const k=A.pixelRatio||1,T=await(0,_.createGIF)({width:C.width*k,height:C.height*k}),V=1e3/(A.fps||10),G=C.duration/V;for(let $=0;$<G-1;$++){const te=$*V||1;C.setCurrentTime(te);let W=0,U="";for(const D of C.pages)if(W+=D.duration,D.set({_rendering:W>te}),W>te){U=D.id;break}const z=await C._toCanvas({pixelRatio:k,pageId:U,_skipTimeout:!0});T.addFrame(z.getContext("2d"),{delay:V,copy:!0})}for(const $ of C.pages)$.set({_rendering:!1});return C.stop(),T.render(),new Promise($=>{T.on("finished",function(te){(function(W,U){var z=new FileReader;z.onload=function(D){U(D.target.result)},z.readAsDataURL(W)})(te,$)})})},async saveAsGIF(A={}){var{fileName:k}=A,T=i(A,["fileName"]);const V=await C.toGIFDataURL(T);(0,y.downloadFile)(V,k||"polotno.gif")},async toHTML({elementHook:A}={elementHook:void 0}){const k=C.toJSON();return(0,M.jsonToHTML)({json:k,elementHook:A})},async saveAsHTML({fileName:A}={}){const k=await C.toHTML(),T="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,y.downloadFile)(T,A||"polotno.html")},async toSVG({elementHook:A,pageId:k}={elementHook:void 0,pageId:void 0}){var T;const V=C.toJSON();k=k||((T=V.pages[0])===null||T===void 0?void 0:T.id);const G=V.pages.find($=>$.id===k);return(0,N.jsonToSVG)({json:Object.assign(Object.assign({},V),{pages:G?[G]:[]}),elementHook:A})},async saveAsSVG({fileName:A,elementHook:k,pageId:T}={}){const V=await C.toSVG({elementHook:k,pageId:T}),G="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(V)));(0,y.downloadFile)(G,A||"polotno.svg")},async saveAsPDF(A={}){var{fileName:k}=A,T=i(A,["fileName"]);(await C._toPDF(Object.assign({mimeType:"image/jpeg"},T))).save(k||"polotno.pdf")},async waitLoading({_skipTimeout:A=!1}={}){A||await new Promise(k=>setTimeout(k,50)),await(0,v.whenLoaded)()},toJSON:()=>({width:C.width,height:C.height,fonts:(0,s.getSnapshot)(C.fonts),pages:(0,s.getSnapshot)(C.pages),audios:(0,s.getSnapshot)(C.audios),unit:C.unit,dpi:C.dpi,custom:C.custom,schemaVersion:C.schemaVersion}),loadJSON(A,k=!1){var T;const V=Object.assign({},A),G=V.schemaVersion||0;G<1&&x.flags.htmlRenderEnabled&&(0,F.forEveryChild)({children:V.pages},U=>{if(U.type==="text"){const D=U.letterSpacing*16;U.letterSpacing=D/U.fontSize}}),G<2&&(0,F.forEveryChild)({children:V.pages},U=>{U.filters&&Object.keys(U.filters).forEach(z=>{if(["warm","cold","natural"].includes(z))return;const D=U.filters[z];D&&typeof D.intensity=="number"&&(D.intensity=D.intensity/100)})}),delete V.schemaVersion;const $=C.pages.indexOf(C.activePage);let te=(T=V.pages[$]||V.pages[0])===null||T===void 0?void 0:T.id;V._activePageId=te;const W=Object.assign({},(0,s.getSnapshot)(C));Object.assign(W,V),W.history=k?C.history.toJSON():{history:[],undoIdx:-1},(0,s.applySnapshot)(C,W)},clear({keepHistory:A=!1}={}){const k=C.pages.map(T=>T.id);C.deletePages(k),C.custom=null,A||C.history.clear()},addFont(A){C.removeFont(A.fontFamily),C.fonts.push(A),C.loadFont(A.fontFamily)},removeFont(A){C.fonts.filter(k=>k.fontFamily===A).forEach(k=>(0,s.destroy)(k))},addAudio(A){const k=j.Audio.create(Object.assign({id:(0,u.nanoid)(10)},A));C.audios.push(k)},removeAudio(A){const k=C.audios.find(T=>T.id===A);k&&C.audios.remove(k)},async loadFont(A){const k=C.fonts.find(V=>V.fontFamily===A)||w.globalFonts.find(V=>V.fontFamily===A);let T=[{fontStyle:"normal",fontWeight:"normal"}];return k?(k.styles&&(T=k.styles.map(V=>({fontStyle:V.fontStyle||"normal",fontWeight:V.fontWeight||"normal"}))),w.injectCustomFont(k)):w.injectGoogleFont(A),Promise.all(T.map(V=>w.loadFont(A,V.fontStyle,V.fontWeight)))},validate:A=>e.Store.validate(A,[{path:"",type:e.Store}]).map(k=>({path:"store"+k.context.map(T=>T.path).join("."),message:k.message}))})),e.default=O}(Is)),Is}var A4;function h_(){return A4||(A4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const r=hl,t=u0,n=Mm(),a=f_(),i=Nh();e.Node=r.types.model("Node",{id:r.types.identifier,type:"none",name:"",opacity:1,custom:r.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var s in o)o[s]===null&&(o[s]=void 0);return o}).postProcessSnapshot(o=>{const s=Object.assign({},o),c={};for(var u in s)u[0]!=="_"&&(c[u]=o[u]);return c}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,r.getParentOfType)(o,a.Page)},get store(){return(0,r.getParentOfType)(o,n.Store)},get top(){let s=o;for(;;){if(!(0,r.hasParentOfType)(s,i.GroupElement))return s;s=(0,r.getParentOfType)(s,i.GroupElement)}},get parent(){return(0,r.hasParentOfType)(o,i.GroupElement)?(0,r.getParentOfType)(o,i.GroupElement):(0,r.hasParentOfType)(o,a.Page)?(0,r.getParentOfType)(o,a.Page):(0,r.hasParentOfType)(o,n.Store)?(0,r.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,r.getSnapshot)(o))})).actions(o=>({clone(s={},{skipSelect:c=!1}={}){const u=JSON.parse(JSON.stringify(o.toJSON()));return s.id=s.id||(0,t.nanoid)(10),(0,i.forEveryChild)(u,d=>{d.id=(0,t.nanoid)(10)}),Object.assign(u,s),o.page.addElement(u,{skipSelect:c})},set(s){Object.assign(o,s)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(s){o.parent.setElementZIndex(o.id,s)},beforeDestroy(){}}))}(kv)),kv}var Hv={},Vv={},C4;function tk(){return C4||(C4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const r=Dh(),t={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},n={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}};e.animations={fade:({dTime:a,element:i,animation:o})=>{const s=a/o.duration;return o.type==="enter"?{opacity:s*i.opacity}:{opacity:(1-s)*i.opacity}},rotate:({dTime:a,element:i,animation:o})=>{const s=a/o.duration*360;return(0,r.rotateAroundCenter)({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation},s)},blink:({dTime:a,element:i,animation:o})=>{const s=o.duration,c=a%s/(s/2),u=c<=1?c:2-c;return{opacity:i.opacity*u}},bounce:({dTime:a,element:i,animation:o})=>{var s;const c=o.duration,u=c/2,d=(s=o.data.strength)!==null&&s!==void 0?s:1,p={},y={x:i.x+i.width/3*d,y:i.y+i.height/3*d,width:i.width/3*d,height:i.height/3*d,fontSize:i.fontSize/3*d},f={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize},_=a%c/u,S=_<=1?_:2-_;for(let w in y){const x=y[w],v=f[w]-x;p[w]=x+S*v}return p},move:({dTime:a,element:i,animation:o})=>{var s;const c=t[o.data.direction]||t.right,u=(s=o.data.strength)!==null&&s!==void 0?s:1,d={};for(var p in c.from){let y=c.from[p],f=c.to[p];o.type==="exit"&&(y=c.to[p],f=-c.from[p]),y*=u,f*=u;const _=i[p]+y,S=i[p]+f-_;d[p]=_+a/o.duration*S}return d},zoom:({dTime:a,element:i,animation:o})=>{var s;const c={},u=1+(((o.data.direction||"in")==="in"?.75:1.25)-1)*((s=o.data.strength)!==null&&s!==void 0?s:1),d=i.rotation*Math.PI/180,p=Math.cos(d),y=Math.sin(d),f=i.width*(1-u),_=i.height*(1-u),S=(f*p-_*y)/2,w=(f*y+_*p)/2,x={x:i.x+S,y:i.y+w,width:i.width*u,height:i.height*u,fontSize:i.fontSize*u},v={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize};for(var g in x){let E=x[g],b=v[g];if(o.type==="exit"){const N=E;E=b,b=N}const M=b-E;c[g]=E+a/o.duration*M}return c},cameraZoom:({dTime:a,element:i,animation:o})=>{var s,c,u;const d={},p=o.data.direction||"right",y=n[p]||n.right,f=(s=o.data.movementStrength)!==null&&s!==void 0?s:.1,_=(c=o.data.shakeStrength)!==null&&c!==void 0?c:.015;u=o.data.zoomStrength;const S=a/o.duration,w=_*(1-S),x=Math.sin(12*S)*w*.7+Math.sin(8*S)*w*.3;o.type==="exit"&&Math.max(i.cropWidth||1,i.cropHeight||1),o.type;const v=1-Math.pow(1-S,2),g=i.cropX||0,E=i.cropY||0,b=i.cropWidth||1,M=i.cropHeight||1,N=b,R=M;let F,j,O=0,C=0;if(y.cropX){const A=y.cropX>0?1-(g+b):g;O=Math.min(A,Math.abs(f))*y.cropX}if(y.cropY){const A=y.cropY>0?1-(E+M):E;C=Math.min(A,Math.abs(f))*y.cropY}return o.type==="enter"?(F=y.cropX?g+O*(1-v):g,j=y.cropY?E+C*(1-v):E):(F=y.cropX?g+O*v:g,j=y.cropY?E+C*v:E),d.cropX=Math.max(0,Math.min(1-N,F+x*N)),d.cropY=Math.max(0,Math.min(1-R,j+x*R)),d.cropWidth=N,d.cropHeight=R,d}},e.animate=({element:a,dTime:i,animation:o})=>{const s=e.animations[o.name];return s?s({element:a,dTime:i,animation:o}):(console.error("Can not find animation type: "+o.name),{})},e.registerAnimation=(a,i)=>{e.animations[a]&&console.warn(`Animation "${a}" already exists and will be overridden`),e.animations[a]=i}}(Vv)),Vv}var k4;function Bh(){return k4||(k4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.INDEPENDENT_FILTERS=e.ShapeFilter=e.getDiff=e.Animation=void 0;const r=hl,t=tk(),n=vs,a=h_();e.Animation=r.types.model("Animation",{delay:0,duration:500,enabled:!0,type:r.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:r.types.frozen({})}),e.getDiff=(i,o)=>{const s={};for(const c in o)if(typeof i[c]=="number"&&typeof o[c]=="number"){const u=o[c]-i[c];u!==0&&(s[c]=u)}return s},e.ShapeFilter=r.types.model("ShapeFilter",{intensity:1}),e.INDEPENDENT_FILTERS=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],e.Shape=a.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:r.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:r.types.map(e.ShapeFilter),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(i=>{const o=Object.assign(Object.assign({},i),{x:i.x||0,y:i.y||0,filters:Array.isArray(i.filters)?{}:i.filters});return"width"in i&&(o.width=o.width||1),"height"in i&&(o.height=o.height||1),i.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1,o.removable=!1),o}).views(i=>{const o=(0,n.observable)({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize}),s=(0,n.action)(u=>{Object.assign(o,u)}),c=(0,n.action)(u=>{for(const d in u)typeof o[d]=="number"&&(o[d]=o[d]+u[d])});return{get a(){const{currentTime:u}=i.store;if(s({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize,cropX:i.cropX,cropY:i.cropY,cropWidth:i.cropWidth,cropHeight:i.cropHeight}),u===0)return o;const d=u-i.page.startTime;if(d>i.page.duration||d<0)return o;const p=i.store.animatedElementsIds;if(p.length&&!p.includes(i.id))return o;const y=i.animations.find(x=>x.type==="enter"),f=(y==null?void 0:y.enabled)&&d<y.delay;f&&s({opacity:0});const _=(y==null?void 0:y.enabled)&&d>=y.delay&&d<=y.delay+y.duration;if(_){const x=d-y.delay,v=(0,t.animate)({element:i,animation:y,dTime:x}),g=(0,e.getDiff)(i,v);c(g)}const S=i.animations.find(x=>x.type==="exit");if(!f&&!_&&(S!=null&&S.enabled)&&d>=i.page.duration-S.duration-S.delay&&d<=i.page.duration-S.delay){const x=d-(i.page.duration-S.duration-S.delay),v=(0,t.animate)({element:i,animation:S,dTime:x}),g=(0,e.getDiff)(i,v);c(g)}S!=null&&S.enabled&&d>=i.page.duration-S.delay&&s({opacity:0});const w=i.animations.find(x=>x.type==="loop");if(w!=null&&w.enabled){const x=d,v=(0,t.animate)({element:i,animation:w,dTime:x}),g=(0,e.getDiff)(i,v);c(g)}return o},animated:u=>i.a[u]}}).actions(i=>({setAnimation(o,s){const c=i.animations.find(u=>u.type===o);c?Object.assign(c,s):i.animations.push(Object.assign({type:o},s))},setFilter(o,s){e.INDEPENDENT_FILTERS.includes(o)||i.filters.forEach((c,u)=>{e.INDEPENDENT_FILTERS.includes(u.toString())||i.filters.delete(u.toString())}),s==null?i.filters.delete(o):i.filters.set(o,{intensity:s})}}))}(Hv)),Hv}var Gv={},L4;function rk(){return L4||(L4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const r=hl,t=Bh();e.TextElement=t.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:r.types.optional(r.types.union(r.types.number,r.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(a){n._editModeEnabled=a??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Gv)),Gv}var Wv={},N4;function Im(){return N4||(N4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const r=Bh();e.ImageElement=r.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,stretchEnabled:!1,_cropModeEnabled:!1}).actions(t=>({toggleCropMode(n){t._cropModeEnabled=n??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}(Wv)),Wv}var $v={},T4;function nk(){return T4||(T4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const r=Im();e.VideoElement=r.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}($v)),$v}var Yv={},R4;function ik(){return R4||(R4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const r=hl,t=Bh();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:r.types.array(r.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Yv)),Yv}var Xv={},M4;function ak(){return M4||(M4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const r=hl,t=Bh();e.SVGElement=t.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,stretchEnabled:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:r.types.map(r.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource,colorsReplace:Array.isArray(n.colorsReplace)?{}:n.colorsReplace})).actions(n=>({replaceColor(a,i){n.colorsReplace.set(a,i)}}))}(Xv)),Xv}var Kv={},I4;function ok(){return I4||(I4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=hl,t=Bh();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:r.types.array(r.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(Kv)),Kv}var Zv={},j4;function sk(){return j4||(j4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const r=Im();e.GifElement=r.ImageElement.named("Gif").props({type:"gif",duration:0,keepRatio:!0})}(Zv)),Zv}var F4;function Nh(){return F4||(F4=1,function(e){var r=Jd&&Jd.__rest||function(S,w){var x={};for(var v in S)Object.prototype.hasOwnProperty.call(S,v)&&w.indexOf(v)<0&&(x[v]=S[v]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var g=0;for(v=Object.getOwnPropertySymbols(S);g<v.length;g++)w.indexOf(v[g])<0&&Object.prototype.propertyIsEnumerable.call(S,v[g])&&(x[v[g]]=S[v[g]])}return x};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=function(S,w){const x=S.type;if(!x)throw new Error('You must pass "type" attribute to custom model.');let v=i.Shape.named(x).props(S);w&&(v=w(v)),e.TYPES_MAP[x]=v,_.push(v)};const t=hl,n=u0,a=h_(),i=Bh(),o=rk(),s=Im(),c=nk(),u=ik(),d=ak(),p=ok(),y=sk();e.forEveryChild=(S,w)=>{if(S.children)for(const x of S.children){if(w(x)===!0)break;(0,e.forEveryChild)(x,w)}};const f=[...new Array(20)].map((S,w)=>t.types.late(()=>_[w]));e.ElementTypes=t.types.union({dispatcher:S=>{const w=e.TYPES_MAP[S.type];if(!w)throw new Error(`Unknown element type: "${S.type}"`);return w}},d.SVGElement,o.TextElement,s.ImageElement,u.LineElement,c.VideoElement,p.FigureElement,y.GifElement,t.types.late(()=>e.GroupElement),...f),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(S=>({get draggable(){let w=!0;return(0,e.forEveryChild)(S,x=>{x.draggable||(w=!1)}),w},get resizable(){let w=!0;return(0,e.forEveryChild)(S,x=>{x.resizable||(w=!1)}),w},get contentEditable(){let w=!0;return(0,e.forEveryChild)(S,x=>{x.contentEditable||(w=!1)}),w},get styleEditable(){let w=!0;return(0,e.forEveryChild)(S,x=>{x.styleEditable||(w=!1)}),w},get locked(){let w=!0;return(0,e.forEveryChild)(S,x=>{x.locked||(w=!1)}),w}})).actions(S=>({set(w){var{draggable:x,contentEditable:v,styleEditable:g,resizable:E}=w,b=r(w,["draggable","contentEditable","styleEditable","resizable"]);x!==void 0&&(0,e.forEveryChild)(S,M=>{M.set({draggable:x})}),v!==void 0&&(0,e.forEveryChild)(S,M=>{M.set({contentEditable:v})}),g!==void 0&&(0,e.forEveryChild)(S,M=>{M.set({styleEditable:g})}),E!==void 0&&(0,e.forEveryChild)(S,M=>{M.set({resizable:E})}),Object.assign(S,b)},addElement(w,{skipSelect:x=!1}={}){const v=e.TYPES_MAP[w.type];if(!v)return void console.error("Can not find model with type "+w.type);w.children&&w.children.forEach(E=>{E.id=E.id||(0,n.nanoid)(10)});const g=v.create(Object.assign({id:(0,n.nanoid)(10)},w));return S.children.push(g),g.selectable&&!x&&S.store.selectElements([g.id]),g},setElementZIndex(w,x){const v=S.children.find(g=>g.id===w);v&&((0,t.detach)(v),S.children.remove(v),S.children.splice(x,0,v))}}));const _=[];e.TYPES_MAP={svg:d.SVGElement,text:o.TextElement,image:s.ImageElement,group:e.GroupElement,line:u.LineElement,video:c.VideoElement,figure:p.FigureElement,gif:y.GifElement}}(Jd)),Jd}var D4;function lk(){return D4||(D4=1,function(e){var r=Dd&&Dd.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=function(E,b){x[E]=b};const t=r(ni()),n=Us,a=r(Hs()),i=z8(),o=Om(),s=TC(),c=RC(),u=i_(),d=MC(),p=BC(),y=Fu,f=qC(),_=Nh(),S=gc(),w=(0,n.observer)(E=>{const{element:b,store:M}=E,{children:N}=b,R=b.selectable||M.role==="admin";return t.default.createElement(y.Group,{opacity:b.opacity,listening:R,hideInExport:!b.showInExport},N.map(F=>t.default.createElement(g,Object.assign({},E,{key:F.id,store:M,element:F}))))}),x={text:i.TextElement,image:o.ImageElement,svg:o.ImageElement,line:c.LineElement,video:u.VideoElement,figure:d.FigureElement,group:w,gif:p.GifElement},v=(E,b)=>{const M=[];(0,_.forEveryChild)(E,k=>{k.type!=="group"&&M.push(k.a)});const N=[];M.forEach(k=>{const T=[{x:0,y:0},{x:0+k.width,y:0},{x:0+k.width,y:0+k.height},{x:0,y:0+k.height}],V=new a.default.Transform;V.translate(k.x,k.y),V.rotate(a.default.Util.degToRad(k.rotation)),T.forEach(G=>{const $=V.point(G);N.push($)})});const R=new a.default.Transform;R.rotate(-a.default.Util.degToRad(b));let F=1/0,j=1/0,O=-1/0,C=-1/0;N.forEach(k=>{const T=R.point(k);F=Math.min(F,T.x),j=Math.min(j,T.y),O=Math.max(O,T.x),C=Math.max(C,T.y)}),R.invert();const A=R.point({x:F,y:j});return{x:A.x,y:A.y,width:O-F,height:C-j,rotation:b}},g=(0,n.observer)(E=>{const{element:b,store:M}=E,[N,R]=t.default.useState(!1),F=M.selectedElements.indexOf(b)>=0&&b.selectable,j=b.parent.type==="group",O=(k=>{const[T,V]=t.default.useState(null);return t.default.useEffect(()=>{const G=setTimeout(()=>{const $=k.page.id,te=a.default.stages.find(W=>W.getAttr("pageId")===$);te||console.error("No stage is found for element",k.id),V(te)});return()=>clearTimeout(G)},[k.id]),T})(b),C=O==null?void 0:O.findOne("Transformer");t.default.useEffect(()=>{if(O){const k=V=>{const G=V.target.findAncestor(".element",!0),$=M.getElementById(G==null?void 0:G.id()),te=$==null?void 0:$.top,W=te==null?void 0:te.id;R(W===b.id)};O.on("mouseover",k);const T=()=>{R(!1)};return O.on("mouseleave",T),()=>{O.off("mouseover",k),O.off("mouseleave",T)}}},[O]);let A=x[E.element.type];return E.element.type==="text"&&S.flags.htmlRenderEnabled&&(A=s.HTMLElement),E.element.visible?A?t.default.createElement(t.default.Fragment,null,t.default.createElement(A,Object.assign({},E)),(N||F)&&!j&&t.default.createElement(f.Highlighter,{element:b.type==="group"?{a:v(b,(C==null?void 0:C.rotation())||0)}:b})):(console.error("Can not find component for "+E.element.type),null):null});e.default=g}(Dd)),Dd}var Qv={},B4;function uk(){return B4||(B4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=function(r,t,n="scale"){const a=t.width/t.height;let i,o;a>=r.width/r.height?(i=r.width,o=r.width/a):(i=r.height*a,o=r.height);let s=0,c=0;return n==="left-top"?(s=0,c=0):n==="left-middle"?(s=0,c=(r.height-o)/2):n==="left-bottom"?(s=0,c=r.height-o):n==="center-top"?(s=(r.width-i)/2,c=0):n==="center-middle"?(s=(r.width-i)/2,c=(r.height-o)/2):n==="center-bottom"?(s=(r.width-i)/2,c=r.height-o):n==="right-top"?(s=r.width-i,c=0):n==="right-middle"?(s=r.width-i,c=(r.height-o)/2):n==="right-bottom"?(s=r.width-i,c=r.height-o):n==="scale"?(s=0,c=0,i=r.width,o=r.height):console.error(new Error("Unknown clip position property - "+n)),{cropX:s,cropY:c,cropWidth:i,cropHeight:o}}}(Qv)),Qv}var q4;function ck(){return q4||(q4=1,function(e){var r=yf&&yf.__rest||function(D,Y){var Q={};for(var J in D)Object.prototype.hasOwnProperty.call(D,J)&&Y.indexOf(J)<0&&(Q[J]=D[J]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function"){var Z=0;for(J=Object.getOwnPropertySymbols(D);Z<J.length;Z++)Y.indexOf(J[Z])<0&&Object.prototype.propertyIsEnumerable.call(D,J[Z])&&(Q[J[Z]]=D[J[Z]])}return Q},t=yf&&yf.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.useContextMenu=e.setTransformerStyle=void 0,e.registerTransformerAttrs=function(D,Y){j[D]=j[D]||Y,Object.assign(j[D],Y)};const n=t(ni()),a=Us,i=vs,o=Fu,s=t(r0()),c=t(Hs()),u=t(lk()),d=n_(),p=Om(),y=uk(),f=Tm(),_=Dh(),S=Rm(),w=gc(),x=rf(),v=Op(),g=dm(),E=Mh,b=c.default.DD._drag;window.removeEventListener("mousemove",b),c.default.DD._drag=function(D){(0,i.runInAction)(()=>{b.call(this,D)})},window.addEventListener("mousemove",c.default.DD._drag);const M=new c.default.Group,N=20;M.add(new c.default.Rect({width:N,height:N,fill:"white"})),M.add(new c.default.Path({scaleX:N/24,scaleY:N/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const R=M.toCanvas({pixelRatio:2,width:N,height:N}),F={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:D=>{D.hasName("rotater")&&D.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:R,fillPatternScaleX:20/N/2,fillPatternScaleY:20/N/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}};e.setTransformerStyle=D=>{Object.assign(F,D)};const j={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},gif:{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"]}},O=D=>n.default.createElement(o.Rect,Object.assign({},D,{preventDefault:!1})),C=D=>{var{url:Y}=D,Q=r(D,["url"]);const[J,Z]=(0,s.default)(Y,"anonymous"),ae=J?(0,y.getCrop)(J,{width:Q.width,height:Q.height},"center-middle"):{};return(0,p.useImageLoader)(Z,Y,"page background"),n.default.createElement(o.Image,Object.assign({image:J},Q,ae))},A=D=>{const Y=(0,v.useColor)({fill:D.fill,a:{width:D.width,height:D.height}});return n.default.createElement(o.Rect,Object.assign({},D,Y))},k=D=>{const{background:Y,scale:Q,borderColor:J}=D,Z=r(D,["background","scale","borderColor"]),ae=n.default.useMemo(()=>!!c.default.Util.colorToRGBA(Y)||(0,g.isGradient)(Y),[Y]),se=n.default.useMemo(()=>{const ce=document.createElement("canvas"),de=30;ce.width=60,ce.height=60;const Oe=ce.getContext("2d");return Oe&&(Oe.fillStyle="black",Oe.fillRect(de,0,de,de),Oe.fillRect(0,de,de,de)),ce},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:se},Z,{opacity:.1,hideInExport:!0})),ae?n.default.createElement(A,Object.assign({fill:Y},Z)):n.default.createElement(C,Object.assign({url:Y},Z)))},T=(0,a.observer)(({selection:D})=>D.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(D.x1,D.x2),y:Math.min(D.y1,D.y2),width:Math.abs(D.x1-D.x2),height:Math.abs(D.y1-D.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),V=(0,a.observer)(({x:D,y:Y,width:Q,height:J,rotation:Z,anchor:ae,store:se})=>{const ce=(0,_.getClientRect)({x:D,y:Y,width:Q,height:J,rotation:c.default.Util.radToDeg(Z)});if(ae===void 0)return null;const de=(J/2+70)*Math.cos(Z-Math.PI/2),Oe=(J/2+70)*Math.sin(Z-Math.PI/2),Le=(0,S.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:Q/se.scale,precious:se.unit==="px"?0:1})+" x "+(0,S.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:J/se.scale,precious:se.unit==="px"?0:1})+(se.unit==="px"?"":" "+se.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(ce.minX+ce.maxX)/2+de,y:(ce.minY+ce.maxY)/2+Oe,offsetX:14,offsetY:14,visible:ae==="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(c.default.Util.radToDeg(Z)).toString()+"°"})),n.default.createElement(o.Label,{x:(ce.minX+ce.maxX)/2,y:ce.maxY+20,visible:ae!=="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:Le})))}),G=(0,a.observer)(({elements:D,store:Y})=>{const Q=D.filter(Z=>Z.alwaysOnTop),J=D.filter(Z=>!Z.alwaysOnTop).concat(Q);return n.default.createElement(n.default.Fragment,null,J.map(Z=>n.default.createElement(u.default,{key:Z.id,store:Y,element:Z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});e.useContextMenu=({store:D})=>{const[Y,Q]=n.default.useState(!1),[J,Z]=n.default.useState({x:0,y:0});return{open:n.default.useCallback(se=>{Q(!0),Z(se)},[]),close:n.default.useCallback(()=>{Q(!1)},[]),props:{isOpen:Y,offset:J,setIsOpen:Q}}};let $=null;e.registerNextDomDrop=D=>{$=D};const te=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),W=atob("cmVk"),U=atob("djAuOS4y"),z=D=>n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{fill:W,height:200},n.default.createElement(o.Tag,{fill:W}),n.default.createElement(o.Text,Object.assign({},D,{fill:"white",text:te,height:void 0,padding:10,fontSize:20}))));e.default=(0,a.observer)(({store:D,page:Y,width:Q,height:J,pageControlsEnabled:Z,backColor:ae,pageBorderColor:se,activePageBorderColor:ce,components:de,bleedColor:Oe,altCloneEnabled:Le,viewportSize:ke})=>{const Se=D.bleedVisible?Y.bleed:0,ye=Y.computedWidth+2*Se,Je=Y.computedHeight+2*Se,we=(Q-ye*D.scale)/2,me=(J-Je*D.scale)/2,Ee=n.default.useRef(null),Te=n.default.useRef(null),he=n.default.useRef(null),Re=Z==null||Z,[Ie,Xe]=n.default.useState(null),[rt,vt]=n.default.useState({}),et=(0,e.useContextMenu)({store:D}),yt=D.selectedElements.find(nt=>nt._cropModeEnabled),mt=D.selectedShapes.filter(nt=>!nt.resizable).length>0,ct=D.selectedShapes.filter(nt=>!nt.draggable).length>0,Bt=D.selectedElements.filter(nt=>!nt.visible).length>0;n.default.useLayoutEffect(()=>{var nt,We,it;if(!Ee.current)return;const He=Ee.current.getStage(),wt=D.selectedShapes.map(_t=>_t._cropModeEnabled?null:He.findOne("#"+_t.id)).filter(_t=>_t),ze=D.selectedElements.length===1&&((nt=D.selectedElements[0])===null||nt===void 0?void 0:nt.type)||"many";j[ze]?(Ee.current.setAttrs(Object.assign(Object.assign({},F),j[ze])),ze!=="svg"&&ze!=="image"&&ze!=="gif"||D.selectedElements[0].keepRatio||Ee.current.setAttrs({enabledAnchors:F.enabledAnchors}),ze==="text"&&w.flags.textVerticalResizeEnabled&&Ee.current.setAttrs({enabledAnchors:(We=j.text.enabledAnchors)===null||We===void 0?void 0:We.concat(["bottom-center"])})):Ee.current.setAttrs(F),mt&&Ee.current.enabledAnchors([]),ct&&Ee.current.rotateEnabled(!1),wt.find(_t=>_t==null?void 0:_t.isDragging())&&wt.forEach(_t=>{_t.isDragging()||_t==null||_t.startDrag()}),Ee.current.nodes(wt),(it=Ee.current.getLayer())===null||it===void 0||it.batchDraw()},[D.selectedShapes,yt,mt,Bt,ct]);const Pt=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Yt=n.default.useRef(!1),Gt=(0,x.isTouchDevice)(),Be=(0,i.action)(nt=>{var We,it,He,wt;if(Gt)return;Yt.current=!1;const ze=nt.target.findAncestor(".elements-container"),_t=nt.target.findAncestor("Transformer"),Ht=nt.target.findAncestor(".page-abs-container");if(ze||_t||Ht)return;const Dt=(We=nt.target.getStage())===null||We===void 0?void 0:We.getPointerPosition();Dt.x-=(it=nt.target.getStage())===null||it===void 0?void 0:it.x(),Dt.y-=(He=nt.target.getStage())===null||He===void 0?void 0:He.y(),Dt&&(Pt.visible=!0,Pt.x1=Dt.x,Pt.y1=Dt.y,Pt.x2=Dt.x,Pt.y2=Dt.y,((wt=nt.target.getStage())===null||wt===void 0?void 0:wt.getPointersPositions().length)>=2&&(Pt.visible=!1))});(({stageRef:nt,containerRef:We,viewportSize:it})=>{n.default.useEffect(()=>{var He;const wt=(He=We.current)===null||He===void 0?void 0:He.closest(".polotno-workspace-inner");function ze(){var _t;if(!nt.current)return;const Ht=(_t=We.current)===null||_t===void 0?void 0:_t.getBoundingClientRect(),Dt=wt==null?void 0:wt.getBoundingClientRect(),Vt=Math.max(0,Dt.left-Ht.left-100),er=Math.max(0,Dt.top-Ht.top-100);nt.current.position({x:-Vt,y:-er}),nt.current.container().style.transform=`translate(${Vt}px, ${er}px)`}return ze(),wt.addEventListener("scroll",ze),()=>{wt.removeEventListener("scroll",ze)}},[it.width,it.height])})({stageRef:Te,containerRef:he,viewportSize:ke}),n.default.useEffect(()=>{const nt=(0,i.action)(it=>{var He,wt,ze,_t;if(!Pt.visible)return;(He=Te.current)===null||He===void 0||He.setPointersPositions(it);let Ht=(wt=Te.current)===null||wt===void 0?void 0:wt.getPointerPosition();Ht?(Ht.x-=(ze=Te.current)===null||ze===void 0?void 0:ze.x(),Ht.y-=(_t=Te.current)===null||_t===void 0?void 0:_t.y()):Ht={x:Pt.x2,y:Pt.y2},Pt.x2=Ht.x,Pt.y2=Ht.y}),We=(0,i.action)(()=>{if(!Pt.visible||!Te.current)return;const it=Te.current.findOne(".selection"),He=it?it.getClientRect():{width:0,height:0,x:0,y:0};if(He.width&&He.height){const wt=[];Te.current.find(".element").forEach(_t=>{const Ht=_t.getClientRect(),Dt=D.getElementById(_t.id()),Vt=Dt==null?void 0:Dt.draggable,er=Dt==null?void 0:Dt.selectable;c.default.Util.haveIntersection(He,Ht)&&Vt&&er&&wt.push(Dt.top.id)});const ze=[...new Set(wt)];D.selectElements(ze)}Pt.visible=!1,Yt.current=!0});return window.addEventListener("mousemove",nt),window.addEventListener("touchmove",nt),window.addEventListener("mouseup",We),window.addEventListener("touchend",We),()=>{window.removeEventListener("mousemove",nt),window.removeEventListener("touchmove",nt),window.removeEventListener("mouseup",We),window.removeEventListener("touchend",We)}},[]);const Ce=n.default.useRef(!1);n.default.useEffect(()=>{var nt;let We;const it=(nt=he.current)===null||nt===void 0?void 0:nt.closest(".polotno-workspace-inner"),He=()=>{Ce.current=!0,clearTimeout(We),We=setTimeout(()=>{Ce.current=!1},300)};return it.addEventListener("scroll",He),()=>{clearTimeout(We),it.removeEventListener("scroll",He)}},[]);const ft=nt=>{if(D.activePage!==Y&&Y.select(),Ce.current||Yt.current)return;const We=nt.evt.ctrlKey||nt.evt.metaKey||nt.evt.shiftKey,it=nt.target.findAncestor(".elements-container"),He=nt.target.findAncestor(".page-abs-container"),wt=nt.target.findAncestor("Transformer");if(!(We||it||wt||He))return void D.selectElements([]);const ze=nt.target.findAncestor(".element",!0),_t=D.getElementById(ze==null?void 0:ze.id()),Ht=_t==null?void 0:_t.top,Dt=Ht==null?void 0:Ht.id,Vt=D.selectedElementsIds.indexOf(Dt)>=0;Dt&&We&&!Vt?D.selectElements(D.selectedElementsIds.concat([Dt])):Dt&&We&&Vt?D.selectElements(D.selectedElementsIds.filter(er=>er!==Dt)):!Dt||We||Vt||D.selectElements([Dt])};(0,d.useSnap)(Ee,D);const Ct=D.activePage===Y,Ot=de==null?void 0:de.PageControls,Nt=de==null?void 0:de.Tooltip,Jt=de==null?void 0:de.ContextMenu,Xt=1/D.scale,kt=0/D.scale;return n.default.createElement("div",{ref:he,onDragOver:nt=>nt.preventDefault(),onDrop:nt=>{if(nt.preventDefault(),!Te.current)return;Te.current.setPointersPositions(nt);const We=Te.current.findOne(".elements-container").getRelativePointerPosition(),it=Te.current.getPointerPosition(),He=Te.current.getAllIntersections(it).map(_t=>_t.findAncestor(".element",!0)).filter(Boolean),wt=[...new Set(He.reverse())].map(_t=>D.getElementById(_t.id())),ze=wt[0];$&&($(We,ze,{elements:wt,page:Y}),$=null)},style:{position:"relative",width:Q+"px",height:J+"px",overflow:"hidden"},className:"polotno-page-container"+(Ct?" active-page":"")},n.default.createElement(o.Stage,{ref:Te,width:Math.min(Q,ke.width+200),height:Math.min(ke.height+200,J),onClick:ft,onTap:ft,onContextMenu:nt=>{nt.evt.preventDefault();const We=nt.target.findAncestor(".element",!0),it=D.getElementById(We==null?void 0:We.id()),He=it==null?void 0:it.top,wt=He==null?void 0:He.id;wt?D.selectedElementsIds.indexOf(wt)>=0||D.selectElements([wt]):D.selectElements([]),et.open({x:nt.evt.clientX,y:nt.evt.clientY})},onMouseDown:Be,onMouseMove:nt=>{if(!nt.evt.altKey&&Ie)return void Xe(null);if(!nt.evt.altKey)return;const We=nt.target.findAncestor(".element",!0),it=We==null?void 0:We.id();if(!D.selectedElements[0]||D.selectedElementsIds.includes(it))return;const He=(0,_.getTotalClientRect)(D.selectedShapes),wt=it?D.getElementById(it):{x:0,y:0,width:Y.computedWidth,height:Y.computedHeight,rotation:0},ze=(0,_.getClientRect)(wt),_t=[];He.minX>ze.maxX&&_t.push({distance:He.minX-ze.maxX,box1:He,box2:ze,points:[{x:He.minX,y:He.minY+He.height/2},{x:ze.maxX,y:He.minY+He.height/2},{x:ze.maxX,y:ze.minY+ze.height/2}]}),He.maxX<ze.minX&&_t.push({distance:ze.minX-He.maxX,box1:He,box2:ze,points:[{x:He.maxX,y:He.minY+He.height/2},{x:ze.minX,y:He.minY+He.height/2},{x:ze.minX,y:ze.minY+ze.height/2}]}),He.minY>ze.maxY&&_t.push({box1:He,box2:ze,distance:He.minY-ze.maxY,points:[{x:He.minX+He.width/2,y:He.minY},{x:He.minX+He.width/2,y:ze.maxY},{x:ze.minX+ze.width/2,y:ze.maxY}]}),He.maxY<ze.minY&&_t.push({box1:He,box2:ze,distance:ze.minY-He.maxY,points:[{x:He.minX+He.width/2,y:He.maxY},{x:He.minX+He.width/2,y:ze.minY},{x:ze.minX+ze.width/2,y:ze.minY}]}),He.minX>=ze.minX&&He.maxX<=ze.maxX&&He.minY>=ze.minY&&He.maxY<=ze.maxY&&(_t.push({distance:He.minX-ze.minX,box1:He,box2:ze,points:[{x:He.minX,y:He.minY+He.height/2},{x:ze.minX,y:He.minY+He.height/2},{x:ze.minX,y:ze.minY+ze.height/2}]}),_t.push({distance:ze.maxX-He.maxX,box1:He,box2:ze,points:[{x:He.maxX,y:He.minY+He.height/2},{x:ze.maxX,y:He.minY+He.height/2},{x:ze.maxX,y:ze.minY+ze.height/2}]}),_t.push({box1:He,box2:ze,distance:He.minY-ze.minY,points:[{x:He.minX+He.width/2,y:He.minY},{x:He.minX+He.width/2,y:ze.minY},{x:ze.minX+ze.width/2,y:ze.minY}]}),_t.push({box1:He,box2:ze,distance:ze.maxY-He.maxY,points:[{x:He.minX+He.width/2,y:He.maxY},{x:He.minX+He.width/2,y:ze.maxY},{x:ze.minX+ze.width/2,y:ze.maxY}]})),JSON.stringify(Ie)!==JSON.stringify(_t)&&Xe(_t)},onDragStart:nt=>{var We;const it=nt.target.findAncestor(".element",!0);if(it){const He=D.getElementById(it==null?void 0:it.id()),wt=He==null?void 0:He.top,ze=wt==null?void 0:wt.id;!(D.selectedElementsIds.indexOf(ze)>=0)&&ze&&(D.selectElements([ze]),nt.target.stopDrag(),nt.target.startDrag(nt),(We=Ee.current)===null||We===void 0||We.startDrag(nt))}Ie&&Xe(null)},pageId:Y.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},n.default.createElement(o.Layer,null,n.default.createElement(O,{width:Q,height:J,fill:ae}),n.default.createElement(o.Group,{x:we,y:me,scaleX:D.scale,scaleY:D.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:Se,y:Se},n.default.createElement(k,{x:-Y.bleed,y:-Y.bleed,width:Y.computedWidth+2*Y.bleed,height:Y.computedHeight+2*Y.bleed,background:Y.background,name:"page-background",preventDefault:!1,scale:D.scale})),n.default.createElement(o.Group,{x:Se,y:Se,name:"elements-container",listening:!D.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:Y.computedWidth,height:Y.computedHeight,listening:!1}),n.default.createElement(G,{elements:Y.children,store:D})),n.default.createElement(o.Rect,{stroke:Oe,name:"bleed",strokeWidth:Y.bleed,x:Y.bleed/2,y:Y.bleed/2,width:Y.computedWidth+Y.bleed,height:Y.computedHeight+Y.bleed,listening:!1,visible:Y.bleed>0&&D.bleedVisible,hideInExport:!0}),(0,f.___)()===U&&n.default.createElement(z,{name:"hit-detection",x:-Xt/2-kt,y:-Xt/2-kt,width:ye+Xt+2*kt,height:Je+Xt+2*kt}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,Q,0,Q,J,0,J,0,0,we,me,we,J-me,Q-we,J-me,Q-we,me,we,me],listening:!1,closed:!0,fill:ae}),n.default.createElement(o.Group,{x:we,y:me,scaleX:D.scale,scaleY:D.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-Xt/2-kt,y:-Xt/2-kt,width:ye+Xt+2*kt,height:Je+Xt+2*kt,stroke:Ct&&D.pages.length>1?ce:se,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:we+Se*D.scale,y:me+Se*D.scale,scaleX:D.scale,scaleY:D.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:Ee,onDragStart:nt=>{var We;!((We=nt.evt)===null||We===void 0)&&We.altKey&&Le&&D.selectedElements.forEach(it=>{const He=it.clone({},{skipSelect:!0}),wt=Y.children.indexOf(it);Y.setElementZIndex(He.id,wt)}),D.history.startTransaction()},onDragEnd:()=>{D.history.endTransaction()},onTransformStart:()=>{D.history.startTransaction(),Xe(null)},boundBoxFunc:(nt,We)=>{const it=Math.abs(We.width)<1||Math.abs(We.height)<1,He=Math.abs(nt.width)<1||Math.abs(nt.height)<1;return it&&!He?nt:We},onTransform:nt=>{var We,it;const He=Ee.current.nodes(),wt=He[He.length-1];if(nt.target!==wt)return;const ze=(We=Ee.current)===null||We===void 0?void 0:We.__getNodeRect(),_t=(it=Ee.current)===null||it===void 0?void 0:it.getActiveAnchor();vt({anchor:_t,x:ze.x,y:ze.y,rotation:ze.rotation,width:ze.width,height:ze.height})},onTransformEnd:nt=>{vt({}),D.history.endTransaction()},visible:!D.isPlaying}),Ie&&Ie.map(({points:nt,distance:We,box1:it,box2:He},wt)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:wt,listening:!1},n.default.createElement(o.Rect,Object.assign({},it,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},He,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[nt[0].x,nt[0].y,nt[1].x,nt[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[nt[1].x,nt[1].y,nt[2].x,nt[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(nt[0].x+nt[1].x)/2,y:(nt[0].y+nt[1].y)/2,offsetY:-10,scaleX:1/D.scale,scaleY:1/D.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,S.pxToUnitString)({unit:D.unit,dpi:D.dpi,px:We})})))),Y._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:ye,height:Je,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:ye,height:Je,align:"center",verticalAlign:"middle"})),Nt&&n.default.createElement(Nt,{components:de,store:D,page:Y,stageRef:Te}),Jt&&n.default.createElement(E.Html,null,n.default.createElement(Jt,Object.assign({components:de,store:D},et.props)))),n.default.createElement(V,Object.assign({},rt,{store:D})),n.default.createElement(T,{selection:Pt}),(0,f.isCreditVisible)()&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:Q-170,y:J-18,onMouseEnter:nt=>{nt.target.getStage().container().style.cursor="pointer"},onMouseLeave:nt=>{nt.target.getStage().container().style.cursor=""},onTouchStart:nt=>{nt.cancelBubble=!0},onMouseDown:nt=>{nt.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Re&&Ot&&n.default.createElement(Ot,{store:D,page:Y,xPadding:we,yPadding:me}))})}(yf)),yf}var ep={},z4;function fk(){return z4||(z4=1,function(e){var r=ep&&ep.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=function(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))};const t=r(ni()),n=Dh(),a=Rm(),i=Us,o=r_(),s=(0,o.styled)("div",t.default.forwardRef)`
|
|
386
|
+
position: absolute;
|
|
387
|
+
top: 0;
|
|
388
|
+
left: 0;
|
|
389
|
+
pointer-events: none;
|
|
390
|
+
`,c=(0,o.styled)("div",t.default.forwardRef)`
|
|
391
|
+
height: 14px;
|
|
392
|
+
position: sticky;
|
|
393
|
+
font-size: 8px;
|
|
394
|
+
line-height: 14px;
|
|
395
|
+
top: 0;
|
|
396
|
+
left: 0;
|
|
397
|
+
color: grey;
|
|
398
|
+
border-bottom: 1px solid grey;
|
|
399
|
+
background-color: #e8e8e8;
|
|
400
|
+
overflow: hidden;
|
|
401
|
+
`,u=(0,o.styled)("div",t.default.forwardRef)`
|
|
402
|
+
left: 0;
|
|
403
|
+
width: 14px;
|
|
404
|
+
position: sticky;
|
|
405
|
+
font-size: 8px;
|
|
406
|
+
line-height: 14px;
|
|
407
|
+
color: grey;
|
|
408
|
+
border-right: 1px solid grey;
|
|
409
|
+
background-color: #e8e8e8;
|
|
410
|
+
overflow: hidden;
|
|
411
|
+
`,d=(0,o.styled)("div",t.default.forwardRef)`
|
|
412
|
+
position: absolute;
|
|
413
|
+
border-left: 1px solid grey;
|
|
414
|
+
padding-left: 2px;
|
|
415
|
+
`,p=(0,o.styled)("div",t.default.forwardRef)`
|
|
416
|
+
position: absolute;
|
|
417
|
+
left: 14px;
|
|
418
|
+
border-left: 1px solid grey;
|
|
419
|
+
padding-left: 2px;
|
|
420
|
+
transform: rotate(90deg);
|
|
421
|
+
transform-origin: left top;
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
`,y=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];e.TopRules=(0,i.observer)(({store:f,width:_,height:S})=>{const w=t.default.useRef(null);if(!f.activePage)return null;const x=f.activePage,v=(f.bleedVisible&&x.bleed,x.computedWidth*f.scale),g=x.computedHeight*f.scale,E=(_-v)/2,b=(M=O=>(0,a.unitToPx)({unitVal:O,dpi:f.dpi,unit:f.unit})*f.scale,y.find(O=>M(O)>30)||1e4);var M;const N=(0,a.unitToPx)({unitVal:b,dpi:f.dpi,unit:f.unit})*f.scale,R=Math.round(v/N)+1,F=Math.round(g/N)+1,j=(0,n.getTotalClientRect)(f.selectedShapes);return t.default.createElement(s,{ref:w,className:"polotno-rulers"},t.default.createElement(c,{style:{width:_+"px"},className:"polotno-x-ruler"},[...Array(R)].map((O,C)=>t.default.createElement(d,{key:C,style:{left:E+C*N+"px",width:N+"px"}},f.unit==="px"||b>=1?Math.round(b*C):(b*C).toFixed(1))),!!f.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:E+j.x*f.scale+"px",height:"14px",width:j.width*f.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),f.pages.map((O,C)=>{var A;const k=O.computedHeight*f.scale,T=(S-k)/2;return t.default.createElement(u,{key:O.id,style:{height:S+"px"},className:"polotno-y-ruler"},[...Array(F)].map((V,G)=>t.default.createElement(p,{key:G,style:{top:T+G*N-14+"px",width:N+"px"}},f.unit==="px"||b>=1?Math.round(b*G):(b*G).toFixed(1))),((A=f.selectedShapes[0])===null||A===void 0?void 0:A.page)===O&&t.default.createElement("div",{style:{position:"absolute",top:T+j.y*f.scale-14+"px",width:"14px",height:j.height*f.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(ep)),ep}var tp={},U4;function hk(){return U4||(U4=1,function(e){var r=tp&&tp.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=r(ni()),n=Us,a=vs;e.AudioElement=(0,n.observer)(({audio:i,store:o})=>{const[s,c]=function(u){const[d,p]=t.default.useState(null),[y,f]=t.default.useState("loading");return t.default.useEffect(()=>{const _=new Audio(u),S=()=>{f("loaded"),p(_)},w=()=>{f("failed"),p(null)};return _.addEventListener("canplay",S),_.addEventListener("error",w),()=>{_.removeEventListener("canplay",S),_.removeEventListener("error",w)}},[u]),[d,y]}(i.src);return t.default.useEffect(()=>{s&&o.history.ignore(()=>{i.set({duration:1e3*s.duration})})},[s,i,o.history]),t.default.useEffect(()=>{if(!s)return;const u=()=>{s.currentTime=i.startTime*i.duration/1e3},d=()=>{const y=i.endTime*i.duration/1e3;s.currentTime>=y&&(s.pause(),s.currentTime=i.startTime*i.duration/1e3)};s.addEventListener("ended",u),s.addEventListener("timeupdate",d);const p=(0,a.autorun)(()=>{const y=o.animatedElementsIds;if(y.length&&!y.includes(i.id))return;const f=o.currentTime-i.delay,_=i.duration*(i.endTime-i.startTime),S=f>=0&&f<_;if(!o.isPlaying||o.animatedElementsIds.length!==0||!S)return void s.pause();s.volume=i.volume,s.paused&&s.play();const w=f%_/1e3+i.startTime*i.duration/1e3,x=s.currentTime;Math.abs(x-w)>.5&&w!==x&&(s.currentTime=w)});return()=>{s.pause(),s.removeEventListener("ended",u),s.removeEventListener("timeupdate",d),p()}},[o.isPlaying,i.startTime,i.endTime,i.volume,s]),null})}(tp)),tp}var Jv={},e2={},H4;function dk(){return H4||(H4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const r=Nh(),t=Dh();let n={data:[],pageId:""};const a="polotno_clipboard",i=(s,c)=>{n={data:JSON.parse(JSON.stringify(s)),pageId:c};try{localStorage.setItem(a,JSON.stringify(s)),localStorage.setItem(a+"_page",c)}catch{}},o=()=>{try{const s=localStorage.getItem(a),c=localStorage.getItem(a+"_page");if(s)return{data:JSON.parse(s),pageId:c}}catch{}return n};e.copy=s=>{var c;s.selectedElements.length!==0&&i(s.selectedElements.map(u=>u.toJSON()),(c=s.activePage)===null||c===void 0?void 0:c.id)},e.cut=s=>{var c;i(s.selectedElements.map(d=>d.toJSON()),(c=s.activePage)===null||c===void 0?void 0:c.id);let u=s.selectedElements.filter(d=>d.removable).map(d=>d.id);s.deleteElements(u)},e.paste=s=>{s.history.transaction(()=>{var c,u;let d=0,p=0;const{data:y,pageId:f}=o();if(f===((c=s.activePage)===null||c===void 0?void 0:c.id))d=s.width/20,p=s.height/20;else{const S=[];(0,r.forEveryChild)({children:y},x=>{x.type!=="group"&&S.push(x)});const w=(0,t.getTotalClientRect)(S);w.maxX>s.width&&(d=-w.minX),w.maxY>s.height&&(p=-w.minY)}const _=[];(0,r.forEveryChild)({children:y},S=>{delete S.id,S.type!=="group"&&(S.x+=d,S.y+=p)}),y.forEach(S=>{var w;const x=(w=s.activePage)===null||w===void 0?void 0:w.addElement(S);x&&_.push(x.id)}),i(y,(u=s.activePage)===null||u===void 0?void 0:u.id),s.selectElements(_)})},e.isClipboardEmpty=()=>o().data.length===0}(e2)),e2}var V4;function pk(){return V4||(V4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=function(t,n){var a,i,o,s;if(((a=document.activeElement)===null||a===void 0?void 0:a.tagName)==="INPUT"||((i=document.activeElement)===null||i===void 0?void 0:i.tagName)==="TEXTAREA"||((o=document.activeElement)===null||o===void 0?void 0:o.contentEditable)==="true")return;const c=n.selectedElements.filter(p=>p.removable).map(p=>p.id);t.keyCode!==46&&t.keyCode!==8||n.deleteElements(c);const u=t.ctrlKey||t.metaKey,d=t.shiftKey;if(!u||d||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),n.history.undo()),u&&d&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),n.history.redo()),u&&t.code==="KeyA"){t.preventDefault();const p=(s=n.activePage)===null||s===void 0?void 0:s.children.filter(f=>f.selectable),y=(p==null?void 0:p.map(f=>f.id))||[];n.selectElements(y)}u&&t.code==="KeyC"&&(t.preventDefault(),(0,r.copy)(n)),u&&t.code==="KeyX"&&(t.preventDefault(),(0,r.cut)(n)),u&&t.code==="KeyV"&&(t.preventDefault(),(0,r.paste)(n)),t.code==="ArrowDown"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({y:p.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({y:p.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({x:p.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({x:p.x+1})}))};const r=dk()}(Jv)),Jv}var t2={},G4;function gk(){return G4||(G4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const r=vs,t=(0,r.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),n=s=>s&&typeof s=="object";function a(s,c){Object.keys(c).forEach(u=>{const d=s[u],p=c[u];n(p)&&n(d)?a(d,p):s[u]=p})}function i(s,c,u=""){Object.keys(c).forEach(d=>{const p=c[d],y=u?`${u}.${d}`:d;n(p)?n(s[d])?i(s[d],p,y):console.warn(`Missing nested translation object at '${y}'`):s[d]===void 0&&console.warn(`Missing translation '${y}'`)})}e.setTranslations=(0,r.action)((s,{validate:c=!1}={})=>{c&&i(s,t),a(t,s)}),e.getTranslations=()=>(0,r.toJS)(t);const o={};e.t=s=>{const c=function(p,y){var f,_=y.split("."),S=p;for(f=0;f<_.length;++f){if(S[_[f]]==null)return;S=S[_[f]]}return S}(t,s);if(c!==void 0)return c;o[s]||(o[s]=!0,console.warn(`Missing translation '${s}'`));const u=s.split("."),d=u[u.length-1]||" ";return d.charAt(0).toUpperCase()+d.slice(1)}}(t2)),t2}var W4;function vk(){return W4||(W4=1,function(e){var r=Kh&&Kh.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=r(ni()),n=Us,a=r(ck()),i=fk(),o=hk(),s=pk(),c=gk(),u=({store:p})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,c.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{p.addPage()}},(0,c.t)("workspace.addPage"))),d=({width:p,height:y,xPadding:f,yPadding:_,backgroundColor:S})=>t.default.createElement("div",{style:{width:p+"px",height:y+"px",backgroundColor:S,paddingLeft:f+"px",paddingRight:f+"px",paddingTop:_+"px",paddingBottom:_+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:y,backgroundColor:f,pageBorderColor:_,activePageBorderColor:S,bleedColor:w,components:x,onKeyDown:v,paddingX:g,paddingY:E,altCloneEnabled:b=!0,visiblePagesOffset:M,renderOnlyActivePage:N})=>{var R;const F=g??20,j=E??55,[O,C]=t.default.useState({width:100,height:100}),A=t.default.useRef(O),k=t.default.useRef(null),T=t.default.useRef(null),V=p.bleedVisible?Math.max(0,...p.pages.map(ke=>ke.bleed)):0,G=Math.max(...p.pages.map(ke=>ke.computedWidth)),$=Math.max(...p.pages.map(ke=>ke.computedHeight)),te=((R=p.activePage)===null||R===void 0?void 0:R.computedHeight)||0,W=G+2*V,U=(N?te:$)+2*V,z=async({skipTimeout:ke}={skipTimeout:!1})=>{if(ke||await new Promise(he=>setTimeout(he,50)),k.current===null)return;const Se=k.current.getBoundingClientRect();Se.width!==0&&Se.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
424
|
+
Width or height of parent elements is equal 0.
|
|
425
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
426
|
+
For simpler debugging here is the log of the parent element:`),console.log(k.current));const ye=T.current.clientWidth||Se.width,Je={width:ye,height:Se.height};(A.current.width!==Je.width||A.current.height!==Je.height)&&(C(Je),A.current=Je);const we=(ye-2*F)/W,me=p.pages.length>1?3.1:2,Ee=(Se.height-j*me)/U,Te=p.pages.length?Math.max(Math.min(we,Ee),.01):1;p.scaleToFit!==Te&&(p.setScale(Te),p._setScaleToFit(Te))};t.default.useLayoutEffect(()=>{z({skipTimeout:!0})},[]),t.default.useEffect(()=>{z()},[W,U]),t.default.useEffect(()=>{p.__()},[]),t.default.useEffect(()=>{const ke=k.current;if(window.ResizeObserver){const Se=new ResizeObserver(()=>{z({skipTimeout:!0})});return Se.observe(ke),()=>Se.unobserve(ke)}{const Se=setInterval(()=>{z({skipTimeout:!0})},100);return()=>clearInterval(Se)}},[W,U]);const D=Math.max(F,(O.width-W*p.scale)/2),Y=N?1:p.pages.length,Q=U*p.scale*Y,J=Math.max(j,(O.height-Q)/Y/2);t.default.useEffect(()=>{const ke=Se=>{(v||s.handleHotkey)(Se,p)};return window.addEventListener("keydown",ke),()=>window.removeEventListener("keydown",ke)},[]),t.default.useEffect(()=>{var ke;const Se=ye=>{if(ye.ctrlKey||ye.metaKey){ye.preventDefault();const Ee=Math.max(5,p.scaleToFit),Te=Math.min(.1,p.scaleToFit),he=.03,Re=(Je=ye.deltaY<0?p.scale*(1+he):p.scale/(1+he),we=Te,me=Ee,Math.max(we,Math.min(me,Je)));p.setScale(Re)}else var Je,we,me};return(ke=T.current)===null||ke===void 0||ke.addEventListener("wheel",Se),()=>{var ye;return(ye=T.current)===null||ye===void 0?void 0:ye.removeEventListener("wheel",Se)}},[]);const Z=t.default.useRef(!1);((ke,Se,ye,Je,we,me)=>{const Ee=t.default.useRef({width:Se,height:ye}),Te=t.default.useRef({top:0,left:0}),he=t.default.useRef(!1),Re=t.default.useRef(we.pages.length);he.current=Re.current!==we.pages.length,Re.current=we.pages.length,t.default.useEffect(()=>{const Ie=ke.current,Xe=rt=>{Te.current={top:Ie.scrollTop,left:Ie.scrollLeft}};return Ie.addEventListener("scroll",Xe),()=>{Ie.removeEventListener("scroll",Xe)}},[]),t.default.useLayoutEffect(()=>{if(!ke.current||he.current)return;const Ie=ke.current,Xe=(Te.current.left+Ie.offsetWidth/2)/Ee.current.width,rt=(Te.current.top+Ie.offsetHeight/2)/Ee.current.height;me.current=!0,Ie.scrollLeft=Xe*Se-Ie.offsetWidth/2,Ie.scrollTop=rt*ye-Ie.offsetHeight/2,Ee.current={width:Se,height:ye}},[Je,Se,ye])})(T,W*p.scale+2*D,U*p.scale+2*J,p.scale,p,Z);const{handleScroll:ae}=((ke,Se,ye,Je,we,me)=>{const Ee=t.default.useRef(!1),Te=t.default.useRef(null),he=t.default.useRef(!1);t.default.useEffect(()=>{const Ie=ke.current,Xe=()=>{we.current};return Ie.addEventListener("scroll",Xe),()=>{Ie.removeEventListener("scroll",Xe)}},[]);const Re=ye.pages.indexOf(ye.activePage);return t.default.useLayoutEffect(()=>{if(me||!ye.activePage||!ke.current||Ee.current)return;const Ie=ke.current,Xe=ye.pages.indexOf(ye.activePage)*Se;let rt=()=>{};return(Math.abs(Xe-Ie.scrollTop)>.5*Se||he.current)&&(he.current=!0,rt=(({element:vt,scrollTop:et=0,duration:yt=300,onFinish:mt=()=>{}})=>{const ct=vt.scrollTop,Bt=et-ct;let Pt=0,Yt=!1;if(yt===0)return vt.scrollTop=et,()=>{};const Gt=()=>{if(Yt)return;Pt+=20;const Ce=Be(Pt,ct,Bt,yt);vt.scrollTop=Ce,Pt<yt?setTimeout(Gt,20):mt()},Be=(Ce,ft,Ct,Ot)=>(Ce/=Ot/2)<1?Ct/2*Ce*Ce+ft:-Ct/2*(--Ce*(Ce-2)-1)+ft;return Gt(),()=>{Yt=!0}})({element:Ie,scrollTop:Xe,onFinish:()=>{he.current=!1},duration:ye.isPlaying?0:300})),rt},[ye.activePage,Re,ye.isPlaying,me]),{handleScroll:Ie=>{if(me||he.current)return;Ee.current=!0,clearTimeout(Te.current),Te.current=setTimeout(()=>{Ee.current=!1},300);const Xe=Ie.currentTarget.childNodes[0].offsetHeight,rt=Ie.currentTarget.scrollTop,vt=Math.floor((rt+Je.height/3)/Xe),et=ye.pages[vt];et&&ye.activePage!==et&&et.select()}}})(T,U*p.scale+2*J,p,O,Z,N),se=O.width>=W*p.scale+2*D,ce=f||"rgba(232, 232, 232, 0.9)",de=p.pages.indexOf(p.activePage),Oe=(x==null?void 0:x.NoPages)||u,Le=M??Math.min(3,Math.max(1,Math.ceil(O.height/2/(U*p.scale))));return t.default.createElement("div",{ref:k,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ce,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:T,onScroll:ae,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:se?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((ke,Se)=>{const ye=ke===p.activePage;if(N&&!ye&&!ke._exportingOrRendering&&!ke._forceMount)return null;if(!(Math.abs(Se-de)<=Le||ke._exportingOrRendering||ke._forceMount))return t.default.createElement(d,{key:ke.id,width:W*p.scale+2*D,height:U*p.scale+2*J,backgroundColor:ce,xPadding:D,yPadding:J});const Je=t.default.createElement(a.default,{key:ke.id,page:ke,xPadding:D,yPadding:J,width:W*p.scale+2*D,height:U*p.scale+2*J,store:p,pageControlsEnabled:y,backColor:ce,pageBorderColor:_||"lightgrey",activePageBorderColor:S||"rgb(0, 161, 255)",altCloneEnabled:b,bleedColor:w||"rgba(255, 0, 0, 0.1)",components:x,viewportSize:O});return(ke._exportingOrRendering||ke._forceMount)&&!ye&&N?t.default.createElement("div",{style:{display:"none"},key:ke.id},Je):Je}),p.rulesVisible&&t.default.createElement(i.TopRules,{store:p,xPadding:D,yPadding:J,width:W*p.scale+2*D,height:U*p.scale+2*J}),p.pages.length===0&&t.default.createElement(Oe,{store:p}),p.audios.map(ke=>t.default.createElement(o.AudioElement,{key:ke.id,audio:ke,store:p}))))}),e.default=e.WorkspaceCanvas}(Kh)),Kh}var mk=vk(),yk=Mm(),bk=If(),ap=gc(),r2=jf(),wk=Ih();const _k="modulepreload",Sk=function(e,r){return new URL(e,r).href},$4={},A2=function(r,t,n){let a=Promise.resolve();if(t&&t.length>0){let o=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const s=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=o(t.map(d=>{if(d=Sk(d,n),d in $4)return;$4[d]=!0;const p=d.endsWith(".css"),y=p?'[rel="stylesheet"]':"";if(!!n)for(let S=s.length-1;S>=0;S--){const w=s[S];if(w.href===d&&(!p||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${y}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":_k,p||(_.as="script"),_.crossOrigin="",_.href=d,u&&_.setAttribute("nonce",u),document.head.appendChild(_),p)return new Promise((S,w)=>{_.addEventListener("load",S),_.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return a.then(o=>{for(const s of o||[])s.status==="rejected"&&i(s.reason);return r().catch(i)})};function On(e){"@babel/helpers - typeof";return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},On(e)}var Po=Uint8Array,Bs=Uint16Array,jm=Int32Array,c0=new Po([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),f0=new Po([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),C2=new Po([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d_=function(e,r){for(var t=new Bs(31),n=0;n<31;++n)t[n]=r+=1<<e[n-1];for(var a=new jm(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)a[i]=i-t[n]<<5|n;return{b:t,r:a}},p_=d_(c0,2),g_=p_.b,k2=p_.r;g_[28]=258,k2[258]=28;var v_=d_(f0,0),xk=v_.b,Y4=v_.r,L2=new Bs(32768);for(var ti=0;ti<32768;++ti){var qc=(ti&43690)>>1|(ti&21845)<<1;qc=(qc&52428)>>2|(qc&13107)<<2,qc=(qc&61680)>>4|(qc&3855)<<4,L2[ti]=((qc&65280)>>8|(qc&255)<<8)>>1}var Ru=function(e,r,t){for(var n=e.length,a=0,i=new Bs(r);a<n;++a)e[a]&&++i[e[a]-1];var o=new Bs(r);for(a=1;a<r;++a)o[a]=o[a-1]+i[a-1]<<1;var s;if(t){s=new Bs(1<<r);var c=15-r;for(a=0;a<n;++a)if(e[a])for(var u=a<<4|e[a],d=r-e[a],p=o[e[a]-1]++<<d,y=p|(1<<d)-1;p<=y;++p)s[L2[p]>>c]=u}else for(s=new Bs(n),a=0;a<n;++a)e[a]&&(s[a]=L2[o[e[a]-1]++]>>15-e[a]);return s},Xc=new Po(288);for(var ti=0;ti<144;++ti)Xc[ti]=8;for(var ti=144;ti<256;++ti)Xc[ti]=9;for(var ti=256;ti<280;++ti)Xc[ti]=7;for(var ti=280;ti<288;++ti)Xc[ti]=8;var mp=new Po(32);for(var ti=0;ti<32;++ti)mp[ti]=5;var Ek=Ru(Xc,9,0),Pk=Ru(Xc,9,1),Ok=Ru(mp,5,0),Ak=Ru(mp,5,1),n2=function(e){for(var r=e[0],t=1;t<e.length;++t)e[t]>r&&(r=e[t]);return r},Ul=function(e,r,t){var n=r/8|0;return(e[n]|e[n+1]<<8)>>(r&7)&t},i2=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},Fm=function(e){return(e+7)/8|0},m_=function(e,r,t){return(t==null||t>e.length)&&(t=e.length),new Po(e.subarray(r,t))},Ck=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Gl=function(e,r,t){var n=new Error(r||Ck[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Gl),!t)throw n;return n},kk=function(e,r,t,n){var a=e.length,i=0;if(!a||r.f&&!r.l)return t||new Po(0);var o=!t,s=o||r.i!=2,c=r.i;o&&(t=new Po(a*3));var u=function(de){var Oe=t.length;if(de>Oe){var Le=new Po(Math.max(Oe*2,de));Le.set(t),t=Le}},d=r.f||0,p=r.p||0,y=r.b||0,f=r.l,_=r.d,S=r.m,w=r.n,x=a*8;do{if(!f){d=Ul(e,p,1);var v=Ul(e,p+1,3);if(p+=3,v)if(v==1)f=Pk,_=Ak,S=9,w=5;else if(v==2){var M=Ul(e,p,31)+257,N=Ul(e,p+10,15)+4,R=M+Ul(e,p+5,31)+1;p+=14;for(var F=new Po(R),j=new Po(19),O=0;O<N;++O)j[C2[O]]=Ul(e,p+O*3,7);p+=N*3;for(var C=n2(j),A=(1<<C)-1,k=Ru(j,C,1),O=0;O<R;){var T=k[Ul(e,p,A)];p+=T&15;var g=T>>4;if(g<16)F[O++]=g;else{var V=0,G=0;for(g==16?(G=3+Ul(e,p,3),p+=2,V=F[O-1]):g==17?(G=3+Ul(e,p,7),p+=3):g==18&&(G=11+Ul(e,p,127),p+=7);G--;)F[O++]=V}}var $=F.subarray(0,M),te=F.subarray(M);S=n2($),w=n2(te),f=Ru($,S,1),_=Ru(te,w,1)}else Gl(1);else{var g=Fm(p)+4,E=e[g-4]|e[g-3]<<8,b=g+E;if(b>a){c&&Gl(0);break}s&&u(y+E),t.set(e.subarray(g,b),y),r.b=y+=E,r.p=p=b*8,r.f=d;continue}if(p>x){c&&Gl(0);break}}s&&u(y+131072);for(var W=(1<<S)-1,U=(1<<w)-1,z=p;;z=p){var V=f[i2(e,p)&W],D=V>>4;if(p+=V&15,p>x){c&&Gl(0);break}if(V||Gl(2),D<256)t[y++]=D;else if(D==256){z=p,f=null;break}else{var Y=D-254;if(D>264){var O=D-257,Q=c0[O];Y=Ul(e,p,(1<<Q)-1)+g_[O],p+=Q}var J=_[i2(e,p)&U],Z=J>>4;J||Gl(3),p+=J&15;var te=xk[Z];if(Z>3){var Q=f0[Z];te+=i2(e,p)&(1<<Q)-1,p+=Q}if(p>x){c&&Gl(0);break}s&&u(y+131072);var ae=y+Y;if(y<te){var se=i-te,ce=Math.min(te,ae);for(se+y<0&&Gl(3);y<ce;++y)t[y]=n[se+y]}for(;y<ae;++y)t[y]=t[y-te]}}r.l=f,r.p=z,r.b=y,r.f=d,f&&(d=1,r.m=S,r.d=_,r.n=w)}while(!d);return y!=t.length&&o?m_(t,0,y):t.subarray(0,y)},lc=function(e,r,t){t<<=r&7;var n=r/8|0;e[n]|=t,e[n+1]|=t>>8},rp=function(e,r,t){t<<=r&7;var n=r/8|0;e[n]|=t,e[n+1]|=t>>8,e[n+2]|=t>>16},a2=function(e,r){for(var t=[],n=0;n<e.length;++n)e[n]&&t.push({s:n,f:e[n]});var a=t.length,i=t.slice();if(!a)return{t:b_,l:0};if(a==1){var o=new Po(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(b,M){return b.f-M.f}),t.push({s:-1,f:25001});var s=t[0],c=t[1],u=0,d=1,p=2;for(t[0]={s:-1,f:s.f+c.f,l:s,r:c};d!=a-1;)s=t[t[u].f<t[p].f?u++:p++],c=t[u!=d&&t[u].f<t[p].f?u++:p++],t[d++]={s:-1,f:s.f+c.f,l:s,r:c};for(var y=i[0].s,n=1;n<a;++n)i[n].s>y&&(y=i[n].s);var f=new Bs(y+1),_=N2(t[d-1],f,0);if(_>r){var n=0,S=0,w=_-r,x=1<<w;for(i.sort(function(M,N){return f[N.s]-f[M.s]||M.f-N.f});n<a;++n){var v=i[n].s;if(f[v]>r)S+=x-(1<<_-f[v]),f[v]=r;else break}for(S>>=w;S>0;){var g=i[n].s;f[g]<r?S-=1<<r-f[g]++-1:++n}for(;n>=0&&S;--n){var E=i[n].s;f[E]==r&&(--f[E],++S)}_=r}return{t:new Po(f),l:_}},N2=function(e,r,t){return e.s==-1?Math.max(N2(e.l,r,t+1),N2(e.r,r,t+1)):r[e.s]=t},X4=function(e){for(var r=e.length;r&&!e[--r];);for(var t=new Bs(++r),n=0,a=e[0],i=1,o=function(c){t[n++]=c},s=1;s<=r;++s)if(e[s]==a&&s!=r)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=e[s]}return{c:t.subarray(0,n),n:r}},np=function(e,r){for(var t=0,n=0;n<r.length;++n)t+=e[n]*r[n];return t},y_=function(e,r,t){var n=t.length,a=Fm(r+2);e[a]=n&255,e[a+1]=n>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var i=0;i<n;++i)e[a+i+4]=t[i];return(a+4+n)*8},K4=function(e,r,t,n,a,i,o,s,c,u,d){lc(r,d++,t),++a[256];for(var p=a2(a,15),y=p.t,f=p.l,_=a2(i,15),S=_.t,w=_.l,x=X4(y),v=x.c,g=x.n,E=X4(S),b=E.c,M=E.n,N=new Bs(19),R=0;R<v.length;++R)++N[v[R]&31];for(var R=0;R<b.length;++R)++N[b[R]&31];for(var F=a2(N,7),j=F.t,O=F.l,C=19;C>4&&!j[C2[C-1]];--C);var A=u+5<<3,k=np(a,Xc)+np(i,mp)+o,T=np(a,y)+np(i,S)+o+14+3*C+np(N,j)+2*N[16]+3*N[17]+7*N[18];if(c>=0&&A<=k&&A<=T)return y_(r,d,e.subarray(c,c+u));var V,G,$,te;if(lc(r,d,1+(T<k)),d+=2,T<k){V=Ru(y,f,0),G=y,$=Ru(S,w,0),te=S;var W=Ru(j,O,0);lc(r,d,g-257),lc(r,d+5,M-1),lc(r,d+10,C-4),d+=14;for(var R=0;R<C;++R)lc(r,d+3*R,j[C2[R]]);d+=3*C;for(var U=[v,b],z=0;z<2;++z)for(var D=U[z],R=0;R<D.length;++R){var Y=D[R]&31;lc(r,d,W[Y]),d+=j[Y],Y>15&&(lc(r,d,D[R]>>5&127),d+=D[R]>>12)}}else V=Ek,G=Xc,$=Ok,te=mp;for(var R=0;R<s;++R){var Q=n[R];if(Q>255){var Y=Q>>18&31;rp(r,d,V[Y+257]),d+=G[Y+257],Y>7&&(lc(r,d,Q>>23&31),d+=c0[Y]);var J=Q&31;rp(r,d,$[J]),d+=te[J],J>3&&(rp(r,d,Q>>5&8191),d+=f0[J])}else rp(r,d,V[Q]),d+=G[Q]}return rp(r,d,V[256]),d+G[256]},Lk=new jm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),b_=new Po(0),Nk=function(e,r,t,n,a,i){var o=i.z||e.length,s=new Po(n+o+5*(1+Math.ceil(o/7e3))+a),c=s.subarray(n,s.length-a),u=i.l,d=(i.r||0)&7;if(r){d&&(c[0]=i.r>>3);for(var p=Lk[r-1],y=p>>13,f=p&8191,_=(1<<t)-1,S=i.p||new Bs(32768),w=i.h||new Bs(_+1),x=Math.ceil(t/3),v=2*x,g=function(ke){return(e[ke]^e[ke+1]<<x^e[ke+2]<<v)&_},E=new jm(25e3),b=new Bs(288),M=new Bs(32),N=0,R=0,F=i.i||0,j=0,O=i.w||0,C=0;F+2<o;++F){var A=g(F),k=F&32767,T=w[A];if(S[k]=T,w[A]=k,O<=F){var V=o-F;if((N>7e3||j>24576)&&(V>423||!u)){d=K4(e,c,0,E,b,M,R,j,C,F-C,d),j=N=R=0,C=F;for(var G=0;G<286;++G)b[G]=0;for(var G=0;G<30;++G)M[G]=0}var $=2,te=0,W=f,U=k-T&32767;if(V>2&&A==g(F-U))for(var z=Math.min(y,V)-1,D=Math.min(32767,F),Y=Math.min(258,V);U<=D&&--W&&k!=T;){if(e[F+$]==e[F+$-U]){for(var Q=0;Q<Y&&e[F+Q]==e[F+Q-U];++Q);if(Q>$){if($=Q,te=U,Q>z)break;for(var J=Math.min(U,Q-2),Z=0,G=0;G<J;++G){var ae=F-U+G&32767,se=S[ae],ce=ae-se&32767;ce>Z&&(Z=ce,T=ae)}}}k=T,T=S[k],U+=k-T&32767}if(te){E[j++]=268435456|k2[$]<<18|Y4[te];var de=k2[$]&31,Oe=Y4[te]&31;R+=c0[de]+f0[Oe],++b[257+de],++M[Oe],O=F+$,++N}else E[j++]=e[F],++b[e[F]]}}for(F=Math.max(F,O);F<o;++F)E[j++]=e[F],++b[e[F]];d=K4(e,c,u,E,b,M,R,j,C,F-C,d),u||(i.r=d&7|c[d/8|0]<<3,d-=7,i.h=w,i.p=S,i.i=F,i.w=O)}else{for(var F=i.w||0;F<o+u;F+=65535){var Le=F+65535;Le>=o&&(c[d/8|0]=u,Le=o),d=y_(c,d+1,e.subarray(F,Le))}i.i=o}return m_(s,0,n+Fm(d)+a)},w_=function(){var e=1,r=0;return{p:function(t){for(var n=e,a=r,i=t.length|0,o=0;o!=i;){for(var s=Math.min(o+2655,i);o<s;++o)a+=n+=t[o];n=(n&65535)+15*(n>>16),a=(a&65535)+15*(a>>16)}e=n,r=a},d:function(){return e%=65521,r%=65521,(e&255)<<24|(e&65280)<<8|(r&255)<<8|r>>8}}},Tk=function(e,r,t,n,a){if(!a&&(a={l:1},r.dictionary)){var i=r.dictionary.subarray(-32768),o=new Po(i.length+e.length);o.set(i),o.set(e,i.length),e=o,a.w=i.length}return Nk(e,r.level==null?6:r.level,r.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+r.mem,t,n,a)},__=function(e,r,t){for(;t;++r)e[r]=t,t>>>=8},Rk=function(e,r){var t=r.level,n=t==0?0:t<6?1:t==9?3:2;if(e[0]=120,e[1]=n<<6|(r.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,r.dictionary){var a=w_();a.p(r.dictionary),__(e,2,a.d())}},Mk=function(e,r){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Gl(6,"invalid zlib data"),(e[1]>>5&1)==1&&Gl(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function T2(e,r){r||(r={});var t=w_();t.p(e);var n=Tk(e,r,r.dictionary?6:2,4);return Rk(n,r),__(n,n.length-4,t.d()),n}function Ik(e,r){return kk(e.subarray(Mk(e),-4),{i:2},r,r)}var jk=typeof TextDecoder<"u"&&new TextDecoder,Fk=0;try{jk.decode(b_,{stream:!0}),Fk=1}catch{}var pr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function o2(){pr.console&&typeof pr.console.log=="function"&&pr.console.log.apply(pr.console,arguments)}var Gn={log:o2,warn:function(e){pr.console&&(typeof pr.console.warn=="function"?pr.console.warn.apply(pr.console,arguments):o2.call(null,arguments))},error:function(e){pr.console&&(typeof pr.console.error=="function"?pr.console.error.apply(pr.console,arguments):o2(e))}};function s2(e,r,t){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){_f(n.response,r,t)},n.onerror=function(){Gn.error("could not download file")},n.send()}function Z4(e){var r=new XMLHttpRequest;r.open("HEAD",e,!1);try{r.send()}catch{}return r.status>=200&&r.status<=299}function f1(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}}var cp,R2,_f=pr.saveAs||((typeof window>"u"?"undefined":On(window))!=="object"||window!==pr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,r,t){var n=pr.URL||pr.webkitURL,a=document.createElement("a");r=r||e.name||"download",a.download=r,a.rel="noopener",typeof e=="string"?(a.href=e,a.origin!==location.origin?Z4(a.href)?s2(e,r,t):f1(a,a.target="_blank"):f1(a)):(a.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(a.href)},4e4),setTimeout(function(){f1(a)},0))}:"msSaveOrOpenBlob"in navigator?function(e,r,t){if(r=r||e.name||"download",typeof e=="string")if(Z4(e))s2(e,r,t);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){f1(n)})}else navigator.msSaveOrOpenBlob(function(a,i){return i===void 0?i={autoBom:!1}:On(i)!=="object"&&(Gn.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}(e,t),r)}:function(e,r,t,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return s2(e,r,t);var a=e.type==="application/octet-stream",i=/constructor/i.test(pr.HTMLElement)||pr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||a&&i)&&(typeof FileReader>"u"?"undefined":On(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var d=s.result;d=o?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=d:location=d,n=null},s.readAsDataURL(e)}else{var c=pr.URL||pr.webkitURL,u=c.createObjectURL(e);n?n.location=u:location.href=u,n=null,setTimeout(function(){c.revokeObjectURL(u)},4e4)}});/**
|
|
427
|
+
* A class to parse color values
|
|
428
|
+
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
429
|
+
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
|
430
|
+
* @license Use it if you like it
|
|
431
|
+
*/function S_(e){var r;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],n=0;n<t.length;n++){var a=t[n].re,i=t[n].process,o=a.exec(e);o&&(r=i(o),this.r=r[0],this.g=r[1],this.b=r[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var s=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return s.length==1&&(s="0"+s),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+s+c+u}}/**
|
|
432
|
+
* @license
|
|
433
|
+
* Joseph Myers does not specify a particular license for his work.
|
|
434
|
+
*
|
|
435
|
+
* Author: Joseph Myers
|
|
436
|
+
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
|
437
|
+
*
|
|
438
|
+
* Modified by: Owen Leong
|
|
439
|
+
*/function l2(e,r){var t=e[0],n=e[1],a=e[2],i=e[3];t=_o(t,n,a,i,r[0],7,-680876936),i=_o(i,t,n,a,r[1],12,-389564586),a=_o(a,i,t,n,r[2],17,606105819),n=_o(n,a,i,t,r[3],22,-1044525330),t=_o(t,n,a,i,r[4],7,-176418897),i=_o(i,t,n,a,r[5],12,1200080426),a=_o(a,i,t,n,r[6],17,-1473231341),n=_o(n,a,i,t,r[7],22,-45705983),t=_o(t,n,a,i,r[8],7,1770035416),i=_o(i,t,n,a,r[9],12,-1958414417),a=_o(a,i,t,n,r[10],17,-42063),n=_o(n,a,i,t,r[11],22,-1990404162),t=_o(t,n,a,i,r[12],7,1804603682),i=_o(i,t,n,a,r[13],12,-40341101),a=_o(a,i,t,n,r[14],17,-1502002290),t=So(t,n=_o(n,a,i,t,r[15],22,1236535329),a,i,r[1],5,-165796510),i=So(i,t,n,a,r[6],9,-1069501632),a=So(a,i,t,n,r[11],14,643717713),n=So(n,a,i,t,r[0],20,-373897302),t=So(t,n,a,i,r[5],5,-701558691),i=So(i,t,n,a,r[10],9,38016083),a=So(a,i,t,n,r[15],14,-660478335),n=So(n,a,i,t,r[4],20,-405537848),t=So(t,n,a,i,r[9],5,568446438),i=So(i,t,n,a,r[14],9,-1019803690),a=So(a,i,t,n,r[3],14,-187363961),n=So(n,a,i,t,r[8],20,1163531501),t=So(t,n,a,i,r[13],5,-1444681467),i=So(i,t,n,a,r[2],9,-51403784),a=So(a,i,t,n,r[7],14,1735328473),t=xo(t,n=So(n,a,i,t,r[12],20,-1926607734),a,i,r[5],4,-378558),i=xo(i,t,n,a,r[8],11,-2022574463),a=xo(a,i,t,n,r[11],16,1839030562),n=xo(n,a,i,t,r[14],23,-35309556),t=xo(t,n,a,i,r[1],4,-1530992060),i=xo(i,t,n,a,r[4],11,1272893353),a=xo(a,i,t,n,r[7],16,-155497632),n=xo(n,a,i,t,r[10],23,-1094730640),t=xo(t,n,a,i,r[13],4,681279174),i=xo(i,t,n,a,r[0],11,-358537222),a=xo(a,i,t,n,r[3],16,-722521979),n=xo(n,a,i,t,r[6],23,76029189),t=xo(t,n,a,i,r[9],4,-640364487),i=xo(i,t,n,a,r[12],11,-421815835),a=xo(a,i,t,n,r[15],16,530742520),t=Eo(t,n=xo(n,a,i,t,r[2],23,-995338651),a,i,r[0],6,-198630844),i=Eo(i,t,n,a,r[7],10,1126891415),a=Eo(a,i,t,n,r[14],15,-1416354905),n=Eo(n,a,i,t,r[5],21,-57434055),t=Eo(t,n,a,i,r[12],6,1700485571),i=Eo(i,t,n,a,r[3],10,-1894986606),a=Eo(a,i,t,n,r[10],15,-1051523),n=Eo(n,a,i,t,r[1],21,-2054922799),t=Eo(t,n,a,i,r[8],6,1873313359),i=Eo(i,t,n,a,r[15],10,-30611744),a=Eo(a,i,t,n,r[6],15,-1560198380),n=Eo(n,a,i,t,r[13],21,1309151649),t=Eo(t,n,a,i,r[4],6,-145523070),i=Eo(i,t,n,a,r[11],10,-1120210379),a=Eo(a,i,t,n,r[2],15,718787259),n=Eo(n,a,i,t,r[9],21,-343485551),e[0]=Vc(t,e[0]),e[1]=Vc(n,e[1]),e[2]=Vc(a,e[2]),e[3]=Vc(i,e[3])}function h0(e,r,t,n,a,i){return r=Vc(Vc(r,e),Vc(n,i)),Vc(r<<a|r>>>32-a,t)}function _o(e,r,t,n,a,i,o){return h0(r&t|~r&n,e,r,a,i,o)}function So(e,r,t,n,a,i,o){return h0(r&n|t&~n,e,r,a,i,o)}function xo(e,r,t,n,a,i,o){return h0(r^t^n,e,r,a,i,o)}function Eo(e,r,t,n,a,i,o){return h0(t^(r|~n),e,r,a,i,o)}function x_(e){var r,t=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=e.length;r+=64)l2(n,Dk(e.substring(r-64,r)));e=e.substring(r-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;r<e.length;r++)a[r>>2]|=e.charCodeAt(r)<<(r%4<<3);if(a[r>>2]|=128<<(r%4<<3),r>55)for(l2(n,a),r=0;r<16;r++)a[r]=0;return a[14]=8*t,l2(n,a),n}function Dk(e){var r,t=[];for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}cp=pr.atob.bind(pr),R2=pr.btoa.bind(pr);var Q4="0123456789abcdef".split("");function Bk(e){for(var r="",t=0;t<4;t++)r+=Q4[e>>8*t+4&15]+Q4[e>>8*t&15];return r}function qk(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function M2(e){return x_(e).map(qk).join("")}var zk=function(e){for(var r=0;r<e.length;r++)e[r]=Bk(e[r]);return e.join("")}(x_("hello"))!="5d41402abc4b2a76b9719d911017c592";function Vc(e,r){if(zk){var t=(65535&e)+(65535&r);return(e>>16)+(r>>16)+(t>>16)<<16|65535&t}return e+r&4294967295}/**
|
|
440
|
+
* @license
|
|
441
|
+
* FPDF is released under a permissive license: there is no usage restriction.
|
|
442
|
+
* You may embed it freely in your application (commercial or not), with or
|
|
443
|
+
* without modifications.
|
|
444
|
+
*
|
|
445
|
+
* Reference: http://www.fpdf.org/en/script/script37.php
|
|
446
|
+
*/function I2(e,r){var t,n,a,i;if(e!==t){for(var o=(a=e,i=1+(256/e.length>>0),new Array(i+1).join(a)),s=[],c=0;c<256;c++)s[c]=c;var u=0;for(c=0;c<256;c++){var d=s[c];u=(u+d+o.charCodeAt(c))%256,s[c]=s[u],s[u]=d}t=e,n=s}else s=n;var p=r.length,y=0,f=0,_="";for(c=0;c<p;c++)f=(f+(d=s[y=(y+1)%256]))%256,s[y]=s[f],s[f]=d,o=s[(s[y]+s[f])%256],_+=String.fromCharCode(r.charCodeAt(c)^o);return _}/**
|
|
447
|
+
* @license
|
|
448
|
+
* Licensed under the MIT License.
|
|
449
|
+
* http://opensource.org/licenses/mit-license
|
|
450
|
+
* Author: Owen Leong (@owenl131)
|
|
451
|
+
* Date: 15 Oct 2020
|
|
452
|
+
* References:
|
|
453
|
+
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
454
|
+
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
455
|
+
* http://www.fpdf.org/en/script/script37.php
|
|
456
|
+
*/var J4={print:4,modify:8,copy:16,"annot-forms":32};function lh(e,r,t,n){this.v=1,this.r=2;var a=192;e.forEach(function(s){if(J4.perm!==void 0)throw new Error("Invalid permission: "+s);a+=J4[s]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var i=(r+this.padding).substr(0,32),o=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,o),this.P=-(1+(255^a)),this.encryptionKey=M2(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=I2(this.encryptionKey,this.padding)}function uh(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var r="",t=e.length,n=0;n<t;n++){var a=e.charCodeAt(n);a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?r+="#"+("0"+a.toString(16)).slice(-2):r+=e[n]}return r}function ew(e){if(On(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var r={};this.subscribe=function(t,n,a){if(a=a||!1,typeof t!="string"||typeof n!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");r.hasOwnProperty(t)||(r[t]={});var i=Math.random().toString(35);return r[t][i]=[n,!!a],i},this.unsubscribe=function(t){for(var n in r)if(r[n][t])return delete r[n][t],Object.keys(r[n]).length===0&&delete r[n],!0;return!1},this.publish=function(t){if(r.hasOwnProperty(t)){var n=Array.prototype.slice.call(arguments,1),a=[];for(var i in r[t]){var o=r[t][i];try{o[0].apply(e,n)}catch(s){pr.console&&Gn.error("jsPDF PubSub Error",s.message,s)}o[1]&&a.push(i)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return r}}function B1(e){if(!(this instanceof B1))return new B1(e);var r="opacity,stroke-opacity".split(",");for(var t in e)e.hasOwnProperty(t)&&r.indexOf(t)>=0&&(this[t]=e[t]);this.id="",this.objectNumber=-1}function E_(e,r){this.gState=e,this.matrix=r,this.id="",this.objectNumber=-1}function Sf(e,r,t,n,a){if(!(this instanceof Sf))return new Sf(e,r,t,n,a);this.type=e==="axial"?2:3,this.coords=r,this.colors=t,E_.call(this,n,a)}function dh(e,r,t,n,a){if(!(this instanceof dh))return new dh(e,r,t,n,a);this.boundingBox=e,this.xStep=r,this.yStep=t,this.stream="",this.cloneIndex=0,E_.call(this,n,a)}function hr(e){var r,t=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],a=arguments[2],i=arguments[3],o=[],s=1,c=16,u="S",d=null;On(e=e||{})==="object"&&(t=e.orientation,n=e.unit||n,a=e.format||a,i=e.compress||e.compressPdf||i,(d=e.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),s=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(r=e.precision),e.floatPrecision!==void 0&&(c=e.floatPrecision),u=e.defaultPathOperation||"S"),o=e.filters||(i===!0?["FlateEncode"]:o),n=n||"mm",t=(""+(t||"P")).toLowerCase();var p=e.putOnlyUsedFonts||!1,y={},f={internal:{},__private__:{}};f.__private__.PubSub=ew;var _="1.3",S=f.__private__.getPdfVersion=function(){return _};f.__private__.setPdfVersion=function(X){_=X};var w={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};f.__private__.getPageFormats=function(){return w};var x=f.__private__.getPageFormat=function(X){return w[X]};a=a||"a4";var v={COMPAT:"compat",ADVANCED:"advanced"},g=v.COMPAT;function E(){this.saveGraphicsState(),ye(new ze(ct,0,0,-ct,0,Ko()*ct).toString()+" cm"),this.setFontSize(this.getFontSize()/ct),u="n",g=v.ADVANCED}function b(){this.restoreGraphicsState(),u="S",g=v.COMPAT}var M=f.__private__.combineFontStyleAndFontWeight=function(X,fe){if(X=="bold"&&fe=="normal"||X=="bold"&&fe==400||X=="normal"&&fe=="italic"||X=="bold"&&fe=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return fe&&(X=fe==400||fe==="normal"?X==="italic"?"italic":"normal":fe!=700&&fe!=="bold"||X!=="normal"?(fe==700?"bold":fe)+""+X:"bold"),X};f.advancedAPI=function(X){var fe=g===v.COMPAT;return fe&&E.call(this),typeof X!="function"||(X(this),fe&&b.call(this)),this},f.compatAPI=function(X){var fe=g===v.ADVANCED;return fe&&b.call(this),typeof X!="function"||(X(this),fe&&E.call(this)),this},f.isAdvancedAPI=function(){return g===v.ADVANCED};var N,R=function(X){if(g!==v.ADVANCED)throw new Error(X+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},F=f.roundToPrecision=f.__private__.roundToPrecision=function(X,fe){var Ae=r||fe;if(isNaN(X)||isNaN(Ae))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return X.toFixed(Ae).replace(/0+$/,"")};N=f.hpf=f.__private__.hpf=typeof c=="number"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return F(X,c)}:c==="smart"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return F(X,X>-1&&X<1?16:5)}:function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return F(X,16)};var j=f.f2=f.__private__.f2=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f2");return F(X,2)},O=f.__private__.f3=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f3");return F(X,3)},C=f.scale=f.__private__.scale=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.scale");return g===v.COMPAT?X*ct:g===v.ADVANCED?X:void 0},A=function(X){return g===v.COMPAT?Ko()-X:g===v.ADVANCED?X:void 0},k=function(X){return C(A(X))};f.__private__.setPrecision=f.setPrecision=function(X){typeof parseInt(X,10)=="number"&&(r=parseInt(X,10))};var T,V="00000000000000000000000000000000",G=f.__private__.getFileId=function(){return V},$=f.__private__.setFileId=function(X){return V=X!==void 0&&/^[a-fA-F0-9]{32}$/.test(X)?X.toUpperCase():V.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(gn=new lh(d.userPermissions,d.userPassword,d.ownerPassword,V)),V};f.setFileId=function(X){return $(X),this},f.getFileId=function(){return G()};var te=f.__private__.convertDateToPDFDate=function(X){var fe=X.getTimezoneOffset(),Ae=fe<0?"+":"-",je=Math.floor(Math.abs(fe/60)),Qe=Math.abs(fe%60),dt=[Ae,Y(je),"'",Y(Qe),"'"].join("");return["D:",X.getFullYear(),Y(X.getMonth()+1),Y(X.getDate()),Y(X.getHours()),Y(X.getMinutes()),Y(X.getSeconds()),dt].join("")},W=f.__private__.convertPDFDateToDate=function(X){var fe=parseInt(X.substr(2,4),10),Ae=parseInt(X.substr(6,2),10)-1,je=parseInt(X.substr(8,2),10),Qe=parseInt(X.substr(10,2),10),dt=parseInt(X.substr(12,2),10),St=parseInt(X.substr(14,2),10);return new Date(fe,Ae,je,Qe,dt,St,0)},U=f.__private__.setCreationDate=function(X){var fe;if(X===void 0&&(X=new Date),X instanceof Date)fe=te(X);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(X))throw new Error("Invalid argument passed to jsPDF.setCreationDate");fe=X}return T=fe},z=f.__private__.getCreationDate=function(X){var fe=T;return X==="jsDate"&&(fe=W(T)),fe};f.setCreationDate=function(X){return U(X),this},f.getCreationDate=function(X){return z(X)};var D,Y=f.__private__.padd2=function(X){return("0"+parseInt(X)).slice(-2)},Q=f.__private__.padd2Hex=function(X){return("00"+(X=X.toString())).substr(X.length)},J=0,Z=[],ae=[],se=0,ce=[],de=[],Oe=!1,Le=ae,ke=function(){J=0,se=0,ae=[],Z=[],ce=[],Ur=er(),on=er()};f.__private__.setCustomOutputDestination=function(X){Oe=!0,Le=X};var Se=function(X){Oe||(Le=X)};f.__private__.resetCustomOutputDestination=function(){Oe=!1,Le=ae};var ye=f.__private__.out=function(X){return X=X.toString(),se+=X.length+1,Le.push(X),Le},Je=f.__private__.write=function(X){return ye(arguments.length===1?X.toString():Array.prototype.join.call(arguments," "))},we=f.__private__.getArrayBuffer=function(X){for(var fe=X.length,Ae=new ArrayBuffer(fe),je=new Uint8Array(Ae);fe--;)je[fe]=X.charCodeAt(fe);return Ae},me=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];f.__private__.getStandardFonts=function(){return me};var Ee=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(X){return Ee=g===v.ADVANCED?X/ct:X,this};var Te,he=f.__private__.getFontSize=f.getFontSize=function(){return g===v.COMPAT?Ee:Ee*ct},Re=e.R2L||!1;f.__private__.setR2L=f.setR2L=function(X){return Re=X,this},f.__private__.getR2L=f.getR2L=function(){return Re};var Ie,Xe=f.__private__.setZoomMode=function(X){var fe=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(X))Te=X;else if(isNaN(X)){if(fe.indexOf(X)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+X+'" is not recognized.');Te=X}else Te=parseInt(X,10)};f.__private__.getZoomMode=function(){return Te};var rt,vt=f.__private__.setPageMode=function(X){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(X)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+X+'" is not recognized.');Ie=X};f.__private__.getPageMode=function(){return Ie};var et=f.__private__.setLayoutMode=function(X){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(X)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+X+'" is not recognized.');rt=X};f.__private__.getLayoutMode=function(){return rt},f.__private__.setDisplayMode=f.setDisplayMode=function(X,fe,Ae){return Xe(X),et(fe),vt(Ae),this};var yt={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(X){if(Object.keys(yt).indexOf(X)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return yt[X]},f.__private__.getDocumentProperties=function(){return yt},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(X){for(var fe in yt)yt.hasOwnProperty(fe)&&X[fe]&&(yt[fe]=X[fe]);return this},f.__private__.setDocumentProperty=function(X,fe){if(Object.keys(yt).indexOf(X)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return yt[X]=fe};var mt,ct,Bt,Pt,Yt,Gt={},Be={},Ce=[],ft={},Ct={},Ot={},Nt={},Jt=null,Xt=0,kt=[],nt=new ew(f),We=e.hotfixes||[],it={},He={},wt=[],ze=function X(fe,Ae,je,Qe,dt,St){if(!(this instanceof X))return new X(fe,Ae,je,Qe,dt,St);isNaN(fe)&&(fe=1),isNaN(Ae)&&(Ae=0),isNaN(je)&&(je=0),isNaN(Qe)&&(Qe=1),isNaN(dt)&&(dt=0),isNaN(St)&&(St=0),this._matrix=[fe,Ae,je,Qe,dt,St]};Object.defineProperty(ze.prototype,"sx",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(ze.prototype,"shy",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(ze.prototype,"shx",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(ze.prototype,"sy",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(ze.prototype,"tx",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(ze.prototype,"ty",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(ze.prototype,"a",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(ze.prototype,"b",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(ze.prototype,"c",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(ze.prototype,"d",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(ze.prototype,"e",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(ze.prototype,"f",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(ze.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(ze.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(ze.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(ze.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),ze.prototype.join=function(X){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(N).join(X)},ze.prototype.multiply=function(X){var fe=X.sx*this.sx+X.shy*this.shx,Ae=X.sx*this.shy+X.shy*this.sy,je=X.shx*this.sx+X.sy*this.shx,Qe=X.shx*this.shy+X.sy*this.sy,dt=X.tx*this.sx+X.ty*this.shx+this.tx,St=X.tx*this.shy+X.ty*this.sy+this.ty;return new ze(fe,Ae,je,Qe,dt,St)},ze.prototype.decompose=function(){var X=this.sx,fe=this.shy,Ae=this.shx,je=this.sy,Qe=this.tx,dt=this.ty,St=Math.sqrt(X*X+fe*fe),Ft=(X/=St)*Ae+(fe/=St)*je;Ae-=X*Ft,je-=fe*Ft;var ir=Math.sqrt(Ae*Ae+je*je);return Ft/=ir,X*(je/=ir)<fe*(Ae/=ir)&&(X=-X,fe=-fe,Ft=-Ft,St=-St),{scale:new ze(St,0,0,ir,0,0),translate:new ze(1,0,0,1,Qe,dt),rotate:new ze(X,fe,-fe,X,0,0),skew:new ze(1,0,Ft,1,0,0)}},ze.prototype.toString=function(X){return this.join(" ")},ze.prototype.inversed=function(){var X=this.sx,fe=this.shy,Ae=this.shx,je=this.sy,Qe=this.tx,dt=this.ty,St=1/(X*je-fe*Ae),Ft=je*St,ir=-fe*St,gr=-Ae*St,dr=X*St;return new ze(Ft,ir,gr,dr,-Ft*Qe-gr*dt,-ir*Qe-dr*dt)},ze.prototype.applyToPoint=function(X){var fe=X.x*this.sx+X.y*this.shx+this.tx,Ae=X.x*this.shy+X.y*this.sy+this.ty;return new $n(fe,Ae)},ze.prototype.applyToRectangle=function(X){var fe=this.applyToPoint(X),Ae=this.applyToPoint(new $n(X.x+X.w,X.y+X.h));return new gi(fe.x,fe.y,Ae.x-fe.x,Ae.y-fe.y)},ze.prototype.clone=function(){var X=this.sx,fe=this.shy,Ae=this.shx,je=this.sy,Qe=this.tx,dt=this.ty;return new ze(X,fe,Ae,je,Qe,dt)},f.Matrix=ze;var _t=f.matrixMult=function(X,fe){return fe.multiply(X)},Ht=new ze(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=Ht;var Dt=function(X,fe){if(!Ct[X]){var Ae=(fe instanceof Sf?"Sh":"P")+(Object.keys(ft).length+1).toString(10);fe.id=Ae,Ct[X]=Ae,ft[Ae]=fe,nt.publish("addPattern",fe)}};f.ShadingPattern=Sf,f.TilingPattern=dh,f.addShadingPattern=function(X,fe){return R("addShadingPattern()"),Dt(X,fe),this},f.beginTilingPattern=function(X){R("beginTilingPattern()"),Qs(X.boundingBox[0],X.boundingBox[1],X.boundingBox[2]-X.boundingBox[0],X.boundingBox[3]-X.boundingBox[1],X.matrix)},f.endTilingPattern=function(X,fe){R("endTilingPattern()"),fe.stream=de[D].join(`
|
|
457
|
+
`),Dt(X,fe),nt.publish("endTilingPattern",fe),wt.pop().restore()};var Vt=f.__private__.newObject=function(){var X=er();return _r(X,!0),X},er=f.__private__.newObjectDeferred=function(){return J++,Z[J]=function(){return se},J},_r=function(X,fe){return fe=typeof fe=="boolean"&&fe,Z[X]=se,fe&&ye(X+" 0 obj"),X},kr=f.__private__.newAdditionalObject=function(){var X={objId:er(),content:""};return ce.push(X),X},Ur=er(),on=er(),Wn=f.__private__.decodeColorString=function(X){var fe=X.split(" ");if(fe.length!==2||fe[1]!=="g"&&fe[1]!=="G")fe.length===5&&(fe[4]==="k"||fe[4]==="K")&&(fe=[(1-fe[0])*(1-fe[3]),(1-fe[1])*(1-fe[3]),(1-fe[2])*(1-fe[3]),"r"]);else{var Ae=parseFloat(fe[0]);fe=[Ae,Ae,Ae,"r"]}for(var je="#",Qe=0;Qe<3;Qe++)je+=("0"+Math.floor(255*parseFloat(fe[Qe])).toString(16)).slice(-2);return je},sn=f.__private__.encodeColorString=function(X){var fe;typeof X=="string"&&(X={ch1:X});var Ae=X.ch1,je=X.ch2,Qe=X.ch3,dt=X.ch4,St=X.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Ae=="string"&&Ae.charAt(0)!=="#"){var Ft=new S_(Ae);if(Ft.ok)Ae=Ft.toHex();else if(!/^\d*\.?\d*$/.test(Ae))throw new Error('Invalid color "'+Ae+'" passed to jsPDF.encodeColorString.')}if(typeof Ae=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Ae)&&(Ae="#"+Ae[1]+Ae[1]+Ae[2]+Ae[2]+Ae[3]+Ae[3]),typeof Ae=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Ae)){var ir=parseInt(Ae.substr(1),16);Ae=ir>>16&255,je=ir>>8&255,Qe=255&ir}if(je===void 0||dt===void 0&&Ae===je&&je===Qe)if(typeof Ae=="string")fe=Ae+" "+St[0];else switch(X.precision){case 2:fe=j(Ae/255)+" "+St[0];break;case 3:default:fe=O(Ae/255)+" "+St[0]}else if(dt===void 0||On(dt)==="object"){if(dt&&!isNaN(dt.a)&&dt.a===0)return fe=["1.","1.","1.",St[1]].join(" ");if(typeof Ae=="string")fe=[Ae,je,Qe,St[1]].join(" ");else switch(X.precision){case 2:fe=[j(Ae/255),j(je/255),j(Qe/255),St[1]].join(" ");break;default:case 3:fe=[O(Ae/255),O(je/255),O(Qe/255),St[1]].join(" ")}}else if(typeof Ae=="string")fe=[Ae,je,Qe,dt,St[2]].join(" ");else switch(X.precision){case 2:fe=[j(Ae),j(je),j(Qe),j(dt),St[2]].join(" ");break;case 3:default:fe=[O(Ae),O(je),O(Qe),O(dt),St[2]].join(" ")}return fe},Li=f.__private__.getFilters=function(){return o},wi=f.__private__.putStream=function(X){var fe=(X=X||{}).data||"",Ae=X.filters||Li(),je=X.alreadyAppliedFilters||[],Qe=X.addLength1||!1,dt=fe.length,St=X.objectId,Ft=function(Qn){return Qn};if(d!==null&&St===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(Ft=gn.encryptor(St,0));var ir={};Ae===!0&&(Ae=["FlateEncode"]);var gr=X.additionalKeyValues||[],dr=(ir=hr.API.processDataByFilters!==void 0?hr.API.processDataByFilters(fe,Ae):{data:fe,reverseChain:[]}).reverseChain+(Array.isArray(je)?je.join(" "):je.toString());if(ir.data.length!==0&&(gr.push({key:"Length",value:ir.data.length}),Qe===!0&&gr.push({key:"Length1",value:dt})),dr.length!=0)if(dr.split("/").length-1==1)gr.push({key:"Filter",value:dr});else{gr.push({key:"Filter",value:"["+dr+"]"});for(var Sr=0;Sr<gr.length;Sr+=1)if(gr[Sr].key==="DecodeParms"){for(var Cn=[],Sn=0;Sn<ir.reverseChain.split("/").length-1;Sn+=1)Cn.push("null");Cn.push(gr[Sr].value),gr[Sr].value="["+Cn.join(" ")+"]"}}ye("<<");for(var jn=0;jn<gr.length;jn++)ye("/"+gr[jn].key+" "+gr[jn].value);ye(">>"),ir.data.length!==0&&(ye("stream"),ye(Ft(ir.data)),ye("endstream"))},Ni=f.__private__.putPage=function(X){var fe=X.number,Ae=X.data,je=X.objId,Qe=X.contentsObjId;_r(je,!0),ye("<</Type /Page"),ye("/Parent "+X.rootDictionaryObjId+" 0 R"),ye("/Resources "+X.resourceDictionaryObjId+" 0 R"),ye("/MediaBox ["+parseFloat(N(X.mediaBox.bottomLeftX))+" "+parseFloat(N(X.mediaBox.bottomLeftY))+" "+N(X.mediaBox.topRightX)+" "+N(X.mediaBox.topRightY)+"]"),X.cropBox!==null&&ye("/CropBox ["+N(X.cropBox.bottomLeftX)+" "+N(X.cropBox.bottomLeftY)+" "+N(X.cropBox.topRightX)+" "+N(X.cropBox.topRightY)+"]"),X.bleedBox!==null&&ye("/BleedBox ["+N(X.bleedBox.bottomLeftX)+" "+N(X.bleedBox.bottomLeftY)+" "+N(X.bleedBox.topRightX)+" "+N(X.bleedBox.topRightY)+"]"),X.trimBox!==null&&ye("/TrimBox ["+N(X.trimBox.bottomLeftX)+" "+N(X.trimBox.bottomLeftY)+" "+N(X.trimBox.topRightX)+" "+N(X.trimBox.topRightY)+"]"),X.artBox!==null&&ye("/ArtBox ["+N(X.artBox.bottomLeftX)+" "+N(X.artBox.bottomLeftY)+" "+N(X.artBox.topRightX)+" "+N(X.artBox.topRightY)+"]"),typeof X.userUnit=="number"&&X.userUnit!==1&&ye("/UserUnit "+X.userUnit),nt.publish("putPage",{objId:je,pageContext:kt[fe],pageNumber:fe,page:Ae}),ye("/Contents "+Qe+" 0 R"),ye(">>"),ye("endobj");var dt=Ae.join(`
|
|
458
|
+
`);return g===v.ADVANCED&&(dt+=`
|
|
459
|
+
Q`),_r(Qe,!0),wi({data:dt,filters:Li(),objectId:Qe}),ye("endobj"),je},_i=f.__private__.putPages=function(){var X,fe,Ae=[];for(X=1;X<=Xt;X++)kt[X].objId=er(),kt[X].contentsObjId=er();for(X=1;X<=Xt;X++)Ae.push(Ni({number:X,data:de[X],objId:kt[X].objId,contentsObjId:kt[X].contentsObjId,mediaBox:kt[X].mediaBox,cropBox:kt[X].cropBox,bleedBox:kt[X].bleedBox,trimBox:kt[X].trimBox,artBox:kt[X].artBox,userUnit:kt[X].userUnit,rootDictionaryObjId:Ur,resourceDictionaryObjId:on}));_r(Ur,!0),ye("<</Type /Pages");var je="/Kids [";for(fe=0;fe<Xt;fe++)je+=Ae[fe]+" 0 R ";ye(je+"]"),ye("/Count "+Xt),ye(">>"),ye("endobj"),nt.publish("postPutPages")},ao=function(X){nt.publish("putFont",{font:X,out:ye,newObject:Vt,putStream:wi}),X.isAlreadyPutted!==!0&&(X.objectNumber=Vt(),ye("<<"),ye("/Type /Font"),ye("/BaseFont /"+uh(X.postScriptName)),ye("/Subtype /Type1"),typeof X.encoding=="string"&&ye("/Encoding /"+X.encoding),ye("/FirstChar 32"),ye("/LastChar 255"),ye(">>"),ye("endobj"))},_s=function(){for(var X in Gt)Gt.hasOwnProperty(X)&&(p===!1||p===!0&&y.hasOwnProperty(X))&&ao(Gt[X])},Go=function(X){X.objectNumber=Vt();var fe=[];fe.push({key:"Type",value:"/XObject"}),fe.push({key:"Subtype",value:"/Form"}),fe.push({key:"BBox",value:"["+[N(X.x),N(X.y),N(X.x+X.width),N(X.y+X.height)].join(" ")+"]"}),fe.push({key:"Matrix",value:"["+X.matrix.toString()+"]"});var Ae=X.pages[1].join(`
|
|
460
|
+
`);wi({data:Ae,additionalKeyValues:fe,objectId:X.objectNumber}),ye("endobj")},tu=function(){for(var X in it)it.hasOwnProperty(X)&&Go(it[X])},mc=function(X,fe){var Ae,je=[],Qe=1/(fe-1);for(Ae=0;Ae<1;Ae+=Qe)je.push(Ae);if(je.push(1),X[0].offset!=0){var dt={offset:0,color:X[0].color};X.unshift(dt)}if(X[X.length-1].offset!=1){var St={offset:1,color:X[X.length-1].color};X.push(St)}for(var Ft="",ir=0,gr=0;gr<je.length;gr++){for(Ae=je[gr];Ae>X[ir+1].offset;)ir++;var dr=X[ir].offset,Sr=(Ae-dr)/(X[ir+1].offset-dr),Cn=X[ir].color,Sn=X[ir+1].color;Ft+=Q(Math.round((1-Sr)*Cn[0]+Sr*Sn[0]).toString(16))+Q(Math.round((1-Sr)*Cn[1]+Sr*Sn[1]).toString(16))+Q(Math.round((1-Sr)*Cn[2]+Sr*Sn[2]).toString(16))}return Ft.trim()},Mn=function(X,fe){fe||(fe=21);var Ae=Vt(),je=mc(X.colors,fe),Qe=[];Qe.push({key:"FunctionType",value:"0"}),Qe.push({key:"Domain",value:"[0.0 1.0]"}),Qe.push({key:"Size",value:"["+fe+"]"}),Qe.push({key:"BitsPerSample",value:"8"}),Qe.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Qe.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),wi({data:je,additionalKeyValues:Qe,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Ae}),ye("endobj"),X.objectNumber=Vt(),ye("<< /ShadingType "+X.type),ye("/ColorSpace /DeviceRGB");var dt="/Coords ["+N(parseFloat(X.coords[0]))+" "+N(parseFloat(X.coords[1]))+" ";X.type===2?dt+=N(parseFloat(X.coords[2]))+" "+N(parseFloat(X.coords[3])):dt+=N(parseFloat(X.coords[2]))+" "+N(parseFloat(X.coords[3]))+" "+N(parseFloat(X.coords[4]))+" "+N(parseFloat(X.coords[5])),ye(dt+="]"),X.matrix&&ye("/Matrix ["+X.matrix.toString()+"]"),ye("/Function "+Ae+" 0 R"),ye("/Extend [true true]"),ye(">>"),ye("endobj")},Bu=function(X,fe){var Ae=er(),je=Vt();fe.push({resourcesOid:Ae,objectOid:je}),X.objectNumber=je;var Qe=[];Qe.push({key:"Type",value:"/Pattern"}),Qe.push({key:"PatternType",value:"1"}),Qe.push({key:"PaintType",value:"1"}),Qe.push({key:"TilingType",value:"1"}),Qe.push({key:"BBox",value:"["+X.boundingBox.map(N).join(" ")+"]"}),Qe.push({key:"XStep",value:N(X.xStep)}),Qe.push({key:"YStep",value:N(X.yStep)}),Qe.push({key:"Resources",value:Ae+" 0 R"}),X.matrix&&Qe.push({key:"Matrix",value:"["+X.matrix.toString()+"]"}),wi({data:X.stream,additionalKeyValues:Qe,objectId:X.objectNumber}),ye("endobj")},oo=function(X){var fe;for(fe in ft)ft.hasOwnProperty(fe)&&(ft[fe]instanceof Sf?Mn(ft[fe]):ft[fe]instanceof dh&&Bu(ft[fe],X))},dl=function(X){for(var fe in X.objectNumber=Vt(),ye("<<"),X)switch(fe){case"opacity":ye("/ca "+j(X[fe]));break;case"stroke-opacity":ye("/CA "+j(X[fe]))}ye(">>"),ye("endobj")},Vs=function(){var X;for(X in Ot)Ot.hasOwnProperty(X)&&dl(Ot[X])},qu=function(){for(var X in ye("/XObject <<"),it)it.hasOwnProperty(X)&&it[X].objectNumber>=0&&ye("/"+X+" "+it[X].objectNumber+" 0 R");nt.publish("putXobjectDict"),ye(">>")},ru=function(){gn.oid=Vt(),ye("<<"),ye("/Filter /Standard"),ye("/V "+gn.v),ye("/R "+gn.r),ye("/U <"+gn.toHexString(gn.U)+">"),ye("/O <"+gn.toHexString(gn.O)+">"),ye("/P "+gn.P),ye(">>"),ye("endobj")},so=function(){for(var X in ye("/Font <<"),Gt)Gt.hasOwnProperty(X)&&(p===!1||p===!0&&y.hasOwnProperty(X))&&ye("/"+X+" "+Gt[X].objectNumber+" 0 R");ye(">>")},di=function(){if(Object.keys(ft).length>0){for(var X in ye("/Shading <<"),ft)ft.hasOwnProperty(X)&&ft[X]instanceof Sf&&ft[X].objectNumber>=0&&ye("/"+X+" "+ft[X].objectNumber+" 0 R");nt.publish("putShadingPatternDict"),ye(">>")}},Xr=function(X){if(Object.keys(ft).length>0){for(var fe in ye("/Pattern <<"),ft)ft.hasOwnProperty(fe)&&ft[fe]instanceof f.TilingPattern&&ft[fe].objectNumber>=0&&ft[fe].objectNumber<X&&ye("/"+fe+" "+ft[fe].objectNumber+" 0 R");nt.publish("putTilingPatternDict"),ye(">>")}},Ar=function(){if(Object.keys(Ot).length>0){var X;for(X in ye("/ExtGState <<"),Ot)Ot.hasOwnProperty(X)&&Ot[X].objectNumber>=0&&ye("/"+X+" "+Ot[X].objectNumber+" 0 R");nt.publish("putGStateDict"),ye(">>")}},ln=function(X){_r(X.resourcesOid,!0),ye("<<"),ye("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),so(),di(),Xr(X.objectOid),Ar(),qu(),ye(">>"),ye("endobj")},pi=function(){var X=[];_s(),Vs(),tu(),oo(X),nt.publish("putResources"),X.forEach(ln),ln({resourcesOid:on,objectOid:Number.MAX_SAFE_INTEGER}),nt.publish("postPutResources")},Ti=function(){nt.publish("putAdditionalObjects");for(var X=0;X<ce.length;X++){var fe=ce[X];_r(fe.objId,!0),ye(fe.content),ye("endobj")}nt.publish("postPutAdditionalObjects")},Ma=function(X){Be[X.fontName]=Be[X.fontName]||{},Be[X.fontName][X.fontStyle]=X.id},Ia=function(X,fe,Ae,je,Qe){var dt={id:"F"+(Object.keys(Gt).length+1).toString(10),postScriptName:X,fontName:fe,fontStyle:Ae,encoding:je,isStandardFont:Qe||!1,metadata:{}};return nt.publish("addFont",{font:dt,instance:this}),Gt[dt.id]=dt,Ma(dt),dt.id},ii=function(X){for(var fe=0,Ae=me.length;fe<Ae;fe++){var je=Ia.call(this,X[fe][0],X[fe][1],X[fe][2],me[fe][3],!0);p===!1&&(y[je]=!0);var Qe=X[fe][0].split("-");Ma({id:je,fontName:Qe[0],fontStyle:Qe[1]||""})}nt.publish("addFonts",{fonts:Gt,dictionary:Be})},Ri=function(X){return X.foo=function(){try{return X.apply(this,arguments)}catch(je){var fe=je.stack||"";~fe.indexOf(" at ")&&(fe=fe.split(" at ")[1]);var Ae="Error in function "+fe.split(`
|
|
461
|
+
`)[0].split("<")[0]+": "+je.message;if(!pr.console)throw new Error(Ae);pr.console.error(Ae,je),pr.alert&&alert(Ae)}},X.foo.bar=X,X.foo},pl=function(X,fe){var Ae,je,Qe,dt,St,Ft,ir,gr,dr;if(Qe=(fe=fe||{}).sourceEncoding||"Unicode",St=fe.outputEncoding,(fe.autoencode||St)&&Gt[mt].metadata&&Gt[mt].metadata[Qe]&&Gt[mt].metadata[Qe].encoding&&(dt=Gt[mt].metadata[Qe].encoding,!St&&Gt[mt].encoding&&(St=Gt[mt].encoding),!St&&dt.codePages&&(St=dt.codePages[0]),typeof St=="string"&&(St=dt[St]),St)){for(ir=!1,Ft=[],Ae=0,je=X.length;Ae<je;Ae++)(gr=St[X.charCodeAt(Ae)])?Ft.push(String.fromCharCode(gr)):Ft.push(X[Ae]),Ft[Ae].charCodeAt(0)>>8&&(ir=!0);X=Ft.join("")}for(Ae=X.length;ir===void 0&&Ae!==0;)X.charCodeAt(Ae-1)>>8&&(ir=!0),Ae--;if(!ir)return X;for(Ft=fe.noBOM?[]:[254,255],Ae=0,je=X.length;Ae<je;Ae++){if((dr=(gr=X.charCodeAt(Ae))>>8)>>8)throw new Error("Character at position "+Ae+" of string '"+X+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Ft.push(dr),Ft.push(gr-(dr<<8))}return String.fromCharCode.apply(void 0,Ft)},fa=f.__private__.pdfEscape=f.pdfEscape=function(X,fe){return pl(X,fe).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Wo=f.__private__.beginPage=function(X){de[++Xt]=[],kt[Xt]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(X[0]),topRightY:Number(X[1])}},Gs(Xt),Se(de[D])},nu=function(X,fe){var Ae,je,Qe;switch(t=fe||t,typeof X=="string"&&(Ae=x(X.toLowerCase()),Array.isArray(Ae)&&(je=Ae[0],Qe=Ae[1])),Array.isArray(X)&&(je=X[0]*ct,Qe=X[1]*ct),isNaN(je)&&(je=a[0],Qe=a[1]),(je>14400||Qe>14400)&&(Gn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),je=Math.min(14400,je),Qe=Math.min(14400,Qe)),a=[je,Qe],t.substr(0,1)){case"l":Qe>je&&(a=[Qe,je]);break;case"p":je>Qe&&(a=[Qe,je])}Wo(a),Os(Da),ye(wn),lu!==0&&ye(lu+" J"),As!==0&&ye(As+" j"),nt.publish("addPage",{pageNumber:Xt})},ha=function(X){X>0&&X<=Xt&&(de.splice(X,1),kt.splice(X,1),Xt--,D>Xt&&(D=Xt),this.setPage(D))},Gs=function(X){X>0&&X<=Xt&&(D=X)},af=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return de.length-1},iu=function(X,fe,Ae){var je,Qe=void 0;return Ae=Ae||{},X=X!==void 0?X:Gt[mt].fontName,fe=fe!==void 0?fe:Gt[mt].fontStyle,je=X.toLowerCase(),Be[je]!==void 0&&Be[je][fe]!==void 0?Qe=Be[je][fe]:Be[X]!==void 0&&Be[X][fe]!==void 0?Qe=Be[X][fe]:Ae.disableWarning===!1&&Gn.warn("Unable to look up font label for font '"+X+"', '"+fe+"'. Refer to getFontList() for available fonts."),Qe||Ae.noFallback||(Qe=Be.times[fe])==null&&(Qe=Be.times.normal),Qe},Rr=f.__private__.putInfo=function(){var X=Vt(),fe=function(je){return je};for(var Ae in d!==null&&(fe=gn.encryptor(X,0)),ye("<<"),ye("/Producer ("+fa(fe("jsPDF "+hr.version))+")"),yt)yt.hasOwnProperty(Ae)&&yt[Ae]&&ye("/"+Ae.substr(0,1).toUpperCase()+Ae.substr(1)+" ("+fa(fe(yt[Ae]))+")");ye("/CreationDate ("+fa(fe(T))+")"),ye(">>"),ye("endobj")},Ss=f.__private__.putCatalog=function(X){var fe=(X=X||{}).rootDictionaryObjId||Ur;switch(Vt(),ye("<<"),ye("/Type /Catalog"),ye("/Pages "+fe+" 0 R"),Te||(Te="fullwidth"),Te){case"fullwidth":ye("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ye("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ye("/OpenAction [3 0 R /Fit]");break;case"original":ye("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Ae=""+Te;Ae.substr(Ae.length-1)==="%"&&(Te=parseInt(Te)/100),typeof Te=="number"&&ye("/OpenAction [3 0 R /XYZ null null "+j(Te)+"]")}switch(rt||(rt="continuous"),rt){case"continuous":ye("/PageLayout /OneColumn");break;case"single":ye("/PageLayout /SinglePage");break;case"two":case"twoleft":ye("/PageLayout /TwoColumnLeft");break;case"tworight":ye("/PageLayout /TwoColumnRight")}Ie&&ye("/PageMode /"+Ie),nt.publish("putCatalog"),ye(">>"),ye("endobj")},Ws=f.__private__.putTrailer=function(){ye("trailer"),ye("<<"),ye("/Size "+(J+1)),ye("/Root "+J+" 0 R"),ye("/Info "+(J-1)+" 0 R"),d!==null&&ye("/Encrypt "+gn.oid+" 0 R"),ye("/ID [ <"+V+"> <"+V+"> ]"),ye(">>")},$s=f.__private__.putHeader=function(){ye("%PDF-"+_),ye("%ºß¬à")},yc=f.__private__.putXRef=function(){var X="0000000000";ye("xref"),ye("0 "+(J+1)),ye("0000000000 65535 f ");for(var fe=1;fe<=J;fe++)typeof Z[fe]=="function"?ye((X+Z[fe]()).slice(-10)+" 00000 n "):Z[fe]!==void 0?ye((X+Z[fe]).slice(-10)+" 00000 n "):ye("0000000000 00000 n ")},$o=f.__private__.buildDocument=function(){ke(),Se(ae),nt.publish("buildDocument"),$s(),_i(),Ti(),pi(),d!==null&&ru(),Rr(),Ss();var X=se;return yc(),Ws(),ye("startxref"),ye(""+X),ye("%%EOF"),Se(de[D]),ae.join(`
|
|
462
|
+
`)},xs=f.__private__.getBlob=function(X){return new Blob([we(X)],{type:"application/pdf"})},Es=f.output=f.__private__.output=Ri(function(X,fe){switch(typeof(fe=fe||{})=="string"?fe={filename:fe}:fe.filename=fe.filename||"generated.pdf",X){case void 0:return $o();case"save":f.save(fe.filename);break;case"arraybuffer":return we($o());case"blob":return xs($o());case"bloburi":case"bloburl":if(pr.URL!==void 0&&typeof pr.URL.createObjectURL=="function")return pr.URL&&pr.URL.createObjectURL(xs($o()))||void 0;Gn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Ae="",je=$o();try{Ae=R2(je)}catch{Ae=R2(unescape(encodeURIComponent(je)))}return"data:application/pdf;filename="+fe.filename+";base64,"+Ae;case"pdfobjectnewwindow":if(Object.prototype.toString.call(pr)==="[object Window]"){var Qe="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",dt=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';fe.pdfObjectUrl&&(Qe=fe.pdfObjectUrl,dt="");var St='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Qe+'"'+dt+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(fe)+");<\/script></body></html>",Ft=pr.open();return Ft!==null&&Ft.document.write(St),Ft}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(pr)==="[object Window]"){var ir='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(fe.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+fe.filename+'" width="500px" height="400px" /></body></html>',gr=pr.open();if(gr!==null){gr.document.write(ir);var dr=this;gr.document.documentElement.querySelector("#pdfViewer").onload=function(){gr.document.title=fe.filename,gr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(dr.output("bloburl"))}}return gr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(pr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Sr='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",fe)+'"></iframe></body></html>',Cn=pr.open();if(Cn!==null&&(Cn.document.write(Sr),Cn.document.title=fe.filename),Cn||typeof safari>"u")return Cn;break;case"datauri":case"dataurl":return pr.document.location.href=this.output("datauristring",fe);default:return null}}),Ps=function(X){return Array.isArray(We)===!0&&We.indexOf(X)>-1};switch(n){case"pt":ct=1;break;case"mm":ct=72/25.4;break;case"cm":ct=72/2.54;break;case"in":ct=72;break;case"px":ct=Ps("px_scaling")==1?.75:96/72;break;case"pc":case"em":ct=12;break;case"ex":ct=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);ct=n}var gn=null;U(),$();var Yo=function(X){return d!==null?gn.encryptor(X,0):function(fe){return fe}},ja=f.__private__.getPageInfo=f.getPageInfo=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:kt[X].objId,pageNumber:X,pageContext:kt[X]}},It=f.__private__.getPageInfoByObjId=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var fe in kt)if(kt[fe].objId===X)break;return ja(fe)},Ys=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:kt[D].objId,pageNumber:D,pageContext:kt[D]}};f.addPage=function(){return nu.apply(this,arguments),this},f.setPage=function(){return Gs.apply(this,arguments),Se.call(this,de[D]),this},f.insertPage=function(X){return this.addPage(),this.movePage(D,X),this},f.movePage=function(X,fe){var Ae,je;if(X>fe){Ae=de[X],je=kt[X];for(var Qe=X;Qe>fe;Qe--)de[Qe]=de[Qe-1],kt[Qe]=kt[Qe-1];de[fe]=Ae,kt[fe]=je,this.setPage(fe)}else if(X<fe){Ae=de[X],je=kt[X];for(var dt=X;dt<fe;dt++)de[dt]=de[dt+1],kt[dt]=kt[dt+1];de[fe]=Ae,kt[fe]=je,this.setPage(fe)}return this},f.deletePage=function(){return ha.apply(this,arguments),this},f.__private__.text=f.text=function(X,fe,Ae,je,Qe){var dt,St,Ft,ir,gr,dr,Sr,Cn,Sn,jn=(je=je||{}).scope||this;if(typeof X=="number"&&typeof fe=="number"&&(typeof Ae=="string"||Array.isArray(Ae))){var Qn=Ae;Ae=fe,fe=X,X=Qn}if(arguments[3]instanceof ze?(R("The transform parameter of text() with a Matrix value"),Sn=Qe):(Ft=arguments[4],ir=arguments[5],On(Sr=arguments[3])==="object"&&Sr!==null||(typeof Ft=="string"&&(ir=Ft,Ft=null),typeof Sr=="string"&&(ir=Sr,Sr=null),typeof Sr=="number"&&(Ft=Sr,Sr=null),je={flags:Sr,angle:Ft,align:ir})),isNaN(fe)||isNaN(Ae)||X==null)throw new Error("Invalid arguments passed to jsPDF.text");if(X.length===0)return jn;var si="",za=!1,xa=typeof je.lineHeightFactor=="number"?je.lineHeightFactor:Mi,Ea=jn.internal.scaleFactor;function Zo(tn){return tn=tn.split(" ").join(Array(je.TabLen||9).join(" ")),fa(tn,Sr)}function Qo(tn){for(var $r,Fn=tn.concat(),Jn=[],Io=Fn.length;Io--;)typeof($r=Fn.shift())=="string"?Jn.push($r):Array.isArray(tn)&&($r.length===1||$r[1]===void 0&&$r[2]===void 0)?Jn.push($r[0]):Jn.push([$r[0],$r[1],$r[2]]);return Jn}function Di(tn,$r){var Fn;if(typeof tn=="string")Fn=$r(tn)[0];else if(Array.isArray(tn)){for(var Jn,Io,_l=tn.concat(),nl=[],cu=_l.length;cu--;)typeof(Jn=_l.shift())=="string"?nl.push($r(Jn)[0]):Array.isArray(Jn)&&typeof Jn[0]=="string"&&(Io=$r(Jn[0],Jn[1],Jn[2]),nl.push([Io[0],Io[1],Io[2]]));Fn=nl}return Fn}var Ua=!1,Js=!0;if(typeof X=="string")Ua=!0;else if(Array.isArray(X)){var bl=X.concat();St=[];for(var ra,en=bl.length;en--;)(typeof(ra=bl.shift())!="string"||Array.isArray(ra)&&typeof ra[0]!="string")&&(Js=!1);Ua=Js}if(Ua===!1)throw new Error('Type of text must be string or Array. "'+X+'" is not recognized.');typeof X=="string"&&(X=X.match(/[\r?\n]/)?X.split(/\r\n|\r|\n/g):[X]);var el=Ee/jn.internal.scaleFactor,wl=el*(xa-1);switch(je.baseline){case"bottom":Ae-=wl;break;case"top":Ae+=el-wl;break;case"hanging":Ae+=el-2*wl;break;case"middle":Ae+=el/2-wl}if((dr=je.maxWidth||0)>0&&(typeof X=="string"?X=jn.splitTextToSize(X,dr):Object.prototype.toString.call(X)==="[object Array]"&&(X=X.reduce(function(tn,$r){return tn.concat(jn.splitTextToSize($r,dr))},[]))),dt={text:X,x:fe,y:Ae,options:je,mutex:{pdfEscape:fa,activeFontKey:mt,fonts:Gt,activeFontSize:Ee}},nt.publish("preProcessText",dt),X=dt.text,Ft=(je=dt.options).angle,!(Sn instanceof ze)&&Ft&&typeof Ft=="number"){Ft*=Math.PI/180,je.rotationDirection===0&&(Ft=-Ft),g===v.ADVANCED&&(Ft=-Ft);var Pa=Math.cos(Ft),Ha=Math.sin(Ft);Sn=new ze(Pa,Ha,-Ha,Pa,0,0)}else Ft&&Ft instanceof ze&&(Sn=Ft);g!==v.ADVANCED||Sn||(Sn=Ht),(gr=je.charSpace||ta)!==void 0&&(si+=N(C(gr))+` Tc
|
|
463
|
+
`,this.setCharSpace(this.getCharSpace()||0)),(Cn=je.horizontalScale)!==void 0&&(si+=N(100*Cn)+` Tz
|
|
464
|
+
`),je.lang;var Si=-1,tl=je.renderingMode!==void 0?je.renderingMode:je.stroke,co=jn.internal.getCurrentPageInfo().pageContext;switch(tl){case 0:case!1:case"fill":Si=0;break;case 1:case!0:case"stroke":Si=1;break;case 2:case"fillThenStroke":Si=2;break;case 3:case"invisible":Si=3;break;case 4:case"fillAndAddForClipping":Si=4;break;case 5:case"strokeAndAddPathForClipping":Si=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Si=6;break;case 7:case"addToPathForClipping":Si=7}var Hu=co.usedRenderingMode!==void 0?co.usedRenderingMode:-1;Si!==-1?si+=Si+` Tr
|
|
465
|
+
`:Hu!==-1&&(si+=`0 Tr
|
|
466
|
+
`),Si!==-1&&(co.usedRenderingMode=Si),ir=je.align||"left";var vi,Bi=Ee*xa,Cs=jn.internal.pageSize.getWidth(),Co=Gt[mt];gr=je.charSpace||ta,dr=je.maxWidth||0,Sr=Object.assign({autoencode:!0,noBOM:!0},je.flags);var mi=[],Jo=function(tn){return jn.getStringUnitWidth(tn,{font:Co,charSpace:gr,fontSize:Ee,doKerning:!1})*Ee/Ea};if(Object.prototype.toString.call(X)==="[object Array]"){var li;St=Qo(X),ir!=="left"&&(vi=St.map(Jo));var qi,es=0;if(ir==="right"){fe-=vi[0],X=[],en=St.length;for(var Wr=0;Wr<en;Wr++)Wr===0?(qi=Ii(fe),li=ji(Ae)):(qi=C(es-vi[Wr]),li=-Bi),X.push([St[Wr],qi,li]),es=vi[Wr]}else if(ir==="center"){fe-=vi[0]/2,X=[],en=St.length;for(var fo=0;fo<en;fo++)fo===0?(qi=Ii(fe),li=ji(Ae)):(qi=C((es-vi[fo])/2),li=-Bi),X.push([St[fo],qi,li]),es=vi[fo]}else if(ir==="left"){X=[],en=St.length;for(var rl=0;rl<en;rl++)X.push(St[rl])}else if(ir==="justify"&&Co.encoding==="Identity-H"){X=[],en=St.length,dr=dr!==0?dr:Cs;for(var ko=0,Mr=0;Mr<en;Mr++)if(li=Mr===0?ji(Ae):-Bi,qi=Mr===0?Ii(fe):ko,Mr<en-1){var Lo=C((dr-vi[Mr])/(St[Mr].split(" ").length-1)),Yn=St[Mr].split(" ");X.push([Yn[0]+" ",qi,li]),ko=0;for(var Lr=1;Lr<Yn.length;Lr++){var xn=(Jo(Yn[Lr-1]+" "+Yn[Lr])-Jo(Yn[Lr]))*Ea+Lo;Lr==Yn.length-1?X.push([Yn[Lr],xn,0]):X.push([Yn[Lr]+" ",xn,0]),ko-=xn}}else X.push([St[Mr],qi,li]);X.push(["",ko,0])}else{if(ir!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(X=[],en=St.length,dr=dr!==0?dr:Cs,Mr=0;Mr<en;Mr++)li=Mr===0?ji(Ae):-Bi,qi=Mr===0?Ii(fe):0,Mr<en-1?mi.push(N(C((dr-vi[Mr])/(St[Mr].split(" ").length-1)))):mi.push(0),X.push([St[Mr],qi,li])}}var Xn=typeof je.R2L=="boolean"?je.R2L:Re;Xn===!0&&(X=Di(X,function(tn,$r,Fn){return[tn.split("").reverse().join(""),$r,Fn]})),dt={text:X,x:fe,y:Ae,options:je,mutex:{pdfEscape:fa,activeFontKey:mt,fonts:Gt,activeFontSize:Ee}},nt.publish("postProcessText",dt),X=dt.text,za=dt.mutex.isHex||!1;var ts=Gt[mt].encoding;ts!=="WinAnsiEncoding"&&ts!=="StandardEncoding"||(X=Di(X,function(tn,$r,Fn){return[Zo(tn),$r,Fn]})),St=Qo(X),X=[];for(var No,To,Va,kn=0,ho=1,Ro=Array.isArray(St[0])?ho:kn,Mo="",zi=function(tn,$r,Fn){var Jn="";return Fn instanceof ze?(Fn=typeof je.angle=="number"?_t(Fn,new ze(1,0,0,1,tn,$r)):_t(new ze(1,0,0,1,tn,$r),Fn),g===v.ADVANCED&&(Fn=_t(new ze(1,0,0,-1,0,0),Fn)),Jn=Fn.join(" ")+` Tm
|
|
467
|
+
`):Jn=N(tn)+" "+N($r)+` Td
|
|
468
|
+
`,Jn},un=0;un<St.length;un++){switch(Mo="",Ro){case ho:Va=(za?"<":"(")+St[un][0]+(za?">":")"),No=parseFloat(St[un][1]),To=parseFloat(St[un][2]);break;case kn:Va=(za?"<":"(")+St[un]+(za?">":")"),No=Ii(fe),To=ji(Ae)}mi!==void 0&&mi[un]!==void 0&&(Mo=mi[un]+` Tw
|
|
469
|
+
`),un===0?X.push(Mo+zi(No,To,Sn)+Va):Ro===kn?X.push(Mo+Va):Ro===ho&&X.push(Mo+zi(No,To,Sn)+Va)}X=Ro===kn?X.join(` Tj
|
|
470
|
+
T* `):X.join(` Tj
|
|
471
|
+
`),X+=` Tj
|
|
472
|
+
`;var xi=`BT
|
|
473
|
+
/`;return xi+=mt+" "+Ee+` Tf
|
|
474
|
+
`,xi+=N(Ee*xa)+` TL
|
|
475
|
+
`,xi+=_n+`
|
|
476
|
+
`,xi+=si,xi+=X,ye(xi+="ET"),y[mt]=!0,jn};var lo=f.__private__.clip=f.clip=function(X){return ye(X==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return lo("evenodd")},f.__private__.discardPath=f.discardPath=function(){return ye("n"),this};var Oo=f.__private__.isValidStyle=function(X){var fe=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(X)!==-1&&(fe=!0),fe};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(X){return Oo(X)&&(u=X),this};var zu=f.__private__.getStyle=f.getStyle=function(X){var fe=u;switch(X){case"D":case"S":fe="S";break;case"F":fe="f";break;case"FD":case"DF":fe="B";break;case"f":case"f*":case"B":case"B*":fe=X}return fe},Xs=f.close=function(){return ye("h"),this};f.stroke=function(){return ye("S"),this},f.fill=function(X){return In("f",X),this},f.fillEvenOdd=function(X){return In("f*",X),this},f.fillStroke=function(X){return In("B",X),this},f.fillStrokeEvenOdd=function(X){return In("B*",X),this};var In=function(X,fe){On(fe)==="object"?ou(fe,X):ye(X)},Ks=function(X){X===null||g===v.ADVANCED&&X===void 0||(X=zu(X),ye(X))};function au(X,fe,Ae,je,Qe){var dt=new dh(fe||this.boundingBox,Ae||this.xStep,je||this.yStep,this.gState,Qe||this.matrix);dt.stream=this.stream;var St=X+"$$"+this.cloneIndex+++"$$";return Dt(St,dt),dt}var ou=function(X,fe){var Ae=Ct[X.key],je=ft[Ae];if(je instanceof Sf)ye("q"),ye(of(fe)),je.gState&&f.setGState(je.gState),ye(X.matrix.toString()+" cm"),ye("/"+Ae+" sh"),ye("Q");else if(je instanceof dh){var Qe=new ze(1,0,0,-1,0,Ko());X.matrix&&(Qe=Qe.multiply(X.matrix||Ht),Ae=au.call(je,X.key,X.boundingBox,X.xStep,X.yStep,Qe).id),ye("q"),ye("/Pattern cs"),ye("/"+Ae+" scn"),je.gState&&f.setGState(je.gState),ye(fe),ye("Q")}},of=function(X){switch(X){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},uo=f.moveTo=function(X,fe){return ye(N(C(X))+" "+N(k(fe))+" m"),this},ai=f.lineTo=function(X,fe){return ye(N(C(X))+" "+N(k(fe))+" l"),this},Fa=f.curveTo=function(X,fe,Ae,je,Qe,dt){return ye([N(C(X)),N(k(fe)),N(C(Ae)),N(k(je)),N(C(Qe)),N(k(dt)),"c"].join(" ")),this};f.__private__.line=f.line=function(X,fe,Ae,je,Qe){if(isNaN(X)||isNaN(fe)||isNaN(Ae)||isNaN(je)||!Oo(Qe))throw new Error("Invalid arguments passed to jsPDF.line");return g===v.COMPAT?this.lines([[Ae-X,je-fe]],X,fe,[1,1],Qe||"S"):this.lines([[Ae-X,je-fe]],X,fe,[1,1]).stroke()},f.__private__.lines=f.lines=function(X,fe,Ae,je,Qe,dt){var St,Ft,ir,gr,dr,Sr,Cn,Sn,jn,Qn,si,za;if(typeof X=="number"&&(za=Ae,Ae=fe,fe=X,X=za),je=je||[1,1],dt=dt||!1,isNaN(fe)||isNaN(Ae)||!Array.isArray(X)||!Array.isArray(je)||!Oo(Qe)||typeof dt!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(uo(fe,Ae),St=je[0],Ft=je[1],gr=X.length,Qn=fe,si=Ae,ir=0;ir<gr;ir++)(dr=X[ir]).length===2?(Qn=dr[0]*St+Qn,si=dr[1]*Ft+si,ai(Qn,si)):(Sr=dr[0]*St+Qn,Cn=dr[1]*Ft+si,Sn=dr[2]*St+Qn,jn=dr[3]*Ft+si,Qn=dr[4]*St+Qn,si=dr[5]*Ft+si,Fa(Sr,Cn,Sn,jn,Qn,si));return dt&&Xs(),Ks(Qe),this},f.path=function(X){for(var fe=0;fe<X.length;fe++){var Ae=X[fe],je=Ae.c;switch(Ae.op){case"m":uo(je[0],je[1]);break;case"l":ai(je[0],je[1]);break;case"c":Fa.apply(this,je);break;case"h":Xs()}}return this},f.__private__.rect=f.rect=function(X,fe,Ae,je,Qe){if(isNaN(X)||isNaN(fe)||isNaN(Ae)||isNaN(je)||!Oo(Qe))throw new Error("Invalid arguments passed to jsPDF.rect");return g===v.COMPAT&&(je=-je),ye([N(C(X)),N(k(fe)),N(C(Ae)),N(C(je)),"re"].join(" ")),Ks(Qe),this},f.__private__.triangle=f.triangle=function(X,fe,Ae,je,Qe,dt,St){if(isNaN(X)||isNaN(fe)||isNaN(Ae)||isNaN(je)||isNaN(Qe)||isNaN(dt)||!Oo(St))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Ae-X,je-fe],[Qe-Ae,dt-je],[X-Qe,fe-dt]],X,fe,[1,1],St,!0),this},f.__private__.roundedRect=f.roundedRect=function(X,fe,Ae,je,Qe,dt,St){if(isNaN(X)||isNaN(fe)||isNaN(Ae)||isNaN(je)||isNaN(Qe)||isNaN(dt)||!Oo(St))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Ft=4/3*(Math.SQRT2-1);return Qe=Math.min(Qe,.5*Ae),dt=Math.min(dt,.5*je),this.lines([[Ae-2*Qe,0],[Qe*Ft,0,Qe,dt-dt*Ft,Qe,dt],[0,je-2*dt],[0,dt*Ft,-Qe*Ft,dt,-Qe,dt],[2*Qe-Ae,0],[-Qe*Ft,0,-Qe,-dt*Ft,-Qe,-dt],[0,2*dt-je],[0,-dt*Ft,Qe*Ft,-dt,Qe,-dt]],X+Qe,fe,[1,1],St,!0),this},f.__private__.ellipse=f.ellipse=function(X,fe,Ae,je,Qe){if(isNaN(X)||isNaN(fe)||isNaN(Ae)||isNaN(je)||!Oo(Qe))throw new Error("Invalid arguments passed to jsPDF.ellipse");var dt=4/3*(Math.SQRT2-1)*Ae,St=4/3*(Math.SQRT2-1)*je;return uo(X+Ae,fe),Fa(X+Ae,fe-St,X+dt,fe-je,X,fe-je),Fa(X-dt,fe-je,X-Ae,fe-St,X-Ae,fe),Fa(X-Ae,fe+St,X-dt,fe+je,X,fe+je),Fa(X+dt,fe+je,X+Ae,fe+St,X+Ae,fe),Ks(Qe),this},f.__private__.circle=f.circle=function(X,fe,Ae,je){if(isNaN(X)||isNaN(fe)||isNaN(Ae)||!Oo(je))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(X,fe,Ae,Ae,je)},f.setFont=function(X,fe,Ae){return Ae&&(fe=M(fe,Ae)),mt=iu(X,fe,{disableWarning:!1}),this};var su=f.__private__.getFont=f.getFont=function(){return Gt[iu.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var X,fe,Ae={};for(X in Be)if(Be.hasOwnProperty(X))for(fe in Ae[X]=[],Be[X])Be[X].hasOwnProperty(fe)&&Ae[X].push(fe);return Ae},f.addFont=function(X,fe,Ae,je,Qe){var dt=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&dt.indexOf(arguments[3])!==-1?Qe=arguments[3]:arguments[3]&&dt.indexOf(arguments[3])==-1&&(Ae=M(Ae,je)),Qe=Qe||"Identity-H",Ia.call(this,X,fe,Ae,Qe)};var Mi,Da=e.lineWidth||.200025,Ao=f.__private__.getLineWidth=f.getLineWidth=function(){return Da},Os=f.__private__.setLineWidth=f.setLineWidth=function(X){return Da=X,ye(N(C(X))+" w"),this};f.__private__.setLineDash=hr.API.setLineDash=hr.API.setLineDashPattern=function(X,fe){if(X=X||[],fe=fe||0,isNaN(fe)||!Array.isArray(X))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return X=X.map(function(Ae){return N(C(Ae))}).join(" "),fe=N(C(fe)),ye("["+X+"] "+fe+" d"),this};var gl=f.__private__.getLineHeight=f.getLineHeight=function(){return Ee*Mi};f.__private__.getLineHeight=f.getLineHeight=function(){return Ee*Mi};var Uu=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function(X){return typeof(X=X||1.15)=="number"&&(Mi=X),this},oi=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return Mi};Uu(e.lineHeight);var Ii=f.__private__.getHorizontalCoordinate=function(X){return C(X)},ji=f.__private__.getVerticalCoordinate=function(X){return g===v.ADVANCED?X:kt[D].mediaBox.topRightY-kt[D].mediaBox.bottomLeftY-C(X)},vl=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function(X){return N(Ii(X))},Sa=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function(X){return N(ji(X))},wn=e.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return Wn(wn)},f.__private__.setStrokeColor=f.setDrawColor=function(X,fe,Ae,je){return wn=sn({ch1:X,ch2:fe,ch3:Ae,ch4:je,pdfColorType:"draw",precision:2}),ye(wn),this};var Fi=e.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return Wn(Fi)},f.__private__.setFillColor=f.setFillColor=function(X,fe,Ae,je){return Fi=sn({ch1:X,ch2:fe,ch3:Ae,ch4:je,pdfColorType:"fill",precision:2}),ye(Fi),this};var _n=e.textColor||"0 g",ea=f.__private__.getTextColor=f.getTextColor=function(){return Wn(_n)};f.__private__.setTextColor=f.setTextColor=function(X,fe,Ae,je){return _n=sn({ch1:X,ch2:fe,ch3:Ae,ch4:je,pdfColorType:"text",precision:3}),this};var ta=e.charSpace,Ba=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(ta||0)};f.__private__.setCharSpace=f.setCharSpace=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return ta=X,this};var lu=0;f.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},f.__private__.setLineCap=f.setLineCap=function(X){var fe=f.CapJoinStyles[X];if(fe===void 0)throw new Error("Line cap style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return lu=fe,ye(fe+" J"),this};var As=0;f.__private__.setLineJoin=f.setLineJoin=function(X){var fe=f.CapJoinStyles[X];if(fe===void 0)throw new Error("Line join style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return As=fe,ye(fe+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function(X){if(X=X||0,isNaN(X))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ye(N(C(X))+" M"),this},f.GState=B1,f.setGState=function(X){(X=typeof X=="string"?Ot[Nt[X]]:Zs(null,X)).equals(Jt)||(ye("/"+X.id+" gs"),Jt=X)};var Zs=function(X,fe){if(!X||!Nt[X]){var Ae=!1;for(var je in Ot)if(Ot.hasOwnProperty(je)&&Ot[je].equals(fe)){Ae=!0;break}if(Ae)fe=Ot[je];else{var Qe="GS"+(Object.keys(Ot).length+1).toString(10);Ot[Qe]=fe,fe.id=Qe}return X&&(Nt[X]=fe.id),nt.publish("addGState",fe),fe}};f.addGState=function(X,fe){return Zs(X,fe),this},f.saveGraphicsState=function(){return ye("q"),Ce.push({key:mt,size:Ee,color:_n}),this},f.restoreGraphicsState=function(){ye("Q");var X=Ce.pop();return mt=X.key,Ee=X.size,_n=X.color,Jt=null,this},f.setCurrentTransformationMatrix=function(X){return ye(X.toString()+" cm"),this},f.comment=function(X){return ye("#"+X),this};var $n=function(X,fe){var Ae=X||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Ae},set:function(dt){isNaN(dt)||(Ae=parseFloat(dt))}});var je=fe||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return je},set:function(dt){isNaN(dt)||(je=parseFloat(dt))}});var Qe="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Qe},set:function(dt){Qe=dt.toString()}}),this},gi=function(X,fe,Ae,je){$n.call(this,X,fe),this.type="rect";var Qe=Ae||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Qe},set:function(St){isNaN(St)||(Qe=parseFloat(St))}});var dt=je||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return dt},set:function(St){isNaN(St)||(dt=parseFloat(St))}}),this},Jr=function(){this.page=Xt,this.currentPage=D,this.pages=de.slice(0),this.pagesContext=kt.slice(0),this.x=Bt,this.y=Pt,this.matrix=Yt,this.width=Xo(D),this.height=Ko(D),this.outputDestination=Le,this.id="",this.objectNumber=-1};Jr.prototype.restore=function(){Xt=this.page,D=this.currentPage,kt=this.pagesContext,de=this.pages,Bt=this.x,Pt=this.y,Yt=this.matrix,yl(D,this.width),uu(D,this.height),Le=this.outputDestination};var Qs=function(X,fe,Ae,je,Qe){wt.push(new Jr),Xt=D=0,de=[],Bt=X,Pt=fe,Yt=Qe,Wo([Ae,je])},qa=function(X){if(He[X])wt.pop().restore();else{var fe=new Jr,Ae="Xo"+(Object.keys(it).length+1).toString(10);fe.id=Ae,He[X]=Ae,it[Ae]=fe,nt.publish("addFormObject",fe),wt.pop().restore()}};for(var ml in f.beginFormObject=function(X,fe,Ae,je,Qe){return Qs(X,fe,Ae,je,Qe),this},f.endFormObject=function(X){return qa(X),this},f.doFormObject=function(X,fe){var Ae=it[He[X]];return ye("q"),ye(fe.toString()+" cm"),ye("/"+Ae.id+" Do"),ye("Q"),this},f.getFormObject=function(X){var fe=it[He[X]];return{x:fe.x,y:fe.y,width:fe.width,height:fe.height,matrix:fe.matrix}},f.save=function(X,fe){return X=X||"generated.pdf",(fe=fe||{}).returnPromise=fe.returnPromise||!1,fe.returnPromise===!1?(_f(xs($o()),X),typeof _f.unload=="function"&&pr.setTimeout&&setTimeout(_f.unload,911),this):new Promise(function(Ae,je){try{var Qe=_f(xs($o()),X);typeof _f.unload=="function"&&pr.setTimeout&&setTimeout(_f.unload,911),Ae(Qe)}catch(dt){je(dt.message)}})},hr.API)hr.API.hasOwnProperty(ml)&&(ml==="events"&&hr.API.events.length?function(X,fe){var Ae,je,Qe;for(Qe=fe.length-1;Qe!==-1;Qe--)Ae=fe[Qe][0],je=fe[Qe][1],X.subscribe.apply(X,[Ae].concat(typeof je=="function"?[je]:je))}(nt,hr.API.events):f[ml]=hr.API[ml]);var Xo=f.getPageWidth=function(X){return(kt[X=X||D].mediaBox.topRightX-kt[X].mediaBox.bottomLeftX)/ct},yl=f.setPageWidth=function(X,fe){kt[X].mediaBox.topRightX=fe*ct+kt[X].mediaBox.bottomLeftX},Ko=f.getPageHeight=function(X){return(kt[X=X||D].mediaBox.topRightY-kt[X].mediaBox.bottomLeftY)/ct},uu=f.setPageHeight=function(X,fe){kt[X].mediaBox.topRightY=fe*ct+kt[X].mediaBox.bottomLeftY};return f.internal={pdfEscape:fa,getStyle:zu,getFont:su,getFontSize:he,getCharSpace:Ba,getTextColor:ea,getLineHeight:gl,getLineHeightFactor:oi,getLineWidth:Ao,write:Je,getHorizontalCoordinate:Ii,getVerticalCoordinate:ji,getCoordinateString:vl,getVerticalCoordinateString:Sa,collections:{},newObject:Vt,newAdditionalObject:kr,newObjectDeferred:er,newObjectDeferredBegin:_r,getFilters:Li,putStream:wi,events:nt,scaleFactor:ct,pageSize:{getWidth:function(){return Xo(D)},setWidth:function(X){yl(D,X)},getHeight:function(){return Ko(D)},setHeight:function(X){uu(D,X)}},encryptionOptions:d,encryption:gn,getEncryptor:Yo,output:Es,getNumberOfPages:af,pages:de,out:ye,f2:j,f3:O,getPageInfo:ja,getPageInfoByObjId:It,getCurrentPageInfo:Ys,getPDFVersion:S,Point:$n,Rectangle:gi,Matrix:ze,hasHotfix:Ps},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return Xo(D)},set:function(X){yl(D,X)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return Ko(D)},set:function(X){uu(D,X)},enumerable:!0,configurable:!0}),ii.call(f,me),mt="F1",nu(a,t),nt.publish("initialized"),f}lh.prototype.lsbFirstWord=function(e){return String.fromCharCode(e>>0&255,e>>8&255,e>>16&255,e>>24&255)},lh.prototype.toHexString=function(e){return e.split("").map(function(r){return("0"+(255&r.charCodeAt(0)).toString(16)).slice(-2)}).join("")},lh.prototype.hexToBytes=function(e){for(var r=[],t=0;t<e.length;t+=2)r.push(String.fromCharCode(parseInt(e.substr(t,2),16)));return r.join("")},lh.prototype.processOwnerPassword=function(e,r){return I2(M2(r).substr(0,5),e)},lh.prototype.encryptor=function(e,r){var t=M2(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&r,r>>8&255)).substr(0,10);return function(n){return I2(t,n)}},B1.prototype.equals=function(e){var r,t="id,objectNumber,equals";if(!e||On(e)!==On(this))return!1;var n=0;for(r in this)if(!(t.indexOf(r)>=0)){if(this.hasOwnProperty(r)&&!e.hasOwnProperty(r)||this[r]!==e[r])return!1;n++}for(r in e)e.hasOwnProperty(r)&&t.indexOf(r)<0&&n--;return n===0},hr.API={events:[]},hr.version="3.0.1";var Ci=hr.API,Dm=1,Df=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ih=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Er=function(e){return e.toFixed(2)},zc=function(e){return e.toFixed(5)};Ci.__acroform__={};var ws=function(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e},tw=function(e){return e*Dm},Au=function(e){var r=new O_,t=rr.internal.getHeight(e)||0,n=rr.internal.getWidth(e)||0;return r.BBox=[0,0,Number(Er(n)),Number(Er(t))],r},Uk=Ci.__acroform__.setBit=function(e,r){if(e=e||0,r=r||0,isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|=1<<r},Hk=Ci.__acroform__.clearBit=function(e,r){if(e=e||0,r=r||0,isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&=~(1<<r)},Vk=Ci.__acroform__.getBit=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return(e&1<<r)==0?0:1},Ki=Ci.__acroform__.getBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Vk(e,r-1)},Zi=Ci.__acroform__.setBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Uk(e,r-1)},Qi=Ci.__acroform__.clearBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Hk(e,r-1)},Gk=Ci.__acroform__.calculateCoordinates=function(e,r){var t=r.internal.getHorizontalCoordinate,n=r.internal.getVerticalCoordinate,a=e[0],i=e[1],o=e[2],s=e[3],c={};return c.lowerLeft_X=t(a)||0,c.lowerLeft_Y=n(i+s)||0,c.upperRight_X=t(a+o)||0,c.upperRight_Y=n(i)||0,[Number(Er(c.lowerLeft_X)),Number(Er(c.lowerLeft_Y)),Number(Er(c.upperRight_X)),Number(Er(c.upperRight_Y))]},Wk=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var r=[],t=e._V||e.DV,n=j2(e,t),a=e.scope.internal.getFont(e.fontName,e.fontStyle).id;r.push("/Tx BMC"),r.push("q"),r.push("BT"),r.push(e.scope.__private__.encodeColorString(e.color)),r.push("/"+a+" "+Er(n.fontSize)+" Tf"),r.push("1 0 0 1 0 0 Tm"),r.push(n.text),r.push("ET"),r.push("Q"),r.push("EMC");var i=Au(e);return i.scope=e.scope,i.stream=r.join(`
|
|
477
|
+
`),i}},j2=function(e,r){var t=e.fontSize===0?e.maxFontSize:e.fontSize,n={text:"",fontSize:""},a=(r=(r=r.substr(0,1)=="("?r.substr(1):r).substr(r.length-1)==")"?r.substr(0,r.length-1):r).split(" ");a=e.multiline?a.map(function(O){return O.split(`
|
|
478
|
+
`)}):a.map(function(O){return[O]});var i=t,o=rr.internal.getHeight(e)||0;o=o<0?-o:o;var s=rr.internal.getWidth(e)||0;s=s<0?-s:s;var c=function(O,C,A){if(O+1<a.length){var k=C+" "+a[O+1][0];return h1(k,e,A).width<=s-4}return!1};i++;e:for(;i>0;){r="",i--;var u,d,p=h1("3",e,i).height,y=e.multiline?o-i:(o-p)/2,f=y+=2,_=0,S=0,w=0;if(i<=0){r=`(...) Tj
|
|
479
|
+
`,r+="% Width of Text: "+h1(r,e,i=12).width+", FieldWidth:"+s+`
|
|
480
|
+
`;break}for(var x="",v=0,g=0;g<a.length;g++)if(a.hasOwnProperty(g)){var E=!1;if(a[g].length!==1&&w!==a[g].length-1){if((p+2)*(v+2)+2>o)continue e;x+=a[g][w],E=!0,S=g,g--}else{x=(x+=a[g][w]+" ").substr(x.length-1)==" "?x.substr(0,x.length-1):x;var b=parseInt(g),M=c(b,x,i),N=g>=a.length-1;if(M&&!N){x+=" ",w=0;continue}if(M||N){if(N)S=b;else if(e.multiline&&(p+2)*(v+2)+2>o)continue e}else{if(!e.multiline||(p+2)*(v+2)+2>o)continue e;S=b}}for(var R="",F=_;F<=S;F++){var j=a[F];if(e.multiline){if(F===S){R+=j[w]+" ",w=(w+1)%j.length;continue}if(F===_){R+=j[j.length-1]+" ";continue}}R+=j[0]+" "}switch(R=R.substr(R.length-1)==" "?R.substr(0,R.length-1):R,d=h1(R,e,i).width,e.textAlign){case"right":u=s-d-2;break;case"center":u=(s-d)/2;break;case"left":default:u=2}r+=Er(u)+" "+Er(f)+` Td
|
|
481
|
+
`,r+="("+Df(R)+`) Tj
|
|
482
|
+
`,r+=-Er(u)+` 0 Td
|
|
483
|
+
`,f=-(i+2),d=0,_=E?S:S+1,v++,x=""}break}return n.text=r,n.fontSize=i,n},h1=function(e,r,t){var n=r.scope.internal.getFont(r.fontName,r.fontStyle),a=r.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(t),charSpace:0})*parseFloat(t);return{height:r.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(t),charSpace:0})*parseFloat(t)*1.5,width:a}},$k={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Yk=function(e,r){var t={type:"reference",object:e};r.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===t.type&&n.object===t.object})===void 0&&r.internal.getPageInfo(e.page).pageContext.annotations.push(t)},Xk=function(e,r){for(var t in e)if(e.hasOwnProperty(t)){var n=t,a=e[t];r.internal.newObjectDeferredBegin(a.objId,!0),On(a)==="object"&&typeof a.putStream=="function"&&a.putStream(),delete e[n]}},Kk=function(e,r){if(r.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(Jl.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify($k)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Dm=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new A_,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];i.objId=void 0,i.hasAnnotation&&Yk(i,t)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(t){if(t.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(t){(function(n,a){var i=!n;for(var o in n||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(o)){var s=n[o],c=[],u=s.Rect;if(s.Rect&&(s.Rect=Gk(s.Rect,a)),a.internal.newObjectDeferredBegin(s.objId,!0),s.DA=rr.createDefaultAppearanceStream(s),On(s)==="object"&&typeof s.getKeyValueListForStream=="function"&&(c=s.getKeyValueListForStream()),s.Rect=u,s.hasAppearanceStream&&!s.appearanceStreamContent){var d=Wk(s);c.push({key:"AP",value:"<</N "+d+">>"}),a.internal.acroformPlugin.xForms.push(d)}if(s.appearanceStreamContent){var p="";for(var y in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(y)){var f=s.appearanceStreamContent[y];if(p+="/"+y+" ",p+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var o in f)if(f.hasOwnProperty(o)){var _=f[o];typeof _=="function"&&(_=_.call(a,s)),p+="/"+o+" "+_+" ",a.internal.acroformPlugin.xForms.indexOf(_)>=0||a.internal.acroformPlugin.xForms.push(_)}}else typeof(_=f)=="function"&&(_=_.call(a,s)),p+="/"+o+" "+_,a.internal.acroformPlugin.xForms.indexOf(_)>=0||a.internal.acroformPlugin.xForms.push(_);p+=">>"}c.push({key:"AP",value:`<<
|
|
484
|
+
`+p+">>"})}a.internal.putStream({additionalKeyValues:c,objectId:s.objId}),a.internal.out("endobj")}i&&Xk(a.internal.acroformPlugin.xForms,a)})(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},P_=Ci.__acroform__.arrayToPdfArray=function(e,r,t){var n=function(o){return o};if(Array.isArray(e)){for(var a="[",i=0;i<e.length;i++)switch(i!==0&&(a+=" "),On(e[i])){case"boolean":case"number":case"object":a+=e[i].toString();break;case"string":e[i].substr(0,1)!=="/"?(r!==void 0&&t&&(n=t.internal.getEncryptor(r)),a+="("+Df(n(e[i].toString()))+")"):a+=e[i].toString()}return a+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},u2=function(e,r,t){var n=function(a){return a};return r!==void 0&&t&&(n=t.internal.getEncryptor(r)),(e=e||"").toString(),e="("+Df(n(e))+")"},Lu=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Lu.prototype.toString=function(){return this.objId+" 0 R"},Lu.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Lu.prototype.getKeyValueListForStream=function(){var e=[],r=Object.getOwnPropertyNames(this).filter(function(i){return i!="content"&&i!="appearanceStreamContent"&&i!="scope"&&i!="objId"&&i.substring(0,1)!="_"});for(var t in r)if(Object.getOwnPropertyDescriptor(this,r[t]).configurable===!1){var n=r[t],a=this[n];a&&(Array.isArray(a)?e.push({key:n,value:P_(a,this.objId,this.scope)}):a instanceof Lu?(a.scope=this.scope,e.push({key:n,value:a.objId+" 0 R"})):typeof a!="function"&&e.push({key:n,value:a}))}return e};var O_=function(){Lu.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,r=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};ws(O_,Lu);var A_=function(){Lu.call(this);var e,r=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return r.length>0?r:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return r}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(n){return n};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Df(t(e))+")"}},set:function(t){e=t}})};ws(A_,Lu);var Jl=function e(){Lu.call(this);var r=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return r},set:function(x){if(isNaN(x))throw new Error('Invalid value "'+x+'" for attribute F supplied.');r=x}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ki(r,3)},set:function(x){x?this.F=Zi(r,3):this.F=Qi(r,3)}});var t=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return t},set:function(x){if(isNaN(x))throw new Error('Invalid value "'+x+'" for attribute Ff supplied.');t=x}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(x){n=x!==void 0?x:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(x){n[0]=x}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(x){n[1]=x}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(x){n[2]=x}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(x){n[3]=x}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(x){switch(x){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=x;break;default:throw new Error('Invalid value "'+x+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof q1)return;i="FieldObject"+e.FieldNum++}var x=function(v){return v};return this.scope&&(x=this.scope.internal.getEncryptor(this.objId)),"("+Df(x(i))+")"},set:function(x){i=x.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(x){i=x}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(x){o=x}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(x){s=x}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(x){c=x}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/Dm:u},set:function(x){u=x}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(x){d=x}});var p="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!p||this instanceof q1||this instanceof Of))return u2(p,this.objId,this.scope)},set:function(x){x=x.toString(),p=x}});var y=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(y)return this instanceof Na?y:u2(y,this.objId,this.scope)},set:function(x){x=x.toString(),y=this instanceof Na?x:x.substr(0,1)==="("?ih(x.substr(1,x.length-2)):ih(x)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Na?ih(y.substr(1,y.length-1)):y},set:function(x){x=x.toString(),y=this instanceof Na?"/"+x:x}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(x){this.V=x}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof Na?f:u2(f,this.objId,this.scope)},set:function(x){x=x.toString(),f=this instanceof Na?x:x.substr(0,1)==="("?ih(x.substr(1,x.length-2)):ih(x)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Na?ih(f.substr(1,f.length-1)):f},set:function(x){x=x.toString(),f=this instanceof Na?"/"+x:x}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var _,S=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return S},set:function(x){x=!!x,S=x}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(_)return _},set:function(x){_=x}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,1)},set:function(x){x?this.Ff=Zi(this.Ff,1):this.Ff=Qi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,2)},set:function(x){x?this.Ff=Zi(this.Ff,2):this.Ff=Qi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,3)},set:function(x){x?this.Ff=Zi(this.Ff,3):this.Ff=Qi(this.Ff,3)}});var w=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(w!==null)return w},set:function(x){if([0,1,2].indexOf(x)===-1)throw new Error('Invalid value "'+x+'" for attribute Q supplied.');w=x}}),Object.defineProperty(this,"textAlign",{get:function(){var x;switch(w){case 0:default:x="left";break;case 1:x="center";break;case 2:x="right"}return x},configurable:!0,enumerable:!0,set:function(x){switch(x){case"right":case 2:w=2;break;case"center":case 1:w=1;break;case"left":case 0:default:w=0}}})};ws(Jl,Lu);var gh=function(){Jl.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var r=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return P_(r,this.objId,this.scope)},set:function(t){var n,a;a=[],typeof(n=t)=="string"&&(a=function(i,o,s){s||(s=1);for(var c,u=[];c=o.exec(i);)u.push(c[s]);return u}(n,/\((.*?)\)/g)),r=a}}),this.getOptions=function(){return r},this.setOptions=function(t){r=t,this.sort&&r.sort()},this.addOption=function(t){t=(t=t||"").toString(),r.push(t),this.sort&&r.sort()},this.removeOption=function(t,n){for(n=n||!1,t=(t=t||"").toString();r.indexOf(t)!==-1&&(r.splice(r.indexOf(t),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,18)},set:function(t){t?this.Ff=Zi(this.Ff,18):this.Ff=Qi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,19)},set:function(t){this.combo===!0&&(t?this.Ff=Zi(this.Ff,19):this.Ff=Qi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,20)},set:function(t){t?(this.Ff=Zi(this.Ff,20),r.sort()):this.Ff=Qi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,22)},set:function(t){t?this.Ff=Zi(this.Ff,22):this.Ff=Qi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,23)},set:function(t){t?this.Ff=Zi(this.Ff,23):this.Ff=Qi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,27)},set:function(t){t?this.Ff=Zi(this.Ff,27):this.Ff=Qi(this.Ff,27)}}),this.hasAppearanceStream=!1};ws(gh,Jl);var vh=function(){gh.call(this),this.fontName="helvetica",this.combo=!1};ws(vh,gh);var mh=function(){vh.call(this),this.combo=!0};ws(mh,vh);var _1=function(){mh.call(this),this.edit=!0};ws(_1,mh);var Na=function(){Jl.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,15)},set:function(t){t?this.Ff=Zi(this.Ff,15):this.Ff=Qi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,16)},set:function(t){t?this.Ff=Zi(this.Ff,16):this.Ff=Qi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,17)},set:function(t){t?this.Ff=Zi(this.Ff,17):this.Ff=Qi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,26)},set:function(t){t?this.Ff=Zi(this.Ff,26):this.Ff=Qi(this.Ff,26)}});var e,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(i){return i};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),Object.keys(r).length!==0){var n,a=[];for(n in a.push("<<"),r)a.push("/"+n+" ("+Df(t(r[n]))+")");return a.push(">>"),a.join(`
|
|
485
|
+
`)}},set:function(t){On(t)==="object"&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){typeof t=="string"&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};ws(Na,Jl);var S1=function(){Na.call(this),this.pushButton=!0};ws(S1,Na);var yh=function(){Na.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r!==void 0?r:[]}})};ws(yh,Na);var q1=function(){var e,r;Jl.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(a){e=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(a){r=a}});var t,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(s){return s};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,o=[];for(i in o.push("<<"),n)o.push("/"+i+" ("+Df(a(n[i]))+")");return o.push(">>"),o.join(`
|
|
486
|
+
`)},set:function(a){On(a)==="object"&&(n=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(a){typeof a=="string"&&(n.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(a){t=a}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(a){t="/"+a}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=rr.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ws(q1,Jl),yh.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var r in this.Kids)if(this.Kids.hasOwnProperty(r)){var t=this.Kids[r];t.appearanceStreamContent=e.createAppearanceStream(t.optionName),t.caption=e.getCA()}},yh.prototype.createOption=function(e){var r=new q1;return r.Parent=this,r.optionName=e,this.Kids.push(r),Zk.call(this.scope,r),r};var x1=function(){Na.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=rr.CheckBox.createAppearanceStream()};ws(x1,Na);var Of=function(){Jl.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,13)},set:function(r){r?this.Ff=Zi(this.Ff,13):this.Ff=Qi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,21)},set:function(r){r?this.Ff=Zi(this.Ff,21):this.Ff=Qi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,23)},set:function(r){r?this.Ff=Zi(this.Ff,23):this.Ff=Qi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,24)},set:function(r){r?this.Ff=Zi(this.Ff,24):this.Ff=Qi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,25)},set:function(r){r?this.Ff=Zi(this.Ff,25):this.Ff=Qi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,26)},set:function(r){r?this.Ff=Zi(this.Ff,26):this.Ff=Qi(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){Number.isInteger(r)&&(e=r)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ws(Of,Jl);var E1=function(){Of.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,14)},set:function(e){e?this.Ff=Zi(this.Ff,14):this.Ff=Qi(this.Ff,14)}}),this.password=!0};ws(E1,Of);var rr={CheckBox:{createAppearanceStream:function(){return{N:{On:rr.CheckBox.YesNormal},D:{On:rr.CheckBox.YesPushDown,Off:rr.CheckBox.OffPushDown}}},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,a=e.scope.__private__.encodeColorString(e.color),i=j2(e,e.caption);return t.push("0.749023 g"),t.push("0 0 "+Er(rr.internal.getWidth(e))+" "+Er(rr.internal.getHeight(e))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+n+" "+Er(i.fontSize)+" Tf "+a),t.push("BT"),t.push(i.text),t.push("ET"),t.push("Q"),t.push("EMC"),r.stream=t.join(`
|
|
487
|
+
`),r},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),a=[],i=rr.internal.getHeight(e),o=rr.internal.getWidth(e),s=j2(e,e.caption);return a.push("1 g"),a.push("0 0 "+Er(o)+" "+Er(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+Er(o-1)+" "+Er(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+t+" "+Er(s.fontSize)+" Tf "+n),a.push(s.text),a.push("ET"),a.push("Q"),r.stream=a.join(`
|
|
488
|
+
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Er(rr.internal.getWidth(e))+" "+Er(rr.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
489
|
+
`),r}},RadioButton:{Circle:{createAppearanceStream:function(e){var r={D:{Off:rr.RadioButton.Circle.OffPushDown},N:{}};return r.N[e]=rr.RadioButton.Circle.YesNormal,r.D[e]=rr.RadioButton.Circle.YesPushDown,r},getCA:function(){return"l"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=rr.internal.getWidth(e)<=rr.internal.getHeight(e)?rr.internal.getWidth(e)/4:rr.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=rr.internal.Bezier_C,i=Number((n*a).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+zc(rr.internal.getWidth(e)/2)+" "+zc(rr.internal.getHeight(e)/2)+" cm"),t.push(n+" 0 m"),t.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),t.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),t.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),t.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
490
|
+
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=rr.internal.getWidth(e)<=rr.internal.getHeight(e)?rr.internal.getWidth(e)/4:rr.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*rr.internal.Bezier_C).toFixed(5)),o=Number((n*rr.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+zc(rr.internal.getWidth(e)/2)+" "+zc(rr.internal.getHeight(e)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),t.push("0 g"),t.push("q"),t.push("1 0 0 1 "+zc(rr.internal.getWidth(e)/2)+" "+zc(rr.internal.getHeight(e)/2)+" cm"),t.push(n+" 0 m"),t.push(n+" "+o+" "+o+" "+n+" 0 "+n+" c"),t.push("-"+o+" "+n+" -"+n+" "+o+" -"+n+" 0 c"),t.push("-"+n+" -"+o+" -"+o+" -"+n+" 0 -"+n+" c"),t.push(o+" -"+n+" "+n+" -"+o+" "+n+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
491
|
+
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=rr.internal.getWidth(e)<=rr.internal.getHeight(e)?rr.internal.getWidth(e)/4:rr.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*rr.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+zc(rr.internal.getWidth(e)/2)+" "+zc(rr.internal.getHeight(e)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
492
|
+
`),r}},Cross:{createAppearanceStream:function(e){var r={D:{Off:rr.RadioButton.Cross.OffPushDown},N:{}};return r.N[e]=rr.RadioButton.Cross.YesNormal,r.D[e]=rr.RadioButton.Cross.YesPushDown,r},getCA:function(){return"8"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=rr.internal.calculateCross(e);return t.push("q"),t.push("1 1 "+Er(rr.internal.getWidth(e)-2)+" "+Er(rr.internal.getHeight(e)-2)+" re"),t.push("W"),t.push("n"),t.push(Er(n.x1.x)+" "+Er(n.x1.y)+" m"),t.push(Er(n.x2.x)+" "+Er(n.x2.y)+" l"),t.push(Er(n.x4.x)+" "+Er(n.x4.y)+" m"),t.push(Er(n.x3.x)+" "+Er(n.x3.y)+" l"),t.push("s"),t.push("Q"),r.stream=t.join(`
|
|
493
|
+
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=rr.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+Er(rr.internal.getWidth(e))+" "+Er(rr.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+Er(rr.internal.getWidth(e)-2)+" "+Er(rr.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Er(t.x1.x)+" "+Er(t.x1.y)+" m"),n.push(Er(t.x2.x)+" "+Er(t.x2.y)+" l"),n.push(Er(t.x4.x)+" "+Er(t.x4.y)+" m"),n.push(Er(t.x3.x)+" "+Er(t.x3.y)+" l"),n.push("s"),n.push("Q"),r.stream=n.join(`
|
|
494
|
+
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Er(rr.internal.getWidth(e))+" "+Er(rr.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
495
|
+
`),r}}},createDefaultAppearanceStream:function(e){var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,t=e.scope.__private__.encodeColorString(e.color);return"/"+r+" "+e.fontSize+" Tf "+t}};rr.internal={Bezier_C:.551915024494,calculateCross:function(e){var r=rr.internal.getWidth(e),t=rr.internal.getHeight(e),n=Math.min(r,t);return{x1:{x:(r-n)/2,y:(t-n)/2+n},x2:{x:(r-n)/2+n,y:(t-n)/2},x3:{x:(r-n)/2,y:(t-n)/2},x4:{x:(r-n)/2+n,y:(t-n)/2+n}}}},rr.internal.getWidth=function(e){var r=0;return On(e)==="object"&&(r=tw(e.Rect[2])),r},rr.internal.getHeight=function(e){var r=0;return On(e)==="object"&&(r=tw(e.Rect[3])),r};var Zk=Ci.addField=function(e){if(Kk(this,e),!(e instanceof Jl))throw new Error("Invalid argument passed to jsPDF.addField.");var r;return(r=e).scope.internal.acroformPlugin.printedOut&&(r.scope.internal.acroformPlugin.printedOut=!1,r.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),r.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(r),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Ci.AcroFormChoiceField=gh,Ci.AcroFormListBox=vh,Ci.AcroFormComboBox=mh,Ci.AcroFormEditBox=_1,Ci.AcroFormButton=Na,Ci.AcroFormPushButton=S1,Ci.AcroFormRadioButton=yh,Ci.AcroFormCheckBox=x1,Ci.AcroFormTextField=Of,Ci.AcroFormPasswordField=E1,Ci.AcroFormAppearance=rr,Ci.AcroForm={ChoiceField:gh,ListBox:vh,ComboBox:mh,EditBox:_1,Button:Na,PushButton:S1,RadioButton:yh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:rr},hr.AcroForm={ChoiceField:gh,ListBox:vh,ComboBox:mh,EditBox:_1,Button:Na,PushButton:S1,RadioButton:yh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:rr};hr.AcroForm;function C_(e){return e.reduce(function(r,t,n){return r[t]=n,r},{})}(function(e){e.__addimage__={};var r="UNKNOWN",t={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},n=e.__addimage__.getImageFileTypeByImageData=function(O,C){var A,k,T,V,G,$=r;if((C=C||r)==="RGBA"||O.data!==void 0&&O.data instanceof Uint8ClampedArray&&"height"in O&&"width"in O)return"RGBA";if(M(O))for(G in t)for(T=t[G],A=0;A<T.length;A+=1){for(V=!0,k=0;k<T[A].length;k+=1)if(T[A][k]!==void 0&&T[A][k]!==O[k]){V=!1;break}if(V===!0){$=G;break}}else for(G in t)for(T=t[G],A=0;A<T.length;A+=1){for(V=!0,k=0;k<T[A].length;k+=1)if(T[A][k]!==void 0&&T[A][k]!==O.charCodeAt(k)){V=!1;break}if(V===!0){$=G;break}}return $===r&&C!==r&&($=C),$},a=function O(C){for(var A=this.internal.write,k=this.internal.putStream,T=(0,this.internal.getFilters)();T.indexOf("FlateEncode")!==-1;)T.splice(T.indexOf("FlateEncode"),1);C.objectId=this.internal.newObject();var V=[];if(V.push({key:"Type",value:"/XObject"}),V.push({key:"Subtype",value:"/Image"}),V.push({key:"Width",value:C.width}),V.push({key:"Height",value:C.height}),C.colorSpace===w.INDEXED?V.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(C.palette.length/3-1)+" "+("sMask"in C&&C.sMask!==void 0?C.objectId+2:C.objectId+1)+" 0 R]"}):(V.push({key:"ColorSpace",value:"/"+C.colorSpace}),C.colorSpace===w.DEVICE_CMYK&&V.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),V.push({key:"BitsPerComponent",value:C.bitsPerComponent}),"decodeParameters"in C&&C.decodeParameters!==void 0&&V.push({key:"DecodeParms",value:"<<"+C.decodeParameters+">>"}),"transparency"in C&&Array.isArray(C.transparency)){for(var G="",$=0,te=C.transparency.length;$<te;$++)G+=C.transparency[$]+" "+C.transparency[$]+" ";V.push({key:"Mask",value:"["+G+"]"})}C.sMask!==void 0&&V.push({key:"SMask",value:C.objectId+1+" 0 R"});var W=C.filter!==void 0?["/"+C.filter]:void 0;if(k({data:C.data,additionalKeyValues:V,alreadyAppliedFilters:W,objectId:C.objectId}),A("endobj"),"sMask"in C&&C.sMask!==void 0){var U="/Predictor "+C.predictor+" /Colors 1 /BitsPerComponent "+C.bitsPerComponent+" /Columns "+C.width,z={width:C.width,height:C.height,colorSpace:"DeviceGray",bitsPerComponent:C.bitsPerComponent,decodeParameters:U,data:C.sMask};"filter"in C&&(z.filter=C.filter),O.call(this,z)}if(C.colorSpace===w.INDEXED){var D=this.internal.newObject();k({data:R(new Uint8Array(C.palette)),objectId:D}),A("endobj")}},i=function(){var O=this.internal.collections.addImage_images;for(var C in O)a.call(this,O[C])},o=function(){var O,C=this.internal.collections.addImage_images,A=this.internal.write;for(var k in C)A("/I"+(O=C[k]).index,O.objectId,"0","R")},s=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",i),this.internal.events.subscribe("putXobjectDict",o))},c=function(){var O=this.internal.collections.addImage_images;return s.call(this),O},u=function(){return Object.keys(this.internal.collections.addImage_images).length},d=function(O){return typeof e["process"+O.toUpperCase()]=="function"},p=function(O){return On(O)==="object"&&O.nodeType===1},y=function(O,C){if(O.nodeName==="IMG"&&O.hasAttribute("src")){var A=""+O.getAttribute("src");if(A.indexOf("data:image/")===0)return cp(unescape(A).split("base64,").pop());var k=e.loadFile(A,!0);if(k!==void 0)return k}if(O.nodeName==="CANVAS"){if(O.width===0||O.height===0)throw new Error("Given canvas must have data. Canvas width: "+O.width+", height: "+O.height);var T;switch(C){case"PNG":T="image/png";break;case"WEBP":T="image/webp";break;case"JPEG":case"JPG":default:T="image/jpeg"}return cp(O.toDataURL(T,1).split("base64,").pop())}},f=function(O){var C=this.internal.collections.addImage_images;if(C){for(var A in C)if(O===C[A].alias)return C[A]}},_=function(O,C,A){return O||C||(O=-96,C=-96),O<0&&(O=-1*A.width*72/O/this.internal.scaleFactor),C<0&&(C=-1*A.height*72/C/this.internal.scaleFactor),O===0&&(O=C*A.width/A.height),C===0&&(C=O*A.height/A.width),[O,C]},S=function(O,C,A,k,T,V){var G=_.call(this,A,k,T),$=this.internal.getCoordinateString,te=this.internal.getVerticalCoordinateString,W=c.call(this);if(A=G[0],k=G[1],W[T.index]=T,V){V*=Math.PI/180;var U=Math.cos(V),z=Math.sin(V),D=function(Q){return Q.toFixed(4)},Y=[D(U),D(z),D(-1*z),D(U),0,0,"cm"]}this.internal.write("q"),V?(this.internal.write([1,"0","0",1,$(O),te(C+k),"cm"].join(" ")),this.internal.write(Y.join(" ")),this.internal.write([$(A),"0","0",$(k),"0","0","cm"].join(" "))):this.internal.write([$(A),"0","0",$(k),$(O),te(C+k),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+T.index+" Do"),this.internal.write("Q")},w=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var x=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},v=e.__addimage__.sHashCode=function(O){var C,A,k=0;if(typeof O=="string")for(A=O.length,C=0;C<A;C++)k=(k<<5)-k+O.charCodeAt(C),k|=0;else if(M(O))for(A=O.byteLength/2,C=0;C<A;C++)k=(k<<5)-k+O[C],k|=0;return k},g=e.__addimage__.validateStringAsBase64=function(O){(O=O||"").toString().trim();var C=!0;return O.length===0&&(C=!1),O.length%4!=0&&(C=!1),/^[A-Za-z0-9+/]+$/.test(O.substr(0,O.length-2))===!1&&(C=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(O.substr(-2))===!1&&(C=!1),C},E=e.__addimage__.extractImageFromDataUrl=function(O){if(O==null||!(O=O.trim()).startsWith("data:"))return null;var C=O.indexOf(",");return C<0?null:O.substring(0,C).trim().endsWith("base64")?O.substring(C+1):null},b=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(O){return b()&&O instanceof ArrayBuffer};var M=e.__addimage__.isArrayBufferView=function(O){return b()&&typeof Uint32Array<"u"&&(O instanceof Int8Array||O instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&O instanceof Uint8ClampedArray||O instanceof Int16Array||O instanceof Uint16Array||O instanceof Int32Array||O instanceof Uint32Array||O instanceof Float32Array||O instanceof Float64Array)},N=e.__addimage__.binaryStringToUint8Array=function(O){for(var C=O.length,A=new Uint8Array(C),k=0;k<C;k++)A[k]=O.charCodeAt(k);return A},R=e.__addimage__.arrayBufferToBinaryString=function(O){for(var C="",A=M(O)?O:new Uint8Array(O),k=0;k<A.length;k+=8192)C+=String.fromCharCode.apply(null,A.subarray(k,k+8192));return C};e.addImage=function(){var O,C,A,k,T,V,G,$,te;if(typeof arguments[1]=="number"?(C=r,A=arguments[1],k=arguments[2],T=arguments[3],V=arguments[4],G=arguments[5],$=arguments[6],te=arguments[7]):(C=arguments[1],A=arguments[2],k=arguments[3],T=arguments[4],V=arguments[5],G=arguments[6],$=arguments[7],te=arguments[8]),On(O=arguments[0])==="object"&&!p(O)&&"imageData"in O){var W=O;O=W.imageData,C=W.format||C||r,A=W.x||A||0,k=W.y||k||0,T=W.w||W.width||T,V=W.h||W.height||V,G=W.alias||G,$=W.compression||$,te=W.rotation||W.angle||te}var U=this.internal.getFilters();if($===void 0&&U.indexOf("FlateEncode")!==-1&&($="SLOW"),isNaN(A)||isNaN(k))throw new Error("Invalid coordinates passed to jsPDF.addImage");s.call(this);var z=F.call(this,O,C,G,$);return S.call(this,A,k,T,V,z,te),this};var F=function(O,C,A,k){var T,V,G;if(typeof O=="string"&&n(O)===r){O=unescape(O);var $=j(O,!1);($!==""||($=e.loadFile(O,!0))!==void 0)&&(O=$)}if(p(O)&&(O=y(O,C)),C=n(O,C),!d(C))throw new Error("addImage does not support files of type '"+C+"', please ensure that a plugin for '"+C+"' support is added.");if(((G=A)==null||G.length===0)&&(A=function(te){return typeof te=="string"||M(te)?v(te):M(te.data)?v(te.data):null}(O)),(T=f.call(this,A))||(b()&&(O instanceof Uint8Array||C==="RGBA"||(V=O,O=N(O))),T=this["process"+C.toUpperCase()](O,u.call(this),A,function(te){return te&&typeof te=="string"&&(te=te.toUpperCase()),te in e.image_compression?te:x.NONE}(k),V)),!T)throw new Error("An unknown error occurred whilst processing the image.");return T},j=e.__addimage__.convertBase64ToBinaryString=function(O,C){C=typeof C!="boolean"||C;var A,k="";if(typeof O=="string"){var T;A=(T=E(O))!==null&&T!==void 0?T:O;try{k=cp(A)}catch(V){if(C)throw g(A)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+V.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return k};e.getImageProperties=function(O){var C,A,k="";if(p(O)&&(O=y(O)),typeof O=="string"&&n(O)===r&&((k=j(O,!1))===""&&(k=e.loadFile(O)||""),O=k),A=n(O),!d(A))throw new Error("addImage does not support files of type '"+A+"', please ensure that a plugin for '"+A+"' support is added.");if(!b()||O instanceof Uint8Array||(O=N(O)),!(C=this["process"+A.toUpperCase()](O)))throw new Error("An unknown error occurred whilst processing the image");return C.fileType=A,C}})(hr.API),function(e){var r=function(t){if(t!==void 0&&t!="")return!0};hr.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(t){for(var n,a,i,o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(t.objId),u=t.pageContext.annotations,d=!1,p=0;p<u.length&&!d;p++)switch((n=u[p]).type){case"link":(r(n.options.url)||r(n.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var y=0;y<u.length;y++){n=u[y];var f=this.internal.pdfEscape,_=this.internal.getEncryptor(t.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var S=this.internal.newAdditionalObject(),w=this.internal.newAdditionalObject(),x=this.internal.getEncryptor(S.objId),v=n.title||"Note";i="<</Type /Annot /Subtype /Text "+(a="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+f(x(n.contents))+")",i+=" /Popup "+w.objId+" 0 R",i+=" /P "+c.objId+" 0 R",i+=" /T ("+f(x(v))+") >>",S.content=i;var g=S.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+o(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+g,n.open&&(i+=" /Open true"),i+=" >>",w.content=i,this.internal.write(S.objId,"0 R",w.objId,"0 R");break;case"freetext":a="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var E=n.color||"#000000";i="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+f(_(n.contents))+")",i+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+E+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(n.options.name){var b=this.annotations._nameMap[n.options.name];n.options.pageNumber=b.page,n.options.top=b.y}else n.options.top||(n.options.top=0);if(a="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",i="",n.options.url)i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+f(_(n.options.url))+") >>";else if(n.options.pageNumber)switch(i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":i+=" /Fit]";break;case"FitH":i+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,i+=" /FitV "+n.options.left+"]";break;case"XYZ":default:var M=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),i+=" /XYZ "+n.options.left+" "+M+" "+n.options.zoom+"]"}i!=""&&(i+=" >>",this.internal.write(i))}}this.internal.write("]")}}]),e.createAnnotation=function(t){var n=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":n.pageContext.annotations.push(t)}},e.link=function(t,n,a,i,o){var s=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:c(t),y:u(n),w:c(t+a),h:u(n+i)},options:o,type:"link"})},e.textWithLink=function(t,n,a,i){var o,s,c=this.getTextWidth(t),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(i.maxWidth!==void 0){s=i.maxWidth;var d=this.splitTextToSize(t,s).length;o=Math.ceil(u*d)}else s=c,o=u;return this.text(t,n,a,i),a+=.2*u,i.align==="center"&&(n-=c/2),i.align==="right"&&(n-=c),this.link(n,a-u,s,o,i),c},e.getTextWidth=function(t){var n=this.internal.getFontSize();return this.getStringUnitWidth(t)*n/this.internal.scaleFactor}}(hr.API),function(e){var r={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},t={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];e.__arabicParser__={};var i=e.__arabicParser__.isInArabicSubstitutionA=function(S){return r[S.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(S){return typeof S=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(S)},s=e.__arabicParser__.isArabicEndLetter=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(S){return o(S)&&a.indexOf(S.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length>=3};var d=e.__arabicParser__.arabicLetterHasMedialForm=function(S){return o(S)&&i(S)&&r[S.charCodeAt(0)].length==4},p=e.__arabicParser__.resolveLigatures=function(S){var w=0,x=t,v="",g=0;for(w=0;w<S.length;w+=1)x[S.charCodeAt(w)]!==void 0?(g++,typeof(x=x[S.charCodeAt(w)])=="number"&&(v+=String.fromCharCode(x),x=t,g=0),w===S.length-1&&(x=t,v+=S.charAt(w-(g-1)),w-=g-1,g=0)):(x=t,v+=S.charAt(w-g),w-=g,g=0);return v};e.__arabicParser__.isArabicDiacritic=function(S){return S!==void 0&&n[S.charCodeAt(0)]!==void 0};var y=e.__arabicParser__.getCorrectForm=function(S,w,x){return o(S)?i(S)===!1?-1:!u(S)||!o(w)&&!o(x)||!o(x)&&s(w)||s(S)&&!o(w)||s(S)&&c(w)||s(S)&&s(w)?0:d(S)&&o(w)&&!s(w)&&o(x)&&u(x)?3:s(S)||!o(x)?1:2:-1},f=function(S){var w=0,x=0,v=0,g="",E="",b="",M=(S=S||"").split("\\s+"),N=[];for(w=0;w<M.length;w+=1){for(N.push(""),x=0;x<M[w].length;x+=1)g=M[w][x],E=M[w][x-1],b=M[w][x+1],o(g)?(v=y(g,E,b),N[w]+=v!==-1?String.fromCharCode(r[g.charCodeAt(0)][v]):g):N[w]+=g;N[w]=p(N[w])}return N.join(" ")},_=e.__arabicParser__.processArabic=e.processArabic=function(){var S,w=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,x=[];if(Array.isArray(w)){var v=0;for(x=[],v=0;v<w.length;v+=1)Array.isArray(w[v])?x.push([f(w[v][0]),w[v][1],w[v][2]]):x.push([f(w[v])]);S=x}else S=f(w);return typeof arguments[0]=="string"?S:(arguments[0].text=S,arguments[0])};e.events.push(["preProcessText",_])}(hr.API),hr.API.autoPrint=function(e){var r;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){r=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+r+" 0 R")})}return this},function(e){var r=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(s){t=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(s){a=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(s){i=s}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(s){o=s}}),Object.defineProperty(this,"parentNode",{})};r.prototype.getContext=function(t,n){var a;if((t=t||"2d")!=="2d")return null;for(a in n)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=n[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},r.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new r,this.canvas.pdf=this}])}(hr.API),function(e){var r={left:0,top:0,bottom:0,right:0},t=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},r),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(S){c=S}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(S){u=S}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(S){d=S}});var p=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return p},set:function(S){p=S}});var y=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return y},set:function(S){y=S}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(S){f=S}});var _=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return _},set:function(S){_=S}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(c){return n.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,u){n.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),p=u.font||this.getFont(),y=u.scaleFactor||this.internal.scaleFactor,f=0,_=0,S=0,w=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var x=u.maxWidth;x>0?typeof c=="string"?c=this.splitTextToSize(c,x):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(g,E){return g.concat(w.splitTextToSize(E,x))},[])):c=Array.isArray(c)?c:[c];for(var v=0;v<c.length;v++)f<(S=this.getStringUnitWidth(c[v],{font:p})*d)&&(f=S);return f!==0&&(_=c.length),{w:f/=y,h:Math.max((_*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/y,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var c=this.internal.__cell__.margins||r;return this.internal.__cell__.lastCell=new i(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=e.cell=function(){var c;c=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var u=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,p=this.internal.__cell__.margins||r,y=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===c.lineNumber?(c.x=(u.x||0)+(u.width||0),c.y=u.y||0):u.y+u.height+c.height+p.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=p.top,f&&y&&(this.printHeaderRow(c.lineNumber,!0),c.y+=y[0].height)):c.y=u.y+u.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,t===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};e.table=function(c,u,d,p,y){if(n.call(this),!d)throw new Error("No data for PDF table.");var f,_,S,w,x=[],v=[],g=[],E={},b={},M=[],N=[],R=(y=y||{}).autoSize||!1,F=y.printHeaders!==!1,j=y.css&&y.css["font-size"]!==void 0?16*y.css["font-size"]:y.fontSize||12,O=y.margins||Object.assign({width:this.getPageWidth()},r),C=typeof y.padding=="number"?y.padding:3,A=y.headerBackgroundColor||"#c8c8c8",k=y.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=F,this.internal.__cell__.margins=O,this.internal.__cell__.table_font_size=j,this.internal.__cell__.padding=C,this.internal.__cell__.headerBackgroundColor=A,this.internal.__cell__.headerTextColor=k,this.setFontSize(j),p==null)v=x=Object.keys(d[0]),g=x.map(function(){return"left"});else if(Array.isArray(p)&&On(p[0])==="object")for(x=p.map(function(W){return W.name}),v=p.map(function(W){return W.prompt||W.name||""}),g=p.map(function(W){return W.align||"left"}),f=0;f<p.length;f+=1)b[p[f].name]=p[f].width*(19.049976/25.4);else Array.isArray(p)&&typeof p[0]=="string"&&(v=x=p,g=x.map(function(){return"left"}));if(R||Array.isArray(p)&&typeof p[0]=="string")for(f=0;f<x.length;f+=1){for(E[w=x[f]]=d.map(function(W){return W[w]}),this.setFont(void 0,"bold"),M.push(this.getTextDimensions(v[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),_=E[w],this.setFont(void 0,"normal"),S=0;S<_.length;S+=1)M.push(this.getTextDimensions(_[S],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);b[w]=Math.max.apply(null,M)+C+C,M=[]}if(F){var T={};for(f=0;f<x.length;f+=1)T[x[f]]={},T[x[f]].text=v[f],T[x[f]].align=g[f];var V=s.call(this,T,b);N=x.map(function(W){return new i(c,u,b[W],V,T[W].text,void 0,T[W].align)}),this.setTableHeaderRow(N),this.printHeaderRow(1,!1)}var G=p.reduce(function(W,U){return W[U.name]=U.align,W},{});for(f=0;f<d.length;f+=1){"rowStart"in y&&y.rowStart instanceof Function&&y.rowStart({row:f,data:d[f]},this);var $=s.call(this,d[f],b);for(S=0;S<x.length;S+=1){var te=d[f][x[S]];"cellStart"in y&&y.cellStart instanceof Function&&y.cellStart({row:f,col:S,data:te},this),o.call(this,new i(c,u,b[x[S]],$,te,f+2,G[x[S]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=u,this};var s=function(c,u){var d=this.internal.__cell__.padding,p=this.internal.__cell__.table_font_size,y=this.internal.scaleFactor;return Object.keys(c).map(function(f){var _=c[f];return this.splitTextToSize(_.hasOwnProperty("text")?_.text:_,u[f]-d-d)},this).map(function(f){return this.getLineHeightFactor()*f.length*p/y+d+d},this).reduce(function(f,_){return Math.max(f,_)},0)};e.setTableHeaderRow=function(c){n.call(this),this.internal.__cell__.tableHeaderRow=c},e.printHeaderRow=function(c,u){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(t=!0,typeof this.internal.__cell__.headerFunction=="function"){var p=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(p[0],p[1],p[2],p[3],void 0,-1)}this.setFont(void 0,"bold");for(var y=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){d=this.internal.__cell__.tableHeaderRow[f].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,y.push(d)),d.lineNumber=c;var _=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,d),this.setTextColor(_)}y.length>0&&this.setTableHeaderRow(y),this.setFont(void 0,"normal"),t=!1}}(hr.API);var k_={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},L_=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],F2=C_(L_),N_=[100,200,300,400,500,600,700,800,900],Qk=C_(N_);function D2(e){var r=e.family.replace(/"|'/g,"").toLowerCase(),t=function(i){return k_[i=i||"normal"]?i:"normal"}(e.style),n=function(i){if(!i)return 400;if(typeof i=="number")return i>=100&&i<=900&&i%100==0?i:400;if(/^\d00$/.test(i))return parseInt(i);switch(i){case"bold":return 700;case"normal":default:return 400}}(e.weight),a=function(i){return typeof F2[i=i||"normal"]=="number"?i:"normal"}(e.stretch);return{family:r,style:t,weight:n,stretch:a,src:e.src||[],ref:e.ref||{name:r,style:[a,t,n].join(" ")}}}function rw(e,r,t,n){var a;for(a=t;a>=0&&a<r.length;a+=n)if(e[r[a]])return e[r[a]];for(a=t;a>=0&&a<r.length;a-=n)if(e[r[a]])return e[r[a]]}var Jk={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},nw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function iw(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function eL(e,r,t){for(var n=(t=t||{}).defaultFontFamily||"times",a=Object.assign({},Jk,t.genericFontFamilies||{}),i=null,o=null,s=0;s<r.length;++s)if(a[(i=D2(r[s])).family]&&(i.family=a[i.family]),e.hasOwnProperty(i.family)){o=e[i.family];break}if(!(o=o||e[n]))throw new Error("Could not find a font-family for the rule '"+iw(i)+"' and default family '"+n+"'.");if(o=function(c,u){if(u[c])return u[c];var d=F2[c],p=d<=F2.normal?-1:1,y=rw(u,L_,d,p);if(!y)throw new Error("Could not find a matching font-stretch value for "+c);return y}(i.stretch,o),o=function(c,u){if(u[c])return u[c];for(var d=k_[c],p=0;p<d.length;++p)if(u[d[p]])return u[d[p]];throw new Error("Could not find a matching font-style for "+c)}(i.style,o),!(o=function(c,u){if(u[c])return u[c];if(c===400&&u[500])return u[500];if(c===500&&u[400])return u[400];var d=Qk[c],p=rw(u,N_,d,c<400?-1:1);if(!p)throw new Error("Could not find a matching font-weight for value "+c);return p}(i.weight,o)))throw new Error("Failed to resolve a font for the rule '"+iw(i)+"'.");return o}function aw(e){return e.trimLeft()}function tL(e,r){for(var t=0;t<e.length;){if(e.charAt(t)===r)return[e.substring(0,t),e.substring(t+1)];t+=1}return null}function rL(e){var r=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return r===null?null:[r[0],e.substring(r[0].length)]}var d1,ow,sw,c2=["times"];(function(e){var r,t,n,a,i,o,s,c,u,d=function(z){return z=z||{},this.isStrokeTransparent=z.isStrokeTransparent||!1,this.strokeOpacity=z.strokeOpacity||1,this.strokeStyle=z.strokeStyle||"#000000",this.fillStyle=z.fillStyle||"#000000",this.isFillTransparent=z.isFillTransparent||!1,this.fillOpacity=z.fillOpacity||1,this.font=z.font||"10px sans-serif",this.textBaseline=z.textBaseline||"alphabetic",this.textAlign=z.textAlign||"left",this.lineWidth=z.lineWidth||1,this.lineJoin=z.lineJoin||"miter",this.lineCap=z.lineCap||"butt",this.path=z.path||[],this.transform=z.transform!==void 0?z.transform.clone():new c,this.globalCompositeOperation=z.globalCompositeOperation||"normal",this.globalAlpha=z.globalAlpha||1,this.clip_path=z.clip_path||[],this.currentPoint=z.currentPoint||new o,this.miterLimit=z.miterLimit||10,this.lastPoint=z.lastPoint||new o,this.lineDashOffset=z.lineDashOffset||0,this.lineDash=z.lineDash||[],this.margin=z.margin||[0,0,0,0],this.prevPageLastElemOffset=z.prevPageLastElemOffset||0,this.ignoreClearRect=typeof z.ignoreClearRect!="boolean"||z.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new p(this),r=this.internal.f2,t=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,c=this.internal.Matrix,u=new d}]);var p=function(z){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var D=z;Object.defineProperty(this,"pdf",{get:function(){return D}});var Y=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Y},set:function(Se){Y=!!Se}});var Q=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Q},set:function(Se){Q=!!Se}});var J=0;Object.defineProperty(this,"posX",{get:function(){return J},set:function(Se){isNaN(Se)||(J=Se)}});var Z=0;Object.defineProperty(this,"posY",{get:function(){return Z},set:function(Se){isNaN(Se)||(Z=Se)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(Se){var ye;typeof Se=="number"?ye=[Se,Se,Se,Se]:((ye=new Array(4))[0]=Se[0],ye[1]=Se.length>=2?Se[1]:ye[0],ye[2]=Se.length>=3?Se[2]:ye[0],ye[3]=Se.length>=4?Se[3]:ye[1]),u.margin=ye}});var ae=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ae},set:function(Se){ae=Se}});var se=0;Object.defineProperty(this,"lastBreak",{get:function(){return se},set:function(Se){se=Se}});var ce=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ce},set:function(Se){ce=Se}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(Se){Se instanceof d&&(u=Se)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(Se){u.path=Se}});var de=[];Object.defineProperty(this,"ctxStack",{get:function(){return de},set:function(Se){de=Se}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Se){var ye;ye=y(Se),this.ctx.fillStyle=ye.style,this.ctx.isFillTransparent=ye.a===0,this.ctx.fillOpacity=ye.a,this.pdf.setFillColor(ye.r,ye.g,ye.b,{a:ye.a}),this.pdf.setTextColor(ye.r,ye.g,ye.b,{a:ye.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Se){var ye=y(Se);this.ctx.strokeStyle=ye.style,this.ctx.isStrokeTransparent=ye.a===0,this.ctx.strokeOpacity=ye.a,ye.a===0?this.pdf.setDrawColor(255,255,255):(ye.a,this.pdf.setDrawColor(ye.r,ye.g,ye.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Se){["butt","round","square"].indexOf(Se)!==-1&&(this.ctx.lineCap=Se,this.pdf.setLineCap(Se))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Se){isNaN(Se)||(this.ctx.lineWidth=Se,this.pdf.setLineWidth(Se))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Se){["bevel","round","miter"].indexOf(Se)!==-1&&(this.ctx.lineJoin=Se,this.pdf.setLineJoin(Se))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Se){isNaN(Se)||(this.ctx.miterLimit=Se,this.pdf.setMiterLimit(Se))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Se){this.ctx.textBaseline=Se}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Se){["right","end","center","left","start"].indexOf(Se)!==-1&&(this.ctx.textAlign=Se)}});var Oe=null;function Le(Se,ye){if(Oe===null){var Je=function(we){var me=[];return Object.keys(we).forEach(function(Ee){we[Ee].forEach(function(Te){var he=null;switch(Te){case"bold":he={family:Ee,weight:"bold"};break;case"italic":he={family:Ee,style:"italic"};break;case"bolditalic":he={family:Ee,weight:"bold",style:"italic"};break;case"":case"normal":he={family:Ee}}he!==null&&(he.ref={name:Ee,style:Te},me.push(he))})}),me}(Se.getFontList());Oe=function(we){for(var me={},Ee=0;Ee<we.length;++Ee){var Te=D2(we[Ee]),he=Te.family,Re=Te.stretch,Ie=Te.style,Xe=Te.weight;me[he]=me[he]||{},me[he][Re]=me[he][Re]||{},me[he][Re][Ie]=me[he][Re][Ie]||{},me[he][Re][Ie][Xe]=Te}return me}(Je.concat(ye))}return Oe}var ke=null;Object.defineProperty(this,"fontFaces",{get:function(){return ke},set:function(Se){Oe=null,ke=Se}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Se){var ye;if(this.ctx.font=Se,(ye=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Se))!==null){var Je=ye[1];ye[2];var we=ye[3],me=ye[4];ye[5];var Ee=ye[6],Te=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(me)[2];me=Math.floor(Te==="px"?parseFloat(me)*this.pdf.internal.scaleFactor:Te==="em"?parseFloat(me)*this.pdf.getFontSize():parseFloat(me)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(me);var he=function(yt){var mt,ct,Bt=[],Pt=yt.trim();if(Pt==="")return c2;if(Pt in nw)return[nw[Pt]];for(;Pt!=="";){switch(ct=null,mt=(Pt=aw(Pt)).charAt(0)){case'"':case"'":ct=tL(Pt.substring(1),mt);break;default:ct=rL(Pt)}if(ct===null||(Bt.push(ct[0]),(Pt=aw(ct[1]))!==""&&Pt.charAt(0)!==","))return c2;Pt=Pt.replace(/^,/,"")}return Bt}(Ee);if(this.fontFaces){var Re=eL(Le(this.pdf,this.fontFaces),he.map(function(yt){return{family:yt,stretch:"normal",weight:we,style:Je}}));this.pdf.setFont(Re.ref.name,Re.ref.style)}else{var Ie="";(we==="bold"||parseInt(we,10)>=700||Je==="bold")&&(Ie="bold"),Je==="italic"&&(Ie+="italic"),Ie.length===0&&(Ie="normal");for(var Xe="",rt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},vt=0;vt<he.length;vt++){if(this.pdf.internal.getFont(he[vt],Ie,{noFallback:!0,disableWarning:!0})!==void 0){Xe=he[vt];break}if(Ie==="bolditalic"&&this.pdf.internal.getFont(he[vt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Xe=he[vt],Ie="bold";else if(this.pdf.internal.getFont(he[vt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Xe=he[vt],Ie="normal";break}}if(Xe===""){for(var et=0;et<he.length;et++)if(rt[he[et]]){Xe=rt[he[et]];break}}Xe=Xe===""?"Times":Xe,this.pdf.setFont(Xe,Ie)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Se){this.ctx.globalCompositeOperation=Se}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Se){this.ctx.globalAlpha=Se}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Se){this.ctx.lineDashOffset=Se,U.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Se){this.ctx.lineDash=Se,U.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Se){this.ctx.ignoreClearRect=!!Se}})};p.prototype.setLineDash=function(z){this.lineDash=z},p.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},p.prototype.fill=function(){E.call(this,"fill",!1)},p.prototype.stroke=function(){E.call(this,"stroke",!1)},p.prototype.beginPath=function(){this.path=[{type:"begin"}]},p.prototype.moveTo=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Y=this.ctx.transform.applyToPoint(new o(z,D));this.path.push({type:"mt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new o(z,D)},p.prototype.closePath=function(){var z=new o(0,0),D=0;for(D=this.path.length-1;D!==-1;D--)if(this.path[D].type==="begin"&&On(this.path[D+1])==="object"&&typeof this.path[D+1].x=="number"){z=new o(this.path[D+1].x,this.path[D+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(z.x,z.y)},p.prototype.lineTo=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Y=this.ctx.transform.applyToPoint(new o(z,D));this.path.push({type:"lt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new o(Y.x,Y.y)},p.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),E.call(this,null,!0)},p.prototype.quadraticCurveTo=function(z,D,Y,Q){if(isNaN(Y)||isNaN(Q)||isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var J=this.ctx.transform.applyToPoint(new o(Y,Q)),Z=this.ctx.transform.applyToPoint(new o(z,D));this.path.push({type:"qct",x1:Z.x,y1:Z.y,x:J.x,y:J.y}),this.ctx.lastPoint=new o(J.x,J.y)},p.prototype.bezierCurveTo=function(z,D,Y,Q,J,Z){if(isNaN(J)||isNaN(Z)||isNaN(z)||isNaN(D)||isNaN(Y)||isNaN(Q))throw Gn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ae=this.ctx.transform.applyToPoint(new o(J,Z)),se=this.ctx.transform.applyToPoint(new o(z,D)),ce=this.ctx.transform.applyToPoint(new o(Y,Q));this.path.push({type:"bct",x1:se.x,y1:se.y,x2:ce.x,y2:ce.y,x:ae.x,y:ae.y}),this.ctx.lastPoint=new o(ae.x,ae.y)},p.prototype.arc=function(z,D,Y,Q,J,Z){if(isNaN(z)||isNaN(D)||isNaN(Y)||isNaN(Q)||isNaN(J))throw Gn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Z=!!Z,!this.ctx.transform.isIdentity){var ae=this.ctx.transform.applyToPoint(new o(z,D));z=ae.x,D=ae.y;var se=this.ctx.transform.applyToPoint(new o(0,Y)),ce=this.ctx.transform.applyToPoint(new o(0,0));Y=Math.sqrt(Math.pow(se.x-ce.x,2)+Math.pow(se.y-ce.y,2))}Math.abs(J-Q)>=2*Math.PI&&(Q=0,J=2*Math.PI),this.path.push({type:"arc",x:z,y:D,radius:Y,startAngle:Q,endAngle:J,counterclockwise:Z})},p.prototype.arcTo=function(z,D,Y,Q,J){throw new Error("arcTo not implemented.")},p.prototype.rect=function(z,D,Y,Q){if(isNaN(z)||isNaN(D)||isNaN(Y)||isNaN(Q))throw Gn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(z,D),this.lineTo(z+Y,D),this.lineTo(z+Y,D+Q),this.lineTo(z,D+Q),this.lineTo(z,D),this.lineTo(z+Y,D),this.lineTo(z,D)},p.prototype.fillRect=function(z,D,Y,Q){if(isNaN(z)||isNaN(D)||isNaN(Y)||isNaN(Q))throw Gn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var J={};this.lineCap!=="butt"&&(J.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(J.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(z,D,Y,Q),this.fill(),J.hasOwnProperty("lineCap")&&(this.lineCap=J.lineCap),J.hasOwnProperty("lineJoin")&&(this.lineJoin=J.lineJoin)}},p.prototype.strokeRect=function(z,D,Y,Q){if(isNaN(z)||isNaN(D)||isNaN(Y)||isNaN(Q))throw Gn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");_.call(this)||(this.beginPath(),this.rect(z,D,Y,Q),this.stroke())},p.prototype.clearRect=function(z,D,Y,Q){if(isNaN(z)||isNaN(D)||isNaN(Y)||isNaN(Q))throw Gn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(z,D,Y,Q))},p.prototype.save=function(z){z=typeof z!="boolean"||z;for(var D=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("q");if(this.pdf.setPage(D),z){this.ctx.fontSize=this.pdf.internal.getFontSize();var Q=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Q}},p.prototype.restore=function(z){z=typeof z!="boolean"||z;for(var D=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("Q");this.pdf.setPage(D),z&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},p.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var y=function(z){var D,Y,Q,J;if(z.isCanvasGradient===!0&&(z=z.getColor()),!z)return{r:0,g:0,b:0,a:0,style:z};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(z))D=0,Y=0,Q=0,J=0;else{var Z=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(z);if(Z!==null)D=parseInt(Z[1]),Y=parseInt(Z[2]),Q=parseInt(Z[3]),J=1;else if((Z=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(z))!==null)D=parseInt(Z[1]),Y=parseInt(Z[2]),Q=parseInt(Z[3]),J=parseFloat(Z[4]);else{if(J=1,typeof z=="string"&&z.charAt(0)!=="#"){var ae=new S_(z);z=ae.ok?ae.toHex():"#000000"}z.length===4?(D=z.substring(1,2),D+=D,Y=z.substring(2,3),Y+=Y,Q=z.substring(3,4),Q+=Q):(D=z.substring(1,3),Y=z.substring(3,5),Q=z.substring(5,7)),D=parseInt(D,16),Y=parseInt(Y,16),Q=parseInt(Q,16)}}return{r:D,g:Y,b:Q,a:J,style:z}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},_=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};p.prototype.fillText=function(z,D,Y,Q){if(isNaN(D)||isNaN(Y)||typeof z!="string")throw Gn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Q=isNaN(Q)?void 0:Q,!f.call(this)){var J=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;C.call(this,{text:z,x:D,y:Y,scale:Z,angle:J,align:this.textAlign,maxWidth:Q})}},p.prototype.strokeText=function(z,D,Y,Q){if(isNaN(D)||isNaN(Y)||typeof z!="string")throw Gn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!_.call(this)){Q=isNaN(Q)?void 0:Q;var J=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;C.call(this,{text:z,x:D,y:Y,scale:Z,renderingMode:"stroke",angle:J,align:this.textAlign,maxWidth:Q})}},p.prototype.measureText=function(z){if(typeof z!="string")throw Gn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var D=this.pdf,Y=this.pdf.internal.scaleFactor,Q=D.internal.getFontSize(),J=D.getStringUnitWidth(z)*Q/D.internal.scaleFactor,Z=function(ae){var se=(ae=ae||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return se}}),this};return new Z({width:J*=Math.round(96*Y/72*1e4)/1e4})},p.prototype.scale=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Y=new c(z,0,0,D,0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},p.prototype.rotate=function(z){if(isNaN(z))throw Gn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var D=new c(Math.cos(z),Math.sin(z),-Math.sin(z),Math.cos(z),0,0);this.ctx.transform=this.ctx.transform.multiply(D)},p.prototype.translate=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Y=new c(1,0,0,1,z,D);this.ctx.transform=this.ctx.transform.multiply(Y)},p.prototype.transform=function(z,D,Y,Q,J,Z){if(isNaN(z)||isNaN(D)||isNaN(Y)||isNaN(Q)||isNaN(J)||isNaN(Z))throw Gn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ae=new c(z,D,Y,Q,J,Z);this.ctx.transform=this.ctx.transform.multiply(ae)},p.prototype.setTransform=function(z,D,Y,Q,J,Z){z=isNaN(z)?1:z,D=isNaN(D)?0:D,Y=isNaN(Y)?0:Y,Q=isNaN(Q)?1:Q,J=isNaN(J)?0:J,Z=isNaN(Z)?0:Z,this.ctx.transform=new c(z,D,Y,Q,J,Z)};var S=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};p.prototype.drawImage=function(z,D,Y,Q,J,Z,ae,se,ce){var de=this.pdf.getImageProperties(z),Oe=1,Le=1,ke=1,Se=1;Q!==void 0&&se!==void 0&&(ke=se/Q,Se=ce/J,Oe=de.width/Q*se/Q,Le=de.height/J*ce/J),Z===void 0&&(Z=D,ae=Y,D=0,Y=0),Q!==void 0&&se===void 0&&(se=Q,ce=J),Q===void 0&&se===void 0&&(se=de.width,ce=de.height);for(var ye,Je=this.ctx.transform.decompose(),we=$(Je.rotate.shx),me=new c,Ee=(me=(me=(me=me.multiply(Je.translate)).multiply(Je.skew)).multiply(Je.scale)).applyToRectangle(new s(Z-D*ke,ae-Y*Se,Q*Oe,J*Le)),Te=w.call(this,Ee),he=[],Re=0;Re<Te.length;Re+=1)he.indexOf(Te[Re])===-1&&he.push(Te[Re]);if(g(he),this.autoPaging)for(var Ie=he[0],Xe=he[he.length-1],rt=Ie;rt<Xe+1;rt++){this.pdf.setPage(rt);var vt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],et=rt===1?this.posY+this.margin[0]:this.margin[0],yt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],mt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ct=rt===1?0:yt+(rt-2)*mt;if(this.ctx.clip_path.length!==0){var Bt=this.path;ye=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(ye,this.posX+this.margin[3],-ct+et+this.ctx.prevPageLastElemOffset),b.call(this,"fill",!0),this.path=Bt}var Pt=JSON.parse(JSON.stringify(Ee));Pt=v([Pt],this.posX+this.margin[3],-ct+et+this.ctx.prevPageLastElemOffset)[0];var Yt=(rt>Ie||rt<Xe)&&S.call(this);Yt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],vt,mt,null).clip().discardPath()),this.pdf.addImage(z,"JPEG",Pt.x,Pt.y,Pt.w,Pt.h,null,null,we),Yt&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(z,"JPEG",Ee.x,Ee.y,Ee.w,Ee.h,null,null,we)};var w=function(z,D,Y){var Q=[];D=D||this.pdf.internal.pageSize.width,Y=Y||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var J=this.posY+this.ctx.prevPageLastElemOffset;switch(z.type){default:case"mt":case"lt":Q.push(Math.floor((z.y+J)/Y)+1);break;case"arc":Q.push(Math.floor((z.y+J-z.radius)/Y)+1),Q.push(Math.floor((z.y+J+z.radius)/Y)+1);break;case"qct":var Z=te(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x,z.y);Q.push(Math.floor((Z.y+J)/Y)+1),Q.push(Math.floor((Z.y+Z.h+J)/Y)+1);break;case"bct":var ae=W(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x2,z.y2,z.x,z.y);Q.push(Math.floor((ae.y+J)/Y)+1),Q.push(Math.floor((ae.y+ae.h+J)/Y)+1);break;case"rect":Q.push(Math.floor((z.y+J)/Y)+1),Q.push(Math.floor((z.y+z.h+J)/Y)+1)}for(var se=0;se<Q.length;se+=1)for(;this.pdf.internal.getNumberOfPages()<Q[se];)x.call(this);return Q},x=function(){var z=this.fillStyle,D=this.strokeStyle,Y=this.font,Q=this.lineCap,J=this.lineWidth,Z=this.lineJoin;this.pdf.addPage(),this.fillStyle=z,this.strokeStyle=D,this.font=Y,this.lineCap=Q,this.lineWidth=J,this.lineJoin=Z},v=function(z,D,Y){for(var Q=0;Q<z.length;Q++)switch(z[Q].type){case"bct":z[Q].x2+=D,z[Q].y2+=Y;case"qct":z[Q].x1+=D,z[Q].y1+=Y;case"mt":case"lt":case"arc":default:z[Q].x+=D,z[Q].y+=Y}return z},g=function(z){return z.sort(function(D,Y){return D-Y})},E=function(z,D){for(var Y,Q,J=this.fillStyle,Z=this.strokeStyle,ae=this.lineCap,se=this.lineWidth,ce=Math.abs(se*this.ctx.transform.scaleX),de=this.lineJoin,Oe=JSON.parse(JSON.stringify(this.path)),Le=JSON.parse(JSON.stringify(this.path)),ke=[],Se=0;Se<Le.length;Se++)if(Le[Se].x!==void 0)for(var ye=w.call(this,Le[Se]),Je=0;Je<ye.length;Je+=1)ke.indexOf(ye[Je])===-1&&ke.push(ye[Je]);for(var we=0;we<ke.length;we++)for(;this.pdf.internal.getNumberOfPages()<ke[we];)x.call(this);if(g(ke),this.autoPaging)for(var me=ke[0],Ee=ke[ke.length-1],Te=me;Te<Ee+1;Te++){this.pdf.setPage(Te),this.fillStyle=J,this.strokeStyle=Z,this.lineCap=ae,this.lineWidth=ce,this.lineJoin=de;var he=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Re=Te===1?this.posY+this.margin[0]:this.margin[0],Ie=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Xe=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],rt=Te===1?0:Ie+(Te-2)*Xe;if(this.ctx.clip_path.length!==0){var vt=this.path;Y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Y,this.posX+this.margin[3],-rt+Re+this.ctx.prevPageLastElemOffset),b.call(this,z,!0),this.path=vt}if(Q=JSON.parse(JSON.stringify(Oe)),this.path=v(Q,this.posX+this.margin[3],-rt+Re+this.ctx.prevPageLastElemOffset),D===!1||Te===0){var et=(Te>me||Te<Ee)&&S.call(this);et&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],he,Xe,null).clip().discardPath()),b.call(this,z,D),et&&this.pdf.restoreGraphicsState()}this.lineWidth=se}else this.lineWidth=ce,b.call(this,z,D),this.lineWidth=se;this.path=Oe},b=function(z,D){if((z!=="stroke"||D||!_.call(this))&&(z==="stroke"||D||!f.call(this))){for(var Y,Q,J=[],Z=this.path,ae=0;ae<Z.length;ae++){var se=Z[ae];switch(se.type){case"begin":J.push({begin:!0});break;case"close":J.push({close:!0});break;case"mt":J.push({start:se,deltas:[],abs:[]});break;case"lt":var ce=J.length;if(Z[ae-1]&&!isNaN(Z[ae-1].x)&&(Y=[se.x-Z[ae-1].x,se.y-Z[ae-1].y],ce>0)){for(;ce>=0;ce--)if(J[ce-1].close!==!0&&J[ce-1].begin!==!0){J[ce-1].deltas.push(Y),J[ce-1].abs.push(se);break}}break;case"bct":Y=[se.x1-Z[ae-1].x,se.y1-Z[ae-1].y,se.x2-Z[ae-1].x,se.y2-Z[ae-1].y,se.x-Z[ae-1].x,se.y-Z[ae-1].y],J[J.length-1].deltas.push(Y);break;case"qct":var de=Z[ae-1].x+2/3*(se.x1-Z[ae-1].x),Oe=Z[ae-1].y+2/3*(se.y1-Z[ae-1].y),Le=se.x+2/3*(se.x1-se.x),ke=se.y+2/3*(se.y1-se.y),Se=se.x,ye=se.y;Y=[de-Z[ae-1].x,Oe-Z[ae-1].y,Le-Z[ae-1].x,ke-Z[ae-1].y,Se-Z[ae-1].x,ye-Z[ae-1].y],J[J.length-1].deltas.push(Y);break;case"arc":J.push({deltas:[],abs:[],arc:!0}),Array.isArray(J[J.length-1].abs)&&J[J.length-1].abs.push(se)}}Q=D?null:z==="stroke"?"stroke":"fill";for(var Je=!1,we=0;we<J.length;we++)if(J[we].arc)for(var me=J[we].abs,Ee=0;Ee<me.length;Ee++){var Te=me[Ee];Te.type==="arc"?R.call(this,Te.x,Te.y,Te.radius,Te.startAngle,Te.endAngle,Te.counterclockwise,void 0,D,!Je):A.call(this,Te.x,Te.y),Je=!0}else if(J[we].close===!0)this.pdf.internal.out("h"),Je=!1;else if(J[we].begin!==!0){var he=J[we].start.x,Re=J[we].start.y;k.call(this,J[we].deltas,he,Re),Je=!0}Q&&F.call(this,Q),D&&j.call(this)}},M=function(z){var D=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Y=D*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return z-Y;case"top":return z+D-Y;case"hanging":return z+D-2*Y;case"middle":return z+D/2-Y;case"ideographic":return z;case"alphabetic":default:return z}},N=function(z){return z+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};p.prototype.createLinearGradient=function(){var z=function(){};return z.colorStops=[],z.addColorStop=function(D,Y){this.colorStops.push([D,Y])},z.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},z.isCanvasGradient=!0,z},p.prototype.createPattern=function(){return this.createLinearGradient()},p.prototype.createRadialGradient=function(){return this.createLinearGradient()};var R=function(z,D,Y,Q,J,Z,ae,se,ce){for(var de=V.call(this,Y,Q,J,Z),Oe=0;Oe<de.length;Oe++){var Le=de[Oe];Oe===0&&(ce?O.call(this,Le.x1+z,Le.y1+D):A.call(this,Le.x1+z,Le.y1+D)),T.call(this,z,D,Le.x2,Le.y2,Le.x3,Le.y3,Le.x4,Le.y4)}se?j.call(this):F.call(this,ae)},F=function(z){switch(z){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},j=function(){this.pdf.clip(),this.pdf.discardPath()},O=function(z,D){this.pdf.internal.out(t(z)+" "+n(D)+" m")},C=function(z){var D;switch(z.align){case"right":case"end":D="right";break;case"center":D="center";break;case"left":case"start":default:D="left"}var Y=this.pdf.getTextDimensions(z.text),Q=M.call(this,z.y),J=N.call(this,Q)-Y.h,Z=this.ctx.transform.applyToPoint(new o(z.x,Q)),ae=this.ctx.transform.decompose(),se=new c;se=(se=(se=se.multiply(ae.translate)).multiply(ae.skew)).multiply(ae.scale);for(var ce,de,Oe,Le=this.ctx.transform.applyToRectangle(new s(z.x,Q,Y.w,Y.h)),ke=se.applyToRectangle(new s(z.x,J,Y.w,Y.h)),Se=w.call(this,ke),ye=[],Je=0;Je<Se.length;Je+=1)ye.indexOf(Se[Je])===-1&&ye.push(Se[Je]);if(g(ye),this.autoPaging)for(var we=ye[0],me=ye[ye.length-1],Ee=we;Ee<me+1;Ee++){this.pdf.setPage(Ee);var Te=Ee===1?this.posY+this.margin[0]:this.margin[0],he=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Re=this.pdf.internal.pageSize.height-this.margin[2],Ie=Re-this.margin[0],Xe=this.pdf.internal.pageSize.width-this.margin[1],rt=Xe-this.margin[3],vt=Ee===1?0:he+(Ee-2)*Ie;if(this.ctx.clip_path.length!==0){var et=this.path;ce=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(ce,this.posX+this.margin[3],-1*vt+Te),b.call(this,"fill",!0),this.path=et}var yt=v([JSON.parse(JSON.stringify(ke))],this.posX+this.margin[3],-vt+Te+this.ctx.prevPageLastElemOffset)[0];z.scale>=.01&&(de=this.pdf.internal.getFontSize(),this.pdf.setFontSize(de*z.scale),Oe=this.lineWidth,this.lineWidth=Oe*z.scale);var mt=this.autoPaging!=="text";if(mt||yt.y+yt.h<=Re){if(mt||yt.y>=Te&&yt.x<=Xe){var ct=mt?z.text:this.pdf.splitTextToSize(z.text,z.maxWidth||Xe-yt.x)[0],Bt=v([JSON.parse(JSON.stringify(Le))],this.posX+this.margin[3],-vt+Te+this.ctx.prevPageLastElemOffset)[0],Pt=mt&&(Ee>we||Ee<me)&&S.call(this);Pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],rt,Ie,null).clip().discardPath()),this.pdf.text(ct,Bt.x,Bt.y,{angle:z.angle,align:D,renderingMode:z.renderingMode}),Pt&&this.pdf.restoreGraphicsState()}}else yt.y<Re&&(this.ctx.prevPageLastElemOffset+=Re-yt.y);z.scale>=.01&&(this.pdf.setFontSize(de),this.lineWidth=Oe)}else z.scale>=.01&&(de=this.pdf.internal.getFontSize(),this.pdf.setFontSize(de*z.scale),Oe=this.lineWidth,this.lineWidth=Oe*z.scale),this.pdf.text(z.text,Z.x+this.posX,Z.y+this.posY,{angle:z.angle,align:D,renderingMode:z.renderingMode,maxWidth:z.maxWidth}),z.scale>=.01&&(this.pdf.setFontSize(de),this.lineWidth=Oe)},A=function(z,D,Y,Q){Y=Y||0,Q=Q||0,this.pdf.internal.out(t(z+Y)+" "+n(D+Q)+" l")},k=function(z,D,Y){return this.pdf.lines(z,D,Y,null,null)},T=function(z,D,Y,Q,J,Z,ae,se){this.pdf.internal.out([r(a(Y+z)),r(i(Q+D)),r(a(J+z)),r(i(Z+D)),r(a(ae+z)),r(i(se+D)),"c"].join(" "))},V=function(z,D,Y,Q){for(var J=2*Math.PI,Z=Math.PI/2;D>Y;)D-=J;var ae=Math.abs(Y-D);ae<J&&Q&&(ae=J-ae);for(var se=[],ce=Q?-1:1,de=D;ae>1e-5;){var Oe=de+ce*Math.min(ae,Z);se.push(G.call(this,z,de,Oe)),ae-=Math.abs(Oe-de),de=Oe}return se},G=function(z,D,Y){var Q=(Y-D)/2,J=z*Math.cos(Q),Z=z*Math.sin(Q),ae=J,se=-Z,ce=ae*ae+se*se,de=ce+ae*J+se*Z,Oe=4/3*(Math.sqrt(2*ce*de)-de)/(ae*Z-se*J),Le=ae-Oe*se,ke=se+Oe*ae,Se=Le,ye=-ke,Je=Q+D,we=Math.cos(Je),me=Math.sin(Je);return{x1:z*Math.cos(D),y1:z*Math.sin(D),x2:Le*we-ke*me,y2:Le*me+ke*we,x3:Se*we-ye*me,y3:Se*me+ye*we,x4:z*Math.cos(Y),y4:z*Math.sin(Y)}},$=function(z){return 180*z/Math.PI},te=function(z,D,Y,Q,J,Z){var ae=z+.5*(Y-z),se=D+.5*(Q-D),ce=J+.5*(Y-J),de=Z+.5*(Q-Z),Oe=Math.min(z,J,ae,ce),Le=Math.max(z,J,ae,ce),ke=Math.min(D,Z,se,de),Se=Math.max(D,Z,se,de);return new s(Oe,ke,Le-Oe,Se-ke)},W=function(z,D,Y,Q,J,Z,ae,se){var ce,de,Oe,Le,ke,Se,ye,Je,we,me,Ee,Te,he,Re,Ie=Y-z,Xe=Q-D,rt=J-Y,vt=Z-Q,et=ae-J,yt=se-Z;for(de=0;de<41;de++)we=(ye=(Oe=z+(ce=de/40)*Ie)+ce*((ke=Y+ce*rt)-Oe))+ce*(ke+ce*(J+ce*et-ke)-ye),me=(Je=(Le=D+ce*Xe)+ce*((Se=Q+ce*vt)-Le))+ce*(Se+ce*(Z+ce*yt-Se)-Je),de==0?(Ee=we,Te=me,he=we,Re=me):(Ee=Math.min(Ee,we),Te=Math.min(Te,me),he=Math.max(he,we),Re=Math.max(Re,me));return new s(Math.round(Ee),Math.round(Te),Math.round(he-Ee),Math.round(Re-Te))},U=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var z,D,Y=(z=this.ctx.lineDash,D=this.ctx.lineDashOffset,JSON.stringify({lineDash:z,lineDashOffset:D}));this.prevLineDash!==Y&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Y)}}})(hr.API),function(e){var r=function(i){var o,s,c,u,d,p,y,f,_,S;for(s=[],c=0,u=(i+=o="\0\0\0\0".slice(i.length%4||4)).length;u>c;c+=4)(d=(i.charCodeAt(c)<<24)+(i.charCodeAt(c+1)<<16)+(i.charCodeAt(c+2)<<8)+i.charCodeAt(c+3))!==0?(p=(d=((d=((d=((d=(d-(S=d%85))/85)-(_=d%85))/85)-(f=d%85))/85)-(y=d%85))/85)%85,s.push(p+33,y+33,f+33,_+33,S+33)):s.push(122);return function(w,x){for(var v=x;v>0;v--)w.pop()}(s,o.length),String.fromCharCode.apply(String,s)+"~>"},t=function(i){var o,s,c,u,d,p=String,y="length",f=255,_="charCodeAt",S="slice",w="replace";for(i[S](-2),i=i[S](0,-2)[w](/\s/g,"")[w]("z","!!!!!"),c=[],u=0,d=(i+=o="uuuuu"[S](i[y]%5||5))[y];d>u;u+=5)s=52200625*(i[_](u)-33)+614125*(i[_](u+1)-33)+7225*(i[_](u+2)-33)+85*(i[_](u+3)-33)+(i[_](u+4)-33),c.push(f&s>>24,f&s>>16,f&s>>8,f&s);return function(x,v){for(var g=v;g>0;g--)x.pop()}(c,o[y]),p.fromCharCode.apply(p,c)},n=function(i){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((i=i.replace(/\s/g,"")).indexOf(">")!==-1&&(i=i.substr(0,i.indexOf(">"))),i.length%2&&(i+="0"),o.test(i)===!1)return"";for(var s="",c=0;c<i.length;c+=2)s+=String.fromCharCode("0x"+(i[c]+i[c+1]));return s},a=function(i){for(var o=new Uint8Array(i.length),s=i.length;s--;)o[s]=i.charCodeAt(s);return i=(o=T2(o)).reduce(function(c,u){return c+String.fromCharCode(u)},"")};e.processDataByFilters=function(i,o){var s=0,c=i||"",u=[];for(typeof(o=o||[])=="string"&&(o=[o]),s=0;s<o.length;s+=1)switch(o[s]){case"ASCII85Decode":case"/ASCII85Decode":c=t(c),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":c=r(c),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":c=n(c),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":c=c.split("").map(function(d){return("0"+d.charCodeAt().toString(16)).slice(-2)}).join("")+">",u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":c=a(c),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[s]+'" is not implemented')}return{data:c,reverseChain:u.reverse().join(" ")}}}(hr.API),function(e){e.loadFile=function(r,t,n){return function(a,i,o){i=i!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=function(c,u,d){var p=new XMLHttpRequest,y=0,f=function(_){var S=_.length,w=[],x=String.fromCharCode;for(y=0;y<S;y+=1)w.push(x(255&_.charCodeAt(y)));return w.join("")};if(p.open("GET",c,!u),p.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(p.onload=function(){p.status===200?d(f(this.responseText)):d(void 0)}),p.send(null),u&&p.status===200)return f(p.responseText)}(a,i,o)}catch{}return s}(r,t,n)},e.loadImageFile=e.loadFile}(hr.API),function(e){function r(){return(pr.html2canvas?Promise.resolve(pr.html2canvas):A2(()=>import("./html2canvas.esm-CBrSDip1.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function t(){return(pr.DOMPurify?Promise.resolve(pr.DOMPurify):A2(()=>import("./purify.es-CQJ0hv7W.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var n=function(o){var s=On(o);return s==="undefined"?"undefined":s==="string"||o instanceof String?"string":s==="number"||o instanceof Number?"number":s==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":s==="object"?"object":"unknown"},a=function(o,s){var c=document.createElement(o);for(var u in s.className&&(c.className=s.className),s.innerHTML&&s.dompurify&&(c.innerHTML=s.dompurify.sanitize(s.innerHTML)),s.style)c.style[u]=s.style[u];return c},i=function o(s){var c=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),u=o.convert(Promise.resolve(),c);return u=(u=u.setProgress(1,o,1,[o])).set(s)};(i.prototype=Object.create(Promise.prototype)).constructor=i,i.convert=function(o,s){return o.__proto__=s||i.prototype,o},i.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},i.prototype.from=function(o,s){return this.then(function(){switch(s=s||function(c){switch(n(c)){case"string":return"string";case"element":return c.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o)){case"string":return this.then(t).then(function(c){return this.set({src:a("div",{innerHTML:o,dompurify:c})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},i.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},i.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},s=function c(u,d){for(var p=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),y=u.firstChild;y;y=y.nextSibling)d!==!0&&y.nodeType===1&&y.nodeName==="SCRIPT"||p.appendChild(c(y,d));return u.nodeType===1&&(u.nodeName==="CANVAS"?(p.width=u.width,p.height=u.height,p.getContext("2d").drawImage(u,0,0)):u.nodeName!=="TEXTAREA"&&u.nodeName!=="SELECT"||(p.value=u.value),p.addEventListener("load",function(){p.scrollTop=u.scrollTop,p.scrollLeft=u.scrollLeft},!0)),p}(this.prop.src,this.opt.html2canvas.javascriptEnabled);s.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(s),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},i.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(r).then(function(s){var c=Object.assign({},this.opt.html2canvas);return delete c.onrendered,s(this.prop.container,c)}).then(function(s){(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},i.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(r).then(function(s){var c=this.opt.jsPDF,u=this.opt.fontFaces,d=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,p=Object.assign({async:!0,allowTaint:!0,scale:d,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete p.onrendered,c.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,c.context2d.posX=this.opt.x,c.context2d.posY=this.opt.y,c.context2d.margin=this.opt.margin,c.context2d.fontFaces=u,u)for(var y=0;y<u.length;++y){var f=u[y],_=f.src.find(function(S){return S.format==="truetype"});_&&c.addFont(_.url,f.ref.name,f.ref.style)}return p.windowHeight=p.windowHeight||0,p.windowHeight=p.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):p.windowHeight,c.context2d.save(!0),s(this.prop.container,p)}).then(function(s){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},i.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},i.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},i.prototype.output=function(o,s,c){return(c=c||"pdf").toLowerCase()==="img"||c.toLowerCase()==="image"?this.outputImg(o,s):this.outputPdf(o,s)},i.prototype.outputPdf=function(o,s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,s)})},i.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},i.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},i.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},i.prototype.set=function(o){if(n(o)!=="object")return this;var s=Object.keys(o||{}).map(function(c){if(c in i.template.prop)return function(){this.prop[c]=o[c]};switch(c){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[c]=o[c]}}},this);return this.then(function(){return this.thenList(s)})},i.prototype.get=function(o,s){return this.then(function(){var c=o in i.template.prop?this.prop[o]:this.opt[o];return s?s(c):c})},i.prototype.setMargin=function(o){return this.then(function(){switch(n(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},i.prototype.setPageSize=function(o){function s(c,u){return Math.floor(c*u/72*96)}return this.then(function(){(o=o||hr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:s(o.inner.width,o.k),height:s(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},i.prototype.setProgress=function(o,s,c,u){return o!=null&&(this.progress.val=o),s!=null&&(this.progress.state=s),c!=null&&(this.progress.n=c),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},i.prototype.updateProgress=function(o,s,c,u){return this.setProgress(o?this.progress.val+o:null,s||null,c?this.progress.n+c:null,u?this.progress.stack.concat(u):null)},i.prototype.then=function(o,s){var c=this;return this.thenCore(o,s,function(u,d){return c.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(p){return c.updateProgress(null,u),p}).then(u,d).then(function(p){return c.updateProgress(1),p})})},i.prototype.thenCore=function(o,s,c){c=c||Promise.prototype.then,o&&(o=o.bind(this)),s&&(s=s.bind(this));var u=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:i.convert(Object.assign({},this),Promise.prototype),d=c.call(u,o,s);return i.convert(d,this.__proto__)},i.prototype.thenExternal=function(o,s){return Promise.prototype.then.call(this,o,s)},i.prototype.thenList=function(o){var s=this;return o.forEach(function(c){s=s.thenCore(c)}),s},i.prototype.catch=function(o){o&&(o=o.bind(this));var s=Promise.prototype.catch.call(this,o);return i.convert(s,this)},i.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},i.prototype.error=function(o){return this.then(function(){throw new Error(o)})},i.prototype.using=i.prototype.set,i.prototype.saveAs=i.prototype.save,i.prototype.export=i.prototype.output,i.prototype.run=i.prototype.then,hr.getPageSize=function(o,s,c){if(On(o)==="object"){var u=o;o=u.orientation,s=u.unit||s,c=u.format||c}s=s||"mm",c=c||"a4",o=(""+(o||"P")).toLowerCase();var d,p=(""+c).toLowerCase(),y={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(s){case"pt":d=1;break;case"mm":d=72/25.4;break;case"cm":d=72/2.54;break;case"in":d=72;break;case"px":d=.75;break;case"pc":case"em":d=12;break;case"ex":d=6;break;default:throw"Invalid unit: "+s}var f,_=0,S=0;if(y.hasOwnProperty(p))_=y[p][1]/d,S=y[p][0]/d;else try{_=c[1],S=c[0]}catch{throw new Error("Invalid format: "+c)}if(o==="p"||o==="portrait")o="p",S>_&&(f=S,S=_,_=f);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",_>S&&(f=S,S=_,_=f)}return{width:S,height:_,unit:s,k:d,orientation:o}},e.html=function(o,s){(s=s||{}).callback=s.callback||function(){},s.html2canvas=s.html2canvas||{},s.html2canvas.canvas=s.html2canvas.canvas||this.canvas,s.jsPDF=s.jsPDF||this,s.fontFaces=s.fontFaces?s.fontFaces.map(D2):null;var c=new i(s);return s.worker?c:c.from(o).doCallback()}}(hr.API),hr.API.addJS=function(e){return sw=e,this.internal.events.subscribe("postPutResources",function(){d1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(d1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),ow=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+sw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){d1!==void 0&&ow!==void 0&&this.internal.out("/Names <</JavaScript "+d1+" 0 R>>")}),this},function(e){var r;e.events.push(["postPutResources",function(){var t=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=t.outline.render().split(/\r\n/),i=0;i<a.length;i++){var o=a[i],s=n.exec(o);if(s!=null){var c=s[1];t.internal.newObjectDeferredBegin(c,!1)}t.internal.write(o)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,d=[];for(i=0;i<u;i++){var p=t.internal.newObject();d.push(p);var y=t.internal.getPageInfo(i+1);t.internal.write("<< /D["+y.objId+" 0 R /XYZ null null null]>> endobj")}var f=t.internal.newObject();for(t.internal.write("<< /Names [ "),i=0;i<d.length;i++)t.internal.write("(page_"+(i+1)+")"+d[i]+" 0 R");t.internal.write(" ] >>","endobj"),r=t.internal.newObject(),t.internal.write("<< /Dests "+f+" 0 R"),t.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+r+" 0 R"))}]),e.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(n,a,i){var o={title:a,options:i,children:[]};return n==null&&(n=this.root),n.children.push(o),o},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(n){n.id=t.internal.newObjectDeferred();for(var a=0;a<n.children.length;a++)this.genIds_r(n.children[a])},t.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},t.outline.renderItems=function(n){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<n.children.length;i++){var o=n.children[i];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(n)),i>0&&this.line("/Prev "+this.makeRef(n.children[i-1])),i<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[i+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var c=t.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var u=0;u<n.children.length;u++)this.renderItems(n.children[u])},t.outline.line=function(n){this.ctx.val+=n+`\r
|
|
496
|
+
`},t.outline.makeRef=function(n){return n.id+" 0 R"},t.outline.makeString=function(n){return"("+t.internal.pdfEscape(n)+")"},t.outline.objStart=function(n){this.ctx.val+=`\r
|
|
497
|
+
`+n.id+` 0 obj\r
|
|
498
|
+
<<\r
|
|
499
|
+
`},t.outline.objEnd=function(){this.ctx.val+=`>> \r
|
|
500
|
+
endobj\r
|
|
501
|
+
`},t.outline.count_r=function(n,a){for(var i=0;i<a.children.length;i++)n.count++,this.count_r(n,a.children[i]);return n.count}}])}(hr.API),function(e){var r=[192,193,194,195,196,197,198,199];e.processJPEG=function(t,n,a,i,o,s){var c,u=this.decode.DCT_DECODE,d=null;if(typeof t=="string"||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=o||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(c=function(p){for(var y,f=256*p.charCodeAt(4)+p.charCodeAt(5),_=p.length,S={width:0,height:0,numcomponents:1},w=4;w<_;w+=2){if(w+=f,r.indexOf(p.charCodeAt(w+1))!==-1){y=256*p.charCodeAt(w+5)+p.charCodeAt(w+6),S={width:256*p.charCodeAt(w+7)+p.charCodeAt(w+8),height:y,numcomponents:p.charCodeAt(w+9)};break}f=256*p.charCodeAt(w+2)+p.charCodeAt(w+3)}return S}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}d={data:t,width:c.width,height:c.height,colorSpace:s,bitsPerComponent:8,filter:u,index:n,alias:a}}return d}}(hr.API);var ah,p1,lw,uw,cw,nL=function(){var e,r,t;function n(i){var o,s,c,u,d,p,y,f,_,S,w,x,v,g;for(this.data=i,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},p=null;;){switch(o=this.readUInt32(),_=(function(){var E,b;for(b=[],E=0;E<4;++E)b.push(String.fromCharCode(this.data[this.pos++]));return b}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(o);break;case"fcTL":p&&this.animation.frames.push(p),this.pos+=4,p={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},d=this.readUInt16(),u=this.readUInt16()||100,p.delay=1e3*d/u,p.disposeOp=this.data[this.pos++],p.blendOp=this.data[this.pos++],p.data=[];break;case"IDAT":case"fdAT":for(_==="fdAT"&&(this.pos+=4,o-=4),i=(p!=null?p.data:void 0)||this.imgData,x=0;0<=o?x<o:x>o;0<=o?++x:--x)i.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(c=this.palette.length/3,this.transparency.indexed=this.read(o),this.transparency.indexed.length>c)throw new Error("More transparent colors than palette size");if((S=c-this.transparency.indexed.length)>0)for(v=0;0<=S?v<S:v>S;0<=S?++v:--v)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(o)[0];break;case 2:this.transparency.rgb=this.read(o)}break;case"tEXt":y=(w=this.read(o)).indexOf(0),f=String.fromCharCode.apply(String,w.slice(0,y)),this.text[f]=String.fromCharCode.apply(String,w.slice(y+1));break;case"IEND":return p&&this.animation.frames.push(p),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,s=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*s,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=o}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}n.prototype.read=function(i){var o,s;for(s=[],o=0;0<=i?o<i:o>i;0<=i?++o:--o)s.push(this.data[this.pos++]);return s},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(i){var o=this.pixelBitlength/8,s=new Uint8Array(this.width*this.height*o),c=0,u=this;if(i==null&&(i=this.imgData),i.length===0)return new Uint8Array(0);function d(p,y,f,_){var S,w,x,v,g,E,b,M,N,R,F,j,O,C,A,k,T,V,G,$,te,W=Math.ceil((u.width-p)/f),U=Math.ceil((u.height-y)/_),z=u.width==W&&u.height==U;for(C=o*W,j=z?s:new Uint8Array(C*U),E=i.length,O=0,w=0;O<U&&c<E;){switch(i[c++]){case 0:for(v=T=0;T<C;v=T+=1)j[w++]=i[c++];break;case 1:for(v=V=0;V<C;v=V+=1)S=i[c++],g=v<o?0:j[w-o],j[w++]=(S+g)%256;break;case 2:for(v=G=0;G<C;v=G+=1)S=i[c++],x=(v-v%o)/o,A=O&&j[(O-1)*C+x*o+v%o],j[w++]=(A+S)%256;break;case 3:for(v=$=0;$<C;v=$+=1)S=i[c++],x=(v-v%o)/o,g=v<o?0:j[w-o],A=O&&j[(O-1)*C+x*o+v%o],j[w++]=(S+Math.floor((g+A)/2))%256;break;case 4:for(v=te=0;te<C;v=te+=1)S=i[c++],x=(v-v%o)/o,g=v<o?0:j[w-o],O===0?A=k=0:(A=j[(O-1)*C+x*o+v%o],k=x&&j[(O-1)*C+(x-1)*o+v%o]),b=g+A-k,M=Math.abs(b-g),R=Math.abs(b-A),F=Math.abs(b-k),N=M<=R&&M<=F?g:R<=F?A:k,j[w++]=(S+N)%256;break;default:throw new Error("Invalid filter algorithm: "+i[c-1])}if(!z){var D=((y+O*_)*u.width+p)*o,Y=O*C;for(v=0;v<W;v+=1){for(var Q=0;Q<o;Q+=1)s[D++]=j[Y++];D+=(f-1)*o}}O++}}return i=Ik(i),u.interlaceMethod==1?(d(0,0,8,8),d(4,0,8,8),d(0,4,4,8),d(2,0,4,4),d(0,2,2,4),d(1,0,2,2),d(0,1,1,2)):d(0,0,1,1),s},n.prototype.decodePalette=function(){var i,o,s,c,u,d,p,y,f;for(s=this.palette,d=this.transparency.indexed||[],u=new Uint8Array((d.length||0)+s.length),c=0,i=0,o=p=0,y=s.length;p<y;o=p+=3)u[c++]=s[o],u[c++]=s[o+1],u[c++]=s[o+2],u[c++]=(f=d[i++])!=null?f:255;return u},n.prototype.copyToImageData=function(i,o){var s,c,u,d,p,y,f,_,S,w,x;if(c=this.colors,S=null,s=this.hasAlphaChannel,this.palette.length&&(S=(x=this._decodedPalette)!=null?x:this._decodedPalette=this.decodePalette(),c=4,s=!0),_=(u=i.data||i).length,p=S||o,d=y=0,c===1)for(;d<_;)f=S?4*o[d/4]:y,w=p[f++],u[d++]=w,u[d++]=w,u[d++]=w,u[d++]=s?p[f++]:255,y=f;else for(;d<_;)f=S?4*o[d/4]:y,u[d++]=p[f++],u[d++]=p[f++],u[d++]=p[f++],u[d++]=s?p[f++]:255,y=f},n.prototype.decode=function(){var i;return i=new Uint8Array(this.width*this.height*4),this.copyToImageData(i,this.decodePixels()),i};var a=function(){if(Object.prototype.toString.call(pr)==="[object Window]"){try{r=pr.document.createElement("canvas"),t=r.getContext("2d")}catch{return!1}return!0}return!1};return a(),e=function(i){var o;if(a()===!0)return t.width=i.width,t.height=i.height,t.clearRect(0,0,i.width,i.height),t.putImageData(i,0,0),(o=new Image).src=r.toDataURL(),o;throw new Error("This method requires a Browser with Canvas-capability.")},n.prototype.decodeFrames=function(i){var o,s,c,u,d,p,y,f;if(this.animation){for(f=[],s=d=0,p=(y=this.animation.frames).length;d<p;s=++d)o=y[s],c=i.createImageData(o.width,o.height),u=this.decodePixels(new Uint8Array(o.data)),this.copyToImageData(c,u),o.imageData=c,f.push(o.image=e(c));return f}},n.prototype.renderFrame=function(i,o){var s,c,u;return s=(c=this.animation.frames)[o],u=c[o-1],o===0&&i.clearRect(0,0,this.width,this.height),(u!=null?u.disposeOp:void 0)===1?i.clearRect(u.xOffset,u.yOffset,u.width,u.height):(u!=null?u.disposeOp:void 0)===2&&i.putImageData(u.imageData,u.xOffset,u.yOffset),s.blendOp===0&&i.clearRect(s.xOffset,s.yOffset,s.width,s.height),i.drawImage(s.image,s.xOffset,s.yOffset)},n.prototype.animate=function(i){var o,s,c,u,d,p,y=this;return s=0,p=this.animation,u=p.numFrames,c=p.frames,d=p.numPlays,(o=function(){var f,_;if(f=s++%u,_=c[f],y.renderFrame(i,f),u>1&&s/u<d)return y.animation._timeout=setTimeout(o,_.delay)})()},n.prototype.stopAnimation=function(){var i;return clearTimeout((i=this.animation)!=null?i._timeout:void 0)},n.prototype.render=function(i){var o,s;return i._png&&i._png.stopAnimation(),i._png=this,i.width=this.width,i.height=this.height,o=i.getContext("2d"),this.animation?(this.decodeFrames(o),this.animate(o)):(s=o.createImageData(this.width,this.height),this.copyToImageData(s,this.decodePixels()),o.putImageData(s,0,0))},n}();/**
|
|
502
|
+
* @license
|
|
503
|
+
*
|
|
504
|
+
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
|
|
505
|
+
*
|
|
506
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
507
|
+
* a copy of this software and associated documentation files (the
|
|
508
|
+
* "Software"), to deal in the Software without restriction, including
|
|
509
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
510
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
511
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
512
|
+
* the following conditions:
|
|
513
|
+
*
|
|
514
|
+
* The above copyright notice and this permission notice shall be
|
|
515
|
+
* included in all copies or substantial portions of the Software.
|
|
516
|
+
*
|
|
517
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
518
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
519
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
520
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
521
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
522
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
523
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
524
|
+
* ====================================================================
|
|
525
|
+
*//**
|
|
526
|
+
* @license
|
|
527
|
+
* (c) Dean McNamee <dean@gmail.com>, 2013.
|
|
528
|
+
*
|
|
529
|
+
* https://github.com/deanm/omggif
|
|
530
|
+
*
|
|
531
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
532
|
+
* of this software and associated documentation files (the "Software"), to
|
|
533
|
+
* deal in the Software without restriction, including without limitation the
|
|
534
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
535
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
536
|
+
* furnished to do so, subject to the following conditions:
|
|
537
|
+
*
|
|
538
|
+
* The above copyright notice and this permission notice shall be included in
|
|
539
|
+
* all copies or substantial portions of the Software.
|
|
540
|
+
*
|
|
541
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
542
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
543
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
544
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
545
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
546
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
547
|
+
* IN THE SOFTWARE.
|
|
548
|
+
*
|
|
549
|
+
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
|
|
550
|
+
* including animation and compression. It does not rely on any specific
|
|
551
|
+
* underlying system, so should run in the browser, Node, or Plask.
|
|
552
|
+
*/function iL(e){var r=0;if(e[r++]!==71||e[r++]!==73||e[r++]!==70||e[r++]!==56||(e[r++]+1&253)!=56||e[r++]!==97)throw new Error("Invalid GIF 87a/89a header.");var t=e[r++]|e[r++]<<8,n=e[r++]|e[r++]<<8,a=e[r++],i=a>>7,o=1<<(7&a)+1;e[r++],e[r++];var s=null,c=null;i&&(s=r,c=o,r+=3*o);var u=!0,d=[],p=0,y=null,f=0,_=null;for(this.width=t,this.height=n;u&&r<e.length;)switch(e[r++]){case 33:switch(e[r++]){case 255:if(e[r]!==11||e[r+1]==78&&e[r+2]==69&&e[r+3]==84&&e[r+4]==83&&e[r+5]==67&&e[r+6]==65&&e[r+7]==80&&e[r+8]==69&&e[r+9]==50&&e[r+10]==46&&e[r+11]==48&&e[r+12]==3&&e[r+13]==1&&e[r+16]==0)r+=14,_=e[r++]|e[r++]<<8,r++;else for(r+=12;;){if(!((O=e[r++])>=0))throw Error("Invalid block size");if(O===0)break;r+=O}break;case 249:if(e[r++]!==4||e[r+4]!==0)throw new Error("Invalid graphics extension block.");var S=e[r++];p=e[r++]|e[r++]<<8,y=e[r++],(1&S)==0&&(y=null),f=S>>2&7,r++;break;case 254:for(;;){if(!((O=e[r++])>=0))throw Error("Invalid block size");if(O===0)break;r+=O}break;default:throw new Error("Unknown graphic control label: 0x"+e[r-1].toString(16))}break;case 44:var w=e[r++]|e[r++]<<8,x=e[r++]|e[r++]<<8,v=e[r++]|e[r++]<<8,g=e[r++]|e[r++]<<8,E=e[r++],b=E>>6&1,M=1<<(7&E)+1,N=s,R=c,F=!1;E>>7&&(F=!0,N=r,R=M,r+=3*M);var j=r;for(r++;;){var O;if(!((O=e[r++])>=0))throw Error("Invalid block size");if(O===0)break;r+=O}d.push({x:w,y:x,width:v,height:g,has_local_palette:F,palette_offset:N,palette_size:R,data_offset:j,data_length:r-j,transparent_index:y,interlaced:!!b,delay:p,disposal:f});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+e[r-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return _},this.frameInfo=function(C){if(C<0||C>=d.length)throw new Error("Frame index out of range.");return d[C]},this.decodeAndBlitFrameBGRA=function(C,A){var k=this.frameInfo(C),T=k.width*k.height,V=new Uint8Array(T);fw(e,k.data_offset,V,T);var G=k.palette_offset,$=k.transparent_index;$===null&&($=256);var te=k.width,W=t-te,U=te,z=4*(k.y*t+k.x),D=4*((k.y+k.height)*t+k.x),Y=z,Q=4*W;k.interlaced===!0&&(Q+=4*t*7);for(var J=8,Z=0,ae=V.length;Z<ae;++Z){var se=V[Z];if(U===0&&(U=te,(Y+=Q)>=D&&(Q=4*W+4*t*(J-1),Y=z+(te+W)*(J<<1),J>>=1)),se===$)Y+=4;else{var ce=e[G+3*se],de=e[G+3*se+1],Oe=e[G+3*se+2];A[Y++]=Oe,A[Y++]=de,A[Y++]=ce,A[Y++]=255}--U}},this.decodeAndBlitFrameRGBA=function(C,A){var k=this.frameInfo(C),T=k.width*k.height,V=new Uint8Array(T);fw(e,k.data_offset,V,T);var G=k.palette_offset,$=k.transparent_index;$===null&&($=256);var te=k.width,W=t-te,U=te,z=4*(k.y*t+k.x),D=4*((k.y+k.height)*t+k.x),Y=z,Q=4*W;k.interlaced===!0&&(Q+=4*t*7);for(var J=8,Z=0,ae=V.length;Z<ae;++Z){var se=V[Z];if(U===0&&(U=te,(Y+=Q)>=D&&(Q=4*W+4*t*(J-1),Y=z+(te+W)*(J<<1),J>>=1)),se===$)Y+=4;else{var ce=e[G+3*se],de=e[G+3*se+1],Oe=e[G+3*se+2];A[Y++]=ce,A[Y++]=de,A[Y++]=Oe,A[Y++]=255}--U}}}function fw(e,r,t,n){for(var a=e[r++],i=1<<a,o=i+1,s=o+1,c=a+1,u=(1<<c)-1,d=0,p=0,y=0,f=e[r++],_=new Int32Array(4096),S=null;;){for(;d<16&&f!==0;)p|=e[r++]<<d,d+=8,f===1?f=e[r++]:--f;if(d<c)break;var w=p&u;if(p>>=c,d-=c,w!==i){if(w===o)break;for(var x=w<s?w:S,v=0,g=x;g>i;)g=_[g]>>8,++v;var E=g;if(y+v+(x!==w?1:0)>n)return void Gn.log("Warning, gif stream longer than expected.");t[y++]=E;var b=y+=v;for(x!==w&&(t[y++]=E),g=x;v--;)g=_[g],t[--b]=255&g,g>>=8;S!==null&&s<4096&&(_[s++]=S<<8|E,s>=u+1&&c<12&&(++c,u=u<<1|1)),S=w}else s=o+1,u=(1<<(c=a+1))-1,S=null}return y!==n&&Gn.log("Warning, gif stream shorter than expected."),t}/**
|
|
553
|
+
* @license
|
|
554
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
|
555
|
+
All rights reserved.
|
|
556
|
+
|
|
557
|
+
Redistribution and use in source and binary forms, with or without
|
|
558
|
+
modification, are permitted provided that the following conditions are
|
|
559
|
+
met:
|
|
560
|
+
|
|
561
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
562
|
+
this list of conditions and the following disclaimer.
|
|
563
|
+
|
|
564
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
565
|
+
notice, this list of conditions and the following disclaimer in the
|
|
566
|
+
documentation and/or other materials provided with the distribution.
|
|
567
|
+
|
|
568
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
|
569
|
+
contributors may be used to endorse or promote products derived from
|
|
570
|
+
this software without specific prior written permission.
|
|
571
|
+
|
|
572
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
573
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
574
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
575
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
576
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
577
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
578
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
579
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
580
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
581
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
582
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
583
|
+
*/function f2(e){var r,t,n,a,i,o=Math.floor,s=new Array(64),c=new Array(64),u=new Array(64),d=new Array(64),p=new Array(65535),y=new Array(65535),f=new Array(64),_=new Array(64),S=[],w=0,x=7,v=new Array(64),g=new Array(64),E=new Array(64),b=new Array(256),M=new Array(2048),N=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],R=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],j=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],O=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],C=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],A=[0,1,2,3,4,5,6,7,8,9,10,11],k=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],T=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function V(z,D){for(var Y=0,Q=0,J=new Array,Z=1;Z<=16;Z++){for(var ae=1;ae<=z[Z];ae++)J[D[Q]]=[],J[D[Q]][0]=Y,J[D[Q]][1]=Z,Q++,Y++;Y*=2}return J}function G(z){for(var D=z[0],Y=z[1]-1;Y>=0;)D&1<<Y&&(w|=1<<x),Y--,--x<0&&(w==255?($(255),$(0)):$(w),x=7,w=0)}function $(z){S.push(z)}function te(z){$(z>>8&255),$(255&z)}function W(z,D,Y,Q,J){for(var Z,ae=J[0],se=J[240],ce=function(me,Ee){var Te,he,Re,Ie,Xe,rt,vt,et,yt,mt,ct=0;for(yt=0;yt<8;++yt){Te=me[ct],he=me[ct+1],Re=me[ct+2],Ie=me[ct+3],Xe=me[ct+4],rt=me[ct+5],vt=me[ct+6];var Bt=Te+(et=me[ct+7]),Pt=Te-et,Yt=he+vt,Gt=he-vt,Be=Re+rt,Ce=Re-rt,ft=Ie+Xe,Ct=Ie-Xe,Ot=Bt+ft,Nt=Bt-ft,Jt=Yt+Be,Xt=Yt-Be;me[ct]=Ot+Jt,me[ct+4]=Ot-Jt;var kt=.707106781*(Xt+Nt);me[ct+2]=Nt+kt,me[ct+6]=Nt-kt;var nt=.382683433*((Ot=Ct+Ce)-(Xt=Gt+Pt)),We=.5411961*Ot+nt,it=1.306562965*Xt+nt,He=.707106781*(Jt=Ce+Gt),wt=Pt+He,ze=Pt-He;me[ct+5]=ze+We,me[ct+3]=ze-We,me[ct+1]=wt+it,me[ct+7]=wt-it,ct+=8}for(ct=0,yt=0;yt<8;++yt){Te=me[ct],he=me[ct+8],Re=me[ct+16],Ie=me[ct+24],Xe=me[ct+32],rt=me[ct+40],vt=me[ct+48];var _t=Te+(et=me[ct+56]),Ht=Te-et,Dt=he+vt,Vt=he-vt,er=Re+rt,_r=Re-rt,kr=Ie+Xe,Ur=Ie-Xe,on=_t+kr,Wn=_t-kr,sn=Dt+er,Li=Dt-er;me[ct]=on+sn,me[ct+32]=on-sn;var wi=.707106781*(Li+Wn);me[ct+16]=Wn+wi,me[ct+48]=Wn-wi;var Ni=.382683433*((on=Ur+_r)-(Li=Vt+Ht)),_i=.5411961*on+Ni,ao=1.306562965*Li+Ni,_s=.707106781*(sn=_r+Vt),Go=Ht+_s,tu=Ht-_s;me[ct+40]=tu+_i,me[ct+24]=tu-_i,me[ct+8]=Go+ao,me[ct+56]=Go-ao,ct++}for(yt=0;yt<64;++yt)mt=me[yt]*Ee[yt],f[yt]=mt>0?mt+.5|0:mt-.5|0;return f}(z,D),de=0;de<64;++de)_[N[de]]=ce[de];var Oe=_[0]-Y;Y=_[0],Oe==0?G(Q[0]):(G(Q[y[Z=32767+Oe]]),G(p[Z]));for(var Le=63;Le>0&&_[Le]==0;)Le--;if(Le==0)return G(ae),Y;for(var ke,Se=1;Se<=Le;){for(var ye=Se;_[Se]==0&&Se<=Le;)++Se;var Je=Se-ye;if(Je>=16){ke=Je>>4;for(var we=1;we<=ke;++we)G(se);Je&=15}Z=32767+_[Se],G(J[(Je<<4)+y[Z]]),G(p[Z]),Se++}return Le!=63&&G(ae),Y}function U(z){z=Math.min(Math.max(z,1),100),i!=z&&(function(D){for(var Y=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Q=0;Q<64;Q++){var J=o((Y[Q]*D+50)/100);J=Math.min(Math.max(J,1),255),s[N[Q]]=J}for(var Z=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ae=0;ae<64;ae++){var se=o((Z[ae]*D+50)/100);se=Math.min(Math.max(se,1),255),c[N[ae]]=se}for(var ce=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],de=0,Oe=0;Oe<8;Oe++)for(var Le=0;Le<8;Le++)u[de]=1/(s[N[de]]*ce[Oe]*ce[Le]*8),d[de]=1/(c[N[de]]*ce[Oe]*ce[Le]*8),de++}(z<50?Math.floor(5e3/z):Math.floor(200-2*z)),i=z)}this.encode=function(z,D){D&&U(D),S=new Array,w=0,x=7,te(65496),te(65504),te(16),$(74),$(70),$(73),$(70),$(0),$(1),$(1),$(0),te(1),te(1),$(0),$(0),function(){te(65499),te(132),$(0);for(var he=0;he<64;he++)$(s[he]);$(1);for(var Re=0;Re<64;Re++)$(c[Re])}(),function(he,Re){te(65472),te(17),$(8),te(Re),te(he),$(3),$(1),$(17),$(0),$(2),$(17),$(1),$(3),$(17),$(1)}(z.width,z.height),function(){te(65476),te(418),$(0);for(var he=0;he<16;he++)$(R[he+1]);for(var Re=0;Re<=11;Re++)$(F[Re]);$(16);for(var Ie=0;Ie<16;Ie++)$(j[Ie+1]);for(var Xe=0;Xe<=161;Xe++)$(O[Xe]);$(1);for(var rt=0;rt<16;rt++)$(C[rt+1]);for(var vt=0;vt<=11;vt++)$(A[vt]);$(17);for(var et=0;et<16;et++)$(k[et+1]);for(var yt=0;yt<=161;yt++)$(T[yt])}(),te(65498),te(12),$(3),$(1),$(0),$(2),$(17),$(3),$(17),$(0),$(63),$(0);var Y=0,Q=0,J=0;w=0,x=7,this.encode.displayName="_encode_";for(var Z,ae,se,ce,de,Oe,Le,ke,Se,ye=z.data,Je=z.width,we=z.height,me=4*Je,Ee=0;Ee<we;){for(Z=0;Z<me;){for(de=me*Ee+Z,Le=-1,ke=0,Se=0;Se<64;Se++)Oe=de+(ke=Se>>3)*me+(Le=4*(7&Se)),Ee+ke>=we&&(Oe-=me*(Ee+1+ke-we)),Z+Le>=me&&(Oe-=Z+Le-me+4),ae=ye[Oe++],se=ye[Oe++],ce=ye[Oe++],v[Se]=(M[ae]+M[se+256>>0]+M[ce+512>>0]>>16)-128,g[Se]=(M[ae+768>>0]+M[se+1024>>0]+M[ce+1280>>0]>>16)-128,E[Se]=(M[ae+1280>>0]+M[se+1536>>0]+M[ce+1792>>0]>>16)-128;Y=W(v,u,Y,r,n),Q=W(g,d,Q,t,a),J=W(E,d,J,t,a),Z+=32}Ee+=8}if(x>=0){var Te=[];Te[1]=x+1,Te[0]=(1<<x+1)-1,G(Te)}return te(65497),new Uint8Array(S)},e=e||50,function(){for(var z=String.fromCharCode,D=0;D<256;D++)b[D]=z(D)}(),r=V(R,F),t=V(C,A),n=V(j,O),a=V(k,T),function(){for(var z=1,D=2,Y=1;Y<=15;Y++){for(var Q=z;Q<D;Q++)y[32767+Q]=Y,p[32767+Q]=[],p[32767+Q][1]=Y,p[32767+Q][0]=Q;for(var J=-(D-1);J<=-z;J++)y[32767+J]=Y,p[32767+J]=[],p[32767+J][1]=Y,p[32767+J][0]=D-1+J;z<<=1,D<<=1}}(),function(){for(var z=0;z<256;z++)M[z]=19595*z,M[z+256>>0]=38470*z,M[z+512>>0]=7471*z+32768,M[z+768>>0]=-11059*z,M[z+1024>>0]=-21709*z,M[z+1280>>0]=32768*z+8421375,M[z+1536>>0]=-27439*z,M[z+1792>>0]=-5329*z}(),U(e)}/**
|
|
584
|
+
* @license
|
|
585
|
+
* Copyright (c) 2017 Aras Abbasi
|
|
586
|
+
*
|
|
587
|
+
* Licensed under the MIT License.
|
|
588
|
+
* http://opensource.org/licenses/mit-license
|
|
589
|
+
*/function Hl(e,r){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!r,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function hw(e){function r(R){if(!R)throw Error("assert :P")}function t(R,F,j){for(var O=0;4>O;O++)if(R[F+O]!=j.charCodeAt(O))return!0;return!1}function n(R,F,j,O,C){for(var A=0;A<C;A++)R[F+A]=j[O+A]}function a(R,F,j,O){for(var C=0;C<O;C++)R[F+C]=j}function i(R){return new Int32Array(R)}function o(R,F){for(var j=[],O=0;O<R;O++)j.push(new F);return j}function s(R,F){var j=[];return function O(C,A,k){for(var T=k[A],V=0;V<T&&(C.push(k.length>A+1?[]:new F),!(k.length<A+1));V++)O(C[V],A+1,k)}(j,0,R),j}var c=function(){var R=this;function F(I,H){for(var re=1<<H-1>>>0;I&re;)re>>>=1;return re?(I&re-1)+re:I}function j(I,H,re,oe,ue){r(!(oe%re));do I[H+(oe-=re)]=ue;while(0<oe)}function O(I,H,re,oe,ue){if(r(2328>=ue),512>=ue)var pe=i(512);else if((pe=i(ue))==null)return 0;return function(ve,be,_e,Pe,Fe,Ze){var $e,Ge,bt=be,lt=1<<_e,Me=i(16),qe=i(16);for(r(Fe!=0),r(Pe!=null),r(ve!=null),r(0<_e),Ge=0;Ge<Fe;++Ge){if(15<Pe[Ge])return 0;++Me[Pe[Ge]]}if(Me[0]==Fe)return 0;for(qe[1]=0,$e=1;15>$e;++$e){if(Me[$e]>1<<$e)return 0;qe[$e+1]=qe[$e]+Me[$e]}for(Ge=0;Ge<Fe;++Ge)$e=Pe[Ge],0<Pe[Ge]&&(Ze[qe[$e]++]=Ge);if(qe[15]==1)return(Pe=new C).g=0,Pe.value=Ze[0],j(ve,bt,1,lt,Pe),lt;var Ue,ht=-1,gt=lt-1,qt=0,jt=1,ar=1,Mt=1<<_e;for(Ge=0,$e=1,Fe=2;$e<=_e;++$e,Fe<<=1){if(jt+=ar<<=1,0>(ar-=Me[$e]))return 0;for(;0<Me[$e];--Me[$e])(Pe=new C).g=$e,Pe.value=Ze[Ge++],j(ve,bt+qt,Fe,Mt,Pe),qt=F(qt,$e)}for($e=_e+1,Fe=2;15>=$e;++$e,Fe<<=1){if(jt+=ar<<=1,0>(ar-=Me[$e]))return 0;for(;0<Me[$e];--Me[$e]){if(Pe=new C,(qt>)!=ht){for(bt+=Mt,Ue=1<<(ht=$e)-_e;15>ht&&!(0>=(Ue-=Me[ht]));)++ht,Ue<<=1;lt+=Mt=1<<(Ue=ht-_e),ve[be+(ht=qt>)].g=Ue+_e,ve[be+ht].value=bt-be-ht}Pe.g=$e-_e,Pe.value=Ze[Ge++],j(ve,bt+(qt>>_e),Fe,Mt,Pe),qt=F(qt,$e)}}return jt!=2*qe[15]-1?0:lt}(I,H,re,oe,ue,pe)}function C(){this.value=this.g=0}function A(){this.value=this.g=0}function k(){this.G=o(5,C),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(en,A)}function T(I,H,re,oe){r(I!=null),r(H!=null),r(2147483648>oe),I.Ca=254,I.I=0,I.b=-8,I.Ka=0,I.oa=H,I.pa=re,I.Jd=H,I.Yc=re+oe,I.Zc=4<=oe?re+oe-4+1:re,Z(I)}function V(I,H){for(var re=0;0<H--;)re|=se(I,128)<<H;return re}function G(I,H){var re=V(I,H);return ae(I)?-re:re}function $(I,H,re,oe){var ue,pe=0;for(r(I!=null),r(H!=null),r(4294967288>oe),I.Sb=oe,I.Ra=0,I.u=0,I.h=0,4<oe&&(oe=4),ue=0;ue<oe;++ue)pe+=H[re+ue]<<8*ue;I.Ra=pe,I.bb=oe,I.oa=H,I.pa=re}function te(I){for(;8<=I.u&&I.bb<I.Sb;)I.Ra>>>=8,I.Ra+=I.oa[I.pa+I.bb]<<Pa-8>>>0,++I.bb,I.u-=8;Y(I)&&(I.h=1,I.u=0)}function W(I,H){if(r(0<=H),!I.h&&H<=wl){var re=D(I)&el[H];return I.u+=H,te(I),re}return I.h=1,I.u=0}function U(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function z(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function D(I){return I.Ra>>>(I.u&Pa-1)>>>0}function Y(I){return r(I.bb<=I.Sb),I.h||I.bb==I.Sb&&I.u>Pa}function Q(I,H){I.u=H,I.h=Y(I)}function J(I){I.u>=Ha&&(r(I.u>=Ha),te(I))}function Z(I){r(I!=null&&I.oa!=null),I.pa<I.Zc?(I.I=(I.oa[I.pa++]|I.I<<8)>>>0,I.b+=8):(r(I!=null&&I.oa!=null),I.pa<I.Yc?(I.b+=8,I.I=I.oa[I.pa++]|I.I<<8):I.Ka?I.b=0:(I.I<<=8,I.b+=8,I.Ka=1))}function ae(I){return V(I,1)}function se(I,H){var re=I.Ca;0>I.b&&Z(I);var oe=I.b,ue=re*H>>>8,pe=(I.I>>>oe>ue)+0;for(pe?(re-=ue,I.I-=ue+1<<oe>>>0):re=ue+1,oe=re,ue=0;256<=oe;)ue+=8,oe>>=8;return oe=7^ue+Si[oe],I.b-=oe,I.Ca=(re<<oe)-1,pe}function ce(I,H,re){I[H+0]=re>>24&255,I[H+1]=re>>16&255,I[H+2]=re>>8&255,I[H+3]=re>>0&255}function de(I,H){return I[H+0]<<0|I[H+1]<<8}function Oe(I,H){return de(I,H)|I[H+2]<<16}function Le(I,H){return de(I,H)|de(I,H+2)<<16}function ke(I,H){var re=1<<H;return r(I!=null),r(0<H),I.X=i(re),I.X==null?0:(I.Mb=32-H,I.Xa=H,1)}function Se(I,H){r(I!=null),r(H!=null),r(I.Xa==H.Xa),n(H.X,0,I.X,0,1<<H.Xa)}function ye(){this.X=[],this.Xa=this.Mb=0}function Je(I,H,re,oe){r(re!=null),r(oe!=null);var ue=re[0],pe=oe[0];return ue==0&&(ue=(I*pe+H/2)/H),pe==0&&(pe=(H*ue+I/2)/I),0>=ue||0>=pe?0:(re[0]=ue,oe[0]=pe,1)}function we(I,H){return I+(1<<H)-1>>>H}function me(I,H){return((4278255360&I)+(4278255360&H)>>>0&4278255360)+((16711935&I)+(16711935&H)>>>0&16711935)>>>0}function Ee(I,H){R[H]=function(re,oe,ue,pe,ve,be,_e){var Pe;for(Pe=0;Pe<ve;++Pe){var Fe=R[I](be[_e+Pe-1],ue,pe+Pe);be[_e+Pe]=me(re[oe+Pe],Fe)}}}function Te(){this.ud=this.hd=this.jd=0}function he(I,H){return((4278124286&(I^H))>>>1)+(I&H)>>>0}function Re(I){return 0<=I&&256>I?I:0>I?0:255<I?255:void 0}function Ie(I,H){return Re(I+(I-H+.5>>1))}function Xe(I,H,re){return Math.abs(H-re)-Math.abs(I-re)}function rt(I,H,re,oe,ue,pe,ve){for(oe=pe[ve-1],re=0;re<ue;++re)pe[ve+re]=oe=me(I[H+re],oe)}function vt(I,H,re,oe,ue){var pe;for(pe=0;pe<re;++pe){var ve=I[H+pe],be=ve>>8&255,_e=16711935&(_e=(_e=16711935&ve)+((be<<16)+be));oe[ue+pe]=(4278255360&ve)+_e>>>0}}function et(I,H){H.jd=I>>0&255,H.hd=I>>8&255,H.ud=I>>16&255}function yt(I,H,re,oe,ue,pe){var ve;for(ve=0;ve<oe;++ve){var be=H[re+ve],_e=be>>>8,Pe=be,Fe=255&(Fe=(Fe=be>>>16)+((I.jd<<24>>24)*(_e<<24>>24)>>>5));Pe=255&(Pe=(Pe=Pe+((I.hd<<24>>24)*(_e<<24>>24)>>>5))+((I.ud<<24>>24)*(Fe<<24>>24)>>>5)),ue[pe+ve]=(4278255360&be)+(Fe<<16)+Pe}}function mt(I,H,re,oe,ue){R[H]=function(pe,ve,be,_e,Pe,Fe,Ze,$e,Ge){for(_e=Ze;_e<$e;++_e)for(Ze=0;Ze<Ge;++Ze)Pe[Fe++]=ue(be[oe(pe[ve++])])},R[I]=function(pe,ve,be,_e,Pe,Fe,Ze){var $e=8>>pe.b,Ge=pe.Ea,bt=pe.K[0],lt=pe.w;if(8>$e)for(pe=(1<<pe.b)-1,lt=(1<<$e)-1;ve<be;++ve){var Me,qe=0;for(Me=0;Me<Ge;++Me)Me&pe||(qe=oe(_e[Pe++])),Fe[Ze++]=ue(bt[qe<]),qe>>=$e}else R["VP8LMapColor"+re](_e,Pe,bt,lt,Fe,Ze,ve,be,Ge)}}function ct(I,H,re,oe,ue){for(re=H+re;H<re;){var pe=I[H++];oe[ue++]=pe>>16&255,oe[ue++]=pe>>8&255,oe[ue++]=pe>>0&255}}function Bt(I,H,re,oe,ue){for(re=H+re;H<re;){var pe=I[H++];oe[ue++]=pe>>16&255,oe[ue++]=pe>>8&255,oe[ue++]=pe>>0&255,oe[ue++]=pe>>24&255}}function Pt(I,H,re,oe,ue){for(re=H+re;H<re;){var pe=(ve=I[H++])>>16&240|ve>>12&15,ve=ve>>0&240|ve>>28&15;oe[ue++]=pe,oe[ue++]=ve}}function Yt(I,H,re,oe,ue){for(re=H+re;H<re;){var pe=(ve=I[H++])>>16&248|ve>>13&7,ve=ve>>5&224|ve>>3&31;oe[ue++]=pe,oe[ue++]=ve}}function Gt(I,H,re,oe,ue){for(re=H+re;H<re;){var pe=I[H++];oe[ue++]=pe>>0&255,oe[ue++]=pe>>8&255,oe[ue++]=pe>>16&255}}function Be(I,H,re,oe,ue,pe){if(pe==0)for(re=H+re;H<re;)ce(oe,((pe=I[H++])[0]>>24|pe[1]>>8&65280|pe[2]<<8&16711680|pe[3]<<24)>>>0),ue+=32;else n(oe,ue,I,H,re)}function Ce(I,H){R[H][0]=R[I+"0"],R[H][1]=R[I+"1"],R[H][2]=R[I+"2"],R[H][3]=R[I+"3"],R[H][4]=R[I+"4"],R[H][5]=R[I+"5"],R[H][6]=R[I+"6"],R[H][7]=R[I+"7"],R[H][8]=R[I+"8"],R[H][9]=R[I+"9"],R[H][10]=R[I+"10"],R[H][11]=R[I+"11"],R[H][12]=R[I+"12"],R[H][13]=R[I+"13"],R[H][14]=R[I+"0"],R[H][15]=R[I+"0"]}function ft(I){return I==Pl||I==ks||I==hu||I==du}function Ct(){this.eb=[],this.size=this.A=this.fb=0}function Ot(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Nt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Ct,this.f.kb=new Ot,this.sd=null}function Jt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Xt(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function kt(I){return alert("todo:WebPSamplerProcessPlane"),I.T}function nt(I,H){var re=I.T,oe=H.ba.f.RGBA,ue=oe.eb,pe=oe.fb+I.ka*oe.A,ve=da[H.ba.S],be=I.y,_e=I.O,Pe=I.f,Fe=I.N,Ze=I.ea,$e=I.W,Ge=H.cc,bt=H.dc,lt=H.Mc,Me=H.Nc,qe=I.ka,Ue=I.ka+I.T,ht=I.U,gt=ht+1>>1;for(qe==0?ve(be,_e,null,null,Pe,Fe,Ze,$e,Pe,Fe,Ze,$e,ue,pe,null,null,ht):(ve(H.ec,H.fc,be,_e,Ge,bt,lt,Me,Pe,Fe,Ze,$e,ue,pe-oe.A,ue,pe,ht),++re);qe+2<Ue;qe+=2)Ge=Pe,bt=Fe,lt=Ze,Me=$e,Fe+=I.Rc,$e+=I.Rc,pe+=2*oe.A,ve(be,(_e+=2*I.fa)-I.fa,be,_e,Ge,bt,lt,Me,Pe,Fe,Ze,$e,ue,pe-oe.A,ue,pe,ht);return _e+=I.fa,I.j+Ue<I.o?(n(H.ec,H.fc,be,_e,ht),n(H.cc,H.dc,Pe,Fe,gt),n(H.Mc,H.Nc,Ze,$e,gt),re--):1&Ue||ve(be,_e,null,null,Pe,Fe,Ze,$e,Pe,Fe,Ze,$e,ue,pe+oe.A,null,null,ht),re}function We(I,H,re){var oe=I.F,ue=[I.J];if(oe!=null){var pe=I.U,ve=H.ba.S,be=ve==fu||ve==hu;H=H.ba.f.RGBA;var _e=[0],Pe=I.ka;_e[0]=I.T,I.Kb&&(Pe==0?--_e[0]:(--Pe,ue[0]-=I.width),I.j+I.ka+I.T==I.o&&(_e[0]=I.o-I.j-Pe));var Fe=H.eb;Pe=H.fb+Pe*H.A,I=$r(oe,ue[0],I.width,pe,_e,Fe,Pe+(be?0:3),H.A),r(re==_e),I&&ft(ve)&&xi(Fe,Pe,be,pe,_e,H.A)}return 0}function it(I){var H=I.ma,re=H.ba.S,oe=11>re,ue=re==Fo||re==El||re==fu||re==cn||re==12||ft(re);if(H.memory=null,H.Ib=null,H.Jb=null,H.Nd=null,!Js(H.Oa,I,ue?11:12))return 0;if(ue&&ft(re)&&St(),I.da)alert("todo:use_scaling");else{if(oe){if(H.Ib=kt,I.Kb){if(re=I.U+1>>1,H.memory=i(I.U+2*re),H.memory==null)return 0;H.ec=H.memory,H.fc=0,H.cc=H.ec,H.dc=H.fc+I.U,H.Mc=H.cc,H.Nc=H.dc+re,H.Ib=nt,St()}}else alert("todo:EmitYUV");ue&&(H.Jb=We,oe&&Qe())}if(oe&&!Ei){for(I=0;256>I;++I)ia[I]=89858*(I-128)+go>>rs,aa[I]=-22014*(I-128)+go,Al[I]=-45773*(I-128),al[I]=113618*(I-128)+go>>rs;for(I=Kr;I<rn;++I)H=76283*(I-16)+go>>rs,mu[I-Kr]=xa(H,255),cf[I-Kr]=xa(H+8>>4,15);Ei=1}return 1}function He(I){var H=I.ma,re=I.U,oe=I.T;return r(!(1&I.ka)),0>=re||0>=oe?0:(re=H.Ib(I,H),H.Jb!=null&&H.Jb(I,H,re),H.Dc+=re,1)}function wt(I){I.ma.memory=null}function ze(I,H,re,oe){return W(I,8)!=47?0:(H[0]=W(I,14)+1,re[0]=W(I,14)+1,oe[0]=W(I,1),W(I,3)!=0?0:!I.h)}function _t(I,H){if(4>I)return I+1;var re=I-2>>1;return(2+(1&I)<<re)+W(H,re)+1}function Ht(I,H){return 120<H?H-120:1<=(re=((re=qf[H-1])>>4)*I+(8-(15&re)))?re:1;var re}function Dt(I,H,re){var oe=D(re),ue=I[H+=255&oe].g-8;return 0<ue&&(Q(re,re.u+8),oe=D(re),H+=I[H].value,H+=oe&(1<<ue)-1),Q(re,re.u+I[H].g),I[H].value}function Vt(I,H,re){return re.g+=I.g,re.value+=I.value<<H>>>0,r(8>=re.g),I.g}function er(I,H,re){var oe=I.xc;return r((H=oe==0?0:I.vc[I.md*(re>>oe)+(H>>oe)])<I.Wb),I.Ya[H]}function _r(I,H,re,oe){var ue=I.ab,pe=I.c*H,ve=I.C;H=ve+H;var be=re,_e=oe;for(oe=I.Ta,re=I.Ua;0<ue--;){var Pe=I.gc[ue],Fe=ve,Ze=H,$e=be,Ge=_e,bt=(_e=oe,be=re,Pe.Ea);switch(r(Fe<Ze),r(Ze<=Pe.nc),Pe.hc){case 2:Hu($e,Ge,(Ze-Fe)*bt,_e,be);break;case 0:var lt=Fe,Me=Ze,qe=_e,Ue=be,ht=(Mt=Pe).Ea;lt==0&&(tl($e,Ge,null,null,1,qe,Ue),rt($e,Ge+1,0,0,ht-1,qe,Ue+1),Ge+=ht,Ue+=ht,++lt);for(var gt=1<<Mt.b,qt=gt-1,jt=we(ht,Mt.b),ar=Mt.K,Mt=Mt.w+(lt>>Mt.b)*jt;lt<Me;){var Ir=ar,Dr=Mt,Nr=1;for(co($e,Ge,qe,Ue-ht,1,qe,Ue);Nr<ht;){var yr=(Nr&~qt)+gt;yr>ht&&(yr=ht),(0,mi[Ir[Dr++]>>8&15])($e,Ge+ +Nr,qe,Ue+Nr-ht,yr-Nr,qe,Ue+Nr),Nr=yr}Ge+=ht,Ue+=ht,++lt&qt||(Mt+=jt)}Ze!=Pe.nc&&n(_e,be-bt,_e,be+(Ze-Fe-1)*bt,bt);break;case 1:for(bt=$e,Me=Ge,ht=($e=Pe.Ea)-(Ue=$e&~(qe=(Ge=1<<Pe.b)-1)),lt=we($e,Pe.b),gt=Pe.K,Pe=Pe.w+(Fe>>Pe.b)*lt;Fe<Ze;){for(qt=gt,jt=Pe,ar=new Te,Mt=Me+Ue,Ir=Me+$e;Me<Mt;)et(qt[jt++],ar),Jo(ar,bt,Me,Ge,_e,be),Me+=Ge,be+=Ge;Me<Ir&&(et(qt[jt++],ar),Jo(ar,bt,Me,ht,_e,be),Me+=ht,be+=ht),++Fe&qe||(Pe+=lt)}break;case 3:if($e==_e&&Ge==be&&0<Pe.b){for(Me=_e,$e=bt=be+(Ze-Fe)*bt-(Ue=(Ze-Fe)*we(Pe.Ea,Pe.b)),Ge=_e,qe=be,lt=[],Ue=(ht=Ue)-1;0<=Ue;--Ue)lt[Ue]=Ge[qe+Ue];for(Ue=ht-1;0<=Ue;--Ue)Me[$e+Ue]=lt[Ue];vi(Pe,Fe,Ze,_e,bt,_e,be)}else vi(Pe,Fe,Ze,$e,Ge,_e,be)}be=oe,_e=re}_e!=re&&n(oe,re,be,_e,pe)}function kr(I,H){var re=I.V,oe=I.Ba+I.c*I.C,ue=H-I.C;if(r(H<=I.l.o),r(16>=ue),0<ue){var pe=I.l,ve=I.Ta,be=I.Ua,_e=pe.width;if(_r(I,ue,re,oe),ue=be=[be],r((re=I.C)<(oe=H)),r(pe.v<pe.va),oe>pe.o&&(oe=pe.o),re<pe.j){var Pe=pe.j-re;re=pe.j,ue[0]+=Pe*_e}if(re>=oe?re=0:(ue[0]+=4*pe.v,pe.ka=re-pe.j,pe.U=pe.va-pe.v,pe.T=oe-re,re=1),re){if(be=be[0],11>(re=I.ca).S){var Fe=re.f.RGBA,Ze=(oe=re.S,ue=pe.U,pe=pe.T,Pe=Fe.eb,Fe.A),$e=pe;for(Fe=Fe.fb+I.Ma*Fe.A;0<$e--;){var Ge=ve,bt=be,lt=ue,Me=Pe,qe=Fe;switch(oe){case xl:li(Ge,bt,lt,Me,qe);break;case Fo:qi(Ge,bt,lt,Me,qe);break;case Pl:qi(Ge,bt,lt,Me,qe),xi(Me,qe,0,lt,1,0);break;case sf:fo(Ge,bt,lt,Me,qe);break;case El:Be(Ge,bt,lt,Me,qe,1);break;case ks:Be(Ge,bt,lt,Me,qe,1),xi(Me,qe,0,lt,1,0);break;case fu:Be(Ge,bt,lt,Me,qe,0);break;case hu:Be(Ge,bt,lt,Me,qe,0),xi(Me,qe,1,lt,1,0);break;case cn:es(Ge,bt,lt,Me,qe);break;case du:es(Ge,bt,lt,Me,qe),tn(Me,qe,lt,1,0);break;case Vu:Wr(Ge,bt,lt,Me,qe);break;default:r(0)}be+=_e,Fe+=Ze}I.Ma+=pe}else alert("todo:EmitRescaledRowsYUVA");r(I.Ma<=re.height)}}I.C=H,r(I.C<=I.i)}function Ur(I){var H;if(0<I.ua)return 0;for(H=0;H<I.Wb;++H){var re=I.Ya[H].G,oe=I.Ya[H].H;if(0<re[1][oe[1]+0].g||0<re[2][oe[2]+0].g||0<re[3][oe[3]+0].g)return 0}return 1}function on(I,H,re,oe,ue,pe){if(I.Z!=0){var ve=I.qd,be=I.rd;for(r(Vi[I.Z]!=null);H<re;++H)Vi[I.Z](ve,be,oe,ue,oe,ue,pe),ve=oe,be=ue,ue+=pe;I.qd=ve,I.rd=be}}function Wn(I,H){var re=I.l.ma,oe=re.Z==0||re.Z==1?I.l.j:I.C;if(oe=I.C<oe?oe:I.C,r(H<=I.l.o),H>oe){var ue=I.l.width,pe=re.ca,ve=re.tb+ue*oe,be=I.V,_e=I.Ba+I.c*oe,Pe=I.gc;r(I.ab==1),r(Pe[0].hc==3),Cs(Pe[0],oe,H,be,_e,pe,ve),on(re,oe,H,pe,ve,ue)}I.C=I.Ma=H}function sn(I,H,re,oe,ue,pe,ve){var be=I.$/oe,_e=I.$%oe,Pe=I.m,Fe=I.s,Ze=re+I.$,$e=Ze;ue=re+oe*ue;var Ge=re+oe*pe,bt=280+Fe.ua,lt=I.Pb?be:16777216,Me=0<Fe.ua?Fe.Wa:null,qe=Fe.wc,Ue=Ze<Ge?er(Fe,_e,be):null;r(I.C<pe),r(Ge<=ue);var ht=!1;e:for(;;){for(;ht||Ze<Ge;){var gt=0;if(be>=lt){var qt=Ze-re;r((lt=I).Pb),lt.wd=lt.m,lt.xd=qt,0<lt.s.ua&&Se(lt.s.Wa,lt.s.vb),lt=be+Gu}if(_e&qe||(Ue=er(Fe,_e,be)),r(Ue!=null),Ue.Qb&&(H[Ze]=Ue.qb,ht=!0),!ht)if(J(Pe),Ue.jc){gt=Pe,qt=H;var jt=Ze,ar=Ue.pd[D(gt)&en-1];r(Ue.jc),256>ar.g?(Q(gt,gt.u+ar.g),qt[jt]=ar.value,gt=0):(Q(gt,gt.u+ar.g-256),r(256<=ar.value),gt=ar.value),gt==0&&(ht=!0)}else gt=Dt(Ue.G[0],Ue.H[0],Pe);if(Pe.h)break;if(ht||256>gt){if(!ht)if(Ue.nd)H[Ze]=(Ue.qb|gt<<8)>>>0;else{if(J(Pe),ht=Dt(Ue.G[1],Ue.H[1],Pe),J(Pe),qt=Dt(Ue.G[2],Ue.H[2],Pe),jt=Dt(Ue.G[3],Ue.H[3],Pe),Pe.h)break;H[Ze]=(jt<<24|ht<<16|gt<<8|qt)>>>0}if(ht=!1,++Ze,++_e>=oe&&(_e=0,++be,ve!=null&&be<=pe&&!(be%16)&&ve(I,be),Me!=null))for(;$e<Ze;)gt=H[$e++],Me.X[(506832829*gt&4294967295)>>>Me.Mb]=gt}else if(280>gt){if(gt=_t(gt-256,Pe),qt=Dt(Ue.G[4],Ue.H[4],Pe),J(Pe),qt=Ht(oe,qt=_t(qt,Pe)),Pe.h)break;if(Ze-re<qt||ue-Ze<gt)break e;for(jt=0;jt<gt;++jt)H[Ze+jt]=H[Ze+jt-qt];for(Ze+=gt,_e+=gt;_e>=oe;)_e-=oe,++be,ve!=null&&be<=pe&&!(be%16)&&ve(I,be);if(r(Ze<=ue),_e&qe&&(Ue=er(Fe,_e,be)),Me!=null)for(;$e<Ze;)gt=H[$e++],Me.X[(506832829*gt&4294967295)>>>Me.Mb]=gt}else{if(!(gt<bt))break e;for(ht=gt-280,r(Me!=null);$e<Ze;)gt=H[$e++],Me.X[(506832829*gt&4294967295)>>>Me.Mb]=gt;gt=Ze,r(!(ht>>>(qt=Me).Xa)),H[gt]=qt.X[ht],ht=!0}ht||r(Pe.h==Y(Pe))}if(I.Pb&&Pe.h&&Ze<ue)r(I.m.h),I.a=5,I.m=I.wd,I.$=I.xd,0<I.s.ua&&Se(I.s.vb,I.s.Wa);else{if(Pe.h)break e;ve!=null&&ve(I,be>pe?pe:be),I.a=0,I.$=Ze-re}return 1}return I.a=3,0}function Li(I){r(I!=null),I.vc=null,I.yc=null,I.Ya=null;var H=I.Wa;H!=null&&(H.X=null),I.vb=null,r(I!=null)}function wi(){var I=new qa;return I==null?null:(I.a=0,I.xb=gu,Ce("Predictor","VP8LPredictors"),Ce("Predictor","VP8LPredictors_C"),Ce("PredictorAdd","VP8LPredictorsAdd"),Ce("PredictorAdd","VP8LPredictorsAdd_C"),Hu=vt,Jo=yt,li=ct,qi=Bt,es=Pt,Wr=Yt,fo=Gt,R.VP8LMapColor32b=Bi,R.VP8LMapColor8b=Co,I)}function Ni(I,H,re,oe,ue){var pe=1,ve=[I],be=[H],_e=oe.m,Pe=oe.s,Fe=null,Ze=0;e:for(;;){if(re)for(;pe&&W(_e,1);){var $e=ve,Ge=be,bt=oe,lt=1,Me=bt.m,qe=bt.gc[bt.ab],Ue=W(Me,2);if(bt.Oc&1<<Ue)pe=0;else{switch(bt.Oc|=1<<Ue,qe.hc=Ue,qe.Ea=$e[0],qe.nc=Ge[0],qe.K=[null],++bt.ab,r(4>=bt.ab),Ue){case 0:case 1:qe.b=W(Me,3)+2,lt=Ni(we(qe.Ea,qe.b),we(qe.nc,qe.b),0,bt,qe.K),qe.K=qe.K[0];break;case 3:var ht,gt=W(Me,8)+1,qt=16<gt?0:4<gt?1:2<gt?2:3;if($e[0]=we(qe.Ea,qt),qe.b=qt,ht=lt=Ni(gt,1,0,bt,qe.K)){var jt,ar=gt,Mt=qe,Ir=1<<(8>>Mt.b),Dr=i(Ir);if(Dr==null)ht=0;else{var Nr=Mt.K[0],yr=Mt.w;for(Dr[0]=Mt.K[0][0],jt=1;jt<1*ar;++jt)Dr[jt]=me(Nr[yr+jt],Dr[jt-1]);for(;jt<4*Ir;++jt)Dr[jt]=0;Mt.K[0]=null,Mt.K[0]=Dr,ht=1}}lt=ht;break;case 2:break;default:r(0)}pe=lt}}if(ve=ve[0],be=be[0],pe&&W(_e,1)&&!(pe=1<=(Ze=W(_e,4))&&11>=Ze)){oe.a=3;break e}var Yr;if(Yr=pe)t:{var Zr,Zt,Br,Ln=oe,Dn=ve,ci=be,xr=Ze,Gi=re,En=Ln.m,Bn=Ln.s,fi=[null],Pi=1,pa=0,$a=lf[xr];r:for(;;){if(Gi&&W(En,1)){var yn=W(En,3)+2,qn=we(Dn,yn),oa=we(ci,yn),Do=qn*oa;if(!Ni(qn,oa,0,Ln,fi))break r;for(fi=fi[0],Bn.xc=yn,Zr=0;Zr<Do;++Zr){var vo=fi[Zr]>>8&65535;fi[Zr]=vo,vo>=Pi&&(Pi=vo+1)}}if(En.h)break r;for(Zt=0;5>Zt;++Zt){var jr=il[Zt];!Zt&&0<xr&&(jr+=1<<xr),pa<jr&&(pa=jr)}var mo=o(Pi*$a,C),yu=Pi,Xu=o(yu,k);if(Xu==null)var Ya=null;else r(65536>=yu),Ya=Xu;var Oa=i(pa);if(Ya==null||Oa==null||mo==null){Ln.a=1;break r}var kl=mo;for(Zr=Br=0;Zr<Pi;++Zr){var ga=Ya[Zr],Bo=ga.G,vn=ga.H,vr=0,Qr=1,Pn=0;for(Zt=0;5>Zt;++Zt){jr=il[Zt],Bo[Zt]=kl,vn[Zt]=Br,!Zt&&0<xr&&(jr+=1<<xr);i:{var Nn,ei=jr,qo=Ln,fn=Oa,bu=kl,Ts=Br,hn=0,Xa=qo.m,Ll=W(Xa,1);if(a(fn,0,0,ei),Ll){var sa=W(Xa,1)+1,wu=W(Xa,1),_u=W(Xa,wu==0?1:8);fn[_u]=1,sa==2&&(fn[_u=W(Xa,8)]=1);var Oi=1}else{var nn=i(19),zn=W(Xa,4)+4;if(19<zn){qo.a=3;var Un=0;break i}for(Nn=0;Nn<zn;++Nn)nn[qh[Nn]]=W(Xa,3);var Ka=void 0,yo=void 0,Za=qo,xc=nn,Hn=ei,Su=fn,ol=0,Qa=Za.m,bn=8,hi=o(128,C);n:for(;O(hi,0,7,xc,19);){if(W(Qa,1)){var la=2+2*W(Qa,3);if((Ka=2+W(Qa,la))>Hn)break n}else Ka=Hn;for(yo=0;yo<Hn&&Ka--;){J(Qa);var Wi=hi[0+(127&D(Qa))];Q(Qa,Qa.u+Wi.g);var Rs=Wi.value;if(16>Rs)Su[yo++]=Rs,Rs!=0&&(bn=Rs);else{var Ec=Rs==16,Ku=Rs-16,Wf=bc[Ku],os=W(Qa,pu[Ku])+Wf;if(yo+os>Hn)break n;for(var ff=Ec?bn:0;0<os--;)Su[yo++]=ff}}ol=1;break n}ol||(Za.a=3),Oi=ol}(Oi=Oi&&!Xa.h)&&(hn=O(bu,Ts,8,fn,ei)),Oi&&hn!=0?Un=hn:(qo.a=3,Un=0)}if(Un==0)break r;if(Qr&&Bf[Zt]==1&&(Qr=kl[Br].g==0),vr+=kl[Br].g,Br+=Un,3>=Zt){var Nl,xu=Oa[0];for(Nl=1;Nl<jr;++Nl)Oa[Nl]>xu&&(xu=Oa[Nl]);Pn+=xu}}if(ga.nd=Qr,ga.Qb=0,Qr&&(ga.qb=(Bo[3][vn[3]+0].value<<24|Bo[1][vn[1]+0].value<<16|Bo[2][vn[2]+0].value)>>>0,vr==0&&256>Bo[0][vn[0]+0].value&&(ga.Qb=1,ga.qb+=Bo[0][vn[0]+0].value<<8)),ga.jc=!ga.Qb&&6>Pn,ga.jc){var zo,Aa=ga;for(zo=0;zo<en;++zo){var ss=zo,Ja=Aa.pd[ss],ls=Aa.G[0][Aa.H[0]+ss];256<=ls.value?(Ja.g=ls.g+256,Ja.value=ls.value):(Ja.g=0,Ja.value=0,ss>>=Vt(ls,8,Ja),ss>>=Vt(Aa.G[1][Aa.H[1]+ss],16,Ja),ss>>=Vt(Aa.G[2][Aa.H[2]+ss],0,Ja),Vt(Aa.G[3][Aa.H[3]+ss],24,Ja))}}}Bn.vc=fi,Bn.Wb=Pi,Bn.Ya=Ya,Bn.yc=mo,Yr=1;break t}Yr=0}if(!(pe=Yr)){oe.a=3;break e}if(0<Ze){if(Pe.ua=1<<Ze,!ke(Pe.Wa,Ze)){oe.a=1,pe=0;break e}}else Pe.ua=0;var Pc=oe,Oc=ve,hf=be,Zu=Pc.s,us=Zu.xc;if(Pc.c=Oc,Pc.i=hf,Zu.md=we(Oc,us),Zu.wc=us==0?-1:(1<<us)-1,re){oe.xb=po;break e}if((Fe=i(ve*be))==null){oe.a=1,pe=0;break e}pe=(pe=sn(oe,Fe,0,ve,be,be,null))&&!_e.h;break e}return pe?(ue!=null?ue[0]=Fe:(r(Fe==null),r(re)),oe.$=0,re||Li(Pe)):Li(Pe),pe}function _i(I,H){var re=I.c*I.i,oe=re+H+16*H;return r(I.c<=H),I.V=i(oe),I.V==null?(I.Ta=null,I.Ua=0,I.a=1,0):(I.Ta=I.V,I.Ua=I.Ba+re+H,1)}function ao(I,H){var re=I.C,oe=H-re,ue=I.V,pe=I.Ba+I.c*re;for(r(H<=I.l.o);0<oe;){var ve=16<oe?16:oe,be=I.l.ma,_e=I.l.width,Pe=_e*ve,Fe=be.ca,Ze=be.tb+_e*re,$e=I.Ta,Ge=I.Ua;_r(I,ve,ue,pe),Fn($e,Ge,Fe,Ze,Pe),on(be,re,re+ve,Fe,Ze,_e),oe-=ve,ue+=ve*I.c,re+=ve}r(re==H),I.C=I.Ma=H}function _s(){this.ub=this.yd=this.td=this.Rb=0}function Go(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function tu(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function mc(){this.Yb=function(){var I=[];return function H(re,oe,ue){for(var pe=ue[oe],ve=0;ve<pe&&(re.push(ue.length>oe+1?[]:0),!(ue.length<oe+1));ve++)H(re[ve],oe+1,ue)}(I,0,[3,11]),I}()}function Mn(){this.jb=i(3),this.Wc=s([4,8],mc),this.Xc=s([4,17],mc)}function Bu(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function oo(){this.ld=this.La=this.dd=this.tc=0}function dl(){this.Na=this.la=0}function Vs(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function qu(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function ru(){this.uc=this.M=this.Nb=0,this.wa=Array(new oo),this.Y=0,this.ya=Array(new qu),this.aa=0,this.l=new Xr}function so(){this.y=i(16),this.f=i(8),this.ea=i(8)}function di(){this.cb=this.a=0,this.sc="",this.m=new U,this.Od=new _s,this.Kc=new Go,this.ed=new Bu,this.Qa=new tu,this.Ic=this.$c=this.Aa=0,this.D=new ru,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,U),this.ia=0,this.pb=o(4,Vs),this.Pa=new Mn,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new so),this.Hd=0,this.rb=Array(new dl),this.sb=0,this.wa=Array(new oo),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new qu),this.L=this.aa=0,this.gd=s([4,2],oo),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Xr(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Ar(){var I=new di;return I!=null&&(I.a=0,I.sc="OK",I.cb=0,I.Xb=0,Ol||(Ol=Ma)),I}function ln(I,H,re){return I.a==0&&(I.a=H,I.sc=re,I.cb=0),0}function pi(I,H,re){return 3<=re&&I[H+0]==157&&I[H+1]==1&&I[H+2]==42}function Ti(I,H){if(I==null)return 0;if(I.a=0,I.sc="OK",H==null)return ln(I,2,"null VP8Io passed to VP8GetHeaders()");var re=H.data,oe=H.w,ue=H.ha;if(4>ue)return ln(I,7,"Truncated header.");var pe=re[oe+0]|re[oe+1]<<8|re[oe+2]<<16,ve=I.Od;if(ve.Rb=!(1&pe),ve.td=pe>>1&7,ve.yd=pe>>4&1,ve.ub=pe>>5,3<ve.td)return ln(I,3,"Incorrect keyframe parameters.");if(!ve.yd)return ln(I,4,"Frame not displayable.");oe+=3,ue-=3;var be=I.Kc;if(ve.Rb){if(7>ue)return ln(I,7,"cannot parse picture header");if(!pi(re,oe,ue))return ln(I,3,"Bad code word");be.c=16383&(re[oe+4]<<8|re[oe+3]),be.Td=re[oe+4]>>6,be.i=16383&(re[oe+6]<<8|re[oe+5]),be.Ud=re[oe+6]>>6,oe+=7,ue-=7,I.za=be.c+15>>4,I.Ub=be.i+15>>4,H.width=be.c,H.height=be.i,H.Da=0,H.j=0,H.v=0,H.va=H.width,H.o=H.height,H.da=0,H.ib=H.width,H.hb=H.height,H.U=H.width,H.T=H.height,a((pe=I.Pa).jb,0,255,pe.jb.length),r((pe=I.Qa)!=null),pe.Cb=0,pe.Bb=0,pe.Fb=1,a(pe.Zb,0,0,pe.Zb.length),a(pe.Lb,0,0,pe.Lb)}if(ve.ub>ue)return ln(I,7,"bad partition length");T(pe=I.m,re,oe,ve.ub),oe+=ve.ub,ue-=ve.ub,ve.Rb&&(be.Ld=ae(pe),be.Kd=ae(pe)),be=I.Qa;var _e,Pe=I.Pa;if(r(pe!=null),r(be!=null),be.Cb=ae(pe),be.Cb){if(be.Bb=ae(pe),ae(pe)){for(be.Fb=ae(pe),_e=0;4>_e;++_e)be.Zb[_e]=ae(pe)?G(pe,7):0;for(_e=0;4>_e;++_e)be.Lb[_e]=ae(pe)?G(pe,6):0}if(be.Bb)for(_e=0;3>_e;++_e)Pe.jb[_e]=ae(pe)?V(pe,8):255}else be.Bb=0;if(pe.Ka)return ln(I,3,"cannot parse segment header");if((be=I.ed).zd=ae(pe),be.Tb=V(pe,6),be.wb=V(pe,3),be.Pc=ae(pe),be.Pc&&ae(pe)){for(Pe=0;4>Pe;++Pe)ae(pe)&&(be.vd[Pe]=G(pe,6));for(Pe=0;4>Pe;++Pe)ae(pe)&&(be.od[Pe]=G(pe,6))}if(I.L=be.Tb==0?0:be.zd?1:2,pe.Ka)return ln(I,3,"cannot parse filter header");var Fe=ue;if(ue=_e=oe,oe=_e+Fe,be=Fe,I.Xb=(1<<V(I.m,2))-1,Fe<3*(Pe=I.Xb))re=7;else{for(_e+=3*Pe,be-=3*Pe,Fe=0;Fe<Pe;++Fe){var Ze=re[ue+0]|re[ue+1]<<8|re[ue+2]<<16;Ze>be&&(Ze=be),T(I.Jc[+Fe],re,_e,Ze),_e+=Ze,be-=Ze,ue+=3}T(I.Jc[+Pe],re,_e,be),re=_e<oe?0:5}if(re!=0)return ln(I,re,"cannot parse partitions");for(re=V(_e=I.m,7),ue=ae(_e)?G(_e,4):0,oe=ae(_e)?G(_e,4):0,be=ae(_e)?G(_e,4):0,Pe=ae(_e)?G(_e,4):0,_e=ae(_e)?G(_e,4):0,Fe=I.Qa,Ze=0;4>Ze;++Ze){if(Fe.Cb){var $e=Fe.Zb[Ze];Fe.Fb||($e+=re)}else{if(0<Ze){I.pb[Ze]=I.pb[0];continue}$e=re}var Ge=I.pb[Ze];Ge.Sc[0]=Ls[xa($e+ue,127)],Ge.Sc[1]=Wu[xa($e+0,127)],Ge.Eb[0]=2*Ls[xa($e+oe,127)],Ge.Eb[1]=101581*Wu[xa($e+be,127)]>>16,8>Ge.Eb[1]&&(Ge.Eb[1]=8),Ge.Qc[0]=Ls[xa($e+Pe,117)],Ge.Qc[1]=Wu[xa($e+_e,127)],Ge.lc=$e+_e}if(!ve.Rb)return ln(I,4,"Not a key frame.");for(ae(pe),ve=I.Pa,re=0;4>re;++re){for(ue=0;8>ue;++ue)for(oe=0;3>oe;++oe)for(be=0;11>be;++be)Pe=se(pe,Uf[re][ue][oe][be])?V(pe,8):$u[re][ue][oe][be],ve.Wc[re][ue].Yb[oe][be]=Pe;for(ue=0;17>ue;++ue)ve.Xc[re][ue]=ve.Wc[re][_c[ue]]}return I.kc=ae(pe),I.kc&&(I.Bd=V(pe,8)),I.cb=1}function Ma(I,H,re,oe,ue,pe,ve){var be=H[ue].Yb[re];for(re=0;16>ue;++ue){if(!se(I,be[re+0]))return ue;for(;!se(I,be[re+1]);)if(be=H[++ue].Yb[0],re=0,ue==16)return 16;var _e=H[ue+1].Yb;if(se(I,be[re+2])){var Pe=I,Fe=0;if(se(Pe,($e=be)[(Ze=re)+3]))if(se(Pe,$e[Ze+6])){for(be=0,Ze=2*(Fe=se(Pe,$e[Ze+8]))+($e=se(Pe,$e[Ze+9+Fe])),Fe=0,$e=uf[Ze];$e[be];++be)Fe+=Fe+se(Pe,$e[be]);Fe+=3+(8<<Ze)}else se(Pe,$e[Ze+7])?(Fe=7+2*se(Pe,165),Fe+=se(Pe,145)):Fe=5+se(Pe,159);else Fe=se(Pe,$e[Ze+4])?3+se(Pe,$e[Ze+5]):2;be=_e[2]}else Fe=1,be=_e[1];_e=ve+Wa[ue],0>(Pe=I).b&&Z(Pe);var Ze,$e=Pe.b,Ge=(Ze=Pe.Ca>>1)-(Pe.I>>$e)>>31;--Pe.b,Pe.Ca+=Ge,Pe.Ca|=1,Pe.I-=(Ze+1&Ge)<<$e,pe[_e]=((Fe^Ge)-Ge)*oe[(0<ue)+0]}return 16}function Ia(I){var H=I.rb[I.sb-1];H.la=0,H.Na=0,a(I.zc,0,0,I.zc.length),I.ja=0}function ii(I,H){if(I==null)return 0;if(H==null)return ln(I,2,"NULL VP8Io parameter in VP8Decode().");if(!I.cb&&!Ti(I,H))return 0;if(r(I.cb),H.ac==null||H.ac(H)){H.ob&&(I.L=0);var re=is[I.L];if(I.L==2?(I.yb=0,I.zb=0):(I.yb=H.v-re>>4,I.zb=H.j-re>>4,0>I.yb&&(I.yb=0),0>I.zb&&(I.zb=0)),I.Va=H.o+15+re>>4,I.Hb=H.va+15+re>>4,I.Hb>I.za&&(I.Hb=I.za),I.Va>I.Ub&&(I.Va=I.Ub),0<I.L){var oe=I.ed;for(re=0;4>re;++re){var ue;if(I.Qa.Cb){var pe=I.Qa.Lb[re];I.Qa.Fb||(pe+=oe.Tb)}else pe=oe.Tb;for(ue=0;1>=ue;++ue){var ve=I.gd[re][ue],be=pe;if(oe.Pc&&(be+=oe.vd[0],ue&&(be+=oe.od[0])),0<(be=0>be?0:63<be?63:be)){var _e=be;0<oe.wb&&(_e=4<oe.wb?_e>>2:_e>>1)>9-oe.wb&&(_e=9-oe.wb),1>_e&&(_e=1),ve.dd=_e,ve.tc=2*be+_e,ve.ld=40<=be?2:15<=be?1:0}else ve.tc=0;ve.La=ue}}}re=0}else ln(I,6,"Frame setup failed"),re=I.a;if(re=re==0){if(re){I.$c=0,0<I.Aa||(I.Ic=as);e:{re=I.Ic,oe=4*(_e=I.za);var Pe=32*_e,Fe=_e+1,Ze=0<I.L?_e*(0<I.Aa?2:1):0,$e=(I.Aa==2?2:1)*_e;if((ve=oe+832+(ue=3*(16*re+is[I.L])/2*Pe)+(pe=I.Fa!=null&&0<I.Fa.length?I.Kc.c*I.Kc.i:0))!=ve)re=0;else{if(ve>I.Vb){if(I.Vb=0,I.Ec=i(ve),I.Fc=0,I.Ec==null){re=ln(I,1,"no memory during frame initialization.");break e}I.Vb=ve}ve=I.Ec,be=I.Fc,I.Ac=ve,I.Bc=be,be+=oe,I.Gd=o(Pe,so),I.Hd=0,I.rb=o(Fe+1,dl),I.sb=1,I.wa=Ze?o(Ze,oo):null,I.Y=0,I.D.Nb=0,I.D.wa=I.wa,I.D.Y=I.Y,0<I.Aa&&(I.D.Y+=_e),r(!0),I.oc=ve,I.pc=be,be+=832,I.ya=o($e,qu),I.aa=0,I.D.ya=I.ya,I.D.aa=I.aa,I.Aa==2&&(I.D.aa+=_e),I.R=16*_e,I.B=8*_e,_e=(Pe=is[I.L])*I.R,Pe=Pe/2*I.B,I.sa=ve,I.ta=be+_e,I.qa=I.sa,I.ra=I.ta+16*re*I.R+Pe,I.Ha=I.qa,I.Ia=I.ra+8*re*I.B+Pe,I.$c=0,be+=ue,I.mb=pe?ve:null,I.nb=pe?be:null,r(be+pe<=I.Fc+I.Vb),Ia(I),a(I.Ac,I.Bc,0,oe),re=1}}if(re){if(H.ka=0,H.y=I.sa,H.O=I.ta,H.f=I.qa,H.N=I.ra,H.ea=I.Ha,H.Vd=I.Ia,H.fa=I.R,H.Rc=I.B,H.F=null,H.J=0,!cu){for(re=-255;255>=re;++re)Jn[255+re]=0>re?-re:re;for(re=-1020;1020>=re;++re)Io[1020+re]=-128>re?-128:127<re?127:re;for(re=-112;112>=re;++re)_l[112+re]=-16>re?-16:15<re?15:re;for(re=-255;510>=re;++re)nl[255+re]=0>re?0:255<re?255:re;cu=1}rl=Rr,ko=ha,Lo=Gs,Yn=af,Lr=iu,Mr=nu,xn=Fi,Xn=_n,ts=Ba,No=lu,To=ea,Va=ta,kn=As,ho=Zs,Ro=oi,Mo=Ii,zi=ji,un=vl,Hi[0]=Oo,Hi[1]=Ws,Hi[2]=Ys,Hi[3]=lo,Hi[4]=zu,Hi[5]=In,Hi[6]=Xs,Hi[7]=Ks,Hi[8]=ou,Hi[9]=au,Ui[0]=Ps,Ui[1]=yc,Ui[2]=$o,Ui[3]=xs,Ui[4]=gn,Ui[5]=Yo,Ui[6]=ja,na[0]=Fa,na[1]=$s,na[2]=of,na[3]=uo,na[4]=Mi,na[5]=su,na[6]=Da,re=1}else re=0}re&&(re=function(Ge,bt){for(Ge.M=0;Ge.M<Ge.Va;++Ge.M){var lt,Me=Ge.Jc[Ge.M&Ge.Xb],qe=Ge.m,Ue=Ge;for(lt=0;lt<Ue.za;++lt){var ht=qe,gt=Ue,qt=gt.Ac,jt=gt.Bc+4*lt,ar=gt.zc,Mt=gt.ya[gt.aa+lt];if(gt.Qa.Bb?Mt.$b=se(ht,gt.Pa.jb[0])?2+se(ht,gt.Pa.jb[2]):se(ht,gt.Pa.jb[1]):Mt.$b=0,gt.kc&&(Mt.Ad=se(ht,gt.Bd)),Mt.Za=!se(ht,145)+0,Mt.Za){var Ir=Mt.Ob,Dr=0;for(gt=0;4>gt;++gt){var Nr,yr=ar[0+gt];for(Nr=0;4>Nr;++Nr){yr=zf[qt[jt+Nr]][yr];for(var Yr=wc[se(ht,yr[0])];0<Yr;)Yr=wc[2*Yr+se(ht,yr[Yr])];yr=-Yr,qt[jt+Nr]=yr}n(Ir,Dr,qt,jt,4),Dr+=4,ar[0+gt]=yr}}else yr=se(ht,156)?se(ht,128)?1:3:se(ht,163)?2:0,Mt.Ob[0]=yr,a(qt,jt,yr,4),a(ar,0,yr,4);Mt.Dd=se(ht,142)?se(ht,114)?se(ht,183)?1:3:2:0}if(Ue.m.Ka)return ln(Ge,7,"Premature end-of-partition0 encountered.");for(;Ge.ja<Ge.za;++Ge.ja){if(Ue=Me,ht=(qe=Ge).rb[qe.sb-1],qt=qe.rb[qe.sb+qe.ja],lt=qe.ya[qe.aa+qe.ja],jt=qe.kc?lt.Ad:0)ht.la=qt.la=0,lt.Za||(ht.Na=qt.Na=0),lt.Hc=0,lt.Gc=0,lt.ia=0;else{var Zr,Zt;if(ht=qt,qt=Ue,jt=qe.Pa.Xc,ar=qe.ya[qe.aa+qe.ja],Mt=qe.pb[ar.$b],gt=ar.ad,Ir=0,Dr=qe.rb[qe.sb-1],yr=Nr=0,a(gt,Ir,0,384),ar.Za)var Br=0,Ln=jt[3];else{Yr=i(16);var Dn=ht.Na+Dr.Na;if(Dn=Ol(qt,jt[1],Dn,Mt.Eb,0,Yr,0),ht.Na=Dr.Na=(0<Dn)+0,1<Dn)rl(Yr,0,gt,Ir);else{var ci=Yr[0]+3>>3;for(Yr=0;256>Yr;Yr+=16)gt[Ir+Yr]=ci}Br=1,Ln=jt[0]}var xr=15&ht.la,Gi=15&Dr.la;for(Yr=0;4>Yr;++Yr){var En=1&Gi;for(ci=Zt=0;4>ci;++ci)xr=xr>>1|(En=(Dn=Ol(qt,Ln,Dn=En+(1&xr),Mt.Sc,Br,gt,Ir))>Br)<<7,Zt=Zt<<2|(3<Dn?3:1<Dn?2:gt[Ir+0]!=0),Ir+=16;xr>>=4,Gi=Gi>>1|En<<7,Nr=(Nr<<8|Zt)>>>0}for(Ln=xr,Br=Gi>>4,Zr=0;4>Zr;Zr+=2){for(Zt=0,xr=ht.la>>4+Zr,Gi=Dr.la>>4+Zr,Yr=0;2>Yr;++Yr){for(En=1&Gi,ci=0;2>ci;++ci)Dn=En+(1&xr),xr=xr>>1|(En=0<(Dn=Ol(qt,jt[2],Dn,Mt.Qc,0,gt,Ir)))<<3,Zt=Zt<<2|(3<Dn?3:1<Dn?2:gt[Ir+0]!=0),Ir+=16;xr>>=2,Gi=Gi>>1|En<<5}yr|=Zt<<4*Zr,Ln|=xr<<4<<Zr,Br|=(240&Gi)<<Zr}ht.la=Ln,Dr.la=Br,ar.Hc=Nr,ar.Gc=yr,ar.ia=43690&yr?0:Mt.ia,jt=!(Nr|yr)}if(0<qe.L&&(qe.wa[qe.Y+qe.ja]=qe.gd[lt.$b][lt.Za],qe.wa[qe.Y+qe.ja].La|=!jt),Ue.Ka)return ln(Ge,7,"Premature end-of-file encountered.")}if(Ia(Ge),qe=bt,Ue=1,lt=(Me=Ge).D,ht=0<Me.L&&Me.M>=Me.zb&&Me.M<=Me.Va,Me.Aa==0)e:{if(lt.M=Me.M,lt.uc=ht,Di(Me,lt),Ue=1,lt=(Zt=Me.D).Nb,ht=(yr=is[Me.L])*Me.R,qt=yr/2*Me.B,Yr=16*lt*Me.R,ci=8*lt*Me.B,jt=Me.sa,ar=Me.ta-ht+Yr,Mt=Me.qa,gt=Me.ra-qt+ci,Ir=Me.Ha,Dr=Me.Ia-qt+ci,Gi=(xr=Zt.M)==0,Nr=xr>=Me.Va-1,Me.Aa==2&&Di(Me,Zt),Zt.uc)for(En=(Dn=Me).D.M,r(Dn.D.uc),Zt=Dn.yb;Zt<Dn.Hb;++Zt){Br=Zt,Ln=En;var Bn=(fi=(jr=Dn).D).Nb;Zr=jr.R;var fi=fi.wa[fi.Y+Br],Pi=jr.sa,pa=jr.ta+16*Bn*Zr+16*Br,$a=fi.dd,yn=fi.tc;if(yn!=0)if(r(3<=yn),jr.L==1)0<Br&&Mo(Pi,pa,Zr,yn+4),fi.La&&un(Pi,pa,Zr,yn),0<Ln&&Ro(Pi,pa,Zr,yn+4),fi.La&&zi(Pi,pa,Zr,yn);else{var qn=jr.B,oa=jr.qa,Do=jr.ra+8*Bn*qn+8*Br,vo=jr.Ha,jr=jr.Ia+8*Bn*qn+8*Br;Bn=fi.ld,0<Br&&(Xn(Pi,pa,Zr,yn+4,$a,Bn),No(oa,Do,vo,jr,qn,yn+4,$a,Bn)),fi.La&&(Va(Pi,pa,Zr,yn,$a,Bn),ho(oa,Do,vo,jr,qn,yn,$a,Bn)),0<Ln&&(xn(Pi,pa,Zr,yn+4,$a,Bn),ts(oa,Do,vo,jr,qn,yn+4,$a,Bn)),fi.La&&(To(Pi,pa,Zr,yn,$a,Bn),kn(oa,Do,vo,jr,qn,yn,$a,Bn))}}if(Me.ia&&alert("todo:DitherRow"),qe.put!=null){if(Zt=16*xr,xr=16*(xr+1),Gi?(qe.y=Me.sa,qe.O=Me.ta+Yr,qe.f=Me.qa,qe.N=Me.ra+ci,qe.ea=Me.Ha,qe.W=Me.Ia+ci):(Zt-=yr,qe.y=jt,qe.O=ar,qe.f=Mt,qe.N=gt,qe.ea=Ir,qe.W=Dr),Nr||(xr-=yr),xr>qe.o&&(xr=qe.o),qe.F=null,qe.J=null,Me.Fa!=null&&0<Me.Fa.length&&Zt<xr&&(qe.J=uu(Me,qe,Zt,xr-Zt),qe.F=Me.mb,qe.F==null&&qe.F.length==0)){Ue=ln(Me,3,"Could not decode alpha data.");break e}Zt<qe.j&&(yr=qe.j-Zt,Zt=qe.j,r(!(1&yr)),qe.O+=Me.R*yr,qe.N+=Me.B*(yr>>1),qe.W+=Me.B*(yr>>1),qe.F!=null&&(qe.J+=qe.width*yr)),Zt<xr&&(qe.O+=qe.v,qe.N+=qe.v>>1,qe.W+=qe.v>>1,qe.F!=null&&(qe.J+=qe.v),qe.ka=Zt-qe.j,qe.U=qe.va-qe.v,qe.T=xr-Zt,Ue=qe.put(qe))}lt+1!=Me.Ic||Nr||(n(Me.sa,Me.ta-ht,jt,ar+16*Me.R,ht),n(Me.qa,Me.ra-qt,Mt,gt+8*Me.B,qt),n(Me.Ha,Me.Ia-qt,Ir,Dr+8*Me.B,qt))}if(!Ue)return ln(Ge,6,"Output aborted.")}return 1}(I,H)),H.bc!=null&&H.bc(H),re&=1}return re?(I.cb=0,re):0}function Ri(I,H,re,oe,ue){ue=I[H+re+32*oe]+(ue>>3),I[H+re+32*oe]=-256&ue?0>ue?0:255:ue}function pl(I,H,re,oe,ue,pe){Ri(I,H,0,re,oe+ue),Ri(I,H,1,re,oe+pe),Ri(I,H,2,re,oe-pe),Ri(I,H,3,re,oe-ue)}function fa(I){return(20091*I>>16)+I}function Wo(I,H,re,oe){var ue,pe=0,ve=i(16);for(ue=0;4>ue;++ue){var be=I[H+0]+I[H+8],_e=I[H+0]-I[H+8],Pe=(35468*I[H+4]>>16)-fa(I[H+12]),Fe=fa(I[H+4])+(35468*I[H+12]>>16);ve[pe+0]=be+Fe,ve[pe+1]=_e+Pe,ve[pe+2]=_e-Pe,ve[pe+3]=be-Fe,pe+=4,H++}for(ue=pe=0;4>ue;++ue)be=(I=ve[pe+0]+4)+ve[pe+8],_e=I-ve[pe+8],Pe=(35468*ve[pe+4]>>16)-fa(ve[pe+12]),Ri(re,oe,0,0,be+(Fe=fa(ve[pe+4])+(35468*ve[pe+12]>>16))),Ri(re,oe,1,0,_e+Pe),Ri(re,oe,2,0,_e-Pe),Ri(re,oe,3,0,be-Fe),pe++,oe+=32}function nu(I,H,re,oe){var ue=I[H+0]+4,pe=35468*I[H+4]>>16,ve=fa(I[H+4]),be=35468*I[H+1]>>16;pl(re,oe,0,ue+ve,I=fa(I[H+1]),be),pl(re,oe,1,ue+pe,I,be),pl(re,oe,2,ue-pe,I,be),pl(re,oe,3,ue-ve,I,be)}function ha(I,H,re,oe,ue){Wo(I,H,re,oe),ue&&Wo(I,H+16,re,oe+4)}function Gs(I,H,re,oe){ko(I,H+0,re,oe,1),ko(I,H+32,re,oe+128,1)}function af(I,H,re,oe){var ue;for(I=I[H+0]+4,ue=0;4>ue;++ue)for(H=0;4>H;++H)Ri(re,oe,H,ue,I)}function iu(I,H,re,oe){I[H+0]&&Yn(I,H+0,re,oe),I[H+16]&&Yn(I,H+16,re,oe+4),I[H+32]&&Yn(I,H+32,re,oe+128),I[H+48]&&Yn(I,H+48,re,oe+128+4)}function Rr(I,H,re,oe){var ue,pe=i(16);for(ue=0;4>ue;++ue){var ve=I[H+0+ue]+I[H+12+ue],be=I[H+4+ue]+I[H+8+ue],_e=I[H+4+ue]-I[H+8+ue],Pe=I[H+0+ue]-I[H+12+ue];pe[0+ue]=ve+be,pe[8+ue]=ve-be,pe[4+ue]=Pe+_e,pe[12+ue]=Pe-_e}for(ue=0;4>ue;++ue)ve=(I=pe[0+4*ue]+3)+pe[3+4*ue],be=pe[1+4*ue]+pe[2+4*ue],_e=pe[1+4*ue]-pe[2+4*ue],Pe=I-pe[3+4*ue],re[oe+0]=ve+be>>3,re[oe+16]=Pe+_e>>3,re[oe+32]=ve-be>>3,re[oe+48]=Pe-_e>>3,oe+=64}function Ss(I,H,re){var oe,ue=H-32,pe=yi,ve=255-I[ue-1];for(oe=0;oe<re;++oe){var be,_e=pe,Pe=ve+I[H-1];for(be=0;be<re;++be)I[H+be]=_e[Pe+I[ue+be]];H+=32}}function Ws(I,H){Ss(I,H,4)}function $s(I,H){Ss(I,H,8)}function yc(I,H){Ss(I,H,16)}function $o(I,H){var re;for(re=0;16>re;++re)n(I,H+32*re,I,H-32,16)}function xs(I,H){var re;for(re=16;0<re;--re)a(I,H,I[H-1],16),H+=32}function Es(I,H,re){var oe;for(oe=0;16>oe;++oe)a(H,re+32*oe,I,16)}function Ps(I,H){var re,oe=16;for(re=0;16>re;++re)oe+=I[H-1+32*re]+I[H+re-32];Es(oe>>5,I,H)}function gn(I,H){var re,oe=8;for(re=0;16>re;++re)oe+=I[H-1+32*re];Es(oe>>4,I,H)}function Yo(I,H){var re,oe=8;for(re=0;16>re;++re)oe+=I[H+re-32];Es(oe>>4,I,H)}function ja(I,H){Es(128,I,H)}function It(I,H,re){return I+2*H+re+2>>2}function Ys(I,H){var re,oe=H-32;for(oe=new Uint8Array([It(I[oe-1],I[oe+0],I[oe+1]),It(I[oe+0],I[oe+1],I[oe+2]),It(I[oe+1],I[oe+2],I[oe+3]),It(I[oe+2],I[oe+3],I[oe+4])]),re=0;4>re;++re)n(I,H+32*re,oe,0,oe.length)}function lo(I,H){var re=I[H-1],oe=I[H-1+32],ue=I[H-1+64],pe=I[H-1+96];ce(I,H+0,16843009*It(I[H-1-32],re,oe)),ce(I,H+32,16843009*It(re,oe,ue)),ce(I,H+64,16843009*It(oe,ue,pe)),ce(I,H+96,16843009*It(ue,pe,pe))}function Oo(I,H){var re,oe=4;for(re=0;4>re;++re)oe+=I[H+re-32]+I[H-1+32*re];for(oe>>=3,re=0;4>re;++re)a(I,H+32*re,oe,4)}function zu(I,H){var re=I[H-1+0],oe=I[H-1+32],ue=I[H-1+64],pe=I[H-1-32],ve=I[H+0-32],be=I[H+1-32],_e=I[H+2-32],Pe=I[H+3-32];I[H+0+96]=It(oe,ue,I[H-1+96]),I[H+1+96]=I[H+0+64]=It(re,oe,ue),I[H+2+96]=I[H+1+64]=I[H+0+32]=It(pe,re,oe),I[H+3+96]=I[H+2+64]=I[H+1+32]=I[H+0+0]=It(ve,pe,re),I[H+3+64]=I[H+2+32]=I[H+1+0]=It(be,ve,pe),I[H+3+32]=I[H+2+0]=It(_e,be,ve),I[H+3+0]=It(Pe,_e,be)}function Xs(I,H){var re=I[H+1-32],oe=I[H+2-32],ue=I[H+3-32],pe=I[H+4-32],ve=I[H+5-32],be=I[H+6-32],_e=I[H+7-32];I[H+0+0]=It(I[H+0-32],re,oe),I[H+1+0]=I[H+0+32]=It(re,oe,ue),I[H+2+0]=I[H+1+32]=I[H+0+64]=It(oe,ue,pe),I[H+3+0]=I[H+2+32]=I[H+1+64]=I[H+0+96]=It(ue,pe,ve),I[H+3+32]=I[H+2+64]=I[H+1+96]=It(pe,ve,be),I[H+3+64]=I[H+2+96]=It(ve,be,_e),I[H+3+96]=It(be,_e,_e)}function In(I,H){var re=I[H-1+0],oe=I[H-1+32],ue=I[H-1+64],pe=I[H-1-32],ve=I[H+0-32],be=I[H+1-32],_e=I[H+2-32],Pe=I[H+3-32];I[H+0+0]=I[H+1+64]=pe+ve+1>>1,I[H+1+0]=I[H+2+64]=ve+be+1>>1,I[H+2+0]=I[H+3+64]=be+_e+1>>1,I[H+3+0]=_e+Pe+1>>1,I[H+0+96]=It(ue,oe,re),I[H+0+64]=It(oe,re,pe),I[H+0+32]=I[H+1+96]=It(re,pe,ve),I[H+1+32]=I[H+2+96]=It(pe,ve,be),I[H+2+32]=I[H+3+96]=It(ve,be,_e),I[H+3+32]=It(be,_e,Pe)}function Ks(I,H){var re=I[H+0-32],oe=I[H+1-32],ue=I[H+2-32],pe=I[H+3-32],ve=I[H+4-32],be=I[H+5-32],_e=I[H+6-32],Pe=I[H+7-32];I[H+0+0]=re+oe+1>>1,I[H+1+0]=I[H+0+64]=oe+ue+1>>1,I[H+2+0]=I[H+1+64]=ue+pe+1>>1,I[H+3+0]=I[H+2+64]=pe+ve+1>>1,I[H+0+32]=It(re,oe,ue),I[H+1+32]=I[H+0+96]=It(oe,ue,pe),I[H+2+32]=I[H+1+96]=It(ue,pe,ve),I[H+3+32]=I[H+2+96]=It(pe,ve,be),I[H+3+64]=It(ve,be,_e),I[H+3+96]=It(be,_e,Pe)}function au(I,H){var re=I[H-1+0],oe=I[H-1+32],ue=I[H-1+64],pe=I[H-1+96];I[H+0+0]=re+oe+1>>1,I[H+2+0]=I[H+0+32]=oe+ue+1>>1,I[H+2+32]=I[H+0+64]=ue+pe+1>>1,I[H+1+0]=It(re,oe,ue),I[H+3+0]=I[H+1+32]=It(oe,ue,pe),I[H+3+32]=I[H+1+64]=It(ue,pe,pe),I[H+3+64]=I[H+2+64]=I[H+0+96]=I[H+1+96]=I[H+2+96]=I[H+3+96]=pe}function ou(I,H){var re=I[H-1+0],oe=I[H-1+32],ue=I[H-1+64],pe=I[H-1+96],ve=I[H-1-32],be=I[H+0-32],_e=I[H+1-32],Pe=I[H+2-32];I[H+0+0]=I[H+2+32]=re+ve+1>>1,I[H+0+32]=I[H+2+64]=oe+re+1>>1,I[H+0+64]=I[H+2+96]=ue+oe+1>>1,I[H+0+96]=pe+ue+1>>1,I[H+3+0]=It(be,_e,Pe),I[H+2+0]=It(ve,be,_e),I[H+1+0]=I[H+3+32]=It(re,ve,be),I[H+1+32]=I[H+3+64]=It(oe,re,ve),I[H+1+64]=I[H+3+96]=It(ue,oe,re),I[H+1+96]=It(pe,ue,oe)}function of(I,H){var re;for(re=0;8>re;++re)n(I,H+32*re,I,H-32,8)}function uo(I,H){var re;for(re=0;8>re;++re)a(I,H,I[H-1],8),H+=32}function ai(I,H,re){var oe;for(oe=0;8>oe;++oe)a(H,re+32*oe,I,8)}function Fa(I,H){var re,oe=8;for(re=0;8>re;++re)oe+=I[H+re-32]+I[H-1+32*re];ai(oe>>4,I,H)}function su(I,H){var re,oe=4;for(re=0;8>re;++re)oe+=I[H+re-32];ai(oe>>3,I,H)}function Mi(I,H){var re,oe=4;for(re=0;8>re;++re)oe+=I[H-1+32*re];ai(oe>>3,I,H)}function Da(I,H){ai(128,I,H)}function Ao(I,H,re){var oe=I[H-re],ue=I[H+0],pe=3*(ue-oe)+jo[1020+I[H-2*re]-I[H+re]],ve=Sl[112+(pe+4>>3)];I[H-re]=yi[255+oe+Sl[112+(pe+3>>3)]],I[H+0]=yi[255+ue-ve]}function Os(I,H,re,oe){var ue=I[H+0],pe=I[H+re];return Ga[255+I[H-2*re]-I[H-re]]>oe||Ga[255+pe-ue]>oe}function gl(I,H,re,oe){return 4*Ga[255+I[H-re]-I[H+0]]+Ga[255+I[H-2*re]-I[H+re]]<=oe}function Uu(I,H,re,oe,ue){var pe=I[H-3*re],ve=I[H-2*re],be=I[H-re],_e=I[H+0],Pe=I[H+re],Fe=I[H+2*re],Ze=I[H+3*re];return 4*Ga[255+be-_e]+Ga[255+ve-Pe]>oe?0:Ga[255+I[H-4*re]-pe]<=ue&&Ga[255+pe-ve]<=ue&&Ga[255+ve-be]<=ue&&Ga[255+Ze-Fe]<=ue&&Ga[255+Fe-Pe]<=ue&&Ga[255+Pe-_e]<=ue}function oi(I,H,re,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(I,H+oe,re,ue)&&Ao(I,H+oe,re)}function Ii(I,H,re,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(I,H+oe*re,1,ue)&&Ao(I,H+oe*re,1)}function ji(I,H,re,oe){var ue;for(ue=3;0<ue;--ue)oi(I,H+=4*re,re,oe)}function vl(I,H,re,oe){var ue;for(ue=3;0<ue;--ue)Ii(I,H+=4,re,oe)}function Sa(I,H,re,oe,ue,pe,ve,be){for(pe=2*pe+1;0<ue--;){if(Uu(I,H,re,pe,ve))if(Os(I,H,re,be))Ao(I,H,re);else{var _e=I,Pe=H,Fe=re,Ze=_e[Pe-2*Fe],$e=_e[Pe-Fe],Ge=_e[Pe+0],bt=_e[Pe+Fe],lt=_e[Pe+2*Fe],Me=27*(Ue=jo[1020+3*(Ge-$e)+jo[1020+Ze-bt]])+63>>7,qe=18*Ue+63>>7,Ue=9*Ue+63>>7;_e[Pe-3*Fe]=yi[255+_e[Pe-3*Fe]+Ue],_e[Pe-2*Fe]=yi[255+Ze+qe],_e[Pe-Fe]=yi[255+$e+Me],_e[Pe+0]=yi[255+Ge-Me],_e[Pe+Fe]=yi[255+bt-qe],_e[Pe+2*Fe]=yi[255+lt-Ue]}H+=oe}}function wn(I,H,re,oe,ue,pe,ve,be){for(pe=2*pe+1;0<ue--;){if(Uu(I,H,re,pe,ve))if(Os(I,H,re,be))Ao(I,H,re);else{var _e=I,Pe=H,Fe=re,Ze=_e[Pe-Fe],$e=_e[Pe+0],Ge=_e[Pe+Fe],bt=Sl[112+((lt=3*($e-Ze))+4>>3)],lt=Sl[112+(lt+3>>3)],Me=bt+1>>1;_e[Pe-2*Fe]=yi[255+_e[Pe-2*Fe]+Me],_e[Pe-Fe]=yi[255+Ze+lt],_e[Pe+0]=yi[255+$e-bt],_e[Pe+Fe]=yi[255+Ge-Me]}H+=oe}}function Fi(I,H,re,oe,ue,pe){Sa(I,H,re,1,16,oe,ue,pe)}function _n(I,H,re,oe,ue,pe){Sa(I,H,1,re,16,oe,ue,pe)}function ea(I,H,re,oe,ue,pe){var ve;for(ve=3;0<ve;--ve)wn(I,H+=4*re,re,1,16,oe,ue,pe)}function ta(I,H,re,oe,ue,pe){var ve;for(ve=3;0<ve;--ve)wn(I,H+=4,1,re,16,oe,ue,pe)}function Ba(I,H,re,oe,ue,pe,ve,be){Sa(I,H,ue,1,8,pe,ve,be),Sa(re,oe,ue,1,8,pe,ve,be)}function lu(I,H,re,oe,ue,pe,ve,be){Sa(I,H,1,ue,8,pe,ve,be),Sa(re,oe,1,ue,8,pe,ve,be)}function As(I,H,re,oe,ue,pe,ve,be){wn(I,H+4*ue,ue,1,8,pe,ve,be),wn(re,oe+4*ue,ue,1,8,pe,ve,be)}function Zs(I,H,re,oe,ue,pe,ve,be){wn(I,H+4,1,ue,8,pe,ve,be),wn(re,oe+4,1,ue,8,pe,ve,be)}function $n(){this.ba=new Nt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Xt,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function gi(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Jr(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Qs(){this.ua=0,this.Wa=new ye,this.vb=new ye,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new k,this.yc=new C}function qa(){this.xb=this.a=0,this.l=new Xr,this.ca=new Nt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new z,this.Pb=0,this.wd=new z,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Qs,this.ab=0,this.gc=o(4,Jr),this.Oc=0}function ml(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Xr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Xo(I,H,re,oe,ue,pe,ve){for(I=I==null?0:I[H+0],H=0;H<ve;++H)ue[pe+H]=I+re[oe+H]&255,I=ue[pe+H]}function yl(I,H,re,oe,ue,pe,ve){var be;if(I==null)Xo(null,null,re,oe,ue,pe,ve);else for(be=0;be<ve;++be)ue[pe+be]=I[H+be]+re[oe+be]&255}function Ko(I,H,re,oe,ue,pe,ve){if(I==null)Xo(null,null,re,oe,ue,pe,ve);else{var be,_e=I[H+0],Pe=_e,Fe=_e;for(be=0;be<ve;++be)Pe=Fe+(_e=I[H+be])-Pe,Fe=re[oe+be]+(-256&Pe?0>Pe?0:255:Pe)&255,Pe=_e,ue[pe+be]=Fe}}function uu(I,H,re,oe){var ue=H.width,pe=H.o;if(r(I!=null&&H!=null),0>re||0>=oe||re+oe>pe)return null;if(!I.Cc){if(I.ga==null){var ve;if(I.ga=new ml,(ve=I.ga==null)||(ve=H.width*H.o,r(I.Gb.length==0),I.Gb=i(ve),I.Uc=0,I.Gb==null?ve=0:(I.mb=I.Gb,I.nb=I.Uc,I.rc=null,ve=1),ve=!ve),!ve){ve=I.ga;var be=I.Fa,_e=I.P,Pe=I.qc,Fe=I.mb,Ze=I.nb,$e=_e+1,Ge=Pe-1,bt=ve.l;if(r(be!=null&&Fe!=null&&H!=null),Vi[0]=null,Vi[1]=Xo,Vi[2]=yl,Vi[3]=Ko,ve.ca=Fe,ve.tb=Ze,ve.c=H.width,ve.i=H.height,r(0<ve.c&&0<ve.i),1>=Pe)H=0;else if(ve.$a=be[_e+0]>>0&3,ve.Z=be[_e+0]>>2&3,ve.Lc=be[_e+0]>>4&3,_e=be[_e+0]>>6&3,0>ve.$a||1<ve.$a||4<=ve.Z||1<ve.Lc||_e)H=0;else if(bt.put=He,bt.ac=it,bt.bc=wt,bt.ma=ve,bt.width=H.width,bt.height=H.height,bt.Da=H.Da,bt.v=H.v,bt.va=H.va,bt.j=H.j,bt.o=H.o,ve.$a)e:{r(ve.$a==1),H=wi();t:for(;;){if(H==null){H=0;break e}if(r(ve!=null),ve.mc=H,H.c=ve.c,H.i=ve.i,H.l=ve.l,H.l.ma=ve,H.l.width=ve.c,H.l.height=ve.i,H.a=0,$(H.m,be,$e,Ge),!Ni(ve.c,ve.i,1,H,null)||(H.ab==1&&H.gc[0].hc==3&&Ur(H.s)?(ve.ic=1,be=H.c*H.i,H.Ta=null,H.Ua=0,H.V=i(be),H.Ba=0,H.V==null?(H.a=1,H=0):H=1):(ve.ic=0,H=_i(H,ve.c)),!H))break t;H=1;break e}ve.mc=null,H=0}else H=Ge>=ve.c*ve.i;ve=!H}if(ve)return null;I.ga.Lc!=1?I.Ga=0:oe=pe-re}r(I.ga!=null),r(re+oe<=pe);e:{if(H=(be=I.ga).c,pe=be.l.o,be.$a==0){if($e=I.rc,Ge=I.Vc,bt=I.Fa,_e=I.P+1+re*H,Pe=I.mb,Fe=I.nb+re*H,r(_e<=I.P+I.qc),be.Z!=0)for(r(Vi[be.Z]!=null),ve=0;ve<oe;++ve)Vi[be.Z]($e,Ge,bt,_e,Pe,Fe,H),$e=Pe,Ge=Fe,Fe+=H,_e+=H;else for(ve=0;ve<oe;++ve)n(Pe,Fe,bt,_e,H),$e=Pe,Ge=Fe,Fe+=H,_e+=H;I.rc=$e,I.Vc=Ge}else{if(r(be.mc!=null),H=re+oe,r((ve=be.mc)!=null),r(H<=ve.i),ve.C>=H)H=1;else if(be.ic||Qe(),be.ic){be=ve.V,$e=ve.Ba,Ge=ve.c;var lt=ve.i,Me=(bt=1,_e=ve.$/Ge,Pe=ve.$%Ge,Fe=ve.m,Ze=ve.s,ve.$),qe=Ge*lt,Ue=Ge*H,ht=Ze.wc,gt=Me<Ue?er(Ze,Pe,_e):null;r(Me<=qe),r(H<=lt),r(Ur(Ze));t:for(;;){for(;!Fe.h&&Me<Ue;){if(Pe&ht||(gt=er(Ze,Pe,_e)),r(gt!=null),J(Fe),256>(lt=Dt(gt.G[0],gt.H[0],Fe)))be[$e+Me]=lt,++Me,++Pe>=Ge&&(Pe=0,++_e<=H&&!(_e%16)&&Wn(ve,_e));else{if(!(280>lt)){bt=0;break t}lt=_t(lt-256,Fe);var qt,jt=Dt(gt.G[4],gt.H[4],Fe);if(J(Fe),!(Me>=(jt=Ht(Ge,jt=_t(jt,Fe)))&&qe-Me>=lt)){bt=0;break t}for(qt=0;qt<lt;++qt)be[$e+Me+qt]=be[$e+Me+qt-jt];for(Me+=lt,Pe+=lt;Pe>=Ge;)Pe-=Ge,++_e<=H&&!(_e%16)&&Wn(ve,_e);Me<Ue&&Pe&ht&&(gt=er(Ze,Pe,_e))}r(Fe.h==Y(Fe))}Wn(ve,_e>H?H:_e);break t}!bt||Fe.h&&Me<qe?(bt=0,ve.a=Fe.h?5:3):ve.$=Me,H=bt}else H=sn(ve,ve.V,ve.Ba,ve.c,ve.i,H,ao);if(!H){oe=0;break e}}re+oe>=pe&&(I.Cc=1),oe=1}if(!oe)return null;if(I.Cc&&((oe=I.ga)!=null&&(oe.mc=null),I.ga=null,0<I.Ga))return alert("todo:WebPDequantizeLevels"),null}return I.nb+re*ue}function X(I,H,re,oe,ue,pe){for(;0<ue--;){var ve,be=I,_e=H+(re?1:0),Pe=I,Fe=H+(re?0:3);for(ve=0;ve<oe;++ve){var Ze=Pe[Fe+4*ve];Ze!=255&&(Ze*=32897,be[_e+4*ve+0]=be[_e+4*ve+0]*Ze>>23,be[_e+4*ve+1]=be[_e+4*ve+1]*Ze>>23,be[_e+4*ve+2]=be[_e+4*ve+2]*Ze>>23)}H+=pe}}function fe(I,H,re,oe,ue){for(;0<oe--;){var pe;for(pe=0;pe<re;++pe){var ve=I[H+2*pe+0],be=15&(Pe=I[H+2*pe+1]),_e=4369*be,Pe=(240&Pe|Pe>>4)*_e>>16;I[H+2*pe+0]=(240&ve|ve>>4)*_e>>16&240|(15&ve|ve<<4)*_e>>16>>4&15,I[H+2*pe+1]=240&Pe|be}H+=ue}}function Ae(I,H,re,oe,ue,pe,ve,be){var _e,Pe,Fe=255;for(Pe=0;Pe<ue;++Pe){for(_e=0;_e<oe;++_e){var Ze=I[H+_e];pe[ve+4*_e]=Ze,Fe&=Ze}H+=re,ve+=be}return Fe!=255}function je(I,H,re,oe,ue){var pe;for(pe=0;pe<ue;++pe)re[oe+pe]=I[H+pe]>>8}function Qe(){xi=X,tn=fe,$r=Ae,Fn=je}function dt(I,H,re){R[I]=function(oe,ue,pe,ve,be,_e,Pe,Fe,Ze,$e,Ge,bt,lt,Me,qe,Ue,ht){var gt,qt=ht-1>>1,jt=be[_e+0]|Pe[Fe+0]<<16,ar=Ze[$e+0]|Ge[bt+0]<<16;r(oe!=null);var Mt=3*jt+ar+131074>>2;for(H(oe[ue+0],255&Mt,Mt>>16,lt,Me),pe!=null&&(Mt=3*ar+jt+131074>>2,H(pe[ve+0],255&Mt,Mt>>16,qe,Ue)),gt=1;gt<=qt;++gt){var Ir=be[_e+gt]|Pe[Fe+gt]<<16,Dr=Ze[$e+gt]|Ge[bt+gt]<<16,Nr=jt+Ir+ar+Dr+524296,yr=Nr+2*(Ir+ar)>>3;Mt=yr+jt>>1,jt=(Nr=Nr+2*(jt+Dr)>>3)+Ir>>1,H(oe[ue+2*gt-1],255&Mt,Mt>>16,lt,Me+(2*gt-1)*re),H(oe[ue+2*gt-0],255&jt,jt>>16,lt,Me+(2*gt-0)*re),pe!=null&&(Mt=Nr+ar>>1,jt=yr+Dr>>1,H(pe[ve+2*gt-1],255&Mt,Mt>>16,qe,Ue+(2*gt-1)*re),H(pe[ve+2*gt+0],255&jt,jt>>16,qe,Ue+(2*gt+0)*re)),jt=Ir,ar=Dr}1&ht||(Mt=3*jt+ar+131074>>2,H(oe[ue+ht-1],255&Mt,Mt>>16,lt,Me+(ht-1)*re),pe!=null&&(Mt=3*ar+jt+131074>>2,H(pe[ve+ht-1],255&Mt,Mt>>16,qe,Ue+(ht-1)*re)))}}function St(){da[xl]=Hf,da[Fo]=Ns,da[sf]=Vf,da[El]=vu,da[fu]=ui,da[cn]=bi,da[Vu]=Sc,da[Pl]=Ns,da[ks]=vu,da[hu]=ui,da[du]=bi}function Ft(I){return I&-16384?0>I?0:255:I>>ns}function ir(I,H){return Ft((19077*I>>8)+(26149*H>>8)-14234)}function gr(I,H,re){return Ft((19077*I>>8)-(6419*H>>8)-(13320*re>>8)+8708)}function dr(I,H){return Ft((19077*I>>8)+(33050*H>>8)-17685)}function Sr(I,H,re,oe,ue){oe[ue+0]=ir(I,re),oe[ue+1]=gr(I,H,re),oe[ue+2]=dr(I,H)}function Cn(I,H,re,oe,ue){oe[ue+0]=dr(I,H),oe[ue+1]=gr(I,H,re),oe[ue+2]=ir(I,re)}function Sn(I,H,re,oe,ue){var pe=gr(I,H,re);H=pe<<3&224|dr(I,H)>>3,oe[ue+0]=248&ir(I,re)|pe>>5,oe[ue+1]=H}function jn(I,H,re,oe,ue){var pe=240&dr(I,H)|15;oe[ue+0]=240&ir(I,re)|gr(I,H,re)>>4,oe[ue+1]=pe}function Qn(I,H,re,oe,ue){oe[ue+0]=255,Sr(I,H,re,oe,ue+1)}function si(I,H,re,oe,ue){Cn(I,H,re,oe,ue),oe[ue+3]=255}function za(I,H,re,oe,ue){Sr(I,H,re,oe,ue),oe[ue+3]=255}function xa(I,H){return 0>I?0:I>H?H:I}function Ea(I,H,re){R[I]=function(oe,ue,pe,ve,be,_e,Pe,Fe,Ze){for(var $e=Fe+(-2&Ze)*re;Fe!=$e;)H(oe[ue+0],pe[ve+0],be[_e+0],Pe,Fe),H(oe[ue+1],pe[ve+0],be[_e+0],Pe,Fe+re),ue+=2,++ve,++_e,Fe+=2*re;1&Ze&&H(oe[ue+0],pe[ve+0],be[_e+0],Pe,Fe)}}function Zo(I,H,re){return re==0?I==0?H==0?6:5:H==0?4:0:re}function Qo(I,H,re,oe,ue){switch(I>>>30){case 3:ko(H,re,oe,ue,0);break;case 2:Mr(H,re,oe,ue);break;case 1:Yn(H,re,oe,ue)}}function Di(I,H){var re,oe,ue=H.M,pe=H.Nb,ve=I.oc,be=I.pc+40,_e=I.oc,Pe=I.pc+584,Fe=I.oc,Ze=I.pc+600;for(re=0;16>re;++re)ve[be+32*re-1]=129;for(re=0;8>re;++re)_e[Pe+32*re-1]=129,Fe[Ze+32*re-1]=129;for(0<ue?ve[be-1-32]=_e[Pe-1-32]=Fe[Ze-1-32]=129:(a(ve,be-32-1,127,21),a(_e,Pe-32-1,127,9),a(Fe,Ze-32-1,127,9)),oe=0;oe<I.za;++oe){var $e=H.ya[H.aa+oe];if(0<oe){for(re=-1;16>re;++re)n(ve,be+32*re-4,ve,be+32*re+12,4);for(re=-1;8>re;++re)n(_e,Pe+32*re-4,_e,Pe+32*re+4,4),n(Fe,Ze+32*re-4,Fe,Ze+32*re+4,4)}var Ge=I.Gd,bt=I.Hd+oe,lt=$e.ad,Me=$e.Hc;if(0<ue&&(n(ve,be-32,Ge[bt].y,0,16),n(_e,Pe-32,Ge[bt].f,0,8),n(Fe,Ze-32,Ge[bt].ea,0,8)),$e.Za){var qe=ve,Ue=be-32+16;for(0<ue&&(oe>=I.za-1?a(qe,Ue,Ge[bt].y[15],4):n(qe,Ue,Ge[bt+1].y,0,4)),re=0;4>re;re++)qe[Ue+128+re]=qe[Ue+256+re]=qe[Ue+384+re]=qe[Ue+0+re];for(re=0;16>re;++re,Me<<=2)qe=ve,Ue=be+Yu[re],Hi[$e.Ob[re]](qe,Ue),Qo(Me,lt,16*+re,qe,Ue)}else if(qe=Zo(oe,ue,$e.Ob[0]),Ui[qe](ve,be),Me!=0)for(re=0;16>re;++re,Me<<=2)Qo(Me,lt,16*+re,ve,be+Yu[re]);for(re=$e.Gc,qe=Zo(oe,ue,$e.Dd),na[qe](_e,Pe),na[qe](Fe,Ze),Me=lt,qe=_e,Ue=Pe,255&($e=re>>0)&&(170&$e?Lo(Me,256,qe,Ue):Lr(Me,256,qe,Ue)),$e=Fe,Me=Ze,255&(re>>=8)&&(170&re?Lo(lt,320,$e,Me):Lr(lt,320,$e,Me)),ue<I.Ub-1&&(n(Ge[bt].y,0,ve,be+480,16),n(Ge[bt].f,0,_e,Pe+224,8),n(Ge[bt].ea,0,Fe,Ze+224,8)),re=8*pe*I.B,Ge=I.sa,bt=I.ta+16*oe+16*pe*I.R,lt=I.qa,$e=I.ra+8*oe+re,Me=I.Ha,qe=I.Ia+8*oe+re,re=0;16>re;++re)n(Ge,bt+re*I.R,ve,be+32*re,16);for(re=0;8>re;++re)n(lt,$e+re*I.B,_e,Pe+32*re,8),n(Me,qe+re*I.B,Fe,Ze+32*re,8)}}function Ua(I,H,re,oe,ue,pe,ve,be,_e){var Pe=[0],Fe=[0],Ze=0,$e=_e!=null?_e.kd:0,Ge=_e??new gi;if(I==null||12>re)return 7;Ge.data=I,Ge.w=H,Ge.ha=re,H=[H],re=[re],Ge.gb=[Ge.gb];e:{var bt=H,lt=re,Me=Ge.gb;if(r(I!=null),r(lt!=null),r(Me!=null),Me[0]=0,12<=lt[0]&&!t(I,bt[0],"RIFF")){if(t(I,bt[0]+8,"WEBP")){Me=3;break e}var qe=Le(I,bt[0]+4);if(12>qe||4294967286<qe){Me=3;break e}if($e&&qe>lt[0]-8){Me=7;break e}Me[0]=qe,bt[0]+=12,lt[0]-=12}Me=0}if(Me!=0)return Me;for(qe=0<Ge.gb[0],re=re[0];;){e:{var Ue=I;lt=H,Me=re;var ht=Pe,gt=Fe,qt=bt=[0];if((Mt=Ze=[Ze])[0]=0,8>Me[0])Me=7;else{if(!t(Ue,lt[0],"VP8X")){if(Le(Ue,lt[0]+4)!=10){Me=3;break e}if(18>Me[0]){Me=7;break e}var jt=Le(Ue,lt[0]+8),ar=1+Oe(Ue,lt[0]+12);if(2147483648<=ar*(Ue=1+Oe(Ue,lt[0]+15))){Me=3;break e}qt!=null&&(qt[0]=jt),ht!=null&&(ht[0]=ar),gt!=null&&(gt[0]=Ue),lt[0]+=18,Me[0]-=18,Mt[0]=1}Me=0}}if(Ze=Ze[0],bt=bt[0],Me!=0)return Me;if(lt=!!(2&bt),!qe&&Ze)return 3;if(pe!=null&&(pe[0]=!!(16&bt)),ve!=null&&(ve[0]=lt),be!=null&&(be[0]=0),ve=Pe[0],bt=Fe[0],Ze&<&&_e==null){Me=0;break}if(4>re){Me=7;break}if(qe&&Ze||!qe&&!Ze&&!t(I,H[0],"ALPH")){re=[re],Ge.na=[Ge.na],Ge.P=[Ge.P],Ge.Sa=[Ge.Sa];e:{jt=I,Me=H,qe=re;var Mt=Ge.gb;ht=Ge.na,gt=Ge.P,qt=Ge.Sa,ar=22,r(jt!=null),r(qe!=null),Ue=Me[0];var Ir=qe[0];for(r(ht!=null),r(qt!=null),ht[0]=null,gt[0]=null,qt[0]=0;;){if(Me[0]=Ue,qe[0]=Ir,8>Ir){Me=7;break e}var Dr=Le(jt,Ue+4);if(4294967286<Dr){Me=3;break e}var Nr=8+Dr+1&-2;if(ar+=Nr,0<Mt&&ar>Mt){Me=3;break e}if(!t(jt,Ue,"VP8 ")||!t(jt,Ue,"VP8L")){Me=0;break e}if(Ir[0]<Nr){Me=7;break e}t(jt,Ue,"ALPH")||(ht[0]=jt,gt[0]=Ue+8,qt[0]=Dr),Ue+=Nr,Ir-=Nr}}if(re=re[0],Ge.na=Ge.na[0],Ge.P=Ge.P[0],Ge.Sa=Ge.Sa[0],Me!=0)break}re=[re],Ge.Ja=[Ge.Ja],Ge.xa=[Ge.xa];e:if(Mt=I,Me=H,qe=re,ht=Ge.gb[0],gt=Ge.Ja,qt=Ge.xa,jt=Me[0],Ue=!t(Mt,jt,"VP8 "),ar=!t(Mt,jt,"VP8L"),r(Mt!=null),r(qe!=null),r(gt!=null),r(qt!=null),8>qe[0])Me=7;else{if(Ue||ar){if(Mt=Le(Mt,jt+4),12<=ht&&Mt>ht-12){Me=3;break e}if($e&&Mt>qe[0]-8){Me=7;break e}gt[0]=Mt,Me[0]+=8,qe[0]-=8,qt[0]=ar}else qt[0]=5<=qe[0]&&Mt[jt+0]==47&&!(Mt[jt+4]>>5),gt[0]=qe[0];Me=0}if(re=re[0],Ge.Ja=Ge.Ja[0],Ge.xa=Ge.xa[0],H=H[0],Me!=0)break;if(4294967286<Ge.Ja)return 3;if(be==null||lt||(be[0]=Ge.xa?2:1),ve=[ve],bt=[bt],Ge.xa){if(5>re){Me=7;break}be=ve,$e=bt,lt=pe,I==null||5>re?I=0:5<=re&&I[H+0]==47&&!(I[H+4]>>5)?(qe=[0],Mt=[0],ht=[0],$(gt=new z,I,H,re),ze(gt,qe,Mt,ht)?(be!=null&&(be[0]=qe[0]),$e!=null&&($e[0]=Mt[0]),lt!=null&&(lt[0]=ht[0]),I=1):I=0):I=0}else{if(10>re){Me=7;break}be=bt,I==null||10>re||!pi(I,H+3,re-3)?I=0:($e=I[H+0]|I[H+1]<<8|I[H+2]<<16,lt=16383&(I[H+7]<<8|I[H+6]),I=16383&(I[H+9]<<8|I[H+8]),1&$e||3<($e>>1&7)||!($e>>4&1)||$e>>5>=Ge.Ja||!lt||!I?I=0:(ve&&(ve[0]=lt),be&&(be[0]=I),I=1))}if(!I||(ve=ve[0],bt=bt[0],Ze&&(Pe[0]!=ve||Fe[0]!=bt)))return 3;_e!=null&&(_e[0]=Ge,_e.offset=H-_e.w,r(4294967286>H-_e.w),r(_e.offset==_e.ha-re));break}return Me==0||Me==7&&Ze&&_e==null?(pe!=null&&(pe[0]|=Ge.na!=null&&0<Ge.na.length),oe!=null&&(oe[0]=ve),ue!=null&&(ue[0]=bt),0):Me}function Js(I,H,re){var oe=H.width,ue=H.height,pe=0,ve=0,be=oe,_e=ue;if(H.Da=I!=null&&0<I.Da,H.Da&&(be=I.cd,_e=I.bd,pe=I.v,ve=I.j,11>re||(pe&=-2,ve&=-2),0>pe||0>ve||0>=be||0>=_e||pe+be>oe||ve+_e>ue))return 0;if(H.v=pe,H.j=ve,H.va=pe+be,H.o=ve+_e,H.U=be,H.T=_e,H.da=I!=null&&0<I.da,H.da){if(!Je(be,_e,re=[I.ib],pe=[I.hb]))return 0;H.ib=re[0],H.hb=pe[0]}return H.ob=I!=null&&I.ob,H.Kb=I==null||!I.Sd,H.da&&(H.ob=H.ib<3*oe/4&&H.hb<3*ue/4,H.Kb=0),1}function bl(I){if(I==null)return 2;if(11>I.S){var H=I.f.RGBA;H.fb+=(I.height-1)*H.A,H.A=-H.A}else H=I.f.kb,I=I.height,H.O+=(I-1)*H.fa,H.fa=-H.fa,H.N+=(I-1>>1)*H.Ab,H.Ab=-H.Ab,H.W+=(I-1>>1)*H.Db,H.Db=-H.Db,H.F!=null&&(H.J+=(I-1)*H.lb,H.lb=-H.lb);return 0}function ra(I,H,re,oe){if(oe==null||0>=I||0>=H)return 2;if(re!=null){if(re.Da){var ue=re.cd,pe=re.bd,ve=-2&re.v,be=-2&re.j;if(0>ve||0>be||0>=ue||0>=pe||ve+ue>I||be+pe>H)return 2;I=ue,H=pe}if(re.da){if(!Je(I,H,ue=[re.ib],pe=[re.hb]))return 2;I=ue[0],H=pe[0]}}oe.width=I,oe.height=H;e:{var _e=oe.width,Pe=oe.height;if(I=oe.S,0>=_e||0>=Pe||!(I>=xl&&13>I))I=2;else{if(0>=oe.Rd&&oe.sd==null){ve=pe=ue=H=0;var Fe=(be=_e*Cl[I])*Pe;if(11>I||(pe=(Pe+1)/2*(H=(_e+1)/2),I==12&&(ve=(ue=_e)*Pe)),(Pe=i(Fe+2*pe+ve))==null){I=1;break e}oe.sd=Pe,11>I?((_e=oe.f.RGBA).eb=Pe,_e.fb=0,_e.A=be,_e.size=Fe):((_e=oe.f.kb).y=Pe,_e.O=0,_e.fa=be,_e.Fd=Fe,_e.f=Pe,_e.N=0+Fe,_e.Ab=H,_e.Cd=pe,_e.ea=Pe,_e.W=0+Fe+pe,_e.Db=H,_e.Ed=pe,I==12&&(_e.F=Pe,_e.J=0+Fe+2*pe),_e.Tc=ve,_e.lb=ue)}if(H=1,ue=oe.S,pe=oe.width,ve=oe.height,ue>=xl&&13>ue)if(11>ue)I=oe.f.RGBA,H&=(be=Math.abs(I.A))*(ve-1)+pe<=I.size,H&=be>=pe*Cl[ue],H&=I.eb!=null;else{I=oe.f.kb,be=(pe+1)/2,Fe=(ve+1)/2,_e=Math.abs(I.fa),Pe=Math.abs(I.Ab);var Ze=Math.abs(I.Db),$e=Math.abs(I.lb),Ge=$e*(ve-1)+pe;H&=_e*(ve-1)+pe<=I.Fd,H&=Pe*(Fe-1)+be<=I.Cd,H=(H&=Ze*(Fe-1)+be<=I.Ed)&_e>=pe&Pe>=be&Ze>=be,H&=I.y!=null,H&=I.f!=null,H&=I.ea!=null,ue==12&&(H&=$e>=pe,H&=Ge<=I.Tc,H&=I.F!=null)}else H=0;I=H?0:2}}return I!=0||re!=null&&re.fd&&(I=bl(oe)),I}var en=64,el=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],wl=24,Pa=32,Ha=8,Si=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Ee("Predictor0","PredictorAdd0"),R.Predictor0=function(){return 4278190080},R.Predictor1=function(I){return I},R.Predictor2=function(I,H,re){return H[re+0]},R.Predictor3=function(I,H,re){return H[re+1]},R.Predictor4=function(I,H,re){return H[re-1]},R.Predictor5=function(I,H,re){return he(he(I,H[re+1]),H[re+0])},R.Predictor6=function(I,H,re){return he(I,H[re-1])},R.Predictor7=function(I,H,re){return he(I,H[re+0])},R.Predictor8=function(I,H,re){return he(H[re-1],H[re+0])},R.Predictor9=function(I,H,re){return he(H[re+0],H[re+1])},R.Predictor10=function(I,H,re){return he(he(I,H[re-1]),he(H[re+0],H[re+1]))},R.Predictor11=function(I,H,re){var oe=H[re+0];return 0>=Xe(oe>>24&255,I>>24&255,(H=H[re-1])>>24&255)+Xe(oe>>16&255,I>>16&255,H>>16&255)+Xe(oe>>8&255,I>>8&255,H>>8&255)+Xe(255&oe,255&I,255&H)?oe:I},R.Predictor12=function(I,H,re){var oe=H[re+0];return(Re((I>>24&255)+(oe>>24&255)-((H=H[re-1])>>24&255))<<24|Re((I>>16&255)+(oe>>16&255)-(H>>16&255))<<16|Re((I>>8&255)+(oe>>8&255)-(H>>8&255))<<8|Re((255&I)+(255&oe)-(255&H)))>>>0},R.Predictor13=function(I,H,re){var oe=H[re-1];return(Ie((I=he(I,H[re+0]))>>24&255,oe>>24&255)<<24|Ie(I>>16&255,oe>>16&255)<<16|Ie(I>>8&255,oe>>8&255)<<8|Ie(I>>0&255,oe>>0&255))>>>0};var tl=R.PredictorAdd0;R.PredictorAdd1=rt,Ee("Predictor2","PredictorAdd2"),Ee("Predictor3","PredictorAdd3"),Ee("Predictor4","PredictorAdd4"),Ee("Predictor5","PredictorAdd5"),Ee("Predictor6","PredictorAdd6"),Ee("Predictor7","PredictorAdd7"),Ee("Predictor8","PredictorAdd8"),Ee("Predictor9","PredictorAdd9"),Ee("Predictor10","PredictorAdd10"),Ee("Predictor11","PredictorAdd11"),Ee("Predictor12","PredictorAdd12"),Ee("Predictor13","PredictorAdd13");var co=R.PredictorAdd2;mt("ColorIndexInverseTransform","MapARGB","32b",function(I){return I>>8&255},function(I){return I}),mt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(I){return I},function(I){return I>>8&255});var Hu,vi=R.ColorIndexInverseTransform,Bi=R.MapARGB,Cs=R.VP8LColorIndexInverseTransformAlpha,Co=R.MapAlpha,mi=R.VP8LPredictorsAdd=[];mi.length=16,(R.VP8LPredictors=[]).length=16,(R.VP8LPredictorsAdd_C=[]).length=16,(R.VP8LPredictors_C=[]).length=16;var Jo,li,qi,es,Wr,fo,rl,ko,Mr,Lo,Yn,Lr,xn,Xn,ts,No,To,Va,kn,ho,Ro,Mo,zi,un,xi,tn,$r,Fn,Jn=i(511),Io=i(2041),_l=i(225),nl=i(767),cu=0,jo=Io,Sl=_l,yi=nl,Ga=Jn,xl=0,Fo=1,sf=2,El=3,fu=4,cn=5,Vu=6,Pl=7,ks=8,hu=9,du=10,pu=[2,3,7],bc=[3,3,11],il=[280,256,256,256,40],Bf=[0,1,1,1,0],qh=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],qf=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],lf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Gu=8,Ls=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Wu=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Ol=null,uf=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Wa=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],wc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],$u=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],zf=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Uf=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],_c=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ui=[],Hi=[],na=[],po=1,gu=2,Vi=[],da=[];dt("UpsampleRgbLinePair",Sr,3),dt("UpsampleBgrLinePair",Cn,3),dt("UpsampleRgbaLinePair",za,4),dt("UpsampleBgraLinePair",si,4),dt("UpsampleArgbLinePair",Qn,4),dt("UpsampleRgba4444LinePair",jn,2),dt("UpsampleRgb565LinePair",Sn,2);var Hf=R.UpsampleRgbLinePair,Vf=R.UpsampleBgrLinePair,Ns=R.UpsampleRgbaLinePair,vu=R.UpsampleBgraLinePair,ui=R.UpsampleArgbLinePair,bi=R.UpsampleRgba4444LinePair,Sc=R.UpsampleRgb565LinePair,rs=16,go=1<<rs-1,Kr=-227,rn=482,ns=6,Ei=0,ia=i(256),al=i(256),Al=i(256),aa=i(256),mu=i(rn-Kr),cf=i(rn-Kr);Ea("YuvToRgbRow",Sr,3),Ea("YuvToBgrRow",Cn,3),Ea("YuvToRgbaRow",za,4),Ea("YuvToBgraRow",si,4),Ea("YuvToArgbRow",Qn,4),Ea("YuvToRgba4444Row",jn,2),Ea("YuvToRgb565Row",Sn,2);var Yu=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],is=[0,2,8],Gf=[8,7,6,4,4,2,2,2,1,1,1,1],as=1;this.WebPDecodeRGBA=function(I,H,re,oe,ue){var pe=Fo,ve=new $n,be=new Nt;ve.ba=be,be.S=pe,be.width=[be.width],be.height=[be.height];var _e=be.width,Pe=be.height,Fe=new Jt;if(Fe==null||I==null)var Ze=2;else r(Fe!=null),Ze=Ua(I,H,re,Fe.width,Fe.height,Fe.Pd,Fe.Qd,Fe.format,null);if(Ze!=0?_e=0:(_e!=null&&(_e[0]=Fe.width[0]),Pe!=null&&(Pe[0]=Fe.height[0]),_e=1),_e){be.width=be.width[0],be.height=be.height[0],oe!=null&&(oe[0]=be.width),ue!=null&&(ue[0]=be.height);e:{if(oe=new Xr,(ue=new gi).data=I,ue.w=H,ue.ha=re,ue.kd=1,H=[0],r(ue!=null),((I=Ua(ue.data,ue.w,ue.ha,null,null,null,H,null,ue))==0||I==7)&&H[0]&&(I=4),(H=I)==0){if(r(ve!=null),oe.data=ue.data,oe.w=ue.w+ue.offset,oe.ha=ue.ha-ue.offset,oe.put=He,oe.ac=it,oe.bc=wt,oe.ma=ve,ue.xa){if((I=wi())==null){ve=1;break e}if(function($e,Ge){var bt=[0],lt=[0],Me=[0];t:for(;;){if($e==null)return 0;if(Ge==null)return $e.a=2,0;if($e.l=Ge,$e.a=0,$($e.m,Ge.data,Ge.w,Ge.ha),!ze($e.m,bt,lt,Me)){$e.a=3;break t}if($e.xb=gu,Ge.width=bt[0],Ge.height=lt[0],!Ni(bt[0],lt[0],1,$e,null))break t;return 1}return r($e.a!=0),0}(I,oe)){if(oe=(H=ra(oe.width,oe.height,ve.Oa,ve.ba))==0){t:{oe=I;r:for(;;){if(oe==null){oe=0;break t}if(r(oe.s.yc!=null),r(oe.s.Ya!=null),r(0<oe.s.Wb),r((re=oe.l)!=null),r((ue=re.ma)!=null),oe.xb!=0){if(oe.ca=ue.ba,oe.tb=ue.tb,r(oe.ca!=null),!Js(ue.Oa,re,El)){oe.a=2;break r}if(!_i(oe,re.width)||re.da)break r;if((re.da||ft(oe.ca.S))&&Qe(),11>oe.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),oe.ca.f.kb.F!=null&&Qe()),oe.Pb&&0<oe.s.ua&&oe.s.vb.X==null&&!ke(oe.s.vb,oe.s.Wa.Xa)){oe.a=1;break r}oe.xb=0}if(!sn(oe,oe.V,oe.Ba,oe.c,oe.i,re.o,kr))break r;ue.Dc=oe.Ma,oe=1;break t}r(oe.a!=0),oe=0}oe=!oe}oe&&(H=I.a)}else H=I.a}else{if((I=new Ar)==null){ve=1;break e}if(I.Fa=ue.na,I.P=ue.P,I.qc=ue.Sa,Ti(I,oe)){if((H=ra(oe.width,oe.height,ve.Oa,ve.ba))==0){if(I.Aa=0,re=ve.Oa,r((ue=I)!=null),re!=null){if(0<(_e=0>(_e=re.Md)?0:100<_e?255:255*_e/100)){for(Pe=Fe=0;4>Pe;++Pe)12>(Ze=ue.pb[Pe]).lc&&(Ze.ia=_e*Gf[0>Ze.lc?0:Ze.lc]>>3),Fe|=Ze.ia;Fe&&(alert("todo:VP8InitRandom"),ue.ia=1)}ue.Ga=re.Id,100<ue.Ga?ue.Ga=100:0>ue.Ga&&(ue.Ga=0)}ii(I,oe)||(H=I.a)}}else H=I.a}H==0&&ve.Oa!=null&&ve.Oa.fd&&(H=bl(ve.ba))}ve=H}pe=ve!=0?null:11>pe?be.f.RGBA.eb:be.f.kb.y}else pe=null;return pe};var Cl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(R,F){for(var j="",O=0;O<4;O++)j+=String.fromCharCode(R[F++]);return j}function d(R,F){return(R[F+0]<<0|R[F+1]<<8|R[F+2]<<16)>>>0}function p(R,F){return(R[F+0]<<0|R[F+1]<<8|R[F+2]<<16|R[F+3]<<24)>>>0}new c;var y=[0],f=[0],_=[],S=new c,w=e,x=function(R,F){var j={},O=0,C=!1,A=0,k=0;if(j.frames=[],!function(D,Y,Q,J){for(var Z=0;Z<J;Z++)if(D[Y+Z]!=Q.charCodeAt(Z))return!0;return!1}(R,F,"RIFF",4)){for(p(R,F+=4),F+=8;F<R.length;){var T=u(R,F),V=p(R,F+=4);F+=4;var G=V+(1&V);switch(T){case"VP8 ":case"VP8L":j.frames[O]===void 0&&(j.frames[O]={}),(W=j.frames[O]).src_off=C?k:F-8,W.src_size=A+V+8,O++,C&&(C=!1,A=0,k=0);break;case"VP8X":(W=j.header={}).feature_flags=R[F];var $=F+4;W.canvas_width=1+d(R,$),$+=3,W.canvas_height=1+d(R,$),$+=3;break;case"ALPH":C=!0,A=G+8,k=F-8;break;case"ANIM":(W=j.header).bgcolor=p(R,F),$=F+4,W.loop_count=(U=R)[(z=$)+0]<<0|U[z+1]<<8,$+=2;break;case"ANMF":var te,W;(W=j.frames[O]={}).offset_x=2*d(R,F),F+=3,W.offset_y=2*d(R,F),F+=3,W.width=1+d(R,F),F+=3,W.height=1+d(R,F),F+=3,W.duration=d(R,F),F+=3,te=R[F++],W.dispose=1&te,W.blend=te>>1&1}T!="ANMF"&&(F+=G)}var U,z;return j}}(w,0);x.response=w,x.rgbaoutput=!0,x.dataurl=!1;var v=x.header?x.header:null,g=x.frames?x.frames:null;if(v){v.loop_counter=v.loop_count,y=[v.canvas_height],f=[v.canvas_width];for(var E=0;E<g.length&&g[E].blend!=0;E++);}var b=g[0],M=S.WebPDecodeRGBA(w,b.src_off,b.src_size,f,y);b.rgba=M,b.imgwidth=f[0],b.imgheight=y[0];for(var N=0;N<f[0]*y[0]*4;N++)_[N]=M[N];return this.width=f,this.height=y,this.data=_,this}(function(e){var r=function(){return typeof T2=="function"},t=function(y,f,_,S){var w=4,x=o;switch(S){case e.image_compression.FAST:w=1,x=i;break;case e.image_compression.MEDIUM:w=6,x=s;break;case e.image_compression.SLOW:w=9,x=c}y=n(y,f,_,x);var v=T2(y,{level:w});return e.__addimage__.arrayBufferToBinaryString(v)},n=function(y,f,_,S){for(var w,x,v,g=y.length/f,E=new Uint8Array(y.length+g),b=d(),M=0;M<g;M+=1){if(v=M*f,w=y.subarray(v,v+f),S)E.set(S(w,_,x),v+M);else{for(var N,R=b.length,F=[];N<R;N+=1)F[N]=b[N](w,_,x);var j=p(F.concat());E.set(F[j],v+M)}x=w}return E},a=function(y){var f=Array.apply([],y);return f.unshift(0),f},i=function(y,f){var _,S=[],w=y.length;S[0]=1;for(var x=0;x<w;x+=1)_=y[x-f]||0,S[x+1]=y[x]-_+256&255;return S},o=function(y,f,_){var S,w=[],x=y.length;w[0]=2;for(var v=0;v<x;v+=1)S=_&&_[v]||0,w[v+1]=y[v]-S+256&255;return w},s=function(y,f,_){var S,w,x=[],v=y.length;x[0]=3;for(var g=0;g<v;g+=1)S=y[g-f]||0,w=_&&_[g]||0,x[g+1]=y[g]+256-(S+w>>>1)&255;return x},c=function(y,f,_){var S,w,x,v,g=[],E=y.length;g[0]=4;for(var b=0;b<E;b+=1)S=y[b-f]||0,w=_&&_[b]||0,x=_&&_[b-f]||0,v=u(S,w,x),g[b+1]=y[b]-v+256&255;return g},u=function(y,f,_){if(y===f&&f===_)return y;var S=Math.abs(f-_),w=Math.abs(y-_),x=Math.abs(y+f-_-_);return S<=w&&S<=x?y:w<=x?f:_},d=function(){return[a,i,o,s,c]},p=function(y){var f=y.map(function(_){return _.reduce(function(S,w){return S+Math.abs(w)},0)});return f.indexOf(Math.min.apply(null,f))};e.processPNG=function(y,f,_,S){var w,x,v,g,E,b,M,N,R,F,j,O,C,A,k,T=this.decode.FLATE_DECODE,V="";if(this.__addimage__.isArrayBuffer(y)&&(y=new Uint8Array(y)),this.__addimage__.isArrayBufferView(y)){if(y=(v=new nL(y)).imgData,x=v.bits,w=v.colorSpace,E=v.colors,[4,6].indexOf(v.colorType)!==-1){if(v.bits===8){R=(N=v.pixelBitlength==32?new Uint32Array(v.decodePixels().buffer):v.pixelBitlength==16?new Uint16Array(v.decodePixels().buffer):new Uint8Array(v.decodePixels().buffer)).length,j=new Uint8Array(R*v.colors),F=new Uint8Array(R);var G,$=v.pixelBitlength-v.bits;for(A=0,k=0;A<R;A++){for(C=N[A],G=0;G<$;)j[k++]=C>>>G&255,G+=v.bits;F[A]=C>>>G&255}}if(v.bits===16){R=(N=new Uint32Array(v.decodePixels().buffer)).length,j=new Uint8Array(R*(32/v.pixelBitlength)*v.colors),F=new Uint8Array(R*(32/v.pixelBitlength)),O=v.colors>1,A=0,k=0;for(var te=0;A<R;)C=N[A++],j[k++]=C>>>0&255,O&&(j[k++]=C>>>16&255,C=N[A++],j[k++]=C>>>0&255),F[te++]=C>>>16&255;x=8}S!==e.image_compression.NONE&&r()?(y=t(j,v.width*v.colors,v.colors,S),M=t(F,v.width,1,S)):(y=j,M=F,T=void 0)}if(v.colorType===3&&(w=this.color_spaces.INDEXED,b=v.palette,v.transparency.indexed)){var W=v.transparency.indexed,U=0;for(A=0,R=W.length;A<R;++A)U+=W[A];if((U/=255)===R-1&&W.indexOf(0)!==-1)g=[W.indexOf(0)];else if(U!==R){for(N=v.decodePixels(),F=new Uint8Array(N.length),A=0,R=N.length;A<R;A++)F[A]=W[N[A]];M=t(F,v.width,1)}}var z=function(D){var Y;switch(D){case e.image_compression.FAST:Y=11;break;case e.image_compression.MEDIUM:Y=13;break;case e.image_compression.SLOW:Y=14;break;default:Y=12}return Y}(S);return T===this.decode.FLATE_DECODE&&(V="/Predictor "+z+" "),V+="/Colors "+E+" /BitsPerComponent "+x+" /Columns "+v.width,(this.__addimage__.isArrayBuffer(y)||this.__addimage__.isArrayBufferView(y))&&(y=this.__addimage__.arrayBufferToBinaryString(y)),(M&&this.__addimage__.isArrayBuffer(M)||this.__addimage__.isArrayBufferView(M))&&(M=this.__addimage__.arrayBufferToBinaryString(M)),{alias:_,data:y,index:f,filter:T,decodeParameters:V,transparency:g,palette:b,sMask:M,predictor:z,width:v.width,height:v.height,bitsPerComponent:x,colorSpace:w}}}})(hr.API),function(e){e.processGIF89A=function(r,t,n,a){var i=new iL(r),o=i.width,s=i.height,c=[];i.decodeAndBlitFrameRGBA(0,c);var u={data:c,width:o,height:s},d=new f2(100).encode(u,100);return e.processJPEG.call(this,d,t,n,a)},e.processGIF87A=e.processGIF89A}(hr.API),Hl.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var r=0;r<e;r++){var t=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0);this.palette[r]={red:a,green:n,blue:t,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Hl.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,r=this.width*this.height*4;this.data=new Uint8Array(r),this[e]()}catch(t){Gn.log("bit decode error:"+t)}},Hl.prototype.bit1=function(){var e,r=Math.ceil(this.width/8),t=r%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,a=0;a<r;a++)for(var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*a*4,s=0;s<8&&8*a+s<this.width;s++){var c=this.palette[i>>7-s&1];this.data[o+4*s]=c.blue,this.data[o+4*s+1]=c.green,this.data[o+4*s+2]=c.red,this.data[o+4*s+3]=255}t!==0&&(this.pos+=4-t)}},Hl.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),r=e%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<e;a++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*a*4,s=i>>4,c=15&i,u=this.palette[s];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*a+1>=this.width)break;u=this.palette[c],this.data[o+4]=u.blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}r!==0&&(this.pos+=4-r)}},Hl.prototype.bit8=function(){for(var e=this.width%4,r=this.height-1;r>=0;r--){for(var t=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var a=this.datav.getUint8(this.pos++,!0),i=t*this.width*4+4*n;if(a<this.palette.length){var o=this.palette[a];this.data[i]=o.red,this.data[i+1]=o.green,this.data[i+2]=o.blue,this.data[i+3]=255}else this.data[i]=255,this.data[i+1]=255,this.data[i+2]=255,this.data[i+3]=255}e!==0&&(this.pos+=4-e)}},Hl.prototype.bit15=function(){for(var e=this.width%3,r=parseInt("11111",2),t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<this.width;a++){var i=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(i&r)/r*255|0,s=(i>>5&r)/r*255|0,c=(i>>10&r)/r*255|0,u=i>>15?255:0,d=n*this.width*4+4*a;this.data[d]=c,this.data[d+1]=s,this.data[d+2]=o,this.data[d+3]=u}this.pos+=e}},Hl.prototype.bit16=function(){for(var e=this.width%3,r=parseInt("11111",2),t=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var a=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&r)/r*255|0,c=(o>>5&t)/t*255|0,u=(o>>11)/r*255|0,d=a*this.width*4+4*i;this.data[d]=u,this.data[d+1]=c,this.data[d+2]=s,this.data[d+3]=255}this.pos+=e}},Hl.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,t=0;t<this.width;t++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+4*t;this.data[o]=i,this.data[o+1]=a,this.data[o+2]=n,this.data[o+3]=255}this.pos+=this.width%4}},Hl.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var r=this.bottom_up?e:this.height-1-e,t=0;t<this.width;t++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+4*t;this.data[s]=i,this.data[s+1]=a,this.data[s+2]=n,this.data[s+3]=o}},Hl.prototype.getData=function(){return this.data},function(e){e.processBMP=function(r,t,n,a){var i=new Hl(r,!1),o=i.width,s=i.height,c={data:i.getData(),width:o,height:s},u=new f2(100).encode(c,100);return e.processJPEG.call(this,u,t,n,a)}}(hr.API),hw.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(r,t,n,a){var i=new hw(r),o=i.width,s=i.height,c={data:i.getData(),width:o,height:s},u=new f2(100).encode(c,100);return e.processJPEG.call(this,u,t,n,a)}}(hr.API),hr.API.processRGBA=function(e,r,t){for(var n=e.data,a=n.length,i=new Uint8Array(a/4*3),o=new Uint8Array(a/4),s=0,c=0,u=0;u<a;u+=4){var d=n[u],p=n[u+1],y=n[u+2],f=n[u+3];i[s++]=d,i[s++]=p,i[s++]=y,o[c++]=f}var _=this.__addimage__.arrayBufferToBinaryString(i);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:_,index:r,alias:t,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},hr.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},ah=hr.API,p1=ah.getCharWidthsArray=function(e,r){var t,n,a=(r=r||{}).font||this.internal.getFont(),i=r.fontSize||this.internal.getFontSize(),o=r.charSpace||this.internal.getCharSpace(),s=r.widths?r.widths:a.metadata.Unicode.widths,c=s.fof?s.fof:1,u=r.kerning?r.kerning:a.metadata.Unicode.kerning,d=u.fof?u.fof:1,p=r.doKerning!==!1,y=0,f=e.length,_=0,S=s[0]||c,w=[];for(t=0;t<f;t++)n=e.charCodeAt(t),typeof a.metadata.widthOfString=="function"?w.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(n))+o*(1e3/i)||0)/1e3):(y=p&&On(u[n])==="object"&&!isNaN(parseInt(u[n][_],10))?u[n][_]/d:0,w.push((s[n]||S)/c+y)),_=n;return w},lw=ah.getStringUnitWidth=function(e,r){var t=(r=r||{}).fontSize||this.internal.getFontSize(),n=r.font||this.internal.getFont(),a=r.charSpace||this.internal.getCharSpace();return ah.processArabic&&(e=ah.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,t,a)/t:p1.apply(this,arguments).reduce(function(i,o){return i+o},0)},uw=function(e,r,t,n){for(var a=[],i=0,o=e.length,s=0;i!==o&&s+r[i]<t;)s+=r[i],i++;a.push(e.slice(0,i));var c=i;for(s=0;i!==o;)s+r[i]>n&&(a.push(e.slice(c,i)),s=0,c=i),s+=r[i],i++;return c!==i&&a.push(e.slice(c,i)),a},cw=function(e,r,t){t||(t={});var n,a,i,o,s,c,u,d=[],p=[d],y=t.textIndent||0,f=0,_=0,S=e.split(" "),w=p1.apply(this,[" ",t])[0];if(c=t.lineIndent===-1?S[0].length+2:t.lineIndent||0){var x=Array(c).join(" "),v=[];S.map(function(E){(E=E.split(/\s*\n/)).length>1?v=v.concat(E.map(function(b,M){return(M&&b.length?`
|
|
590
|
+
`:"")+b})):v.push(E[0])}),S=v,c=lw.apply(this,[x,t])}for(i=0,o=S.length;i<o;i++){var g=0;if(n=S[i],c&&n[0]==`
|
|
591
|
+
`&&(n=n.substr(1),g=1),y+f+(_=(a=p1.apply(this,[n,t])).reduce(function(E,b){return E+b},0))>r||g){if(_>r){for(s=uw.apply(this,[n,a,r-(y+f),r]),d.push(s.shift()),d=[s.pop()];s.length;)p.push([s.shift()]);_=a.slice(n.length-(d[0]?d[0].length:0)).reduce(function(E,b){return E+b},0)}else d=[n];p.push(d),y=_+c,f=w}else d.push(n),y+=f+_,f=w}return u=c?function(E,b){return(b?x:"")+E.join(" ")}:function(E){return E.join(" ")},p.map(u)},ah.splitTextToSize=function(e,r,t){var n,a=(t=t||{}).fontSize||this.internal.getFontSize(),i=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var p=this.internal.getFont(d.fontName,d.fontStyle);return p.metadata.Unicode?{widths:p.metadata.Unicode.widths||{0:1},kerning:p.metadata.Unicode.kerning||{}}:{font:p.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*r/a;i.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/a:0,i.lineIndent=t.lineIndent;var s,c,u=[];for(s=0,c=n.length;s<c;s++)u=u.concat(cw.apply(this,[n[s],o,i]));return u},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var r="klmnopqrstuvwxyz",t={},n={},a=0;a<r.length;a++)t[r[a]]="0123456789abcdef"[a],n["0123456789abcdef"[a]]=r[a];var i=function(p){return"0x"+parseInt(p,10).toString(16)},o=e.__fontmetrics__.compress=function(p){var y,f,_,S,w=["{"];for(var x in p){if(y=p[x],isNaN(parseInt(x,10))?f="'"+x+"'":(x=parseInt(x,10),f=(f=i(x).slice(2)).slice(0,-1)+n[f.slice(-1)]),typeof y=="number")y<0?(_=i(y).slice(3),S="-"):(_=i(y).slice(2),S=""),_=S+_.slice(0,-1)+n[_.slice(-1)];else{if(On(y)!=="object")throw new Error("Don't know what to do with value type "+On(y)+".");_=o(y)}w.push(f+_)}return w.push("}"),w.join("")},s=e.__fontmetrics__.uncompress=function(p){if(typeof p!="string")throw new Error("Invalid argument passed to uncompress.");for(var y,f,_,S,w={},x=1,v=w,g=[],E="",b="",M=p.length-1,N=1;N<M;N+=1)(S=p[N])=="'"?y?(_=y.join(""),y=void 0):y=[]:y?y.push(S):S=="{"?(g.push([v,_]),v={},_=void 0):S=="}"?((f=g.pop())[0][f[1]]=v,_=void 0,v=f[0]):S=="-"?x=-1:_===void 0?t.hasOwnProperty(S)?(E+=t[S],_=parseInt(E,16)*x,x=1,E=""):E+=S:t.hasOwnProperty(S)?(b+=t[S],v[_]=parseInt(b,16)*x,x=1,_=void 0,b=""):b+=S;return w},c={codePages:["WinAnsiEncoding"],WinAnsiEncoding:s("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:c,"Courier-Bold":c,"Courier-BoldOblique":c,"Courier-Oblique":c,Helvetica:c,"Helvetica-Bold":c,"Helvetica-BoldOblique":c,"Helvetica-Oblique":c,"Times-Roman":c,"Times-Bold":c,"Times-BoldItalic":c,"Times-Italic":c}},d={Unicode:{"Courier-Oblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":s("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":s("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:s("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:s("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":s("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":s("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(p){var y=p.font,f=d.Unicode[y.postScriptName];f&&(y.metadata.Unicode={},y.metadata.Unicode.widths=f.widths,y.metadata.Unicode.kerning=f.kerning);var _=u.Unicode[y.postScriptName];_&&(y.metadata.Unicode.encoding=_,y.encoding=_.codePages[0])}])}(hr.API),function(e){var r=function(t){for(var n=t.length,a=new Uint8Array(n),i=0;i<n;i++)a[i]=t.charCodeAt(i);return a};e.API.events.push(["addFont",function(t){var n=void 0,a=t.font,i=t.instance;if(!a.isStandardFont){if(i===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(n=i.existsFileInVFS(a.postScriptName)===!1?i.loadFile(a.postScriptName):i.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?r(s):r(cp(s)),o.metadata=e.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(a,n)}}])}(hr),function(e){function r(){return(pr.canvg?Promise.resolve(pr.canvg):A2(()=>import("./index.es-ChKYbgkT.js"),[],import.meta.url)).catch(function(t){return Promise.reject(new Error("Could not load canvg: "+t))}).then(function(t){return t.default?t.default:t})}hr.API.addSvgAsImage=function(t,n,a,i,o,s,c,u){if(isNaN(n)||isNaN(a))throw Gn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw Gn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var d=document.createElement("canvas");d.width=i,d.height=o;var p=d.getContext("2d");p.fillStyle="#fff",p.fillRect(0,0,d.width,d.height);var y={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return r().then(function(_){return _.fromString(p,t,y)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(_){return _.render(y)}).then(function(){f.addImage(d.toDataURL("image/jpeg",1),n,a,i,o,c,u)})}}(),hr.API.putTotalPages=function(e){var r,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(r=new RegExp(e,"g"),t=this.internal.getNumberOfPages()):(r=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var a=0;a<this.internal.pages[n].length;a++)this.internal.pages[n][a]=this.internal.pages[n][a].replace(r,t);return this},hr.API.viewerPreferences=function(e,r){var t;e=e||{},r=r||!1;var n,a,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),c=[],u=0,d=0,p=0;function y(_,S){var w,x=!1;for(w=0;w<_.length;w+=1)_[w]===S&&(x=!0);return x}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),t=this.internal.viewerpreferences.configuration,e==="reset"||r===!0){var f=s.length;for(p=0;p<f;p+=1)t[s[p]].value=t[s[p]].defaultValue,t[s[p]].explicitSet=!1}if(On(e)==="object"){for(a in e)if(i=e[a],y(s,a)&&i!==void 0){if(t[a].type==="boolean"&&typeof i=="boolean")t[a].value=i;else if(t[a].type==="name"&&y(t[a].valueSet,i))t[a].value=i;else if(t[a].type==="integer"&&Number.isInteger(i))t[a].value=i;else if(t[a].type==="array"){for(u=0;u<i.length;u+=1)if(n=!0,i[u].length===1&&typeof i[u][0]=="number")c.push(String(i[u]-1));else if(i[u].length>1){for(d=0;d<i[u].length;d+=1)typeof i[u][d]!="number"&&(n=!1);n===!0&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}t[a].value="["+c.join(" ")+"]"}else t[a].value=t[a].defaultValue;t[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var _,S=[];for(_ in t)t[_].explicitSet===!0&&(t[_].type==="name"?S.push("/"+_+" /"+t[_].value):S.push("/"+_+" "+t[_].value));S.length!==0&&this.internal.write(`/ViewerPreferences
|
|
592
|
+
<<
|
|
593
|
+
`+S.join(`
|
|
594
|
+
`)+`
|
|
595
|
+
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=t,this},function(e){var r=function(){var n='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',a=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),i=unescape(encodeURIComponent(n)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),s=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),c=unescape(encodeURIComponent("</x:xmpmeta>")),u=i.length+o.length+s.length+a.length+c.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+u+" >>"),this.internal.write("stream"),this.internal.write(a+i+o+s+c),this.internal.write("endstream"),this.internal.write("endobj")},t=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(n,a){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceuri:a||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",t),this.internal.events.subscribe("postPutResources",r)),this}}(hr.API),function(e){var r=e.API,t=r.pdfEscape16=function(i,o){for(var s,c=o.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],p=0,y=i.length;p<y;++p){if(s=o.metadata.characterToGlyph(i.charCodeAt(p)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=i.charCodeAt(p),c.indexOf(s)==-1&&(c.push(s),c.push([parseInt(o.metadata.widthOfGlyph(s),10)])),s=="0")return d.join("");s=s.toString(16),d.push(u[4-s.length],s)}return d.join("")},n=function(i){var o,s,c,u,d,p,y;for(d=`/CIDInit /ProcSet findresource begin
|
|
596
|
+
12 dict begin
|
|
597
|
+
begincmap
|
|
598
|
+
/CIDSystemInfo <<
|
|
599
|
+
/Registry (Adobe)
|
|
600
|
+
/Ordering (UCS)
|
|
601
|
+
/Supplement 0
|
|
602
|
+
>> def
|
|
603
|
+
/CMapName /Adobe-Identity-UCS def
|
|
604
|
+
/CMapType 2 def
|
|
605
|
+
1 begincodespacerange
|
|
606
|
+
<0000><ffff>
|
|
607
|
+
endcodespacerange`,c=[],p=0,y=(s=Object.keys(i).sort(function(f,_){return f-_})).length;p<y;p++)o=s[p],c.length>=100&&(d+=`
|
|
608
|
+
`+c.length+` beginbfchar
|
|
609
|
+
`+c.join(`
|
|
610
|
+
`)+`
|
|
611
|
+
endbfchar`,c=[]),i[o]!==void 0&&i[o]!==null&&typeof i[o].toString=="function"&&(u=("0000"+i[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),c.push("<"+o+"><"+u+">"));return c.length&&(d+=`
|
|
612
|
+
`+c.length+` beginbfchar
|
|
613
|
+
`+c.join(`
|
|
614
|
+
`)+`
|
|
615
|
+
endbfchar
|
|
616
|
+
`),d+=`endcmap
|
|
617
|
+
CMapName currentdict /CMap defineresource pop
|
|
618
|
+
end
|
|
619
|
+
end`};r.events.push(["putFont",function(i){(function(o){var s=o.font,c=o.out,u=o.newObject,d=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="Identity-H"){for(var p=s.metadata.Unicode.widths,y=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),f="",_=0;_<y.length;_++)f+=String.fromCharCode(y[_]);var S=u();d({data:f,addLength1:!0,objectId:S}),c("endobj");var w=u();d({data:n(s.metadata.toUnicode),addLength1:!0,objectId:w}),c("endobj");var x=u();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+uh(s.fontName)),c("/FontFile2 "+S+" 0 R"),c("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),c("/Flags "+s.metadata.flags),c("/StemV "+s.metadata.stemV),c("/ItalicAngle "+s.metadata.italicAngle),c("/Ascent "+s.metadata.ascender),c("/Descent "+s.metadata.decender),c("/CapHeight "+s.metadata.capHeight),c(">>"),c("endobj");var v=u();c("<<"),c("/Type /Font"),c("/BaseFont /"+uh(s.fontName)),c("/FontDescriptor "+x+" 0 R"),c("/W "+e.API.PDFObject.convert(p)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+s.encoding+")"),c(">>"),c(">>"),c("endobj"),s.objectNumber=u(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+w+" 0 R"),c("/BaseFont /"+uh(s.fontName)),c("/Encoding /"+s.encoding),c("/DescendantFonts ["+v+" 0 R]"),c(">>"),c("endobj"),s.isAlreadyPutted=!0}})(i)}]),r.events.push(["putFont",function(i){(function(o){var s=o.font,c=o.out,u=o.newObject,d=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="WinAnsiEncoding"){for(var p=s.metadata.rawData,y="",f=0;f<p.length;f++)y+=String.fromCharCode(p[f]);var _=u();d({data:y,addLength1:!0,objectId:_}),c("endobj");var S=u();d({data:n(s.metadata.toUnicode),addLength1:!0,objectId:S}),c("endobj");var w=u();c("<<"),c("/Descent "+s.metadata.decender),c("/CapHeight "+s.metadata.capHeight),c("/StemV "+s.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+_+" 0 R"),c("/Flags 96"),c("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),c("/FontName /"+uh(s.fontName)),c("/ItalicAngle "+s.metadata.italicAngle),c("/Ascent "+s.metadata.ascender),c(">>"),c("endobj"),s.objectNumber=u();for(var x=0;x<s.metadata.hmtx.widths.length;x++)s.metadata.hmtx.widths[x]=parseInt(s.metadata.hmtx.widths[x]*(1e3/s.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+S+" 0 R/BaseFont/"+uh(s.fontName)+"/FontDescriptor "+w+" 0 R/Encoding/"+s.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(s.metadata.hmtx.widths)+">>"),c("endobj"),s.isAlreadyPutted=!0}})(i)}]);var a=function(i){var o,s=i.text||"",c=i.x,u=i.y,d=i.options||{},p=i.mutex||{},y=p.pdfEscape,f=p.activeFontKey,_=p.fonts,S=f,w="",x=0,v="",g=_[S].encoding;if(_[S].encoding!=="Identity-H")return{text:s,x:c,y:u,options:d,mutex:p};for(v=s,S=f,Array.isArray(s)&&(v=s[0]),x=0;x<v.length;x+=1)_[S].metadata.hasOwnProperty("cmap")&&(o=_[S].metadata.cmap.unicode.codeMap[v[x].charCodeAt(0)]),o||v[x].charCodeAt(0)<256&&_[S].metadata.hasOwnProperty("Unicode")?w+=v[x]:w+="";var E="";return parseInt(S.slice(1))<14||g==="WinAnsiEncoding"?E=y(w,S).split("").map(function(b){return b.charCodeAt(0).toString(16)}).join(""):g==="Identity-H"&&(E=t(w,_[S])),p.isHex=!0,{text:E,x:c,y:u,options:d,mutex:p}};r.events.push(["postProcessText",function(i){var o=i.text||"",s=[],c={text:o,x:i.x,y:i.y,options:i.options,mutex:i.mutex};if(Array.isArray(o)){var u=0;for(u=0;u<o.length;u+=1)Array.isArray(o[u])&&o[u].length===3?s.push([a(Object.assign({},c,{text:o[u][0]})).text,o[u][1],o[u][2]]):s.push(a(Object.assign({},c,{text:o[u]})).text);i.text=s}else i.text=a(Object.assign({},c,{text:o})).text}])}(hr),function(e){var r=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(t){return r.call(this),this.internal.vFS[t]!==void 0},e.addFileToVFS=function(t,n){return r.call(this),this.internal.vFS[t]=n,this},e.getFileFromVFS=function(t){return r.call(this),this.internal.vFS[t]!==void 0?this.internal.vFS[t]:null}}(hr.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var a,i,o,s,c,u,d,p=r,y=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],_={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},S={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},w=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],x=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),v=!1,g=0;this.__bidiEngine__={};var E=function(O){var C=O.charCodeAt(),A=C>>8,k=S[A];return k!==void 0?p[256*k+(255&C)]:A===252||A===253?"AL":x.test(A)?"L":A===8?"R":"N"},b=function(O){for(var C,A=0;A<O.length;A++){if((C=E(O.charAt(A)))==="L")return!1;if(C==="R")return!0}return!1},M=function(O,C,A,k){var T,V,G,$,te=C[k];switch(te){case"L":case"R":v=!1;break;case"N":case"AN":break;case"EN":v&&(te="AN");break;case"AL":v=!0,te="R";break;case"WS":te="N";break;case"CS":k<1||k+1>=C.length||(T=A[k-1])!=="EN"&&T!=="AN"||(V=C[k+1])!=="EN"&&V!=="AN"?te="N":v&&(V="AN"),te=V===T?V:"N";break;case"ES":te=(T=k>0?A[k-1]:"B")==="EN"&&k+1<C.length&&C[k+1]==="EN"?"EN":"N";break;case"ET":if(k>0&&A[k-1]==="EN"){te="EN";break}if(v){te="N";break}for(G=k+1,$=C.length;G<$&&C[G]==="ET";)G++;te=G<$&&C[G]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for($=C.length,G=k+1;G<$&&C[G]==="NSM";)G++;if(G<$){var W=O[k],U=W>=1425&&W<=2303||W===64286;if(T=C[G],U&&(T==="R"||T==="AL")){te="R";break}}}te=k<1||(T=C[k-1])==="B"?"N":A[k-1];break;case"B":v=!1,a=!0,te=g;break;case"S":i=!0,te="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":v=!1;break;case"BN":te="N"}return te},N=function(O,C,A){var k=O.split("");return A&&R(k,A,{hiLevel:g}),k.reverse(),C&&C.reverse(),k.join("")},R=function(O,C,A){var k,T,V,G,$,te=-1,W=O.length,U=0,z=[],D=g?f:y,Y=[];for(v=!1,a=!1,i=!1,T=0;T<W;T++)Y[T]=E(O[T]);for(V=0;V<W;V++){if($=U,z[V]=M(O,Y,z,V),k=240&(U=D[$][_[z[V]]]),U&=15,C[V]=G=D[U][5],k>0)if(k===16){for(T=te;T<V;T++)C[T]=1;te=-1}else te=-1;if(D[U][6])te===-1&&(te=V);else if(te>-1){for(T=te;T<V;T++)C[T]=G;te=-1}Y[V]==="B"&&(C[V]=0),A.hiLevel|=G}i&&function(Q,J,Z){for(var ae=0;ae<Z;ae++)if(Q[ae]==="S"){J[ae]=g;for(var se=ae-1;se>=0&&Q[se]==="WS";se--)J[se]=g}}(Y,C,W)},F=function(O,C,A,k,T){if(!(T.hiLevel<O)){if(O===1&&g===1&&!a)return C.reverse(),void(A&&A.reverse());for(var V,G,$,te,W=C.length,U=0;U<W;){if(k[U]>=O){for($=U+1;$<W&&k[$]>=O;)$++;for(te=U,G=$-1;te<G;te++,G--)V=C[te],C[te]=C[G],C[G]=V,A&&(V=A[te],A[te]=A[G],A[G]=V);U=$}U++}}},j=function(O,C,A){var k=O.split(""),T={hiLevel:g};return A||(A=[]),R(k,A,T),function(V,G,$){if($.hiLevel!==0&&d)for(var te,W=0;W<V.length;W++)G[W]===1&&(te=w.indexOf(V[W]))>=0&&(V[W]=w[te+1])}(k,A,T),F(2,k,C,A,T),F(1,k,C,A,T),k.join("")};return this.__bidiEngine__.doBidiReorder=function(O,C,A){if(function(T,V){if(V)for(var G=0;G<T.length;G++)V[G]=G;s===void 0&&(s=b(T)),u===void 0&&(u=b(T))}(O,C),o||!c||u)if(o&&c&&s^u)g=s?1:0,O=N(O,C,A);else if(!o&&c&&u)g=s?1:0,O=j(O,C,A),O=N(O,C);else if(!o||s||c||u){if(o&&!c&&s^u)O=N(O,C),s?(g=0,O=j(O,C,A)):(g=1,O=j(O,C,A),O=N(O,C));else if(o&&s&&!c&&u)g=1,O=j(O,C,A),O=N(O,C);else if(!o&&!c&&s^u){var k=d;s?(g=1,O=j(O,C,A),g=0,d=!1,O=j(O,C,A),d=k):(g=0,O=j(O,C,A),O=N(O,C),g=1,d=!1,O=j(O,C,A),d=k,O=N(O,C))}}else g=0,O=j(O,C,A);else g=s?1:0,O=j(O,C,A);return O},this.__bidiEngine__.setOptions=function(O){O&&(o=O.isInputVisual,c=O.isOutputVisual,s=O.isInputRtl,u=O.isOutputRtl,d=O.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var r=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],t=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(n){var a=n.text;n.x,n.y;var i=n.options||{};n.mutex,i.lang;var o=[];if(i.isInputVisual=typeof i.isInputVisual!="boolean"||i.isInputVisual,t.setOptions(i),Object.prototype.toString.call(a)==="[object Array]"){var s=0;for(o=[],s=0;s<a.length;s+=1)Object.prototype.toString.call(a[s])==="[object Array]"?o.push([t.doBidiReorder(a[s][0]),a[s][1],a[s][2]]):o.push([t.doBidiReorder(a[s])]);n.text=o}else n.text=t.doBidiReorder(a);t.setOptions({isInputVisual:!0})}])}(hr),hr.API.TTFFont=function(){function e(r){var t;if(this.rawData=r,t=this.contents=new Kc(r),this.contents.pos=4,t.readString(4)==="ttcf")throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new bL(this),this.registerTTF()}return e.open=function(r){return new e(r)},e.prototype.parse=function(){return this.directory=new aL(this.contents),this.head=new sL(this),this.name=new hL(this),this.cmap=new T_(this),this.toUnicode={},this.hhea=new lL(this),this.maxp=new dL(this),this.hmtx=new pL(this),this.post=new cL(this),this.os2=new uL(this),this.loca=new yL(this),this.glyf=new gL(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var r,t,n,a,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,s,c,u;for(u=[],o=0,s=(c=this.bbox).length;o<s;o++)r=c[o],u.push(Math.round(r*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(n=255&(a=this.post.italic_angle),(32768&(t=a>>16))!=0&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(r){var t;return((t=this.cmap.unicode)!=null?t.codeMap[r]:void 0)||0},e.prototype.widthOfGlyph=function(r){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(r).advance*t},e.prototype.widthOfString=function(r,t,n){var a,i,o,s;for(o=0,i=0,s=(r=""+r).length;0<=s?i<s:i>s;i=0<=s?++i:--i)a=r.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(a))+n*(1e3/t)||0;return o*(t/1e3)},e.prototype.lineHeight=function(r,t){var n;return t==null&&(t=!1),n=t?this.lineGap:0,(this.ascender+n-this.decender)/1e3*r},e}();var eu,Kc=function(){function e(r){this.data=r??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(r){return this.data[this.pos++]=r},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(r){return this.writeByte(r>>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt32=function(){var r;return(r=this.readUInt32())>=2147483648?r-4294967296:r},e.prototype.writeInt32=function(r){return r<0&&(r+=4294967296),this.writeUInt32(r)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(r){return this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt16=function(){var r;return(r=this.readUInt16())>=32768?r-65536:r},e.prototype.writeInt16=function(r){return r<0&&(r+=65536),this.writeUInt16(r)},e.prototype.readString=function(r){var t,n;for(n=[],t=0;0<=r?t<r:t>r;t=0<=r?++t:--t)n[t]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(r){var t,n,a;for(a=[],t=0,n=r.length;0<=n?t<n:t>n;t=0<=n?++t:--t)a.push(this.writeByte(r.charCodeAt(t)));return a},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(r){return this.writeInt16(r)},e.prototype.readLongLong=function(){var r,t,n,a,i,o,s,c;return r=this.readByte(),t=this.readByte(),n=this.readByte(),a=this.readByte(),i=this.readByte(),o=this.readByte(),s=this.readByte(),c=this.readByte(),128&r?-1*(72057594037927940*(255^r)+281474976710656*(255^t)+1099511627776*(255^n)+4294967296*(255^a)+16777216*(255^i)+65536*(255^o)+256*(255^s)+(255^c)+1):72057594037927940*r+281474976710656*t+1099511627776*n+4294967296*a+16777216*i+65536*o+256*s+c},e.prototype.writeLongLong=function(r){var t,n;return t=Math.floor(r/4294967296),n=4294967295&r,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(r){return this.writeInt32(r)},e.prototype.read=function(r){var t,n;for(t=[],n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)t.push(this.readByte());return t},e.prototype.write=function(r){var t,n,a,i;for(i=[],n=0,a=r.length;n<a;n++)t=r[n],i.push(this.writeByte(t));return i},e}(),aL=function(){var e;function r(t){var n,a,i;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},a=0,i=this.tableCount;0<=i?a<i:a>i;a=0<=i?++a:--a)n={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[n.tag]=n}return r.prototype.encode=function(t){var n,a,i,o,s,c,u,d,p,y,f,_,S;for(S in f=Object.keys(t).length,c=Math.log(2),p=16*Math.floor(Math.log(f)/c),o=Math.floor(p/c),d=16*f-p,(a=new Kc).writeInt(this.scalarType),a.writeShort(f),a.writeShort(p),a.writeShort(o),a.writeShort(d),i=16*f,u=a.pos+i,s=null,_=[],t)for(y=t[S],a.writeString(S),a.writeInt(e(y)),a.writeInt(u),a.writeInt(y.length),_=_.concat(y),S==="head"&&(s=u),u+=y.length;u%4;)_.push(0),u++;return a.write(_),n=2981146554-e(a.data),a.pos=s+8,a.writeUInt32(n),a.data},e=function(t){var n,a,i,o;for(t=R_.call(t);t.length%4;)t.push(0);for(i=new Kc(t),a=0,n=0,o=t.length;n<o;n=n+=4)a+=i.readUInt32();return 4294967295&a},r}(),oL={}.hasOwnProperty,Du=function(e,r){for(var t in r)oL.call(r,t)&&(e[t]=r[t]);function n(){this.constructor=e}return n.prototype=r.prototype,e.prototype=new n,e.__super__=r.prototype,e};eu=function(){function e(r){var t;this.file=r,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var sL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="head",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},r.prototype.encode=function(t){var n;return(n=new Kc).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},r}(),dw=function(){function e(r,t){var n,a,i,o,s,c,u,d,p,y,f,_,S,w,x,v,g;switch(this.platformID=r.readUInt16(),this.encodingID=r.readShort(),this.offset=t+r.readInt(),p=r.pos,r.pos=this.offset,this.format=r.readUInt16(),this.length=r.readUInt16(),this.language=r.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(c=0;c<256;++c)this.codeMap[c]=r.readByte();break;case 4:for(f=r.readUInt16(),y=f/2,r.pos+=6,i=function(){var E,b;for(b=[],c=E=0;0<=y?E<y:E>y;c=0<=y?++E:--E)b.push(r.readUInt16());return b}(),r.pos+=2,S=function(){var E,b;for(b=[],c=E=0;0<=y?E<y:E>y;c=0<=y?++E:--E)b.push(r.readUInt16());return b}(),u=function(){var E,b;for(b=[],c=E=0;0<=y?E<y:E>y;c=0<=y?++E:--E)b.push(r.readUInt16());return b}(),d=function(){var E,b;for(b=[],c=E=0;0<=y?E<y:E>y;c=0<=y?++E:--E)b.push(r.readUInt16());return b}(),a=(this.length-r.pos+this.offset)/2,s=function(){var E,b;for(b=[],c=E=0;0<=a?E<a:E>a;c=0<=a?++E:--E)b.push(r.readUInt16());return b}(),c=x=0,g=i.length;x<g;c=++x)for(w=i[c],n=v=_=S[c];_<=w?v<=w:v>=w;n=_<=w?++v:--v)d[c]===0?o=n+u[c]:(o=s[d[c]/2+(n-_)-(y-c)]||0)!==0&&(o+=u[c]),this.codeMap[n]=65535&o}r.pos=p}return e.encode=function(r,t){var n,a,i,o,s,c,u,d,p,y,f,_,S,w,x,v,g,E,b,M,N,R,F,j,O,C,A,k,T,V,G,$,te,W,U,z,D,Y,Q,J,Z,ae,se,ce,de,Oe;switch(k=new Kc,o=Object.keys(r).sort(function(Le,ke){return Le-ke}),t){case"macroman":for(S=0,w=function(){var Le=[];for(_=0;_<256;++_)Le.push(0);return Le}(),v={0:0},i={},T=0,te=o.length;T<te;T++)v[se=r[a=o[T]]]==null&&(v[se]=++S),i[a]={old:r[a],new:v[r[a]]},w[a]=v[r[a]];return k.writeUInt16(1),k.writeUInt16(0),k.writeUInt32(12),k.writeUInt16(0),k.writeUInt16(262),k.writeUInt16(0),k.write(w),{charMap:i,subtable:k.data,maxGlyphID:S+1};case"unicode":for(C=[],p=[],g=0,v={},n={},x=u=null,V=0,W=o.length;V<W;V++)v[b=r[a=o[V]]]==null&&(v[b]=++g),n[a]={old:b,new:v[b]},s=v[b]-a,x!=null&&s===u||(x&&p.push(x),C.push(a),u=s),x=a;for(x&&p.push(x),p.push(65535),C.push(65535),j=2*(F=C.length),R=2*Math.pow(Math.log(F)/Math.LN2,2),y=Math.log(R/2)/Math.LN2,N=2*F-R,c=[],M=[],f=[],_=G=0,U=C.length;G<U;_=++G){if(O=C[_],d=p[_],O===65535){c.push(0),M.push(0);break}if(O-(A=n[O].new)>=32768)for(c.push(0),M.push(2*(f.length+F-_)),a=$=O;O<=d?$<=d:$>=d;a=O<=d?++$:--$)f.push(n[a].new);else c.push(A-O),M.push(0)}for(k.writeUInt16(3),k.writeUInt16(1),k.writeUInt32(12),k.writeUInt16(4),k.writeUInt16(16+8*F+2*f.length),k.writeUInt16(0),k.writeUInt16(j),k.writeUInt16(R),k.writeUInt16(y),k.writeUInt16(N),Z=0,z=p.length;Z<z;Z++)a=p[Z],k.writeUInt16(a);for(k.writeUInt16(0),ae=0,D=C.length;ae<D;ae++)a=C[ae],k.writeUInt16(a);for(ce=0,Y=c.length;ce<Y;ce++)s=c[ce],k.writeUInt16(s);for(de=0,Q=M.length;de<Q;de++)E=M[de],k.writeUInt16(E);for(Oe=0,J=f.length;Oe<J;Oe++)S=f[Oe],k.writeUInt16(S);return{charMap:n,subtable:k.data,maxGlyphID:g+1}}},e}(),T_=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="cmap",r.prototype.parse=function(t){var n,a,i;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,a=0;0<=i?a<i:a>i;a=0<=i?++a:--a)n=new dw(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},r.encode=function(t,n){var a,i;return n==null&&(n="macroman"),a=dw.encode(t,n),(i=new Kc).writeUInt16(0),i.writeUInt16(1),a.table=i.data.concat(a.subtable),a},r}(),lL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="hhea",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},r}(),uL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="OS/2",r.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,a;for(a=[],n=0;n<10;++n)a.push(t.readByte());return a}(),this.charRange=function(){var n,a;for(a=[],n=0;n<4;++n)a.push(t.readInt());return a}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,a;for(a=[],n=0;n<2;n=++n)a.push(t.readInt());return a}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},r}(),cL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="post",r.prototype.parse=function(t){var n,a,i;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:break;case 131072:var o;for(a=t.readUInt16(),this.glyphNameIndex=[],o=0;0<=a?o<a:o>a;o=0<=a?++o:--o)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],i=[];t.pos<this.offset+this.length;)n=t.readByte(),i.push(this.names.push(t.readString(n)));return i;case 151552:return a=t.readUInt16(),this.offsets=t.read(a);case 196608:break;case 262144:return this.map=(function(){var s,c,u;for(u=[],o=s=0,c=this.file.maxp.numGlyphs;0<=c?s<c:s>c;o=0<=c?++s:--s)u.push(t.readUInt32());return u}).call(this)}},r}(),fL=function(e,r){this.raw=e,this.length=e.length,this.platformID=r.platformID,this.encodingID=r.encodingID,this.languageID=r.languageID},hL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="name",r.prototype.parse=function(t){var n,a,i,o,s,c,u,d,p,y,f;for(t.pos=this.offset,t.readShort(),n=t.readShort(),c=t.readShort(),a=[],o=0;0<=n?o<n:o>n;o=0<=n?++o:--o)a.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+c+t.readShort()});for(u={},o=p=0,y=a.length;p<y;o=++p)i=a[o],t.pos=i.offset,d=t.readString(i.length),s=new fL(d,i),u[f=i.nameID]==null&&(u[f]=[]),u[i.nameID].push(s);this.strings=u,this.copyright=u[0],this.fontFamily=u[1],this.fontSubfamily=u[2],this.uniqueSubfamily=u[3],this.fontName=u[4],this.version=u[5];try{this.postscriptName=u[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=u[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=u[7],this.manufacturer=u[8],this.designer=u[9],this.description=u[10],this.vendorUrl=u[11],this.designerUrl=u[12],this.license=u[13],this.licenseUrl=u[14],this.preferredFamily=u[15],this.preferredSubfamily=u[17],this.compatibleFull=u[18],this.sampleText=u[19]},r}(),dL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="maxp",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},r}(),pL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="hmtx",r.prototype.parse=function(t){var n,a,i,o,s,c,u;for(t.pos=this.offset,this.metrics=[],n=0,c=this.file.hhea.numberOfMetrics;0<=c?n<c:n>c;n=0<=c?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var d,p;for(p=[],n=d=0;0<=i?d<i:d>i;n=0<=i?++d:--d)p.push(t.readInt16());return p}(),this.widths=(function(){var d,p,y,f;for(f=[],d=0,p=(y=this.metrics).length;d<p;d++)o=y[d],f.push(o.advance);return f}).call(this),a=this.widths[this.widths.length-1],u=[],n=s=0;0<=i?s<i:s>i;n=0<=i?++s:--s)u.push(this.widths.push(a));return u},r.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},r}(),R_=[].slice,gL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="glyf",r.prototype.parse=function(){return this.cache={}},r.prototype.glyphFor=function(t){var n,a,i,o,s,c,u,d,p,y;return t in this.cache?this.cache[t]:(o=this.file.loca,n=this.file.contents,a=o.indexOf(t),(i=o.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+a,s=(c=new Kc(n.read(i))).readShort(),d=c.readShort(),y=c.readShort(),u=c.readShort(),p=c.readShort(),this.cache[t]=s===-1?new mL(c,d,y,u,p):new vL(c,s,d,y,u,p),this.cache[t]))},r.prototype.encode=function(t,n,a){var i,o,s,c,u;for(s=[],o=[],c=0,u=n.length;c<u;c++)i=t[n[c]],o.push(s.length),i&&(s=s.concat(i.encode(a)));return o.push(s.length),{table:s,offsets:o}},r}(),vL=function(){function e(r,t,n,a,i,o){this.raw=r,this.numberOfContours=t,this.xMin=n,this.yMin=a,this.xMax=i,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),mL=function(){function e(r,t,n,a,i){var o,s;for(this.raw=r,this.xMin=t,this.yMin=n,this.xMax=a,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;s=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&s;)o.pos+=1&s?4:2,128&s?o.pos+=8:64&s?o.pos+=4:8&s&&(o.pos+=2)}return e.prototype.encode=function(){var r,t,n;for(t=new Kc(R_.call(this.raw.data)),r=0,n=this.glyphIDs.length;r<n;++r)t.pos=this.glyphOffsets[r];return t.data},e}(),yL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="loca",r.prototype.parse=function(t){var n,a;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,o;for(o=[],a=0,i=this.length;a<i;a+=2)o.push(2*t.readUInt16());return o}).call(this):(function(){var i,o;for(o=[],a=0,i=this.length;a<i;a+=4)o.push(t.readUInt32());return o}).call(this)},r.prototype.indexOf=function(t){return this.offsets[t]},r.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},r.prototype.encode=function(t,n){for(var a=new Uint32Array(this.offsets.length),i=0,o=0,s=0;s<a.length;++s)if(a[s]=i,o<n.length&&n[o]==s){++o,a[s]=i;var c=this.offsets[s],u=this.offsets[s+1]-c;u>0&&(i+=u)}for(var d=new Array(4*a.length),p=0;p<a.length;++p)d[4*p+3]=255&a[p],d[4*p+2]=(65280&a[p])>>8,d[4*p+1]=(16711680&a[p])>>16,d[4*p]=(4278190080&a[p])>>24;return d},r}(),bL=function(){function e(r){this.font=r,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var r,t,n,a,i;for(t in a=this.font.cmap.tables[0].codeMap,r={},i=this.subset)n=i[t],r[t]=a[n];return r},e.prototype.glyphsFor=function(r){var t,n,a,i,o,s,c;for(a={},o=0,s=r.length;o<s;o++)a[i=r[o]]=this.font.glyf.glyphFor(i);for(i in t=[],a)(n=a[i])!=null&&n.compound&&t.push.apply(t,n.glyphIDs);if(t.length>0)for(i in c=this.glyphsFor(t))n=c[i],a[i]=n;return a},e.prototype.encode=function(r,t){var n,a,i,o,s,c,u,d,p,y,f,_,S,w,x;for(a in n=T_.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(r),f={0:0},x=n.charMap)f[(c=x[a]).old]=c.new;for(_ in y=n.maxGlyphID,o)_ in f||(f[_]=y++);return d=function(v){var g,E;for(g in E={},v)E[v[g]]=g;return E}(f),p=Object.keys(d).sort(function(v,g){return v-g}),S=function(){var v,g,E;for(E=[],v=0,g=p.length;v<g;v++)s=p[v],E.push(d[s]);return E}(),i=this.font.glyf.encode(o,S,f),u=this.font.loca.encode(i.offsets,S),w={cmap:this.font.cmap.raw(),glyf:i.table,loca:u,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(w["OS/2"]=this.font.os2.raw()),this.font.directory.encode(w)},e}();hr.API.PDFObject=function(){var e;function r(){}return e=function(t,n){return(Array(n+1).join("0")+t).slice(-n)},r.convert=function(t){var n,a,i,o;if(Array.isArray(t))return"["+function(){var s,c,u;for(u=[],s=0,c=t.length;s<c;s++)n=t[s],u.push(r.convert(n));return u}().join(" ")+"]";if(typeof t=="string")return"/"+t;if(t!=null&&t.isString)return"("+t+")";if(t instanceof Date)return"(D:"+e(t.getUTCFullYear(),4)+e(t.getUTCMonth(),2)+e(t.getUTCDate(),2)+e(t.getUTCHours(),2)+e(t.getUTCMinutes(),2)+e(t.getUTCSeconds(),2)+"Z)";if({}.toString.call(t)==="[object Object]"){for(a in i=["<<"],t)o=t[a],i.push("/"+a+" "+r.convert(o));return i.push(">>"),i.join(`
|
|
620
|
+
`)}return""+t},r}();window.jspdf={jsPDF:hr};bk.toggleFadeInAnimation(!1);ap.setTextOverflow("change-font-size");const wL=new URLSearchParams(location.search).get("key"),M_=yk.createStore({key:wL});window.store=M_;window.config={addGlobalFont:wk.addGlobalFont,unstable_useHtmlTextRender:ap.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:ap.setTextVerticalResizeEnabled,unstable_setTextOverflow:ap.setTextOverflow,onLoadError:r2.onLoadError,setAssetLoadTimeout:r2.setAssetLoadTimeout,setFontLoadTimeout:r2.setFontLoadTimeout,unstable_setTextSplitAllowed:ap.setTextSplitAllowed};const _L=gw.createRoot(document.getElementById("root"));_L.render(Vr.createElement(mk.WorkspaceCanvas,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:M_,components:{PageControls:()=>null,Tooltip:()=>null}}));export{On as _,bh as c,yp as g};
|