polotno-node 2.12.21 → 2.12.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,587 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var t0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ch(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tx(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var kg={exports:{}},Dr={};/**
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 Zy;function Rx(){if(Zy)return Dr;Zy=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),v=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=v&&B[v]||B["@@iterator"],typeof B=="function"?B:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,_={};function x(B,D,U){this.props=B,this.context=D,this.refs=_,this.updater=U||p}x.prototype.isReactComponent={},x.prototype.setState=function(B,D){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,D,"setState")},x.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=x.prototype;function E(B,D,U){this.props=B,this.context=D,this.refs=_,this.updater=U||p}var k=E.prototype=new b;k.constructor=E,y(k,x.prototype),k.isPureReactComponent=!0;var S=Array.isArray,A=Object.prototype.hasOwnProperty,M={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function I(B,D,U){var X,ee={},K=null,oe=null;if(D!=null)for(X in D.ref!==void 0&&(oe=D.ref),D.key!==void 0&&(K=""+D.key),D)A.call(D,X)&&!C.hasOwnProperty(X)&&(ee[X]=D[X]);var me=arguments.length-2;if(me===1)ee.children=U;else if(1<me){for(var de=Array(me),ye=0;ye<me;ye++)de[ye]=arguments[ye+2];ee.children=de}if(B&&B.defaultProps)for(X in me=B.defaultProps,me)ee[X]===void 0&&(ee[X]=me[X]);return{$$typeof:t,type:B,key:K,ref:oe,props:ee,_owner:M.current}}function F(B,D){return{$$typeof:t,type:B.type,key:D,ref:B.ref,props:B.props,_owner:B._owner}}function j(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function O(B){var D={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(U){return D[U]})}var T=/\/+/g;function $(B,D){return typeof B=="object"&&B!==null&&B.key!=null?O(""+B.key):D.toString(36)}function q(B,D,U,X,ee){var K=typeof B;(K==="undefined"||K==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(K){case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case t:case e:oe=!0}}if(oe)return oe=B,ee=ee(oe),B=X===""?"."+$(oe,0):X,S(ee)?(U="",B!=null&&(U=B.replace(T,"$&/")+"/"),q(ee,D,U,"",function(ye){return ye})):ee!=null&&(j(ee)&&(ee=F(ee,U+(!ee.key||oe&&oe.key===ee.key?"":(""+ee.key).replace(T,"$&/")+"/")+B)),D.push(ee)),1;if(oe=0,X=X===""?".":X+":",S(B))for(var me=0;me<B.length;me++){K=B[me];var de=X+$(K,me);oe+=q(K,D,U,de,ee)}else if(de=g(B),typeof de=="function")for(B=de.call(B),me=0;!(K=B.next()).done;)K=K.value,de=X+$(K,me++),oe+=q(K,D,U,de,ee);else if(K==="object")throw D=String(B),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return oe}function J(B,D,U){if(B==null)return B;var X=[],ee=0;return q(B,X,"","",function(K){return D.call(U,K,ee++)}),X}function ae(B){if(B._status===-1){var D=B._result;D=D(),D.then(function(U){(B._status===0||B._status===-1)&&(B._status=1,B._result=U)},function(U){(B._status===0||B._status===-1)&&(B._status=2,B._result=U)}),B._status===-1&&(B._status=0,B._result=D)}if(B._status===1)return B._result.default;throw B._result}var ie={current:null},Z={transition:null},te={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:Z,ReactCurrentOwner:M};function V(){throw Error("act(...) is not supported in production builds of React.")}return Dr.Children={map:J,forEach:function(B,D,U){J(B,function(){D.apply(this,arguments)},U)},count:function(B){var D=0;return J(B,function(){D++}),D},toArray:function(B){return J(B,function(D){return D})||[]},only:function(B){if(!j(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Dr.Component=x,Dr.Fragment=r,Dr.Profiler=i,Dr.PureComponent=E,Dr.StrictMode=n,Dr.Suspense=u,Dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Dr.act=V,Dr.cloneElement=function(B,D,U){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var X=y({},B.props),ee=B.key,K=B.ref,oe=B._owner;if(D!=null){if(D.ref!==void 0&&(K=D.ref,oe=M.current),D.key!==void 0&&(ee=""+D.key),B.type&&B.type.defaultProps)var me=B.type.defaultProps;for(de in D)A.call(D,de)&&!C.hasOwnProperty(de)&&(X[de]=D[de]===void 0&&me!==void 0?me[de]:D[de])}var de=arguments.length-2;if(de===1)X.children=U;else if(1<de){me=Array(de);for(var ye=0;ye<de;ye++)me[ye]=arguments[ye+2];X.children=me}return{$$typeof:t,type:B.type,key:ee,ref:K,props:X,_owner:oe}},Dr.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:a,_context:B},B.Consumer=B},Dr.createElement=I,Dr.createFactory=function(B){var D=I.bind(null,B);return D.type=B,D},Dr.createRef=function(){return{current:null}},Dr.forwardRef=function(B){return{$$typeof:s,render:B}},Dr.isValidElement=j,Dr.lazy=function(B){return{$$typeof:f,_payload:{_status:-1,_result:B},_init:ae}},Dr.memo=function(B,D){return{$$typeof:h,type:B,compare:D===void 0?null:D}},Dr.startTransition=function(B){var D=Z.transition;Z.transition={};try{B()}finally{Z.transition=D}},Dr.unstable_act=V,Dr.useCallback=function(B,D){return ie.current.useCallback(B,D)},Dr.useContext=function(B){return ie.current.useContext(B)},Dr.useDebugValue=function(){},Dr.useDeferredValue=function(B){return ie.current.useDeferredValue(B)},Dr.useEffect=function(B,D){return ie.current.useEffect(B,D)},Dr.useId=function(){return ie.current.useId()},Dr.useImperativeHandle=function(B,D,U){return ie.current.useImperativeHandle(B,D,U)},Dr.useInsertionEffect=function(B,D){return ie.current.useInsertionEffect(B,D)},Dr.useLayoutEffect=function(B,D){return ie.current.useLayoutEffect(B,D)},Dr.useMemo=function(B,D){return ie.current.useMemo(B,D)},Dr.useReducer=function(B,D,U){return ie.current.useReducer(B,D,U)},Dr.useRef=function(B){return ie.current.useRef(B)},Dr.useState=function(B){return ie.current.useState(B)},Dr.useSyncExternalStore=function(B,D,U){return ie.current.useSyncExternalStore(B,D,U)},Dr.useTransition=function(){return ie.current.useTransition()},Dr.version="18.3.1",Dr}var Qy;function Sp(){return Qy||(Qy=1,kg.exports=Rx()),kg.exports}var Ii=Sp();const se=ch(Ii);var u1={},Pg={exports:{}},Os={},Og={exports:{}},Cg={};/**
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 Jy;function Mx(){return Jy||(Jy=1,function(t){function e(Z,te){var V=Z.length;Z.push(te);e:for(;0<V;){var B=V-1>>>1,D=Z[B];if(0<i(D,te))Z[B]=te,Z[V]=D,V=B;else break e}}function r(Z){return Z.length===0?null:Z[0]}function n(Z){if(Z.length===0)return null;var te=Z[0],V=Z.pop();if(V!==te){Z[0]=V;e:for(var B=0,D=Z.length,U=D>>>1;B<U;){var X=2*(B+1)-1,ee=Z[X],K=X+1,oe=Z[K];if(0>i(ee,V))K<D&&0>i(oe,ee)?(Z[B]=oe,Z[K]=V,B=K):(Z[B]=ee,Z[X]=V,B=X);else if(K<D&&0>i(oe,V))Z[B]=oe,Z[K]=V,B=K;else break e}}return te}function i(Z,te){var V=Z.sortIndex-te.sortIndex;return V!==0?V:Z.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var u=[],h=[],f=1,v=null,g=3,p=!1,y=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(Z){for(var te=r(h);te!==null;){if(te.callback===null)n(h);else if(te.startTime<=Z)n(h),te.sortIndex=te.expirationTime,e(u,te);else break;te=r(h)}}function S(Z){if(_=!1,k(Z),!y)if(r(u)!==null)y=!0,ae(A);else{var te=r(h);te!==null&&ie(S,te.startTime-Z)}}function A(Z,te){y=!1,_&&(_=!1,b(I),I=-1),p=!0;var V=g;try{for(k(te),v=r(u);v!==null&&(!(v.expirationTime>te)||Z&&!O());){var B=v.callback;if(typeof B=="function"){v.callback=null,g=v.priorityLevel;var D=B(v.expirationTime<=te);te=t.unstable_now(),typeof D=="function"?v.callback=D:v===r(u)&&n(u),k(te)}else n(u);v=r(u)}if(v!==null)var U=!0;else{var X=r(h);X!==null&&ie(S,X.startTime-te),U=!1}return U}finally{v=null,g=V,p=!1}}var M=!1,C=null,I=-1,F=5,j=-1;function O(){return!(t.unstable_now()-j<F)}function T(){if(C!==null){var Z=t.unstable_now();j=Z;var te=!0;try{te=C(!0,Z)}finally{te?$():(M=!1,C=null)}}else M=!1}var $;if(typeof E=="function")$=function(){E(T)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,J=q.port2;q.port1.onmessage=T,$=function(){J.postMessage(null)}}else $=function(){x(T,0)};function ae(Z){C=Z,M||(M=!0,$())}function ie(Z,te){I=x(function(){Z(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Z){Z.callback=null},t.unstable_continueExecution=function(){y||p||(y=!0,ae(A))},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(Z){switch(g){case 1:case 2:case 3:var te=3;break;default:te=g}var V=g;g=te;try{return Z()}finally{g=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(Z,te){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var V=g;g=Z;try{return te()}finally{g=V}},t.unstable_scheduleCallback=function(Z,te,V){var B=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?B+V:B):V=B,Z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=V+D,Z={id:f++,callback:te,priorityLevel:Z,startTime:V,expirationTime:D,sortIndex:-1},V>B?(Z.sortIndex=V,e(h,Z),r(u)===null&&Z===r(h)&&(_?(b(I),I=-1):_=!0,ie(S,V-B))):(Z.sortIndex=D,e(u,Z),y||p||(y=!0,ae(A))),Z},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(Z){var te=g;return function(){var V=g;g=te;try{return Z.apply(this,arguments)}finally{g=V}}}}(Cg)),Cg}var e5;function Tm(){return e5||(e5=1,Og.exports=Mx()),Og.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 t5;function Ix(){if(t5)return Os;t5=1;var t=Sp(),e=Tm();function r(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,w=1;w<arguments.length;w++)c+="&args[]="+encodeURIComponent(arguments[w]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(l,c){o(l,c),o(l+"Capture",c)}function o(l,c){for(i[l]=c,l=0;l<c.length;l++)n.add(c[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[: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]*$/,f={},v={};function g(l){return u.call(v,l)?!0:u.call(f,l)?!1:h.test(l)?v[l]=!0:(f[l]=!0,!1)}function p(l,c,w,N){if(w!==null&&w.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return N?!1:w!==null?!w.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,c,w,N){if(c===null||typeof c>"u"||p(l,c,w,N))return!0;if(N)return!1;if(w!==null)switch(w.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(l,c,w,N,G,Q,he){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=N,this.attributeNamespace=G,this.mustUseProperty=w,this.propertyName=l,this.type=c,this.sanitizeURL=Q,this.removeEmptyString=he}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new _(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var c=l[0];x[c]=new _(c,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new _(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new _(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){x[l]=new _(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new _(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new _(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new _(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new _(l,5,!1,l.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function E(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 c=l.replace(b,E);x[c]=new _(c,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!0,!0)});function k(l,c,w,N){var G=x.hasOwnProperty(c)?x[c]:null;(G!==null?G.type!==0:N||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(y(c,w,G,N)&&(w=null),N||G===null?g(c)&&(w===null?l.removeAttribute(c):l.setAttribute(c,""+w)):G.mustUseProperty?l[G.propertyName]=w===null?G.type===3?!1:"":w:(c=G.attributeName,N=G.attributeNamespace,w===null?l.removeAttribute(c):(G=G.type,w=G===3||G===4&&w===!0?"":""+w,N?l.setAttributeNS(N,c,w):l.setAttribute(c,w))))}var S=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),M=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),O=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),Z=Symbol.iterator;function te(l){return l===null||typeof l!="object"?null:(l=Z&&l[Z]||l["@@iterator"],typeof l=="function"?l:null)}var V=Object.assign,B;function D(l){if(B===void 0)try{throw Error()}catch(w){var c=w.stack.trim().match(/\n( *(at )?)/);B=c&&c[1]||""}return`
26
+ `+B+l}var U=!1;function X(l,c){if(!l||U)return"";U=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(nt){var N=nt}Reflect.construct(l,[],c)}else{try{c.call()}catch(nt){N=nt}l.call(c.prototype)}else{try{throw Error()}catch(nt){N=nt}l()}}catch(nt){if(nt&&N&&typeof nt.stack=="string"){for(var G=nt.stack.split(`
27
+ `),Q=N.stack.split(`
28
+ `),he=G.length-1,Me=Q.length-1;1<=he&&0<=Me&&G[he]!==Q[Me];)Me--;for(;1<=he&&0<=Me;he--,Me--)if(G[he]!==Q[Me]){if(he!==1||Me!==1)do if(he--,Me--,0>Me||G[he]!==Q[Me]){var ze=`
29
+ `+G[he].replace(" at new "," at ");return l.displayName&&ze.includes("<anonymous>")&&(ze=ze.replace("<anonymous>",l.displayName)),ze}while(1<=he&&0<=Me);break}}}finally{U=!1,Error.prepareStackTrace=w}return(l=l?l.displayName||l.name:"")?D(l):""}function ee(l){switch(l.tag){case 5:return D(l.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return l=X(l.type,!1),l;case 11:return l=X(l.type.render,!1),l;case 1:return l=X(l.type,!0),l;default:return""}}function K(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 C:return"Fragment";case M:return"Portal";case F:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case q: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 T:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case J:return c=l.displayName||null,c!==null?c:K(l.type)||"Memo";case ae:c=l._payload,l=l._init;try{return K(l(c))}catch{}}return null}function oe(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(c);case 8:return c===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function me(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function de(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ye(l){var c=de(l)?"checked":"value",w=Object.getOwnPropertyDescriptor(l.constructor.prototype,c),N=""+l[c];if(!l.hasOwnProperty(c)&&typeof w<"u"&&typeof w.get=="function"&&typeof w.set=="function"){var G=w.get,Q=w.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return G.call(this)},set:function(he){N=""+he,Q.call(this,he)}}),Object.defineProperty(l,c,{enumerable:w.enumerable}),{getValue:function(){return N},setValue:function(he){N=""+he},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function Te(l){l._valueTracker||(l._valueTracker=ye(l))}function Ce(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var w=c.getValue(),N="";return l&&(N=de(l)?l.checked?"true":"false":l.value),l=N,l!==w?(c.setValue(l),!0):!1}function Ie(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 Ee(l,c){var w=c.checked;return V({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:w??l._wrapperState.initialChecked})}function ge(l,c){var w=c.defaultValue==null?"":c.defaultValue,N=c.checked!=null?c.checked:c.defaultChecked;w=me(c.value!=null?c.value:w),l._wrapperState={initialChecked:N,initialValue:w,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Re(l,c){c=c.checked,c!=null&&k(l,"checked",c,!1)}function Be(l,c){Re(l,c);var w=me(c.value),N=c.type;if(w!=null)N==="number"?(w===0&&l.value===""||l.value!=w)&&(l.value=""+w):l.value!==""+w&&(l.value=""+w);else if(N==="submit"||N==="reset"){l.removeAttribute("value");return}c.hasOwnProperty("value")?fe(l,c.type,w):c.hasOwnProperty("defaultValue")&&fe(l,c.type,me(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(l.defaultChecked=!!c.defaultChecked)}function Oe(l,c,w){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var N=c.type;if(!(N!=="submit"&&N!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+l._wrapperState.initialValue,w||c===l.value||(l.value=c),l.defaultValue=c}w=l.name,w!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,w!==""&&(l.name=w)}function fe(l,c,w){(c!=="number"||Ie(l.ownerDocument)!==l)&&(w==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+w&&(l.defaultValue=""+w))}var Le=Array.isArray;function Ne(l,c,w,N){if(l=l.options,c){c={};for(var G=0;G<w.length;G++)c["$"+w[G]]=!0;for(w=0;w<l.length;w++)G=c.hasOwnProperty("$"+l[w].value),l[w].selected!==G&&(l[w].selected=G),G&&N&&(l[w].defaultSelected=!0)}else{for(w=""+me(w),c=null,G=0;G<l.length;G++){if(l[G].value===w){l[G].selected=!0,N&&(l[G].defaultSelected=!0);return}c!==null||l[G].disabled||(c=l[G])}c!==null&&(c.selected=!0)}}function ue(l,c){if(c.dangerouslySetInnerHTML!=null)throw Error(r(91));return V({},c,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function ke(l,c){var w=c.value;if(w==null){if(w=c.children,c=c.defaultValue,w!=null){if(c!=null)throw Error(r(92));if(Le(w)){if(1<w.length)throw Error(r(93));w=w[0]}c=w}c==null&&(c=""),w=c}l._wrapperState={initialValue:me(w)}}function Pe(l,c){var w=me(c.value),N=me(c.defaultValue);w!=null&&(w=""+w,w!==l.value&&(l.value=w),c.defaultValue==null&&l.defaultValue!==w&&(l.defaultValue=w)),N!=null&&(l.defaultValue=""+N)}function Ue(l){var c=l.textContent;c===l._wrapperState.initialValue&&c!==""&&c!==null&&(l.value=c)}function st(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 dt(l,c){return l==null||l==="http://www.w3.org/1999/xhtml"?st(c):l==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var pt,xt=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,w,N,G){MSApp.execUnsafeLocalFunction(function(){return l(c,w,N,G)})}:l}(function(l,c){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=c;else{for(pt=pt||document.createElement("div"),pt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=pt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;c.firstChild;)l.appendChild(c.firstChild)}});function bt(l,c){if(c){var w=l.firstChild;if(w&&w===l.lastChild&&w.nodeType===3){w.nodeValue=c;return}}l.textContent=c}var At={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},Br=["Webkit","ms","Moz","O"];Object.keys(At).forEach(function(l){Br.forEach(function(c){c=c+l.charAt(0).toUpperCase()+l.substring(1),At[c]=At[l]})});function _r(l,c,w){return c==null||typeof c=="boolean"||c===""?"":w||typeof c!="number"||c===0||At.hasOwnProperty(l)&&At[l]?(""+c).trim():c+"px"}function It(l,c){l=l.style;for(var w in c)if(c.hasOwnProperty(w)){var N=w.indexOf("--")===0,G=_r(w,c[w],N);w==="float"&&(w="cssFloat"),N?l.setProperty(w,G):l[w]=G}}var Jt=V({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 Ve(l,c){if(c){if(Jt[l]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,l));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function qe(l,c){if(l.indexOf("-")===-1)return typeof c.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 Nt=null;function Ct(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ir=null,Ut=null,xr=null;function er(l){if(l=bu(l)){if(typeof ir!="function")throw Error(r(280));var c=l.stateNode;c&&(c=Ni(c),ir(l.stateNode,l.type,c))}}function pr(l){Ut?xr?xr.push(l):xr=[l]:Ut=l}function Fi(){if(Ut){var l=Ut,c=xr;if(xr=Ut=null,er(l),c)for(l=0;l<c.length;l++)er(c[l])}}function oi(l,c){return l(c)}function Ei(){}var Sn=!1;function Zt(l,c,w){if(Sn)return l(c,w);Sn=!0;try{return oi(l,c,w)}finally{Sn=!1,(Ut!==null||xr!==null)&&(Ei(),Fi())}}function ca(l,c){var w=l.stateNode;if(w===null)return null;var N=Ni(w);if(N===null)return null;w=N[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(N=!N.disabled)||(l=l.type,N=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!N;break e;default:l=!1}if(l)return null;if(w&&typeof w!="function")throw Error(r(231,c,typeof w));return w}var Fa=!1;if(s)try{var Kn={};Object.defineProperty(Kn,"passive",{get:function(){Fa=!0}}),window.addEventListener("test",Kn,Kn),window.removeEventListener("test",Kn,Kn)}catch{Fa=!1}function Yi(l,c,w,N,G,Q,he,Me,ze){var nt=Array.prototype.slice.call(arguments,3);try{c.apply(w,nt)}catch(vt){this.onError(vt)}}var zr=!1,En=null,Rn=!1,Sa=null,Uo={onError:function(l){zr=!0,En=l}};function Ea(l,c,w,N,G,Q,he,Me,ze){zr=!1,En=null,Yi.apply(Uo,arguments)}function eo(l,c,w,N,G,Q,he,Me,ze){if(Ea.apply(this,arguments),zr){if(zr){var nt=En;zr=!1,En=null}else throw Error(r(198));Rn||(Rn=!0,Sa=nt)}}function si(l){var c=l,w=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(w=c.return),l=c.return;while(l)}return c.tag===3?w:null}function Aa(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function ka(l){if(si(l)!==l)throw Error(r(188))}function Ho(l){var c=l.alternate;if(!c){if(c=si(l),c===null)throw Error(r(188));return c!==l?null:l}for(var w=l,N=c;;){var G=w.return;if(G===null)break;var Q=G.alternate;if(Q===null){if(N=G.return,N!==null){w=N;continue}break}if(G.child===Q.child){for(Q=G.child;Q;){if(Q===w)return ka(G),l;if(Q===N)return ka(G),c;Q=Q.sibling}throw Error(r(188))}if(w.return!==N.return)w=G,N=Q;else{for(var he=!1,Me=G.child;Me;){if(Me===w){he=!0,w=G,N=Q;break}if(Me===N){he=!0,N=G,w=Q;break}Me=Me.sibling}if(!he){for(Me=Q.child;Me;){if(Me===w){he=!0,w=Q,N=G;break}if(Me===N){he=!0,N=Q,w=G;break}Me=Me.sibling}if(!he)throw Error(r(189))}}if(w.alternate!==N)throw Error(r(190))}if(w.tag!==3)throw Error(r(188));return w.stateNode.current===w?l:c}function Bi(l){return l=Ho(l),l!==null?to(l):null}function to(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=to(l);if(c!==null)return c;l=l.sibling}return null}var Ds=e.unstable_scheduleCallback,rs=e.unstable_cancelCallback,su=e.unstable_shouldYield,Lf=e.unstable_requestPaint,An=e.unstable_now,lu=e.unstable_getCurrentPriorityLevel,ns=e.unstable_ImmediatePriority,Pa=e.unstable_UserBlockingPriority,is=e.unstable_NormalPriority,Sc=e.unstable_LowPriority,sl=e.unstable_IdlePriority,_o=null,gi=null;function cn(l){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(_o,l,void 0,(l.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:Xi,as=Math.log,Tr=Math.LN2;function Xi(l){return l>>>=0,l===0?32:31-(as(l)/Tr|0)|0}var ro=64,Ki=4194304;function Mn(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 Zi(l,c){var w=l.pendingLanes;if(w===0)return 0;var N=0,G=l.suspendedLanes,Q=l.pingedLanes,he=w&268435455;if(he!==0){var Me=he&~G;Me!==0?N=Mn(Me):(Q&=he,Q!==0&&(N=Mn(Q)))}else he=w&~G,he!==0?N=Mn(he):Q!==0&&(N=Mn(Q));if(N===0)return 0;if(c!==0&&c!==N&&(c&G)===0&&(G=N&-N,Q=c&-c,G>=Q||G===16&&(Q&4194240)!==0))return c;if((N&4)!==0&&(N|=w&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=N;0<c;)w=31-Sr(c),G=1<<w,N|=l[w],c&=~G;return N}function ll(l,c){switch(l){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zn(l,c){for(var w=l.suspendedLanes,N=l.pingedLanes,G=l.expirationTimes,Q=l.pendingLanes;0<Q;){var he=31-Sr(Q),Me=1<<he,ze=G[he];ze===-1?((Me&w)===0||(Me&N)!==0)&&(G[he]=ll(Me,c)):ze<=c&&(l.expiredLanes|=Me),Q&=~Me}}function os(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Wu(){var l=ro;return ro<<=1,(ro&4194240)===0&&(ro=64),l}function Oa(l){for(var c=[],w=0;31>w;w++)c.push(l);return c}function Nl(l,c,w){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Sr(c),l[c]=w}function ss(l,c){var w=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var N=l.eventTimes;for(l=l.expirationTimes;0<w;){var G=31-Sr(w),Q=1<<G;c[G]=0,N[G]=-1,l[G]=-1,w&=~Q}}function uu(l,c){var w=l.entangledLanes|=c;for(l=l.entanglements;w;){var N=31-Sr(w),G=1<<N;G&c|l[N]&c&&(l[N]|=c),w&=~G}}var Rr=0;function xo(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var ls,ul,Ec,Ac,cl,us=!1,no=[],Ba=null,za=null,qa=null,Pt=new Map,fl=new Map,So=[],kc="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 Pc(l,c){switch(l){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Pt.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":fl.delete(c.pointerId)}}function io(l,c,w,N,G,Q){return l===null||l.nativeEvent!==Q?(l={blockedOn:c,domEventName:w,eventSystemFlags:N,nativeEvent:Q,targetContainers:[G]},c!==null&&(c=bu(c),c!==null&&ul(c)),l):(l.eventSystemFlags|=N,c=l.targetContainers,G!==null&&c.indexOf(G)===-1&&c.push(G),l)}function wn(l,c,w,N,G){switch(c){case"focusin":return Ba=io(Ba,l,c,w,N,G),!0;case"dragenter":return za=io(za,l,c,w,N,G),!0;case"mouseover":return qa=io(qa,l,c,w,N,G),!0;case"pointerover":var Q=G.pointerId;return Pt.set(Q,io(Pt.get(Q)||null,l,c,w,N,G)),!0;case"gotpointercapture":return Q=G.pointerId,fl.set(Q,io(fl.get(Q)||null,l,c,w,N,G)),!0}return!1}function cu(l){var c=Ws(l.target);if(c!==null){var w=si(c);if(w!==null){if(c=w.tag,c===13){if(c=Aa(w),c!==null){l.blockedOn=c,cl(l.priority,function(){Ec(w)});return}}else if(c===3&&w.stateNode.current.memoizedState.isDehydrated){l.blockedOn=w.tag===3?w.stateNode.containerInfo:null;return}}}l.blockedOn=null}function fu(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var w=hl(l.domEventName,l.eventSystemFlags,c[0],l.nativeEvent);if(w===null){w=l.nativeEvent;var N=new w.constructor(w.type,w);Nt=N,w.target.dispatchEvent(N),Nt=null}else return c=bu(w),c!==null&&ul(c),l.blockedOn=w,!1;c.shift()}return!0}function Fs(l,c,w){fu(l)&&w.delete(c)}function Vu(){us=!1,Ba!==null&&fu(Ba)&&(Ba=null),za!==null&&fu(za)&&(za=null),qa!==null&&fu(qa)&&(qa=null),Pt.forEach(Fs),fl.forEach(Fs)}function Ua(l,c){l.blockedOn===c&&(l.blockedOn=null,us||(us=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Vu)))}function Ai(l){function c(G){return Ua(G,l)}if(0<no.length){Ua(no[0],l);for(var w=1;w<no.length;w++){var N=no[w];N.blockedOn===l&&(N.blockedOn=null)}}for(Ba!==null&&Ua(Ba,l),za!==null&&Ua(za,l),qa!==null&&Ua(qa,l),Pt.forEach(c),fl.forEach(c),w=0;w<So.length;w++)N=So[w],N.blockedOn===l&&(N.blockedOn=null);for(;0<So.length&&(w=So[0],w.blockedOn===null);)cu(w),w.blockedOn===null&&So.shift()}var $o=S.ReactCurrentBatchConfig,hu=!0;function Ca(l,c,w,N){var G=Rr,Q=$o.transition;$o.transition=null;try{Rr=1,Eo(l,c,w,N)}finally{Rr=G,$o.transition=Q}}function ao(l,c,w,N){var G=Rr,Q=$o.transition;$o.transition=null;try{Rr=4,Eo(l,c,w,N)}finally{Rr=G,$o.transition=Q}}function Eo(l,c,w,N){if(hu){var G=hl(l,c,w,N);if(G===null)vu(l,c,N,Ao,w),Pc(l,N);else if(wn(G,l,c,w,N))N.stopPropagation();else if(Pc(l,N),c&4&&-1<kc.indexOf(l)){for(;G!==null;){var Q=bu(G);if(Q!==null&&ls(Q),Q=hl(l,c,w,N),Q===null&&vu(l,c,N,Ao,w),Q===G)break;G=Q}G!==null&&N.stopPropagation()}else vu(l,c,N,null,w)}}var Ao=null;function hl(l,c,w,N){if(Ao=null,l=Ct(N),l=Ws(l),l!==null)if(c=si(l),c===null)l=null;else if(w=c.tag,w===13){if(l=Aa(c),l!==null)return l;l=null}else if(w===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null);return Ao=l,null}function Tl(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(lu()){case ns:return 1;case Pa:return 4;case is:case Sc:return 16;case sl:return 536870912;default:return 16}default:return 16}}var li=null,Ha=null,ko=null;function dl(){if(ko)return ko;var l,c=Ha,w=c.length,N,G="value"in li?li.value:li.textContent,Q=G.length;for(l=0;l<w&&c[l]===G[l];l++);var he=w-l;for(N=1;N<=he&&c[w-N]===G[Q-N];N++);return ko=G.slice(l,1<N?1-N:void 0)}function La(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function Bn(){return!0}function fa(){return!1}function Qn(l){function c(w,N,G,Q,he){this._reactName=w,this._targetInst=G,this.type=N,this.nativeEvent=Q,this.target=he,this.currentTarget=null;for(var Me in l)l.hasOwnProperty(Me)&&(w=l[Me],this[Me]=w?w(Q):Q[Me]);return this.isDefaultPrevented=(Q.defaultPrevented!=null?Q.defaultPrevented:Q.returnValue===!1)?Bn:fa,this.isPropagationStopped=fa,this}return V(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var w=this.nativeEvent;w&&(w.preventDefault?w.preventDefault():typeof w.returnValue!="unknown"&&(w.returnValue=!1),this.isDefaultPrevented=Bn)},stopPropagation:function(){var w=this.nativeEvent;w&&(w.stopPropagation?w.stopPropagation():typeof w.cancelBubble!="unknown"&&(w.cancelBubble=!0),this.isPropagationStopped=Bn)},persist:function(){},isPersistent:Bn}),c}var vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$a=Qn(vi),H=V({},vi,{view:0,detail:0}),ce=Qn(H),Ae,De,Ge,at=V({},H,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oo,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!==Ge&&(Ge&&l.type==="mousemove"?(Ae=l.screenX-Ge.screenX,De=l.screenY-Ge.screenY):De=Ae=0,Ge=l),Ae)},movementY:function(l){return"movementY"in l?l.movementY:De}}),ct=Qn(at),Dt=V({},at,{dataTransfer:0}),jt=Qn(Dt),cr=V({},H,{relatedTarget:0}),fr=Qn(cr),qr=V({},vi,{animationName:0,elapsedTime:0,pseudoElement:0}),kn=Qn(qr),ui=V({},vi,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),on=Qn(ui),mi=V({},vi,{data:0}),_n=Qn(mi),ki={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Po={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"},Qi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Oc(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=Qi[l])?!!c[l]:!1}function Oo(){return Oc}var cs=V({},H,{key:function(l){if(l.key){var c=ki[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=La(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Po[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oo,charCode:function(l){return l.type==="keypress"?La(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?La(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),Bs=Qn(cs),pl=V({},at,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oo=Qn(pl),gl=V({},H,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oo}),Pi=Qn(gl),fs=V({},vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Co=Qn(fs),Rl=V({},at,{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}),Ml=Qn(Rl),zn=[9,13,27,32],so=s&&"CompositionEvent"in window,Lo=null;s&&"documentMode"in document&&(Lo=document.documentMode);var zs=s&&"TextEvent"in window&&!Lo,In=s&&(!so||Lo&&8<Lo&&11>=Lo),Ga=" ",vl=!1;function Il(l,c){switch(l){case"keyup":return zn.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zi(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Oi=!1;function Na(l,c){switch(l){case"compositionend":return zi(c);case"keypress":return c.which!==32?null:(vl=!0,Ga);case"textInput":return l=c.data,l===Ga&&vl?null:l;default:return null}}function Wa(l,c){if(Oi)return l==="compositionend"||!so&&Il(l,c)?(l=dl(),ko=Ha=li=null,Oi=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return In&&c.locale!=="ko"?null:c.data;default:return null}}var ha={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 Ji(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!ha[l.type]:c==="textarea"}function No(l,c,w,N){pr(N),c=Ic(c,"onChange"),0<c.length&&(w=new $a("onChange","change",null,w,N),l.push({event:w,listeners:c}))}var hs=null,lo=null;function Jn(l){pu(l,0)}function Go(l){var c=yi(l);if(Ce(c))return l}function ci(l,c){if(l==="change")return c}var Ta=!1;if(s){var To;if(s){var da="oninput"in document;if(!da){var ml=document.createElement("div");ml.setAttribute("oninput","return;"),da=typeof ml.oninput=="function"}To=da}else To=!1;Ta=To&&(!document.documentMode||9<document.documentMode)}function Wo(){hs&&(hs.detachEvent("onpropertychange",ds),lo=hs=null)}function ds(l){if(l.propertyName==="value"&&Go(lo)){var c=[];No(c,lo,l,Ct(l)),Zt(Jn,c)}}function ps(l,c,w){l==="focusin"?(Wo(),hs=c,lo=w,hs.attachEvent("onpropertychange",ds)):l==="focusout"&&Wo()}function Jr(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Go(lo)}function gs(l,c){if(l==="click")return Go(c)}function vs(l,c){if(l==="input"||l==="change")return Go(c)}function qs(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Pn=typeof Object.is=="function"?Object.is:qs;function pa(l,c){if(Pn(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var w=Object.keys(l),N=Object.keys(c);if(w.length!==N.length)return!1;for(N=0;N<w.length;N++){var G=w[N];if(!u.call(c,G)||!Pn(l[G],c[G]))return!1}return!0}function Cr(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function ar(l,c){var w=Cr(l);l=0;for(var N;w;){if(w.nodeType===3){if(N=l+w.textContent.length,l<=c&&N>=c)return{node:w,offset:c-l};l=N}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=Cr(w)}}function Er(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?Er(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function Lr(){for(var l=window,c=Ie();c instanceof l.HTMLIFrameElement;){try{var w=typeof c.contentWindow.location.href=="string"}catch{w=!1}if(w)l=c.contentWindow;else break;c=Ie(l.document)}return c}function Va(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}function Us(l){var c=Lr(),w=l.focusedElem,N=l.selectionRange;if(c!==w&&w&&w.ownerDocument&&Er(w.ownerDocument.documentElement,w)){if(N!==null&&Va(w)){if(c=N.start,l=N.end,l===void 0&&(l=c),"selectionStart"in w)w.selectionStart=c,w.selectionEnd=Math.min(l,w.value.length);else if(l=(c=w.ownerDocument||document)&&c.defaultView||window,l.getSelection){l=l.getSelection();var G=w.textContent.length,Q=Math.min(N.start,G);N=N.end===void 0?Q:Math.min(N.end,G),!l.extend&&Q>N&&(G=N,N=Q,Q=G),G=ar(w,Q);var he=ar(w,N);G&&he&&(l.rangeCount!==1||l.anchorNode!==G.node||l.anchorOffset!==G.offset||l.focusNode!==he.node||l.focusOffset!==he.offset)&&(c=c.createRange(),c.setStart(G.node,G.offset),l.removeAllRanges(),Q>N?(l.addRange(c),l.extend(he.node,he.offset)):(c.setEnd(he.node,he.offset),l.addRange(c)))}}for(c=[],l=w;l=l.parentNode;)l.nodeType===1&&c.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<c.length;w++)l=c[w],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var ms=s&&"documentMode"in document&&11>=document.documentMode,Hs=null,Ci=null,yl=null,du=!1;function Yu(l,c,w){var N=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;du||Hs==null||Hs!==Ie(N)||(N=Hs,"selectionStart"in N&&Va(N)?N={start:N.selectionStart,end:N.selectionEnd}:(N=(N.ownerDocument&&N.ownerDocument.defaultView||window).getSelection(),N={anchorNode:N.anchorNode,anchorOffset:N.anchorOffset,focusNode:N.focusNode,focusOffset:N.focusOffset}),yl&&pa(yl,N)||(yl=N,N=Ic(Ci,"onSelect"),0<N.length&&(c=new $a("onSelect","select",null,c,w),l.push({event:c,listeners:N}),c.target=Hs)))}function Ya(l,c){var w={};return w[l.toLowerCase()]=c.toLowerCase(),w["Webkit"+l]="webkit"+c,w["Moz"+l]="moz"+c,w}var qi={animationend:Ya("Animation","AnimationEnd"),animationiteration:Ya("Animation","AnimationIteration"),animationstart:Ya("Animation","AnimationStart"),transitionend:Ya("Transition","TransitionEnd")},Vo={},Xu={};s&&(Xu=document.createElement("div").style,"AnimationEvent"in window||(delete qi.animationend.animation,delete qi.animationiteration.animation,delete qi.animationstart.animation),"TransitionEvent"in window||delete qi.transitionend.transition);function jl(l){if(Vo[l])return Vo[l];if(!qi[l])return l;var c=qi[l],w;for(w in c)if(c.hasOwnProperty(w)&&w in Xu)return Vo[l]=c[w];return l}var Cc=jl("animationend"),Lc=jl("animationiteration"),Nc=jl("animationstart"),Tc=jl("transitionend"),Rc=new Map,Mc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Yo(l,c){Rc.set(l,c),a(c,[l])}for(var Dl=0;Dl<Mc.length;Dl++){var Li=Mc[Dl],uo=Li.toLowerCase(),Fl=Li[0].toUpperCase()+Li.slice(1);Yo(uo,"on"+Fl)}Yo(Cc,"onAnimationEnd"),Yo(Lc,"onAnimationIteration"),Yo(Nc,"onAnimationStart"),Yo("dblclick","onDoubleClick"),Yo("focusin","onFocus"),Yo("focusout","onBlur"),Yo(Tc,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xo="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(" "),Nf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xo));function Bl(l,c,w){var N=l.type||"unknown-event";l.currentTarget=w,eo(N,c,void 0,l),l.currentTarget=null}function pu(l,c){c=(c&4)!==0;for(var w=0;w<l.length;w++){var N=l[w],G=N.event;N=N.listeners;e:{var Q=void 0;if(c)for(var he=N.length-1;0<=he;he--){var Me=N[he],ze=Me.instance,nt=Me.currentTarget;if(Me=Me.listener,ze!==Q&&G.isPropagationStopped())break e;Bl(G,Me,nt),Q=ze}else for(he=0;he<N.length;he++){if(Me=N[he],ze=Me.instance,nt=Me.currentTarget,Me=Me.listener,ze!==Q&&G.isPropagationStopped())break e;Bl(G,Me,nt),Q=ze}}}if(Rn)throw l=Sa,Rn=!1,Sa=null,l}function fn(l,c){var w=c[Ra];w===void 0&&(w=c[Ra]=new Set);var N=l+"__bubble";w.has(N)||(gu(c,l,2,!1),w.add(N))}function Ku(l,c,w){var N=0;c&&(N|=4),gu(w,l,N,c)}var zl="_reactListening"+Math.random().toString(36).slice(2);function $s(l){if(!l[zl]){l[zl]=!0,n.forEach(function(w){w!=="selectionchange"&&(Nf.has(w)||Ku(w,!1,l),Ku(w,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[zl]||(c[zl]=!0,Ku("selectionchange",!1,c))}}function gu(l,c,w,N){switch(Tl(c)){case 1:var G=Ca;break;case 4:G=ao;break;default:G=Eo}w=G.bind(null,c,w,l),G=void 0,!Fa||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(G=!0),N?G!==void 0?l.addEventListener(c,w,{capture:!0,passive:G}):l.addEventListener(c,w,!0):G!==void 0?l.addEventListener(c,w,{passive:G}):l.addEventListener(c,w,!1)}function vu(l,c,w,N,G){var Q=N;if((c&1)===0&&(c&2)===0&&N!==null)e:for(;;){if(N===null)return;var he=N.tag;if(he===3||he===4){var Me=N.stateNode.containerInfo;if(Me===G||Me.nodeType===8&&Me.parentNode===G)break;if(he===4)for(he=N.return;he!==null;){var ze=he.tag;if((ze===3||ze===4)&&(ze=he.stateNode.containerInfo,ze===G||ze.nodeType===8&&ze.parentNode===G))return;he=he.return}for(;Me!==null;){if(he=Ws(Me),he===null)return;if(ze=he.tag,ze===5||ze===6){N=Q=he;continue e}Me=Me.parentNode}}N=N.return}Zt(function(){var nt=Q,vt=Ct(w),yt=[];e:{var gt=Rc.get(l);if(gt!==void 0){var qt=$a,Vt=l;switch(l){case"keypress":if(La(w)===0)break e;case"keydown":case"keyup":qt=Bs;break;case"focusin":Vt="focus",qt=fr;break;case"focusout":Vt="blur",qt=fr;break;case"beforeblur":case"afterblur":qt=fr;break;case"click":if(w.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qt=ct;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qt=jt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qt=Pi;break;case Cc:case Lc:case Nc:qt=kn;break;case Tc:qt=Co;break;case"scroll":qt=ce;break;case"wheel":qt=Ml;break;case"copy":case"cut":case"paste":qt=on;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qt=oo}var Xt=(c&4)!==0,aa=!Xt&&l==="scroll",et=Xt?gt!==null?gt+"Capture":null:gt;Xt=[];for(var We=nt,tt;We!==null;){tt=We;var _t=tt.stateNode;if(tt.tag===5&&_t!==null&&(tt=_t,et!==null&&(_t=ca(We,et),_t!=null&&Xt.push(mu(We,_t,tt)))),aa)break;We=We.return}0<Xt.length&&(gt=new qt(gt,Vt,null,w,vt),yt.push({event:gt,listeners:Xt}))}}if((c&7)===0){e:{if(gt=l==="mouseover"||l==="pointerover",qt=l==="mouseout"||l==="pointerout",gt&&w!==Nt&&(Vt=w.relatedTarget||w.fromElement)&&(Ws(Vt)||Vt[ra]))break e;if((qt||gt)&&(gt=vt.window===vt?vt:(gt=vt.ownerDocument)?gt.defaultView||gt.parentWindow:window,qt?(Vt=w.relatedTarget||w.toElement,qt=nt,Vt=Vt?Ws(Vt):null,Vt!==null&&(aa=si(Vt),Vt!==aa||Vt.tag!==5&&Vt.tag!==6)&&(Vt=null)):(qt=null,Vt=nt),qt!==Vt)){if(Xt=ct,_t="onMouseLeave",et="onMouseEnter",We="mouse",(l==="pointerout"||l==="pointerover")&&(Xt=oo,_t="onPointerLeave",et="onPointerEnter",We="pointer"),aa=qt==null?gt:yi(qt),tt=Vt==null?gt:yi(Vt),gt=new Xt(_t,We+"leave",qt,w,vt),gt.target=aa,gt.relatedTarget=tt,_t=null,Ws(vt)===nt&&(Xt=new Xt(et,We+"enter",Vt,w,vt),Xt.target=tt,Xt.relatedTarget=aa,_t=Xt),aa=_t,qt&&Vt)t:{for(Xt=qt,et=Vt,We=0,tt=Xt;tt;tt=bl(tt))We++;for(tt=0,_t=et;_t;_t=bl(_t))tt++;for(;0<We-tt;)Xt=bl(Xt),We--;for(;0<tt-We;)et=bl(et),tt--;for(;We--;){if(Xt===et||et!==null&&Xt===et.alternate)break t;Xt=bl(Xt),et=bl(et)}Xt=null}else Xt=null;qt!==null&&Sh(yt,gt,qt,Xt,!1),Vt!==null&&aa!==null&&Sh(yt,aa,Vt,Xt,!0)}}e:{if(gt=nt?yi(nt):window,qt=gt.nodeName&&gt.nodeName.toLowerCase(),qt==="select"||qt==="input"&&gt.type==="file")var Kt=ci;else if(Ji(gt))if(Ta)Kt=vs;else{Kt=Jr;var lr=ps}else(qt=gt.nodeName)&&qt.toLowerCase()==="input"&&(gt.type==="checkbox"||gt.type==="radio")&&(Kt=gs);if(Kt&&(Kt=Kt(l,nt))){No(yt,Kt,w,vt);break e}lr&&lr(l,gt,nt),l==="focusout"&&(lr=gt._wrapperState)&&lr.controlled&&gt.type==="number"&&fe(gt,"number",gt.value)}switch(lr=nt?yi(nt):window,l){case"focusin":(Ji(lr)||lr.contentEditable==="true")&&(Hs=lr,Ci=nt,yl=null);break;case"focusout":yl=Ci=Hs=null;break;case"mousedown":du=!0;break;case"contextmenu":case"mouseup":case"dragend":du=!1,Yu(yt,w,vt);break;case"selectionchange":if(ms)break;case"keydown":case"keyup":Yu(yt,w,vt)}var ur;if(so)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 Oi?Il(l,w)&&(mr="onCompositionEnd"):l==="keydown"&&w.keyCode===229&&(mr="onCompositionStart");mr&&(In&&w.locale!=="ko"&&(Oi||mr!=="onCompositionStart"?mr==="onCompositionEnd"&&Oi&&(ur=dl()):(li=vt,Ha="value"in li?li.value:li.textContent,Oi=!0)),lr=Ic(nt,mr),0<lr.length&&(mr=new _n(mr,l,null,w,vt),yt.push({event:mr,listeners:lr}),ur?mr.data=ur:(ur=zi(w),ur!==null&&(mr.data=ur)))),(ur=zs?Na(l,w):Wa(l,w))&&(nt=Ic(nt,"onBeforeInput"),0<nt.length&&(vt=new _n("onBeforeInput","beforeinput",null,w,vt),yt.push({event:vt,listeners:nt}),vt.data=ur))}pu(yt,c)})}function mu(l,c,w){return{instance:l,listener:c,currentTarget:w}}function Ic(l,c){for(var w=c+"Capture",N=[];l!==null;){var G=l,Q=G.stateNode;G.tag===5&&Q!==null&&(G=Q,Q=ca(l,w),Q!=null&&N.unshift(mu(l,Q,G)),Q=ca(l,c),Q!=null&&N.push(mu(l,Q,G))),l=l.return}return N}function bl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Sh(l,c,w,N,G){for(var Q=c._reactName,he=[];w!==null&&w!==N;){var Me=w,ze=Me.alternate,nt=Me.stateNode;if(ze!==null&&ze===N)break;Me.tag===5&&nt!==null&&(Me=nt,G?(ze=ca(w,Q),ze!=null&&he.unshift(mu(w,ze,Me))):G||(ze=ca(w,Q),ze!=null&&he.push(mu(w,ze,Me)))),w=w.return}he.length!==0&&l.push({event:c,listeners:he})}var Sd=/\r\n?/g,Eh=/\u0000|\uFFFD/g;function Tf(l){return(typeof l=="string"?l:""+l).replace(Sd,`
30
+ `).replace(Eh,"")}function Zu(l,c,w){if(c=Tf(c),Tf(l)!==c&&w)throw Error(r(425))}function Gs(){}var Qu=null,ql=null;function Rf(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var co=typeof setTimeout=="function"?setTimeout:void 0,jc=typeof clearTimeout=="function"?clearTimeout:void 0,Ju=typeof Promise=="function"?Promise:void 0,Ah=typeof queueMicrotask=="function"?queueMicrotask:typeof Ju<"u"?function(l){return Ju.resolve(null).then(l).catch(kh)}:co;function kh(l){setTimeout(function(){throw l})}function Dc(l,c){var w=c,N=0;do{var G=w.nextSibling;if(l.removeChild(w),G&&G.nodeType===8)if(w=G.data,w==="/$"){if(N===0){l.removeChild(G),Ai(c);return}N--}else w!=="$"&&w!=="$?"&&w!=="$!"||N++;w=G}while(w);Ai(c)}function ea(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return l}function ta(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var w=l.data;if(w==="$"||w==="$!"||w==="$?"){if(c===0)return l;c--}else w==="/$"&&c++}l=l.previousSibling}return null}var ga=Math.random().toString(36).slice(2),Ro="__reactFiber$"+ga,yu="__reactProps$"+ga,ra="__reactContainer$"+ga,Ra="__reactEvents$"+ga,Ph="__reactListeners$"+ga,Oh="__reactHandles$"+ga;function Ws(l){var c=l[Ro];if(c)return c;for(var w=l.parentNode;w;){if(c=w[ra]||w[Ro]){if(w=c.alternate,c.child!==null||w!==null&&w.child!==null)for(l=ta(l);l!==null;){if(w=l[Ro])return w;l=ta(l)}return c}l=w,w=l.parentNode}return null}function bu(l){return l=l[Ro]||l[ra],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function yi(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(r(33))}function Ni(l){return l[yu]||null}var Fc=[],ys=-1;function Mo(l){return{current:l}}function en(l){0>ys||(l.current=Fc[ys],Fc[ys]=null,ys--)}function sn(l,c){ys++,Fc[ys]=l.current,l.current=c}var bs={},Ui=Mo(bs),va=Mo(!1),wl=bs;function Ul(l,c){var w=l.type.contextTypes;if(!w)return bs;var N=l.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var G={},Q;for(Q in w)G[Q]=c[Q];return N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=G),G}function ma(l){return l=l.childContextTypes,l!=null}function wu(){en(va),en(Ui)}function Mf(l,c,w){if(Ui.current!==bs)throw Error(r(168));sn(Ui,c),sn(va,w)}function ec(l,c,w){var N=l.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return w;N=N.getChildContext();for(var G in N)if(!(G in c))throw Error(r(108,oe(l)||"Unknown",G));return V({},w,N)}function ws(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||bs,wl=Ui.current,sn(Ui,l),sn(va,va.current),!0}function Ch(l,c,w){var N=l.stateNode;if(!N)throw Error(r(169));w?(l=ec(l,c,wl),N.__reactInternalMemoizedMergedChildContext=l,en(va),en(Ui),sn(Ui,l)):en(va),sn(va,w)}var _s=null,Hl=!1,P=!1;function R(l){_s===null?_s=[l]:_s.push(l)}function Y(l){Hl=!0,R(l)}function re(){if(!P&&_s!==null){P=!0;var l=0,c=Rr;try{var w=_s;for(Rr=1;l<w.length;l++){var N=w[l];do N=N(!0);while(N!==null)}_s=null,Hl=!1}catch(G){throw _s!==null&&(_s=_s.slice(l+1)),Ds(ns,re),G}finally{Rr=c,P=!1}}return null}var le=[],pe=0,ve=null,be=0,we=[],Se=0,Fe=null,Je=1,xe="";function $e(l,c){le[pe++]=be,le[pe++]=ve,ve=l,be=c}function Qe(l,c,w){we[Se++]=Je,we[Se++]=xe,we[Se++]=Fe,Fe=l;var N=Je;l=xe;var G=32-Sr(N)-1;N&=~(1<<G),w+=1;var Q=32-Sr(c)+G;if(30<Q){var he=G-G%5;Q=(N&(1<<he)-1).toString(32),N>>=he,G-=he,Je=1<<32-Sr(c)+G|w<<G|N,xe=Q+l}else Je=1<<Q|w<<G|N,xe=l}function lt(l){l.return!==null&&($e(l,1),Qe(l,1,0))}function Xe(l){for(;l===ve;)ve=le[--pe],le[pe]=null,be=le[--pe],le[pe]=null;for(;l===Fe;)Fe=we[--Se],we[Se]=null,xe=we[--Se],we[Se]=null,Je=we[--Se],we[Se]=null}var ot=null,He=null,ft=!1,ht=null;function Wt(l,c){var w=El(5,null,null,0);w.elementType="DELETED",w.stateNode=c,w.return=l,c=l.deletions,c===null?(l.deletions=[w],l.flags|=16):c.push(w)}function Bt(l,c){switch(l.tag){case 5:var w=l.type;return c=c.nodeType!==1||w.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(l.stateNode=c,ot=l,He=ea(c.firstChild),!0):!1;case 6:return c=l.pendingProps===""||c.nodeType!==3?null:c,c!==null?(l.stateNode=c,ot=l,He=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(w=Fe!==null?{id:Je,overflow:xe}:null,l.memoizedState={dehydrated:c,treeContext:w,retryLane:1073741824},w=El(18,null,null,0),w.stateNode=c,w.return=l,l.child=w,ot=l,He=null,!0):!1;default:return!1}}function hr(l){return(l.mode&1)!==0&&(l.flags&128)===0}function zt(l){if(ft){var c=He;if(c){var w=c;if(!Bt(l,c)){if(hr(l))throw Error(r(418));c=ea(w.nextSibling);var N=ot;c&&Bt(l,c)?Wt(N,w):(l.flags=l.flags&-4097|2,ft=!1,ot=l)}}else{if(hr(l))throw Error(r(418));l.flags=l.flags&-4097|2,ft=!1,ot=l}}}function Pr(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ot=l}function qn(l){if(l!==ot)return!1;if(!ft)return Pr(l),ft=!0,!1;var c;if((c=l.tag!==3)&&!(c=l.tag!==5)&&(c=l.type,c=c!=="head"&&c!=="body"&&!Rf(l.type,l.memoizedProps)),c&&(c=He)){if(hr(l))throw vr(),Error(r(418));for(;c;)Wt(l,c),c=ea(c.nextSibling)}if(Pr(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));e:{for(l=l.nextSibling,c=0;l;){if(l.nodeType===8){var w=l.data;if(w==="/$"){if(c===0){He=ea(l.nextSibling);break e}c--}else w!=="$"&&w!=="$!"&&w!=="$?"||c++}l=l.nextSibling}He=null}}else He=ot?ea(l.stateNode.nextSibling):null;return!0}function vr(){for(var l=He;l;)l=ea(l.nextSibling)}function Ft(){He=ot=null,ft=!1}function St(l){ht===null?ht=[l]:ht.push(l)}var Un=S.ReactCurrentBatchConfig;function Ht(l,c,w){if(l=w.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(w._owner){if(w=w._owner,w){if(w.tag!==1)throw Error(r(309));var N=w.stateNode}if(!N)throw Error(r(147,l));var G=N,Q=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===Q?c.ref:(c=function(he){var Me=G.refs;he===null?delete Me[Q]:Me[Q]=he},c._stringRef=Q,c)}if(typeof l!="string")throw Error(r(284));if(!w._owner)throw Error(r(290,l))}return l}function dr(l,c){throw l=Object.prototype.toString.call(c),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function Mr(l){var c=l._init;return c(l._payload)}function bi(l){function c(et,We){if(l){var tt=et.deletions;tt===null?(et.deletions=[We],et.flags|=16):tt.push(We)}}function w(et,We){if(!l)return null;for(;We!==null;)c(et,We),We=We.sibling;return null}function N(et,We){for(et=new Map;We!==null;)We.key!==null?et.set(We.key,We):et.set(We.index,We),We=We.sibling;return et}function G(et,We){return et=Qc(et,We),et.index=0,et.sibling=null,et}function Q(et,We,tt){return et.index=tt,l?(tt=et.alternate,tt!==null?(tt=tt.index,tt<We?(et.flags|=2,We):tt):(et.flags|=2,We)):(et.flags|=1048576,We)}function he(et){return l&&et.alternate===null&&(et.flags|=2),et}function Me(et,We,tt,_t){return We===null||We.tag!==6?(We=wg(tt,et.mode,_t),We.return=et,We):(We=G(We,tt),We.return=et,We)}function ze(et,We,tt,_t){var Kt=tt.type;return Kt===C?vt(et,We,tt.props.children,_t,tt.key):We!==null&&(We.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===ae&&Mr(Kt)===We.type)?(_t=G(We,tt.props),_t.ref=Ht(et,We,tt),_t.return=et,_t):(_t=t1(tt.type,tt.key,tt.props,null,et.mode,_t),_t.ref=Ht(et,We,tt),_t.return=et,_t)}function nt(et,We,tt,_t){return We===null||We.tag!==4||We.stateNode.containerInfo!==tt.containerInfo||We.stateNode.implementation!==tt.implementation?(We=_g(tt,et.mode,_t),We.return=et,We):(We=G(We,tt.children||[]),We.return=et,We)}function vt(et,We,tt,_t,Kt){return We===null||We.tag!==7?(We=qf(tt,et.mode,_t,Kt),We.return=et,We):(We=G(We,tt),We.return=et,We)}function yt(et,We,tt){if(typeof We=="string"&&We!==""||typeof We=="number")return We=wg(""+We,et.mode,tt),We.return=et,We;if(typeof We=="object"&&We!==null){switch(We.$$typeof){case A:return tt=t1(We.type,We.key,We.props,null,et.mode,tt),tt.ref=Ht(et,null,We),tt.return=et,tt;case M:return We=_g(We,et.mode,tt),We.return=et,We;case ae:var _t=We._init;return yt(et,_t(We._payload),tt)}if(Le(We)||te(We))return We=qf(We,et.mode,tt,null),We.return=et,We;dr(et,We)}return null}function gt(et,We,tt,_t){var Kt=We!==null?We.key:null;if(typeof tt=="string"&&tt!==""||typeof tt=="number")return Kt!==null?null:Me(et,We,""+tt,_t);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case A:return tt.key===Kt?ze(et,We,tt,_t):null;case M:return tt.key===Kt?nt(et,We,tt,_t):null;case ae:return Kt=tt._init,gt(et,We,Kt(tt._payload),_t)}if(Le(tt)||te(tt))return Kt!==null?null:vt(et,We,tt,_t,null);dr(et,tt)}return null}function qt(et,We,tt,_t,Kt){if(typeof _t=="string"&&_t!==""||typeof _t=="number")return et=et.get(tt)||null,Me(We,et,""+_t,Kt);if(typeof _t=="object"&&_t!==null){switch(_t.$$typeof){case A:return et=et.get(_t.key===null?tt:_t.key)||null,ze(We,et,_t,Kt);case M:return et=et.get(_t.key===null?tt:_t.key)||null,nt(We,et,_t,Kt);case ae:var lr=_t._init;return qt(et,We,tt,lr(_t._payload),Kt)}if(Le(_t)||te(_t))return et=et.get(tt)||null,vt(We,et,_t,Kt,null);dr(We,_t)}return null}function Vt(et,We,tt,_t){for(var Kt=null,lr=null,ur=We,mr=We=0,Qa=null;ur!==null&&mr<tt.length;mr++){ur.index>mr?(Qa=ur,ur=null):Qa=ur.sibling;var pn=gt(et,ur,tt[mr],_t);if(pn===null){ur===null&&(ur=Qa);break}l&&ur&&pn.alternate===null&&c(et,ur),We=Q(pn,We,mr),lr===null?Kt=pn:lr.sibling=pn,lr=pn,ur=Qa}if(mr===tt.length)return w(et,ur),ft&&$e(et,mr),Kt;if(ur===null){for(;mr<tt.length;mr++)ur=yt(et,tt[mr],_t),ur!==null&&(We=Q(ur,We,mr),lr===null?Kt=ur:lr.sibling=ur,lr=ur);return ft&&$e(et,mr),Kt}for(ur=N(et,ur);mr<tt.length;mr++)Qa=qt(ur,et,mr,tt[mr],_t),Qa!==null&&(l&&Qa.alternate!==null&&ur.delete(Qa.key===null?mr:Qa.key),We=Q(Qa,We,mr),lr===null?Kt=Qa:lr.sibling=Qa,lr=Qa);return l&&ur.forEach(function(Jc){return c(et,Jc)}),ft&&$e(et,mr),Kt}function Xt(et,We,tt,_t){var Kt=te(tt);if(typeof Kt!="function")throw Error(r(150));if(tt=Kt.call(tt),tt==null)throw Error(r(151));for(var lr=Kt=null,ur=We,mr=We=0,Qa=null,pn=tt.next();ur!==null&&!pn.done;mr++,pn=tt.next()){ur.index>mr?(Qa=ur,ur=null):Qa=ur.sibling;var Jc=gt(et,ur,pn.value,_t);if(Jc===null){ur===null&&(ur=Qa);break}l&&ur&&Jc.alternate===null&&c(et,ur),We=Q(Jc,We,mr),lr===null?Kt=Jc:lr.sibling=Jc,lr=Jc,ur=Qa}if(pn.done)return w(et,ur),ft&&$e(et,mr),Kt;if(ur===null){for(;!pn.done;mr++,pn=tt.next())pn=yt(et,pn.value,_t),pn!==null&&(We=Q(pn,We,mr),lr===null?Kt=pn:lr.sibling=pn,lr=pn);return ft&&$e(et,mr),Kt}for(ur=N(et,ur);!pn.done;mr++,pn=tt.next())pn=qt(ur,et,mr,pn.value,_t),pn!==null&&(l&&pn.alternate!==null&&ur.delete(pn.key===null?mr:pn.key),We=Q(pn,We,mr),lr===null?Kt=pn:lr.sibling=pn,lr=pn);return l&&ur.forEach(function(Nx){return c(et,Nx)}),ft&&$e(et,mr),Kt}function aa(et,We,tt,_t){if(typeof tt=="object"&&tt!==null&&tt.type===C&&tt.key===null&&(tt=tt.props.children),typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case A:e:{for(var Kt=tt.key,lr=We;lr!==null;){if(lr.key===Kt){if(Kt=tt.type,Kt===C){if(lr.tag===7){w(et,lr.sibling),We=G(lr,tt.props.children),We.return=et,et=We;break e}}else if(lr.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===ae&&Mr(Kt)===lr.type){w(et,lr.sibling),We=G(lr,tt.props),We.ref=Ht(et,lr,tt),We.return=et,et=We;break e}w(et,lr);break}else c(et,lr);lr=lr.sibling}tt.type===C?(We=qf(tt.props.children,et.mode,_t,tt.key),We.return=et,et=We):(_t=t1(tt.type,tt.key,tt.props,null,et.mode,_t),_t.ref=Ht(et,We,tt),_t.return=et,et=_t)}return he(et);case M:e:{for(lr=tt.key;We!==null;){if(We.key===lr)if(We.tag===4&&We.stateNode.containerInfo===tt.containerInfo&&We.stateNode.implementation===tt.implementation){w(et,We.sibling),We=G(We,tt.children||[]),We.return=et,et=We;break e}else{w(et,We);break}else c(et,We);We=We.sibling}We=_g(tt,et.mode,_t),We.return=et,et=We}return he(et);case ae:return lr=tt._init,aa(et,We,lr(tt._payload),_t)}if(Le(tt))return Vt(et,We,tt,_t);if(te(tt))return Xt(et,We,tt,_t);dr(et,tt)}return typeof tt=="string"&&tt!==""||typeof tt=="number"?(tt=""+tt,We!==null&&We.tag===6?(w(et,We.sibling),We=G(We,tt),We.return=et,et=We):(w(et,We),We=wg(tt,et.mode,_t),We.return=et,et=We),he(et)):w(et,We)}return aa}var fi=bi(!0),Ur=bi(!1),wi=Mo(null),vn=null,jn=null,Nr=null;function $r(){Nr=jn=vn=null}function On(l){var c=wi.current;en(wi),l._currentValue=c}function Gr(l,c,w){for(;l!==null;){var N=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,N!==null&&(N.childLanes|=c)):N!==null&&(N.childLanes&c)!==c&&(N.childLanes|=c),l===w)break;l=l.return}}function Cn(l,c){vn=l,Nr=jn=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&c)!==0&&(ne=!0),l.firstContext=null)}function Ln(l){var c=l._currentValue;if(Nr!==l)if(l={context:l,memoizedValue:c,next:null},jn===null){if(vn===null)throw Error(r(308));jn=l,vn.dependencies={lanes:0,firstContext:l}}else jn=jn.next=l;return c}var tn=null;function Ti(l){tn===null?tn=[l]:tn.push(l)}function Yr(l,c,w,N){var G=c.interleaved;return G===null?(w.next=w,Ti(c)):(w.next=G.next,G.next=w),c.interleaved=w,Xr(l,N)}function Xr(l,c){l.lanes|=c;var w=l.alternate;for(w!==null&&(w.lanes|=c),w=l,l=l.return;l!==null;)l.childLanes|=c,w=l.alternate,w!==null&&(w.childLanes|=c),w=l,l=l.return;return w.tag===3?w.stateNode:null}var ei=!1;function Ri(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ya(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function ti(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function Hn(l,c,w){var N=l.updateQueue;if(N===null)return null;if(N=N.shared,(un&2)!==0){var G=N.pending;return G===null?c.next=c:(c.next=G.next,G.next=c),N.pending=c,Xr(l,w)}return G=N.interleaved,G===null?(c.next=c,Ti(N)):(c.next=G.next,G.next=c),N.interleaved=c,Xr(l,w)}function ba(l,c,w){if(c=c.updateQueue,c!==null&&(c=c.shared,(w&4194240)!==0)){var N=c.lanes;N&=l.pendingLanes,w|=N,c.lanes=w,uu(l,w)}}function rn(l,c){var w=l.updateQueue,N=l.alternate;if(N!==null&&(N=N.updateQueue,w===N)){var G=null,Q=null;if(w=w.firstBaseUpdate,w!==null){do{var he={eventTime:w.eventTime,lane:w.lane,tag:w.tag,payload:w.payload,callback:w.callback,next:null};Q===null?G=Q=he:Q=Q.next=he,w=w.next}while(w!==null);Q===null?G=Q=c:Q=Q.next=c}else G=Q=c;w={baseState:N.baseState,firstBaseUpdate:G,lastBaseUpdate:Q,shared:N.shared,effects:N.effects},l.updateQueue=w;return}l=w.lastBaseUpdate,l===null?w.firstBaseUpdate=c:l.next=c,w.lastBaseUpdate=c}function Hi(l,c,w,N){var G=l.updateQueue;ei=!1;var Q=G.firstBaseUpdate,he=G.lastBaseUpdate,Me=G.shared.pending;if(Me!==null){G.shared.pending=null;var ze=Me,nt=ze.next;ze.next=null,he===null?Q=nt:he.next=nt,he=ze;var vt=l.alternate;vt!==null&&(vt=vt.updateQueue,Me=vt.lastBaseUpdate,Me!==he&&(Me===null?vt.firstBaseUpdate=nt:Me.next=nt,vt.lastBaseUpdate=ze))}if(Q!==null){var yt=G.baseState;he=0,vt=nt=ze=null,Me=Q;do{var gt=Me.lane,qt=Me.eventTime;if((N&gt)===gt){vt!==null&&(vt=vt.next={eventTime:qt,lane:0,tag:Me.tag,payload:Me.payload,callback:Me.callback,next:null});e:{var Vt=l,Xt=Me;switch(gt=c,qt=w,Xt.tag){case 1:if(Vt=Xt.payload,typeof Vt=="function"){yt=Vt.call(qt,yt,gt);break e}yt=Vt;break e;case 3:Vt.flags=Vt.flags&-65537|128;case 0:if(Vt=Xt.payload,gt=typeof Vt=="function"?Vt.call(qt,yt,gt):Vt,gt==null)break e;yt=V({},yt,gt);break e;case 2:ei=!0}}Me.callback!==null&&Me.lane!==0&&(l.flags|=64,gt=G.effects,gt===null?G.effects=[Me]:gt.push(Me))}else qt={eventTime:qt,lane:gt,tag:Me.tag,payload:Me.payload,callback:Me.callback,next:null},vt===null?(nt=vt=qt,ze=yt):vt=vt.next=qt,he|=gt;if(Me=Me.next,Me===null){if(Me=G.shared.pending,Me===null)break;gt=Me,Me=gt.next,gt.next=null,G.lastBaseUpdate=gt,G.shared.pending=null}}while(!0);if(vt===null&&(ze=yt),G.baseState=ze,G.firstBaseUpdate=nt,G.lastBaseUpdate=vt,c=G.shared.interleaved,c!==null){G=c;do he|=G.lane,G=G.next;while(G!==c)}else Q===null&&(G.shared.lanes=0);Df|=he,l.lanes=he,l.memoizedState=yt}}function Wr(l,c,w){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var N=l[c],G=N.callback;if(G!==null){if(N.callback=null,N=w,typeof G!="function")throw Error(r(191,G));G.call(N)}}}var sr={},Ir=Mo(sr),Ar=Mo(sr),Dn=Mo(sr);function hi(l){if(l===sr)throw Error(r(174));return l}function Ko(l,c){switch(sn(Dn,c),sn(Ar,l),sn(Ir,sr),l=c.nodeType,l){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:dt(null,"");break;default:l=l===8?c.parentNode:c,c=l.namespaceURI||null,l=l.tagName,c=dt(c,l)}en(Ir),sn(Ir,c)}function hn(){en(Ir),en(Ar),en(Dn)}function _u(l){hi(Dn.current);var c=hi(Ir.current),w=dt(c,l.type);c!==w&&(sn(Ar,l),sn(Ir,w))}function Vs(l){Ar.current===l&&(en(Ir),en(Ar))}var dn=Mo(0);function fo(l){for(var c=l;c!==null;){if(c.tag===13){var w=c.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||w.data==="$?"||w.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var $l=[];function wa(){for(var l=0;l<$l.length;l++)$l[l]._workInProgressVersionPrimary=null;$l.length=0}var xu=S.ReactCurrentDispatcher,Su=S.ReactCurrentBatchConfig,$i=0,ln=null,$n=null,Gn=null,ho=!1,Io=!1,po=0,Bc=0;function Wn(){throw Error(r(321))}function Eu(l,c){if(c===null)return!1;for(var w=0;w<c.length&&w<l.length;w++)if(!Pn(l[w],c[w]))return!1;return!0}function _l(l,c,w,N,G,Q){if($i=Q,ln=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,xu.current=l===null||l.memoizedState===null?tg:ku,l=w(N,G),Io){Q=0;do{if(Io=!1,po=0,25<=Q)throw Error(r(301));Q+=1,Gn=$n=null,c.updateQueue=null,xu.current=Nh,l=w(N,G)}while(Io)}if(xu.current=Hc,c=$n!==null&&$n.next!==null,$i=0,Gn=$n=ln=null,ho=!1,c)throw Error(r(300));return l}function go(){var l=po!==0;return po=0,l}function xn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gn===null?ln.memoizedState=Gn=l:Gn=Gn.next=l,Gn}function _i(){if($n===null){var l=ln.alternate;l=l!==null?l.memoizedState:null}else l=$n.next;var c=Gn===null?ln.memoizedState:Gn.next;if(c!==null)Gn=c,$n=l;else{if(l===null)throw Error(r(310));$n=l,l={memoizedState:$n.memoizedState,baseState:$n.baseState,baseQueue:$n.baseQueue,queue:$n.queue,next:null},Gn===null?ln.memoizedState=Gn=l:Gn=Gn.next=l}return Gn}function _a(l,c){return typeof c=="function"?c(l):c}function na(l){var c=_i(),w=c.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=l;var N=$n,G=N.baseQueue,Q=w.pending;if(Q!==null){if(G!==null){var he=G.next;G.next=Q.next,Q.next=he}N.baseQueue=G=Q,w.pending=null}if(G!==null){Q=G.next,N=N.baseState;var Me=he=null,ze=null,nt=Q;do{var vt=nt.lane;if(($i&vt)===vt)ze!==null&&(ze=ze.next={lane:0,action:nt.action,hasEagerState:nt.hasEagerState,eagerState:nt.eagerState,next:null}),N=nt.hasEagerState?nt.eagerState:l(N,nt.action);else{var yt={lane:vt,action:nt.action,hasEagerState:nt.hasEagerState,eagerState:nt.eagerState,next:null};ze===null?(Me=ze=yt,he=N):ze=ze.next=yt,ln.lanes|=vt,Df|=vt}nt=nt.next}while(nt!==null&&nt!==Q);ze===null?he=N:ze.next=Me,Pn(N,c.memoizedState)||(ne=!0),c.memoizedState=N,c.baseState=he,c.baseQueue=ze,w.lastRenderedState=N}if(l=w.interleaved,l!==null){G=l;do Q=G.lane,ln.lanes|=Q,Df|=Q,G=G.next;while(G!==l)}else G===null&&(w.lanes=0);return[c.memoizedState,w.dispatch]}function Ys(l){var c=_i(),w=c.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=l;var N=w.dispatch,G=w.pending,Q=c.memoizedState;if(G!==null){w.pending=null;var he=G=G.next;do Q=l(Q,he.action),he=he.next;while(he!==G);Pn(Q,c.memoizedState)||(ne=!0),c.memoizedState=Q,c.baseQueue===null&&(c.baseState=Q),w.lastRenderedState=Q}return[Q,N]}function zc(){}function tc(l,c){var w=ln,N=_i(),G=c(),Q=!Pn(N.memoizedState,G);if(Q&&(N.memoizedState=G,ne=!0),N=N.queue,Uc(If.bind(null,w,N,l),[l]),N.getSnapshot!==c||Q||Gn!==null&&Gn.memoizedState.tag&1){if(w.flags|=2048,Xa(9,xs.bind(null,w,N,G,c),void 0,null),Za===null)throw Error(r(349));($i&30)!==0||Lh(w,c,G)}return G}function Lh(l,c,w){l.flags|=16384,l={getSnapshot:c,value:w},c=ln.updateQueue,c===null?(c={lastEffect:null,stores:null},ln.updateQueue=c,c.stores=[l]):(w=c.stores,w===null?c.stores=[l]:w.push(l))}function xs(l,c,w,N){c.value=w,c.getSnapshot=N,Gl(c)&&Au(l)}function If(l,c,w){return w(function(){Gl(c)&&Au(l)})}function Gl(l){var c=l.getSnapshot;l=l.value;try{var w=c();return!Pn(l,w)}catch{return!0}}function Au(l){var c=Xr(l,1);c!==null&&Xl(c,l,1,-1)}function Zo(l){var c=xn();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:l},c.queue=l,l=l.dispatch=qp.bind(null,ln,l),[c.memoizedState,l]}function Xa(l,c,w,N){return l={tag:l,create:c,destroy:w,deps:N,next:null},c=ln.updateQueue,c===null?(c={lastEffect:null,stores:null},ln.updateQueue=c,c.lastEffect=l.next=l):(w=c.lastEffect,w===null?c.lastEffect=l.next=l:(N=w.next,w.next=l,l.next=N,c.lastEffect=l)),l}function Ss(){return _i().memoizedState}function vo(l,c,w,N){var G=xn();ln.flags|=l,G.memoizedState=Xa(1|c,w,void 0,N===void 0?null:N)}function Es(l,c,w,N){var G=_i();N=N===void 0?null:N;var Q=void 0;if($n!==null){var he=$n.memoizedState;if(Q=he.destroy,N!==null&&Eu(N,he.deps)){G.memoizedState=Xa(c,w,Q,N);return}}ln.flags|=l,G.memoizedState=Xa(1|c,w,Q,N)}function qc(l,c){return vo(8390656,8,l,c)}function Uc(l,c){return Es(2048,8,l,c)}function jf(l,c){return Es(4,2,l,c)}function rc(l,c){return Es(4,4,l,c)}function As(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function Dp(l,c,w){return w=w!=null?w.concat([l]):null,Es(4,4,As.bind(null,c,l),w)}function Wl(){}function Ed(l,c){var w=_i();c=c===void 0?null:c;var N=w.memoizedState;return N!==null&&c!==null&&Eu(c,N[1])?N[0]:(w.memoizedState=[l,c],l)}function Vn(l,c){var w=_i();c=c===void 0?null:c;var N=w.memoizedState;return N!==null&&c!==null&&Eu(c,N[1])?N[0]:(l=l(),w.memoizedState=[l,c],l)}function Fp(l,c,w){return($i&21)===0?(l.baseState&&(l.baseState=!1,ne=!0),l.memoizedState=w):(Pn(w,c)||(w=Wu(),ln.lanes|=w,Df|=w,l.baseState=!0),c)}function Bp(l,c){var w=Rr;Rr=w!==0&&4>w?w:4,l(!0);var N=Su.transition;Su.transition={};try{l(!1),c()}finally{Rr=w,Su.transition=N}}function zp(){return _i().memoizedState}function eg(l,c,w){var N=Kc(l);if(w={lane:N,action:w,hasEagerState:!1,eagerState:null,next:null},Ad(l))Up(c,w);else if(w=Yr(l,c,w,N),w!==null){var G=Jo();Xl(w,l,N,G),Qo(w,c,N)}}function qp(l,c,w){var N=Kc(l),G={lane:N,action:w,hasEagerState:!1,eagerState:null,next:null};if(Ad(l))Up(c,G);else{var Q=l.alternate;if(l.lanes===0&&(Q===null||Q.lanes===0)&&(Q=c.lastRenderedReducer,Q!==null))try{var he=c.lastRenderedState,Me=Q(he,w);if(G.hasEagerState=!0,G.eagerState=Me,Pn(Me,he)){var ze=c.interleaved;ze===null?(G.next=G,Ti(c)):(G.next=ze.next,ze.next=G),c.interleaved=G;return}}catch{}finally{}w=Yr(l,c,G,N),w!==null&&(G=Jo(),Xl(w,l,N,G),Qo(w,c,N))}}function Ad(l){var c=l.alternate;return l===ln||c!==null&&c===ln}function Up(l,c){Io=ho=!0;var w=l.pending;w===null?c.next=c:(c.next=w.next,w.next=c),l.pending=c}function Qo(l,c,w){if((w&4194240)!==0){var N=c.lanes;N&=l.pendingLanes,w|=N,c.lanes=w,uu(l,w)}}var Hc={readContext:Ln,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},tg={readContext:Ln,useCallback:function(l,c){return xn().memoizedState=[l,c===void 0?null:c],l},useContext:Ln,useEffect:qc,useImperativeHandle:function(l,c,w){return w=w!=null?w.concat([l]):null,vo(4194308,4,As.bind(null,c,l),w)},useLayoutEffect:function(l,c){return vo(4194308,4,l,c)},useInsertionEffect:function(l,c){return vo(4,2,l,c)},useMemo:function(l,c){var w=xn();return c=c===void 0?null:c,l=l(),w.memoizedState=[l,c],l},useReducer:function(l,c,w){var N=xn();return c=w!==void 0?w(c):c,N.memoizedState=N.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},N.queue=l,l=l.dispatch=eg.bind(null,ln,l),[N.memoizedState,l]},useRef:function(l){var c=xn();return l={current:l},c.memoizedState=l},useState:Zo,useDebugValue:Wl,useDeferredValue:function(l){return xn().memoizedState=l},useTransition:function(){var l=Zo(!1),c=l[0];return l=Bp.bind(null,l[1]),xn().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,w){var N=ln,G=xn();if(ft){if(w===void 0)throw Error(r(407));w=w()}else{if(w=c(),Za===null)throw Error(r(349));($i&30)!==0||Lh(N,c,w)}G.memoizedState=w;var Q={value:w,getSnapshot:c};return G.queue=Q,qc(If.bind(null,N,Q,l),[l]),N.flags|=2048,Xa(9,xs.bind(null,N,Q,w,c),void 0,null),w},useId:function(){var l=xn(),c=Za.identifierPrefix;if(ft){var w=xe,N=Je;w=(N&~(1<<32-Sr(N)-1)).toString(32)+w,c=":"+c+"R"+w,w=po++,0<w&&(c+="H"+w.toString(32)),c+=":"}else w=Bc++,c=":"+c+"r"+w.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},ku={readContext:Ln,useCallback:Ed,useContext:Ln,useEffect:Uc,useImperativeHandle:Dp,useInsertionEffect:jf,useLayoutEffect:rc,useMemo:Vn,useReducer:na,useRef:Ss,useState:function(){return na(_a)},useDebugValue:Wl,useDeferredValue:function(l){var c=_i();return Fp(c,$n.memoizedState,l)},useTransition:function(){var l=na(_a)[0],c=_i().memoizedState;return[l,c]},useMutableSource:zc,useSyncExternalStore:tc,useId:zp,unstable_isNewReconciler:!1},Nh={readContext:Ln,useCallback:Ed,useContext:Ln,useEffect:Uc,useImperativeHandle:Dp,useInsertionEffect:jf,useLayoutEffect:rc,useMemo:Vn,useReducer:Ys,useRef:Ss,useState:function(){return Ys(_a)},useDebugValue:Wl,useDeferredValue:function(l){var c=_i();return $n===null?c.memoizedState=l:Fp(c,$n.memoizedState,l)},useTransition:function(){var l=Ys(_a)[0],c=_i().memoizedState;return[l,c]},useMutableSource:zc,useSyncExternalStore:tc,useId:zp,unstable_isNewReconciler:!1};function Ma(l,c){if(l&&l.defaultProps){c=V({},c),l=l.defaultProps;for(var w in l)c[w]===void 0&&(c[w]=l[w]);return c}return c}function $c(l,c,w,N){c=l.memoizedState,w=w(N,c),w=w==null?c:V({},c,w),l.memoizedState=w,l.lanes===0&&(l.updateQueue.baseState=w)}var Gc={isMounted:function(l){return(l=l._reactInternals)?si(l)===l:!1},enqueueSetState:function(l,c,w){l=l._reactInternals;var N=Jo(),G=Kc(l),Q=ti(N,G);Q.payload=c,w!=null&&(Q.callback=w),c=Hn(l,Q,G),c!==null&&(Xl(c,l,G,N),ba(c,l,G))},enqueueReplaceState:function(l,c,w){l=l._reactInternals;var N=Jo(),G=Kc(l),Q=ti(N,G);Q.tag=1,Q.payload=c,w!=null&&(Q.callback=w),c=Hn(l,Q,G),c!==null&&(Xl(c,l,G,N),ba(c,l,G))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var w=Jo(),N=Kc(l),G=ti(w,N);G.tag=2,c!=null&&(G.callback=c),c=Hn(l,G,N),c!==null&&(Xl(c,l,N,w),ba(c,l,N))}};function Th(l,c,w,N,G,Q,he){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(N,Q,he):c.prototype&&c.prototype.isPureReactComponent?!pa(w,N)||!pa(G,Q):!0}function Hp(l,c,w){var N=!1,G=bs,Q=c.contextType;return typeof Q=="object"&&Q!==null?Q=Ln(Q):(G=ma(c)?wl:Ui.current,N=c.contextTypes,Q=(N=N!=null)?Ul(l,G):bs),c=new c(w,Q),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Gc,l.stateNode=c,c._reactInternals=l,N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=G,l.__reactInternalMemoizedMaskedChildContext=Q),c}function kd(l,c,w,N){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(w,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(w,N),c.state!==l&&Gc.enqueueReplaceState(c,c.state,null)}function Rh(l,c,w,N){var G=l.stateNode;G.props=w,G.state=l.memoizedState,G.refs={},Ri(l);var Q=c.contextType;typeof Q=="object"&&Q!==null?G.context=Ln(Q):(Q=ma(c)?wl:Ui.current,G.context=Ul(l,Q)),G.state=l.memoizedState,Q=c.getDerivedStateFromProps,typeof Q=="function"&&($c(l,c,Q,w),G.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof G.getSnapshotBeforeUpdate=="function"||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(c=G.state,typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount(),c!==G.state&&Gc.enqueueReplaceState(G,G.state,null),Hi(l,w,G,N),G.state=l.memoizedState),typeof G.componentDidMount=="function"&&(l.flags|=4194308)}function nc(l,c){try{var w="",N=c;do w+=ee(N),N=N.return;while(N);var G=w}catch(Q){G=`
31
+ Error generating stack: `+Q.message+`
32
+ `+Q.stack}return{value:l,source:c,stack:G,digest:null}}function Mh(l,c,w){return{value:l,source:null,stack:w??null,digest:c??null}}function Wc(l,c){try{console.error(c.value)}catch(w){setTimeout(function(){throw w})}}var rg=typeof WeakMap=="function"?WeakMap:Map;function $p(l,c,w){w=ti(-1,w),w.tag=3,w.payload={element:null};var N=c.value;return w.callback=function(){Xp||(Xp=!0,hg=N),Wc(l,c)},w}function d(l,c,w){w=ti(-1,w),w.tag=3;var N=l.type.getDerivedStateFromError;if(typeof N=="function"){var G=c.value;w.payload=function(){return N(G)},w.callback=function(){Wc(l,c)}}var Q=l.stateNode;return Q!==null&&typeof Q.componentDidCatch=="function"&&(w.callback=function(){Wc(l,c),typeof N!="function"&&(Yc===null?Yc=new Set([this]):Yc.add(this));var he=c.stack;this.componentDidCatch(c.value,{componentStack:he!==null?he:""})}),w}function m(l,c,w){var N=l.pingCache;if(N===null){N=l.pingCache=new rg;var G=new Set;N.set(c,G)}else G=N.get(c),G===void 0&&(G=new Set,N.set(c,G));G.has(w)||(G.add(w),l=wx.bind(null,l,c,w),c.then(l,l))}function L(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function z(l,c,w,N,G){return(l.mode&1)===0?(l===c?l.flags|=65536:(l.flags|=128,w.flags|=131072,w.flags&=-52805,w.tag===1&&(w.alternate===null?w.tag=17:(c=ti(-1,1),c.tag=2,Hn(w,c,1))),w.lanes|=1),l):(l.flags|=65536,l.lanes=G,l)}var W=S.ReactCurrentOwner,ne=!1;function _e(l,c,w,N){c.child=l===null?Ur(c,null,w,N):fi(c,l.child,w,N)}function Ye(l,c,w,N,G){w=w.render;var Q=c.ref;return Cn(c,G),N=_l(l,c,w,N,Q,G),w=go(),l!==null&&!ne?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~G,Ka(l,c,G)):(ft&&w&&lt(c),c.flags|=1,_e(l,c,N,G),c.child)}function it(l,c,w,N,G){if(l===null){var Q=w.type;return typeof Q=="function"&&!bg(Q)&&Q.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(c.tag=15,c.type=Q,wt(l,c,Q,N,G)):(l=t1(w.type,null,N,c,c.mode,G),l.ref=c.ref,l.return=c,c.child=l)}if(Q=l.child,(l.lanes&G)===0){var he=Q.memoizedProps;if(w=w.compare,w=w!==null?w:pa,w(he,N)&&l.ref===c.ref)return Ka(l,c,G)}return c.flags|=1,l=Qc(Q,N),l.ref=c.ref,l.return=c,c.child=l}function wt(l,c,w,N,G){if(l!==null){var Q=l.memoizedProps;if(pa(Q,N)&&l.ref===c.ref)if(ne=!1,c.pendingProps=N=Q,(l.lanes&G)!==0)(l.flags&131072)!==0&&(ne=!0);else return c.lanes=l.lanes,Ka(l,c,G)}return Tt(l,c,w,N,G)}function $t(l,c,w){var N=c.pendingProps,G=N.children,Q=l!==null?l.memoizedState:null;if(N.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},sn(jh,Xs),Xs|=w;else{if((w&1073741824)===0)return l=Q!==null?Q.baseLanes|w:w,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,sn(jh,Xs),Xs|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=Q!==null?Q.baseLanes:w,sn(jh,Xs),Xs|=N}else Q!==null?(N=Q.baseLanes|w,c.memoizedState=null):N=w,sn(jh,Xs),Xs|=N;return _e(l,c,G,w),c.child}function br(l,c){var w=c.ref;(l===null&&w!==null||l!==null&&l.ref!==w)&&(c.flags|=512,c.flags|=2097152)}function Tt(l,c,w,N,G){var Q=ma(w)?wl:Ui.current;return Q=Ul(c,Q),Cn(c,G),w=_l(l,c,w,N,Q,G),N=go(),l!==null&&!ne?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~G,Ka(l,c,G)):(ft&&N&&lt(c),c.flags|=1,_e(l,c,w,G),c.child)}function Fn(l,c,w,N,G){if(ma(w)){var Q=!0;ws(c)}else Q=!1;if(Cn(c,G),c.stateNode===null)Hr(l,c),Hp(c,w,N),Rh(c,w,N,G),N=!0;else if(l===null){var he=c.stateNode,Me=c.memoizedProps;he.props=Me;var ze=he.context,nt=w.contextType;typeof nt=="object"&&nt!==null?nt=Ln(nt):(nt=ma(w)?wl:Ui.current,nt=Ul(c,nt));var vt=w.getDerivedStateFromProps,yt=typeof vt=="function"||typeof he.getSnapshotBeforeUpdate=="function";yt||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Me!==N||ze!==nt)&&kd(c,he,N,nt),ei=!1;var gt=c.memoizedState;he.state=gt,Hi(c,N,he,G),ze=c.memoizedState,Me!==N||gt!==ze||va.current||ei?(typeof vt=="function"&&($c(c,w,vt,N),ze=c.memoizedState),(Me=ei||Th(c,w,Me,N,gt,ze,nt))?(yt||typeof he.UNSAFE_componentWillMount!="function"&&typeof he.componentWillMount!="function"||(typeof he.componentWillMount=="function"&&he.componentWillMount(),typeof he.UNSAFE_componentWillMount=="function"&&he.UNSAFE_componentWillMount()),typeof he.componentDidMount=="function"&&(c.flags|=4194308)):(typeof he.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=N,c.memoizedState=ze),he.props=N,he.state=ze,he.context=nt,N=Me):(typeof he.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{he=c.stateNode,ya(l,c),Me=c.memoizedProps,nt=c.type===c.elementType?Me:Ma(c.type,Me),he.props=nt,yt=c.pendingProps,gt=he.context,ze=w.contextType,typeof ze=="object"&&ze!==null?ze=Ln(ze):(ze=ma(w)?wl:Ui.current,ze=Ul(c,ze));var qt=w.getDerivedStateFromProps;(vt=typeof qt=="function"||typeof he.getSnapshotBeforeUpdate=="function")||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Me!==yt||gt!==ze)&&kd(c,he,N,ze),ei=!1,gt=c.memoizedState,he.state=gt,Hi(c,N,he,G);var Vt=c.memoizedState;Me!==yt||gt!==Vt||va.current||ei?(typeof qt=="function"&&($c(c,w,qt,N),Vt=c.memoizedState),(nt=ei||Th(c,w,nt,N,gt,Vt,ze)||!1)?(vt||typeof he.UNSAFE_componentWillUpdate!="function"&&typeof he.componentWillUpdate!="function"||(typeof he.componentWillUpdate=="function"&&he.componentWillUpdate(N,Vt,ze),typeof he.UNSAFE_componentWillUpdate=="function"&&he.UNSAFE_componentWillUpdate(N,Vt,ze)),typeof he.componentDidUpdate=="function"&&(c.flags|=4),typeof he.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof he.componentDidUpdate!="function"||Me===l.memoizedProps&&gt===l.memoizedState||(c.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Me===l.memoizedProps&&gt===l.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=Vt),he.props=N,he.state=Vt,he.context=ze,N=nt):(typeof he.componentDidUpdate!="function"||Me===l.memoizedProps&&gt===l.memoizedState||(c.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Me===l.memoizedProps&&gt===l.memoizedState||(c.flags|=1024),N=!1)}return mn(l,c,w,N,Q,G)}function mn(l,c,w,N,G,Q){br(l,c);var he=(c.flags&128)!==0;if(!N&&!he)return G&&Ch(c,w,!1),Ka(l,c,Q);N=c.stateNode,W.current=c;var Me=he&&typeof w.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,l!==null&&he?(c.child=fi(c,l.child,null,Q),c.child=fi(c,null,Me,Q)):_e(l,c,Me,Q),c.memoizedState=N.state,G&&Ch(c,w,!0),c.child}function mo(l){var c=l.stateNode;c.pendingContext?Mf(l,c.pendingContext,c.pendingContext!==c.context):c.context&&Mf(l,c.context,!1),Ko(l,c.containerInfo)}function xl(l,c,w,N,G){return Ft(),St(G),c.flags|=256,_e(l,c,w,N),c.child}var rt={dehydrated:null,treeContext:null,retryLane:0};function Ke(l){return{baseLanes:l,cachePool:null,transitions:null}}function ut(l,c,w){var N=c.pendingProps,G=dn.current,Q=!1,he=(c.flags&128)!==0,Me;if((Me=he)||(Me=l!==null&&l.memoizedState===null?!1:(G&2)!==0),Me?(Q=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(G|=1),sn(dn,G&1),l===null)return zt(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((c.mode&1)===0?c.lanes=1:l.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(he=N.children,l=N.fallback,Q?(N=c.mode,Q=c.child,he={mode:"hidden",children:he},(N&1)===0&&Q!==null?(Q.childLanes=0,Q.pendingProps=he):Q=r1(he,N,0,null),l=qf(l,N,w,null),Q.return=c,l.return=c,Q.sibling=l,c.child=Q,c.child.memoizedState=Ke(w),c.memoizedState=rt,l):Rt(c,he));if(G=l.memoizedState,G!==null&&(Me=G.dehydrated,Me!==null))return Or(l,c,he,N,Me,G,w);if(Q){Q=N.fallback,he=c.mode,G=l.child,Me=G.sibling;var ze={mode:"hidden",children:N.children};return(he&1)===0&&c.child!==G?(N=c.child,N.childLanes=0,N.pendingProps=ze,c.deletions=null):(N=Qc(G,ze),N.subtreeFlags=G.subtreeFlags&14680064),Me!==null?Q=Qc(Me,Q):(Q=qf(Q,he,w,null),Q.flags|=2),Q.return=c,N.return=c,N.sibling=Q,c.child=N,N=Q,Q=c.child,he=l.child.memoizedState,he=he===null?Ke(w):{baseLanes:he.baseLanes|w,cachePool:null,transitions:he.transitions},Q.memoizedState=he,Q.childLanes=l.childLanes&~w,c.memoizedState=rt,N}return Q=l.child,l=Q.sibling,N=Qc(Q,{mode:"visible",children:N.children}),(c.mode&1)===0&&(N.lanes=w),N.return=c,N.sibling=null,l!==null&&(w=c.deletions,w===null?(c.deletions=[l],c.flags|=16):w.push(l)),c.child=N,c.memoizedState=null,N}function Rt(l,c){return c=r1({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function nr(l,c,w,N){return N!==null&&St(N),fi(c,l.child,null,w),l=Rt(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function Or(l,c,w,N,G,Q,he){if(w)return c.flags&256?(c.flags&=-257,N=Mh(Error(r(422))),nr(l,c,he,N)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(Q=N.fallback,G=c.mode,N=r1({mode:"visible",children:N.children},G,0,null),Q=qf(Q,G,he,null),Q.flags|=2,N.return=c,Q.return=c,N.sibling=Q,c.child=N,(c.mode&1)!==0&&fi(c,l.child,null,he),c.child.memoizedState=Ke(he),c.memoizedState=rt,Q);if((c.mode&1)===0)return nr(l,c,he,null);if(G.data==="$!"){if(N=G.nextSibling&&G.nextSibling.dataset,N)var Me=N.dgst;return N=Me,Q=Error(r(419)),N=Mh(Q,N,void 0),nr(l,c,he,N)}if(Me=(he&l.childLanes)!==0,ne||Me){if(N=Za,N!==null){switch(he&-he){case 4:G=2;break;case 16:G=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:G=32;break;case 536870912:G=268435456;break;default:G=0}G=(G&(N.suspendedLanes|he))!==0?0:G,G!==0&&G!==Q.retryLane&&(Q.retryLane=G,Xr(l,G),Xl(N,l,G,-1))}return yg(),N=Mh(Error(r(421))),nr(l,c,he,N)}return G.data==="$?"?(c.flags|=128,c.child=l.child,c=_x.bind(null,l),G._reactRetry=c,null):(l=Q.treeContext,He=ea(G.nextSibling),ot=c,ft=!0,ht=null,l!==null&&(we[Se++]=Je,we[Se++]=xe,we[Se++]=Fe,Je=l.id,xe=l.overflow,Fe=c),c=Rt(c,N.children),c.flags|=4096,c)}function wr(l,c,w){l.lanes|=c;var N=l.alternate;N!==null&&(N.lanes|=c),Gr(l.return,c,w)}function Vr(l,c,w,N,G){var Q=l.memoizedState;Q===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:w,tailMode:G}:(Q.isBackwards=c,Q.rendering=null,Q.renderingStartTime=0,Q.last=N,Q.tail=w,Q.tailMode=G)}function ia(l,c,w){var N=c.pendingProps,G=N.revealOrder,Q=N.tail;if(_e(l,c,N.children,w),N=dn.current,(N&2)!==0)N=N&1|2,c.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&wr(l,w,c);else if(l.tag===19)wr(l,w,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}N&=1}if(sn(dn,N),(c.mode&1)===0)c.memoizedState=null;else switch(G){case"forwards":for(w=c.child,G=null;w!==null;)l=w.alternate,l!==null&&fo(l)===null&&(G=w),w=w.sibling;w=G,w===null?(G=c.child,c.child=null):(G=w.sibling,w.sibling=null),Vr(c,!1,G,w,Q);break;case"backwards":for(w=null,G=c.child,c.child=null;G!==null;){if(l=G.alternate,l!==null&&fo(l)===null){c.child=G;break}l=G.sibling,G.sibling=w,w=G,G=l}Vr(c,!0,w,null,Q);break;case"together":Vr(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Hr(l,c){(c.mode&1)===0&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function Ka(l,c,w){if(l!==null&&(c.dependencies=l.dependencies),Df|=c.lanes,(w&c.childLanes)===0)return null;if(l!==null&&c.child!==l.child)throw Error(r(153));if(c.child!==null){for(l=c.child,w=Qc(l,l.pendingProps),c.child=w,w.return=c;l.sibling!==null;)l=l.sibling,w=w.sibling=Qc(l,l.pendingProps),w.return=c;w.sibling=null}return c.child}function ng(l,c,w){switch(c.tag){case 3:mo(c),Ft();break;case 5:_u(c);break;case 1:ma(c.type)&&ws(c);break;case 4:Ko(c,c.stateNode.containerInfo);break;case 10:var N=c.type._context,G=c.memoizedProps.value;sn(wi,N._currentValue),N._currentValue=G;break;case 13:if(N=c.memoizedState,N!==null)return N.dehydrated!==null?(sn(dn,dn.current&1),c.flags|=128,null):(w&c.child.childLanes)!==0?ut(l,c,w):(sn(dn,dn.current&1),l=Ka(l,c,w),l!==null?l.sibling:null);sn(dn,dn.current&1);break;case 19:if(N=(w&c.childLanes)!==0,(l.flags&128)!==0){if(N)return ia(l,c,w);c.flags|=128}if(G=c.memoizedState,G!==null&&(G.rendering=null,G.tail=null,G.lastEffect=null),sn(dn,dn.current),N)break;return null;case 22:case 23:return c.lanes=0,$t(l,c,w)}return Ka(l,c,w)}var xy,ig,Sy,Ey;xy=function(l,c){for(var w=c.child;w!==null;){if(w.tag===5||w.tag===6)l.appendChild(w.stateNode);else if(w.tag!==4&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===c)break;for(;w.sibling===null;){if(w.return===null||w.return===c)return;w=w.return}w.sibling.return=w.return,w=w.sibling}},ig=function(){},Sy=function(l,c,w,N){var G=l.memoizedProps;if(G!==N){l=c.stateNode,hi(Ir.current);var Q=null;switch(w){case"input":G=Ee(l,G),N=Ee(l,N),Q=[];break;case"select":G=V({},G,{value:void 0}),N=V({},N,{value:void 0}),Q=[];break;case"textarea":G=ue(l,G),N=ue(l,N),Q=[];break;default:typeof G.onClick!="function"&&typeof N.onClick=="function"&&(l.onclick=Gs)}Ve(w,N);var he;w=null;for(nt in G)if(!N.hasOwnProperty(nt)&&G.hasOwnProperty(nt)&&G[nt]!=null)if(nt==="style"){var Me=G[nt];for(he in Me)Me.hasOwnProperty(he)&&(w||(w={}),w[he]="")}else nt!=="dangerouslySetInnerHTML"&&nt!=="children"&&nt!=="suppressContentEditableWarning"&&nt!=="suppressHydrationWarning"&&nt!=="autoFocus"&&(i.hasOwnProperty(nt)?Q||(Q=[]):(Q=Q||[]).push(nt,null));for(nt in N){var ze=N[nt];if(Me=G?.[nt],N.hasOwnProperty(nt)&&ze!==Me&&(ze!=null||Me!=null))if(nt==="style")if(Me){for(he in Me)!Me.hasOwnProperty(he)||ze&&ze.hasOwnProperty(he)||(w||(w={}),w[he]="");for(he in ze)ze.hasOwnProperty(he)&&Me[he]!==ze[he]&&(w||(w={}),w[he]=ze[he])}else w||(Q||(Q=[]),Q.push(nt,w)),w=ze;else nt==="dangerouslySetInnerHTML"?(ze=ze?ze.__html:void 0,Me=Me?Me.__html:void 0,ze!=null&&Me!==ze&&(Q=Q||[]).push(nt,ze)):nt==="children"?typeof ze!="string"&&typeof ze!="number"||(Q=Q||[]).push(nt,""+ze):nt!=="suppressContentEditableWarning"&&nt!=="suppressHydrationWarning"&&(i.hasOwnProperty(nt)?(ze!=null&&nt==="onScroll"&&fn("scroll",l),Q||Me===ze||(Q=[])):(Q=Q||[]).push(nt,ze))}w&&(Q=Q||[]).push("style",w);var nt=Q;(c.updateQueue=nt)&&(c.flags|=4)}},Ey=function(l,c,w,N){w!==N&&(c.flags|=4)};function Pd(l,c){if(!ft)switch(l.tailMode){case"hidden":c=l.tail;for(var w=null;c!==null;)c.alternate!==null&&(w=c),c=c.sibling;w===null?l.tail=null:w.sibling=null;break;case"collapsed":w=l.tail;for(var N=null;w!==null;)w.alternate!==null&&(N=w),w=w.sibling;N===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:N.sibling=null}}function jo(l){var c=l.alternate!==null&&l.alternate.child===l.child,w=0,N=0;if(c)for(var G=l.child;G!==null;)w|=G.lanes|G.childLanes,N|=G.subtreeFlags&14680064,N|=G.flags&14680064,G.return=l,G=G.sibling;else for(G=l.child;G!==null;)w|=G.lanes|G.childLanes,N|=G.subtreeFlags,N|=G.flags,G.return=l,G=G.sibling;return l.subtreeFlags|=N,l.childLanes=w,c}function cx(l,c,w){var N=c.pendingProps;switch(Xe(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jo(c),null;case 1:return ma(c.type)&&wu(),jo(c),null;case 3:return N=c.stateNode,hn(),en(va),en(Ui),wa(),N.pendingContext&&(N.context=N.pendingContext,N.pendingContext=null),(l===null||l.child===null)&&(qn(c)?c.flags|=4:l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,ht!==null&&(gg(ht),ht=null))),ig(l,c),jo(c),null;case 5:Vs(c);var G=hi(Dn.current);if(w=c.type,l!==null&&c.stateNode!=null)Sy(l,c,w,N,G),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(r(166));return jo(c),null}if(l=hi(Ir.current),qn(c)){N=c.stateNode,w=c.type;var Q=c.memoizedProps;switch(N[Ro]=c,N[yu]=Q,l=(c.mode&1)!==0,w){case"dialog":fn("cancel",N),fn("close",N);break;case"iframe":case"object":case"embed":fn("load",N);break;case"video":case"audio":for(G=0;G<Xo.length;G++)fn(Xo[G],N);break;case"source":fn("error",N);break;case"img":case"image":case"link":fn("error",N),fn("load",N);break;case"details":fn("toggle",N);break;case"input":ge(N,Q),fn("invalid",N);break;case"select":N._wrapperState={wasMultiple:!!Q.multiple},fn("invalid",N);break;case"textarea":ke(N,Q),fn("invalid",N)}Ve(w,Q),G=null;for(var he in Q)if(Q.hasOwnProperty(he)){var Me=Q[he];he==="children"?typeof Me=="string"?N.textContent!==Me&&(Q.suppressHydrationWarning!==!0&&Zu(N.textContent,Me,l),G=["children",Me]):typeof Me=="number"&&N.textContent!==""+Me&&(Q.suppressHydrationWarning!==!0&&Zu(N.textContent,Me,l),G=["children",""+Me]):i.hasOwnProperty(he)&&Me!=null&&he==="onScroll"&&fn("scroll",N)}switch(w){case"input":Te(N),Oe(N,Q,!0);break;case"textarea":Te(N),Ue(N);break;case"select":case"option":break;default:typeof Q.onClick=="function"&&(N.onclick=Gs)}N=G,c.updateQueue=N,N!==null&&(c.flags|=4)}else{he=G.nodeType===9?G:G.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=st(w)),l==="http://www.w3.org/1999/xhtml"?w==="script"?(l=he.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof N.is=="string"?l=he.createElement(w,{is:N.is}):(l=he.createElement(w),w==="select"&&(he=l,N.multiple?he.multiple=!0:N.size&&(he.size=N.size))):l=he.createElementNS(l,w),l[Ro]=c,l[yu]=N,xy(l,c,!1,!1),c.stateNode=l;e:{switch(he=qe(w,N),w){case"dialog":fn("cancel",l),fn("close",l),G=N;break;case"iframe":case"object":case"embed":fn("load",l),G=N;break;case"video":case"audio":for(G=0;G<Xo.length;G++)fn(Xo[G],l);G=N;break;case"source":fn("error",l),G=N;break;case"img":case"image":case"link":fn("error",l),fn("load",l),G=N;break;case"details":fn("toggle",l),G=N;break;case"input":ge(l,N),G=Ee(l,N),fn("invalid",l);break;case"option":G=N;break;case"select":l._wrapperState={wasMultiple:!!N.multiple},G=V({},N,{value:void 0}),fn("invalid",l);break;case"textarea":ke(l,N),G=ue(l,N),fn("invalid",l);break;default:G=N}Ve(w,G),Me=G;for(Q in Me)if(Me.hasOwnProperty(Q)){var ze=Me[Q];Q==="style"?It(l,ze):Q==="dangerouslySetInnerHTML"?(ze=ze?ze.__html:void 0,ze!=null&&xt(l,ze)):Q==="children"?typeof ze=="string"?(w!=="textarea"||ze!=="")&&bt(l,ze):typeof ze=="number"&&bt(l,""+ze):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?ze!=null&&Q==="onScroll"&&fn("scroll",l):ze!=null&&k(l,Q,ze,he))}switch(w){case"input":Te(l),Oe(l,N,!1);break;case"textarea":Te(l),Ue(l);break;case"option":N.value!=null&&l.setAttribute("value",""+me(N.value));break;case"select":l.multiple=!!N.multiple,Q=N.value,Q!=null?Ne(l,!!N.multiple,Q,!1):N.defaultValue!=null&&Ne(l,!!N.multiple,N.defaultValue,!0);break;default:typeof G.onClick=="function"&&(l.onclick=Gs)}switch(w){case"button":case"input":case"select":case"textarea":N=!!N.autoFocus;break e;case"img":N=!0;break e;default:N=!1}}N&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return jo(c),null;case 6:if(l&&c.stateNode!=null)Ey(l,c,l.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(r(166));if(w=hi(Dn.current),hi(Ir.current),qn(c)){if(N=c.stateNode,w=c.memoizedProps,N[Ro]=c,(Q=N.nodeValue!==w)&&(l=ot,l!==null))switch(l.tag){case 3:Zu(N.nodeValue,w,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Zu(N.nodeValue,w,(l.mode&1)!==0)}Q&&(c.flags|=4)}else N=(w.nodeType===9?w:w.ownerDocument).createTextNode(N),N[Ro]=c,c.stateNode=N}return jo(c),null;case 13:if(en(dn),N=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ft&&He!==null&&(c.mode&1)!==0&&(c.flags&128)===0)vr(),Ft(),c.flags|=98560,Q=!1;else if(Q=qn(c),N!==null&&N.dehydrated!==null){if(l===null){if(!Q)throw Error(r(318));if(Q=c.memoizedState,Q=Q!==null?Q.dehydrated:null,!Q)throw Error(r(317));Q[Ro]=c}else Ft(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;jo(c),Q=!1}else ht!==null&&(gg(ht),ht=null),Q=!0;if(!Q)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=w,c):(N=N!==null,N!==(l!==null&&l.memoizedState!==null)&&N&&(c.child.flags|=8192,(c.mode&1)!==0&&(l===null||(dn.current&1)!==0?Ia===0&&(Ia=3):yg())),c.updateQueue!==null&&(c.flags|=4),jo(c),null);case 4:return hn(),ig(l,c),l===null&&$s(c.stateNode.containerInfo),jo(c),null;case 10:return On(c.type._context),jo(c),null;case 17:return ma(c.type)&&wu(),jo(c),null;case 19:if(en(dn),Q=c.memoizedState,Q===null)return jo(c),null;if(N=(c.flags&128)!==0,he=Q.rendering,he===null)if(N)Pd(Q,!1);else{if(Ia!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(he=fo(l),he!==null){for(c.flags|=128,Pd(Q,!1),N=he.updateQueue,N!==null&&(c.updateQueue=N,c.flags|=4),c.subtreeFlags=0,N=w,w=c.child;w!==null;)Q=w,l=N,Q.flags&=14680066,he=Q.alternate,he===null?(Q.childLanes=0,Q.lanes=l,Q.child=null,Q.subtreeFlags=0,Q.memoizedProps=null,Q.memoizedState=null,Q.updateQueue=null,Q.dependencies=null,Q.stateNode=null):(Q.childLanes=he.childLanes,Q.lanes=he.lanes,Q.child=he.child,Q.subtreeFlags=0,Q.deletions=null,Q.memoizedProps=he.memoizedProps,Q.memoizedState=he.memoizedState,Q.updateQueue=he.updateQueue,Q.type=he.type,l=he.dependencies,Q.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),w=w.sibling;return sn(dn,dn.current&1|2),c.child}l=l.sibling}Q.tail!==null&&An()>Dh&&(c.flags|=128,N=!0,Pd(Q,!1),c.lanes=4194304)}else{if(!N)if(l=fo(he),l!==null){if(c.flags|=128,N=!0,w=l.updateQueue,w!==null&&(c.updateQueue=w,c.flags|=4),Pd(Q,!0),Q.tail===null&&Q.tailMode==="hidden"&&!he.alternate&&!ft)return jo(c),null}else 2*An()-Q.renderingStartTime>Dh&&w!==1073741824&&(c.flags|=128,N=!0,Pd(Q,!1),c.lanes=4194304);Q.isBackwards?(he.sibling=c.child,c.child=he):(w=Q.last,w!==null?w.sibling=he:c.child=he,Q.last=he)}return Q.tail!==null?(c=Q.tail,Q.rendering=c,Q.tail=c.sibling,Q.renderingStartTime=An(),c.sibling=null,w=dn.current,sn(dn,N?w&1|2:w&1),c):(jo(c),null);case 22:case 23:return mg(),N=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==N&&(c.flags|=8192),N&&(c.mode&1)!==0?(Xs&1073741824)!==0&&(jo(c),c.subtreeFlags&6&&(c.flags|=8192)):jo(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function fx(l,c){switch(Xe(c),c.tag){case 1:return ma(c.type)&&wu(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return hn(),en(va),en(Ui),wa(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 5:return Vs(c),null;case 13:if(en(dn),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ft()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return en(dn),null;case 4:return hn(),null;case 10:return On(c.type._context),null;case 22:case 23:return mg(),null;case 24:return null;default:return null}}var Gp=!1,Do=!1,hx=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function Ih(l,c){var w=l.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(N){Gi(l,c,N)}else w.current=null}function ag(l,c,w){try{w()}catch(N){Gi(l,c,N)}}var Ay=!1;function dx(l,c){if(Qu=hu,l=Lr(),Va(l)){if("selectionStart"in l)var w={start:l.selectionStart,end:l.selectionEnd};else e:{w=(w=l.ownerDocument)&&w.defaultView||window;var N=w.getSelection&&w.getSelection();if(N&&N.rangeCount!==0){w=N.anchorNode;var G=N.anchorOffset,Q=N.focusNode;N=N.focusOffset;try{w.nodeType,Q.nodeType}catch{w=null;break e}var he=0,Me=-1,ze=-1,nt=0,vt=0,yt=l,gt=null;t:for(;;){for(var qt;yt!==w||G!==0&&yt.nodeType!==3||(Me=he+G),yt!==Q||N!==0&&yt.nodeType!==3||(ze=he+N),yt.nodeType===3&&(he+=yt.nodeValue.length),(qt=yt.firstChild)!==null;)gt=yt,yt=qt;for(;;){if(yt===l)break t;if(gt===w&&++nt===G&&(Me=he),gt===Q&&++vt===N&&(ze=he),(qt=yt.nextSibling)!==null)break;yt=gt,gt=yt.parentNode}yt=qt}w=Me===-1||ze===-1?null:{start:Me,end:ze}}else w=null}w=w||{start:0,end:0}}else w=null;for(ql={focusedElem:l,selectionRange:w},hu=!1,Gt=c;Gt!==null;)if(c=Gt,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Gt=l;else for(;Gt!==null;){c=Gt;try{var Vt=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Vt!==null){var Xt=Vt.memoizedProps,aa=Vt.memoizedState,et=c.stateNode,We=et.getSnapshotBeforeUpdate(c.elementType===c.type?Xt:Ma(c.type,Xt),aa);et.__reactInternalSnapshotBeforeUpdate=We}break;case 3:var tt=c.stateNode.containerInfo;tt.nodeType===1?tt.textContent="":tt.nodeType===9&&tt.documentElement&&tt.removeChild(tt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(_t){Gi(c,c.return,_t)}if(l=c.sibling,l!==null){l.return=c.return,Gt=l;break}Gt=c.return}return Vt=Ay,Ay=!1,Vt}function Od(l,c,w){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var G=N=N.next;do{if((G.tag&l)===l){var Q=G.destroy;G.destroy=void 0,Q!==void 0&&ag(c,w,Q)}G=G.next}while(G!==N)}}function Wp(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var w=c=c.next;do{if((w.tag&l)===l){var N=w.create;w.destroy=N()}w=w.next}while(w!==c)}}function og(l){var c=l.ref;if(c!==null){var w=l.stateNode;switch(l.tag){case 5:l=w;break;default:l=w}typeof c=="function"?c(l):c.current=l}}function ky(l){var c=l.alternate;c!==null&&(l.alternate=null,ky(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&(delete c[Ro],delete c[yu],delete c[Ra],delete c[Ph],delete c[Oh])),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 Py(l){return l.tag===5||l.tag===3||l.tag===4}function Oy(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Py(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 sg(l,c,w){var N=l.tag;if(N===5||N===6)l=l.stateNode,c?w.nodeType===8?w.parentNode.insertBefore(l,c):w.insertBefore(l,c):(w.nodeType===8?(c=w.parentNode,c.insertBefore(l,w)):(c=w,c.appendChild(l)),w=w._reactRootContainer,w!=null||c.onclick!==null||(c.onclick=Gs));else if(N!==4&&(l=l.child,l!==null))for(sg(l,c,w),l=l.sibling;l!==null;)sg(l,c,w),l=l.sibling}function lg(l,c,w){var N=l.tag;if(N===5||N===6)l=l.stateNode,c?w.insertBefore(l,c):w.appendChild(l);else if(N!==4&&(l=l.child,l!==null))for(lg(l,c,w),l=l.sibling;l!==null;)lg(l,c,w),l=l.sibling}var yo=null,Vl=!1;function Vc(l,c,w){for(w=w.child;w!==null;)Cy(l,c,w),w=w.sibling}function Cy(l,c,w){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(_o,w)}catch{}switch(w.tag){case 5:Do||Ih(w,c);case 6:var N=yo,G=Vl;yo=null,Vc(l,c,w),yo=N,Vl=G,yo!==null&&(Vl?(l=yo,w=w.stateNode,l.nodeType===8?l.parentNode.removeChild(w):l.removeChild(w)):yo.removeChild(w.stateNode));break;case 18:yo!==null&&(Vl?(l=yo,w=w.stateNode,l.nodeType===8?Dc(l.parentNode,w):l.nodeType===1&&Dc(l,w),Ai(l)):Dc(yo,w.stateNode));break;case 4:N=yo,G=Vl,yo=w.stateNode.containerInfo,Vl=!0,Vc(l,c,w),yo=N,Vl=G;break;case 0:case 11:case 14:case 15:if(!Do&&(N=w.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){G=N=N.next;do{var Q=G,he=Q.destroy;Q=Q.tag,he!==void 0&&((Q&2)!==0||(Q&4)!==0)&&ag(w,c,he),G=G.next}while(G!==N)}Vc(l,c,w);break;case 1:if(!Do&&(Ih(w,c),N=w.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=w.memoizedProps,N.state=w.memoizedState,N.componentWillUnmount()}catch(Me){Gi(w,c,Me)}Vc(l,c,w);break;case 21:Vc(l,c,w);break;case 22:w.mode&1?(Do=(N=Do)||w.memoizedState!==null,Vc(l,c,w),Do=N):Vc(l,c,w);break;default:Vc(l,c,w)}}function Ly(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var w=l.stateNode;w===null&&(w=l.stateNode=new hx),c.forEach(function(N){var G=xx.bind(null,l,N);w.has(N)||(w.add(N),N.then(G,G))})}}function Yl(l,c){var w=c.deletions;if(w!==null)for(var N=0;N<w.length;N++){var G=w[N];try{var Q=l,he=c,Me=he;e:for(;Me!==null;){switch(Me.tag){case 5:yo=Me.stateNode,Vl=!1;break e;case 3:yo=Me.stateNode.containerInfo,Vl=!0;break e;case 4:yo=Me.stateNode.containerInfo,Vl=!0;break e}Me=Me.return}if(yo===null)throw Error(r(160));Cy(Q,he,G),yo=null,Vl=!1;var ze=G.alternate;ze!==null&&(ze.return=null),G.return=null}catch(nt){Gi(G,c,nt)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Ny(c,l),c=c.sibling}function Ny(l,c){var w=l.alternate,N=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Yl(c,l),Pu(l),N&4){try{Od(3,l,l.return),Wp(3,l)}catch(Xt){Gi(l,l.return,Xt)}try{Od(5,l,l.return)}catch(Xt){Gi(l,l.return,Xt)}}break;case 1:Yl(c,l),Pu(l),N&512&&w!==null&&Ih(w,w.return);break;case 5:if(Yl(c,l),Pu(l),N&512&&w!==null&&Ih(w,w.return),l.flags&32){var G=l.stateNode;try{bt(G,"")}catch(Xt){Gi(l,l.return,Xt)}}if(N&4&&(G=l.stateNode,G!=null)){var Q=l.memoizedProps,he=w!==null?w.memoizedProps:Q,Me=l.type,ze=l.updateQueue;if(l.updateQueue=null,ze!==null)try{Me==="input"&&Q.type==="radio"&&Q.name!=null&&Re(G,Q),qe(Me,he);var nt=qe(Me,Q);for(he=0;he<ze.length;he+=2){var vt=ze[he],yt=ze[he+1];vt==="style"?It(G,yt):vt==="dangerouslySetInnerHTML"?xt(G,yt):vt==="children"?bt(G,yt):k(G,vt,yt,nt)}switch(Me){case"input":Be(G,Q);break;case"textarea":Pe(G,Q);break;case"select":var gt=G._wrapperState.wasMultiple;G._wrapperState.wasMultiple=!!Q.multiple;var qt=Q.value;qt!=null?Ne(G,!!Q.multiple,qt,!1):gt!==!!Q.multiple&&(Q.defaultValue!=null?Ne(G,!!Q.multiple,Q.defaultValue,!0):Ne(G,!!Q.multiple,Q.multiple?[]:"",!1))}G[yu]=Q}catch(Xt){Gi(l,l.return,Xt)}}break;case 6:if(Yl(c,l),Pu(l),N&4){if(l.stateNode===null)throw Error(r(162));G=l.stateNode,Q=l.memoizedProps;try{G.nodeValue=Q}catch(Xt){Gi(l,l.return,Xt)}}break;case 3:if(Yl(c,l),Pu(l),N&4&&w!==null&&w.memoizedState.isDehydrated)try{Ai(c.containerInfo)}catch(Xt){Gi(l,l.return,Xt)}break;case 4:Yl(c,l),Pu(l);break;case 13:Yl(c,l),Pu(l),G=l.child,G.flags&8192&&(Q=G.memoizedState!==null,G.stateNode.isHidden=Q,!Q||G.alternate!==null&&G.alternate.memoizedState!==null||(fg=An())),N&4&&Ly(l);break;case 22:if(vt=w!==null&&w.memoizedState!==null,l.mode&1?(Do=(nt=Do)||vt,Yl(c,l),Do=nt):Yl(c,l),Pu(l),N&8192){if(nt=l.memoizedState!==null,(l.stateNode.isHidden=nt)&&!vt&&(l.mode&1)!==0)for(Gt=l,vt=l.child;vt!==null;){for(yt=Gt=vt;Gt!==null;){switch(gt=Gt,qt=gt.child,gt.tag){case 0:case 11:case 14:case 15:Od(4,gt,gt.return);break;case 1:Ih(gt,gt.return);var Vt=gt.stateNode;if(typeof Vt.componentWillUnmount=="function"){N=gt,w=gt.return;try{c=N,Vt.props=c.memoizedProps,Vt.state=c.memoizedState,Vt.componentWillUnmount()}catch(Xt){Gi(N,w,Xt)}}break;case 5:Ih(gt,gt.return);break;case 22:if(gt.memoizedState!==null){My(yt);continue}}qt!==null?(qt.return=gt,Gt=qt):My(yt)}vt=vt.sibling}e:for(vt=null,yt=l;;){if(yt.tag===5){if(vt===null){vt=yt;try{G=yt.stateNode,nt?(Q=G.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none"):(Me=yt.stateNode,ze=yt.memoizedProps.style,he=ze!=null&&ze.hasOwnProperty("display")?ze.display:null,Me.style.display=_r("display",he))}catch(Xt){Gi(l,l.return,Xt)}}}else if(yt.tag===6){if(vt===null)try{yt.stateNode.nodeValue=nt?"":yt.memoizedProps}catch(Xt){Gi(l,l.return,Xt)}}else if((yt.tag!==22&&yt.tag!==23||yt.memoizedState===null||yt===l)&&yt.child!==null){yt.child.return=yt,yt=yt.child;continue}if(yt===l)break e;for(;yt.sibling===null;){if(yt.return===null||yt.return===l)break e;vt===yt&&(vt=null),yt=yt.return}vt===yt&&(vt=null),yt.sibling.return=yt.return,yt=yt.sibling}}break;case 19:Yl(c,l),Pu(l),N&4&&Ly(l);break;case 21:break;default:Yl(c,l),Pu(l)}}function Pu(l){var c=l.flags;if(c&2){try{e:{for(var w=l.return;w!==null;){if(Py(w)){var N=w;break e}w=w.return}throw Error(r(160))}switch(N.tag){case 5:var G=N.stateNode;N.flags&32&&(bt(G,""),N.flags&=-33);var Q=Oy(l);lg(l,Q,G);break;case 3:case 4:var he=N.stateNode.containerInfo,Me=Oy(l);sg(l,Me,he);break;default:throw Error(r(161))}}catch(ze){Gi(l,l.return,ze)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function px(l,c,w){Gt=l,Ty(l)}function Ty(l,c,w){for(var N=(l.mode&1)!==0;Gt!==null;){var G=Gt,Q=G.child;if(G.tag===22&&N){var he=G.memoizedState!==null||Gp;if(!he){var Me=G.alternate,ze=Me!==null&&Me.memoizedState!==null||Do;Me=Gp;var nt=Do;if(Gp=he,(Do=ze)&&!nt)for(Gt=G;Gt!==null;)he=Gt,ze=he.child,he.tag===22&&he.memoizedState!==null?Iy(G):ze!==null?(ze.return=he,Gt=ze):Iy(G);for(;Q!==null;)Gt=Q,Ty(Q),Q=Q.sibling;Gt=G,Gp=Me,Do=nt}Ry(l)}else(G.subtreeFlags&8772)!==0&&Q!==null?(Q.return=G,Gt=Q):Ry(l)}}function Ry(l){for(;Gt!==null;){var c=Gt;if((c.flags&8772)!==0){var w=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Do||Wp(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Do)if(w===null)N.componentDidMount();else{var G=c.elementType===c.type?w.memoizedProps:Ma(c.type,w.memoizedProps);N.componentDidUpdate(G,w.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var Q=c.updateQueue;Q!==null&&Wr(c,Q,N);break;case 3:var he=c.updateQueue;if(he!==null){if(w=null,c.child!==null)switch(c.child.tag){case 5:w=c.child.stateNode;break;case 1:w=c.child.stateNode}Wr(c,he,w)}break;case 5:var Me=c.stateNode;if(w===null&&c.flags&4){w=Me;var ze=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":ze.autoFocus&&w.focus();break;case"img":ze.src&&(w.src=ze.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var nt=c.alternate;if(nt!==null){var vt=nt.memoizedState;if(vt!==null){var yt=vt.dehydrated;yt!==null&&Ai(yt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Do||c.flags&512&&og(c)}catch(gt){Gi(c,c.return,gt)}}if(c===l){Gt=null;break}if(w=c.sibling,w!==null){w.return=c.return,Gt=w;break}Gt=c.return}}function My(l){for(;Gt!==null;){var c=Gt;if(c===l){Gt=null;break}var w=c.sibling;if(w!==null){w.return=c.return,Gt=w;break}Gt=c.return}}function Iy(l){for(;Gt!==null;){var c=Gt;try{switch(c.tag){case 0:case 11:case 15:var w=c.return;try{Wp(4,c)}catch(ze){Gi(c,w,ze)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var G=c.return;try{N.componentDidMount()}catch(ze){Gi(c,G,ze)}}var Q=c.return;try{og(c)}catch(ze){Gi(c,Q,ze)}break;case 5:var he=c.return;try{og(c)}catch(ze){Gi(c,he,ze)}}}catch(ze){Gi(c,c.return,ze)}if(c===l){Gt=null;break}var Me=c.sibling;if(Me!==null){Me.return=c.return,Gt=Me;break}Gt=c.return}}var gx=Math.ceil,Vp=S.ReactCurrentDispatcher,ug=S.ReactCurrentOwner,Sl=S.ReactCurrentBatchConfig,un=0,Za=null,xa=null,bo=0,Xs=0,jh=Mo(0),Ia=0,Cd=null,Df=0,Yp=0,cg=0,Ld=null,ks=null,fg=0,Dh=1/0,ic=null,Xp=!1,hg=null,Yc=null,Kp=!1,Xc=null,Zp=0,Nd=0,dg=null,Qp=-1,Jp=0;function Jo(){return(un&6)!==0?An():Qp!==-1?Qp:Qp=An()}function Kc(l){return(l.mode&1)===0?1:(un&2)!==0&&bo!==0?bo&-bo:Un.transition!==null?(Jp===0&&(Jp=Wu()),Jp):(l=Rr,l!==0||(l=window.event,l=l===void 0?16:Tl(l.type)),l)}function Xl(l,c,w,N){if(50<Nd)throw Nd=0,dg=null,Error(r(185));Nl(l,w,N),((un&2)===0||l!==Za)&&(l===Za&&((un&2)===0&&(Yp|=w),Ia===4&&Zc(l,bo)),Ps(l,N),w===1&&un===0&&(c.mode&1)===0&&(Dh=An()+500,Hl&&re()))}function Ps(l,c){var w=l.callbackNode;Zn(l,c);var N=Zi(l,l===Za?bo:0);if(N===0)w!==null&&rs(w),l.callbackNode=null,l.callbackPriority=0;else if(c=N&-N,l.callbackPriority!==c){if(w!=null&&rs(w),c===1)l.tag===0?Y(Dy.bind(null,l)):R(Dy.bind(null,l)),Ah(function(){(un&6)===0&&re()}),w=null;else{switch(xo(N)){case 1:w=ns;break;case 4:w=Pa;break;case 16:w=is;break;case 536870912:w=sl;break;default:w=is}w=Gy(w,jy.bind(null,l))}l.callbackPriority=c,l.callbackNode=w}}function jy(l,c){if(Qp=-1,Jp=0,(un&6)!==0)throw Error(r(327));var w=l.callbackNode;if(Fh()&&l.callbackNode!==w)return null;var N=Zi(l,l===Za?bo:0);if(N===0)return null;if((N&30)!==0||(N&l.expiredLanes)!==0||c)c=e1(l,N);else{c=N;var G=un;un|=2;var Q=By();(Za!==l||bo!==c)&&(ic=null,Dh=An()+500,Bf(l,c));do try{yx();break}catch(Me){Fy(l,Me)}while(!0);$r(),Vp.current=Q,un=G,xa!==null?c=0:(Za=null,bo=0,c=Ia)}if(c!==0){if(c===2&&(G=os(l),G!==0&&(N=G,c=pg(l,G))),c===1)throw w=Cd,Bf(l,0),Zc(l,N),Ps(l,An()),w;if(c===6)Zc(l,N);else{if(G=l.current.alternate,(N&30)===0&&!vx(G)&&(c=e1(l,N),c===2&&(Q=os(l),Q!==0&&(N=Q,c=pg(l,Q))),c===1))throw w=Cd,Bf(l,0),Zc(l,N),Ps(l,An()),w;switch(l.finishedWork=G,l.finishedLanes=N,c){case 0:case 1:throw Error(r(345));case 2:zf(l,ks,ic);break;case 3:if(Zc(l,N),(N&130023424)===N&&(c=fg+500-An(),10<c)){if(Zi(l,0)!==0)break;if(G=l.suspendedLanes,(G&N)!==N){Jo(),l.pingedLanes|=l.suspendedLanes&G;break}l.timeoutHandle=co(zf.bind(null,l,ks,ic),c);break}zf(l,ks,ic);break;case 4:if(Zc(l,N),(N&4194240)===N)break;for(c=l.eventTimes,G=-1;0<N;){var he=31-Sr(N);Q=1<<he,he=c[he],he>G&&(G=he),N&=~Q}if(N=G,N=An()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*gx(N/1960))-N,10<N){l.timeoutHandle=co(zf.bind(null,l,ks,ic),N);break}zf(l,ks,ic);break;case 5:zf(l,ks,ic);break;default:throw Error(r(329))}}}return Ps(l,An()),l.callbackNode===w?jy.bind(null,l):null}function pg(l,c){var w=Ld;return l.current.memoizedState.isDehydrated&&(Bf(l,c).flags|=256),l=e1(l,c),l!==2&&(c=ks,ks=w,c!==null&&gg(c)),l}function gg(l){ks===null?ks=l:ks.push.apply(ks,l)}function vx(l){for(var c=l;;){if(c.flags&16384){var w=c.updateQueue;if(w!==null&&(w=w.stores,w!==null))for(var N=0;N<w.length;N++){var G=w[N],Q=G.getSnapshot;G=G.value;try{if(!Pn(Q(),G))return!1}catch{return!1}}}if(w=c.child,c.subtreeFlags&16384&&w!==null)w.return=c,c=w;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Zc(l,c){for(c&=~cg,c&=~Yp,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var w=31-Sr(c),N=1<<w;l[w]=-1,c&=~N}}function Dy(l){if((un&6)!==0)throw Error(r(327));Fh();var c=Zi(l,0);if((c&1)===0)return Ps(l,An()),null;var w=e1(l,c);if(l.tag!==0&&w===2){var N=os(l);N!==0&&(c=N,w=pg(l,N))}if(w===1)throw w=Cd,Bf(l,0),Zc(l,c),Ps(l,An()),w;if(w===6)throw Error(r(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,zf(l,ks,ic),Ps(l,An()),null}function vg(l,c){var w=un;un|=1;try{return l(c)}finally{un=w,un===0&&(Dh=An()+500,Hl&&re())}}function Ff(l){Xc!==null&&Xc.tag===0&&(un&6)===0&&Fh();var c=un;un|=1;var w=Sl.transition,N=Rr;try{if(Sl.transition=null,Rr=1,l)return l()}finally{Rr=N,Sl.transition=w,un=c,(un&6)===0&&re()}}function mg(){Xs=jh.current,en(jh)}function Bf(l,c){l.finishedWork=null,l.finishedLanes=0;var w=l.timeoutHandle;if(w!==-1&&(l.timeoutHandle=-1,jc(w)),xa!==null)for(w=xa.return;w!==null;){var N=w;switch(Xe(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&wu();break;case 3:hn(),en(va),en(Ui),wa();break;case 5:Vs(N);break;case 4:hn();break;case 13:en(dn);break;case 19:en(dn);break;case 10:On(N.type._context);break;case 22:case 23:mg()}w=w.return}if(Za=l,xa=l=Qc(l.current,null),bo=Xs=c,Ia=0,Cd=null,cg=Yp=Df=0,ks=Ld=null,tn!==null){for(c=0;c<tn.length;c++)if(w=tn[c],N=w.interleaved,N!==null){w.interleaved=null;var G=N.next,Q=w.pending;if(Q!==null){var he=Q.next;Q.next=G,N.next=he}w.pending=N}tn=null}return l}function Fy(l,c){do{var w=xa;try{if($r(),xu.current=Hc,ho){for(var N=ln.memoizedState;N!==null;){var G=N.queue;G!==null&&(G.pending=null),N=N.next}ho=!1}if($i=0,Gn=$n=ln=null,Io=!1,po=0,ug.current=null,w===null||w.return===null){Ia=1,Cd=c,xa=null;break}e:{var Q=l,he=w.return,Me=w,ze=c;if(c=bo,Me.flags|=32768,ze!==null&&typeof ze=="object"&&typeof ze.then=="function"){var nt=ze,vt=Me,yt=vt.tag;if((vt.mode&1)===0&&(yt===0||yt===11||yt===15)){var gt=vt.alternate;gt?(vt.updateQueue=gt.updateQueue,vt.memoizedState=gt.memoizedState,vt.lanes=gt.lanes):(vt.updateQueue=null,vt.memoizedState=null)}var qt=L(he);if(qt!==null){qt.flags&=-257,z(qt,he,Me,Q,c),qt.mode&1&&m(Q,nt,c),c=qt,ze=nt;var Vt=c.updateQueue;if(Vt===null){var Xt=new Set;Xt.add(ze),c.updateQueue=Xt}else Vt.add(ze);break e}else{if((c&1)===0){m(Q,nt,c),yg();break e}ze=Error(r(426))}}else if(ft&&Me.mode&1){var aa=L(he);if(aa!==null){(aa.flags&65536)===0&&(aa.flags|=256),z(aa,he,Me,Q,c),St(nc(ze,Me));break e}}Q=ze=nc(ze,Me),Ia!==4&&(Ia=2),Ld===null?Ld=[Q]:Ld.push(Q),Q=he;do{switch(Q.tag){case 3:Q.flags|=65536,c&=-c,Q.lanes|=c;var et=$p(Q,ze,c);rn(Q,et);break e;case 1:Me=ze;var We=Q.type,tt=Q.stateNode;if((Q.flags&128)===0&&(typeof We.getDerivedStateFromError=="function"||tt!==null&&typeof tt.componentDidCatch=="function"&&(Yc===null||!Yc.has(tt)))){Q.flags|=65536,c&=-c,Q.lanes|=c;var _t=d(Q,Me,c);rn(Q,_t);break e}}Q=Q.return}while(Q!==null)}qy(w)}catch(Kt){c=Kt,xa===w&&w!==null&&(xa=w=w.return);continue}break}while(!0)}function By(){var l=Vp.current;return Vp.current=Hc,l===null?Hc:l}function yg(){(Ia===0||Ia===3||Ia===2)&&(Ia=4),Za===null||(Df&268435455)===0&&(Yp&268435455)===0||Zc(Za,bo)}function e1(l,c){var w=un;un|=2;var N=By();(Za!==l||bo!==c)&&(ic=null,Bf(l,c));do try{mx();break}catch(G){Fy(l,G)}while(!0);if($r(),un=w,Vp.current=N,xa!==null)throw Error(r(261));return Za=null,bo=0,Ia}function mx(){for(;xa!==null;)zy(xa)}function yx(){for(;xa!==null&&!su();)zy(xa)}function zy(l){var c=$y(l.alternate,l,Xs);l.memoizedProps=l.pendingProps,c===null?qy(l):xa=c,ug.current=null}function qy(l){var c=l;do{var w=c.alternate;if(l=c.return,(c.flags&32768)===0){if(w=cx(w,c,Xs),w!==null){xa=w;return}}else{if(w=fx(w,c),w!==null){w.flags&=32767,xa=w;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Ia=6,xa=null;return}}if(c=c.sibling,c!==null){xa=c;return}xa=c=l}while(c!==null);Ia===0&&(Ia=5)}function zf(l,c,w){var N=Rr,G=Sl.transition;try{Sl.transition=null,Rr=1,bx(l,c,w,N)}finally{Sl.transition=G,Rr=N}return null}function bx(l,c,w,N){do Fh();while(Xc!==null);if((un&6)!==0)throw Error(r(327));w=l.finishedWork;var G=l.finishedLanes;if(w===null)return null;if(l.finishedWork=null,l.finishedLanes=0,w===l.current)throw Error(r(177));l.callbackNode=null,l.callbackPriority=0;var Q=w.lanes|w.childLanes;if(ss(l,Q),l===Za&&(xa=Za=null,bo=0),(w.subtreeFlags&2064)===0&&(w.flags&2064)===0||Kp||(Kp=!0,Gy(is,function(){return Fh(),null})),Q=(w.flags&15990)!==0,(w.subtreeFlags&15990)!==0||Q){Q=Sl.transition,Sl.transition=null;var he=Rr;Rr=1;var Me=un;un|=4,ug.current=null,dx(l,w),Ny(w,l),Us(ql),hu=!!Qu,ql=Qu=null,l.current=w,px(w),Lf(),un=Me,Rr=he,Sl.transition=Q}else l.current=w;if(Kp&&(Kp=!1,Xc=l,Zp=G),Q=l.pendingLanes,Q===0&&(Yc=null),cn(w.stateNode),Ps(l,An()),c!==null)for(N=l.onRecoverableError,w=0;w<c.length;w++)G=c[w],N(G.value,{componentStack:G.stack,digest:G.digest});if(Xp)throw Xp=!1,l=hg,hg=null,l;return(Zp&1)!==0&&l.tag!==0&&Fh(),Q=l.pendingLanes,(Q&1)!==0?l===dg?Nd++:(Nd=0,dg=l):Nd=0,re(),null}function Fh(){if(Xc!==null){var l=xo(Zp),c=Sl.transition,w=Rr;try{if(Sl.transition=null,Rr=16>l?16:l,Xc===null)var N=!1;else{if(l=Xc,Xc=null,Zp=0,(un&6)!==0)throw Error(r(331));var G=un;for(un|=4,Gt=l.current;Gt!==null;){var Q=Gt,he=Q.child;if((Gt.flags&16)!==0){var Me=Q.deletions;if(Me!==null){for(var ze=0;ze<Me.length;ze++){var nt=Me[ze];for(Gt=nt;Gt!==null;){var vt=Gt;switch(vt.tag){case 0:case 11:case 15:Od(8,vt,Q)}var yt=vt.child;if(yt!==null)yt.return=vt,Gt=yt;else for(;Gt!==null;){vt=Gt;var gt=vt.sibling,qt=vt.return;if(ky(vt),vt===nt){Gt=null;break}if(gt!==null){gt.return=qt,Gt=gt;break}Gt=qt}}}var Vt=Q.alternate;if(Vt!==null){var Xt=Vt.child;if(Xt!==null){Vt.child=null;do{var aa=Xt.sibling;Xt.sibling=null,Xt=aa}while(Xt!==null)}}Gt=Q}}if((Q.subtreeFlags&2064)!==0&&he!==null)he.return=Q,Gt=he;else e:for(;Gt!==null;){if(Q=Gt,(Q.flags&2048)!==0)switch(Q.tag){case 0:case 11:case 15:Od(9,Q,Q.return)}var et=Q.sibling;if(et!==null){et.return=Q.return,Gt=et;break e}Gt=Q.return}}var We=l.current;for(Gt=We;Gt!==null;){he=Gt;var tt=he.child;if((he.subtreeFlags&2064)!==0&&tt!==null)tt.return=he,Gt=tt;else e:for(he=We;Gt!==null;){if(Me=Gt,(Me.flags&2048)!==0)try{switch(Me.tag){case 0:case 11:case 15:Wp(9,Me)}}catch(Kt){Gi(Me,Me.return,Kt)}if(Me===he){Gt=null;break e}var _t=Me.sibling;if(_t!==null){_t.return=Me.return,Gt=_t;break e}Gt=Me.return}}if(un=G,re(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(_o,l)}catch{}N=!0}return N}finally{Rr=w,Sl.transition=c}}return!1}function Uy(l,c,w){c=nc(w,c),c=$p(l,c,1),l=Hn(l,c,1),c=Jo(),l!==null&&(Nl(l,1,c),Ps(l,c))}function Gi(l,c,w){if(l.tag===3)Uy(l,l,w);else for(;c!==null;){if(c.tag===3){Uy(c,l,w);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(Yc===null||!Yc.has(N))){l=nc(w,l),l=d(c,l,1),c=Hn(c,l,1),l=Jo(),c!==null&&(Nl(c,1,l),Ps(c,l));break}}c=c.return}}function wx(l,c,w){var N=l.pingCache;N!==null&&N.delete(c),c=Jo(),l.pingedLanes|=l.suspendedLanes&w,Za===l&&(bo&w)===w&&(Ia===4||Ia===3&&(bo&130023424)===bo&&500>An()-fg?Bf(l,0):cg|=w),Ps(l,c)}function Hy(l,c){c===0&&((l.mode&1)===0?c=1:(c=Ki,Ki<<=1,(Ki&130023424)===0&&(Ki=4194304)));var w=Jo();l=Xr(l,c),l!==null&&(Nl(l,c,w),Ps(l,w))}function _x(l){var c=l.memoizedState,w=0;c!==null&&(w=c.retryLane),Hy(l,w)}function xx(l,c){var w=0;switch(l.tag){case 13:var N=l.stateNode,G=l.memoizedState;G!==null&&(w=G.retryLane);break;case 19:N=l.stateNode;break;default:throw Error(r(314))}N!==null&&N.delete(c),Hy(l,w)}var $y;$y=function(l,c,w){if(l!==null)if(l.memoizedProps!==c.pendingProps||va.current)ne=!0;else{if((l.lanes&w)===0&&(c.flags&128)===0)return ne=!1,ng(l,c,w);ne=(l.flags&131072)!==0}else ne=!1,ft&&(c.flags&1048576)!==0&&Qe(c,be,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;Hr(l,c),l=c.pendingProps;var G=Ul(c,Ui.current);Cn(c,w),G=_l(null,c,N,l,G,w);var Q=go();return c.flags|=1,typeof G=="object"&&G!==null&&typeof G.render=="function"&&G.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,ma(N)?(Q=!0,ws(c)):Q=!1,c.memoizedState=G.state!==null&&G.state!==void 0?G.state:null,Ri(c),G.updater=Gc,c.stateNode=G,G._reactInternals=c,Rh(c,N,l,w),c=mn(null,c,N,!0,Q,w)):(c.tag=0,ft&&Q&&lt(c),_e(null,c,G,w),c=c.child),c;case 16:N=c.elementType;e:{switch(Hr(l,c),l=c.pendingProps,G=N._init,N=G(N._payload),c.type=N,G=c.tag=Ex(N),l=Ma(N,l),G){case 0:c=Tt(null,c,N,l,w);break e;case 1:c=Fn(null,c,N,l,w);break e;case 11:c=Ye(null,c,N,l,w);break e;case 14:c=it(null,c,N,Ma(N.type,l),w);break e}throw Error(r(306,N,""))}return c;case 0:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Tt(l,c,N,G,w);case 1:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Fn(l,c,N,G,w);case 3:e:{if(mo(c),l===null)throw Error(r(387));N=c.pendingProps,Q=c.memoizedState,G=Q.element,ya(l,c),Hi(c,N,null,w);var he=c.memoizedState;if(N=he.element,Q.isDehydrated)if(Q={element:N,isDehydrated:!1,cache:he.cache,pendingSuspenseBoundaries:he.pendingSuspenseBoundaries,transitions:he.transitions},c.updateQueue.baseState=Q,c.memoizedState=Q,c.flags&256){G=nc(Error(r(423)),c),c=xl(l,c,N,w,G);break e}else if(N!==G){G=nc(Error(r(424)),c),c=xl(l,c,N,w,G);break e}else for(He=ea(c.stateNode.containerInfo.firstChild),ot=c,ft=!0,ht=null,w=Ur(c,null,N,w),c.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(Ft(),N===G){c=Ka(l,c,w);break e}_e(l,c,N,w)}c=c.child}return c;case 5:return _u(c),l===null&&zt(c),N=c.type,G=c.pendingProps,Q=l!==null?l.memoizedProps:null,he=G.children,Rf(N,G)?he=null:Q!==null&&Rf(N,Q)&&(c.flags|=32),br(l,c),_e(l,c,he,w),c.child;case 6:return l===null&&zt(c),null;case 13:return ut(l,c,w);case 4:return Ko(c,c.stateNode.containerInfo),N=c.pendingProps,l===null?c.child=fi(c,null,N,w):_e(l,c,N,w),c.child;case 11:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Ye(l,c,N,G,w);case 7:return _e(l,c,c.pendingProps,w),c.child;case 8:return _e(l,c,c.pendingProps.children,w),c.child;case 12:return _e(l,c,c.pendingProps.children,w),c.child;case 10:e:{if(N=c.type._context,G=c.pendingProps,Q=c.memoizedProps,he=G.value,sn(wi,N._currentValue),N._currentValue=he,Q!==null)if(Pn(Q.value,he)){if(Q.children===G.children&&!va.current){c=Ka(l,c,w);break e}}else for(Q=c.child,Q!==null&&(Q.return=c);Q!==null;){var Me=Q.dependencies;if(Me!==null){he=Q.child;for(var ze=Me.firstContext;ze!==null;){if(ze.context===N){if(Q.tag===1){ze=ti(-1,w&-w),ze.tag=2;var nt=Q.updateQueue;if(nt!==null){nt=nt.shared;var vt=nt.pending;vt===null?ze.next=ze:(ze.next=vt.next,vt.next=ze),nt.pending=ze}}Q.lanes|=w,ze=Q.alternate,ze!==null&&(ze.lanes|=w),Gr(Q.return,w,c),Me.lanes|=w;break}ze=ze.next}}else if(Q.tag===10)he=Q.type===c.type?null:Q.child;else if(Q.tag===18){if(he=Q.return,he===null)throw Error(r(341));he.lanes|=w,Me=he.alternate,Me!==null&&(Me.lanes|=w),Gr(he,w,c),he=Q.sibling}else he=Q.child;if(he!==null)he.return=Q;else for(he=Q;he!==null;){if(he===c){he=null;break}if(Q=he.sibling,Q!==null){Q.return=he.return,he=Q;break}he=he.return}Q=he}_e(l,c,G.children,w),c=c.child}return c;case 9:return G=c.type,N=c.pendingProps.children,Cn(c,w),G=Ln(G),N=N(G),c.flags|=1,_e(l,c,N,w),c.child;case 14:return N=c.type,G=Ma(N,c.pendingProps),G=Ma(N.type,G),it(l,c,N,G,w);case 15:return wt(l,c,c.type,c.pendingProps,w);case 17:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Hr(l,c),c.tag=1,ma(N)?(l=!0,ws(c)):l=!1,Cn(c,w),Hp(c,N,G),Rh(c,N,G,w),mn(null,c,N,!0,l,w);case 19:return ia(l,c,w);case 22:return $t(l,c,w)}throw Error(r(156,c.tag))};function Gy(l,c){return Ds(l,c)}function Sx(l,c,w,N){this.tag=l,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function El(l,c,w,N){return new Sx(l,c,w,N)}function bg(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Ex(l){if(typeof l=="function")return bg(l)?1:0;if(l!=null){if(l=l.$$typeof,l===T)return 11;if(l===J)return 14}return 2}function Qc(l,c){var w=l.alternate;return w===null?(w=El(l.tag,c,l.key,l.mode),w.elementType=l.elementType,w.type=l.type,w.stateNode=l.stateNode,w.alternate=l,l.alternate=w):(w.pendingProps=c,w.type=l.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=l.flags&14680064,w.childLanes=l.childLanes,w.lanes=l.lanes,w.child=l.child,w.memoizedProps=l.memoizedProps,w.memoizedState=l.memoizedState,w.updateQueue=l.updateQueue,c=l.dependencies,w.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},w.sibling=l.sibling,w.index=l.index,w.ref=l.ref,w}function t1(l,c,w,N,G,Q){var he=2;if(N=l,typeof l=="function")bg(l)&&(he=1);else if(typeof l=="string")he=5;else e:switch(l){case C:return qf(w.children,G,Q,c);case I:he=8,G|=8;break;case F:return l=El(12,w,c,G|2),l.elementType=F,l.lanes=Q,l;case $:return l=El(13,w,c,G),l.elementType=$,l.lanes=Q,l;case q:return l=El(19,w,c,G),l.elementType=q,l.lanes=Q,l;case ie:return r1(w,G,Q,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case j:he=10;break e;case O:he=9;break e;case T:he=11;break e;case J:he=14;break e;case ae:he=16,N=null;break e}throw Error(r(130,l==null?l:typeof l,""))}return c=El(he,w,c,G),c.elementType=l,c.type=N,c.lanes=Q,c}function qf(l,c,w,N){return l=El(7,l,N,c),l.lanes=w,l}function r1(l,c,w,N){return l=El(22,l,N,c),l.elementType=ie,l.lanes=w,l.stateNode={isHidden:!1},l}function wg(l,c,w){return l=El(6,l,null,c),l.lanes=w,l}function _g(l,c,w){return c=El(4,l.children!==null?l.children:[],l.key,c),c.lanes=w,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function Ax(l,c,w,N,G){this.tag=c,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=Oa(0),this.expirationTimes=Oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.identifierPrefix=N,this.onRecoverableError=G,this.mutableSourceEagerHydrationData=null}function xg(l,c,w,N,G,Q,he,Me,ze){return l=new Ax(l,c,w,Me,ze),c===1?(c=1,Q===!0&&(c|=8)):c=0,Q=El(3,null,null,c),l.current=Q,Q.stateNode=l,Q.memoizedState={element:N,isDehydrated:w,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ri(Q),l}function kx(l,c,w){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:N==null?null:""+N,children:l,containerInfo:c,implementation:w}}function Wy(l){if(!l)return bs;l=l._reactInternals;e:{if(si(l)!==l||l.tag!==1)throw Error(r(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(ma(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(r(171))}if(l.tag===1){var w=l.type;if(ma(w))return ec(l,w,c)}return c}function Vy(l,c,w,N,G,Q,he,Me,ze){return l=xg(w,N,!0,l,G,Q,he,Me,ze),l.context=Wy(null),w=l.current,N=Jo(),G=Kc(w),Q=ti(N,G),Q.callback=c??null,Hn(w,Q,G),l.current.lanes=G,Nl(l,G,N),Ps(l,N),l}function n1(l,c,w,N){var G=c.current,Q=Jo(),he=Kc(G);return w=Wy(w),c.context===null?c.context=w:c.pendingContext=w,c=ti(Q,he),c.payload={element:l},N=N===void 0?null:N,N!==null&&(c.callback=N),l=Hn(G,c,he),l!==null&&(Xl(l,G,he,Q),ba(l,G,he)),he}function i1(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 Yy(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var w=l.retryLane;l.retryLane=w!==0&&w<c?w:c}}function Sg(l,c){Yy(l,c),(l=l.alternate)&&Yy(l,c)}function Px(){return null}var Xy=typeof reportError=="function"?reportError:function(l){console.error(l)};function Eg(l){this._internalRoot=l}a1.prototype.render=Eg.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(r(409));n1(l,c,null,null)},a1.prototype.unmount=Eg.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;Ff(function(){n1(null,l,null,null)}),c[ra]=null}};function a1(l){this._internalRoot=l}a1.prototype.unstable_scheduleHydration=function(l){if(l){var c=Ac();l={blockedOn:null,target:l,priority:c};for(var w=0;w<So.length&&c!==0&&c<So[w].priority;w++);So.splice(w,0,l),w===0&&cu(l)}};function Ag(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function o1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function Ky(){}function Ox(l,c,w,N,G){if(G){if(typeof N=="function"){var Q=N;N=function(){var nt=i1(he);Q.call(nt)}}var he=Vy(c,N,l,0,null,!1,!1,"",Ky);return l._reactRootContainer=he,l[ra]=he.current,$s(l.nodeType===8?l.parentNode:l),Ff(),he}for(;G=l.lastChild;)l.removeChild(G);if(typeof N=="function"){var Me=N;N=function(){var nt=i1(ze);Me.call(nt)}}var ze=xg(l,0,!1,null,null,!1,!1,"",Ky);return l._reactRootContainer=ze,l[ra]=ze.current,$s(l.nodeType===8?l.parentNode:l),Ff(function(){n1(c,ze,w,N)}),ze}function s1(l,c,w,N,G){var Q=w._reactRootContainer;if(Q){var he=Q;if(typeof G=="function"){var Me=G;G=function(){var ze=i1(he);Me.call(ze)}}n1(c,he,l,G)}else he=Ox(w,c,l,G,N);return i1(he)}ls=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var w=Mn(c.pendingLanes);w!==0&&(uu(c,w|1),Ps(c,An()),(un&6)===0&&(Dh=An()+500,re()))}break;case 13:Ff(function(){var N=Xr(l,1);if(N!==null){var G=Jo();Xl(N,l,1,G)}}),Sg(l,1)}},ul=function(l){if(l.tag===13){var c=Xr(l,134217728);if(c!==null){var w=Jo();Xl(c,l,134217728,w)}Sg(l,134217728)}},Ec=function(l){if(l.tag===13){var c=Kc(l),w=Xr(l,c);if(w!==null){var N=Jo();Xl(w,l,c,N)}Sg(l,c)}},Ac=function(){return Rr},cl=function(l,c){var w=Rr;try{return Rr=l,c()}finally{Rr=w}},ir=function(l,c,w){switch(c){case"input":if(Be(l,w),c=w.name,w.type==="radio"&&c!=null){for(w=l;w.parentNode;)w=w.parentNode;for(w=w.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<w.length;c++){var N=w[c];if(N!==l&&N.form===l.form){var G=Ni(N);if(!G)throw Error(r(90));Ce(N),Be(N,G)}}}break;case"textarea":Pe(l,w);break;case"select":c=w.value,c!=null&&Ne(l,!!w.multiple,c,!1)}},oi=vg,Ei=Ff;var Cx={usingClientEntryPoint:!1,Events:[bu,yi,Ni,pr,Fi,vg]},Td={findFiberByHostInstance:Ws,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Lx={bundleType:Td.bundleType,version:Td.version,rendererPackageName:Td.rendererPackageName,rendererConfig:Td.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Bi(l),l===null?null:l.stateNode},findFiberByHostInstance:Td.findFiberByHostInstance||Px,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 l1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!l1.isDisabled&&l1.supportsFiber)try{_o=l1.inject(Lx),gi=l1}catch{}}return Os.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cx,Os.createPortal=function(l,c){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ag(c))throw Error(r(200));return kx(l,c,null,w)},Os.createRoot=function(l,c){if(!Ag(l))throw Error(r(299));var w=!1,N="",G=Xy;return c!=null&&(c.unstable_strictMode===!0&&(w=!0),c.identifierPrefix!==void 0&&(N=c.identifierPrefix),c.onRecoverableError!==void 0&&(G=c.onRecoverableError)),c=xg(l,1,!1,null,null,w,!1,N,G),l[ra]=c.current,$s(l.nodeType===8?l.parentNode:l),new Eg(c)},Os.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=Bi(c),l=l===null?null:l.stateNode,l},Os.flushSync=function(l){return Ff(l)},Os.hydrate=function(l,c,w){if(!o1(c))throw Error(r(200));return s1(null,l,c,!0,w)},Os.hydrateRoot=function(l,c,w){if(!Ag(l))throw Error(r(405));var N=w!=null&&w.hydratedSources||null,G=!1,Q="",he=Xy;if(w!=null&&(w.unstable_strictMode===!0&&(G=!0),w.identifierPrefix!==void 0&&(Q=w.identifierPrefix),w.onRecoverableError!==void 0&&(he=w.onRecoverableError)),c=Vy(c,null,l,1,w??null,G,!1,Q,he),l[ra]=c.current,$s(l),N)for(l=0;l<N.length;l++)w=N[l],G=w._getVersion,G=G(w._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[w,G]:c.mutableSourceEagerHydrationData.push(w,G);return new a1(c)},Os.render=function(l,c,w){if(!o1(c))throw Error(r(200));return s1(null,l,c,!1,w)},Os.unmountComponentAtNode=function(l){if(!o1(l))throw Error(r(40));return l._reactRootContainer?(Ff(function(){s1(null,null,l,!1,function(){l._reactRootContainer=null,l[ra]=null})}),!0):!1},Os.unstable_batchedUpdates=vg,Os.unstable_renderSubtreeIntoContainer=function(l,c,w,N){if(!o1(w))throw Error(r(200));if(l==null||l._reactInternals===void 0)throw Error(r(38));return s1(l,c,w,!1,N)},Os.version="18.3.1-next-f1338f8080-20240426",Os}var r5;function Gw(){if(r5)return Pg.exports;r5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Pg.exports=Ix(),Pg.exports}var n5;function jx(){if(n5)return u1;n5=1;var t=Gw();return u1.createRoot=t.createRoot,u1.hydrateRoot=t.hydrateRoot,u1}var Dx=jx();const Ww=ch(Dx);function jr(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var Fx={};function A0(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Fx}var Vw=Object.assign,r0=Object.getOwnPropertyDescriptor,Mu=Object.defineProperty,k0=Object.prototype,qv=[];Object.freeze(qv);var Rm={};Object.freeze(Rm);var Bx=typeof Proxy<"u",zx=Object.toString();function Yw(){Bx||jr("Proxy not available")}function Xw(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var Zh=function(){};function al(t){return typeof t=="function"}function ih(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function P0(t){return t!==null&&typeof t=="object"}function gf(t){if(!P0(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r.toString()===zx}function Kw(t){var e=t?.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function O0(t,e,r){Mu(t,e,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Zw(t,e,r){Mu(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}function _f(t,e){var r="isMobX"+t;return e.prototype[r]=!0,function(n){return P0(n)&&n[r]===!0}}function gd(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function qx(t){var e=Object.getPrototypeOf(t),r=Object.getPrototypeOf(e),n=Object.getPrototypeOf(r);return n===null}function fc(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var Qw=typeof Object.getOwnPropertySymbols<"u";function Ux(t){var e=Object.keys(t);if(!Qw)return e;var r=Object.getOwnPropertySymbols(t);return r.length?[].concat(e,r.filter(function(n){return k0.propertyIsEnumerable.call(t,n)})):e}var C0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Qw?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Jw(t){return t===null?null:typeof t=="object"?""+t:t}function pc(t,e){return k0.hasOwnProperty.call(t,e)}var Hx=Object.getOwnPropertyDescriptors||function(e){var r={};return C0(e).forEach(function(n){r[n]=r0(e,n)}),r};function Js(t,e){return!!(t&e)}function el(t,e,r){return r?t|=e:t&=~e,t}function i5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $x(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wx(n.key),n)}}function vd(t,e,r){return e&&$x(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qh(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Vx(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[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 vf(){return vf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},vf.apply(null,arguments)}function e6(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Uv(t,e)}function Uv(t,e){return Uv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Uv(t,e)}function Gx(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Wx(t){var e=Gx(t,"string");return typeof e=="symbol"?e:e+""}function Vx(t,e){if(t){if(typeof t=="string")return i5(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i5(t,e):void 0}}var Lu=Symbol("mobx-stored-annotations");function Iu(t){function e(r,n){if(Ap(n))return t.decorate_20223_(r,n);Ep(r,n,t)}return Object.assign(e,t)}function Ep(t,e,r){pc(t,Lu)||O0(t,Lu,vf({},t[Lu])),e9(r)||(t[Lu][e]=r)}function Yx(t){return pc(t,Lu)||O0(t,Lu,vf({},t[Lu])),t[Lu]}function Ap(t){return typeof t=="object"&&typeof t.kind=="string"}var gr=Symbol("mobx administration"),xf=function(){function t(r){r===void 0&&(r="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=gn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},e.reportObserved=function(){return m6(this)},e.reportChanged=function(){Ls(),y6(this),Ns()},e.toString=function(){return this.name_},vd(t,[{key:"isBeingObserved",get:function(){return Js(this.flags_,t.isBeingObservedMask_)},set:function(n){this.flags_=el(this.flags_,t.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Js(this.flags_,t.isPendingUnobservationMask_)},set:function(n){this.flags_=el(this.flags_,t.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Js(this.flags_,t.diffValueMask_)?1:0},set:function(n){this.flags_=el(this.flags_,t.diffValueMask_,n===1)}}])}();xf.isBeingObservedMask_=1;xf.isPendingUnobservationMask_=2;xf.diffValueMask_=4;var Mm=_f("Atom",xf);function n0(t,e,r){e===void 0&&(e=Zh),r===void 0&&(r=Zh);var n=new xf(t);return e!==Zh&&nS(n,e),r!==Zh&&k6(n,r),n}function Xx(t,e){return H6(t,e)}function Kx(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var sd={structural:Xx,default:Kx};function ah(t,e,r){return N6(t)?t:Array.isArray(t)?Kr.array(t,{name:r}):gf(t)?Kr.object(t,void 0,{name:r}):gd(t)?Kr.map(t,{name:r}):fc(t)?Kr.set(t,{name:r}):typeof t=="function"&&!cp(t)&&!fp(t)?Kw(t)?ld(t):up(r,t):t}function Zx(t,e,r){if(t==null||nu(t)||Uu(t)||Ll(t)||ts(t))return t;if(Array.isArray(t))return Kr.array(t,{name:r,deep:!1});if(gf(t))return Kr.object(t,void 0,{name:r,deep:!1});if(gd(t))return Kr.map(t,{name:r,deep:!1});if(fc(t))return Kr.set(t,{name:r,deep:!1})}function L0(t){return t}function Qx(t,e){return H6(t,e)?e:t}var Jx="override";function e9(t){return t.annotationType_===Jx}function kp(t,e){return{annotationType_:t,options_:e,make_:t9,extend_:r9,decorate_20223_:n9}}function t9(t,e,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(t,e,r,!1)===null?0:1;if(n===t.target_)return this.extend_(t,e,r,!1)===null?0:2;if(cp(r.value))return 1;var a=t6(t,this,e,r,!1);return Mu(n,e,a),2}function r9(t,e,r,n){var i=t6(t,this,e,r);return t.defineProperty_(e,i,n)}function n9(t,e){var r=e.kind,n=e.name,i=e.addInitializer,a=this,o=function(h){var f,v,g,p;return mf((f=(v=a.options_)==null?void 0:v.name)!=null?f:n.toString(),h,(g=(p=a.options_)==null?void 0:p.autoAction)!=null?g:!1)};if(r=="field")return function(u){var h,f=u;return cp(f)||(f=o(f)),(h=a.options_)!=null&&h.bound&&(f=f.bind(this),f.isMobxAction=!0),f};if(r=="method"){var s;return cp(t)||(t=o(t)),(s=this.options_)!=null&&s.bound&&i(function(){var u=this,h=u[n].bind(u);h.isMobxAction=!0,u[n]=h}),t}jr("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
+ '`+a.annotationType_+"' can only be used on properties with a function value."))}function i9(t,e,r,n){e.annotationType_,n.value}function t6(t,e,r,n,i){var a,o,s,u,h,f,v;i===void 0&&(i=Lt.safeDescriptors),i9(t,e,r,n);var g=n.value;if((a=e.options_)!=null&&a.bound){var p;g=g.bind((p=t.proxy_)!=null?p:t.target_)}return{value:mf((o=(s=e.options_)==null?void 0:s.name)!=null?o:r.toString(),g,(u=(h=e.options_)==null?void 0:h.autoAction)!=null?u:!1,(f=e.options_)!=null&&f.bound?(v=t.proxy_)!=null?v:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function r6(t,e){return{annotationType_:t,options_:e,make_:a9,extend_:o9,decorate_20223_:s9}}function a9(t,e,r,n){var i;if(n===t.target_)return this.extend_(t,e,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!pc(t.target_,e)||!fp(t.target_[e]))&&this.extend_(t,e,r,!1)===null)return 0;if(fp(r.value))return 1;var a=n6(t,this,e,r,!1,!1);return Mu(n,e,a),2}function o9(t,e,r,n){var i,a=n6(t,this,e,r,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,a,n)}function s9(t,e){var r,n=e.name,i=e.addInitializer;return fp(t)||(t=ld(t)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),t}function l9(t,e,r,n){e.annotationType_,n.value}function n6(t,e,r,n,i,a){a===void 0&&(a=Lt.safeDescriptors),l9(t,e,r,n);var o=n.value;if(fp(o)||(o=ld(o)),i){var s;o=o.bind((s=t.proxy_)!=null?s:t.target_),o.isMobXFlow=!0}return{value:o,configurable:a?t.isPlainObject_:!0,enumerable:!1,writable:!a}}function Im(t,e){return{annotationType_:t,options_:e,make_:u9,extend_:c9,decorate_20223_:f9}}function u9(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function c9(t,e,r,n){return h9(t,this,e,r),t.defineComputedProperty_(e,vf({},this.options_,{get:r.get,set:r.set}),n)}function f9(t,e){var r=this,n=e.name,i=e.addInitializer;return i(function(){var a=md(this)[gr],o=vf({},r.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new eu(o))}),function(){return this[gr].getObservablePropValue_(n)}}function h9(t,e,r,n){e.annotationType_,n.get}function N0(t,e){return{annotationType_:t,options_:e,make_:d9,extend_:p9,decorate_20223_:g9}}function d9(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function p9(t,e,r,n){var i,a;return v9(t,this),t.defineObservableProperty_(e,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:ah,n)}function g9(t,e){var r=this,n=e.kind,i=e.name,a=new WeakSet;function o(s,u){var h,f,v=md(s)[gr],g=new pf(u,(h=(f=r.options_)==null?void 0:f.enhancer)!=null?h:ah,"ObservableObject."+i.toString(),!1);v.values_.set(i,g),a.add(s)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,t.get.call(this)),this[gr].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[gr].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function v9(t,e,r,n){e.annotationType_}var m9="true",y9=i6();function i6(t){return{annotationType_:m9,options_:t,make_:b9,extend_:w9,decorate_20223_:_9}}function b9(t,e,r,n){var i,a;if(r.get)return fh.make_(t,e,r,n);if(r.set){var o=mf(e.toString(),r.set);return n===t.target_?t.defineProperty_(e,{configurable:Lt.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(Mu(n,e,{configurable:!0,set:o}),2)}if(n!==t.target_&&typeof r.value=="function"){var s;if(Kw(r.value)){var u,h=(u=this.options_)!=null&&u.autoBind?ld.bound:ld;return h.make_(t,e,r,n)}var f=(s=this.options_)!=null&&s.autoBind?up.bound:up;return f.make_(t,e,r,n)}var v=((i=this.options_)==null?void 0:i.deep)===!1?Kr.ref:Kr;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var g;r.value=r.value.bind((g=t.proxy_)!=null?g:t.target_)}return v.make_(t,e,r,n)}function w9(t,e,r,n){var i,a;if(r.get)return fh.extend_(t,e,r,n);if(r.set)return t.defineProperty_(e,{configurable:Lt.safeDescriptors?t.isPlainObject_:!0,set:mf(e.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=t.proxy_)!=null?o:t.target_)}var s=((a=this.options_)==null?void 0:a.deep)===!1?Kr.ref:Kr;return s.extend_(t,e,r,n)}function _9(t,e){jr("'"+this.annotationType_+"' cannot be used as a decorator")}var x9="observable",S9="observable.ref",E9="observable.shallow",A9="observable.struct",a6={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(a6);function c1(t){return t||a6}var Hv=N0(x9),k9=N0(S9,{enhancer:L0}),P9=N0(E9,{enhancer:Zx}),O9=N0(A9,{enhancer:Qx}),o6=Iu(Hv);function f1(t){return t.deep===!0?ah:t.deep===!1?L0:L9(t.defaultDecorator)}function C9(t){var e;return t?(e=t.defaultDecorator)!=null?e:i6(t):void 0}function L9(t){var e,r;return t&&(e=(r=t.options_)==null?void 0:r.enhancer)!=null?e:ah}function s6(t,e,r){if(Ap(e))return Hv.decorate_20223_(t,e);if(ih(e)){Ep(t,e,Hv);return}return N6(t)?t:gf(t)?Kr.object(t,e,r):Array.isArray(t)?Kr.array(t,e):gd(t)?Kr.map(t,e):fc(t)?Kr.set(t,e):typeof t=="object"&&t!==null?t:Kr.box(t,e)}Vw(s6,o6);var N9={box:function(e,r){var n=c1(r);return new pf(e,f1(n),n.name,!0,n.equals)},array:function(e,r){var n=c1(r);return(Lt.useProxies===!1||n.proxy===!1?RS:SS)(e,f1(n),n.name)},map:function(e,r){var n=c1(r);return new zm(e,f1(n),n.name)},set:function(e,r){var n=c1(r);return new F6(e,f1(n),n.name)},object:function(e,r,n){return dh(function(){return sS(Lt.useProxies===!1||n?.proxy===!1?md({},n):wS({},n),e,r)})},ref:Iu(k9),shallow:Iu(P9),deep:o6,struct:Iu(O9)},Kr=Vw(s6,N9),l6="computed",T9="computed.struct",$v=Im(l6),R9=Im(T9,{equals:sd.structural}),fh=function(e,r){if(Ap(r))return $v.decorate_20223_(e,r);if(ih(r))return Ep(e,r,$v);if(gf(e))return Iu(Im(l6,e));var n=gf(r)?r:{};return n.get=e,n.name||(n.name=e.name||""),new eu(n)};Object.assign(fh,$v);fh.struct=Iu(R9);var a5,o5,i0=0,M9=1,I9=(a5=(o5=r0(function(){},"name"))==null?void 0:o5.configurable)!=null?a5:!1,s5={value:"action",configurable:!0,writable:!1,enumerable:!1};function mf(t,e,r,n){r===void 0&&(r=!1);function i(){return u6(t,r,e,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},I9&&(s5.value=t,Mu(i,"name",s5)),i}function u6(t,e,r,n,i){var a=j9(t,e);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{D9(a)}}function j9(t,e,r,n){var i=!1,a=0,o=Lt.trackingDerivation,s=!e||!o;Ls();var u=Lt.allowStateChanges;s&&(hh(),u=T0(!0));var h=jm(!0),f={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:h,notifySpy_:i,startTime_:a,actionId_:M9++,parentActionId_:i0};return i0=f.actionId_,f}function D9(t){i0!==t.actionId_&&jr(30),i0=t.parentActionId_,t.error_!==void 0&&(Lt.suppressReactionErrors=!0),R0(t.prevAllowStateChanges_),Kd(t.prevAllowStateReads_),Ns(),t.runAsAction_&&gc(t.prevDerivation_),Lt.suppressReactionErrors=!1}function c6(t,e){var r=T0(t);try{return e()}finally{R0(r)}}function T0(t){var e=Lt.allowStateChanges;return Lt.allowStateChanges=t,e}function R0(t){Lt.allowStateChanges=t}var pf=function(t){function e(n,i,a,o,s){var u;return a===void 0&&(a="ObservableValue"),s===void 0&&(s=sd.default),u=t.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=s,u.value_=i(n,void 0,a),u}e6(e,t);var r=e.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Lt.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Al(this)){var a=kl(this,{object:this,type:ju,newValue:i});if(!a)return Lt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Lt.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Ql(this)&&Jl(this,{type:ju,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Pp(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:ju,newValue:this.value_,oldValue:void 0}),Op(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Jw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},e}(xf),F9=_f("ObservableValue",pf),eu=function(){function t(r){this.dependenciesState_=gn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=gn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new o0(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=a0.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||jr(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=mf("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?sd.structural:sd.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){$9(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},e.get=function(){if(this.isComputing&&jr(32,this.name_,this.derivation),Lt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Gv(this)&&(this.warnAboutUntrackedRead_(),Ls(),this.value_=this.computeValue_(!1),Ns());else if(m6(this),Gv(this)){var n=Lt.trackingContext;this.keepAlive_&&!n&&(Lt.trackingContext=this),this.trackAndCompute()&&H9(this),Lt.trackingContext=n}var i=this.value_;if(B1(i))throw i.cause;return i},e.set=function(n){if(this.setter_){this.isRunningSetter&&jr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else jr(34,this.name_)},e.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===gn.NOT_TRACKING_,a=this.computeValue_(!0),o=i||B1(n)||B1(a)||!this.equals_(n,a);return o&&(this.value_=a),o},e.computeValue_=function(n){this.isComputing=!0;var i=T0(!1),a;if(n)a=f6(this,this.derivation,this.scope_);else if(Lt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new o0(o)}return R0(i),this.isComputing=!1,a},e.suspend_=function(){this.keepAlive_||(Wv(this),this.value_=void 0)},e.observe_=function(n,i){var a=this,o=!0,s=void 0;return Bu(function(){var u=a.get();if(!o||i){var h=hh();n({observableKind:"computed",debugObjectName:a.name_,type:ju,object:a,newValue:u,oldValue:s}),gc(h)}o=!1,s=u})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return Jw(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},vd(t,[{key:"isComputing",get:function(){return Js(this.flags_,t.isComputingMask_)},set:function(n){this.flags_=el(this.flags_,t.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Js(this.flags_,t.isRunningSetterMask_)},set:function(n){this.flags_=el(this.flags_,t.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Js(this.flags_,t.isBeingObservedMask_)},set:function(n){this.flags_=el(this.flags_,t.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Js(this.flags_,t.isPendingUnobservationMask_)},set:function(n){this.flags_=el(this.flags_,t.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Js(this.flags_,t.diffValueMask_)?1:0},set:function(n){this.flags_=el(this.flags_,t.diffValueMask_,n===1)}}])}();eu.isComputingMask_=1;eu.isRunningSetterMask_=2;eu.isBeingObservedMask_=4;eu.isPendingUnobservationMask_=8;eu.diffValueMask_=16;var M0=_f("ComputedValue",eu),gn;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(gn||(gn={}));var a0;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(a0||(a0={}));var o0=function(e){this.cause=void 0,this.cause=e};function B1(t){return t instanceof o0}function Gv(t){switch(t.dependenciesState_){case gn.UP_TO_DATE_:return!1;case gn.NOT_TRACKING_:case gn.STALE_:return!0;case gn.POSSIBLY_STALE_:{for(var e=jm(!0),r=hh(),n=t.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(M0(o)){if(Lt.disableErrorBoundaries)o.get();else try{o.get()}catch{return gc(r),Kd(e),!0}if(t.dependenciesState_===gn.STALE_)return gc(r),Kd(e),!0}}return d6(t),gc(r),Kd(e),!1}}}function f6(t,e,r){var n=jm(!0);d6(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++Lt.runId;var i=Lt.trackingDerivation;Lt.trackingDerivation=t,Lt.inBatch++;var a;if(Lt.disableErrorBoundaries===!0)a=e.call(r);else try{a=e.call(r)}catch(o){a=new o0(o)}return Lt.inBatch--,Lt.trackingDerivation=i,B9(t),Kd(n),a}function B9(t){for(var e=t.observing_,r=t.observing_=t.newObserving_,n=gn.UP_TO_DATE_,i=0,a=t.unboundDepsCount_,o=0;o<a;o++){var s=r[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(r[i]=s),i++),s.dependenciesState_>n&&(n=s.dependenciesState_)}for(r.length=i,t.newObserving_=null,a=e.length;a--;){var u=e[a];u.diffValue===0&&g6(u,t),u.diffValue=0}for(;i--;){var h=r[i];h.diffValue===1&&(h.diffValue=0,U9(h,t))}n!==gn.UP_TO_DATE_&&(t.dependenciesState_=n,t.onBecomeStale_())}function Wv(t){var e=t.observing_;t.observing_=[];for(var r=e.length;r--;)g6(e[r],t);t.dependenciesState_=gn.NOT_TRACKING_}function h6(t){var e=hh();try{return t()}finally{gc(e)}}function hh(){var t=Lt.trackingDerivation;return Lt.trackingDerivation=null,t}function gc(t){Lt.trackingDerivation=t}function jm(t){var e=Lt.allowStateReads;return Lt.allowStateReads=t,e}function Kd(t){Lt.allowStateReads=t}function d6(t){if(t.dependenciesState_!==gn.UP_TO_DATE_){t.dependenciesState_=gn.UP_TO_DATE_;for(var e=t.observing_,r=e.length;r--;)e[r].lowestObserverState_=gn.UP_TO_DATE_}}var z1=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},q1=!0,p6=!1,Lt=function(){var t=A0();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(q1=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new z1().version&&(q1=!1),q1?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new z1):(setTimeout(function(){p6||jr(35)},1),new z1)}();function z9(){if((Lt.pendingReactions.length||Lt.inBatch||Lt.isRunningReactions)&&jr(36),p6=!0,q1){var t=A0();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),Lt=new z1}}function q9(){return Lt}function U9(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function g6(t,e){t.observers_.delete(e),t.observers_.size===0&&v6(t)}function v6(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,Lt.pendingUnobservations.push(t))}function Ls(){Lt.inBatch++}function Ns(){if(--Lt.inBatch===0){b6();for(var t=Lt.pendingUnobservations,e=0;e<t.length;e++){var r=t[e];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof eu&&r.suspend_())}Lt.pendingUnobservations=[]}}function m6(t){var e=Lt.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&Lt.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&Lt.inBatch>0&&v6(t),!1)}function y6(t){t.lowestObserverState_!==gn.STALE_&&(t.lowestObserverState_=gn.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gn.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=gn.STALE_}))}function H9(t){t.lowestObserverState_!==gn.STALE_&&(t.lowestObserverState_=gn.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gn.POSSIBLY_STALE_?e.dependenciesState_=gn.STALE_:e.dependenciesState_===gn.UP_TO_DATE_&&(t.lowestObserverState_=gn.UP_TO_DATE_)}))}function $9(t){t.lowestObserverState_===gn.UP_TO_DATE_&&(t.lowestObserverState_=gn.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gn.UP_TO_DATE_&&(e.dependenciesState_=gn.POSSIBLY_STALE_,e.onBecomeStale_())}))}var Fu=function(){function t(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=gn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=a0.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Lt.pendingReactions.push(this),b6())},e.runReaction_=function(){if(!this.isDisposed){Ls(),this.isScheduled=!1;var n=Lt.trackingContext;if(Lt.trackingContext=this,Gv(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Lt.trackingContext=n,Ns()}},e.track=function(n){if(!this.isDisposed){Ls(),this.isRunning=!0;var i=Lt.trackingContext;Lt.trackingContext=this;var a=f6(this,n,void 0);Lt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Wv(this),B1(a)&&this.reportExceptionInDerivation_(a.cause),Ns()}},e.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Lt.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Lt.suppressReactionErrors||console.error(a,n),Lt.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Ls(),Wv(this),Ns()))},e.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[gr]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(n){},vd(t,[{key:"isDisposed",get:function(){return Js(this.flags_,t.isDisposedMask_)},set:function(n){this.flags_=el(this.flags_,t.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Js(this.flags_,t.isScheduledMask_)},set:function(n){this.flags_=el(this.flags_,t.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Js(this.flags_,t.isTrackPendingMask_)},set:function(n){this.flags_=el(this.flags_,t.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Js(this.flags_,t.isRunningMask_)},set:function(n){this.flags_=el(this.flags_,t.isRunningMask_,n)}},{key:"diffValue",get:function(){return Js(this.flags_,t.diffValueMask_)?1:0},set:function(n){this.flags_=el(this.flags_,t.diffValueMask_,n===1)}}])}();Fu.isDisposedMask_=1;Fu.isScheduledMask_=2;Fu.isTrackPendingMask_=4;Fu.isRunningMask_=8;Fu.diffValueMask_=16;var G9=100,Vv=function(e){return e()};function b6(){Lt.inBatch>0||Lt.isRunningReactions||Vv(W9)}function W9(){Lt.isRunningReactions=!0;for(var t=Lt.pendingReactions,e=0;t.length>0;){++e===G9&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var r=t.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Lt.isRunningReactions=!1}var s0=_f("Reaction",Fu);function V9(t){var e=Vv;Vv=function(n){return t(function(){return e(n)})}}function Zd(){return!1}function Y9(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var w6="action",X9="action.bound",_6="autoAction",K9="autoAction.bound",x6="<unnamed action>",Yv=kp(w6),Z9=kp(X9,{bound:!0}),Xv=kp(_6,{autoAction:!0}),Q9=kp(K9,{autoAction:!0,bound:!0});function S6(t){var e=function(n,i){if(al(n))return mf(n.name||x6,n,t);if(al(i))return mf(n,i,t);if(Ap(i))return(t?Xv:Yv).decorate_20223_(n,i);if(ih(i))return Ep(n,i,t?Xv:Yv);if(ih(n))return Iu(kp(t?_6:w6,{name:n,autoAction:t}))};return e}var Zr=S6(!1);Object.assign(Zr,Yv);var up=S6(!0);Object.assign(up,Xv);Zr.bound=Iu(Z9);up.bound=Iu(Q9);function hc(t){return u6(t.name||x6,!1,t,this,void 0)}function cp(t){return al(t)&&t.isMobxAction===!0}function Bu(t,e){var r,n,i,a;e===void 0&&(e=Rm);var o=(r=(n=e)==null?void 0:n.name)!=null?r:"Autorun",s=!e.scheduler&&!e.delay,u;if(s)u=new Fu(o,function(){this.track(v)},e.onError,e.requiresObservable);else{var h=E6(e),f=!1;u=new Fu(o,function(){f||(f=!0,h(function(){f=!1,u.isDisposed||u.track(v)}))},e.onError,e.requiresObservable)}function v(){t(u)}return(i=e)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=e)==null?void 0:a.signal)}var J9=function(e){return e()};function E6(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:J9}function A6(t,e,r){var n,i,a;r===void 0&&(r=Rm);var o=(n=r.name)!=null?n:"Reaction",s=Zr(o,r.onError?eS(r.onError,e):e),u=!r.scheduler&&!r.delay,h=E6(r),f=!0,v=!1,g,p=r.compareStructural?sd.structural:r.equals||sd.default,y=new Fu(o,function(){f||u?_():v||(v=!0,h(_))},r.onError,r.requiresObservable);function _(){if(v=!1,!y.isDisposed){var x=!1,b=g;y.track(function(){var E=c6(!1,function(){return t(y)});x=f||!p(g,E),g=E}),(f&&r.fireImmediately||!f&&x)&&s(g,b,y),f=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||y.schedule_(),y.getDisposer_((a=r)==null?void 0:a.signal)}function eS(t,e){return function(){try{return e.apply(this,arguments)}catch(r){t.call(this,r)}}}var tS="onBO",rS="onBUO";function nS(t,e,r){return P6(tS,t,e,r)}function k6(t,e,r){return P6(rS,t,e,r)}function P6(t,e,r,n){var i=ud(e),a=al(n)?n:r,o=t+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var s=i[o];s&&(s.delete(a),s.size===0&&delete i[o])}}var iS="never",h1="always",aS="observed";function oS(t){t.isolateGlobalState===!0&&z9();var e=t.useProxies,r=t.enforceActions;if(e!==void 0&&(Lt.useProxies=e===h1?!0:e===iS?!1:typeof Proxy<"u"),e==="ifavailable"&&(Lt.verifyProxies=!0),r!==void 0){var n=r===h1?h1:r===aS;Lt.enforceActions=n,Lt.allowStateChanges=!(n===!0||n===h1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in t&&(Lt[i]=!!t[i])}),Lt.allowStateReads=!Lt.observableRequiresReaction,t.reactionScheduler&&V9(t.reactionScheduler)}function sS(t,e,r,n){var i=Hx(e);return dh(function(){var a=md(t,n)[gr];C0(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),t}function lS(t,e){return O6(ud(t,e))}function O6(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=uS(t.observing_).map(O6)),e}function uS(t){return Array.from(new Set(t))}var cS=0;function C6(){this.message="FLOW_CANCELLED"}C6.prototype=Object.create(Error.prototype);var Lg=r6("flow"),fS=r6("flow.bound",{bound:!0}),ld=Object.assign(function(e,r){if(Ap(r))return Lg.decorate_20223_(e,r);if(ih(r))return Ep(e,r,Lg);var n=e,i=n.name||"<unnamed flow>",a=function(){var s=this,u=arguments,h=++cS,f=Zr(i+" - runid: "+h+" - init",n).apply(s,u),v,g=void 0,p=new Promise(function(y,_){var x=0;v=_;function b(S){g=void 0;var A;try{A=Zr(i+" - runid: "+h+" - yield "+x++,f.next).call(f,S)}catch(M){return _(M)}k(A)}function E(S){g=void 0;var A;try{A=Zr(i+" - runid: "+h+" - yield "+x++,f.throw).call(f,S)}catch(M){return _(M)}k(A)}function k(S){if(al(S?.then)){S.then(k,_);return}return S.done?y(S.value):(g=Promise.resolve(S.value),g.then(b,E))}b(void 0)});return p.cancel=Zr(i+" - runid: "+h+" - cancel",function(){try{g&&l5(g);var y=f.return(void 0),_=Promise.resolve(y.value);_.then(Zh,Zh),l5(_),v(new C6)}catch(x){v(x)}}),p};return a.isMobXFlow=!0,a},Lg);ld.bound=Iu(fS);function l5(t){al(t.cancel)&&t.cancel()}function fp(t){return t?.isMobXFlow===!0}function L6(t,e,r){var n;return Ll(t)||Uu(t)||F9(t)?n=zu(t):nu(t)&&(n=zu(t,e)),n.dehancer=typeof e=="function"?e:r,function(){n.dehancer=void 0}}function Dm(t,e,r){return al(r)?dS(t,e,r):hS(t,e)}function hS(t,e){return zu(t).intercept_(e)}function dS(t,e,r){return zu(t,e).intercept_(r)}function pS(t,e){return t?nu(t)||!!t[gr]||Mm(t)||s0(t)||M0(t):!1}function N6(t){return pS(t)}function l0(t){if(nu(t))return t[gr].keys_();if(Ll(t)||ts(t))return Array.from(t.keys());if(Uu(t))return t.map(function(e,r){return r});jr(5)}function T6(t){if(nu(t))return l0(t).map(function(e){return t[e]});if(Ll(t))return l0(t).map(function(e){return t.get(e)});if(ts(t))return Array.from(t.values());if(Uu(t))return t.slice();jr(6)}function gS(t){if(nu(t))return l0(t).map(function(e){return[e,t[e]]});if(Ll(t))return l0(t).map(function(e){return[e,t.get(e)]});if(ts(t))return Array.from(t.entries());if(Uu(t))return t.map(function(e,r){return[r,e]});jr(7)}function R6(t,e,r){if(arguments.length===2&&!ts(t)){Ls();var n=e;try{for(var i in n)R6(t,i,n[i])}finally{Ns()}return}nu(t)?t[gr].set_(e,r):Ll(t)?t.set(e,r):ts(t)?t.add(e):Uu(t)?(typeof e!="number"&&(e=parseInt(e,10)),e<0&&jr("Invalid index: '"+e+"'"),Ls(),e>=t.length&&(t.length=e+1),t[e]=r,Ns()):jr(8)}function M6(t,e,r){if(nu(t))return t[gr].defineProperty_(e,r);jr(39)}function Fm(t,e,r,n){return al(r)?mS(t,e,r,n):vS(t,e,r)}function vS(t,e,r){return zu(t).observe_(e,r)}function mS(t,e,r,n){return zu(t,e).observe_(r,n)}function dc(t,e){e===void 0&&(e=void 0),Ls();try{return t.apply(e)}finally{Ns()}}function u5(t,e,r){return arguments.length===1||e&&typeof e=="object"?yS(t,e):I6(t,e,{})}function I6(t,e,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[gr].isDisposed)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=mf("When-effect",e),o=Bu(function(s){var u=c6(!1,t);u&&(s.dispose(),n&&clearTimeout(n),a())},r);return o}function yS(t,e){var r;if(e!=null&&(r=e.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,s){var u,h=I6(t,o,vf({},e,{onError:s}));n=function(){h(),s(new Error("WHEN_CANCELLED"))},i=function(){h(),s(new Error("WHEN_ABORTED"))},e==null||(u=e.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function Bh(t){return t[gr]}var bS={has:function(e,r){return Bh(e).has_(r)},get:function(e,r){return Bh(e).get_(r)},set:function(e,r,n){var i;return ih(r)?(i=Bh(e).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(e,r){var n;return ih(r)?(n=Bh(e).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(e,r,n){var i;return(i=Bh(e).defineProperty_(r,n))!=null?i:!0},ownKeys:function(e){return Bh(e).ownKeys_()},preventExtensions:function(e){jr(13)}};function wS(t,e){var r,n;return Yw(),t=md(t,e),(n=(r=t[gr]).proxy_)!=null?n:r.proxy_=new Proxy(t,bS)}function Al(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function Pp(t,e){var r=t.interceptors_||(t.interceptors_=[]);return r.push(e),Xw(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function kl(t,e){var r=hh();try{for(var n=[].concat(t.interceptors_||[]),i=0,a=n.length;i<a&&(e=n[i](e),e&&!e.type&&jr(14),!!e);i++);return e}finally{gc(r)}}function Ql(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function Op(t,e){var r=t.changeListeners_||(t.changeListeners_=[]);return r.push(e),Xw(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function Jl(t,e){var r=hh(),n=t.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](e);gc(r)}}function j6(t,e,r){return dh(function(){var n,i=md(t,r)[gr];(n=e)!=null||(e=Yx(t)),C0(e).forEach(function(a){return i.make_(a,e[a])})}),t}var c5="splice",ju="update",_S=1e4,xS={get:function(e,r){var n=e[gr];return r===gr?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):pc(u0,r)?u0[r]:e[r]},set:function(e,r,n){var i=e[gr];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?e[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){jr(15)}},Bm=function(){function t(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new xf(r),this.enhancer_=function(o,s){return n(o,s,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},e.intercept_=function(n){return Pp(this,n)},e.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Op(this,n)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&jr("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},e.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&jr(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&U6(n+i+1)},e.spliceWithArray_=function(n,i,a){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?i=s-n:i==null?i=0:i=Math.max(0,Math.min(i,s-n)),a===void 0&&(a=qv),Al(this)){var u=kl(this,{object:this.proxy_,type:c5,index:n,removedCount:i,added:a});if(!u)return qv;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(v){return o.enhancer_(v,void 0)}),this.legacyMode_){var h=a.length-i;this.updateArrayLength_(s,h)}var f=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,f),this.dehanceValues_(f)},e.spliceItemsIntoValues_=function(n,i,a){if(a.length<_S){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var s=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var h=0;h<a.length;h++)this.values_[n+h]=a[h];for(var f=0;f<u.length;f++)this.values_[n+a.length+f]=u[f];return s}},e.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Zd(),s=Ql(this),u=s||o?{observableKind:"array",object:this.proxy_,type:ju,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),s&&Jl(this,u)},e.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Zd(),s=Ql(this),u=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:c5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),s&&Jl(this,u)},e.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])},e.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&jr(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Al(this)){var s=kl(this,{type:ju,object:this.proxy_,index:n,newValue:i});if(!s)return;i=s.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var h=new Array(n+1-a.length),f=0;f<h.length-1;f++)h[f]=void 0;h[h.length-1]=i,this.spliceWithArray_(a.length,0,h)}},t}();function SS(t,e,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Yw(),dh(function(){var i=new Bm(r,e,n,!1);Zw(i.values_,gr,i);var a=new Proxy(i.values_,xS);return i.proxy_=a,t&&t.length&&i.spliceWithArray_(0,0,t),a})}var u0={clear:function(){return this.splice(0)},replace:function(e){var r=this[gr];return r.spliceWithArray_(0,r.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[gr];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,r)}return o.spliceWithArray_(e,r,i)},spliceWithArray:function(e,r,n){return this[gr].spliceWithArray_(e,r,n)},push:function(){for(var e=this[gr],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,n),e.values_.length},pop:function(){return this.splice(Math.max(this[gr].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[gr],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.spliceWithArray_(0,0,n),e.values_.length},reverse:function(){return Lt.trackingDerivation&&jr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Lt.trackingDerivation&&jr(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var r=this[gr],n=r.dehanceValues_(r.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}};ii("at",ol);ii("concat",ol);ii("flat",ol);ii("includes",ol);ii("indexOf",ol);ii("join",ol);ii("lastIndexOf",ol);ii("slice",ol);ii("toString",ol);ii("toLocaleString",ol);ii("toSorted",ol);ii("toSpliced",ol);ii("with",ol);ii("every",ru);ii("filter",ru);ii("find",ru);ii("findIndex",ru);ii("findLast",ru);ii("findLastIndex",ru);ii("flatMap",ru);ii("forEach",ru);ii("map",ru);ii("some",ru);ii("toReversed",ru);ii("reduce",D6);ii("reduceRight",D6);function ii(t,e){typeof Array.prototype[t]=="function"&&(u0[t]=e(t))}function ol(t){return function(){var e=this[gr];e.atom_.reportObserved();var r=e.dehanceValues_(e.values_);return r[t].apply(r,arguments)}}function ru(t){return function(e,r){var n=this,i=this[gr];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[t](function(o,s){return e.call(r,o,s,n)})}}function D6(t){return function(){var e=this,r=this[gr];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,s){return i(a,o,s,e)},n[t].apply(n,arguments)}}var ES=_f("ObservableArrayAdministration",Bm);function Uu(t){return P0(t)&&ES(t[gr])}var AS={},cf="add",c0="delete",zm=function(){function t(r,n,i){var a=this;n===void 0&&(n=ah),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[gr]=AS,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,al(Map)||jr(18),dh(function(){a.keysAtom_=n0("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var e=t.prototype;return e.has_=function(n){return this.data_.has(n)},e.has=function(n){var i=this;if(!Lt.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new pf(this.has_(n),L0,"ObservableMap.key?",!1);this.hasMap_.set(n,o),k6(o,function(){return i.hasMap_.delete(n)})}return a.get()},e.set=function(n,i){var a=this.has_(n);if(Al(this)){var o=kl(this,{type:a?ju:cf,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},e.delete=function(n){var i=this;if(this.keysAtom_,Al(this)){var a=kl(this,{type:c0,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Zd(),s=Ql(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:c0,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return dc(function(){var h;i.keysAtom_.reportChanged(),(h=i.hasMap_.get(n))==null||h.setNewValue_(!1);var f=i.data_.get(n);f.setNewValue_(void 0),i.data_.delete(n)}),s&&Jl(this,u),!0}return!1},e.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var o=Zd(),s=Ql(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:ju,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),s&&Jl(this,u)}},e.addValue_=function(n,i){var a=this;this.keysAtom_,dc(function(){var h,f=new pf(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,f),i=f.value_,(h=a.hasMap_.get(n))==null||h.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Zd(),s=Ql(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:cf,object:this,name:n,newValue:i}:null;s&&Jl(this,u)},e.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var n=this,i=this.keys();return f5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:n.get(u)}}})},e.entries=function(){var n=this,i=this.keys();return f5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:[u,n.get(u)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(n,i){for(var a=Qh(this),o;!(o=a()).done;){var s=o.value,u=s[0],h=s[1];n.call(i,h,u,this)}},e.merge=function(n){var i=this;return Ll(n)&&(n=new Map(n)),dc(function(){gf(n)?Ux(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var o=a[0],s=a[1];return i.set(o,s)}):gd(n)?(qx(n)||jr(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&jr(20,n)}),this},e.clear=function(){var n=this;dc(function(){h6(function(){for(var i=Qh(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.replace=function(n){var i=this;return dc(function(){for(var a=kS(n),o=new Map,s=!1,u=Qh(i.data_.keys()),h;!(h=u()).done;){var f=h.value;if(!a.has(f)){var v=i.delete(f);if(v)s=!0;else{var g=i.data_.get(f);o.set(f,g)}}}for(var p=Qh(a.entries()),y;!(y=p()).done;){var _=y.value,x=_[0],b=_[1],E=i.data_.has(x);if(i.set(x,b),i.data_.has(x)){var k=i.data_.get(x);o.set(x,k),E||(s=!0)}}if(!s)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var S=i.data_.keys(),A=o.keys(),M=S.next(),C=A.next();!M.done;){if(M.value!==C.value){i.keysAtom_.reportChanged();break}M=S.next(),C=A.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(n,i){return Op(this,n)},e.intercept_=function(n){return Pp(this,n)},vd(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Ll=_f("ObservableMap",zm);function f5(t){return t[Symbol.toStringTag]="MapIterator",Um(t)}function kS(t){if(gd(t)||Ll(t))return t;if(Array.isArray(t))return new Map(t);if(gf(t)){var e=new Map;for(var r in t)e.set(r,t[r]);return e}else return jr(21,t)}var PS={},F6=function(){function t(r,n,i){var a=this;n===void 0&&(n=ah),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[gr]=PS,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,al(Set)||jr(22),this.enhancer_=function(o,s){return n(o,s,i)},dh(function(){a.atom_=n0(a.name_),r&&a.replace(r)})}var e=t.prototype;return e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.clear=function(){var n=this;dc(function(){h6(function(){for(var i=Qh(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.forEach=function(n,i){for(var a=Qh(this),o;!(o=a()).done;){var s=o.value;n.call(i,s,s,this)}},e.add=function(n){var i=this;if(this.atom_,Al(this)){var a=kl(this,{type:cf,object:this,newValue:n});if(!a)return this;n=a.newValue}if(!this.has(n)){dc(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,s=Ql(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:cf,object:this,newValue:n}:null;s&&Jl(this,u)}return this},e.delete=function(n){var i=this;if(Al(this)){var a=kl(this,{type:c0,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,s=Ql(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:c0,object:this,oldValue:n}:null;return dc(function(){i.atom_.reportChanged(),i.data_.delete(n)}),s&&Jl(this,u),!0}return!1},e.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},e.entries=function(){var n=this.values();return h5({next:function(){var a=n.next(),o=a.value,s=a.done;return s?{value:void 0,done:s}:{value:[o,o],done:s}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return h5({next:function(){var o=i.next(),s=o.value,u=o.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(s),done:u}}})},e.intersection=function(n){if(fc(n)&&!ts(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},e.union=function(n){if(fc(n)&&!ts(n))return n.union(this);var i=new Set(this);return i.union(n)},e.difference=function(n){return new Set(this).difference(n)},e.symmetricDifference=function(n){if(fc(n)&&!ts(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},e.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},e.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},e.isDisjointFrom=function(n){if(fc(n)&&!ts(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},e.replace=function(n){var i=this;return ts(n)&&(n=new Set(n)),dc(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):fc(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&jr("Cannot initialize set from "+n)}),this},e.observe_=function(n,i){return Op(this,n)},e.intercept_=function(n){return Pp(this,n)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},vd(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),ts=_f("ObservableSet",F6);function h5(t){return t[Symbol.toStringTag]="SetIterator",Um(t)}var d5=Object.create(null),p5="remove",B6=function(){function t(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=y9),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new xf("ObservableObject.keys"),this.isPlainObject_=gf(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(n){return this.values_.get(n).get()},e.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof eu)return a.set(i),!0;if(Al(this)){var o=kl(this,{type:ju,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var s=Ql(this),u=!1,h=s||u?{type:ju,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),s&&Jl(this,h)}return!0},e.get_=function(n){return Lt.trackingDerivation&&!pc(this.target_,n)&&this.has_(n),this.target_[n]},e.set_=function(n,i,a){return a===void 0&&(a=!1),pc(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},e.has_=function(n){if(!Lt.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new pf(n in this.target_,L0,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},e.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[Lu])!=null&&a[n])return;jr(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==k0;){var s=r0(o,n);if(s){var u=i.make_(this,n,s,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}v5(this,i,n)}},e.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var s=a.extend_(this,n,i,o);return s&&v5(this,a,n),s},e.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ls();var o=this.delete_(n);if(!o)return o;if(Al(this)){var s=kl(this,{object:this.proxy_||this.target_,name:n,type:cf,newValue:i.value});if(!s)return null;var u=s.newValue;i.value!==u&&(i=vf({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Mu(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{Ns()}return!0},e.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{Ls();var s=this.delete_(n);if(!s)return s;if(Al(this)){var u=kl(this,{object:this.proxy_||this.target_,name:n,type:cf,newValue:i});if(!u)return null;i=u.newValue}var h=g5(n),f={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:h.get,set:h.set};if(o){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Mu(this.target_,n,f);var v=new pf(i,a,"ObservableObject.key",!1);this.values_.set(n,v),this.notifyPropertyAddition_(n,v.value_)}finally{Ns()}return!0},e.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ls();var o=this.delete_(n);if(!o)return o;if(Al(this)){var s=kl(this,{object:this.proxy_||this.target_,name:n,type:cf,newValue:void 0});if(!s)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=g5(n),h={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,h))return!1}else Mu(this.target_,n,h);this.values_.set(n,new eu(i)),this.notifyPropertyAddition_(n,void 0)}finally{Ns()}return!0},e.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!pc(this.target_,n))return!0;if(Al(this)){var a=kl(this,{object:this.proxy_||this.target_,name:n,type:p5});if(!a)return null}try{var o;Ls();var s=Ql(this),u=!1,h=this.values_.get(n),f=void 0;if(!h&&(s||u)){var v;f=(v=r0(this.target_,n))==null?void 0:v.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(h&&(this.values_.delete(n),h instanceof pf&&(f=h.value_),y6(h)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),s||u){var g={type:p5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:f,name:n};s&&Jl(this,g)}}finally{Ns()}return!0},e.observe_=function(n,i){return Op(this,n)},e.intercept_=function(n){return Pp(this,n)},e.notifyPropertyAddition_=function(n,i){var a,o=Ql(this),s=!1;if(o||s){var u=o||s?{type:cf,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&Jl(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),C0(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function md(t,e){var r;if(pc(t,gr))return t;var n=(r=e?.name)!=null?r:"ObservableObject",i=new B6(t,new Map,String(n),C9(e));return O0(t,gr,i),t}var OS=_f("ObservableObjectAdministration",B6);function g5(t){return d5[t]||(d5[t]={get:function(){return this[gr].getObservablePropValue_(t)},set:function(r){return this[gr].setObservablePropValue_(t,r)}})}function nu(t){return P0(t)?OS(t[gr]):!1}function v5(t,e,r){var n;(n=t.target_[Lu])==null||delete n[r]}var CS=q6(0),LS=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),Ng=0,z6=function(){};function NS(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}NS(z6,Array.prototype);var qm=function(t){function e(n,i,a,o){var s;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),s=t.call(this)||this,dh(function(){var u=new Bm(a,i,o,!0);u.proxy_=s,Zw(s,gr,u),n&&n.length&&s.spliceWithArray(0,0,n),LS&&Object.defineProperty(s,"0",CS)}),s}e6(e,t);var r=e.prototype;return r.concat=function(){this[gr].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(s){return Uu(s)?s.slice():s}))},r[Symbol.iterator]=function(){var n=this,i=0;return Um({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},vd(e,[{key:"length",get:function(){return this[gr].getArrayLength_()},set:function(i){this[gr].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(z6);Object.entries(u0).forEach(function(t){var e=t[0],r=t[1];e!=="concat"&&O0(qm.prototype,e,r)});function q6(t){return{enumerable:!1,configurable:!0,get:function(){return this[gr].get_(t)},set:function(r){this[gr].set_(t,r)}}}function TS(t){Mu(qm.prototype,""+t,q6(t))}function U6(t){if(t>Ng){for(var e=Ng;e<t+100;e++)TS(e);Ng=t}}U6(1e3);function RS(t,e,r){return new qm(t,e,r)}function ud(t,e){if(typeof t=="object"&&t!==null){if(Uu(t))return e!==void 0&&jr(23),t[gr].atom_;if(ts(t))return t.atom_;if(Ll(t)){if(e===void 0)return t.keysAtom_;var r=t.data_.get(e)||t.hasMap_.get(e);return r||jr(25,e,Kv(t)),r}if(nu(t)){if(!e)return jr(26);var n=t[gr].values_.get(e);return n||jr(27,e,Kv(t)),n}if(Mm(t)||M0(t)||s0(t))return t}else if(al(t)&&s0(t[gr]))return t[gr];jr(28)}function zu(t,e){if(t||jr(29),e!==void 0)return zu(ud(t,e));if(Mm(t)||M0(t)||s0(t)||Ll(t)||ts(t))return t;if(t[gr])return t[gr];jr(24,t)}function Kv(t,e){var r;if(e!==void 0)r=ud(t,e);else{if(cp(t))return t.name;nu(t)||Ll(t)||ts(t)?r=zu(t):r=ud(t)}return r.name_}function dh(t){var e=hh(),r=T0(!0);Ls();try{return t()}finally{Ns(),R0(r),gc(e)}}var m5=k0.toString;function H6(t,e,r){return r===void 0&&(r=-1),Zv(t,e,r)}function Zv(t,e,r,n,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;var o=m5.call(t);if(o!==m5.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":r>=0&&r++;break}t=y5(t),e=y5(e);var s=o==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var u=t.constructor,h=e.constructor;if(u!==h&&!(al(u)&&u instanceof u&&al(h)&&h instanceof h)&&"constructor"in t&&"constructor"in e)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var f=n.length;f--;)if(n[f]===t)return i[f]===e;if(n.push(t),i.push(e),s){if(f=t.length,f!==e.length)return!1;for(;f--;)if(!Zv(t[f],e[f],r-1,n,i))return!1}else{var v=Object.keys(t),g=v.length;if(Object.keys(e).length!==g)return!1;for(var p=0;p<g;p++){var y=v[p];if(!(pc(e,y)&&Zv(t[y],e[y],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function y5(t){return Uu(t)?t.slice():gd(t)||Ll(t)||fc(t)||ts(t)?Array.from(t.entries()):t}var b5,MS=((b5=A0().Iterator)==null?void 0:b5.prototype)||{};function Um(t){return t[Symbol.iterator]=IS,Object.assign(Object.create(MS),t)}function IS(){return this}["Symbol","Map","Set"].forEach(function(t){var e=A0();typeof e[t]>"u"&&jr("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Y9,extras:{getDebugName:Kv},$mobx:gr});if(!Ii.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!j6)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var $6=Gw();function jS(t){t()}function DS(t){t||(t=jS),oS({reactionScheduler:t})}function FS(t){return lS(t)}var BS=1e4,zS=1e4,qS=function(){function t(e){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),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=BS),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(t.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,zS))}}),t}(),US=typeof FinalizationRegistry<"u"?FinalizationRegistry:qS,Qv=new US(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.reaction=null}),Tg={exports:{}},Rg={};/**
35
+ * @license React
36
+ * use-sync-external-store-shim.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var w5;function HS(){if(w5)return Rg;w5=1;var t=Sp();function e(v,g){return v===g&&(v!==0||1/v===1/g)||v!==v&&g!==g}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,a=t.useLayoutEffect,o=t.useDebugValue;function s(v,g){var p=g(),y=n({inst:{value:p,getSnapshot:g}}),_=y[0].inst,x=y[1];return a(function(){_.value=p,_.getSnapshot=g,u(_)&&x({inst:_})},[v,p,g]),i(function(){return u(_)&&x({inst:_}),v(function(){u(_)&&x({inst:_})})},[v]),o(p),p}function u(v){var g=v.getSnapshot;v=v.value;try{var p=g();return!r(v,p)}catch{return!0}}function h(v,g){return g()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:s;return Rg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,Rg}var _5;function $S(){return _5||(_5=1,Tg.exports=HS()),Tg.exports}var GS=$S();function x5(t){t.reaction=new Fu("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function WS(t,e){e===void 0&&(e="observed");var r=se.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(s){return Qv.unregister(n),n.onStoreChange=s,n.reaction||(x5(n),n.stateVersion=Symbol()),function(){var u;n.onStoreChange=null,(u=n.reaction)===null||u===void 0||u.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var i=r.current;i.reaction||(x5(i),Qv.register(r,i,i)),se.useDebugValue(i.reaction,FS),GS.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=t()}catch(s){o=s}}),o)throw o;return a}var Mg,Ig,G6=typeof Symbol=="function"&&Symbol.for,VS=(Ig=(Mg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Mg===void 0?void 0:Mg.configurable)!==null&&Ig!==void 0?Ig:!1,S5=G6?Symbol.for("react.forward_ref"):typeof Ii.forwardRef=="function"&&Ii.forwardRef(function(t){return null}).$$typeof,E5=G6?Symbol.for("react.memo"):typeof Ii.memo=="function"&&Ii.memo(function(t){return null}).$$typeof;function ni(t,e){var r;if(E5&&t.$$typeof===E5)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.");var n=(r=void 0)!==null&&r!==void 0?r:!1,i=t,a=t.displayName||t.name;if(S5&&t.$$typeof===S5&&(n=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(s,u){return WS(function(){return i(s,u)},a)};return o.displayName=t.displayName,VS&&Object.defineProperty(o,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(o.contextTypes=t.contextTypes),n&&(o=Ii.forwardRef(o)),o=Ii.memo(o),XS(t,o),o}var YS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function XS(t,e){Object.keys(t).forEach(function(r){YS[r]||Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}function KS(t,e){return Ii.useState(function(){return Kr(t(),e,{autoBind:!0})})[0]}var jg;DS($6.unstable_batchedUpdates);jg=Qv.finalizeAllImmediately;const ZS=Math.PI/180;function QS(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Kf=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Ot={_global:Kf,version:"10.0.2",isBrowser:QS(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return Ot.angleDeg?t*ZS:t},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,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return Ot.DD.isDragging},isTransforming(){var t,e;return(e=(t=Ot.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!Ot.DD.node},releaseCanvasOnDestroy:!0,document:Kf.document,_injectGlobal(t){typeof Kf.Konva<"u"&&console.error("Severa Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Kf.Konva=t}},Di=t=>{Ot[t.prototype.getClassName()]=t};Ot._injectGlobal(Ot);const JS=`Konva.js unsupported environment.
43
+
44
+ Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
45
+
46
+ To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
47
+
48
+ bash: npm install canvas
49
+ js: import "konva/canvas-backend";
50
+
51
+ or
52
+
53
+ bash: npm install skia-canvas
54
+ js: import "konva/skia-backend";
55
+ `,A5=()=>{if(typeof document>"u")throw new Error(JS)};class tl{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 tl(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 r=this.m;return{x:r[0]*e.x+r[2]*e.y+r[4],y:r[1]*e.x+r[3]*e.y+r[5]}}translate(e,r){return this.m[4]+=this.m[0]*e+this.m[2]*r,this.m[5]+=this.m[1]*e+this.m[3]*r,this}scale(e,r){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=r,this.m[3]*=r,this}rotate(e){const r=Math.cos(e),n=Math.sin(e),i=this.m[0]*r+this.m[2]*n,a=this.m[1]*r+this.m[3]*n,o=this.m[0]*-n+this.m[2]*r,s=this.m[1]*-n+this.m[3]*r;return this.m[0]=i,this.m[1]=a,this.m[2]=o,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,r){const n=this.m[0]+this.m[2]*r,i=this.m[1]+this.m[3]*r,a=this.m[2]+this.m[0]*e,o=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}multiply(e){const r=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],i=this.m[0]*e.m[2]+this.m[2]*e.m[3],a=this.m[1]*e.m[2]+this.m[3]*e.m[3],o=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],s=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=r,this.m[1]=n,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),r=this.m[3]*e,n=-this.m[1]*e,i=-this.m[2]*e,a=this.m[0]*e,o=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=r,this.m[1]=n,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}getMatrix(){return this.m}decompose(){const e=this.m[0],r=this.m[1],n=this.m[2],i=this.m[3],a=this.m[4],o=this.m[5],s=e*i-r*n,u={x:a,y:o,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||r!=0){const h=Math.sqrt(e*e+r*r);u.rotation=r>0?Math.acos(e/h):-Math.acos(e/h),u.scaleX=h,u.scaleY=s/h,u.skewX=(e*n+r*i)/s,u.skewY=0}else if(n!=0||i!=0){const h=Math.sqrt(n*n+i*i);u.rotation=Math.PI/2-(i>0?Math.acos(-n/h):-Math.acos(n/h)),u.scaleX=s/h,u.scaleY=h,u.skewX=0,u.skewY=(e*n+r*i)/s}return u.rotation=Ze._getRotation(u.rotation),u}}const eE="[object Array]",tE="[object Number]",rE="[object String]",nE="[object Boolean]",iE=Math.PI/180,aE=180/Math.PI,Dg="#",oE="",sE="0",lE="Konva warning: ",k5="Konva error: ",uE="rgb(",Fg={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]},cE=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let d1=[];const fE=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,60)},Ze={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===eE},_isNumber(t){return Object.prototype.toString.call(t)===tE&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===rE},_isBoolean(t){return Object.prototype.toString.call(t)===nE},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;const e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){d1.push(t),d1.length===1&&fE(function(){const e=d1;d1=[],e.forEach(function(r){r()})})},createCanvasElement(){A5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return A5(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const r=Ze.createImageElement();r.onload=function(){e(r)},r.src=t},_rgbToHex(t,e,r){return((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)},_hexToRgb(t){t=t.replace(Dg,oE);const e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let t=(Math.random()*16777215<<0).toString(16);for(;t.length<6;)t=sE+t;return Dg+t},getRGB(t){let e;return t in Fg?(e=Fg[t],{r:e[0],g:e[1],b:e[2]}):t[0]===Dg?this._hexToRgb(t.substring(1)):t.substr(0,4)===uE?(e=cE.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",Ze._namedColorToRBA(t)||Ze._hex3ColorToRGBA(t)||Ze._hex4ColorToRGBA(t)||Ze._hex6ColorToRGBA(t)||Ze._hex8ColorToRGBA(t)||Ze._rgbColorToRGBA(t)||Ze._rgbaColorToRGBA(t)||Ze._hslColorToRGBA(t)},_namedColorToRBA(t){const e=Fg[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];const e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];const e=t.split(/ *, */).map((r,n)=>r.slice(-1)==="%"?n===3?parseInt(r)/100:parseInt(r)/100*255:Number(r));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...r]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),n=Number(r[0])/360,i=Number(r[1])/100,a=Number(r[2])/100;let o,s,u;if(i===0)return u=a*255,{r:Math.round(u),g:Math.round(u),b:Math.round(u),a:1};a<.5?o=a*(1+i):o=a+i-a*i;const h=2*a-o,f=[0,0,0];for(let v=0;v<3;v++)s=n+1/3*-(v-1),s<0&&s++,s>1&&s--,6*s<1?u=h+(o-h)*6*s:2*s<1?u=o:3*s<2?u=h+(o-h)*(2/3-s)*6:u=h,f[v]=u*255;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject(t){const e={};for(const r in t)this._isPlainObject(t[r])?e[r]=this.cloneObject(t[r]):this._isArray(t[r])?e[r]=this.cloneArray(t[r]):e[r]=t[r];return e},cloneArray(t){return t.slice(0)},degToRad(t){return t*iE},radToDeg(t){return t*aE},_degToRad(t){return Ze.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),Ze.degToRad(t)},_radToDeg(t){return Ze.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),Ze.radToDeg(t)},_getRotation(t){return Ot.angleDeg?Ze.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(k5+t)},error(t){console.error(k5+t)},warn(t){Ot.showWarnings&&console.warn(lE+t)},each(t,e){for(const r in t)e(r,t[r])},_inRange(t,e,r){return e<=t&&t<r},_getProjectionToSegment(t,e,r,n,i,a){let o,s,u;const h=(t-r)*(t-r)+(e-n)*(e-n);if(h==0)o=t,s=e,u=(i-r)*(i-r)+(a-n)*(a-n);else{const f=((i-t)*(r-t)+(a-e)*(n-e))/h;f<0?(o=t,s=e,u=(t-i)*(t-i)+(e-a)*(e-a)):f>1?(o=r,s=n,u=(r-i)*(r-i)+(n-a)*(n-a)):(o=t+f*(r-t),s=e+f*(n-e),u=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,u]},_getProjectionToLine(t,e,r){const n=Ze.cloneObject(t);let i=Number.MAX_VALUE;return e.forEach(function(a,o){if(!r&&o===e.length-1)return;const s=e[(o+1)%e.length],u=Ze._getProjectionToSegment(a.x,a.y,s.x,s.y,t.x,t.y),h=u[0],f=u[1],v=u[2];v<i&&(n.x=h,n.y=f,i=v)}),n},_prepareArrayForTween(t,e,r){const n=[],i=[];if(t.length>e.length){const o=e;e=t,t=o}for(let o=0;o<t.length;o+=2)n.push({x:t[o],y:t[o+1]});for(let o=0;o<e.length;o+=2)i.push({x:e[o],y:e[o+1]});const a=[];return i.forEach(function(o){const s=Ze._getProjectionToLine(o,n,r);a.push(s.x),a.push(s.y)}),a},_prepareToStringify(t){let e;t.visitedByCircularReferenceRemoval=!0;for(const r in t)if(t.hasOwnProperty(r)&&t[r]&&typeof t[r]=="object"){if(e=Object.getOwnPropertyDescriptor(t,r),t[r].visitedByCircularReferenceRemoval||Ze._isElement(t[r]))if(e.configurable)delete t[r];else return null;else if(Ze._prepareToStringify(t[r])===null)if(e.configurable)delete t[r];else return null}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(const r in e)t[r]=e[r];return t},_getFirstPointerId(t){return t.touches?t.changedTouches[0].identifier:t.pointerId||999},releaseCanvas(...t){Ot.releaseCanvasOnDestroy&&t.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(t,e,r,n){let i=e<0?e:0,a=r<0?r:0;e=Math.abs(e),r=Math.abs(r);let o=0,s=0,u=0,h=0;typeof n=="number"?o=s=u=h=Math.min(n,e/2,r/2):(o=Math.min(n[0]||0,e/2,r/2),s=Math.min(n[1]||0,e/2,r/2),h=Math.min(n[2]||0,e/2,r/2),u=Math.min(n[3]||0,e/2,r/2)),t.moveTo(i+o,a),t.lineTo(i+e-s,a),t.arc(i+e-s,a+s,s,Math.PI*3/2,0,!1),t.lineTo(i+e,a+r-h),t.arc(i+e-h,a+r-h,h,0,Math.PI/2,!1),t.lineTo(i+u,a+r),t.arc(i+u,a+r-u,u,Math.PI/2,Math.PI,!1),t.lineTo(i,a+o),t.arc(i+o,a+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(t,e,r,n,i){n=Math.abs(n);for(let a=0;a<r;a++){const o=e[(a-1+r)%r],s=e[a],u=e[(a+1)%r],h={x:s.x-o.x,y:s.y-o.y},f={x:u.x-s.x,y:u.y-s.y},v=Math.hypot(h.x,h.y),g=Math.hypot(f.x,f.y);let p;typeof i=="number"?p=i:p=a<i.length?i[a]:0,p=n*Math.cos(Math.PI/r)*Math.min(1,p/n*2);const _={x:h.x/v,y:h.y/v},x={x:f.x/g,y:f.y/g},b={x:s.x-_.x*p,y:s.y-_.y*p},E={x:s.x+x.x*p,y:s.y+x.y*p};a===0?t.moveTo(b.x,b.y):t.lineTo(b.x,b.y),t.arcTo(s.x,s.y,E.x,E.y,p)}}};function hE(t){const e=[],r=t.length,n=Ze;for(let i=0;i<r;i++){let a=t[i];n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),e.push(a)}return e}const P5=",",dE="(",pE=")",gE="([",vE="])",mE=";",yE="()",bE="=",O5=["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"],wE=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],_E=100;let p1=null;function C5(){if(p1!==null)return p1;try{const e=Ze.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(p1=!1,!1)}catch{return p1=!1,!1}}class I0{constructor(e){this.canvas=e,Ot.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,r){let n=this.traceArr,i=n.length,a="",o,s,u,h;for(o=0;o<i;o++)s=n[o],u=s.method,u?(h=s.args,a+=u,e?a+=yE:Ze._isArray(h[0])?a+=gE+h.join(P5)+vE:(r&&(h=h.map(f=>typeof f=="number"?Math.floor(f):f)),a+=dE+h.join(P5)+pE)):(a+=s.property,e||(a+=bE+s.val)),a+=mE;return a}clearTrace(){this.traceArr=[]}_trace(e){let r=this.traceArr,n;r.push(e),n=r.length,n>=_E&&r.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const r=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(e){const r=e.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(e){const r=e.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(e){const r=e.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}_applyMiterLimit(e){const r=e.attrs.miterLimit;r!=null&&this.setAttr("miterLimit",r)}setAttr(e,r){this._context[e]=r}arc(e,r,n,i,a,o){this._context.arc(e,r,n,i,a,o)}arcTo(e,r,n,i,a){this._context.arcTo(e,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(e,r,n,i,a,o){this._context.bezierCurveTo(e,r,n,i,a,o)}clearRect(e,r,n,i){this._context.clearRect(e,r,n,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,r){const n=arguments;if(n.length===2)return this._context.createImageData(e,r);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,r,n,i){return this._context.createLinearGradient(e,r,n,i)}createPattern(e,r){return this._context.createPattern(e,r)}createRadialGradient(e,r,n,i,a,o){return this._context.createRadialGradient(e,r,n,i,a,o)}drawImage(e,r,n,i,a,o,s,u,h){const f=arguments,v=this._context;f.length===3?v.drawImage(e,r,n):f.length===5?v.drawImage(e,r,n,i,a):f.length===9&&v.drawImage(e,r,n,i,a,o,s,u,h)}ellipse(e,r,n,i,a,o,s,u){this._context.ellipse(e,r,n,i,a,o,s,u)}isPointInPath(e,r,n,i){return n?this._context.isPointInPath(n,e,r,i):this._context.isPointInPath(e,r,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,r,n,i){this._context.fillRect(e,r,n,i)}strokeRect(e,r,n,i){this._context.strokeRect(e,r,n,i)}fillText(e,r,n,i){i?this._context.fillText(e,r,n,i):this._context.fillText(e,r,n)}measureText(e){return this._context.measureText(e)}getImageData(e,r,n,i){return this._context.getImageData(e,r,n,i)}lineTo(e,r){this._context.lineTo(e,r)}moveTo(e,r){this._context.moveTo(e,r)}rect(e,r,n,i){this._context.rect(e,r,n,i)}roundRect(e,r,n,i,a){this._context.roundRect(e,r,n,i,a)}putImageData(e,r,n){this._context.putImageData(e,r,n)}quadraticCurveTo(e,r,n,i){this._context.quadraticCurveTo(e,r,n,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,r){this._context.scale(e,r)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,r,n,i,a,o){this._context.setTransform(e,r,n,i,a,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,r,n,i){this._context.strokeText(e,r,n,i)}transform(e,r,n,i,a,o){this._context.transform(e,r,n,i,a,o)}translate(e,r){this._context.translate(e,r)}_enableTrace(){let e=this,r=O5.length,n=this.setAttr,i,a;const o=function(s){let u=e[s],h;e[s]=function(){return a=hE(Array.prototype.slice.call(arguments,0)),h=u.apply(e,arguments),e._trace({method:s,args:a}),h}};for(i=0;i<r;i++)o(O5[i]);e.setAttr=function(){n.apply(e,arguments);const s=arguments[0];let u=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),e._trace({property:s,val:u})}}_applyGlobalCompositeOperation(e){const r=e.attrs.globalCompositeOperation;!r||r==="source-over"||this.setAttr("globalCompositeOperation",r)}}wE.forEach(function(t){Object.defineProperty(I0.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class xE extends I0{constructor(e,{willReadFrequently:r=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(e){const r=e.fill();this.setAttr("fillStyle",r),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const r=e._getLinearGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fillRadialGradient(e){const r=e._getRadialGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fill(e){const r=e.fill(),n=e.getFillPriority();if(r&&n==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(e);return}const a=e.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(e);return}const o=e.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(e);return}r?this._fillColor(e):i?this._fillPattern(e):a?this._fillLinearGradient(e):o&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const r=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(let o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(e){const r=e.dash(),n=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!n){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(e),r&&e.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),n||this.restore()}}_applyShadow(e){var r,n,i;const a=(r=e.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=e.getShadowBlur())!==null&&n!==void 0?n:5,s=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=e.getAbsoluteScale(),h=this.canvas.getPixelRatio(),f=u.x*h,v=u.y*h;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(f),Math.abs(v))),this.setAttr("shadowOffsetX",s.x*f),this.setAttr("shadowOffsetY",s.y*v)}}class SE extends I0{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const r=e.getStrokeScaleEnabled();if(!r){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(e);const n=e.hitStrokeWidth(),i=n==="auto"?e.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),r||this.restore()}}}let g1;function EE(){if(g1)return g1;const t=Ze.createCanvasElement(),e=t.getContext("2d");return g1=function(){const r=Ot._global.devicePixelRatio||1,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return r/n}(),Ze.releaseCanvas(t),g1}class Hm{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const n=(e||{}).pixelRatio||Ot.pixelRatio||EE();this.pixelRatio=n,this._canvas=Ze.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const r=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const r=this.pixelRatio;this.getContext()._context.scale(r,r)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const r=this.pixelRatio;this.getContext()._context.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,r){this.setWidth(e||0),this.setHeight(r||0)}toDataURL(e,r){try{return this._canvas.toDataURL(e,r)}catch{try{return this._canvas.toDataURL()}catch(i){return Ze.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class sf extends Hm{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new xE(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}function L5(){const t=Ze.createCanvasElement();t.width=1,t.height=1;const e=t.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,1,1),e.fillStyle="rgba(255,0,255,1)",e.fillRect(0,0,1,1);const r=e.getImageData(0,0,1,1).data;return!(r[0]===255&&r[1]===0&&r[2]===255&&r[3]===255)}function N5(){var t,e;return typeof navigator>"u"?!1:(e=(t=navigator.brave)===null||t===void 0?void 0:t.isBrave())!==null&&e!==void 0?e:!1}let T5=!1;function AE(){return N5()&&L5()&&!T5&&(T5=!0,Ze.error('Looks like you have "Brave shield" enabled in your browser. It breaks KonvaJS internals. Please disable it. You may need to ask your users to do the same.')),N5()&&L5()}class $m extends Hm{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new SE(this),this.setSize(e.width,e.height),AE()}}const yn={get isDragging(){let t=!1;return yn._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){let t;return yn._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];yn._dragElements.forEach((r,n)=>{const{node:i}=r,a=i.getStage();a.setPointersPositions(t),r.pointerId===void 0&&(r.pointerId=Ze._getFirstPointerId(t));const o=a._changedPointerPositions.find(s=>s.id===r.pointerId);if(o){if(r.dragStatus!=="dragging"){const s=i.dragDistance();if(Math.max(Math.abs(o.x-r.startPointerPos.x),Math.abs(o.y-r.startPointerPos.y))<s||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,r),e.push(i)}}),e.forEach(r=>{r.fire("dragmove",{type:"dragmove",target:r,evt:t},!0)})},_endDragBefore(t){const e=[];yn._dragElements.forEach(r=>{const{node:n}=r,i=n.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(s=>s.id===r.pointerId))return;(r.dragStatus==="dragging"||r.dragStatus==="stopped")&&(yn.justDragged=!0,Ot._mouseListenClick=!1,Ot._touchListenClick=!1,Ot._pointerListenClick=!1,r.dragStatus="stopped");const o=r.node.getLayer()||r.node instanceof Ot.Stage&&r.node;o&&e.indexOf(o)===-1&&e.push(o)}),e.forEach(r=>{r.draw()})},_endDragAfter(t){yn._dragElements.forEach((e,r)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&yn._dragElements.delete(r)})}};Ot.isBrowser&&(window.addEventListener("mouseup",yn._endDragBefore,!0),window.addEventListener("touchend",yn._endDragBefore,!0),window.addEventListener("touchcancel",yn._endDragBefore,!0),window.addEventListener("mousemove",yn._drag),window.addEventListener("touchmove",yn._drag),window.addEventListener("mouseup",yn._endDragAfter,!1),window.addEventListener("touchend",yn._endDragAfter,!1),window.addEventListener("touchcancel",yn._endDragAfter,!1));function Sf(t){return Ze._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||Ze._isBoolean(t)?t:Object.prototype.toString.call(t)}function W6(t){return t>255?255:t<0?0:Math.round(t)}function Et(){if(Ot.isUnminified)return function(t,e){return Ze._isNumber(t)||Ze.warn(Sf(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function j0(t){if(Ot.isUnminified)return function(e,r){let n=Ze._isNumber(e),i=Ze._isArray(e)&&e.length==t;return!n&&!i&&Ze.warn(Sf(e)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function Gm(){if(Ot.isUnminified)return function(t,e){return Ze._isNumber(t)||t==="auto"||Ze.warn(Sf(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function ph(){if(Ot.isUnminified)return function(t,e){return Ze._isString(t)||Ze.warn(Sf(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function V6(){if(Ot.isUnminified)return function(t,e){const r=Ze._isString(t),n=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return r||n||Ze.warn(Sf(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function kE(){if(Ot.isUnminified)return function(t,e){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&t instanceof r||(Ze._isArray(t)?t.forEach(function(n){Ze._isNumber(n)||Ze.warn('"'+e+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Ze.warn(Sf(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function iu(){if(Ot.isUnminified)return function(t,e){return t===!0||t===!1||Ze.warn(Sf(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function PE(t){if(Ot.isUnminified)return function(e,r){return e==null||Ze.isObject(e)||Ze.warn(Sf(e)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+t),e}}const Rd="get",Md="set",je={addGetterSetter(t,e,r,n,i){je.addGetter(t,e,r),je.addSetter(t,e,n,i),je.addOverloadedGetterSetter(t,e)},addGetter(t,e,r){const n=Rd+Ze._capitalize(e);t.prototype[n]=t.prototype[n]||function(){const i=this.attrs[e];return i===void 0?r:i}},addSetter(t,e,r,n){const i=Md+Ze._capitalize(e);t.prototype[i]||je.overWriteSetter(t,e,r,n)},overWriteSetter(t,e,r,n){const i=Md+Ze._capitalize(e);t.prototype[i]=function(a){return r&&a!==void 0&&a!==null&&(a=r.call(this,a,e)),this._setAttr(e,a),n&&n.call(this),this}},addComponentsGetterSetter(t,e,r,n,i){const a=r.length,o=Ze._capitalize,s=Rd+o(e),u=Md+o(e);t.prototype[s]=function(){const f={};for(let v=0;v<a;v++){const g=r[v];f[g]=this.getAttr(e+o(g))}return f};const h=PE(r);t.prototype[u]=function(f){const v=this.attrs[e];n&&(f=n.call(this,f,e)),h&&h.call(this,f,e);for(const g in f)f.hasOwnProperty(g)&&this._setAttr(e+o(g),f[g]);return f||r.forEach(g=>{this._setAttr(e+o(g),void 0)}),this._fireChangeEvent(e,v,f),i&&i.call(this),this},je.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const r=Ze._capitalize(e),n=Md+r,i=Rd+r;t.prototype[e]=function(){return arguments.length?(this[n](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,r,n){Ze.error("Adding deprecated "+e);const i=Rd+Ze._capitalize(e),a=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){Ze.error(a);const o=this.attrs[e];return o===void 0?r:o},je.addSetter(t,e,n,function(){Ze.error(a)}),je.addOverloadedGetterSetter(t,e)},backCompat(t,e){Ze.each(e,function(r,n){const i=t.prototype[n],a=Rd+Ze._capitalize(r),o=Md+Ze._capitalize(r);function s(){i.apply(this,arguments),Ze.error('"'+r+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}t.prototype[r]=s,t.prototype[a]=s,t.prototype[o]=s})},afterSetFilter(){this._filterUpToDate=!1}};function OE(t){const e=/(\w+)\(([^)]+)\)/g;let r;for(;(r=e.exec(t))!==null;){const[,n,i]=r;switch(n){case"blur":{const a=parseFloat(i.replace("px",""));return function(o){this.blurRadius(a*.5);const s=Ot.Filters;s&&s.Blur&&s.Blur.call(this,o)}}case"brightness":{const a=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(o){this.brightness(a);const s=Ot.Filters;s&&s.Brightness&&s.Brightness.call(this,o)}}case"contrast":{const a=parseFloat(i);return function(o){const s=100*(Math.sqrt(a)-1);this.contrast(s);const u=Ot.Filters;u&&u.Contrast&&u.Contrast.call(this,o)}}case"grayscale":return function(a){const o=Ot.Filters;o&&o.Grayscale&&o.Grayscale.call(this,a)};case"sepia":return function(a){const o=Ot.Filters;o&&o.Sepia&&o.Sepia.call(this,a)};case"invert":return function(a){const o=Ot.Filters;o&&o.Invert&&o.Invert.call(this,a)};default:Ze.warn(`CSS filter "${n}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const U1="absoluteOpacity",v1="allEventListeners",uc="absoluteTransform",R5="absoluteScale",Uf="canvas",CE="Change",LE="children",NE="konva",Jv="listening",TE="mouseenter",RE="mouseleave",ME="pointerenter",IE="pointerleave",jE="touchenter",DE="touchleave",M5="set",I5="Shape",H1=" ",j5="stage",af="transform",FE="Stage",em="visible",BE=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(H1);let zE=1,kt=class tm{constructor(e){this._id=zE++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===af||e===uc)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,r){let n=this._cache.get(e);return(n===void 0||(e===af||e===uc)&&n.dirty===!0)&&(n=r.call(this),this._cache.set(e,n)),n}_calculate(e,r,n){if(!this._attachedDepsListeners.get(e)){const i=r.map(a=>a+"Change.konva").join(H1);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(Uf)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===uc&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Uf)){const{scene:e,filter:r,hit:n,buffer:i}=this._cache.get(Uf);Ze.releaseCanvas(e,r,n,i),this._cache.delete(Uf)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const r=e||{};let n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,s=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,h=r.offset||0,f=r.drawBorder||!1,v=r.hitCanvasPixelRatio||1;if(!i||!a){Ze.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const g=Math.abs(Math.round(n.x)-s)>.5?1:0,p=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=h*2+g,a+=h*2+p,s-=h,u-=h;const y=new sf({pixelRatio:o,width:i,height:a}),_=new sf({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),x=new $m({pixelRatio:v,width:i,height:a}),b=y.getContext(),E=x.getContext(),k=new sf({width:y.width/y.pixelRatio+Math.abs(s),height:y.height/y.pixelRatio+Math.abs(u),pixelRatio:y.pixelRatio}),S=k.getContext();return x.isCache=!0,y.isCache=!0,this._cache.delete(Uf),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(y.getContext()._context.imageSmoothingEnabled=!1,_.getContext()._context.imageSmoothingEnabled=!1),b.save(),E.save(),S.save(),b.translate(-s,-u),E.translate(-s,-u),S.translate(-s,-u),k.x=s,k.y=u,this._isUnderCache=!0,this._clearSelfAndDescendantCache(U1),this._clearSelfAndDescendantCache(R5),this.drawScene(y,this,k),this.drawHit(x,this),this._isUnderCache=!1,b.restore(),E.restore(),f&&(b.save(),b.beginPath(),b.rect(0,0,i,a),b.closePath(),b.setAttr("strokeStyle","red"),b.setAttr("lineWidth",5),b.stroke(),b.restore()),this._cache.set(Uf,{scene:y,filter:_,hit:x,buffer:k,x:s,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Uf)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,r){const n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,a=1/0,o=-1/0,s=-1/0;const u=this.getAbsoluteTransform(r);return n.forEach(function(h){const f=u.point(h);i===void 0&&(i=o=f.x,a=s=f.y),i=Math.min(i,f.x),a=Math.min(a,f.y),o=Math.max(o,f.x),s=Math.max(s,f.y)}),{x:i,y:a,width:o-i,height:s-a}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();e.translate(r.x,r.y);const n=this._getCachedSceneCanvas(),i=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/i,n.height/i),e.restore()}_drawCachedHitCanvas(e){const r=this._getCanvasCache(),n=r.hit;e.save(),e.translate(r.x,r.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,s,u,h;if(!e||e.length===0)return n;if(this._filterUpToDate)return i;let f=!0;for(let g=0;g<e.length;g++)if(typeof e[g]=="string"&&C5(),typeof e[g]!="string"||!C5()){f=!1;break}const v=n.pixelRatio;if(i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio),f){const g=e.join(" ");return a.save(),a.setAttr("filter",g),a.drawImage(n._canvas,0,0,n.getWidth()/v,n.getHeight()/v),a.restore(),this._filterUpToDate=!0,i}try{for(o=e.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/v,n.getHeight()/v),s=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++)h=e[u],typeof h=="string"&&(h=OE(h)),h.call(this,s),a.putImageData(s,0,0)}catch(g){Ze.error("Unable to apply filter. "+g.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(e,r){if(this._cache&&this._cache.delete(v1),arguments.length===3)return this._delegate.apply(this,arguments);const n=e.split(H1);for(let i=0;i<n.length;i++){const o=n[i].split("."),s=o[0],u=o[1]||"";this.eventListeners[s]||(this.eventListeners[s]=[]),this.eventListeners[s].push({name:u,handler:r})}return this}off(e,r){let n=(e||"").split(H1),i=n.length,a,o,s,u,h,f;if(this._cache&&this._cache.delete(v1),!e)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(s=n[a],u=s.split("."),h=u[0],f=u[1],h)this.eventListeners[h]&&this._off(h,f,r);else for(o in this.eventListeners)this._off(o,f,r);return this}dispatchEvent(e){const r={target:this,type:e.type,evt:e};return this.fire(e.type,r),this}addEventListener(e,r){return this.on(e,function(n){r.call(this,n.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,r,n){const i=this;this.on(e,function(a){const o=a.target.findAncestors(r,!0,i);for(let s=0;s<o.length;s++)a=Ze.cloneObject(a),a.currentTarget=o[s],n.call(o[s],a)})}remove(){return this.isDragging()&&this.stopDrag(),yn._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(uc),this._clearSelfAndDescendantCache(U1),this._clearSelfAndDescendantCache(R5),this._clearSelfAndDescendantCache(j5),this._clearSelfAndDescendantCache(em),this._clearSelfAndDescendantCache(Jv)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const r="get"+Ze._capitalize(e);return Ze._isFunction(this[r])?this[r]():this.attrs[e]}getAncestors(){let e=this.getParent(),r=[];for(;e;)r.push(e),e=e.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let r,n;if(!e)return this;for(r in e)r!==LE&&(n=M5+Ze._capitalize(r),Ze._isFunction(this[n])?this[n](e[r]):this._setAttr(r,e[r]))}),this}isListening(){return this._getCache(Jv,this._isListening)}_isListening(e){if(!this.listening())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isListening(e):!0}isVisible(){return this._getCache(em,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isVisible(e):!0}shouldDrawHit(e,r=!1){if(e)return this._isVisible(e)&&this._isListening(e);const n=this.getLayer();let i=!1;yn._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});const a=!r&&!Ot.hitOnDragEnabled&&(i||Ot.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),r=this,n=0,i,a,o,s;function u(f){for(i=[],a=f.length,o=0;o<a;o++)s=f[o],n++,s.nodeType!==I5&&(i=i.concat(s.getChildren().slice())),s._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=e&&u(i)}const h=this.getStage();return r.nodeType!==FE&&h&&u(h.getChildren()),n}getDepth(){let e=0,r=this.parent;for(;r;)e++,r=r.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(af),this._clearSelfAndDescendantCache(uc)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const r=e.getPointerPosition();if(!r)return null;const n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(e){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),a=new tl,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(e){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache(af);const a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(e.x,e.y),e={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(af),this._clearSelfAndDescendantCache(uc),this}_setTransform(e){let r;for(r in e)this.attrs[r]=e[r]}_clearTransform(){const e={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,e}move(e){let r=e.x,n=e.y,i=this.x(),a=this.y();return r!==void 0&&(i+=r),n!==void 0&&(a+=n),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(e,r){let n=[],i=this.getParent(),a,o;if(!(r&&r._id===this._id)){for(n.unshift(this);i&&(!r||i._id!==r._id);)n.unshift(i),i=i.parent;for(a=n.length,o=0;o<a;o++)e(n[o])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return Ze.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Ze.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Ze.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Ze.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return Ze.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Ze.warn("Unexpected value "+e+" 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 r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(U1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const r=this.getParent();return r&&!r._isUnderCache&&(e*=r.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),r,n,i,a,o;const s={attrs:{},className:this.getClassName()};for(r in e)n=e[r],o=Ze.isObject(n)&&!Ze._isPlainObject(n)&&!Ze._isArray(n),!o&&(i=typeof this[r]=="function"&&this[r],delete e[r],a=i?i.call(this):null,e[r]=n,a!==n&&(s.attrs[r]=n));return Ze._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,r,n){const i=[];r&&this._isMatch(e)&&i.push(this);let a=this.parent;for(;a;){if(a===n)return i;a._isMatch(e)&&i.push(a),a=a.parent}return i}isAncestorOf(e){return!1}findAncestor(e,r,n){return this.findAncestors(e,r,n)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let r=e.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],Ze.isValidSelector(a)||(Ze.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Ze.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Ze.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(j5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,r={},n){return r.target=r.target||this,n?this._fireAndBubble(e,r):this._fire(e,r),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(uc,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let r;if(e)return r=new tl,this._eachAncestorReverse(function(n){const i=n.transformsEnabled();i==="all"?r.multiply(n.getTransform()):i==="position"&&r.translate(n.x()-n.offsetX(),n.y()-n.offsetY())},e),r;{r=this._cache.get(uc)||new tl,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();const n=this.transformsEnabled();if(n==="all")r.multiply(this.getTransform());else if(n==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,s=this.attrs.offsetY||0;r.translate(i-o,a-s)}return r.dirty=!1,r}}getAbsoluteScale(e){let r=this;for(;r;)r._isUnderCache&&(e=r),r=r.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(af,this._getTransform)}_getTransform(){var e,r;const n=this._cache.get(af)||new tl;n.reset();const i=this.x(),a=this.y(),o=Ot.getAngle(this.rotation()),s=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,h=this.attrs.skewX||0,f=this.attrs.skewY||0,v=this.attrs.offsetX||0,g=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(h!==0||f!==0)&&n.skew(h,f),(s!==1||u!==1)&&n.scale(s,u),(v!==0||g!==0)&&n.translate(-1*v,-1*g),n.dirty=!1,n}clone(e){let r=Ze.cloneObject(this.attrs),n,i,a,o,s;for(n in e)r[n]=e[n];const u=new this.constructor(r);for(n in this.eventListeners)for(i=this.eventListeners[n],a=i.length,o=0;o<a;o++)s=i[o],s.name.indexOf(NE)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(s));return u}_toKonvaCanvas(e){e=e||{};const r=this.getClientRect(),n=this.getStage(),i=e.x!==void 0?e.x:Math.floor(r.x),a=e.y!==void 0?e.y:Math.floor(r.y),o=e.pixelRatio||1,s=new sf({width:e.width||Math.ceil(r.width)||(n?n.width():0),height:e.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=s.getContext(),h=new sf({width:s.width/s.pixelRatio+Math.abs(i),height:s.height/s.pixelRatio+Math.abs(a),pixelRatio:s.pixelRatio});return e.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(s,void 0,h),u.restore(),s}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const r=e.mimeType||null,n=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(r,n);return e.callback&&e.callback(i),i}toImage(e){return new Promise((r,n)=>{try{const i=e?.callback;i&&delete e.callback,Ze._urlToImage(this.toDataURL(e),function(a){r(a),i?.(a)})}catch(i){n(i)}})}toBlob(e){return new Promise((r,n)=>{try{const i=e?.callback;i&&delete e.callback,this.toCanvas(e).toBlob(a=>{r(a),i?.(a)},e?.mimeType,e?.quality)}catch(i){n(i)}})}setSize(e){return this.width(e.width),this.height(e.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():Ot.dragDistance}_off(e,r,n){let i=this.eventListeners[e],a,o,s;for(a=0;a<i.length;a++)if(o=i[a].name,s=i[a].handler,(o!=="konva"||r==="konva")&&(!r||o===r)&&(!n||n===s)){if(i.splice(a,1),i.length===0){delete this.eventListeners[e];break}a--}}_fireChangeEvent(e,r,n){this._fire(e+CE,{oldVal:r,newVal:n})}addName(e){if(!this.hasName(e)){const r=this.name(),n=r?r+" "+e:e;this.name(n)}return this}hasName(e){if(!e)return!1;const r=this.name();return r?(r||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const r=(this.name()||"").split(/\s/g),n=r.indexOf(e);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(e,r){const n=this[M5+Ze._capitalize(e)];return Ze._isFunction(n)?n.call(this,r):this._setAttr(e,r),this}_requestDraw(){if(Ot.autoDrawEnabled){const e=this.getLayer()||this.getStage();e?.batchDraw()}}_setAttr(e,r){const n=this.attrs[e];n===r&&!Ze.isObject(r)||(r==null?delete this.attrs[e]:this.attrs[e]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(e,n,r),this._requestDraw())}_setComponentAttr(e,r,n){let i;n!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][r]=n,this._fireChangeEvent(e,i,n))}_fireAndBubble(e,r,n){r&&this.nodeType===I5&&(r.target=this);const i=[TE,RE,ME,IE,jE,DE];if(!(i.indexOf(e)!==-1&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n))){this._fire(e,r);const o=i.indexOf(e)!==-1&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!o&&(n&&n.parent?this._fireAndBubble.call(this.parent,e,r,n):this._fireAndBubble.call(this.parent,e,r))}}_getProtoListeners(e){var r,n,i;const a=(r=this._cache.get(v1))!==null&&r!==void 0?r:{};let o=a?.[e];if(o===void 0){o=[];let s=Object.getPrototypeOf(this);for(;s;){const u=(i=(n=s.eventListeners)===null||n===void 0?void 0:n[e])!==null&&i!==void 0?i:[];o.push(...u),s=Object.getPrototypeOf(s)}a[e]=o,this._cache.set(v1,a)}return o}_fire(e,r){r=r||{},r.currentTarget=this,r.type=e;const n=this._getProtoListeners(e);if(n)for(let a=0;a<n.length;a++)n[a].handler.call(this,r);const i=this.eventListeners[e];if(i)for(let a=0;a<i.length;a++)i[a].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const r=e?e.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(!n)return;const a=n._getPointerById(r)||n._changedPointerPositions[0]||i;yn._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:r})}startDrag(e,r=!0){yn._dragElements.has(this._id)||this._createDragElement(e);const n=yn._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},r)}_setDragPosition(e,r){const n=this.getStage()._getPointerById(r.pointerId);if(!n)return;let i={x:n.x-r.offset.x,y:n.y-r.offset.y};const a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,e);o?i=o:Ze.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const r=yn._dragElements.get(this._id);r&&(r.dragStatus="stopped"),yn._endDragBefore(e),yn._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=yn._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ot.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;yn._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const r=yn._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&yn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-e.x,y:-e.y,width:r.width()+2*e.x,height:r.height()+2*e.y};return Ze.haveIntersection(n,this.getClientRect())}static create(e,r){return Ze._isString(e)&&(e=JSON.parse(e)),this._createNode(e,r)}static _createNode(e,r){let n=tm.prototype.getClassName.call(e),i=e.children,a,o,s;r&&(e.attrs.container=r),Ot[n]||(Ze.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Ot[n];if(a=new u(e.attrs),i)for(o=i.length,s=0;s<o;s++)a.add(tm._createNode(i[s]));return a}};kt.prototype.nodeType="Node";kt.prototype._attrsAffectingSize=[];kt.prototype.eventListeners={};kt.prototype.on.call(kt.prototype,BE,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(af),this._clearSelfAndDescendantCache(uc)});kt.prototype.on.call(kt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(em)});kt.prototype.on.call(kt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(Jv)});kt.prototype.on.call(kt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(U1)});const Xn=je.addGetterSetter;Xn(kt,"zIndex");Xn(kt,"absolutePosition");Xn(kt,"position");Xn(kt,"x",0,Et());Xn(kt,"y",0,Et());Xn(kt,"globalCompositeOperation","source-over",ph());Xn(kt,"opacity",1,Et());Xn(kt,"name","",ph());Xn(kt,"id","",ph());Xn(kt,"rotation",0,Et());je.addComponentsGetterSetter(kt,"scale",["x","y"]);Xn(kt,"scaleX",1,Et());Xn(kt,"scaleY",1,Et());je.addComponentsGetterSetter(kt,"skew",["x","y"]);Xn(kt,"skewX",0,Et());Xn(kt,"skewY",0,Et());je.addComponentsGetterSetter(kt,"offset",["x","y"]);Xn(kt,"offsetX",0,Et());Xn(kt,"offsetY",0,Et());Xn(kt,"dragDistance",void 0,Et());Xn(kt,"width",0,Et());Xn(kt,"height",0,Et());Xn(kt,"listening",!0,iu());Xn(kt,"preventDefault",!0,iu());Xn(kt,"filters",void 0,function(t){return this._filterUpToDate=!1,t});Xn(kt,"visible",!0,iu());Xn(kt,"transformsEnabled","all",ph());Xn(kt,"size");Xn(kt,"dragBoundFunc");Xn(kt,"draggable",!1,iu());je.backCompat(kt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class il extends kt{constructor(){super(...arguments),this.children=[]}getChildren(e){const r=this.children||[];return e?r.filter(e):r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let n=0;n<e.length;n++)this.add(e[n]);return this}const r=e[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const r=this._generalFind(e,!0);return r.length>0?r[0]:void 0}_generalFind(e,r){const n=[];return this._descendants(i=>{const a=i._isMatch(e);return a&&n.push(i),!!(a&&r)}),n}_descendants(e){let r=!1;const n=this.getChildren();for(const i of n){if(r=e(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(e),r))return!0}return!1}toObject(){const e=kt.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(r=>{e.children.push(r.toObject())}),e}isAncestorOf(e){let r=e.getParent();for(;r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(e){const r=kt.prototype.clone.call(this,e);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(e){const r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(e)&&r.push(n)}),r}_clearSelfAndDescendantCache(e){var r;super._clearSelfAndDescendantCache(e),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(e,r,n){const i=this.getLayer(),a=e||i&&i.getCanvas(),o=a&&a.getContext(),s=this._getCanvasCache(),u=s&&s.scene,h=a&&a.isCache;if(!this.isVisible()&&!h)return this;if(u){o.save();const f=this.getAbsoluteTransform(r).getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(e,r){if(!this.shouldDrawHit(r))return this;const n=this.getLayer(),i=e||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache();if(o&&o.hit){a.save();const u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(e,r,n,i){var a;const o=r&&r.getContext(),s=this.clipWidth(),u=this.clipHeight(),h=this.clipFunc(),f=typeof s=="number"&&typeof u=="number"||h,v=n===this;if(f){o.save();const p=this.getAbsoluteTransform(n);let y=p.getMatrix();o.transform(y[0],y[1],y[2],y[3],y[4],y[5]),o.beginPath();let _;if(h)_=h.call(this,o,this);else{const x=this.clipX(),b=this.clipY();o.rect(x||0,b||0,s,u)}o.clip.apply(o,_),y=p.copy().invert().getMatrix(),o.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const g=!v&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";g&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(p){p[e](r,n,i)}),g&&o.restore(),f&&o.restore()}getClientRect(e={}){var r;const n=e.skipTransform,i=e.relativeTo;let a,o,s,u,h={x:1/0,y:1/0,width:0,height:0};const f=this;(r=this.children)===null||r===void 0||r.forEach(function(p){if(!p.visible())return;const y=p.getClientRect({relativeTo:f,skipShadow:e.skipShadow,skipStroke:e.skipStroke});y.width===0&&y.height===0||(a===void 0?(a=y.x,o=y.y,s=y.x+y.width,u=y.y+y.height):(a=Math.min(a,y.x),o=Math.min(o,y.y),s=Math.max(s,y.x+y.width),u=Math.max(u,y.y+y.height)))});const v=this.find("Shape");let g=!1;for(let p=0;p<v.length;p++)if(v[p]._isVisible(this)){g=!0;break}return g&&a!==void 0?h={x:a,y:o,width:s-a,height:u-o}:h={x:0,y:0,width:0,height:0},n?h:this._transformedRect(h,i)}}je.addComponentsGetterSetter(il,"clip",["x","y","width","height"]);je.addGetterSetter(il,"clipX",void 0,Et());je.addGetterSetter(il,"clipY",void 0,Et());je.addGetterSetter(il,"clipWidth",void 0,Et());je.addGetterSetter(il,"clipHeight",void 0,Et());je.addGetterSetter(il,"clipFunc");const hp=new Map,Y6=Ot._global.PointerEvent!==void 0;function Bg(t){return hp.get(t)}function Wm(t){return{evt:t,pointerId:t.pointerId}}function X6(t,e){return hp.get(t)===e}function K6(t,e){Qd(t),e.getStage()&&(hp.set(t,e),Y6&&e._fire("gotpointercapture",Wm(new PointerEvent("gotpointercapture"))))}function Qd(t,e){const r=hp.get(t);if(!r)return;const n=r.getStage();n&&n.content,hp.delete(t),Y6&&r._fire("lostpointercapture",Wm(new PointerEvent("lostpointercapture")))}const qE="Stage",UE="string",D5="px",HE="mouseout",Z6="mouseleave",Q6="mouseover",J6="mouseenter",e8="mousemove",t8="mousedown",r8="mouseup",Ud="pointermove",Hd="pointerdown",Jh="pointerup",$d="pointercancel",$E="lostpointercapture",m1="pointerout",Gd="pointerleave",y1="pointerover",b1="pointerenter",rm="contextmenu",n8="touchstart",i8="touchend",a8="touchmove",o8="touchcancel",nm="wheel",GE=5,WE=[[J6,"_pointerenter"],[t8,"_pointerdown"],[e8,"_pointermove"],[r8,"_pointerup"],[Z6,"_pointerleave"],[n8,"_pointerdown"],[a8,"_pointermove"],[i8,"_pointerup"],[o8,"_pointercancel"],[Q6,"_pointerover"],[nm,"_wheel"],[rm,"_contextmenu"],[Hd,"_pointerdown"],[Ud,"_pointermove"],[Jh,"_pointerup"],[$d,"_pointercancel"],[Gd,"_pointerleave"],[$E,"_lostpointercapture"]],zg={mouse:{[m1]:HE,[Gd]:Z6,[y1]:Q6,[b1]:J6,[Ud]:e8,[Hd]:t8,[Jh]:r8,[$d]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[m1]:"touchout",[Gd]:"touchleave",[y1]:"touchover",[b1]:"touchenter",[Ud]:a8,[Hd]:n8,[Jh]:i8,[$d]:o8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[m1]:m1,[Gd]:Gd,[y1]:y1,[b1]:b1,[Ud]:Ud,[Hd]:Hd,[Jh]:Jh,[$d]:$d,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Wd=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",zh=t=>{const e=Wd(t);if(e==="pointer")return Ot.pointerEventsEnabled&&zg.pointer;if(e==="touch")return zg.touch;if(e==="mouse")return zg.mouse};function F5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&Ze.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const VE="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);",Jd=[];let D0=class extends il{constructor(e){super(F5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Jd.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{F5(this.attrs)}),this._checkVisibility()}_validateAdd(e){const r=e.getType()==="Layer",n=e.getType()==="FastLayer";r||n||Ze.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===UE){let r;if(e.charAt(0)==="."){const n=e.slice(1);e=document.getElementsByClassName(n)[0]}else e.charAt(0)!=="#"?r=e:r=e.slice(1),e=document.getElementById(r);if(!e)throw"Can not find container in document with id "+r}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,r=e.length;for(let n=0;n<r;n++)e[n].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),il.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&Ze._isInDocument(e)&&this.container().removeChild(e);const r=Jd.indexOf(this);return r>-1&&Jd.splice(r,1),Ze.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(Ze.warn(VE),null)}_getPointerById(e){return this._pointerPositions.find(r=>r.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const r=new sf({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=r.getContext()._context,i=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),i.forEach(function(a){if(!a.isVisible())return;const o=a._toKonvaCanvas(e);n.drawImage(o._canvas,e.x,e.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),r}getIntersection(e){if(!e)return null;const r=this.children,n=r.length,i=n-1;for(let a=i;a>=0;a--){const o=r[a].getIntersection(e);if(o)return o}return null}_resizeDOM(){const e=this.width(),r=this.height();this.content&&(this.content.style.width=e+D5,this.content.style.height=r+D5),this.bufferCanvas.setSize(e,r),this.bufferHitCanvas.setSize(e,r),this.children.forEach(n=>{n.setSize({width:e,height:r}),n.draw()})}add(e,...r){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);const n=this.children.length;return n>GE&&Ze.warn("The stage has "+n+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Ot.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return X6(e,this)}setPointerCapture(e){K6(e,this)}releaseCapture(e){Qd(e)}getLayers(){return this.children}_bindContentEvents(){Ot.isBrowser&&WE.forEach(([e,r])=>{this.content.addEventListener(e,n=>{this[r](n)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const r=zh(e.type);r&&this._fire(r.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const r=zh(e.type);r&&this._fire(r.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let r=this[e+"targetShape"];return r&&!r.getStage()&&(r=null),r}_pointerleave(e){const r=zh(e.type),n=Wd(e.type);if(!r)return;this.setPointersPositions(e);const i=this._getTargetShape(n),a=!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled;i&&a?(i._fireAndBubble(r.pointerout,{evt:e}),i._fireAndBubble(r.pointerleave,{evt:e}),this._fire(r.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):a&&(this._fire(r.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(r.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const r=zh(e.type),n=Wd(e.type);if(!r)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(a=>{const o=this.getIntersection(a);if(yn.justDragged=!1,Ot["_"+n+"ListenClick"]=!0,!o||!o.isListening()){this[n+"ClickStartShape"]=void 0;return}Ot.capturePointerEventsEnabled&&o.setPointerCapture(a.id),this[n+"ClickStartShape"]=o,o._fireAndBubble(r.pointerdown,{evt:e,pointerId:a.id}),i=!0;const s=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&s&&e.preventDefault()}),i||this._fire(r.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const r=zh(e.type),n=Wd(e.type);if(!r)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(Ot.isDragging()&&yn.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled))return;const o={};let s=!1;const u=this._getTargetShape(n);this._changedPointerPositions.forEach(h=>{const f=Bg(h.id)||this.getIntersection(h),v=h.id,g={evt:e,pointerId:v},p=u!==f;if(p&&u&&(u._fireAndBubble(r.pointerout,{...g},f),u._fireAndBubble(r.pointerleave,{...g},f)),f){if(o[f._id])return;o[f._id]=!0}f&&f.isListening()?(s=!0,p&&(f._fireAndBubble(r.pointerover,{...g},u),f._fireAndBubble(r.pointerenter,{...g},u),this[n+"targetShape"]=f),f._fireAndBubble(r.pointermove,{...g})):u&&(this._fire(r.pointerover,{evt:e,target:this,currentTarget:this,pointerId:v}),this[n+"targetShape"]=null)}),s||this._fire(r.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const r=zh(e.type),n=Wd(e.type);if(!r)return;this.setPointersPositions(e);const i=this[n+"ClickStartShape"],a=this[n+"ClickEndShape"],o={};let s=!1;this._changedPointerPositions.forEach(u=>{const h=Bg(u.id)||this.getIntersection(u);if(h){if(h.releaseCapture(u.id),o[h._id])return;o[h._id]=!0}const f=u.id,v={evt:e,pointerId:f};let g=!1;Ot["_"+n+"InDblClickWindow"]?(g=!0,clearTimeout(this[n+"DblTimeout"])):yn.justDragged||(Ot["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout(function(){Ot["_"+n+"InDblClickWindow"]=!1},Ot.dblClickWindow),h&&h.isListening()?(s=!0,this[n+"ClickEndShape"]=h,h._fireAndBubble(r.pointerup,{...v}),Ot["_"+n+"ListenClick"]&&i&&i===h&&(h._fireAndBubble(r.pointerclick,{...v}),g&&a&&a===h&&h._fireAndBubble(r.pointerdblclick,{...v}))):(this[n+"ClickEndShape"]=null,s||(this._fire(r.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),s=!0),Ot["_"+n+"ListenClick"]&&this._fire(r.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:f}),g&&this._fire(r.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:f}))}),s||this._fire(r.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ot["_"+n+"ListenClick"]=!1,e.cancelable&&n!=="touch"&&n!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const r=this.getIntersection(this.getPointerPosition());r&&r.isListening()?r._fireAndBubble(rm,{evt:e}):this._fire(rm,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const r=this.getIntersection(this.getPointerPosition());r&&r.isListening()?r._fireAndBubble(nm,{evt:e}):this._fire(nm,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const r=Bg(e.pointerId)||this.getIntersection(this.getPointerPosition());r&&r._fireAndBubble(Jh,Wm(e)),Qd(e.pointerId)}_lostpointercapture(e){Qd(e.pointerId)}setPointersPositions(e){const r=this._getContentPosition();let n=null,i=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,a=>{this._pointerPositions.push({id:a.identifier,x:(a.clientX-r.left)/r.scaleX,y:(a.clientY-r.top)/r.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,a=>{this._changedPointerPositions.push({id:a.identifier,x:(a.clientX-r.left)/r.scaleX,y:(a.clientY-r.top)/r.scaleY})})):(n=(e.clientX-r.left)/r.scaleX,i=(e.clientY-r.top)/r.scaleY,this.pointerPos={x:n,y:i},this._pointerPositions=[{x:n,y:i,id:Ze._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:i,id:Ze._getFirstPointerId(e)}])}_setPointerPosition(e){Ze.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new sf({width:this.width(),height:this.height()}),this.bufferHitCanvas=new $m({pixelRatio:1,width:this.width(),height:this.height()}),!Ot.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}cache(){return Ze.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(e){e.batchDraw()}),this}};D0.prototype.nodeType=qE;Di(D0);je.addGetterSetter(D0,"container");Ot.isBrowser&&document.addEventListener("visibilitychange",()=>{Jd.forEach(t=>{t.batchDraw()})});const s8="hasShadow",l8="shadowRGBA",u8="patternImage",c8="linearGradient",f8="radialGradient";let w1;function qg(){return w1||(w1=Ze.createCanvasElement().getContext("2d"),w1)}const ep={};function YE(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function XE(t){t.stroke()}function KE(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function ZE(t){t.stroke()}function QE(){this._clearCache(s8)}function JE(){this._clearCache(l8)}function eA(){this._clearCache(u8)}function tA(){this._clearCache(c8)}function rA(){this._clearCache(f8)}let mt=class extends kt{constructor(e){super(e);let r;for(;r=Ze.getRandomColor(),!(r&&!(r in ep)););this.colorKey=r,ep[r]=this}getContext(){return Ze.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return Ze.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(s8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(u8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const r=qg().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(r&&r.setTransform){const n=new tl;n.translate(this.fillPatternX(),this.fillPatternY()),n.rotate(Ot.getAngle(this.fillPatternRotation())),n.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),n.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=n.getMatrix(),a=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);r.setTransform(a)}return r}}_getLinearGradient(){return this._getCache(c8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const r=qg(),n=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),a=r.createLinearGradient(n.x,n.y,i.x,i.y);for(let o=0;o<e.length;o+=2)a.addColorStop(e[o],e[o+1]);return a}}_getRadialGradient(){return this._getCache(f8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const r=qg(),n=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),a=r.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius());for(let o=0;o<e.length;o+=2)a.addColorStop(e[o],e[o+1]);return a}}getShadowRGBA(){return this._getCache(l8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=Ze.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.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 e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const r=this.getStage();if(!r)return!1;const n=r.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return kt.prototype.destroy.call(this),delete ep[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var r;if(!((r=this.attrs.perfectDrawEnabled)!==null&&r!==void 0?r:!0))return!1;const i=e||this.hasFill(),a=this.hasStroke(),o=this.getAbsoluteOpacity()!==1;if(i&&a&&o)return!0;const s=this.hasShadow(),u=this.shadowForStrokeEnabled();return!!(i&&a&&s&&u)}setStrokeHitEnabled(e){Ze.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let r=!1,n=this.getParent();for(;n;){if(n.isCached()){r=!0;break}n=n.getParent()}const i=e.skipTransform,a=e.relativeTo||r&&this.getStage()||void 0,o=this.getSelfRect(),u=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,h=o.width+u,f=o.height+u,v=!e.skipShadow&&this.hasShadow(),g=v?this.shadowOffsetX():0,p=v?this.shadowOffsetY():0,y=h+Math.abs(g),_=f+Math.abs(p),x=v&&this.shadowBlur()||0,b=y+x*2,E=_+x*2,k={width:b,height:E,x:-(u/2+x)+Math.min(g,0)+o.x,y:-(u/2+x)+Math.min(p,0)+o.y};return i?k:this._transformedRect(k,a)}drawScene(e,r,n){const i=this.getLayer(),a=e||i.getCanvas(),o=a.getContext(),s=this._getCanvasCache(),u=this.getSceneFunc(),h=this.hasShadow();let f;const v=r===this;if(!this.isVisible()&&!v)return this;if(s){o.save();const g=this.getAbsoluteTransform(r).getMatrix();return o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!u)return this;if(o.save(),this._useBufferCanvas()){f=this.getStage();const g=n||f.bufferCanvas,p=g.getContext();p.clear(),p.save(),p._applyLineJoin(this),p._applyMiterLimit(this);const y=this.getAbsoluteTransform(r).getMatrix();p.transform(y[0],y[1],y[2],y[3],y[4],y[5]),u.call(this,p,this),p.restore();const _=g.pixelRatio;h&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(g._canvas,g.x||0,g.y||0,g.width/_,g.height/_)}else{if(o._applyLineJoin(this),o._applyMiterLimit(this),!v){const g=this.getAbsoluteTransform(r).getMatrix();o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}h&&o._applyShadow(this),u.call(this,o,this)}return o.restore(),this}drawHit(e,r,n=!1){if(!this.shouldDrawHit(r,n))return this;const i=this.getLayer(),a=e||i.hitCanvas,o=a&&a.getContext(),s=this.hitFunc()||this.sceneFunc(),u=this._getCanvasCache(),h=u&&u.hit;if(this.colorKey||Ze.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),h){o.save();const v=this.getAbsoluteTransform(r).getMatrix();return o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),!(this===r)){const v=this.getAbsoluteTransform(r).getMatrix();o.transform(v[0],v[1],v[2],v[3],v[4],v[5])}return s.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){const r=this._getCanvasCache(),n=this._getCachedSceneCanvas(),i=r.hit,a=i.getContext(),o=i.getWidth(),s=i.getHeight();a.clear(),a.drawImage(n._canvas,0,0,o,s);try{const u=a.getImageData(0,0,o,s),h=u.data,f=h.length,v=Ze._hexToRgb(this.colorKey);for(let g=0;g<f;g+=4)h[g+3]>e?(h[g]=v.r,h[g+1]=v.g,h[g+2]=v.b,h[g+3]=255):h[g+3]=0;a.putImageData(u,0,0)}catch(u){Ze.error("Unable to draw hit graph from cached scene canvas. "+u.message)}return this}hasPointerCapture(e){return X6(e,this)}setPointerCapture(e){K6(e,this)}releaseCapture(e){Qd(e)}};mt.prototype._fillFunc=YE;mt.prototype._strokeFunc=XE;mt.prototype._fillFuncHit=KE;mt.prototype._strokeFuncHit=ZE;mt.prototype._centroid=!1;mt.prototype.nodeType="Shape";Di(mt);mt.prototype.eventListeners={};mt.prototype.on.call(mt.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",QE);mt.prototype.on.call(mt.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",JE);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",eA);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",tA);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",rA);je.addGetterSetter(mt,"stroke",void 0,V6());je.addGetterSetter(mt,"strokeWidth",2,Et());je.addGetterSetter(mt,"fillAfterStrokeEnabled",!1);je.addGetterSetter(mt,"hitStrokeWidth","auto",Gm());je.addGetterSetter(mt,"strokeHitEnabled",!0,iu());je.addGetterSetter(mt,"perfectDrawEnabled",!0,iu());je.addGetterSetter(mt,"shadowForStrokeEnabled",!0,iu());je.addGetterSetter(mt,"lineJoin");je.addGetterSetter(mt,"lineCap");je.addGetterSetter(mt,"miterLimit");je.addGetterSetter(mt,"sceneFunc");je.addGetterSetter(mt,"hitFunc");je.addGetterSetter(mt,"dash");je.addGetterSetter(mt,"dashOffset",0,Et());je.addGetterSetter(mt,"shadowColor",void 0,ph());je.addGetterSetter(mt,"shadowBlur",0,Et());je.addGetterSetter(mt,"shadowOpacity",1,Et());je.addComponentsGetterSetter(mt,"shadowOffset",["x","y"]);je.addGetterSetter(mt,"shadowOffsetX",0,Et());je.addGetterSetter(mt,"shadowOffsetY",0,Et());je.addGetterSetter(mt,"fillPatternImage");je.addGetterSetter(mt,"fill",void 0,V6());je.addGetterSetter(mt,"fillPatternX",0,Et());je.addGetterSetter(mt,"fillPatternY",0,Et());je.addGetterSetter(mt,"fillLinearGradientColorStops");je.addGetterSetter(mt,"strokeLinearGradientColorStops");je.addGetterSetter(mt,"fillRadialGradientStartRadius",0);je.addGetterSetter(mt,"fillRadialGradientEndRadius",0);je.addGetterSetter(mt,"fillRadialGradientColorStops");je.addGetterSetter(mt,"fillPatternRepeat","repeat");je.addGetterSetter(mt,"fillEnabled",!0);je.addGetterSetter(mt,"strokeEnabled",!0);je.addGetterSetter(mt,"shadowEnabled",!0);je.addGetterSetter(mt,"dashEnabled",!0);je.addGetterSetter(mt,"strokeScaleEnabled",!0);je.addGetterSetter(mt,"fillPriority","color");je.addComponentsGetterSetter(mt,"fillPatternOffset",["x","y"]);je.addGetterSetter(mt,"fillPatternOffsetX",0,Et());je.addGetterSetter(mt,"fillPatternOffsetY",0,Et());je.addComponentsGetterSetter(mt,"fillPatternScale",["x","y"]);je.addGetterSetter(mt,"fillPatternScaleX",1,Et());je.addGetterSetter(mt,"fillPatternScaleY",1,Et());je.addComponentsGetterSetter(mt,"fillLinearGradientStartPoint",["x","y"]);je.addComponentsGetterSetter(mt,"strokeLinearGradientStartPoint",["x","y"]);je.addGetterSetter(mt,"fillLinearGradientStartPointX",0);je.addGetterSetter(mt,"strokeLinearGradientStartPointX",0);je.addGetterSetter(mt,"fillLinearGradientStartPointY",0);je.addGetterSetter(mt,"strokeLinearGradientStartPointY",0);je.addComponentsGetterSetter(mt,"fillLinearGradientEndPoint",["x","y"]);je.addComponentsGetterSetter(mt,"strokeLinearGradientEndPoint",["x","y"]);je.addGetterSetter(mt,"fillLinearGradientEndPointX",0);je.addGetterSetter(mt,"strokeLinearGradientEndPointX",0);je.addGetterSetter(mt,"fillLinearGradientEndPointY",0);je.addGetterSetter(mt,"strokeLinearGradientEndPointY",0);je.addComponentsGetterSetter(mt,"fillRadialGradientStartPoint",["x","y"]);je.addGetterSetter(mt,"fillRadialGradientStartPointX",0);je.addGetterSetter(mt,"fillRadialGradientStartPointY",0);je.addComponentsGetterSetter(mt,"fillRadialGradientEndPoint",["x","y"]);je.addGetterSetter(mt,"fillRadialGradientEndPointX",0);je.addGetterSetter(mt,"fillRadialGradientEndPointY",0);je.addGetterSetter(mt,"fillPatternRotation",0);je.addGetterSetter(mt,"fillRule",void 0,ph());je.backCompat(mt,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const nA="#",iA="beforeDraw",aA="draw",h8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],oA=h8.length;let gh=class extends il{constructor(e){super(e),this.canvas=new sf,this.hitCanvas=new $m({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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),e<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[e+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){kt.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!kt.prototype.moveUp.call(this))return!1;const r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(kt.prototype.moveDown.call(this)){const e=this.getStage();if(e){const r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(kt.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return kt.prototype.remove.call(this),e&&e.parentNode&&Ze._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:r}){return this.canvas.setSize(e,r),this.hitCanvas.setSize(e,r),this._setSmoothEnabled(),this}_validateAdd(e){const r=e.getType();r!=="Group"&&r!=="Shape"&&Ze.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),kt.prototype._toKonvaCanvas.call(this,e)}_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(){Ze.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ze.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ze.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let r=1,n=!1;for(;;){for(let i=0;i<oA;i++){const a=h8[i],o=this._getIntersection({x:e.x+a.x*r,y:e.y+a.y*r}),s=o.shape;if(s)return s;if(n=!!o.antialiased,!o.antialiased)break}if(n)r+=1;else return null}}_getIntersection(e){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(e.x*r),Math.round(e.y*r),1,1).data,i=n[3];if(i===255){const a=Ze._rgbToHex(n[0],n[1],n[2]),o=ep[nA+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,r,n){const i=this.getLayer(),a=e||i&&i.getCanvas();return this._fire(iA,{node:this}),this.clearBeforeDraw()&&a.getContext().clear(),il.prototype.drawScene.call(this,a,r,n),this._fire(aA,{node:this}),this}drawHit(e,r){const n=this.getLayer(),i=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),il.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return Ze.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};gh.prototype.nodeType="Layer";Di(gh);je.addGetterSetter(gh,"imageSmoothingEnabled",!0);je.addGetterSetter(gh,"clearBeforeDraw",!0);je.addGetterSetter(gh,"hitGraphEnabled",!0,iu());class Vm extends gh{constructor(e){super(e),this.listening(!1),Ze.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Vm.prototype.nodeType="FastLayer";Di(Vm);let cd=class extends il{_validateAdd(e){const r=e.getType();r!=="Group"&&r!=="Shape"&&Ze.throw("You may only add groups and shapes to groups.")}};cd.prototype.nodeType="Group";Di(cd);const Ug=function(){return Kf.performance&&Kf.performance.now?function(){return Kf.performance.now()}:function(){return new Date().getTime()}}();let yd=class Vh{constructor(e,r){this.id=Vh.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Ug(),frameRate:0},this.func=e,this.setLayers(r)}setLayers(e){let r=[];return e&&(r=Array.isArray(e)?e:[e]),this.layers=r,this}getLayers(){return this.layers}addLayer(e){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const r=Vh.animations,n=r.length;for(let i=0;i<n;i++)if(r[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Ug(),Vh._addAnimation(this),this}stop(){return Vh._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const r=e.id,n=this.animations,i=n.length;for(let a=0;a<i;a++)if(n[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const e={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject(Ug());const s=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let h=0;h<s;h++){const f=a[h];f._id!==void 0&&(e[f._id]=f)}}for(const n in e)e.hasOwnProperty(n)&&e[n].batchDraw()}static _animationLoop(){const e=Vh;e.animations.length?(e._runFrames(),Ze.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Ze.requestAnimFrame(this._animationLoop))}};yd.animations=[];yd.animIdCounter=0;yd.animRunning=!1;const sA={node:1,duration:1,easing:1,onFinish:1,yoyo:1},lA=1,B5=2,z5=3,q5=["fill","stroke","shadowColor"];let uA=0;class cA{constructor(e,r,n,i,a,o,s){this.prop=e,this.propFunc=r,this.begin=i,this._pos=i,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=a-this.begin,this.pause()}fire(e){const r=this[e];r&&r()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=B5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=z5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===B5?this.setTime(e):this.state===z5&&this.setTime(this.duration-e)}pause(){this.state=lA,this.fire("onPause")}getTimer(){return new Date().getTime()}}class ri{constructor(e){const r=this,n=e.node,i=n._id,a=e.easing||tp.Linear,o=!!e.yoyo;let s,u;typeof e.duration>"u"?s=.3:e.duration===0?s=.001:s=e.duration,this.node=n,this._id=uA++;const h=n.getLayer()||(n instanceof Ot.Stage?n.getLayers():null);h||Ze.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new yd(function(){r.tween.onEnterFrame()},h),this.tween=new cA(u,function(f){r._tweenFunc(f)},a,0,1,s*1e3,o),this._addListeners(),ri.attrs[i]||(ri.attrs[i]={}),ri.attrs[i][this._id]||(ri.attrs[i][this._id]={}),ri.tweens[i]||(ri.tweens[i]={});for(u in e)sA[u]===void 0&&this._addAttr(u,e[u]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,r){const n=this.node,i=n._id;let a,o,s,u,h;const f=ri.tweens[i][e];f&&delete ri.attrs[i][f][e];let v=n.getAttr(e);if(Ze._isArray(r))if(a=[],o=Math.max(r.length,v.length),e==="points"&&r.length!==v.length&&(r.length>v.length?(u=v,v=Ze._prepareArrayForTween(v,r,n.closed())):(s=r,r=Ze._prepareArrayForTween(r,v,n.closed()))),e.indexOf("fill")===0)for(let g=0;g<o;g++)if(g%2===0)a.push(r[g]-v[g]);else{const p=Ze.colorToRGBA(v[g]);h=Ze.colorToRGBA(r[g]),v[g]=p,a.push({r:h.r-p.r,g:h.g-p.g,b:h.b-p.b,a:h.a-p.a})}else for(let g=0;g<o;g++)a.push(r[g]-v[g]);else q5.indexOf(e)!==-1?(v=Ze.colorToRGBA(v),h=Ze.colorToRGBA(r),a={r:h.r-v.r,g:h.g-v.g,b:h.b-v.b,a:h.a-v.a}):a=r-v;ri.attrs[i][this._id][e]={start:v,diff:a,end:r,trueEnd:s,trueStart:u},ri.tweens[i][e]=this._id}_tweenFunc(e){const r=this.node,n=ri.attrs[r._id][this._id];let i,a,o,s,u,h,f,v;for(i in n){if(a=n[i],o=a.start,s=a.diff,v=a.end,Ze._isArray(o))if(u=[],f=Math.max(o.length,v.length),i.indexOf("fill")===0)for(h=0;h<f;h++)h%2===0?u.push((o[h]||0)+s[h]*e):u.push("rgba("+Math.round(o[h].r+s[h].r*e)+","+Math.round(o[h].g+s[h].g*e)+","+Math.round(o[h].b+s[h].b*e)+","+(o[h].a+s[h].a*e)+")");else for(h=0;h<f;h++)u.push((o[h]||0)+s[h]*e);else q5.indexOf(i)!==-1?u="rgba("+Math.round(o.r+s.r*e)+","+Math.round(o.g+s.g*e)+","+Math.round(o.b+s.b*e)+","+(o.a+s.a*e)+")":u=o+s*e;r.setAttr(i,u)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,r=ri.attrs[e._id][this._id];r.points&&r.points.trueEnd&&e.setAttr("points",r.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,r=ri.attrs[e._id][this._id];r.points&&r.points.trueStart&&e.points(r.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,r=this._id,n=ri.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const i in n)delete ri.tweens[e][i];delete ri.attrs[e][r],ri.tweens[e]&&(Object.keys(ri.tweens[e]).length===0&&delete ri.tweens[e],Object.keys(ri.attrs[e]).length===0&&delete ri.attrs[e])}}ri.attrs={};ri.tweens={};kt.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new ri(t).play()};const tp={BackEaseIn(t,e,r,n){return r*(t/=n)*t*((1.70158+1)*t-1.70158)+e},BackEaseOut(t,e,r,n){return r*((t=t/n-1)*t*((1.70158+1)*t+1.70158)+1)+e},BackEaseInOut(t,e,r,n){let i=1.70158;return(t/=n/2)<1?r/2*(t*t*(((i*=1.525)+1)*t-i))+e:r/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,r,n,i,a){let o=0;return t===0?e:(t/=n)===1?e+r:(a||(a=n*.3),!i||i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a))+e)},ElasticEaseOut(t,e,r,n,i,a){let o=0;return t===0?e:(t/=n)===1?e+r:(a||(a=n*.3),!i||i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),i*Math.pow(2,-10*t)*Math.sin((t*n-o)*(2*Math.PI)/a)+r+e)},ElasticEaseInOut(t,e,r,n,i,a){let o=0;return t===0?e:(t/=n/2)===2?e+r:(a||(a=n*(.3*1.5)),!i||i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)*.5+r+e)},BounceEaseOut(t,e,r,n){return(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn(t,e,r,n){return r-tp.BounceEaseOut(n-t,0,r,n)+e},BounceEaseInOut(t,e,r,n){return t<n/2?tp.BounceEaseIn(t*2,0,r,n)*.5+e:tp.BounceEaseOut(t*2-n,0,r,n)*.5+r*.5+e},EaseIn(t,e,r,n){return r*(t/=n)*t+e},EaseOut(t,e,r,n){return-r*(t/=n)*(t-2)+e},EaseInOut(t,e,r,n){return(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e},StrongEaseIn(t,e,r,n){return r*(t/=n)*t*t*t*t+e},StrongEaseOut(t,e,r,n){return r*((t=t/n-1)*t*t*t*t+1)+e},StrongEaseInOut(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e},Linear(t,e,r,n){return r*t/n+e}},oh=Ze._assign(Ot,{Util:Ze,Transform:tl,Node:kt,Container:il,Stage:D0,stages:Jd,Layer:gh,FastLayer:Vm,Group:cd,DD:yn,Shape:mt,shapes:ep,Animation:yd,Tween:ri,Easings:tp,Context:I0,Canvas:Hm});let bc=class extends mt{_sceneFunc(e){const r=Ot.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,r,n),e.arc(0,0,this.innerRadius(),r,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=Ot.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,s=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),h=a*(a>0?e:r),f=o*r,v=s*(s>0?e:r),g=u*(u>0?r:e);return{x:h,y:n?-1*g:v,width:f-h,height:g-v}}};bc.prototype._centroid=!0;bc.prototype.className="Arc";bc.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Di(bc);je.addGetterSetter(bc,"innerRadius",0,Et());je.addGetterSetter(bc,"outerRadius",0,Et());je.addGetterSetter(bc,"angle",0,Et());je.addGetterSetter(bc,"clockwise",!1,iu());function im(t,e,r,n,i,a,o){const s=Math.sqrt(Math.pow(r-t,2)+Math.pow(n-e,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),h=o*s/(s+u),f=o*u/(s+u),v=r-h*(i-t),g=n-h*(a-e),p=r+f*(i-t),y=n+f*(a-e);return[v,g,p,y]}function U5(t,e){const r=t.length,n=[];for(let i=2;i<r-2;i+=2){const a=im(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(a[0])||(n.push(a[0]),n.push(a[1]),n.push(t[i]),n.push(t[i+1]),n.push(a[2]),n.push(a[3]))}return n}let wc=class extends mt{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier();if(!n)return;let s=0;if(e.beginPath(),e.moveTo(r[0],r[1]),i!==0&&n>4){const u=this.getTensionPoints(),h=u.length;for(s=a?0:4,a||e.quadraticCurveTo(u[0],u[1],u[2],u[3]);s<h-2;)e.bezierCurveTo(u[s++],u[s++],u[s++],u[s++],u[s++],u[s++]);a||e.quadraticCurveTo(u[h-2],u[h-1],r[n-2],r[n-1])}else if(o)for(s=2;s<n;)e.bezierCurveTo(r[s++],r[s++],r[s++],r[s++],r[s++],r[s++]);else for(s=2;s<n;s+=2)e.lineTo(r[s],r[s+1]);a?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():U5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),r=e.length,n=this.tension(),i=im(e[r-2],e[r-1],e[0],e[1],e[2],e[3],n),a=im(e[r-4],e[r-3],e[r-2],e[r-1],e[0],e[1],n),o=U5(e,n);return[i[2],i[3]].concat(o).concat([a[0],a[1],e[r-2],e[r-1],a[2],a[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let r=e[0],n=e[0],i=e[1],a=e[1],o,s;for(let u=0;u<e.length/2;u++)o=e[u*2],s=e[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,s),a=Math.max(a,s);return{x:r,y:i,width:n-r,height:a-i}}};wc.prototype.className="Line";wc.prototype._attrsAffectingSize=["points","bezier","tension"];Di(wc);je.addGetterSetter(wc,"closed",!1);je.addGetterSetter(wc,"bezier",!1);je.addGetterSetter(wc,"tension",0,Et());je.addGetterSetter(wc,"points",[],kE());const fA=[[],[],[-.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]],hA=[[],[],[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]],dA=[[1],[1,1],[1,2,1],[1,3,3,1]],H5=(t,e,r)=>{let n,i;const o=r/2;n=0;for(let s=0;s<20;s++)i=o*fA[20][s]+o,n+=hA[20][s]*pA(t,e,i);return o*n},$5=(t,e,r)=>{r===void 0&&(r=1);const n=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],a=2*t[1]-2*t[0],o=2*e[1]-2*e[0],s=4*(n*n+i*i),u=4*(n*a+i*o),h=a*a+o*o;if(s===0)return r*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));const f=u/(2*s),v=h/s,g=r+f,p=v-f*f,y=g*g+p>0?Math.sqrt(g*g+p):0,_=f*f+p>0?Math.sqrt(f*f+p):0,x=f+Math.sqrt(f*f+p)!==0?p*Math.log(Math.abs((g+y)/(f+_))):0;return Math.sqrt(s)/2*(g*y-f*_+x)};function pA(t,e,r){const n=am(1,r,t),i=am(1,r,e),a=n*n+i*i;return Math.sqrt(a)}const am=(t,e,r)=>{const n=r.length-1;let i,a;if(n===0)return 0;if(t===0){a=0;for(let o=0;o<=n;o++)a+=dA[n][o]*Math.pow(1-e,n-o)*Math.pow(e,o)*r[o];return a}else{i=new Array(n);for(let o=0;o<n;o++)i[o]=n*(r[o+1]-r[o]);return am(t-1,e,i)}},G5=(t,e,r)=>{let n=1,i=t/e,a=(t-r(i))/e,o=0;for(;n>.001;){const s=r(i+a),u=Math.abs(t-s)/e;if(u<n)n=u,i+=a;else{const h=r(i-a),f=Math.abs(t-h)/e;f<n?(n=f,i-=a):a/=2}if(o++,o>500)break}return i};let Pl=class Cs extends mt{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Cs.parsePathData(this.data()),this.pathLength=Cs.getPathLength(this.dataArray)}_sceneFunc(e){const r=this.dataArray;e.beginPath();let n=!1;for(let i=0;i<r.length;i++){const a=r[i].command,o=r[i].points;switch(a){case"L":e.lineTo(o[0],o[1]);break;case"M":e.moveTo(o[0],o[1]);break;case"C":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":e.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":const s=o[0],u=o[1],h=o[2],f=o[3],v=o[4],g=o[5],p=o[6],y=o[7],_=h>f?h:f,x=h>f?1:h/f,b=h>f?f/h:1;e.translate(s,u),e.rotate(p),e.scale(x,b),e.arc(0,0,_,v,v+g,1-y),e.scale(1/x,1/b),e.rotate(-p),e.translate(-s,-u);break;case"z":n=!0,e.closePath();break}}!n&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(u){if(u.command==="A"){const h=u.points[4],f=u.points[5],v=u.points[4]+f;let g=Math.PI/180;if(Math.abs(h-v)<g&&(g=Math.abs(h-v)),f<0)for(let p=h-g;p>v;p-=g){const y=Cs.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);e.push(y.x,y.y)}else for(let p=h+g;p<v;p+=g){const y=Cs.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);e.push(y.x,y.y)}}else if(u.command==="C")for(let h=0;h<=1;h+=.01){const f=Cs.getPointOnCubicBezier(h,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);e.push(f.x,f.y)}else e=e.concat(u.points)});let r=e[0],n=e[0],i=e[1],a=e[1],o,s;for(let u=0;u<e.length/2;u++)o=e[u*2],s=e[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(s)||(i=Math.min(i,s),a=Math.max(a,s));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(e){return Cs.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,r,n,i){return Math.sqrt((n-e)*(n-e)+(i-r)*(i-r))}static getPathLength(e){let r=0;for(let n=0;n<e.length;++n)r+=e[n].pathLength;return r}static getPointAtLengthOfDataArray(e,r){let n,i=0,a=r.length;if(!a)return null;for(;i<a&&e>r[i].pathLength;)e-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(e<.01)return r[i].command==="M"?(n=r[i].points.slice(0,2),{x:n[0],y:n[1]}):{x:r[i].start.x,y:r[i].start.y};const o=r[i],s=o.points;switch(o.command){case"L":return Cs.getPointOnLine(e,o.start.x,o.start.y,s[0],s[1]);case"C":return Cs.getPointOnCubicBezier(G5(e,Cs.getPathLength(r),_=>H5([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Cs.getPointOnQuadraticBezier(G5(e,Cs.getPathLength(r),_=>$5([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case"A":const u=s[0],h=s[1],f=s[2],v=s[3],g=s[5],p=s[6];let y=s[4];return y+=g*e/o.pathLength,Cs.getPointOnEllipticalArc(u,h,f,v,y,p)}return null}static getPointOnLine(e,r,n,i,a,o,s){o=o??r,s=s??n;const u=this.getLineLength(r,n,i,a);if(u<1e-10)return{x:r,y:n};if(i===r)return{x:o,y:s+(a>n?e:-e)};const h=(a-n)/(i-r),f=Math.sqrt(e*e/(1+h*h))*(i<r?-1:1),v=h*f;if(Math.abs(s-n-h*(o-r))<1e-10)return{x:o+f,y:s+v};const g=((o-r)*(i-r)+(s-n)*(a-n))/(u*u),p=r+g*(i-r),y=n+g*(a-n),_=this.getLineLength(o,s,p,y),x=Math.sqrt(e*e-_*_),b=Math.sqrt(x*x/(1+h*h))*(i<r?-1:1),E=h*b;return{x:p+b,y:y+E}}static getPointOnCubicBezier(e,r,n,i,a,o,s,u,h){function f(x){return x*x*x}function v(x){return 3*x*x*(1-x)}function g(x){return 3*x*(1-x)*(1-x)}function p(x){return(1-x)*(1-x)*(1-x)}const y=u*f(e)+o*v(e)+i*g(e)+r*p(e),_=h*f(e)+s*v(e)+a*g(e)+n*p(e);return{x:y,y:_}}static getPointOnQuadraticBezier(e,r,n,i,a,o,s){function u(p){return p*p}function h(p){return 2*p*(1-p)}function f(p){return(1-p)*(1-p)}const v=o*u(e)+i*h(e)+r*f(e),g=s*u(e)+a*h(e)+n*f(e);return{x:v,y:g}}static getPointOnEllipticalArc(e,r,n,i,a,o){const s=Math.cos(o),u=Math.sin(o),h={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:e+(h.x*s-h.y*u),y:r+(h.x*u+h.y*s)}}static parsePathData(e){if(!e)return[];let r=e;const n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(let v=0;v<n.length;v++)r=r.replace(new RegExp(n[v],"g"),"|"+n[v]);const i=r.split("|"),a=[],o=[];let s=0,u=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let f;for(let v=1;v<i.length;v++){let g=i[v],p=g.charAt(0);for(g=g.slice(1),o.length=0;f=h.exec(g);)o.push(f[0]);let y=[],_=p==="A"||p==="a"?0:-1;for(let x=0,b=o.length;x<b;x++){const E=o[x];if(E==="00"){y.push(0,0),_>=0&&(_+=2,_>=7&&(_-=7));continue}if(_>=0){if(_===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(E)){y.push(parseInt(E[0],10)),y.push(parseInt(E[1],10)),y.push(parseFloat(E.slice(2))),_+=3,_>=7&&(_-=7);continue}if(E==="11"||E==="10"||E==="01"){y.push(parseInt(E[0],10)),y.push(parseInt(E[1],10)),_+=2,_>=7&&(_-=7);continue}if(E==="0"||E==="1"){y.push(parseInt(E,10)),_+=1,_>=7&&(_-=7);continue}}else if(_===4){if(/^[01]\d+(?:\.\d+)?$/.test(E)){y.push(parseInt(E[0],10)),y.push(parseFloat(E.slice(1))),_+=2,_>=7&&(_-=7);continue}if(E==="0"||E==="1"){y.push(parseInt(E,10)),_+=1,_>=7&&(_-=7);continue}}const k=parseFloat(E);isNaN(k)?y.push(0):y.push(k),_+=1,_>=7&&(_-=7)}else{const k=parseFloat(E);isNaN(k)?y.push(0):y.push(k)}}for(;y.length>0&&!isNaN(y[0]);){let x="",b=[];const E=s,k=u;let S,A,M,C,I,F,j,O,T,$;switch(p){case"l":s+=y.shift(),u+=y.shift(),x="L",b.push(s,u);break;case"L":s=y.shift(),u=y.shift(),b.push(s,u);break;case"m":const q=y.shift(),J=y.shift();if(s+=q,u+=J,x="M",a.length>2&&a[a.length-1].command==="z"){for(let ae=a.length-2;ae>=0;ae--)if(a[ae].command==="M"){s=a[ae].points[0]+q,u=a[ae].points[1]+J;break}}b.push(s,u),p="l";break;case"M":s=y.shift(),u=y.shift(),x="M",b.push(s,u),p="L";break;case"h":s+=y.shift(),x="L",b.push(s,u);break;case"H":s=y.shift(),x="L",b.push(s,u);break;case"v":u+=y.shift(),x="L",b.push(s,u);break;case"V":u=y.shift(),x="L",b.push(s,u);break;case"C":b.push(y.shift(),y.shift(),y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"c":b.push(s+y.shift(),u+y.shift(),s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"S":A=s,M=u,S=a[a.length-1],S.command==="C"&&(A=s+(s-S.points[2]),M=u+(u-S.points[3])),b.push(A,M,y.shift(),y.shift()),s=y.shift(),u=y.shift(),x="C",b.push(s,u);break;case"s":A=s,M=u,S=a[a.length-1],S.command==="C"&&(A=s+(s-S.points[2]),M=u+(u-S.points[3])),b.push(A,M,s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"Q":b.push(y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"q":b.push(s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="Q",b.push(s,u);break;case"T":A=s,M=u,S=a[a.length-1],S.command==="Q"&&(A=s+(s-S.points[0]),M=u+(u-S.points[1])),s=y.shift(),u=y.shift(),x="Q",b.push(A,M,s,u);break;case"t":A=s,M=u,S=a[a.length-1],S.command==="Q"&&(A=s+(s-S.points[0]),M=u+(u-S.points[1])),s+=y.shift(),u+=y.shift(),x="Q",b.push(A,M,s,u);break;case"A":C=y.shift(),I=y.shift(),F=y.shift(),j=y.shift(),O=y.shift(),T=s,$=u,s=y.shift(),u=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(T,$,s,u,j,O,C,I,F);break;case"a":C=y.shift(),I=y.shift(),F=y.shift(),j=y.shift(),O=y.shift(),T=s,$=u,s+=y.shift(),u+=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(T,$,s,u,j,O,C,I,F);break}a.push({command:x||p,points:b,start:{x:E,y:k},pathLength:this.calcLength(E,k,x||p,b)})}(p==="z"||p==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,r,n,i){let a,o,s,u;const h=Cs;switch(n){case"L":return h.getLineLength(e,r,i[0],i[1]);case"C":return H5([e,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return $5([e,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;const f=i[4],v=i[5],g=i[4]+v;let p=Math.PI/180;if(Math.abs(f-g)<p&&(p=Math.abs(f-g)),o=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),v<0)for(u=f-p;u>g;u-=p)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=f+p;u<g;u+=p)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],g,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),a}return 0}static convertEndpointToCenterParameterization(e,r,n,i,a,o,s,u,h){const f=h*(Math.PI/180),v=Math.cos(f)*(e-n)/2+Math.sin(f)*(r-i)/2,g=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(r-i)/2,p=v*v/(s*s)+g*g/(u*u);p>1&&(s*=Math.sqrt(p),u*=Math.sqrt(p));let y=Math.sqrt((s*s*(u*u)-s*s*(g*g)-u*u*(v*v))/(s*s*(g*g)+u*u*(v*v)));a===o&&(y*=-1),isNaN(y)&&(y=0);const _=y*s*g/u,x=y*-u*v/s,b=(e+n)/2+Math.cos(f)*_-Math.sin(f)*x,E=(r+i)/2+Math.sin(f)*_+Math.cos(f)*x,k=function(j){return Math.sqrt(j[0]*j[0]+j[1]*j[1])},S=function(j,O){return(j[0]*O[0]+j[1]*O[1])/(k(j)*k(O))},A=function(j,O){return(j[0]*O[1]<j[1]*O[0]?-1:1)*Math.acos(S(j,O))},M=A([1,0],[(v-_)/s,(g-x)/u]),C=[(v-_)/s,(g-x)/u],I=[(-1*v-_)/s,(-1*g-x)/u];let F=A(C,I);return S(C,I)<=-1&&(F=Math.PI),S(C,I)>=1&&(F=0),o===0&&F>0&&(F=F-2*Math.PI),o===1&&F<0&&(F=F+2*Math.PI),[b,E,s,u,M,F,f,o]}};Pl.prototype.className="Path";Pl.prototype._attrsAffectingSize=["data"];Di(Pl);je.addGetterSetter(Pl,"data");class vh extends wc{_sceneFunc(e){super._sceneFunc(e);const r=Math.PI*2,n=this.points();let i=n;const a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());const o=this.pointerLength(),s=n.length;let u,h;if(a){const g=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[s-2],n[s-1]],p=Pl.calcLength(i[i.length-4],i[i.length-3],"C",g),y=Pl.getPointOnQuadraticBezier(Math.min(1,1-o/p),g[0],g[1],g[2],g[3],g[4],g[5]);u=n[s-2]-y.x,h=n[s-1]-y.y}else u=n[s-2]-n[s-4],h=n[s-1]-n[s-3];const f=(Math.atan2(h,u)+r)%r,v=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[s-2],n[s-1]),e.rotate(f),e.moveTo(0,0),e.lineTo(-o,v/2),e.lineTo(-o,-v/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],h=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],h=n[3]-n[1]),e.rotate((Math.atan2(-h,-u)+r)%r),e.moveTo(0,0),e.lineTo(-o,v/2),e.lineTo(-o,-v/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),r=this.pointerWidth()/2;return{x:e.x,y:e.y-r,width:e.width,height:e.height+r*2}}}vh.prototype.className="Arrow";Di(vh);je.addGetterSetter(vh,"pointerLength",10,Et());je.addGetterSetter(vh,"pointerWidth",10,Et());je.addGetterSetter(vh,"pointerAtBeginning",!1);je.addGetterSetter(vh,"pointerAtEnding",!0);let bd=class extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};bd.prototype._centroid=!0;bd.prototype.className="Circle";bd.prototype._attrsAffectingSize=["radius"];Di(bd);je.addGetterSetter(bd,"radius",0,Et());class Ef extends mt{_sceneFunc(e){const r=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),r!==n&&e.scale(1,n/r),e.arc(0,0,r,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Ef.prototype.className="Ellipse";Ef.prototype._centroid=!0;Ef.prototype._attrsAffectingSize=["radiusX","radiusY"];Di(Ef);je.addComponentsGetterSetter(Ef,"radius",["x","y"]);je.addGetterSetter(Ef,"radiusX",0,Et());je.addGetterSetter(Ef,"radiusY",0,Et());let Hu=class d8 extends mt{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",r=>{this._removeImageLoad(r.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),r=this.hasShadow();return e&&r?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const r=this.getWidth(),n=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const s=this.attrs.cropWidth,u=this.attrs.cropHeight;s&&u?o=[a,this.cropX(),this.cropY(),s,u,0,0,r,n]:o=[a,0,0,r,n]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?Ze.drawRoundedRectPath(e,r,n,i):e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){const r=this.width(),n=this.height(),i=this.cornerRadius();e.beginPath(),i?Ze.drawRoundedRectPath(e,r,n,i):e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,r;return(e=this.attrs.width)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var e,r;return(e=this.attrs.height)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(e,r,n=null){const i=Ze.createImageElement();i.onload=function(){const a=new d8({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=e}};Hu.prototype.className="Image";Di(Hu);je.addGetterSetter(Hu,"cornerRadius",0,j0(4));je.addGetterSetter(Hu,"image");je.addComponentsGetterSetter(Hu,"crop",["x","y","width","height"]);je.addGetterSetter(Hu,"cropX",0,Et());je.addGetterSetter(Hu,"cropY",0,Et());je.addGetterSetter(Hu,"cropWidth",0,Et());je.addGetterSetter(Hu,"cropHeight",0,Et());const p8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],gA="Change.konva",vA="none",om="up",sm="right",lm="down",um="left",mA=p8.length;let Ym=class extends cd{constructor(e){super(e),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let r=this,n;const i=function(){r._sync()};for(n=0;n<mA;n++)e.on(p8[n]+gA,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),r=this.getTag(),n,i,a,o,s,u,h;if(e&&r){switch(n=e.width(),i=e.height(),a=r.pointerDirection(),o=r.pointerWidth(),h=r.pointerHeight(),s=0,u=0,a){case om:s=n/2,u=-1*h;break;case sm:s=n+o,u=i/2;break;case lm:s=n/2,u=i+h;break;case um:s=-1*o,u=i/2;break}r.setAttrs({x:-1*s,y:-1*u,width:n,height:i}),e.setAttrs({x:-1*s,y:-1*u})}}};Ym.prototype.className="Label";Di(Ym);let mh=class extends mt{_sceneFunc(e){const r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),s=this.cornerRadius();let u=0,h=0,f=0,v=0;typeof s=="number"?u=h=f=v=Math.min(s,r/2,n/2):(u=Math.min(s[0]||0,r/2,n/2),h=Math.min(s[1]||0,r/2,n/2),v=Math.min(s[2]||0,r/2,n/2),f=Math.min(s[3]||0,r/2,n/2)),e.beginPath(),e.moveTo(u,0),i===om&&(e.lineTo((r-a)/2,0),e.lineTo(r/2,-1*o),e.lineTo((r+a)/2,0)),e.lineTo(r-h,0),e.arc(r-h,h,h,Math.PI*3/2,0,!1),i===sm&&(e.lineTo(r,(n-o)/2),e.lineTo(r+a,n/2),e.lineTo(r,(n+o)/2)),e.lineTo(r,n-v),e.arc(r-v,n-v,v,0,Math.PI/2,!1),i===lm&&(e.lineTo((r+a)/2,n),e.lineTo(r/2,n+o),e.lineTo((r-a)/2,n)),e.lineTo(f,n),e.arc(f,n-f,f,Math.PI/2,Math.PI,!1),i===um&&(e.lineTo(0,(n+o)/2),e.lineTo(-1*a,n/2),e.lineTo(0,(n-o)/2)),e.lineTo(0,u),e.arc(u,u,u,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),s=this.height();return a===om?(r-=i,s+=i):a===lm?s+=i:a===um?(e-=n*1.5,o+=n):a===sm&&(o+=n*1.5),{x:e,y:r,width:o,height:s}}};mh.prototype.className="Tag";Di(mh);je.addGetterSetter(mh,"pointerDirection",vA);je.addGetterSetter(mh,"pointerWidth",0,Et());je.addGetterSetter(mh,"pointerHeight",0,Et());je.addGetterSetter(mh,"cornerRadius",0,j0(4));let Cp=class extends mt{_sceneFunc(e){const r=this.cornerRadius(),n=this.width(),i=this.height();e.beginPath(),r?Ze.drawRoundedRectPath(e,n,i,r):e.rect(0,0,n,i),e.closePath(),e.fillStrokeShape(this)}};Cp.prototype.className="Rect";Di(Cp);je.addGetterSetter(Cp,"cornerRadius",0,j0(4));class Af extends mt{_sceneFunc(e){const r=this._getPoints(),n=this.radius(),i=this.sides(),a=this.cornerRadius();if(e.beginPath(),a)Ze.drawRoundedPolygonPath(e,r,i,n,a);else{e.moveTo(r[0].x,r[0].y);for(let o=1;o<r.length;o++)e.lineTo(r[o].x,r[o].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,r=this.attrs.radius||0,n=[];for(let i=0;i<e;i++)n.push({x:r*Math.sin(i*2*Math.PI/e),y:-1*r*Math.cos(i*2*Math.PI/e)});return n}getSelfRect(){const e=this._getPoints();let r=e[0].x,n=e[0].y,i=e[0].x,a=e[0].y;return e.forEach(o=>{r=Math.min(r,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:r,y:i,width:n-r,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Af.prototype.className="RegularPolygon";Af.prototype._centroid=!0;Af.prototype._attrsAffectingSize=["radius"];Di(Af);je.addGetterSetter(Af,"radius",0,Et());je.addGetterSetter(Af,"sides",0,Et());je.addGetterSetter(Af,"cornerRadius",0,j0(4));const W5=Math.PI*2;class yh extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,W5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),W5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}yh.prototype.className="Ring";yh.prototype._centroid=!0;yh.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Di(yh);je.addGetterSetter(yh,"innerRadius",0,Et());je.addGetterSetter(yh,"outerRadius",0,Et());class $u extends mt{constructor(e){super(e),this._updated=!0,this.anim=new yd(()=>{const r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),s=a[i+0],u=a[i+1],h=a[i+2],f=a[i+3],v=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,h,f),e.closePath(),e.fillStrokeShape(this)),v)if(o){const g=o[r],p=n*2;e.drawImage(v,s,u,h,f,g[p+0],g[p+1],h,f)}else e.drawImage(v,s,u,h,f,0,0,h,f)}_hitFunc(e){const r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),s=a[i+2],u=a[i+3];if(e.beginPath(),o){const h=o[r],f=n*2;e.rect(h[f+0],h[f+1],s,u)}else e.rect(0,0,s,u);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;e<a-1?this.frameIndex(e+1):this.frameIndex(0)}}$u.prototype.className="Sprite";Di($u);je.addGetterSetter($u,"animation");je.addGetterSetter($u,"animations");je.addGetterSetter($u,"frameOffsets");je.addGetterSetter($u,"image");je.addGetterSetter($u,"frameIndex",0,Et());je.addGetterSetter($u,"frameRate",17,Et());je.backCompat($u,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class kf extends mt{_sceneFunc(e){const r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-n);for(let a=1;a<i*2;a++){const o=a%2===0?n:r,s=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);e.lineTo(s,u)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}kf.prototype.className="Star";kf.prototype._centroid=!0;kf.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Di(kf);je.addGetterSetter(kf,"numPoints",5,Et());je.addGetterSetter(kf,"innerRadius",0,Et());je.addGetterSetter(kf,"outerRadius",0,Et());function of(t){return[...t].reduce((e,r,n,i)=>{if(new RegExp("\\p{Emoji}","u").test(r)){const a=i[n+1];a&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(a)?(e.push(r+a),i[n+1]=""):e.push(r)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(r+(i[n+1]||""))?e.push(r+i[n+1]):n>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(r)?e[e.length-1]+=r:r&&e.push(r);return e},[])}const qh="auto",yA="center",g8="inherit",Uh="justify",bA="Change.konva",wA="2d",V5="-",v8="left",_A="text",xA="Text",SA="top",EA="bottom",Y5="middle",m8="normal",AA="px ",_1=" ",kA="right",X5="rtl",PA="word",OA="char",K5="none",Hg="…",y8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],CA=y8.length;function LA(t){return t.split(",").map(e=>{e=e.trim();const r=e.indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return r&&!n&&(e=`"${e}"`),e}).join(", ")}let x1;function $g(){return x1||(x1=Ze.createCanvasElement().getContext(wA),x1)}function NA(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function TA(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function RA(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let pi=class extends mt{constructor(e){super(RA(e)),this._partialTextX=0,this._partialTextY=0;for(let r=0;r<CA;r++)this.on(y8[r]+bA,this._setTextData);this._setTextData()}_sceneFunc(e){var r,n;const i=this.textArr,a=i.length;if(!this.text())return;let o=this.padding(),s=this.fontSize(),u=this.lineHeight()*s,h=this.verticalAlign(),f=this.direction(),v=0,g=this.align(),p=this.getWidth(),y=this.letterSpacing(),_=this.charRenderFunc(),x=this.fill(),b=this.textDecoration(),E=b.indexOf("underline")!==-1,k=b.indexOf("line-through")!==-1,S;f=f===g8?e.direction:f;let A=u/2,M=Y5;if(!Ot.legacyTextRendering){const C=this.measureSize("M");M="alphabetic";const I=(r=C.fontBoundingBoxAscent)!==null&&r!==void 0?r:C.actualBoundingBoxAscent,F=(n=C.fontBoundingBoxDescent)!==null&&n!==void 0?n:C.actualBoundingBoxDescent;A=(I-F)/2+u/2}for(f===X5&&e.setAttr("direction",f),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",M),e.setAttr("textAlign",v8),h===Y5?v=(this.getHeight()-a*u-o*2)/2:h===EA&&(v=this.getHeight()-a*u-o*2),e.translate(o,v+o),S=0;S<a;S++){let C=0,I=0;const F=i[S],j=F.text,O=F.width,T=F.lastInParagraph;if(e.save(),g===kA?C+=p-O-o*2:g===yA&&(C+=(p-O-o*2)/2),E){e.save(),e.beginPath();const $=Ot.legacyTextRendering?Math.round(s/2):Math.round(s/4),q=C,J=A+I+$;e.moveTo(q,J);const ae=g===Uh&&!T?p-o*2:O;e.lineTo(q+Math.round(ae),J),e.lineWidth=s/15;const ie=this._getLinearGradient();e.strokeStyle=ie||x,e.stroke(),e.restore()}if(f!==X5&&(y!==0||g===Uh||_)){const $=j.split(" ").length-1,q=of(j);for(let J=0;J<q.length;J++){const ae=q[J];if(ae===" "&&!T&&g===Uh&&(C+=(p-o*2-O)/$),this._partialTextX=C,this._partialTextY=A+I,this._partialText=ae,_){e.save();const Z=i.slice(0,S).reduce((V,B)=>V+of(B.text).length,0),te=J+Z;_({char:ae,index:te,x:C,y:A+I,lineIndex:S,column:J,isLastInLine:T,width:this.measureSize(ae).width,context:e})}e.fillStrokeShape(this),_&&e.restore(),C+=this.measureSize(ae).width+y}}else y!==0&&e.setAttr("letterSpacing",`${y}px`),this._partialTextX=C,this._partialTextY=A+I,this._partialText=j,e.fillStrokeShape(this);if(k){e.save(),e.beginPath();const $=Ot.legacyTextRendering?0:-Math.round(s/4),q=g===Uh?0:C;e.moveTo(q,A+I+$);const J=g===Uh&&!T?p-o*2:O;e.lineTo(q+Math.round(J),A+I+$),e.lineWidth=s/15;const ae=this._getLinearGradient();e.strokeStyle=ae||x,e.stroke(),e.restore()}e.restore(),a>1&&(A+=u)}}_hitFunc(e){const r=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)}setText(e){const r=Ze._isString(e)?e:e==null?"":e+"";return this._setAttr(_A,r),this}getWidth(){return this.attrs.width===qh||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===qh||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var r,n,i,a,o,s,u,h,f,v,g;let p=$g(),y=this.fontSize(),_;p.save(),p.font=this._getContextFont(),_=p.measureText(e),p.restore();const x=y/100;return{actualBoundingBoxAscent:(r=_.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*x,actualBoundingBoxDescent:(n=_.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(i=_.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*x,actualBoundingBoxRight:(a=_.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*x,alphabeticBaseline:(o=_.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(s=_.emHeightAscent)!==null&&s!==void 0?s:100*x,emHeightDescent:(u=_.emHeightDescent)!==null&&u!==void 0?u:-20*x,fontBoundingBoxAscent:(h=_.fontBoundingBoxAscent)!==null&&h!==void 0?h:91*x,fontBoundingBoxDescent:(f=_.fontBoundingBoxDescent)!==null&&f!==void 0?f:21*x,hangingBaseline:(v=_.hangingBaseline)!==null&&v!==void 0?v:72.80000305175781*x,ideographicBaseline:(g=_.ideographicBaseline)!==null&&g!==void 0?g:-21*x,width:_.width,height:y}}_getContextFont(){return this.fontStyle()+_1+this.fontVariant()+_1+(this.fontSize()+AA)+LA(this.fontFamily())}_addTextLine(e){this.align()===Uh&&(e=e.trim());const n=this._getTextWidth(e);return this.textArr.push({text:e,width:n,lastInParagraph:!1})}_getTextWidth(e){const r=this.letterSpacing(),n=e.length;return $g().measureText(e).width+r*n}_setTextData(){let e=this.text().split(`
56
+ `),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,s=a!==qh&&a!==void 0,u=o!==qh&&o!==void 0,h=this.padding(),f=a-h*2,v=o-h*2,g=0,p=this.wrap(),y=p!==K5,_=p!==OA&&y,x=this.ellipsis();this.textArr=[],$g().font=this._getContextFont();const b=x?this._getTextWidth(Hg):0;for(let E=0,k=e.length;E<k;++E){let S=e[E],A=this._getTextWidth(S);if(s&&A>f)for(;S.length>0;){let M=0,C=of(S).length,I="",F=0;for(;M<C;){const j=M+C>>>1,O=of(S),T=O.slice(0,j+1).join(""),$=this._getTextWidth(T);(x&&u&&g+i>v?$+b:$)<=f?(M=j+1,I=T,F=$):C=j}if(I){if(_){const T=of(S),$=of(I),q=T[$.length],J=q===_1||q===V5;let ae;if(J&&F<=f)ae=$.length;else{const ie=$.lastIndexOf(_1),Z=$.lastIndexOf(V5);ae=Math.max(ie,Z)+1}ae>0&&(M=ae,I=T.slice(0,M).join(""),F=this._getTextWidth(I))}if(I=I.trimRight(),this._addTextLine(I),n=Math.max(n,F),g+=i,this._shouldHandleEllipsis(g)){this._tryToAddEllipsisToLastLine();break}if(S=of(S).slice(M).join("").trimLeft(),S.length>0&&(A=this._getTextWidth(S),A<=f)){this._addTextLine(S),g+=i,n=Math.max(n,A);break}}else break}else this._addTextLine(S),g+=i,n=Math.max(n,A),this._shouldHandleEllipsis(g)&&E<k-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&g+i>v)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(e){const r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==qh&&i!==void 0,o=this.padding(),s=i-o*2;return!(this.wrap()!==K5)||a&&e+n>s}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,r=e!==qh&&e!==void 0,n=this.padding(),i=e-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];!o||!a||(r&&(this._getTextWidth(o.text+Hg)<i||(o.text=o.text.slice(0,o.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Hg))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return e&&r?!0:super._useBufferCanvas()}};pi.prototype._fillFunc=NA;pi.prototype._strokeFunc=TA;pi.prototype.className=xA;pi.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Di(pi);je.overWriteSetter(pi,"width",Gm());je.overWriteSetter(pi,"height",Gm());je.addGetterSetter(pi,"direction",g8);je.addGetterSetter(pi,"fontFamily","Arial");je.addGetterSetter(pi,"fontSize",12,Et());je.addGetterSetter(pi,"fontStyle",m8);je.addGetterSetter(pi,"fontVariant",m8);je.addGetterSetter(pi,"padding",0,Et());je.addGetterSetter(pi,"align",v8);je.addGetterSetter(pi,"verticalAlign",SA);je.addGetterSetter(pi,"lineHeight",1,Et());je.addGetterSetter(pi,"wrap",PA);je.addGetterSetter(pi,"ellipsis",!1,iu());je.addGetterSetter(pi,"letterSpacing",0,Et());je.addGetterSetter(pi,"text","",ph());je.addGetterSetter(pi,"textDecoration","");je.addGetterSetter(pi,"charRenderFunc",void 0);const MA="",b8="normal";function w8(t){t.fillText(this.partialText,0,0)}function _8(t){t.strokeText(this.partialText,0,0)}let Da=class extends mt{constructor(e){super(e),this.dummyCanvas=Ze.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 Pl.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const r=this.pathLength;return e>r?null:Pl.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Pl.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&e.beginPath();for(let o=0;o<a.length;o++){e.save();const s=a[o].p0;e.translate(s.x,s.y),e.rotate(a[o].rotation),this.partialText=a[o].text,e.fillStrokeShape(this),r==="underline"&&(o===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}r==="underline"&&(e.strokeStyle=n,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();const r=this.glyphInfo;if(r.length>=1){const n=r[0].p0;e.moveTo(n.x,n.y)}for(let n=0;n<r.length;n++){const i=r[n].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return pi.prototype.setText.call(this,e)}_getContextFont(){return pi.prototype._getContextFont.call(this)}_getTextSize(e){const n=this.dummyCanvas.getContext("2d");n.save(),n.font=this._getContextFont();const i=n.measureText(e);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=of(this.text()),r=[];let n=0;for(let v=0;v<e.length;v++)r.push({char:e[v],width:this._getTextSize(e[v]).width}),n+=r[v].width;const{height:i}=this._getTextSize(this.attrs.text);if(this.textWidth=n,this.textHeight=i,this.glyphInfo=[],!this.attrs.data)return null;const a=this.letterSpacing(),o=this.align(),s=this.kerningFunc(),u=Math.max(this.textWidth+((this.attrs.text||"").length-1)*a,0);let h=0;o==="center"&&(h=Math.max(0,this.pathLength/2-u/2)),o==="right"&&(h=Math.max(0,this.pathLength-u));let f=h;for(let v=0;v<r.length;v++){const g=this._getPointAtLength(f);if(!g)return;const p=r[v].char;let y=r[v].width+a;if(p===" "&&o==="justify"){const S=this.text().split(" ").length-1;y+=(this.pathLength-u)/S}const _=this._getPointAtLength(f+y);if(!_)return;const x=Pl.getLineLength(g.x,g.y,_.x,_.y);let b=0;if(s)try{b=s(r[v-1].char,p)*this.fontSize()}catch{b=0}g.x+=b,_.x+=b,this.textWidth+=b;const E=Pl.getPointOnLine(b+x/2,g.x,g.y,_.x,_.y),k=Math.atan2(_.y-g.y,_.x-g.x);this.glyphInfo.push({transposeX:E.x,transposeY:E.y,text:e[v],rotation:k,p0:g,p1:_}),f+=y}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(h){e.push(h.p0.x),e.push(h.p0.y),e.push(h.p1.x),e.push(h.p1.y)});let r=e[0]||0,n=e[0]||0,i=e[1]||0,a=e[1]||0,o,s;for(let h=0;h<e.length/2;h++)o=e[h*2],s=e[h*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,s),a=Math.max(a,s);const u=this.fontSize();return{x:r-u/2,y:i-u/2,width:n-r+u,height:a-i+u}}destroy(){return Ze.releaseCanvas(this.dummyCanvas),super.destroy()}};Da.prototype._fillFunc=w8;Da.prototype._strokeFunc=_8;Da.prototype._fillFuncHit=w8;Da.prototype._strokeFuncHit=_8;Da.prototype.className="TextPath";Da.prototype._attrsAffectingSize=["text","fontSize","data"];Di(Da);je.addGetterSetter(Da,"data");je.addGetterSetter(Da,"fontFamily","Arial");je.addGetterSetter(Da,"fontSize",12,Et());je.addGetterSetter(Da,"fontStyle",b8);je.addGetterSetter(Da,"align","left");je.addGetterSetter(Da,"letterSpacing",0,Et());je.addGetterSetter(Da,"textBaseline","middle");je.addGetterSetter(Da,"fontVariant",b8);je.addGetterSetter(Da,"text",MA);je.addGetterSetter(Da,"textDecoration","");je.addGetterSetter(Da,"kerningFunc",void 0);const x8="tr-konva",IA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${x8}`).join(" "),Z5="nodesRect",jA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],DA={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},FA="ontouchstart"in Ot._global;function BA(t,e,r){if(t==="rotater")return r;e+=Ze.degToRad(DA[t]||0);const n=(Ze.radToDeg(e)%360+360)%360;return Ze._inRange(n,315+22.5,360)||Ze._inRange(n,0,22.5)?"ns-resize":Ze._inRange(n,45-22.5,45+22.5)?"nesw-resize":Ze._inRange(n,90-22.5,90+22.5)?"ew-resize":Ze._inRange(n,135-22.5,135+22.5)?"nwse-resize":Ze._inRange(n,180-22.5,180+22.5)?"ns-resize":Ze._inRange(n,225-22.5,225+22.5)?"nesw-resize":Ze._inRange(n,270-22.5,270+22.5)?"ew-resize":Ze._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Ze.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}const f0=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function zA(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function S8(t,e,r){const n=r.x+(t.x-r.x)*Math.cos(e)-(t.y-r.y)*Math.sin(e),i=r.y+(t.x-r.x)*Math.sin(e)+(t.y-r.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:n,y:i}}function qA(t,e){const r=zA(t);return S8(t,e,r)}function UA(t,e,r){let n=e;for(let i=0;i<t.length;i++){const a=Ot.getAngle(t[i]),o=Math.abs(a-e)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let cm=0,Qr=class extends cd{constructor(e){super(e),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(IA,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return Ze.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return x8+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const r=e.filter(i=>i.isAncestorOf(this)?(Ze.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=r,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const o=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(o,a)}i.on(jA.map(o=>o+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let r;e.on(`dragstart.${this._getEventNamespace()}`,n=>{r=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=e.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(s=>{if(s===e||s.isDragging())return;const u=s.getAbsolutePosition();s.setAbsolutePosition({x:u.x+a,y:u.y+o}),s.startDrag(n)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Z5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Z5,this.__getNodeRect)}__getNodeShape(e,r=this.rotation(),n){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(n),o=e.getAbsolutePosition(n),s=i.x*a.x-e.offsetX()*a.x,u=i.y*a.y-e.offsetY()*a.y,h=(Ot.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),f={x:o.x+s*Math.cos(h)+u*Math.sin(-h),y:o.y+u*Math.cos(h)+s*Math.sin(h),width:i.width*a.x,height:i.height*a.y,rotation:h};return S8(f,-Ot.getAngle(r),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const r=[];this.nodes().map(h=>{const f=h.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),v=[{x:f.x,y:f.y},{x:f.x+f.width,y:f.y},{x:f.x+f.width,y:f.y+f.height},{x:f.x,y:f.y+f.height}],g=h.getAbsoluteTransform();v.forEach(function(p){const y=g.point(p);r.push(y)})});const n=new tl;n.rotate(-Ot.getAngle(this.rotation()));let i=1/0,a=1/0,o=-1/0,s=-1/0;r.forEach(function(h){const f=n.point(h);i===void 0&&(i=o=f.x,a=s=f.y),i=Math.min(i,f.x),a=Math.min(a,f.y),o=Math.max(o,f.x),s=Math.max(s,f.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:s-a,rotation:Ot.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(),f0.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const r=new Cp({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:FA?10:"auto"}),n=this;r.on("mousedown touchstart",function(i){n._handleMouseDown(i)}),r.on("dragstart",i=>{r.stopDrag(),i.cancelBubble=!0}),r.on("dragend",i=>{i.cancelBubble=!0}),r.on("mouseenter",()=>{const i=Ot.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=BA(e,i,a);r.getStage().content&&(r.getStage().content.style.cursor=o),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){const e=new mt({name:"back",width:0,height:0,sceneFunc(r,n){const i=n.getParent(),a=i.padding();r.beginPath(),r.rect(-a,-a,n.width()+a*2,n.height()+a*2),r.moveTo(n.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*Ze._sign(n.height())-a),r.fillStrokeShape(n)},hitFunc:(r,n)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();r.beginPath(),r.rect(-i,-i,n.width()+i*2,n.height()+i*2),r.fillStrokeShape(n)}});this.add(e),this._proxyDrag(e),e.on("dragstart",r=>{r.cancelBubble=!0}),e.on("dragmove",r=>{r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const r=this._getNodeRect(),n=r.width,i=r.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const o=e.target.getAbsolutePosition(),s=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-o.x,y:s.y-o.y},cm++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:e.evt,target:u})})}_handleMouseMove(e){let r,n,i;const a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(e);const s=o.getPointerPosition();let u={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const h=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(h,u,e)),a.setAbsolutePosition(u);const f=a.getAbsolutePosition();if(h.x===f.x&&h.y===f.y)return;if(this._movingAnchorName==="rotater"){const E=this._getNodeRect();r=a.x()-E.width/2,n=-a.y()+E.height/2;let k=Math.atan2(-n,r)+Math.PI/2;E.height<0&&(k-=Math.PI);const A=Ot.getAngle(this.rotation())+k,M=Ot.getAngle(this.rotationSnapTolerance()),I=UA(this.rotationSnaps(),A,M)-E.rotation,F=qA(E,I);this._fitNodesInto(F,e);return}const v=this.shiftBehavior();let g;v==="inverted"?g=this.keepRatio()&&!e.shiftKey:v==="none"?g=this.keepRatio():g=this.keepRatio()||e.shiftKey;let p=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(g){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(E.x-a.x(),2)+Math.pow(E.y-a.y(),2));const k=this.findOne(".top-left").x()>E.x?-1:1,S=this.findOne(".top-left").y()>E.y?-1:1;r=i*this.cos*k,n=i*this.sin*S,this.findOne(".top-left").x(E.x-r),this.findOne(".top-left").y(E.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(g){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-E.x,2)+Math.pow(E.y-a.y(),2));const k=this.findOne(".top-right").x()<E.x?-1:1,S=this.findOne(".top-right").y()>E.y?-1:1;r=i*this.cos*k,n=i*this.sin*S,this.findOne(".top-right").x(E.x+r),this.findOne(".top-right").y(E.y-n)}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(g){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(E.x-a.x(),2)+Math.pow(a.y()-E.y,2));const k=E.x<a.x()?-1:1,S=a.y()<E.y?-1:1;r=i*this.cos*k,n=i*this.sin*S,a.x(E.x-r),a.y(E.y+n)}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(g){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-E.x,2)+Math.pow(a.y()-E.y,2));const k=this.findOne(".bottom-right").x()<E.x?-1:1,S=this.findOne(".bottom-right").y()<E.y?-1:1;r=i*this.cos*k,n=i*this.sin*S,this.findOne(".bottom-right").x(E.x+r),this.findOne(".bottom-right").y(E.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(p=this.centeredScaling()||e.altKey,p){const E=this.findOne(".top-left"),k=this.findOne(".bottom-right"),S=E.x(),A=E.y(),M=this.getWidth()-k.x(),C=this.getHeight()-k.y();k.move({x:-S,y:-A}),E.move({x:M,y:C})}const _=this.findOne(".top-left").getAbsolutePosition();r=_.x,n=_.y;const x=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),b=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:x,height:b,rotation:Ot.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var r;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const n=this.getNode();cm--,this._fire("transformend",{evt:e,target:n}),(r=this.getLayer())===null||r===void 0||r.batchDraw(),n&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:e,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,r){const n=this._getNodeRect(),i=1;if(Ze._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(Ze._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const a=new tl;if(a.rotate(Ot.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const g=a.point({x:-this.padding()*2,y:0});e.x+=g.x,e.y+=g.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const g=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const g=a.point({x:0,y:-this.padding()*2});e.x+=g.x,e.y+=g.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const g=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const g=this.boundBoxFunc()(n,e);g?e=g:Ze.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,s=new tl;s.translate(n.x,n.y),s.rotate(n.rotation),s.scale(n.width/o,n.height/o);const u=new tl,h=e.width/o,f=e.height/o;this.flipEnabled()===!1?(u.translate(e.x,e.y),u.rotate(e.rotation),u.translate(e.width<0?e.width:0,e.height<0?e.height:0),u.scale(Math.abs(h),Math.abs(f))):(u.translate(e.x,e.y),u.rotate(e.rotation),u.scale(h,f));const v=u.multiply(s.invert());this._nodes.forEach(g=>{var p;if(!g.getStage())return;const y=g.getParent().getAbsoluteTransform(),_=g.getTransform().copy();_.translate(g.offsetX(),g.offsetY());const x=new tl;x.multiply(y.copy().invert()).multiply(v).multiply(y).multiply(_);const b=x.decompose();g.setAttrs(b),(p=g.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(Ze._getRotation(e.rotation)),this._nodes.forEach(g=>{this._fire("transform",{evt:r,target:g}),g._fire("transform",{evt:r,target:g})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,r){this.findOne(e).setAttrs(r)}update(){var e;const r=this._getNodeRect();this.rotation(Ze._getRotation(r.rotation));const n=r.width,i=r.height,a=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),u=this.anchorSize(),h=this.find("._anchor");h.forEach(v=>{v.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+s,offsetY:u/2+s,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+s,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-s,offsetY:u/2+s,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+s,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-s,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-s,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*Ze._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(v=>v.draggable()),x:0,y:0});const f=this.anchorStyleFunc();f&&h.forEach(v=>{f(v)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),cd.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return kt.prototype.toObject.call(this)}clone(e){return kt.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Qr.isTransforming=()=>cm>0;function HA(t){return t instanceof Array||Ze.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){f0.indexOf(e)===-1&&Ze.warn("Unknown anchor name: "+e+". Available names are: "+f0.join(", "))}),t||[]}Qr.prototype.className="Transformer";Di(Qr);je.addGetterSetter(Qr,"enabledAnchors",f0,HA);je.addGetterSetter(Qr,"flipEnabled",!0,iu());je.addGetterSetter(Qr,"resizeEnabled",!0);je.addGetterSetter(Qr,"anchorSize",10,Et());je.addGetterSetter(Qr,"rotateEnabled",!0);je.addGetterSetter(Qr,"rotateLineVisible",!0);je.addGetterSetter(Qr,"rotationSnaps",[]);je.addGetterSetter(Qr,"rotateAnchorOffset",50,Et());je.addGetterSetter(Qr,"rotateAnchorCursor","crosshair");je.addGetterSetter(Qr,"rotationSnapTolerance",5,Et());je.addGetterSetter(Qr,"borderEnabled",!0);je.addGetterSetter(Qr,"anchorStroke","rgb(0, 161, 255)");je.addGetterSetter(Qr,"anchorStrokeWidth",1,Et());je.addGetterSetter(Qr,"anchorFill","white");je.addGetterSetter(Qr,"anchorCornerRadius",0,Et());je.addGetterSetter(Qr,"borderStroke","rgb(0, 161, 255)");je.addGetterSetter(Qr,"borderStrokeWidth",1,Et());je.addGetterSetter(Qr,"borderDash");je.addGetterSetter(Qr,"keepRatio",!0);je.addGetterSetter(Qr,"shiftBehavior","default");je.addGetterSetter(Qr,"centeredScaling",!1);je.addGetterSetter(Qr,"ignoreStroke",!1);je.addGetterSetter(Qr,"padding",0,Et());je.addGetterSetter(Qr,"nodes");je.addGetterSetter(Qr,"node");je.addGetterSetter(Qr,"boundBoxFunc");je.addGetterSetter(Qr,"anchorDragBoundFunc");je.addGetterSetter(Qr,"anchorStyleFunc");je.addGetterSetter(Qr,"shouldOverdrawWholeArea",!1);je.addGetterSetter(Qr,"useSingleNodeRotation",!0);je.backCompat(Qr,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class _c extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Ot.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}_c.prototype.className="Wedge";_c.prototype._centroid=!0;_c.prototype._attrsAffectingSize=["radius"];Di(_c);je.addGetterSetter(_c,"radius",0,Et());je.addGetterSetter(_c,"angle",0,Et());je.addGetterSetter(_c,"clockwise",!1);je.backCompat(_c,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function Q5(){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],GA=[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 WA(t,e){const r=t.data,n=t.width,i=t.height;let a,o,s,u,h,f,v,g,p,y,_,x,b,E,k,S,A,M,C,I;const F=e+e+1,j=n-1,O=i-1,T=e+1,$=T*(T+1)/2,q=new Q5,J=$A[e],ae=GA[e];let ie=null,Z=q,te=null,V=null;for(let B=1;B<F;B++)Z=Z.next=new Q5,B===T&&(ie=Z);Z.next=q,s=o=0;for(let B=0;B<i;B++){x=b=E=k=u=h=f=v=0,g=T*(S=r[o]),p=T*(A=r[o+1]),y=T*(M=r[o+2]),_=T*(C=r[o+3]),u+=$*S,h+=$*A,f+=$*M,v+=$*C,Z=q;for(let D=0;D<T;D++)Z.r=S,Z.g=A,Z.b=M,Z.a=C,Z=Z.next;for(let D=1;D<T;D++)a=o+((j<D?j:D)<<2),u+=(Z.r=S=r[a])*(I=T-D),h+=(Z.g=A=r[a+1])*I,f+=(Z.b=M=r[a+2])*I,v+=(Z.a=C=r[a+3])*I,x+=S,b+=A,E+=M,k+=C,Z=Z.next;te=q,V=ie;for(let D=0;D<n;D++)r[o+3]=C=v*J>>ae,C!==0?(C=255/C,r[o]=(u*J>>ae)*C,r[o+1]=(h*J>>ae)*C,r[o+2]=(f*J>>ae)*C):r[o]=r[o+1]=r[o+2]=0,u-=g,h-=p,f-=y,v-=_,g-=te.r,p-=te.g,y-=te.b,_-=te.a,a=s+((a=D+e+1)<j?a:j)<<2,x+=te.r=r[a],b+=te.g=r[a+1],E+=te.b=r[a+2],k+=te.a=r[a+3],u+=x,h+=b,f+=E,v+=k,te=te.next,g+=S=V.r,p+=A=V.g,y+=M=V.b,_+=C=V.a,x-=S,b-=A,E-=M,k-=C,V=V.next,o+=4;s+=n}for(let B=0;B<n;B++){b=E=k=x=h=f=v=u=0,o=B<<2,g=T*(S=r[o]),p=T*(A=r[o+1]),y=T*(M=r[o+2]),_=T*(C=r[o+3]),u+=$*S,h+=$*A,f+=$*M,v+=$*C,Z=q;for(let U=0;U<T;U++)Z.r=S,Z.g=A,Z.b=M,Z.a=C,Z=Z.next;let D=n;for(let U=1;U<=e;U++)o=D+B<<2,u+=(Z.r=S=r[o])*(I=T-U),h+=(Z.g=A=r[o+1])*I,f+=(Z.b=M=r[o+2])*I,v+=(Z.a=C=r[o+3])*I,x+=S,b+=A,E+=M,k+=C,Z=Z.next,U<O&&(D+=n);o=B,te=q,V=ie;for(let U=0;U<i;U++)a=o<<2,r[a+3]=C=v*J>>ae,C>0?(C=255/C,r[a]=(u*J>>ae)*C,r[a+1]=(h*J>>ae)*C,r[a+2]=(f*J>>ae)*C):r[a]=r[a+1]=r[a+2]=0,u-=g,h-=p,f-=y,v-=_,g-=te.r,p-=te.g,y-=te.b,_-=te.a,a=B+((a=U+T)<O?a:O)*n<<2,u+=x+=te.r=r[a],h+=b+=te.g=r[a+1],f+=E+=te.b=r[a+2],v+=k+=te.a=r[a+3],te=te.next,g+=S=V.r,p+=A=V.g,y+=M=V.b,_+=C=V.a,x-=S,b-=A,E-=M,k-=C,V=V.next,o+=n}}const VA=function(e){const r=Math.round(this.blurRadius());r>0&&WA(e,r)};je.addGetterSetter(kt,"blurRadius",0,Et(),je.afterSetFilter);const YA=function(t){const e=this.brightness()*255,r=t.data,n=r.length;for(let i=0;i<n;i+=4)r[i]+=e,r[i+1]+=e,r[i+2]+=e};je.addGetterSetter(kt,"brightness",0,Et(),je.afterSetFilter);const XA=function(t){const e=this.brightness(),r=t.data,n=r.length;for(let i=0;i<n;i+=4)r[i]=Math.min(255,r[i]*e),r[i+1]=Math.min(255,r[i+1]*e),r[i+2]=Math.min(255,r[i+2]*e)},KA=function(t){const e=Math.pow((this.contrast()+100)/100,2),r=t.data,n=r.length;let i=150,a=150,o=150;for(let s=0;s<n;s+=4)i=r[s],a=r[s+1],o=r[s+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[s]=i,r[s+1]=a,r[s+2]=o};je.addGetterSetter(kt,"contrast",0,Et(),je.afterSetFilter);const ZA=function(t){var e,r,n,i,a,o,s,u,h;const f=t.data,v=t.width,g=t.height,p=Math.min(1,Math.max(0,(r=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&r!==void 0?r:.5)),y=Math.min(1,Math.max(0,(i=(n=this.embossWhiteLevel)===null||n===void 0?void 0:n.call(this))!==null&&i!==void 0?i:.5)),x=(s={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(o=(a=this.embossDirection)===null||a===void 0?void 0:a.call(this))!==null&&o!==void 0?o:"top-left"])!==null&&s!==void 0?s:315,b=!!((h=(u=this.embossBlend)===null||u===void 0?void 0:u.call(this))!==null&&h!==void 0&&h),E=p*10,k=y*255,S=x*Math.PI/180,A=Math.cos(S),M=Math.sin(S),C=128/1020*E,I=new Uint8ClampedArray(f),F=new Float32Array(v*g);for(let q=0,J=0;J<f.length;J+=4,q++)F[q]=.2126*I[J]+.7152*I[J+1]+.0722*I[J+2];const j=[-1,0,1,-2,0,2,-1,0,1],O=[-1,-2,-1,0,0,0,1,2,1],T=[-v-1,-v,-v+1,-1,0,1,v-1,v,v+1],$=q=>q<0?0:q>255?255:q;for(let q=1;q<g-1;q++)for(let J=1;J<v-1;J++){const ae=q*v+J;let ie=0,Z=0;ie+=F[ae+T[0]]*j[0],Z+=F[ae+T[0]]*O[0],ie+=F[ae+T[1]]*j[1],Z+=F[ae+T[1]]*O[1],ie+=F[ae+T[2]]*j[2],Z+=F[ae+T[2]]*O[2],ie+=F[ae+T[3]]*j[3],Z+=F[ae+T[3]]*O[3],ie+=F[ae+T[5]]*j[5],Z+=F[ae+T[5]]*O[5],ie+=F[ae+T[6]]*j[6],Z+=F[ae+T[6]]*O[6],ie+=F[ae+T[7]]*j[7],Z+=F[ae+T[7]]*O[7],ie+=F[ae+T[8]]*j[8],Z+=F[ae+T[8]]*O[8];const te=A*ie+M*Z,V=$(k+te*C),B=ae*4;if(b){const D=V-k;f[B]=$(I[B]+D),f[B+1]=$(I[B+1]+D),f[B+2]=$(I[B+2]+D),f[B+3]=I[B+3]}else f[B]=f[B+1]=f[B+2]=V,f[B+3]=I[B+3]}for(let q=0;q<v;q++){let J=q*4,ae=((g-1)*v+q)*4;f[J]=I[J],f[J+1]=I[J+1],f[J+2]=I[J+2],f[J+3]=I[J+3],f[ae]=I[ae],f[ae+1]=I[ae+1],f[ae+2]=I[ae+2],f[ae+3]=I[ae+3]}for(let q=1;q<g-1;q++){let J=q*v*4,ae=(q*v+(v-1))*4;f[J]=I[J],f[J+1]=I[J+1],f[J+2]=I[J+2],f[J+3]=I[J+3],f[ae]=I[ae],f[ae+1]=I[ae+1],f[ae+2]=I[ae+2],f[ae+3]=I[ae+3]}return t};je.addGetterSetter(kt,"embossStrength",.5,Et(),je.afterSetFilter);je.addGetterSetter(kt,"embossWhiteLevel",.5,Et(),je.afterSetFilter);je.addGetterSetter(kt,"embossDirection","top-left",void 0,je.afterSetFilter);je.addGetterSetter(kt,"embossBlend",!1,void 0,je.afterSetFilter);function Gg(t,e,r,n,i){const a=r-e,o=i-n;if(a===0)return n+o/2;if(o===0)return n;let s=(t-e)/a;return s=o*s+n,s}const QA=function(t){const e=t.data,r=e.length;let n=e[0],i=n,a,o=e[1],s=o,u,h=e[2],f=h,v;const g=this.enhance();if(g===0)return;for(let k=0;k<r;k+=4)a=e[k+0],a<n?n=a:a>i&&(i=a),u=e[k+1],u<o?o=u:u>s&&(s=u),v=e[k+2],v<h?h=v:v>f&&(f=v);i===n&&(i=255,n=0),s===o&&(s=255,o=0),f===h&&(f=255,h=0);let p,y,_,x,b,E;if(g>0)p=i+g*(255-i),y=n-g*(n-0),_=s+g*(255-s),x=o-g*(o-0),b=f+g*(255-f),E=h-g*(h-0);else{const k=(i+n)*.5;p=i+g*(i-k),y=n+g*(n-k);const S=(s+o)*.5;_=s+g*(s-S),x=o+g*(o-S);const A=(f+h)*.5;b=f+g*(f-A),E=h+g*(h-A)}for(let k=0;k<r;k+=4)e[k+0]=Gg(e[k+0],n,i,y,p),e[k+1]=Gg(e[k+1],o,s,x,_),e[k+2]=Gg(e[k+2],h,f,E,b)};je.addGetterSetter(kt,"enhance",0,Et(),je.afterSetFilter);const JA=function(t){const e=t.data,r=e.length;for(let n=0;n<r;n+=4){const i=.34*e[n]+.5*e[n+1]+.16*e[n+2];e[n]=i,e[n+1]=i,e[n+2]=i}};je.addGetterSetter(kt,"hue",0,Et(),je.afterSetFilter);je.addGetterSetter(kt,"saturation",0,Et(),je.afterSetFilter);je.addGetterSetter(kt,"luminance",0,Et(),je.afterSetFilter);const ek=function(t){const e=t.data,r=e.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,s=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),h=.299*n+.701*s+.167*u,f=.587*n-.587*s+.33*u,v=.114*n-.114*s-.497*u,g=.299*n-.299*s-.328*u,p=.587*n+.413*s+.035*u,y=.114*n-.114*s+.293*u,_=.299*n-.3*s+1.25*u,x=.587*n-.586*s-1.05*u,b=.114*n+.886*s-.2*u;let E,k,S,A;for(let M=0;M<r;M+=4)E=e[M+0],k=e[M+1],S=e[M+2],A=e[M+3],e[M+0]=h*E+f*k+v*S+o,e[M+1]=g*E+p*k+y*S+o,e[M+2]=_*E+x*k+b*S+o,e[M+3]=A},tk=function(t){const e=t.data,r=e.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=n*i*Math.cos(a*Math.PI/180),s=n*i*Math.sin(a*Math.PI/180),u=.299*n+.701*o+.167*s,h=.587*n-.587*o+.33*s,f=.114*n-.114*o-.497*s,v=.299*n-.299*o-.328*s,g=.587*n+.413*o+.035*s,p=.114*n-.114*o+.293*s,y=.299*n-.3*o+1.25*s,_=.587*n-.586*o-1.05*s,x=.114*n+.886*o-.2*s;for(let b=0;b<r;b+=4){const E=e[b+0],k=e[b+1],S=e[b+2],A=e[b+3];e[b+0]=u*E+h*k+f*S,e[b+1]=v*E+g*k+p*S,e[b+2]=y*E+_*k+x*S,e[b+3]=A}};je.addGetterSetter(kt,"hue",0,Et(),je.afterSetFilter);je.addGetterSetter(kt,"saturation",0,Et(),je.afterSetFilter);je.addGetterSetter(kt,"value",0,Et(),je.afterSetFilter);const rk=function(t){const e=t.data,r=e.length;for(let n=0;n<r;n+=4)e[n]=255-e[n],e[n+1]=255-e[n+1],e[n+2]=255-e[n+2]},nk=function(t,e,r){const n=t.data,i=e.data,a=t.width,o=t.height,s=r.polarCenterX||a/2,u=r.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),f=a-s,v=o-u;const g=Math.sqrt(f*f+v*v);h=g>h?g:h;const p=o,y=a,_=360/y*Math.PI/180;for(let x=0;x<y;x+=1){const b=Math.sin(x*_),E=Math.cos(x*_);for(let k=0;k<p;k+=1){f=Math.floor(s+h*k/p*E),v=Math.floor(u+h*k/p*b);let S=(v*a+f)*4;const A=n[S+0],M=n[S+1],C=n[S+2],I=n[S+3];S=(x+k*a)*4,i[S+0]=A,i[S+1]=M,i[S+2]=C,i[S+3]=I}}},ik=function(t,e,r){const n=t.data,i=e.data,a=t.width,o=t.height,s=r.polarCenterX||a/2,u=r.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),f=a-s,v=o-u;const g=Math.sqrt(f*f+v*v);h=g>h?g:h;const p=o,y=a,_=0;let x,b;for(f=0;f<a;f+=1)for(v=0;v<o;v+=1){const E=f-s,k=v-u,S=Math.sqrt(E*E+k*k)*p/h;let A=(Math.atan2(k,E)*180/Math.PI+360+_)%360;A=A*y/360,x=Math.floor(A),b=Math.floor(S);let M=(b*a+x)*4;const C=n[M+0],I=n[M+1],F=n[M+2],j=n[M+3];M=(v*a+f)*4,i[M+0]=C,i[M+1]=I,i[M+2]=F,i[M+3]=j}},ak=function(t){const e=t.width,r=t.height;let n,i,a,o,s,u,h,f,v,g,p=Math.round(this.kaleidoscopePower());const y=Math.round(this.kaleidoscopeAngle()),_=Math.floor(e*(y%360)/360);if(p<1)return;const x=Ze.createCanvasElement();x.width=e,x.height=r;const b=x.getContext("2d").getImageData(0,0,e,r);Ze.releaseCanvas(x),nk(t,b,{polarCenterX:e/2,polarCenterY:r/2});let E=e/Math.pow(2,p);for(;E<=8;)E=E*2,p-=1;E=Math.ceil(E);let k=E,S=0,A=k,M=1;for(_+E>e&&(S=k,A=0,M=-1),i=0;i<r;i+=1)for(n=S;n!==A;n+=M)a=Math.round(n+_)%e,v=(e*i+a)*4,s=b.data[v+0],u=b.data[v+1],h=b.data[v+2],f=b.data[v+3],g=(e*i+n)*4,b.data[g+0]=s,b.data[g+1]=u,b.data[g+2]=h,b.data[g+3]=f;for(i=0;i<r;i+=1)for(k=Math.floor(E),o=0;o<p;o+=1){for(n=0;n<k+1;n+=1)v=(e*i+n)*4,s=b.data[v+0],u=b.data[v+1],h=b.data[v+2],f=b.data[v+3],g=(e*i+k*2-n-1)*4,b.data[g+0]=s,b.data[g+1]=u,b.data[g+2]=h,b.data[g+3]=f;k*=2}ik(b,t,{})};je.addGetterSetter(kt,"kaleidoscopePower",2,Et(),je.afterSetFilter);je.addGetterSetter(kt,"kaleidoscopeAngle",0,Et(),je.afterSetFilter);function S1(t,e,r){let n=(r*t.width+e)*4;const i=[];return i.push(t.data[n++],t.data[n++],t.data[n++],t.data[n++]),i}function Id(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function ok(t){const e=[0,0,0];for(let r=0;r<t.length;r++)e[0]+=t[r][0],e[1]+=t[r][1],e[2]+=t[r][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function sk(t,e){const r=S1(t,0,0),n=S1(t,t.width-1,0),i=S1(t,0,t.height-1),a=S1(t,t.width-1,t.height-1),o=e||10;if(Id(r,n)<o&&Id(n,a)<o&&Id(a,i)<o&&Id(i,r)<o){const s=ok([n,r,a,i]),u=[];for(let h=0;h<t.width*t.height;h++){const f=Id(s,[t.data[h*4],t.data[h*4+1],t.data[h*4+2]]);u[h]=f<o?0:255}return u}}function lk(t,e){for(let r=0;r<t.width*t.height;r++)t.data[4*r+3]=e[r]}function uk(t,e,r){const n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[];for(let s=0;s<r;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let v=0;v<i;v++)for(let g=0;g<i;g++){const p=s+v-a,y=u+g-a;if(p>=0&&p<r&&y>=0&&y<e){const _=p*e+y,x=n[v*i+g];f+=t[_]*x}}o[h]=f===255*8?255:0}return o}function ck(t,e,r){const n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[];for(let s=0;s<r;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let v=0;v<i;v++)for(let g=0;g<i;g++){const p=s+v-a,y=u+g-a;if(p>=0&&p<r&&y>=0&&y<e){const _=p*e+y,x=n[v*i+g];f+=t[_]*x}}o[h]=f>=255*4?255:0}return o}function fk(t,e,r){const n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[];for(let s=0;s<r;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let v=0;v<i;v++)for(let g=0;g<i;g++){const p=s+v-a,y=u+g-a;if(p>=0&&p<r&&y>=0&&y<e){const _=p*e+y,x=n[v*i+g];f+=t[_]*x}}o[h]=f}return o}const hk=function(t){const e=this.threshold();let r=sk(t,e);return r&&(r=uk(r,t.width,t.height),r=ck(r,t.width,t.height),r=fk(r,t.width,t.height),lk(t,r)),t};je.addGetterSetter(kt,"threshold",0,Et(),je.afterSetFilter);const dk=function(t){const e=this.noise()*255,r=t.data,n=r.length,i=e/2;for(let a=0;a<n;a+=4)r[a+0]+=i-2*i*Math.random(),r[a+1]+=i-2*i*Math.random(),r[a+2]+=i-2*i*Math.random()};je.addGetterSetter(kt,"noise",.2,Et(),je.afterSetFilter);const pk=function(t){let e=Math.ceil(this.pixelSize()),r=t.width,n=t.height,i=Math.ceil(r/e),a=Math.ceil(n/e),o=t.data;if(e<=0){Ze.error("pixelSize value can not be <= 0");return}for(let s=0;s<i;s+=1)for(let u=0;u<a;u+=1){let h=0,f=0,v=0,g=0;const p=s*e,y=p+e,_=u*e,x=_+e;let b=0;for(let E=p;E<y;E+=1)if(!(E>=r))for(let k=_;k<x;k+=1){if(k>=n)continue;const S=(r*k+E)*4;h+=o[S+0],f+=o[S+1],v+=o[S+2],g+=o[S+3],b+=1}h=h/b,f=f/b,v=v/b,g=g/b;for(let E=p;E<y;E+=1)if(!(E>=r))for(let k=_;k<x;k+=1){if(k>=n)continue;const S=(r*k+E)*4;o[S+0]=h,o[S+1]=f,o[S+2]=v,o[S+3]=g}}};je.addGetterSetter(kt,"pixelSize",8,Et(),je.afterSetFilter);const gk=function(t){const e=Math.round(this.levels()*254)+1,r=t.data,n=r.length,i=255/e;for(let a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};je.addGetterSetter(kt,"levels",.5,Et(),je.afterSetFilter);const vk=function(t){const e=t.data,r=e.length,n=this.red(),i=this.green(),a=this.blue();for(let o=0;o<r;o+=4){const s=(.34*e[o]+.5*e[o+1]+.16*e[o+2])/255;e[o]=s*n,e[o+1]=s*i,e[o+2]=s*a,e[o+3]=e[o+3]}};je.addGetterSetter(kt,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(kt,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(kt,"blue",0,W6,je.afterSetFilter);const mk=function(t){const e=t.data,r=e.length,n=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let s=0;s<r;s+=4){const u=1-o;e[s]=n*o+e[s]*u,e[s+1]=i*o+e[s+1]*u,e[s+2]=a*o+e[s+2]*u}};je.addGetterSetter(kt,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(kt,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(kt,"blue",0,W6,je.afterSetFilter);je.addGetterSetter(kt,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const yk=function(t){const e=t.data,r=e.length;for(let n=0;n<r;n+=4){const i=e[n+0],a=e[n+1],o=e[n+2];e[n+0]=Math.min(255,i*.393+a*.769+o*.189),e[n+1]=Math.min(255,i*.349+a*.686+o*.168),e[n+2]=Math.min(255,i*.272+a*.534+o*.131)}},bk=function(t){const r=t.data;for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2];.2126*i+.7152*a+.0722*o>=128&&(r[n]=255-i,r[n+1]=255-a,r[n+2]=255-o)}return t},wk=function(t){const e=this.threshold()*255,r=t.data,n=r.length;for(let i=0;i<n;i+=1)r[i]=r[i]<e?0:255};je.addGetterSetter(kt,"threshold",.5,Et(),je.afterSetFilter);const or=oh.Util._assign(oh,{Arc:bc,Arrow:vh,Circle:bd,Ellipse:Ef,Image:Hu,Label:Ym,Tag:mh,Line:wc,Path:Pl,Rect:Cp,RegularPolygon:Af,Ring:yh,Sprite:$u,Star:kf,Text:pi,TextPath:Da,Transformer:Qr,Wedge:_c,Filters:{Blur:VA,Brightness:XA,Brighten:YA,Contrast:KA,Emboss:ZA,Enhance:QA,Grayscale:JA,HSL:ek,HSV:tk,Invert:rk,Kaleidoscope:ak,Mask:hk,Noise:dk,Pixelate:pk,Posterize:gk,RGB:vk,RGBA:mk,Sepia:yk,Solarize:bk,Threshold:wk}});var Wg={exports:{}};/**
57
+ * @license React
58
+ * react-reconciler.production.min.js
59
+ *
60
+ * Copyright (c) Facebook, Inc. and its affiliates.
61
+ *
62
+ * This source code is licensed under the MIT license found in the
63
+ * LICENSE file in the root directory of this source tree.
64
+ */var Vg,J5;function _k(){return J5||(J5=1,Vg=function(e){var r={},n=Sp(),i=Tm(),a=Object.assign;function o(d){for(var m="https://reactjs.org/docs/error-decoder.html?invariant="+d,L=1;L<arguments.length;L++)m+="&args[]="+encodeURIComponent(arguments[L]);return"Minified React error #"+d+"; visit "+m+" 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,u=Symbol.for("react.element"),h=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),y=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),A=Symbol.iterator;function M(d){return d===null||typeof d!="object"?null:(d=A&&d[A]||d["@@iterator"],typeof d=="function"?d:null)}function C(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case f:return"Fragment";case h:return"Portal";case g:return"Profiler";case v:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case y:return(d.displayName||"Context")+".Consumer";case p:return(d._context.displayName||"Context")+".Provider";case _:var m=d.render;return d=d.displayName,d||(d=m.displayName||m.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case E:return m=d.displayName||null,m!==null?m:C(d.type)||"Memo";case k:m=d._payload,d=d._init;try{return C(d(m))}catch{}}return null}function I(d){var m=d.type;switch(d.tag){case 24:return"Cache";case 9:return(m.displayName||"Context")+".Consumer";case 10:return(m._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return d=m.render,d=d.displayName||d.name||"",m.displayName||(d!==""?"ForwardRef("+d+")":"ForwardRef");case 7:return"Fragment";case 5:return m;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C(m);case 8:return m===v?"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 m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m}return null}function F(d){var m=d,L=d;if(d.alternate)for(;m.return;)m=m.return;else{d=m;do m=d,(m.flags&4098)!==0&&(L=m.return),d=m.return;while(d)}return m.tag===3?L:null}function j(d){if(F(d)!==d)throw Error(o(188))}function O(d){var m=d.alternate;if(!m){if(m=F(d),m===null)throw Error(o(188));return m!==d?null:d}for(var L=d,z=m;;){var W=L.return;if(W===null)break;var ne=W.alternate;if(ne===null){if(z=W.return,z!==null){L=z;continue}break}if(W.child===ne.child){for(ne=W.child;ne;){if(ne===L)return j(W),d;if(ne===z)return j(W),m;ne=ne.sibling}throw Error(o(188))}if(L.return!==z.return)L=W,z=ne;else{for(var _e=!1,Ye=W.child;Ye;){if(Ye===L){_e=!0,L=W,z=ne;break}if(Ye===z){_e=!0,z=W,L=ne;break}Ye=Ye.sibling}if(!_e){for(Ye=ne.child;Ye;){if(Ye===L){_e=!0,L=ne,z=W;break}if(Ye===z){_e=!0,z=ne,L=W;break}Ye=Ye.sibling}if(!_e)throw Error(o(189))}}if(L.alternate!==z)throw Error(o(190))}if(L.tag!==3)throw Error(o(188));return L.stateNode.current===L?d:m}function T(d){return d=O(d),d!==null?$(d):null}function $(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){var m=$(d);if(m!==null)return m;d=d.sibling}return null}function q(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){if(d.tag!==4){var m=q(d);if(m!==null)return m}d=d.sibling}return null}var J=Array.isArray,ae=e.getPublicInstance,ie=e.getRootHostContext,Z=e.getChildHostContext,te=e.prepareForCommit,V=e.resetAfterCommit,B=e.createInstance,D=e.appendInitialChild,U=e.finalizeInitialChildren,X=e.prepareUpdate,ee=e.shouldSetTextContent,K=e.createTextInstance,oe=e.scheduleTimeout,me=e.cancelTimeout,de=e.noTimeout,ye=e.isPrimaryRenderer,Te=e.supportsMutation,Ce=e.supportsPersistence,Ie=e.supportsHydration,Ee=e.getInstanceFromNode,ge=e.preparePortalMount,Re=e.getCurrentEventPriority,Be=e.detachDeletedInstance,Oe=e.supportsMicrotasks,fe=e.scheduleMicrotask,Le=e.supportsTestSelectors,Ne=e.findFiberRoot,ue=e.getBoundingRect,ke=e.getTextContent,Pe=e.isHiddenSubtree,Ue=e.matchAccessibilityRole,st=e.setFocusIfFocusable,dt=e.setupIntersectionObserver,pt=e.appendChild,xt=e.appendChildToContainer,bt=e.commitTextUpdate,At=e.commitMount,Br=e.commitUpdate,_r=e.insertBefore,It=e.insertInContainerBefore,Jt=e.removeChild,Ve=e.removeChildFromContainer,qe=e.resetTextContent,Nt=e.hideInstance,Ct=e.hideTextInstance,ir=e.unhideInstance,Ut=e.unhideTextInstance,xr=e.clearContainer,er=e.cloneInstance,pr=e.createContainerChildSet,Fi=e.appendChildToContainerChildSet,oi=e.finalizeContainerChildren,Ei=e.replaceContainerChildren,Sn=e.cloneHiddenInstance,Zt=e.cloneHiddenTextInstance,ca=e.canHydrateInstance,Fa=e.canHydrateTextInstance,Kn=e.canHydrateSuspenseInstance,Yi=e.isSuspenseInstancePending,zr=e.isSuspenseInstanceFallback,En=e.getSuspenseInstanceFallbackErrorDetails,Rn=e.registerSuspenseInstanceRetry,Sa=e.getNextHydratableSibling,Uo=e.getFirstHydratableChild,Ea=e.getFirstHydratableChildWithinContainer,eo=e.getFirstHydratableChildWithinSuspenseInstance,si=e.hydrateInstance,Aa=e.hydrateTextInstance,ka=e.hydrateSuspenseInstance,Ho=e.getNextHydratableInstanceAfterSuspenseInstance,Bi=e.commitHydratedContainer,to=e.commitHydratedSuspenseInstance,Ds=e.clearSuspenseBoundary,rs=e.clearSuspenseBoundaryFromContainer,su=e.shouldDeleteUnhydratedTailInstances,Lf=e.didNotMatchHydratedContainerTextInstance,An=e.didNotMatchHydratedTextInstance,lu;function ns(d){if(lu===void 0)try{throw Error()}catch(L){var m=L.stack.trim().match(/\n( *(at )?)/);lu=m&&m[1]||""}return`
65
+ `+lu+d}var Pa=!1;function is(d,m){if(!d||Pa)return"";Pa=!0;var L=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(m)if(m=function(){throw Error()},Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(wt){var z=wt}Reflect.construct(d,[],m)}else{try{m.call()}catch(wt){z=wt}d.call(m.prototype)}else{try{throw Error()}catch(wt){z=wt}d()}}catch(wt){if(wt&&z&&typeof wt.stack=="string"){for(var W=wt.stack.split(`
66
+ `),ne=z.stack.split(`
67
+ `),_e=W.length-1,Ye=ne.length-1;1<=_e&&0<=Ye&&W[_e]!==ne[Ye];)Ye--;for(;1<=_e&&0<=Ye;_e--,Ye--)if(W[_e]!==ne[Ye]){if(_e!==1||Ye!==1)do if(_e--,Ye--,0>Ye||W[_e]!==ne[Ye]){var it=`
68
+ `+W[_e].replace(" at new "," at ");return d.displayName&&it.includes("<anonymous>")&&(it=it.replace("<anonymous>",d.displayName)),it}while(1<=_e&&0<=Ye);break}}}finally{Pa=!1,Error.prepareStackTrace=L}return(d=d?d.displayName||d.name:"")?ns(d):""}var Sc=Object.prototype.hasOwnProperty,sl=[],_o=-1;function gi(d){return{current:d}}function cn(d){0>_o||(d.current=sl[_o],sl[_o]=null,_o--)}function Sr(d,m){_o++,sl[_o]=d.current,d.current=m}var as={},Tr=gi(as),Xi=gi(!1),ro=as;function Ki(d,m){var L=d.type.contextTypes;if(!L)return as;var z=d.stateNode;if(z&&z.__reactInternalMemoizedUnmaskedChildContext===m)return z.__reactInternalMemoizedMaskedChildContext;var W={},ne;for(ne in L)W[ne]=m[ne];return z&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=m,d.__reactInternalMemoizedMaskedChildContext=W),W}function Mn(d){return d=d.childContextTypes,d!=null}function Zi(){cn(Xi),cn(Tr)}function ll(d,m,L){if(Tr.current!==as)throw Error(o(168));Sr(Tr,m),Sr(Xi,L)}function Zn(d,m,L){var z=d.stateNode;if(m=m.childContextTypes,typeof z.getChildContext!="function")return L;z=z.getChildContext();for(var W in z)if(!(W in m))throw Error(o(108,I(d)||"Unknown",W));return a({},L,z)}function os(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||as,ro=Tr.current,Sr(Tr,d),Sr(Xi,Xi.current),!0}function Wu(d,m,L){var z=d.stateNode;if(!z)throw Error(o(169));L?(d=Zn(d,m,ro),z.__reactInternalMemoizedMergedChildContext=d,cn(Xi),cn(Tr),Sr(Tr,d)):cn(Xi),Sr(Xi,L)}var Oa=Math.clz32?Math.clz32:uu,Nl=Math.log,ss=Math.LN2;function uu(d){return d>>>=0,d===0?32:31-(Nl(d)/ss|0)|0}var Rr=64,xo=4194304;function ls(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function ul(d,m){var L=d.pendingLanes;if(L===0)return 0;var z=0,W=d.suspendedLanes,ne=d.pingedLanes,_e=L&268435455;if(_e!==0){var Ye=_e&~W;Ye!==0?z=ls(Ye):(ne&=_e,ne!==0&&(z=ls(ne)))}else _e=L&~W,_e!==0?z=ls(_e):ne!==0&&(z=ls(ne));if(z===0)return 0;if(m!==0&&m!==z&&(m&W)===0&&(W=z&-z,ne=m&-m,W>=ne||W===16&&(ne&4194240)!==0))return m;if((z&4)!==0&&(z|=L&16),m=d.entangledLanes,m!==0)for(d=d.entanglements,m&=z;0<m;)L=31-Oa(m),W=1<<L,z|=d[L],m&=~W;return z}function Ec(d,m){switch(d){case 1:case 2:case 4:return m+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 m+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 Ac(d,m){for(var L=d.suspendedLanes,z=d.pingedLanes,W=d.expirationTimes,ne=d.pendingLanes;0<ne;){var _e=31-Oa(ne),Ye=1<<_e,it=W[_e];it===-1?((Ye&L)===0||(Ye&z)!==0)&&(W[_e]=Ec(Ye,m)):it<=m&&(d.expiredLanes|=Ye),ne&=~Ye}}function cl(d){return d=d.pendingLanes&-1073741825,d!==0?d:d&1073741824?1073741824:0}function us(){var d=Rr;return Rr<<=1,(Rr&4194240)===0&&(Rr=64),d}function no(d){for(var m=[],L=0;31>L;L++)m.push(d);return m}function Ba(d,m,L){d.pendingLanes|=m,m!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,m=31-Oa(m),d[m]=L}function za(d,m){var L=d.pendingLanes&~m;d.pendingLanes=m,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=m,d.mutableReadLanes&=m,d.entangledLanes&=m,m=d.entanglements;var z=d.eventTimes;for(d=d.expirationTimes;0<L;){var W=31-Oa(L),ne=1<<W;m[W]=0,z[W]=-1,d[W]=-1,L&=~ne}}function qa(d,m){var L=d.entangledLanes|=m;for(d=d.entanglements;L;){var z=31-Oa(L),W=1<<z;W&m|d[z]&m&&(d[z]|=m),L&=~W}}var Pt=0;function fl(d){return d&=-d,1<d?4<d?(d&268435455)!==0?16:536870912:4:1}var So=i.unstable_scheduleCallback,kc=i.unstable_cancelCallback,Pc=i.unstable_shouldYield,io=i.unstable_requestPaint,wn=i.unstable_now,cu=i.unstable_ImmediatePriority,fu=i.unstable_UserBlockingPriority,Fs=i.unstable_NormalPriority,Vu=i.unstable_IdlePriority,Ua=null,Ai=null;function $o(d){if(Ai&&typeof Ai.onCommitFiberRoot=="function")try{Ai.onCommitFiberRoot(Ua,d,void 0,(d.current.flags&128)===128)}catch{}}function hu(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var Ca=typeof Object.is=="function"?Object.is:hu,ao=null,Eo=!1,Ao=!1;function hl(d){ao===null?ao=[d]:ao.push(d)}function Tl(d){Eo=!0,hl(d)}function li(){if(!Ao&&ao!==null){Ao=!0;var d=0,m=Pt;try{var L=ao;for(Pt=1;d<L.length;d++){var z=L[d];do z=z(!0);while(z!==null)}ao=null,Eo=!1}catch(W){throw ao!==null&&(ao=ao.slice(d+1)),So(cu,li),W}finally{Pt=m,Ao=!1}}return null}var Ha=[],ko=0,dl=null,La=0,Bn=[],fa=0,Qn=null,vi=1,$a="";function H(d,m){Ha[ko++]=La,Ha[ko++]=dl,dl=d,La=m}function ce(d,m,L){Bn[fa++]=vi,Bn[fa++]=$a,Bn[fa++]=Qn,Qn=d;var z=vi;d=$a;var W=32-Oa(z)-1;z&=~(1<<W),L+=1;var ne=32-Oa(m)+W;if(30<ne){var _e=W-W%5;ne=(z&(1<<_e)-1).toString(32),z>>=_e,W-=_e,vi=1<<32-Oa(m)+W|L<<W|z,$a=ne+d}else vi=1<<ne|L<<W|z,$a=d}function Ae(d){d.return!==null&&(H(d,1),ce(d,1,0))}function De(d){for(;d===dl;)dl=Ha[--ko],Ha[ko]=null,La=Ha[--ko],Ha[ko]=null;for(;d===Qn;)Qn=Bn[--fa],Bn[fa]=null,$a=Bn[--fa],Bn[fa]=null,vi=Bn[--fa],Bn[fa]=null}var Ge=null,at=null,ct=!1,Dt=!1,jt=null;function cr(d,m){var L=Qo(5,null,null,0);L.elementType="DELETED",L.stateNode=m,L.return=d,m=d.deletions,m===null?(d.deletions=[L],d.flags|=16):m.push(L)}function fr(d,m){switch(d.tag){case 5:return m=ca(m,d.type,d.pendingProps),m!==null?(d.stateNode=m,Ge=d,at=Uo(m),!0):!1;case 6:return m=Fa(m,d.pendingProps),m!==null?(d.stateNode=m,Ge=d,at=null,!0):!1;case 13:if(m=Kn(m),m!==null){var L=Qn!==null?{id:vi,overflow:$a}:null;return d.memoizedState={dehydrated:m,treeContext:L,retryLane:1073741824},L=Qo(18,null,null,0),L.stateNode=m,L.return=d,d.child=L,Ge=d,at=null,!0}return!1;default:return!1}}function qr(d){return(d.mode&1)!==0&&(d.flags&128)===0}function kn(d){if(ct){var m=at;if(m){var L=m;if(!fr(d,m)){if(qr(d))throw Error(o(418));m=Sa(L);var z=Ge;m&&fr(d,m)?cr(z,L):(d.flags=d.flags&-4097|2,ct=!1,Ge=d)}}else{if(qr(d))throw Error(o(418));d.flags=d.flags&-4097|2,ct=!1,Ge=d}}}function ui(d){for(d=d.return;d!==null&&d.tag!==5&&d.tag!==3&&d.tag!==13;)d=d.return;Ge=d}function on(d){if(!Ie||d!==Ge)return!1;if(!ct)return ui(d),ct=!0,!1;if(d.tag!==3&&(d.tag!==5||su(d.type)&&!ee(d.type,d.memoizedProps))){var m=at;if(m){if(qr(d))throw mi(),Error(o(418));for(;m;)cr(d,m),m=Sa(m)}}if(ui(d),d.tag===13){if(!Ie)throw Error(o(316));if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));at=Ho(d)}else at=Ge?Sa(d.stateNode):null;return!0}function mi(){for(var d=at;d;)d=Sa(d)}function _n(){Ie&&(at=Ge=null,Dt=ct=!1)}function ki(d){jt===null?jt=[d]:jt.push(d)}var Po=s.ReactCurrentBatchConfig;function Qi(d,m){if(Ca(d,m))return!0;if(typeof d!="object"||d===null||typeof m!="object"||m===null)return!1;var L=Object.keys(d),z=Object.keys(m);if(L.length!==z.length)return!1;for(z=0;z<L.length;z++){var W=L[z];if(!Sc.call(m,W)||!Ca(d[W],m[W]))return!1}return!0}function Oc(d){switch(d.tag){case 5:return ns(d.type);case 16:return ns("Lazy");case 13:return ns("Suspense");case 19:return ns("SuspenseList");case 0:case 2:case 15:return d=is(d.type,!1),d;case 11:return d=is(d.type.render,!1),d;case 1:return d=is(d.type,!0),d;default:return""}}function Oo(d,m,L){if(d=L.ref,d!==null&&typeof d!="function"&&typeof d!="object"){if(L._owner){if(L=L._owner,L){if(L.tag!==1)throw Error(o(309));var z=L.stateNode}if(!z)throw Error(o(147,d));var W=z,ne=""+d;return m!==null&&m.ref!==null&&typeof m.ref=="function"&&m.ref._stringRef===ne?m.ref:(m=function(_e){var Ye=W.refs;_e===null?delete Ye[ne]:Ye[ne]=_e},m._stringRef=ne,m)}if(typeof d!="string")throw Error(o(284));if(!L._owner)throw Error(o(290,d))}return d}function cs(d,m){throw d=Object.prototype.toString.call(m),Error(o(31,d==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":d))}function Bs(d){var m=d._init;return m(d._payload)}function pl(d){function m(rt,Ke){if(d){var ut=rt.deletions;ut===null?(rt.deletions=[Ke],rt.flags|=16):ut.push(Ke)}}function L(rt,Ke){if(!d)return null;for(;Ke!==null;)m(rt,Ke),Ke=Ke.sibling;return null}function z(rt,Ke){for(rt=new Map;Ke!==null;)Ke.key!==null?rt.set(Ke.key,Ke):rt.set(Ke.index,Ke),Ke=Ke.sibling;return rt}function W(rt,Ke){return rt=ku(rt,Ke),rt.index=0,rt.sibling=null,rt}function ne(rt,Ke,ut){return rt.index=ut,d?(ut=rt.alternate,ut!==null?(ut=ut.index,ut<Ke?(rt.flags|=2,Ke):ut):(rt.flags|=2,Ke)):(rt.flags|=1048576,Ke)}function _e(rt){return d&&rt.alternate===null&&(rt.flags|=2),rt}function Ye(rt,Ke,ut,Rt){return Ke===null||Ke.tag!==6?(Ke=Gc(ut,rt.mode,Rt),Ke.return=rt,Ke):(Ke=W(Ke,ut),Ke.return=rt,Ke)}function it(rt,Ke,ut,Rt){var nr=ut.type;return nr===f?$t(rt,Ke,ut.props.children,Rt,ut.key):Ke!==null&&(Ke.elementType===nr||typeof nr=="object"&&nr!==null&&nr.$$typeof===k&&Bs(nr)===Ke.type)?(Rt=W(Ke,ut.props),Rt.ref=Oo(rt,Ke,ut),Rt.return=rt,Rt):(Rt=Nh(ut.type,ut.key,ut.props,null,rt.mode,Rt),Rt.ref=Oo(rt,Ke,ut),Rt.return=rt,Rt)}function wt(rt,Ke,ut,Rt){return Ke===null||Ke.tag!==4||Ke.stateNode.containerInfo!==ut.containerInfo||Ke.stateNode.implementation!==ut.implementation?(Ke=Th(ut,rt.mode,Rt),Ke.return=rt,Ke):(Ke=W(Ke,ut.children||[]),Ke.return=rt,Ke)}function $t(rt,Ke,ut,Rt,nr){return Ke===null||Ke.tag!==7?(Ke=Ma(ut,rt.mode,Rt,nr),Ke.return=rt,Ke):(Ke=W(Ke,ut),Ke.return=rt,Ke)}function br(rt,Ke,ut){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number")return Ke=Gc(""+Ke,rt.mode,ut),Ke.return=rt,Ke;if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case u:return ut=Nh(Ke.type,Ke.key,Ke.props,null,rt.mode,ut),ut.ref=Oo(rt,null,Ke),ut.return=rt,ut;case h:return Ke=Th(Ke,rt.mode,ut),Ke.return=rt,Ke;case k:var Rt=Ke._init;return br(rt,Rt(Ke._payload),ut)}if(J(Ke)||M(Ke))return Ke=Ma(Ke,rt.mode,ut,null),Ke.return=rt,Ke;cs(rt,Ke)}return null}function Tt(rt,Ke,ut,Rt){var nr=Ke!==null?Ke.key:null;if(typeof ut=="string"&&ut!==""||typeof ut=="number")return nr!==null?null:Ye(rt,Ke,""+ut,Rt);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case u:return ut.key===nr?it(rt,Ke,ut,Rt):null;case h:return ut.key===nr?wt(rt,Ke,ut,Rt):null;case k:return nr=ut._init,Tt(rt,Ke,nr(ut._payload),Rt)}if(J(ut)||M(ut))return nr!==null?null:$t(rt,Ke,ut,Rt,null);cs(rt,ut)}return null}function Fn(rt,Ke,ut,Rt,nr){if(typeof Rt=="string"&&Rt!==""||typeof Rt=="number")return rt=rt.get(ut)||null,Ye(Ke,rt,""+Rt,nr);if(typeof Rt=="object"&&Rt!==null){switch(Rt.$$typeof){case u:return rt=rt.get(Rt.key===null?ut:Rt.key)||null,it(Ke,rt,Rt,nr);case h:return rt=rt.get(Rt.key===null?ut:Rt.key)||null,wt(Ke,rt,Rt,nr);case k:var Or=Rt._init;return Fn(rt,Ke,ut,Or(Rt._payload),nr)}if(J(Rt)||M(Rt))return rt=rt.get(ut)||null,$t(Ke,rt,Rt,nr,null);cs(Ke,Rt)}return null}function mn(rt,Ke,ut,Rt){for(var nr=null,Or=null,wr=Ke,Vr=Ke=0,ia=null;wr!==null&&Vr<ut.length;Vr++){wr.index>Vr?(ia=wr,wr=null):ia=wr.sibling;var Hr=Tt(rt,wr,ut[Vr],Rt);if(Hr===null){wr===null&&(wr=ia);break}d&&wr&&Hr.alternate===null&&m(rt,wr),Ke=ne(Hr,Ke,Vr),Or===null?nr=Hr:Or.sibling=Hr,Or=Hr,wr=ia}if(Vr===ut.length)return L(rt,wr),ct&&H(rt,Vr),nr;if(wr===null){for(;Vr<ut.length;Vr++)wr=br(rt,ut[Vr],Rt),wr!==null&&(Ke=ne(wr,Ke,Vr),Or===null?nr=wr:Or.sibling=wr,Or=wr);return ct&&H(rt,Vr),nr}for(wr=z(rt,wr);Vr<ut.length;Vr++)ia=Fn(wr,rt,Vr,ut[Vr],Rt),ia!==null&&(d&&ia.alternate!==null&&wr.delete(ia.key===null?Vr:ia.key),Ke=ne(ia,Ke,Vr),Or===null?nr=ia:Or.sibling=ia,Or=ia);return d&&wr.forEach(function(Ka){return m(rt,Ka)}),ct&&H(rt,Vr),nr}function mo(rt,Ke,ut,Rt){var nr=M(ut);if(typeof nr!="function")throw Error(o(150));if(ut=nr.call(ut),ut==null)throw Error(o(151));for(var Or=nr=null,wr=Ke,Vr=Ke=0,ia=null,Hr=ut.next();wr!==null&&!Hr.done;Vr++,Hr=ut.next()){wr.index>Vr?(ia=wr,wr=null):ia=wr.sibling;var Ka=Tt(rt,wr,Hr.value,Rt);if(Ka===null){wr===null&&(wr=ia);break}d&&wr&&Ka.alternate===null&&m(rt,wr),Ke=ne(Ka,Ke,Vr),Or===null?nr=Ka:Or.sibling=Ka,Or=Ka,wr=ia}if(Hr.done)return L(rt,wr),ct&&H(rt,Vr),nr;if(wr===null){for(;!Hr.done;Vr++,Hr=ut.next())Hr=br(rt,Hr.value,Rt),Hr!==null&&(Ke=ne(Hr,Ke,Vr),Or===null?nr=Hr:Or.sibling=Hr,Or=Hr);return ct&&H(rt,Vr),nr}for(wr=z(rt,wr);!Hr.done;Vr++,Hr=ut.next())Hr=Fn(wr,rt,Vr,Hr.value,Rt),Hr!==null&&(d&&Hr.alternate!==null&&wr.delete(Hr.key===null?Vr:Hr.key),Ke=ne(Hr,Ke,Vr),Or===null?nr=Hr:Or.sibling=Hr,Or=Hr);return d&&wr.forEach(function(ng){return m(rt,ng)}),ct&&H(rt,Vr),nr}function xl(rt,Ke,ut,Rt){if(typeof ut=="object"&&ut!==null&&ut.type===f&&ut.key===null&&(ut=ut.props.children),typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case u:e:{for(var nr=ut.key,Or=Ke;Or!==null;){if(Or.key===nr){if(nr=ut.type,nr===f){if(Or.tag===7){L(rt,Or.sibling),Ke=W(Or,ut.props.children),Ke.return=rt,rt=Ke;break e}}else if(Or.elementType===nr||typeof nr=="object"&&nr!==null&&nr.$$typeof===k&&Bs(nr)===Or.type){L(rt,Or.sibling),Ke=W(Or,ut.props),Ke.ref=Oo(rt,Or,ut),Ke.return=rt,rt=Ke;break e}L(rt,Or);break}else m(rt,Or);Or=Or.sibling}ut.type===f?(Ke=Ma(ut.props.children,rt.mode,Rt,ut.key),Ke.return=rt,rt=Ke):(Rt=Nh(ut.type,ut.key,ut.props,null,rt.mode,Rt),Rt.ref=Oo(rt,Ke,ut),Rt.return=rt,rt=Rt)}return _e(rt);case h:e:{for(Or=ut.key;Ke!==null;){if(Ke.key===Or)if(Ke.tag===4&&Ke.stateNode.containerInfo===ut.containerInfo&&Ke.stateNode.implementation===ut.implementation){L(rt,Ke.sibling),Ke=W(Ke,ut.children||[]),Ke.return=rt,rt=Ke;break e}else{L(rt,Ke);break}else m(rt,Ke);Ke=Ke.sibling}Ke=Th(ut,rt.mode,Rt),Ke.return=rt,rt=Ke}return _e(rt);case k:return Or=ut._init,xl(rt,Ke,Or(ut._payload),Rt)}if(J(ut))return mn(rt,Ke,ut,Rt);if(M(ut))return mo(rt,Ke,ut,Rt);cs(rt,ut)}return typeof ut=="string"&&ut!==""||typeof ut=="number"?(ut=""+ut,Ke!==null&&Ke.tag===6?(L(rt,Ke.sibling),Ke=W(Ke,ut),Ke.return=rt,rt=Ke):(L(rt,Ke),Ke=Gc(ut,rt.mode,Rt),Ke.return=rt,rt=Ke),_e(rt)):L(rt,Ke)}return xl}var oo=pl(!0),gl=pl(!1),Pi=gi(null),fs=null,Co=null,Rl=null;function Ml(){Rl=Co=fs=null}function zn(d,m,L){ye?(Sr(Pi,m._currentValue),m._currentValue=L):(Sr(Pi,m._currentValue2),m._currentValue2=L)}function so(d){var m=Pi.current;cn(Pi),ye?d._currentValue=m:d._currentValue2=m}function Lo(d,m,L){for(;d!==null;){var z=d.alternate;if((d.childLanes&m)!==m?(d.childLanes|=m,z!==null&&(z.childLanes|=m)):z!==null&&(z.childLanes&m)!==m&&(z.childLanes|=m),d===L)break;d=d.return}}function zs(d,m){fs=d,Rl=Co=null,d=d.dependencies,d!==null&&d.firstContext!==null&&((d.lanes&m)!==0&&(yi=!0),d.firstContext=null)}function In(d){var m=ye?d._currentValue:d._currentValue2;if(Rl!==d)if(d={context:d,memoizedValue:m,next:null},Co===null){if(fs===null)throw Error(o(308));Co=d,fs.dependencies={lanes:0,firstContext:d}}else Co=Co.next=d;return m}var Ga=null;function vl(d){Ga===null?Ga=[d]:Ga.push(d)}function Il(d,m,L,z){var W=m.interleaved;return W===null?(L.next=L,vl(m)):(L.next=W.next,W.next=L),m.interleaved=L,zi(d,z)}function zi(d,m){d.lanes|=m;var L=d.alternate;for(L!==null&&(L.lanes|=m),L=d,d=d.return;d!==null;)d.childLanes|=m,L=d.alternate,L!==null&&(L.childLanes|=m),L=d,d=d.return;return L.tag===3?L.stateNode:null}var Oi=!1;function Na(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wa(d,m){d=d.updateQueue,m.updateQueue===d&&(m.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,effects:d.effects})}function ha(d,m){return{eventTime:d,lane:m,tag:0,payload:null,callback:null,next:null}}function Ji(d,m,L){var z=d.updateQueue;if(z===null)return null;if(z=z.shared,(sr&2)!==0){var W=z.pending;return W===null?m.next=m:(m.next=W.next,W.next=m),z.pending=m,zi(d,L)}return W=z.interleaved,W===null?(m.next=m,vl(z)):(m.next=W.next,W.next=m),z.interleaved=m,zi(d,L)}function No(d,m,L){if(m=m.updateQueue,m!==null&&(m=m.shared,(L&4194240)!==0)){var z=m.lanes;z&=d.pendingLanes,L|=z,m.lanes=L,qa(d,L)}}function hs(d,m){var L=d.updateQueue,z=d.alternate;if(z!==null&&(z=z.updateQueue,L===z)){var W=null,ne=null;if(L=L.firstBaseUpdate,L!==null){do{var _e={eventTime:L.eventTime,lane:L.lane,tag:L.tag,payload:L.payload,callback:L.callback,next:null};ne===null?W=ne=_e:ne=ne.next=_e,L=L.next}while(L!==null);ne===null?W=ne=m:ne=ne.next=m}else W=ne=m;L={baseState:z.baseState,firstBaseUpdate:W,lastBaseUpdate:ne,shared:z.shared,effects:z.effects},d.updateQueue=L;return}d=L.lastBaseUpdate,d===null?L.firstBaseUpdate=m:d.next=m,L.lastBaseUpdate=m}function lo(d,m,L,z){var W=d.updateQueue;Oi=!1;var ne=W.firstBaseUpdate,_e=W.lastBaseUpdate,Ye=W.shared.pending;if(Ye!==null){W.shared.pending=null;var it=Ye,wt=it.next;it.next=null,_e===null?ne=wt:_e.next=wt,_e=it;var $t=d.alternate;$t!==null&&($t=$t.updateQueue,Ye=$t.lastBaseUpdate,Ye!==_e&&(Ye===null?$t.firstBaseUpdate=wt:Ye.next=wt,$t.lastBaseUpdate=it))}if(ne!==null){var br=W.baseState;_e=0,$t=wt=it=null,Ye=ne;do{var Tt=Ye.lane,Fn=Ye.eventTime;if((z&Tt)===Tt){$t!==null&&($t=$t.next={eventTime:Fn,lane:0,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null});e:{var mn=d,mo=Ye;switch(Tt=m,Fn=L,mo.tag){case 1:if(mn=mo.payload,typeof mn=="function"){br=mn.call(Fn,br,Tt);break e}br=mn;break e;case 3:mn.flags=mn.flags&-65537|128;case 0:if(mn=mo.payload,Tt=typeof mn=="function"?mn.call(Fn,br,Tt):mn,Tt==null)break e;br=a({},br,Tt);break e;case 2:Oi=!0}}Ye.callback!==null&&Ye.lane!==0&&(d.flags|=64,Tt=W.effects,Tt===null?W.effects=[Ye]:Tt.push(Ye))}else Fn={eventTime:Fn,lane:Tt,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null},$t===null?(wt=$t=Fn,it=br):$t=$t.next=Fn,_e|=Tt;if(Ye=Ye.next,Ye===null){if(Ye=W.shared.pending,Ye===null)break;Tt=Ye,Ye=Tt.next,Tt.next=null,W.lastBaseUpdate=Tt,W.shared.pending=null}}while(!0);if($t===null&&(it=br),W.baseState=it,W.firstBaseUpdate=wt,W.lastBaseUpdate=$t,m=W.shared.interleaved,m!==null){W=m;do _e|=W.lane,W=W.next;while(W!==m)}else ne===null&&(W.shared.lanes=0);Vs|=_e,d.lanes=_e,d.memoizedState=br}}function Jn(d,m,L){if(d=m.effects,m.effects=null,d!==null)for(m=0;m<d.length;m++){var z=d[m],W=z.callback;if(W!==null){if(z.callback=null,z=L,typeof W!="function")throw Error(o(191,W));W.call(z)}}}var Go={},ci=gi(Go),Ta=gi(Go),To=gi(Go);function da(d){if(d===Go)throw Error(o(174));return d}function ml(d,m){Sr(To,m),Sr(Ta,d),Sr(ci,Go),d=ie(m),cn(ci),Sr(ci,d)}function Wo(){cn(ci),cn(Ta),cn(To)}function ds(d){var m=da(To.current),L=da(ci.current);m=Z(L,d.type,m),L!==m&&(Sr(Ta,d),Sr(ci,m))}function ps(d){Ta.current===d&&(cn(ci),cn(Ta))}var Jr=gi(0);function gs(d){for(var m=d;m!==null;){if(m.tag===13){var L=m.memoizedState;if(L!==null&&(L=L.dehydrated,L===null||Yi(L)||zr(L)))return m}else if(m.tag===19&&m.memoizedProps.revealOrder!==void 0){if((m.flags&128)!==0)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var vs=[];function qs(){for(var d=0;d<vs.length;d++){var m=vs[d];ye?m._workInProgressVersionPrimary=null:m._workInProgressVersionSecondary=null}vs.length=0}var Pn=s.ReactCurrentDispatcher,pa=s.ReactCurrentBatchConfig,Cr=0,ar=null,Er=null,Lr=null,Va=!1,Us=!1,ms=0,Hs=0;function Ci(){throw Error(o(321))}function yl(d,m){if(m===null)return!1;for(var L=0;L<m.length&&L<d.length;L++)if(!Ca(d[L],m[L]))return!1;return!0}function du(d,m,L,z,W,ne){if(Cr=ne,ar=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,Pn.current=d===null||d.memoizedState===null?Qu:ql,d=L(z,W),Us){ne=0;do{if(Us=!1,ms=0,25<=ne)throw Error(o(301));ne+=1,Lr=Er=null,m.updateQueue=null,Pn.current=Rf,d=L(z,W)}while(Us)}if(Pn.current=Gs,m=Er!==null&&Er.next!==null,Cr=0,Lr=Er=ar=null,Va=!1,m)throw Error(o(300));return d}function Yu(){var d=ms!==0;return ms=0,d}function Ya(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lr===null?ar.memoizedState=Lr=d:Lr=Lr.next=d,Lr}function qi(){if(Er===null){var d=ar.alternate;d=d!==null?d.memoizedState:null}else d=Er.next;var m=Lr===null?ar.memoizedState:Lr.next;if(m!==null)Lr=m,Er=d;else{if(d===null)throw Error(o(310));Er=d,d={memoizedState:Er.memoizedState,baseState:Er.baseState,baseQueue:Er.baseQueue,queue:Er.queue,next:null},Lr===null?ar.memoizedState=Lr=d:Lr=Lr.next=d}return Lr}function Vo(d,m){return typeof m=="function"?m(d):m}function Xu(d){var m=qi(),L=m.queue;if(L===null)throw Error(o(311));L.lastRenderedReducer=d;var z=Er,W=z.baseQueue,ne=L.pending;if(ne!==null){if(W!==null){var _e=W.next;W.next=ne.next,ne.next=_e}z.baseQueue=W=ne,L.pending=null}if(W!==null){ne=W.next,z=z.baseState;var Ye=_e=null,it=null,wt=ne;do{var $t=wt.lane;if((Cr&$t)===$t)it!==null&&(it=it.next={lane:0,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null}),z=wt.hasEagerState?wt.eagerState:d(z,wt.action);else{var br={lane:$t,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null};it===null?(Ye=it=br,_e=z):it=it.next=br,ar.lanes|=$t,Vs|=$t}wt=wt.next}while(wt!==null&&wt!==ne);it===null?_e=z:it.next=Ye,Ca(z,m.memoizedState)||(yi=!0),m.memoizedState=z,m.baseState=_e,m.baseQueue=it,L.lastRenderedState=z}if(d=L.interleaved,d!==null){W=d;do ne=W.lane,ar.lanes|=ne,Vs|=ne,W=W.next;while(W!==d)}else W===null&&(L.lanes=0);return[m.memoizedState,L.dispatch]}function jl(d){var m=qi(),L=m.queue;if(L===null)throw Error(o(311));L.lastRenderedReducer=d;var z=L.dispatch,W=L.pending,ne=m.memoizedState;if(W!==null){L.pending=null;var _e=W=W.next;do ne=d(ne,_e.action),_e=_e.next;while(_e!==W);Ca(ne,m.memoizedState)||(yi=!0),m.memoizedState=ne,m.baseQueue===null&&(m.baseState=ne),L.lastRenderedState=ne}return[ne,z]}function Cc(){}function Lc(d,m){var L=ar,z=qi(),W=m(),ne=!Ca(z.memoizedState,W);if(ne&&(z.memoizedState=W,yi=!0),z=z.queue,Bl(Rc.bind(null,L,z,d),[d]),z.getSnapshot!==m||ne||Lr!==null&&Lr.memoizedState.tag&1){if(L.flags|=2048,Li(9,Tc.bind(null,L,z,W,m),void 0,null),Ir===null)throw Error(o(349));(Cr&30)!==0||Nc(L,m,W)}return W}function Nc(d,m,L){d.flags|=16384,d={getSnapshot:m,value:L},m=ar.updateQueue,m===null?(m={lastEffect:null,stores:null},ar.updateQueue=m,m.stores=[d]):(L=m.stores,L===null?m.stores=[d]:L.push(d))}function Tc(d,m,L,z){m.value=L,m.getSnapshot=z,Mc(m)&&Yo(d)}function Rc(d,m,L){return L(function(){Mc(m)&&Yo(d)})}function Mc(d){var m=d.getSnapshot;d=d.value;try{var L=m();return!Ca(d,L)}catch{return!0}}function Yo(d){var m=zi(d,1);m!==null&&_a(m,d,1,-1)}function Dl(d){var m=Ya();return typeof d=="function"&&(d=d()),m.memoizedState=m.baseState=d,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:d},m.queue=d,d=d.dispatch=Sd.bind(null,ar,d),[m.memoizedState,d]}function Li(d,m,L,z){return d={tag:d,create:m,destroy:L,deps:z,next:null},m=ar.updateQueue,m===null?(m={lastEffect:null,stores:null},ar.updateQueue=m,m.lastEffect=d.next=d):(L=m.lastEffect,L===null?m.lastEffect=d.next=d:(z=L.next,L.next=d,d.next=z,m.lastEffect=d)),d}function uo(){return qi().memoizedState}function Fl(d,m,L,z){var W=Ya();ar.flags|=d,W.memoizedState=Li(1|m,L,void 0,z===void 0?null:z)}function Xo(d,m,L,z){var W=qi();z=z===void 0?null:z;var ne=void 0;if(Er!==null){var _e=Er.memoizedState;if(ne=_e.destroy,z!==null&&yl(z,_e.deps)){W.memoizedState=Li(m,L,ne,z);return}}ar.flags|=d,W.memoizedState=Li(1|m,L,ne,z)}function Nf(d,m){return Fl(8390656,8,d,m)}function Bl(d,m){return Xo(2048,8,d,m)}function pu(d,m){return Xo(4,2,d,m)}function fn(d,m){return Xo(4,4,d,m)}function Ku(d,m){if(typeof m=="function")return d=d(),m(d),function(){m(null)};if(m!=null)return d=d(),m.current=d,function(){m.current=null}}function zl(d,m,L){return L=L!=null?L.concat([d]):null,Xo(4,4,Ku.bind(null,m,d),L)}function $s(){}function gu(d,m){var L=qi();m=m===void 0?null:m;var z=L.memoizedState;return z!==null&&m!==null&&yl(m,z[1])?z[0]:(L.memoizedState=[d,m],d)}function vu(d,m){var L=qi();m=m===void 0?null:m;var z=L.memoizedState;return z!==null&&m!==null&&yl(m,z[1])?z[0]:(d=d(),L.memoizedState=[d,m],d)}function mu(d,m,L){return(Cr&21)===0?(d.baseState&&(d.baseState=!1,yi=!0),d.memoizedState=L):(Ca(L,m)||(L=us(),ar.lanes|=L,Vs|=L,d.baseState=!0),m)}function Ic(d,m){var L=Pt;Pt=L!==0&&4>L?L:4,d(!0);var z=pa.transition;pa.transition={};try{d(!1),m()}finally{Pt=L,pa.transition=z}}function bl(){return qi().memoizedState}function Sh(d,m,L){var z=_i(d);if(L={lane:z,action:L,hasEagerState:!1,eagerState:null,next:null},Eh(d))Tf(m,L);else if(L=Il(d,m,L,z),L!==null){var W=xn();_a(L,d,z,W),Zu(L,m,z)}}function Sd(d,m,L){var z=_i(d),W={lane:z,action:L,hasEagerState:!1,eagerState:null,next:null};if(Eh(d))Tf(m,W);else{var ne=d.alternate;if(d.lanes===0&&(ne===null||ne.lanes===0)&&(ne=m.lastRenderedReducer,ne!==null))try{var _e=m.lastRenderedState,Ye=ne(_e,L);if(W.hasEagerState=!0,W.eagerState=Ye,Ca(Ye,_e)){var it=m.interleaved;it===null?(W.next=W,vl(m)):(W.next=it.next,it.next=W),m.interleaved=W;return}}catch{}finally{}L=Il(d,m,W,z),L!==null&&(W=xn(),_a(L,d,z,W),Zu(L,m,z))}}function Eh(d){var m=d.alternate;return d===ar||m!==null&&m===ar}function Tf(d,m){Us=Va=!0;var L=d.pending;L===null?m.next=m:(m.next=L.next,L.next=m),d.pending=m}function Zu(d,m,L){if((L&4194240)!==0){var z=m.lanes;z&=d.pendingLanes,L|=z,m.lanes=L,qa(d,L)}}var Gs={readContext:In,useCallback:Ci,useContext:Ci,useEffect:Ci,useImperativeHandle:Ci,useInsertionEffect:Ci,useLayoutEffect:Ci,useMemo:Ci,useReducer:Ci,useRef:Ci,useState:Ci,useDebugValue:Ci,useDeferredValue:Ci,useTransition:Ci,useMutableSource:Ci,useSyncExternalStore:Ci,useId:Ci,unstable_isNewReconciler:!1},Qu={readContext:In,useCallback:function(d,m){return Ya().memoizedState=[d,m===void 0?null:m],d},useContext:In,useEffect:Nf,useImperativeHandle:function(d,m,L){return L=L!=null?L.concat([d]):null,Fl(4194308,4,Ku.bind(null,m,d),L)},useLayoutEffect:function(d,m){return Fl(4194308,4,d,m)},useInsertionEffect:function(d,m){return Fl(4,2,d,m)},useMemo:function(d,m){var L=Ya();return m=m===void 0?null:m,d=d(),L.memoizedState=[d,m],d},useReducer:function(d,m,L){var z=Ya();return m=L!==void 0?L(m):m,z.memoizedState=z.baseState=m,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:m},z.queue=d,d=d.dispatch=Sh.bind(null,ar,d),[z.memoizedState,d]},useRef:function(d){var m=Ya();return d={current:d},m.memoizedState=d},useState:Dl,useDebugValue:$s,useDeferredValue:function(d){return Ya().memoizedState=d},useTransition:function(){var d=Dl(!1),m=d[0];return d=Ic.bind(null,d[1]),Ya().memoizedState=d,[m,d]},useMutableSource:function(){},useSyncExternalStore:function(d,m,L){var z=ar,W=Ya();if(ct){if(L===void 0)throw Error(o(407));L=L()}else{if(L=m(),Ir===null)throw Error(o(349));(Cr&30)!==0||Nc(z,m,L)}W.memoizedState=L;var ne={value:L,getSnapshot:m};return W.queue=ne,Nf(Rc.bind(null,z,ne,d),[d]),z.flags|=2048,Li(9,Tc.bind(null,z,ne,L,m),void 0,null),L},useId:function(){var d=Ya(),m=Ir.identifierPrefix;if(ct){var L=$a,z=vi;L=(z&~(1<<32-Oa(z)-1)).toString(32)+L,m=":"+m+"R"+L,L=ms++,0<L&&(m+="H"+L.toString(32)),m+=":"}else L=Hs++,m=":"+m+"r"+L.toString(32)+":";return d.memoizedState=m},unstable_isNewReconciler:!1},ql={readContext:In,useCallback:gu,useContext:In,useEffect:Bl,useImperativeHandle:zl,useInsertionEffect:pu,useLayoutEffect:fn,useMemo:vu,useReducer:Xu,useRef:uo,useState:function(){return Xu(Vo)},useDebugValue:$s,useDeferredValue:function(d){var m=qi();return mu(m,Er.memoizedState,d)},useTransition:function(){var d=Xu(Vo)[0],m=qi().memoizedState;return[d,m]},useMutableSource:Cc,useSyncExternalStore:Lc,useId:bl,unstable_isNewReconciler:!1},Rf={readContext:In,useCallback:gu,useContext:In,useEffect:Bl,useImperativeHandle:zl,useInsertionEffect:pu,useLayoutEffect:fn,useMemo:vu,useReducer:jl,useRef:uo,useState:function(){return jl(Vo)},useDebugValue:$s,useDeferredValue:function(d){var m=qi();return Er===null?m.memoizedState=d:mu(m,Er.memoizedState,d)},useTransition:function(){var d=jl(Vo)[0],m=qi().memoizedState;return[d,m]},useMutableSource:Cc,useSyncExternalStore:Lc,useId:bl,unstable_isNewReconciler:!1};function co(d,m){if(d&&d.defaultProps){m=a({},m),d=d.defaultProps;for(var L in d)m[L]===void 0&&(m[L]=d[L]);return m}return m}function jc(d,m,L,z){m=d.memoizedState,L=L(z,m),L=L==null?m:a({},m,L),d.memoizedState=L,d.lanes===0&&(d.updateQueue.baseState=L)}var Ju={isMounted:function(d){return(d=d._reactInternals)?F(d)===d:!1},enqueueSetState:function(d,m,L){d=d._reactInternals;var z=xn(),W=_i(d),ne=ha(z,W);ne.payload=m,L!=null&&(ne.callback=L),m=Ji(d,ne,W),m!==null&&(_a(m,d,W,z),No(m,d,W))},enqueueReplaceState:function(d,m,L){d=d._reactInternals;var z=xn(),W=_i(d),ne=ha(z,W);ne.tag=1,ne.payload=m,L!=null&&(ne.callback=L),m=Ji(d,ne,W),m!==null&&(_a(m,d,W,z),No(m,d,W))},enqueueForceUpdate:function(d,m){d=d._reactInternals;var L=xn(),z=_i(d),W=ha(L,z);W.tag=2,m!=null&&(W.callback=m),m=Ji(d,W,z),m!==null&&(_a(m,d,z,L),No(m,d,z))}};function Ah(d,m,L,z,W,ne,_e){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(z,ne,_e):m.prototype&&m.prototype.isPureReactComponent?!Qi(L,z)||!Qi(W,ne):!0}function kh(d,m,L){var z=!1,W=as,ne=m.contextType;return typeof ne=="object"&&ne!==null?ne=In(ne):(W=Mn(m)?ro:Tr.current,z=m.contextTypes,ne=(z=z!=null)?Ki(d,W):as),m=new m(L,ne),d.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Ju,d.stateNode=m,m._reactInternals=d,z&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=W,d.__reactInternalMemoizedMaskedChildContext=ne),m}function Dc(d,m,L,z){d=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(L,z),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(L,z),m.state!==d&&Ju.enqueueReplaceState(m,m.state,null)}function ea(d,m,L,z){var W=d.stateNode;W.props=L,W.state=d.memoizedState,W.refs={},Na(d);var ne=m.contextType;typeof ne=="object"&&ne!==null?W.context=In(ne):(ne=Mn(m)?ro:Tr.current,W.context=Ki(d,ne)),W.state=d.memoizedState,ne=m.getDerivedStateFromProps,typeof ne=="function"&&(jc(d,m,ne,L),W.state=d.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof W.getSnapshotBeforeUpdate=="function"||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(m=W.state,typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount(),m!==W.state&&Ju.enqueueReplaceState(W,W.state,null),lo(d,L,W,z),W.state=d.memoizedState),typeof W.componentDidMount=="function"&&(d.flags|=4194308)}function ta(d,m){try{var L="",z=m;do L+=Oc(z),z=z.return;while(z);var W=L}catch(ne){W=`
69
+ Error generating stack: `+ne.message+`
70
+ `+ne.stack}return{value:d,source:m,stack:W,digest:null}}function ga(d,m,L){return{value:d,source:null,stack:L??null,digest:m??null}}function Ro(d,m){try{console.error(m.value)}catch(L){setTimeout(function(){throw L})}}var yu=typeof WeakMap=="function"?WeakMap:Map;function ra(d,m,L){L=ha(-1,L),L.tag=3,L.payload={element:null};var z=m.value;return L.callback=function(){$n||($n=!0,Gn=z),Ro(d,m)},L}function Ra(d,m,L){L=ha(-1,L),L.tag=3;var z=d.type.getDerivedStateFromError;if(typeof z=="function"){var W=m.value;L.payload=function(){return z(W)},L.callback=function(){Ro(d,m)}}var ne=d.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(L.callback=function(){Ro(d,m),typeof z!="function"&&(ho===null?ho=new Set([this]):ho.add(this));var _e=m.stack;this.componentDidCatch(m.value,{componentStack:_e!==null?_e:""})}),L}function Ph(d,m,L){var z=d.pingCache;if(z===null){z=d.pingCache=new yu;var W=new Set;z.set(m,W)}else W=z.get(m),W===void 0&&(W=new Set,z.set(m,W));W.has(L)||(W.add(L),d=Fp.bind(null,d,m,L),m.then(d,d))}function Oh(d){do{var m;if((m=d.tag===13)&&(m=d.memoizedState,m=m!==null?m.dehydrated!==null:!0),m)return d;d=d.return}while(d!==null);return null}function Ws(d,m,L,z,W){return(d.mode&1)===0?(d===m?d.flags|=65536:(d.flags|=128,L.flags|=131072,L.flags&=-52805,L.tag===1&&(L.alternate===null?L.tag=17:(m=ha(-1,1),m.tag=2,Ji(L,m,1))),L.lanes|=1),d):(d.flags|=65536,d.lanes=W,d)}var bu=s.ReactCurrentOwner,yi=!1;function Ni(d,m,L,z){m.child=d===null?gl(m,null,L,z):oo(m,d.child,L,z)}function Fc(d,m,L,z,W){L=L.render;var ne=m.ref;return zs(m,W),z=du(d,m,L,z,ne,W),L=Yu(),d!==null&&!yi?(m.updateQueue=d.updateQueue,m.flags&=-2053,d.lanes&=~W,Y(d,m,W)):(ct&&L&&Ae(m),m.flags|=1,Ni(d,m,z,W),m.child)}function ys(d,m,L,z,W){if(d===null){var ne=L.type;return typeof ne=="function"&&!Hc(ne)&&ne.defaultProps===void 0&&L.compare===null&&L.defaultProps===void 0?(m.tag=15,m.type=ne,Mo(d,m,ne,z,W)):(d=Nh(L.type,null,z,m,m.mode,W),d.ref=m.ref,d.return=m,m.child=d)}if(ne=d.child,(d.lanes&W)===0){var _e=ne.memoizedProps;if(L=L.compare,L=L!==null?L:Qi,L(_e,z)&&d.ref===m.ref)return Y(d,m,W)}return m.flags|=1,d=ku(ne,z),d.ref=m.ref,d.return=m,m.child=d}function Mo(d,m,L,z,W){if(d!==null){var ne=d.memoizedProps;if(Qi(ne,z)&&d.ref===m.ref)if(yi=!1,m.pendingProps=z=ne,(d.lanes&W)!==0)(d.flags&131072)!==0&&(yi=!0);else return m.lanes=d.lanes,Y(d,m,W)}return bs(d,m,L,z,W)}function en(d,m,L){var z=m.pendingProps,W=z.children,ne=d!==null?d.memoizedState:null;if(z.mode==="hidden")if((m.mode&1)===0)m.memoizedState={baseLanes:0,cachePool:null,transitions:null},Sr(Ko,hi),hi|=L;else{if((L&1073741824)===0)return d=ne!==null?ne.baseLanes|L:L,m.lanes=m.childLanes=1073741824,m.memoizedState={baseLanes:d,cachePool:null,transitions:null},m.updateQueue=null,Sr(Ko,hi),hi|=d,null;m.memoizedState={baseLanes:0,cachePool:null,transitions:null},z=ne!==null?ne.baseLanes:L,Sr(Ko,hi),hi|=z}else ne!==null?(z=ne.baseLanes|L,m.memoizedState=null):z=L,Sr(Ko,hi),hi|=z;return Ni(d,m,W,L),m.child}function sn(d,m){var L=m.ref;(d===null&&L!==null||d!==null&&d.ref!==L)&&(m.flags|=512,m.flags|=2097152)}function bs(d,m,L,z,W){var ne=Mn(L)?ro:Tr.current;return ne=Ki(m,ne),zs(m,W),L=du(d,m,L,z,ne,W),z=Yu(),d!==null&&!yi?(m.updateQueue=d.updateQueue,m.flags&=-2053,d.lanes&=~W,Y(d,m,W)):(ct&&z&&Ae(m),m.flags|=1,Ni(d,m,L,W),m.child)}function Ui(d,m,L,z,W){if(Mn(L)){var ne=!0;os(m)}else ne=!1;if(zs(m,W),m.stateNode===null)R(d,m),kh(m,L,z),ea(m,L,z,W),z=!0;else if(d===null){var _e=m.stateNode,Ye=m.memoizedProps;_e.props=Ye;var it=_e.context,wt=L.contextType;typeof wt=="object"&&wt!==null?wt=In(wt):(wt=Mn(L)?ro:Tr.current,wt=Ki(m,wt));var $t=L.getDerivedStateFromProps,br=typeof $t=="function"||typeof _e.getSnapshotBeforeUpdate=="function";br||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ye!==z||it!==wt)&&Dc(m,_e,z,wt),Oi=!1;var Tt=m.memoizedState;_e.state=Tt,lo(m,z,_e,W),it=m.memoizedState,Ye!==z||Tt!==it||Xi.current||Oi?(typeof $t=="function"&&(jc(m,L,$t,z),it=m.memoizedState),(Ye=Oi||Ah(m,L,Ye,z,Tt,it,wt))?(br||typeof _e.UNSAFE_componentWillMount!="function"&&typeof _e.componentWillMount!="function"||(typeof _e.componentWillMount=="function"&&_e.componentWillMount(),typeof _e.UNSAFE_componentWillMount=="function"&&_e.UNSAFE_componentWillMount()),typeof _e.componentDidMount=="function"&&(m.flags|=4194308)):(typeof _e.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=z,m.memoizedState=it),_e.props=z,_e.state=it,_e.context=wt,z=Ye):(typeof _e.componentDidMount=="function"&&(m.flags|=4194308),z=!1)}else{_e=m.stateNode,Wa(d,m),Ye=m.memoizedProps,wt=m.type===m.elementType?Ye:co(m.type,Ye),_e.props=wt,br=m.pendingProps,Tt=_e.context,it=L.contextType,typeof it=="object"&&it!==null?it=In(it):(it=Mn(L)?ro:Tr.current,it=Ki(m,it));var Fn=L.getDerivedStateFromProps;($t=typeof Fn=="function"||typeof _e.getSnapshotBeforeUpdate=="function")||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ye!==br||Tt!==it)&&Dc(m,_e,z,it),Oi=!1,Tt=m.memoizedState,_e.state=Tt,lo(m,z,_e,W);var mn=m.memoizedState;Ye!==br||Tt!==mn||Xi.current||Oi?(typeof Fn=="function"&&(jc(m,L,Fn,z),mn=m.memoizedState),(wt=Oi||Ah(m,L,wt,z,Tt,mn,it)||!1)?($t||typeof _e.UNSAFE_componentWillUpdate!="function"&&typeof _e.componentWillUpdate!="function"||(typeof _e.componentWillUpdate=="function"&&_e.componentWillUpdate(z,mn,it),typeof _e.UNSAFE_componentWillUpdate=="function"&&_e.UNSAFE_componentWillUpdate(z,mn,it)),typeof _e.componentDidUpdate=="function"&&(m.flags|=4),typeof _e.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof _e.componentDidUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=1024),m.memoizedProps=z,m.memoizedState=mn),_e.props=z,_e.state=mn,_e.context=it,z=wt):(typeof _e.componentDidUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=1024),z=!1)}return va(d,m,L,z,ne,W)}function va(d,m,L,z,W,ne){sn(d,m);var _e=(m.flags&128)!==0;if(!z&&!_e)return W&&Wu(m,L,!1),Y(d,m,ne);z=m.stateNode,bu.current=m;var Ye=_e&&typeof L.getDerivedStateFromError!="function"?null:z.render();return m.flags|=1,d!==null&&_e?(m.child=oo(m,d.child,null,ne),m.child=oo(m,null,Ye,ne)):Ni(d,m,Ye,ne),m.memoizedState=z.state,W&&Wu(m,L,!0),m.child}function wl(d){var m=d.stateNode;m.pendingContext?ll(d,m.pendingContext,m.pendingContext!==m.context):m.context&&ll(d,m.context,!1),ml(d,m.containerInfo)}function Ul(d,m,L,z,W){return _n(),ki(W),m.flags|=256,Ni(d,m,L,z),m.child}var ma={dehydrated:null,treeContext:null,retryLane:0};function wu(d){return{baseLanes:d,cachePool:null,transitions:null}}function Mf(d,m,L){var z=m.pendingProps,W=Jr.current,ne=!1,_e=(m.flags&128)!==0,Ye;if((Ye=_e)||(Ye=d!==null&&d.memoizedState===null?!1:(W&2)!==0),Ye?(ne=!0,m.flags&=-129):(d===null||d.memoizedState!==null)&&(W|=1),Sr(Jr,W&1),d===null)return kn(m),d=m.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?((m.mode&1)===0?m.lanes=1:zr(d)?m.lanes=8:m.lanes=1073741824,null):(_e=z.children,d=z.fallback,ne?(z=m.mode,ne=m.child,_e={mode:"hidden",children:_e},(z&1)===0&&ne!==null?(ne.childLanes=0,ne.pendingProps=_e):ne=$c(_e,z,0,null),d=Ma(d,z,L,null),ne.return=m,d.return=m,ne.sibling=d,m.child=ne,m.child.memoizedState=wu(L),m.memoizedState=ma,d):ec(m,_e));if(W=d.memoizedState,W!==null&&(Ye=W.dehydrated,Ye!==null))return Ch(d,m,_e,z,Ye,W,L);if(ne){ne=z.fallback,_e=m.mode,W=d.child,Ye=W.sibling;var it={mode:"hidden",children:z.children};return(_e&1)===0&&m.child!==W?(z=m.child,z.childLanes=0,z.pendingProps=it,m.deletions=null):(z=ku(W,it),z.subtreeFlags=W.subtreeFlags&14680064),Ye!==null?ne=ku(Ye,ne):(ne=Ma(ne,_e,L,null),ne.flags|=2),ne.return=m,z.return=m,z.sibling=ne,m.child=z,z=ne,ne=m.child,_e=d.child.memoizedState,_e=_e===null?wu(L):{baseLanes:_e.baseLanes|L,cachePool:null,transitions:_e.transitions},ne.memoizedState=_e,ne.childLanes=d.childLanes&~L,m.memoizedState=ma,z}return ne=d.child,d=ne.sibling,z=ku(ne,{mode:"visible",children:z.children}),(m.mode&1)===0&&(z.lanes=L),z.return=m,z.sibling=null,d!==null&&(L=m.deletions,L===null?(m.deletions=[d],m.flags|=16):L.push(d)),m.child=z,m.memoizedState=null,z}function ec(d,m){return m=$c({mode:"visible",children:m},d.mode,0,null),m.return=d,d.child=m}function ws(d,m,L,z){return z!==null&&ki(z),oo(m,d.child,null,L),d=ec(m,m.pendingProps.children),d.flags|=2,m.memoizedState=null,d}function Ch(d,m,L,z,W,ne,_e){if(L)return m.flags&256?(m.flags&=-257,z=ga(Error(o(422))),ws(d,m,_e,z)):m.memoizedState!==null?(m.child=d.child,m.flags|=128,null):(ne=z.fallback,W=m.mode,z=$c({mode:"visible",children:z.children},W,0,null),ne=Ma(ne,W,_e,null),ne.flags|=2,z.return=m,ne.return=m,z.sibling=ne,m.child=z,(m.mode&1)!==0&&oo(m,d.child,null,_e),m.child.memoizedState=wu(_e),m.memoizedState=ma,ne);if((m.mode&1)===0)return ws(d,m,_e,null);if(zr(W))return z=En(W).digest,ne=Error(o(419)),z=ga(ne,z,void 0),ws(d,m,_e,z);if(L=(_e&d.childLanes)!==0,yi||L){if(z=Ir,z!==null){switch(_e&-_e){case 4:W=2;break;case 16:W=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:W=32;break;case 536870912:W=268435456;break;default:W=0}W=(W&(z.suspendedLanes|_e))!==0?0:W,W!==0&&W!==ne.retryLane&&(ne.retryLane=W,zi(d,W),_a(z,d,W,-1))}return vo(),z=ga(Error(o(421))),ws(d,m,_e,z)}return Yi(W)?(m.flags|=128,m.child=d.child,m=zp.bind(null,d),Rn(W,m),null):(d=ne.treeContext,Ie&&(at=eo(W),Ge=m,ct=!0,jt=null,Dt=!1,d!==null&&(Bn[fa++]=vi,Bn[fa++]=$a,Bn[fa++]=Qn,vi=d.id,$a=d.overflow,Qn=m)),m=ec(m,z.children),m.flags|=4096,m)}function _s(d,m,L){d.lanes|=m;var z=d.alternate;z!==null&&(z.lanes|=m),Lo(d.return,m,L)}function Hl(d,m,L,z,W){var ne=d.memoizedState;ne===null?d.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:z,tail:L,tailMode:W}:(ne.isBackwards=m,ne.rendering=null,ne.renderingStartTime=0,ne.last=z,ne.tail=L,ne.tailMode=W)}function P(d,m,L){var z=m.pendingProps,W=z.revealOrder,ne=z.tail;if(Ni(d,m,z.children,L),z=Jr.current,(z&2)!==0)z=z&1|2,m.flags|=128;else{if(d!==null&&(d.flags&128)!==0)e:for(d=m.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&_s(d,L,m);else if(d.tag===19)_s(d,L,m);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===m)break e;for(;d.sibling===null;){if(d.return===null||d.return===m)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}z&=1}if(Sr(Jr,z),(m.mode&1)===0)m.memoizedState=null;else switch(W){case"forwards":for(L=m.child,W=null;L!==null;)d=L.alternate,d!==null&&gs(d)===null&&(W=L),L=L.sibling;L=W,L===null?(W=m.child,m.child=null):(W=L.sibling,L.sibling=null),Hl(m,!1,W,L,ne);break;case"backwards":for(L=null,W=m.child,m.child=null;W!==null;){if(d=W.alternate,d!==null&&gs(d)===null){m.child=W;break}d=W.sibling,W.sibling=L,L=W,W=d}Hl(m,!0,L,null,ne);break;case"together":Hl(m,!1,null,null,void 0);break;default:m.memoizedState=null}return m.child}function R(d,m){(m.mode&1)===0&&d!==null&&(d.alternate=null,m.alternate=null,m.flags|=2)}function Y(d,m,L){if(d!==null&&(m.dependencies=d.dependencies),Vs|=m.lanes,(L&m.childLanes)===0)return null;if(d!==null&&m.child!==d.child)throw Error(o(153));if(m.child!==null){for(d=m.child,L=ku(d,d.pendingProps),m.child=L,L.return=m;d.sibling!==null;)d=d.sibling,L=L.sibling=ku(d,d.pendingProps),L.return=m;L.sibling=null}return m.child}function re(d,m,L){switch(m.tag){case 3:wl(m),_n();break;case 5:ds(m);break;case 1:Mn(m.type)&&os(m);break;case 4:ml(m,m.stateNode.containerInfo);break;case 10:zn(m,m.type._context,m.memoizedProps.value);break;case 13:var z=m.memoizedState;if(z!==null)return z.dehydrated!==null?(Sr(Jr,Jr.current&1),m.flags|=128,null):(L&m.child.childLanes)!==0?Mf(d,m,L):(Sr(Jr,Jr.current&1),d=Y(d,m,L),d!==null?d.sibling:null);Sr(Jr,Jr.current&1);break;case 19:if(z=(L&m.childLanes)!==0,(d.flags&128)!==0){if(z)return P(d,m,L);m.flags|=128}var W=m.memoizedState;if(W!==null&&(W.rendering=null,W.tail=null,W.lastEffect=null),Sr(Jr,Jr.current),z)break;return null;case 22:case 23:return m.lanes=0,en(d,m,L)}return Y(d,m,L)}function le(d){d.flags|=4}function pe(d,m){if(d!==null&&d.child===m.child)return!0;if((m.flags&16)!==0)return!1;for(d=m.child;d!==null;){if((d.flags&12854)!==0||(d.subtreeFlags&12854)!==0)return!1;d=d.sibling}return!0}var ve,be,we,Se;if(Te)ve=function(d,m){for(var L=m.child;L!==null;){if(L.tag===5||L.tag===6)D(d,L.stateNode);else if(L.tag!==4&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===m)break;for(;L.sibling===null;){if(L.return===null||L.return===m)return;L=L.return}L.sibling.return=L.return,L=L.sibling}},be=function(){},we=function(d,m,L,z,W){if(d=d.memoizedProps,d!==z){var ne=m.stateNode,_e=da(ci.current);L=X(ne,L,d,z,W,_e),(m.updateQueue=L)&&le(m)}},Se=function(d,m,L,z){L!==z&&le(m)};else if(Ce){ve=function(d,m,L,z){for(var W=m.child;W!==null;){if(W.tag===5){var ne=W.stateNode;L&&z&&(ne=Sn(ne,W.type,W.memoizedProps,W)),D(d,ne)}else if(W.tag===6)ne=W.stateNode,L&&z&&(ne=Zt(ne,W.memoizedProps,W)),D(d,ne);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ne=W.child,ne!==null&&(ne.return=W),ve(d,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===m)break;for(;W.sibling===null;){if(W.return===null||W.return===m)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};var Fe=function(d,m,L,z){for(var W=m.child;W!==null;){if(W.tag===5){var ne=W.stateNode;L&&z&&(ne=Sn(ne,W.type,W.memoizedProps,W)),Fi(d,ne)}else if(W.tag===6)ne=W.stateNode,L&&z&&(ne=Zt(ne,W.memoizedProps,W)),Fi(d,ne);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ne=W.child,ne!==null&&(ne.return=W),Fe(d,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===m)break;for(;W.sibling===null;){if(W.return===null||W.return===m)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};be=function(d,m){var L=m.stateNode;if(!pe(d,m)){d=L.containerInfo;var z=pr(d);Fe(z,m,!1,!1),L.pendingChildren=z,le(m),oi(d,z)}},we=function(d,m,L,z,W){var ne=d.stateNode,_e=d.memoizedProps;if((d=pe(d,m))&&_e===z)m.stateNode=ne;else{var Ye=m.stateNode,it=da(ci.current),wt=null;_e!==z&&(wt=X(Ye,L,_e,z,W,it)),d&&wt===null?m.stateNode=ne:(ne=er(ne,wt,L,_e,z,m,d,Ye),U(ne,L,z,W,it)&&le(m),m.stateNode=ne,d?le(m):ve(ne,m,!1,!1))}},Se=function(d,m,L,z){L!==z?(d=da(To.current),L=da(ci.current),m.stateNode=K(z,d,L,m),le(m)):m.stateNode=d.stateNode}}else be=function(){},we=function(){},Se=function(){};function Je(d,m){if(!ct)switch(d.tailMode){case"hidden":m=d.tail;for(var L=null;m!==null;)m.alternate!==null&&(L=m),m=m.sibling;L===null?d.tail=null:L.sibling=null;break;case"collapsed":L=d.tail;for(var z=null;L!==null;)L.alternate!==null&&(z=L),L=L.sibling;z===null?m||d.tail===null?d.tail=null:d.tail.sibling=null:z.sibling=null}}function xe(d){var m=d.alternate!==null&&d.alternate.child===d.child,L=0,z=0;if(m)for(var W=d.child;W!==null;)L|=W.lanes|W.childLanes,z|=W.subtreeFlags&14680064,z|=W.flags&14680064,W.return=d,W=W.sibling;else for(W=d.child;W!==null;)L|=W.lanes|W.childLanes,z|=W.subtreeFlags,z|=W.flags,W.return=d,W=W.sibling;return d.subtreeFlags|=z,d.childLanes=L,m}function $e(d,m,L){var z=m.pendingProps;switch(De(m),m.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xe(m),null;case 1:return Mn(m.type)&&Zi(),xe(m),null;case 3:return L=m.stateNode,Wo(),cn(Xi),cn(Tr),qs(),L.pendingContext&&(L.context=L.pendingContext,L.pendingContext=null),(d===null||d.child===null)&&(on(m)?le(m):d===null||d.memoizedState.isDehydrated&&(m.flags&256)===0||(m.flags|=1024,jt!==null&&(tc(jt),jt=null))),be(d,m),xe(m),null;case 5:ps(m),L=da(To.current);var W=m.type;if(d!==null&&m.stateNode!=null)we(d,m,W,z,L),d.ref!==m.ref&&(m.flags|=512,m.flags|=2097152);else{if(!z){if(m.stateNode===null)throw Error(o(166));return xe(m),null}if(d=da(ci.current),on(m)){if(!Ie)throw Error(o(175));d=si(m.stateNode,m.type,m.memoizedProps,L,d,m,!Dt),m.updateQueue=d,d!==null&&le(m)}else{var ne=B(W,z,L,d,m);ve(ne,m,!1,!1),m.stateNode=ne,U(ne,W,z,L,d)&&le(m)}m.ref!==null&&(m.flags|=512,m.flags|=2097152)}return xe(m),null;case 6:if(d&&m.stateNode!=null)Se(d,m,d.memoizedProps,z);else{if(typeof z!="string"&&m.stateNode===null)throw Error(o(166));if(d=da(To.current),L=da(ci.current),on(m)){if(!Ie)throw Error(o(176));if(d=m.stateNode,L=m.memoizedProps,(z=Aa(d,L,m,!Dt))&&(W=Ge,W!==null))switch(W.tag){case 3:Lf(W.stateNode.containerInfo,d,L,(W.mode&1)!==0);break;case 5:An(W.type,W.memoizedProps,W.stateNode,d,L,(W.mode&1)!==0)}z&&le(m)}else m.stateNode=K(z,d,L,m)}return xe(m),null;case 13:if(cn(Jr),z=m.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(ct&&at!==null&&(m.mode&1)!==0&&(m.flags&128)===0)mi(),_n(),m.flags|=98560,W=!1;else if(W=on(m),z!==null&&z.dehydrated!==null){if(d===null){if(!W)throw Error(o(318));if(!Ie)throw Error(o(344));if(W=m.memoizedState,W=W!==null?W.dehydrated:null,!W)throw Error(o(317));ka(W,m)}else _n(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;xe(m),W=!1}else jt!==null&&(tc(jt),jt=null),W=!0;if(!W)return m.flags&65536?m:null}return(m.flags&128)!==0?(m.lanes=L,m):(L=z!==null,L!==(d!==null&&d.memoizedState!==null)&&L&&(m.child.flags|=8192,(m.mode&1)!==0&&(d===null||(Jr.current&1)!==0?hn===0&&(hn=3):vo())),m.updateQueue!==null&&(m.flags|=4),xe(m),null);case 4:return Wo(),be(d,m),d===null&&ge(m.stateNode.containerInfo),xe(m),null;case 10:return so(m.type._context),xe(m),null;case 17:return Mn(m.type)&&Zi(),xe(m),null;case 19:if(cn(Jr),W=m.memoizedState,W===null)return xe(m),null;if(z=(m.flags&128)!==0,ne=W.rendering,ne===null)if(z)Je(W,!1);else{if(hn!==0||d!==null&&(d.flags&128)!==0)for(d=m.child;d!==null;){if(ne=gs(d),ne!==null){for(m.flags|=128,Je(W,!1),d=ne.updateQueue,d!==null&&(m.updateQueue=d,m.flags|=4),m.subtreeFlags=0,d=L,L=m.child;L!==null;)z=L,W=d,z.flags&=14680066,ne=z.alternate,ne===null?(z.childLanes=0,z.lanes=W,z.child=null,z.subtreeFlags=0,z.memoizedProps=null,z.memoizedState=null,z.updateQueue=null,z.dependencies=null,z.stateNode=null):(z.childLanes=ne.childLanes,z.lanes=ne.lanes,z.child=ne.child,z.subtreeFlags=0,z.deletions=null,z.memoizedProps=ne.memoizedProps,z.memoizedState=ne.memoizedState,z.updateQueue=ne.updateQueue,z.type=ne.type,W=ne.dependencies,z.dependencies=W===null?null:{lanes:W.lanes,firstContext:W.firstContext}),L=L.sibling;return Sr(Jr,Jr.current&1|2),m.child}d=d.sibling}W.tail!==null&&wn()>Su&&(m.flags|=128,z=!0,Je(W,!1),m.lanes=4194304)}else{if(!z)if(d=gs(ne),d!==null){if(m.flags|=128,z=!0,d=d.updateQueue,d!==null&&(m.updateQueue=d,m.flags|=4),Je(W,!0),W.tail===null&&W.tailMode==="hidden"&&!ne.alternate&&!ct)return xe(m),null}else 2*wn()-W.renderingStartTime>Su&&L!==1073741824&&(m.flags|=128,z=!0,Je(W,!1),m.lanes=4194304);W.isBackwards?(ne.sibling=m.child,m.child=ne):(d=W.last,d!==null?d.sibling=ne:m.child=ne,W.last=ne)}return W.tail!==null?(m=W.tail,W.rendering=m,W.tail=m.sibling,W.renderingStartTime=wn(),m.sibling=null,d=Jr.current,Sr(Jr,z?d&1|2:d&1),m):(xe(m),null);case 22:case 23:return Au(),L=m.memoizedState!==null,d!==null&&d.memoizedState!==null!==L&&(m.flags|=8192),L&&(m.mode&1)!==0?(hi&1073741824)!==0&&(xe(m),Te&&m.subtreeFlags&6&&(m.flags|=8192)):xe(m),null;case 24:return null;case 25:return null}throw Error(o(156,m.tag))}function Qe(d,m){switch(De(m),m.tag){case 1:return Mn(m.type)&&Zi(),d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 3:return Wo(),cn(Xi),cn(Tr),qs(),d=m.flags,(d&65536)!==0&&(d&128)===0?(m.flags=d&-65537|128,m):null;case 5:return ps(m),null;case 13:if(cn(Jr),d=m.memoizedState,d!==null&&d.dehydrated!==null){if(m.alternate===null)throw Error(o(340));_n()}return d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 19:return cn(Jr),null;case 4:return Wo(),null;case 10:return so(m.type._context),null;case 22:case 23:return Au(),null;case 24:return null;default:return null}}var lt=!1,Xe=!1,ot=typeof WeakSet=="function"?WeakSet:Set,He=null;function ft(d,m){var L=d.ref;if(L!==null)if(typeof L=="function")try{L(null)}catch(z){Vn(d,m,z)}else L.current=null}function ht(d,m,L){try{L()}catch(z){Vn(d,m,z)}}var Wt=!1;function Bt(d,m){for(te(d.containerInfo),He=m;He!==null;)if(d=He,m=d.child,(d.subtreeFlags&1028)!==0&&m!==null)m.return=d,He=m;else for(;He!==null;){d=He;try{var L=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(L!==null){var z=L.memoizedProps,W=L.memoizedState,ne=d.stateNode,_e=ne.getSnapshotBeforeUpdate(d.elementType===d.type?z:co(d.type,z),W);ne.__reactInternalSnapshotBeforeUpdate=_e}break;case 3:Te&&xr(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ye){Vn(d,d.return,Ye)}if(m=d.sibling,m!==null){m.return=d.return,He=m;break}He=d.return}return L=Wt,Wt=!1,L}function hr(d,m,L){var z=m.updateQueue;if(z=z!==null?z.lastEffect:null,z!==null){var W=z=z.next;do{if((W.tag&d)===d){var ne=W.destroy;W.destroy=void 0,ne!==void 0&&ht(m,L,ne)}W=W.next}while(W!==z)}}function zt(d,m){if(m=m.updateQueue,m=m!==null?m.lastEffect:null,m!==null){var L=m=m.next;do{if((L.tag&d)===d){var z=L.create;L.destroy=z()}L=L.next}while(L!==m)}}function Pr(d){var m=d.ref;if(m!==null){var L=d.stateNode;switch(d.tag){case 5:d=ae(L);break;default:d=L}typeof m=="function"?m(d):m.current=d}}function qn(d){var m=d.alternate;m!==null&&(d.alternate=null,qn(m)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(m=d.stateNode,m!==null&&Be(m)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function vr(d){return d.tag===5||d.tag===3||d.tag===4}function Ft(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||vr(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function St(d,m,L){var z=d.tag;if(z===5||z===6)d=d.stateNode,m?It(L,d,m):xt(L,d);else if(z!==4&&(d=d.child,d!==null))for(St(d,m,L),d=d.sibling;d!==null;)St(d,m,L),d=d.sibling}function Un(d,m,L){var z=d.tag;if(z===5||z===6)d=d.stateNode,m?_r(L,d,m):pt(L,d);else if(z!==4&&(d=d.child,d!==null))for(Un(d,m,L),d=d.sibling;d!==null;)Un(d,m,L),d=d.sibling}var Ht=null,dr=!1;function Mr(d,m,L){for(L=L.child;L!==null;)bi(d,m,L),L=L.sibling}function bi(d,m,L){if(Ai&&typeof Ai.onCommitFiberUnmount=="function")try{Ai.onCommitFiberUnmount(Ua,L)}catch{}switch(L.tag){case 5:Xe||ft(L,m);case 6:if(Te){var z=Ht,W=dr;Ht=null,Mr(d,m,L),Ht=z,dr=W,Ht!==null&&(dr?Ve(Ht,L.stateNode):Jt(Ht,L.stateNode))}else Mr(d,m,L);break;case 18:Te&&Ht!==null&&(dr?rs(Ht,L.stateNode):Ds(Ht,L.stateNode));break;case 4:Te?(z=Ht,W=dr,Ht=L.stateNode.containerInfo,dr=!0,Mr(d,m,L),Ht=z,dr=W):(Ce&&(z=L.stateNode.containerInfo,W=pr(z),Ei(z,W)),Mr(d,m,L));break;case 0:case 11:case 14:case 15:if(!Xe&&(z=L.updateQueue,z!==null&&(z=z.lastEffect,z!==null))){W=z=z.next;do{var ne=W,_e=ne.destroy;ne=ne.tag,_e!==void 0&&((ne&2)!==0||(ne&4)!==0)&&ht(L,m,_e),W=W.next}while(W!==z)}Mr(d,m,L);break;case 1:if(!Xe&&(ft(L,m),z=L.stateNode,typeof z.componentWillUnmount=="function"))try{z.props=L.memoizedProps,z.state=L.memoizedState,z.componentWillUnmount()}catch(Ye){Vn(L,m,Ye)}Mr(d,m,L);break;case 21:Mr(d,m,L);break;case 22:L.mode&1?(Xe=(z=Xe)||L.memoizedState!==null,Mr(d,m,L),Xe=z):Mr(d,m,L);break;default:Mr(d,m,L)}}function fi(d){var m=d.updateQueue;if(m!==null){d.updateQueue=null;var L=d.stateNode;L===null&&(L=d.stateNode=new ot),m.forEach(function(z){var W=eg.bind(null,d,z);L.has(z)||(L.add(z),z.then(W,W))})}}function Ur(d,m){var L=m.deletions;if(L!==null)for(var z=0;z<L.length;z++){var W=L[z];try{var ne=d,_e=m;if(Te){var Ye=_e;e:for(;Ye!==null;){switch(Ye.tag){case 5:Ht=Ye.stateNode,dr=!1;break e;case 3:Ht=Ye.stateNode.containerInfo,dr=!0;break e;case 4:Ht=Ye.stateNode.containerInfo,dr=!0;break e}Ye=Ye.return}if(Ht===null)throw Error(o(160));bi(ne,_e,W),Ht=null,dr=!1}else bi(ne,_e,W);var it=W.alternate;it!==null&&(it.return=null),W.return=null}catch(wt){Vn(W,m,wt)}}if(m.subtreeFlags&12854)for(m=m.child;m!==null;)wi(m,d),m=m.sibling}function wi(d,m){var L=d.alternate,z=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:if(Ur(m,d),vn(d),z&4){try{hr(3,d,d.return),zt(3,d)}catch(Tt){Vn(d,d.return,Tt)}try{hr(5,d,d.return)}catch(Tt){Vn(d,d.return,Tt)}}break;case 1:Ur(m,d),vn(d),z&512&&L!==null&&ft(L,L.return);break;case 5:if(Ur(m,d),vn(d),z&512&&L!==null&&ft(L,L.return),Te){if(d.flags&32){var W=d.stateNode;try{qe(W)}catch(Tt){Vn(d,d.return,Tt)}}if(z&4&&(W=d.stateNode,W!=null)){var ne=d.memoizedProps;if(L=L!==null?L.memoizedProps:ne,z=d.type,m=d.updateQueue,d.updateQueue=null,m!==null)try{Br(W,m,z,L,ne,d)}catch(Tt){Vn(d,d.return,Tt)}}}break;case 6:if(Ur(m,d),vn(d),z&4&&Te){if(d.stateNode===null)throw Error(o(162));W=d.stateNode,ne=d.memoizedProps,L=L!==null?L.memoizedProps:ne;try{bt(W,L,ne)}catch(Tt){Vn(d,d.return,Tt)}}break;case 3:if(Ur(m,d),vn(d),z&4){if(Te&&Ie&&L!==null&&L.memoizedState.isDehydrated)try{Bi(m.containerInfo)}catch(Tt){Vn(d,d.return,Tt)}if(Ce){W=m.containerInfo,ne=m.pendingChildren;try{Ei(W,ne)}catch(Tt){Vn(d,d.return,Tt)}}}break;case 4:if(Ur(m,d),vn(d),z&4&&Ce){ne=d.stateNode,W=ne.containerInfo,ne=ne.pendingChildren;try{Ei(W,ne)}catch(Tt){Vn(d,d.return,Tt)}}break;case 13:Ur(m,d),vn(d),W=d.child,W.flags&8192&&(ne=W.memoizedState!==null,W.stateNode.isHidden=ne,!ne||W.alternate!==null&&W.alternate.memoizedState!==null||(xu=wn())),z&4&&fi(d);break;case 22:var _e=L!==null&&L.memoizedState!==null;if(d.mode&1?(Xe=(L=Xe)||_e,Ur(m,d),Xe=L):Ur(m,d),vn(d),z&8192){if(L=d.memoizedState!==null,(d.stateNode.isHidden=L)&&!_e&&(d.mode&1)!==0)for(He=d,z=d.child;z!==null;){for(m=He=z;He!==null;){_e=He;var Ye=_e.child;switch(_e.tag){case 0:case 11:case 14:case 15:hr(4,_e,_e.return);break;case 1:ft(_e,_e.return);var it=_e.stateNode;if(typeof it.componentWillUnmount=="function"){var wt=_e,$t=_e.return;try{var br=wt;it.props=br.memoizedProps,it.state=br.memoizedState,it.componentWillUnmount()}catch(Tt){Vn(wt,$t,Tt)}}break;case 5:ft(_e,_e.return);break;case 22:if(_e.memoizedState!==null){On(m);continue}}Ye!==null?(Ye.return=_e,He=Ye):On(m)}z=z.sibling}if(Te){e:if(z=null,Te)for(m=d;;){if(m.tag===5){if(z===null){z=m;try{W=m.stateNode,L?Nt(W):ir(m.stateNode,m.memoizedProps)}catch(Tt){Vn(d,d.return,Tt)}}}else if(m.tag===6){if(z===null)try{ne=m.stateNode,L?Ct(ne):Ut(ne,m.memoizedProps)}catch(Tt){Vn(d,d.return,Tt)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===d)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break e;for(;m.sibling===null;){if(m.return===null||m.return===d)break e;z===m&&(z=null),m=m.return}z===m&&(z=null),m.sibling.return=m.return,m=m.sibling}}}break;case 19:Ur(m,d),vn(d),z&4&&fi(d);break;case 21:break;default:Ur(m,d),vn(d)}}function vn(d){var m=d.flags;if(m&2){try{if(Te){e:{for(var L=d.return;L!==null;){if(vr(L)){var z=L;break e}L=L.return}throw Error(o(160))}switch(z.tag){case 5:var W=z.stateNode;z.flags&32&&(qe(W),z.flags&=-33);var ne=Ft(d);Un(d,ne,W);break;case 3:case 4:var _e=z.stateNode.containerInfo,Ye=Ft(d);St(d,Ye,_e);break;default:throw Error(o(161))}}}catch(it){Vn(d,d.return,it)}d.flags&=-3}m&4096&&(d.flags&=-4097)}function jn(d,m,L){He=d,Nr(d)}function Nr(d,m,L){for(var z=(d.mode&1)!==0;He!==null;){var W=He,ne=W.child;if(W.tag===22&&z){var _e=W.memoizedState!==null||lt;if(!_e){var Ye=W.alternate,it=Ye!==null&&Ye.memoizedState!==null||Xe;Ye=lt;var wt=Xe;if(lt=_e,(Xe=it)&&!wt)for(He=W;He!==null;)_e=He,it=_e.child,_e.tag===22&&_e.memoizedState!==null?Gr(W):it!==null?(it.return=_e,He=it):Gr(W);for(;ne!==null;)He=ne,Nr(ne),ne=ne.sibling;He=W,lt=Ye,Xe=wt}$r(d)}else(W.subtreeFlags&8772)!==0&&ne!==null?(ne.return=W,He=ne):$r(d)}}function $r(d){for(;He!==null;){var m=He;if((m.flags&8772)!==0){var L=m.alternate;try{if((m.flags&8772)!==0)switch(m.tag){case 0:case 11:case 15:Xe||zt(5,m);break;case 1:var z=m.stateNode;if(m.flags&4&&!Xe)if(L===null)z.componentDidMount();else{var W=m.elementType===m.type?L.memoizedProps:co(m.type,L.memoizedProps);z.componentDidUpdate(W,L.memoizedState,z.__reactInternalSnapshotBeforeUpdate)}var ne=m.updateQueue;ne!==null&&Jn(m,ne,z);break;case 3:var _e=m.updateQueue;if(_e!==null){if(L=null,m.child!==null)switch(m.child.tag){case 5:L=ae(m.child.stateNode);break;case 1:L=m.child.stateNode}Jn(m,_e,L)}break;case 5:var Ye=m.stateNode;L===null&&m.flags&4&&At(Ye,m.type,m.memoizedProps,m);break;case 6:break;case 4:break;case 12:break;case 13:if(Ie&&m.memoizedState===null){var it=m.alternate;if(it!==null){var wt=it.memoizedState;if(wt!==null){var $t=wt.dehydrated;$t!==null&&to($t)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Xe||m.flags&512&&Pr(m)}catch(br){Vn(m,m.return,br)}}if(m===d){He=null;break}if(L=m.sibling,L!==null){L.return=m.return,He=L;break}He=m.return}}function On(d){for(;He!==null;){var m=He;if(m===d){He=null;break}var L=m.sibling;if(L!==null){L.return=m.return,He=L;break}He=m.return}}function Gr(d){for(;He!==null;){var m=He;try{switch(m.tag){case 0:case 11:case 15:var L=m.return;try{zt(4,m)}catch(it){Vn(m,L,it)}break;case 1:var z=m.stateNode;if(typeof z.componentDidMount=="function"){var W=m.return;try{z.componentDidMount()}catch(it){Vn(m,W,it)}}var ne=m.return;try{Pr(m)}catch(it){Vn(m,ne,it)}break;case 5:var _e=m.return;try{Pr(m)}catch(it){Vn(m,_e,it)}}}catch(it){Vn(m,m.return,it)}if(m===d){He=null;break}var Ye=m.sibling;if(Ye!==null){Ye.return=m.return,He=Ye;break}He=m.return}}var Cn=0,Ln=1,tn=2,Ti=3,Yr=4;if(typeof Symbol=="function"&&Symbol.for){var Xr=Symbol.for;Cn=Xr("selector.component"),Ln=Xr("selector.has_pseudo_class"),tn=Xr("selector.role"),Ti=Xr("selector.test_id"),Yr=Xr("selector.text")}function ei(d){var m=Ee(d);if(m!=null){if(typeof m.memoizedProps["data-testname"]!="string")throw Error(o(364));return m}if(d=Ne(d),d===null)throw Error(o(362));return d.stateNode.current}function Ri(d,m){switch(m.$$typeof){case Cn:if(d.type===m.value)return!0;break;case Ln:e:{m=m.value,d=[d,0];for(var L=0;L<d.length;){var z=d[L++],W=d[L++],ne=m[W];if(z.tag!==5||!Pe(z)){for(;ne!=null&&Ri(z,ne);)W++,ne=m[W];if(W===m.length){m=!0;break e}else for(z=z.child;z!==null;)d.push(z,W),z=z.sibling}}m=!1}return m;case tn:if(d.tag===5&&Ue(d.stateNode,m.value))return!0;break;case Yr:if((d.tag===5||d.tag===6)&&(d=ke(d),d!==null&&0<=d.indexOf(m.value)))return!0;break;case Ti:if(d.tag===5&&(d=d.memoizedProps["data-testname"],typeof d=="string"&&d.toLowerCase()===m.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function ya(d){switch(d.$$typeof){case Cn:return"<"+(C(d.value)||"Unknown")+">";case Ln:return":has("+(ya(d)||"")+")";case tn:return'[role="'+d.value+'"]';case Yr:return'"'+d.value+'"';case Ti:return'[data-testname="'+d.value+'"]';default:throw Error(o(365))}}function ti(d,m){var L=[];d=[d,0];for(var z=0;z<d.length;){var W=d[z++],ne=d[z++],_e=m[ne];if(W.tag!==5||!Pe(W)){for(;_e!=null&&Ri(W,_e);)ne++,_e=m[ne];if(ne===m.length)L.push(W);else for(W=W.child;W!==null;)d.push(W,ne),W=W.sibling}}return L}function Hn(d,m){if(!Le)throw Error(o(363));d=ei(d),d=ti(d,m),m=[],d=Array.from(d);for(var L=0;L<d.length;){var z=d[L++];if(z.tag===5)Pe(z)||m.push(z.stateNode);else for(z=z.child;z!==null;)d.push(z),z=z.sibling}return m}var ba=Math.ceil,rn=s.ReactCurrentDispatcher,Hi=s.ReactCurrentOwner,Wr=s.ReactCurrentBatchConfig,sr=0,Ir=null,Ar=null,Dn=0,hi=0,Ko=gi(0),hn=0,_u=null,Vs=0,dn=0,fo=0,$l=null,wa=null,xu=0,Su=1/0,$i=null;function ln(){Su=wn()+500}var $n=!1,Gn=null,ho=null,Io=!1,po=null,Bc=0,Wn=0,Eu=null,_l=-1,go=0;function xn(){return(sr&6)!==0?wn():_l!==-1?_l:_l=wn()}function _i(d){return(d.mode&1)===0?1:(sr&2)!==0&&Dn!==0?Dn&-Dn:Po.transition!==null?(go===0&&(go=us()),go):(d=Pt,d!==0?d:Re())}function _a(d,m,L,z){if(50<Wn)throw Wn=0,Eu=null,Error(o(185));Ba(d,L,z),((sr&2)===0||d!==Ir)&&(d===Ir&&((sr&2)===0&&(dn|=L),hn===4&&xs(d,Dn)),na(d,z),L===1&&sr===0&&(m.mode&1)===0&&(ln(),Eo&&li()))}function na(d,m){var L=d.callbackNode;Ac(d,m);var z=ul(d,d===Ir?Dn:0);if(z===0)L!==null&&kc(L),d.callbackNode=null,d.callbackPriority=0;else if(m=z&-z,d.callbackPriority!==m){if(L!=null&&kc(L),m===1)d.tag===0?Tl(If.bind(null,d)):hl(If.bind(null,d)),Oe?fe(function(){(sr&6)===0&&li()}):So(cu,li),L=null;else{switch(fl(z)){case 1:L=cu;break;case 4:L=fu;break;case 16:L=Fs;break;case 536870912:L=Vu;break;default:L=Fs}L=Ad(L,Ys.bind(null,d))}d.callbackPriority=m,d.callbackNode=L}}function Ys(d,m){if(_l=-1,go=0,(sr&6)!==0)throw Error(o(327));var L=d.callbackNode;if(Wl()&&d.callbackNode!==L)return null;var z=ul(d,d===Ir?Dn:0);if(z===0)return null;if((z&30)!==0||(z&d.expiredLanes)!==0||m)m=Es(d,z);else{m=z;var W=sr;sr|=2;var ne=Ss();(Ir!==d||Dn!==m)&&($i=null,ln(),Zo(d,m));do try{Uc();break}catch(Ye){Xa(d,Ye)}while(!0);Ml(),rn.current=ne,sr=W,Ar!==null?m=0:(Ir=null,Dn=0,m=hn)}if(m!==0){if(m===2&&(W=cl(d),W!==0&&(z=W,m=zc(d,W))),m===1)throw L=_u,Zo(d,0),xs(d,z),na(d,wn()),L;if(m===6)xs(d,z);else{if(W=d.current.alternate,(z&30)===0&&!Lh(W)&&(m=Es(d,z),m===2&&(ne=cl(d),ne!==0&&(z=ne,m=zc(d,ne))),m===1))throw L=_u,Zo(d,0),xs(d,z),na(d,wn()),L;switch(d.finishedWork=W,d.finishedLanes=z,m){case 0:case 1:throw Error(o(345));case 2:As(d,wa,$i);break;case 3:if(xs(d,z),(z&130023424)===z&&(m=xu+500-wn(),10<m)){if(ul(d,0)!==0)break;if(W=d.suspendedLanes,(W&z)!==z){xn(),d.pingedLanes|=d.suspendedLanes&W;break}d.timeoutHandle=oe(As.bind(null,d,wa,$i),m);break}As(d,wa,$i);break;case 4:if(xs(d,z),(z&4194240)===z)break;for(m=d.eventTimes,W=-1;0<z;){var _e=31-Oa(z);ne=1<<_e,_e=m[_e],_e>W&&(W=_e),z&=~ne}if(z=W,z=wn()-z,z=(120>z?120:480>z?480:1080>z?1080:1920>z?1920:3e3>z?3e3:4320>z?4320:1960*ba(z/1960))-z,10<z){d.timeoutHandle=oe(As.bind(null,d,wa,$i),z);break}As(d,wa,$i);break;case 5:As(d,wa,$i);break;default:throw Error(o(329))}}}return na(d,wn()),d.callbackNode===L?Ys.bind(null,d):null}function zc(d,m){var L=$l;return d.current.memoizedState.isDehydrated&&(Zo(d,m).flags|=256),d=Es(d,m),d!==2&&(m=wa,wa=L,m!==null&&tc(m)),d}function tc(d){wa===null?wa=d:wa.push.apply(wa,d)}function Lh(d){for(var m=d;;){if(m.flags&16384){var L=m.updateQueue;if(L!==null&&(L=L.stores,L!==null))for(var z=0;z<L.length;z++){var W=L[z],ne=W.getSnapshot;W=W.value;try{if(!Ca(ne(),W))return!1}catch{return!1}}}if(L=m.child,m.subtreeFlags&16384&&L!==null)L.return=m,m=L;else{if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function xs(d,m){for(m&=~fo,m&=~dn,d.suspendedLanes|=m,d.pingedLanes&=~m,d=d.expirationTimes;0<m;){var L=31-Oa(m),z=1<<L;d[L]=-1,m&=~z}}function If(d){if((sr&6)!==0)throw Error(o(327));Wl();var m=ul(d,0);if((m&1)===0)return na(d,wn()),null;var L=Es(d,m);if(d.tag!==0&&L===2){var z=cl(d);z!==0&&(m=z,L=zc(d,z))}if(L===1)throw L=_u,Zo(d,0),xs(d,m),na(d,wn()),L;if(L===6)throw Error(o(345));return d.finishedWork=d.current.alternate,d.finishedLanes=m,As(d,wa,$i),na(d,wn()),null}function Gl(d){po!==null&&po.tag===0&&(sr&6)===0&&Wl();var m=sr;sr|=1;var L=Wr.transition,z=Pt;try{if(Wr.transition=null,Pt=1,d)return d()}finally{Pt=z,Wr.transition=L,sr=m,(sr&6)===0&&li()}}function Au(){hi=Ko.current,cn(Ko)}function Zo(d,m){d.finishedWork=null,d.finishedLanes=0;var L=d.timeoutHandle;if(L!==de&&(d.timeoutHandle=de,me(L)),Ar!==null)for(L=Ar.return;L!==null;){var z=L;switch(De(z),z.tag){case 1:z=z.type.childContextTypes,z!=null&&Zi();break;case 3:Wo(),cn(Xi),cn(Tr),qs();break;case 5:ps(z);break;case 4:Wo();break;case 13:cn(Jr);break;case 19:cn(Jr);break;case 10:so(z.type._context);break;case 22:case 23:Au()}L=L.return}if(Ir=d,Ar=d=ku(d.current,null),Dn=hi=m,hn=0,_u=null,fo=dn=Vs=0,wa=$l=null,Ga!==null){for(m=0;m<Ga.length;m++)if(L=Ga[m],z=L.interleaved,z!==null){L.interleaved=null;var W=z.next,ne=L.pending;if(ne!==null){var _e=ne.next;ne.next=W,z.next=_e}L.pending=z}Ga=null}return d}function Xa(d,m){do{var L=Ar;try{if(Ml(),Pn.current=Gs,Va){for(var z=ar.memoizedState;z!==null;){var W=z.queue;W!==null&&(W.pending=null),z=z.next}Va=!1}if(Cr=0,Lr=Er=ar=null,Us=!1,ms=0,Hi.current=null,L===null||L.return===null){hn=1,_u=m,Ar=null;break}e:{var ne=d,_e=L.return,Ye=L,it=m;if(m=Dn,Ye.flags|=32768,it!==null&&typeof it=="object"&&typeof it.then=="function"){var wt=it,$t=Ye,br=$t.tag;if(($t.mode&1)===0&&(br===0||br===11||br===15)){var Tt=$t.alternate;Tt?($t.updateQueue=Tt.updateQueue,$t.memoizedState=Tt.memoizedState,$t.lanes=Tt.lanes):($t.updateQueue=null,$t.memoizedState=null)}var Fn=Oh(_e);if(Fn!==null){Fn.flags&=-257,Ws(Fn,_e,Ye,ne,m),Fn.mode&1&&Ph(ne,wt,m),m=Fn,it=wt;var mn=m.updateQueue;if(mn===null){var mo=new Set;mo.add(it),m.updateQueue=mo}else mn.add(it);break e}else{if((m&1)===0){Ph(ne,wt,m),vo();break e}it=Error(o(426))}}else if(ct&&Ye.mode&1){var xl=Oh(_e);if(xl!==null){(xl.flags&65536)===0&&(xl.flags|=256),Ws(xl,_e,Ye,ne,m),ki(ta(it,Ye));break e}}ne=it=ta(it,Ye),hn!==4&&(hn=2),$l===null?$l=[ne]:$l.push(ne),ne=_e;do{switch(ne.tag){case 3:ne.flags|=65536,m&=-m,ne.lanes|=m;var rt=ra(ne,it,m);hs(ne,rt);break e;case 1:Ye=it;var Ke=ne.type,ut=ne.stateNode;if((ne.flags&128)===0&&(typeof Ke.getDerivedStateFromError=="function"||ut!==null&&typeof ut.componentDidCatch=="function"&&(ho===null||!ho.has(ut)))){ne.flags|=65536,m&=-m,ne.lanes|=m;var Rt=Ra(ne,Ye,m);hs(ne,Rt);break e}}ne=ne.return}while(ne!==null)}rc(L)}catch(nr){m=nr,Ar===L&&L!==null&&(Ar=L=L.return);continue}break}while(!0)}function Ss(){var d=rn.current;return rn.current=Gs,d===null?Gs:d}function vo(){(hn===0||hn===3||hn===2)&&(hn=4),Ir===null||(Vs&268435455)===0&&(dn&268435455)===0||xs(Ir,Dn)}function Es(d,m){var L=sr;sr|=2;var z=Ss();(Ir!==d||Dn!==m)&&($i=null,Zo(d,m));do try{qc();break}catch(W){Xa(d,W)}while(!0);if(Ml(),sr=L,rn.current=z,Ar!==null)throw Error(o(261));return Ir=null,Dn=0,hn}function qc(){for(;Ar!==null;)jf(Ar)}function Uc(){for(;Ar!==null&&!Pc();)jf(Ar)}function jf(d){var m=qp(d.alternate,d,hi);d.memoizedProps=d.pendingProps,m===null?rc(d):Ar=m,Hi.current=null}function rc(d){var m=d;do{var L=m.alternate;if(d=m.return,(m.flags&32768)===0){if(L=$e(L,m,hi),L!==null){Ar=L;return}}else{if(L=Qe(L,m),L!==null){L.flags&=32767,Ar=L;return}if(d!==null)d.flags|=32768,d.subtreeFlags=0,d.deletions=null;else{hn=6,Ar=null;return}}if(m=m.sibling,m!==null){Ar=m;return}Ar=m=d}while(m!==null);hn===0&&(hn=5)}function As(d,m,L){var z=Pt,W=Wr.transition;try{Wr.transition=null,Pt=1,Dp(d,m,L,z)}finally{Wr.transition=W,Pt=z}return null}function Dp(d,m,L,z){do Wl();while(po!==null);if((sr&6)!==0)throw Error(o(327));L=d.finishedWork;var W=d.finishedLanes;if(L===null)return null;if(d.finishedWork=null,d.finishedLanes=0,L===d.current)throw Error(o(177));d.callbackNode=null,d.callbackPriority=0;var ne=L.lanes|L.childLanes;if(za(d,ne),d===Ir&&(Ar=Ir=null,Dn=0),(L.subtreeFlags&2064)===0&&(L.flags&2064)===0||Io||(Io=!0,Ad(Fs,function(){return Wl(),null})),ne=(L.flags&15990)!==0,(L.subtreeFlags&15990)!==0||ne){ne=Wr.transition,Wr.transition=null;var _e=Pt;Pt=1;var Ye=sr;sr|=4,Hi.current=null,Bt(d,L),wi(L,d),V(d.containerInfo),d.current=L,jn(L),io(),sr=Ye,Pt=_e,Wr.transition=ne}else d.current=L;if(Io&&(Io=!1,po=d,Bc=W),ne=d.pendingLanes,ne===0&&(ho=null),$o(L.stateNode),na(d,wn()),m!==null)for(z=d.onRecoverableError,L=0;L<m.length;L++)W=m[L],z(W.value,{componentStack:W.stack,digest:W.digest});if($n)throw $n=!1,d=Gn,Gn=null,d;return(Bc&1)!==0&&d.tag!==0&&Wl(),ne=d.pendingLanes,(ne&1)!==0?d===Eu?Wn++:(Wn=0,Eu=d):Wn=0,li(),null}function Wl(){if(po!==null){var d=fl(Bc),m=Wr.transition,L=Pt;try{if(Wr.transition=null,Pt=16>d?16:d,po===null)var z=!1;else{if(d=po,po=null,Bc=0,(sr&6)!==0)throw Error(o(331));var W=sr;for(sr|=4,He=d.current;He!==null;){var ne=He,_e=ne.child;if((He.flags&16)!==0){var Ye=ne.deletions;if(Ye!==null){for(var it=0;it<Ye.length;it++){var wt=Ye[it];for(He=wt;He!==null;){var $t=He;switch($t.tag){case 0:case 11:case 15:hr(8,$t,ne)}var br=$t.child;if(br!==null)br.return=$t,He=br;else for(;He!==null;){$t=He;var Tt=$t.sibling,Fn=$t.return;if(qn($t),$t===wt){He=null;break}if(Tt!==null){Tt.return=Fn,He=Tt;break}He=Fn}}}var mn=ne.alternate;if(mn!==null){var mo=mn.child;if(mo!==null){mn.child=null;do{var xl=mo.sibling;mo.sibling=null,mo=xl}while(mo!==null)}}He=ne}}if((ne.subtreeFlags&2064)!==0&&_e!==null)_e.return=ne,He=_e;else e:for(;He!==null;){if(ne=He,(ne.flags&2048)!==0)switch(ne.tag){case 0:case 11:case 15:hr(9,ne,ne.return)}var rt=ne.sibling;if(rt!==null){rt.return=ne.return,He=rt;break e}He=ne.return}}var Ke=d.current;for(He=Ke;He!==null;){_e=He;var ut=_e.child;if((_e.subtreeFlags&2064)!==0&&ut!==null)ut.return=_e,He=ut;else e:for(_e=Ke;He!==null;){if(Ye=He,(Ye.flags&2048)!==0)try{switch(Ye.tag){case 0:case 11:case 15:zt(9,Ye)}}catch(nr){Vn(Ye,Ye.return,nr)}if(Ye===_e){He=null;break e}var Rt=Ye.sibling;if(Rt!==null){Rt.return=Ye.return,He=Rt;break e}He=Ye.return}}if(sr=W,li(),Ai&&typeof Ai.onPostCommitFiberRoot=="function")try{Ai.onPostCommitFiberRoot(Ua,d)}catch{}z=!0}return z}finally{Pt=L,Wr.transition=m}}return!1}function Ed(d,m,L){m=ta(L,m),m=ra(d,m,1),d=Ji(d,m,1),m=xn(),d!==null&&(Ba(d,1,m),na(d,m))}function Vn(d,m,L){if(d.tag===3)Ed(d,d,L);else for(;m!==null;){if(m.tag===3){Ed(m,d,L);break}else if(m.tag===1){var z=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof z.componentDidCatch=="function"&&(ho===null||!ho.has(z))){d=ta(L,d),d=Ra(m,d,1),m=Ji(m,d,1),d=xn(),m!==null&&(Ba(m,1,d),na(m,d));break}}m=m.return}}function Fp(d,m,L){var z=d.pingCache;z!==null&&z.delete(m),m=xn(),d.pingedLanes|=d.suspendedLanes&L,Ir===d&&(Dn&L)===L&&(hn===4||hn===3&&(Dn&130023424)===Dn&&500>wn()-xu?Zo(d,0):fo|=L),na(d,m)}function Bp(d,m){m===0&&((d.mode&1)===0?m=1:(m=xo,xo<<=1,(xo&130023424)===0&&(xo=4194304)));var L=xn();d=zi(d,m),d!==null&&(Ba(d,m,L),na(d,L))}function zp(d){var m=d.memoizedState,L=0;m!==null&&(L=m.retryLane),Bp(d,L)}function eg(d,m){var L=0;switch(d.tag){case 13:var z=d.stateNode,W=d.memoizedState;W!==null&&(L=W.retryLane);break;case 19:z=d.stateNode;break;default:throw Error(o(314))}z!==null&&z.delete(m),Bp(d,L)}var qp;qp=function(d,m,L){if(d!==null)if(d.memoizedProps!==m.pendingProps||Xi.current)yi=!0;else{if((d.lanes&L)===0&&(m.flags&128)===0)return yi=!1,re(d,m,L);yi=(d.flags&131072)!==0}else yi=!1,ct&&(m.flags&1048576)!==0&&ce(m,La,m.index);switch(m.lanes=0,m.tag){case 2:var z=m.type;R(d,m),d=m.pendingProps;var W=Ki(m,Tr.current);zs(m,L),W=du(null,m,z,d,W,L);var ne=Yu();return m.flags|=1,typeof W=="object"&&W!==null&&typeof W.render=="function"&&W.$$typeof===void 0?(m.tag=1,m.memoizedState=null,m.updateQueue=null,Mn(z)?(ne=!0,os(m)):ne=!1,m.memoizedState=W.state!==null&&W.state!==void 0?W.state:null,Na(m),W.updater=Ju,m.stateNode=W,W._reactInternals=m,ea(m,z,d,L),m=va(null,m,z,!0,ne,L)):(m.tag=0,ct&&ne&&Ae(m),Ni(null,m,W,L),m=m.child),m;case 16:z=m.elementType;e:{switch(R(d,m),d=m.pendingProps,W=z._init,z=W(z._payload),m.type=z,W=m.tag=tg(z),d=co(z,d),W){case 0:m=bs(null,m,z,d,L);break e;case 1:m=Ui(null,m,z,d,L);break e;case 11:m=Fc(null,m,z,d,L);break e;case 14:m=ys(null,m,z,co(z.type,d),L);break e}throw Error(o(306,z,""))}return m;case 0:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),bs(d,m,z,W,L);case 1:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),Ui(d,m,z,W,L);case 3:e:{if(wl(m),d===null)throw Error(o(387));z=m.pendingProps,ne=m.memoizedState,W=ne.element,Wa(d,m),lo(m,z,null,L);var _e=m.memoizedState;if(z=_e.element,Ie&&ne.isDehydrated)if(ne={element:z,isDehydrated:!1,cache:_e.cache,pendingSuspenseBoundaries:_e.pendingSuspenseBoundaries,transitions:_e.transitions},m.updateQueue.baseState=ne,m.memoizedState=ne,m.flags&256){W=ta(Error(o(423)),m),m=Ul(d,m,z,L,W);break e}else if(z!==W){W=ta(Error(o(424)),m),m=Ul(d,m,z,L,W);break e}else for(Ie&&(at=Ea(m.stateNode.containerInfo),Ge=m,ct=!0,jt=null,Dt=!1),L=gl(m,null,z,L),m.child=L;L;)L.flags=L.flags&-3|4096,L=L.sibling;else{if(_n(),z===W){m=Y(d,m,L);break e}Ni(d,m,z,L)}m=m.child}return m;case 5:return ds(m),d===null&&kn(m),z=m.type,W=m.pendingProps,ne=d!==null?d.memoizedProps:null,_e=W.children,ee(z,W)?_e=null:ne!==null&&ee(z,ne)&&(m.flags|=32),sn(d,m),Ni(d,m,_e,L),m.child;case 6:return d===null&&kn(m),null;case 13:return Mf(d,m,L);case 4:return ml(m,m.stateNode.containerInfo),z=m.pendingProps,d===null?m.child=oo(m,null,z,L):Ni(d,m,z,L),m.child;case 11:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),Fc(d,m,z,W,L);case 7:return Ni(d,m,m.pendingProps,L),m.child;case 8:return Ni(d,m,m.pendingProps.children,L),m.child;case 12:return Ni(d,m,m.pendingProps.children,L),m.child;case 10:e:{if(z=m.type._context,W=m.pendingProps,ne=m.memoizedProps,_e=W.value,zn(m,z,_e),ne!==null)if(Ca(ne.value,_e)){if(ne.children===W.children&&!Xi.current){m=Y(d,m,L);break e}}else for(ne=m.child,ne!==null&&(ne.return=m);ne!==null;){var Ye=ne.dependencies;if(Ye!==null){_e=ne.child;for(var it=Ye.firstContext;it!==null;){if(it.context===z){if(ne.tag===1){it=ha(-1,L&-L),it.tag=2;var wt=ne.updateQueue;if(wt!==null){wt=wt.shared;var $t=wt.pending;$t===null?it.next=it:(it.next=$t.next,$t.next=it),wt.pending=it}}ne.lanes|=L,it=ne.alternate,it!==null&&(it.lanes|=L),Lo(ne.return,L,m),Ye.lanes|=L;break}it=it.next}}else if(ne.tag===10)_e=ne.type===m.type?null:ne.child;else if(ne.tag===18){if(_e=ne.return,_e===null)throw Error(o(341));_e.lanes|=L,Ye=_e.alternate,Ye!==null&&(Ye.lanes|=L),Lo(_e,L,m),_e=ne.sibling}else _e=ne.child;if(_e!==null)_e.return=ne;else for(_e=ne;_e!==null;){if(_e===m){_e=null;break}if(ne=_e.sibling,ne!==null){ne.return=_e.return,_e=ne;break}_e=_e.return}ne=_e}Ni(d,m,W.children,L),m=m.child}return m;case 9:return W=m.type,z=m.pendingProps.children,zs(m,L),W=In(W),z=z(W),m.flags|=1,Ni(d,m,z,L),m.child;case 14:return z=m.type,W=co(z,m.pendingProps),W=co(z.type,W),ys(d,m,z,W,L);case 15:return Mo(d,m,m.type,m.pendingProps,L);case 17:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),R(d,m),m.tag=1,Mn(z)?(d=!0,os(m)):d=!1,zs(m,L),kh(m,z,W),ea(m,z,W,L),va(null,m,z,!0,d,L);case 19:return P(d,m,L);case 22:return en(d,m,L)}throw Error(o(156,m.tag))};function Ad(d,m){return So(d,m)}function Up(d,m,L,z){this.tag=d,this.key=L,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=z,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qo(d,m,L,z){return new Up(d,m,L,z)}function Hc(d){return d=d.prototype,!(!d||!d.isReactComponent)}function tg(d){if(typeof d=="function")return Hc(d)?1:0;if(d!=null){if(d=d.$$typeof,d===_)return 11;if(d===E)return 14}return 2}function ku(d,m){var L=d.alternate;return L===null?(L=Qo(d.tag,m,d.key,d.mode),L.elementType=d.elementType,L.type=d.type,L.stateNode=d.stateNode,L.alternate=d,d.alternate=L):(L.pendingProps=m,L.type=d.type,L.flags=0,L.subtreeFlags=0,L.deletions=null),L.flags=d.flags&14680064,L.childLanes=d.childLanes,L.lanes=d.lanes,L.child=d.child,L.memoizedProps=d.memoizedProps,L.memoizedState=d.memoizedState,L.updateQueue=d.updateQueue,m=d.dependencies,L.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},L.sibling=d.sibling,L.index=d.index,L.ref=d.ref,L}function Nh(d,m,L,z,W,ne){var _e=2;if(z=d,typeof d=="function")Hc(d)&&(_e=1);else if(typeof d=="string")_e=5;else e:switch(d){case f:return Ma(L.children,W,ne,m);case v:_e=8,W|=8;break;case g:return d=Qo(12,L,m,W|2),d.elementType=g,d.lanes=ne,d;case x:return d=Qo(13,L,m,W),d.elementType=x,d.lanes=ne,d;case b:return d=Qo(19,L,m,W),d.elementType=b,d.lanes=ne,d;case S:return $c(L,W,ne,m);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case p:_e=10;break e;case y:_e=9;break e;case _:_e=11;break e;case E:_e=14;break e;case k:_e=16,z=null;break e}throw Error(o(130,d==null?d:typeof d,""))}return m=Qo(_e,L,m,W),m.elementType=d,m.type=z,m.lanes=ne,m}function Ma(d,m,L,z){return d=Qo(7,d,z,m),d.lanes=L,d}function $c(d,m,L,z){return d=Qo(22,d,z,m),d.elementType=S,d.lanes=L,d.stateNode={isHidden:!1},d}function Gc(d,m,L){return d=Qo(6,d,null,m),d.lanes=L,d}function Th(d,m,L){return m=Qo(4,d.children!==null?d.children:[],d.key,m),m.lanes=L,m.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},m}function Hp(d,m,L,z,W){this.tag=m,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=de,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=no(0),this.expirationTimes=no(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=no(0),this.identifierPrefix=z,this.onRecoverableError=W,Ie&&(this.mutableSourceEagerHydrationData=null)}function kd(d,m,L,z,W,ne,_e,Ye,it){return d=new Hp(d,m,L,Ye,it),m===1?(m=1,ne===!0&&(m|=8)):m=0,ne=Qo(3,null,null,m),d.current=ne,ne.stateNode=d,ne.memoizedState={element:z,isDehydrated:L,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(ne),d}function Rh(d){if(!d)return as;d=d._reactInternals;e:{if(F(d)!==d||d.tag!==1)throw Error(o(170));var m=d;do{switch(m.tag){case 3:m=m.stateNode.context;break e;case 1:if(Mn(m.type)){m=m.stateNode.__reactInternalMemoizedMergedChildContext;break e}}m=m.return}while(m!==null);throw Error(o(171))}if(d.tag===1){var L=d.type;if(Mn(L))return Zn(d,L,m)}return m}function nc(d){var m=d._reactInternals;if(m===void 0)throw typeof d.render=="function"?Error(o(188)):(d=Object.keys(d).join(","),Error(o(268,d)));return d=T(m),d===null?null:d.stateNode}function Mh(d,m){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var L=d.retryLane;d.retryLane=L!==0&&L<m?L:m}}function Wc(d,m){Mh(d,m),(d=d.alternate)&&Mh(d,m)}function rg(d){return d=T(d),d===null?null:d.stateNode}function $p(){return null}return r.attemptContinuousHydration=function(d){if(d.tag===13){var m=zi(d,134217728);if(m!==null){var L=xn();_a(m,d,134217728,L)}Wc(d,134217728)}},r.attemptDiscreteHydration=function(d){if(d.tag===13){var m=zi(d,1);if(m!==null){var L=xn();_a(m,d,1,L)}Wc(d,1)}},r.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13){var m=_i(d),L=zi(d,m);if(L!==null){var z=xn();_a(L,d,m,z)}Wc(d,m)}},r.attemptSynchronousHydration=function(d){switch(d.tag){case 3:var m=d.stateNode;if(m.current.memoizedState.isDehydrated){var L=ls(m.pendingLanes);L!==0&&(qa(m,L|1),na(m,wn()),(sr&6)===0&&(ln(),li()))}break;case 13:Gl(function(){var z=zi(d,1);if(z!==null){var W=xn();_a(z,d,1,W)}}),Wc(d,1)}},r.batchedUpdates=function(d,m){var L=sr;sr|=1;try{return d(m)}finally{sr=L,sr===0&&(ln(),Eo&&li())}},r.createComponentSelector=function(d){return{$$typeof:Cn,value:d}},r.createContainer=function(d,m,L,z,W,ne,_e){return kd(d,m,!1,null,L,z,W,ne,_e)},r.createHasPseudoClassSelector=function(d){return{$$typeof:Ln,value:d}},r.createHydrationContainer=function(d,m,L,z,W,ne,_e,Ye,it){return d=kd(L,z,!0,d,W,ne,_e,Ye,it),d.context=Rh(null),L=d.current,z=xn(),W=_i(L),ne=ha(z,W),ne.callback=m??null,Ji(L,ne,W),d.current.lanes=W,Ba(d,W,z),na(d,z),d},r.createPortal=function(d,m,L){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:z==null?null:""+z,children:d,containerInfo:m,implementation:L}},r.createRoleSelector=function(d){return{$$typeof:tn,value:d}},r.createTestNameSelector=function(d){return{$$typeof:Ti,value:d}},r.createTextSelector=function(d){return{$$typeof:Yr,value:d}},r.deferredUpdates=function(d){var m=Pt,L=Wr.transition;try{return Wr.transition=null,Pt=16,d()}finally{Pt=m,Wr.transition=L}},r.discreteUpdates=function(d,m,L,z,W){var ne=Pt,_e=Wr.transition;try{return Wr.transition=null,Pt=1,d(m,L,z,W)}finally{Pt=ne,Wr.transition=_e,sr===0&&ln()}},r.findAllNodes=Hn,r.findBoundingRects=function(d,m){if(!Le)throw Error(o(363));m=Hn(d,m),d=[];for(var L=0;L<m.length;L++)d.push(ue(m[L]));for(m=d.length-1;0<m;m--){L=d[m];for(var z=L.x,W=z+L.width,ne=L.y,_e=ne+L.height,Ye=m-1;0<=Ye;Ye--)if(m!==Ye){var it=d[Ye],wt=it.x,$t=wt+it.width,br=it.y,Tt=br+it.height;if(z>=wt&&ne>=br&&W<=$t&&_e<=Tt){d.splice(m,1);break}else if(z!==wt||L.width!==it.width||Tt<ne||br>_e){if(!(ne!==br||L.height!==it.height||$t<z||wt>W)){wt>z&&(it.width+=wt-z,it.x=z),$t<W&&(it.width=W-wt),d.splice(m,1);break}}else{br>ne&&(it.height+=br-ne,it.y=ne),Tt<_e&&(it.height=_e-br),d.splice(m,1);break}}}return d},r.findHostInstance=nc,r.findHostInstanceWithNoPortals=function(d){return d=O(d),d=d!==null?q(d):null,d===null?null:d.stateNode},r.findHostInstanceWithWarning=function(d){return nc(d)},r.flushControlled=function(d){var m=sr;sr|=1;var L=Wr.transition,z=Pt;try{Wr.transition=null,Pt=1,d()}finally{Pt=z,Wr.transition=L,sr=m,sr===0&&(ln(),li())}},r.flushPassiveEffects=Wl,r.flushSync=Gl,r.focusWithin=function(d,m){if(!Le)throw Error(o(363));for(d=ei(d),m=ti(d,m),m=Array.from(m),d=0;d<m.length;){var L=m[d++];if(!Pe(L)){if(L.tag===5&&st(L.stateNode))return!0;for(L=L.child;L!==null;)m.push(L),L=L.sibling}}return!1},r.getCurrentUpdatePriority=function(){return Pt},r.getFindAllNodesFailureDescription=function(d,m){if(!Le)throw Error(o(363));var L=0,z=[];d=[ei(d),0];for(var W=0;W<d.length;){var ne=d[W++],_e=d[W++],Ye=m[_e];if((ne.tag!==5||!Pe(ne))&&(Ri(ne,Ye)&&(z.push(ya(Ye)),_e++,_e>L&&(L=_e)),_e<m.length))for(ne=ne.child;ne!==null;)d.push(ne,_e),ne=ne.sibling}if(L<m.length){for(d=[];L<m.length;L++)d.push(ya(m[L]));return`findAllNodes was able to match part of the selector:
71
+ `+(z.join(" > ")+`
72
+
73
+ No matching component was found for:
74
+ `)+d.join(" > ")}return null},r.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return ae(d.child.stateNode);default:return d.child.stateNode}},r.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:rg,findFiberByHostInstance:d.findFiberByHostInstance||$p,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(m.isDisabled||!m.supportsFiber)d=!0;else{try{Ua=m.inject(d),Ai=m}catch{}d=!!m.checkDCE}}return d},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(d,m,L,z){if(!Le)throw Error(o(363));d=Hn(d,m);var W=dt(d,L,z).disconnect;return{disconnect:function(){W()}}},r.registerMutableSourceForHydration=function(d,m){var L=m._getVersion;L=L(m._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[m,L]:d.mutableSourceEagerHydrationData.push(m,L)},r.runWithPriority=function(d,m){var L=Pt;try{return Pt=d,m()}finally{Pt=L}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(d,m,L,z){var W=m.current,ne=xn(),_e=_i(W);return L=Rh(L),m.context===null?m.context=L:m.pendingContext=L,m=ha(ne,_e),m.payload={element:d},z=z===void 0?null:z,z!==null&&(m.callback=z),d=Ji(W,m,_e),d!==null&&(_a(d,W,_e,ne),No(d,W,_e)),_e},r}),Vg}var e3;function xk(){return e3||(e3=1,Wg.exports=_k()),Wg.exports}var Sk=xk();const Ek=ch(Sk);var Yg={exports:{}},ef={};/**
75
+ * @license React
76
+ * react-reconciler-constants.production.min.js
77
+ *
78
+ * Copyright (c) Facebook, Inc. and its affiliates.
79
+ *
80
+ * This source code is licensed under the MIT license found in the
81
+ * LICENSE file in the root directory of this source tree.
82
+ */var t3;function Ak(){return t3||(t3=1,ef.ConcurrentRoot=1,ef.ContinuousEventPriority=4,ef.DefaultEventPriority=16,ef.DiscreteEventPriority=1,ef.IdleEventPriority=536870912,ef.LegacyRoot=0),ef}var r3;function kk(){return r3||(r3=1,Yg.exports=Ak()),Yg.exports}var E8=kk();const n3={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let i3=!1,a3=!1;const Xm=".react-konva-event",Pk=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
83
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
84
+ Consider to add onDragMove or onDragEnd events.
85
+ For more info see: https://github.com/konvajs/react-konva/issues/256
86
+ `,Ok=`ReactKonva: You are using "zIndex" attribute for a Konva node.
87
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
88
+ For more info see: https://github.com/konvajs/react-konva/issues/194
89
+ `,Ck={};function F0(t,e,r=Ck){if(!i3&&"zIndex"in e&&(console.warn(Ok),i3=!0),!a3&&e.draggable){var n=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;n&&!i&&(console.warn(Pk),a3=!0)}for(var a in r)if(!n3[a]){var o=a.slice(0,2)==="on",s=r[a]!==e[a];if(o&&s){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t.off(u,r[a])}var h=!e.hasOwnProperty(a);h&&t.setAttr(a,void 0)}var f=e._useStrictMode,v={},g=!1;const p={};for(var a in e)if(!n3[a]){var o=a.slice(0,2)==="on",y=r[a]!==e[a];if(o&&y){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e[a]&&(p[u]=e[a])}!o&&(e[a]!==r[a]||f&&e[a]!==t.getAttr(a))&&(g=!0,v[a]=e[a])}g&&(t.setAttrs(v),Pf(t));for(var u in p)t.on(u+Xm,p[u])}function Pf(t){if(!Ot.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var Xg=Tm();const A8={},Lk={};oh.Node.prototype._applyProps=F0;function Nk(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),Pf(t)}function Tk(t,e,r){let n=oh[t];n||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" 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=oh.Group);const i={},a={};for(var o in e){var s=o.slice(0,2)==="on";s?a[o]=e[o]:i[o]=e[o]}const u=new n(i);return F0(u,a),u}function Rk(t,e,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function Mk(t,e,r){return!1}function Ik(t){return t}function jk(){return null}function Dk(){return null}function Fk(t,e,r,n){return Lk}function Bk(){}function zk(t){}function qk(t,e){return!1}function Uk(){return A8}function Hk(){return A8}const $k=setTimeout,Gk=clearTimeout,Wk=-1;function Vk(t,e){return!1}const Yk=!1,Xk=!0,Kk=!0;function Zk(t,e){e.parent===t?e.moveToTop():t.add(e),Pf(t)}function Qk(t,e){e.parent===t?e.moveToTop():t.add(e),Pf(t)}function k8(t,e,r){e._remove(),t.add(e),e.setZIndex(r.getZIndex()),Pf(t)}function Jk(t,e,r){k8(t,e,r)}function eP(t,e){e.destroy(),e.off(Xm),Pf(t)}function tP(t,e){e.destroy(),e.off(Xm),Pf(t)}function rP(t,e,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function nP(t,e,r){}function iP(t,e,r,n,i){F0(t,i,n)}function aP(t){t.hide(),Pf(t)}function oP(t){}function sP(t,e){(e.visible==null||e.visible)&&t.show()}function lP(t,e){}function uP(t){}function cP(){}const fP=()=>E8.DefaultEventPriority,hP=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Zk,appendChildToContainer:Qk,appendInitialChild:Nk,cancelTimeout:Gk,clearContainer:uP,commitMount:nP,commitTextUpdate:rP,commitUpdate:iP,createInstance:Tk,createTextInstance:Rk,detachDeletedInstance:cP,finalizeInitialChildren:Mk,getChildHostContext:Hk,getCurrentEventPriority:fP,getPublicInstance:Ik,getRootHostContext:Uk,hideInstance:aP,hideTextInstance:oP,idlePriority:Xg.unstable_IdlePriority,insertBefore:k8,insertInContainerBefore:Jk,isPrimaryRenderer:Yk,noTimeout:Wk,now:Xg.unstable_now,prepareForCommit:jk,preparePortalMount:Dk,prepareUpdate:Fk,removeChild:eP,removeChildFromContainer:tP,resetAfterCommit:Bk,resetTextContent:zk,run:Xg.unstable_runWithPriority,scheduleTimeout:$k,shouldDeprioritizeSubtree:qk,shouldSetTextContent:Vk,supportsMutation:Kk,unhideInstance:sP,unhideTextInstance:lP,warnsIfNotActing:Xk},Symbol.toStringTag,{value:"Module"}));var dP=Object.defineProperty,pP=Object.defineProperties,gP=Object.getOwnPropertyDescriptors,o3=Object.getOwnPropertySymbols,vP=Object.prototype.hasOwnProperty,mP=Object.prototype.propertyIsEnumerable,s3=(t,e,r)=>e in t?dP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l3=(t,e)=>{for(var r in e||(e={}))vP.call(e,r)&&s3(t,r,e[r]);if(o3)for(var r of o3(e))mP.call(e,r)&&s3(t,r,e[r]);return t},yP=(t,e)=>pP(t,gP(e)),u3,c3;typeof window<"u"&&((u3=window.document)!=null&&u3.createElement||((c3=window.navigator)==null?void 0:c3.product)==="ReactNative")?Ii.useLayoutEffect:Ii.useEffect;function P8(t,e,r){if(!t)return;if(r(t)===!0)return t;let n=t.child;for(;n;){const i=P8(n,e,r);if(i)return i;n=n.sibling}}function O8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const f3=console.error;console.error=function(){const t=[...arguments].join("");if(t?.startsWith("Warning:")&&t.includes("useContext")){console.error=f3;return}return f3.apply(this,arguments)};const Km=O8(Ii.createContext(null));class C8 extends Ii.Component{render(){return Ii.createElement(Km.Provider,{value:this._reactInternals},this.props.children)}}function bP(){const t=Ii.useContext(Km);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Ii.useId();return Ii.useMemo(()=>{for(const n of[t,t?.alternate]){if(!n)continue;const i=P8(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[t,e])}function wP(){const t=bP(),[e]=Ii.useState(()=>new Map);e.clear();let r=t;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==Km&&!e.has(i)&&e.set(i,Ii.useContext(O8(i)))}r=r.return}return e}function L8(){const t=wP();return Ii.useMemo(()=>Array.from(t.keys()).reduce((e,r)=>n=>Ii.createElement(e,null,Ii.createElement(r.Provider,yP(l3({},n),{value:t.get(r)}))),e=>Ii.createElement(C8,l3({},e))),[t])}function _P(t){const e=se.useRef({});return se.useLayoutEffect(()=>{e.current=t}),se.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const xP=t=>{const e=se.useRef(null),r=se.useRef(null),n=se.useRef(null),i=_P(t),a=L8(),o=s=>{const{forwardedRef:u}=t;u&&(typeof u=="function"?u(s):u.current=s)};return se.useLayoutEffect(()=>(r.current=new oh.Stage({width:t.width,height:t.height,container:e.current}),o(r.current),n.current=Vd.createContainer(r.current,E8.LegacyRoot,!1,null),Vd.updateContainer(se.createElement(a,{},t.children),n.current),()=>{oh.isBrowser&&(o(null),Vd.updateContainer(null,n.current,null),r.current.destroy())}),[]),se.useLayoutEffect(()=>{o(r.current),F0(r.current,t,i),Vd.updateContainer(se.createElement(a,{},t.children),n.current,null)}),se.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},SP="Layer",bn="Group",h0="Label",Tn="Rect",EP="Circle",ff="Line",Nu="Image",Du="Text",AP="TextPath",Zm="Arc",d0="Tag",dp="Path",pp="Transformer",Vd=Ek(hP);Vd.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:se.version,rendererPackageName:"react-konva"});const kP=se.forwardRef((t,e)=>se.createElement(C8,{},se.createElement(xP,{...t,forwardedRef:e})));var Kg,h3;function PP(){if(h3)return Kg;h3=1;var t=Sp();return Kg=function(r,n,i){const a=t.useRef("loading"),o=t.useRef(),[s,u]=t.useState(0),h=t.useRef(),f=t.useRef(),v=t.useRef();return(h.current!==r||f.current!==n||v.current!==i)&&(a.current="loading",o.current=void 0,h.current=r,f.current=n,v.current=i),t.useLayoutEffect(function(){if(!r)return;var g=document.createElement("img");function p(){g.decode().catch(()=>{}).finally(()=>{a.current="loaded",o.current=g,u(Math.random())})}function y(){a.current="failed",o.current=void 0,u(Math.random())}return g.addEventListener("load",p),g.addEventListener("error",y),n&&(g.crossOrigin=n),i&&(g.referrerPolicy=i),g.src=r,function(){g.removeEventListener("load",p),g.removeEventListener("error",y)}},[r,n,i]),[o.current,a.current]},Kg}var OP=PP();const Qm=ch(OP);var CP=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const LP=t=>{const e=window.getComputedStyle(t).position;return!(e==="absolute"||e==="relative")};function NP(t=()=>{}){const e=se.useRef(t);return e.current=t,se.useCallback((...r)=>e.current.apply(null,r),[])}const p0=({children:t,groupProps:e,divProps:r,transform:n,transformFunc:i,parentNodeFunc:a})=>{const o=L8(),s=se.useRef(null),[u]=se.useState(()=>document.createElement("div")),h=se.useMemo(()=>Ww.createRoot(u),[u]),f=n??!0,v=NP(()=>{if(f&&s.current){let x=s.current.getAbsoluteTransform().decompose();i&&(x=i(x)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${x.x}px, ${x.y}px) rotate(${x.rotation}deg) scaleX(${x.scaleX}) scaleY(${x.scaleY})`,u.style.transformOrigin="top left"}else u.style.position="",u.style.zIndex="",u.style.top="",u.style.left="",u.style.transform="",u.style.transformOrigin="";const g=r||{},{style:p}=g,y=CP(g,["style"]);Object.assign(u.style,p),Object.assign(u,y)});return se.useLayoutEffect(()=>{var g;const p=s.current;if(!p)return;const y=a?a({stage:p.getStage()}):(g=p.getStage())===null||g===void 0?void 0:g.container();if(y)return y.appendChild(u),f&&LP(y)&&(y.style.position="relative"),p.on("absoluteTransformChange",v),v(),()=>{var _;p.off("absoluteTransformChange",v),(_=u.parentNode)===null||_===void 0||_.removeChild(u)}},[f,a]),se.useLayoutEffect(()=>{v()},[r,i]),se.useLayoutEffect(()=>{queueMicrotask(()=>{$6.flushSync(()=>{h.render(se.createElement(o,null,t))})})}),se.useLayoutEffect(()=>()=>{setTimeout(()=>{h.unmount()})},[]),se.createElement(bn,Object.assign({ref:s},e))},Jm=({selector:t,enabled:e,children:r})=>{const n=se.useRef(null),i=se.useRef(null),a=se.useRef(null),o=e??!0;return se.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(t);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const h=n.current.getLayer();if(h&&(h.batchDraw(),u)){const f=u.getLayer();if(!f)return;f.batchDraw()}},[t,o]),se.useEffect(()=>()=>{var s;(s=a.current)===null||s===void 0||s.destroy()},[]),se.createElement(bn,{name:"_outer_portal",ref:n},se.createElement(bn,{name:"_inner_portal",ref:i},r))};function N8(t,e,r){const n=e-1,i=r[R8(n,r.length)];return i.marker!=="Z"?i:N8(t,n,r)}function T8(t,e,r){const n=e+1,i=r[R8(n,r.length)];return i.marker==="Z"?T8(t,n,r):i}function TP(t,e,r){let n=r[e-1]||{values:{x:0,y:0}};if(t.marker===t.marker.toLowerCase())switch(t.marker=t.marker.toUpperCase(),t.marker){case"M":t.values.x+=n.values.x,t.values.y+=n.values.y;break;case"L":case"A":t.values.x+=n.values.x,t.values.y+=n.values.y;break;case"H":t.marker="L",t.values.x+=n.values.x,t.values.y=n.values.y;break;case"V":t.marker="L",t.values.x=n.values.x,t.values.y+=n.values.y;break;case"C":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x1+=n.values.x,t.values.y1+=n.values.y,t.values.x2+=n.values.x,t.values.y2+=n.values.y;break;case"S":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x2+=n.values.x,t.values.y2+=n.values.y;break;case"Q":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x1+=n.values.x,t.values.y1+=n.values.y;break;case"T":t.values.x+=n.values.x,t.values.y+=n.values.y;break}else if(t.marker===t.marker.toUpperCase())switch(t.marker){case"H":t.marker="L",t.values.y=n.values.y;break;case"V":t.marker="L",t.values.x=n.values.x;break}if(t.marker==="Z"){let i=function(o,s){return o[s].marker==="M"?o[s]:i(o,s-1)},a=i(r,e);t.values.x=a.values.x,t.values.y=a.values.y}return t}function RP(t,e){const r=[];switch(t.toUpperCase()){case"M":for(let n=0;n<e.length;n+=2){let i;t===t.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:e[n],y:e[n+1]}})}break;case"L":for(let n=0;n<e.length;n+=2)r.push({marker:t,values:{x:e[n],y:e[n+1]}});break;case"H":for(let n=0;n<e.length;n++)r.push({marker:t,values:{x:e[n],y:0}});break;case"V":for(let n=0;n<e.length;n++)r.push({marker:t,values:{x:0,y:e[n]}});break;case"C":for(let n=0;n<e.length;n+=6)r.push({marker:t,values:{x1:e[n],y1:e[n+1],x2:e[n+2],y2:e[n+3],x:e[n+4],y:e[n+5]}});break;case"S":for(let n=0;n<e.length;n+=4)r.push({marker:t,values:{x2:e[n],y2:e[n+1],x:e[n+2],y:e[n+3]}});break;case"Q":for(let n=0;n<e.length;n+=4)r.push({marker:t,values:{x1:e[n],y1:e[n+1],x:e[n+2],y:e[n+3]}});break;case"T":for(let n=0;n<e.length;n+=2)r.push({marker:t,values:{x:e[n],y:e[n+1]}});break;case"A":for(let n=0;n<e.length;n+=7)r.push({marker:t,values:{radiusX:e[n],radiusY:e[n+1],rotation:e[n+2],largeArc:e[n+3],sweep:e[n+4],x:e[n+5],y:e[n+6]}});break;case"Z":r.push({marker:t,values:{x:0,y:0}});break}return r}function R8(t,e){return(t%e+e)%e}function MP(t,e,r){if(e!==0&&t.marker==="L"){let n=r[e-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-t.values[a]))===0)&&(t.overlap=!0)}return t}function fm(t,e){const r=["x","y"].every(n=>Math.round(Math.abs(t[e].values[n]-t[0].values[n]))===0);t[e].marker==="L"&&r&&(t[e].overlap=!0,fm(t,e-1)),t[e].marker==="Z"&&fm(t,e-1)}function IP(t,e,r){const n=p3(t.values,r.values),i=p3(e.values,t.values);return Math.min(i,n)}function d3(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}function p3(t,e){const r=t.x-e.x,n=t.y-e.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function g3(t,e){return Math.sin(t)*e}function v3(t,e){return Math.cos(t)*e}function m3(t,e){const r=e/Math.tan(t);return r===1/0||r===-1/0||isNaN(r)?e:r}function jP(t,e){return e*Math.tan(t)}function DP(t,e){let r,n=0,i=t*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=m3(t/2,-e):(r=m3(t/2,e),n=1,r===1/0&&(r=e)),{offset:r,sweepFlag:n}}function FP(t){const e=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=e.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function BP(t){const e=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...t.matchAll(e)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=t.substring(i.index,n.length?n[n.length-1].index:t.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return RP(n.marker,a)}).map(TP)}function zP(t,e,r){let n=[],i=[];return t.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(MP),fm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(s=>!s.overlap).map((s,u,h)=>{const v=N8(s,u,h),g=T8(s,u,h),p=d3(s.values,v.values),y=d3(s.values,g.values),_=y-p,x=_*(180/Math.PI),b=IP(s,v,g),E=Math.abs(jP(_/2,b/2)),k=Math.min(e,E),S=DP(_,k),A=S.offset,M=S.sweepFlag,C=(u==0||u==h.length-1)&&!o;switch(s.marker){case"M":case"L":const I=[s.values.x+g3(p,A),s.values.y+v3(p,A)],F=[s.values.x+g3(y,A),s.values.y+v3(y,A)];C?i.push({marker:s.marker,values:s.values}):i.push({marker:s.marker,values:{x:parseFloat(I[0].toFixed(3)),y:parseFloat(I[1].toFixed(3))}}),!C&&(g.marker==="L"||g.marker==="M")&&i.push({marker:"A",radius:k,values:{radiusX:parseFloat(k.toFixed(3)),radiusY:parseFloat(k.toFixed(3)),rotation:x,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":i.push({marker:s.marker,values:s.values});break}})}),{path:FP(i),commands:i}}var E1={},y3;function qP(){if(y3)return E1;y3=1;var t=t||{};t.stringify=function(){var e={"visit_linear-gradient":function(r){return e.visit_gradient(r)},"visit_repeating-linear-gradient":function(r){return e.visit_gradient(r)},"visit_radial-gradient":function(r){return e.visit_gradient(r)},"visit_repeating-radial-gradient":function(r){return e.visit_gradient(r)},visit_gradient:function(r){var n=e.visit(r.orientation);return n&&(n+=", "),r.type+"("+n+e.visit(r.colorStops)+")"},visit_shape:function(r){var n=r.value,i=e.visit(r.at),a=e.visit(r.style);return a&&(n+=" "+a),i&&(n+=" at "+i),n},"visit_default-radial":function(r){var n="",i=e.visit(r.at);return i&&(n+=i),n},"visit_extent-keyword":function(r){var n=r.value,i=e.visit(r.at);return i&&(n+=" at "+i),n},"visit_position-keyword":function(r){return r.value},visit_position:function(r){return e.visit(r.value.x)+" "+e.visit(r.value.y)},"visit_%":function(r){return r.value+"%"},visit_em:function(r){return r.value+"em"},visit_px:function(r){return r.value+"px"},visit_calc:function(r){return"calc("+r.value+")"},visit_literal:function(r){return e.visit_color(r.value,r)},visit_hex:function(r){return e.visit_color("#"+r.value,r)},visit_rgb:function(r){return e.visit_color("rgb("+r.value.join(", ")+")",r)},visit_rgba:function(r){return e.visit_color("rgba("+r.value.join(", ")+")",r)},visit_hsl:function(r){return e.visit_color("hsl("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%)",r)},visit_hsla:function(r){return e.visit_color("hsla("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%, "+r.value[3]+")",r)},visit_var:function(r){return e.visit_color("var("+r.value+")",r)},visit_color:function(r,n){var i=r,a=e.visit(n.length);return a&&(i+=" "+a),i},visit_angular:function(r){return r.value+"deg"},visit_directional:function(r){return"to "+r.value},visit_array:function(r){var n="",i=r.length;return r.forEach(function(a,o){n+=e.visit(a),o<i-1&&(n+=", ")}),n},visit_object:function(r){return r.width&&r.height?e.visit(r.width)+" "+e.visit(r.height):""},visit:function(r){if(!r)return"";if(r instanceof Array)return e.visit_array(r);if(typeof r=="object"&&!r.type)return e.visit_object(r);if(r.type){var n=e["visit_"+r.type];if(n)return n(r);throw Error("Missing visitor visit_"+r.type)}else throw Error("Invalid node.")}};return function(r){return e.visit(r)}}();var t=t||{};return t.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|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},r="";function n(U){var X=new Error(r+": "+U);throw X.source=r,X}function i(){var U=a();return r.length>0&&n("Invalid input not EOF"),U}function a(){return S(o)}function o(){return s("linear-gradient",e.linearGradient,h)||s("repeating-linear-gradient",e.repeatingLinearGradient,h)||s("radial-gradient",e.radialGradient,g)||s("repeating-radial-gradient",e.repeatingRadialGradient,g)}function s(U,X,ee){return u(X,function(K){var oe=ee();return oe&&(B(e.comma)||n("Missing comma before color stops")),{type:U,orientation:oe,colorStops:S(A)}})}function u(U,X){var ee=B(U);if(ee){B(e.startCall)||n("Missing (");var K=X(ee);return B(e.endCall)||n("Missing )"),K}}function h(){var U=f();if(U)return U;var X=V("position-keyword",e.positionKeywords,1);return X?{type:"directional",value:X.value}:v()}function f(){return V("directional",e.sideOrCorner,1)}function v(){return V("angular",e.angleValue,1)||V("angular",e.radianValue,1)}function g(){var U,X=p(),ee;return X&&(U=[],U.push(X),ee=r,B(e.comma)&&(X=p(),X?U.push(X):r=ee)),U}function p(){var U=y()||_();if(U)U.at=b();else{var X=x();if(X){U=X;var ee=b();ee&&(U.at=ee)}else{var K=b();if(K)U={type:"default-radial",at:K};else{var oe=E();oe&&(U={type:"default-radial",at:oe})}}}return U}function y(){var U=V("shape",/^(circle)/i,0);return U&&(U.style=te()||x()),U}function _(){var U=V("shape",/^(ellipse)/i,0);return U&&(U.style=E()||ae()||x()),U}function x(){return V("extent-keyword",e.extentKeywords,1)}function b(){if(V("position",/^at/,0)){var U=E();return U||n("Missing positioning value"),U}}function E(){var U=k();if(U.x||U.y)return{type:"position",value:U}}function k(){return{x:ae(),y:ae()}}function S(U){var X=U(),ee=[];if(X)for(ee.push(X);B(e.comma);)X=U(),X?ee.push(X):n("One extra comma");return ee}function A(){var U=M();return U||n("Expected color definition"),U.length=ae(),U}function M(){return I()||$()||T()||j()||F()||O()||C()}function C(){return V("literal",e.literalColor,0)}function I(){return V("hex",e.hexColor,1)}function F(){return u(e.rgbColor,function(){return{type:"rgb",value:S(J)}})}function j(){return u(e.rgbaColor,function(){return{type:"rgba",value:S(J)}})}function O(){return u(e.varColor,function(){return{type:"var",value:q()}})}function T(){return u(e.hslColor,function(){var U=B(e.percentageValue);U&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var X=J();B(e.comma);var ee=B(e.percentageValue),K=ee?ee[1]:null;B(e.comma),ee=B(e.percentageValue);var oe=ee?ee[1]:null;return(!K||!oe)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[X,K,oe]}})}function $(){return u(e.hslaColor,function(){var U=J();B(e.comma);var X=B(e.percentageValue),ee=X?X[1]:null;B(e.comma),X=B(e.percentageValue);var K=X?X[1]:null;B(e.comma);var oe=J();return(!ee||!K)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[U,ee,K,oe]}})}function q(){return B(e.variableName)[1]}function J(){return B(e.number)[1]}function ae(){return V("%",e.percentageValue,1)||ie()||Z()||te()}function ie(){return V("position-keyword",e.positionKeywords,1)}function Z(){return u(e.calcValue,function(){for(var U=1,X=0;U>0&&X<r.length;){var ee=r.charAt(X);ee==="("?U++:ee===")"&&U--,X++}U>0&&n("Missing closing parenthesis in calc() expression");var K=r.substring(0,X-1);return D(X-1),{type:"calc",value:K}})}function te(){return V("px",e.pixelValue,1)||V("em",e.emValue,1)}function V(U,X,ee){var K=B(X);if(K)return{type:U,value:K[ee]}}function B(U){var X,ee;return ee=/^[\n\r\t\s]+/.exec(r),ee&&D(ee[0].length),X=U.exec(r),X&&D(X[0].length),X}function D(U){r=r.substr(U)}return function(U){return r=U.toString().trim(),r.endsWith(";")&&(r=r.slice(0,-1)),i()}}(),E1.parse=t.parse,E1.stringify=t.stringify,E1}var UP=qP();const HP=ch(UP),B0=t=>t.indexOf("linear-gradient")>=0,$P=t=>t.type==="hex"?"#"+t.value:t.type==="literal"?t.value:`${t.type}(${t.value.join(",")})`,M8=t=>{if(!B0(t))return{rotation:0,stops:[{offset:0,color:t},{offset:1,color:t}]};const e=HP.parse(t)[0];return{rotation:parseFloat(e.orientation.value),stops:e.colorStops.map((r,n)=>({color:$P(r),offset:r.length?parseFloat(r.length.value)/100:n/(e.colorStops.length-1)}))}},yf=(t,e=t.fill,r="fill")=>se.useMemo(()=>{if(!B0(e))return{[r]:e};const{stops:n,rotation:i}=M8(e),a=t.a.width/2,o=t.a.height/2,s=(i%180+180)%180,u=s>45&&s<135?t.a.width:t.a.height,h=or.Util.degToRad(i)-Math.PI/2,f=[];return n.forEach(({offset:v,color:g})=>{f.push(v,g)}),r==="fill"?{fillLinearGradientStartPointX:a-u/2*Math.cos(h),fillLinearGradientStartPointY:o-u/2*Math.sin(h),fillLinearGradientColorStops:f,fillLinearGradientEndPointX:a+u/2*Math.cos(h),fillLinearGradientEndPointY:o+u/2*Math.sin(h),fill:n[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:a-u/2*Math.cos(h),strokeLinearGradientStartPointY:o-u/2*Math.sin(h),strokeLinearGradientColorStops:f,strokeLinearGradientEndPointX:a+u/2*Math.cos(h),strokeLinearGradientEndPointY:o+u/2*Math.sin(h)}},[e,t.width,t.height]);let g0=!1;const GP=(t=!g0)=>{g0=t},WP=()=>g0;function Lp(t,e){const r=se.useRef();se.useLayoutEffect(()=>{r.current&&r.current.destroy()},[e]),se.useLayoutEffect(()=>{if(!g0)return;const n=t.current.opacity();return n?(t.current.opacity(0),r.current=new or.Tween({node:t.current,opacity:n,onFinish:()=>{var i;(i=r.current)===null||i===void 0||i.destroy()}}),r.current.play(),()=>{var i;(i=r.current)===null||i===void 0||i.destroy()}):void 0},[])}let v0=0,hm=[],I8=3e4;const VP=t=>{I8=t};let j8=6e3;const YP=t=>{j8=t},XP=()=>j8;function fd(t){v0+=1;let e=!1,r=!1;const n=setTimeout(()=>{e||(Np(`Timeout loading asset ${t}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",t),e=!0,b3())},I8);return()=>{r?console.error("Finish called twice! That is not expected. id: ",t):(r=!0,e||(clearTimeout(n),b3()))}}function b3(){v0-=1,v0===0&&(hm.forEach(t=>t()),hm=[])}function KP(){return new Promise(t=>{return e=()=>{WP()?setTimeout(t,300):t(!0)},void(v0===0?e():hm.push(e));var e})}let D8=[];function ZP(t){D8.push(t)}function Np(t){D8.forEach(e=>e(t))}Kr(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]);Kr({value:!1});const ey=Kr([]);function QP(t){ey.push(t)}var JP="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let Zg;function Hh(t,e="Arial",r="normal",n="normal"){Zg||(Zg=document.createElement("canvas"));var i=Zg.getContext("2d");return i.font=`${r} ${n} 40px '${t}', ${e}`,i.measureText(JP).width}const $1={Arial:!0},w3=t=>!!$1[t];async function Yh(t,e,r){var n;if($1[t])return;const i=!!(!((n=document.fonts)===null||n===void 0)&&n.load),a=Hh("Arial","Arial",e,r);if(i)try{if(await document.fonts.load(`16px '${t}', ${e} ${r}`),a!==Hh(t,"Arial",e,r))return void($1[t]=!0)}catch{}const o=Hh("Times","Times",e,r),s=Hh(t,"Arial",e,r),u=Math.min(6e3,XP())/60;for(let h=0;h<u;h++){const f=Hh(t,"Arial",e,r),v=Hh(t,"Times",e,r);if(f!==s||f!==a||v!==o)return await new Promise(g=>setTimeout(g,60)),void($1[t]=!0);await new Promise(g=>setTimeout(g,60))}console.warn(`Timeout for loading font "${t}". Looks like polotno can't load it. Is it a correct font family?`),Np(`Timeout for loading font "${t}"`)}const _3={};let F8="400,400italic,700,700italic";function eO(){return F8}function B8(t){return`https://fonts.googleapis.com/css?family=${t.replace(/ /g,"+")}:${F8}`}function z8(t){if(_3[t])return;const e=B8(t),r=document.createElement("link");r.type="text/css",r.href=e,r.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(r),_3[t]=!0}const x3={};let Hf;function q8(t){const e=t.fontFamily;if(x3[e]||!t.url&&!t.styles)return;const r=t.styles||(t.url?[{src:`url("${t.url}")`}]:[]),n=(Hf||(Hf=document.getElementById("polotno-font-style"),Hf||(Hf=document.createElement("style"),Hf.id="polotno-font-style",document.head.appendChild(Hf)),Hf)).sheet;r.forEach(i=>{n.insertRule(`
90
+ @font-face{
91
+ font-family:'${e}';
92
+ src:${i.src};
93
+ font-style:${i.fontStyle||"normal"};
94
+ font-weight:${i.fontWeight||"normal"};
95
+ font-display:swap; /* optional but recommended */
96
+ }`,n.cssRules.length)}),x3[t.fontFamily]=!0}const Si=Kr({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),tO=Zr(t=>{Si.textVerticalResizeEnabled=t}),rO=Zr(t=>{Si.removeBackgroundEnabled=t}),nO=Zr(t=>{Si.htmlRenderEnabled=t}),iO=Zr(t=>{Si.imageDownScalingEnabled=t});Zr(t=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),iO(t)});Zr(t=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),Si.textOverflow="change-font-size"});const U8=Zr(t=>{Si.textOverflow=t}),aO=Zr(t=>{Si.textSplitAllowed=t});Zr(t=>{Si.animationsEnabled=t});function rl(t=""){return(t.match(/<\/p>/gi)||[]).length>1&&(t=t.replace(/<\/p>/gi,(e,r,n)=>(n.slice(r+e.length).match(/<\/p>/gi)||[]).length>0?`
97
+ `:e)),t.replace(/(<([^>]+)>)/gi,"")}function oO(t){return t?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(t)?t=(t=t.replace(/<(?![a-z/!])/gi,"&lt;")).replace(/([^a-z0-9"'\s/])>/gi,"$1&gt;"):t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}const sO={warm:t=>e=>{const r=e.data;t=Math.max(0,Math.min(1,t));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]+30*t,255),r[n+1]=Math.min(r[n+1]+15*t,255);return e},cold:t=>e=>{const r=e.data;t=Math.max(0,Math.min(1,t));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]-15*t,255),r[n+1]=Math.min(r[n+1]-10*t,255),r[n+2]=Math.min(r[n+2]+15*t,255);return e},natural:t=>e=>{const r=e.data;t=Math.max(0,Math.min(1,t));for(let n=0;n<r.length;n+=4){r[n]=Math.min(r[n]*(1+.1*t),255),r[n+1]=Math.min(r[n+1]*(1+.1*t),255),r[n+2]=Math.min(r[n+2]*(1+.1*t),255);const i=(r[n]+r[n+1]+r[n+2])/3;r[n]=Math.min((r[n]-i)*(1+.2*t)+i,255),r[n+1]=Math.min((r[n+1]-i)*(1+.2*t)+i,255),r[n+2]=Math.min((r[n+2]-i)*(1+.2*t)+i,255)}return e},temperature:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=(r[n+1],r[n+2]);r[n]=Math.min(Math.max(i+15*t,0),255),r[n+2]=Math.min(Math.max(a-15*t,0),255)}return e},contrast:t=>e=>{const r=e.data,n=100*(t=Math.max(-1,Math.min(1,t))),i=259*(n+255)/(255*(259-n));for(let a=0;a<r.length;a+=4)r[a]=Math.min(Math.max(i*(r[a]-128)+128,0),255),r[a+1]=Math.min(Math.max(i*(r[a+1]-128)+128,0),255),r[a+2]=Math.min(Math.max(i*(r[a+2]-128)+128,0),255);return e},shadows:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=(r[n]+r[n+1]+r[n+2])/3;if(i<128){const a=1+t*(1-i/128)*2;r[n]=Math.min(Math.max(r[n]*a,0),255),r[n+1]=Math.min(Math.max(r[n+1]*a,0),255),r[n+2]=Math.min(Math.max(r[n+2]*a,0),255)}}return e},white:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=(i+a+o)/3;if(s>128){const u=1+t*((s-128)/127);r[n]=Math.min(Math.max(i*u,0),255),r[n+1]=Math.min(Math.max(a*u,0),255),r[n+2]=Math.min(Math.max(o*u,0),255)}}return e},black:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=(i+a+o)/3;if(s<128){const u=1+t*((128-s)/128);r[n]=Math.min(Math.max(i*u,0),255),r[n+1]=Math.min(Math.max(a*u,0),255),r[n+2]=Math.min(Math.max(o*u,0),255)}}return e},vibrance:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=Math.max(i,a,o),u=t<0?(1-(s===0?0:(s-(i+a+o)/3)/s))*t*1.5:.5*t;r[n]=Math.min(Math.max(i-(s-i)*u,0),255),r[n+1]=Math.min(Math.max(a-(s-a)*u,0),255),r[n+2]=Math.min(Math.max(o-(s-o)*u,0),255)}return e},saturation:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=.2126*i+.7152*a+.0722*o;r[n]=Math.min(Math.max(s+(i-s)*(1+t),0),255),r[n+1]=Math.min(Math.max(s+(a-s)*(1+t),0),255),r[n+2]=Math.min(Math.max(s+(o-s)*(1+t),0),255)}return e}};function Ts(t,e){var r;const n={filters:[]},i={};e.brightnessEnabled&&(n.filters.push(or.Filters.Brighten),n.brightness=e.brightness),e.blurEnabled&&(n.filters.push(or.Filters.Blur),n.blurRadius=e.blurRadius,e.type==="text"&&e.lineHeight<1&&(i.offset=e.fontSize)),e.sepiaEnabled&&n.filters.push(or.Filters.Sepia),e.grayscaleEnabled&&n.filters.push(or.Filters.Grayscale),e.filters.forEach((a,o)=>{const s=sO[o];s&&n.filters.push(s(a.intensity))}),t.setAttrs(n),n.filters.length?t.cache(Object.assign(Object.assign({},i),{pixelRatio:e.store._elementsPixelRatio})):t.clearCache(),(r=t.getLayer())===null||r===void 0||r.batchDraw()}const Of=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;var S3={},H8="warn";function lO(t){H8=t}function uO(){return H8}var ja;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(ja||(ja={}));var dm=function(t,e){return dm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},dm(t,e)};function ai(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");dm(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qu=function(){return qu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},qu.apply(this,arguments)};function cO(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function rp(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function sh(t,e,r){if(arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}function $8(t){return Fr(t).type}function G8(t,e){return Fr(t).onSnapshot(e)}function E3(t,e){Fr(t).applyPatches(e7(e))}function pm(t,e){return Fr(t).applySnapshot(e)}function Tu(t,e){e===void 0&&(e=!0);var r=Fr(t);return e?r.snapshot:r.type.getSnapshot(r,!1)}function A1(t,e){for(var r=Fr(t).parent;r;){if(e.is(r.storedValue))return!0;r=r.parent}return!1}function Vf(t,e){for(var r=Fr(t).parent;r;){if(e.is(r.storedValue))return r.storedValue;r=r.parent}throw new rr("Failed to find the parent of ".concat(Fr(t)," of a given type"))}function fO(t){return Fr(t).root.storedValue}function hO(t){return Fr(t).path}function dO(t,e){var r=MO(Fr(t),e);return r?r.value:void 0}function pO(t){return Fr(t).identifier}function Qf(t){return Fr(t).detach(),t}function Qg(t){var e=Fr(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)}function A3(t){return Fr(t).observableIsAlive}var W8=function(){function t(e,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:wo.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(t.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var r=this.isAlive;this._state=e;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(t.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return this._hookSubscribers||(this._hookSubscribers=new n7),this._hookSubscribers.register(e,r)}}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(t.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){this._parent=e,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(t.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||(this.pathAtom=n0("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?eh(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==wo.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDetaching",{get:function(){return this.state===wo.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=n0("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===wo.CREATED){if(this.parent){if(this.parent.state!==wo.FINALIZED)return;this.fireHook(ja.afterAttach)}this.state=wo.FINALIZED,e&&e()}}}),Object.defineProperty(t.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=wo.DEAD}}),Object.defineProperty(t.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(ja.beforeDestroy)}}),t}(),gp=function(t){ai(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i,a)||this;try{s.storedValue=r.createNewInstance(o)}catch(u){throw s.state=wo.DEAD,u}return s.state=wo.CREATED,s.finalizeCreation(),s}return Object.defineProperty(e.prototype,"root",{get:function(){if(!this.parent)throw new rr("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===wo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),e}(W8);gp.prototype.die=Zr(gp.prototype.die);var gO=1,Zl;(function(t){t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.CREATING=1]="CREATING",t[t.CREATED=2]="CREATED"})(Zl||(Zl={}));var Zs;(function(t){t.Dispose="dispose",t.Patch="patch",t.Snapshot="snapshot"})(Zs||(Zs={}));var vO={onError:function(t){throw t}},Rs=function(t){ai(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i,a)||this;if(Object.defineProperty(s,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++gO}),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:Zl.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=fh(function(){return s.getSnapshot()}),s.unbox=s.unbox.bind(s),s._initialSnapshot=o,s.identifierAttribute=r.identifierAttribute,n||(s.identifierCache=new NO),s._childNodes=r.initializeChildNodes(s,s._initialSnapshot),s.identifier=null,s.unnormalizedIdentifier=null,s.identifierAttribute&&s._initialSnapshot){var u=s._initialSnapshot[s.identifierAttribute];if(u===void 0){var h=s._childNodes[s.identifierAttribute];h&&(u=h.value)}if(typeof u!="string"&&typeof u!="number")throw new rr("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=Tp(u),s.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(s):s.identifierCache.addNodeToCache(s),s}return Object.defineProperty(e.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(e.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===Zl.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(e.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=Zl.CREATING;for(var s=[],u=this.parent;u&&u._observableInstanceState===Zl.UNINITIALIZED;)s.unshift(u),u=u.parent;try{for(var h=rp(s),f=h.next();!f.done;f=h.next()){var v=f.value;v.createObservableInstanceIfNeeded(!1)}}catch(_){n={error:_}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}var g=this.type;try{this.storedValue=g.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,g.finalizeNewInstance(this,this.storedValue)}catch(_){throw this.state=wo.DEAD,_}finally{this._isRunningAction=!1}if(this._observableInstanceState=Zl.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=pd,this.state=wo.CREATED,r){this.fireHook(ja.afterCreate),this.finalizeCreation();try{for(var p=rp(s.reverse()),y=p.next();!y.done;y=p.next()){var v=y.value;v.fireHook(ja.afterCreate),v.finalizeCreation()}}catch(_){a={error:_}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}}),Object.defineProperty(e.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(ja.beforeDetach);var r=this.state;this.state=wo.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(ja.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(hc?hc(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Zl.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(e.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(e.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(e.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=uO();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new rr(i);case"warn":$O(i)}}}}),Object.defineProperty(e.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&eh(r.subpath)||"",a=r.actionContext||bO();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var s=a&&a.context&&hO(a.context)||n;o="".concat(s,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===Zl.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(pd),this._autoUnbox=!1;try{return this._observableInstanceState===Zl.CREATED?this.type.getChildren(this):Q8(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(e.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new rr("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(e.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=rp(r.getChildren()),o=a.next();!o.done;o=a.next()){var s=o.value;s.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(ja.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new rr("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(e.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=vp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=i7(i.path),o=Z8(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=vp(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Jf(this.storedValue,"$treenode",this),Jf(this.storedValue,"toJSON",RO)}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===wo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Zl.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Zs.Dispose),this._internalEventsClear(Zs.Dispose))}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(Zs.Snapshot,r)}}),Object.defineProperty(e.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(Zs.Snapshot,r)}}),Object.defineProperty(e.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(Zs.Patch,r)}}),Object.defineProperty(e.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(Zs.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=zO({},r,{path:i}),o=bf(WO(a),2),s=o[0],u=o[1];this._internalEventsEmit(Zs.Patch,s,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(e.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(Zs.Dispose,r)}}),Object.defineProperty(e.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(Zs.Dispose,r,!0);return}throw new rr("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(e.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(Zs.Dispose,r))throw new rr("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Zs.Dispose,r)}}),Object.defineProperty(e.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(e.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(e.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=A6(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},vO);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(e.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(e.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new n7),this._internalEvents.register(r,n,i)}}),Object.defineProperty(e.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,sh([r],bf(i),!1))}}),Object.defineProperty(e.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(e.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),e}(W8);Rs.prototype.createObservableInstance=Zr(Rs.prototype.createObservableInstance);Rs.prototype.detach=Zr(Rs.prototype.detach);Rs.prototype.die=Zr(Rs.prototype.die);var V8,an;(function(t){t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=4]="Boolean",t[t.Date=8]="Date",t[t.Literal=16]="Literal",t[t.Array=32]="Array",t[t.Map=64]="Map",t[t.Object=128]="Object",t[t.Frozen=256]="Frozen",t[t.Optional=512]="Optional",t[t.Reference=1024]="Reference",t[t.Identifier=2048]="Identifier",t[t.Late=4096]="Late",t[t.Refinement=8192]="Refinement",t[t.Union=16384]="Union",t[t.Null=32768]="Null",t[t.Undefined=65536]="Undefined",t[t.Integer=131072]="Integer",t[t.Custom=262144]="Custom",t[t.SnapshotProcessor=524288]="SnapshotProcessor",t[t.Lazy=1048576]="Lazy",t[t.Finite=2097152]="Finite",t[t.Float=4194304]="Float"})(an||(an={}));var Y8="cannotDetermine",mO=Symbol("$type"),mc=function(){function t(e){Object.defineProperty(this,V8,{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=e}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return vc(this,e),this.instantiate(null,"",r,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){throw new rr("unimplemented method")}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(t.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=K8(e);if(n){var i=$8(e);return this.isAssignableFrom(i)?Ms():Is(r,e)}return this.isValidSnapshot(e,r)}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:"",type:this}]).length===0}}),Object.defineProperty(t.prototype,"Type",{get:function(){throw new rr("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(t.prototype,"TypeWithoutSTN",{get:function(){throw new rr("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(t.prototype,"SnapshotType",{get:function(){throw new rr("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(t.prototype,"CreationType",{get:function(){throw new rr("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}),t}();V8=mO;mc.prototype.create=Zr(mc.prototype.create);var hd=function(t){ai(e,t);function e(r){var n=t.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),t.prototype.create.call(this,r,n)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Tp(n[r.identifierAttribute])}}),Object.defineProperty(e.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||ji(n)&&Fr(n)===r?!0:r.type===this&&t7(n)&&!ji(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),ji(n)&&this.isAssignableFrom($8(n))){var s=Fr(n);return s.setParent(i,a),s}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(mc);hd.prototype.create=Zr(hd.prototype.create);var bh=function(t){ai(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(mc);function yc(t){return typeof t=="object"&&t&&t.isType===!0}var yO=1,np;function bO(){return np}function wO(){return yO++}function _O(t,e){var r=Fr(t.context);t.type==="action"&&r.assertAlive({actionContext:t});var n=r._isRunningAction;r._isRunningAction=!0;var i=np;np=t;try{return EO(r,t,e)}finally{np=i,r._isRunningAction=n}}function xO(t){if(t)return t.type==="action"?t:t.parentActionEvent}function vp(t,e,r){var n=function(){var i=wO(),a=np,o=xO(a);return _O({type:"action",name:e,id:i,args:HO(arguments),context:t,tree:fO(t),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?sh(sh([],bf(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var SO=function(){function t(e,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=e;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e){var r=e[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),t}();function EO(t,e,r){var n=new SO(t,r);if(n.isEmpty)return Zr(r).apply(null,e.args);var i=null;function a(o){var s=n.getNextMiddleware(),u=s&&s.handler;if(!u)return Zr(r).apply(null,o.args);if(!s.includeHooks&&ja[o.name])return a(o);function h(v,g){i=a(v),g&&(i=g(i))}function f(v){i=v}return u(o,h,f),i}return a(e)}function AO(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: ".concat(e,">")}}function X8(t){return typeof t=="function"?"<function".concat(t.name?" "+t.name:"",">"):ji(t)?"<".concat(t,">"):"`".concat(AO(t),"`")}function kO(t){return t.length<280?t:"".concat(t.substring(0,272),"......").concat(t.substring(t.length-8))}function PO(t){var e=t.value,r=t.context[t.context.length-1].type,n=t.context.map(function(s){var u=s.path;return u}).filter(function(s){return s.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=ji(e)?"value of type ".concat(Fr(e).type.name,":"):mp(e)?"value":"snapshot",o=r&&ji(e)&&r.is(Fr(e).snapshot);return"".concat(i).concat(a," ").concat(X8(e)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(t.message?" (".concat(t.message,")"):"")+(r?hC(r)||mp(e)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function ty(t,e,r){return t.concat([{path:e,type:r}])}function Ms(){return dd}function Is(t,e,r){return[{context:t,value:e,message:r}]}function z0(t){return t.reduce(function(e,r){return e.concat(r)},[])}function vc(t,e){GO()&&OO(t,e)}function OO(t,e){var r=t.validate(e,[{path:"",type:t}]);if(r.length>0)throw new rr(CO(t,e,r))}function CO(t,e,r){if(r.length!==0)return"Error while converting ".concat(kO(X8(e))," to `").concat(t.name,`\`:
98
+
99
+ `)+r.map(PO).join(`
100
+ `)}var LO=0,NO=function(){function t(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:LO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Kr.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Kr.map()})}return Object.defineProperty(t.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,r===void 0?1:r+1)}}),Object.defineProperty(t.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(t.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){if(r===void 0&&(r=!0),e.identifierAttribute){var n=e.identifier;this.cache.has(n)||this.cache.set(n,Kr.array([],q0));var i=this.cache.get(n);if(i.indexOf(e)!==-1)throw new rr("Already registered");i.push(e),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(t.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this;T6(e.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(t.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var r=e.identifier,n=this.cache.get(r);n&&(n.remove(e),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(t.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this,n=new t,i=e.path+"/";return gS(this.cache).forEach(function(a){for(var o=bf(a,2),s=o[0],u=o[1],h=!1,f=u.length-1;f>=0;f--){var v=u[f];(v===e||v.path.indexOf(i)===0)&&(n.addNodeToCache(v,!1),u.splice(f,1),u.length||r.cache.delete(s),h=!0)}h&&r.updateLastCacheModificationPerId(s)}),n}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);return n?n.some(function(i){return e.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(t.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return e.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new rr("Cannot resolve a reference to type '".concat(e.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),t}();function ry(t,e,r,n,i){var a=K8(i);if(a){if(a.parent)throw new rr("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?e.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return e&&a.setParent(e,r),a}return new Rs(t,e,r,n,i)}function Cf(t,e,r,n,i){return new gp(t,e,r,n,i)}function TO(t){return t instanceof gp||t instanceof Rs}var wo;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CREATED=1]="CREATED",t[t.FINALIZED=2]="FINALIZED",t[t.DETACHING=3]="DETACHING",t[t.DEAD=4]="DEAD"})(wo||(wo={}));function ji(t){return!!(t&&t.$treenode)}function Fr(t){if(!ji(t))throw new rr("Value ".concat(t," is no MST Node"));return t.$treenode}function K8(t){return t&&t.$treenode||null}function RO(){return Fr(this).snapshot}function MO(t,e,r){return r===void 0&&(r=!0),Z8(t,i7(e),r)}function Z8(t,e,r){r===void 0&&(r=!0);var n=t;try{for(var i=0;i<e.length;i++){var a=e[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof gp){var o=n.value;ji(o)&&(n=Fr(o))}if(n instanceof Rs){var s=n.getChildType(a);if(s&&(n=n.getChildNode(a),n))continue}}}throw new rr("Could not resolve '".concat(a,"' in path '").concat(k3(e.slice(0,i))||"/","' while resolving '").concat(k3(e),"'"))}}catch(u){if(!r)return;throw u}return n}function Q8(t){if(!t)return dd;var e=Object.keys(t);if(!e.length)return dd;var r=new Array(e.length);return e.forEach(function(n,i){r[i]=t[n]}),r}var IO=Object.toString(),dd=Object.freeze([]),pd=Object.freeze({}),q0=q9().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(q0);var rr=function(t){ai(e,t);function e(r){return r===void 0&&(r="Illegal state"),t.call(this,"[mobx-state-tree] ".concat(r))||this}return e}(Error);function jO(t){return t}var DO=Number.isInteger;function FO(t){return Number(t)===t&&t%1!==0}function BO(t){return Number.isFinite(t)}function J8(t){return Array.isArray(t)||Uu(t)}function e7(t){return t?J8(t)?t:[t]:dd}function zO(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++){var i=e[n];for(var a in i)t[a]=i[a]}return t}function ed(t){var e;if(t===null||typeof t!="object")return!1;var r=Object.getPrototypeOf(t);return r==null?!0:((e=r.constructor)===null||e===void 0?void 0:e.toString())===IO}function t7(t){return t!==null&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof RegExp)}function mp(t,e){return e===void 0&&(e=!0),t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e&&t instanceof Date}function r7(t){return typeof t!="function"}function qO(t,e,r){nu(t)?M6(t,e,r):Object.defineProperty(t,e,r)}function Jf(t,e,r){qO(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}var UO=function(){function t(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(t.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(e):this.handlers.push(e),function(){n.unregister(e)}}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.handlers.indexOf(e);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,sh([],bf(e),!1))})}}),t}(),n7=function(){function t(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(t.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.eventHandlers&&this.eventHandlers[e];return!!r&&r.hasSubscribers}}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[e];return i||(i=this.eventHandlers[e]=new UO),i.register(r,n)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];return!!n&&n.has(r)}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];n&&n.unregister(r)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[e];a&&(r=a).emit.apply(r,sh([],bf(n),!1))}}),t}();function HO(t){for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}function Jg(t,e){return t.indexOf(e)===0}function $O(t){console.warn(new Error("[mobx-state-tree] ".concat(t)))}function GO(){return typeof process<"u"&&S3&&S3.ENABLE_TYPE_CHECK==="true"}function WO(t){if(!("oldValue"in t))throw new rr("Patches without `oldValue` field cannot be inversed");return[VO(t),YO(t)]}function VO(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}function YO(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}function XO(t){return typeof t=="number"}function eh(t){return XO(t)===!0?""+t:t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function KO(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function k3(t){if(t.length===0)return"";var e=function(r){return r.map(eh).join("/")};return t[0]==="."||t[0]===".."?e(t):"/"+e(t)}function i7(t){var e=t.split("/").map(KO),r=t===""||t==="."||t===".."||Jg(t,"/")||Jg(t,"./")||Jg(t,"../");if(!r)throw new rr("a json path must be either rooted, empty or relative, but got '".concat(t,"'"));return e[0]===""&&e.shift(),e}var e2=Symbol("$preProcessorFailed"),ZO=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|an.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(e.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(e.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return e2}}}),Object.defineProperty(e.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(e.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;QO(r.type,this,"create"),r instanceof Rs&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},yC(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=ji(a)?a:this.preProcessSnapshot(a),s=this._subtype.instantiate(r,n,i,o);return this._fixNode(s),s}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,ji(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===e2?Is(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=yc(r)?this._subtype:ji(r)?Tu(r,!1):this.preProcessSnapshotSafe(r);return n===e2?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof hd))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),e}(mc);function QO(t,e){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=rp(i),s=o.next();!s.done;s=o.next()){var u=s.value;t[u]=e[u].bind(e)}}catch(h){r={error:h}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function JO(t,e,r){return new ZO(t,e,r)}var P3="Map.put can only be used to store complex values that have an identifier type attribute";function a7(t,e){var r,n,i=t.getSubTypes();if(i===Y8)return!1;if(i){var a=e7(i);try{for(var o=rp(a),s=o.next();!s.done;s=o.next()){var u=s.value;if(!a7(u,e))return!1}}catch(h){r={error:h}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return t instanceof yp&&e.push(t),!0}var lf;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO"})(lf||(lf={}));var eC=function(t){ai(e,t);function e(r,n){return t.call(this,r,Kr.ref.enhancer,n)||this}return Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.get.call(this,""+r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.has.call(this,""+r)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.delete.call(this,""+r)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return t.prototype.set.call(this,""+r,n)}}),Object.defineProperty(e.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new rr("Map.put cannot be used to set empty values");if(ji(r)){var n=Fr(r);if(n.identifier===null)throw new rr(P3);return this.set(n.identifier,r),r}else if(t7(r)){var i=Fr(this),a=i.type;if(a.identifierMode!==lf.YES)throw new rr(P3);var o=a.mapIdentifierAttribute,s=r[o];if(!ny(s)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(Tu(u))}var h=Tp(s);return this.set(h,r),this.get(h)}else throw new rr("Map.put can only be used to store complex values")}}),e}(zm),m0=function(t){ai(e,t);function e(r,n,i){i===void 0&&(i=[]);var a=t.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:lf.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),ry(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===lf.UNKNOWN){var r=[];if(a7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new rr("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);n?(this.identifierMode=lf.YES,this.mapIdentifierAttribute=n):this.identifierMode=lf.NO}}}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new eC(r,this.name)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){L6(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(s){var u=o[s],h=vp(n,s,u);Jf(n,s,h)})}),Dm(n,this.willChange),Fm(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return T6(r.storedValue)}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new rr("Not a child "+n);return i}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fr(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var s=r.newValue,u=r.object.get(i);if(s===u)return null;vc(o,s),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":vc(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(e.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===lf.YES&&n instanceof Rs){var i=n.identifier;if(i!==r)throw new rr("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:eh(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:eh(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:eh(r.name),oldValue:i},n)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){vc(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(s){a[s]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(s){a[s]===!1&&i.delete(s)})}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return ed(r)?z0(Object.keys(r).map(function(a){return i._subType.validate(r[a],ty(n,a,i._subType))})):Is(n,r,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return pd}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),e}(hd);m0.prototype.applySnapshot=Zr(m0.prototype.applySnapshot);function tC(t){return new m0("Map<string, ".concat(t.name,">"),t)}var y0=function(t){ai(e,t);function e(r,n,i){i===void 0&&(i=[]);var a=t.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return ry(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,s){var u=""+s;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qu(qu({},q0),{name:this.name});return Kr.array(Q8(r),n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){zu(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(s){var u=o[s],h=vp(n,s,u);Jf(n,s,h)})}),Dm(n,this.willChange),Fm(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new rr("Not a child: "+n)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fr(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,a=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var o=O3(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var s=r.index,u=r.removedCount,h=r.added,f=O3(n,i,a.slice(s,s+u),h,h.map(function(g,p){return s+p}));if(!f)return null;r.added=f;for(var v=s+u;v<a.length;v++)a[v].setParent(n,""+(v+h.length-u))}break}return r}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Fr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){vc(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return J8(r)?z0(r.map(function(a,o){return i._subType.validate(a,ty(n,""+o,i._subType))})):Is(n,r,"Value is not an array")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return dd}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),e}(hd);y0.prototype.applySnapshot=Zr(y0.prototype.applySnapshot);function rC(t){return new y0("".concat(t.name,"[]"),t)}function O3(t,e,r,n,i){for(var a=!0,o=0;;o++){var s=o<=n.length-1,u=r[o],h=s?n[o]:void 0,f=""+i[o];if(TO(h)&&(h=h.storedValue),!u&&!s)break;if(!s)a=!1,r.splice(o,1),u instanceof Rs&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(C3(u,h))r[o]=t2(e,t,f,h,u);else{for(var g=void 0,p=o;p<r.length;p++)if(C3(r[p],h)){g=r.splice(p,1)[0];break}a=!1;var v=t2(e,t,f,h,g);r.splice(o,0,v)}else{if(ji(h)&&Fr(h).parent===t)throw new rr("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t.path,"/").concat(f,"', but it lives already at '").concat(Fr(h).path,"'"));a=!1;var v=t2(e,t,f,h);r.splice(o,0,v)}}return a?null:r}function t2(t,e,r,n,i){vc(t,n);function a(){if(ji(n)){var s=Fr(n);if(s.assertAlive(pd),s.parent!==null&&s.parent===e)return s.setParent(e,r),s}return i?t.reconcile(i,n,e,r):t.instantiate(e,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof Rs&&i.createObservableInstanceIfNeeded(),i.die()),o}function C3(t,e){if(!t.isAlive)return!1;if(ji(e)){var r=Fr(e);return r.isAlive&&r===t}if(t.snapshot===e)return!0;if(!(t instanceof Rs))return!1;var n=t.getReconciliationType();return t.identifier!==null&&t.identifierAttribute&&ed(e)&&n.is(e)&&n.isMatchingSnapshotId(t,e)}var L3="preProcessSnapshot",N3="postProcessSnapshot";function nC(){return Fr(this).toString()}var T3={name:"AnonymousModel",properties:{},initializers:dd};function iC(t){var e=Object.keys(t),r=new Set;return e.forEach(function(n){if(r.has(n))throw new rr("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),e.reduce(function(n,i){if(i in ja)throw new rr("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(t,i);if("get"in a)throw new rr("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new rr("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(mp(o))n[i]=th(fC(o),o);else if(o instanceof m0)n[i]=th(o,{});else if(o instanceof y0)n[i]=th(o,[]);else if(!yc(o))throw new rr("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},qu({},t))}var yp=function(t){ai(e,t);function e(r){var n=t.call(this,r.name||T3.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.preProcessor;return a?n.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.postProcessor;return a?n.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,T3,r),n.properties=iC(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(e.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&an.Identifier){if(r)throw new rr("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(e.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new e({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(e.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!ed(n))throw new rr("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===L3)throw new rr("Cannot define action '".concat(L3,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===N3)throw new rr("Cannot define action '".concat(N3,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in ja&&o){var s=a;a=function(){o.apply(null,arguments),s.apply(null,arguments)}}var u=a.$mst_middleware,h=a.bind(n);h._isFlowAction=a._isFlowAction||!1,h.$mst_middleware=u;var f=vp(r,i,h);n[i]=f,Jf(r,i,f)})}}),Object.defineProperty(e.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new rr("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!ed(n))throw new rr("volatile state initializer should return a plain object containing state");R6(r,n)}}),Object.defineProperty(e.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),s=o.actions,u=o.views,h=o.state,f=cO(o,["actions","views","state"]);for(var v in f)throw new rr("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(v,"'"));return h&&n.instantiateVolatileState(a,h),u&&n.instantiateViews(a,u),s&&n.instantiateActions(a,s),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!ed(n))throw new rr("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)M6(r,i,o),j6(r,(a={},a[i]=fh,a));else if(typeof o.value=="function")Jf(r,i,o.value);else throw new rr("A view member should either be a function or getter based property")})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=ji(a)?a:this.applySnapshotPreProcessor(a);return ry(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,s){a[o]=s.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=qu(qu({},q0),{name:this.name});return Kr.object(r,pd,n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Jf(n,"toString",nC),this.forAllProps(function(i){L6(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Dm(n,this.willChange),Fm(n,this.didChange)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Fr(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(vc(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Fr(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:eh(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new rr("Not a value property: "+n);var a=zu(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new rr("Node not available for property "+n);return o}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,s){try{var u=ud(r.storedValue,o);u.reportObserved()}catch{throw new rr("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new rr("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){vc(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(e.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return ed(a)?z0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],ty(n,o,i.properties[o]))})):Is(n,a,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return pd}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),e}(hd);yp.prototype.applySnapshot=Zr(yp.prototype.applySnapshot);function aC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():"AnonymousModel",n=t.shift()||{};return new yp({name:r,properties:n})}function oC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string",n=r?t[0]:"AnonymousModel";return r&&t.shift(),t.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function sC(t){return yc(t)&&(t.flags&an.Object)>0}var xc=function(t){ai(e,t);function e(r,n,i,a){a===void 0&&(a=jO);var o=t.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Cf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(mp(r)&&this.checker(r))return Ms();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Is(n,r,"Value is not a ".concat(i))}}),e}(bh),o7=new xc("string",an.String,function(t){return typeof t=="string"}),s7=new xc("number",an.Number,function(t){return typeof t=="number"}),lC=new xc("integer",an.Integer,function(t){return DO(t)}),uC=new xc("float",an.Float,function(t){return FO(t)}),cC=new xc("finite",an.Finite,function(t){return BO(t)}),l7=new xc("boolean",an.Boolean,function(t){return typeof t=="boolean"}),u7=new xc("null",an.Null,function(t){return t===null}),c7=new xc("undefined",an.Undefined,function(t){return t===void 0}),f7=new xc("Date",an.Date,function(t){return typeof t=="number"||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});f7.getSnapshot=function(t){return t.storedValue.getTime()};var h7=f7;function fC(t){switch(typeof t){case"string":return o7;case"number":return s7;case"boolean":return l7;case"object":if(t instanceof Date)return h7}throw new rr("Cannot determine primitive type from value "+t)}function hC(t){return yc(t)&&(t.flags&(an.String|an.Number|an.Integer|an.Boolean|an.Date))>0}var dC=function(t){ai(e,t);function e(r){var n=t.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Literal}),n.value=r,n}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Cf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return mp(r)&&r===this.value?Ms():Is(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),e}(bh);function d7(t){return new dC(t)}var pC=function(t){ai(e,t);function e(r,n,i,a){var o=t.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|an.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=ji(r)?Fr(r).snapshot:r;return this._predicate(a)?Ms():Is(n,r,this._message(r))}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(mc);function gC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():yc(t[0])?t[0].name:null,n=t[0],i=t[1],a=t[2]?t[2]:function(o){return"Value does not respect the refinement predicate"};return new pC(r,n,i,a)}function vC(t,e){var r=typeof t=="string"?e:t,n=U0.apply(void 0,sh([],bf(r.map(function(i){return d7(""+i)})),!1));return typeof t=="string"&&(n.name=t),n}var mC=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=qu({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(e.prototype,"flags",{get:function(){var r=an.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new rr("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new rr("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(e.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var s=this._types[o],u=s.validate(r,n);if(u.length===0){if(this._eager)return Ms();a++}else i.push(u)}return a===1?Ms():Is(n,r,"No type is applicable for the union").concat(z0(i))}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),e}(mc);function U0(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=yc(t)?void 0:t,i=yc(t)?sh([t],bf(e),!1):e,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new mC(a,i,n)}function yC(t){return yc(t)&&(t.flags&an.Union)>0}var bC=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|an.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(e.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&vc(this,r),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Ms():this._subtype.validate(r,n)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(mc);function wC(t,e){if(typeof e!="function"&&ji(e))throw new rr("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function th(t,e,r){return wC(t,e),new bC(t,e,r||_C)}var _C=[void 0],xC=th(c7,void 0),SC=th(u7,null);function p7(t){return U0(t,xC)}function EC(t){return U0(t,SC)}var AC=function(t){ai(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(e.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|an.Late},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new rr("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):Ms()}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||Y8}}),e}(mc);function kC(t,e){var r=typeof t=="string"?t:"late(".concat(t.toString(),")"),n=typeof t=="string"?e:t;return new AC(r,n)}function PC(t,e){return new OC(t,e)}var OC=function(t){ai(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Kr.array()}),u5(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(Zr(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var s=Cf(this,r,n,i,a);return this.pendingNodeList.push(s),u5(function(){return!s.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(s),1)}),s}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):r7(r)?Ms():Is(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):t.prototype.reconcile.call(this,r,n,i,a)}}),e}(bh),g7=function(t){ai(e,t);function e(r){var n=t.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Frozen}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Cf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r7(r)?this.subType?this.subType.validate(r,n):Ms():Is(n,r,"Value is not serializable and cannot be frozen")}}),e}(bh),R3=new g7;function CC(t){return arguments.length===0?R3:yc(t)?new g7(t):th(R3,t)}function LC(t){switch(t){case ja.beforeDestroy:return"destroy";case ja.beforeDetach:return"detach";default:return}}var NC=function(){function t(e,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),ny(e))this.identifier=e;else if(ji(e)){var n=Fr(e);if(!n.identifierAttribute)throw new rr("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new rr("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new rr("Can only store references to tree nodes or identifiers, got: '".concat(e,"'"))}return Object.defineProperty(t.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=Tp(this.identifier),n=e.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new TC("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(e.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),t}(),TC=function(t){ai(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return e}(Error),v7=function(t){ai(e,t);function e(r,n){var i=t.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Reference}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return ny(r)?Ms():Is(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(e.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var s=o.storedValue;s&&this.onInvalidated({cause:r,parent:s,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){E3(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){sC(o.type)?this.replaceRef(void 0):E3(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(e.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=Fr(a),s=function(f,v){var g=LC(v);g&&i.fireInvalidated(g,r,n,o)},u=o.registerHook(ja.beforeDetach,s),h=o.registerHook(ja.beforeDestroy,s);return function(){u(),h()}}}}),Object.defineProperty(e.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(ja.beforeDestroy,function(){o&&o()});var s=function(u){o&&o();var h=r.parent,f=h&&h.storedValue;if(h&&h.isAlive&&f){var v=void 0;i?v=!!i.get(n,f):v=r.root.identifierCache.has(a.targetType,Tp(n)),v?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===wo.FINALIZED?s(!0):(r.isRoot||r.root.registerHook(ja.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(ja.afterAttach,function(){s(!1)}))}}}),e}(bh),RC=function(t){ai(e,t);function e(r,n){return t.call(this,r,n)||this}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=ji(a)?pO(a):a,s=new NC(a,this.targetType),u=Cf(this,r,n,i,s);return s.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=ji(n),s=r.storedValue;if(!o&&s.identifier===n||o&&s.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),e}(v7),MC=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=ji(a)?this.options.set(a,r?r.storedValue:null):a,s=Cf(this,r,n,i,o);return this.watchTargetNodeForInvalidations(s,o,this.options),s}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=ji(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var s=this.instantiate(i,a,void 0,o);return r.die(),s}}),e}(v7);function m7(t,e){var r=e||void 0,n=e?e.onInvalidated:void 0;return r&&(r.get||r.set)?new MC(t,{get:r.get,set:r.set},n):new RC(t,n)}function IC(t,e){var r=m7(t,qu(qu({},e),{onInvalidated:function(n){e&&e.onInvalidated&&e.onInvalidated(n),n.removeRef()}}));return e&&e.acceptsUndefined===!1?r:p7(r)}var y7=function(t){ai(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Identifier}),i}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof yp))throw new rr("Identifier types can only be instantiated as direct child of a model type");return Cf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new rr("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Is(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):Ms()}}),e}(bh),jC=function(t){ai(e,t);function e(){var r=t.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Identifier}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),e}(y7),DC=function(t){ai(e,t);function e(){return t.call(this,"identifierNumber","number")||this}return Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),e}(y7),FC=new jC,BC=new DC;function Tp(t){return""+t}function ny(t){return typeof t=="string"||typeof t=="number"}function zC(t){return new qC(t)}var qC=function(t){ai(e,t);function e(r){var n=t.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Custom}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return Ms();var i=this.options.getValidationMessage(r);return i?Is(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):Ms()}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return Cf(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var s=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(s)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,h=this.instantiate(i,a,void 0,u);return r.die(),h}}),e}(bh),Qt={enumeration:vC,model:aC,compose:oC,custom:zC,reference:m7,safeReference:IC,union:U0,optional:th,literal:d7,maybe:p7,maybeNull:EC,refinement:gC,string:o7,boolean:l7,number:s7,integer:lC,float:uC,finite:cC,Date:h7,map:tC,array:rC,frozen:CC,identifier:FC,identifierNumber:BC,late:kC,lazy:PC,undefined:c7,null:u7,snapshotProcessor:JO};function b7({oldText:t,newText:e,element:r}){if(!(e.length/Math.max(20,t.length)>=4))return r.fontSize;const n=r.width*r.page.computedHeight/e.length,i=1.5*Math.sqrt(n),a=r.fontSize;return Math.min(a,Math.max(5,Math.round(i)))}function M3(t){const{r:e,g:r,b:n}=or.Util.colorToRGBA(t);return(e*299+r*587+n*114)/1e3}function w7(t){const{outlineSize:e,outlineColor:r}=function(a){const o=a.strokeWidth||0;return o>0?{outlineSize:o,outlineColor:a.stroke}:{outlineSize:a.shadowEnabled&&a.shadowBlur>0&&a.shadowOpacity>.1?a.shadowBlur*a.shadowOpacity:0,outlineColor:a.shadowColor}}(t);if(e<.001)return t.fill;const n=M3(t.fill),i=M3(r);return Math.abs(n-i)>=50?r:t.fill}let $f;function UC(){return $f||($f=document.getElementById("polotno-text-style"),$f||($f=document.createElement("style"),$f.id="polotno-text-style",document.head.appendChild($f)),$f)}or._fixTextRendering=!0;const I3={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal",textTransform:"none"};function HC(t){var e="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+e+"]*?["+e+"]").test(t)}function $C(t){t=t.replace(/\s/g,"");let e=0;for(var r=0;r<t.length;r++)HC(t[r])&&(e+=1);return e>t.length/2}function H0(t){return $C(t)?"rtl":"ltr"}const GC=ni(({textNodeRef:t,element:e,onBlur:r,selectAll:n,cursorPosition:i})=>{const[a,o]=se.useState(I3),s=t.current;se.useLayoutEffect(()=>{const g={};g.width=s.width()-2*s.padding()+"px",g.height=s.height()-2*s.padding()+s.fontSize()*s.lineHeight()+"px",g.fontSize=s.fontSize()+"px",g.lineHeight=s.lineHeight()+.01,g.fontFamily=s.fontFamily(),g.textAlign=s.align(),g.color=s.fill(),g.fontWeight=e.fontWeight,g.fontStyle=e.fontStyle,g.letterSpacing=e.letterSpacing+"em",g.opacity=Math.max(e.a.opacity,.2),g.textTransform=e.textTransform,g.caretColor=w7(e);const p=`
101
+ .polotno-input::placeholder {
102
+ color: ${a.color};
103
+ opacity: 0.6;
104
+ }
105
+ `,y=UC();y.innerHTML="",y.appendChild(document.createTextNode(p)),JSON.stringify(g)!==JSON.stringify(a)&&o(g)});const u=se.useRef(null);se.useLayoutEffect(()=>{var g;const p=u.current;if(!p)return;(g=u.current)===null||g===void 0||g.focus();const y=i||p.value.length;p.selectionStart=p.selectionEnd=y,n&&(p?.select(),document.execCommand("selectAll",!1,null))},[]),se.useEffect(()=>{window.addEventListener("blur",r);const g=p=>{var y;!((y=u.current)===null||y===void 0)&&y.contains(p.target)||r()};return window.addEventListener("touchstart",g),()=>{window.removeEventListener("blur",r),window.removeEventListener("touchstart",g)}},[]);let h=0;const f=s.textArr.length*s.lineHeight()*s.fontSize();e.verticalAlign==="middle"&&(h=(e.a.height-f)/2),e.verticalAlign==="bottom"&&(h=e.a.height-f);const v=rl(e.text);return se.createElement("textarea",{className:"polotno-input",ref:u,dir:H0(v),style:Object.assign(Object.assign(Object.assign({},I3),a),{paddingTop:h+"px"}),value:v,onChange:g=>{const p=b7({oldText:e.text,newText:g.target.value,element:e});e.set({text:g.target.value,fontSize:p})},placeholder:e.placeholder,onBlur:r})}),WC=t=>se.createElement(p0,null,se.createElement(GC,Object.assign({},t))),_7=(t,e)=>{const[r,n]=se.useReducer(o=>o+1,0),i=se.useRef(w3(e)),a=se.useRef(null);return se.useLayoutEffect(()=>{if(i.current=w3(e),i.current)return;let o=!0;return(async()=>{i.current=!1,n();const s=fd(`text ${e}`);await t.loadFont(e),o?(a.current=s,i.current=!0,n()):s()})(),()=>{a.current&&(a.current(),a.current=null),o=!1}},[e]),se.useEffect(()=>{i.current&&setTimeout(()=>{a.current&&(a.current(),a.current=null)})},[i.current]),[i.current]},x7=({fontLoaded:t,fontFamily:e,fontSize:r,lineHeight:n})=>se.useMemo(()=>{if(typeof n=="number")return n;const i=document.createElement("div");i.style.fontFamily=e,i.style.fontSize=r+"px",i.style.lineHeight=n,i.innerText="Test text",document.body.appendChild(i);const a=i.offsetHeight;return document.body.removeChild(i),a/r},[t,e,r,n]);function S7(t){const e=se.useRef(t),r=se.useRef(t);return se.useMemo(()=>{r.current=e.current,e.current=t},[t]),r.current}function bp(t,e,r,n){const i=Math.max(-.9999,Math.min(.9999,r));if(Math.abs(i)<1e-4)return`M 0 ${e/2} L ${t} ${e/2}`;const a=5*n/(2*Math.abs(i))-n,o=t/2;if(i>0){const s=2*a+n/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 1 ${o} ${s-2*a}`,`A ${a} ${a} 0 1 1 ${o} ${s}`].join(" ")}{const s=-(2*a-Math.round(e))-n/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 0 ${o} ${s+2*a}`,`A ${a} ${a} 0 1 0 ${o} ${s}`].join(" ")}}const VC=ni(({element:t,store:e})=>{const r=se.useRef(null),n=se.useRef(null),i=se.useRef(null),{editorEnabled:a,selectAll:o}=(q=>{const[J,ae]=se.useState(!1),ie=se.useRef(!1);return se.useEffect(()=>{var Z=!0;return setTimeout(()=>{Z&&(q._editModeEnabled&&(ie.current=!0),ae(!0),setTimeout(()=>{ie.current=!1},50))},50),()=>{Z=!1}},[]),{editorEnabled:J&&q._editModeEnabled,selectAll:ie.current}})(t),[s,u]=se.useState(!1),h=se.useRef(t.a.height),f=e.selectedShapes.indexOf(t)>=0&&t.selectable,{textVerticalResizeEnabled:v}=Si,g=S7(t.fontFamily),[p,y]=se.useState([]);se.useEffect(()=>{var q,J;const ae=(J=(q=r.current)===null||q===void 0?void 0:q.textArr)!==null&&J!==void 0?J:[];JSON.stringify(ae)!==JSON.stringify(p)&&y(ae)}),se.useEffect(()=>{if(t.a.width)return;const q=r.current;q.width(600),t.set({width:1.4*q.getTextWidth()})},[]),se.useEffect(()=>{f||t.text!==""||!t.removable||t.placeholder||e.deleteElements([t.id])},[f]),se.useLayoutEffect(()=>Bu(()=>{const q=r.current;Ts(q,t)}));const[_]=_7(e,t.fontFamily);let x=rl(t.text);t.textTransform==="uppercase"&&(x=x.toUpperCase());const b=()=>{if(t.curveEnabled){const ae=n.current;return ae.getSelfRect().height||ae.fontSize()}const q=r.current.clone({height:void 0}),J=Math.ceil(q.fontSize()*q.lineHeight()*q.textArr.length+1);return q.destroy(),J};se.useLayoutEffect(()=>{if(!_)return;const{textOverflow:q,textSplitAllowed:J}=Si;if(!t.a.height){const ae=b();return void e.history.ignore(()=>{t.set({height:ae})})}if(!e.isPlaying)if(q!=="change-font-size"||s){if(q==="resize"){const ae=b();v&&t.a.height<ae&&e.history.ignore(()=>{var ie;A3(t)&&t.set({height:ae}),(ie=r.current)===null||ie===void 0||ie.height(ae)},!1,!0),v||t.a.height===ae||s||e.history.ignore(()=>{var ie;A3(t)&&t.set({height:ae}),(ie=r.current)===null||ie===void 0||ie.height(ae)},!1,!0)}}else{const ae=function(Z,te,V=!1){const B=Z.fontSize(),D=Z.height(),U=rl(te.text);let X=te.a.fontSize;Z.height(void 0);const ee=Math.round(2*te.a.fontSize)-1;for(let K=1;K<ee;K++){const oe=te.a.height&&Z.height()>te.a.height;let me=U.split(`
106
+ `).join(" ").split(/[\s-]+/).reduce((Te,Ce)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(Ce)?Te.concat(Ce.split("")):Te.concat(Ce),[]),de=Z.textArr.map(Te=>Te.text).join(";");const ye=me.find(Te=>!de.includes(Te)||(de=de.replace(Te,""),!1));if(!(oe||ye&&!V))break;X-=.5,Z.fontSize(X)}return Z.fontSize(B),Z.height(D),X}(r.current,t,J);if(ae!==t.a.fontSize)return void e.history.ignore(()=>{t.set({fontSize:ae})},!1,!0);const ie=b();t.a.height===ie||v||e.history.ignore(()=>{t.set({height:ie})},!1,!0)}}),se.useLayoutEffect(()=>{var q;if(_&&t.curveEnabled){const J=(q=n.current)===null||q===void 0?void 0:q.getSelfRect().width;if(J){const ae=J-t.a.width,ie=t.a.rotation*Math.PI/180,Z=-ae/2*Math.cos(ie),te=-ae/2*Math.sin(ie);t.set({width:J,x:t.a.x+Z,y:t.a.y+te})}}},[_,t.curveEnabled,t.curvePower,t.text,t.fontSize,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing]),se.useLayoutEffect(()=>{const q=r.current;q&&(q.width(q.width()+1e-8),q.width(q.width()-1e-8),q._setTextData(),Ts(q,t))},[_]);const E=se.useRef(null),k=se.useRef(0),S=q=>{q.evt.preventDefault(),e.selectedShapes.find(ae=>ae===t)&&t.contentEditable&&(k.current=function(ae){var ie;const Z=ae.target,te=function(ee){var K=ee.getAbsoluteTransform().copy();K.invert();var oe=ee.getStage().getPointerPosition();return K.point(oe)}(Z),V=Z.textArr,B=Math.floor(te.y/(Z.fontSize()*Z.lineHeight())),D=V.slice(0,B).reduce((ee,K)=>ee+K.text.length,B),U=(ie=V[B])!==null&&ie!==void 0?ie:V[0];let X=0;return Z.align()==="right"?X=Z.width()-U.width:Z.align()==="center"&&(X=Z.width()/2-U.width/2),D+Math.round((te.x-X)/U.width*U.text.length)}(q),t.toggleEditMode())},A=!x&&t.placeholder?.6:t.a.opacity;Lp(r,A);const M=x7({fontLoaded:_,fontFamily:t.fontFamily,fontSize:t.a.fontSize,lineHeight:t.lineHeight}),C=t.selectable||e.role==="admin",I=yf(t),F=se.useMemo(()=>t.backgroundEnabled?function({lines:q,lineHeight:J,width:ae,align:ie="left",padding:Z=0,cornerRadius:te=0}){var V;q.forEach((X,ee)=>{X.cx=ae/2,ie==="right"?X.cx=ae-X.width/2:ie==="left"&&(X.cx=X.width/2),ie!=="justify"||X.lastInParagraph||(X.width=ae),ie==="justify"&&(X.cx=X.width/2)});let B=`M ${(V=q[0])===null||V===void 0?void 0:V.cx} ${-Z}`;q.forEach((X,ee)=>{const{cx:K}=X,oe=q[ee-1];oe&&oe.width>X.width?B+=` L ${K+X.width/2+Z} ${ee*J+Z}`:B+=` L ${K+X.width/2+Z} ${ee*J-Z}`;const me=q[ee+1];me&&me.width>X.width?B+=` L ${K+X.width/2+Z} ${(ee+1)*J-Z}`:B+=` L ${K+X.width/2+Z} ${(ee+1)*J+Z}`});for(var D=q.length-1;D>=0;D--){const X=q[D],{cx:ee}=X,K=q[D+1];K&&K.width>X.width?B+=` L ${ee-X.width/2-Z} ${(D+1)*J-Z}`:B+=` L ${ee-X.width/2-Z} ${(D+1)*J+Z}`;const oe=q[D-1];oe&&oe.width>X.width?B+=` L ${ee-X.width/2-Z} ${D*J+Z}`:B+=` L ${ee-X.width/2-Z} ${D*J-Z}`}B+=" Z";const U=BP(B);return zP(U,te).path}({lines:JSON.parse(JSON.stringify(p)),cornerRadius:t.backgroundCornerRadius*(t.a.fontSize*M*.5),lineHeight:M*t.a.fontSize,padding:t.backgroundPadding*(t.a.fontSize*M*.5),width:t.a.width,align:t.align}):"",[t.backgroundEnabled,t.backgroundCornerRadius,t.a.fontSize,M,t.backgroundPadding,t.a.width,t.align,p]),j=Of();let O=0;t.verticalAlign==="middle"?O=(t.a.height-p.length*M*t.a.fontSize)/2:t.verticalAlign==="bottom"&&(O=t.a.height-p.length*M*t.a.fontSize);const T=t.curveEnabled?bp(t.a.width,t.a.height,t.curvePower,t.a.fontSize):"",$=_?t.fontFamily:g===t.fontFamily?"Arial":t.fontFamily;return se.createElement(se.Fragment,null,se.createElement(dp,{ref:i,x:t.a.x,y:t.a.y,rotation:t.a.rotation,hideInExport:!t.showInExport,listening:!1,visible:t.backgroundEnabled,opacity:t.backgroundOpacity*A,data:F,fill:t.backgroundColor,offsetY:-O}),se.createElement(dp,{data:T,stroke:"red",strokeWidth:1,x:t.a.x,y:t.a.y,rotation:t.a.rotation,visible:!1}),se.createElement(AP,Object.assign({ref:n,visible:t.curveEnabled,data:T,text:x||t.placeholder,listening:!1,align:"center",textBaseline:"middle"},I,{stroke:t.stroke,strokeWidth:t.strokeWidth,lineJoin:"round",fillAfterStrokeEnabled:!0,fontSize:t.a.fontSize,fontFamily:`"${t.fontFamily}", "${g}"`,fontStyle:t.fontStyle+" "+t.fontWeight,letterSpacing:t.letterSpacing*t.a.fontSize,x:t.a.x,y:t.a.y,rotation:t.a.rotation,opacity:t._editModeEnabled?.3:A,hideInExport:!t.showInExport})),se.createElement(Du,Object.assign({ref:r,id:t.id,name:"element",hideInExport:!t.showInExport,editModeEnabled:t._editModeEnabled,x:t.a.x,y:t.a.y,rotation:t.a.rotation,width:t.a.width,height:t.a.height,text:x||t.placeholder,direction:H0(x)},I,{stroke:t.stroke,lineJoin:"round",strokeWidth:t.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:t.a.fontSize,fontFamily:$,fontStyle:t.fontStyle+" "+t.fontWeight,textDecoration:t.textDecoration,align:t.align,verticalAlign:t.verticalAlign,draggable:j?t.draggable&&f:t.draggable,preventDefault:!j||f,opacity:t.curveEnabled?0:A,visible:!t._editModeEnabled,ellipsis:Si.textOverflow==="ellipsis",shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,lineHeight:M,letterSpacing:t.letterSpacing*t.a.fontSize,listening:C,onDragMove:q=>{t.set({x:q.target.x(),y:q.target.y()})},onDragEnd:q=>{t.set({x:q.target.x(),y:q.target.y()})},onClick:S,onTap:S,onTransformStart:()=>{u(!0),h.current=r.current.height()},onTransform:q=>{var J,ae,ie;const Z=q.target;(J=i.current)===null||J===void 0||J.setAttrs({x:Z.x(),y:Z.y(),rotation:Z.rotation(),scale:Z.scale()});const te=((ae=Z.getStage())===null||ae===void 0?void 0:ae.findOne("Transformer")).getActiveAnchor();if(te==="middle-left"||te==="middle-right"){const B=Z.scaleX(),D=Z.width()*B,U=t.a.fontSize;let X=D;D<U&&(X=U,E.current&&Z.position(E.current)),Z.width(X),Z.scaleX(1),Z.scaleY(1);const ee=b();if(Si.textOverflow!=="ellipsis"){const oe=Math.max(ee,h.current);Z.height(oe),t.set({height:Z.height()})}const K=Si.textVerticalResizeEnabled?Math.max(ee,h.current):b();t.set({x:Z.x(),width:Z.width(),rotation:Z.rotation(),height:K}),Ts(Z,t)}if(te==="top-center"||te==="bottom-center"){let B=Si.textOverflow==="resize"?b():M*t.a.fontSize;q.target.height(Math.max(B,q.target.height()*q.target.scaleY())),q.target.scaleY(1)}E.current=q.target.position();const V=q.target.scaleX();(ie=i.current)===null||ie===void 0||ie.setAttrs({scaleX:1,scaleY:1}),q.target.scaleX(1),q.target.scaleY(1),t.set({fontSize:t.a.fontSize*V,width:q.target.width()*V,x:q.target.x(),y:q.target.y(),rotation:q.target.rotation(),height:q.target.height()*V,shadowBlur:t.shadowBlur*V,shadowOffsetX:t.shadowOffsetX*V,shadowOffsetY:t.shadowOffsetY*V,strokeWidth:t.strokeWidth*V})},onTransformEnd:q=>{var J;const ae=q.target.scaleX();q.target.scaleX(1),q.target.scaleY(1),t.set({fontSize:Math.round(t.a.fontSize*ae),width:Math.ceil(q.target.width()*ae),x:q.target.x(),y:q.target.y(),rotation:q.target.rotation(),height:q.target.height()*ae,shadowBlur:t.shadowBlur*ae,shadowOffsetX:t.shadowOffsetX*ae,shadowOffsetY:t.shadowOffsetY*ae,strokeWidth:t.strokeWidth*ae}),(J=i.current)===null||J===void 0||J.setAttrs({scaleX:1,scaleY:1}),u(!1)}})),a&&se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation},se.createElement(WC,{textNodeRef:r,element:t,selectAll:o,cursorPosition:k.current,onBlur:()=>{t.toggleEditMode(!1)}})))});var r2={exports:{}},n2={exports:{}},j3;function iy(){return j3||(j3=1,function(t,e){t.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
107
+ `)}}(n2)),n2.exports}var D3;function E7(){return D3||(D3=1,function(t,e){iy()("lex"),t.exports=r;function r(n){var i="",a,o=0,s=-1,u=0,h=1,f="before-selector",v=[f],g={},p=[],y=["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 _(){return I(),n[s]}function x(ie){return ie?v[v.length-1-ie]:f}function b(ie){var Z=s+1;return ie===n.slice(Z,Z+ie.length)}function E(ie){var Z=n.slice(s).indexOf(ie);return Z>0?Z:!1}function k(ie){return ie===S(1)}function S(ie){return n[s+(ie||1)]}function A(){var ie=v.pop();return f=v[v.length-1],ie}function M(ie){return f=ie,v.push(f),v.length}function C(ie){var Z=f;return v[v.length-1]=f=ie,Z}function I(ie){if((ie||1)==1)n[s]==`
108
+ `?(h++,o=1):o++,s++;else{var Z=n.slice(s,s+ie).split(`
109
+ `);Z.length>1&&(h+=Z.length-1,o=1),o+=Z[Z.length-1].length,s=s+ie}}function F(){g.end={line:h,col:o},p.push(g),i="",g={}}function j(ie){g={type:ie,start:{line:h,col:o}}}for(;a=_();)switch(a){case" ":switch(x()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
110
+ `:case" ":case"\r":case"\f":switch(x()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
111
+ `&&(g.value=i.trim(),F(),A());break}break;case":":switch(x()){case"name":g.name=i.trim(),i="",C("before-value");break;case"before-selector":i+=a,j("selector"),M("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a;break}break;case";":switch(x()){case"name":case"before-value":case"value":i.trim().length>0&&(g.value=i.trim(),F()),C("before-name");break;case"value-paren":i+=a;break;case"at-value":g.value=i.trim(),F(),A();break;case"before-name":break;default:i+=a;break}break;case"{":switch(x()){case"selector":if(S(-1)==="\\"){i+=a;break}g.text=i.trim(),F(),C("before-name"),u=u+1;break;case"at-group":switch(g.name=i.trim(),g.type){case"font-face":case"viewport":case"page":M("before-name");break;default:M("before-selector")}F(),u=u+1;break;case"name":case"at-rule":g.name=i.trim(),F(),M("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":C("value"),i+=a;break}break;case"}":switch(x()){case"before-name":case"name":case"before-value":case"value":i&&(g.value=i.trim()),g.name&&g.value&&F(),j("end"),F(),A(),x()==="at-group"&&(j("at-group-end"),F(),A()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(S(-1)==="\\"){i+=a;break}u>0&&x(1)==="at-group"&&(j("at-group-end"),F()),u>1&&A(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(x()){case"double-string":a==='"'&&S(-1)!=="\\"&&A();break;case"single-string":a==="'"&&S(-1)!=="\\"&&A();break;case"before-at-value":C("at-value"),M(a==='"'?"double-string":"single-string");break;case"before-value":C("value"),M(a==='"'?"double-string":"single-string");break;case"comment":break;default:S(-1)!=="\\"&&M(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(k("*")){var O=E("*/");O&&I(O+1)}else x()=="before-value"&&C("value"),i+=a;break;default:k("*")?(j("comment"),M("comment"),I()):i+=a;break}break;case"*":switch(x()){case"comment":k("/")?(g.text=i,I(),F(),A()):i+=a;break;case"before-selector":i+=a,j("selector"),M("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a}break;case"@":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":C("value"),i+=a;break;default:for(var T=!1,$,q,J=0,ae=y.length;!T&&J<ae;++J)q=y[J],$=q.name||q,b($)&&(T=!0,j($),M(q.state||"at-group"),I($.length),q.prefix&&(g.prefix=q.prefix),q.type&&(g.type=q.type));T||(i+=a);break}break;case"(":switch(x()){case"value":M("value-paren");break;case"before-value":C("value");break}i+=a;break;case")":switch(x()){case"value-paren":A();break;case"before-value":C("value");break}i+=a;break;default:switch(x()){case"before-selector":j("selector"),M("selector");break;case"before-name":j("property"),C("name");break;case"before-value":C("value");break;case"before-at-value":C("at-value");break}i+=a;break}return p}}(r2)),r2.exports}var i2={exports:{}},F3;function YC(){return F3||(F3=1,function(t,e){iy()("parse");var r=E7();t.exports=s;var n,i,a,o;function s(A,M){M||(M={}),n=!!M.comments,a=!!M.position,i=0,o=Array.isArray(A)?A.slice():r(A);for(var C,I=[],F;F=h();)C=b(F),C&&I.push(C);return{type:"stylesheet",stylesheet:{rules:I}}}function u(A,M){M||(M={});for(var C,I=["type","name","value"],F={},j=0;j<I.length;++j)C=I[j],A[C]&&(F[C]=M[C]||A[C]);for(I=Object.keys(M),j=0;j<I.length;++j)C=I[j],F[C]||(F[C]=M[C]);return a&&(F.position={start:A.start,end:A.end}),F}function h(){var A=o.shift();return A}function f(A){i=i+1;var M={};switch(A.type){case"font-face":case"viewport":M.declarations=k();break;case"page":M.prefix=A.prefix,M.declarations=k();break;default:M.prefix=A.prefix,M.rules=S()}return u(A,M)}function v(A){return u(A)}function g(A){return u(A)}function p(A){return u(A,{text:A.text})}function y(A){return u(A)}function _(A){return u(A)}function x(A){function M(C){return C.trim()}return u(A,{type:"rule",selectors:A.text.split(",").map(M),declarations:k()})}function b(A){switch(A.type){case"property":return _(A);case"selector":return x(A);case"at-group-end":i=i-1;return;case"media":case"keyframes":return f(A);case"comment":if(n)return p(A);break;case"charset":return g(A);case"import":return v(A);case"namespace":return y(A);case"font-face":case"supports":case"viewport":case"document":case"page":return f(A)}}function E(A){for(var M,C=[],I;(I=h())&&A&&A(I);)M=b(I),M&&C.push(M);return I&&I.type!=="end"&&o.unshift(I),C}function k(){return E(function(A){return A.type==="property"||A.type==="comment"})}function S(){return E(function(){return i})}}(i2)),i2.exports}var a2={exports:{}},B3;function XC(){return B3||(B3=1,function(t,e){iy()("stringify");var r,n,i,a,o,s;t.exports=u;function u(S,A){A||(A={}),i=A.indentation||"",n=!!A.compress,r=!!A.comments,a=1,n?o=s="":(o=`
112
+ `,s=" ");var M=y(S.stylesheet.rules,E).join(`
113
+ `).trim();return M}function h(S){if(S){a+=S;return}return n?"":Array(a).join(i||"")}function f(S){return"@"+S.type+" "+S.value+";"+o}function v(S){var A="",M=S.prefix||"";S.name&&(A=" "+S.name);var C=S.type!=="page";return"@"+M+S.type+A+s+_(S,C)+o}function g(S){return r?"/*"+(S.text||"")+"*/"+o:""}function p(S){var A;return S.selectors?A=S.selectors.join(","+o):(A="@"+S.type,A+=S.name?" "+S.name:""),h()+A+s+_(S)+o}function y(S,A){return S.reduce(function(M,C){var I=C.type==="comment"?g(C):A(C);return I&&M.push(I),M},[])}function _(S,A){var M=S.declarations,C=b;return S.rules&&(M=S.rules,C=p),M=x(M,C),M&&(M=o+M+(A?"":o)),"{"+M+h()+"}"}function x(S,A){if(!S)return"";h(1);var M=y(S,A);return h(-1),M.length?M.join(o):""}function b(S){if(S.type==="property")return k(S)}function E(S){switch(S.type){case"rule":return p(S);case"media":case"keyframes":return v(S);case"comment":return g(S);case"import":case"charset":case"namespace":return f(S);case"font-face":case"supports":case"viewport":case"document":case"page":return v(S)}}function k(S){var A=S.name?S.name+":"+s:"";return h()+A+S.value+";"}}(a2)),a2.exports}var o2,z3;function KC(){return z3||(z3=1,o2={lex:E7(),parse:YC(),stringify:XC()}),o2}var ZC=KC();const QC=ch(ZC);function JC(t){for(;t.parentNode;){if(t.nodeName==="defs")return!0;t=t.parentNode}return!1}function eL(t){const e={};return t.querySelectorAll("style").forEach(r=>{const n=QC.parse(r.textContent).stylesheet.rules;for(let i of n)i.selectors&&i.selectors.forEach(a=>{const o=e[a]||{};i.declarations.forEach(s=>{o[s.name]=s.value}),e[a]=o})}),e}function A7(t,e){var r;const n={fill:"",stroke:""},i=((r=t.getAttribute("class"))===null||r===void 0?void 0:r.split(" "))||[],a=t.getAttribute("id");let o={};if(a&&e[`#${a}`]?o=e[`#${a}`]:i.forEach(s=>{e[`.${s}`]&&(o=Object.assign(Object.assign({},o),e[`.${s}`]))}),e[t.nodeName]&&(o=Object.assign(Object.assign({},o),e[t.nodeName])),t.getAttribute("fill")&&t.getAttribute("fill")!=="none"?n.fill=t.getAttribute("fill"):o.fill&&o.fill!=="none"&&(n.fill=o.fill),t.getAttribute("stroke")&&t.getAttribute("stroke")!=="none"?n.stroke=t.getAttribute("stroke"):o.stroke&&o.stroke!=="none"&&(n.stroke=o.stroke),!n.fill&&t.style.fill&&t.style.fill!=="none"&&(n.fill=t.style.fill),!n.stroke&&t.style.stroke&&t.style.stroke!=="none"&&(n.stroke=t.style.stroke),!n.stroke&&!n.fill){const s=t.ownerSVGElement,u=s&&s!==t&&A7(s,e);u?.fill==="currentColor"||u?.stroke==="currentColor"||(n.fill="black")}return n}const tL=["path","rect","circle","line","polygon","polyline","ellipse","text"];function rL(t){for(var e=[],r=t.getElementsByTagName("*"),n=0,i=r.length;n<i;n++){const a=r[n];JC(a)||(a.getAttribute("fill")!==null&&e.push(a),(a.getAttribute("stroke")!==null||a.style&&a.style.fill||tL.indexOf(a.nodeName)>=0)&&e.push(a))}return e}async function nL(t){const e=await fetch(t);return wh(await e.text())}async function Rp(t){return await(await fetch(t,{mode:"cors"})).text()}function wh(t){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(t)))}function ay(t){var e=new DOMParser().parseFromString(t,"image/svg+xml");const r=e.documentElement.getAttribute("viewBox"),[n,i,a,o]=r?.split(" ")||[],s=e.documentElement.getAttribute("width");!s&&e.documentElement.setAttribute("width",a+"px");const u=e.documentElement.getAttribute("height");if((!u||u.indexOf("%")>=0)&&e.documentElement.setAttribute("height",o+"px"),s&&s.indexOf("%")>=0&&u&&u.indexOf("%")===-1){const h=parseFloat(u)/parseFloat(o);e.documentElement.setAttribute("width",h*parseFloat(a)+"px")}if(u&&u.indexOf("%")>=0&&s&&s.indexOf("%")===-1){const h=parseFloat(s)/parseFloat(a);e.documentElement.setAttribute("height",h*parseFloat(o)+"px")}return s==="100%"&&u==="100%"&&(e.documentElement.setAttribute("width",a+"px"),e.documentElement.setAttribute("height",o+"px")),new XMLSerializer().serializeToString(e)}const iL=(t,e)=>{if(!t||!e)return!1;if(e==="currentColor"&&t==="black")return!0;const r=or.Util.colorToRGBA(t),n=or.Util.colorToRGBA(e);return r&&n?r.r===n.r&&r.g===n.g&&r.b===n.b&&r.a===n.a:void 0};function oy(t,e){var r=new DOMParser().parseFromString(t,"image/svg+xml");const n=rL(r),i=Array.from(e.keys()),a=eL(r);return n.forEach(o=>{const{fill:s,stroke:u}=A7(o,a);[{prop:"fill",color:s},{prop:"stroke",color:u}].forEach(({prop:h,color:f})=>{const v=i.find(g=>iL(g,f));if(v){const g=e.get(v);if(B0(g)){const{rotation:p,stops:y}=M8(g),_=y.map(b=>({offset:100*b.offset+"%","stop-color":b.color})),x="color"+Math.round(1e8*Math.random());(function(b,E,k,S){var A=b.namespaceURI,M=document.createElementNS(A,"linearGradient");const C=or.Util.degToRad(k+90),I=(Math.cos(C)+1)/2,F=(Math.sin(C)+1)/2,j=(Math.cos(C+Math.PI)+1)/2,O=(Math.sin(C+Math.PI)+1)/2;M.setAttribute("x1",100*I+"%"),M.setAttribute("y1",100*F+"%"),M.setAttribute("x2",100*j+"%"),M.setAttribute("y2",100*O+"%"),M.setAttribute("gradientUnits","userSpaceOnUse"),M.setAttribute("id",E);for(var T=0;T<S.length;T++){var $=S[T],q=document.createElementNS(A,"stop");for(var J in $)$.hasOwnProperty(J)&&q.setAttribute(J,$[J]);M.appendChild(q)}(b.querySelector("defs")||b.insertBefore(document.createElementNS(A,"defs"),b.firstChild)).appendChild(M)})(r.children[0],x,p,_),o.style[h]=null,o.setAttribute(h,`url('#${x}')`)}else o.style[h]=e.get(v)}})}),wh(new XMLSerializer().serializeToString(r))}const sy=(t,e,r)=>{let n=e,i=r,a=1;for(;n>0&&i>0;){t.width=n,t.height=i;const o=t.getContext("2d");if(!o)return;if(o.fillStyle="rgba(0,0,0,0.1)",o.fillRect(0,0,1,1),o.getImageData(0,0,1,1).data[3]!==0)return void o.clearRect(0,0,t.width,t.height);if(a*=.9,n=Math.floor(e*a),i=Math.floor(r*a),n=Math.max(n,1),i=Math.max(i,1),n<=1&&i<=1)return t.width=1,void(t.height=1)}},gm=(t,e=100,r=!1,n)=>{const i=se.useRef(n??t),[,a]=se.useReducer(u=>u+1,0),o=se.useCallback(u=>{i.current!==u&&(i.current=u,a())},[i]),s=se.useRef(null);return t===r&&(s.current&&(clearTimeout(s.current),s.current=null),i.current=r),se.useEffect(()=>(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o(t),s.current=null},e),()=>{s.current&&clearTimeout(s.current)}),[t,e,r]),[i.current,o]};function Zf(){return document.createElement("canvas")}const k7=t=>t.indexOf("data:image/svg+xml")>=0||t.indexOf(".svg")>=0,q3=t=>{const[e,r]=se.useState(t);return se.useEffect(()=>{(async()=>{const n=await async function(i){if(!k7(i))return i;const a=await Rp(i),o=ay(a);return wh(o)}(t);n!==e&&r(n)})()},[t]),e};function U3(t,e){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}const aL={boundBoxFunc:(t,e)=>e.width<5||e.height<5?t:e,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2},oL={boundBoxFunc:(t,e)=>e.width<5||e.height<5?t:e,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},H3=(t,e,r)=>Math.max(e,Math.min(r,t)),sL=(t,e,r,n,i=0,a=!1,o=!0)=>{const s=Math.floor(H3(t.a.width*n,1,1e4)),u=Math.floor(H3(t.a.height*n,1,1e4)),h=Math.min(i*n,s/2,u/2),f=Math.max(t.a.width/r.width,t.a.height/r.height)*n,v=t.page._exportingOrRendering&&Si.imageDownScalingEnabled&&f<1&&!a,g=r.x===0&&r.y===0&&r.width===e?.width&&r.height===e?.height,p=se.useMemo(()=>{if(e&&e.width&&e.height)return g&&h===0&&!v?void 0:Zf()},[e,h,v,g]);return se.useLayoutEffect(()=>{if(!p||!e)return;sy(p,s,u);const y=p.getContext("2d");if(!y)return;h&&(y.beginPath(),y.moveTo(h,0),y.lineTo(s-h,0),y.arc(s-h,h,h,3*Math.PI/2,0,!1),y.lineTo(s,u-h),y.arc(s-h,u-h,h,0,Math.PI/2,!1),y.lineTo(h,u),y.arc(h,u-h,h,Math.PI/2,Math.PI,!1),y.lineTo(0,h),y.arc(h,h,h,Math.PI,3*Math.PI/2,!1),y.clip());const _=v?function(b,E){var k,S;const A=Zf();A.width=b.width,A.height=b.height;const M=Math.max(1,Math.floor(A.width*E)),C=Math.max(1,Math.floor(A.height*E));(k=A.getContext("2d"))===null||k===void 0||k.drawImage(b,0,0,A.width,A.height);const I=function(F,j,O,T,$,q,J){for(var ae=new ImageData(j,O),ie=new Int32Array(F.data.buffer),Z=F.width,te=new Int32Array(ae.data.buffer),V=ae.width,B=j/q,D=O/J,U=Math.round(1/B),X=Math.round(1/D),ee=U*X,K=0;K<ae.height;K++)for(var oe=0;oe<V;oe++){for(var me=0+Math.round(oe/B)+(0+Math.round(K/D))*Z,de=0,ye=0,Te=0,Ce=0,Ie=0;Ie<X;Ie++)for(var Ee=0;Ee<U;Ee++){var ge=ie[me+Ee+Ie*Z];de+=ge<<24>>>24,ye+=ge<<16>>>24,Te+=ge<<8>>>24,Ce+=ge>>>24}de=Math.round(de/ee),ye=Math.round(ye/ee),Te=Math.round(Te/ee),Ce=Math.round(Ce/ee),te[oe+K*V]=Ce<<24|Te<<16|ye<<8|de}return ae}(A.getContext("2d").getImageData(0,0,A.width,A.height),M,C,0,0,A.width,A.height);return A.width=M,A.height=C,(S=A.getContext("2d"))===null||S===void 0||S.putImageData(I,0,0),A}(e,f):e,x=v?{x:Math.floor(r.x*f),y:Math.floor(r.y*f),width:Math.floor(r.width*f),height:Math.floor(r.height*f)}:r;y.drawImage(_,x.x,x.y,x.width,x.height,0,0,p.width,p.height)},[p,t.a.width,t.a.height,r.x,r.y,r.width,r.height,i,n,a,t.page._exportingOrRendering,v]),se.useEffect(()=>()=>{p&&p.nodeName==="CANVAS"&&or.Util.releaseCanvas(p)},[p]),p||e},lL=Zf(),uL=ni(({element:t})=>{const e=Math.min(30,t.a.width/4,t.a.height/4),r=se.useRef(null);return se.useEffect(()=>{const n=r.current;if(!n)return;const i=new or.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),se.createElement(bn,{x:t.x,y:t.y,rotation:t.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.a.width,height:t.a.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(Zm,{ref:r,x:t.a.width/2,y:t.a.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),cL=ni(({element:t})=>{const e=Math.max(10,Math.min(30,t.a.width/25));return se.createElement(bn,{x:t.x,y:t.y,rotation:t.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.a.width,height:t.a.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Du,{text:"Can not load the image...",fontSize:e,width:t.a.width,height:t.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let s2=Qm;const ip=(t,e="",r="")=>{const n=se.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};se.useEffect(()=>i,[]),se.useLayoutEffect(()=>{const a=e.slice(0,200),o=`image with id ${r} url: ${a}`;t!=="loading"||n.current||(n.current=fd(o)),t!=="loading"&&i(),t==="failed"&&Np(o)},[t])},$3=ni(({element:t,store:e})=>{var r;const[n,i]=se.useState(!1),a=se.useRef(null),o=se.useRef(null),s=e.selectedShapes.indexOf(t)>=0&&t.selectable,[u,h]=(Re=>{const[Be,Oe]=se.useReducer(ke=>ke+1,0),fe=se.useRef("loading"),Le=se.useRef(Re.src),Ne=se.useRef(Re.src);Ne.current!==Re.src&&(Ne.current=Re.src,fe.current="loading");const ue=se.useMemo(()=>k7(Re.src)||Re.type==="svg",[Re.src,Re.type]);return se.useEffect(()=>{if(!ue||!Re.src)return;let ke=!1;return(async()=>{fe.current="loading",Oe();const Pe=await Rp(Re.src),Ue=ay(Pe);let st;st=Re.colorsReplace?oy(Ue,Re.colorsReplace||new Map):wh(Ue),ke||(Le.current=st,fe.current="loaded",Oe())})(),()=>{ke=!0}},[Re.src,JSON.stringify(Re.colorsReplace)]),ue?[Le.current,fe.current]:[Re.src,"loaded"]})(t),[f,v]=s2(u,"anonymous"),g=t.type!=="svg"||h==="loaded"?v:"loading";ip(g,t.src,t.id);const p=t.page._exportingOrRendering?1:Math.max(1,e.scale),y=e._elementsPixelRatio*p,_=(({image:Re,status:Be,type:Oe})=>{const fe=se.useRef();return se.useEffect(()=>{fe.current=Re||fe.current},[Re]),Be!=="failed"||Be!=="failed"&&Oe==="svg"?fe.current:void 0})({image:f,status:v,type:t.type}),x=((Re,Be,Oe)=>{const fe=se.useMemo(()=>{var Le,Ne;const{flipX:ue,flipY:ke}=Re,Pe=Re.type==="svg"||Re.src.indexOf("data:image/svg+xml")>=0||Re.src.indexOf(".svg")>=0,Ue=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,st=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Ue)&&Pe||Re.maskSrc;if(!ue&&!ke&&!st)return Be;if(!Be||!Be.width||!Be.height)return null;const dt=Zf();let pt=1;Re.type==="svg"&&(pt=Math.max(Re.a.width/Be.width*Oe,Re.a.height/Be.height*Oe)),sy(dt,Math.max(Be.width*pt,1),Math.max(Be.height*pt,1));let xt=ue?-dt.width:0,bt=ke?-dt.height:0;return(Le=dt.getContext("2d"))===null||Le===void 0||Le.scale(ue?-1:1,ke?-1:1),(Ne=dt.getContext("2d"))===null||Ne===void 0||Ne.drawImage(Be,xt,bt,dt.width,dt.height),dt},[Re.maskSrc,Re.flipX,Re.flipY,Be,Re.a.width,Re.a.height,Oe]);return se.useEffect(()=>()=>{fe&&fe.nodeName==="CANVAS"&&or.Util.releaseCanvas(fe)},[fe]),fe})(t,f||_,y),b=((Re,Be)=>{const Oe=q3(Re.maskSrc||""),[fe,Le]=s2(Oe,"anonymous");return ip(Oe?Le:"loaded",Oe||"",Re.id),se.useMemo(()=>{if(!fe||!Be||!Be.width||!Be.height)return Be;const Ne=Zf();Ne.width=Math.max(Be.width,1),Ne.height=Math.max(Be.height,1);const ue=Ne.getContext("2d");if(!ue)return Be;ue.drawImage(Be,0,0),ue.globalCompositeOperation="source-in";const ke=function(Pe,Ue){const st=Ue.width/Ue.height;let dt,pt;return st>=Pe.width/Pe.height?(dt=Pe.width,pt=Pe.width/st):(dt=Pe.height*st,pt=Pe.height),{x:(Pe.width-dt)/2,y:(Pe.height-pt)/2,width:dt,height:pt}}(fe,Re);return ue.drawImage(fe,ke.x,ke.y,ke.width,ke.height,0,0,Be.width,Be.height),Ne},[Be,fe,Re.a.width,Re.a.height])})(t,x)||lL;let{cropX:E,cropY:k,cropWidth:S,cropHeight:A}=t.a;v!=="loaded"&&(E=k=0,S=A=1);const M=b.width*S,C=b.height*A,I=t.a.width/t.a.height;let F,j;const O=M/C,T=t.stretchEnabled;T?(F=M,j=C):I>=O?(F=M,j=M/I):(F=C*I,j=C);const $={x:b.width*E,y:b.height*k,width:F,height:j},q=(r=t.cornerRadius)!==null&&r!==void 0?r:0,J=t.page._exportingOrRendering?1:Math.min(2,e.scale),ae=e._elementsPixelRatio*J;let ie=((Re,Be,Oe,fe)=>{const Le=q3(Re.clipSrc||""),[Ne,ue]=s2(Le,"anonymous"),ke=Re.clipSrc?ue:"loaded";ip(ke,Re.clipSrc,Re.id);const Pe=se.useMemo(()=>{if(Be&&Ne)return Zf()},[Be,Ne]);return se.useLayoutEffect(()=>{var Ue;if(!Ne||!Be||!Be.width||!Be.height||!Ne||!Ne.width||!Ne.height||!Pe)return;const st=Zf(),dt=Math.max(Re.a.width/Ne.width*Oe,Re.a.height/Ne.height*Oe);st.width=Math.max(Ne.width*dt,1),st.height=Math.max(Ne.height*dt,1),(Ue=st.getContext("2d"))===null||Ue===void 0||Ue.drawImage(Ne,0,0,st.width,st.height),Pe.width=Math.max(Be.width,1),Pe.height=Math.max(Be.height,1);const pt=Pe.getContext("2d");pt&&(pt.save(),pt.drawImage(st,0,0,Be.width,Be.height),or.Util.releaseCanvas(st),pt.globalCompositeOperation="source-in",pt.drawImage(Be,0,0,Pe.width,Pe.height),pt.restore())},[Pe,Be,Ne,Re.a.width,Re.a.height,Oe,...fe]),Re.clipSrc&&Ne?Pe:Be})(t,sL(t,b,$,ae,q,n||t._cropModeEnabled||t.type==="svg",!0),ae,[$,q,ae]);const Z=Math.max(t.a.width/F,t.a.height/j);se.useEffect(()=>{var Re;if(!t._cropModeEnabled)return;const Be=(Re=a.current)===null||Re===void 0?void 0:Re.getStage();function Oe(Le){t._cropModeEnabled&&Le.target!==o.current&&t.toggleCropMode(!1)}function fe(Le){t._cropModeEnabled&&Le.target.parentNode!==Be.content&&t.toggleCropMode(!1)}return document.body.addEventListener("click",fe),Be?.on("click",Oe),Be?.on("tap",Oe),()=>{document.body.removeEventListener("click",fe),document.body.removeEventListener("touchstart",fe),Be?.off("click",Oe),Be?.off("click",Oe)}},[t._cropModeEnabled]),se.useLayoutEffect(()=>{if(!n&&!t._cropModeEnabled)return Ts(a.current,t),Bu(()=>{Ts(a.current,t)},{delay:100})},[ie,t.page._exportingOrRendering,n,S,A,t._cropModeEnabled]),se.useLayoutEffect(()=>{var Re;n||t._cropModeEnabled?(Re=a.current)===null||Re===void 0||Re.clearCache():Ts(a.current,t)},[n,t.a.width,t.a.height,t._cropModeEnabled]),se.useEffect(()=>{Ts(a.current,t)},[t.shadowEnabled,t.shadowBlur,t.cornerRadius,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]);const te=se.useRef(null),V=se.useRef(null),B=se.useRef(null);se.useLayoutEffect(()=>{t._cropModeEnabled&&(V.current.nodes([te.current]),B.current.nodes([o.current]))},[t._cropModeEnabled]);var D=se.useRef(null),U=se.useRef(0),X=se.useRef(!1);const ee=Re=>{var Be;((Be=Re.evt.touches)===null||Be===void 0?void 0:Be.length)>2&&Re.target.stopDrag(),Math.round(Re.target.x())>0&&(Re.target.x(0),Re.target.scaleX(1)),Math.round(Re.target.y())>0&&(Re.target.y(0),Re.target.scaleY(1));const Oe=Re.target.width()*Re.target.scaleX(),fe=Re.target.height()*Re.target.scaleY(),Le=Math.min(1,F/Oe),Ne=Math.min(1,j/fe),ue=1-Le,ke=Math.min(ue,Math.max(0,Math.round(-Re.target.x())/Oe)),Pe=1-Ne,Ue=Math.min(Pe,Math.max(0,Math.round(-Re.target.y())/fe));Re.target.setAttrs({x:-ke*b.width,y:-Ue*b.height,scaleX:1,scaleY:1}),t.set({cropX:ke,cropY:Ue,cropWidth:Le,cropHeight:Ne})},K=()=>{t.type!=="svg"&&t.contentEditable&&(t.stretchEnabled||setTimeout(()=>{t.toggleCropMode(!0)}))},oe=t.type==="svg"&&_,me=v==="loading"&&!oe,[de]=gm(me,100,!1,!1),ye=v==="failed",Te=!de&&!ye,Ce=se.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Ie=Te?t.a.opacity:0;Lp(a,Ie);const Ee=t.selectable||e.role==="admin",ge=Of();return se.createElement(se.Fragment,null,de&&se.createElement(uL,{element:t}),ye&&se.createElement(cL,{element:t}),se.createElement(Nu,{ref:a,name:"element",id:t.id,image:ie,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:Ie,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:$,listening:Ee,draggable:ge?t.draggable&&s:t.draggable,preventDefault:!ge||s,hideInExport:!t.showInExport,onDragMove:Re=>{t.set({x:Re.target.x(),y:Re.target.y()})},onDragEnd:Re=>{t.set({x:Re.target.x(),y:Re.target.y()})},onDblClick:K,onDblTap:K,onTransformStart:()=>{i(!0),Ce.current={cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}},onTransform:Re=>{var Be;const Oe=Re.currentTarget,fe=Math.abs(Oe.scaleX()-1)<1e-7?1:Oe.scaleX(),Le=Math.abs(Oe.scaleY()-1)<1e-7?1:Oe.scaleY();Oe.scaleX(1),Oe.scaleY(1);const Ne=(Be=Re.target.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer"),ue=1-F/b.width,ke=Math.min(ue,Math.max(0,t.cropX)),Pe=1-j/b.height,Ue=Math.min(Pe,Math.max(0,t.cropY)),st=Ne.getActiveAnchor(),dt=!(st.indexOf("middle")>=0||st.indexOf("center")>=0),pt=!dt&&fe<1&&Ce.current.cropHeight>j/b.height;let xt=dt?t.cropWidth:t.cropWidth*fe;pt&&(xt=t.cropWidth);const bt=!dt&&Le<1&&Ce.current.cropWidth>F/b.width;let At=dt?t.cropHeight:t.cropHeight*Le;bt&&(At=t.cropHeight),T&&(xt=t.cropWidth,At=t.cropHeight),t.set({cropX:ke,cropY:Ue,x:Oe.x(),y:Oe.y(),width:Oe.width()*fe,height:Oe.height()*Le,rotation:Re.target.rotation(),cropWidth:Math.min(xt,1-ke),cropHeight:Math.min(At,1-Ue)})},onTransformEnd:Re=>{const Be=Re.currentTarget;t.set({width:Be.width(),height:Be.height(),x:Be.x(),y:Be.y(),rotation:Re.target.rotation(),cropWidth:F/b.width,cropHeight:j/b.height}),i(!1)}}),se.createElement(Tn,{x:t.x,y:t.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:Ie,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,q-t.borderSize),hideInExport:!t.showInExport}),t._cropModeEnabled&&se.createElement(Jm,{selector:".page-abs-container",enabled:!0},se.createElement(Tn,{x:-window.innerWidth/e.scale,y:-window.innerWidth/e.scale,width:window.innerWidth/e.scale*3,height:window.innerWidth/e.scale*3,fill:"rgba(0,0,0,0.3)"}),se.createElement(Nu,{listening:!1,image:ie,x:t.x,y:t.y,width:t.a.width,height:t.a.height,rotation:t.rotation,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur}),se.createElement(bn,{x:t.x,y:t.y,rotation:t.rotation,scaleX:Z,scaleY:Z},se.createElement(Nu,{image:b,ref:o,opacity:.4,draggable:!0,x:-t.cropX*b.width,y:-t.cropY*b.height,onDragMove:ee,onTransform:ee,onTouchMove:Re=>{Re.evt.preventDefault();const Be=Re.target.getStage().getPointersPositions();var Oe=Be[0],fe=Be[1];const Le=Re.target;if(Oe&&!fe&&!Le.isDragging()&&X.current&&(Le.startDrag(),X.current=!1),Oe&&fe){or.hitOnDragEnabled=!0,Le.isDragging()&&(X.current=!0,Le.stopDrag());const bt=Re.target.getAbsoluteTransform().copy();bt.invert();var Ne={x:Oe.x,y:Oe.y},ue={x:fe.x,y:fe.y};if(!D.current)return void(D.current=U3(Ne,ue));var ke=U3(Ne,ue),Pe=function(It,Jt){return Math.sqrt(Math.pow(Jt.x-It.x,2)+Math.pow(Jt.y-It.y,2))}(Ne,ue);U.current||(U.current=Pe);const At=Le.position();var Ue={x:ke.x-At.x,y:ke.y-At.y},st=Pe/U.current;Le.scaleX(st),Le.scaleY(st);const Br=bt.point(ke),_r=bt.point(D.current);var dt=Br.x-_r.x,pt=Br.y-_r.y,xt={x:Math.min(0,ke.x-Ue.x*st+dt),y:Math.min(0,ke.y-Ue.y*st+pt)};Le.position(xt),U.current=Pe,D.current=ke,ee(Re)}},onTouchEnd:Re=>{U.current=0,D.current=null,or.hitOnDragEnabled=!1}}),se.createElement(pp,Object.assign({ref:B},oL)),se.createElement(Tn,{width:F,height:j,ref:te,listening:!1,onTransform:Re=>{if(t.cropX<Math.abs(Re.target.x()/b.width)&&Re.target.x()<0&&t.cropX>0){const Pe=(t.cropWidth+t.cropX)*b.width;Re.target.scaleX(1),Re.target.width(Pe)}if(t.cropY<Math.abs(Re.target.y()/b.height)&&Re.target.y()<0&&t.cropY>0){const Pe=(t.cropHeight+t.cropY)*b.height;Re.target.scaleY(1),Re.target.height(Pe)}Re.target.x()<-t.cropX*b.width-1e-9&&(Re.target.x(-t.cropX*b.width),Re.target.scaleX(1)),Re.target.y()<-t.cropY*b.height-1e-9&&(Re.target.y(-t.cropY*b.height),Re.target.scaleY(1));const Be=Math.min(1,Math.max(0,t.cropX+Re.target.x()/b.width)),Oe=Math.min(1,Math.max(0,Re.target.y()/b.height+t.cropY)),fe=Re.target.width()*Re.target.scaleX(),Le=Re.target.height()*Re.target.scaleY(),Ne=Math.min(1-Be,fe/b.width),ue=Math.min(1-Oe,Le/b.height),ke=Re.target.getAbsolutePosition(Re.target.getParent().getParent());Re.target.scale({x:1,y:1}),Re.target.position({x:0,y:0}),t.set({x:ke.x,y:ke.y,cropX:Be,cropY:Oe,cropWidth:Ne,cropHeight:ue,width:Math.min(fe*Z,b.width*(1-Be)*Z),height:Math.min(Le*Z,b.height*(1-Oe)*Z)})}}),se.createElement(pp,Object.assign({ref:V},aL,{visible:t.resizable})))))});var G1={exports:{}};/*!
114
+ * Quill Editor v1.3.7
115
+ * https://quilljs.com/
116
+ * Copyright (c) 2014, Jason Chen
117
+ * Copyright (c) 2013, salesforce.com
118
+ */var fL=G1.exports,G3;function hL(){return G3||(G3=1,function(t,e){(function(n,i){t.exports=i()})(typeof self<"u"?self:fL,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),s=i(19),u=i(45),h=i(46),f=i(47),v=i(48),g=i(49),p=i(12),y=i(32),_=i(33),x=i(31),b=i(1),E={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:a.default,Format:o.default,Leaf:s.default,Embed:v.default,Scroll:u.default,Block:f.default,Inline:h.default,Text:g.default,Attributor:{Attribute:p.default,Class:y.default,Style:_.default,Store:x.default}};n.default=E},function(r,n,i){var a=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,E){b.__proto__=E}||function(b,E){for(var k in E)E.hasOwnProperty(k)&&(b[k]=E[k])};return function(b,E){x(b,E);function k(){this.constructor=b}b.prototype=E===null?Object.create(E):(k.prototype=E.prototype,new k)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(x){a(b,x);function b(E){var k=this;return E="[Parchment] "+E,k=x.call(this,E)||this,k.message=E,k.name=k.constructor.name,k}return b}(Error);n.ParchmentError=o;var s={},u={},h={},f={};n.DATA_KEY="__blot";var v;(function(x){x[x.TYPE=3]="TYPE",x[x.LEVEL=12]="LEVEL",x[x.ATTRIBUTE=13]="ATTRIBUTE",x[x.BLOT=14]="BLOT",x[x.INLINE=7]="INLINE",x[x.BLOCK=11]="BLOCK",x[x.BLOCK_BLOT=10]="BLOCK_BLOT",x[x.INLINE_BLOT=6]="INLINE_BLOT",x[x.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",x[x.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",x[x.ANY=15]="ANY"})(v=n.Scope||(n.Scope={}));function g(x,b){var E=y(x);if(E==null)throw new o("Unable to create "+x+" blot");var k=E,S=x instanceof Node||x.nodeType===Node.TEXT_NODE?x:k.create(b);return new k(S,b)}n.create=g;function p(x,b){return b===void 0&&(b=!1),x==null?null:x[n.DATA_KEY]!=null?x[n.DATA_KEY].blot:b?p(x.parentNode,b):null}n.find=p;function y(x,b){b===void 0&&(b=v.ANY);var E;if(typeof x=="string")E=f[x]||s[x];else if(x instanceof Text||x.nodeType===Node.TEXT_NODE)E=f.text;else if(typeof x=="number")x&v.LEVEL&v.BLOCK?E=f.block:x&v.LEVEL&v.INLINE&&(E=f.inline);else if(x instanceof HTMLElement){var k=(x.getAttribute("class")||"").split(/\s+/);for(var S in k)if(E=u[k[S]],E)break;E=E||h[x.tagName]}return E==null?null:b&v.LEVEL&E.scope&&b&v.TYPE&E.scope?E:null}n.query=y;function _(){for(var x=[],b=0;b<arguments.length;b++)x[b]=arguments[b];if(x.length>1)return x.map(function(S){return _(S)});var E=x[0];if(typeof E.blotName!="string"&&typeof E.attrName!="string")throw new o("Invalid definition");if(E.blotName==="abstract")throw new o("Cannot register abstract class");if(f[E.blotName||E.attrName]=E,typeof E.keyName=="string")s[E.keyName]=E;else if(E.className!=null&&(u[E.className]=E),E.tagName!=null){Array.isArray(E.tagName)?E.tagName=E.tagName.map(function(S){return S.toUpperCase()}):E.tagName=E.tagName.toUpperCase();var k=Array.isArray(E.tagName)?E.tagName:[E.tagName];k.forEach(function(S){(h[S]==null||E.className==null)&&(h[S]=E)})}return E}n.register=_},function(r,n,i){var a=i(51),o=i(11),s=i(3),u=i(20),h="\0",f=function(v){Array.isArray(v)?this.ops=v:v!=null&&Array.isArray(v.ops)?this.ops=v.ops:this.ops=[]};f.prototype.insert=function(v,g){var p={};return v.length===0?this:(p.insert=v,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(p.attributes=g),this.push(p))},f.prototype.delete=function(v){return v<=0?this:this.push({delete:v})},f.prototype.retain=function(v,g){if(v<=0)return this;var p={retain:v};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(p.attributes=g),this.push(p)},f.prototype.push=function(v){var g=this.ops.length,p=this.ops[g-1];if(v=s(!0,{},v),typeof p=="object"){if(typeof v.delete=="number"&&typeof p.delete=="number")return this.ops[g-1]={delete:p.delete+v.delete},this;if(typeof p.delete=="number"&&v.insert!=null&&(g-=1,p=this.ops[g-1],typeof p!="object"))return this.ops.unshift(v),this;if(o(v.attributes,p.attributes)){if(typeof v.insert=="string"&&typeof p.insert=="string")return this.ops[g-1]={insert:p.insert+v.insert},typeof v.attributes=="object"&&(this.ops[g-1].attributes=v.attributes),this;if(typeof v.retain=="number"&&typeof p.retain=="number")return this.ops[g-1]={retain:p.retain+v.retain},typeof v.attributes=="object"&&(this.ops[g-1].attributes=v.attributes),this}}return g===this.ops.length?this.ops.push(v):this.ops.splice(g,0,v),this},f.prototype.chop=function(){var v=this.ops[this.ops.length-1];return v&&v.retain&&!v.attributes&&this.ops.pop(),this},f.prototype.filter=function(v){return this.ops.filter(v)},f.prototype.forEach=function(v){this.ops.forEach(v)},f.prototype.map=function(v){return this.ops.map(v)},f.prototype.partition=function(v){var g=[],p=[];return this.forEach(function(y){var _=v(y)?g:p;_.push(y)}),[g,p]},f.prototype.reduce=function(v,g){return this.ops.reduce(v,g)},f.prototype.changeLength=function(){return this.reduce(function(v,g){return g.insert?v+u.length(g):g.delete?v-g.delete:v},0)},f.prototype.length=function(){return this.reduce(function(v,g){return v+u.length(g)},0)},f.prototype.slice=function(v,g){v=v||0,typeof g!="number"&&(g=1/0);for(var p=[],y=u.iterator(this.ops),_=0;_<g&&y.hasNext();){var x;_<v?x=y.next(v-_):(x=y.next(g-_),p.push(x)),_+=u.length(x)}return new f(p)},f.prototype.compose=function(v){var g=u.iterator(this.ops),p=u.iterator(v.ops),y=[],_=p.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){for(var x=_.retain;g.peekType()==="insert"&&g.peekLength()<=x;)x-=g.peekLength(),y.push(g.next());_.retain-x>0&&p.next(_.retain-x)}for(var b=new f(y);g.hasNext()||p.hasNext();)if(p.peekType()==="insert")b.push(p.next());else if(g.peekType()==="delete")b.push(g.next());else{var E=Math.min(g.peekLength(),p.peekLength()),k=g.next(E),S=p.next(E);if(typeof S.retain=="number"){var A={};typeof k.retain=="number"?A.retain=E:A.insert=k.insert;var M=u.attributes.compose(k.attributes,S.attributes,typeof k.retain=="number");if(M&&(A.attributes=M),b.push(A),!p.hasNext()&&o(b.ops[b.ops.length-1],A)){var C=new f(g.rest());return b.concat(C).chop()}}else typeof S.delete=="number"&&typeof k.retain=="number"&&b.push(S)}return b.chop()},f.prototype.concat=function(v){var g=new f(this.ops.slice());return v.ops.length>0&&(g.push(v.ops[0]),g.ops=g.ops.concat(v.ops.slice(1))),g},f.prototype.diff=function(v,g){if(this.ops===v.ops)return new f;var p=[this,v].map(function(E){return E.map(function(k){if(k.insert!=null)return typeof k.insert=="string"?k.insert:h;var S=E===v?"on":"with";throw new Error("diff() called "+S+" non-document")}).join("")}),y=new f,_=a(p[0],p[1],g),x=u.iterator(this.ops),b=u.iterator(v.ops);return _.forEach(function(E){for(var k=E[1].length;k>0;){var S=0;switch(E[0]){case a.INSERT:S=Math.min(b.peekLength(),k),y.push(b.next(S));break;case a.DELETE:S=Math.min(k,x.peekLength()),x.next(S),y.delete(S);break;case a.EQUAL:S=Math.min(x.peekLength(),b.peekLength(),k);var A=x.next(S),M=b.next(S);o(A.insert,M.insert)?y.retain(S,u.attributes.diff(A.attributes,M.attributes)):y.push(M).delete(S);break}k-=S}}),y.chop()},f.prototype.eachLine=function(v,g){g=g||`
119
+ `;for(var p=u.iterator(this.ops),y=new f,_=0;p.hasNext();){if(p.peekType()!=="insert")return;var x=p.peek(),b=u.length(x)-p.peekLength(),E=typeof x.insert=="string"?x.insert.indexOf(g,b)-b:-1;if(E<0)y.push(p.next());else if(E>0)y.push(p.next(E));else{if(v(y,p.next(1).attributes||{},_)===!1)return;_+=1,y=new f}}y.length()>0&&v(y,{},_)},f.prototype.transform=function(v,g){if(g=!!g,typeof v=="number")return this.transformPosition(v,g);for(var p=u.iterator(this.ops),y=u.iterator(v.ops),_=new f;p.hasNext()||y.hasNext();)if(p.peekType()==="insert"&&(g||y.peekType()!=="insert"))_.retain(u.length(p.next()));else if(y.peekType()==="insert")_.push(y.next());else{var x=Math.min(p.peekLength(),y.peekLength()),b=p.next(x),E=y.next(x);if(b.delete)continue;E.delete?_.push(E):_.retain(x,u.attributes.transform(b.attributes,E.attributes,g))}return _.chop()},f.prototype.transformPosition=function(v,g){g=!!g;for(var p=u.iterator(this.ops),y=0;p.hasNext()&&y<=v;){var _=p.peekLength(),x=p.peekType();if(p.next(),x==="delete"){v-=Math.min(_,v-y);continue}else x==="insert"&&(y<v||!g)&&(v+=_);y+=_}return v},r.exports=f},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},h=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var y=i.call(p,"constructor"),_=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!_)return!1;var x;for(x in p);return typeof x>"u"||i.call(p,x)},f=function(p,y){o&&y.name==="__proto__"?o(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},v=function(p,y){if(y==="__proto__")if(i.call(p,y)){if(s)return s(p,y).value}else return;return p[y]};r.exports=function g(){var p,y,_,x,b,E,k=arguments[0],S=1,A=arguments.length,M=!1;for(typeof k=="boolean"&&(M=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<A;++S)if(p=arguments[S],p!=null)for(y in p)_=v(k,y),x=v(p,y),k!==x&&(M&&x&&(h(x)||(b=u(x)))?(b?(b=!1,E=_&&u(_)?_:[]):E=_&&h(_)?_:{},f(k,{name:y,newValue:g(M,E,x)})):typeof x<"u"&&f(k,{name:y,newValue:x}));return k}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function O(T,$){for(var q=0;q<$.length;q++){var J=$[q];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(T,J.key,J)}}return function(T,$,q){return $&&O(T.prototype,$),q&&O(T,q),T}}(),o=function O(T,$,q){T===null&&(T=Function.prototype);var J=Object.getOwnPropertyDescriptor(T,$);if(J===void 0){var ae=Object.getPrototypeOf(T);return ae===null?void 0:O(ae,$,q)}else{if("value"in J)return J.value;var ie=J.get;return ie===void 0?void 0:ie.call(q)}},s=i(3),u=k(s),h=i(2),f=k(h),v=i(0),g=k(v),p=i(16),y=k(p),_=i(6),x=k(_),b=i(7),E=k(b);function k(O){return O&&O.__esModule?O:{default:O}}function S(O,T){if(!(O instanceof T))throw new TypeError("Cannot call a class as a function")}function A(O,T){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:O}function M(O,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);O.prototype=Object.create(T&&T.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(O,T):O.__proto__=T)}var C=1,I=function(O){M(T,O);function T(){return S(this,T),A(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return a(T,[{key:"attach",value:function(){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"attach",this).call(this),this.attributes=new g.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new f.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(q,J){var ae=g.default.query(q,g.default.Scope.BLOCK_ATTRIBUTE);ae!=null&&this.attributes.attribute(ae,J)}},{key:"formatAt",value:function(q,J,ae,ie){this.format(ae,ie)}},{key:"insertAt",value:function(q,J,ae){if(typeof J=="string"&&J.endsWith(`
120
+ `)){var ie=g.default.create(F.blotName);this.parent.insertBefore(ie,q===0?this:this.next),ie.insertAt(0,J.slice(0,-1))}else o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,q,J,ae)}}]),T}(g.default.Embed);I.scope=g.default.Scope.BLOCK_BLOT;var F=function(O){M(T,O);function T($){S(this,T);var q=A(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,$));return q.cache={},q}return a(T,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(g.default.Leaf).reduce(function(q,J){return J.length()===0?q:q.insert(J.value(),j(J))},new f.default).insert(`
121
+ `,j(this))),this.cache.delta}},{key:"deleteAt",value:function(q,J){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"deleteAt",this).call(this,q,J),this.cache={}}},{key:"formatAt",value:function(q,J,ae,ie){J<=0||(g.default.query(ae,g.default.Scope.BLOCK)?q+J===this.length()&&this.format(ae,ie):o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"formatAt",this).call(this,q,Math.min(J,this.length()-q-1),ae,ie),this.cache={})}},{key:"insertAt",value:function(q,J,ae){if(ae!=null)return o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,q,J,ae);if(J.length!==0){var ie=J.split(`
122
+ `),Z=ie.shift();Z.length>0&&(q<this.length()-1||this.children.tail==null?o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,Math.min(q,this.length()-1),Z):this.children.tail.insertAt(this.children.tail.length(),Z),this.cache={});var te=this;ie.reduce(function(V,B){return te=te.split(V,!0),te.insertAt(0,B),B.length},q+Z.length)}}},{key:"insertBefore",value:function(q,J){var ae=this.children.head;o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertBefore",this).call(this,q,J),ae instanceof y.default&&ae.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"length",this).call(this)+C),this.cache.length}},{key:"moveChildren",value:function(q,J){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"moveChildren",this).call(this,q,J),this.cache={}}},{key:"optimize",value:function(q){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,q),this.cache={}}},{key:"path",value:function(q){return o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"path",this).call(this,q,!0)}},{key:"removeChild",value:function(q){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"removeChild",this).call(this,q),this.cache={}}},{key:"split",value:function(q){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(J&&(q===0||q>=this.length()-C)){var ae=this.clone();return q===0?(this.parent.insertBefore(ae,this),this):(this.parent.insertBefore(ae,this.next),ae)}else{var ie=o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"split",this).call(this,q,J);return this.cache={},ie}}}]),T}(g.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[x.default,g.default.Embed,E.default];function j(O){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O==null||(typeof O.formats=="function"&&(T=(0,u.default)(T,O.formats())),O.parent==null||O.parent.blotName=="scroll"||O.parent.statics.scope!==O.statics.scope)?T:j(O.parent,T)}n.bubbleFormats=j,n.BlockEmbed=I,n.default=F},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},o=function(){function te(V,B){var D=[],U=!0,X=!1,ee=void 0;try{for(var K=V[Symbol.iterator](),oe;!(U=(oe=K.next()).done)&&(D.push(oe.value),!(B&&D.length===B));U=!0);}catch(me){X=!0,ee=me}finally{try{!U&&K.return&&K.return()}finally{if(X)throw ee}}return D}return function(V,B){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return te(V,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function te(V,B){for(var D=0;D<B.length;D++){var U=B[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(V,U.key,U)}}return function(V,B,D){return B&&te(V.prototype,B),D&&te(V,D),V}}();i(50);var u=i(2),h=j(u),f=i(14),v=j(f),g=i(8),p=j(g),y=i(9),_=j(y),x=i(0),b=j(x),E=i(15),k=j(E),S=i(3),A=j(S),M=i(10),C=j(M),I=i(34),F=j(I);function j(te){return te&&te.__esModule?te:{default:te}}function O(te,V,B){return V in te?Object.defineProperty(te,V,{value:B,enumerable:!0,configurable:!0,writable:!0}):te[V]=B,te}function T(te,V){if(!(te instanceof V))throw new TypeError("Cannot call a class as a function")}var $=(0,C.default)("quill"),q=function(){s(te,null,[{key:"debug",value:function(B){B===!0&&(B="log"),C.default.level(B)}},{key:"find",value:function(B){return B.__quill||b.default.find(B)}},{key:"import",value:function(B){return this.imports[B]==null&&$.error("Cannot import "+B+". Are you sure it was registered?"),this.imports[B]}},{key:"register",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof B!="string"){var ee=B.attrName||B.blotName;typeof ee=="string"?this.register("formats/"+ee,B,D):Object.keys(B).forEach(function(K){U.register(K,B[K],D)})}else this.imports[B]!=null&&!X&&$.warn("Overwriting "+B+" with",D),this.imports[B]=D,(B.startsWith("blots/")||B.startsWith("formats/"))&&D.blotName!=="abstract"?b.default.register(D):B.startsWith("modules")&&typeof D.register=="function"&&D.register()}}]);function te(V){var B=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(T(this,te),this.options=J(V,D),this.container=this.options.container,this.container==null)return $.error("Invalid Quill container",V);this.options.debug&&te.debug(this.options.debug);var U=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(ee){ee===p.default.events.TEXT_CHANGE&&B.root.classList.toggle("ql-blank",B.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(ee,K){var oe=B.selection.lastRange,me=oe&&oe.length===0?oe.index:void 0;ae.call(B,function(){return B.editor.update(null,K,me)},ee)});var X=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+U+"<p><br></p></div>");this.setContents(X),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(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof B=="string"){var U=B;B=document.createElement("div"),B.classList.add(U)}return this.container.insertBefore(B,D),B}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(B,D,U){var X=this,ee=ie(B,D,U),K=o(ee,4);return B=K[0],D=K[1],U=K[3],ae.call(this,function(){return X.editor.deleteText(B,D)},U,B,-1*D)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(B),this.container.classList.toggle("ql-disabled",!B)}},{key:"focus",value:function(){var B=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=B,this.scrollIntoView()}},{key:"format",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return ae.call(this,function(){var ee=U.getSelection(!0),K=new h.default;if(ee==null)return K;if(b.default.query(B,b.default.Scope.BLOCK))K=U.editor.formatLine(ee.index,ee.length,O({},B,D));else{if(ee.length===0)return U.selection.format(B,D),K;K=U.editor.formatText(ee.index,ee.length,O({},B,D))}return U.setSelection(ee,p.default.sources.SILENT),K},X)}},{key:"formatLine",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,D,U,X,ee),de=o(me,4);return B=de[0],D=de[1],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.formatLine(B,D,oe)},ee,B,0)}},{key:"formatText",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,D,U,X,ee),de=o(me,4);return B=de[0],D=de[1],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.formatText(B,D,oe)},ee,B,0)}},{key:"getBounds",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=void 0;typeof B=="number"?U=this.selection.getBounds(B,D):U=this.selection.getBounds(B.index,B.length);var X=this.container.getBoundingClientRect();return{bottom:U.bottom-X.top,height:U.height,left:U.left-X.left,right:U.right-X.left,top:U.top-X.top,width:U.width}}},{key:"getContents",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,U=ie(B,D),X=o(U,2);return B=X[0],D=X[1],this.editor.getContents(B,D)}},{key:"getFormat",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof B=="number"?this.editor.getFormat(B,D):this.editor.getFormat(B.index,B.length)}},{key:"getIndex",value:function(B){return B.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(B){return this.scroll.leaf(B)}},{key:"getLine",value:function(B){return this.scroll.line(B)}},{key:"getLines",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof B!="number"?this.scroll.lines(B.index,B.length):this.scroll.lines(B,D)}},{key:"getModule",value:function(B){return this.theme.modules[B]}},{key:"getSelection",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return B&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,U=ie(B,D),X=o(U,2);return B=X[0],D=X[1],this.editor.getText(B,D)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(B,D,U){var X=this,ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:te.sources.API;return ae.call(this,function(){return X.editor.insertEmbed(B,D,U)},ee,B)}},{key:"insertText",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,0,U,X,ee),de=o(me,4);return B=de[0],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.insertText(B,D,oe)},ee,B,D.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(B,D,U){this.clipboard.dangerouslyPasteHTML(B,D,U)}},{key:"removeFormat",value:function(B,D,U){var X=this,ee=ie(B,D,U),K=o(ee,4);return B=K[0],D=K[1],U=K[3],ae.call(this,function(){return X.editor.removeFormat(B,D)},U,B)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(B){var D=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return ae.call(this,function(){B=new h.default(B);var X=D.getLength(),ee=D.editor.deleteText(0,X),K=D.editor.applyDelta(B),oe=K.ops[K.ops.length-1];oe!=null&&typeof oe.insert=="string"&&oe.insert[oe.insert.length-1]===`
123
+ `&&(D.editor.deleteText(D.getLength()-1,1),K.delete(1));var me=ee.compose(K);return me},U)}},{key:"setSelection",value:function(B,D,U){if(B==null)this.selection.setRange(null,D||te.sources.API);else{var X=ie(B,D,U),ee=o(X,4);B=ee[0],D=ee[1],U=ee[3],this.selection.setRange(new E.Range(B,D),U),U!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,U=new h.default().insert(B);return this.setContents(U,D)}},{key:"update",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,D=this.scroll.update(B);return this.selection.update(B),D}},{key:"updateContents",value:function(B){var D=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return ae.call(this,function(){return B=new h.default(B),D.editor.applyDelta(B,U)},U,!0)}}]),te}();q.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},q.events=p.default.events,q.sources=p.default.sources,q.version="1.3.7",q.imports={delta:h.default,parchment:b.default,"core/module":_.default,"core/theme":F.default};function J(te,V){if(V=(0,A.default)(!0,{container:te,modules:{clipboard:!0,keyboard:!0,history:!0}},V),!V.theme||V.theme===q.DEFAULTS.theme)V.theme=F.default;else if(V.theme=q.import("themes/"+V.theme),V.theme==null)throw new Error("Invalid theme "+V.theme+". Did you register it?");var B=(0,A.default)(!0,{},V.theme.DEFAULTS);[B,V].forEach(function(X){X.modules=X.modules||{},Object.keys(X.modules).forEach(function(ee){X.modules[ee]===!0&&(X.modules[ee]={})})});var D=Object.keys(B.modules).concat(Object.keys(V.modules)),U=D.reduce(function(X,ee){var K=q.import("modules/"+ee);return K==null?$.error("Cannot load "+ee+" module. Are you sure you registered it?"):X[ee]=K.DEFAULTS||{},X},{});return V.modules!=null&&V.modules.toolbar&&V.modules.toolbar.constructor!==Object&&(V.modules.toolbar={container:V.modules.toolbar}),V=(0,A.default)(!0,{},q.DEFAULTS,{modules:U},B,V),["bounds","container","scrollingContainer"].forEach(function(X){typeof V[X]=="string"&&(V[X]=document.querySelector(V[X]))}),V.modules=Object.keys(V.modules).reduce(function(X,ee){return V.modules[ee]&&(X[ee]=V.modules[ee]),X},{}),V}function ae(te,V,B,D){if(this.options.strict&&!this.isEnabled()&&V===p.default.sources.USER)return new h.default;var U=B==null?null:this.getSelection(),X=this.editor.delta,ee=te();if(U!=null&&(B===!0&&(B=U.index),D==null?U=Z(U,ee,V):D!==0&&(U=Z(U,B,D,V)),this.setSelection(U,p.default.sources.SILENT)),ee.length()>0){var K,oe=[p.default.events.TEXT_CHANGE,ee,X,V];if((K=this.emitter).emit.apply(K,[p.default.events.EDITOR_CHANGE].concat(oe)),V!==p.default.sources.SILENT){var me;(me=this.emitter).emit.apply(me,oe)}}return ee}function ie(te,V,B,D,U){var X={};return typeof te.index=="number"&&typeof te.length=="number"?typeof V!="number"?(U=D,D=B,B=V,V=te.length,te=te.index):(V=te.length,te=te.index):typeof V!="number"&&(U=D,D=B,B=V,V=0),(typeof B>"u"?"undefined":a(B))==="object"?(X=B,U=D):typeof B=="string"&&(D!=null?X[B]=D:U=B),U=U||p.default.sources.API,[te,V,X,U]}function Z(te,V,B,D){if(te==null)return null;var U=void 0,X=void 0;if(V instanceof h.default){var ee=[te.index,te.index+te.length].map(function(de){return V.transformPosition(de,D!==p.default.sources.USER)}),K=o(ee,2);U=K[0],X=K[1]}else{var oe=[te.index,te.index+te.length].map(function(de){return de<V||de===V&&D===p.default.sources.USER?de:B>=0?de+B:Math.max(V,de+B)}),me=o(oe,2);U=me[0],X=me[1]}return new E.Range(U,X-U)}n.expandConfig=J,n.overload=ie,n.default=q},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(b,E){for(var k=0;k<E.length;k++){var S=E[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,k){return E&&x(b.prototype,E),k&&x(b,k),b}}(),o=function x(b,E,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,E,k)}else{if("value"in S)return S.value;var M=S.get;return M===void 0?void 0:M.call(k)}},s=i(7),u=v(s),h=i(0),f=v(h);function v(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function p(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function y(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var _=function(x){y(b,x);function b(){return g(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"formatAt",value:function(k,S,A,M){if(b.compare(this.statics.blotName,A)<0&&f.default.query(A,f.default.Scope.BLOT)){var C=this.isolate(k,S);M&&C.wrap(A,M)}else o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,k,S,A,M)}},{key:"optimize",value:function(k){if(o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,k),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var S=this.parent.isolate(this.offset(),this.length());this.moveChildren(S),S.wrap(this)}}}],[{key:"compare",value:function(k,S){var A=b.order.indexOf(k),M=b.order.indexOf(S);return A>=0||M>=0?A-M:k===S?0:k<S?-1:1}}]),b}(f.default.Inline);_.allowedChildren=[_,f.default.Embed,u.default],_.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function h(g,p){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:g}function f(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(g,p):g.__proto__=p)}var v=function(g){f(p,g);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default.Text);n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(k,S){for(var A=0;A<S.length;A++){var M=S[A];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(k,M.key,M)}}return function(k,S,A){return S&&E(k.prototype,S),A&&E(k,A),k}}(),o=function E(k,S,A){k===null&&(k=Function.prototype);var M=Object.getOwnPropertyDescriptor(k,S);if(M===void 0){var C=Object.getPrototypeOf(k);return C===null?void 0:E(C,S,A)}else{if("value"in M)return M.value;var I=M.get;return I===void 0?void 0:I.call(A)}},s=i(54),u=v(s),h=i(10),f=v(h);function v(E){return E&&E.__esModule?E:{default:E}}function g(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function p(E,k){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:E}function y(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);E.prototype=Object.create(k&&k.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(E,k):E.__proto__=k)}var _=(0,f.default)("quill:events"),x=["selectionchange","mousedown","mouseup","click"];x.forEach(function(E){document.addEventListener(E,function(){for(var k=arguments.length,S=Array(k),A=0;A<k;A++)S[A]=arguments[A];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(M){if(M.__quill&&M.__quill.emitter){var C;(C=M.__quill.emitter).handleDOM.apply(C,S)}})})});var b=function(E){y(k,E);function k(){g(this,k);var S=p(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return S.listeners={},S.on("error",_.error),S}return a(k,[{key:"emit",value:function(){_.log.apply(_,arguments),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(A){for(var M=arguments.length,C=Array(M>1?M-1:0),I=1;I<M;I++)C[I-1]=arguments[I];(this.listeners[A.type]||[]).forEach(function(F){var j=F.node,O=F.handler;(A.target===j||j.contains(A.target))&&O.apply(void 0,[A].concat(C))})}},{key:"listenDOM",value:function(A,M,C){this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push({node:M,handler:C})}}]),k}(u.default);b.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"},b.sources={API:"api",SILENT:"silent",USER:"user"},n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function s(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,s),this.quill=u,this.options=h};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function s(h){if(a.indexOf(h)<=a.indexOf(o)){for(var f,v=arguments.length,g=Array(v>1?v-1:0),p=1;p<v;p++)g[p-1]=arguments[p];(f=console)[h].apply(f,g)}}function u(h){return a.reduce(function(f,v){return f[v]=s.bind(console,v,h),f},{})}s.level=u.level=function(h){o=h},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),s=i(53),u=r.exports=function(g,p,y){return y||(y={}),g===p?!0:g instanceof Date&&p instanceof Date?g.getTime()===p.getTime():!g||!p||typeof g!="object"&&typeof p!="object"?y.strict?g===p:g==p:v(g,p,y)};function h(g){return g==null}function f(g){return!(!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number")}function v(g,p,y){var _,x;if(h(g)||h(p)||g.prototype!==p.prototype)return!1;if(s(g))return s(p)?(g=a.call(g),p=a.call(p),u(g,p,y)):!1;if(f(g)){if(!f(p)||g.length!==p.length)return!1;for(_=0;_<g.length;_++)if(g[_]!==p[_])return!1;return!0}try{var b=o(g),E=o(p)}catch{return!1}if(b.length!=E.length)return!1;for(b.sort(),E.sort(),_=b.length-1;_>=0;_--)if(b[_]!=E[_])return!1;for(_=b.length-1;_>=0;_--)if(x=b[_],!u(g[x],p[x],y))return!1;return typeof g==typeof p}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function s(u,h,f){f===void 0&&(f={}),this.attrName=u,this.keyName=h;var v=a.Scope.TYPE&a.Scope.ATTRIBUTE;f.scope!=null?this.scope=f.scope&a.Scope.LEVEL|v:this.scope=a.Scope.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}return s.keys=function(u){return[].map.call(u.attributes,function(h){return h.name})},s.prototype.add=function(u,h){return this.canAdd(u,h)?(u.setAttribute(this.keyName,h),!0):!1},s.prototype.canAdd=function(u,h){var f=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return f==null?!1:this.whitelist==null?!0:typeof h=="string"?this.whitelist.indexOf(h.replace(/["']/g,""))>-1:this.whitelist.indexOf(h)>-1},s.prototype.remove=function(u){u.removeAttribute(this.keyName)},s.prototype.value=function(u){var h=u.getAttribute(this.keyName);return this.canAdd(u,h)&&h?h:""},s}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function I(F,j){var O=[],T=!0,$=!1,q=void 0;try{for(var J=F[Symbol.iterator](),ae;!(T=(ae=J.next()).done)&&(O.push(ae.value),!(j&&O.length===j));T=!0);}catch(ie){$=!0,q=ie}finally{try{!T&&J.return&&J.return()}finally{if($)throw q}}return O}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return I(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function I(F,j){for(var O=0;O<j.length;O++){var T=j[O];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(F,T.key,T)}}return function(F,j,O){return j&&I(F.prototype,j),O&&I(F,O),F}}(),s=function I(F,j,O){F===null&&(F=Function.prototype);var T=Object.getOwnPropertyDescriptor(F,j);if(T===void 0){var $=Object.getPrototypeOf(F);return $===null?void 0:I($,j,O)}else{if("value"in T)return T.value;var q=T.get;return q===void 0?void 0:q.call(O)}},u=i(2),h=E(u),f=i(0),v=E(f),g=i(4),p=E(g),y=i(6),_=E(y),x=i(7),b=E(x);function E(I){return I&&I.__esModule?I:{default:I}}function k(I,F){if(!(I instanceof F))throw new TypeError("Cannot call a class as a function")}function S(I,F){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:I}function A(I,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);I.prototype=Object.create(F&&F.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(I,F):I.__proto__=F)}var M=function(I){A(F,I);function F(){return k(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F}(_.default);M.blotName="code",M.tagName="CODE";var C=function(I){A(F,I);function F(){return k(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return o(F,[{key:"delta",value:function(){var O=this,T=this.domNode.textContent;return T.endsWith(`
124
+ `)&&(T=T.slice(0,-1)),T.split(`
125
+ `).reduce(function($,q){return $.insert(q).insert(`
126
+ `,O.formats())},new h.default)}},{key:"format",value:function(O,T){if(!(O===this.statics.blotName&&T)){var $=this.descendant(b.default,this.length()-1),q=a($,1),J=q[0];J?.deleteAt(J.length()-1,1),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,O,T)}}},{key:"formatAt",value:function(O,T,$,q){if(T!==0&&!(v.default.query($,v.default.Scope.BLOCK)==null||$===this.statics.blotName&&q===this.statics.formats(this.domNode))){var J=this.newlineIndex(O);if(!(J<0||J>=O+T)){var ae=this.newlineIndex(O,!0)+1,ie=J-ae+1,Z=this.isolate(ae,ie),te=Z.next;Z.format($,q),te instanceof F&&te.formatAt(0,O-ae+T-ie,$,q)}}}},{key:"insertAt",value:function(O,T,$){if($==null){var q=this.descendant(b.default,O),J=a(q,2),ae=J[0],ie=J[1];ae.insertAt(ie,T)}}},{key:"length",value:function(){var O=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
127
+ `)?O:O+1}},{key:"newlineIndex",value:function(O){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(T)return this.domNode.textContent.slice(0,O).lastIndexOf(`
128
+ `);var $=this.domNode.textContent.slice(O).indexOf(`
129
+ `);return $>-1?O+$:-1}},{key:"optimize",value:function(O){this.domNode.textContent.endsWith(`
130
+ `)||this.appendChild(v.default.create("text",`
131
+ `)),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,O);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===T.statics.formats(T.domNode)&&(T.optimize(O),T.moveChildren(this),T.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(T){var $=v.default.find(T);$==null?T.parentNode.removeChild(T):$ instanceof v.default.Embed?$.remove():$.unwrap()})}}],[{key:"create",value:function(O){var T=s(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,O);return T.setAttribute("spellcheck",!1),T}},{key:"formats",value:function(){return!0}}]),F}(p.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",n.Code=M,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=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(V,B){var D=[],U=!0,X=!1,ee=void 0;try{for(var K=V[Symbol.iterator](),oe;!(U=(oe=K.next()).done)&&(D.push(oe.value),!(B&&D.length===B));U=!0);}catch(me){X=!0,ee=me}finally{try{!U&&K.return&&K.return()}finally{if(X)throw ee}}return D}return function(V,B){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return te(V,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function te(V,B){for(var D=0;D<B.length;D++){var U=B[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(V,U.key,U)}}return function(V,B,D){return B&&te(V.prototype,B),D&&te(V,D),V}}(),u=i(2),h=T(u),f=i(20),v=T(f),g=i(0),p=T(g),y=i(13),_=T(y),x=i(24),b=T(x),E=i(4),k=T(E),S=i(16),A=T(S),M=i(21),C=T(M),I=i(11),F=T(I),j=i(3),O=T(j);function T(te){return te&&te.__esModule?te:{default:te}}function $(te,V,B){return V in te?Object.defineProperty(te,V,{value:B,enumerable:!0,configurable:!0,writable:!0}):te[V]=B,te}function q(te,V){if(!(te instanceof V))throw new TypeError("Cannot call a class as a function")}var J=/^[ -~]*$/,ae=function(){function te(V){q(this,te),this.scroll=V,this.delta=this.getDelta()}return s(te,[{key:"applyDelta",value:function(B){var D=this,U=!1;this.scroll.update();var X=this.scroll.length();return this.scroll.batchStart(),B=Z(B),B.reduce(function(ee,K){var oe=K.retain||K.delete||K.insert.length||1,me=K.attributes||{};if(K.insert!=null){if(typeof K.insert=="string"){var de=K.insert;de.endsWith(`
132
+ `)&&U&&(U=!1,de=de.slice(0,-1)),ee>=X&&!de.endsWith(`
133
+ `)&&(U=!0),D.scroll.insertAt(ee,de);var ye=D.scroll.line(ee),Te=o(ye,2),Ce=Te[0],Ie=Te[1],Ee=(0,O.default)({},(0,E.bubbleFormats)(Ce));if(Ce instanceof k.default){var ge=Ce.descendant(p.default.Leaf,Ie),Re=o(ge,1),Be=Re[0];Ee=(0,O.default)(Ee,(0,E.bubbleFormats)(Be))}me=v.default.attributes.diff(Ee,me)||{}}else if(a(K.insert)==="object"){var Oe=Object.keys(K.insert)[0];if(Oe==null)return ee;D.scroll.insertAt(ee,Oe,K.insert[Oe])}X+=oe}return Object.keys(me).forEach(function(fe){D.scroll.formatAt(ee,oe,fe,me[fe])}),ee+oe},0),B.reduce(function(ee,K){return typeof K.delete=="number"?(D.scroll.deleteAt(ee,K.delete),ee):ee+(K.retain||K.insert.length||1)},0),this.scroll.batchEnd(),this.update(B)}},{key:"deleteText",value:function(B,D){return this.scroll.deleteAt(B,D),this.update(new h.default().retain(B).delete(D))}},{key:"formatLine",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(X).forEach(function(ee){if(!(U.scroll.whitelist!=null&&!U.scroll.whitelist[ee])){var K=U.scroll.lines(B,Math.max(D,1)),oe=D;K.forEach(function(me){var de=me.length();if(!(me instanceof _.default))me.format(ee,X[ee]);else{var ye=B-me.offset(U.scroll),Te=me.newlineIndex(ye+oe)-ye+1;me.formatAt(ye,Te,ee,X[ee])}oe-=de})}}),this.scroll.optimize(),this.update(new h.default().retain(B).retain(D,(0,C.default)(X)))}},{key:"formatText",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(X).forEach(function(ee){U.scroll.formatAt(B,D,ee,X[ee])}),this.update(new h.default().retain(B).retain(D,(0,C.default)(X)))}},{key:"getContents",value:function(B,D){return this.delta.slice(B,B+D)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(B,D){return B.concat(D.delta())},new h.default)}},{key:"getFormat",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=[],X=[];D===0?this.scroll.path(B).forEach(function(K){var oe=o(K,1),me=oe[0];me instanceof k.default?U.push(me):me instanceof p.default.Leaf&&X.push(me)}):(U=this.scroll.lines(B,D),X=this.scroll.descendants(p.default.Leaf,B,D));var ee=[U,X].map(function(K){if(K.length===0)return{};for(var oe=(0,E.bubbleFormats)(K.shift());Object.keys(oe).length>0;){var me=K.shift();if(me==null)return oe;oe=ie((0,E.bubbleFormats)(me),oe)}return oe});return O.default.apply(O.default,ee)}},{key:"getText",value:function(B,D){return this.getContents(B,D).filter(function(U){return typeof U.insert=="string"}).map(function(U){return U.insert}).join("")}},{key:"insertEmbed",value:function(B,D,U){return this.scroll.insertAt(B,D,U),this.update(new h.default().retain(B).insert($({},D,U)))}},{key:"insertText",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return D=D.replace(/\r\n/g,`
134
+ `).replace(/\r/g,`
135
+ `),this.scroll.insertAt(B,D),Object.keys(X).forEach(function(ee){U.scroll.formatAt(B,D.length,ee,X[ee])}),this.update(new h.default().retain(B).insert(D,(0,C.default)(X)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var B=this.scroll.children.head;return B.statics.blotName!==k.default.blotName||B.children.length>1?!1:B.children.head instanceof A.default}},{key:"removeFormat",value:function(B,D){var U=this.getText(B,D),X=this.scroll.line(B+D),ee=o(X,2),K=ee[0],oe=ee[1],me=0,de=new h.default;K!=null&&(K instanceof _.default?me=K.newlineIndex(oe)-oe+1:me=K.length()-oe,de=K.delta().slice(oe,oe+me-1).insert(`
136
+ `));var ye=this.getContents(B,D+me),Te=ye.diff(new h.default().insert(U).concat(de)),Ce=new h.default().retain(B).concat(Te);return this.applyDelta(Ce)}},{key:"update",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,X=this.delta;if(D.length===1&&D[0].type==="characterData"&&D[0].target.data.match(J)&&p.default.find(D[0].target)){var ee=p.default.find(D[0].target),K=(0,E.bubbleFormats)(ee),oe=ee.offset(this.scroll),me=D[0].oldValue.replace(b.default.CONTENTS,""),de=new h.default().insert(me),ye=new h.default().insert(ee.value()),Te=new h.default().retain(oe).concat(de.diff(ye,U));B=Te.reduce(function(Ce,Ie){return Ie.insert?Ce.insert(Ie.insert,K):Ce.push(Ie)},new h.default),this.delta=X.compose(B)}else this.delta=this.getDelta(),(!B||!(0,F.default)(X.compose(B),this.delta))&&(B=X.diff(this.delta,U));return B}}]),te}();function ie(te,V){return Object.keys(V).reduce(function(B,D){return te[D]==null||(V[D]===te[D]?B[D]=V[D]:Array.isArray(V[D])?V[D].indexOf(te[D])<0&&(B[D]=V[D].concat([te[D]])):B[D]=[V[D],te[D]]),B},{})}function Z(te){return te.reduce(function(V,B){if(B.insert===1){var D=(0,C.default)(B.attributes);return delete D.image,V.insert({image:B.attributes.image},D)}if(B.attributes!=null&&(B.attributes.list===!0||B.attributes.bullet===!0)&&(B=(0,C.default)(B),B.attributes.list?B.attributes.list="ordered":(B.attributes.list="bullet",delete B.attributes.bullet)),typeof B.insert=="string"){var U=B.insert.replace(/\r\n/g,`
137
+ `).replace(/\r/g,`
138
+ `);return V.insert(U,B.attributes)}return V.push(B)},new h.default)}n.default=ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function I(F,j){var O=[],T=!0,$=!1,q=void 0;try{for(var J=F[Symbol.iterator](),ae;!(T=(ae=J.next()).done)&&(O.push(ae.value),!(j&&O.length===j));T=!0);}catch(ie){$=!0,q=ie}finally{try{!T&&J.return&&J.return()}finally{if($)throw q}}return O}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return I(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function I(F,j){for(var O=0;O<j.length;O++){var T=j[O];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(F,T.key,T)}}return function(F,j,O){return j&&I(F.prototype,j),O&&I(F,O),F}}(),s=i(0),u=b(s),h=i(21),f=b(h),v=i(11),g=b(v),p=i(8),y=b(p),_=i(10),x=b(_);function b(I){return I&&I.__esModule?I:{default:I}}function E(I){if(Array.isArray(I)){for(var F=0,j=Array(I.length);F<I.length;F++)j[F]=I[F];return j}else return Array.from(I)}function k(I,F){if(!(I instanceof F))throw new TypeError("Cannot call a class as a function")}var S=(0,x.default)("quill:selection"),A=function I(F){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;k(this,I),this.index=F,this.length=j},M=function(){function I(F,j){var O=this;k(this,I),this.emitter=j,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new A(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){O.mouseDown||setTimeout(O.update.bind(O,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(T,$){T===y.default.events.TEXT_CHANGE&&$.length()>0&&O.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(O.hasFocus()){var T=O.getNativeRange();T!=null&&T.start.node!==O.cursor.textNode&&O.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{O.setNativeRange(T.start.node,T.start.offset,T.end.node,T.end.offset)}catch{}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(T,$){if($.range){var q=$.range,J=q.startNode,ae=q.startOffset,ie=q.endNode,Z=q.endOffset;O.setNativeRange(J,ae,ie,Z)}}),this.update(y.default.sources.SILENT)}return o(I,[{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(y.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 T=this.getNativeRange();if(!(T==null||!T.native.collapsed||u.default.query(j,u.default.Scope.BLOCK))){if(T.start.node!==this.cursor.textNode){var $=u.default.find(T.start.node,!1);if($==null)return;if($ instanceof u.default.Leaf){var q=$.split(T.start.offset);$.parent.insertBefore(this.cursor,q)}else $.insertBefore(this.cursor,T.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,T=this.scroll.length();j=Math.min(j,T-1),O=Math.min(j+O,T-1)-j;var $=void 0,q=this.scroll.leaf(j),J=a(q,2),ae=J[0],ie=J[1];if(ae==null)return null;var Z=ae.position(ie,!0),te=a(Z,2);$=te[0],ie=te[1];var V=document.createRange();if(O>0){V.setStart($,ie);var B=this.scroll.leaf(j+O),D=a(B,2);if(ae=D[0],ie=D[1],ae==null)return null;var U=ae.position(ie,!0),X=a(U,2);return $=X[0],ie=X[1],V.setEnd($,ie),V.getBoundingClientRect()}else{var ee="left",K=void 0;return $ instanceof Text?(ie<$.data.length?(V.setStart($,ie),V.setEnd($,ie+1)):(V.setStart($,ie-1),V.setEnd($,ie),ee="right"),K=V.getBoundingClientRect()):(K=ae.domNode.getBoundingClientRect(),ie>0&&(ee="right")),{bottom:K.top+K.height,height:K.height,left:K[ee],right:K[ee],top:K.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 T=this.normalizeNative(O);return S.info("getNativeRange",T),T}},{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,T=[[j.start.node,j.start.offset]];j.native.collapsed||T.push([j.end.node,j.end.offset]);var $=T.map(function(ae){var ie=a(ae,2),Z=ie[0],te=ie[1],V=u.default.find(Z,!0),B=V.offset(O.scroll);return te===0?B:V instanceof u.default.Container?B+V.length():B+V.index(Z,te)}),q=Math.min(Math.max.apply(Math,E($)),this.scroll.length()-1),J=Math.min.apply(Math,[q].concat(E($)));return new A(J,q-J)}},{key:"normalizeNative",value:function(j){if(!C(this.root,j.startContainer)||!j.collapsed&&!C(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(T){for(var $=T.node,q=T.offset;!($ instanceof Text)&&$.childNodes.length>0;)if($.childNodes.length>q)$=$.childNodes[q],q=0;else if($.childNodes.length===q)$=$.lastChild,q=$ instanceof Text?$.data.length:$.childNodes.length+1;else break;T.node=$,T.offset=q}),O}},{key:"rangeToNative",value:function(j){var O=this,T=j.collapsed?[j.index]:[j.index,j.index+j.length],$=[],q=this.scroll.length();return T.forEach(function(J,ae){J=Math.min(q-1,J);var ie=void 0,Z=O.scroll.leaf(J),te=a(Z,2),V=te[0],B=te[1],D=V.position(B,ae!==0),U=a(D,2);ie=U[0],B=U[1],$.push(ie,B)}),$.length<2&&($=$.concat($)),$}},{key:"scrollIntoView",value:function(j){var O=this.lastRange;if(O!=null){var T=this.getBounds(O.index,O.length);if(T!=null){var $=this.scroll.length()-1,q=this.scroll.line(Math.min(O.index,$)),J=a(q,1),ae=J[0],ie=ae;if(O.length>0){var Z=this.scroll.line(Math.min(O.index+O.length,$)),te=a(Z,1);ie=te[0]}if(!(ae==null||ie==null)){var V=j.getBoundingClientRect();T.top<V.top?j.scrollTop-=V.top-T.top:T.bottom>V.bottom&&(j.scrollTop+=T.bottom-V.bottom)}}}}},{key:"setNativeRange",value:function(j,O){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:j,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:O,q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(S.info("setNativeRange",j,O,T,$),!(j!=null&&(this.root.parentNode==null||j.parentNode==null||T.parentNode==null))){var J=document.getSelection();if(J!=null)if(j!=null){this.hasFocus()||this.root.focus();var ae=(this.getNativeRange()||{}).native;if(ae==null||q||j!==ae.startContainer||O!==ae.startOffset||T!==ae.endContainer||$!==ae.endOffset){j.tagName=="BR"&&(O=[].indexOf.call(j.parentNode.childNodes,j),j=j.parentNode),T.tagName=="BR"&&($=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode);var ie=document.createRange();ie.setStart(j,O),ie.setEnd(T,$),J.removeAllRanges(),J.addRange(ie)}}else J.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(j){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof O=="string"&&(T=O,O=!1),S.info("setRange",j),j!=null){var $=this.rangeToNative(j);this.setNativeRange.apply(this,E($).concat([O]))}else this.setNativeRange(null);this.update(T)}},{key:"update",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,O=this.lastRange,T=this.getRange(),$=a(T,2),q=$[0],J=$[1];if(this.lastRange=q,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,g.default)(O,this.lastRange)){var ae;!this.composing&&J!=null&&J.native.collapsed&&J.start.node!==this.cursor.textNode&&this.cursor.restore();var ie=[y.default.events.SELECTION_CHANGE,(0,f.default)(this.lastRange),(0,f.default)(O),j];if((ae=this.emitter).emit.apply(ae,[y.default.events.EDITOR_CHANGE].concat(ie)),j!==y.default.sources.SILENT){var Z;(Z=this.emitter).emit.apply(Z,ie)}}}}]),I}();function C(I,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),I.contains(F)}n.Range=A,n.default=M},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(0),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function v(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){g(_,y);function _(){return f(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"insertInto",value:function(b,E){b.children.length===0?o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertInto",this).call(this,b,E):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),_}(u.default.Embed);p.blotName="break",p.tagName="BR",n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,p){g.__proto__=p}||function(g,p){for(var y in p)p.hasOwnProperty(y)&&(g[y]=p[y])};return function(g,p){v(g,p);function y(){this.constructor=g}g.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),s=i(30),u=i(1),h=function(v){a(g,v);function g(p){var y=v.call(this,p)||this;return y.build(),y}return g.prototype.appendChild=function(p){this.insertBefore(p)},g.prototype.attach=function(){v.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},g.prototype.build=function(){var p=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var _=f(y);p.insertBefore(_,p.children.head||void 0)}catch(x){if(x instanceof u.ParchmentError)return;throw x}})},g.prototype.deleteAt=function(p,y){if(p===0&&y===this.length())return this.remove();this.children.forEachAt(p,y,function(_,x,b){_.deleteAt(x,b)})},g.prototype.descendant=function(p,y){var _=this.children.find(y),x=_[0],b=_[1];return p.blotName==null&&p(x)||p.blotName!=null&&x instanceof p?[x,b]:x instanceof g?x.descendant(p,b):[null,-1]},g.prototype.descendants=function(p,y,_){y===void 0&&(y=0),_===void 0&&(_=Number.MAX_VALUE);var x=[],b=_;return this.children.forEachAt(y,_,function(E,k,S){(p.blotName==null&&p(E)||p.blotName!=null&&E instanceof p)&&x.push(E),E instanceof g&&(x=x.concat(E.descendants(p,k,b))),b-=S}),x},g.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),v.prototype.detach.call(this)},g.prototype.formatAt=function(p,y,_,x){this.children.forEachAt(p,y,function(b,E,k){b.formatAt(E,k,_,x)})},g.prototype.insertAt=function(p,y,_){var x=this.children.find(p),b=x[0],E=x[1];if(b)b.insertAt(E,y,_);else{var k=_==null?u.create("text",y):u.create(y,_);this.appendChild(k)}},g.prototype.insertBefore=function(p,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(_){return p instanceof _}))throw new u.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,y)},g.prototype.length=function(){return this.children.reduce(function(p,y){return p+y.length()},0)},g.prototype.moveChildren=function(p,y){this.children.forEach(function(_){p.insertBefore(_,y)})},g.prototype.optimize=function(p){if(v.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var y=u.create(this.statics.defaultChild);this.appendChild(y),y.optimize(p)}else this.remove()},g.prototype.path=function(p,y){y===void 0&&(y=!1);var _=this.children.find(p,y),x=_[0],b=_[1],E=[[this,p]];return x instanceof g?E.concat(x.path(b,y)):(x!=null&&E.push([x,b]),E)},g.prototype.removeChild=function(p){this.children.remove(p)},g.prototype.replace=function(p){p instanceof g&&p.moveChildren(this),v.prototype.replace.call(this,p)},g.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 _=this.clone();return this.parent.insertBefore(_,this.next),this.children.forEachAt(p,this.length(),function(x,b,E){x=x.split(b,y),_.appendChild(x)}),_},g.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},g.prototype.update=function(p,y){var _=this,x=[],b=[];p.forEach(function(E){E.target===_.domNode&&E.type==="childList"&&(x.push.apply(x,E.addedNodes),b.push.apply(b,E.removedNodes))}),b.forEach(function(E){if(!(E.parentNode!=null&&E.tagName!=="IFRAME"&&document.body.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var k=u.find(E);k!=null&&(k.domNode.parentNode==null||k.domNode.parentNode===_.domNode)&&k.detach()}}),x.filter(function(E){return E.parentNode==_.domNode}).sort(function(E,k){return E===k?0:E.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(E){var k=null;E.nextSibling!=null&&(k=u.find(E.nextSibling));var S=f(E);(S.next!=k||S.next==null)&&(S.parent!=null&&S.parent.removeChild(_),_.insertBefore(S,k||void 0))})},g}(s.default);function f(v){var g=u.find(v);if(g==null)try{g=u.create(v)}catch{g=u.create(u.Scope.INLINE),[].slice.call(v.childNodes).forEach(function(y){g.domNode.appendChild(y)}),v.parentNode&&v.parentNode.replaceChild(g.domNode,v),g.attach()}return g}n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,p){g.__proto__=p}||function(g,p){for(var y in p)p.hasOwnProperty(y)&&(g[y]=p[y])};return function(g,p){v(g,p);function y(){this.constructor=g}g.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),s=i(31),u=i(17),h=i(1),f=function(v){a(g,v);function g(p){var y=v.call(this,p)||this;return y.attributes=new s.default(y.domNode),y}return g.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},g.prototype.format=function(p,y){var _=h.query(p);_ instanceof o.default?this.attributes.attribute(_,y):y&&_!=null&&(p!==this.statics.blotName||this.formats()[p]!==y)&&this.replaceWith(p,y)},g.prototype.formats=function(){var p=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(p[this.statics.blotName]=y),p},g.prototype.replaceWith=function(p,y){var _=v.prototype.replaceWith.call(this,p,y);return this.attributes.copy(_),_},g.prototype.update=function(p,y){var _=this;v.prototype.update.call(this,p,y),p.some(function(x){return x.target===_.domNode&&x.type==="attributes"})&&this.attributes.build()},g.prototype.wrap=function(p,y){var _=v.prototype.wrap.call(this,p,y);return _ instanceof g&&_.statics.scope===this.statics.scope&&this.attributes.move(_),_},g}(u.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){h(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),s=i(1),u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.value=function(v){return!0},f.prototype.index=function(v,g){return this.domNode===v||this.domNode.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(g,1):-1},f.prototype.position=function(v,g){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return v>0&&(p+=1),[this.parent.domNode,p]},f.prototype.value=function(){var v;return v={},v[this.statics.blotName]=this.statics.value(this.domNode)||!0,v},f.scope=s.Scope.INLINE_BLOT,f}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),s={attributes:{compose:function(h,f,v){typeof h!="object"&&(h={}),typeof f!="object"&&(f={});var g=o(!0,{},f);v||(g=Object.keys(g).reduce(function(y,_){return g[_]!=null&&(y[_]=g[_]),y},{}));for(var p in h)h[p]!==void 0&&f[p]===void 0&&(g[p]=h[p]);return Object.keys(g).length>0?g:void 0},diff:function(h,f){typeof h!="object"&&(h={}),typeof f!="object"&&(f={});var v=Object.keys(h).concat(Object.keys(f)).reduce(function(g,p){return a(h[p],f[p])||(g[p]=f[p]===void 0?null:f[p]),g},{});return Object.keys(v).length>0?v:void 0},transform:function(h,f,v){if(typeof h!="object")return f;if(typeof f=="object"){if(!v)return f;var g=Object.keys(f).reduce(function(p,y){return h[y]===void 0&&(p[y]=f[y]),p},{});return Object.keys(g).length>0?g:void 0}}},iterator:function(h){return new u(h)},length:function(h){return typeof h.delete=="number"?h.delete:typeof h.retain=="number"?h.retain:typeof h.insert=="string"?h.insert.length:1}};function u(h){this.ops=h,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(h){h||(h=1/0);var f=this.ops[this.index];if(f){var v=this.offset,g=s.length(f);if(h>=g-v?(h=g-v,this.index+=1,this.offset=0):this.offset+=h,typeof f.delete=="number")return{delete:h};var p={};return f.attributes&&(p.attributes=f.attributes),typeof f.retain=="number"?p.retain=h:typeof f.insert=="string"?p.insert=f.insert.substr(v,h):p.insert=f.insert,p}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?s.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var h=this.offset,f=this.index,v=this.next(),g=this.ops.slice(this.index);return this.offset=h,this.index=f,[v].concat(g)}else return[]},r.exports=s},function(r,n){var i=function(){function a(_,x){return x!=null&&_ instanceof x}var o;try{o=Map}catch{o=function(){}}var s;try{s=Set}catch{s=function(){}}var u;try{u=Promise}catch{u=function(){}}function h(_,x,b,E,k){typeof x=="object"&&(b=x.depth,E=x.prototype,k=x.includeNonEnumerable,x=x.circular);var S=[],A=[],M=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof b>"u"&&(b=1/0);function C(I,F){if(I===null)return null;if(F===0)return I;var j,O;if(typeof I!="object")return I;if(a(I,o))j=new o;else if(a(I,s))j=new s;else if(a(I,u))j=new u(function(V,B){I.then(function(D){V(C(D,F-1))},function(D){B(C(D,F-1))})});else if(h.__isArray(I))j=[];else if(h.__isRegExp(I))j=new RegExp(I.source,y(I)),I.lastIndex&&(j.lastIndex=I.lastIndex);else if(h.__isDate(I))j=new Date(I.getTime());else{if(M&&Buffer.isBuffer(I))return Buffer.allocUnsafe?j=Buffer.allocUnsafe(I.length):j=new Buffer(I.length),I.copy(j),j;a(I,Error)?j=Object.create(I):typeof E>"u"?(O=Object.getPrototypeOf(I),j=Object.create(O)):(j=Object.create(E),O=E)}if(x){var T=S.indexOf(I);if(T!=-1)return A[T];S.push(I),A.push(j)}a(I,o)&&I.forEach(function(V,B){var D=C(B,F-1),U=C(V,F-1);j.set(D,U)}),a(I,s)&&I.forEach(function(V){var B=C(V,F-1);j.add(B)});for(var $ in I){var q;O&&(q=Object.getOwnPropertyDescriptor(O,$)),!(q&&q.set==null)&&(j[$]=C(I[$],F-1))}if(Object.getOwnPropertySymbols)for(var J=Object.getOwnPropertySymbols(I),$=0;$<J.length;$++){var ae=J[$],ie=Object.getOwnPropertyDescriptor(I,ae);ie&&!ie.enumerable&&!k||(j[ae]=C(I[ae],F-1),ie.enumerable||Object.defineProperty(j,ae,{enumerable:!1}))}if(k)for(var Z=Object.getOwnPropertyNames(I),$=0;$<Z.length;$++){var te=Z[$],ie=Object.getOwnPropertyDescriptor(I,te);ie&&ie.enumerable||(j[te]=C(I[te],F-1),Object.defineProperty(j,te,{enumerable:!1}))}return j}return C(_,b)}h.clonePrototype=function(x){if(x===null)return null;var b=function(){};return b.prototype=x,new b};function f(_){return Object.prototype.toString.call(_)}h.__objToStr=f;function v(_){return typeof _=="object"&&f(_)==="[object Date]"}h.__isDate=v;function g(_){return typeof _=="object"&&f(_)==="[object Array]"}h.__isArray=g;function p(_){return typeof _=="object"&&f(_)==="[object RegExp]"}h.__isRegExp=p;function y(_){var x="";return _.global&&(x+="g"),_.ignoreCase&&(x+="i"),_.multiline&&(x+="m"),x}return h.__getRegExpFlags=y,h}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function j(O,T){var $=[],q=!0,J=!1,ae=void 0;try{for(var ie=O[Symbol.iterator](),Z;!(q=(Z=ie.next()).done)&&($.push(Z.value),!(T&&$.length===T));q=!0);}catch(te){J=!0,ae=te}finally{try{!q&&ie.return&&ie.return()}finally{if(J)throw ae}}return $}return function(O,T){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return j(O,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(O,T){for(var $=0;$<T.length;$++){var q=T[$];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(O,q.key,q)}}return function(O,T,$){return T&&j(O.prototype,T),$&&j(O,$),O}}(),s=function j(O,T,$){O===null&&(O=Function.prototype);var q=Object.getOwnPropertyDescriptor(O,T);if(q===void 0){var J=Object.getPrototypeOf(O);return J===null?void 0:j(J,T,$)}else{if("value"in q)return q.value;var ae=q.get;return ae===void 0?void 0:ae.call($)}},u=i(0),h=S(u),f=i(8),v=S(f),g=i(4),p=S(g),y=i(16),_=S(y),x=i(13),b=S(x),E=i(25),k=S(E);function S(j){return j&&j.__esModule?j:{default:j}}function A(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 C(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 I(j){return j instanceof p.default||j instanceof g.BlockEmbed}var F=function(j){C(O,j);function O(T,$){A(this,O);var q=M(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,T));return q.emitter=$.emitter,Array.isArray($.whitelist)&&(q.whitelist=$.whitelist.reduce(function(J,ae){return J[ae]=!0,J},{})),q.domNode.addEventListener("DOMNodeInserted",function(){}),q.optimize(),q.enable(),q}return o(O,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function($,q){var J=this.line($),ae=a(J,2),ie=ae[0],Z=ae[1],te=this.line($+q),V=a(te,1),B=V[0];if(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,$,q),B!=null&&ie!==B&&Z>0){if(ie instanceof g.BlockEmbed||B instanceof g.BlockEmbed){this.optimize();return}if(ie instanceof b.default){var D=ie.newlineIndex(ie.length(),!0);if(D>-1&&(ie=ie.split(D+1),ie===B)){this.optimize();return}}else if(B instanceof b.default){var U=B.newlineIndex(0);U>-1&&B.split(U+1)}var X=B.children.head instanceof _.default?null:B.children.head;ie.moveChildren(B,X),ie.remove()}this.optimize()}},{key:"enable",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",$)}},{key:"formatAt",value:function($,q,J,ae){this.whitelist!=null&&!this.whitelist[J]||(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,$,q,J,ae),this.optimize())}},{key:"insertAt",value:function($,q,J){if(!(J!=null&&this.whitelist!=null&&!this.whitelist[q])){if($>=this.length())if(J==null||h.default.query(q,h.default.Scope.BLOCK)==null){var ae=h.default.create(this.statics.defaultChild);this.appendChild(ae),J==null&&q.endsWith(`
139
+ `)&&(q=q.slice(0,-1)),ae.insertAt(0,q,J)}else{var ie=h.default.create(q,J);this.appendChild(ie)}else s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,$,q,J);this.optimize()}}},{key:"insertBefore",value:function($,q){if($.statics.scope===h.default.Scope.INLINE_BLOT){var J=h.default.create(this.statics.defaultChild);J.appendChild($),$=J}s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,$,q)}},{key:"leaf",value:function($){return this.path($).pop()||[null,-1]}},{key:"line",value:function($){return $===this.length()?this.line($-1):this.descendant(I,$)}},{key:"lines",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,J=function ae(ie,Z,te){var V=[],B=te;return ie.children.forEachAt(Z,te,function(D,U,X){I(D)?V.push(D):D instanceof h.default.Container&&(V=V.concat(ae(D,U,B))),B-=X}),V};return J(this,$,q)}},{key:"optimize",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,$,q),$.length>0&&this.emitter.emit(v.default.events.SCROLL_OPTIMIZE,$,q))}},{key:"path",value:function($){return s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,$).slice(1)}},{key:"update",value:function($){if(this.batch!==!0){var q=v.default.sources.USER;typeof $=="string"&&(q=$),Array.isArray($)||($=this.observer.takeRecords()),$.length>0&&this.emitter.emit(v.default.events.SCROLL_BEFORE_UPDATE,q,$),s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"update",this).call(this,$.concat([])),$.length>0&&this.emitter.emit(v.default.events.SCROLL_UPDATE,q,$)}}}]),O}(h.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[p.default,g.BlockEmbed,k.default],n.default=F},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},o=function(){function K(oe,me){var de=[],ye=!0,Te=!1,Ce=void 0;try{for(var Ie=oe[Symbol.iterator](),Ee;!(ye=(Ee=Ie.next()).done)&&(de.push(Ee.value),!(me&&de.length===me));ye=!0);}catch(ge){Te=!0,Ce=ge}finally{try{!ye&&Ie.return&&Ie.return()}finally{if(Te)throw Ce}}return de}return function(oe,me){if(Array.isArray(oe))return oe;if(Symbol.iterator in Object(oe))return K(oe,me);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function K(oe,me){for(var de=0;de<me.length;de++){var ye=me[de];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(oe,ye.key,ye)}}return function(oe,me,de){return me&&K(oe.prototype,me),de&&K(oe,de),oe}}(),u=i(21),h=j(u),f=i(11),v=j(f),g=i(3),p=j(g),y=i(2),_=j(y),x=i(20),b=j(x),E=i(0),k=j(E),S=i(5),A=j(S),M=i(10),C=j(M),I=i(9),F=j(I);function j(K){return K&&K.__esModule?K:{default:K}}function O(K,oe,me){return oe in K?Object.defineProperty(K,oe,{value:me,enumerable:!0,configurable:!0,writable:!0}):K[oe]=me,K}function T(K,oe){if(!(K instanceof oe))throw new TypeError("Cannot call a class as a function")}function $(K,oe){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe&&(typeof oe=="object"||typeof oe=="function")?oe:K}function q(K,oe){if(typeof oe!="function"&&oe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof oe);K.prototype=Object.create(oe&&oe.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),oe&&(Object.setPrototypeOf?Object.setPrototypeOf(K,oe):K.__proto__=oe)}var J=(0,C.default)("quill:keyboard"),ae=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",ie=function(K){q(oe,K),s(oe,null,[{key:"match",value:function(de,ye){return ye=ee(ye),["altKey","ctrlKey","metaKey","shiftKey"].some(function(Te){return!!ye[Te]!==de[Te]&&ye[Te]!==null})?!1:ye.key===(de.which||de.keyCode)}}]);function oe(me,de){T(this,oe);var ye=$(this,(oe.__proto__||Object.getPrototypeOf(oe)).call(this,me,de));return ye.bindings={},Object.keys(ye.options.bindings).forEach(function(Te){Te==="list autofill"&&me.scroll.whitelist!=null&&!me.scroll.whitelist.list||ye.options.bindings[Te]&&ye.addBinding(ye.options.bindings[Te])}),ye.addBinding({key:oe.keys.ENTER,shiftKey:null},D),ye.addBinding({key:oe.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!0},te),ye.addBinding({key:oe.keys.DELETE},{collapsed:!0},V)):(ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},te),ye.addBinding({key:oe.keys.DELETE},{collapsed:!0,suffix:/^.?$/},V)),ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!1},B),ye.addBinding({key:oe.keys.DELETE},{collapsed:!1},B),ye.addBinding({key:oe.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},te),ye.listen(),ye}return s(oe,[{key:"addBinding",value:function(de){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ce=ee(de);if(Ce==null||Ce.key==null)return J.warn("Attempted to add invalid keyboard binding",Ce);typeof ye=="function"&&(ye={handler:ye}),typeof Te=="function"&&(Te={handler:Te}),Ce=(0,p.default)(Ce,ye,Te),this.bindings[Ce.key]=this.bindings[Ce.key]||[],this.bindings[Ce.key].push(Ce)}},{key:"listen",value:function(){var de=this;this.quill.root.addEventListener("keydown",function(ye){if(!ye.defaultPrevented){var Te=ye.which||ye.keyCode,Ce=(de.bindings[Te]||[]).filter(function(bt){return oe.match(ye,bt)});if(Ce.length!==0){var Ie=de.quill.getSelection();if(!(Ie==null||!de.quill.hasFocus())){var Ee=de.quill.getLine(Ie.index),ge=o(Ee,2),Re=ge[0],Be=ge[1],Oe=de.quill.getLeaf(Ie.index),fe=o(Oe,2),Le=fe[0],Ne=fe[1],ue=Ie.length===0?[Le,Ne]:de.quill.getLeaf(Ie.index+Ie.length),ke=o(ue,2),Pe=ke[0],Ue=ke[1],st=Le instanceof k.default.Text?Le.value().slice(0,Ne):"",dt=Pe instanceof k.default.Text?Pe.value().slice(Ue):"",pt={collapsed:Ie.length===0,empty:Ie.length===0&&Re.length()<=1,format:de.quill.getFormat(Ie),offset:Be,prefix:st,suffix:dt},xt=Ce.some(function(bt){if(bt.collapsed!=null&&bt.collapsed!==pt.collapsed||bt.empty!=null&&bt.empty!==pt.empty||bt.offset!=null&&bt.offset!==pt.offset)return!1;if(Array.isArray(bt.format)){if(bt.format.every(function(At){return pt.format[At]==null}))return!1}else if(a(bt.format)==="object"&&!Object.keys(bt.format).every(function(At){return bt.format[At]===!0?pt.format[At]!=null:bt.format[At]===!1?pt.format[At]==null:(0,v.default)(bt.format[At],pt.format[At])}))return!1;return bt.prefix!=null&&!bt.prefix.test(pt.prefix)||bt.suffix!=null&&!bt.suffix.test(pt.suffix)?!1:bt.handler.call(de,Ie,pt)!==!0});xt&&ye.preventDefault()}}}})}}]),oe}(F.default);ie.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},ie.DEFAULTS={bindings:{bold:X("bold"),italic:X("italic"),underline:X("underline"),indent:{key:ie.keys.TAB,format:["blockquote","indent","list"],handler:function(oe,me){if(me.collapsed&&me.offset!==0)return!0;this.quill.format("indent","+1",A.default.sources.USER)}},outdent:{key:ie.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(oe,me){if(me.collapsed&&me.offset!==0)return!0;this.quill.format("indent","-1",A.default.sources.USER)}},"outdent backspace":{key:ie.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(oe,me){me.format.indent!=null?this.quill.format("indent","-1",A.default.sources.USER):me.format.list!=null&&this.quill.format("list",!1,A.default.sources.USER)}},"indent code-block":U(!0),"outdent code-block":U(!1),"remove tab":{key:ie.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(oe){this.quill.deleteText(oe.index-1,1,A.default.sources.USER)}},tab:{key:ie.keys.TAB,handler:function(oe){this.quill.history.cutoff();var me=new _.default().retain(oe.index).delete(oe.length).insert(" ");this.quill.updateContents(me,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(oe.index+1,A.default.sources.SILENT)}},"list empty enter":{key:ie.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(oe,me){this.quill.format("list",!1,A.default.sources.USER),me.format.indent&&this.quill.format("indent",!1,A.default.sources.USER)}},"checklist enter":{key:ie.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(oe){var me=this.quill.getLine(oe.index),de=o(me,2),ye=de[0],Te=de[1],Ce=(0,p.default)({},ye.formats(),{list:"checked"}),Ie=new _.default().retain(oe.index).insert(`
140
+ `,Ce).retain(ye.length()-Te-1).retain(1,{list:"unchecked"});this.quill.updateContents(Ie,A.default.sources.USER),this.quill.setSelection(oe.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:ie.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(oe,me){var de=this.quill.getLine(oe.index),ye=o(de,2),Te=ye[0],Ce=ye[1],Ie=new _.default().retain(oe.index).insert(`
141
+ `,me.format).retain(Te.length()-Ce-1).retain(1,{header:null});this.quill.updateContents(Ie,A.default.sources.USER),this.quill.setSelection(oe.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(oe,me){var de=me.prefix.length,ye=this.quill.getLine(oe.index),Te=o(ye,2),Ce=Te[0],Ie=Te[1];if(Ie>de)return!0;var Ee=void 0;switch(me.prefix.trim()){case"[]":case"[ ]":Ee="unchecked";break;case"[x]":Ee="checked";break;case"-":case"*":Ee="bullet";break;default:Ee="ordered"}this.quill.insertText(oe.index," ",A.default.sources.USER),this.quill.history.cutoff();var ge=new _.default().retain(oe.index-Ie).delete(de+1).retain(Ce.length()-2-Ie).retain(1,{list:Ee});this.quill.updateContents(ge,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(oe.index-de,A.default.sources.SILENT)}},"code exit":{key:ie.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(oe){var me=this.quill.getLine(oe.index),de=o(me,2),ye=de[0],Te=de[1],Ce=new _.default().retain(oe.index+ye.length()-Te-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Ce,A.default.sources.USER)}},"embed left":Z(ie.keys.LEFT,!1),"embed left shift":Z(ie.keys.LEFT,!0),"embed right":Z(ie.keys.RIGHT,!1),"embed right shift":Z(ie.keys.RIGHT,!0)}};function Z(K,oe){var me,de=K===ie.keys.LEFT?"prefix":"suffix";return me={key:K,shiftKey:oe,altKey:null},O(me,de,/^$/),O(me,"handler",function(Te){var Ce=Te.index;K===ie.keys.RIGHT&&(Ce+=Te.length+1);var Ie=this.quill.getLeaf(Ce),Ee=o(Ie,1),ge=Ee[0];return ge instanceof k.default.Embed?(K===ie.keys.LEFT?oe?this.quill.setSelection(Te.index-1,Te.length+1,A.default.sources.USER):this.quill.setSelection(Te.index-1,A.default.sources.USER):oe?this.quill.setSelection(Te.index,Te.length+1,A.default.sources.USER):this.quill.setSelection(Te.index+Te.length+1,A.default.sources.USER),!1):!0}),me}function te(K,oe){if(!(K.index===0||this.quill.getLength()<=1)){var me=this.quill.getLine(K.index),de=o(me,1),ye=de[0],Te={};if(oe.offset===0){var Ce=this.quill.getLine(K.index-1),Ie=o(Ce,1),Ee=Ie[0];if(Ee!=null&&Ee.length()>1){var ge=ye.formats(),Re=this.quill.getFormat(K.index-1,1);Te=b.default.attributes.diff(ge,Re)||{}}}var Be=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(oe.prefix)?2:1;this.quill.deleteText(K.index-Be,Be,A.default.sources.USER),Object.keys(Te).length>0&&this.quill.formatLine(K.index-Be,Be,Te,A.default.sources.USER),this.quill.focus()}}function V(K,oe){var me=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(oe.suffix)?2:1;if(!(K.index>=this.quill.getLength()-me)){var de={},ye=0,Te=this.quill.getLine(K.index),Ce=o(Te,1),Ie=Ce[0];if(oe.offset>=Ie.length()-1){var Ee=this.quill.getLine(K.index+1),ge=o(Ee,1),Re=ge[0];if(Re){var Be=Ie.formats(),Oe=this.quill.getFormat(K.index,1);de=b.default.attributes.diff(Be,Oe)||{},ye=Re.length()}}this.quill.deleteText(K.index,me,A.default.sources.USER),Object.keys(de).length>0&&this.quill.formatLine(K.index+ye-1,me,de,A.default.sources.USER)}}function B(K){var oe=this.quill.getLines(K),me={};if(oe.length>1){var de=oe[0].formats(),ye=oe[oe.length-1].formats();me=b.default.attributes.diff(ye,de)||{}}this.quill.deleteText(K,A.default.sources.USER),Object.keys(me).length>0&&this.quill.formatLine(K.index,1,me,A.default.sources.USER),this.quill.setSelection(K.index,A.default.sources.SILENT),this.quill.focus()}function D(K,oe){var me=this;K.length>0&&this.quill.scroll.deleteAt(K.index,K.length);var de=Object.keys(oe.format).reduce(function(ye,Te){return k.default.query(Te,k.default.Scope.BLOCK)&&!Array.isArray(oe.format[Te])&&(ye[Te]=oe.format[Te]),ye},{});this.quill.insertText(K.index,`
142
+ `,de,A.default.sources.USER),this.quill.setSelection(K.index+1,A.default.sources.SILENT),this.quill.focus(),Object.keys(oe.format).forEach(function(ye){de[ye]==null&&(Array.isArray(oe.format[ye])||ye!=="link"&&me.quill.format(ye,oe.format[ye],A.default.sources.USER))})}function U(K){return{key:ie.keys.TAB,shiftKey:!K,format:{"code-block":!0},handler:function(me){var de=k.default.query("code-block"),ye=me.index,Te=me.length,Ce=this.quill.scroll.descendant(de,ye),Ie=o(Ce,2),Ee=Ie[0],ge=Ie[1];if(Ee!=null){var Re=this.quill.getIndex(Ee),Be=Ee.newlineIndex(ge,!0)+1,Oe=Ee.newlineIndex(Re+ge+Te),fe=Ee.domNode.textContent.slice(Be,Oe).split(`
143
+ `);ge=0,fe.forEach(function(Le,Ne){K?(Ee.insertAt(Be+ge,de.TAB),ge+=de.TAB.length,Ne===0?ye+=de.TAB.length:Te+=de.TAB.length):Le.startsWith(de.TAB)&&(Ee.deleteAt(Be+ge,de.TAB.length),ge-=de.TAB.length,Ne===0?ye-=de.TAB.length:Te-=de.TAB.length),ge+=Le.length+1}),this.quill.update(A.default.sources.USER),this.quill.setSelection(ye,Te,A.default.sources.SILENT)}}}}function X(K){return{key:K[0].toUpperCase(),shortKey:!0,handler:function(me,de){this.quill.format(K,!de.format[K],A.default.sources.USER)}}}function ee(K){if(typeof K=="string"||typeof K=="number")return ee({key:K});if((typeof K>"u"?"undefined":a(K))==="object"&&(K=(0,h.default)(K,!1)),typeof K.key=="string")if(ie.keys[K.key.toUpperCase()]!=null)K.key=ie.keys[K.key.toUpperCase()];else if(K.key.length===1)K.key=K.key.toUpperCase().charCodeAt(0);else return null;return K.shortKey&&(K[ae]=K.shortKey,delete K.shortKey),K}n.default=ie,n.SHORTKEY=ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(E,k){var S=[],A=!0,M=!1,C=void 0;try{for(var I=E[Symbol.iterator](),F;!(A=(F=I.next()).done)&&(S.push(F.value),!(k&&S.length===k));A=!0);}catch(j){M=!0,C=j}finally{try{!A&&I.return&&I.return()}finally{if(M)throw C}}return S}return function(E,k){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return b(E,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function b(E,k,S){E===null&&(E=Function.prototype);var A=Object.getOwnPropertyDescriptor(E,k);if(A===void 0){var M=Object.getPrototypeOf(E);return M===null?void 0:b(M,k,S)}else{if("value"in A)return A.value;var C=A.get;return C===void 0?void 0:C.call(S)}},s=function(){function b(E,k){for(var S=0;S<k.length;S++){var A=k[S];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(E,A.key,A)}}return function(E,k,S){return k&&b(E.prototype,k),S&&b(E,S),E}}(),u=i(0),h=g(u),f=i(7),v=g(f);function g(b){return b&&b.__esModule?b:{default:b}}function p(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function y(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function _(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var x=function(b){_(E,b),s(E,null,[{key:"value",value:function(){}}]);function E(k,S){p(this,E);var A=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,k));return A.selection=S,A.textNode=document.createTextNode(E.CONTENTS),A.domNode.appendChild(A.textNode),A._length=0,A}return s(E,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(S,A){if(this._length!==0)return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"format",this).call(this,S,A);for(var M=this,C=0;M!=null&&M.statics.scope!==h.default.Scope.BLOCK_BLOT;)C+=M.offset(M.parent),M=M.parent;M!=null&&(this._length=E.CONTENTS.length,M.optimize(),M.formatAt(C,E.CONTENTS.length,S,A),this._length=0)}},{key:"index",value:function(S,A){return S===this.textNode?0:o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"index",this).call(this,S,A)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var S=this.textNode,A=this.selection.getNativeRange(),M=void 0,C=void 0,I=void 0;if(A!=null&&A.start.node===S&&A.end.node===S){var F=[S,A.start.offset,A.end.offset];M=F[0],C=F[1],I=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!==E.CONTENTS){var j=this.textNode.data.split(E.CONTENTS).join("");this.next instanceof v.default?(M=this.next.domNode,this.next.insertAt(0,j),this.textNode.data=E.CONTENTS):(this.textNode.data=j,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(E.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var O=[C,I].map(function($){return Math.max(0,Math.min(M.data.length,$-1))}),T=a(O,2);return C=T[0],I=T[1],{startNode:M,startOffset:C,endNode:M,endOffset:I}}}}},{key:"update",value:function(S,A){var M=this;if(S.some(function(I){return I.type==="characterData"&&I.target===M.textNode})){var C=this.restore();C&&(A.range=C)}}},{key:"value",value:function(){return""}}]),E}(h.default.Embed);x.blotName="cursor",x.className="ql-cursor",x.tagName="span",x.CONTENTS="\uFEFF",n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=h(a),s=i(4),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function v(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){g(_,y);function _(){return f(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return _}(o.default.Container);p.allowedChildren=[u.default,s.BlockEmbed,p],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function x(b,E){for(var k=0;k<E.length;k++){var S=E[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,k){return E&&x(b.prototype,E),k&&x(b,k),b}}(),o=function x(b,E,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,E,k)}else{if("value"in S)return S.value;var M=S.get;return M===void 0?void 0:M.call(k)}},s=i(0),u=h(s);function h(x){return x&&x.__esModule?x:{default:x}}function f(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function v(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function g(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var p=function(x){g(b,x);function b(){return f(this,b),v(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"value",value:function(k){var S=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,k);return S.startsWith("rgb(")?(S=S.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+S.split(",").map(function(A){return("00"+parseInt(A).toString(16)).slice(-2)}).join("")):S}}]),b}(u.default.Attributor.Style),y=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),_=new p("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=y,n.ColorStyle=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function _(x,b){for(var E=0;E<b.length;E++){var k=b[E];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,b,E){return b&&_(x.prototype,b),E&&_(x,E),x}}(),o=function _(x,b,E){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,b);if(k===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:_(S,b,E)}else{if("value"in k)return k.value;var A=k.get;return A===void 0?void 0:A.call(E)}},s=i(6),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function f(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function v(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function g(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var p=function(_){g(x,_);function x(){return f(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"format",value:function(E,k){if(E!==this.statics.blotName||!k)return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,E,k);k=this.constructor.sanitize(k),this.domNode.setAttribute("href",k)}}],[{key:"create",value:function(E){var k=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,E);return E=this.sanitize(E),k.setAttribute("href",E),k.setAttribute("rel","noopener noreferrer"),k.setAttribute("target","_blank"),k}},{key:"formats",value:function(E){return E.getAttribute("href")}},{key:"sanitize",value:function(E){return y(E,this.PROTOCOL_WHITELIST)?E:this.SANITIZED_URL}}]),x}(u.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function y(_,x){var b=document.createElement("a");b.href=_;var E=b.href.slice(0,b.href.indexOf(":"));return x.indexOf(E)>-1}n.default=p,n.sanitize=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},o=function(){function x(b,E){for(var k=0;k<E.length;k++){var S=E[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,k){return E&&x(b.prototype,E),k&&x(b,k),b}}(),s=i(23),u=v(s),h=i(107),f=v(h);function v(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}var p=0;function y(x,b){x.setAttribute(b,x.getAttribute(b)!=="true")}var _=function(){function x(b){var E=this;g(this,x),this.select=b,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(){E.togglePicker()}),this.label.addEventListener("keydown",function(k){switch(k.keyCode){case u.default.keys.ENTER:E.togglePicker();break;case u.default.keys.ESCAPE:E.escape(),k.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(x,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),y(this.label,"aria-expanded"),y(this.options,"aria-hidden")}},{key:"buildItem",value:function(E){var k=this,S=document.createElement("span");return S.tabIndex="0",S.setAttribute("role","button"),S.classList.add("ql-picker-item"),E.hasAttribute("value")&&S.setAttribute("data-value",E.getAttribute("value")),E.textContent&&S.setAttribute("data-label",E.textContent),S.addEventListener("click",function(){k.selectItem(S,!0)}),S.addEventListener("keydown",function(A){switch(A.keyCode){case u.default.keys.ENTER:k.selectItem(S,!0),A.preventDefault();break;case u.default.keys.ESCAPE:k.escape(),A.preventDefault();break}}),S}},{key:"buildLabel",value:function(){var E=document.createElement("span");return E.classList.add("ql-picker-label"),E.innerHTML=f.default,E.tabIndex="0",E.setAttribute("role","button"),E.setAttribute("aria-expanded","false"),this.container.appendChild(E),E}},{key:"buildOptions",value:function(){var E=this,k=document.createElement("span");k.classList.add("ql-picker-options"),k.setAttribute("aria-hidden","true"),k.tabIndex="-1",k.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",k.id),this.options=k,[].slice.call(this.select.options).forEach(function(S){var A=E.buildItem(S);k.appendChild(A),S.selected===!0&&E.selectItem(A)}),this.container.appendChild(k)}},{key:"buildPicker",value:function(){var E=this;[].slice.call(this.select.attributes).forEach(function(k){E.container.setAttribute(k.name,k.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var E=this;this.close(),setTimeout(function(){return E.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(E){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,S=this.container.querySelector(".ql-selected");if(E!==S&&(S?.classList.remove("ql-selected"),E!=null&&(E.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(E.parentNode.children,E),E.hasAttribute("data-value")?this.label.setAttribute("data-value",E.getAttribute("data-value")):this.label.removeAttribute("data-value"),E.hasAttribute("data-label")?this.label.setAttribute("data-label",E.getAttribute("data-label")):this.label.removeAttribute("data-label"),k))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var A=document.createEvent("Event");A.initEvent("change",!0,!0),this.select.dispatchEvent(A)}this.close()}}},{key:"update",value:function(){var E=void 0;if(this.select.selectedIndex>-1){var k=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];E=this.select.options[this.select.selectedIndex],this.selectItem(k)}else this.selectItem(null);var S=E!=null&&E!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",S)}}]),x}();n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=J(a),s=i(5),u=J(s),h=i(4),f=J(h),v=i(16),g=J(v),p=i(25),y=J(p),_=i(24),x=J(_),b=i(35),E=J(b),k=i(6),S=J(k),A=i(22),M=J(A),C=i(7),I=J(C),F=i(55),j=J(F),O=i(42),T=J(O),$=i(23),q=J($);function J(ae){return ae&&ae.__esModule?ae:{default:ae}}u.default.register({"blots/block":f.default,"blots/block/embed":h.BlockEmbed,"blots/break":g.default,"blots/container":y.default,"blots/cursor":x.default,"blots/embed":E.default,"blots/inline":S.default,"blots/scroll":M.default,"blots/text":I.default,"modules/clipboard":j.default,"modules/history":T.default,"modules/keyboard":q.default}),o.default.register(f.default,g.default,x.default,S.default,M.default,I.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function s(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(s.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),s.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var h;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?h=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?h=document.createElement(u):h=document.createElement(this.tagName[0])):h=document.createElement(this.tagName),this.className&&h.classList.add(this.className),h},s.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},s.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},s.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},s.prototype.deleteAt=function(u,h){var f=this.isolate(u,h);f.remove()},s.prototype.formatAt=function(u,h,f,v){var g=this.isolate(u,h);if(a.query(f,a.Scope.BLOT)!=null&&v)g.wrap(f,v);else if(a.query(f,a.Scope.ATTRIBUTE)!=null){var p=a.create(this.statics.scope);g.wrap(p),p.format(f,v)}},s.prototype.insertAt=function(u,h,f){var v=f==null?a.create("text",h):a.create(h,f),g=this.split(u);this.parent.insertBefore(v,g)},s.prototype.insertInto=function(u,h){h===void 0&&(h=null),this.parent!=null&&this.parent.children.remove(this);var f=null;u.children.insertBefore(this,h),h!=null&&(f=h.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=f)&&u.domNode.insertBefore(this.domNode,f),this.parent=u,this.attach()},s.prototype.isolate=function(u,h){var f=this.split(u);return f.split(h),f},s.prototype.length=function(){return 1},s.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},s.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},s.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},s.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},s.prototype.replaceWith=function(u,h){var f=typeof u=="string"?a.create(u,h):u;return f.replace(this),f},s.prototype.split=function(u,h){return u===0?this:this.next},s.prototype.update=function(u,h){},s.prototype.wrap=function(u,h){var f=typeof u=="string"?a.create(u,h):u;return this.parent!=null&&this.parent.insertBefore(f,this.next),f.appendChild(this),f},s.blotName="abstract",s}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),s=i(33),u=i(1),h=function(){function f(v){this.attributes={},this.domNode=v,this.build()}return f.prototype.attribute=function(v,g){g?v.add(this.domNode,g)&&(v.value(this.domNode)!=null?this.attributes[v.attrName]=v:delete this.attributes[v.attrName]):(v.remove(this.domNode),delete this.attributes[v.attrName])},f.prototype.build=function(){var v=this;this.attributes={};var g=a.default.keys(this.domNode),p=o.default.keys(this.domNode),y=s.default.keys(this.domNode);g.concat(p).concat(y).forEach(function(_){var x=u.query(_,u.Scope.ATTRIBUTE);x instanceof a.default&&(v.attributes[x.attrName]=x)})},f.prototype.copy=function(v){var g=this;Object.keys(this.attributes).forEach(function(p){var y=g.attributes[p].value(g.domNode);v.format(p,y)})},f.prototype.move=function(v){var g=this;this.copy(v),Object.keys(this.attributes).forEach(function(p){g.attributes[p].remove(g.domNode)}),this.attributes={}},f.prototype.values=function(){var v=this;return Object.keys(this.attributes).reduce(function(g,p){return g[p]=v.attributes[p].value(v.domNode),g},{})},f}();n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){h(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function s(h,f){var v=h.getAttribute("class")||"";return v.split(/\s+/).filter(function(g){return g.indexOf(f+"-")===0})}var u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.keys=function(v){return(v.getAttribute("class")||"").split(/\s+/).map(function(g){return g.split("-").slice(0,-1).join("-")})},f.prototype.add=function(v,g){return this.canAdd(v,g)?(this.remove(v),v.classList.add(this.keyName+"-"+g),!0):!1},f.prototype.remove=function(v){var g=s(v,this.keyName);g.forEach(function(p){v.classList.remove(p)}),v.classList.length===0&&v.removeAttribute("class")},f.prototype.value=function(v){var g=s(v,this.keyName)[0]||"",p=g.slice(this.keyName.length+1);return this.canAdd(v,p)?p:""},f}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){h(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function s(h){var f=h.split("-"),v=f.slice(1).map(function(g){return g[0].toUpperCase()+g.slice(1)}).join("");return f[0]+v}var u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.keys=function(v){return(v.getAttribute("style")||"").split(";").map(function(g){var p=g.split(":");return p[0].trim()})},f.prototype.add=function(v,g){return this.canAdd(v,g)?(v.style[s(this.keyName)]=g,!0):!1},f.prototype.remove=function(v){v.style[s(this.keyName)]="",v.getAttribute("style")||v.removeAttribute("style")},f.prototype.value=function(v){var g=v.style[s(this.keyName)];return this.canAdd(v,g)?g:""},f}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(h,f){for(var v=0;v<f.length;v++){var g=f[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}return function(h,f,v){return f&&u(h.prototype,f),v&&u(h,v),h}}();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(h,f){o(this,u),this.quill=h,this.options=f,this.modules={}}return a(u,[{key:"init",value:function(){var f=this;Object.keys(this.options.modules).forEach(function(v){f.modules[v]==null&&f.addModule(v)})}},{key:"addModule",value:function(f){var v=this.quill.constructor.import("modules/"+f);return this.modules[f]=new v(this.quill,this.options.modules[f]||{}),this.modules[f]}}]),u}();s.DEFAULTS={modules:{}},s.themes={default:s},n.default=s},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(E,k){for(var S=0;S<k.length;S++){var A=k[S];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(E,A.key,A)}}return function(E,k,S){return k&&b(E.prototype,k),S&&b(E,S),E}}(),o=function b(E,k,S){E===null&&(E=Function.prototype);var A=Object.getOwnPropertyDescriptor(E,k);if(A===void 0){var M=Object.getPrototypeOf(E);return M===null?void 0:b(M,k,S)}else{if("value"in A)return A.value;var C=A.get;return C===void 0?void 0:C.call(S)}},s=i(0),u=v(s),h=i(7),f=v(h);function v(b){return b&&b.__esModule?b:{default:b}}function g(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function p(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function y(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var _="\uFEFF",x=function(b){y(E,b);function E(k){g(this,E);var S=p(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,k));return S.contentNode=document.createElement("span"),S.contentNode.setAttribute("contenteditable",!1),[].slice.call(S.domNode.childNodes).forEach(function(A){S.contentNode.appendChild(A)}),S.leftGuard=document.createTextNode(_),S.rightGuard=document.createTextNode(_),S.domNode.appendChild(S.leftGuard),S.domNode.appendChild(S.contentNode),S.domNode.appendChild(S.rightGuard),S}return a(E,[{key:"index",value:function(S,A){return S===this.leftGuard?0:S===this.rightGuard?1:o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"index",this).call(this,S,A)}},{key:"restore",value:function(S){var A=void 0,M=void 0,C=S.data.split(_).join("");if(S===this.leftGuard)if(this.prev instanceof f.default){var I=this.prev.length();this.prev.insertAt(I,C),A={startNode:this.prev.domNode,startOffset:I+C.length}}else M=document.createTextNode(C),this.parent.insertBefore(u.default.create(M),this),A={startNode:M,startOffset:C.length};else S===this.rightGuard&&(this.next instanceof f.default?(this.next.insertAt(0,C),A={startNode:this.next.domNode,startOffset:C.length}):(M=document.createTextNode(C),this.parent.insertBefore(u.default.create(M),this.next),A={startNode:M,startOffset:C.length}));return S.data=_,A}},{key:"update",value:function(S,A){var M=this;S.forEach(function(C){if(C.type==="characterData"&&(C.target===M.leftGuard||C.target===M.rightGuard)){var I=M.restore(C.target);I&&(A.range=I)}})}}]),E}(u.default.Embed);n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},h=new o.default.Attributor.Attribute("align","align",u),f=new o.default.Attributor.Class("align","ql-align",u),v=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=h,n.AlignClass=f,n.AlignStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),s=i(26);function u(v){return v&&v.__esModule?v:{default:v}}var h=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),f=new s.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=h,n.BackgroundStyle=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},h=new o.default.Attributor.Attribute("direction","dir",u),f=new o.default.Attributor.Class("direction","ql-direction",u),v=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=h,n.DirectionClass=f,n.DirectionStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function b(E,k){for(var S=0;S<k.length;S++){var A=k[S];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(E,A.key,A)}}return function(E,k,S){return k&&b(E.prototype,k),S&&b(E,S),E}}(),o=function b(E,k,S){E===null&&(E=Function.prototype);var A=Object.getOwnPropertyDescriptor(E,k);if(A===void 0){var M=Object.getPrototypeOf(E);return M===null?void 0:b(M,k,S)}else{if("value"in A)return A.value;var C=A.get;return C===void 0?void 0:C.call(S)}},s=i(0),u=h(s);function h(b){return b&&b.__esModule?b:{default:b}}function f(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function v(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function g(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var p={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new u.default.Attributor.Class("font","ql-font",p),_=function(b){g(E,b);function E(){return f(this,E),v(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"value",value:function(S){return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"value",this).call(this,S).replace(/["']/g,"")}}]),E}(u.default.Attributor.Style),x=new _("font","font-family",p);n.FontStyle=x,n.FontClass=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=s(a);function s(f){return f&&f.__esModule?f:{default:f}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),h=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=h},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function k(S,A){for(var M=0;M<A.length;M++){var C=A[M];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}return function(S,A,M){return A&&k(S.prototype,A),M&&k(S,M),S}}(),o=i(0),s=g(o),u=i(5),h=g(u),f=i(9),v=g(f);function g(k){return k&&k.__esModule?k:{default:k}}function p(k,S){if(!(k instanceof S))throw new TypeError("Cannot call a class as a function")}function y(k,S){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:k}function _(k,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);k.prototype=Object.create(S&&S.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(k,S):k.__proto__=S)}var x=function(k){_(S,k);function S(A,M){p(this,S);var C=y(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,A,M));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(h.default.events.EDITOR_CHANGE,function(I,F,j,O){I!==h.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||O===h.default.sources.USER?C.record(F,j):C.transform(F))}),C.quill.keyboard.addBinding({key:"Z",shortKey:!0},C.undo.bind(C)),C.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},C.redo.bind(C)),/Win/i.test(navigator.platform)&&C.quill.keyboard.addBinding({key:"Y",shortKey:!0},C.redo.bind(C)),C}return a(S,[{key:"change",value:function(M,C){if(this.stack[M].length!==0){var I=this.stack[M].pop();this.stack[C].push(I),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(I[M],h.default.sources.USER),this.ignoreChange=!1;var F=E(I[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,C){if(M.ops.length!==0){this.stack.redo=[];var I=this.quill.getContents().diff(C),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var j=this.stack.undo.pop();I=I.compose(j.undo),M=j.redo.compose(M)}else this.lastRecorded=F;this.stack.undo.push({redo:M,undo:I}),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(C){C.undo=M.transform(C.undo,!0),C.redo=M.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=M.transform(C.undo,!0),C.redo=M.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),S}(v.default);x.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(k){var S=k.ops[k.ops.length-1];return S==null?!1:S.insert!=null?typeof S.insert=="string"&&S.insert.endsWith(`
144
+ `):S.attributes!=null?Object.keys(S.attributes).some(function(A){return s.default.query(A,s.default.Scope.BLOCK)!=null}):!1}function E(k){var S=k.reduce(function(M,C){return M+=C.delete||0,M},0),A=k.length()-S;return b(k)&&(A-=1),A}n.default=x,n.getLastChangeIndex=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function D(U,X){for(var ee=0;ee<X.length;ee++){var K=X[ee];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(U,K.key,K)}}return function(U,X,ee){return X&&D(U.prototype,X),ee&&D(U,ee),U}}(),o=function D(U,X,ee){U===null&&(U=Function.prototype);var K=Object.getOwnPropertyDescriptor(U,X);if(K===void 0){var oe=Object.getPrototypeOf(U);return oe===null?void 0:D(oe,X,ee)}else{if("value"in K)return K.value;var me=K.get;return me===void 0?void 0:me.call(ee)}},s=i(3),u=F(s),h=i(2),f=F(h),v=i(8),g=F(v),p=i(23),y=F(p),_=i(34),x=F(_),b=i(59),E=F(b),k=i(60),S=F(k),A=i(28),M=F(A),C=i(61),I=F(C);function F(D){return D&&D.__esModule?D:{default:D}}function j(D,U){if(!(D instanceof U))throw new TypeError("Cannot call a class as a function")}function O(D,U){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:D}function T(D,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);D.prototype=Object.create(U&&U.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(D,U):D.__proto__=U)}var $=[!1,"center","right","justify"],q=["#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"],J=[!1,"serif","monospace"],ae=["1","2","3",!1],ie=["small",!1,"large","huge"],Z=function(D){T(U,D);function U(X,ee){j(this,U);var K=O(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,ee)),oe=function me(de){if(!document.body.contains(X.root))return document.body.removeEventListener("click",me);K.tooltip!=null&&!K.tooltip.root.contains(de.target)&&document.activeElement!==K.tooltip.textbox&&!K.quill.hasFocus()&&K.tooltip.hide(),K.pickers!=null&&K.pickers.forEach(function(ye){ye.container.contains(de.target)||ye.close()})};return X.emitter.listenDOM("click",document.body,oe),K}return a(U,[{key:"addModule",value:function(ee){var K=o(U.prototype.__proto__||Object.getPrototypeOf(U.prototype),"addModule",this).call(this,ee);return ee==="toolbar"&&this.extendToolbar(K),K}},{key:"buildButtons",value:function(ee,K){ee.forEach(function(oe){var me=oe.getAttribute("class")||"";me.split(/\s+/).forEach(function(de){if(de.startsWith("ql-")&&(de=de.slice(3),K[de]!=null))if(de==="direction")oe.innerHTML=K[de][""]+K[de].rtl;else if(typeof K[de]=="string")oe.innerHTML=K[de];else{var ye=oe.value||"";ye!=null&&K[de][ye]&&(oe.innerHTML=K[de][ye])}})})}},{key:"buildPickers",value:function(ee,K){var oe=this;this.pickers=ee.map(function(de){if(de.classList.contains("ql-align"))return de.querySelector("option")==null&&B(de,$),new S.default(de,K.align);if(de.classList.contains("ql-background")||de.classList.contains("ql-color")){var ye=de.classList.contains("ql-background")?"background":"color";return de.querySelector("option")==null&&B(de,q,ye==="background"?"#ffffff":"#000000"),new E.default(de,K[ye])}else return de.querySelector("option")==null&&(de.classList.contains("ql-font")?B(de,J):de.classList.contains("ql-header")?B(de,ae):de.classList.contains("ql-size")&&B(de,ie)),new M.default(de)});var me=function(){oe.pickers.forEach(function(ye){ye.update()})};this.quill.on(g.default.events.EDITOR_CHANGE,me)}}]),U}(x.default);Z.DEFAULTS=(0,u.default)(!0,{},x.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var U=this,X=this.container.querySelector("input.ql-image[type=file]");X==null&&(X=document.createElement("input"),X.setAttribute("type","file"),X.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),X.classList.add("ql-image"),X.addEventListener("change",function(){if(X.files!=null&&X.files[0]!=null){var ee=new FileReader;ee.onload=function(K){var oe=U.quill.getSelection(!0);U.quill.updateContents(new f.default().retain(oe.index).delete(oe.length).insert({image:K.target.result}),g.default.sources.USER),U.quill.setSelection(oe.index+1,g.default.sources.SILENT),X.value=""},ee.readAsDataURL(X.files[0])}}),this.container.appendChild(X)),X.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var te=function(D){T(U,D);function U(X,ee){j(this,U);var K=O(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,ee));return K.textbox=K.root.querySelector('input[type="text"]'),K.listen(),K}return a(U,[{key:"listen",value:function(){var ee=this;this.textbox.addEventListener("keydown",function(K){y.default.match(K,"enter")?(ee.save(),K.preventDefault()):y.default.match(K,"escape")&&(ee.cancel(),K.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),K!=null?this.textbox.value=K:ee!==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-"+ee)||""),this.root.setAttribute("data-mode",ee)}},{key:"restoreFocus",value:function(){var ee=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=ee}},{key:"save",value:function(){var ee=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var K=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",ee,g.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",ee,g.default.sources.USER)),this.quill.root.scrollTop=K;break}case"video":ee=V(ee);case"formula":{if(!ee)break;var oe=this.quill.getSelection(!0);if(oe!=null){var me=oe.index+oe.length;this.quill.insertEmbed(me,this.root.getAttribute("data-mode"),ee,g.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(me+1," ",g.default.sources.USER),this.quill.setSelection(me+2,g.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),U}(I.default);function V(D){var U=D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return U?(U[1]||"https")+"://www.youtube.com/embed/"+U[2]+"?showinfo=0":(U=D.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(U[1]||"https")+"://player.vimeo.com/video/"+U[2]+"/":D}function B(D,U){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;U.forEach(function(ee){var K=document.createElement("option");ee===X?K.setAttribute("selected","selected"):K.setAttribute("value",ee),D.appendChild(K)})}n.BaseTooltip=te,n.default=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];this.insertBefore(s[0],null),s.length>1&&this.append.apply(this,s.slice(1))},o.prototype.contains=function(s){for(var u,h=this.iterator();u=h();)if(u===s)return!0;return!1},o.prototype.insertBefore=function(s,u){s&&(s.next=u,u!=null?(s.prev=u.prev,u.prev!=null&&(u.prev.next=s),u.prev=s,u===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 u=0,h=this.head;h!=null;){if(h===s)return u;u+=h.length(),h=h.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 u=s;return s!=null&&(s=s.next),u}},o.prototype.find=function(s,u){u===void 0&&(u=!1);for(var h,f=this.iterator();h=f();){var v=h.length();if(s<v||u&&s===v&&(h.next==null||h.next.length()!==0))return[h,s];s-=v}return[null,0]},o.prototype.forEach=function(s){for(var u,h=this.iterator();u=h();)s(u)},o.prototype.forEachAt=function(s,u,h){if(!(u<=0))for(var f=this.find(s),v=f[0],g=f[1],p,y=s-g,_=this.iterator(v);(p=_())&&y<s+u;){var x=p.length();s>y?h(p,s-y,Math.min(u,y+x-s)):h(p,0,Math.min(x,s+u-y)),y+=x}},o.prototype.map=function(s){return this.reduce(function(u,h){return u.push(s(h)),u},[])},o.prototype.reduce=function(s,u){for(var h,f=this.iterator();h=f();)u=s(u,h);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,p){g.__proto__=p}||function(g,p){for(var y in p)p.hasOwnProperty(y)&&(g[y]=p[y])};return function(g,p){v(g,p);function y(){this.constructor=g}g.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),s=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},h=100,f=function(v){a(g,v);function g(p){var y=v.call(this,p)||this;return y.scroll=y,y.observer=new MutationObserver(function(_){y.update(_)}),y.observer.observe(y.domNode,u),y.attach(),y}return g.prototype.detach=function(){v.prototype.detach.call(this),this.observer.disconnect()},g.prototype.deleteAt=function(p,y){this.update(),p===0&&y===this.length()?this.children.forEach(function(_){_.remove()}):v.prototype.deleteAt.call(this,p,y)},g.prototype.formatAt=function(p,y,_,x){this.update(),v.prototype.formatAt.call(this,p,y,_,x)},g.prototype.insertAt=function(p,y,_){this.update(),v.prototype.insertAt.call(this,p,y,_)},g.prototype.optimize=function(p,y){var _=this;p===void 0&&(p=[]),y===void 0&&(y={}),v.prototype.optimize.call(this,y);for(var x=[].slice.call(this.observer.takeRecords());x.length>0;)p.push(x.pop());for(var b=function(A,M){M===void 0&&(M=!0),!(A==null||A===_)&&A.domNode.parentNode!=null&&(A.domNode[s.DATA_KEY].mutations==null&&(A.domNode[s.DATA_KEY].mutations=[]),M&&b(A.parent))},E=function(A){A.domNode[s.DATA_KEY]==null||A.domNode[s.DATA_KEY].mutations==null||(A instanceof o.default&&A.children.forEach(E),A.optimize(y))},k=p,S=0;k.length>0;S+=1){if(S>=h)throw new Error("[Parchment] Maximum optimize iterations reached");for(k.forEach(function(A){var M=s.find(A.target,!0);M!=null&&(M.domNode===A.target&&(A.type==="childList"?(b(s.find(A.previousSibling,!1)),[].forEach.call(A.addedNodes,function(C){var I=s.find(C,!1);b(I,!1),I instanceof o.default&&I.children.forEach(function(F){b(F,!1)})})):A.type==="attributes"&&b(M.prev)),b(M))}),this.children.forEach(E),k=[].slice.call(this.observer.takeRecords()),x=k.slice();x.length>0;)p.push(x.pop())}},g.prototype.update=function(p,y){var _=this;y===void 0&&(y={}),p=p||this.observer.takeRecords(),p.map(function(x){var b=s.find(x.target,!0);return b==null?null:b.domNode[s.DATA_KEY].mutations==null?(b.domNode[s.DATA_KEY].mutations=[x],b):(b.domNode[s.DATA_KEY].mutations.push(x),null)}).forEach(function(x){x==null||x===_||x.domNode[s.DATA_KEY]==null||x.update(x.domNode[s.DATA_KEY].mutations||[],y)}),this.domNode[s.DATA_KEY].mutations!=null&&v.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,y),this.optimize(p,y)},g.blotName="scroll",g.defaultChild="block",g.scope=s.Scope.BLOCK_BLOT,g.tagName="DIV",g}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var p in g)g.hasOwnProperty(p)&&(v[p]=g[p])};return function(v,g){f(v,g);function p(){this.constructor=v}v.prototype=g===null?Object.create(g):(p.prototype=g.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),s=i(1);function u(f,v){if(Object.keys(f).length!==Object.keys(v).length)return!1;for(var g in f)if(f[g]!==v[g])return!1;return!0}var h=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.formats=function(g){if(g.tagName!==v.tagName)return f.formats.call(this,g)},v.prototype.format=function(g,p){var y=this;g===this.statics.blotName&&!p?(this.children.forEach(function(_){_ instanceof o.default||(_=_.wrap(v.blotName,!0)),y.attributes.copy(_)}),this.unwrap()):f.prototype.format.call(this,g,p)},v.prototype.formatAt=function(g,p,y,_){if(this.formats()[y]!=null||s.query(y,s.Scope.ATTRIBUTE)){var x=this.isolate(g,p);x.format(y,_)}else f.prototype.formatAt.call(this,g,p,y,_)},v.prototype.optimize=function(g){f.prototype.optimize.call(this,g);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var y=this.next;y instanceof v&&y.prev===this&&u(p,y.formats())&&(y.moveChildren(this),y.remove())},v.blotName="inline",v.scope=s.Scope.INLINE_BLOT,v.tagName="SPAN",v}(o.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){h(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),s=i(1),u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.formats=function(v){var g=s.query(f.blotName).tagName;if(v.tagName!==g)return h.formats.call(this,v)},f.prototype.format=function(v,g){s.query(v,s.Scope.BLOCK)!=null&&(v===this.statics.blotName&&!g?this.replaceWith(f.blotName):h.prototype.format.call(this,v,g))},f.prototype.formatAt=function(v,g,p,y){s.query(p,s.Scope.BLOCK)!=null?this.format(p,y):h.prototype.formatAt.call(this,v,g,p,y)},f.prototype.insertAt=function(v,g,p){if(p==null||s.query(g,s.Scope.INLINE)!=null)h.prototype.insertAt.call(this,v,g,p);else{var y=this.split(v),_=s.create(g,p);y.parent.insertBefore(_,y)}},f.prototype.update=function(v,g){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,v,g)},f.blotName="block",f.scope=s.Scope.BLOCK_BLOT,f.tagName="P",f}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var v in f)f.hasOwnProperty(v)&&(h[v]=f[v])};return function(h,f){u(h,f);function v(){this.constructor=h}h.prototype=f===null?Object.create(f):(v.prototype=f.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),s=function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.formats=function(f){},h.prototype.format=function(f,v){u.prototype.formatAt.call(this,0,this.length(),f,v)},h.prototype.formatAt=function(f,v,g,p){f===0&&v===this.length()?this.format(g,p):u.prototype.formatAt.call(this,f,v,g,p)},h.prototype.formats=function(){return this.statics.formats(this.domNode)},h}(o.default);n.default=s},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){h(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),s=i(1),u=function(h){a(f,h);function f(v){var g=h.call(this,v)||this;return g.text=g.statics.value(g.domNode),g}return f.create=function(v){return document.createTextNode(v)},f.value=function(v){var g=v.data;return g.normalize&&(g=g.normalize()),g},f.prototype.deleteAt=function(v,g){this.domNode.data=this.text=this.text.slice(0,v)+this.text.slice(v+g)},f.prototype.index=function(v,g){return this.domNode===v?g:-1},f.prototype.insertAt=function(v,g,p){p==null?(this.text=this.text.slice(0,v)+g+this.text.slice(v),this.domNode.data=this.text):h.prototype.insertAt.call(this,v,g,p)},f.prototype.length=function(){return this.text.length},f.prototype.optimize=function(v){h.prototype.optimize.call(this,v),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof f&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},f.prototype.position=function(v,g){return[this.domNode,v]},f.prototype.split=function(v,g){if(g===void 0&&(g=!1),!g){if(v===0)return this;if(v===this.length())return this.next}var p=s.create(this.domNode.splitText(v));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},f.prototype.update=function(v,g){var p=this;v.some(function(y){return y.type==="characterData"&&y.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},f.prototype.value=function(){return this.text},f.blotName="text",f.scope=s.Scope.INLINE_BLOT,f}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(s,u){return arguments.length>1&&!this.contains(s)==!u?u:o.call(this,s)}}String.prototype.startsWith||(String.prototype.startsWith=function(s,u){return u=u||0,this.substr(u,s.length)===s}),String.prototype.endsWith||(String.prototype.endsWith=function(s,u){var h=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>h.length)&&(u=h.length),u-=s.length;var f=h.indexOf(s,u);return f!==-1&&f===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var h=Object(this),f=h.length>>>0,v=arguments[1],g,p=0;p<f;p++)if(g=h[p],u.call(v,g,p,h))return g}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function s(S,A,M){if(S==A)return S?[[o,S]]:[];(M<0||S.length<M)&&(M=null);var C=v(S,A),I=S.substring(0,C);S=S.substring(C),A=A.substring(C),C=g(S,A);var F=S.substring(S.length-C);S=S.substring(0,S.length-C),A=A.substring(0,A.length-C);var j=u(S,A);return I&&j.unshift([o,I]),F&&j.push([o,F]),y(j),M!=null&&(j=b(j,M)),j=E(j),j}function u(S,A){var M;if(!S)return[[a,A]];if(!A)return[[i,S]];var C=S.length>A.length?S:A,I=S.length>A.length?A:S,F=C.indexOf(I);if(F!=-1)return M=[[a,C.substring(0,F)],[o,I],[a,C.substring(F+I.length)]],S.length>A.length&&(M[0][0]=M[2][0]=i),M;if(I.length==1)return[[i,S],[a,A]];var j=p(S,A);if(j){var O=j[0],T=j[1],$=j[2],q=j[3],J=j[4],ae=s(O,$),ie=s(T,q);return ae.concat([[o,J]],ie)}return h(S,A)}function h(S,A){for(var M=S.length,C=A.length,I=Math.ceil((M+C)/2),F=I,j=2*I,O=new Array(j),T=new Array(j),$=0;$<j;$++)O[$]=-1,T[$]=-1;O[F+1]=0,T[F+1]=0;for(var q=M-C,J=q%2!=0,ae=0,ie=0,Z=0,te=0,V=0;V<I;V++){for(var B=-V+ae;B<=V-ie;B+=2){var D=F+B,U;B==-V||B!=V&&O[D-1]<O[D+1]?U=O[D+1]:U=O[D-1]+1;for(var X=U-B;U<M&&X<C&&S.charAt(U)==A.charAt(X);)U++,X++;if(O[D]=U,U>M)ie+=2;else if(X>C)ae+=2;else if(J){var ee=F+q-B;if(ee>=0&&ee<j&&T[ee]!=-1){var K=M-T[ee];if(U>=K)return f(S,A,U,X)}}}for(var oe=-V+Z;oe<=V-te;oe+=2){var ee=F+oe,K;oe==-V||oe!=V&&T[ee-1]<T[ee+1]?K=T[ee+1]:K=T[ee-1]+1;for(var me=K-oe;K<M&&me<C&&S.charAt(M-K-1)==A.charAt(C-me-1);)K++,me++;if(T[ee]=K,K>M)te+=2;else if(me>C)Z+=2;else if(!J){var D=F+q-oe;if(D>=0&&D<j&&O[D]!=-1){var U=O[D],X=F+U-D;if(K=M-K,U>=K)return f(S,A,U,X)}}}}return[[i,S],[a,A]]}function f(S,A,M,C){var I=S.substring(0,M),F=A.substring(0,C),j=S.substring(M),O=A.substring(C),T=s(I,F),$=s(j,O);return T.concat($)}function v(S,A){if(!S||!A||S.charAt(0)!=A.charAt(0))return 0;for(var M=0,C=Math.min(S.length,A.length),I=C,F=0;M<I;)S.substring(F,I)==A.substring(F,I)?(M=I,F=M):C=I,I=Math.floor((C-M)/2+M);return I}function g(S,A){if(!S||!A||S.charAt(S.length-1)!=A.charAt(A.length-1))return 0;for(var M=0,C=Math.min(S.length,A.length),I=C,F=0;M<I;)S.substring(S.length-I,S.length-F)==A.substring(A.length-I,A.length-F)?(M=I,F=M):C=I,I=Math.floor((C-M)/2+M);return I}function p(S,A){var M=S.length>A.length?S:A,C=S.length>A.length?A:S;if(M.length<4||C.length*2<M.length)return null;function I(ie,Z,te){for(var V=ie.substring(te,te+Math.floor(ie.length/4)),B=-1,D="",U,X,ee,K;(B=Z.indexOf(V,B+1))!=-1;){var oe=v(ie.substring(te),Z.substring(B)),me=g(ie.substring(0,te),Z.substring(0,B));D.length<me+oe&&(D=Z.substring(B-me,B)+Z.substring(B,B+oe),U=ie.substring(0,te-me),X=ie.substring(te+oe),ee=Z.substring(0,B-me),K=Z.substring(B+oe))}return D.length*2>=ie.length?[U,X,ee,K,D]:null}var F=I(M,C,Math.ceil(M.length/4)),j=I(M,C,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 T,$,q,J;S.length>A.length?(T=O[0],$=O[1],q=O[2],J=O[3]):(q=O[0],J=O[1],T=O[2],$=O[3]);var ae=O[4];return[T,$,q,J,ae]}function y(S){S.push([o,""]);for(var A=0,M=0,C=0,I="",F="",j;A<S.length;)switch(S[A][0]){case a:C++,F+=S[A][1],A++;break;case i:M++,I+=S[A][1],A++;break;case o:M+C>1?(M!==0&&C!==0&&(j=v(F,I),j!==0&&(A-M-C>0&&S[A-M-C-1][0]==o?S[A-M-C-1][1]+=F.substring(0,j):(S.splice(0,0,[o,F.substring(0,j)]),A++),F=F.substring(j),I=I.substring(j)),j=g(F,I),j!==0&&(S[A][1]=F.substring(F.length-j)+S[A][1],F=F.substring(0,F.length-j),I=I.substring(0,I.length-j))),M===0?S.splice(A-C,M+C,[a,F]):C===0?S.splice(A-M,M+C,[i,I]):S.splice(A-M-C,M+C,[i,I],[a,F]),A=A-M-C+(M?1:0)+(C?1:0)+1):A!==0&&S[A-1][0]==o?(S[A-1][1]+=S[A][1],S.splice(A,1)):A++,C=0,M=0,I="",F="";break}S[S.length-1][1]===""&&S.pop();var O=!1;for(A=1;A<S.length-1;)S[A-1][0]==o&&S[A+1][0]==o&&(S[A][1].substring(S[A][1].length-S[A-1][1].length)==S[A-1][1]?(S[A][1]=S[A-1][1]+S[A][1].substring(0,S[A][1].length-S[A-1][1].length),S[A+1][1]=S[A-1][1]+S[A+1][1],S.splice(A-1,1),O=!0):S[A][1].substring(0,S[A+1][1].length)==S[A+1][1]&&(S[A-1][1]+=S[A+1][1],S[A][1]=S[A][1].substring(S[A+1][1].length)+S[A+1][1],S.splice(A+1,1),O=!0)),A++;O&&y(S)}var _=s;_.INSERT=a,_.DELETE=i,_.EQUAL=o,r.exports=_;function x(S,A){if(A===0)return[o,S];for(var M=0,C=0;C<S.length;C++){var I=S[C];if(I[0]===i||I[0]===o){var F=M+I[1].length;if(A===F)return[C+1,S];if(A<F){S=S.slice();var j=A-M,O=[I[0],I[1].slice(0,j)],T=[I[0],I[1].slice(j)];return S.splice(C,1,O,T),[C+1,S]}else M=F}}throw new Error("cursor_pos is out of bounds!")}function b(S,A){var M=x(S,A),C=M[1],I=M[0],F=C[I],j=C[I+1];if(F==null)return S;if(F[0]!==o)return S;if(j!=null&&F[1]+j[1]===j[1]+F[1])return C.splice(I,2,j,F),k(C,I,2);if(j!=null&&j[1].indexOf(F[1])===0){C.splice(I,2,[j[0],F[1]],[0,F[1]]);var O=j[1].slice(F[1].length);return O.length>0&&C.splice(I+2,0,[j[0],O]),k(C,I,3)}else return S}function E(S){for(var A=!1,M=function(j){return j.charCodeAt(0)>=56320&&j.charCodeAt(0)<=57343},C=function(j){return j.charCodeAt(j.length-1)>=55296&&j.charCodeAt(j.length-1)<=56319},I=2;I<S.length;I+=1)S[I-2][0]===o&&C(S[I-2][1])&&S[I-1][0]===i&&M(S[I-1][1])&&S[I][0]===a&&M(S[I][1])&&(A=!0,S[I-1][1]=S[I-2][1].slice(-1)+S[I-1][1],S[I][1]=S[I-2][1].slice(-1)+S[I][1],S[I-2][1]=S[I-2][1].slice(0,-1));if(!A)return S;for(var F=[],I=0;I<S.length;I+=1)S[I][1].length>0&&F.push(S[I]);return F}function k(S,A,M){for(var C=A+M-1;C>=0&&C>=A-1;C--)if(C+1<S.length){var I=S[C],F=S[C+1];I[0]===F[1]&&S.splice(C,2,[I[0],I[1]+F[1]])}return S}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var s in a)o.push(s);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(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(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function s(h,f,v){this.fn=h,this.context=f,this.once=v||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],v,g;if(this._eventsCount===0)return f;for(g in v=this._events)i.call(v,g)&&f.push(a?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(v)):f},u.prototype.listeners=function(f,v){var g=a?a+f:f,p=this._events[g];if(v)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var y=0,_=p.length,x=new Array(_);y<_;y++)x[y]=p[y].fn;return x},u.prototype.emit=function(f,v,g,p,y,_){var x=a?a+f:f;if(!this._events[x])return!1;var b=this._events[x],E=arguments.length,k,S;if(b.fn){switch(b.once&&this.removeListener(f,b.fn,void 0,!0),E){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,v),!0;case 3:return b.fn.call(b.context,v,g),!0;case 4:return b.fn.call(b.context,v,g,p),!0;case 5:return b.fn.call(b.context,v,g,p,y),!0;case 6:return b.fn.call(b.context,v,g,p,y,_),!0}for(S=1,k=new Array(E-1);S<E;S++)k[S-1]=arguments[S];b.fn.apply(b.context,k)}else{var A=b.length,M;for(S=0;S<A;S++)switch(b[S].once&&this.removeListener(f,b[S].fn,void 0,!0),E){case 1:b[S].fn.call(b[S].context);break;case 2:b[S].fn.call(b[S].context,v);break;case 3:b[S].fn.call(b[S].context,v,g);break;case 4:b[S].fn.call(b[S].context,v,g,p);break;default:if(!k)for(M=1,k=new Array(E-1);M<E;M++)k[M-1]=arguments[M];b[S].fn.apply(b[S].context,k)}}return!0},u.prototype.on=function(f,v,g){var p=new s(v,g||this),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},u.prototype.once=function(f,v,g){var p=new s(v,g||this,!0),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},u.prototype.removeListener=function(f,v,g,p){var y=a?a+f:f;if(!this._events[y])return this;if(!v)return--this._eventsCount===0?this._events=new o:delete this._events[y],this;var _=this._events[y];if(_.fn)_.fn===v&&(!p||_.once)&&(!g||_.context===g)&&(--this._eventsCount===0?this._events=new o:delete this._events[y]);else{for(var x=0,b=[],E=_.length;x<E;x++)(_[x].fn!==v||p&&!_[x].once||g&&_[x].context!==g)&&b.push(_[x]);b.length?this._events[y]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new o:delete this._events[y]}return this},u.prototype.removeAllListeners=function(f){var v;return f?(v=a?a+f:f,this._events[v]&&(--this._eventsCount===0?this._events=new o:delete this._events[v])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Oe){return typeof Oe}:function(Oe){return Oe&&typeof Symbol=="function"&&Oe.constructor===Symbol&&Oe!==Symbol.prototype?"symbol":typeof Oe},o=function(){function Oe(fe,Le){var Ne=[],ue=!0,ke=!1,Pe=void 0;try{for(var Ue=fe[Symbol.iterator](),st;!(ue=(st=Ue.next()).done)&&(Ne.push(st.value),!(Le&&Ne.length===Le));ue=!0);}catch(dt){ke=!0,Pe=dt}finally{try{!ue&&Ue.return&&Ue.return()}finally{if(ke)throw Pe}}return Ne}return function(fe,Le){if(Array.isArray(fe))return fe;if(Symbol.iterator in Object(fe))return Oe(fe,Le);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function Oe(fe,Le){for(var Ne=0;Ne<Le.length;Ne++){var ue=Le[Ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(fe,ue.key,ue)}}return function(fe,Le,Ne){return Le&&Oe(fe.prototype,Le),Ne&&Oe(fe,Ne),fe}}(),u=i(3),h=T(u),f=i(2),v=T(f),g=i(0),p=T(g),y=i(5),_=T(y),x=i(10),b=T(x),E=i(9),k=T(E),S=i(36),A=i(37),M=i(13),C=T(M),I=i(26),F=i(38),j=i(39),O=i(40);function T(Oe){return Oe&&Oe.__esModule?Oe:{default:Oe}}function $(Oe,fe,Le){return fe in Oe?Object.defineProperty(Oe,fe,{value:Le,enumerable:!0,configurable:!0,writable:!0}):Oe[fe]=Le,Oe}function q(Oe,fe){if(!(Oe instanceof fe))throw new TypeError("Cannot call a class as a function")}function J(Oe,fe){if(!Oe)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe&&(typeof fe=="object"||typeof fe=="function")?fe:Oe}function ae(Oe,fe){if(typeof fe!="function"&&fe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof fe);Oe.prototype=Object.create(fe&&fe.prototype,{constructor:{value:Oe,enumerable:!1,writable:!0,configurable:!0}}),fe&&(Object.setPrototypeOf?Object.setPrototypeOf(Oe,fe):Oe.__proto__=fe)}var ie=(0,b.default)("quill:clipboard"),Z="__ql-matcher",te=[[Node.TEXT_NODE,Be],[Node.TEXT_NODE,Ee],["br",Te],[Node.ELEMENT_NODE,Ee],[Node.ELEMENT_NODE,ye],[Node.ELEMENT_NODE,ge],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,Re],["li",Ie],["b",me.bind(me,"bold")],["i",me.bind(me,"italic")],["style",Ce]],V=[S.AlignAttribute,F.DirectionAttribute].reduce(function(Oe,fe){return Oe[fe.keyName]=fe,Oe},{}),B=[S.AlignStyle,A.BackgroundStyle,I.ColorStyle,F.DirectionStyle,j.FontStyle,O.SizeStyle].reduce(function(Oe,fe){return Oe[fe.keyName]=fe,Oe},{}),D=function(Oe){ae(fe,Oe);function fe(Le,Ne){q(this,fe);var ue=J(this,(fe.__proto__||Object.getPrototypeOf(fe)).call(this,Le,Ne));return ue.quill.root.addEventListener("paste",ue.onPaste.bind(ue)),ue.container=ue.quill.addContainer("ql-clipboard"),ue.container.setAttribute("contenteditable",!0),ue.container.setAttribute("tabindex",-1),ue.matchers=[],te.concat(ue.options.matchers).forEach(function(ke){var Pe=o(ke,2),Ue=Pe[0],st=Pe[1];!Ne.matchVisual&&st===ge||ue.addMatcher(Ue,st)}),ue}return s(fe,[{key:"addMatcher",value:function(Ne,ue){this.matchers.push([Ne,ue])}},{key:"convert",value:function(Ne){if(typeof Ne=="string")return this.container.innerHTML=Ne.replace(/\>\r?\n +\</g,"><"),this.convert();var ue=this.quill.getFormat(this.quill.selection.savedRange.index);if(ue[C.default.blotName]){var ke=this.container.innerText;return this.container.innerHTML="",new v.default().insert(ke,$({},C.default.blotName,ue[C.default.blotName]))}var Pe=this.prepareMatching(),Ue=o(Pe,2),st=Ue[0],dt=Ue[1],pt=oe(this.container,st,dt);return ee(pt,`
145
+ `)&&pt.ops[pt.ops.length-1].attributes==null&&(pt=pt.compose(new v.default().retain(pt.length()-1).delete(1))),ie.log("convert",this.container.innerHTML,pt),this.container.innerHTML="",pt}},{key:"dangerouslyPasteHTML",value:function(Ne,ue){var ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof Ne=="string")this.quill.setContents(this.convert(Ne),ue),this.quill.setSelection(0,_.default.sources.SILENT);else{var Pe=this.convert(ue);this.quill.updateContents(new v.default().retain(Ne).concat(Pe),ke),this.quill.setSelection(Ne+Pe.length(),_.default.sources.SILENT)}}},{key:"onPaste",value:function(Ne){var ue=this;if(!(Ne.defaultPrevented||!this.quill.isEnabled())){var ke=this.quill.getSelection(),Pe=new v.default().retain(ke.index),Ue=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(_.default.sources.SILENT),setTimeout(function(){Pe=Pe.concat(ue.convert()).delete(ke.length),ue.quill.updateContents(Pe,_.default.sources.USER),ue.quill.setSelection(Pe.length()-ke.length,_.default.sources.SILENT),ue.quill.scrollingContainer.scrollTop=Ue,ue.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Ne=this,ue=[],ke=[];return this.matchers.forEach(function(Pe){var Ue=o(Pe,2),st=Ue[0],dt=Ue[1];switch(st){case Node.TEXT_NODE:ke.push(dt);break;case Node.ELEMENT_NODE:ue.push(dt);break;default:[].forEach.call(Ne.container.querySelectorAll(st),function(pt){pt[Z]=pt[Z]||[],pt[Z].push(dt)});break}}),[ue,ke]}}]),fe}(k.default);D.DEFAULTS={matchers:[],matchVisual:!0};function U(Oe,fe,Le){return(typeof fe>"u"?"undefined":a(fe))==="object"?Object.keys(fe).reduce(function(Ne,ue){return U(Ne,ue,fe[ue])},Oe):Oe.reduce(function(Ne,ue){return ue.attributes&&ue.attributes[fe]?Ne.push(ue):Ne.insert(ue.insert,(0,h.default)({},$({},fe,Le),ue.attributes))},new v.default)}function X(Oe){if(Oe.nodeType!==Node.ELEMENT_NODE)return{};var fe="__ql-computed-style";return Oe[fe]||(Oe[fe]=window.getComputedStyle(Oe))}function ee(Oe,fe){for(var Le="",Ne=Oe.ops.length-1;Ne>=0&&Le.length<fe.length;--Ne){var ue=Oe.ops[Ne];if(typeof ue.insert!="string")break;Le=ue.insert+Le}return Le.slice(-1*fe.length)===fe}function K(Oe){if(Oe.childNodes.length===0)return!1;var fe=X(Oe);return["block","list-item"].indexOf(fe.display)>-1}function oe(Oe,fe,Le){return Oe.nodeType===Oe.TEXT_NODE?Le.reduce(function(Ne,ue){return ue(Oe,Ne)},new v.default):Oe.nodeType===Oe.ELEMENT_NODE?[].reduce.call(Oe.childNodes||[],function(Ne,ue){var ke=oe(ue,fe,Le);return ue.nodeType===Oe.ELEMENT_NODE&&(ke=fe.reduce(function(Pe,Ue){return Ue(ue,Pe)},ke),ke=(ue[Z]||[]).reduce(function(Pe,Ue){return Ue(ue,Pe)},ke)),Ne.concat(ke)},new v.default):new v.default}function me(Oe,fe,Le){return U(Le,Oe,!0)}function de(Oe,fe){var Le=p.default.Attributor.Attribute.keys(Oe),Ne=p.default.Attributor.Class.keys(Oe),ue=p.default.Attributor.Style.keys(Oe),ke={};return Le.concat(Ne).concat(ue).forEach(function(Pe){var Ue=p.default.query(Pe,p.default.Scope.ATTRIBUTE);Ue!=null&&(ke[Ue.attrName]=Ue.value(Oe),ke[Ue.attrName])||(Ue=V[Pe],Ue!=null&&(Ue.attrName===Pe||Ue.keyName===Pe)&&(ke[Ue.attrName]=Ue.value(Oe)||void 0),Ue=B[Pe],Ue!=null&&(Ue.attrName===Pe||Ue.keyName===Pe)&&(Ue=B[Pe],ke[Ue.attrName]=Ue.value(Oe)||void 0))}),Object.keys(ke).length>0&&(fe=U(fe,ke)),fe}function ye(Oe,fe){var Le=p.default.query(Oe);if(Le==null)return fe;if(Le.prototype instanceof p.default.Embed){var Ne={},ue=Le.value(Oe);ue!=null&&(Ne[Le.blotName]=ue,fe=new v.default().insert(Ne,Le.formats(Oe)))}else typeof Le.formats=="function"&&(fe=U(fe,Le.blotName,Le.formats(Oe)));return fe}function Te(Oe,fe){return ee(fe,`
146
+ `)||fe.insert(`
147
+ `),fe}function Ce(){return new v.default}function Ie(Oe,fe){var Le=p.default.query(Oe);if(Le==null||Le.blotName!=="list-item"||!ee(fe,`
148
+ `))return fe;for(var Ne=-1,ue=Oe.parentNode;!ue.classList.contains("ql-clipboard");)(p.default.query(ue)||{}).blotName==="list"&&(Ne+=1),ue=ue.parentNode;return Ne<=0?fe:fe.compose(new v.default().retain(fe.length()-1).retain(1,{indent:Ne}))}function Ee(Oe,fe){return ee(fe,`
149
+ `)||(K(Oe)||fe.length()>0&&Oe.nextSibling&&K(Oe.nextSibling))&&fe.insert(`
150
+ `),fe}function ge(Oe,fe){if(K(Oe)&&Oe.nextElementSibling!=null&&!ee(fe,`
151
+
152
+ `)){var Le=Oe.offsetHeight+parseFloat(X(Oe).marginTop)+parseFloat(X(Oe).marginBottom);Oe.nextElementSibling.offsetTop>Oe.offsetTop+Le*1.5&&fe.insert(`
153
+ `)}return fe}function Re(Oe,fe){var Le={},Ne=Oe.style||{};return Ne.fontStyle&&X(Oe).fontStyle==="italic"&&(Le.italic=!0),Ne.fontWeight&&(X(Oe).fontWeight.startsWith("bold")||parseInt(X(Oe).fontWeight)>=700)&&(Le.bold=!0),Object.keys(Le).length>0&&(fe=U(fe,Le)),parseFloat(Ne.textIndent||0)>0&&(fe=new v.default().insert(" ").concat(fe)),fe}function Be(Oe,fe){var Le=Oe.data;if(Oe.parentNode.tagName==="O:P")return fe.insert(Le.trim());if(Le.trim().length===0&&Oe.parentNode.classList.contains("ql-clipboard"))return fe;if(!X(Oe.parentNode).whiteSpace.startsWith("pre")){var Ne=function(ke,Pe){return Pe=Pe.replace(/[^\u00a0]/g,""),Pe.length<1&&ke?" ":Pe};Le=Le.replace(/\r\n/g," ").replace(/\n/g," "),Le=Le.replace(/\s\s+/g,Ne.bind(Ne,!0)),(Oe.previousSibling==null&&K(Oe.parentNode)||Oe.previousSibling!=null&&K(Oe.previousSibling))&&(Le=Le.replace(/^\s+/,Ne.bind(Ne,!1))),(Oe.nextSibling==null&&K(Oe.parentNode)||Oe.nextSibling!=null&&K(Oe.nextSibling))&&(Le=Le.replace(/\s+$/,Ne.bind(Ne,!1)))}return fe.insert(Le)}n.default=D,n.matchAttributor=de,n.matchBlot=ye,n.matchNewline=Ee,n.matchSpacing=ge,n.matchText=Be},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function v(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){g(_,y);function _(){return f(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"optimize",value:function(b){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),_}(u.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function O(T,$){var q=[],J=!0,ae=!1,ie=void 0;try{for(var Z=T[Symbol.iterator](),te;!(J=(te=Z.next()).done)&&(q.push(te.value),!($&&q.length===$));J=!0);}catch(V){ae=!0,ie=V}finally{try{!J&&Z.return&&Z.return()}finally{if(ae)throw ie}}return q}return function(T,$){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return O(T,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function O(T,$){for(var q=0;q<$.length;q++){var J=$[q];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(T,J.key,J)}}return function(T,$,q){return $&&O(T.prototype,$),q&&O(T,q),T}}(),s=i(2),u=b(s),h=i(0),f=b(h),v=i(5),g=b(v),p=i(10),y=b(p),_=i(9),x=b(_);function b(O){return O&&O.__esModule?O:{default:O}}function E(O,T,$){return T in O?Object.defineProperty(O,T,{value:$,enumerable:!0,configurable:!0,writable:!0}):O[T]=$,O}function k(O,T){if(!(O instanceof T))throw new TypeError("Cannot call a class as a function")}function S(O,T){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:O}function A(O,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);O.prototype=Object.create(T&&T.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(O,T):O.__proto__=T)}var M=(0,y.default)("quill:toolbar"),C=function(O){A(T,O);function T($,q){k(this,T);var J=S(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,$,q));if(Array.isArray(J.options.container)){var ae=document.createElement("div");F(ae,J.options.container),$.container.parentNode.insertBefore(ae,$.container),J.container=ae}else typeof J.options.container=="string"?J.container=document.querySelector(J.options.container):J.container=J.options.container;if(!(J.container instanceof HTMLElement)){var ie;return ie=M.error("Container required for toolbar",J.options),S(J,ie)}return J.container.classList.add("ql-toolbar"),J.controls=[],J.handlers={},Object.keys(J.options.handlers).forEach(function(Z){J.addHandler(Z,J.options.handlers[Z])}),[].forEach.call(J.container.querySelectorAll("button, select"),function(Z){J.attach(Z)}),J.quill.on(g.default.events.EDITOR_CHANGE,function(Z,te){Z===g.default.events.SELECTION_CHANGE&&J.update(te)}),J.quill.on(g.default.events.SCROLL_OPTIMIZE,function(){var Z=J.quill.selection.getRange(),te=a(Z,1),V=te[0];J.update(V)}),J}return o(T,[{key:"addHandler",value:function(q,J){this.handlers[q]=J}},{key:"attach",value:function(q){var J=this,ae=[].find.call(q.classList,function(Z){return Z.indexOf("ql-")===0});if(ae){if(ae=ae.slice(3),q.tagName==="BUTTON"&&q.setAttribute("type","button"),this.handlers[ae]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[ae]==null){M.warn("ignoring attaching to disabled format",ae,q);return}if(f.default.query(ae)==null){M.warn("ignoring attaching to nonexistent format",ae,q);return}}var ie=q.tagName==="SELECT"?"change":"click";q.addEventListener(ie,function(Z){var te=void 0;if(q.tagName==="SELECT"){if(q.selectedIndex<0)return;var V=q.options[q.selectedIndex];V.hasAttribute("selected")?te=!1:te=V.value||!1}else q.classList.contains("ql-active")?te=!1:te=q.value||!q.hasAttribute("value"),Z.preventDefault();J.quill.focus();var B=J.quill.selection.getRange(),D=a(B,1),U=D[0];if(J.handlers[ae]!=null)J.handlers[ae].call(J,te);else if(f.default.query(ae).prototype instanceof f.default.Embed){if(te=prompt("Enter "+ae),!te)return;J.quill.updateContents(new u.default().retain(U.index).delete(U.length).insert(E({},ae,te)),g.default.sources.USER)}else J.quill.format(ae,te,g.default.sources.USER);J.update(U)}),this.controls.push([ae,q])}}},{key:"update",value:function(q){var J=q==null?{}:this.quill.getFormat(q);this.controls.forEach(function(ae){var ie=a(ae,2),Z=ie[0],te=ie[1];if(te.tagName==="SELECT"){var V=void 0;if(q==null)V=null;else if(J[Z]==null)V=te.querySelector("option[selected]");else if(!Array.isArray(J[Z])){var B=J[Z];typeof B=="string"&&(B=B.replace(/\"/g,'\\"')),V=te.querySelector('option[value="'+B+'"]')}V==null?(te.value="",te.selectedIndex=-1):V.selected=!0}else if(q==null)te.classList.remove("ql-active");else if(te.hasAttribute("value")){var D=J[Z]===te.getAttribute("value")||J[Z]!=null&&J[Z].toString()===te.getAttribute("value")||J[Z]==null&&!te.getAttribute("value");te.classList.toggle("ql-active",D)}else te.classList.toggle("ql-active",J[Z]!=null)})}}]),T}(x.default);C.DEFAULTS={};function I(O,T,$){var q=document.createElement("button");q.setAttribute("type","button"),q.classList.add("ql-"+T),$!=null&&(q.value=$),O.appendChild(q)}function F(O,T){Array.isArray(T[0])||(T=[T]),T.forEach(function($){var q=document.createElement("span");q.classList.add("ql-formats"),$.forEach(function(J){if(typeof J=="string")I(q,J);else{var ae=Object.keys(J)[0],ie=J[ae];Array.isArray(ie)?j(q,ae,ie):I(q,ae,ie)}}),O.appendChild(q)})}function j(O,T,$){var q=document.createElement("select");q.classList.add("ql-"+T),$.forEach(function(J){var ae=document.createElement("option");J!==!1?ae.setAttribute("value",J):ae.setAttribute("selected","selected"),q.appendChild(ae)}),O.appendChild(q)}C.DEFAULTS={container:null,handlers:{clean:function(){var T=this,$=this.quill.getSelection();if($!=null)if($.length==0){var q=this.quill.getFormat();Object.keys(q).forEach(function(J){f.default.query(J,f.default.Scope.INLINE)!=null&&T.quill.format(J,!1)})}else this.quill.removeFormat($,g.default.sources.USER)},direction:function(T){var $=this.quill.getFormat().align;T==="rtl"&&$==null?this.quill.format("align","right",g.default.sources.USER):!T&&$==="right"&&this.quill.format("align",!1,g.default.sources.USER),this.quill.format("direction",T,g.default.sources.USER)},indent:function(T){var $=this.quill.getSelection(),q=this.quill.getFormat($),J=parseInt(q.indent||0);if(T==="+1"||T==="-1"){var ae=T==="+1"?1:-1;q.direction==="rtl"&&(ae*=-1),this.quill.format("indent",J+ae,g.default.sources.USER)}},link:function(T){T===!0&&(T=prompt("Enter link URL:")),this.quill.format("link",T,g.default.sources.USER)},list:function(T){var $=this.quill.getSelection(),q=this.quill.getFormat($);T==="check"?q.list==="checked"||q.list==="unchecked"?this.quill.format("list",!1,g.default.sources.USER):this.quill.format("list","unchecked",g.default.sources.USER):this.quill.format("list",T,g.default.sources.USER)}}},n.default=C,n.addControls=F},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function v(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){g(_,y);function _(x,b){f(this,_);var E=v(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return E.label.innerHTML=b,E.container.classList.add("ql-color-picker"),[].slice.call(E.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(k){k.classList.add("ql-primary")}),E}return a(_,[{key:"buildItem",value:function(b){var E=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"buildItem",this).call(this,b);return E.style.backgroundColor=b.getAttribute("value")||"",E}},{key:"selectItem",value:function(b,E){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,E);var k=this.label.querySelector(".ql-color-label"),S=b&&b.getAttribute("data-value")||"";k&&(k.tagName==="line"?k.style.stroke=S:k.style.fill=S)}}]),_}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function v(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){g(_,y);function _(x,b){f(this,_);var E=v(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return E.container.classList.add("ql-icon-picker"),[].forEach.call(E.container.querySelectorAll(".ql-picker-item"),function(k){k.innerHTML=b[k.getAttribute("data-value")||""]}),E.defaultItem=E.container.querySelector(".ql-selected"),E.selectItem(E.defaultItem),E}return a(_,[{key:"selectItem",value:function(b,E){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,E),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),_}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(h,f){for(var v=0;v<f.length;v++){var g=f[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}return function(h,f,v){return f&&u(h.prototype,f),v&&u(h,v),h}}();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(h,f){var v=this;o(this,u),this.quill=h,this.boundsContainer=f||document.body,this.root=h.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){v.root.style.marginTop=-1*v.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(f){var v=f.left+f.width/2-this.root.offsetWidth/2,g=f.bottom+this.quill.root.scrollTop;this.root.style.left=v+"px",this.root.style.top=g+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),_=0;if(y.right>p.right&&(_=p.right-y.right,this.root.style.left=v+_+"px"),y.left<p.left&&(_=p.left-y.left,this.root.style.left=v+_+"px"),y.bottom>p.bottom){var x=y.bottom-y.top,b=f.bottom-f.top+x;this.root.style.top=g-b+"px",this.root.classList.add("ql-flip")}return _}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=s},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function j(O,T){var $=[],q=!0,J=!1,ae=void 0;try{for(var ie=O[Symbol.iterator](),Z;!(q=(Z=ie.next()).done)&&($.push(Z.value),!(T&&$.length===T));q=!0);}catch(te){J=!0,ae=te}finally{try{!q&&ie.return&&ie.return()}finally{if(J)throw ae}}return $}return function(O,T){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return j(O,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function j(O,T,$){O===null&&(O=Function.prototype);var q=Object.getOwnPropertyDescriptor(O,T);if(q===void 0){var J=Object.getPrototypeOf(O);return J===null?void 0:j(J,T,$)}else{if("value"in q)return q.value;var ae=q.get;return ae===void 0?void 0:ae.call($)}},s=function(){function j(O,T){for(var $=0;$<T.length;$++){var q=T[$];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(O,q.key,q)}}return function(O,T,$){return T&&j(O.prototype,T),$&&j(O,$),O}}(),u=i(3),h=k(u),f=i(8),v=k(f),g=i(43),p=k(g),y=i(27),_=k(y),x=i(15),b=i(41),E=k(b);function k(j){return j&&j.__esModule?j:{default:j}}function S(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function A(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 C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],I=function(j){M(O,j);function O(T,$){S(this,O),$.modules.toolbar!=null&&$.modules.toolbar.container==null&&($.modules.toolbar.container=C);var q=A(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,T,$));return q.quill.container.classList.add("ql-snow"),q}return s(O,[{key:"extendToolbar",value:function($){$.container.classList.add("ql-snow"),this.buildButtons([].slice.call($.container.querySelectorAll("button")),E.default),this.buildPickers([].slice.call($.container.querySelectorAll("select")),E.default),this.tooltip=new F(this.quill,this.options.bounds),$.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(q,J){$.handlers.link.call($,!J.format.link)})}}]),O}(p.default);I.DEFAULTS=(0,h.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(O){if(O){var T=this.quill.getSelection();if(T==null||T.length==0)return;var $=this.quill.getText(T);/^\S+@\S+\.\S+$/.test($)&&$.indexOf("mailto:")!==0&&($="mailto:"+$);var q=this.quill.theme.tooltip;q.edit("link",$)}else this.quill.format("link",!1)}}}}});var F=function(j){M(O,j);function O(T,$){S(this,O);var q=A(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,T,$));return q.preview=q.root.querySelector("a.ql-preview"),q}return s(O,[{key:"listen",value:function(){var $=this;o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(q){$.root.classList.contains("ql-editing")?$.save():$.edit("link",$.preview.textContent),q.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(q){if($.linkRange!=null){var J=$.linkRange;$.restoreFocus(),$.quill.formatText(J,"link",!1,v.default.sources.USER),delete $.linkRange}q.preventDefault(),$.hide()}),this.quill.on(v.default.events.SELECTION_CHANGE,function(q,J,ae){if(q!=null){if(q.length===0&&ae===v.default.sources.USER){var ie=$.quill.scroll.descendant(_.default,q.index),Z=a(ie,2),te=Z[0],V=Z[1];if(te!=null){$.linkRange=new x.Range(q.index-V,te.length());var B=_.default.formats(te.domNode);$.preview.textContent=B,$.preview.setAttribute("href",B),$.show(),$.position($.quill.getBounds($.linkRange));return}}else delete $.linkRange;$.hide()}})}},{key:"show",value:function(){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),O}(g.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=I},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=ue(a),s=i(36),u=i(38),h=i(64),f=i(65),v=ue(f),g=i(66),p=ue(g),y=i(67),_=ue(y),x=i(37),b=i(26),E=i(39),k=i(40),S=i(56),A=ue(S),M=i(68),C=ue(M),I=i(27),F=ue(I),j=i(69),O=ue(j),T=i(70),$=ue(T),q=i(71),J=ue(q),ae=i(72),ie=ue(ae),Z=i(73),te=ue(Z),V=i(13),B=ue(V),D=i(74),U=ue(D),X=i(75),ee=ue(X),K=i(57),oe=ue(K),me=i(41),de=ue(me),ye=i(28),Te=ue(ye),Ce=i(59),Ie=ue(Ce),Ee=i(60),ge=ue(Ee),Re=i(61),Be=ue(Re),Oe=i(108),fe=ue(Oe),Le=i(62),Ne=ue(Le);function ue(ke){return ke&&ke.__esModule?ke:{default:ke}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":x.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":E.FontClass,"attributors/class/size":k.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":x.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":E.FontStyle,"attributors/style/size":k.SizeStyle},!0),o.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":h.IndentClass,"formats/background":x.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":E.FontClass,"formats/size":k.SizeClass,"formats/blockquote":v.default,"formats/code-block":B.default,"formats/header":p.default,"formats/list":_.default,"formats/bold":A.default,"formats/code":V.Code,"formats/italic":C.default,"formats/link":F.default,"formats/script":O.default,"formats/strike":$.default,"formats/underline":J.default,"formats/image":ie.default,"formats/video":te.default,"formats/list/item":y.ListItem,"modules/formula":U.default,"modules/syntax":ee.default,"modules/toolbar":oe.default,"themes/bubble":fe.default,"themes/snow":Ne.default,"ui/icons":de.default,"ui/picker":Te.default,"ui/icon-picker":ge.default,"ui/color-picker":Ie.default,"ui/tooltip":Be.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function _(x,b){for(var E=0;E<b.length;E++){var k=b[E];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,b,E){return b&&_(x.prototype,b),E&&_(x,E),x}}(),o=function _(x,b,E){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,b);if(k===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:_(S,b,E)}else{if("value"in k)return k.value;var A=k.get;return A===void 0?void 0:A.call(E)}},s=i(0),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function f(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function v(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function g(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var p=function(_){g(x,_);function x(){return f(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"add",value:function(E,k){if(k==="+1"||k==="-1"){var S=this.value(E)||0;k=k==="+1"?S+1:S-1}return k===0?(this.remove(E),!0):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"add",this).call(this,E,k)}},{key:"canAdd",value:function(E,k){return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,E,k)||o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,E,parseInt(k))}},{key:"value",value:function(E){return parseInt(o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,E))||void 0}}]),x}(u.default.Attributor.Class),y=new p("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function h(g,p){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:g}function f(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(g,p):g.__proto__=p)}var v=function(g){f(p,g);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);v.blotName="blockquote",v.tagName="blockquote",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(y,_){for(var x=0;x<_.length;x++){var b=_[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,_,x){return _&&p(y.prototype,_),x&&p(y,x),y}}(),o=i(4),s=u(o);function u(p){return p&&p.__esModule?p:{default:p}}function h(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function f(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function v(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var g=function(p){v(y,p);function y(){return h(this,y),f(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"formats",value:function(x){return this.tagName.indexOf(x.tagName)+1}}]),y}(s.default);g.blotName="header",g.tagName=["H1","H2","H3","H4","H5","H6"],n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function S(A,M){for(var C=0;C<M.length;C++){var I=M[C];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(A,I.key,I)}}return function(A,M,C){return M&&S(A.prototype,M),C&&S(A,C),A}}(),o=function S(A,M,C){A===null&&(A=Function.prototype);var I=Object.getOwnPropertyDescriptor(A,M);if(I===void 0){var F=Object.getPrototypeOf(A);return F===null?void 0:S(F,M,C)}else{if("value"in I)return I.value;var j=I.get;return j===void 0?void 0:j.call(C)}},s=i(0),u=p(s),h=i(4),f=p(h),v=i(25),g=p(v);function p(S){return S&&S.__esModule?S:{default:S}}function y(S,A,M){return A in S?Object.defineProperty(S,A,{value:M,enumerable:!0,configurable:!0,writable:!0}):S[A]=M,S}function _(S,A){if(!(S instanceof A))throw new TypeError("Cannot call a class as a function")}function x(S,A){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:S}function b(S,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);S.prototype=Object.create(A&&A.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(S,A):S.__proto__=A)}var E=function(S){b(A,S);function A(){return _(this,A),x(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return a(A,[{key:"format",value:function(C,I){C===k.blotName&&!I?this.replaceWith(u.default.create(this.statics.scope)):o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"format",this).call(this,C,I)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,I){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,I),this):(this.parent.unwrap(),o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replaceWith",this).call(this,C,I))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:o(A.__proto__||Object.getPrototypeOf(A),"formats",this).call(this,C)}}]),A}(f.default);E.blotName="list-item",E.tagName="LI";var k=function(S){b(A,S),a(A,null,[{key:"create",value:function(C){var I=C==="ordered"?"OL":"UL",F=o(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this,I);return(C==="checked"||C==="unchecked")&&F.setAttribute("data-checked",C==="checked"),F}},{key:"formats",value:function(C){if(C.tagName==="OL")return"ordered";if(C.tagName==="UL")return C.hasAttribute("data-checked")?C.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function A(M){_(this,A);var C=x(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,M)),I=function(j){if(j.target.parentNode===M){var O=C.statics.formats(M),T=u.default.find(j.target);O==="checked"?T.format("list","unchecked"):O==="unchecked"&&T.format("list","checked")}};return M.addEventListener("touchstart",I),M.addEventListener("mousedown",I),C}return a(A,[{key:"format",value:function(C,I){this.children.length>0&&this.children.tail.format(C,I)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,I){if(C instanceof E)o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,C,I);else{var F=I==null?this.length():I.offset(this),j=this.split(F);j.parent.insertBefore(C,j)}}},{key:"optimize",value:function(C){o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,C);var I=this.next;I!=null&&I.prev===this&&I.statics.blotName===this.statics.blotName&&I.domNode.tagName===this.domNode.tagName&&I.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(I.moveChildren(this),I.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var I=u.default.create(this.statics.defaultChild);C.moveChildren(I),this.appendChild(I)}o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replace",this).call(this,C)}}]),A}(g.default);k.blotName="list",k.scope=u.default.Scope.BLOCK_BLOT,k.tagName=["OL","UL"],k.defaultChild="list-item",k.allowedChildren=[E],n.ListItem=E,n.default=k},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function h(g,p){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:g}function f(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(g,p):g.__proto__=p)}var v=function(g){f(p,g);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);v.blotName="italic",v.tagName=["EM","I"],n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function v(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){g(_,y);function _(){return f(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),_}(u.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function h(g,p){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:g}function f(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(g,p):g.__proto__=p)}var v=function(g){f(p,g);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);v.blotName="strike",v.tagName="S",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function h(g,p){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:g}function f(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(g,p):g.__proto__=p)}var v=function(g){f(p,g);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);v.blotName="underline",v.tagName="U",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(b,E){for(var k=0;k<E.length;k++){var S=E[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,k){return E&&x(b.prototype,E),k&&x(b,k),b}}(),o=function x(b,E,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,E,k)}else{if("value"in S)return S.value;var M=S.get;return M===void 0?void 0:M.call(k)}},s=i(0),u=f(s),h=i(27);function f(x){return x&&x.__esModule?x:{default:x}}function v(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function g(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["alt","height","width"],_=function(x){p(b,x);function b(){return v(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(k,S){y.indexOf(k)>-1?S?this.domNode.setAttribute(k,S):this.domNode.removeAttribute(k):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,k,S)}}],[{key:"create",value:function(k){var S=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,k);return typeof k=="string"&&S.setAttribute("src",this.sanitize(k)),S}},{key:"formats",value:function(k){return y.reduce(function(S,A){return k.hasAttribute(A)&&(S[A]=k.getAttribute(A)),S},{})}},{key:"match",value:function(k){return/\.(jpe?g|gif|png)$/.test(k)||/^data:image\/.+;base64/.test(k)}},{key:"sanitize",value:function(k){return(0,h.sanitize)(k,["http","https","data"])?k:"//:0"}},{key:"value",value:function(k){return k.getAttribute("src")}}]),b}(u.default.Embed);_.blotName="image",_.tagName="IMG",n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(b,E){for(var k=0;k<E.length;k++){var S=E[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,k){return E&&x(b.prototype,E),k&&x(b,k),b}}(),o=function x(b,E,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,E,k)}else{if("value"in S)return S.value;var M=S.get;return M===void 0?void 0:M.call(k)}},s=i(4),u=i(27),h=f(u);function f(x){return x&&x.__esModule?x:{default:x}}function v(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function g(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["height","width"],_=function(x){p(b,x);function b(){return v(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(k,S){y.indexOf(k)>-1?S?this.domNode.setAttribute(k,S):this.domNode.removeAttribute(k):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,k,S)}}],[{key:"create",value:function(k){var S=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,k);return S.setAttribute("frameborder","0"),S.setAttribute("allowfullscreen",!0),S.setAttribute("src",this.sanitize(k)),S}},{key:"formats",value:function(k){return y.reduce(function(S,A){return k.hasAttribute(A)&&(S[A]=k.getAttribute(A)),S},{})}},{key:"sanitize",value:function(k){return h.default.sanitize(k)}},{key:"value",value:function(k){return k.getAttribute("src")}}]),b}(s.BlockEmbed);_.blotName="video",_.className="ql-video",_.tagName="IFRAME",n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function k(S,A){for(var M=0;M<A.length;M++){var C=A[M];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}return function(S,A,M){return A&&k(S.prototype,A),M&&k(S,M),S}}(),o=function k(S,A,M){S===null&&(S=Function.prototype);var C=Object.getOwnPropertyDescriptor(S,A);if(C===void 0){var I=Object.getPrototypeOf(S);return I===null?void 0:k(I,A,M)}else{if("value"in C)return C.value;var F=C.get;return F===void 0?void 0:F.call(M)}},s=i(35),u=p(s),h=i(5),f=p(h),v=i(9),g=p(v);function p(k){return k&&k.__esModule?k:{default:k}}function y(k,S){if(!(k instanceof S))throw new TypeError("Cannot call a class as a function")}function _(k,S){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:k}function x(k,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);k.prototype=Object.create(S&&S.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(k,S):k.__proto__=S)}var b=function(k){x(S,k);function S(){return y(this,S),_(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,null,[{key:"create",value:function(M){var C=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,M);return typeof M=="string"&&(window.katex.render(M,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",M)),C}},{key:"value",value:function(M){return M.getAttribute("data-value")}}]),S}(u.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var E=function(k){x(S,k),a(S,null,[{key:"register",value:function(){f.default.register(b,!0)}}]);function S(){y(this,S);var A=_(this,(S.__proto__||Object.getPrototypeOf(S)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return A}return S}(g.default);n.FormulaBlot=b,n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function M(C,I){for(var F=0;F<I.length;F++){var j=I[F];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(C,j.key,j)}}return function(C,I,F){return I&&M(C.prototype,I),F&&M(C,F),C}}(),o=function M(C,I,F){C===null&&(C=Function.prototype);var j=Object.getOwnPropertyDescriptor(C,I);if(j===void 0){var O=Object.getPrototypeOf(C);return O===null?void 0:M(O,I,F)}else{if("value"in j)return j.value;var T=j.get;return T===void 0?void 0:T.call(F)}},s=i(0),u=_(s),h=i(5),f=_(h),v=i(9),g=_(v),p=i(13),y=_(p);function _(M){return M&&M.__esModule?M:{default:M}}function x(M,C){if(!(M instanceof C))throw new TypeError("Cannot call a class as a function")}function b(M,C){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:M}function E(M,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);M.prototype=Object.create(C&&C.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(M,C):M.__proto__=C)}var k=function(M){E(C,M);function C(){return x(this,C),b(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return a(C,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),o(C.prototype.__proto__||Object.getPrototypeOf(C.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)}}]),C}(y.default);k.className="ql-syntax";var S=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),A=function(M){E(C,M),a(C,null,[{key:"register",value:function(){f.default.register(S,!0),f.default.register(k,!0)}}]);function C(I,F){x(this,C);var j=b(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,I,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(f.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(O),O=setTimeout(function(){j.highlight(),O=null},j.options.interval)}),j.highlight(),j}return a(C,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(f.default.sources.USER);var j=this.quill.getSelection();this.quill.scroll.descendants(k).forEach(function(O){O.highlight(F.options.highlight)}),this.quill.update(f.default.sources.SILENT),j!=null&&this.quill.setSelection(j,f.default.sources.SILENT)}}}]),C}(g.default);A.DEFAULTS={highlight:function(){return window.hljs==null?null:function(M){var C=window.hljs.highlightAuto(M);return C.value}}(),interval:1e3},n.CodeBlock=k,n.CodeToken=S,n.default=A},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function C(I,F,j){I===null&&(I=Function.prototype);var O=Object.getOwnPropertyDescriptor(I,F);if(O===void 0){var T=Object.getPrototypeOf(I);return T===null?void 0:C(T,F,j)}else{if("value"in O)return O.value;var $=O.get;return $===void 0?void 0:$.call(j)}},o=function(){function C(I,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(I,O.key,O)}}return function(I,F,j){return F&&C(I.prototype,F),j&&C(I,j),I}}(),s=i(3),u=x(s),h=i(8),f=x(h),v=i(43),g=x(v),p=i(15),y=i(41),_=x(y);function x(C){return C&&C.__esModule?C:{default:C}}function b(C,I){if(!(C instanceof I))throw new TypeError("Cannot call a class as a function")}function E(C,I){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:C}function k(C,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);C.prototype=Object.create(I&&I.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(C,I):C.__proto__=I)}var S=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],A=function(C){k(I,C);function I(F,j){b(this,I),j.modules.toolbar!=null&&j.modules.toolbar.container==null&&(j.modules.toolbar.container=S);var O=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,F,j));return O.quill.container.classList.add("ql-bubble"),O}return o(I,[{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")),_.default),this.buildPickers([].slice.call(j.container.querySelectorAll("select")),_.default)}}]),I}(g.default);A.DEFAULTS=(0,u.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(I){I?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var M=function(C){k(I,C);function I(F,j){b(this,I);var O=E(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,F,j));return O.quill.on(f.default.events.EDITOR_CHANGE,function(T,$,q,J){if(T===f.default.events.SELECTION_CHANGE)if($!=null&&$.length>0&&J===f.default.sources.USER){O.show(),O.root.style.left="0px",O.root.style.width="",O.root.style.width=O.root.offsetWidth+"px";var ae=O.quill.getLines($.index,$.length);if(ae.length===1)O.position(O.quill.getBounds($));else{var ie=ae[ae.length-1],Z=O.quill.getIndex(ie),te=Math.min(ie.length()-1,$.index+$.length-Z),V=O.quill.getBounds(new p.Range(Z,te));O.position(V)}}else document.activeElement!==O.textbox&&O.quill.hasFocus()&&O.hide()}),O}return o(I,[{key:"listen",value:function(){var j=this;a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){j.root.classList.remove("ql-editing")}),this.quill.on(f.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=a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"position",this).call(this,j),T=this.root.querySelector(".ql-tooltip-arrow");if(T.style.marginLeft="",O===0)return O;T.style.marginLeft=-1*O-T.offsetWidth/2+"px"}}]),I}(v.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=A},function(r,n,i){r.exports=i(63)}]).default})}(G1)),G1.exports}var dL=hL();const P7=ch(dL);var W1={exports:{}},Gf={},Yd={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var pL=Yd.exports,W3;function gL(){return W3||(W3=1,function(t,e){(function(r){var n=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,a=typeof t0=="object"&&t0;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,s=2147483647,u=36,h=1,f=26,v=38,g=700,p=72,y=128,_="-",x=/^xn--/,b=/[^\x20-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=u-h,A=Math.floor,M=String.fromCharCode,C;function I(V){throw new RangeError(k[V])}function F(V,B){for(var D=V.length,U=[];D--;)U[D]=B(V[D]);return U}function j(V,B){var D=V.split("@"),U="";D.length>1&&(U=D[0]+"@",V=D[1]),V=V.replace(E,".");var X=V.split("."),ee=F(X,B).join(".");return U+ee}function O(V){for(var B=[],D=0,U=V.length,X,ee;D<U;)X=V.charCodeAt(D++),X>=55296&&X<=56319&&D<U?(ee=V.charCodeAt(D++),(ee&64512)==56320?B.push(((X&1023)<<10)+(ee&1023)+65536):(B.push(X),D--)):B.push(X);return B}function T(V){return F(V,function(B){var D="";return B>65535&&(B-=65536,D+=M(B>>>10&1023|55296),B=56320|B&1023),D+=M(B),D}).join("")}function $(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:u}function q(V,B){return V+22+75*(V<26)-((B!=0)<<5)}function J(V,B,D){var U=0;for(V=D?A(V/g):V>>1,V+=A(V/B);V>S*f>>1;U+=u)V=A(V/S);return A(U+(S+1)*V/(V+v))}function ae(V){var B=[],D=V.length,U,X=0,ee=y,K=p,oe,me,de,ye,Te,Ce,Ie,Ee,ge;for(oe=V.lastIndexOf(_),oe<0&&(oe=0),me=0;me<oe;++me)V.charCodeAt(me)>=128&&I("not-basic"),B.push(V.charCodeAt(me));for(de=oe>0?oe+1:0;de<D;){for(ye=X,Te=1,Ce=u;de>=D&&I("invalid-input"),Ie=$(V.charCodeAt(de++)),(Ie>=u||Ie>A((s-X)/Te))&&I("overflow"),X+=Ie*Te,Ee=Ce<=K?h:Ce>=K+f?f:Ce-K,!(Ie<Ee);Ce+=u)ge=u-Ee,Te>A(s/ge)&&I("overflow"),Te*=ge;U=B.length+1,K=J(X-ye,U,ye==0),A(X/U)>s-ee&&I("overflow"),ee+=A(X/U),X%=U,B.splice(X++,0,ee)}return T(B)}function ie(V){var B,D,U,X,ee,K,oe,me,de,ye,Te,Ce=[],Ie,Ee,ge,Re;for(V=O(V),Ie=V.length,B=y,D=0,ee=p,K=0;K<Ie;++K)Te=V[K],Te<128&&Ce.push(M(Te));for(U=X=Ce.length,X&&Ce.push(_);U<Ie;){for(oe=s,K=0;K<Ie;++K)Te=V[K],Te>=B&&Te<oe&&(oe=Te);for(Ee=U+1,oe-B>A((s-D)/Ee)&&I("overflow"),D+=(oe-B)*Ee,B=oe,K=0;K<Ie;++K)if(Te=V[K],Te<B&&++D>s&&I("overflow"),Te==B){for(me=D,de=u;ye=de<=ee?h:de>=ee+f?f:de-ee,!(me<ye);de+=u)Re=me-ye,ge=u-ye,Ce.push(M(q(ye+Re%ge,0))),me=A(Re/ge);Ce.push(M(q(me,0))),ee=J(D,Ee,U==X),D=0,++U}++D,++B}return Ce.join("")}function Z(V){return j(V,function(B){return x.test(B)?ae(B.slice(4).toLowerCase()):B})}function te(V){return j(V,function(B){return b.test(B)?"xn--"+ie(B):B})}if(o={version:"1.4.1",ucs2:{decode:O,encode:T},decode:ae,encode:ie,toASCII:te,toUnicode:Z},n&&i)if(t.exports==n)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(n[C]=o[C]);else r.punycode=o})(pL)}(Yd,Yd.exports)),Yd.exports}var l2,V3;function wd(){return V3||(V3=1,l2=TypeError),l2}const vL={},mL=Object.freeze(Object.defineProperty({__proto__:null,default:vL},Symbol.toStringTag,{value:"Module"})),yL=Tx(mL);var u2,Y3;function $0(){if(Y3)return u2;Y3=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,s=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,h=u?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,v=f?WeakSet.prototype.has:null,g=typeof WeakRef=="function"&&WeakRef.prototype,p=g?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,_=Object.prototype.toString,x=Function.prototype.toString,b=String.prototype.match,E=String.prototype.slice,k=String.prototype.replace,S=String.prototype.toUpperCase,A=String.prototype.toLowerCase,M=RegExp.prototype.test,C=Array.prototype.concat,I=Array.prototype.join,F=Array.prototype.slice,j=Math.floor,O=typeof BigInt=="function"?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,q=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===q||!0)?Symbol.toStringTag:null,ae=Object.prototype.propertyIsEnumerable,ie=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Ve){return Ve.__proto__}:null);function Z(Ve,qe){if(Ve===1/0||Ve===-1/0||Ve!==Ve||Ve&&Ve>-1e3&&Ve<1e3||M.call(/e/,qe))return qe;var Nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Ve=="number"){var Ct=Ve<0?-j(-Ve):j(Ve);if(Ct!==Ve){var ir=String(Ct),Ut=E.call(qe,ir.length+1);return k.call(ir,Nt,"$&_")+"."+k.call(k.call(Ut,/([0-9]{3})/g,"$&_"),/_$/,"")}}return k.call(qe,Nt,"$&_")}var te=yL,V=te.custom,B=Ee(V)?V:null,D={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};u2=function Ve(qe,Nt,Ct,ir){var Ut=Nt||{};if(Be(Ut,"quoteStyle")&&!Be(D,Ut.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Be(Ut,"maxStringLength")&&(typeof Ut.maxStringLength=="number"?Ut.maxStringLength<0&&Ut.maxStringLength!==1/0:Ut.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var xr=Be(Ut,"customInspect")?Ut.customInspect:!0;if(typeof xr!="boolean"&&xr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Be(Ut,"indent")&&Ut.indent!==null&&Ut.indent!==" "&&!(parseInt(Ut.indent,10)===Ut.indent&&Ut.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Be(Ut,"numericSeparator")&&typeof Ut.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var er=Ut.numericSeparator;if(typeof qe>"u")return"undefined";if(qe===null)return"null";if(typeof qe=="boolean")return qe?"true":"false";if(typeof qe=="string")return dt(qe,Ut);if(typeof qe=="number"){if(qe===0)return 1/0/qe>0?"0":"-0";var pr=String(qe);return er?Z(qe,pr):pr}if(typeof qe=="bigint"){var Fi=String(qe)+"n";return er?Z(qe,Fi):Fi}var oi=typeof Ut.depth>"u"?5:Ut.depth;if(typeof Ct>"u"&&(Ct=0),Ct>=oi&&oi>0&&typeof qe=="object")return oe(qe)?"[Array]":"[Object]";var Ei=_r(Ut,Ct);if(typeof ir>"u")ir=[];else if(Le(ir,qe)>=0)return"[Circular]";function Sn(Bi,to,Ds){if(to&&(ir=F.call(ir),ir.push(to)),Ds){var rs={depth:Ut.depth};return Be(Ut,"quoteStyle")&&(rs.quoteStyle=Ut.quoteStyle),Ve(Bi,rs,Ct+1,ir)}return Ve(Bi,Ut,Ct+1,ir)}if(typeof qe=="function"&&!de(qe)){var Zt=fe(qe),ca=Jt(qe,Sn);return"[Function"+(Zt?": "+Zt:" (anonymous)")+"]"+(ca.length>0?" { "+I.call(ca,", ")+" }":"")}if(Ee(qe)){var Fa=q?k.call(String(qe),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(qe);return typeof qe=="object"&&!q?xt(Fa):Fa}if(st(qe)){for(var Kn="<"+A.call(String(qe.nodeName)),Yi=qe.attributes||[],zr=0;zr<Yi.length;zr++)Kn+=" "+Yi[zr].name+"="+X(ee(Yi[zr].value),"double",Ut);return Kn+=">",qe.childNodes&&qe.childNodes.length&&(Kn+="..."),Kn+="</"+A.call(String(qe.nodeName))+">",Kn}if(oe(qe)){if(qe.length===0)return"[]";var En=Jt(qe,Sn);return Ei&&!Br(En)?"["+It(En,Ei)+"]":"[ "+I.call(En,", ")+" ]"}if(ye(qe)){var Rn=Jt(qe,Sn);return!("cause"in Error.prototype)&&"cause"in qe&&!ae.call(qe,"cause")?"{ ["+String(qe)+"] "+I.call(C.call("[cause]: "+Sn(qe.cause),Rn),", ")+" }":Rn.length===0?"["+String(qe)+"]":"{ ["+String(qe)+"] "+I.call(Rn,", ")+" }"}if(typeof qe=="object"&&xr){if(B&&typeof qe[B]=="function"&&te)return te(qe,{depth:oi-Ct});if(xr!=="symbol"&&typeof qe.inspect=="function")return qe.inspect()}if(Ne(qe)){var Sa=[];return n&&n.call(qe,function(Bi,to){Sa.push(Sn(to,qe,!0)+" => "+Sn(Bi,qe))}),At("Map",r.call(qe),Sa,Ei)}if(Pe(qe)){var Uo=[];return s&&s.call(qe,function(Bi){Uo.push(Sn(Bi,qe))}),At("Set",o.call(qe),Uo,Ei)}if(ue(qe))return bt("WeakMap");if(Ue(qe))return bt("WeakSet");if(ke(qe))return bt("WeakRef");if(Ce(qe))return xt(Sn(Number(qe)));if(ge(qe))return xt(Sn(O.call(qe)));if(Ie(qe))return xt(y.call(qe));if(Te(qe))return xt(Sn(String(qe)));if(typeof window<"u"&&qe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&qe===globalThis||typeof t0<"u"&&qe===t0)return"{ [object globalThis] }";if(!me(qe)&&!de(qe)){var Ea=Jt(qe,Sn),eo=ie?ie(qe)===Object.prototype:qe instanceof Object||qe.constructor===Object,si=qe instanceof Object?"":"null prototype",Aa=!eo&&J&&Object(qe)===qe&&J in qe?E.call(Oe(qe),8,-1):si?"Object":"",ka=eo||typeof qe.constructor!="function"?"":qe.constructor.name?qe.constructor.name+" ":"",Ho=ka+(Aa||si?"["+I.call(C.call([],Aa||[],si||[]),": ")+"] ":"");return Ea.length===0?Ho+"{}":Ei?Ho+"{"+It(Ea,Ei)+"}":Ho+"{ "+I.call(Ea,", ")+" }"}return String(qe)};function X(Ve,qe,Nt){var Ct=Nt.quoteStyle||qe,ir=D[Ct];return ir+Ve+ir}function ee(Ve){return k.call(String(Ve),/"/g,"&quot;")}function K(Ve){return!J||!(typeof Ve=="object"&&(J in Ve||typeof Ve[J]<"u"))}function oe(Ve){return Oe(Ve)==="[object Array]"&&K(Ve)}function me(Ve){return Oe(Ve)==="[object Date]"&&K(Ve)}function de(Ve){return Oe(Ve)==="[object RegExp]"&&K(Ve)}function ye(Ve){return Oe(Ve)==="[object Error]"&&K(Ve)}function Te(Ve){return Oe(Ve)==="[object String]"&&K(Ve)}function Ce(Ve){return Oe(Ve)==="[object Number]"&&K(Ve)}function Ie(Ve){return Oe(Ve)==="[object Boolean]"&&K(Ve)}function Ee(Ve){if(q)return Ve&&typeof Ve=="object"&&Ve instanceof Symbol;if(typeof Ve=="symbol")return!0;if(!Ve||typeof Ve!="object"||!$)return!1;try{return $.call(Ve),!0}catch{}return!1}function ge(Ve){if(!Ve||typeof Ve!="object"||!O)return!1;try{return O.call(Ve),!0}catch{}return!1}var Re=Object.prototype.hasOwnProperty||function(Ve){return Ve in this};function Be(Ve,qe){return Re.call(Ve,qe)}function Oe(Ve){return _.call(Ve)}function fe(Ve){if(Ve.name)return Ve.name;var qe=b.call(x.call(Ve),/^function\s*([\w$]+)/);return qe?qe[1]:null}function Le(Ve,qe){if(Ve.indexOf)return Ve.indexOf(qe);for(var Nt=0,Ct=Ve.length;Nt<Ct;Nt++)if(Ve[Nt]===qe)return Nt;return-1}function Ne(Ve){if(!r||!Ve||typeof Ve!="object")return!1;try{r.call(Ve);try{o.call(Ve)}catch{return!0}return Ve instanceof Map}catch{}return!1}function ue(Ve){if(!h||!Ve||typeof Ve!="object")return!1;try{h.call(Ve,h);try{v.call(Ve,v)}catch{return!0}return Ve instanceof WeakMap}catch{}return!1}function ke(Ve){if(!p||!Ve||typeof Ve!="object")return!1;try{return p.call(Ve),!0}catch{}return!1}function Pe(Ve){if(!o||!Ve||typeof Ve!="object")return!1;try{o.call(Ve);try{r.call(Ve)}catch{return!0}return Ve instanceof Set}catch{}return!1}function Ue(Ve){if(!v||!Ve||typeof Ve!="object")return!1;try{v.call(Ve,v);try{h.call(Ve,h)}catch{return!0}return Ve instanceof WeakSet}catch{}return!1}function st(Ve){return!Ve||typeof Ve!="object"?!1:typeof HTMLElement<"u"&&Ve instanceof HTMLElement?!0:typeof Ve.nodeName=="string"&&typeof Ve.getAttribute=="function"}function dt(Ve,qe){if(Ve.length>qe.maxStringLength){var Nt=Ve.length-qe.maxStringLength,Ct="... "+Nt+" more character"+(Nt>1?"s":"");return dt(E.call(Ve,0,qe.maxStringLength),qe)+Ct}var ir=U[qe.quoteStyle||"single"];ir.lastIndex=0;var Ut=k.call(k.call(Ve,ir,"\\$1"),/[\x00-\x1f]/g,pt);return X(Ut,"single",qe)}function pt(Ve){var qe=Ve.charCodeAt(0),Nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[qe];return Nt?"\\"+Nt:"\\x"+(qe<16?"0":"")+S.call(qe.toString(16))}function xt(Ve){return"Object("+Ve+")"}function bt(Ve){return Ve+" { ? }"}function At(Ve,qe,Nt,Ct){var ir=Ct?It(Nt,Ct):I.call(Nt,", ");return Ve+" ("+qe+") {"+ir+"}"}function Br(Ve){for(var qe=0;qe<Ve.length;qe++)if(Le(Ve[qe],`
154
+ `)>=0)return!1;return!0}function _r(Ve,qe){var Nt;if(Ve.indent===" ")Nt=" ";else if(typeof Ve.indent=="number"&&Ve.indent>0)Nt=I.call(Array(Ve.indent+1)," ");else return null;return{base:Nt,prev:I.call(Array(qe+1),Nt)}}function It(Ve,qe){if(Ve.length===0)return"";var Nt=`
155
+ `+qe.prev+qe.base;return Nt+I.call(Ve,","+Nt)+`
156
+ `+qe.prev}function Jt(Ve,qe){var Nt=oe(Ve),Ct=[];if(Nt){Ct.length=Ve.length;for(var ir=0;ir<Ve.length;ir++)Ct[ir]=Be(Ve,ir)?qe(Ve[ir],Ve):""}var Ut=typeof T=="function"?T(Ve):[],xr;if(q){xr={};for(var er=0;er<Ut.length;er++)xr["$"+Ut[er]]=Ut[er]}for(var pr in Ve)Be(Ve,pr)&&(Nt&&String(Number(pr))===pr&&pr<Ve.length||q&&xr["$"+pr]instanceof Symbol||(M.call(/[^\w$]/,pr)?Ct.push(qe(pr,Ve)+": "+qe(Ve[pr],Ve)):Ct.push(pr+": "+qe(Ve[pr],Ve))));if(typeof T=="function")for(var Fi=0;Fi<Ut.length;Fi++)ae.call(Ve,Ut[Fi])&&Ct.push("["+qe(Ut[Fi])+"]: "+qe(Ve[Ut[Fi]],Ve));return Ct}return u2}var c2,X3;function bL(){if(X3)return c2;X3=1;var t=$0(),e=wd(),r=function(s,u,h){for(var f=s,v;(v=f.next)!=null;f=v)if(v.key===u)return f.next=v.next,h||(v.next=s.next,s.next=v),v},n=function(s,u){if(s){var h=r(s,u);return h&&h.value}},i=function(s,u,h){var f=r(s,u);f?f.value=h:s.next={key:u,next:s.next,value:h}},a=function(s,u){return s?!!r(s,u):!1},o=function(s,u){if(s)return r(s,u,!0)};return c2=function(){var u,h={assert:function(f){if(!h.has(f))throw new e("Side channel does not contain "+t(f))},delete:function(f){var v=u&&u.next,g=o(u,f);return g&&v&&v===g&&(u=void 0),!!g},get:function(f){return n(u,f)},has:function(f){return a(u,f)},set:function(f,v){u||(u={next:void 0}),i(u,f,v)}};return h},c2}var f2,K3;function O7(){return K3||(K3=1,f2=Object),f2}var h2,Z3;function wL(){return Z3||(Z3=1,h2=Error),h2}var d2,Q3;function _L(){return Q3||(Q3=1,d2=EvalError),d2}var p2,J3;function xL(){return J3||(J3=1,p2=RangeError),p2}var g2,eb;function SL(){return eb||(eb=1,g2=ReferenceError),g2}var v2,tb;function EL(){return tb||(tb=1,v2=SyntaxError),v2}var m2,rb;function AL(){return rb||(rb=1,m2=URIError),m2}var y2,nb;function kL(){return nb||(nb=1,y2=Math.abs),y2}var b2,ib;function PL(){return ib||(ib=1,b2=Math.floor),b2}var w2,ab;function OL(){return ab||(ab=1,w2=Math.max),w2}var _2,ob;function CL(){return ob||(ob=1,_2=Math.min),_2}var x2,sb;function LL(){return sb||(sb=1,x2=Math.pow),x2}var S2,lb;function NL(){return lb||(lb=1,S2=Math.round),S2}var E2,ub;function TL(){return ub||(ub=1,E2=Number.isNaN||function(e){return e!==e}),E2}var A2,cb;function RL(){if(cb)return A2;cb=1;var t=TL();return A2=function(r){return t(r)||r===0?r:r<0?-1:1},A2}var k2,fb;function ML(){return fb||(fb=1,k2=Object.getOwnPropertyDescriptor),k2}var P2,hb;function C7(){if(hb)return P2;hb=1;var t=ML();if(t)try{t([],"length")}catch{t=null}return P2=t,P2}var O2,db;function IL(){if(db)return O2;db=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return O2=t,O2}var C2,pb;function jL(){return pb||(pb=1,C2=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),C2}var L2,gb;function DL(){if(gb)return L2;gb=1;var t=typeof Symbol<"u"&&Symbol,e=jL();return L2=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},L2}var N2,vb;function L7(){return vb||(vb=1,N2=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),N2}var T2,mb;function N7(){if(mb)return T2;mb=1;var t=O7();return T2=t.getPrototypeOf||null,T2}var R2,yb;function FL(){if(yb)return R2;yb=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,h){for(var f=[],v=0;v<u.length;v+=1)f[v]=u[v];for(var g=0;g<h.length;g+=1)f[g+u.length]=h[g];return f},a=function(u,h){for(var f=[],v=h,g=0;v<u.length;v+=1,g+=1)f[g]=u[v];return f},o=function(s,u){for(var h="",f=0;f<s.length;f+=1)h+=s[f],f+1<s.length&&(h+=u);return h};return R2=function(u){var h=this;if(typeof h!="function"||e.apply(h)!==n)throw new TypeError(t+h);for(var f=a(arguments,1),v,g=function(){if(this instanceof v){var b=h.apply(this,i(f,arguments));return Object(b)===b?b:this}return h.apply(u,i(f,arguments))},p=r(0,h.length-f.length),y=[],_=0;_<p;_++)y[_]="$"+_;if(v=Function("binder","return function ("+o(y,",")+"){ return binder.apply(this,arguments); }")(g),h.prototype){var x=function(){};x.prototype=h.prototype,v.prototype=new x,x.prototype=null}return v},R2}var M2,bb;function G0(){if(bb)return M2;bb=1;var t=FL();return M2=Function.prototype.bind||t,M2}var I2,wb;function ly(){return wb||(wb=1,I2=Function.prototype.call),I2}var j2,_b;function T7(){return _b||(_b=1,j2=Function.prototype.apply),j2}var D2,xb;function BL(){return xb||(xb=1,D2=typeof Reflect<"u"&&Reflect&&Reflect.apply),D2}var F2,Sb;function zL(){if(Sb)return F2;Sb=1;var t=G0(),e=T7(),r=ly(),n=BL();return F2=n||t.call(r,e),F2}var B2,Eb;function R7(){if(Eb)return B2;Eb=1;var t=G0(),e=wd(),r=ly(),n=zL();return B2=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(t,r,a)},B2}var z2,Ab;function qL(){if(Ab)return z2;Ab=1;var t=R7(),e=C7(),r;try{r=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!r&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return z2=n&&typeof n.get=="function"?t([n.get]):typeof a=="function"?function(s){return a(s==null?s:i(s))}:!1,z2}var q2,kb;function UL(){if(kb)return q2;kb=1;var t=L7(),e=N7(),r=qL();return q2=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:r?function(i){return r(i)}:null,q2}var U2,Pb;function HL(){if(Pb)return U2;Pb=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=G0();return U2=r.call(t,e),U2}var H2,Ob;function uy(){if(Ob)return H2;Ob=1;var t,e=O7(),r=wL(),n=_L(),i=xL(),a=SL(),o=EL(),s=wd(),u=AL(),h=kL(),f=PL(),v=OL(),g=CL(),p=LL(),y=NL(),_=RL(),x=Function,b=function(de){try{return x('"use strict"; return ('+de+").constructor;")()}catch{}},E=C7(),k=IL(),S=function(){throw new s},A=E?function(){try{return arguments.callee,S}catch{try{return E(arguments,"callee").get}catch{return S}}}():S,M=DL()(),C=UL(),I=N7(),F=L7(),j=T7(),O=ly(),T={},$=typeof Uint8Array>"u"||!C?t:C(Uint8Array),q={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":M&&C?C([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&C?C(C([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!C?t:C(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!C?t:C(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&C?C(""[Symbol.iterator]()):t,"%Symbol%":M?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":A,"%TypedArray%":$,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":j,"%Object.defineProperty%":k,"%Object.getPrototypeOf%":I,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":v,"%Math.min%":g,"%Math.pow%":p,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":F};if(C)try{null.error}catch(de){var J=C(C(de));q["%Error.prototype%"]=J}var ae=function de(ye){var Te;if(ye==="%AsyncFunction%")Te=b("async function () {}");else if(ye==="%GeneratorFunction%")Te=b("function* () {}");else if(ye==="%AsyncGeneratorFunction%")Te=b("async function* () {}");else if(ye==="%AsyncGenerator%"){var Ce=de("%AsyncGeneratorFunction%");Ce&&(Te=Ce.prototype)}else if(ye==="%AsyncIteratorPrototype%"){var Ie=de("%AsyncGenerator%");Ie&&C&&(Te=C(Ie.prototype))}return q[ye]=Te,Te},ie={__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"]},Z=G0(),te=HL(),V=Z.call(O,Array.prototype.concat),B=Z.call(j,Array.prototype.splice),D=Z.call(O,String.prototype.replace),U=Z.call(O,String.prototype.slice),X=Z.call(O,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,oe=function(ye){var Te=U(ye,0,1),Ce=U(ye,-1);if(Te==="%"&&Ce!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Ce==="%"&&Te!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Ie=[];return D(ye,ee,function(Ee,ge,Re,Be){Ie[Ie.length]=Re?D(Be,K,"$1"):ge||Ee}),Ie},me=function(ye,Te){var Ce=ye,Ie;if(te(ie,Ce)&&(Ie=ie[Ce],Ce="%"+Ie[0]+"%"),te(q,Ce)){var Ee=q[Ce];if(Ee===T&&(Ee=ae(Ce)),typeof Ee>"u"&&!Te)throw new s("intrinsic "+ye+" exists, but is not available. Please file an issue!");return{alias:Ie,name:Ce,value:Ee}}throw new o("intrinsic "+ye+" does not exist!")};return H2=function(ye,Te){if(typeof ye!="string"||ye.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Te!="boolean")throw new s('"allowMissing" argument must be a boolean');if(X(/^%?[^%]*%?$/,ye)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ce=oe(ye),Ie=Ce.length>0?Ce[0]:"",Ee=me("%"+Ie+"%",Te),ge=Ee.name,Re=Ee.value,Be=!1,Oe=Ee.alias;Oe&&(Ie=Oe[0],B(Ce,V([0,1],Oe)));for(var fe=1,Le=!0;fe<Ce.length;fe+=1){var Ne=Ce[fe],ue=U(Ne,0,1),ke=U(Ne,-1);if((ue==='"'||ue==="'"||ue==="`"||ke==='"'||ke==="'"||ke==="`")&&ue!==ke)throw new o("property names with quotes must have matching quotes");if((Ne==="constructor"||!Le)&&(Be=!0),Ie+="."+Ne,ge="%"+Ie+"%",te(q,ge))Re=q[ge];else if(Re!=null){if(!(Ne in Re)){if(!Te)throw new s("base intrinsic for "+ye+" exists, but the property is not available.");return}if(E&&fe+1>=Ce.length){var Pe=E(Re,Ne);Le=!!Pe,Le&&"get"in Pe&&!("originalValue"in Pe.get)?Re=Pe.get:Re=Re[Ne]}else Le=te(Re,Ne),Re=Re[Ne];Le&&!Be&&(q[ge]=Re)}}return Re},H2}var $2,Cb;function M7(){if(Cb)return $2;Cb=1;var t=uy(),e=R7(),r=e([t("%String.prototype.indexOf%")]);return $2=function(i,a){var o=t(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?e([o]):o},$2}var G2,Lb;function I7(){if(Lb)return G2;Lb=1;var t=uy(),e=M7(),r=$0(),n=wd(),i=t("%Map%",!0),a=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),s=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),h=e("Map.prototype.size",!0);return G2=!!i&&function(){var v,g={assert:function(p){if(!g.has(p))throw new n("Side channel does not contain "+r(p))},delete:function(p){if(v){var y=u(v,p);return h(v)===0&&(v=void 0),y}return!1},get:function(p){if(v)return a(v,p)},has:function(p){return v?s(v,p):!1},set:function(p,y){v||(v=new i),o(v,p,y)}};return g},G2}var W2,Nb;function $L(){if(Nb)return W2;Nb=1;var t=uy(),e=M7(),r=$0(),n=I7(),i=wd(),a=t("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),s=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),h=e("WeakMap.prototype.delete",!0);return W2=a?function(){var v,g,p={assert:function(y){if(!p.has(y))throw new i("Side channel does not contain "+r(y))},delete:function(y){if(a&&y&&(typeof y=="object"||typeof y=="function")){if(v)return h(v,y)}else if(n&&g)return g.delete(y);return!1},get:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&v?o(v,y):g&&g.get(y)},has:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&v?u(v,y):!!g&&g.has(y)},set:function(y,_){a&&y&&(typeof y=="object"||typeof y=="function")?(v||(v=new a),s(v,y,_)):n&&(g||(g=n()),g.set(y,_))}};return p}:n,W2}var V2,Tb;function GL(){if(Tb)return V2;Tb=1;var t=wd(),e=$0(),r=bL(),n=I7(),i=$L(),a=i||n||r;return V2=function(){var s,u={assert:function(h){if(!u.has(h))throw new t("Side channel does not contain "+e(h))},delete:function(h){return!!s&&s.delete(h)},get:function(h){return s&&s.get(h)},has:function(h){return!!s&&s.has(h)},set:function(h,f){s||(s=a()),s.set(h,f)}};return u},V2}var Y2,Rb;function cy(){if(Rb)return Y2;Rb=1;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Y2={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Y2}var X2,Mb;function j7(){if(Mb)return X2;Mb=1;var t=cy(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var x=[],b=0;b<256;++b)x.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return x}(),i=function(b){for(;b.length>1;){var E=b.pop(),k=E.obj[E.prop];if(r(k)){for(var S=[],A=0;A<k.length;++A)typeof k[A]<"u"&&S.push(k[A]);E.obj[E.prop]=S}}},a=function(b,E){for(var k=E&&E.plainObjects?{__proto__:null}:{},S=0;S<b.length;++S)typeof b[S]<"u"&&(k[S]=b[S]);return k},o=function x(b,E,k){if(!E)return b;if(typeof E!="object"&&typeof E!="function"){if(r(b))b.push(E);else if(b&&typeof b=="object")(k&&(k.plainObjects||k.allowPrototypes)||!e.call(Object.prototype,E))&&(b[E]=!0);else return[b,E];return b}if(!b||typeof b!="object")return[b].concat(E);var S=b;return r(b)&&!r(E)&&(S=a(b,k)),r(b)&&r(E)?(E.forEach(function(A,M){if(e.call(b,M)){var C=b[M];C&&typeof C=="object"&&A&&typeof A=="object"?b[M]=x(C,A,k):b.push(A)}else b[M]=A}),b):Object.keys(E).reduce(function(A,M){var C=E[M];return e.call(A,M)?A[M]=x(A[M],C,k):A[M]=C,A},S)},s=function(b,E){return Object.keys(E).reduce(function(k,S){return k[S]=E[S],k},b)},u=function(x,b,E){var k=x.replace(/\+/g," ");if(E==="iso-8859-1")return k.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(k)}catch{return k}},h=1024,f=function(b,E,k,S,A){if(b.length===0)return b;var M=b;if(typeof b=="symbol"?M=Symbol.prototype.toString.call(b):typeof b!="string"&&(M=String(b)),k==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var C="",I=0;I<M.length;I+=h){for(var F=M.length>=h?M.slice(I,I+h):M,j=[],O=0;O<F.length;++O){var T=F.charCodeAt(O);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||A===t.RFC1738&&(T===40||T===41)){j[j.length]=F.charAt(O);continue}if(T<128){j[j.length]=n[T];continue}if(T<2048){j[j.length]=n[192|T>>6]+n[128|T&63];continue}if(T<55296||T>=57344){j[j.length]=n[224|T>>12]+n[128|T>>6&63]+n[128|T&63];continue}O+=1,T=65536+((T&1023)<<10|F.charCodeAt(O)&1023),j[j.length]=n[240|T>>18]+n[128|T>>12&63]+n[128|T>>6&63]+n[128|T&63]}C+=j.join("")}return C},v=function(b){for(var E=[{obj:{o:b},prop:"o"}],k=[],S=0;S<E.length;++S)for(var A=E[S],M=A.obj[A.prop],C=Object.keys(M),I=0;I<C.length;++I){var F=C[I],j=M[F];typeof j=="object"&&j!==null&&k.indexOf(j)===-1&&(E.push({obj:M,prop:F}),k.push(j))}return i(E),b},g=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},p=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},y=function(b,E){return[].concat(b,E)},_=function(b,E){if(r(b)){for(var k=[],S=0;S<b.length;S+=1)k.push(E(b[S]));return k}return E(b)};return X2={arrayToObject:a,assign:s,combine:y,compact:v,decode:u,encode:f,isBuffer:p,isRegExp:g,maybeMap:_,merge:o},X2}var K2,Ib;function WL(){if(Ib)return K2;Ib=1;var t=GL(),e=j7(),r=cy(),n=Object.prototype.hasOwnProperty,i={brackets:function(x){return x+"[]"},comma:"comma",indices:function(x,b){return x+"["+b+"]"},repeat:function(x){return x}},a=Array.isArray,o=Array.prototype.push,s=function(_,x){o.apply(_,a(x)?x:[x])},u=Date.prototype.toISOString,h=r.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:r.formatters[h],indices:!1,serializeDate:function(x){return u.call(x)},skipNulls:!1,strictNullHandling:!1},v=function(x){return typeof x=="string"||typeof x=="number"||typeof x=="boolean"||typeof x=="symbol"||typeof x=="bigint"},g={},p=function _(x,b,E,k,S,A,M,C,I,F,j,O,T,$,q,J,ae,ie){for(var Z=x,te=ie,V=0,B=!1;(te=te.get(g))!==void 0&&!B;){var D=te.get(x);if(V+=1,typeof D<"u"){if(D===V)throw new RangeError("Cyclic object value");B=!0}typeof te.get(g)>"u"&&(V=0)}if(typeof F=="function"?Z=F(b,Z):Z instanceof Date?Z=T(Z):E==="comma"&&a(Z)&&(Z=e.maybeMap(Z,function(ge){return ge instanceof Date?T(ge):ge})),Z===null){if(A)return I&&!J?I(b,f.encoder,ae,"key",$):b;Z=""}if(v(Z)||e.isBuffer(Z)){if(I){var U=J?b:I(b,f.encoder,ae,"key",$);return[q(U)+"="+q(I(Z,f.encoder,ae,"value",$))]}return[q(b)+"="+q(String(Z))]}var X=[];if(typeof Z>"u")return X;var ee;if(E==="comma"&&a(Z))J&&I&&(Z=e.maybeMap(Z,I)),ee=[{value:Z.length>0?Z.join(",")||null:void 0}];else if(a(F))ee=F;else{var K=Object.keys(Z);ee=j?K.sort(j):K}var oe=C?String(b).replace(/\./g,"%2E"):String(b),me=k&&a(Z)&&Z.length===1?oe+"[]":oe;if(S&&a(Z)&&Z.length===0)return me+"[]";for(var de=0;de<ee.length;++de){var ye=ee[de],Te=typeof ye=="object"&&ye&&typeof ye.value<"u"?ye.value:Z[ye];if(!(M&&Te===null)){var Ce=O&&C?String(ye).replace(/\./g,"%2E"):String(ye),Ie=a(Z)?typeof E=="function"?E(me,Ce):me:me+(O?"."+Ce:"["+Ce+"]");ie.set(x,V);var Ee=t();Ee.set(g,ie),s(X,_(Te,Ie,E,k,S,A,M,C,E==="comma"&&J&&a(Z)?null:I,F,j,O,T,$,q,J,ae,Ee))}}return X},y=function(x){if(!x)return f;if(typeof x.allowEmptyArrays<"u"&&typeof x.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof x.encodeDotInKeys<"u"&&typeof x.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(x.encoder!==null&&typeof x.encoder<"u"&&typeof x.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=x.charset||f.charset;if(typeof x.charset<"u"&&x.charset!=="utf-8"&&x.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=r.default;if(typeof x.format<"u"){if(!n.call(r.formatters,x.format))throw new TypeError("Unknown format option provided.");E=x.format}var k=r.formatters[E],S=f.filter;(typeof x.filter=="function"||a(x.filter))&&(S=x.filter);var A;if(x.arrayFormat in i?A=x.arrayFormat:"indices"in x?A=x.indices?"indices":"repeat":A=f.arrayFormat,"commaRoundTrip"in x&&typeof x.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var M=typeof x.allowDots>"u"?x.encodeDotInKeys===!0?!0:f.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:f.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof x.allowEmptyArrays=="boolean"?!!x.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:A,charset:b,charsetSentinel:typeof x.charsetSentinel=="boolean"?x.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!x.commaRoundTrip,delimiter:typeof x.delimiter>"u"?f.delimiter:x.delimiter,encode:typeof x.encode=="boolean"?x.encode:f.encode,encodeDotInKeys:typeof x.encodeDotInKeys=="boolean"?x.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof x.encoder=="function"?x.encoder:f.encoder,encodeValuesOnly:typeof x.encodeValuesOnly=="boolean"?x.encodeValuesOnly:f.encodeValuesOnly,filter:S,format:E,formatter:k,serializeDate:typeof x.serializeDate=="function"?x.serializeDate:f.serializeDate,skipNulls:typeof x.skipNulls=="boolean"?x.skipNulls:f.skipNulls,sort:typeof x.sort=="function"?x.sort:null,strictNullHandling:typeof x.strictNullHandling=="boolean"?x.strictNullHandling:f.strictNullHandling}};return K2=function(_,x){var b=_,E=y(x),k,S;typeof E.filter=="function"?(S=E.filter,b=S("",b)):a(E.filter)&&(S=E.filter,k=S);var A=[];if(typeof b!="object"||b===null)return"";var M=i[E.arrayFormat],C=M==="comma"&&E.commaRoundTrip;k||(k=Object.keys(b)),E.sort&&k.sort(E.sort);for(var I=t(),F=0;F<k.length;++F){var j=k[F],O=b[j];E.skipNulls&&O===null||s(A,p(O,j,M,C,E.allowEmptyArrays,E.strictNullHandling,E.skipNulls,E.encodeDotInKeys,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,I))}var T=A.join(E.delimiter),$=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?$+="utf8=%26%2310003%3B&":$+="utf8=%E2%9C%93&"),T.length>0?$+T:""},K2}var Z2,jb;function VL(){if(jb)return Z2;jb=1;var t=j7(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(g){return g.replace(/&#(\d+);/g,function(p,y){return String.fromCharCode(parseInt(y,10))})},a=function(g,p,y){if(g&&typeof g=="string"&&p.comma&&g.indexOf(",")>-1)return g.split(",");if(p.throwOnLimitExceeded&&y>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");return g},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",u=function(p,y){var _={__proto__:null},x=y.ignoreQueryPrefix?p.replace(/^\?/,""):p;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=y.parameterLimit===1/0?void 0:y.parameterLimit,E=x.split(y.delimiter,y.throwOnLimitExceeded?b+1:b);if(y.throwOnLimitExceeded&&E.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var k=-1,S,A=y.charset;if(y.charsetSentinel)for(S=0;S<E.length;++S)E[S].indexOf("utf8=")===0&&(E[S]===s?A="utf-8":E[S]===o&&(A="iso-8859-1"),k=S,S=E.length);for(S=0;S<E.length;++S)if(S!==k){var M=E[S],C=M.indexOf("]="),I=C===-1?M.indexOf("="):C+1,F,j;I===-1?(F=y.decoder(M,n.decoder,A,"key"),j=y.strictNullHandling?null:""):(F=y.decoder(M.slice(0,I),n.decoder,A,"key"),j=t.maybeMap(a(M.slice(I+1),y,r(_[F])?_[F].length:0),function(T){return y.decoder(T,n.decoder,A,"value")})),j&&y.interpretNumericEntities&&A==="iso-8859-1"&&(j=i(String(j))),M.indexOf("[]=")>-1&&(j=r(j)?[j]:j);var O=e.call(_,F);O&&y.duplicates==="combine"?_[F]=t.combine(_[F],j):(!O||y.duplicates==="last")&&(_[F]=j)}return _},h=function(g,p,y,_){var x=0;if(g.length>0&&g[g.length-1]==="[]"){var b=g.slice(0,-1).join("");x=Array.isArray(p)&&p[b]?p[b].length:0}for(var E=_?p:a(p,y,x),k=g.length-1;k>=0;--k){var S,A=g[k];if(A==="[]"&&y.parseArrays)S=y.allowEmptyArrays&&(E===""||y.strictNullHandling&&E===null)?[]:t.combine([],E);else{S=y.plainObjects?{__proto__:null}:{};var M=A.charAt(0)==="["&&A.charAt(A.length-1)==="]"?A.slice(1,-1):A,C=y.decodeDotInKeys?M.replace(/%2E/g,"."):M,I=parseInt(C,10);!y.parseArrays&&C===""?S={0:E}:!isNaN(I)&&A!==C&&String(I)===C&&I>=0&&y.parseArrays&&I<=y.arrayLimit?(S=[],S[I]=E):C!=="__proto__"&&(S[C]=E)}E=S}return E},f=function(p,y,_,x){if(p){var b=_.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,E=/(\[[^[\]]*])/,k=/(\[[^[\]]*])/g,S=_.depth>0&&E.exec(b),A=S?b.slice(0,S.index):b,M=[];if(A){if(!_.plainObjects&&e.call(Object.prototype,A)&&!_.allowPrototypes)return;M.push(A)}for(var C=0;_.depth>0&&(S=k.exec(b))!==null&&C<_.depth;){if(C+=1,!_.plainObjects&&e.call(Object.prototype,S[1].slice(1,-1))&&!_.allowPrototypes)return;M.push(S[1])}if(S){if(_.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+_.depth+" and strictDepth is true");M.push("["+b.slice(S.index)+"]")}return h(M,y,_,x)}},v=function(p){if(!p)return n;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof p.throwOnLimitExceeded<"u"&&typeof p.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var y=typeof p.charset>"u"?n.charset:p.charset,_=typeof p.duplicates>"u"?n.duplicates:p.duplicates;if(_!=="combine"&&_!=="first"&&_!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:n.allowDots:!!p.allowDots;return{allowDots:x,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:n.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:n.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:n.arrayLimit,charset:y,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:n.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:n.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:n.decoder,delimiter:typeof p.delimiter=="string"||t.isRegExp(p.delimiter)?p.delimiter:n.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:n.depth,duplicates:_,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:n.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:n.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:n.strictDepth,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof p.throwOnLimitExceeded=="boolean"?p.throwOnLimitExceeded:!1}};return Z2=function(g,p){var y=v(p);if(g===""||g===null||typeof g>"u")return y.plainObjects?{__proto__:null}:{};for(var _=typeof g=="string"?u(g,y):g,x=y.plainObjects?{__proto__:null}:{},b=Object.keys(_),E=0;E<b.length;++E){var k=b[E],S=f(k,_[k],y,typeof g=="string");x=t.merge(x,S,y)}return y.allowSparse===!0?x:t.compact(x)},Z2}var Q2,Db;function YL(){if(Db)return Q2;Db=1;var t=WL(),e=VL(),r=cy();return Q2={formats:r,parse:e,stringify:t},Q2}var Fb;function D7(){if(Fb)return Gf;Fb=1;var t=gL();function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
157
+ `," "],o=["{","}","|","\\","^","`"].concat(a),s=["'"].concat(o),u=["%","/","?",";","#"].concat(s),h=["/","?","#"],f=255,v=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=YL();function b(A,M,C){if(A&&typeof A=="object"&&A instanceof e)return A;var I=new e;return I.parse(A,M,C),I}e.prototype.parse=function(A,M,C){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var I=A.indexOf("?"),F=I!==-1&&I<A.indexOf("#")?"?":"#",j=A.split(F),O=/\\/g;j[0]=j[0].replace(O,"/"),A=j.join(F);var T=A;if(T=T.trim(),!C&&A.split("#").length===1){var $=i.exec(T);if($)return this.path=T,this.href=T,this.pathname=$[1],$[2]?(this.search=$[2],M?this.query=x.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var q=r.exec(T);if(q){q=q[0];var J=q.toLowerCase();this.protocol=J,T=T.substr(q.length)}if(C||q||T.match(/^\/\/[^@/]+@[^@/]+/)){var ae=T.substr(0,2)==="//";ae&&!(q&&y[q])&&(T=T.substr(2),this.slashes=!0)}if(!y[q]&&(ae||q&&!_[q])){for(var ie=-1,Z=0;Z<h.length;Z++){var te=T.indexOf(h[Z]);te!==-1&&(ie===-1||te<ie)&&(ie=te)}var V,B;ie===-1?B=T.lastIndexOf("@"):B=T.lastIndexOf("@",ie),B!==-1&&(V=T.slice(0,B),T=T.slice(B+1),this.auth=decodeURIComponent(V)),ie=-1;for(var Z=0;Z<u.length;Z++){var te=T.indexOf(u[Z]);te!==-1&&(ie===-1||te<ie)&&(ie=te)}ie===-1&&(ie=T.length),this.host=T.slice(0,ie),T=T.slice(ie),this.parseHost(),this.hostname=this.hostname||"";var D=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!D)for(var U=this.hostname.split(/\./),Z=0,X=U.length;Z<X;Z++){var ee=U[Z];if(ee&&!ee.match(v)){for(var K="",oe=0,me=ee.length;oe<me;oe++)ee.charCodeAt(oe)>127?K+="x":K+=ee[oe];if(!K.match(v)){var de=U.slice(0,Z),ye=U.slice(Z+1),Te=ee.match(g);Te&&(de.push(Te[1]),ye.unshift(Te[2])),ye.length&&(T="/"+ye.join(".")+T),this.hostname=de.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=t.toASCII(this.hostname));var Ce=this.port?":"+this.port:"",Ie=this.hostname||"";this.host=Ie+Ce,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),T[0]!=="/"&&(T="/"+T))}if(!p[J])for(var Z=0,X=s.length;Z<X;Z++){var Ee=s[Z];if(T.indexOf(Ee)!==-1){var ge=encodeURIComponent(Ee);ge===Ee&&(ge=escape(Ee)),T=T.split(Ee).join(ge)}}var Re=T.indexOf("#");Re!==-1&&(this.hash=T.substr(Re),T=T.slice(0,Re));var Be=T.indexOf("?");if(Be!==-1?(this.search=T.substr(Be),this.query=T.substr(Be+1),M&&(this.query=x.parse(this.query)),T=T.slice(0,Be)):M&&(this.search="",this.query={}),T&&(this.pathname=T),_[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Ce=this.pathname||"",Oe=this.search||"";this.path=Ce+Oe}return this.href=this.format(),this};function E(A){return typeof A=="string"&&(A=b(A)),A instanceof e?A.format():e.prototype.format.call(A)}e.prototype.format=function(){var A=this.auth||"";A&&(A=encodeURIComponent(A),A=A.replace(/%3A/i,":"),A+="@");var M=this.protocol||"",C=this.pathname||"",I=this.hash||"",F=!1,j="";this.host?F=A+this.host:this.hostname&&(F=A+(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=x.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var O=this.search||j&&"?"+j||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||_[M])&&F!==!1?(F="//"+(F||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):F||(F=""),I&&I.charAt(0)!=="#"&&(I="#"+I),O&&O.charAt(0)!=="?"&&(O="?"+O),C=C.replace(/[?#]/g,function(T){return encodeURIComponent(T)}),O=O.replace("#","%23"),M+F+C+O+I};function k(A,M){return b(A,!1,!0).resolve(M)}e.prototype.resolve=function(A){return this.resolveObject(b(A,!1,!0)).format()};function S(A,M){return A?b(A,!1,!0).resolveObject(M):M}return e.prototype.resolveObject=function(A){if(typeof A=="string"){var M=new e;M.parse(A,!1,!0),A=M}for(var C=new e,I=Object.keys(this),F=0;F<I.length;F++){var j=I[F];C[j]=this[j]}if(C.hash=A.hash,A.href==="")return C.href=C.format(),C;if(A.slashes&&!A.protocol){for(var O=Object.keys(A),T=0;T<O.length;T++){var $=O[T];$!=="protocol"&&(C[$]=A[$])}return _[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(A.protocol&&A.protocol!==C.protocol){if(!_[A.protocol]){for(var q=Object.keys(A),J=0;J<q.length;J++){var ae=q[J];C[ae]=A[ae]}return C.href=C.format(),C}if(C.protocol=A.protocol,!A.host&&!y[A.protocol]){for(var X=(A.pathname||"").split("/");X.length&&!(A.host=X.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),X[0]!==""&&X.unshift(""),X.length<2&&X.unshift(""),C.pathname=X.join("/")}else C.pathname=A.pathname;if(C.search=A.search,C.query=A.query,C.host=A.host||"",C.auth=A.auth,C.hostname=A.hostname||A.host,C.port=A.port,C.pathname||C.search){var ie=C.pathname||"",Z=C.search||"";C.path=ie+Z}return C.slashes=C.slashes||A.slashes,C.href=C.format(),C}var te=C.pathname&&C.pathname.charAt(0)==="/",V=A.host||A.pathname&&A.pathname.charAt(0)==="/",B=V||te||C.host&&A.pathname,D=B,U=C.pathname&&C.pathname.split("/")||[],X=A.pathname&&A.pathname.split("/")||[],ee=C.protocol&&!_[C.protocol];if(ee&&(C.hostname="",C.port=null,C.host&&(U[0]===""?U[0]=C.host:U.unshift(C.host)),C.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(X[0]===""?X[0]=A.host:X.unshift(A.host)),A.host=null),B=B&&(X[0]===""||U[0]==="")),V)C.host=A.host||A.host===""?A.host:C.host,C.hostname=A.hostname||A.hostname===""?A.hostname:C.hostname,C.search=A.search,C.query=A.query,U=X;else if(X.length)U||(U=[]),U.pop(),U=U.concat(X),C.search=A.search,C.query=A.query;else if(A.search!=null){if(ee){C.host=U.shift(),C.hostname=C.host;var K=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;K&&(C.auth=K.shift(),C.hostname=K.shift(),C.host=C.hostname)}return C.search=A.search,C.query=A.query,(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C}if(!U.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var oe=U.slice(-1)[0],me=(C.host||A.host||U.length>1)&&(oe==="."||oe==="..")||oe==="",de=0,ye=U.length;ye>=0;ye--)oe=U[ye],oe==="."?U.splice(ye,1):oe===".."?(U.splice(ye,1),de++):de&&(U.splice(ye,1),de--);if(!B&&!D)for(;de--;de)U.unshift("..");B&&U[0]!==""&&(!U[0]||U[0].charAt(0)!=="/")&&U.unshift(""),me&&U.join("/").substr(-1)!=="/"&&U.push("");var Te=U[0]===""||U[0]&&U[0].charAt(0)==="/";if(ee){C.hostname=Te?"":U.length?U.shift():"",C.host=C.hostname;var K=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;K&&(C.auth=K.shift(),C.hostname=K.shift(),C.host=C.hostname)}return B=B||C.host&&U.length,B&&!Te&&U.unshift(""),U.length>0?C.pathname=U.join("/"):(C.pathname=null,C.path=null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=A.auth||C.auth,C.slashes=C.slashes||A.slashes,C.href=C.format(),C},e.prototype.parseHost=function(){var A=this.host,M=n.exec(A);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),A=A.substr(0,A.length-M.length)),A&&(this.hostname=A)},Gf.parse=b,Gf.resolve=k,Gf.resolveObject=S,Gf.format=E,Gf.Url=e,Gf}var V1={exports:{}},XL=V1.exports,Bb;function KL(){return Bb||(Bb=1,function(t){(function(e,r){t.exports?t.exports=r():e.xmlserializer=r()})(XL,function(){var e=function(p){return p.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(p){var y=p.value;return" "+p.name+'="'+r(y)+'"'},a=function(p){var y=p.tagName;return p.namespaceURI==="http://www.w3.org/1999/xhtml"&&(y=y.toLowerCase()),y},o=function(p,y){var _=Array.prototype.map.call(p.attributes||p.attrs,function(x){return x.name}).indexOf("xmlns")>=0;return!_&&(y||p.namespaceURI!==p.parentNode.namespaceURI)?' xmlns="'+p.namespaceURI+'"':""},s=function(p){return Array.prototype.map.call(p.childNodes,function(y){return g(y)}).join("")},u=function(p,y){var _="<"+a(p);return _+=o(p,y),Array.prototype.forEach.call(p.attributes||p.attrs,function(x){_+=i(x)}),p.childNodes.length>0?(_+=">",_+=s(p),_+="</"+a(p)+">"):_+="/>",_},h=function(p){var y=p.nodeValue||p.value||"";return n(y)},f=function(p){return"<!--"+p.data.replace(/-/g,"&#45;")+"-->"},v=function(p){return"<![CDATA["+p.nodeValue+"]]>"},g=function(p,y){var _=y&&y.rootNode;if(p.nodeName==="#document"||p.nodeName==="#document-fragment")return s(p);if(p.tagName)return u(p,_);if(p.nodeName==="#text")return h(p);if(p.nodeName==="#comment")return f(p);if(p.nodeName==="#cdata-section")return v(p)};return{serializeToString:function(p){return e(g(p,{rootNode:!0}))}}})}(V1)),V1.exports}var J2={},zb;function ZL(){if(zb)return J2;zb=1;var t=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(s){return o.serializeToString(s)}).join("")},e=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
158
+ ?</div>`),new RegExp(`^(.+)
159
+ `)],n=function(a){var o=t(a),s,u;for(s=0;s<r.length;s++)if(u=r[s].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var s=e(a);if(s!==void 0)throw o=n(s)||"Parse error",new Error(o)};return J2.failOnParseError=function(a){return i(a),a},J2}var ev={},tv={},qb;function W0(){return qb||(qb=1,function(t){var e=D7();t.getDocumentBaseUrl=function(s){return s.baseURI!=="about:blank"?s.baseURI:null},t.clone=function(s){var u={},h;for(h in s)s.hasOwnProperty(h)&&(u[h]=s[h]);return u},t.cloneArray=function(s){return Array.prototype.slice.apply(s,[0])},t.joinUrl=function(s,u){return s?e.resolve(s,u):u},t.isDataUri=function(s){return/^data:/.test(s)},t.collectAndReportErrors=function(s){var u=[];return Promise.all(s.map(function(h){return h.catch(function(f){u.push(f)})})).then(function(){return u})};var r=null,n=function(s,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),s+"?_="+r):s};t.ajax=function(s,u){return new Promise(function(h,f){var v=new window.XMLHttpRequest,g=t.joinUrl(u.baseUrl,s),p,y=function(){f({msg:"Unable to load url",url:g})};p=n(g,u.cache),v.addEventListener("load",function(){v.status===200||v.status===0?h(v.response):y()},!1),v.addEventListener("error",y,!1);try{v.open("GET",p,!0),v.overrideMimeType(u.mimeType),v.send(null)}catch{y()}})},t.binaryAjax=function(s,u){var h=t.clone(u);return h.mimeType="text/plain; charset=x-user-defined",t.ajax(s,h).then(function(f){for(var v="",g=0;g<f.length;g++)v+=String.fromCharCode(f.charCodeAt(g)&255);return v})};var i=function(s){var u=function(h,f){return h.substring(0,f.length)===f};return u(s,"<?xml")||u(s,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(s,u){return t.binaryAjax(s,u).then(function(h){var f=btoa(h),v=i(h);return"data:"+v+";base64,"+f})};var a=[],o=function(s){return a.indexOf(s)<0&&a.push(s),a.indexOf(s)};t.memoize=function(s,u,h){if(typeof h!="object")throw new Error("cacheBucket is not an object");return function(){var f=Array.prototype.slice.call(arguments),v=u(f),g=o(s),p;return h[g]&&h[g][v]?h[g][v]:(p=s.apply(null,f),h[g]=h[g]||{},h[g][v]=p,p)}}}(tv)),tv}var rv={},Ub;function QL(){if(Ub)return rv;Ub=1;var t=W0(),e=function(a,o){var s=null;a.hasAttribute("src")?s=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(s=a.getAttribute("href"));var u=t.getDocumentBaseUrl(a.ownerDocument),h=t.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),t.getDataURIForImageURL(s,h).then(function(f){return f},function(f){throw{resourceType:"image",url:f.url,msg:"Unable to load image "+f.url}})},r=function(a){return a.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&&!t.isDataUri(s)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return rv.inline=function(a,o){var s=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),h=n(a.getElementsByTagName("input"));s=s.concat(u),s=s.concat(h);var f=r(s);return t.collectAndReportErrors(f.map(function(v){return e(v,o).then(function(g){v.attributes.src?v.attributes.src.value=g:v.attributes["xlink:href"]?v.attributes["xlink:href"].value=g:v.attributes.href&&(v.attributes.href.value=g)})}))},rv}var nv={},Hb;function JL(){if(Hb)return nv;Hb=1;var t=W0(),e=function(a,o){var s=a.attributes.src.value,u=t.getDocumentBaseUrl(a.ownerDocument),h=t.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),t.ajax(s,h).catch(function(f){throw{resourceType:"script",url:f.url,msg:"Unable to load script "+f.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(s){return!!s.attributes.src})};return nv.inline=function(a,o){var s=i(a);return t.collectAndReportErrors(s.map(function(u){return e(u,o).then(function(h){n(u,h)})}))},nv}var iv={},av={},$b;function fy(){return $b||($b=1,function(t){t.unquoteString=function(e){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(e)?e.replace(r,"$1"):n.test(e)?e.replace(n,"$1"):e},t.rulesForCssText=function(e){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=e,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},t.cssRulesToText=function(e){return e.reduce(function(r,n){return r+n.cssText},"")},t.exchangeRule=function(e,r,n){var i=e.indexOf(r);e[i]=t.rulesForCssText(n)[0]},t.changeFontFaceRuleSrc=function(e,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",t.exchangeRule(e,r,i)}}(av)),av}var ov={},Gb;function eN(){return Gb||(Gb=1,function(t){var e=fy(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};t.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,s;if(!o.test(a))throw new Error("Invalid url");return s=o.exec(a)[1],e.unquoteString(r(s))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,s="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+s+")+",h="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",f=new RegExp(u,"g"),v,g=[],p=function(y){var _=new RegExp(s,"g"),x=[],b;for(b=_.exec(y);b;)x.push(b[1]),b=_.exec(y);return x};if(a.match(new RegExp(h))){for(v=f.exec(a);v;)g.push(p(v[0])),v=f.exec(a);return g}return[]},i=function(a){var o,s;for(o=0;o<a.length;o++)try{return s=t.extractCssUrl(a[o]),{url:s,idx:o}}catch{}};t.parse=function(a){var o=n(a);return o.map(function(s){var u=i(s);return u?{preUrl:s.slice(0,u.idx),url:u.url,postUrl:s.slice(u.idx+1)}:{preUrl:s}})},t.serialize=function(a){var o=a.map(function(s){var u=[].concat(s.preUrl);return s.url&&u.push('url("'+s.url+'")'),s.postUrl&&(u=u.concat(s.postUrl)),u.join(" ")});return o.join(", ")}}(ov)),ov}function k1(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var sv={exports:{}},Wb;function tN(){return Wb||(Wb=1,function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,a){function o(h,f){if(!i[h]){if(!n[h]){var v=typeof k1=="function"&&k1;if(!f&&v)return v(h,!0);if(s)return s(h,!0);var g=new Error("Cannot find module '"+h+"'");throw g.code="MODULE_NOT_FOUND",g}var p=i[h]={exports:{}};n[h][0].call(p.exports,function(y){var _=n[h][1][y];return o(_||y)},p,p.exports,r,n,i,a)}return i[h].exports}for(var s=typeof k1=="function"&&k1,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,h){function f(){this.constructor=u}f.prototype=h.prototype,u.prototype=new f}function o(u,h,f,v){this.message=u,this.expected=h,this.found=f,this.location=v,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,h){var f={literal:function(b){return'"'+g(b.text)+'"'},class:function(b){var E="",k;for(k=0;k<b.parts.length;k++)E+=b.parts[k]instanceof Array?p(b.parts[k][0])+"-"+p(b.parts[k][1]):p(b.parts[k]);return"["+(b.inverted?"^":"")+E+"]"},any:function(b){return"any character"},end:function(b){return"end of input"},other:function(b){return b.description}};function v(b){return b.charCodeAt(0).toString(16).toUpperCase()}function g(b){return b.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(E){return"\\x0"+v(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+v(E)})}function p(b){return b.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(E){return"\\x0"+v(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+v(E)})}function y(b){return f[b.type](b)}function _(b){var E=new Array(b.length),k,S;for(k=0;k<b.length;k++)E[k]=y(b[k]);if(E.sort(),E.length>0){for(k=1,S=1;k<E.length;k++)E[k-1]!==E[k]&&(E[S]=E[k],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function x(b){return b?'"'+g(b)+'"':"end of input"}return"Expected "+_(u)+" but "+x(h)+" found."};function s(u,h){h=h!==void 0?h:{};var f={},v={start:Ce},g=Ce,p="",y=function(){return[]},_=",",x=ee(",",!1),b=function(ue,ke){return[ue].concat(ke)},E=function(ue){return[ue]},k=function(ue,ke){return{url:ue,format:ke}},S=function(ue){return{url:ue}},A="url(",M=ee("url(",!1),C=")",I=ee(")",!1),F=function(ue){return ue},j="format(",O=ee("format(",!1),T="local(",$=ee("local(",!1),q=function(ue){return{local:ue}},J=/^[^)]/,ae=K([")"],!0,!1),ie=function(ue){return Ne.extractValue(ue.join(""))},Z=/^[ \t\r\n\f]/,te=K([" "," ","\r",`
160
+ `,"\f"],!1,!1),V=0,B=[{line:1,column:1}],D=0,U=[],X;if("startRule"in h){if(!(h.startRule in v))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');g=v[h.startRule]}function ee(ue,ke){return{type:"literal",text:ue,ignoreCase:ke}}function K(ue,ke,Pe){return{type:"class",parts:ue,inverted:ke,ignoreCase:Pe}}function oe(){return{type:"end"}}function me(ue){var ke=B[ue],Pe;if(ke)return ke;for(Pe=ue-1;!B[Pe];)Pe--;for(ke=B[Pe],ke={line:ke.line,column:ke.column};Pe<ue;)u.charCodeAt(Pe)===10?(ke.line++,ke.column=1):ke.column++,Pe++;return B[ue]=ke,ke}function de(ue,ke){var Pe=me(ue),Ue=me(ke);return{start:{offset:ue,line:Pe.line,column:Pe.column},end:{offset:ke,line:Ue.line,column:Ue.column}}}function ye(ue){V<D||(V>D&&(D=V,U=[]),U.push(ue))}function Te(ue,ke,Pe){return new o(o.buildMessage(ue,ke),ue,ke,Pe)}function Ce(){var ue,ke;return ue=Ie(),ue===f&&(ue=V,ke=p,ke!==f&&(ke=y()),ue=ke),ue}function Ie(){var ue,ke,Pe,Ue,st,dt;if(ue=V,ke=Ee(),ke!==f){for(Pe=[],Ue=Le();Ue!==f;)Pe.push(Ue),Ue=Le();if(Pe!==f)if(u.charCodeAt(V)===44?(Ue=_,V++):(Ue=f,ye(x)),Ue!==f){for(st=[],dt=Le();dt!==f;)st.push(dt),dt=Le();st!==f?(dt=Ie(),dt!==f?(ke=b(ke,dt),ue=ke):(V=ue,ue=f)):(V=ue,ue=f)}else V=ue,ue=f;else V=ue,ue=f}else V=ue,ue=f;return ue===f&&(ue=V,ke=Ee(),ke!==f&&(ke=E(ke)),ue=ke),ue}function Ee(){var ue;return ue=ge(),ue===f&&(ue=Oe()),ue}function ge(){var ue,ke,Pe,Ue;if(ue=V,ke=Re(),ke!==f){if(Pe=[],Ue=Le(),Ue!==f)for(;Ue!==f;)Pe.push(Ue),Ue=Le();else Pe=f;Pe!==f?(Ue=Be(),Ue!==f?(ke=k(ke,Ue),ue=ke):(V=ue,ue=f)):(V=ue,ue=f)}else V=ue,ue=f;return ue===f&&(ue=V,ke=Re(),ke!==f&&(ke=S(ke)),ue=ke),ue}function Re(){var ue,ke,Pe,Ue;return ue=V,u.substr(V,4)===A?(ke=A,V+=4):(ke=f,ye(M)),ke!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=C,V++):(Ue=f,ye(I)),Ue!==f?(ke=F(Pe),ue=ke):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function Be(){var ue,ke,Pe,Ue;return ue=V,u.substr(V,7)===j?(ke=j,V+=7):(ke=f,ye(O)),ke!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=C,V++):(Ue=f,ye(I)),Ue!==f?(ke=F(Pe),ue=ke):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function Oe(){var ue,ke,Pe,Ue;return ue=V,u.substr(V,6)===T?(ke=T,V+=6):(ke=f,ye($)),ke!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=C,V++):(Ue=f,ye(I)),Ue!==f?(ke=q(Pe),ue=ke):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function fe(){var ue,ke,Pe;if(ue=V,ke=[],J.test(u.charAt(V))?(Pe=u.charAt(V),V++):(Pe=f,ye(ae)),Pe!==f)for(;Pe!==f;)ke.push(Pe),J.test(u.charAt(V))?(Pe=u.charAt(V),V++):(Pe=f,ye(ae));else ke=f;return ke!==f&&(ke=ie(ke)),ue=ke,ue}function Le(){var ue;return Z.test(u.charAt(V))?(ue=u.charAt(V),V++):(ue=f,ye(te)),ue}var Ne=r("../util");if(X=g(),X!==f&&V===u.length)return X;throw X!==f&&V<u.length&&ye(oe()),Te(U,D<u.length?u.charAt(D):null,D<u.length?de(D,D+1):de(D,D))}n.exports={SyntaxError:o,parse:s}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,s){this.message=o,this.offset=s},i.parse=function(o){try{return a.parse(o)}catch(s){throw new i.SyntaxError(s.message,s.offset)}},i.serialize=function(o){return o.map(function(s){var u;return s.url?(u='url("'+s.url+'")',s.format&&(u+=' format("'+s.format+'")')):u='local("'+s.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(s){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return s.replace(u,"$1")},o=function(s){var u=/^"(.*)"$/,h=/^'(.*)'$/;return u.test(s)?s.replace(u,"$1"):h.test(s)?s.replace(h,"$1"):s};i.extractValue=function(s){return o(a(s))}},{}]},{},[2])(2)})}(sv)),sv.exports}var Vb;function rN(){return Vb||(Vb=1,function(t){var e=W0(),r=fy(),n=eN(),i=tN(),a=function(E,k,S){E.style.setProperty(k,S,E.style.getPropertyPriority(k))},o=function(E){return E.filter(function(k){return k.type===window.CSSRule.STYLE_RULE&&(k.style.getPropertyValue("background-image")||k.style.getPropertyValue("background"))})},s=function(E){var k=[];return E.forEach(function(S){S.style.getPropertyValue("background-image")?k.push({property:"background-image",value:S.style.getPropertyValue("background-image"),rule:S}):S.style.getPropertyValue("background")&&k.push({property:"background",value:S.style.getPropertyValue("background"),rule:S})}),k},u=function(E){return E.filter(function(k){return k.type===window.CSSRule.FONT_FACE_RULE&&k.style.getPropertyValue("src")})},h=function(E){return E.filter(function(k){return k.type===window.CSSRule.IMPORT_RULE&&k.href})},f=function(E){var k=[];return E.forEach(function(S,A){S.url&&!e.isDataUri(S.url)&&k.push(A)}),k},v=function(E){var k=[];return E.forEach(function(S,A){S.url&&!e.isDataUri(S.url)&&k.push(A)}),k};t.adjustPathsOfCssResources=function(E,k){var S=o(k),A=s(S),M=!1;return A.forEach(function(C){var I=n.parse(C.value),F=f(I),j;F.length>0&&(F.forEach(function(O){var T=I[O].url,$=e.joinUrl(E,T);I[O].url=$}),j=n.serialize(I),a(C.rule,C.property,j),M=!0)}),u(k).forEach(function(C){var I=C.style.getPropertyValue("src"),F,j;try{F=i.parse(I)}catch{return}j=v(F),j.length>0&&(j.forEach(function(O){var T=F[O].url,$=e.joinUrl(E,T);F[O].url=$}),r.changeFontFaceRuleSrc(k,C,i.serialize(F)),M=!0)}),h(k).forEach(function(C){var I=C.href,F=e.joinUrl(E,I);r.exchangeRule(k,C,"@import url("+F+");"),M=!0}),M};var g=function(E,k,S){var A=E.indexOf(k);E.splice(A,1),S.forEach(function(M,C){E.splice(A+C,0,M)})},p=function(E,k,S,A){var M=k.href,C;return M=r.unquoteString(M),C=e.joinUrl(A.baseUrl,M),S.indexOf(C)>=0?(g(E,k,[]),Promise.resolve([])):(S.push(C),e.ajax(M,A).then(function(I){var F=r.rulesForCssText(I);return t.loadCSSImportsForRules(F,S,A).then(function(j){return t.adjustPathsOfCssResources(M,F),g(E,k,F),j.errors})},function(I){throw{resourceType:"stylesheet",url:I.url,msg:"Unable to load stylesheet "+I.url}}))};t.loadCSSImportsForRules=function(E,k,S){var A=h(E),M=[],C=!1;return Promise.all(A.map(function(I){return p(E,I,k,S).then(function(F){M=M.concat(F),C=!0},function(F){M.push(F)})})).then(function(){return{hasChanges:C,errors:M}})};var y=function(E,k){var S=n.parse(E),A=f(S),M=!1;return e.collectAndReportErrors(A.map(function(C){var I=S[C].url;return e.getDataURIForImageURL(I,k).then(function(F){S[C].url=F,M=!0},function(F){throw{resourceType:"backgroundImage",url:F.url,msg:"Unable to load background-image "+F.url}})})).then(function(C){return{backgroundValue:n.serialize(S),hasChanges:M,errors:C}})},_=function(E,k){var S=o(E),A=s(S),M=[],C=!1;return Promise.all(A.map(function(I){return y(I.value,k).then(function(F){F.hasChanges&&(a(I.rule,I.property,F.backgroundValue),C=!0),M=M.concat(F.errors)})})).then(function(){return{hasChanges:C,errors:M}})},x=function(E,k){var S=!1,A,M;try{A=i.parse(E)}catch{A=[]}return M=v(A),e.collectAndReportErrors(M.map(function(C){var I=A[C],F=I.format||"woff";return e.binaryAjax(I.url,k).then(function(j){var O=btoa(j);I.url="data:font/"+F+";base64,"+O,S=!0},function(j){throw{resourceType:"fontFace",url:j.url,msg:"Unable to load font-face "+j.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(A),hasChanges:S,errors:C}})},b=function(E,k){var S=u(E),A=[],M=!1;return Promise.all(S.map(function(C){var I=C.style.getPropertyValue("src");return x(I,k).then(function(F){F.hasChanges&&(r.changeFontFaceRuleSrc(E,C,F.srcDeclarationValue),M=!0),A=A.concat(F.errors)})})).then(function(){return{hasChanges:M,errors:A}})};t.loadAndInlineCSSResourcesForRules=function(E,k){var S=!1,A=[];return Promise.all([_,b].map(function(M){return M(E,k).then(function(C){S=S||C.hasChanges,A=A.concat(C.errors)})})).then(function(){return{hasChanges:S,errors:A}})}}(iv)),iv}var Yb;function nN(){return Yb||(Yb=1,function(t){var e=W0(),r=QL(),n=JL(),i=rN(),a=fy(),o=function(x){return e.joinUrl(x,".")},s=function(x){var b=x.map(function(E,k){return k===x.length-1&&(E={baseUrl:o(E.baseUrl)}),JSON.stringify(E)});return b},u=function(x,b){return b.cache!==!1&&b.cache!=="none"&&b.cacheBucket?e.memoize(x,s,b.cacheBucket):x},h=function(x,b,E){var k=a.rulesForCssText(x);return i.loadCSSImportsForRules(k,b,E).then(function(S){return i.loadAndInlineCSSResourcesForRules(k,E).then(function(A){var M=S.errors.concat(A.errors),C=S.hasChanges||A.hasChanges;return C&&(x=a.cssRulesToText(k)),{hasChanges:C,content:x,errors:M}})})},f=function(x,b,E){var k=x.textContent,S=u(h,b);return S(k,E,b).then(function(A){return A.hasChanges&&(x.childNodes[0].nodeValue=A.content),e.cloneArray(A.errors)})},v=function(x){var b=x.getElementsByTagName("style");return Array.prototype.filter.call(b,function(E){return!E.attributes.type||E.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(x,b){var E=v(x),k=[],S=[],A;return A=e.clone(b),A.baseUrl=A.baseUrl||e.getDocumentBaseUrl(x),Promise.all(E.map(function(M){return f(M,A,S).then(function(C){k=k.concat(C)})})).then(function(){return k})};var g=function(x,b){var E=x.parentNode,k;b=b.trim(),b&&(k=x.ownerDocument.createElement("style"),k.type="text/css",k.appendChild(x.ownerDocument.createTextNode(b)),E.insertBefore(k,x)),E.removeChild(x)},p=function(x,b){return e.ajax(x,b).then(function(E){var k=a.rulesForCssText(E);return{content:E,cssRules:k}}).then(function(E){var k=i.adjustPathsOfCssResources(x,E.cssRules);return{content:E.content,cssRules:E.cssRules,hasChanges:k}}).then(function(E){return i.loadCSSImportsForRules(E.cssRules,[],b).then(function(k){return{content:E.content,cssRules:E.cssRules,hasChanges:E.hasChanges||k.hasChanges,errors:k.errors}})}).then(function(E){return i.loadAndInlineCSSResourcesForRules(E.cssRules,b).then(function(k){return{content:E.content,cssRules:E.cssRules,hasChanges:E.hasChanges||k.hasChanges,errors:E.errors.concat(k.errors)}})}).then(function(E){var k=E.content;return E.hasChanges&&(k=a.cssRulesToText(E.cssRules)),{content:k,errors:E.errors}})},y=function(x,b){var E=x.attributes.href.value,k=e.getDocumentBaseUrl(x.ownerDocument),S=e.clone(b);!S.baseUrl&&k&&(S.baseUrl=k);var A=u(p,b);return A(E,S).then(function(M){return{content:M.content,errors:e.cloneArray(M.errors)}})},_=function(x){var b=x.getElementsByTagName("link");return Array.prototype.filter.call(b,function(E){return E.attributes.rel&&E.attributes.rel.value==="stylesheet"&&(!E.attributes.type||E.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(x,b){var E=_(x),k=[];return Promise.all(E.map(function(S){return y(S,b).then(function(A){g(S,A.content+`
161
+ `),k=k.concat(A.errors)},function(A){k.push({resourceType:"stylesheet",url:A.url,msg:"Unable to load stylesheet "+A.url})})})).then(function(){return k})},t.loadAndInlineImages=r.inline,t.loadAndInlineScript=n.inline,t.inlineReferences=function(x,b){var E=[],k=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];return b.inlineScripts!==!1&&k.push(t.loadAndInlineScript),Promise.all(k.map(function(S){return S(x,b).then(function(A){E=E.concat(A)})})).then(function(){return E})}}(ev)),ev}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
162
+ * http://www.github.com/cburgmer/rasterizeHTML.js
163
+ * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var iN=W1.exports,Xb;function aN(){return Xb||(Xb=1,function(t){(function(e,r){e===void 0&&window!==void 0&&(e=window),t.exports?t.exports=r(D7(),KL(),ZL(),nN()):e.rasterizeHTML=r(e.url,e.xmlserializer,e.sanedomparsererror,e.inlineresources)})(iN,function(e,r,n,i){var a=function(y){var _={},x=[];_.joinUrl=function(k,S){return k?y.resolve(k,S):S},_.getConstantUniqueIdFor=function(k){return x.indexOf(k)<0&&x.push(k),x.indexOf(k)},_.clone=function(k){var S={},A;for(A in k)k.hasOwnProperty(A)&&(S[A]=k[A]);return S};var b=function(k){return typeof k=="object"&&k!==null},E=function(k){return b(k)&&Object.prototype.toString.apply(k).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return _.parseOptionalParameters=function(k){var S={canvas:null,options:{}};return k[0]==null||E(k[0])?(S.canvas=k[0]||null,S.options=_.clone(k[1])):S.options=_.clone(k[0]),S},_}(e),o=function(y){var _={},x=function(b,E,k){var S=b[E];return b[E]=function(){var A=Array.prototype.slice.call(arguments);return k.apply(this,[A,S])},S};return _.baseUrlRespectingXhr=function(b,E){var k=function(){var S=new b;return x(S,"open",function(A,M){var C=A.shift(),I=A.shift(),F=y.joinUrl(E,I);return M.apply(this,[C,F].concat(A))}),S};return k},_.finishNotifyingXhr=function(b){var E=0,k=0,S=!1,A,M=new Promise(function(I){A=function(){var F=E-k;F<=0&&S&&I({totalCount:E})}}),C=function(){var I=new b;return x(I,"send",function(F,j){return E+=1,j.apply(this,arguments)}),I.addEventListener("load",function(){k+=1,A()}),I};return C.waitForRequestsToFinish=function(){return S=!0,A(),M},C},_}(a),s=function(){var y={},_=function(C){return Array.prototype.slice.call(C)};y.addClassName=function(C,I){C.className+=" "+I},y.addClassNameRecursively=function(C,I){y.addClassName(C,I),C.parentNode!==C.ownerDocument&&y.addClassNameRecursively(C.parentNode,I)};var x=function(C,I){var F=C.parentStyleSheet,j=_(F.cssRules).indexOf(C);F.insertRule(I,j+1),F.deleteRule(j)},b=function(C,I){var F=C.cssText.replace(/^[^\{]+/,""),j=I+" "+F;x(C,j)},E=function(C){return _(C).reduce(function(I,F){return I+F.cssText},"")},k=function(C){C.textContent=E(C.sheet.cssRules)},S=function(C){var I=document.implementation.createHTMLDocument(""),F=document.createElement("style");F.textContent=C.textContent,I.body.appendChild(F),C.sheet=F.sheet},A=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},M=function(C,I,F){var j=A(I);_(C.querySelectorAll("style")).forEach(function(O){typeof O.sheet>"u"&&S(O);var T=_(O.sheet.cssRules).filter(function($){return $.selectorText&&new RegExp(j,"i").test($.selectorText)});T.length&&(T.forEach(function($){var q=$.selectorText.replace(new RegExp(j,"gi"),function(J,ae,ie){return ae+F(ie)});q!==$.selectorText&&b($,q)}),k(O))})};return y.rewriteCssSelectorWith=function(C,I,F){M(C,[I],function(){return F})},y.lowercaseCssTypeSelectors=function(C,I){M(C,I,function(F){return F.toLowerCase()})},y.findHtmlOnlyNodeNames=function(C){var I=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),F={},j={},O;do O=I.currentNode.tagName.toLowerCase(),I.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?F[O]=!0:j[O]=!0;while(I.nextNode());return Object.keys(F).filter(function(T){return!j[T]})},y}(),u=function(y){var _={},x=function(E){return Array.prototype.slice.call(E)},b={active:!0,hover:!0,focus:!1,target:!1};return _.fakeUserAction=function(E,k,S){var A=E.querySelector(k),M=":"+S,C="rasterizehtml"+S;A&&(b[S]?y.addClassNameRecursively(A,C):y.addClassName(A,C),y.rewriteCssSelectorWith(E,M,"."+C))},_.persistInputValues=function(E){var k=E.querySelectorAll("input"),S=E.querySelectorAll("textarea"),A=function(M){return M.type==="checkbox"||M.type==="radio"};x(k).filter(A).forEach(function(M){M.checked?M.setAttribute("checked",""):M.removeAttribute("checked")}),x(k).filter(function(M){return!A(M)}).forEach(function(M){M.setAttribute("value",M.value)}),x(S).forEach(function(M){M.textContent=M.value})},_.rewriteTagNameSelectorsToLowerCase=function(E){y.lowercaseCssTypeSelectors(E,y.findHtmlOnlyNodeNames(E))},_}(s),h=function(y,_,x,b){var E={},k=function(ie,Z,te,V){var B=ie.createElement(Z);return B.style.visibility="hidden",B.style.width=te+"px",B.style.height=V+"px",B.style.position="absolute",B.style.top=-1e4-V+"px",B.style.left=-1e4-te+"px",ie.getElementsByTagName("body")[0].appendChild(B),B},S=function(ie){return ie>0?new Promise(function(Z){setTimeout(Z,ie)}):Promise.resolve()};E.executeJavascript=function(ie,Z){return new Promise(function(te){var V=k(b.document,"iframe",Z.width,Z.height),B=ie.outerHTML,D=[],U=Z.executeJsTimeout||0,X=function(){b.document.getElementsByTagName("body")[0].removeChild(V)},ee=function(){var de=V.contentDocument;te({document:de,errors:D,cleanUp:X})},K=V.contentWindow.XMLHttpRequest,oe=_.finishNotifyingXhr(K),me=_.baseUrlRespectingXhr(oe,Z.baseUrl);V.onload=function(){S(U).then(oe.waitForRequestsToFinish).then(ee)},V.contentDocument.open(),V.contentWindow.XMLHttpRequest=me,V.contentWindow.onerror=function(de){D.push({resourceType:"scriptExecution",msg:de})},V.contentDocument.write("<!DOCTYPE html>"),V.contentDocument.write(B),V.contentDocument.close()})};var A=function(ie,Z,te){var V=ie.createElement("iframe");return V.style.width=Z+"px",V.style.height=te+"px",V.style.visibility="hidden",V.style.position="absolute",V.style.top=-1e4-te+"px",V.style.left=-1e4-Z+"px",V.style.borderWidth=0,V.sandbox="allow-same-origin",V.scrolling="no",V},M=function(ie,Z,te){var V=Math.floor(ie/te),B=Math.floor(Z/te);return A(b.document,V,B)},C=function(ie,Z,te,V){return{width:Math.max(ie.width*V,Z),height:Math.max(ie.height*V,te)}},I=function(ie,Z){var te=ie.querySelector(Z);if(te)return te;if(ie.ownerDocument.querySelector(Z)===ie)return ie;throw{message:"Clipping selector not found"}},F=function(ie,Z,te,V,B){var D=Math.max(ie.scrollWidth,ie.clientWidth),U=Math.max(ie.scrollHeight,ie.clientHeight),X,ee,K,oe,me,de,ye,Te;return Z?(de=I(ie,Z),ye=de.getBoundingClientRect(),X=ye.top,ee=ye.left,K=ye.width,oe=ye.height):(X=0,ee=0,K=D,oe=U),Te=C({width:K,height:oe},te,V,B),me=b.getComputedStyle(ie.ownerDocument.documentElement).fontSize,{left:ee,top:X,width:Te.width,height:Te.height,viewportWidth:D,viewportHeight:U,rootFontSize:me}},j=function(ie,Z){var te=ie.tagName;return Z.querySelector(te)},O=function(ie){var Z=ie.tagName.toLowerCase();return Z==="html"||Z==="body"?ie.outerHTML:'<body style="margin: 0;">'+ie.outerHTML+"</body>"};E.calculateDocumentContentSize=function(ie,Z){return new Promise(function(te,V){var B=Z.zoom||1,D;D=M(Z.width,Z.height,B),b.document.getElementsByTagName("body")[0].appendChild(D),D.onload=function(){var U=D.contentDocument,X;try{X=F(j(ie,U),Z.clip,Z.width,Z.height,B),te(X)}catch(ee){V(ee)}finally{b.document.getElementsByTagName("body")[0].removeChild(D)}},D.contentDocument.open(),D.contentDocument.write("<!DOCTYPE html>"),D.contentDocument.write(O(ie)),D.contentDocument.close()})},E.parseHtmlFragment=function(ie){var Z=b.document.implementation.createHTMLDocument("");Z.documentElement.innerHTML=ie;var te=Z.querySelector("body").firstChild;if(!te)throw"Invalid source";return te};var T=function(ie,Z){var te=/<html((?:\s+[^>]*)?)>/im.exec(Z),V=b.document.implementation.createHTMLDocument(""),B,D,U,X;if(te)for(B="<div"+te[1]+"></div>",V.documentElement.innerHTML=B,U=V.querySelector("div"),D=0;D<U.attributes.length;D++)X=U.attributes[D],ie.documentElement.setAttribute(X.name,X.value)};E.parseHTML=function(ie){var Z=b.document.implementation.createHTMLDocument("");return Z.documentElement.innerHTML=ie,T(Z,ie),Z};var $=function(ie){try{return x.failOnParseError(ie)}catch(Z){throw{message:"Invalid source",originalError:Z}}};E.validateXHTML=function(ie){var Z=new DOMParser,te=Z.parseFromString(ie,"application/xml");$(te)};var q=null,J=function(ie,Z){return Z==="none"||Z==="repeated"?((q===null||Z!=="repeated")&&(q=Date.now()),ie+"?_="+q):ie},ae=function(ie,Z){return new Promise(function(te,V){var B=new window.XMLHttpRequest,D=y.joinUrl(Z.baseUrl,ie),U=J(D,Z.cache),X=function(ee){V({message:"Unable to load page",originalError:ee})};B.addEventListener("load",function(){B.status===200||B.status===0?te(B.responseXML):X(B.statusText)},!1),B.addEventListener("error",function(ee){X(ee)},!1);try{B.open("GET",U,!0),B.responseType="document",B.send(null)}catch(ee){X(ee)}})};return E.loadDocument=function(ie,Z){return ae(ie,Z).then(function(te){return $(te)})},E}(a,o,n,window),f=function(y){var _={},x=function(j,O){return O?URL.createObjectURL(new Blob([j],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(j)},b=function(j){j instanceof Blob&&URL.revokeObjectURL(j)},E='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',k=function(j){return new Promise(function(O,T){var $=document.createElement("canvas"),q=new Image;q.onload=function(){var J=$.getContext("2d");try{J.drawImage(q,0,0),$.toDataURL("image/png"),O(!0)}catch{O(!1)}},q.onerror=T,q.src=j})},S=function(){var j=x(E,!0);return k(j).then(function(O){return b(j),O?!1:k(x(E,!1)).then(function(T){return T})},function(){return!1})},A=function(){if(y.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},M=function(){return new Promise(function(j,O){A()&&y.URL?S().then(function(T){j(!T)},function(){O()}):j(!1)})},C,I=function(){return C===void 0&&(C=M()),C},F=function(j){return I().then(function(O){return x(j,O)})};return _.renderSvg=function(j){return new Promise(function(O,T){var $,q,J=function(){q.onload=null,q.onerror=null},ae=function(){$&&b($)};q=new Image,q.onload=function(){J(),ae(),O(q)},q.onerror=function(){ae(),T()},F(j).then(function(ie){$=ie,q.src=$},T)})},_}(window),v=function(y,_,x,b){var E={},k=function(j,O){var T=O||1,$={width:j.width,height:j.height,"font-size":j.rootFontSize};return T!==1&&($.style="transform:scale("+T+"); transform-origin: 0 0;"),$},S=function(j){var O,T,$,q;O=Math.round(j.viewportWidth),T=Math.round(j.viewportHeight),$=-j.left,q=-j.top;var J={x:$,y:q,width:O,height:T};return J},A=function(j){var O=j.style||"";j.style=O+"float: left;"},M=function(j){j.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},I=function(j){var O=Object.keys(j);return O.length?" "+O.map(function(T){return T+'="'+j[T]+'"'}).join(" "):""},F=function(j,O,T){var $=b.serializeToString(j);_.validateXHTML($);var q=S(O);return A(q),M(q),'<svg xmlns="http://www.w3.org/2000/svg"'+I(k(O,T))+">"+C()+"<foreignObject"+I(q)+">"+$+"</foreignObject></svg>"};return E.getSvgForDocument=function(j,O,T){return x.rewriteTagNameSelectorsToLowerCase(j),F(j,O,T)},E.drawDocumentAsSvg=function(j,O){return["hover","active","focus","target"].forEach(function(T){O[T]&&x.fakeUserAction(j,O[T],T)}),_.calculateDocumentContentSize(j,O).then(function(T){return E.getSvgForDocument(j,T,O.zoom)})},E}(a,h,u,r),g=function(y,_,x,b,E,k){var S={},A=function(j){return{message:"Error rendering page",originalError:j}},M=function(j){return E.renderSvg(j).then(function(O){return{image:O,svg:j}},function(O){throw A(O)})},C=function(j,O){try{O.getContext("2d").drawImage(j,0,0)}catch(T){throw A(T)}},I=function(j,O,T){return b.drawDocumentAsSvg(j,T).then(M).then(function($){return O&&C($.image,O),$})},F=function(j,O){return _.executeJavascript(j,O).then(function(T){var $=T.document;return x.persistInputValues($),{document:$,errors:T.errors,cleanUp:T.cleanUp}})};return S.rasterize=function(j,O,T){var $;return $=y.clone(T),$.inlineScripts=T.executeJs===!0,k.inlineReferences(j,$).then(function(q){return T.executeJs?F(j,T).then(function(J){return{element:J.document.documentElement,errors:q.concat(J.errors),cleanUp:J.cleanUp}}):{element:j,errors:q,cleanUp:function(){}}}).then(function(q){return I(q.element,O,T).then(function(J){return q.cleanUp(),{image:J.image,svg:J.svg,errors:q.errors}})})},S}(a,h,u,v,f,i),p=function(y,_,x){var b={},E=function(C,I){var F=300,j=200,O=C?C.width:F,T=C?C.height:j,$=I.width!==void 0?I.width:O,q=I.height!==void 0?I.height:T;return{width:$,height:q}},k=function(C){var I=E(C.canvas,C.options),F;return F=y.clone(C.options),F.width=I.width,F.height=I.height,F};b.drawDocument=function(){var C=arguments[0],I=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(I),j=C.documentElement?C.documentElement:C;return x.rasterize(j,F.canvas,k(F))};var S=function(C,I,F){var j=_.parseHTML(C);return b.drawDocument(j,I,F)};b.drawHTML=function(){var C=arguments[0],I=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(I);return S(C,F.canvas,F.options)};var A=function(C,I,F){var j=document.implementation.createHTMLDocument("");j.replaceChild(C.documentElement,j.documentElement);var O=F?y.clone(F):{};return F.baseUrl||(O.baseUrl=I),{document:j,options:O}},M=function(C,I,F){return _.loadDocument(C,F).then(function(j){var O=A(j,C,F);return b.drawDocument(O.document,I,O.options)})};return b.drawURL=function(){var C=arguments[0],I=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(I);return M(C,F.canvas,F.options)},b}(a,h,g);return p})}(W1)),W1.exports}var oN=aN();function sN(t,e){if(!t.includes("@font-face"))return"";const r=new Set,n=new Set;e&&((e.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(h=>{const f=h.split(":")[1].trim();f==="bold"?r.add("700"):f==="normal"?r.add("400"):/^\d+$/.test(f)&&r.add(f)}),(e.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(h=>{h.split(":")[1].trim().toLowerCase()==="italic"&&n.add("italic")}),/<(b|strong)\b/i.test(e)&&r.add("700"),/<(i|em)\b/i.test(e)&&n.add("italic"));const i=rl(e);i&&i.trim()&&r.add("400"),r.size===0&&r.add("400");const a=r,o=n.has("italic"),s=Array.from(new Set(i)).map(h=>h.codePointAt(0)).filter(h=>h!==void 0),u=t.split(/}\s*/).map(h=>h&&h+"}").filter(h=>/@font-face/.test(h)&&(f=>{const v=(f.match(/font-weight:\s*(\d+)/)||[])[1];if(v&&!a.has(v)||/font-style:\s*italic/.test(f)&&!o)return!1;const g=f.match(/unicode-range:\s*([^;]+);/);if(!g)return!0;const p=g[1].split(",").map(y=>{const[_,x=_]=y.replace("U+","").split("-").map(b=>parseInt(b,16));return[_,x]});return s.some(y=>p.some(([_,x])=>y>=_&&y<=x))})(h)).join(`
164
+ `);return u?`<style>${u}</style>`:""}const V0=`
165
+ p {
166
+ margin: 0;
167
+ padding: 0;
168
+ word-wrap: break-word; /* Required for Firefox */
169
+ /* a text may have several spaces, we need to preserve them */
170
+ white-space: pre-wrap;
171
+ }
172
+
173
+ /* Reset default list styles and setup counters */
174
+ ul, ol {
175
+ list-style: none; /* Remove default markers */
176
+ padding-inline-start: 0; /* Reset padding */
177
+ margin: 0;
178
+ display: block; /* Use block instead of inline-block for better text wrapping */
179
+ width: 100%;
180
+ text-decoration: inherit;
181
+ counter-reset: ol-counter; /* Initialize counter for ol */
182
+ }
183
+
184
+ li {
185
+ position: relative; /* Needed for absolute positioning of ::before */
186
+ padding-inline-start: 2.1em; /* Space for the marker (start side) */
187
+ margin: 0; /* Reset default li margins */
188
+ word-wrap: break-word; /* Required for Firefox text wrapping */
189
+ white-space: pre-wrap; /* Preserve spaces and allow wrapping */
190
+ }
191
+
192
+ li::before {
193
+ content: ''; /* Base content */
194
+ position: absolute;
195
+ /* Use logical properties for positioning */
196
+ inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
197
+ top: 0; /* Adjust vertical alignment */
198
+ /* Prevent letter-spacing from affecting the marker */
199
+ letter-spacing: normal;
200
+ /* Define width to ensure consistent spacing and alignment */
201
+ display: inline-block;
202
+ width: 2em; /* Width for the marker container */
203
+ /* Align multi-digit numbers to the end (right in LTR, left in RTL) */
204
+ text-align: end;
205
+ /* Space between marker and text (using logical property) */
206
+ margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
207
+ /* Prevent marker style from inheriting list item styles */
208
+ font-weight: normal;
209
+ font-style: normal;
210
+ }
211
+
212
+ /* Style for bullet points */
213
+ ul > li::before {
214
+ content: '•'; /* Literal bullet character */
215
+ /* Center the bullet within its allocated width */
216
+ text-align: center; /* Override text-align: end for bullets */
217
+ font-size: 1.2em;
218
+ top: 0em; /* Re-adjust vertical alignment for bullet */
219
+ /* Bullets don't need number alignment, width can be tighter */
220
+ width: 2em;
221
+ /* Adjust margin to maintain overall padding */
222
+ margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
223
+ }
224
+
225
+ /* Style for numbers using counter */
226
+ ol > li {
227
+ counter-increment: ol-counter; /* Increment counter for each li in ol */
228
+ }
229
+
230
+ ol > li::before {
231
+ content: counter(ol-counter) "."; /* Display counter value + dot */
232
+ }
233
+
234
+ .ql-indent-1 {
235
+ margin-inline-start: 0.5em;
236
+ }
237
+ .ql-indent-2 {
238
+ margin-inline-start: 1em;
239
+ }
240
+ .ql-indent-3 {
241
+ margin-inline-start: 1.5em;
242
+ }
243
+ `,lN=`
244
+ <style>
245
+ html, body {
246
+ padding: 0;
247
+ margin: 0;
248
+ }
249
+ ${V0}
250
+ </style>
251
+ `;let tf;const F7=()=>(tf||(tf=document.createElement("div"),tf.id="polotno-hidden-do-not-touch",tf.style.overflow="hidden",tf.style.position="relative",document.body.appendChild(tf),tf.innerHTML=`<style>#polotno-hidden-do-not-touch {${V0}}</style>`),tf);navigator.userAgent.includes("Firefox");function uN({html:t}){const e=document.createElement("div");e.innerHTML=t,e.style.display="inline-block",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.zIndex="1000",e.style.whiteSpace="nowrap",e.style.visibility="hidden";const r=F7();r.appendChild(e);const n=e.textContent,i=e.childNodes[0];i.style.whiteSpace="nowrap";const a=n?.split(/\s+/)||[];let o=!1;for(let s=0;s<a.length;s++){const u=a[s];if(i&&(i.textContent=u,o=i.scrollWidth>e.clientWidth,o))break}return r.removeChild(e),o}function Kb(t){const e=document.createElement("div");e.innerHTML=t,e.style.display="inline-block",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.zIndex="1000";const r=F7();r.appendChild(e);const n=e.getBoundingClientRect();return r.removeChild(e),{width:n.width,height:n.height}}const cN={},lv={},uv=new Map;async function Zb({html:t,width:e,height:r,fontFamily:n,padding:i,font:a,pixelRatio:o}){let s="";if(n!=="Arial"&&!a){const y=eO();s=await async function(_,x){const b=`${_}|${x}`;if(uv.has(b))return uv.get(b);const E=`https://fonts.googleapis.com/css?family=${_}:${x}&display=swap`,k=await(await fetch(E)).text();return uv.set(b,k),k}(n,y)}if(a){const y=a.styles||(a.url?[{src:`url("${a.url}")`}]:(_=>{if(lv[_])return lv[_];const x=function(E){const k=[];for(let S=0;S<document.styleSheets.length;S++){const A=document.styleSheets[S];try{const M=A.cssRules;if(M)for(let C=0;C<M.length;C++){const I=M[C];I instanceof CSSFontFaceRule&&I.style.fontFamily.replace(/['"]/g,"")===E&&k.push(I)}}catch(M){console.warn(`Could not access stylesheet: ${A.href}`,M)}}return k}(_),b=x.filter(E=>E.style.fontFamily.replace(/['"]/g,"")===_).map(E=>({src:E.style.getPropertyValue("src"),fontStyle:E.style.getPropertyValue("font-style")||"normal",fontWeight:E.style.getPropertyValue("font-weight")||"normal"}));return lv[_]=b,b})(n));s="",y.forEach(_=>{s+=`
252
+ @font-face {
253
+ font-family: '${n}';
254
+ src: ${_.src};
255
+ font-style: ${_.fontStyle||"normal"};
256
+ font-weight: ${_.fontWeight||"normal"};
257
+ }
258
+ `})}let u="";s&&(u=sN(s,t)),t+=u+lN;const h=e+2*i,f=r+2*i,v=document.createElement("canvas"),g=await oN.drawHTML(`<div style="padding: ${i}px;" dir="auto">${t}</div>`,v,{width:h,height:f,cacheBucket:cN});sy(v,h*o,f*o);const p=v.getContext("2d");return p?.drawImage(g.image,0,0,h,f,0,0,v.width,v.height),v}let fN={data:""},hN=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||fN,dN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,pN=/\/\*[^]*?\*\/|\s\s+|\n/g,uf=(t,e)=>{let r="",n="",i="";for(let a in t){let o=t[a];a[0]=="@"?a[1]=="i"?r=a+" "+o+";":n+=a[1]=="f"?uf(o,a):a+"{"+uf(o,a[1]=="k"?"":e)+"}":typeof o=="object"?n+=uf(o,e?e.replace(/([^,])+/g,s=>a.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):a):o!=null&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=uf.p?uf.p(a,o):a+":"+o+";")}return r+(e&&i?e+"{"+i+"}":i)+n},jd={},B7=t=>{if(typeof t=="object"){let e="";for(let r in t)e+=r+B7(t[r]);return e}return t},gN=(t,e,r,n,i)=>{let a=B7(t),o=jd[a]||(jd[a]=(s=>{let u=0,h=11;for(;u<s.length;)h=101*h+s.charCodeAt(u++)>>>0;return"go"+h})(a));if(!jd[o]){let s=a!==t?t:(u=>{let h,f=[{}];for(;h=dN.exec(u.replace(pN,""));)h[4]?f.shift():h[3]?f.unshift(f[0][h[3]]=f[0][h[3]]||{}):f[0][h[1]]=h[2];return f[0]})(t);jd[o]=uf(i?{["@keyframes "+o]:s}:s,r?"":"."+o)}return((s,u,h)=>{u.data.indexOf(s)==-1&&(u.data=h?s+u.data:u.data+s)})(jd[o],e,n),o};function hy(t){let e=this||{},r=t.call?t(e.p):t;return gN(r.unshift?r.raw?((n,i,a)=>n.reduce((o,s,u)=>{let h=i[u];if(h&&h.call){let f=h(a),v=f&&f.props&&f.props.className||/^go/.test(f)&&f;h=v?"."+v:f&&typeof f=="object"?f.props?"":uf(f,""):f===!1?"":f}return o+s+(h??"")},""))(r,[].slice.call(arguments,1),e.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(e.p):i),{}):r,hN(e.target),e.g,e.o,e.k)}let z7,vm,mm;hy.bind({g:1});hy.bind({k:1});function vN(t,e,r,n){uf.p=e,z7=t,vm=r,mm=n}function _d(t,e){let r=this||{};return function(){let n=arguments;function i(a,o){let s=Object.assign({},a),u=s.className||i.className;r.p=Object.assign({theme:vm&&vm()},s),r.o=/ *go\d+/.test(u),s.className=hy.apply(r,n)+(u?" "+u:""),e&&(s.ref=o);let h=t;return t[0]&&(h=s.as||t,delete s.as),mm&&h[0]&&mm(s),z7(h,s)}return e?e(i):i}}vN(se.createElement);function Qb(t){const e=(t||"").trim();if(e==="<p><br></p>"||e==="<p></p>")return"";if(e.startsWith("<p>")&&e.endsWith("</p>")){const r=e.slice(3,-4);if(!/(<\/?(p|div|h[1-6]|ul|ol|li|table|thead|tbody|tr|td|blockquote)\b)/i.test(r))return r}return t}const Wf=Kr({enabled:!1,currentFormat:{},editor:Kr.object({instance:null},{},{deep:!1})}),q7=_d("div",se.forwardRef)`
259
+ .ql-editor {
260
+ outline: none;
261
+ }
262
+ .ql-clipboard {
263
+ pointer-events: none;
264
+ }
265
+ ${V0}
266
+ strong {
267
+ font-weight: 700;
268
+ }
269
+ .ql-direction-rtl {
270
+ direction: rtl;
271
+ }
272
+ `;let mN=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const Jb=(t,e)=>{var r=t.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+e+"<p><br></p></div>");t.setContents(r),t.history.clear()},yN=({html:t,onBlur:e,onChange:r,element:n,clickCoords:i})=>{const a=se.useRef(null);se.useEffect(()=>{if(!a.current)return;const u=(h=a.current,new P7(h,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:mN}));var h;return hc(()=>{Wf.editor.instance=u}),window.__polotnoQuill=u,u.on("text-change",()=>{u.getSelection()&&hc(()=>{Wf.currentFormat=u.getFormat(u.getSelection())}),setTimeout(()=>{var f;const v=(f=a.current)===null||f===void 0?void 0:f.childNodes[0];if(!v)return;const g=v.innerHTML;r(Qb(g))},10)}),Jb(u,t),i?_N(u,i):u.setSelection(0,0,"api"),u.on("selection-change",(f,v,g)=>{f&&hc(()=>{Wf.currentFormat=u.getFormat(u.getSelection())})}),a.current.childNodes[0].addEventListener("blur",f=>{var v;if(!((v=f.relatedTarget)===null||v===void 0)&&v.classList.contains("ql-clipboard"))return;(function(p){return!!p&&!!p.closest(".sketch-picker")})(f.relatedTarget)||e()}),()=>{hc(()=>{Wf.editor.instance=null,Wf.currentFormat={}}),delete window.__polotnoQuill}},[]),se.useEffect(()=>A6(()=>n.text,()=>{var u;const h=Wf.editor.instance;if(!h)return;const f=h.getSelection();Qb((u=a.current)===null||u===void 0?void 0:u.childNodes[0].innerHTML)===n.text||(Jb(h,t),f&&(h.setSelection(f.index,f.length),hc(()=>{Wf.currentFormat=h.getFormat(h.getSelection())})))},{fireImmediately:!0}),[]),se.useEffect(()=>{window.addEventListener("blur",e);const u=h=>{var f;!((f=a.current)===null||f===void 0)&&f.contains(h.target)||e()};return window.addEventListener("touchstart",u),()=>{window.removeEventListener("blur",e),window.removeEventListener("touchstart",u)}},[]);const o={color:n.fill};n.fill.indexOf("gradient")>=0&&(o.backgroundColor=n.fill,o.backgroundImage=n.fill,o.backgroundSize="100% 100%",o.backgroundRepeat="repeat",o.webkitBackgroundClip="text",o.MozBackgroundClip="text",o.WebkitTextFillColor="transparent",o.MozTextFillColor="transparent");const s=w7(n);return se.createElement(q7,{ref:a,style:Object.assign(Object.assign({},o),{fontSize:n.fontSize,fontWeight:n.fontWeight,textTransform:n.textTransform,width:n.a.width,fontFamily:'"'+n.fontFamily+'"',lineHeight:n.lineHeight,letterSpacing:n.letterSpacing*n.fontSize+"px",textAlign:n.align,opacity:Math.max(n.a.opacity,.2),textShadow:n.shadowEnabled?`${n.shadowOffsetX}px ${n.shadowOffsetY}px ${n.shadowBlur}px ${n.shadowColor}`:void 0,caretColor:s}),dir:H0(rl(n.text))})};function bN(t){return!function(e){const r=e.getContext("2d").getImageData(0,0,e.width,e.height).data;for(let n=0;n<r.length;n+=4)if(r[n+3]!==0)return!0;return!1}(t)}function e4(t,{fontFamily:e="",color:r="black"}={}){let n=`color: ${r||t.fill}`;t.fill.indexOf("gradient")>=0&&(n=`
273
+ background-color: ${r};
274
+ background-image: ${t.fill};
275
+ background-size: 100% 100%;
276
+ background-repeat: repeat;
277
+ -webkit-background-clip: text;
278
+ -moz-background-clip: text;
279
+ -webkit-text-fill-color: transparent;
280
+ -moz-text-fill-color: transparent;
281
+ `);const i=["white-space: pre-wrap","word-break: break-word",`width: ${Math.round(t.width||100)}px`,n,`font-size: ${t.fontSize}px`,`font-family: '${e}'`,`text-align: ${t.align}`,`text-transform: ${t.textTransform}`,t.textDecoration?`text-decoration: ${t.textDecoration}; text-decoration-color: ${r||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("; ");if(t.curveEnabled){const a=function(s){const u=new or.TextPath({data:bp(s.a.width,s.a.height,s.curvePower,s.a.fontSize),align:"center",textBaseline:"middle",text:rl(s.text),fontSize:s.a.fontSize,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,letterSpacing:s.letterSpacing*s.a.fontSize,fill:s.fill}),h=u.getSelfRect().height;return u.destroy(),h}(t),o=Math.round(t.width||100);return`
282
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${a}">
283
+ <defs><path id="curve" d="${bp(o,a,t.curvePower,t.fontSize)}" fill="none" /></defs>
284
+ <text
285
+ font-family="'${e}'"
286
+ font-size="${t.fontSize}"
287
+ font-weight="${t.fontWeight}"
288
+ font-style="${t.fontStyle}"
289
+ fill="${r}"
290
+ text-anchor="middle"
291
+ dominant-baseline="middle"${t.strokeWidth?` stroke="${t.stroke}" stroke-width="${t.strokeWidth}" paint-order="stroke fill"`:""}>
292
+ <textPath href="#curve" startOffset="50%">
293
+ ${rl(t.text).replace(/\\n/g," ")}
294
+ </textPath>
295
+ </text>
296
+ </svg>`}return`<div style="${i}" contentEditable dir="${H0(rl(t.text))}">${oO(t.text).replace(/\n/g,"</br>")}</div>`}const t4=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),wN=ni(({element:t,store:e})=>{const r=se.useRef(null),[n,i]=se.useState(),[a,o]=se.useState(!1),[s,u]=se.useState(!1),h=se.useRef(t.height),f=e.selectedShapes.indexOf(t)>=0&&t.selectable,v=t.fontSize/3,{textVerticalResizeEnabled:g}=Si,p=S7(t.fontFamily),[y]=_7(e,t.fontFamily),_=t._editModeEnabled;Lp(r);const x=y?t.fontFamily:p!==t.fontFamily?p:"Arial",b=yf(t).fill,E=e4(t,{fontFamily:x,color:b});let{width:k,height:S}=function(te,V,B){return se.useMemo(()=>Kb(te),[te,V.width,B])}(E,t,y);se.useEffect(()=>{if(!y)return;if(!t.height)return void e.history.ignore(()=>{t.set({height:S})});const{textOverflow:te}=Si;if(te!=="change-font-size"||a)te==="resize"&&(g&&t.height<S&&!a&&e.history.ignore(()=>{t.set({height:S})}),g||t.height===S||e.history.ignore(()=>{t.set({height:S})}));else{const V=(B=>{let D=B.fontSize;for(let U=1;U<50;U++){const X=e4(Object.assign(Object.assign({},B.toJSON()),{fontSize:D}),{fontFamily:B.fontFamily}),{height:ee}=Kb(X);if(!(B.height&&ee>B.height||!Si.textSplitAllowed&&uN({html:X})))break;D-=.5}return D})(t);V!==t.fontSize?e.history.ignore(()=>{t.set({fontSize:V})}):t.height!==S&&(g&&t.height<S?e.history.ignore(()=>{t.set({height:S})}):g||e.history.ignore(()=>{t.set({height:S})}))}});const A=se.useMemo(()=>{const te={lastArgs:null,lastResult:null};return async function(V){return te.lastArgs&&te.lastResult&&(B=te.lastArgs,D=V,JSON.stringify(B)===JSON.stringify(D))||(te.lastResult=await Zb(V),te.lastArgs=Object.assign({},V)),te.lastResult;var B,D}},[]),M=se.useRef(0),C=se.useRef(null);se.useEffect(()=>{a||_||(async()=>{M.current++;const te=M.current;let V=fd(`text ${t.id} ${te}`);C.current&&C.current(),C.current=V,u(!0);let B=null;const D=t4?5:1;for(let U=0;U<D;U++){const X=U>0?A:Zb;try{if(B=await X({skipCache:U>0,html:E,width:t.width||1,height:t.height||S||1,fontFamily:x,padding:v,pixelRatio:e._elementsPixelRatio,font:e.fonts.find(ee=>ee.fontFamily===x)||ey.find(ee=>ee.fontFamily===x)}),te!==M.current)return;if(t4&&bN(B)){await new Promise(ee=>setTimeout(ee,50*(U+1)));continue}break}catch(ee){console.error(ee),Np(`Error rendering rich text with id ${t.id}`);break}}B?i(B):V?(V(),V=null):console.error("Finish function is called twice!"),u(!1)})()},[E,a,S,_,x,t.height,e._elementsPixelRatio,y]);const[I,F]=gm(s,300),[j]=gm(a,300,!0),O=j||I;se.useEffect(()=>{var te;if(!O)return Bu(()=>{const V=r.current;Ts(V,t)});(te=r.current)===null||te===void 0||te.clearCache()},[n,O,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]),se.useEffect(()=>{n&&!s&&C.current&&(C.current(),C.current=null)},[n,s]),se.useLayoutEffect(()=>{if(!y||!t.curveEnabled)return;const te=new or.TextPath({data:bp(t.a.width,t.a.height,t.curvePower,t.a.fontSize),text:rl(t.text),letterSpacing:t.letterSpacing*t.a.fontSize,fontSize:t.a.fontSize,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontStyle:t.fontStyle,align:"center",textBaseline:"middle",fill:t.fill}),V=te.getSelfRect().width;if(V){const B=V-t.a.width,D=t.a.rotation*Math.PI/180,U=-B/2*Math.cos(D),X=-B/2*Math.sin(D);t.set({width:V,x:t.a.x+U,y:t.a.y+X})}te.destroy()},[y,t.curveEnabled,t.curvePower,t.text,t.fontSize,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing]),se.useEffect(()=>()=>{C.current&&C.current()},[]),se.useEffect(()=>{f||rl(t.text)!==""||!t.removable||t.placeholder||e.deleteElements([t.id])},[f]);let T=0;t.verticalAlign==="middle"&&(T=(t.height-S)/2),t.verticalAlign==="bottom"&&(T=t.height-S);const $=x7({fontLoaded:y,fontFamily:t.fontFamily,fontSize:t.fontSize,lineHeight:t.lineHeight}),q=Of(),J=bp(t.a.width,S,t.curvePower,t.fontSize),ae=se.useRef(null),ie=se.useRef(null),Z=_&&t.strokeWidth>0;return se.createElement(se.Fragment,null,se.createElement(Tn,{x:t.a.x,y:t.a.y,offsetX:t.backgroundPadding*(t.fontSize*$*.5),offsetY:t.backgroundPadding*(t.fontSize*$*.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*$),height:t.a.height+t.backgroundPadding*(t.fontSize*$),cornerRadius:t.backgroundCornerRadius*(t.fontSize*$*.5)}),se.createElement(dp,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,data:J,stroke:"red",strokeWidth:1,visible:!1}),se.createElement(Tn,{ref:r,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:!O,draggable:q?t.draggable&&f:t.draggable,preventDefault:!q||f,opacity:_?0:t.a.opacity,hideInExport:!t.showInExport,onDragMove:te=>{t.set({x:te.target.x(),y:te.target.y()})},onDragEnd:te=>{t.set({x:te.target.x(),y:te.target.y()})},id:t.id,onDblClick:te=>{t.contentEditable&&(ie.current={x:te.evt.clientX,y:te.evt.clientY},t.toggleEditMode(!0))},onDblTap:te=>{var V;if(t.contentEditable){const B=(V=te.evt.changedTouches)===null||V===void 0?void 0:V[0];ie.current=B?{x:B.clientX,y:B.clientY}:null,t.toggleEditMode(!0)}},onTransformStart:te=>{o(!0),h.current=t.height},onTransform:te=>{var V;const B=te.target,D=((V=B.getStage())===null||V===void 0?void 0:V.findOne("Transformer")).getActiveAnchor(),U=D==="middle-left"||D==="middle-right",X=D==="top-center"||D==="bottom-center",ee=B.scaleX();if(U){const K=B.scaleX(),oe=B.width()*K,me=t.fontSize;let de=oe;if(oe<me&&(de=me,ae.current&&B.position(ae.current)),B.width(de),B.scaleX(1),Si.textVerticalResizeEnabled){const ye=Math.max(S,h.current);t.set({height:ye})}t.set({width:B.width(),x:B.x(),y:B.y()})}else if(X){let K=Si.textOverflow==="resize"?S:t.lineHeight*t.fontSize;const oe=Math.max(K,te.target.height()*te.target.scaleY());B.scaleY(1),t.set({x:B.x(),y:B.y(),height:oe,rotation:B.rotation()})}else B.scaleX(1),B.scaleY(1),t.set({fontSize:t.fontSize*ee,letterSpacing:t.letterSpacing,width:B.width()*ee,x:B.x(),y:B.y(),rotation:B.rotation(),height:B.height()*ee});ae.current=te.target.position()},onTransformEnd:te=>{o(!1),u(!0);const V=te.target.scaleX();te.target.scaleX(1),te.target.scaleY(1),t.set({fontSize:t.fontSize*V,width:te.target.width()*V,x:te.target.x(),y:te.target.y(),rotation:te.target.rotation(),shadowBlur:t.shadowBlur*V,shadowOffsetX:t.shadowOffsetX*V,shadowOffsetY:t.shadowOffsetY*V,strokeWidth:t.strokeWidth*V})}}),se.createElement(Nu,{ref:r,image:n,x:t.a.x,y:t.a.y,offsetX:v,offsetY:v-T,listening:!1,rotation:t.a.rotation,width:t.a.width+2*v,height:(t.a.width+2*v)*(n?.height/n?.width||1),visible:!O&&!_,opacity:t.a.opacity,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,hideInExport:!t.showInExport,editModeEnabled:t._editModeEnabled||a||O}),(O||Z)&&se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,offsetY:-T},se.createElement(p0,{divProps:{style:{pointerEvents:"none"}}},se.createElement(q7,{dangerouslySetInnerHTML:{__html:E},style:{pointerEvents:"none",opacity:t.a.opacity,textShadow:t.shadowEnabled?`${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor}`:void 0}}))),_&&se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,offsetY:-T},se.createElement(p0,null,se.createElement(yN,{html:E,element:t,onChange:te=>{const V=b7({oldText:rl(t.text),newText:rl(te),element:t});t.set({text:te,fontSize:V})},onBlur:te=>{t.toggleEditMode(!1),F(!0)},clickCoords:ie.current}))))});function _N(t,e){if(!t||!e)return;const{x:r,y:n}=e;try{let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r,n);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r,n);a&&(i=document.createRange(),i.setStart(a.offsetNode,a.offset))}if(i){const a=P7.find(i.startContainer,!0);if(a){const o=a.offset(t.scroll)+i.startOffset;return void t.setSelection(o,0,"api")}}}catch{}t.setSelection(0,0,"api")}function dy(t){return t/180*Math.PI}function P1(t,e,r,n,i){const a=Math.sqrt(r*r+n*n);return i+=Math.atan2(n,r),{x:t+a*Math.cos(i),y:e+a*Math.sin(i)}}function Y0(t){const{x:e,y:r,width:n,height:i}=t,a=dy(t.rotation),o=P1(e,r,0,0,a),s=P1(e,r,n,0,a),u=P1(e,r,n,i,a),h=P1(e,r,0,i,a),f=Math.min(o.x,s.x,u.x,h.x),v=Math.min(o.y,s.y,u.y,h.y),g=Math.max(o.x,s.x,u.x,h.x),p=Math.max(o.y,s.y,u.y,h.y);return{x:f,y:v,width:g-f,height:p-v,minX:f,minY:v,maxX:g,maxY:p}}function X0(t){const e=t.map(o=>Y0(o)),r=Math.min(...e.map(o=>o.minX)),n=Math.min(...e.map(o=>o.minY)),i=Math.max(...e.map(o=>o.maxX)),a=Math.max(...e.map(o=>o.maxY));return{x:r,y:n,width:i-r,height:a-n,minX:r,minY:n,maxX:i,maxY:a}}function xN(t){const e=dy(t.rotation||0);return{x:t.x+t.width/2*Math.cos(e)+t.height/2*Math.sin(-e),y:t.y+t.height/2*Math.cos(e)+t.width/2*Math.sin(e)}}function SN(t,e,r){const n=dy(e),i=r.x+(t.x-r.x)*Math.cos(n)-(t.y-r.y)*Math.sin(n),a=r.y+(t.x-r.x)*Math.sin(n)+(t.y-r.y)*Math.cos(n);return Object.assign(Object.assign({},t),{rotation:t.rotation+e,x:i,y:a})}function EN(t,e){return SN(t,e,xN(t))}const es={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},AN=({stroke:t,strokeWidth:e,dash:r})=>{t!==void 0&&(es.stroke=t),e!==void 0&&(es.strokeWidth=e),r!==void 0&&(es.dash=r)};let r4=({targetKonvaNodes:t,guideKonvaNode:e,distance:r,snapDirection:n})=>r<5;function ym(t,e){var r=[],n=[];t.vertical.forEach(h=>{e.vertical.forEach(f=>{var v=Math.abs(h.offset-f.guide);r4({targetKonvaNodes:f.nodes,guideKonvaNode:h.node,distance:v,snapDirection:h.snap})&&r.push({lineGuide:h.offset,diff:v,snap:f.snap,offset:f.offset})})}),t.horizontal.forEach(h=>{e.horizontal.forEach(f=>{var v=Math.abs(h.offset-f.guide);r4({targetKonvaNodes:f.nodes,guideKonvaNode:h.node,distance:v,snapDirection:h.snap})&&n.push({lineGuide:h.offset,diff:v,snap:f.snap,offset:f.offset})})});var i=[];const a=r.sort((h,f)=>h.diff-f.diff),o=n.sort((h,f)=>h.diff-f.diff);var s=a[0],u=o[0];return s&&a.filter(h=>Math.abs(h.diff-s.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"V"},h))}),u&&o.filter(h=>Math.abs(h.diff-u.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"H"},h))}),i}const U7=()=>{if(or.DD._dragElements.size===0)return;const t=[...or.DD._dragElements.entries()],e=t.find(([r,n])=>n.node instanceof or.Transformer);e&&(t.splice(t.indexOf(e),1),t.unshift(e),or.DD._dragElements.clear(),t.forEach(([r,n])=>{or.DD._dragElements.set(r,n)}))};function kN(t,e,r){const n=se.useRef(null);AN(r);const i=f=>f.hasName("element")||f.hasName("page-background")||!n.current&&f.hasName("elements-area");function a(f){var v;const g=(v=t.current)===null||v===void 0?void 0:v.getStage(),p=[],y=[];return g.find(i).forEach(_=>{if(!(f.indexOf(_)>=0)){var x=_.getClientRect({skipShadow:!0,skipStroke:!0});p.push({offset:x.x,node:_,snap:"start"},{offset:x.x+x.width,node:_,snap:"end"},{offset:x.x+x.width/2,node:_,snap:"center"}),y.push({offset:x.y,node:_,snap:"start"},{offset:x.y+x.height,node:_,snap:"end"},{offset:x.y+x.height/2,node:_,snap:"center"})}}),{vertical:p,horizontal:y}}function o(f){var v;const g=(v=t.current)===null||v===void 0?void 0:v.getLayer(),p=g?.children.find(y=>y.name()==="line-guides");f.forEach(y=>{if(y.orientation==="H"){var _=new or.Line({x:-g.getStage().x(),y:-g.getStage().y(),points:[-6e3,y.lineGuide,6e3,y.lineGuide],stroke:es.stroke,strokeWidth:es.strokeWidth,name:"guid-line",dash:es.dash});p?.add(_),g.batchDraw()}else y.orientation==="V"&&(_=new or.Line({x:-g.getStage().x(),y:-g.getStage().y(),points:[y.lineGuide,-6e3,y.lineGuide,6e3],stroke:es.stroke,strokeWidth:es.strokeWidth,name:"guid-line",dash:es.dash}),p?.add(_))})}const s=f=>{const v=f.target.getLayer().children.find(k=>k.name()==="line-guides");v?.destroyChildren();var g=a(f.target.nodes()),p=function(k){const S=k.__getNodeRect(),A=Y0(Object.assign(Object.assign({},S),{rotation:or.Util.radToDeg(S.rotation)})),M=k.getAbsolutePosition();return{vertical:[{guide:A.x,offset:M.x-A.x,snap:"start",nodes:k.nodes()},{guide:A.x+A.width/2,offset:M.x-A.x-A.width/2,snap:"center",nodes:k.nodes()},{guide:A.x+A.width,offset:M.x-A.x-A.width,snap:"end",nodes:k.nodes()}],horizontal:[{guide:A.y,offset:M.y-A.y,snap:"start",nodes:k.nodes()},{guide:A.y+A.height/2,offset:M.y-A.y-A.height/2,snap:"center",nodes:k.nodes()},{guide:A.y+A.height,offset:M.y-A.y-A.height,snap:"end",nodes:k.nodes()}]}}(f.target),y=ym(g,p);if(!y.length)return;o(y);const _=f.target.getAbsolutePosition(),x=(f.target.nodes().map(k=>k.getAbsolutePosition()),Object.assign({},_));y.forEach(k=>{switch(k.snap){case"start":case"center":case"end":switch(k.orientation){case"V":x.x=k.lineGuide+k.offset;break;case"H":x.y=k.lineGuide+k.offset}}});const b=x.x-_.x,E=x.y-_.y;f.evt.ctrlKey||f.evt.metaKey||f.target.nodes().forEach(k=>{const S=k.getAbsolutePosition();k.setAbsolutePosition({x:S.x+b,y:S.y+E})})},u=(f,v,g)=>{var p;const y=t.current,_=y.getLayer().children.find(I=>I.name()==="line-guides");if(_?.destroyChildren(),y.getActiveAnchor()==="rotater")return v;const x=y.getActiveAnchor(),b=PN[x],E=(p=y.findOne(`.${b}`))===null||p===void 0?void 0:p.getAbsolutePosition();if(!E)return v;const k={x:f.x-E.x,y:f.y-E.y},S=function(I,F){const j=i4(I,F)/i4(F,F);return{x:j*F.x,y:j*F.y}}({x:v.x-f.x,y:v.y-f.y},k),A={x:f.x+S.x,y:f.y+S.y};var M=ym(a(y.nodes()),{vertical:[{guide:A.x,offset:0,snap:"start",nodes:y.nodes()}],horizontal:[{guide:A.y,offset:0,snap:"start",nodes:y.nodes()}]});if(!M.length||(o(M),g.ctrlKey||g.metaKey))return v;const C=[];if(M.forEach(I=>{const F=function(j,O,T){if(T.orientation==="V"){const $=T.lineGuide;if(Math.abs(O.x-j.x)<1e-4)return null;const q=(O.y-j.y)/(O.x-j.x);return{x:$,y:q*$+(j.y-q*j.x)}}{const $=T.lineGuide;if(Math.abs(O.y-j.y)<1e-4)return null;const q=(O.y-j.y)/(O.x-j.x);return{x:($-j.y)/q+j.x,y:$}}}(A,E,{orientation:I.orientation,lineGuide:I.lineGuide});F&&C.push(F)}),C.length>0){let I=C[0],F=Math.sqrt(Math.pow(A.x-I.x,2)+Math.pow(A.y-I.y,2));if(C.forEach(j=>{const O=Math.sqrt(Math.pow(A.x-j.x,2)+Math.pow(A.y-j.y,2));O<F&&(F=O,I=j)}),F<10)return I}return A},h=f=>{if(!f.target)return;const v=f.target.getLayer(),g=v.children.find(p=>p.name()==="line-guides");g?.destroyChildren(),v.batchDraw()};se.useEffect(()=>{t.current&&(t.current.anchorDragBoundFunc(u),t.current.on("dragstart",f=>{setTimeout(()=>{U7()})}),t.current.on("dragmove",s),t.current.on("dragend",h),t.current.on("transformend",h),t.current.on("transform",f=>{var v,g;f.evt.ctrlKey||f.evt.metaKey?(v=t.current)===null||v===void 0||v.rotationSnapTolerance(0):(g=t.current)===null||g===void 0||g.rotationSnapTolerance(5)}))},[])}function n4(t,e,r){const n=o=>o.hasName("element")||o.hasName("line-anchor")||o.hasName("page-background")||o.hasName("elements-area"),i=o=>{const s=o.target.getLayer().children.find(y=>y.name()==="line-guides");s?.destroyChildren();var u,h=ym(function(y){var _;const x=(_=t.current)===null||_===void 0?void 0:_.getStage();var b=[],E=[];return x.find(n).forEach(k=>{if(!(y.indexOf(k)>=0)){var S=k.getClientRect({skipShadow:!0,skipStroke:!0});k.hasName("line-anchor")&&(S={x:k.absolutePosition().x,y:k.absolutePosition().y,width:0,height:0}),b.push({offset:S.x,node:k,snap:"start"},{offset:S.x+S.width,node:k,snap:"end"},{offset:S.x+S.width/2,node:k,snap:"center"}),E.push({offset:S.y,node:k,snap:"start"},{offset:S.y+S.height,node:k,snap:"end"},{offset:S.y+S.height/2,node:k,snap:"center"})}}),{vertical:b,horizontal:E}}([o.target,...e.map(y=>y.current)]),{vertical:[{guide:(u=o.target).absolutePosition().x,offset:0,snap:"center",nodes:[u]}],horizontal:[{guide:u.absolutePosition().y,offset:0,snap:"center",nodes:[u]}]});if(!h.length)return;(function(y){var _;const x=(_=t.current)===null||_===void 0?void 0:_.getLayer(),b=x?.children.find(E=>E.name()==="line-guides");y.forEach(E=>{if(E.orientation==="H"){var k=new or.Line({points:[-6e3,E.lineGuide,6e3,E.lineGuide],stroke:es.stroke,strokeWidth:es.strokeWidth,name:"guid-line",dash:es.dash});b?.add(k),x.batchDraw()}else E.orientation==="V"&&(k=new or.Line({points:[E.lineGuide,-6e3,E.lineGuide,6e3],stroke:es.stroke,strokeWidth:es.strokeWidth,name:"guid-line",dash:es.dash}),b?.add(k))})})(h);const f=o.target.getAbsolutePosition(),v=Object.assign({},f);h.forEach(y=>{switch(y.snap){case"start":case"center":case"end":switch(y.orientation){case"V":v.x=y.lineGuide+y.offset;break;case"H":v.y=y.lineGuide+y.offset}}});const g=v.x-f.x,p=v.y-f.y;if(!o.evt.ctrlKey&&!o.evt.metaKey){const y=o.target.getAbsolutePosition();o.target.absolutePosition({x:y.x+g,y:y.y+p})}},a=o=>{if(!o.target)return;const s=o.target.getLayer(),u=s.children.find(h=>h.name()==="line-guides");u?.destroyChildren(),s.batchDraw()};se.useEffect(()=>{t.current&&(t.current.on("dragmove",i),t.current.on("dragend",a))},r)}function i4(t,e){return t.x*e.x+t.y*e.y}const PN={"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"};function ON(t){const{x:e,y:r,width:n,height:i,rotation:a}=t.a,o=a*Math.PI/180,s={x:e+i/2*Math.cos(o+Math.PI/2),y:r+i/2*Math.sin(o+Math.PI/2)};return{middleLeft:s,middleRight:{x:s.x+n*Math.cos(o),y:s.y+n*Math.sin(o)}}}function a4(t,e,r){const n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),i=Math.atan2(e.y-t.y,e.x-t.x),a=180*i/Math.PI;return{x:t.x+Math.cos(i-Math.PI/2)*r/2,y:t.y+Math.sin(i-Math.PI/2)*r/2,width:n,height:r,rotation:a}}const o4=(t,e)=>({offsetX:5/t,offsetY:5/t,width:10/t,height:10/t,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:r=>{r.target.getStage().container().style.cursor="crosshair"},onMouseLeave:r=>{r.target.getStage().container().style.cursor=""},onDragStart:r=>{e.history.startTransaction()},onDragEnd:r=>{e.history.endTransaction()}}),s4=ni(({element:t,type:e})=>{const r=yf(t,t.a.color,"fill"),n=yf(t,t.a.color,"stroke"),i=Object.assign(Object.assign(Object.assign({strokeWidth:t.height,lineCap:"round",lineJoin:"round"},n),r),{opacity:t.a.opacity,hideInExport:!t.showInExport});return se.createElement(se.Fragment,null,e==="arrow"&&se.createElement(ff,Object.assign({points:[3*t.height,2*-t.height,0,0,3*t.height,2*t.height]},i)),e==="triangle"&&se.createElement(ff,Object.assign({points:[3*t.height,2*-t.height,0,0,3*t.height,2*t.height],closed:!0},i)),e==="bar"&&se.createElement(ff,Object.assign({points:[0,2*-t.height,0,2*t.height],closed:!0},i)),e==="square"&&se.createElement(ff,Object.assign({points:[0,2*-t.height,4*t.height,2*-t.height,4*t.height,2*t.height,0,2*t.height],closed:!0},i)),e==="circle"&&se.createElement(EP,Object.assign({x:2*t.height,y:0,radius:2*t.height},i)))}),CN=ni(({element:t,store:e})=>{const r=se.useRef(null),n=se.useRef(null),i=se.useRef(null),a=t.selectable||e.role==="admin",o=Of(),s=e.selectedElements.indexOf(t)>=0&&e.selectedElements.length===1,u=e.selectedShapes.indexOf(t)>=0&&t.selectable,{middleLeft:h,middleRight:f}=ON(t);n4(n,[r],[s]),n4(i,[r],[s]);const v=yf(t,t.a.color,"stroke");return se.createElement(se.Fragment,null,se.createElement(ff,Object.assign({ref:r,name:"element",id:t.id,x:t.a.x,y:t.a.y,points:[0,0,t.a.width,0],offsetY:-t.a.height/2,strokeWidth:t.a.height,hitStrokeWidth:Math.max(t.a.height,20),dash:t.dash.map(g=>g*t.a.height)},v,{rotation:t.a.rotation,opacity:t.animated("opacity"),shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,listening:a,draggable:o?t.draggable&&u:t.draggable,preventDefault:!o||u,hideInExport:!t.showInExport,onDragMove:g=>{t.set({x:g.target.x(),y:g.target.y()})},onDragEnd:g=>{t.set({x:g.target.x(),y:g.target.y()})},onTransform:g=>{const p=g.target.scaleX();g.target.scaleX(1),g.target.scaleY(1),t.set({height:t.height*p,width:t.width*p,x:g.target.x(),y:g.target.y(),rotation:g.target.rotation()})}})),se.createElement(bn,{x:h.x,y:h.y,rotation:t.rotation,hideInExport:!t.showInExport},se.createElement(s4,{element:t,type:t.startHead})),se.createElement(bn,{x:f.x,y:f.y,rotation:t.rotation+180},se.createElement(s4,{element:t,type:t.endHead})),s&&t.resizable&&se.createElement(Jm,{selector:".page-abs-container",enabled:!0},se.createElement(bn,{visible:s},se.createElement(Tn,Object.assign({x:h.x,y:h.y,ref:n,name:"line-anchor"},o4(e.scale,e),{onDragMove:g=>{const p=a4(g.target.position(),f,t.height);t.set({x:p.x,y:p.y,width:p.width,rotation:p.rotation})}})),se.createElement(Tn,Object.assign({x:f.x,y:f.y,ref:i,name:"line-anchor"},o4(e.scale,e),{onDragMove:g=>{const p=a4(h,g.target.position(),t.height);t.set({x:p.x,y:p.y,width:p.width,rotation:p.rotation})}})))))});function wp(){return document.createElement("canvas")}const H7=new window.Image;H7.src=wh(`
297
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
298
+ <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"/>
299
+ <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"/>
300
+ </svg>
301
+ `);const $7=new window.Image;$7.src=wh(`
302
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
303
+ <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"/>
304
+ <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"/>
305
+ <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"/>
306
+ <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"/>
307
+ </svg>
308
+ `);const G7=(t,e,r,n,i=0,a=!1)=>{const o=Math.floor(Math.max(t.width*n,1)),s=Math.floor(Math.max(t.height*n,1)),u=Math.min(i*n,o/2,s/2),h=Math.max(t.width/r.width,t.height/r.height)*n,f=t.page._exportingOrRendering&&Si.imageDownScalingEnabled&&h<1&&!a,v=r.x===0&&r.y===0&&r.width===e?.width&&r.height===e?.height,g=se.useMemo(()=>{if(e&&e.width&&e.height)return v&&u===0&&!f?void 0:wp()},[e,u,f,v]),p=()=>{if(!g||!e)return;g.width=o,g.height=s;const y=g.getContext("2d");if(!y)return;u&&(y.beginPath(),y.moveTo(u,0),y.lineTo(o-u,0),y.arc(o-u,u,u,3*Math.PI/2,0,!1),y.lineTo(o,s-u),y.arc(o-u,s-u,u,0,Math.PI/2,!1),y.lineTo(u,s),y.arc(u,s-u,u,Math.PI/2,Math.PI,!1),y.lineTo(0,u),y.arc(u,u,u,Math.PI,3*Math.PI/2,!1),y.clip());const _=f?function(b,E){var k,S;const A=wp();A.width=b.width,A.height=b.height,(k=A.getContext("2d"))===null||k===void 0||k.drawImage(b,0,0,A.width,A.height);const M=function(C,I,F,j,O,T,$){for(var q=new ImageData(I,F),J=new Int32Array(C.data.buffer),ae=C.width,ie=new Int32Array(q.data.buffer),Z=q.width,te=I/T,V=F/$,B=Math.round(1/te),D=Math.round(1/V),U=B*D,X=0;X<q.height;X++)for(var ee=0;ee<Z;ee++){for(var K=0+Math.round(ee/te)+(0+Math.round(X/V))*ae,oe=0,me=0,de=0,ye=0,Te=0;Te<D;Te++)for(var Ce=0;Ce<B;Ce++){var Ie=J[K+Ce+Te*ae];oe+=Ie<<24>>>24,me+=Ie<<16>>>24,de+=Ie<<8>>>24,ye+=Ie>>>24}oe=Math.round(oe/U),me=Math.round(me/U),de=Math.round(de/U),ye=Math.round(ye/U),ie[ee+X*Z]=ye<<24|de<<16|me<<8|oe}return q}(A.getContext("2d").getImageData(0,0,A.width,A.height),Math.floor(A.width*E),Math.floor(A.height*E),0,0,A.width,A.height);return A.width=Math.floor(A.width*E),A.height=Math.floor(A.height*E),(S=A.getContext("2d"))===null||S===void 0||S.putImageData(M,0,0),A}(e,h):e,x=f?{x:Math.floor(r.x*h),y:Math.floor(r.y*h),width:Math.floor(r.width*h),height:Math.floor(r.height*h)}:r;y.drawImage(_,x.x,x.y,x.width,x.height,0,0,g.width,g.height)};return se.useLayoutEffect(()=>{p()},[g,t.width,t.height,r.x,r.y,r.width,r.height,i,n,a,t.page._exportingOrRendering,f]),se.useEffect(()=>()=>{g&&g.nodeName==="CANVAS"&&or.Util.releaseCanvas(g)},[g]),[g||e,p]},LN=wp(),NN=ni(({element:t})=>{const e=Math.min(30,t.width/4,t.height/4),r=se.useRef(null);return se.useEffect(()=>{const n=r.current;if(!n)return;const i=new or.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(Zm,{ref:r,x:t.width/2,y:t.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),TN=ni(({element:t})=>{const e=Math.max(10,Math.min(30,t.width/25));return se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Du,{text:"Can not load the video...",fontSize:e,width:t.width,height:t.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let RN=function(t,e,r){const n=se.useRef("loading"),i=se.useRef(null),[a,o]=se.useState(0),s=se.useRef(),u=se.useRef(),h=se.useRef();return s.current===t&&u.current===e&&h.current===r||(n.current="loading",i.current=void 0,s.current=t,u.current=e,h.current=r),se.useLayoutEffect(function(){if(t){var f=document.createElement("video");return f.addEventListener("canplay",v),f.addEventListener("error",g),f.crossOrigin=e,f.src=t,f.load(),function(){f.removeEventListener("canplay",v),f.removeEventListener("error",g)}}function v(){n.current="loaded",i.current=f,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener("canplay",v)}function g(p){var y;const _=f.readyState===4,x=f.buffered&&f.buffered.length>0&&f.buffered.end(f.buffered.length-1)/f.duration*100>=100;if(_&&x)return;const b=p.message||((y=f.error)===null||y===void 0?void 0:y.message)||"Unknown error",E=new Error("Video failed to load: "+b);console.error(E),n.current="failed",i.current=void 0,o(Math.random())}},[t,e,r]),[i.current,n.current]};function l4(t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}const u4=(t,e,r)=>{const n=se.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};se.useEffect(()=>i,[]),se.useLayoutEffect(()=>{const a=e.slice(0,200),o=`video with id ${r} url: ${a}`;t!=="loading"||n.current||(n.current=fd(o)),t!=="loading"&&i(),t==="failed"&&Np(o)},[t])},MN=ni(({element:t,store:e})=>{var r;const[n,i]=se.useState(!1),a=se.useRef(null),o=se.useRef(null),s=e.selectedShapes.indexOf(t)>=0&&t.selectable,[u,h]=se.useState(!1),[f,v]=RN(t.src,"anonymous"),[g,p]=se.useState(!1),y=e.activePage===t.page;u4(v,t.src,t.id),f&&(f.width=f.videoWidth,f.height=f.videoHeight,f.playsInline=!0);const _=f||LN;se.useEffect(()=>{f&&e.history.ignore(()=>{t.set({duration:1e3*f.duration})})},[f]),se.useEffect(()=>{var Ce;if(!f)return;const Ie=e.animatedElementsIds,Ee=(!Ie.length||Ie.includes(t.id))&&e.isPlaying,ge=y&&(Ee||u);if(!ge)return void f.pause();ge&&(f.currentTime=t.startTime*f.duration,f.play());const Re=new or.Animation(()=>{Z()},(Ce=a.current)===null||Ce===void 0?void 0:Ce.getLayer());Re.start();const Be=()=>{h(!1),f.currentTime=t.startTime*f.duration},Oe=()=>{f.currentTime>=t.endTime*f.duration&&(f.pause(),f.currentTime=t.startTime*f.duration,h(!1))};return f.addEventListener("ended",Be),f.addEventListener("timeupdate",Oe),()=>{f.pause(),Re.stop(),f.removeEventListener("ended",Be),f.removeEventListener("timeupdate",Oe)}},[f,u,e.isPlaying,y]),se.useEffect(()=>{f&&(f.volume=t.volume)},[f,t.volume]);const x=se.useRef();se.useEffect(()=>{const Ce=Bu(()=>{var Ie,Ee;if(f){const ge=e.animatedElementsIds;if(ge.length&&!ge.includes(t.id))return;const Re=t.startTime*f.duration*1e3,Be=f.duration*(t.endTime-t.startTime)*1e3,Oe=((e.currentTime||t.page.startTime)-t.page.startTime)%Be+Re;if(Math.abs(1e3*f.currentTime-Oe)>500||!e.isPlaying){const fe=Oe/1e3;fe!==f.currentTime&&(f.currentTime=fe),!l4(f)&&!e.isPlaying&&!x.current&&(x.current=fd(`video ${t.id}`))}Z(),(Ee=(Ie=a.current)===null||Ie===void 0?void 0:Ie.getLayer())===null||Ee===void 0||Ee.batchDraw()}});return()=>{Ce(),x.current&&(x.current(),x.current=null)}},[e,f]),se.useEffect(()=>{if(!f)return;const Ce=()=>{var Ee,ge;!l4(f)&&t.page._exportingOrRendering||x.current&&(Z(),(ge=(Ee=a.current)===null||Ee===void 0?void 0:Ee.getLayer())===null||ge===void 0||ge.batchDraw(),x.current(),x.current=null)};let Ie;return t.page._exportingOrRendering&&(Ie=setInterval(Ce,20)),f.addEventListener("timeupdate",Ce),f.addEventListener("canplay",Ce),()=>{clearInterval(Ie),f.removeEventListener("timeupdate",Ce),f.removeEventListener("canplay",Ce)}},[t.page._exportingOrRendering,f,t.id,fd]);let{cropX:b,cropY:E,cropWidth:k,cropHeight:S}=t;v!=="loaded"&&(b=E=0,k=S=1);const A=_.width*k,M=_.height*S,C=t.width/t.height;let I,F;const j=A/M,O=t.type==="svg";O?(I=A,F=M):C>=j?(I=A,F=A/C):(I=M*C,F=M);const T={x:_.width*b,y:_.height*E,width:I,height:F},$=(r=t.cornerRadius)!==null&&r!==void 0?r:0,[q,J]=G7(t,_,T,e._elementsPixelRatio,$,n||t._cropModeEnabled||t.type==="svg");let[ae,ie]=((Ce,Ie,Ee,ge)=>{const Re=(ue=>{const[ke,Pe]=se.useState(ue);return se.useEffect(()=>{(async()=>{const Ue=await async function(st){if(!(st.indexOf("data:image/svg+xml")>=0||st.indexOf(".svg")>=0))return st;const dt=await Rp(st),pt=ay(dt);return wh(pt)}(ue);Ue!==ke&&Pe(Ue)})()},[ue]),ke})(Ce.clipSrc||""),[Be,Oe]=Qm(Re,"anonymous"),fe=Ce.clipSrc?Oe:"loaded";u4(fe,Ce.clipSrc,Ce.id);const Le=se.useMemo(()=>{if(Ie&&Be)return wp()},[Ie,Be]);function Ne(){var ue;if(!Be||!Ie||!Ie.width||!Ie.height||!Be||!Be.width||!Be.height||!Le)return;const ke=wp(),Pe=Math.max(Ce.width/Be.width*Ee,Ce.height/Be.height*Ee);ke.width=Be.width*Pe,ke.height=Be.height*Pe,(ue=ke.getContext("2d"))===null||ue===void 0||ue.drawImage(Be,0,0,ke.width,ke.height),Le.width=Math.max(Ie.width,1),Le.height=Math.max(Ie.height,1);const Ue=Le.getContext("2d");Ue&&(Ue.save(),Ue.drawImage(ke,0,0,Ie.width,Ie.height),or.Util.releaseCanvas(ke),Ue.globalCompositeOperation="source-in",Ue.drawImage(Ie,0,0,Le.width,Le.height),Ue.restore())}return se.useLayoutEffect(()=>{Ne()},[Le,Ie,Be,Ce.width,Ce.height,Ee,...ge]),[Ce.clipSrc&&Be?Le:Ie,Ne]})(t,q,e._elementsPixelRatio,[T,$,e._elementsPixelRatio]);function Z(){J(),ie()}const te=Math.max(t.width/I,t.height/F);se.useEffect(()=>{var Ce;if(!t._cropModeEnabled)return;const Ie=(Ce=a.current)===null||Ce===void 0?void 0:Ce.getStage();function Ee(Re){t._cropModeEnabled&&Re.target!==o.current&&t.toggleCropMode(!1)}function ge(Re){t._cropModeEnabled&&Re.target.parentNode!==Ie.content&&t.toggleCropMode(!1)}return document.body.addEventListener("click",ge),Ie?.on("click",Ee),Ie?.on("tap",Ee),()=>{document.body.removeEventListener("click",ge),document.body.removeEventListener("touchstart",ge),Ie?.off("click",Ee),Ie?.off("click",Ee)}},[t._cropModeEnabled]),se.useLayoutEffect(()=>{if(!n&&!t._cropModeEnabled)return Ts(a.current,t),Bu(()=>{Ts(a.current,t)},{delay:100})},[_,n,k,S,t._cropModeEnabled]),se.useLayoutEffect(()=>{var Ce;n||t._cropModeEnabled?(Ce=a.current)===null||Ce===void 0||Ce.clearCache():Ts(a.current,t)},[n,t.width,t.height,t._cropModeEnabled]),se.useEffect(()=>{Ts(a.current,t)},[t.shadowEnabled,t.shadowBlur,t.cornerRadius,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]);const V=se.useRef(null),B=se.useRef(null),D=se.useRef(null);se.useLayoutEffect(()=>{t._cropModeEnabled&&(B.current.nodes([V.current]),D.current.nodes([o.current]))},[t._cropModeEnabled]);const U=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 Ie=Ce.target.width()*Ce.target.scaleX(),Ee=Ce.target.height()*Ce.target.scaleY(),ge=Math.min(1,I/Ie),Re=Math.min(1,F/Ee),Be=1-ge,Oe=Math.min(Be,Math.max(0,Math.round(-Ce.target.x())/Ie)),fe=1-Re,Le=Math.min(fe,Math.max(0,Math.round(-Ce.target.y())/Ee));Ce.target.setAttrs({x:-Oe*_.width,y:-Le*_.height,scaleX:1,scaleY:1}),t.set({cropX:Oe,cropY:Le,cropWidth:ge,cropHeight:Re})},X=()=>{t.type!=="svg"&&t.contentEditable&&setTimeout(()=>{t.toggleCropMode(!0)})},ee=v==="loading",K=v==="failed",oe=!ee&&!K,me=se.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),de=oe?t.a.opacity:0;Lp(a,de);const ye=t.selectable||e.role==="admin",Te=Of();return se.createElement(se.Fragment,null,se.createElement(bn,{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1)},ee&&se.createElement(NN,{element:t}),K&&se.createElement(TN,{element:t}),se.createElement(Nu,{ref:a,name:"element",id:t.id,image:ae,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:de,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:T,listening:ye,draggable:Te?t.draggable&&s:t.draggable,preventDefault:!Te||s,hideInExport:!t.showInExport,onDragMove:Ce=>{t.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{t.set({x:Ce.target.x(),y:Ce.target.y()})},onDblClick:X,onDblTap:X,onTransformStart:()=>{i(!0),me.current={cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}},onTransform:Ce=>{var Ie;const Ee=Ce.currentTarget,ge=Math.abs(Ee.scaleX()-1)<1e-7?1:Ee.scaleX(),Re=Math.abs(Ee.scaleY()-1)<1e-7?1:Ee.scaleY();Ee.scaleX(1),Ee.scaleY(1);const Be=(Ie=Ce.target.getStage())===null||Ie===void 0?void 0:Ie.findOne("Transformer"),Oe=1-I/_.width,fe=Math.min(Oe,Math.max(0,t.cropX)),Le=1-F/_.height,Ne=Math.min(Le,Math.max(0,t.cropY)),ue=Be.getActiveAnchor(),ke=!(ue.indexOf("middle")>=0||ue.indexOf("center")>=0),Pe=!ke&&ge<1&&me.current.cropHeight>F/_.height;let Ue=ke?t.cropWidth:t.cropWidth*ge;Pe&&(Ue=t.cropWidth);const st=!ke&&Re<1&&me.current.cropWidth>I/_.width;let dt=ke?t.cropHeight:t.cropHeight*Re;st&&(dt=t.cropHeight),O&&(Ue=t.cropWidth,dt=t.cropHeight),t.set({cropX:fe,cropY:Ne,x:Ee.x(),y:Ee.y(),width:Ee.width()*ge,height:Ee.height()*Re,rotation:Ce.target.rotation(),cropWidth:Math.min(Ue,1-fe),cropHeight:Math.min(dt,1-Ne)})},onTransformEnd:Ce=>{const Ie=Ce.currentTarget;t.set({width:Ie.width(),height:Ie.height(),x:Ie.x(),y:Ie.y(),rotation:Ce.target.rotation(),cropWidth:I/_.width,cropHeight:F/_.height}),i(!1)}}),se.createElement(Tn,{x:t.a.x,y:t.a.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:de,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,$-t.borderSize),hideInExport:!t.showInExport}),!e.isPlaying&&se.createElement(Nu,{image:u?(g||Te)&&$7:H7,x:t.a.x,y:t.a.y,offsetX:-t.a.width/2+15/e.scale,offsetY:-t.a.height/2+15/e.scale,rotation:t.a.rotation,width:30/e.scale,height:30/e.scale,hideInExport:!0,onClick:()=>h(!u),onTap:()=>h(!u)}),t._cropModeEnabled&&se.createElement(Jm,{selector:".page-abs-container",enabled:!0},se.createElement(Tn,{x:-window.innerWidth/e.scale,y:-window.innerWidth/e.scale,width:window.innerWidth/e.scale*3,height:window.innerWidth/e.scale*3,fill:"rgba(0,0,0,0.3)"}),se.createElement(Nu,{listening:!1,image:ae,x:t.a.x,y:t.a.y,width:t.a.width,height:t.a.height,rotation:t.a.rotation,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur}),se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,scaleX:te,scaleY:te},se.createElement(Nu,{image:_,ref:o,opacity:.4,draggable:!0,x:-t.cropX*_.width,y:-t.cropY*_.height,onDragMove:U,onTransform:U}),se.createElement(pp,{ref:D,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ce,Ie)=>Ie.width<5||Ie.height<5?Ce:Ie,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),se.createElement(Tn,{width:I,height:F,ref:V,listening:!1,onTransform:Ce=>{Ce.target.x()<-t.cropX*_.width-1e-9&&(Ce.target.x(-t.cropX*_.width),Ce.target.scaleX(1)),Ce.target.y()<-t.cropY*_.height-1e-9&&(Ce.target.y(-t.cropY*_.height),Ce.target.scaleY(1));const Ie=Math.min(1,Math.max(0,t.cropX+Ce.target.x()/_.width)),Ee=Math.min(1,Math.max(0,Ce.target.y()/_.height+t.cropY)),ge=Ce.target.width()*Ce.target.scaleX(),Re=Ce.target.height()*Ce.target.scaleY(),Be=Math.min(1-Ie,ge/_.width),Oe=Math.min(1-Ee,Re/_.height),fe=Ce.target.getAbsolutePosition(Ce.target.getParent().getParent());Ce.target.scale({x:1,y:1}),Ce.target.position({x:0,y:0}),t.set({x:fe.x,y:fe.y,cropX:Ie,cropY:Ee,cropWidth:Be,cropHeight:Oe,width:Math.min(ge*te,_.width*(1-Ie)*te),height:Math.min(Re*te,_.height*(1-Ee)*te)})}}),se.createElement(pp,{ref:B,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ce,Ie)=>Ie.width<5||Ie.height<5?Ce:Ie,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:t.resizable})))))}),py=({width:t,height:e,cornerRadius:r})=>{if(r>0){const n=Math.min(r,t/2,e/2);return`M 0 ${n} A ${n} ${n} 0 0 1 ${n} 0 L ${t-n} 0 A ${n} ${n} 0 0 1 ${t} ${n} L ${t} ${e-n} A ${n} ${n} 0 0 1 ${t-n} ${e} L ${n} ${e} A ${n} ${n} 0 0 1 0 ${e-n} Z`}return`M 0 0 L ${t} 0 L ${t} ${e} L 0 ${e} Z`},IN=({width:t,height:e})=>`M ${t/2} 0 L ${t} ${e} L 0 ${e} Z`,jN=({width:t,height:e})=>`M 0 0 L ${t} 0 L 0 ${e} Z`,DN=({width:t,height:e})=>`M ${t/2} ${e/2} m -${t/2}, 0 a ${t/2},${e/2} 0 1,0 ${t},0 a ${t/2},${e/2} 0 1,0 -${t},0`;function FN({width:t,height:e}){const r=t/2,n=e/2,i=t/2,a=e/2,o=i/2,s=a/2;let u="",h=Math.PI/5;for(let f=0;f<10;f++){const v=f%2==0?a:s,g=r+(f%2==0?i:o)*Math.sin(f*h),p=n-v*Math.cos(f*h);f===0?u=`M ${g} ${p}`:u+=` L ${g} ${p}`}return u+" Z"}function BN({width:t,height:e}){const r=t/2,n=e/2;return`M ${r} 0 L ${t} ${n} L ${r} ${e} L 0 ${n} Z`}function zN({width:t,height:e}){const r=t/2,n=e/2,i=t/2,a=e/2;let o="",s=2*Math.PI/5;for(let u=0;u<5;u++){const h=a,f=r+i*Math.sin(u*s),v=n-h*Math.cos(u*s);u===0?o=`M ${f} ${v}`:o+=` L ${f} ${v}`}return o+" Z"}function qN({width:t,height:e}){const r=t/2,n=e/2,i=t/2,a=e/2;let o="",s=2*Math.PI/6;for(let u=0;u<6;u++){const h=a,f=r+i*Math.sin(u*s),v=n-h*Math.cos(u*s);u===0?o=`M ${f} ${v}`:o+=` L ${f} ${v}`}return o+" Z"}function Mt({path:t,aspectRatio:e,width:r,height:n}){return{path:t,scaleX:r/e.width,scaleY:n/e.height}}function UN({width:t,height:e}){const r=.1*Math.min(t,e),n=.2*t,i=.2*e,a=.5*t;let o=`M ${r},0`;return o+=" H "+(t-r),o+=` A ${r},${r} 0 0 1 ${t},${r}`,o+=" V "+(e-r-i),o+=` A ${r},${r} 0 0 1 ${t-r},${e-i}`,o+=` H ${a+n/2}`,o+=` L ${a},${e}`,o+=` L ${a-n/2},${e-i}`,o+=` H ${r}`,o+=` A ${r},${r} 0 0 1 0,${e-r-i}`,o+=` V ${r}`,o+=` A ${r},${r} 0 0 1 ${r},0`,o+=" Z",o}function HN({width:t,height:e}){const r=.3*t,n=.3*e,i=t/2,a=e/2,o=i-r/2,s=i+r/2,u=a-n/2,h=a+n/2;let f=`M ${o},0 `;return f+=`H ${s} `,f+=`V ${u} `,f+=`H ${t} `,f+=`V ${h} `,f+=`H ${s} `,f+=`V ${e} `,f+=`H ${o} `,f+=`V ${h} `,f+="H 0 ",f+=`V ${u} `,f+=`H ${o} `,f+="V 0 ",f+="Z",f}const $N={rect:py,circle:DN,star:FN,triangle:IN,rightTriangle:jN,diamond:BN,pentagon:zN,hexagon:qN,speechBubble:UN,cross:HN,arc:({width:t,height:e})=>Mt({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:t,height:e}),cloud:({width:t,height:e})=>Mt({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:t,height:e}),rightArrow:({width:t,height:e})=>{const r=.6*t;return`M 0 ${e/4} L ${r} ${e/4} L ${r} 0 L ${t} ${e/2} L ${r} ${e} L ${r} ${.75*e} L 0 ${.75*e} Z`},leftArrow:({width:t,height:e})=>{const r=.4*t;return`M ${t} ${e/4} L ${r} ${e/4} L ${r} 0 L 0 ${e/2} L ${r} ${e} L ${r} ${.75*e} L ${t} ${.75*e} Z`},downArrow:({width:t,height:e})=>{const r=.6*e;return`M ${t/4} 0 L ${t/4} ${r} L 0 ${r} L ${t/2} ${e} L ${t} ${r} L ${.75*t} ${r} L ${.75*t} 0 Z`},upArrow:({width:t,height:e})=>{const r=.4*e;return`M ${t/4} ${e} L ${t/4} ${r} L 0 ${r} L ${t/2} 0 L ${t} ${r} L ${.75*t} ${r} L ${.75*t} ${e} Z`},asterisk1:({width:t,height:e})=>Mt({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:t,height:e}),asterisk2:({width:t,height:e})=>Mt({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:t,height:e}),bookmark:({width:t,height:e})=>Mt({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:t,height:e}),butterfly:({width:t,height:e})=>Mt({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:t,height:e}),cylinder:({width:t,height:e})=>Mt({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:t,height:e}),diamond2:({width:t,height:e})=>Mt({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:t,height:e}),door:({width:t,height:e})=>Mt({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:t,height:e}),drop1:({width:t,height:e})=>Mt({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:t,height:e}),drop2:({width:t,height:e})=>Mt({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:t,height:e}),explosion:({width:t,height:e})=>Mt({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:t,height:e}),flag:({width:t,height:e})=>Mt({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:t,height:e}),flower:({width:t,height:e})=>Mt({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:t,height:e}),frame:({width:t,height:e})=>Mt({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:t,height:e}),heart1:({width:t,height:e})=>Mt({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:t,height:e}),home:({width:t,height:e})=>Mt({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:t,height:e}),home2:({width:t,height:e})=>Mt({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:t,height:e}),hourglass:({width:t,height:e})=>Mt({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:t,height:e}),house:({width:t,height:e})=>Mt({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:t,height:e}),keyhole:({width:t,height:e})=>Mt({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:t,height:e}),kiss:({width:t,height:e})=>Mt({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:t,height:e}),leaf:({width:t,height:e})=>Mt({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:t,height:e}),lightning1:({width:t,height:e})=>Mt({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:t,height:e}),lightning2:({width:t,height:e})=>Mt({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:t,height:e}),magnet:({width:t,height:e})=>Mt({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:t,height:e}),mithosis:({width:t,height:e})=>Mt({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:t,height:e}),orangeRicky:({width:t,height:e})=>Mt({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:t,height:e}),party:({width:t,height:e})=>Mt({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:t,height:e}),pillow:({width:t,height:e})=>Mt({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:t,height:e}),polygon:({width:t,height:e})=>Mt({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:t,height:e}),rainbow:({width:t,height:e})=>Mt({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:t,height:e}),rhodeIsland:({width:t,height:e})=>Mt({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:t,height:e}),shell:({width:t,height:e})=>Mt({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:t,height:e}),shield1:({width:t,height:e})=>Mt({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:t,height:e}),shield2:({width:t,height:e})=>Mt({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:t,height:e}),skewedRectangle:({width:t,height:e})=>Mt({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:t,height:e}),softFlower:({width:t,height:e})=>Mt({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:t,height:e}),softStar:({width:t,height:e})=>Mt({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:t,height:e}),stairs1:({width:t,height:e})=>Mt({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:t,height:e}),stairs2:({width:t,height:e})=>Mt({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:t,height:e}),teewee:({width:t,height:e})=>Mt({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:t,height:e}),blob1:({width:t,height:e})=>Mt({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:t,height:e}),blob10:({width:t,height:e})=>Mt({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:t,height:e}),blob11:({width:t,height:e})=>Mt({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:t,height:e}),blob12:({width:t,height:e})=>Mt({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:t,height:e}),blob13:({width:t,height:e})=>Mt({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:t,height:e}),blob14:({width:t,height:e})=>Mt({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:t,height:e}),blob15:({width:t,height:e})=>Mt({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:t,height:e}),blob16:({width:t,height:e})=>Mt({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:t,height:e}),blob17:({width:t,height:e})=>Mt({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:t,height:e}),blob18:({width:t,height:e})=>Mt({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:t,height:e}),blob19:({width:t,height:e})=>Mt({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:t,height:e}),blob2:({width:t,height:e})=>Mt({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:t,height:e}),blob20:({width:t,height:e})=>Mt({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:t,height:e}),blob21:({width:t,height:e})=>Mt({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:t,height:e}),blob22:({width:t,height:e})=>Mt({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:t,height:e}),blob23:({width:t,height:e})=>Mt({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:t,height:e}),blob24:({width:t,height:e})=>Mt({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:t,height:e}),blob25:({width:t,height:e})=>Mt({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:t,height:e}),blob26:({width:t,height:e})=>Mt({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:t,height:e}),blob27:({width:t,height:e})=>Mt({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:t,height:e}),blob28:({width:t,height:e})=>Mt({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:t,height:e}),blob29:({width:t,height:e})=>Mt({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:t,height:e}),blob3:({width:t,height:e})=>Mt({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:t,height:e}),blob30:({width:t,height:e})=>Mt({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:t,height:e}),blob31:({width:t,height:e})=>Mt({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:t,height:e}),blob32:({width:t,height:e})=>Mt({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:t,height:e}),blob4:({width:t,height:e})=>Mt({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:t,height:e}),blob5:({width:t,height:e})=>Mt({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:t,height:e}),blob6:({width:t,height:e})=>Mt({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:t,height:e}),blob7:({width:t,height:e})=>Mt({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:t,height:e}),blob8:({width:t,height:e})=>Mt({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:t,height:e}),blob9:({width:t,height:e})=>Mt({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:t,height:e})};function W7(t){return $N[t]||py}function V7(t){const{subType:e}=t,r=W7(e);return r?function(n,i){const{width:a,height:o,fill:s,stroke:u,strokeWidth:h,dash:f}=n,v=(f||[]).map(x=>x*h);let g=i(n),p=1,y=1;typeof g!="string"&&(p=g.scaleX,y=g.scaleY,g=g.path);const _=`clip-${n.id||Math.random()}`;return`
309
+ <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}">
310
+ <defs>
311
+ <clipPath id="${_}">
312
+ <path d="${g}" />
313
+ </clipPath>
314
+ </defs>
315
+
316
+ <!-- Path for the fill -->
317
+ <path d="${g}" fill="${s}" transform="scale(${p}, ${y})"/>
318
+
319
+ <!-- Path for the stroke, clipped by the star path -->
320
+ <path d="${g}" fill="none" stroke="${u}" stroke-width="${2*h}" clip-path="url(#${_})" transform="scale(${p}, ${y})" stroke-dasharray="${v.join(" ")}"/>
321
+ </svg>
322
+ `}(t,r):(console.error(`Polotno error: Can not convert ${t.subType} figure to svg.`),py(t))}const cv={},GN=ni(({element:t,store:e})=>{const r=t.selectable||e.role==="admin",n=Of(),i=e.selectedShapes.indexOf(t)>=0&&t.selectable,a=Math.min(t.strokeWidth,t.width/2,t.height/2),o=Math.max(0,Math.min(t.width/2,t.height/2,t.cornerRadius)),s=yf(t,t.a.fill,"fill"),u=Object.assign(Object.assign({width:t.a.width,height:t.a.height},s),{cornerRadius:o,opacity:t.animated("opacity"),shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,preventDefault:!n||i,hideInExport:!t.showInExport}),h=yf(t,t.stroke,"stroke"),f=Object.assign(Object.assign({visible:a>0,x:a/2,y:a/2,width:t.a.width-a,height:t.a.height-a},h),{strokeWidth:a,cornerRadius:Math.max(0,o-a),dash:t.dash.map(y=>y*a),opacity:t.animated("opacity"),hideInExport:!t.showInExport,listening:!1}),v=(g=t.subType,cv[g]||(cv[g]=(p=W7(g),ni(({element:y,fillProps:_,strokeProps:x})=>{let b=p({width:y.a.width,height:y.a.height,cornerRadius:y.cornerRadius}),E=1,k=1;typeof b!="string"&&(E=b.scaleX,k=b.scaleY,b=b.path);const S=se.useRef(null);return se.createElement(se.Fragment,null,se.createElement(Tn,{width:y.width,height:y.height,fill:"transparent"}),se.createElement(dp,Object.assign({},_,{ref:S,data:b,scaleX:E,scaleY:k})),se.createElement(bn,{clipFunc:A=>{const M=S.current;if(M){var C=M.dataArray;A.beginPath();for(var I=0;I<C.length;I++){var F=C[I].command,j=C[I].points;switch(F){case"L":A.lineTo(j[0],j[1]);break;case"M":A.moveTo(j[0],j[1]);break;case"C":A.bezierCurveTo(j[0],j[1],j[2],j[3],j[4],j[5]);break;case"Q":A.quadraticCurveTo(j[0],j[1],j[2],j[3]);break;case"A":var O=j[0],T=j[1],$=j[2],q=j[3],J=j[4],ae=j[5],ie=j[6],Z=j[7],te=$>q?$:q,V=$>q?1:$/q,B=$>q?q/$:1;A.translate(O,T),A.rotate(ie),A.scale(V,B),A.arc(0,0,te,J,J+ae,1-Z),A.scale(1/V,1/B),A.rotate(-ie),A.translate(-O,-T);break;case"z":A.closePath()}}}},scaleX:E,scaleY:k},se.createElement(dp,Object.assign({},x,{x:0,y:0,data:b,strokeWidth:2*x.strokeWidth,dash:x.dash.map(A=>A)}))))}))),cv[g]||bn);var g,p;return se.createElement(se.Fragment,null,se.createElement(bn,{id:t.id,x:t.a.x,y:t.a.y,rotation:t.a.rotation,opacity:t.a.opacity,listening:r,draggable:n?t.draggable&&i:t.draggable,name:"element",onDragMove:y=>{t.set({x:y.target.x(),y:y.target.y()})},onDragEnd:y=>{t.set({x:y.target.x(),y:y.target.y()})},onTransform:y=>{const _=y.target.scale();y.target.scaleX(1),y.target.scaleY(1),t.set({width:t.width*_.x,height:t.height*_.y,x:y.target.x(),y:y.target.y(),rotation:y.target.rotation()})}},se.createElement(v,{element:t,fillProps:u,strokeProps:f})))});var ac={},fv={},oc={},c4;function Y7(){if(c4)return oc;c4=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.loop=oc.conditional=oc.parse=void 0;var t=function n(i,a){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(a))a.forEach(function(h){return n(i,h,o,s)});else if(typeof a=="function")a(i,o,s,n);else{var u=Object.keys(a)[0];Array.isArray(a[u])?(s[u]={},n(i,a[u],o,s[u])):s[u]=a[u](i,o,s,n)}return o};oc.parse=t;var e=function(i,a){return function(o,s,u,h){a(o,s,u)&&h(o,i,s,u)}};oc.conditional=e;var r=function(i,a){return function(o,s,u,h){for(var f=[],v=o.pos;a(o,s,u);){var g={};if(h(o,i,s,g),o.pos===v)break;v=o.pos,f.push(g)}return f}};return oc.loop=r,oc}var oa={},f4;function X7(){if(f4)return oa;f4=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.readBits=oa.readArray=oa.readUnsigned=oa.readString=oa.peekBytes=oa.readBytes=oa.peekByte=oa.readByte=oa.buildStream=void 0;var t=function(v){return{data:v,pos:0}};oa.buildStream=t;var e=function(){return function(v){return v.data[v.pos++]}};oa.readByte=e;var r=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(g){return g.data[g.pos+v]}};oa.peekByte=r;var n=function(v){return function(g){return g.data.subarray(g.pos,g.pos+=v)}};oa.readBytes=n;var i=function(v){return function(g){return g.data.subarray(g.pos,g.pos+v)}};oa.peekBytes=i;var a=function(v){return function(g){return Array.from(n(v)(g)).map(function(p){return String.fromCharCode(p)}).join("")}};oa.readString=a;var o=function(v){return function(g){var p=n(2)(g);return v?(p[1]<<8)+p[0]:(p[0]<<8)+p[1]}};oa.readUnsigned=o;var s=function(v,g){return function(p,y,_){for(var x=typeof g=="function"?g(p,y,_):g,b=n(v),E=new Array(x),k=0;k<x;k++)E[k]=b(p);return E}};oa.readArray=s;var u=function(v,g,p){for(var y=0,_=0;_<p;_++)y+=v[g+_]&&Math.pow(2,p-_-1);return y},h=function(v){return function(g){for(var p=e()(g),y=new Array(8),_=0;_<8;_++)y[7-_]=!!(p&1<<_);return Object.keys(v).reduce(function(x,b){var E=v[b];return E.length?x[b]=u(y,E.index,E.length):x[b]=y[E.index],x},{})}};return oa.readBits=h,oa}var h4;function WN(){return h4||(h4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Y7(),r=X7(),n={blocks:function(g){for(var p=0,y=[],_=g.data.length,x=0,b=(0,r.readByte)()(g);b!==p&&b;b=(0,r.readByte)()(g)){if(g.pos+b>=_){var E=_-g.pos;y.push((0,r.readBytes)(E)(g)),x+=E;break}y.push((0,r.readBytes)(b)(g)),x+=b}for(var k=new Uint8Array(x),S=0,A=0;A<y.length;A++)k.set(y[A],S),S+=y[A].length;return k}},i=(0,e.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===249}),a=(0,e.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,r.readArray)(3,function(v,g,p){return Math.pow(2,p.descriptor.lct.size+1)})},function(v,g,p){return p.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(v){return(0,r.peekByte)()(v)===44}),o=(0,e.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(g,p,y){return(0,r.readBytes)(y.text.blockSize)(g)}},n]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===1}),s=(0,e.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(g,p,y){return(0,r.readString)(y.blockSize)(g)}},n]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===254}),h=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,e.conditional)({gct:(0,r.readArray)(3,function(v,g){return Math.pow(2,g.lsd.gct.size+1)})},function(v,g){return g.lsd.gct.exists}),{frames:(0,e.loop)([i,s,u,a,o],function(v){var g=(0,r.peekByte)()(v);return g===33||g===44})}],f=h;t.default=f}(fv)),fv}var Dd={},d4;function VN(){if(d4)return Dd;d4=1,Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.deinterlace=void 0;var t=function(r,n){for(var i=new Array(r.length),a=r.length/n,o=function(p,y){var _=r.slice(y*n,(y+1)*n);i.splice.apply(i,[p*n,n].concat(_))},s=[0,4,2,1],u=[8,8,4,2],h=0,f=0;f<4;f++)for(var v=s[f];v<a;v+=u[f])o(v,h),h++;return i};return Dd.deinterlace=t,Dd}var Fd={},p4;function YN(){if(p4)return Fd;p4=1,Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.lzw=void 0;var t=function(r,n,i){var a=4096,o=-1,s=i,u,h,f,v,g,p,y,C,_,x,M,b,I,F,O,j,E=new Array(i),k=new Array(a),S=new Array(a),A=new Array(a+1);for(b=r,h=1<<b,g=h+1,u=h+2,y=o,v=b+1,f=(1<<v)-1,_=0;_<h;_++)k[_]=0,S[_]=_;var M,C,I,F,j,O;for(M=C=I=F=j=O=0,x=0;x<s;){if(F===0){if(C<v){M+=n[O]<<C,C+=8,O++;continue}if(_=M&f,M>>=v,C-=v,_>u||_==g)break;if(_==h){v=b+1,f=(1<<v)-1,u=h+2,y=o;continue}if(y==o){A[F++]=S[_],y=_,I=_;continue}for(p=_,_==u&&(A[F++]=I,_=y);_>h;)A[F++]=S[_],_=k[_];I=S[_]&255,A[F++]=I,u<a&&(k[u]=y,S[u]=I,u++,(u&f)===0&&u<a&&(v++,f+=u)),y=p}F--,E[j++]=A[F],x++}for(x=j;x<s;x++)E[x]=0;return E};return Fd.lzw=t,Fd}var g4;function XN(){if(g4)return ac;g4=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.decompressFrames=ac.decompressFrame=ac.parseGIF=void 0;var t=a(WN()),e=Y7(),r=X7(),n=VN(),i=YN();function a(f){return f&&f.__esModule?f:{default:f}}var o=function(v){var g=new Uint8Array(v);return(0,e.parse)((0,r.buildStream)(g),t.default)};ac.parseGIF=o;var s=function(v){for(var g=v.pixels.length,p=new Uint8ClampedArray(g*4),y=0;y<g;y++){var _=y*4,x=v.pixels[y],b=v.colorTable[x]||[0,0,0];p[_]=b[0],p[_+1]=b[1],p[_+2]=b[2],p[_+3]=x!==v.transparentIndex?255:0}return p},u=function(v,g,p){if(!v.image){console.warn("gif frame does not have associated image.");return}var y=v.image,_=y.descriptor.width*y.descriptor.height,x=(0,i.lzw)(y.data.minCodeSize,y.data.blocks,_);y.descriptor.lct.interlaced&&(x=(0,n.deinterlace)(x,y.descriptor.width));var b={pixels:x,dims:{top:v.image.descriptor.top,left:v.image.descriptor.left,width:v.image.descriptor.width,height:v.image.descriptor.height}};return y.descriptor.lct&&y.descriptor.lct.exists?b.colorTable=y.lct:b.colorTable=g,v.gce&&(b.delay=(v.gce.delay||10)*10,b.disposalType=v.gce.extras.disposal,v.gce.extras.transparentColorGiven&&(b.transparentIndex=v.gce.transparentColorIndex)),p&&(b.patch=s(b)),b};ac.decompressFrame=u;var h=function(v,g){return v.frames.filter(function(p){return p.image}).map(function(p){return u(p,v.gct,g)})};return ac.decompressFrames=h,ac}var v4=XN();function hv(t,e,r){const n=e.getContext("2d"),i=r.getContext("2d");if(!n||!i)return;t.disposalType===2&&n.clearRect(0,0,e.width,e.height),r.width=t.width,r.height=t.height;const a=i.createImageData(t.width,t.height);a.data.set(t.patch),i.putImageData(a,0,0),n.drawImage(r,t.left,t.top)}const KN=ni(({element:t})=>{const e=Math.min(30,t.width/4,t.height/4),r=se.useRef(null);return se.useEffect(()=>{const n=r.current;if(!n)return;const i=new or.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}},[]),se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(Zm,{ref:r,x:t.width/2,y:t.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),ZN=ni(({element:t})=>{const e=Math.max(10,Math.min(30,t.width/22));return se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Du,{text:"Cannot load the GIF...",fontSize:e,width:t.width,height:t.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),QN=ni(({element:t,store:e})=>{var r;const[n,i]=se.useState(!1),a=e.selectedShapes.indexOf(t)>=0&&t.selectable,o=se.useRef(null),s=se.useRef(),[u,h,f,v]=function(F){const[j,O]=se.useState([]),[T,$]=se.useState(0),[q,J]=se.useState("loading"),[ae,ie]=se.useState({width:0,height:0});return se.useEffect(()=>{(async()=>{try{const Z=await fetch(F),te=await Z.arrayBuffer(),V=v4.parseGIF(te),B=v4.decompressFrames(V,!0),D=V.lsd.width,U=V.lsd.height;ie({width:D,height:U});const X=B.map(K=>({patch:new Uint8ClampedArray(K.patch),delay:K.delay,width:K.dims.width,height:K.dims.height,left:K.dims.left,top:K.dims.top,disposalType:K.disposalType})),ee=X.reduce((K,oe)=>K+oe.delay,0);O(X),$(ee),J("loaded")}catch(Z){console.error("Failed to load GIF:",Z),J("failed")}})()},[F]),[j,T,ae,q]}(t.src);ip(v,t.src,t.id),se.useEffect(()=>(s.current=document.createElement("canvas"),()=>{s.current&&or.Util.releaseCanvas(s.current)}),[]),se.useEffect(()=>{if(v==="loaded"&&s.current&&(s.current.width=f.width,s.current.height=f.height,u.length>0)){const F=s.current.getContext("2d");if(F){F.clearRect(0,0,f.width,f.height);const j=document.createElement("canvas");hv(u[0],s.current,j)}}},[f,v,u]),se.useEffect(()=>{if(!u.length||!s.current)return;const F=s.current;F.width=f.width,F.height=f.height;const j=document.createElement("canvas"),O=F.getContext("2d");O&&O.clearRect(0,0,F.width,F.height);let T=-1;hv(u[0],F,j),k(),T=0;const $=q=>{const J=(ae=>{const ie=ae%h;let Z=0;for(let te=0;te<u.length;te++)if(Z+=u[te].delay,Z>ie)return te;return 0})(q);J!==T&&(hv(u[J],F,j),k(),o.current.getLayer().draw(),T=J)};if(e.isPlaying||t.page._exportingOrRendering)return Bu(()=>{$(e.currentTime-t.page.startTime)});{const q=window.setInterval(()=>{$(e.currentTime||performance.now())},16);return()=>{clearInterval(q)}}},[e.isPlaying,u,h,t.page._exportingOrRendering]),se.useEffect(()=>{h&&e.history.ignore(()=>{t.set({duration:h})})},[h]);let{cropX:g,cropY:p,cropWidth:y,cropHeight:_}=t;v!=="loaded"&&(g=p=0,y=_=1);const x={x:f.width*g,y:f.height*p,width:f.width*y,height:f.height*_},b=(r=t.cornerRadius)!==null&&r!==void 0?r:0,[E,k]=G7(t,s.current,x,e._elementsPixelRatio,b,n||t._cropModeEnabled);se.useLayoutEffect(()=>{if(!n&&!t._cropModeEnabled&&o.current)return Ts(o.current,t),Bu(()=>{Ts(o.current,t)},{delay:100})},[s.current,n,y,_,t._cropModeEnabled,f.width,f.height]);const S=v==="loading",A=v==="failed",M=S||A?0:t.a.opacity;Lp(o,M);const C=t.selectable||e.role==="admin",I=Of();return se.createElement(se.Fragment,null,S&&se.createElement(KN,{element:t}),A&&se.createElement(ZN,{element:t}),se.createElement(Nu,{ref:o,name:"element",id:t.id,image:E,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:M,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:x,listening:C,draggable:I?t.draggable&&a:t.draggable,preventDefault:!I||a,hideInExport:!t.showInExport,onDragMove:F=>{t.set({x:F.target.x(),y:F.target.y()})},onDragEnd:F=>{t.set({x:F.target.x(),y:F.target.y()})},onTransformStart:()=>i(!0),onTransform:F=>{const j=F.currentTarget,O=Math.abs(j.scaleX()-1)<1e-7?1:j.scaleX(),T=Math.abs(j.scaleY()-1)<1e-7?1:j.scaleY();j.scaleX(1),j.scaleY(1),t.set({x:j.x(),y:j.y(),width:j.width()*O,height:j.height()*T,rotation:j.rotation()})},onTransformEnd:()=>i(!1)}),se.createElement(Tn,{x:t.a.x,y:t.a.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:M,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,b-t.borderSize),hideInExport:!t.showInExport}))}),JN={stroke:"rgb(0, 161, 255)",strokeWidth:2},eT=ni(({element:t})=>se.createElement(Tn,Object.assign({name:"highlighter",x:t.a.x,y:t.a.y,rotation:t.a.rotation,width:t.a.width,height:t.a.height,listening:!1,strokeScaleEnabled:!1},JN)));let Ol=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");const ap=function(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!=Object.keys(e).length)return!1;for(var r in t)if(!e.hasOwnProperty(r)||!ap(t[r],e[r]))return!1;return!0}return!1};Object.assign(Qt);const tT=Qt.model("UndoManager",{history:Qt.array(Qt.frozen()),undoIdx:-1,targetPath:""}).views(t=>({get canUndo(){return t.undoIdx>0},get canRedo(){return t.undoIdx<t.history.length-1}})).actions(t=>{let e,r,n=!1,i=null,a=0,o=0;const s=()=>o>0;function u(){const f=Tu(e);return{pages:f.pages,width:f.width,height:f.height,custom:f.custom,audios:f.audios}}function h(f){const v=e.pages.map(_=>_.id),g=f.pages.map(_=>_.id),p=!ap(v,g),y=!ap(e.custom,f.custom);p?pm(e.pages,f.pages):e.pages.forEach((_,x)=>{pm(_,f.pages[x])}),y&&e.set({custom:f.custom}),e.setSize(f.width,f.height)}return{startTransaction(){o++},endTransaction(f){o--,f||this.requestAddState(u())},async ignore(f,v=!1,g=!1){g&&await new Promise(b=>setTimeout(b,10)),a&&t.addUndoState();let p=s();t.startTransaction();let y=o;try{await f()}catch(b){setTimeout(()=>{throw b})}const _=y!==o,x=!_;t.endTransaction(x),v||p||t.replaceState(),_||(clearTimeout(a),a=0)},async transaction(f){await t.ignore(f,!0),this.addUndoState()},requestAddState(f){i=f,a||s()||(n?n=!1:a=setTimeout(()=>{a=0,clearTimeout(a),s()||this.addUndoState()},100))},addUndoState(){if(n)return void(n=!1);const f=t.history[t.undoIdx];!ap(i,f)&&(clearTimeout(a),a=0,t.history.splice(t.undoIdx+1),t.history.push(i),t.undoIdx=t.history.length-1)},afterCreate(){if(e=dO(t,".."),!e)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");r=G8(e,()=>{this.requestAddState(u())}),t.history.length===0&&this.requestAddState(u())},clear(){clearTimeout(a),a=0,t.history.splice(0,t.history.length),t.undoIdx=-1,t.addUndoState(u())},beforeDestroy(){r()},undo(){a&&this.addUndoState(),t.canUndo?(t.undoIdx--,n=!0,h(t.history[t.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){a&&this.addUndoState(),t.canRedo?(t.undoIdx++,n=!0,h(t.history[t.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){t.history[t.undoIdx]=u()}}});async function O1(t,e){const r=await(await fetch(t)).blob(),n=document.createElement("a"),i=URL.createObjectURL(r);n.href=i,n.download=e,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(i)},0)}let dv=null;function rT(){var t;return!((t=window.jspdf)===null||t===void 0)&&t.jsPDF?Promise.resolve(window.jspdf.jsPDF):dv||(dv=new Promise(e=>{var r=document.createElement("script");r.onload=function(){e(window.jspdf.jsPDF)},r.src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js",document.head.appendChild(r)}),dv)}function nT(){return window.GIF?Promise.resolve(window.GIF):new Promise(t=>{var e=document.createElement("script");e.onload=function(){t(window.GIF)},e.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(e)})}async function iT({width:t,height:e}){return new(await nT())({workers:4,width:t,height:e,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
323
+ (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]);
324
+ `],{type:"application/javascript"}))})}const aT="https://api.polotno.com",oT=()=>aT+"/api",K7=Kr({value:!1}),Z7=Kr({value:"v1"}),sT=()=>Z7.value,lT=()=>K7.value,uT=Zr(()=>{K7.value=!0});let Xd=typeof window<"u"?window.location.origin:"";const cT=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,fT=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;Xd==="file://"&&cT&&(Xd="headless"),Xd==="file://"&&fT&&(Xd="electron");const hT=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${Xd}" here: https://polotno.com/cabinet`;let dT=fetch;async function pT(t){for(let e=0;e<5;e++)try{const r=await dT(oT()+"/validate-key",{method:"POST",body:JSON.stringify({key:t,site:location.host,skdVersion:"2.28.0"})});if(hc(()=>{Z7.value=r.headers.get("x-api-version")}),!t)return console.warn("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"),!1;if(r.status!==200){await new Promise(i=>setTimeout(i,3e3));continue}const n=await r.json();return n.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),n.is_paid||console.log("%cPolotno Free Version. For development usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),n.is_domain_valid||console.log(hT,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),rO(n.remove_background_enabled),n.is_paid||!1}catch{await new Promise(n=>setTimeout(n,3e3))}return console.error("Can not validate Polotno API key. Please report to anton@polotno.com immediately."),!0}async function gT(t,e){await pT(t)&&!e||uT()}const K0=({px:t,unit:e="px",dpi:r})=>{switch(e){case"pt":default:return t;case"mm":return t/(r/25.4);case"cm":return t/(r/2.54);case"in":return t/r}},m4=({px:t,precious:e=2,dpi:r=72,unit:n="px"})=>parseFloat(K0({px:t,dpi:r,unit:n}).toFixed(e)),y4=({unitVal:t,dpi:e,unit:r})=>t/K0({px:1,unit:r,dpi:e}),vT=t=>{const e=parseFloat(K0(t).toFixed(1));switch(t.unit){case"pt":return`${Math.round(e)}pt`;case"mm":return`${e}mm`;case"cm":return`${e}cm`;case"in":return`${e}in`;default:return`${Math.round(e)}px`}};async function mT(t){for(let e=0;e<30;e++){const r=await t();if(r)return r;await new Promise(n=>setTimeout(n,50))}}function Mp(t){return new Promise((e,r)=>{const n=document.createElement("img");n.onload=()=>{e(n)},n.onerror=i=>{r(i)},n.crossOrigin="anonymous",n.src=t})}async function yT(t,e){const r=await Mp(t),n=document.createElement("canvas");n.width=2*r.width,n.height=2*r.height,n.getContext("2d").drawImage(r,0,0,n.width,n.height);const i=document.createElement("canvas");i.width=e.width,i.height=e.height;const a=i.getContext("2d");let{cropX:o,cropY:s}=e;const u=n.width*e.cropWidth,h=n.height*e.cropHeight,f=e.width/e.height;let v,g;const p=u/h;return e.type==="svg"?(v=u,g=h):f>=p?(v=u,g=u/f):(v=h*f,g=h),a.drawImage(n,o*n.width,s*n.height,v,g,0,0,i.width,i.height),i.toDataURL("image/png")}function Q7(t,e){const{width:r,height:n}=t,i=r/n;let a,o;i>=e.width/e.height?(a=e.width,o=e.width/i):(a=e.height*i,o=e.height);const s=(e.width-a)/2,u=(e.height-o)/2;return{cropX:s/e.width,cropY:u/e.height,cropWidth:a/e.width,cropHeight:o/e.height}}var Qs;(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"})(Qs||(Qs={}));function J7(t,e){let r={filter:"",html:void 0};switch(t){case Qs.warm:{const n=Math.max(0,Math.min(1,e??.5)),i=1+.3*n,a=1+.15*n,o=1;return r.filter="url(#warm-filter)",r.html=`
325
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
326
+ <filter id="warm-filter" color-interpolation-filters="sRGB">
327
+ <feColorMatrix type="matrix" values="
328
+ ${i} 0 0 0 0
329
+ 0 ${a} 0 0 0
330
+ 0 0 ${o} 0 0
331
+ 0 0 0 1 0" />
332
+ </filter>
333
+ </svg>`,r}case Qs.cold:{const n=Math.max(0,Math.min(1,e??.5)),i=1-.15*n,a=1-.1*n,o=1+.15*n;return r.filter="url(#cold-filter)",r.html=`
334
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
335
+ <filter id="cold-filter" color-interpolation-filters="sRGB">
336
+ <feColorMatrix type="matrix" values="
337
+ ${i} 0 0 0 0
338
+ 0 ${a} 0 0 0
339
+ 0 0 ${o} 0 0
340
+ 0 0 0 1 0" />
341
+ </filter>
342
+ </svg>`,r}case"natural":{const n=Math.max(0,Math.min(1,e??.5)),i=1+.1*n,a=1+.3*n,o=1+.2*n;return r.filter=`saturate(${a}) brightness(${i}) contrast(${o})`,r}case Qs.temperature:{const n=Math.max(-1,Math.min(1,e??0)),i=1+.15*n,a=1,o=1-.15*n;return r.filter="url(#temperature-filter)",r.html=`
343
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
344
+ <filter id="temperature-filter" color-interpolation-filters="sRGB">
345
+ <feColorMatrix type="matrix" values="
346
+ ${i} 0 0 0 0
347
+ 0 ${a} 0 0 0
348
+ 0 0 ${o} 0 0
349
+ 0 0 0 1 0" />
350
+ </filter>
351
+ </svg>
352
+ `,r}case Qs.contrast:{const n=100*Math.max(-1,Math.min(1,e??0)),i=259*(n+255)/(255*(259-n)),a=.5*(1-i);return r.filter="url(#contrast-filter)",r.html=`
353
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
354
+ <filter id="contrast-filter" color-interpolation-filters="sRGB">
355
+ <feComponentTransfer>
356
+ <feFuncR type="linear" slope="${i}" intercept="${a}" />
357
+ <feFuncG type="linear" slope="${i}" intercept="${a}" />
358
+ <feFuncB type="linear" slope="${i}" intercept="${a}" />
359
+ </feComponentTransfer>
360
+ </filter>
361
+ </svg>
362
+ `,r}case Qs.shadows:{const n=Math.max(-1,Math.min(1,e??0)),i=Math.min(Math.max(1-.6*n,.4),2.5);return r.filter="url(#shadows-filter)",r.html=`
363
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
364
+ <filter id="shadows-filter" color-interpolation-filters="sRGB">
365
+ <feComponentTransfer>
366
+ <feFuncR type="gamma" amplitude="1" exponent="${i}" offset="0" />
367
+ <feFuncG type="gamma" amplitude="1" exponent="${i}" offset="0" />
368
+ <feFuncB type="gamma" amplitude="1" exponent="${i}" offset="0" />
369
+ </feComponentTransfer>
370
+ </filter>
371
+ </svg>
372
+ `,r}case Qs.white:case Qs.black:return null;case Qs.vibrance:{const n=Math.max(-1,Math.min(1,e??0)),i=.299,a=.587,o=.114;let s;s=n>=0?1+1.5*n:1+n;const u=1-s,h=u*i+s,f=u*a,v=u*o,g=u*i,p=u*a+s,y=u*o,_=u*i,x=u*a,b=u*o+s;return r.filter="url(#vibrance-filter)",r.html=`
373
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
374
+ <filter id="vibrance-filter" color-interpolation-filters="sRGB">
375
+ <feColorMatrix type="matrix" values="
376
+ ${h} ${f} ${v} 0 0
377
+ ${g} ${p} ${y} 0 0
378
+ ${_} ${x} ${b} 0 0
379
+ 0 0 0 1 0" />
380
+ </filter>
381
+ </svg>
382
+ `,r}case Qs.saturation:{const o=1+Math.max(-1,Math.min(1,e??0)),s=1-o,u=s*.2126+o,h=s*.7152,f=s*.0722,v=s*.2126,g=s*.7152+o,p=s*.0722,y=s*.2126,_=s*.7152,x=s*.0722+o;return r.filter="url(#saturation-filter)",r.html=`
383
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
384
+ <filter id="saturation-filter" color-interpolation-filters="sRGB">
385
+ <feColorMatrix type="matrix" values="
386
+ ${u} ${h} ${f} 0 0
387
+ ${v} ${g} ${p} 0 0
388
+ ${y} ${_} ${x} 0 0
389
+ 0 0 0 1 0" />
390
+ </filter>
391
+ </svg>
392
+ `,r}default:return null}}async function bT(t){return new Promise((e,r)=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=t,n.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:a}=n;e({width:i,height:a})}),n.addEventListener("error",i=>{const a=t.slice(0,100);r(new Error(`Failed to load video: ${a}`))})})}var wT=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const Vi=(t,e,...r)=>({type:t,props:e,children:r||[]}),Y1=async({element:t,page:e,store:r})=>{let{src:n}=t;if(t.type==="svg"&&Object.keys(t.colorsReplace).length){const S=await Rp(n);n=oy(S,new Map(Object.entries(t.colorsReplace)))}let i="";t.flipX&&(i+="scaleX(-1)"),t.flipY&&(i+="scaleY(-1)"),i||(i="none");const a={};if(t.clipSrc){const S=await nL(t.clipSrc);a["clip-path"]=`url(${S})`}const o=await Mp(n),s=o.width*t.cropWidth,u=o.height*t.cropHeight,h=t.width/t.height;let f,v;const g=s/u;t.type==="svg"?(f=s,v=u):h>=g?(f=s,v=s/h):(f=u*h,v=u);const p=f/o.width,y=v/o.height,_=f/v>t.width/t.height?t.height/v:t.width/f,x=f*_/p,b=v*_/y,E=t.cropX*_*o.width,k=t.cropY*_*o.height;return Vi("div",{style:Object.assign(Object.assign({},a),{width:"100%",height:"100%",borderRadius:t.cornerRadius+"px",border:t.borderSize?`${t.borderSize}px solid ${t.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${n})`,transform:i,backgroundSize:`${Math.round(x)}px ${Math.round(b)}px`,backgroundPositionX:-Math.round(E)+"px",backgroundPositionY:-Math.round(k)+"px"})})},b4=({element:t,type:e})=>{const r={"stroke-width":t.height,stroke:t.color,"line-cap":"round","stroke-linejoin":"round",opacity:t.opacity};return e==="arrow"||e==="triangle"?Vi("polyline",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},r)):e==="bar"?Vi("polyline",Object.assign({points:`0,${2*-t.height} 0,${2*t.height}`},r)):e==="circle"?Vi("circle",Object.assign({r:t.height},r)):e==="square"?Vi("polyline",Object.assign({points:`${-t.height},${-t.height} ${-t.height},${t.height} ${t.height},${t.height} ${t.height},${-t.height}`},r)):null},_T={image:Y1,svg:Y1,text:async({element:t,page:e,store:r})=>{let n={top:0,left:0};t.fill.indexOf("gradient")>=0&&(n=Object.assign(Object.assign({},n),{backgroundColor:t.fill,backgroundImage:t.fill,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}));const i=t.backgroundPadding*(t.fontSize*t.lineHeight),a=Vi("div",{style:{position:"absolute",top:-i/2+"px",left:-i/2+"px",display:t.backgroundEnabled?"block":"none",width:t.width+i+"px",height:t.height+i+"px",backgroundColor:t.backgroundColor,borderRadius:t.backgroundCornerRadius*(t.fontSize*t.lineHeight*.5)+"px"}});t.verticalAlign==="middle"?(n.top="50%",n.transform="translateY(-50%)"):t.verticalAlign==="bottom"&&(n.bottom=0);const o=/<[a-z][\s\S]*>/i.test(t.text),s=Object.assign(Object.assign({},n),{position:"absolute",width:t.width+"px",color:t.fill,whiteSpace:"pre-wrap",fontSize:t.fontSize+"px",textAlign:t.align,fontFamily:t.fontFamily,textDecoration:t.textDecoration||"none",textTransform:t.textTransform||"none",lineHeight:t.lineHeight,letterSpacing:t.letterSpacing+"em",fontStyle:t.fontStyle,fontWeight:t.fontWeight,WebkitTextStroke:`${t.strokeWidth}px ${t.stroke}`,textStroke:`${t.strokeWidth}px ${t.stroke}`}),u="el-"+t.id,h=o?{id:u}:{},f=`<style>#${u} {${V0}}</style>`,v=Vi("div",Object.assign(Object.assign({style:s},h),{innerHTML:o?`${f}${t.text}`:t.text.split(`
393
+ `).join("<br />")}));return Vi("div",{style:{position:"relative",width:"100%",height:"100%"}},a,v)},line:async({element:t,page:e,store:r})=>Vi("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},Vi("rect",{x:0,y:0,width:t.width,height:t.height,fill:t.color}),Vi("g",{transform:`translate(0 ${t.height/2})`},b4({element:t,type:t.startHead})),Vi("g",{transform:`translate(${t.width} ${t.height/2}) rotate(180)`},b4({element:t,type:t.endHead}))),figure:async({element:t,page:e,store:r,elementHook:n})=>{const i=V7(t),a=Vi("div",{innerHTML:i});return n&&n({dom:a,element:t})||a},group:async({element:t,page:e,store:r,elementHook:n})=>{const i=await Promise.all(t.children.map(o=>e_({element:o,page:e,store:r,elementHook:n}))),a=Vi("div",{style:{transformOrigin:"top left",opacity:t.opacity}},...i);return n&&n({dom:a,element:t})||a},video:async({element:t,page:e,store:r,elementHook:n})=>{const{cropX:i,cropY:a,cropWidth:o,cropHeight:s}=t,u=await bT(t.src),h=u.width*o,f=u.height*s,v=t.width/t.height;let g,p;v>=h/f?(g=h,p=h/v):(g=f*v,p=f);const y=g/o,_=p/s,x=i*u.width,b=a*u.height,E=Math.max(t.width/u.width,t.height/u.height),k={position:"absolute",width:`${Math.round(y*E)}px`,height:`${Math.round(_*E)}px`,left:-Math.round(x*E)+"px",top:-Math.round(b*E)+"px",objectFit:"fill"},S=`video-${t.id}`,A=Vi("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:t.cornerRadius+"px",border:t.borderSize?`${t.borderSize}px solid ${t.borderColor}`:"none"}},Vi("video",{id:S,src:t.src,style:k,controls:!0,playsInline:!0,muted:!0,volume:t.volume}));return n&&n({dom:A,element:t})||A},gif:Y1};async function e_({element:t,page:e,store:r,elementHook:n}){let i=await _T[t.type];if(i||(i=()=>Vi("div",{}),console.error(`HTML export does not support ${t.type} type...`)),!t.visible)return null;const a=await i({element:t,page:e,store:r}),o=[],s=[];if(t.blurEnabled&&o.push(`blur(${t.blurRadius/2}px)`),t.brightnessEnabled&&o.push(`brightness(${100*t.brightness+100}%)`),t.sepiaEnabled&&o.push("sepia()"),t.grayscaleEnabled&&o.push("grayscale()"),t.filters)for(const[h,f]of Object.entries(t.filters)){const v=J7(Qs[h],f.intensity);v&&(o.push(v.filter),v.html&&s.push(v.html))}t.shadowEnabled&&o.push(`drop-shadow(${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor})`);const u=Vi("div",{id:t.id,style:{position:"absolute",left:t.x+"px",top:t.y+"px",width:t.width+"px",height:t.height+"px",transform:`rotate(${t.rotation}deg)`,transformOrigin:"top left",opacity:t.opacity,display:t.visible&&t.showInExport?"block":"none",filter:o.join(" ")||"none"}},a,...s);return n&&n({dom:u,element:t})||u}async function xT({json:t,elementHook:e}){const r=await Promise.all(t.pages.map(a=>async function({page:o,store:s,elementHook:u}){const h=await Promise.all(o.children.map(p=>e_({element:p,page:o,store:s,elementHook:u}))),f=o.width==="auto"?s.width:o.width,v=o.height==="auto"?s.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:p,height:y}=await Mp(o.background),_=await Y1({element:Object.assign({x:0,y:0,width:f,height:v,src:o.background,cornerRadius:0},Q7({width:f,height:v},{width:p,height:y})),page:o,store:s});h.unshift(_)}else g=Object.assign(Object.assign({},g),{backgroundColor:o.background});return Vi("div",{className:"page",id:o.id,style:Object.assign(Object.assign({},g),{width:f+"px",height:v+"px",overflow:"hidden",position:"relative"})},...h)}({page:a,store:t,elementHook:e}))),n=[];t.pages.forEach(a=>{a.children.forEach(o=>{o.type==="text"&&n.indexOf(o.fontFamily)===-1&&n.push(o.fontFamily)})});const i=n.map(a=>t.fonts.find(o=>o.fontFamily===a)?Vi("style",{},""):Vi("link",{href:B8(a),rel:"stylesheet"}));return Vi("div",{className:"design"},...i,...r)}const t_=({dom:t})=>{if(typeof t=="string")return t;if(!t)return"";const e=t.props,{innerHTML:r}=e,n=wT(e,["innerHTML"]),i=Object.keys(n).map(a=>a==="style"&&typeof n[a]=="object"?`style="${Object.keys(n[a]).map(o=>`${o.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`)}: ${n[a][o]}`).join("; ")}"`:((o,s)=>typeof s=="object"?`${o}="${Object.keys(s).map(u=>`${u.replace(/-([a-z])/g,h=>h[1].toUpperCase())}:${s[u]};`).join(" ")}"`:`${o}="${s}"`)(a,n[a])).join(" ");return`<${t.type} ${i}>${r||t.children.map(a=>t_({dom:a})).join("")}</${t.type}>`};async function ST({json:t,elementHook:e}){const r=await xT({json:t,elementHook:e});return t_({dom:r})}var ET=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const r_=(t,e)=>{if(t.children)for(const r of t.children){if(e(r)===!0)break;r_(r,e)}},nn=(t,e,...r)=>({type:t,props:e,children:r||[]}),pv=async t=>{try{const e=await fetch(t);if(typeof Buffer<"u"){const r=await e.arrayBuffer(),n=Buffer.from(r).toString("base64");return`data:${e.headers.get("content-type")||"image/png"};base64,${n}`}{const r=await e.blob();return new Promise((n,i)=>{const a=new FileReader;a.onloadend=()=>n(a.result),a.onerror=i,a.readAsDataURL(r)})}}catch(e){return console.error("Error converting URL to data URL:",e),t}},gv=async({element:t,page:e,store:r})=>{let{src:n}=t;if(t.type==="svg"){const ie=await Rp(n);n=oy(ie,new Map(Object.entries(t.colorsReplace)))}else n=await pv(n);let i,a,o,s,u="";t.flipX&&(u+="scaleX(-1)"),t.flipY&&(u+="scaleY(-1)"),t.clipSrc&&(i=`clip-img-mask-${t.id}`,a=await pv(t.clipSrc)),t.maskSrc&&(o=`mask-img-${t.id}`,s=await pv(t.maskSrc));const h=await Mp(n),f=h.width*t.cropWidth,v=h.height*t.cropHeight,g=t.width/t.height;let p,y;const _=f/v;typeof t.stretchEnabled=="boolean"&&t.stretchEnabled||t.type==="svg"?(p=f,y=v):g>=_?(p=f,y=f/g):(p=v*g,y=v);const x=p/h.width,b=y/h.height,E=p/y>t.width/t.height?t.height/y:t.width/p,k=p*E/x,S=y*E/b,A=t.cropX*h.width*E,M=t.cropY*h.height*E,C=`clip-${t.id}`,I=t.cornerRadius||0,F=n.replace(/&/g,"&amp;"),j={x:-A,y:-M,width:k,height:S,preserveAspectRatio:"none","clip-path":`url(#${C})`},O=[nn("clipPath",{id:C},nn("rect",{x:0,y:0,width:t.width,height:t.height,rx:I||void 0,ry:I||void 0}))];i&&a&&O.push(nn("mask",{id:i,maskUnits:"userSpaceOnUse","mask-type":"alpha"},nn("image",{href:a.replace(/&/g,"&amp;"),x:0,y:0,width:t.width,height:t.height,preserveAspectRatio:"none"}))),o&&O.push(nn("mask",{id:o,maskUnits:"userSpaceOnUse","mask-type":"alpha"},nn("image",Object.assign({href:F},j))));let T=F;const $={};o&&s&&(T=s.replace(/&/g,"&amp;"),$.mask=`url(#${o})`);const q={style:{transform:u}};i&&(q.mask=`url(#${i})`);const J=t.borderSize||0,ae=J>0?nn("rect",{x:J/2,y:J/2,width:Math.max(0,t.width-J),height:Math.max(0,t.height-J),fill:"none",stroke:t.borderColor,"stroke-width":J,rx:Math.max(0,I-J)||void 0,ry:Math.max(0,I-J)||void 0}):null;return nn("g",q,nn("defs",{},...O),nn("image",Object.assign(Object.assign({href:T},j),$)),ae)},w4=({element:t,type:e})=>{const r={"stroke-width":t.height,stroke:t.color,"line-cap":"round","stroke-linejoin":"round",fill:t.color};return e==="arrow"?nn("polyline",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},r)):e==="triangle"?nn("polygon",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},r)):e==="bar"?nn("polyline",Object.assign({points:`0,${2*-t.height} 0,${2*t.height}`},r)):e==="circle"?nn("circle",Object.assign({cx:2*t.height,cy:0,r:2*t.height},r)):e==="square"?nn("polygon",Object.assign({points:`0,${2*-t.height} ${4*t.height},${2*-t.height} ${4*t.height},${2*t.height} 0,${2*t.height}`},r)):null},AT={image:gv,svg:gv,text:async({element:t,page:e,store:r})=>{const n=(p,y,_,x,b,E=0)=>{const k=document.createElement("canvas").getContext("2d");return k.font=`${b} ${x} ${y}px ${_}`,k.measureText(p).width+Math.max(0,(p?p.length:0)-1)*E*y},i=(p,y,_,x,b,E,k=0)=>{const S=[];return p.split(`
394
+ `).forEach(A=>{const M=A.split(" ");let C="";for(let I=0;I<M.length;I++){const F=C+M[I]+" ";n(F,_,x,b,E,k)>y+.5&&I>0?(S.push(C.trim()),C=M[I]+" "):C=F}S.push(C.trim())}),S};let a=rl(t.text);t.textTransform=="uppercase"&&(a=a.toUpperCase());let o=t.fontSize,s=[];for(;;){s=i(a,t.width,o,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing);const p=Math.max(...s.map(_=>n(_,o,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing))),y=s.length*o*t.lineHeight;if(p<=t.width&&y<=t.height||(o-=1,o<4))break}const u=o*t.lineHeight,h=s.length*u;let f=o;t.verticalAlign==="middle"?f=(t.height-h)/2+o:t.verticalAlign==="bottom"&&(f=t.height-h+o);const v=t.align==="center"?"middle":t.align==="right"?"end":"start",g=s.map((p,y)=>nn("tspan",{x:t.align==="center"?t.width/2:t.align==="right"?t.width:0,dy:y===0?0:u,innerHTML:p}));return nn("g",{},nn("text",{fill:t.fill,y:f,"font-size":o+"px","text-anchor":v,"font-family":t.fontFamily,"font-style":t.fontStyle,"font-weight":t.fontWeight,"text-decoration":t.textDecoration,"line-height":t.lineHeight,"letter-spacing":t.letterSpacing+"em","stroke-width":t.strokeWidth,stroke:t.stroke},...g))},line:async({element:t,page:e,store:r})=>nn("g",{},nn("line",{x1:0,y1:t.height/2,x2:t.width,y2:t.height/2,stroke:t.color,"stroke-width":t.height,"stroke-dasharray":t.dash&&t.dash.length?t.dash.map(n=>n*t.height).join(" "):void 0}),nn("g",{transform:`translate(0 ${t.height/2})`},w4({element:t,type:t.startHead})),nn("g",{transform:`translate(${t.width} ${t.height/2}) rotate(180)`},w4({element:t,type:t.endHead}))),figure:async({element:t,page:e,store:r,elementHook:n})=>{const i=function(o){let s=o.replace(/<svg[^>]*>/,"");return s=s.replace(/<\/svg>/,""),s}(V7(t)),a=nn("g",{innerHTML:i});return n&&n({dom:a,element:t})||a},group:async({element:t,page:e,store:r,elementHook:n})=>{const i=await Promise.all(t.children.map(o=>n_({element:o,page:e,store:r,elementHook:n}))),a=nn("g",{style:{"transform-origin":"top left"}},...i);return n&&n({dom:a,element:t})||a},gif:gv};async function n_({element:t,page:e,store:r,elementHook:n}){var i;let a=await AT[t.type];a||(a=()=>nn("g",{}),console.error(`SVG export does not support ${t.type} type...`));const o=await a({element:t,page:e,store:r}),s=[],u=[];if(t.blurEnabled&&s.push(`blur(${t.blurRadius/2}px)`),t.brightnessEnabled&&s.push(`brightness(${100*t.brightness+100}%)`),t.sepiaEnabled&&s.push("sepia()"),t.grayscaleEnabled&&s.push("grayscale()"),t.shadowEnabled&&s.push(`drop-shadow(${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor})`),t.filters)for(const[f,v]of Object.entries(t.filters)){const g=J7(Qs[f],v.intensity);if(g&&(s.push(g.filter),g.html)){const p=g.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");u.push(p)}}const h=nn("g",{className:"element",id:t.id,transform:t.type!=="group"?`translate(${t.x}, ${t.y}) rotate(${t.rotation})`:void 0,display:(i=t.visible)===null||i===void 0||i?void 0:"none",opacity:t.opacity,style:{"transform-origin":"top left",filter:s.join(" ")}},o,...u);return n&&n({dom:h,element:t})||h}async function _4(t){try{const e=await fetch(t),r=e.headers.get("content-type")||"font/ttf",n=await e.arrayBuffer();return`data:${r};base64,${typeof Buffer<"u"?Buffer.from(n).toString("base64"):function(i){const a=new Uint8Array(i);let o="";for(let s=0;s<a.length;s+=32768){const u=a.subarray(s,s+32768);o+=String.fromCharCode(...u)}if(typeof btoa<"u")return btoa(o);if(typeof Buffer<"u")return Buffer.from(a).toString("base64");throw new Error("No base64 encoder available in this environment")}(n)}`}catch(e){return console.error("Error embedding font:",e),t}}async function kT({json:t,elementHook:e,fontEmbedding:r="inline"}){const n=[];r_({children:t.pages},o=>{o.type==="text"&&n.indexOf(o.fontFamily)===-1&&n.push(o.fontFamily)});const i=r==="inline"?await async function(o,s){return await Promise.all(o.map(async u=>{var h,f;if(u==="Arial")return null;const v=s.find(g=>g.fontFamily===u);if(v){q8(v),await Yh(u,"normal","normal"),await Yh(u,"normal","bold"),await Yh(u,"normal","italic"),await Yh(u,"normal","bold-italic");const g=await _4(v.url);return nn("style",{},`@font-face { font-family: ${u}; src: url(${g}); }`)}{z8(u),await Yh(u,"normal","normal");const g=`https://fonts.googleapis.com/css?family=${u}:bi,normal,i,b`;try{const p=await fetch(g),y=await p.text(),_=(f=(h=y.match(/url\((.*?)\)/g))===null||h===void 0?void 0:h.map(b=>b.replace(/url\((.*?)\)/,"$1")))===null||f===void 0?void 0:f.filter(b=>b.startsWith("https"));if(!_?.length)throw new Error("No font URLs found");const x=await Promise.all(_.map(async b=>{const E=await _4(b),k=y.match(/font-style:\s*(.*?);/),S=y.match(/font-weight:\s*(.*?);/),A=k?k[1]:"normal",M=S?S[1]:"normal";return`@font-face {
395
+ font-family: ${u};
396
+ font-style: ${A};
397
+ font-weight: ${M};
398
+ src: url(${E});
399
+ }`}));return nn("style",{},x.join(`
400
+ `))}catch(p){return console.error("Error embedding Google Font:",p),nn("defs",{},nn("style",{type:"text/css",innerHTML:`@import url('${g}');`.replace(/&/g,"&amp;")}))}}}))}(n,t.fonts):[],a=await Promise.all(t.pages.map(o=>async function({page:s,store:u,elementHook:h}){const f=await Promise.all(s.children.map(p=>n_({element:p,page:s,store:u,elementHook:h}))),v=s.background.indexOf("url")>=0||s.background.indexOf("http")>=0||s.background.indexOf(".jpg")>=0||s.background.indexOf(".png")>=0||s.background.indexOf(".jpeg")>=0;let g;if(v){const p=await Mp(s.background);g=await yT(s.background,Object.assign({width:u.width,height:u.height,x:0,y:0},Q7({width:u.width,height:u.height},{width:p.width,height:p.height})))}return nn("g",{className:"page",style:{}},v?nn("image",{"xlink:href":g,x:0,y:0,width:u.width,height:u.height,preserveAspectRatio:"none"}):nn("rect",{x:0,y:0,width:u.width,height:u.height,fill:v?void 0:s.background}),...f)}({page:o,store:t,elementHook:e})));return nn("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${t.width} ${t.height}`,width:t.width,height:t.height},...i,...a)}const i_=({dom:t,nestLevel:e=0})=>{if(typeof t=="string")return t;if(!t)return"";const r=t.props,{innerHTML:n}=r,i=ET(r,["innerHTML"]),a=Object.keys(i).map(s=>((u,h)=>typeof h=="object"?`${u}="${Object.keys(h).map(f=>`${f}:${h[f]};`).join(" ")}"`:h==null||h===""?"":`${u}="${h}"`)(s,i[s])).filter(s=>s&&s.trim().length>0).join(" "),o=" ".repeat(e);return`${o}<${t.type}${a?" "+a:""}>${n||`
401
+ `+t.children.map(s=>i_({dom:s,nestLevel:e+1})).join("")}${o}</${t.type}>
402
+ `};async function PT({json:t,elementHook:e,fontEmbedding:r="inline"}){const n=await kT({json:t,elementHook:e,fontEmbedding:r});return i_({dom:n})}const op=Qt.model("Page",{id:Qt.identifier,children:Qt.array(Qt.late(()=>h_)),width:Qt.optional(Qt.union(Qt.number,Qt.literal("auto")),"auto"),height:Qt.optional(Qt.union(Qt.number,Qt.literal("auto")),"auto"),background:"white",bleed:0,custom:Qt.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(t=>{const e=Object.assign({},t),r={};for(var n in e)n[0]!=="_"&&(r[n]=t[n]);return r}).views(t=>({get store(){return Vf(t,rh)}})).views(t=>({get startTime(){let e=0;for(const r of t.store.pages){if(r.id===t.id)return e;e+=r.duration}return e},get _exportingOrRendering(){return t._exporting||t._rendering}})).views(t=>({get computedWidth(){return t.width==="auto"?t.store.width:t.width},get computedHeight(){return t.height==="auto"?t.store.height:t.height}})).actions(t=>({toJSON:()=>JSON.parse(JSON.stringify(Tu(t))),_forEachElementUp(e,r){const n=e.map(i=>({id:i,index:t.children.findIndex(a=>a.id===i)}));n.sort((i,a)=>a.index-i.index);for(const{index:i}of n){if(i==-1)continue;const a=i<t.children.length-1&&t.children[i+1],o=e.indexOf(a?.id)>=0;i===t.children.length-1||o||r(i)}},_forEachElementDown(e,r){const n=e.map(i=>({id:i,index:t.children.findIndex(a=>a.id===i)}));n.sort((i,a)=>i.index-a.index);for(const{index:i}of n){if(i==-1)continue;const a=i>0&&t.children[i-1],o=e.indexOf(a?.id)>=0;i===0||o||r(i)}return!1}})).actions(t=>({clone(e={}){const r=t.toJSON();r.children.forEach(o=>{o.id=Ol(10),Mi(o,s=>{s.id=Ol(10)})});const n=Object.assign(Object.assign(Object.assign({},r),{id:Ol(10)}),e),i=t.store.addPage(n),a=t.store.pages.indexOf(t);return i.setZIndex(a+1),i.select(),i},setZIndex(e){t.store.setPageZIndex(t.id,e)},set(e){Object.assign(t,e)},select(){t.store.selectPage(t.id)},addElement(e,{skipSelect:r=!1}={}){const n=gy[e.type];if(!n)return void console.error("Can not find model with type "+e.type);"children"in e&&Array.isArray(e.children)&&Mi(e,a=>{a.id=a.id||Ol(10)});const i=n.create(Object.assign({id:Ol(10)},e));return t.children.push(i),i.selectable&&!r&&t.store.selectElements([i.id]),i},canMoveElementsUp(e){let r=!1;return t._forEachElementUp(e,()=>{r=r||!0}),r},moveElementsUp(e){t._forEachElementUp(e,r=>{const n=t.children[r];Qf(n),t.children.splice(r+1,0,n)})},canMoveElementsTop(e){return this.canMoveElementsUp(e)},moveElementsTop(e){const r=[],n=[];t.children.forEach(i=>{e.indexOf(i.id)>=0?r.push(i):n.push(i)}),t.children.replace(n.concat(r))},canMoveElementsDown(e){let r=!1;return t._forEachElementDown(e,()=>{r=r||!0}),r},moveElementsDown(e){t._forEachElementDown(e,r=>{const n=t.children[r];Qf(n),t.children.splice(r-1,0,n)})},canMoveElementsBottom(e){return this.canMoveElementsDown(e)},moveElementsBottom(e){const r=[],n=[];t.children.forEach(i=>{e.indexOf(i.id)>=0?r.push(i):n.push(i)}),t.children.replace(r.concat(n))},setElementZIndex(e,r){const n=t.children.find(i=>i.id===e);n&&(Qf(n),t.children.remove(n),t.children.splice(r,0,n))},setSize({width:e,height:r,useMagic:n,softChange:i}){if(n){const a=[],o=M=>M.type==="image"&&M.x<1&&M.y<1&&M.width>=t.computedWidth-2&&M.height>=t.computedHeight-2;Mi(t,M=>{M.type!=="group"&&(o(M)||a.push(M))});const s=a.length?X0(a):{x:0,y:0,width:t.computedWidth,height:t.computedHeight},u=1/4,h=Math.max(0,Math.min(s.x,t.computedWidth-s.x-s.width)),f=t.computedWidth*u,v=Math.max(0,h-f),g=Math.max(0,Math.min(s.y,t.computedHeight-s.y-s.height)),p=t.computedHeight*u,y=Math.max(0,g-p),_=t.computedWidth-2*v,x=t.computedHeight-2*y,b=e/_,E=r/x,k=Math.min(b,E),S=(e-_*k)/2-v*k,A=(r-x*k)/2-y*k;Mi(t,M=>{M.type!=="group"&&(o(M)?M.set({x:M.x*k,y:M.y*k,width:M.width*b,height:M.height*E,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(M.set({x:S+M.x*k,y:A+M.y*k,width:M.width*k,height:M.height*k}),M.type==="text"?M.set({fontSize:M.fontSize*k}):M.type==="figure"&&M.set({strokeWidth:M.strokeWidth*k})))})}i||(t.width=e),i||(t.height=r)}})).actions(t=>({moveElementUp(e){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),t.moveElementsUp([e])},moveElementDown(e){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),t.moveElementsDown([e])},moveElementTop(e){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),t.moveElementsTop([e])},moveElementBottom(e){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),t.moveElementsBottom([e])},play(){t.store.play({startTime:t.startTime,endTime:t.startTime+t.duration})}})),x4=Qt.model("Audio",{id:Qt.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},Tu(t))})).actions(t=>({set(e){Object.assign(t,e)}}));var Bd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};lO("ignore");const OT=Qt.model("Font",{fontFamily:Qt.string,url:Qt.optional(Qt.string,""),styles:Qt.frozen()}).preProcessSnapshot(t=>Object.assign(Object.assign({},t),{fontFamily:t.fontFamily||t.name})),rh=Qt.model("Store",{role:"",pages:Qt.array(op),fonts:Qt.array(OT),audios:Qt.array(x4),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:Qt.frozen(),selectedElementsIds:Qt.array(Qt.string),animatedElementsIds:Qt.array(Qt.string),history:Qt.optional(tT,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),_activePageId:"",_selectedPagesIds:Qt.array(Qt.string),_forceShowCredit:!1,_key:"",_validated:!1}).views(t=>{const e=fh(()=>{const r={};return Mi({children:t.pages},n=>(r[n.id]=n,!1)),r},{keepAlive:!0});return{get _idsMap(){return e.get()}}}).views(t=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),t.bleedVisible},get selectedElements(){return t.selectedElementsIds.map(e=>{for(const r of t.pages)for(const n of r.children)if(n.id===e)return n}).filter(e=>!!e)},get children(){return t.pages},get selectedShapes(){const e=[];return Mi({children:t.selectedElements},r=>{r.type!=="group"&&e.push(r)}),e},get activePage(){return t.pages.slice().find(e=>e.id===t._activePageId)||(t.pages.length?t.pages[0]:null)},get selectedPages(){return t._selectedPagesIds.map(e=>t.pages.find(r=>r.id===e))},get duration(){let e=0;return t.pages.forEach(r=>{e+=r.duration}),e},get _hasCroppedImages(){return t.find(e=>e.type==="image"&&e._cropModeEnabled)},find(e){let r;return Mi({children:t.pages},n=>{if(!r&&e(n))return r=n,!0}),r},getElementById:e=>t._idsMap[e]})).actions(t=>{let e=0,r=null,n=!1;return{afterCreate(){t.history.canUndo},setCurrentTime(i){t.currentTime=i},_togglePlaying(i=!t.isPlaying){t.isPlaying=i},play({animatedElementsIds:i=[],startTime:a=0,currentTime:o=0,endTime:s=t.duration,repeat:u=!1}={}){o&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),a=o),t.animatedElementsIds=i,t.currentTime=a,t.isPlaying=!0,e=Date.now(),r=s,n=u,requestAnimationFrame(t.seek)},checkActivePage(){let i=0;for(const a of t.pages){if(t.currentTime>=a.startTime&&t.currentTime<a.startTime+a.duration){t.selectPage(a.id);break}i+=a.duration}},seek(){if(!t.isPlaying)return;const i=Date.now(),a=i-e;e=i,t.currentTime+=a,t.checkActivePage();const o=r||t.duration;t.isPlaying&&t.currentTime<o?requestAnimationFrame(t.seek):t.isPlaying&&n?(t.currentTime=0,requestAnimationFrame(t.seek)):t.stop()},stop(){t.isPlaying=!1,t.currentTime=0,t.animatedElementsIds=[],t.checkActivePage()}}}).actions(t=>({__(){t._validated||(gT(t._key,t._forceShowCredit),t._validated=!0)},set(e){Object.assign(t,e)},setUnit({unit:e,dpi:r}){t.unit=e||t.unit,t.dpi=r||t.dpi},setRole(e){t.role=e},addPage(e){const r=op.create(Object.assign({id:Ol(10)},e));return t.pages.push(r),t._activePageId=r.id,r},selectPage(e){t._activePageId=e,t._selectedPagesIds.length===1&&(t._selectedPagesIds=[e])},selectPages(e){t._selectedPagesIds=e,t._selectedPagesIds.length===1&&(t._activePageId=t._selectedPagesIds[0])},selectElements(e){const r=e.map(n=>t.getElementById(n)).sort((n,i)=>n.page.children.indexOf(n)-n.page.children.indexOf(i)).filter(n=>!!n).map(n=>n.id);t.selectedElementsIds=r},toggleBleed(e){t.bleedVisible=e??!t.bleedVisible},toggleRulers(e){t.rulesVisible=e??!t.rulesVisible},openSidePanel(e){t.openedSidePanel!==e&&(t.previousOpenedSidePanel=t.openedSidePanel,t.openedSidePanel=e)},setScale(e){t.scale=e},_setScaleToFit(e){t.scaleToFit=e},setElementsPixelRatio(e){t._elementsPixelRatio=e},setSize(e,r,n){t.pages.forEach(i=>{i.setSize({width:e,height:r,useMagic:n,softChange:!0})}),t.width=e,t.height=r},setPageZIndex(e,r){const n=t.pages.find(i=>i.id===e);n&&(Qf(n),t.pages.remove(n),t.pages.splice(r,0,n))},deletePages(e){const r=t.pages.indexOf(t.activePage);e.forEach(a=>{const o=t.pages.find(s=>s.id===a);Qg(o)});const n=Math.min(t.pages.length-1,r),i=t.pages[n];i&&(t._activePageId=i.id),t.selectedElementsIds=t.selectedElementsIds.filter(a=>t.getElementById(a))},groupElements(e,r={}){const n=e.map(o=>t.getElementById(o)),i=n[0].page;if(n.forEach(o=>{o&&Qf(o)}),!n.length)return;const a=Object.assign({id:Ol(10),children:n,type:"group"},r);return i.children.push(a),t.selectedElementsIds=[a.id],i.children.find(o=>o.id===a.id)},ungroupElements(e){const r=e.map(i=>t.getElementById(i)),n=[];r.forEach(i=>{if(i&&i.type==="group"){const a=i.page,o=a.children.indexOf(i);i.children.forEach(s=>{n.push(s.id)}),i.children.forEach(s=>{Qf(s),a.children.push(s)}),a.children.splice(o,1)}}),t.selectedElementsIds=n},deleteElements(e){const r=[];t.find(n=>(e.includes(n.id)&&r.push(n),!1)),r.forEach(n=>{Qg(n)}),t.selectedElementsIds=t.selectedElementsIds.filter(n=>t.getElementById(n))},on(e,r){if(e==="change"){let n=t.toJSON();return G8(t,i=>{const a=t.toJSON();!ap(n,a)&&(n=a,r(a))})}},async _toCanvas({pixelRatio:e,ignoreBackground:r,pageId:n,mimeType:i,includeBleed:a,_skipTimeout:o,quickMode:s=!1}={}){var u;const h=e||1;n=n||((u=t.pages[0])===null||u===void 0?void 0:u.id);const f=t.pages.find(O=>O.id===n);if(!f)throw new Error(`No page for export with id ${n}`);const v=t._elementsPixelRatio;h>t._elementsPixelRatio&&t.setElementsPixelRatio(h),s?f?.set({_forceMount:!0}):f?.set({_exporting:!0});const g=await mT(()=>or.stages.find(O=>O.getAttr("pageId")===n));if(!g)throw f?.set({_forceMount:!1,_exporting:!1}),t.setElementsPixelRatio(v),new Error(`Export is failed. Can not find stage for page ${n}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);await t.waitLoading({_skipTimeout:o});const p=g.findOne(".page-container");if(!p)throw t.setElementsPixelRatio(v),f?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const y=g.position();g.position({x:0,y:0}),g.find("Transformer").forEach(O=>{O.setAttr("oldVisible",O.visible()),O.visible(!1)}),p.find(".page-background").forEach(O=>O.shadowEnabled(!1)),p.find(".page-background").forEach(O=>O.strokeEnabled(!1)),p.find(".highlighter").forEach(O=>O.visible(!1));const _=p.findOne(".page-background-group"),x=_.clip();_.clip({x:null,y:null,width:null,height:null});const b=p.findOne(".elements-container"),E=b.clip();b.clip({x:null,y:null,width:null,height:null});const k=p.find(O=>!O.visible()&&O.getAttr("editModeEnabled")&&!O.getAttr("hideInExport"));k.forEach(O=>{O.setAttr("oldVisible",O.visible()),O.show()});const S=p.find(O=>O.getAttr("hideInExport"));S.forEach(O=>{O.setAttr("oldVisible",O.visible()),O.hide()}),r&&p.find(".page-background").forEach(O=>O.hide());const A=a?f.bleed:0;let M=A;!t.bleedVisible&&a||(t.bleedVisible||a?t.bleedVisible&&a?M=0:t.bleedVisible&&!a&&(M=-f.bleed):M=0);const C=document.createElement("canvas");C.width=Math.round((f.computedWidth+2*A)*h),C.height=Math.round((f.computedHeight+2*A)*h);const I=C.getContext("2d");i==="image/jpeg"&&(I.fillStyle="white",I.fillRect(0,0,C.width,C.height));const F=p.scale();p.scale({x:1,y:1});const j=p.toCanvas({x:p.x()-M,y:p.y()-M,width:f.computedWidth+2*A,height:f.computedHeight+2*A,pixelRatio:h});return p.scale(F),I.drawImage(j,0,0,C.width,C.height),or.Util.releaseCanvas(j),r&&p.find(".page-background").forEach(O=>O.show()),S.forEach(O=>{O.visible(O.getAttr("oldVisible"))}),k.forEach(O=>{O.visible(O.getAttr("oldVisible"))}),p.find(".page-background").forEach(O=>O.shadowEnabled(!0)),p.find(".page-background").forEach(O=>O.strokeEnabled(!0)),g.find("Transformer").forEach(O=>{O.visible(O.getAttr("oldVisible"))}),p.find(".highlighter").forEach(O=>O.visible(!0)),_.clip(x),b.clip(E),g.position(y),f?.set({_exporting:!1,_forceMount:!1}),await new Promise(O=>setTimeout(O)),t.setElementsPixelRatio(v),C},async toDataURL(e={}){var{mimeType:r,quality:n}=e,i=Bd(e,["mimeType","quality"]);const a=await t._toCanvas(Object.assign({mimeType:r},i)),o=a.toDataURL(r,n);return or.Util.releaseCanvas(a),o},async toBlob(e={}){var{mimeType:r,quality:n}=e,i=Bd(e,["mimeType","quality"]);const a=await t._toCanvas(Object.assign({mimeType:r},i)),o=await new Promise(s=>{a.toBlob(s,r,n)});return or.Util.releaseCanvas(a),o},async saveAsImage(e={}){var{fileName:r}=e,n=Bd(e,["fileName"]);const i=n.mimeType||"image/png",a=i.split("/")[1];O1(await t.toDataURL(n),r||"polotno."+a)},async _toPDF(e){const r=e.dpi||t.dpi,n=e.parallel||1,i=e.unit||(t.unit==="px"?"mm":t.unit),a=e.pixelRatio||1,o=e.pageIds||t.pages.map(k=>k.id),s=t.pages.filter(k=>o.includes(k.id)),u=await rT(),h=k=>K0({px:k,unit:i,dpi:r}),f=e.cropMarkSize||0,v=h(f),g=s[0]||{},p=e.includeBleed?g.bleed:0,y=h(g.computedWidth+2*p+2*v),_=h(g.computedHeight+2*p+2*v);var x=new u({unit:i,orientation:y>_?"landscape":"portrait",format:[y,_],compress:!0,putOnlyUsedFonts:!0});x.deletePage(1);const b=((k,S)=>{for(var A=[],M=0;M<k.length;M+=S)A.push(k.slice(M,M+S));return A})(s,n);let E=0;for(const k of b){const S=k.map(async A=>{const M=e.includeBleed?A.bleed:0,C=A.computedWidth+2*M+2*f,I=A.computedHeight+2*M+2*f,F=h(C),j=h(I);let O=0,T=a;for(;O<10;){O+=1,O===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const $=await t.toDataURL(Object.assign(Object.assign({},e),{pageId:A.id,pixelRatio:T}));if($.length>20)return e.onProgress&&e.onProgress(++E/o.length*.9),{url:$,width:F,height:j,widthPx:C,heightPx:I};T*=.8}});(await Promise.all(S)).forEach(({url:A,width:M,height:C,widthPx:I,heightPx:F})=>{x.addPage([M,C],M>C?"landscape":"portrait");const j=x.getCurrentPageInfo();var O;switch(i){case"pt":O=1;break;case"mm":O=72/25.4;break;case"cm":O=72/2.54;break;case"in":O=72;break;case"px":O=.75;break;case"pc":case"em":O=12;break;case"ex":O=6;break;default:throw"Invalid unit: "+i}if(j.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:M*O,topRightY:C*O},j.pageContext.artBox={bottomLeftX:h(f+p)*O,bottomLeftY:h(f+p)*O,topRightX:h(I-f-p)*O,topRightY:h(F-f-p)*O},j.pageContext.bleedBox={bottomLeftX:h(f+p)*O,bottomLeftY:h(f+p)*O,topRightX:h(I-f-p)*O,topRightY:h(F-f-p)*O},v){x.setLineWidth(h(1));const T=v+h(p);x.line(T,0,T,v),x.line(0,T,v,T),x.line(M-T,0,M-T,v),x.line(M,T,M-v,T),x.line(0,C-T,v,C-T),x.line(T,C,T,C-v),x.line(M,C-T,M-v,C-T),x.line(M-T,C,M-T,C-v)}x.addImage(A,v,v,M-2*v,C-2*v,void 0,"FAST")})}return x},toPDFDataURL:async e=>(await t._toPDF(Object.assign({mimeType:"image/jpeg"},e))).output("datauristring"),async toGIFDataURL(e={}){const r=e.pixelRatio||1,n=await iT({width:t.width*r,height:t.height*r}),i=1e3/(e.fps||10),a=t.duration/i;for(let o=0;o<a-1;o++){const s=o*i||1;t.setCurrentTime(s);let u=0,h="";for(const v of t.pages)if(u+=v.duration,v.set({_rendering:u>s}),u>s){h=v.id;break}const f=await t._toCanvas({pixelRatio:r,pageId:h,_skipTimeout:!0});n.addFrame(f.getContext("2d"),{delay:i,copy:!0})}for(const o of t.pages)o.set({_rendering:!1});return t.stop(),n.render(),new Promise(o=>{n.on("finished",function(s){(function(u,h){var f=new FileReader;f.onload=function(v){h(v.target.result)},f.readAsDataURL(u)})(s,o)})})},async saveAsGIF(e={}){var{fileName:r}=e,n=Bd(e,["fileName"]);const i=await t.toGIFDataURL(n);O1(i,r||"polotno.gif")},async toHTML({elementHook:e}={elementHook:void 0}){const r=t.toJSON();return ST({json:r,elementHook:e})},async saveAsHTML({fileName:e}={}){const r=await t.toHTML(),n="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(r)));O1(n,e||"polotno.html")},async toSVG({elementHook:e,pageId:r,fontEmbedding:n="inline"}={elementHook:void 0,pageId:void 0,fontEmbedding:"inline"}){var i;const a=t.toJSON();r=r||((i=a.pages[0])===null||i===void 0?void 0:i.id);const o=a.pages.find(s=>s.id===r);return PT({json:Object.assign(Object.assign({},a),{pages:o?[o]:[]}),elementHook:e,fontEmbedding:n})},async saveAsSVG({fileName:e,elementHook:r,pageId:n,fontEmbedding:i="inline"}={}){const a=await t.toSVG({elementHook:r,pageId:n,fontEmbedding:i}),o="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(a)));O1(o,e||"polotno.svg")},async saveAsPDF(e={}){var{fileName:r}=e,n=Bd(e,["fileName"]);(await t._toPDF(Object.assign({mimeType:"image/jpeg"},n))).save(r||"polotno.pdf")},async waitLoading({_skipTimeout:e=!1}={}){e||await new Promise(r=>setTimeout(r,50)),await KP()},toJSON:()=>({width:t.width,height:t.height,fonts:Tu(t.fonts),pages:Tu(t.pages),audios:Tu(t.audios),unit:t.unit,dpi:t.dpi,custom:t.custom,schemaVersion:t.schemaVersion}),loadJSON(e,r=!1){var n;const i=JSON.parse(JSON.stringify(e)),a=i.schemaVersion||0;a<1&&Si.htmlRenderEnabled&&Mi({children:i.pages},h=>{if(h.type==="text"){const v=h.letterSpacing*16;h.letterSpacing=v/h.fontSize}}),a<2&&Mi({children:i.pages},h=>{h.filters&&Object.keys(h.filters).forEach(f=>{if(["warm","cold","natural"].includes(f))return;const v=h.filters[f];v&&typeof v.intensity=="number"&&(v.intensity=v.intensity/100)})}),delete i.schemaVersion;const o=t.pages.indexOf(t.activePage);let s=(n=i.pages[o]||i.pages[0])===null||n===void 0?void 0:n.id;i._activePageId=s;const u=Object.assign({},Tu(t));Object.assign(u,i),u.history=r?t.history.toJSON():{history:[],undoIdx:-1},pm(t,u)},clear({keepHistory:e=!1}={}){const r=t.pages.map(n=>n.id);t.deletePages(r),t.custom=null,e||t.history.clear()},addFont(e){t.removeFont(e.fontFamily),t.fonts.push(e),t.loadFont(e.fontFamily)},removeFont(e){t.fonts.filter(r=>r.fontFamily===e).forEach(r=>Qg(r))},addAudio(e){const r=x4.create(Object.assign({id:Ol(10)},e));t.audios.push(r)},removeAudio(e){const r=t.audios.find(n=>n.id===e);r&&t.audios.remove(r)},async loadFont(e){const r=t.fonts.find(i=>i.fontFamily===e)||ey.find(i=>i.fontFamily===e);let n=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return r?(r.styles&&(n=r.styles.map(i=>({fontStyle:i.fontStyle||"normal",fontWeight:i.fontWeight||"normal"}))),q8(r)):z8(e),Promise.all(n.map(i=>Yh(e,i.fontStyle,i.fontWeight)))},validate:e=>rh.validate(e,[{path:"",type:rh}]).map(r=>({path:"store"+r.context.map(n=>n.path).join("."),message:r.message}))}));function CT({key:t,showCredit:e}={key:"",showCredit:!1}){return rh.create({_forceShowCredit:e,_key:t})}const a_=Qt.model("Node",{id:Qt.identifier,type:"none",name:"",opacity:1,custom:Qt.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(t=>{for(var e in t)t[e]===null&&(t[e]=void 0);return t}).postProcessSnapshot(t=>{const e=Object.assign({},t),r={};for(var n in e)n[0]!=="_"&&(r[n]=t[n]);return r}).views(t=>({get locked(){return!(t.draggable||t.contentEditable||t.styleEditable||t.resizable)},get page(){return Vf(t,op)},get store(){return Vf(t,rh)},get top(){let e=t;for(;;){if(!A1(e,td))return e;e=Vf(e,td)}},get parent(){if(A1(t,td)){const e=Vf(t,td);return e&&e.children&&e.children.length,e}if(A1(t,op)){const e=Vf(t,op);return e&&e.children&&e.children.length,e}if(A1(t,rh)){const e=Vf(t,rh);return e&&e.pages&&e.pages.length,e}return null},get zIndex(){return t.parent.children.indexOf(t)}})).actions(t=>({toJSON:()=>Object.assign({},Tu(t))})).actions(t=>({clone(e={},{skipSelect:r=!1}={}){const n=JSON.parse(JSON.stringify(t.toJSON()));return e.id=e.id||Ol(10),Mi(n,i=>{i.id=Ol(10)}),Object.assign(n,e),t.page.addElement(n,{skipSelect:r})},set(e){Object.assign(t,e)},moveUp(){t.page.moveElementsUp([t.id])},moveTop(){t.page.moveElementsTop([t.id])},moveDown(){t.page.moveElementsDown([t.id])},moveBottom(){t.page.moveElementsBottom([t.id])},setZIndex(e){t.parent.setElementZIndex(t.id,e)},beforeDestroy(){}})),S4={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}}},E4={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},LT={fade:({dTime:t,element:e,animation:r})=>{const n=t/r.duration;return r.type==="enter"?{opacity:n*e.opacity}:{opacity:(1-n)*e.opacity}},rotate:({dTime:t,element:e,animation:r})=>{const n=t/r.duration*360;return EN({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation},n)},blink:({dTime:t,element:e,animation:r})=>{const n=r.duration,i=t%n/(n/2),a=i<=1?i:2-i;return{opacity:e.opacity*a}},bounce:({dTime:t,element:e,animation:r})=>{var n;const i=r.duration,a=i/2,o=(n=r.data.strength)!==null&&n!==void 0?n:1,s={},u={x:e.x+e.width/3*o,y:e.y+e.height/3*o,width:e.width/3*o,height:e.height/3*o,fontSize:e.fontSize/3*o},h={x:e.x,y:e.y,width:e.width,height:e.height,fontSize:e.fontSize},f=t%i/a,v=f<=1?f:2-f;for(let g in u){const p=u[g],y=h[g]-p;s[g]=p+v*y}return s},move:({dTime:t,element:e,animation:r})=>{var n;const i=S4[r.data.direction]||S4.right,a=(n=r.data.strength)!==null&&n!==void 0?n:1,o={};for(var s in i.from){let u=i.from[s],h=i.to[s];r.type==="exit"&&(u=i.to[s],h=-i.from[s]),u*=a,h*=a;const f=e[s]+u,v=e[s]+h-f;o[s]=f+t/r.duration*v}return o},zoom:({dTime:t,element:e,animation:r})=>{var n;const i={},a=1+(((r.data.direction||"in")==="in"?.75:1.25)-1)*((n=r.data.strength)!==null&&n!==void 0?n:1),o=e.rotation*Math.PI/180,s=Math.cos(o),u=Math.sin(o),h=e.width*(1-a),f=e.height*(1-a),v=(h*s-f*u)/2,g=(h*u+f*s)/2,p={x:e.x+v,y:e.y+g,width:e.width*a,height:e.height*a,fontSize:e.fontSize*a},y={x:e.x,y:e.y,width:e.width,height:e.height,fontSize:e.fontSize};for(var _ in p){let x=p[_],b=y[_];if(r.type==="exit"){const k=x;x=b,b=k}const E=b-x;i[_]=x+t/r.duration*E}return i},cameraZoom:({dTime:t,element:e,animation:r})=>{var n,i,a;const o={},s=r.data.direction||"right",u=E4[s]||E4.right,h=(n=r.data.movementStrength)!==null&&n!==void 0?n:.1,f=(i=r.data.shakeStrength)!==null&&i!==void 0?i:.015;a=r.data.zoomStrength;const v=t/r.duration,g=f*(1-v),p=Math.sin(12*v)*g*.7+Math.sin(8*v)*g*.3;r.type==="exit"&&Math.max(e.cropWidth||1,e.cropHeight||1),r.type;const y=1-Math.pow(1-v,2),_=e.cropX||0,x=e.cropY||0,b=e.cropWidth||1,E=e.cropHeight||1,k=b,S=E;let A,M,C=0,I=0;if(u.cropX){const F=u.cropX>0?1-(_+b):_;C=Math.min(F,Math.abs(h))*u.cropX}if(u.cropY){const F=u.cropY>0?1-(x+E):x;I=Math.min(F,Math.abs(h))*u.cropY}return r.type==="enter"?(A=u.cropX?_+C*(1-y):_,M=u.cropY?x+I*(1-y):x):(A=u.cropX?_+C*y:_,M=u.cropY?x+I*y:x),o.cropX=Math.max(0,Math.min(1-k,A+p*k)),o.cropY=Math.max(0,Math.min(1-S,M+p*S)),o.cropWidth=k,o.cropHeight=S,o}},vv=({element:t,dTime:e,animation:r})=>{const n=LT[r.name];return n?n({element:t,dTime:e,animation:r}):(console.error("Can not find animation type: "+r.name),{})},NT=Qt.model("Animation",{delay:0,duration:500,enabled:!0,type:Qt.enumeration("Type",["enter","exit","loop"]),name:"none",data:Qt.frozen({})}),mv=(t,e)=>{const r={};for(const n in e)if(typeof t[n]=="number"&&typeof e[n]=="number"){const i=e[n]-t[n];i!==0&&(r[n]=i)}return r},TT=Qt.model("ShapeFilter",{intensity:1}),A4=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],Ip=a_.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:Qt.array(NT),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:Qt.map(TT),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(t=>{const e=Object.assign(Object.assign({},t),{x:t.x||0,y:t.y||0,filters:Array.isArray(t.filters)?{}:t.filters});return"width"in t&&(e.width=e.width||1),"height"in t&&(e.height=e.height||1),t.locked&&(e.draggable=!1,e.contentEditable=!1,e.styleEditable=!1,e.resizable=!1,e.removable=!1),e}).views(t=>{const e=Kr({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,opacity:t.opacity,color:t.color,fontSize:t.fontSize}),r=Zr(i=>{Object.assign(e,i)}),n=Zr(i=>{for(const a in i)typeof e[a]=="number"&&(e[a]=e[a]+i[a])});return{get a(){const{currentTime:i}=t.store;if(r({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,opacity:t.opacity,color:t.color,fontSize:t.fontSize,cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}),i===0)return e;const a=i-t.page.startTime;if(a>t.page.duration||a<0)return e;const o=t.store.animatedElementsIds;if(o.length&&!o.includes(t.id))return e;const s=t.animations.find(g=>g.type==="enter"),u=s?.enabled&&a<s.delay;u&&r({opacity:0});const h=s?.enabled&&a>=s.delay&&a<=s.delay+s.duration;if(h){const g=a-s.delay,p=vv({element:t,animation:s,dTime:g}),y=mv(t,p);n(y)}const f=t.animations.find(g=>g.type==="exit");if(!u&&!h&&f?.enabled&&a>=t.page.duration-f.duration-f.delay&&a<=t.page.duration-f.delay){const g=a-(t.page.duration-f.duration-f.delay),p=vv({element:t,animation:f,dTime:g}),y=mv(t,p);n(y)}f?.enabled&&a>=t.page.duration-f.delay&&r({opacity:0});const v=t.animations.find(g=>g.type==="loop");if(v?.enabled){const g=vv({element:t,animation:v,dTime:a}),p=mv(t,g);n(p)}return e},animated:i=>t.a[i]}}).actions(t=>({setAnimation(e,r){const n=t.animations.find(i=>i.type===e);n?Object.assign(n,r):t.animations.push(Object.assign({type:e},r))},setFilter(e,r){A4.includes(e)||t.filters.forEach((n,i)=>{A4.includes(i.toString())||t.filters.delete(i.toString())}),r==null?t.filters.delete(e):t.filters.set(e,{intensity:r})}})),o_=Ip.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",textTransform:"none",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:Qt.optional(Qt.union(Qt.number,Qt.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5,curveEnabled:!1,curvePower:.5}).preProcessSnapshot(t=>Object.assign({},t)).actions(t=>({toggleEditMode(e){t._editModeEnabled=e??!t._editModeEnabled,t._editModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()}})),Z0=Ip.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(e){t._cropModeEnabled=e??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}})),s_=Z0.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),l_=Ip.named("Line").props({type:"line",width:400,height:10,color:"black",dash:Qt.array(Qt.number),startHead:"",endHead:""}).actions(t=>({})),u_=Ip.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:Qt.map(Qt.string)}).preProcessSnapshot(t=>Object.assign(Object.assign({},t),{src:t.src||t.svgSource,colorsReplace:Array.isArray(t.colorsReplace)?{}:t.colorsReplace})).actions(t=>({replaceColor(e,r){t.colorsReplace.set(e,r)}})),c_=Ip.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:Qt.array(Qt.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),f_=Z0.named("Gif").props({type:"gif",duration:0,keepRatio:!0});var RT=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const Mi=(t,e)=>{if(t.children)for(const r of t.children){if(e(r)===!0)break;Mi(r,e)}},MT=[...new Array(20)].map((t,e)=>Qt.late(()=>IT[e])),h_=Qt.union({dispatcher:t=>{const e=gy[t.type];if(!e)throw new Error(`Unknown element type: "${t.type}"`);return e}},u_,o_,Z0,l_,s_,c_,f_,Qt.late(()=>td),...MT),td=a_.named("Group").props({type:"group",children:Qt.array(h_)}).views(t=>({get draggable(){let e=!0;return Mi(t,r=>{r.draggable||(e=!1)}),e},get resizable(){let e=!0;return Mi(t,r=>{r.resizable||(e=!1)}),e},get contentEditable(){let e=!0;return Mi(t,r=>{r.contentEditable||(e=!1)}),e},get styleEditable(){let e=!0;return Mi(t,r=>{r.styleEditable||(e=!1)}),e},get locked(){let e=!0;return Mi(t,r=>{r.locked||(e=!1)}),e}})).actions(t=>({set(e){var{draggable:r,contentEditable:n,styleEditable:i,resizable:a}=e,o=RT(e,["draggable","contentEditable","styleEditable","resizable"]);r!==void 0&&Mi(t,s=>{s.set({draggable:r})}),n!==void 0&&Mi(t,s=>{s.set({contentEditable:n})}),i!==void 0&&Mi(t,s=>{s.set({styleEditable:i})}),a!==void 0&&Mi(t,s=>{s.set({resizable:a})}),Object.assign(t,o)},addElement(e,{skipSelect:r=!1}={}){const n=gy[e.type];if(!n)return void console.error("Can not find model with type "+e.type);e.children&&e.children.forEach(a=>{a.id=a.id||Ol(10)});const i=n.create(Object.assign({id:Ol(10)},e));return t.children.push(i),i.selectable&&!r&&t.store.selectElements([i.id]),i},setElementZIndex(e,r){const n=t.children.find(i=>i.id===e);n&&(Qf(n),t.children.remove(n),t.children.splice(r,0,n))}})),IT=[],gy={svg:u_,text:o_,image:Z0,group:td,line:l_,video:s_,figure:c_,gif:f_},jT={text:VC,image:$3,svg:$3,line:CN,video:MN,figure:GN,group:ni(t=>{const{element:e,store:r}=t,{children:n}=e,i=e.selectable||r.role==="admin";return se.createElement(bn,{opacity:e.opacity,listening:i,hideInExport:!e.showInExport},n.map(a=>se.createElement(d_,Object.assign({},t,{key:a.id,store:r,element:a}))))}),gif:QN},DT=(t,e)=>{const r=[];Mi(t,f=>{f.type!=="group"&&r.push(f.a)});const n=[];r.forEach(f=>{const v=[{x:0,y:0},{x:0+f.width,y:0},{x:0+f.width,y:0+f.height},{x:0,y:0+f.height}],g=new or.Transform;g.translate(f.x,f.y),g.rotate(or.Util.degToRad(f.rotation)),v.forEach(p=>{const y=g.point(p);n.push(y)})});const i=new or.Transform;i.rotate(-or.Util.degToRad(e));let a=1/0,o=1/0,s=-1/0,u=-1/0;n.forEach(f=>{const v=i.point(f);a=Math.min(a,v.x),o=Math.min(o,v.y),s=Math.max(s,v.x),u=Math.max(u,v.y)}),i.invert();const h=i.point({x:a,y:o});return{x:h.x,y:h.y,width:s-a,height:u-o,rotation:e}},d_=ni(t=>{var e;const{element:r,store:n}=t,[i,a]=se.useState(!1),o=n.selectedElements.indexOf(r)>=0&&r.selectable,s=((e=r.parent)===null||e===void 0?void 0:e.type)==="group",u=(v=>{const[g,p]=se.useState(null);return se.useEffect(()=>{const y=setTimeout(()=>{const _=v.page.id,x=or.stages.find(b=>b.getAttr("pageId")===_);x||console.error("No stage is found for element",v.id),p(x)});return()=>clearTimeout(y)},[v.id]),g})(r),h=u?.findOne("Transformer");se.useEffect(()=>{if(u){const v=p=>{const y=p.target.findAncestor(".element",!0),_=n.getElementById(y?.id()),x=_?.top,b=x?.id;a(b===r.id)};u.on("mouseover",v);const g=()=>{a(!1)};return u.on("mouseleave",g),()=>{u.off("mouseover",v),u.off("mouseleave",g)}}},[u]);let f=jT[t.element.type];return t.element.type==="text"&&Si.htmlRenderEnabled&&(f=wN),t.element.visible?f?se.createElement(se.Fragment,null,se.createElement(f,Object.assign({},t)),(i||o)&&!s&&se.createElement(eT,{element:r.type==="group"?{a:DT(r,h?.rotation()||0)}:r})):(console.error("Can not find component for "+t.element.type),null):null});function FT(t,e,r="scale"){const n=e.width/e.height;let i,a;n>=t.width/t.height?(i=t.width,a=t.width/n):(i=t.height*n,a=t.height);let o=0,s=0;return r==="left-top"?(o=0,s=0):r==="left-middle"?(o=0,s=(t.height-a)/2):r==="left-bottom"?(o=0,s=t.height-a):r==="center-top"?(o=(t.width-i)/2,s=0):r==="center-middle"?(o=(t.width-i)/2,s=(t.height-a)/2):r==="center-bottom"?(o=(t.width-i)/2,s=t.height-a):r==="right-top"?(o=t.width-i,s=0):r==="right-middle"?(o=t.width-i,s=(t.height-a)/2):r==="right-bottom"?(o=t.width-i,s=t.height-a):r==="scale"?(o=0,s=0,i=t.width,a=t.height):console.error(new Error("Unknown clip position property - "+r)),{cropX:o,cropY:s,cropWidth:i,cropHeight:a}}var p_=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const k4=or.DD._drag;window.removeEventListener("mousemove",k4),or.DD._drag=function(t){hc(()=>{k4.call(this,t)})},window.addEventListener("mousemove",or.DD._drag);const bm=new or.Group,hf=20;bm.add(new or.Rect({width:hf,height:hf,fill:"white"})),bm.add(new or.Path({scaleX:hf/24,scaleY:hf/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 BT=bm.toCanvas({pixelRatio:2,width:hf,height:hf}),yv={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:t=>{t.hasName("rotater")&&t.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:BT,fillPatternScaleX:20/hf/2,fillPatternScaleY:20/hf/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},C1={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"]}},zT=t=>se.createElement(Tn,Object.assign({},t,{preventDefault:!1})),qT=t=>{var{url:e}=t,r=p_(t,["url"]);const[n,i]=Qm(e,"anonymous"),a=n?FT(n,{width:r.width,height:r.height},"center-middle"):{};return ip(i,e,"page background"),se.createElement(Nu,Object.assign({image:n},r,a))},UT=t=>{const e=yf({fill:t.fill,a:{width:t.width,height:t.height}});return se.createElement(Tn,Object.assign({},t,e))},HT=t=>{const{background:e,scale:r,borderColor:n}=t,i=p_(t,["background","scale","borderColor"]),a=se.useMemo(()=>!!or.Util.colorToRGBA(e)||B0(e),[e]),o=se.useMemo(()=>{const s=document.createElement("canvas"),u=30;s.width=60,s.height=60;const h=s.getContext("2d");return h&&(h.fillStyle="black",h.fillRect(u,0,u,u),h.fillRect(0,u,u,u)),s},[]);return se.createElement(se.Fragment,null,se.createElement(Tn,Object.assign({fillPatternImage:o},i,{opacity:.1,hideInExport:!0})),a?se.createElement(UT,Object.assign({fill:e},i)):se.createElement(qT,Object.assign({url:e},i)))},$T=ni(({selection:t,fill:e="rgba(0, 161, 255, 0.3)",stroke:r="rgb(0, 161, 255)",strokeWidth:n=1})=>t.visible?se.createElement(Tn,{name:"selection",x:Math.min(t.x1,t.x2),y:Math.min(t.y1,t.y2),width:Math.abs(t.x1-t.x2),height:Math.abs(t.y1-t.y2),fill:e,stroke:r,strokeWidth:n}):null),GT=ni(({x:t,y:e,width:r,height:n,rotation:i,anchor:a,store:o,tagFill:s,textFill:u})=>{const h=Y0({x:t,y:e,width:r,height:n,rotation:or.Util.radToDeg(i)});if(a===void 0)return null;const f=(n/2+70)*Math.cos(i-Math.PI/2),v=(n/2+70)*Math.sin(i-Math.PI/2),g=m4({unit:o.unit,dpi:o.dpi,px:r/o.scale,precious:o.unit==="px"?0:1})+" x "+m4({unit:o.unit,dpi:o.dpi,px:n/o.scale,precious:o.unit==="px"?0:1})+(o.unit==="px"?"":" "+o.unit);return se.createElement(se.Fragment,null,se.createElement(h0,{x:(h.minX+h.maxX)/2+f,y:(h.minY+h.maxY)/2+v,offsetX:14,offsetY:14,visible:a==="rotater"},se.createElement(d0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)"}),se.createElement(Du,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:Math.round(or.Util.radToDeg(i)).toString()+"°"})),se.createElement(h0,{x:(h.minX+h.maxX)/2,y:h.maxY+20,visible:a!=="rotater"},se.createElement(d0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),se.createElement(Du,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:g})))}),WT=ni(({elements:t,store:e})=>{const r=t.filter(i=>i.alwaysOnTop),n=t.filter(i=>!i.alwaysOnTop).concat(r);return se.createElement(se.Fragment,null,n.map(i=>se.createElement(d_,{key:i.id,store:e,element:i,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),VT=({store:t})=>{const[e,r]=se.useState(!1),[n,i]=se.useState({x:0,y:0});return{open:se.useCallback(o=>{r(!0),i(o)},[]),close:se.useCallback(()=>{r(!1)},[]),props:{isOpen:e,offset:n,setIsOpen:r}}},YT=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),P4=atob("cmVk"),XT=atob("djAuOS4y"),KT=t=>se.createElement(se.Fragment,null,se.createElement(h0,{fill:P4,height:200},se.createElement(d0,{fill:P4}),se.createElement(Du,Object.assign({},t,{fill:"white",text:YT,height:void 0,padding:10,fontSize:20})))),ZT=ni(({store:t,page:e,width:r,height:n,pageControlsEnabled:i,backColor:a,pageBorderColor:o,activePageBorderColor:s,components:u,bleedColor:h,altCloneEnabled:f,viewportSize:v,selectionRectFill:g,selectionRectStroke:p,selectionRectStrokeWidth:y,snapGuideStroke:_,snapGuideStrokeWidth:x,snapGuideDash:b,transformLabelFill:E,transformLabelTextFill:k,distanceGuideStroke:S,distanceLabelFill:A,distanceLabelTextFill:M})=>{const C=t.bleedVisible?e.bleed:0,I=e.computedWidth+2*C,F=e.computedHeight+2*C,j=(r-I*t.scale)/2,O=(n-F*t.scale)/2,T=se.useRef(null),$=se.useRef(null),q=se.useRef(null),J=i==null||i,[ae,ie]=se.useState(null),[Z,te]=se.useState({}),V=VT({store:t}),B=t.selectedElements.find(fe=>fe._cropModeEnabled),D=t.selectedElements.find(fe=>fe.curveEnabled),U=t.selectedShapes.filter(fe=>!fe.resizable).length>0,X=t.selectedShapes.filter(fe=>!fe.draggable).length>0,ee=t.selectedElements.filter(fe=>!fe.visible).length>0;se.useLayoutEffect(()=>{var fe,Le,Ne;if(!T.current)return;const ue=T.current.getStage(),ke=t.selectedShapes.map(st=>st._cropModeEnabled?null:ue.findOne("#"+st.id)).filter(st=>st),Pe=t.selectedElements.length===1,Ue=Pe&&((fe=t.selectedElements[0])===null||fe===void 0?void 0:fe.type)||"many";C1[Ue]?(T.current.setAttrs(Object.assign(Object.assign({},yv),C1[Ue])),Ue!=="svg"&&Ue!=="image"&&Ue!=="gif"||t.selectedElements[0].keepRatio||T.current.setAttrs({enabledAnchors:yv.enabledAnchors}),Ue==="text"&&Si.textVerticalResizeEnabled&&T.current.setAttrs({enabledAnchors:(Le=C1.text.enabledAnchors)===null||Le===void 0?void 0:Le.concat(["bottom-center"])}),Ue==="text"&&Pe&&t.selectedElements[0].curveEnabled&&T.current.setAttrs({enabledAnchors:C1.many.enabledAnchors})):T.current.setAttrs(yv),U&&T.current.enabledAnchors([]),X&&T.current.rotateEnabled(!1),ke.find(st=>st?.isDragging())&&ke.forEach(st=>{st.isDragging()||st==null||st.startDrag()}),T.current.nodes(ke),U7(),(Ne=T.current.getLayer())===null||Ne===void 0||Ne.batchDraw()},[t.selectedShapes,B,U,ee,X,D]);const K=KS(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),oe=se.useRef(!1),me=Of(),de=Zr(fe=>{var Le,Ne,ue,ke;if(me)return;oe.current=!1;const Pe=fe.target.findAncestor(".elements-container"),Ue=fe.target.findAncestor("Transformer"),st=fe.target.findAncestor(".page-abs-container");if(Pe||Ue||st)return;const dt=(Le=fe.target.getStage())===null||Le===void 0?void 0:Le.getPointerPosition();dt.x-=(Ne=fe.target.getStage())===null||Ne===void 0?void 0:Ne.x(),dt.y-=(ue=fe.target.getStage())===null||ue===void 0?void 0:ue.y(),dt&&(K.visible=!0,K.x1=dt.x,K.y1=dt.y,K.x2=dt.x,K.y2=dt.y,((ke=fe.target.getStage())===null||ke===void 0?void 0:ke.getPointersPositions().length)>=2&&(K.visible=!1))});(({stageRef:fe,containerRef:Le,viewportSize:Ne})=>{se.useEffect(()=>{var ue;const ke=(ue=Le.current)===null||ue===void 0?void 0:ue.closest(".polotno-workspace-inner");function Pe(){var Ue;if(!fe.current)return;const st=(Ue=Le.current)===null||Ue===void 0?void 0:Ue.getBoundingClientRect(),dt=ke?.getBoundingClientRect(),pt=Math.max(0,dt.left-st.left-100),xt=Math.max(0,dt.top-st.top-100);fe.current.position({x:-pt,y:-xt}),fe.current.container().style.transform=`translate(${pt}px, ${xt}px)`}return Pe(),ke.addEventListener("scroll",Pe),()=>{ke.removeEventListener("scroll",Pe)}},[Ne.width,Ne.height])})({stageRef:$,containerRef:q,viewportSize:v}),se.useEffect(()=>{const fe=Zr(Ne=>{var ue,ke,Pe,Ue;if(!K.visible)return;(ue=$.current)===null||ue===void 0||ue.setPointersPositions(Ne);let st=(ke=$.current)===null||ke===void 0?void 0:ke.getPointerPosition();st?(st.x-=(Pe=$.current)===null||Pe===void 0?void 0:Pe.x(),st.y-=(Ue=$.current)===null||Ue===void 0?void 0:Ue.y()):st={x:K.x2,y:K.y2},K.x2=st.x,K.y2=st.y}),Le=Zr(()=>{if(!K.visible||!$.current)return;const Ne=$.current.findOne(".selection"),ue=Ne?Ne.getClientRect():{width:0,height:0,x:0,y:0};if(ue.width&&ue.height){const ke=[];$.current.find(".element").forEach(Ue=>{const st=Ue.getClientRect(),dt=t.getElementById(Ue.id()),pt=dt?.draggable,xt=dt?.selectable;or.Util.haveIntersection(ue,st)&&pt&&xt&&ke.push(dt.top.id)});const Pe=[...new Set(ke)];t.selectElements(Pe)}K.visible=!1,oe.current=!0});return window.addEventListener("mousemove",fe),window.addEventListener("touchmove",fe),window.addEventListener("mouseup",Le),window.addEventListener("touchend",Le),()=>{window.removeEventListener("mousemove",fe),window.removeEventListener("touchmove",fe),window.removeEventListener("mouseup",Le),window.removeEventListener("touchend",Le)}},[]);const ye=se.useRef(!1);se.useEffect(()=>{var fe;let Le;const Ne=(fe=q.current)===null||fe===void 0?void 0:fe.closest(".polotno-workspace-inner"),ue=()=>{ye.current=!0,clearTimeout(Le),Le=setTimeout(()=>{ye.current=!1},300)};return Ne.addEventListener("scroll",ue),()=>{clearTimeout(Le),Ne.removeEventListener("scroll",ue)}},[]);const Te=fe=>{if(t.activePage!==e&&e.select(),ye.current||oe.current)return;const Le=fe.evt.ctrlKey||fe.evt.metaKey||fe.evt.shiftKey,Ne=fe.target.findAncestor(".elements-container"),ue=fe.target.findAncestor(".page-abs-container"),ke=fe.target.findAncestor("Transformer");if(!(Le||Ne||ke||ue||K.visible))return void t.selectElements([]);const Pe=fe.target.findAncestor(".element",!0),Ue=t.getElementById(Pe?.id()),st=Ue?.top,dt=st?.id,pt=t.selectedElementsIds.indexOf(dt)>=0,xt=fe.target.findAncestor(".page-container",!0);dt&&Le&&!pt?t.selectElements(t.selectedElementsIds.concat([dt])):dt&&Le&&pt?t.selectElements(t.selectedElementsIds.filter(bt=>bt!==dt)):!dt||Le||pt?xt?t.selectPages([e.id]):t.selectPages([]):t.selectElements([dt])};kN(T,t,{stroke:_,strokeWidth:x,dash:b});const Ce=t.activePage===e,Ie=t._selectedPagesIds.includes(e.id),Ee=u?.PageControls,ge=u?.Tooltip,Re=u?.ContextMenu,Be=1/t.scale,Oe=0/t.scale;return se.createElement("div",{ref:q,onDragOver:fe=>fe.preventDefault(),onDrop:fe=>{if(fe.preventDefault(),!$.current)return;$.current.setPointersPositions(fe),$.current.findOne(".elements-container").getRelativePointerPosition();const Le=$.current.getPointerPosition(),Ne=$.current.getAllIntersections(Le).map(ke=>ke.findAncestor(".element",!0)).filter(Boolean);[...new Set(Ne.reverse())].map(ke=>t.getElementById(ke.id()))[0]},style:{position:"relative",width:r+"px",height:n+"px",overflow:"hidden"},className:"polotno-page-container"+(Ce?" active-page":"")},se.createElement(kP,{ref:$,width:Math.min(r,v.width+200),height:Math.min(v.height+200,n),onClick:Te,onTap:Te,onContextMenu:fe=>{fe.evt.preventDefault();const Le=fe.target.findAncestor(".element",!0),Ne=t.getElementById(Le?.id()),ue=Ne?.top,ke=ue?.id;ke?t.selectedElementsIds.indexOf(ke)>=0||t.selectElements([ke]):t.selectElements([]),V.open({x:fe.evt.clientX,y:fe.evt.clientY})},onMouseDown:de,onMouseMove:fe=>{if(!fe.evt.altKey&&ae)return void ie(null);if(!fe.evt.altKey)return;const Le=fe.target.findAncestor(".element",!0),Ne=Le?.id();if(!t.selectedElements[0]||t.selectedElementsIds.includes(Ne))return;const ue=X0(t.selectedShapes),ke=Ne?t.getElementById(Ne):{x:0,y:0,width:e.computedWidth,height:e.computedHeight,rotation:0},Pe=Y0(ke),Ue=[];ue.minX>Pe.maxX&&Ue.push({distance:ue.minX-Pe.maxX,box1:ue,box2:Pe,points:[{x:ue.minX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),ue.maxX<Pe.minX&&Ue.push({distance:Pe.minX-ue.maxX,box1:ue,box2:Pe,points:[{x:ue.maxX,y:ue.minY+ue.height/2},{x:Pe.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),ue.minY>Pe.maxY&&Ue.push({box1:ue,box2:Pe,distance:ue.minY-Pe.maxY,points:[{x:ue.minX+ue.width/2,y:ue.minY},{x:ue.minX+ue.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]}),ue.maxY<Pe.minY&&Ue.push({box1:ue,box2:Pe,distance:Pe.minY-ue.maxY,points:[{x:ue.minX+ue.width/2,y:ue.maxY},{x:ue.minX+ue.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),ue.minX>=Pe.minX&&ue.maxX<=Pe.maxX&&ue.minY>=Pe.minY&&ue.maxY<=Pe.maxY&&(Ue.push({distance:ue.minX-Pe.minX,box1:ue,box2:Pe,points:[{x:ue.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),Ue.push({distance:Pe.maxX-ue.maxX,box1:ue,box2:Pe,points:[{x:ue.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),Ue.push({box1:ue,box2:Pe,distance:ue.minY-Pe.minY,points:[{x:ue.minX+ue.width/2,y:ue.minY},{x:ue.minX+ue.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),Ue.push({box1:ue,box2:Pe,distance:Pe.maxY-ue.maxY,points:[{x:ue.minX+ue.width/2,y:ue.maxY},{x:ue.minX+ue.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]})),JSON.stringify(ae)!==JSON.stringify(Ue)&&ie(Ue)},onDragStart:fe=>{var Le;const Ne=fe.target.findAncestor(".element",!0);if(Ne){const ue=t.getElementById(Ne?.id()),ke=ue?.top,Pe=ke?.id;!(t.selectedElementsIds.indexOf(Pe)>=0)&&Pe&&(t.selectElements([Pe]),fe.target.stopDrag(),fe.target.startDrag(fe),(Le=T.current)===null||Le===void 0||Le.startDrag(fe))}ae&&ie(null)},pageId:e.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},se.createElement(SP,null,se.createElement(zT,{width:r,height:n,fill:a}),se.createElement(bn,{x:j,y:O,scaleX:t.scale,scaleY:t.scale,name:"page-container"},se.createElement(bn,{name:"page-container-2"},se.createElement(bn,{name:"page-background-group",x:C,y:C},se.createElement(HT,{x:-e.bleed,y:-e.bleed,width:e.computedWidth+2*e.bleed,height:e.computedHeight+2*e.bleed,background:e.background,name:"page-background",preventDefault:!1,scale:t.scale})),se.createElement(bn,{x:C,y:C,name:"elements-container",listening:!t.isPlaying},se.createElement(Tn,{name:"elements-area",width:e.computedWidth,height:e.computedHeight,listening:!1}),se.createElement(WT,{elements:e.children,store:t})),se.createElement(Tn,{stroke:h,name:"bleed",strokeWidth:e.bleed,x:e.bleed/2,y:e.bleed/2,width:e.computedWidth+e.bleed,height:e.computedHeight+e.bleed,listening:!1,visible:e.bleed>0&&t.bleedVisible,hideInExport:!0}),sT()===XT&&se.createElement(KT,{name:"hit-detection",x:-Be/2-Oe,y:-Be/2-Oe,width:I+Be+2*Oe,height:F+Be+2*Oe}))),se.createElement(ff,{name:"workspace-background",points:[0,0,r,0,r,n,0,n,0,0,j,O,j,n-O,r-j,n-O,r-j,O,j,O],listening:!1,closed:!0,fill:a}),se.createElement(bn,{x:j,y:O,scaleX:t.scale,scaleY:t.scale},se.createElement(Tn,{name:"page-highlight",hideInExport:!0,x:-Be/2-Oe,y:-Be/2-Oe,width:I+Be+2*Oe,height:F+Be+2*Oe,stroke:Ie?s:o,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),se.createElement(bn,{x:j+C*t.scale,y:O+C*t.scale,scaleX:t.scale,scaleY:t.scale,name:"page-abs-container"},se.createElement(pp,{ref:T,onDragStart:fe=>{var Le;!((Le=fe.evt)===null||Le===void 0)&&Le.altKey&&f&&t.selectedElements.forEach(Ne=>{const ue=Ne.clone({},{skipSelect:!0}),ke=e.children.indexOf(Ne);e.setElementZIndex(ue.id,ke)}),t.history.startTransaction()},onDragEnd:()=>{t.history.endTransaction()},onTransformStart:()=>{t.history.startTransaction(),ie(null)},boundBoxFunc:(fe,Le)=>{const Ne=Math.abs(Le.width)<1||Math.abs(Le.height)<1,ue=Math.abs(fe.width)<1||Math.abs(fe.height)<1;return Ne&&!ue?fe:Le},onTransform:fe=>{var Le,Ne;const ue=T.current.nodes(),ke=ue[ue.length-1];if(fe.target!==ke)return;const Pe=(Le=T.current)===null||Le===void 0?void 0:Le.__getNodeRect(),Ue=(Ne=T.current)===null||Ne===void 0?void 0:Ne.getActiveAnchor();te({anchor:Ue,x:Pe.x,y:Pe.y,rotation:Pe.rotation,width:Pe.width,height:Pe.height})},onTransformEnd:fe=>{te({}),t.history.endTransaction()},visible:!t.isPlaying}),ae&&ae.map(({points:fe,distance:Le,box1:Ne,box2:ue},ke)=>se.createElement(bn,{name:"distances-container",hideInExport:!0,key:ke,listening:!1},se.createElement(Tn,Object.assign({},Ne,{stroke:S,strokeWidth:1,strokeScaleEnabled:!1})),se.createElement(Tn,Object.assign({},ue,{stroke:S,strokeWidth:1,strokeScaleEnabled:!1})),se.createElement(ff,{points:[fe[0].x,fe[0].y,fe[1].x,fe[1].y],stroke:S,strokeWidth:1,strokeScaleEnabled:!1}),se.createElement(ff,{points:[fe[1].x,fe[1].y,fe[2].x,fe[2].y],stroke:S,strokeWidth:1,strokeScaleEnabled:!1}),se.createElement(h0,{x:(fe[0].x+fe[1].x)/2,y:(fe[0].y+fe[1].y)/2,offsetY:-10,scaleX:1/t.scale,scaleY:1/t.scale},se.createElement(d0,{cornerRadius:5,fill:A,pointerDirection:"down"}),se.createElement(Du,{align:"center",verticalAlign:"middle",fill:M,padding:5,text:vT({unit:t.unit,dpi:t.dpi,px:Le})})))),e._rendering&&se.createElement(bn,null,se.createElement(Tn,{width:I,height:F,fill:"rgba(255,255,255,0.9)"}),se.createElement(Du,{text:"Rendering...",fontSize:60,width:I,height:F,align:"center",verticalAlign:"middle"})),ge&&se.createElement(ge,{components:u,store:t,page:e,stageRef:$}),Re&&se.createElement(p0,null,se.createElement(Re,Object.assign({components:u,store:t},V.props)))),se.createElement(GT,Object.assign({},Z,{store:t,tagFill:E,textFill:k})),se.createElement($T,{selection:K,fill:g,stroke:p,strokeWidth:y}),lT()&&se.createElement(Du,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:r-170,y:n-18,onMouseEnter:fe=>{fe.target.getStage().container().style.cursor="pointer"},onMouseLeave:fe=>{fe.target.getStage().container().style.cursor=""},onTouchStart:fe=>{fe.cancelBubble=!0},onMouseDown:fe=>{fe.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),se.createElement(bn,{name:"line-guides"}))),J&&Ee&&se.createElement(Ee,{store:t,page:e,xPadding:j,yPadding:O}))}),QT=_d("div",se.forwardRef)`
403
+ position: absolute;
404
+ top: 0;
405
+ left: 0;
406
+ pointer-events: none;
407
+ `,JT=_d("div",se.forwardRef)`
408
+ height: 14px;
409
+ position: sticky;
410
+ font-size: 8px;
411
+ line-height: 14px;
412
+ top: 0;
413
+ left: 0;
414
+ color: grey;
415
+ border-bottom: 1px solid grey;
416
+ background-color: #e8e8e8;
417
+ overflow: hidden;
418
+ `,eR=_d("div",se.forwardRef)`
419
+ left: 0;
420
+ width: 14px;
421
+ position: sticky;
422
+ font-size: 8px;
423
+ line-height: 14px;
424
+ color: grey;
425
+ border-right: 1px solid grey;
426
+ background-color: #e8e8e8;
427
+ overflow: hidden;
428
+ `,tR=_d("div",se.forwardRef)`
429
+ position: absolute;
430
+ border-left: 1px solid grey;
431
+ padding-left: 2px;
432
+ `,rR=_d("div",se.forwardRef)`
433
+ position: absolute;
434
+ left: 14px;
435
+ border-left: 1px solid grey;
436
+ padding-left: 2px;
437
+ transform: rotate(90deg);
438
+ transform-origin: left top;
439
+ overflow: hidden;
440
+ `,nR=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],iR=ni(({store:t,width:e,height:r})=>{const n=se.useRef(null);if(!t.activePage)return null;const i=t.activePage,a=(t.bleedVisible&&i.bleed,i.computedWidth*t.scale),o=i.computedHeight*t.scale,s=(e-a)/2,u=(h=y=>y4({unitVal:y,dpi:t.dpi,unit:t.unit})*t.scale,nR.find(y=>h(y)>30)||1e4);var h;const f=y4({unitVal:u,dpi:t.dpi,unit:t.unit})*t.scale,v=Math.round(a/f)+1,g=Math.round(o/f)+1,p=X0(t.selectedShapes);return se.createElement(QT,{ref:n,className:"polotno-rulers"},se.createElement(JT,{style:{width:e+"px"},className:"polotno-x-ruler"},[...Array(v)].map((y,_)=>se.createElement(tR,{key:_,style:{left:s+_*f+"px",width:f+"px"}},t.unit==="px"||u>=1?Math.round(u*_):(u*_).toFixed(1))),!!t.selectedShapes.length&&se.createElement("div",{style:{position:"absolute",left:s+p.x*t.scale+"px",height:"14px",width:p.width*t.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),t.pages.map((y,_)=>{var x;const b=y.computedHeight*t.scale,E=(r-b)/2;return se.createElement(eR,{key:y.id,style:{height:r+"px"},className:"polotno-y-ruler"},[...Array(g)].map((k,S)=>se.createElement(rR,{key:S,style:{top:E+S*f-14+"px",width:f+"px"}},t.unit==="px"||u>=1?Math.round(u*S):(u*S).toFixed(1))),((x=t.selectedShapes[0])===null||x===void 0?void 0:x.page)===y&&se.createElement("div",{style:{position:"absolute",top:E+p.y*t.scale-14+"px",width:"14px",height:p.height*t.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),aR=ni(({audio:t,store:e})=>{const[r,n]=function(i){const[a,o]=se.useState(null),[s,u]=se.useState("loading");return se.useEffect(()=>{const h=new Audio(i),f=()=>{u("loaded"),o(h)},v=()=>{u("failed"),o(null)};return h.addEventListener("canplay",f),h.addEventListener("error",v),()=>{h.removeEventListener("canplay",f),h.removeEventListener("error",v)}},[i]),[a,s]}(t.src);return se.useEffect(()=>{r&&e.history.ignore(()=>{t.set({duration:1e3*r.duration})})},[r,t,e.history]),se.useEffect(()=>{if(!r)return;const i=()=>{r.currentTime=t.startTime*t.duration/1e3},a=()=>{const s=t.endTime*t.duration/1e3;r.currentTime>=s&&(r.pause(),r.currentTime=t.startTime*t.duration/1e3)};r.addEventListener("ended",i),r.addEventListener("timeupdate",a);const o=Bu(()=>{const s=e.animatedElementsIds;if(s.length&&!s.includes(t.id))return;const u=e.currentTime-t.delay,h=t.duration*(t.endTime-t.startTime),f=u>=0&&u<h;if(!e.isPlaying||e.animatedElementsIds.length!==0||!f)return void r.pause();r.volume=t.volume,r.paused&&r.play();const v=u%h/1e3+t.startTime*t.duration/1e3,g=r.currentTime;Math.abs(g-v)>.5&&v!==g&&(r.currentTime=v)});return()=>{r.pause(),r.removeEventListener("ended",i),r.removeEventListener("timeupdate",a),o()}},[e.isPlaying,t.startTime,t.endTime,t.volume,r]),null});let g_={data:[],pageId:""};const b0="polotno_clipboard",vy=(t,e)=>{g_={data:JSON.parse(JSON.stringify(t)),pageId:e};try{localStorage.setItem(b0,JSON.stringify(t)),localStorage.setItem(b0+"_page",e)}catch{}},oR=()=>{try{const t=localStorage.getItem(b0),e=localStorage.getItem(b0+"_page");if(t)return{data:JSON.parse(t),pageId:e}}catch{}return g_},sR=t=>{var e;t.selectedElements.length!==0&&vy(t.selectedElements.map(r=>r.toJSON()),(e=t.activePage)===null||e===void 0?void 0:e.id)},lR=t=>{var e;vy(t.selectedElements.map(n=>n.toJSON()),(e=t.activePage)===null||e===void 0?void 0:e.id);let r=t.selectedElements.filter(n=>n.removable).map(n=>n.id);t.deleteElements(r)},uR=t=>{t.history.transaction(()=>{var e,r;let n=0,i=0;const{data:a,pageId:o}=oR();if(o===((e=t.activePage)===null||e===void 0?void 0:e.id))n=t.width/20,i=t.height/20;else{const u=[];Mi({children:a},f=>{f.type!=="group"&&u.push(f)});const h=X0(u);h.maxX>t.width&&(n=-h.minX),h.maxY>t.height&&(i=-h.minY)}const s=[];Mi({children:a},u=>{delete u.id,u.type!=="group"&&(u.x+=n,u.y+=i)}),a.forEach(u=>{var h;const f=(h=t.activePage)===null||h===void 0?void 0:h.addElement(u);f&&s.push(f.id)}),vy(a,(r=t.activePage)===null||r===void 0?void 0:r.id),t.selectElements(s)})};function cR(t,e){var r,n,i,a;if(((r=document.activeElement)===null||r===void 0?void 0:r.tagName)==="INPUT"||((n=document.activeElement)===null||n===void 0?void 0:n.tagName)==="TEXTAREA"||((i=document.activeElement)===null||i===void 0?void 0:i.contentEditable)==="true")return;const o=document.querySelector(".polotno-workspace-container");if(document.activeElement!==o&&!o?.contains(document.activeElement)){const f=window.getSelection();if(f&&f.toString().length>0)return}const s=e.selectedElements.filter(f=>f.removable).map(f=>f.id);t.keyCode!==46&&t.keyCode!==8||e.deleteElements(s);const u=t.ctrlKey||t.metaKey,h=t.shiftKey;if(!u||h||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),e.history.undo()),u&&h&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),e.history.redo()),u&&t.code==="KeyA"){t.preventDefault();const f=(a=e.activePage)===null||a===void 0?void 0:a.children.filter(g=>g.selectable),v=f?.map(g=>g.id)||[];e.selectElements(v)}u&&t.code==="KeyC"&&(t.preventDefault(),sR(e)),u&&t.code==="KeyX"&&(t.preventDefault(),lR(e)),u&&t.code==="KeyV"&&(t.preventDefault(),uR(e)),t.code==="ArrowDown"&&(t.preventDefault(),e.selectedShapes.forEach(f=>{f.draggable&&f.set({y:f.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),e.selectedShapes.forEach(f=>{f.draggable&&f.set({y:f.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),e.selectedShapes.forEach(f=>{f.draggable&&f.set({x:f.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),e.selectedShapes.forEach(f=>{f.draggable&&f.set({x:f.x+1})}))}const wm=Kr({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",curvedText:"Curved text",curvePower:"Power",temperature:"Temperature",saturation:"Saturation",contrast:"Contrast",shadows:"Shadows",white:"White",black:"Black",vibrance:"Vibrance",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",uppercase:"Uppercase",position:"Position",layering:"Layering",toForward:"To Front",up:"Forward",down:"Backward",toBottom:"To back",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"}}),w0=t=>t&&typeof t=="object";function v_(t,e){Object.keys(e).forEach(r=>{const n=t[r],i=e[r];w0(i)&&w0(n)?v_(n,i):t[r]=i})}function m_(t,e,r=""){Object.keys(e).forEach(n=>{const i=e[n],a=r?`${r}.${n}`:n;w0(i)?w0(t[n])?m_(t[n],i,a):console.warn(`Missing nested translation object at '${a}'`):t[n]===void 0&&console.warn(`Missing translation '${a}'`)})}Zr((t,{validate:e=!1}={})=>{e&&m_(t,wm),v_(wm,t)});const O4={},C4=t=>{const e=function(i,a){var o,s=a.split("."),u=i;for(o=0;o<s.length;++o){if(u[s[o]]==null)return;u=u[s[o]]}return u}(wm,t);if(e!==void 0)return e;O4[t]||(O4[t]=!0,console.warn(`Missing translation '${t}'`));const r=t.split("."),n=r[r.length-1]||" ";return n.charAt(0).toUpperCase()+n.slice(1)},fR=({store:t})=>se.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},se.createElement("p",null,C4("workspace.noPages")),se.createElement("button",{onClick:()=>{t.addPage()}},C4("workspace.addPage"))),hR=({width:t,height:e,xPadding:r,yPadding:n,backgroundColor:i})=>se.createElement("div",{style:{width:t+"px",height:e+"px",backgroundColor:i,paddingLeft:r+"px",paddingRight:r+"px",paddingTop:n+"px",paddingBottom:n+"px"}},se.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),dR=[4,6],pR=ni(({store:t,pageControlsEnabled:e,backgroundColor:r,pageBorderColor:n,activePageBorderColor:i,bleedColor:a,snapGuideStroke:o,snapGuideStrokeWidth:s,snapGuideDash:u,selectionRectFill:h,selectionRectStroke:f,selectionRectStrokeWidth:v,transformLabelFill:g,transformLabelTextFill:p,distanceGuideStroke:y,distanceLabelFill:_,distanceLabelTextFill:x,components:b,onKeyDown:E,paddingX:k,paddingY:S,altCloneEnabled:A=!0,visiblePagesOffset:M,renderOnlyActivePage:C})=>{var I;const F=k??20,j=S??55,[O,T]=se.useState({width:100,height:100}),$=se.useRef(O),q=se.useRef(null),J=se.useRef(null),ae=t.bleedVisible?Math.max(0,...t.pages.map(Ee=>Ee.bleed)):0,ie=Math.max(...t.pages.map(Ee=>Ee.computedWidth)),Z=Math.max(...t.pages.map(Ee=>Ee.computedHeight)),te=((I=t.activePage)===null||I===void 0?void 0:I.computedHeight)||0,V=ie+2*ae,B=(C?te:Z)+2*ae,D=async({skipTimeout:Ee}={skipTimeout:!1})=>{if(Ee||await new Promise(ue=>setTimeout(ue,50)),q.current===null)return;const ge=q.current.getBoundingClientRect();ge.width!==0&&ge.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
441
+ Width or height of parent elements is equal 0.
442
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
443
+ For simpler debugging here is the log of the parent element:`),console.log(q.current));const Re=J.current.clientWidth||ge.width,Be={width:Re,height:ge.height};($.current.width!==Be.width||$.current.height!==Be.height)&&(T(Be),$.current=Be);const Oe=(Re-2*F)/V,fe=t.pages.length>1?3.1:2,Le=(ge.height-j*fe)/B,Ne=t.pages.length?Math.max(Math.min(Oe,Le),.01):1;t.scaleToFit!==Ne&&(t.setScale(Ne),t._setScaleToFit(Ne))};se.useLayoutEffect(()=>{D({skipTimeout:!0})},[]),se.useEffect(()=>{D()},[V,B,S,k]),se.useLayoutEffect(()=>{D({skipTimeout:!0})},[t.openedSidePanel]),se.useEffect(()=>{t.__()},[]),se.useEffect(()=>{const Ee=q.current;if(window.ResizeObserver){const ge=new ResizeObserver(()=>{D({skipTimeout:!0})});return ge.observe(Ee),()=>ge.unobserve(Ee)}{const ge=setInterval(()=>{D({skipTimeout:!0})},100);return()=>clearInterval(ge)}},[V,B]);const U=Math.max(F,(O.width-V*t.scale)/2),X=C?1:t.pages.length,ee=B*t.scale*X,K=Math.max(j,(O.height-ee)/X/2);se.useEffect(()=>{const Ee=ge=>{(E||cR)(ge,t)};return window.addEventListener("keydown",Ee),()=>window.removeEventListener("keydown",Ee)},[]),se.useEffect(()=>{var Ee;const ge=Re=>{if(Re.ctrlKey||Re.metaKey){Re.preventDefault();const Le=Math.max(5,t.scaleToFit),Ne=Math.min(.1,t.scaleToFit),ue=.03,ke=(Be=Re.deltaY<0?t.scale*(1+ue):t.scale/(1+ue),Oe=Ne,fe=Le,Math.max(Oe,Math.min(fe,Be)));return void t.setScale(ke)}var Be,Oe,fe};return(Ee=J.current)===null||Ee===void 0||Ee.addEventListener("wheel",ge),()=>{var Re;return(Re=J.current)===null||Re===void 0?void 0:Re.removeEventListener("wheel",ge)}},[]);const oe=se.useRef(!1);((Ee,ge,Re,Be,Oe,fe)=>{const Le=se.useRef({width:ge,height:Re}),Ne=se.useRef({top:0,left:0}),ue=se.useRef(!1),ke=se.useRef(Oe.pages.length);ue.current=ke.current!==Oe.pages.length,ke.current=Oe.pages.length,se.useEffect(()=>{const Pe=Ee.current,Ue=st=>{Ne.current={top:Pe.scrollTop,left:Pe.scrollLeft}};return Pe.addEventListener("scroll",Ue),()=>{Pe.removeEventListener("scroll",Ue)}},[]),se.useLayoutEffect(()=>{if(!Ee.current||ue.current)return;const Pe=Ee.current,Ue=(Ne.current.left+Pe.offsetWidth/2)/Le.current.width,st=(Ne.current.top+Pe.offsetHeight/2)/Le.current.height;fe.current=!0,Pe.scrollLeft=Ue*ge-Pe.offsetWidth/2,Pe.scrollTop=st*Re-Pe.offsetHeight/2,Le.current={width:ge,height:Re}},[Be,ge,Re])})(J,V*t.scale+2*U,B*t.scale+2*K,t.scale,t,oe);const{handleScroll:me}=((Ee,ge,Re,Be,Oe,fe)=>{const Le=se.useRef(!1),Ne=se.useRef(null),ue=se.useRef(!1);se.useEffect(()=>{const Pe=Ee.current,Ue=()=>{Oe.current};return Pe.addEventListener("scroll",Ue),()=>{Pe.removeEventListener("scroll",Ue)}},[]);const ke=Re.pages.indexOf(Re.activePage);return se.useLayoutEffect(()=>{if(fe||!Re.activePage||!Ee.current||Le.current)return;const Pe=Ee.current,Ue=Re.pages.indexOf(Re.activePage)*ge;let st=()=>{};return(Math.abs(Ue-Pe.scrollTop)>.5*ge||ue.current)&&(ue.current=!0,st=(({element:dt,scrollTop:pt=0,duration:xt=300,onFinish:bt=()=>{}})=>{const At=dt.scrollTop,Br=pt-At;let _r=0,It=!1;if(xt===0)return dt.scrollTop=pt,()=>{};const Jt=()=>{if(It)return;_r+=20;const qe=Ve(_r,At,Br,xt);dt.scrollTop=qe,_r<xt?setTimeout(Jt,20):bt()},Ve=(qe,Nt,Ct,ir)=>(qe/=ir/2)<1?Ct/2*qe*qe+Nt:-Ct/2*(--qe*(qe-2)-1)+Nt;return Jt(),()=>{It=!0}})({element:Pe,scrollTop:Ue,onFinish:()=>{ue.current=!1},duration:Re.isPlaying?0:300})),st},[Re.activePage,ke,Re.isPlaying,fe]),{handleScroll:Pe=>{if(fe||ue.current)return;Le.current=!0,clearTimeout(Ne.current),Ne.current=setTimeout(()=>{Le.current=!1},300);const Ue=Pe.currentTarget.childNodes[0].offsetHeight,st=Pe.currentTarget.scrollTop,dt=Math.floor((st+Be.height/3)/Ue),pt=Re.pages[dt];pt&&Re.activePage!==pt&&pt.select()}}})(J,B*t.scale+2*K,t,O,oe,C),de=O.width>=V*t.scale+2*U,ye=r||"rgba(232, 232, 232, 0.9)",Te=t.pages.indexOf(t.activePage),Ce=b?.NoPages||fR,Ie=M??Math.min(3,Math.max(1,Math.ceil(O.height/2/(B*t.scale))));return se.createElement("div",{ref:q,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ye,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},se.createElement("div",{ref:J,onScroll:me,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:de?"hidden":"auto"},className:"polotno-workspace-inner"},t.pages.map((Ee,ge)=>{const Re=Ee===t.activePage;if(C&&!Re&&!Ee._exportingOrRendering&&!Ee._forceMount)return null;if(!(Math.abs(ge-Te)<=Ie||Ee._exportingOrRendering||Ee._forceMount))return se.createElement(hR,{key:Ee.id,width:V*t.scale+2*U,height:B*t.scale+2*K,backgroundColor:ye,xPadding:U,yPadding:K});const Be=se.createElement(ZT,{key:Ee.id,page:Ee,xPadding:U,yPadding:K,width:V*t.scale+2*U,height:B*t.scale+2*K,store:t,pageControlsEnabled:e,backColor:ye,pageBorderColor:n||"lightgrey",activePageBorderColor:i||"rgb(0, 161, 255)",altCloneEnabled:A,bleedColor:a||"rgba(255, 0, 0, 0.1)",selectionRectFill:h,selectionRectStroke:f,selectionRectStrokeWidth:v,snapGuideStroke:o||"rgb(0, 161, 255)",snapGuideStrokeWidth:s||1,snapGuideDash:u||dR,transformLabelFill:g,transformLabelTextFill:p,distanceGuideStroke:y||"rgb(0, 161, 255)",distanceLabelFill:_||"rgb(0, 161, 255)",distanceLabelTextFill:x||"white",components:b,viewportSize:O});return(Ee._exportingOrRendering||Ee._forceMount)&&!Re&&C?se.createElement("div",{style:{display:"none"},key:Ee.id},Be):Be}),t.rulesVisible&&se.createElement(iR,{store:t,xPadding:U,yPadding:K,width:V*t.scale+2*U,height:B*t.scale+2*K}),t.pages.length===0&&se.createElement(Ce,{store:t}),t.audios.map(Ee=>se.createElement(aR,{key:Ee.id,audio:Ee,store:t}))))}),gR="modulepreload",vR=function(t,e){return new URL(t,e).href},L4={},bv=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let h=function(f){return Promise.all(f.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),u=s?.nonce||s?.getAttribute("nonce");i=h(r.map(f=>{if(f=vR(f,n),f in L4)return;L4[f]=!0;const v=f.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(n)for(let y=o.length-1;y>=0;y--){const _=o[y];if(_.href===f&&(!v||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${g}`))return;const p=document.createElement("link");if(p.rel=v?"stylesheet":gR,v||(p.as="script"),p.crossOrigin="",p.href=f,u&&p.setAttribute("nonce",u),document.head.appendChild(p),v)return new Promise((y,_)=>{p.addEventListener("load",y),p.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return e().catch(a)})};function Nn(t){"@babel/helpers - typeof";return Nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nn(t)}var tu=Uint8Array,nl=Uint16Array,my=Int32Array,yy=new tu([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]),by=new tu([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]),N4=new tu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),y_=function(t,e){for(var r=new nl(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new my(r[30]),n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)i[a]=a-r[n]<<5|n;return{b:r,r:i}},b_=y_(yy,2),mR=b_.b,_m=b_.r;mR[28]=258,_m[258]=28;var yR=y_(by,0),T4=yR.r,xm=new nl(32768);for(var di=0;di<32768;++di){var rf=(di&43690)>>1|(di&21845)<<1;rf=(rf&52428)>>2|(rf&13107)<<2,rf=(rf&61680)>>4|(rf&3855)<<4,xm[di]=((rf&65280)>>8|(rf&255)<<8)>>1}var sp=function(t,e,r){for(var n=t.length,i=0,a=new nl(e);i<n;++i)t[i]&&++a[t[i]-1];var o=new nl(e);for(i=1;i<e;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(r){s=new nl(1<<e);var u=15-e;for(i=0;i<n;++i)if(t[i])for(var h=i<<4|t[i],f=e-t[i],v=o[t[i]-1]++<<f,g=v|(1<<f)-1;v<=g;++v)s[xm[v]>>u]=h}else for(s=new nl(n),i=0;i<n;++i)t[i]&&(s[i]=xm[o[t[i]-1]++]>>15-t[i]);return s},lh=new tu(288);for(var di=0;di<144;++di)lh[di]=8;for(var di=144;di<256;++di)lh[di]=9;for(var di=256;di<280;++di)lh[di]=7;for(var di=280;di<288;++di)lh[di]=8;var _0=new tu(32);for(var di=0;di<32;++di)_0[di]=5;var bR=sp(lh,9,0),wR=sp(_0,5,0),w_=function(t){return(t+7)/8|0},_R=function(t,e,r){return(r==null||r>t.length)&&(r=t.length),new tu(t.subarray(e,r))},sc=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},zd=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},wv=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,a=r.slice();if(!i)return{t:x_,l:0};if(i==1){var o=new tu(r[0].s+1);return o[r[0].s]=1,{t:o,l:1}}r.sort(function(A,M){return A.f-M.f}),r.push({s:-1,f:25001});var s=r[0],u=r[1],h=0,f=1,v=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};f!=i-1;)s=r[r[h].f<r[v].f?h++:v++],u=r[h!=f&&r[h].f<r[v].f?h++:v++],r[f++]={s:-1,f:s.f+u.f,l:s,r:u};for(var g=a[0].s,n=1;n<i;++n)a[n].s>g&&(g=a[n].s);var p=new nl(g+1),y=Sm(r[f-1],p,0);if(y>e){var n=0,_=0,x=y-e,b=1<<x;for(a.sort(function(M,C){return p[C.s]-p[M.s]||M.f-C.f});n<i;++n){var E=a[n].s;if(p[E]>e)_+=b-(1<<y-p[E]),p[E]=e;else break}for(_>>=x;_>0;){var k=a[n].s;p[k]<e?_-=1<<e-p[k]++-1:++n}for(;n>=0&&_;--n){var S=a[n].s;p[S]==e&&(--p[S],++_)}y=e}return{t:new tu(p),l:y}},Sm=function(t,e,r){return t.s==-1?Math.max(Sm(t.l,e,r+1),Sm(t.r,e,r+1)):e[t.s]=r},R4=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new nl(++e),n=0,i=t[0],a=1,o=function(u){r[n++]=u},s=1;s<=e;++s)if(t[s]==i&&s!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[s]}return{c:r.subarray(0,n),n:e}},qd=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},__=function(t,e,r){var n=r.length,i=w_(e+2);t[i]=n&255,t[i+1]=n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var a=0;a<n;++a)t[i+a+4]=r[a];return(i+4+n)*8},M4=function(t,e,r,n,i,a,o,s,u,h,f){sc(e,f++,r),++i[256];for(var v=wv(i,15),g=v.t,p=v.l,y=wv(a,15),_=y.t,x=y.l,b=R4(g),E=b.c,k=b.n,S=R4(_),A=S.c,M=S.n,C=new nl(19),I=0;I<E.length;++I)++C[E[I]&31];for(var I=0;I<A.length;++I)++C[A[I]&31];for(var F=wv(C,7),j=F.t,O=F.l,T=19;T>4&&!j[N4[T-1]];--T);var $=h+5<<3,q=qd(i,lh)+qd(a,_0)+o,J=qd(i,g)+qd(a,_)+o+14+3*T+qd(C,j)+2*C[16]+3*C[17]+7*C[18];if(u>=0&&$<=q&&$<=J)return __(e,f,t.subarray(u,u+h));var ae,ie,Z,te;if(sc(e,f,1+(J<q)),f+=2,J<q){ae=sp(g,p,0),ie=g,Z=sp(_,x,0),te=_;var V=sp(j,O,0);sc(e,f,k-257),sc(e,f+5,M-1),sc(e,f+10,T-4),f+=14;for(var I=0;I<T;++I)sc(e,f+3*I,j[N4[I]]);f+=3*T;for(var B=[E,A],D=0;D<2;++D)for(var U=B[D],I=0;I<U.length;++I){var X=U[I]&31;sc(e,f,V[X]),f+=j[X],X>15&&(sc(e,f,U[I]>>5&127),f+=U[I]>>12)}}else ae=bR,ie=lh,Z=wR,te=_0;for(var I=0;I<s;++I){var ee=n[I];if(ee>255){var X=ee>>18&31;zd(e,f,ae[X+257]),f+=ie[X+257],X>7&&(sc(e,f,ee>>23&31),f+=yy[X]);var K=ee&31;zd(e,f,Z[K]),f+=te[K],K>3&&(zd(e,f,ee>>5&8191),f+=by[K])}else zd(e,f,ae[ee]),f+=ie[ee]}return zd(e,f,ae[256]),f+ie[256]},xR=new my([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),x_=new tu(0),SR=function(t,e,r,n,i,a){var o=a.z||t.length,s=new tu(n+o+5*(1+Math.ceil(o/7e3))+i),u=s.subarray(n,s.length-i),h=a.l,f=(a.r||0)&7;if(e){f&&(u[0]=a.r>>3);for(var v=xR[e-1],g=v>>13,p=v&8191,y=(1<<r)-1,_=a.p||new nl(32768),x=a.h||new nl(y+1),b=Math.ceil(r/3),E=2*b,k=function(Ee){return(t[Ee]^t[Ee+1]<<b^t[Ee+2]<<E)&y},S=new my(25e3),A=new nl(288),M=new nl(32),C=0,I=0,F=a.i||0,j=0,O=a.w||0,T=0;F+2<o;++F){var $=k(F),q=F&32767,J=x[$];if(_[q]=J,x[$]=q,O<=F){var ae=o-F;if((C>7e3||j>24576)&&(ae>423||!h)){f=M4(t,u,0,S,A,M,I,j,T,F-T,f),j=C=I=0,T=F;for(var ie=0;ie<286;++ie)A[ie]=0;for(var ie=0;ie<30;++ie)M[ie]=0}var Z=2,te=0,V=p,B=q-J&32767;if(ae>2&&$==k(F-B))for(var D=Math.min(g,ae)-1,U=Math.min(32767,F),X=Math.min(258,ae);B<=U&&--V&&q!=J;){if(t[F+Z]==t[F+Z-B]){for(var ee=0;ee<X&&t[F+ee]==t[F+ee-B];++ee);if(ee>Z){if(Z=ee,te=B,ee>D)break;for(var K=Math.min(B,ee-2),oe=0,ie=0;ie<K;++ie){var me=F-B+ie&32767,de=_[me],ye=me-de&32767;ye>oe&&(oe=ye,J=me)}}}q=J,J=_[q],B+=q-J&32767}if(te){S[j++]=268435456|_m[Z]<<18|T4[te];var Te=_m[Z]&31,Ce=T4[te]&31;I+=yy[Te]+by[Ce],++A[257+Te],++M[Ce],O=F+Z,++C}else S[j++]=t[F],++A[t[F]]}}for(F=Math.max(F,O);F<o;++F)S[j++]=t[F],++A[t[F]];f=M4(t,u,h,S,A,M,I,j,T,F-T,f),h||(a.r=f&7|u[f/8|0]<<3,f-=7,a.h=x,a.p=_,a.i=F,a.w=O)}else{for(var F=a.w||0;F<o+h;F+=65535){var Ie=F+65535;Ie>=o&&(u[f/8|0]=h,Ie=o),f=__(u,f+1,t.subarray(F,Ie))}a.i=o}return _R(s,0,n+w_(f)+i)},S_=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,a=r.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=n+=r[o];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}t=n,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},ER=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new tu(a.length+t.length);o.set(a),o.set(t,a.length),t=o,i.w=a.length}return SR(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,i)},E_=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},AR=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;if(t[0]=120,t[1]=n<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=S_();i.p(e.dictionary),E_(t,2,i.d())}};function Em(t,e){e||(e={});var r=S_();r.p(t);var n=ER(t,e,e.dictionary?6:2,4);return AR(n,e),E_(n,n.length-4,r.d()),n}var kR=typeof TextDecoder<"u"&&new TextDecoder,PR=0;try{kR.decode(x_,{stream:!0}),PR=1}catch{}function OR(t){if(Array.isArray(t))return t}function CR(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,h=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(f){h=!0,i=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(h)throw i}}return s}}function I4(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function LR(t,e){if(t){if(typeof t=="string")return I4(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I4(t,e):void 0}}function NR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
444
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j4(t,e){return OR(t)||CR(t,e)||LR(t,e)||NR()}function D4(t,e="utf8"){return new TextDecoder(e).decode(t)}const TR=new TextEncoder;function RR(t){return TR.encode(t)}const MR=1024*8,IR=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),_v={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class wy{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=MR,r={}){let n=!1;typeof e=="number"?e=new ArrayBuffer(e):(n=!0,this.lastWrittenByte=e.byteLength);const i=r.offset?r.offset>>>0:0,a=e.byteLength-i;let o=i;(ArrayBuffer.isView(e)||e instanceof wy)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+i),e=e.buffer),n?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const n=(this.offset+e)*2,i=new Uint8Array(n);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,r){const n=_v[r].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+n);if(this.littleEndian===IR&&r!=="uint8"&&r!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+n));s.reverse();const u=new _v[r](s.buffer);return this.offset+=n,u.reverse(),u}const o=new _v[r](a);return this.offset+=n,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let r="";for(let n=0;n<e;n++)r+=this.readChar();return r}readUtf8(e=1){return D4(this.readBytes(e))}decodeText(e=1,r="utf8"){return D4(this.readBytes(e),r)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let r=0;r<e.length;r++)this._data.setUint8(this.offset++,e[r]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let r=0;r<e.length;r++)this.writeUint8(e.charCodeAt(r));return this}writeUtf8(e){return this.writeBytes(RR(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function xd(t){let e=t.length;for(;--e>=0;)t[e]=0}const jR=3,DR=258,A_=29,FR=256,BR=FR+1+A_,k_=30,zR=512,qR=new Array((BR+2)*2);xd(qR);const UR=new Array(k_*2);xd(UR);const HR=new Array(zR);xd(HR);const $R=new Array(DR-jR+1);xd($R);const GR=new Array(A_);xd(GR);const WR=new Array(k_);xd(WR);const VR=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var Am=VR;const YR=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},XR=new Uint32Array(YR()),KR=(t,e,r,n)=>{const i=XR,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var Ou=KR,km={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},P_={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const ZR=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var QR=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)ZR(r,n)&&(t[n]=r[n])}}return t},JR=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;const r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},O_={assign:QR,flattenChunks:JR};let C_=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{C_=!1}const _p=new Uint8Array(256);for(let t=0;t<256;t++)_p[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;_p[254]=_p[254]=1;var eM=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e};const tM=(t,e)=>{if(e<65534&&t.subarray&&C_)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r};var rM=(t,e)=>{const r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i;const a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=_p[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return tM(a,i)},nM=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+_p[t[r]]>e?r:e},Pm={string2buf:eM,buf2string:rM,utf8border:nM};function iM(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var aM=iM;const L1=16209,oM=16191;var sM=function(e,r){let n,i,a,o,s,u,h,f,v,g,p,y,_,x,b,E,k,S,A,M,C,I,F,j;const O=e.state;n=e.next_in,F=e.input,i=n+(e.avail_in-5),a=e.next_out,j=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=O.dmax,h=O.wsize,f=O.whave,v=O.wnext,g=O.window,p=O.hold,y=O.bits,_=O.lencode,x=O.distcode,b=(1<<O.lenbits)-1,E=(1<<O.distbits)-1;e:do{y<15&&(p+=F[n++]<<y,y+=8,p+=F[n++]<<y,y+=8),k=_[p&b];t:for(;;){if(S=k>>>24,p>>>=S,y-=S,S=k>>>16&255,S===0)j[a++]=k&65535;else if(S&16){A=k&65535,S&=15,S&&(y<S&&(p+=F[n++]<<y,y+=8),A+=p&(1<<S)-1,p>>>=S,y-=S),y<15&&(p+=F[n++]<<y,y+=8,p+=F[n++]<<y,y+=8),k=x[p&E];r:for(;;){if(S=k>>>24,p>>>=S,y-=S,S=k>>>16&255,S&16){if(M=k&65535,S&=15,y<S&&(p+=F[n++]<<y,y+=8,y<S&&(p+=F[n++]<<y,y+=8)),M+=p&(1<<S)-1,M>u){e.msg="invalid distance too far back",O.mode=L1;break e}if(p>>>=S,y-=S,S=a-o,M>S){if(S=M-S,S>f&&O.sane){e.msg="invalid distance too far back",O.mode=L1;break e}if(C=0,I=g,v===0){if(C+=h-S,S<A){A-=S;do j[a++]=g[C++];while(--S);C=a-M,I=j}}else if(v<S){if(C+=h+v-S,S-=v,S<A){A-=S;do j[a++]=g[C++];while(--S);if(C=0,v<A){S=v,A-=S;do j[a++]=g[C++];while(--S);C=a-M,I=j}}}else if(C+=v-S,S<A){A-=S;do j[a++]=g[C++];while(--S);C=a-M,I=j}for(;A>2;)j[a++]=I[C++],j[a++]=I[C++],j[a++]=I[C++],A-=3;A&&(j[a++]=I[C++],A>1&&(j[a++]=I[C++]))}else{C=a-M;do j[a++]=j[C++],j[a++]=j[C++],j[a++]=j[C++],A-=3;while(A>2);A&&(j[a++]=j[C++],A>1&&(j[a++]=j[C++]))}}else if((S&64)===0){k=x[(k&65535)+(p&(1<<S)-1)];continue r}else{e.msg="invalid distance code",O.mode=L1;break e}break}}else if((S&64)===0){k=_[(k&65535)+(p&(1<<S)-1)];continue t}else if(S&32){O.mode=oM;break e}else{e.msg="invalid literal/length code",O.mode=L1;break e}break}}while(n<i&&a<s);A=y>>3,n-=A,y-=A<<3,p&=(1<<y)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),O.hold=p,O.bits=y};const $h=15,F4=852,B4=592,z4=0,xv=1,q4=2,lM=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),uM=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),cM=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),fM=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),hM=(t,e,r,n,i,a,o,s)=>{const u=s.bits;let h=0,f=0,v=0,g=0,p=0,y=0,_=0,x=0,b=0,E=0,k,S,A,M,C,I=null,F;const j=new Uint16Array($h+1),O=new Uint16Array($h+1);let T=null,$,q,J;for(h=0;h<=$h;h++)j[h]=0;for(f=0;f<n;f++)j[e[r+f]]++;for(p=u,g=$h;g>=1&&j[g]===0;g--);if(p>g&&(p=g),g===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(v=1;v<g&&j[v]===0;v++);for(p<v&&(p=v),x=1,h=1;h<=$h;h++)if(x<<=1,x-=j[h],x<0)return-1;if(x>0&&(t===z4||g!==1))return-1;for(O[1]=0,h=1;h<$h;h++)O[h+1]=O[h]+j[h];for(f=0;f<n;f++)e[r+f]!==0&&(o[O[e[r+f]]++]=f);if(t===z4?(I=T=o,F=20):t===xv?(I=lM,T=uM,F=257):(I=cM,T=fM,F=0),E=0,f=0,h=v,C=a,y=p,_=0,A=-1,b=1<<p,M=b-1,t===xv&&b>F4||t===q4&&b>B4)return 1;for(;;){$=h-_,o[f]+1<F?(q=0,J=o[f]):o[f]>=F?(q=T[o[f]-F],J=I[o[f]-F]):(q=96,J=0),k=1<<h-_,S=1<<y,v=S;do S-=k,i[C+(E>>_)+S]=$<<24|q<<16|J|0;while(S!==0);for(k=1<<h-1;E&k;)k>>=1;if(k!==0?(E&=k-1,E+=k):E=0,f++,--j[h]===0){if(h===g)break;h=e[r+o[f]]}if(h>p&&(E&M)!==A){for(_===0&&(_=p),C+=v,y=h-_,x=1<<y;y+_<g&&(x-=j[y+_],!(x<=0));)y++,x<<=1;if(b+=1<<y,t===xv&&b>F4||t===q4&&b>B4)return 1;A=E&M,i[A]=p<<24|y<<16|C-a|0}}return E!==0&&(i[C+E]=h-_<<24|64<<16|0),s.bits=p,0};var lp=hM;const dM=0,L_=1,N_=2,{Z_FINISH:U4,Z_BLOCK:pM,Z_TREES:N1,Z_OK:uh,Z_STREAM_END:gM,Z_NEED_DICT:vM,Z_STREAM_ERROR:Cl,Z_DATA_ERROR:T_,Z_MEM_ERROR:R_,Z_BUF_ERROR:mM,Z_DEFLATED:H4}=P_,Q0=16180,$4=16181,G4=16182,W4=16183,V4=16184,Y4=16185,X4=16186,K4=16187,Z4=16188,Q4=16189,x0=16190,lc=16191,Sv=16192,J4=16193,Ev=16194,ew=16195,tw=16196,rw=16197,nw=16198,T1=16199,R1=16200,iw=16201,aw=16202,ow=16203,sw=16204,lw=16205,Av=16206,uw=16207,cw=16208,xi=16209,M_=16210,I_=16211,yM=852,bM=592,wM=15,_M=wM,fw=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function xM(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _h=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Q0||e.mode>I_?1:0},j_=t=>{if(_h(t))return Cl;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Q0,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(yM),e.distcode=e.distdyn=new Int32Array(bM),e.sane=1,e.back=-1,uh},D_=t=>{if(_h(t))return Cl;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,j_(t)},F_=(t,e)=>{let r;if(_h(t))return Cl;const n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Cl:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,D_(t))},B_=(t,e)=>{if(!t)return Cl;const r=new xM;t.state=r,r.strm=t,r.window=null,r.mode=Q0;const n=F_(t,e);return n!==uh&&(t.state=null),n},SM=t=>B_(t,_M);let hw=!0,kv,Pv;const EM=t=>{if(hw){kv=new Int32Array(512),Pv=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(lp(L_,t.lens,0,288,kv,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;lp(N_,t.lens,0,32,Pv,0,t.work,{bits:5}),hw=!1}t.lencode=kv,t.lenbits=9,t.distcode=Pv,t.distbits=5},z_=(t,e,r,n)=>{let i;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},AM=(t,e)=>{let r,n,i,a,o,s,u,h,f,v,g,p,y,_,x=0,b,E,k,S,A,M,C,I;const F=new Uint8Array(4);let j,O;const T=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_h(t)||!t.output||!t.input&&t.avail_in!==0)return Cl;r=t.state,r.mode===lc&&(r.mode=Sv),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,h=r.hold,f=r.bits,v=s,g=u,I=uh;e:for(;;)switch(r.mode){case Q0:if(r.wrap===0){r.mode=Sv;break}for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.wrap&2&&h===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=h&255,F[1]=h>>>8&255,r.check=Ou(r.check,F,2,0),h=0,f=0,r.mode=$4;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",r.mode=xi;break}if((h&15)!==H4){t.msg="unknown compression method",r.mode=xi;break}if(h>>>=4,f-=4,C=(h&15)+8,r.wbits===0&&(r.wbits=C),C>15||C>r.wbits){t.msg="invalid window size",r.mode=xi;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=h&512?Q4:lc,h=0,f=0;break;case $4:for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.flags=h,(r.flags&255)!==H4){t.msg="unknown compression method",r.mode=xi;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=xi;break}r.head&&(r.head.text=h>>8&1),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,r.check=Ou(r.check,F,2,0)),h=0,f=0,r.mode=G4;case G4:for(;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.head&&(r.head.time=h),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,F[2]=h>>>16&255,F[3]=h>>>24&255,r.check=Ou(r.check,F,4,0)),h=0,f=0,r.mode=W4;case W4:for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.head&&(r.head.xflags=h&255,r.head.os=h>>8),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,r.check=Ou(r.check,F,2,0)),h=0,f=0,r.mode=V4;case V4:if(r.flags&1024){for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.length=h,r.head&&(r.head.extra_len=h),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,r.check=Ou(r.check,F,2,0)),h=0,f=0}else r.head&&(r.head.extra=null);r.mode=Y4;case Y4:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+p),C)),r.flags&512&&r.wrap&4&&(r.check=Ou(r.check,n,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=X4;case X4:if(r.flags&2048){if(s===0)break e;p=0;do C=n[a+p++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C));while(C&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ou(r.check,n,p,a)),s-=p,a+=p,C)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=K4;case K4:if(r.flags&4096){if(s===0)break e;p=0;do C=n[a+p++],r.head&&C&&r.length<65536&&(r.head.comment+=String.fromCharCode(C));while(C&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Ou(r.check,n,p,a)),s-=p,a+=p,C)break e}else r.head&&(r.head.comment=null);r.mode=Z4;case Z4:if(r.flags&512){for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.wrap&4&&h!==(r.check&65535)){t.msg="header crc mismatch",r.mode=xi;break}h=0,f=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=lc;break;case Q4:for(;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}t.adler=r.check=fw(h),h=0,f=0,r.mode=x0;case x0:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=h,r.bits=f,vM;t.adler=r.check=1,r.mode=lc;case lc:if(e===pM||e===N1)break e;case Sv:if(r.last){h>>>=f&7,f-=f&7,r.mode=Av;break}for(;f<3;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}switch(r.last=h&1,h>>>=1,f-=1,h&3){case 0:r.mode=J4;break;case 1:if(EM(r),r.mode=T1,e===N1){h>>>=2,f-=2;break e}break;case 2:r.mode=tw;break;case 3:t.msg="invalid block type",r.mode=xi}h>>>=2,f-=2;break;case J4:for(h>>>=f&7,f-=f&7;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",r.mode=xi;break}if(r.length=h&65535,h=0,f=0,r.mode=Ev,e===N1)break e;case Ev:r.mode=ew;case ew:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(n.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=lc;break;case tw:for(;f<14;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.nlen=(h&31)+257,h>>>=5,f-=5,r.ndist=(h&31)+1,h>>>=5,f-=5,r.ncode=(h&15)+4,h>>>=4,f-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=xi;break}r.have=0,r.mode=rw;case rw:for(;r.have<r.ncode;){for(;f<3;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.lens[T[r.have++]]=h&7,h>>>=3,f-=3}for(;r.have<19;)r.lens[T[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},I=lp(dM,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,I){t.msg="invalid code lengths set",r.mode=xi;break}r.have=0,r.mode=nw;case nw:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[h&(1<<r.lenbits)-1],b=x>>>24,E=x>>>16&255,k=x&65535,!(b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(k<16)h>>>=b,f-=b,r.lens[r.have++]=k;else{if(k===16){for(O=b+2;f<O;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(h>>>=b,f-=b,r.have===0){t.msg="invalid bit length repeat",r.mode=xi;break}C=r.lens[r.have-1],p=3+(h&3),h>>>=2,f-=2}else if(k===17){for(O=b+3;f<O;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=b,f-=b,C=0,p=3+(h&7),h>>>=3,f-=3}else{for(O=b+7;f<O;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=b,f-=b,C=0,p=11+(h&127),h>>>=7,f-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=xi;break}for(;p--;)r.lens[r.have++]=C}}if(r.mode===xi)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=xi;break}if(r.lenbits=9,j={bits:r.lenbits},I=lp(L_,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,I){t.msg="invalid literal/lengths set",r.mode=xi;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},I=lp(N_,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,I){t.msg="invalid distances set",r.mode=xi;break}if(r.mode=T1,e===N1)break e;case T1:r.mode=R1;case R1:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=h,r.bits=f,sM(t,g),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,h=r.hold,f=r.bits,r.mode===lc&&(r.back=-1);break}for(r.back=0;x=r.lencode[h&(1<<r.lenbits)-1],b=x>>>24,E=x>>>16&255,k=x&65535,!(b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(E&&(E&240)===0){for(S=b,A=E,M=k;x=r.lencode[M+((h&(1<<S+A)-1)>>S)],b=x>>>24,E=x>>>16&255,k=x&65535,!(S+b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=S,f-=S,r.back+=S}if(h>>>=b,f-=b,r.back+=b,r.length=k,E===0){r.mode=lw;break}if(E&32){r.back=-1,r.mode=lc;break}if(E&64){t.msg="invalid literal/length code",r.mode=xi;break}r.extra=E&15,r.mode=iw;case iw:if(r.extra){for(O=r.extra;f<O;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=aw;case aw:for(;x=r.distcode[h&(1<<r.distbits)-1],b=x>>>24,E=x>>>16&255,k=x&65535,!(b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if((E&240)===0){for(S=b,A=E,M=k;x=r.distcode[M+((h&(1<<S+A)-1)>>S)],b=x>>>24,E=x>>>16&255,k=x&65535,!(S+b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=S,f-=S,r.back+=S}if(h>>>=b,f-=b,r.back+=b,E&64){t.msg="invalid distance code",r.mode=xi;break}r.offset=k,r.extra=E&15,r.mode=ow;case ow:if(r.extra){for(O=r.extra;f<O;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=xi;break}r.mode=sw;case sw:if(u===0)break e;if(p=g-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=xi;break}p>r.wnext?(p-=r.wnext,y=r.wsize-p):y=r.wnext-p,p>r.length&&(p=r.length),_=r.window}else _=i,y=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do i[o++]=_[y++];while(--p);r.length===0&&(r.mode=R1);break;case lw:if(u===0)break e;i[o++]=r.length,u--,r.mode=R1;break;case Av:if(r.wrap){for(;f<32;){if(s===0)break e;s--,h|=n[a++]<<f,f+=8}if(g-=u,t.total_out+=g,r.total+=g,r.wrap&4&&g&&(t.adler=r.check=r.flags?Ou(r.check,i,g,o-g):Am(r.check,i,g,o-g)),g=u,r.wrap&4&&(r.flags?h:fw(h))!==r.check){t.msg="incorrect data check",r.mode=xi;break}h=0,f=0}r.mode=uw;case uw:if(r.wrap&&r.flags){for(;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.wrap&4&&h!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=xi;break}h=0,f=0}r.mode=cw;case cw:I=gM;break e;case xi:I=T_;break e;case M_:return R_;case I_:default:return Cl}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=h,r.bits=f,(r.wsize||g!==t.avail_out&&r.mode<xi&&(r.mode<Av||e!==U4))&&z_(t,t.output,t.next_out,g-t.avail_out),v-=t.avail_in,g-=t.avail_out,t.total_in+=v,t.total_out+=g,r.total+=g,r.wrap&4&&g&&(t.adler=r.check=r.flags?Ou(r.check,i,g,t.next_out-g):Am(r.check,i,g,t.next_out-g)),t.data_type=r.bits+(r.last?64:0)+(r.mode===lc?128:0)+(r.mode===T1||r.mode===Ev?256:0),(v===0&&g===0||e===U4)&&I===uh&&(I=mM),I},kM=t=>{if(_h(t))return Cl;let e=t.state;return e.window&&(e.window=null),t.state=null,uh},PM=(t,e)=>{if(_h(t))return Cl;const r=t.state;return(r.wrap&2)===0?Cl:(r.head=e,e.done=!1,uh)},OM=(t,e)=>{const r=e.length;let n,i,a;return _h(t)||(n=t.state,n.wrap!==0&&n.mode!==x0)?Cl:n.mode===x0&&(i=1,i=Am(i,e,r,0),i!==n.check)?T_:(a=z_(t,e,r,r),a?(n.mode=M_,R_):(n.havedict=1,uh))};var CM=D_,LM=F_,NM=j_,TM=SM,RM=B_,MM=AM,IM=kM,jM=PM,DM=OM,FM="pako inflate (from Nodeca project)",cc={inflateReset:CM,inflateReset2:LM,inflateResetKeep:NM,inflateInit:TM,inflateInit2:RM,inflate:MM,inflateEnd:IM,inflateGetHeader:jM,inflateSetDictionary:DM,inflateInfo:FM};function BM(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var zM=BM;const q_=Object.prototype.toString,{Z_NO_FLUSH:qM,Z_FINISH:UM,Z_OK:xp,Z_STREAM_END:Ov,Z_NEED_DICT:Cv,Z_STREAM_ERROR:HM,Z_DATA_ERROR:dw,Z_MEM_ERROR:$M}=P_;function jp(t){this.options=O_.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new aM,this.strm.avail_out=0;let r=cc.inflateInit2(this.strm,e.windowBits);if(r!==xp)throw new Error(km[r]);if(this.header=new zM,cc.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Pm.string2buf(e.dictionary):q_.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cc.inflateSetDictionary(this.strm,e.dictionary),r!==xp)))throw new Error(km[r])}jp.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?UM:qM,q_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=cc.inflate(r,o),a===Cv&&i&&(a=cc.inflateSetDictionary(r,i),a===xp?a=cc.inflate(r,o):a===dw&&(a=Cv));r.avail_in>0&&a===Ov&&r.state.wrap>0&&t[r.next_in]!==0;)cc.inflateReset(r),a=cc.inflate(r,o);switch(a){case HM:case dw:case Cv:case $M:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Ov))if(this.options.to==="string"){let u=Pm.utf8border(r.output,r.next_out),h=r.next_out-u,f=Pm.buf2string(r.output,u);r.next_out=h,r.avail_out=n-h,h&&r.output.set(r.output.subarray(u,u+h),0),this.onData(f)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===xp&&s===0)){if(a===Ov)return a=cc.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};jp.prototype.onData=function(t){this.chunks.push(t)};jp.prototype.onEnd=function(t){t===xp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=O_.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function GM(t,e){const r=new jp(e);if(r.push(t),r.err)throw r.msg||km[r.err];return r.result}var WM=jp,VM=GM,YM={Inflate:WM,inflate:VM};const{Inflate:XM,inflate:KM}=YM;var pw=XM,ZM=KM;const U_=[];for(let t=0;t<256;t++){let e=t;for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e=e>>>1;U_[t]=e}const gw=4294967295;function QM(t,e,r){let n=t;for(let i=0;i<r;i++)n=U_[(n^e[i])&255]^n>>>8;return n}function JM(t,e){return(QM(gw,t,e)^gw)>>>0}function vw(t,e,r){const n=t.readUint32(),i=JM(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(i!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${i}`)}function H_(t,e,r){for(let n=0;n<r;n++)e[n]=t[n]}function $_(t,e,r,n){let i=0;for(;i<n;i++)e[i]=t[i];for(;i<r;i++)e[i]=t[i]+e[i-n]&255}function G_(t,e,r,n){let i=0;if(r.length===0)for(;i<n;i++)e[i]=t[i];else for(;i<n;i++)e[i]=t[i]+r[i]&255}function W_(t,e,r,n,i){let a=0;if(r.length===0){for(;a<i;a++)e[a]=t[a];for(;a<n;a++)e[a]=t[a]+(e[a-i]>>1)&255}else{for(;a<i;a++)e[a]=t[a]+(r[a]>>1)&255;for(;a<n;a++)e[a]=t[a]+(e[a-i]+r[a]>>1)&255}}function V_(t,e,r,n,i){let a=0;if(r.length===0){for(;a<i;a++)e[a]=t[a];for(;a<n;a++)e[a]=t[a]+e[a-i]&255}else{for(;a<i;a++)e[a]=t[a]+r[a]&255;for(;a<n;a++)e[a]=t[a]+eI(e[a-i],r[a],r[a-i])&255}}function eI(t,e,r){const n=t+e-r,i=Math.abs(n-t),a=Math.abs(n-e),o=Math.abs(n-r);return i<=a&&i<=o?t:a<=o?e:r}function tI(t,e,r,n,i,a){switch(t){case 0:H_(e,r,i);break;case 1:$_(e,r,i,a);break;case 2:G_(e,r,n,i);break;case 3:W_(e,r,n,i,a);break;case 4:V_(e,r,n,i,a);break;default:throw new Error(`Unsupported filter: ${t}`)}}const rI=new Uint16Array([255]),nI=new Uint8Array(rI.buffer),iI=nI[0]===255;function aI(t){const{data:e,width:r,height:n,channels:i,depth:a}=t,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(a/8)*i,u=new Uint8Array(n*r*s);let h=0;for(let f=0;f<7;f++){const v=o[f],g=Math.ceil((r-v.x)/v.xStep),p=Math.ceil((n-v.y)/v.yStep);if(g<=0||p<=0)continue;const y=g*s,_=new Uint8Array(y);for(let x=0;x<p;x++){const b=e[h++],E=e.subarray(h,h+y);h+=y;const k=new Uint8Array(y);tI(b,E,k,_,y,s),_.set(k);for(let S=0;S<g;S++){const A=v.x+S*v.xStep,M=v.y+x*v.yStep;if(!(A>=r||M>=n))for(let C=0;C<s;C++)u[(M*r+A)*s+C]=k[S*s+C]}}}if(a===16){const f=new Uint16Array(u.buffer);if(iI)for(let v=0;v<f.length;v++)f[v]=oI(f[v]);return f}else return u}function oI(t){return(t&255)<<8|t>>8&255}const sI=new Uint16Array([255]),lI=new Uint8Array(sI.buffer),uI=lI[0]===255,cI=new Uint8Array(0);function mw(t){const{data:e,width:r,height:n,channels:i,depth:a}=t,o=Math.ceil(a/8)*i,s=Math.ceil(a/8*i*r),u=new Uint8Array(n*s);let h=cI,f=0,v,g;for(let p=0;p<n;p++){switch(v=e.subarray(f+1,f+1+s),g=u.subarray(p*s,(p+1)*s),e[f]){case 0:H_(v,g,s);break;case 1:$_(v,g,s,o);break;case 2:G_(v,g,h,s);break;case 3:W_(v,g,h,s,o);break;case 4:V_(v,g,h,s,o);break;default:throw new Error(`Unsupported filter: ${e[f]}`)}h=g,f+=s+1}if(a===16){const p=new Uint16Array(u.buffer);if(uI)for(let y=0;y<p.length;y++)p[y]=fI(p[y]);return p}else return u}function fI(t){return(t&255)<<8|t>>8&255}const X1=Uint8Array.of(137,80,78,71,13,10,26,10);function yw(t){if(!hI(t.readBytes(X1.length)))throw new Error("wrong PNG signature")}function hI(t){if(t.length<X1.length)return!1;for(let e=0;e<X1.length;e++)if(t[e]!==X1[e])return!1;return!0}const dI="tEXt",pI=0,Y_=new TextDecoder("latin1");function gI(t){if(mI(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const vI=/^[\u0000-\u00FF]*$/;function mI(t){if(!vI.test(t))throw new Error("invalid latin1 text")}function yI(t,e,r){const n=X_(e);t[n]=bI(e,r-n.length-1)}function X_(t){for(t.mark();t.readByte()!==pI;);const e=t.offset;t.reset();const r=Y_.decode(t.readBytes(e-t.offset-1));return t.skip(1),gI(r),r}function bI(t,e){return Y_.decode(t.readBytes(e))}const Ks={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Lv={UNKNOWN:-1,DEFLATE:0},bw={UNKNOWN:-1,ADAPTIVE:0},Nv={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},M1={NONE:0,BACKGROUND:1,PREVIOUS:2},Tv={SOURCE:0,OVER:1};class wI extends wy{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,r={}){super(e);const{checkCrc:n=!1}=r;this._checkCrc=n,this._inflator=new pw,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Lv.UNKNOWN,this._filterMethod=bw.UNKNOWN,this._interlaceMethod=Nv.UNKNOWN,this._colorType=Ks.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(yw(this);!this._end;){const e=this.readUint32(),r=this.readChars(4);this.decodeChunk(e,r)}return this.decodeImage(),this._png}decodeApng(){for(yw(this);!this._end;){const e=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(e,r)}return this.decodeApngImage(),this._apng}decodeChunk(e,r){const n=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case dI:yI(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e);break}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?vw(this,e+4,r):this.skip(4)}decodeApngChunk(e,r){const n=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,r),this.offset=n+e;break}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?vw(this,e+4,r):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=_I(this.readUint8());const r=this.readUint8();this._colorType=r;let n;switch(r){case Ks.GREYSCALE:n=1;break;case Ks.TRUECOLOUR:n=3;break;case Ks.INDEXED_COLOUR:n=1;break;case Ks.GREYSCALE_ALPHA:n=2;break;case Ks.TRUECOLOUR_ALPHA:n=4;break;case Ks.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==Lv.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const r=e/3;this._hasPalette=!0;const n=[];this._palette=n;for(let i=0;i<r;i++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const r=e,n=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,n,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let r=e,n=this.offset+this.byteOffset;if(n+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,n,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case Ks.GREYSCALE:case Ks.TRUECOLOUR:{if(e%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let r=0;r<e/2;r++)this._transparency[r]=this.readUint16();break}case Ks.INDEXED_COLOUR:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let r=0;for(;r<e;r++){const n=this.readByte();this._palette[r].push(n)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case Ks.UNKNOWN:case Ks.GREYSCALE_ALPHA:case Ks.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const r=X_(this),n=this.readUint8();if(n!==Lv.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${n}`);const i=this.readBytes(e-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:ZM(i)}}decodepHYs(){const e=this.readUint32(),r=this.readUint32(),n=this.readByte();this._png.resolution={x:e,y:r,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const r={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(e);if(n){if(n.data=mw({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),e===0||n.xOffset===0&&n.yOffset===0&&n.width===this._png.width&&n.height===this._png.height)r.data=n.data;else{const i=this._apng.frames.at(e-1);this.disposeFrame(n,i,r),this.addFrameDataToCanvas(r,n)}this._apng.frames.push(r)}}return this._apng}disposeFrame(e,r,n){switch(e.disposeOp){case M1.NONE:break;case M1.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let a=0;a<this._png.width;a++){const o=(i*e.width+a)*this._png.channels;for(let s=0;s<this._png.channels;s++)n.data[o+s]=0}break;case M1.PREVIOUS:n.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,r){const n=1<<this._png.depth,i=(a,o)=>{const s=((a+r.yOffset)*this._png.width+r.xOffset+o)*this._png.channels,u=(a*r.width+o)*this._png.channels;return{index:s,frameIndex:u}};switch(r.blendOp){case Tv.SOURCE:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++)e.data[s+h]=r.data[u+h]}break;case Tv.OVER:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++){const f=r.data[u+this._png.channels-1]/n,v=h%(this._png.channels-1)===0?1:r.data[u+h],g=Math.floor(f*v+(1-f)*e.data[s+h]);e.data[s+h]+=g}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==bw.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Nv.NO_INTERLACE)this._png.data=mw({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===Nv.ADAM7)this._png.data=aI({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,r=this._frames.at(-1);r?r.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:M1.NONE,blendOp:Tv.SOURCE,data:e}),this._inflator=new pw,this._writingDataChunks=!1}}function _I(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var ww;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(ww||(ww={}));function xI(t,e){return new wI(t,e).decode()}var yr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function Rv(){yr.console&&typeof yr.console.log=="function"&&yr.console.log.apply(yr.console,arguments)}var Yn={log:Rv,warn:function(t){yr.console&&(typeof yr.console.warn=="function"?yr.console.warn.apply(yr.console,arguments):Rv.call(null,arguments))},error:function(t){yr.console&&(typeof yr.console.error=="function"?yr.console.error.apply(yr.console,arguments):Rv(t))}};function Mv(t,e,r){var n=new XMLHttpRequest;n.open("GET",t),n.responseType="blob",n.onload=function(){Yf(n.response,e,r)},n.onerror=function(){Yn.error("could not download file")},n.send()}function _w(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function I1(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var Yf=yr.saveAs||((typeof window>"u"?"undefined":Nn(window))!=="object"||window!==yr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,r){var n=yr.URL||yr.webkitURL,i=document.createElement("a");e=e||t.name||"download",i.download=e,i.rel="noopener",typeof t=="string"?(i.href=t,i.origin!==location.origin?_w(i.href)?Mv(t,e,r):I1(i,i.target="_blank"):I1(i)):(i.href=n.createObjectURL(t),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){I1(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,r){if(e=e||t.name||"download",typeof t=="string")if(_w(t))Mv(t,e,r);else{var n=document.createElement("a");n.href=t,n.target="_blank",setTimeout(function(){I1(n)})}else navigator.msSaveOrOpenBlob(function(i,a){return a===void 0?a={autoBom:!1}:Nn(a)!=="object"&&(Yn.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(t,r),e)}:function(t,e,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof t=="string")return Mv(t,e,r);var i=t.type==="application/octet-stream",a=/constructor/i.test(yr.HTMLElement)||yr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>"u"?"undefined":Nn(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var f=s.result;f=o?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=f:location=f,n=null},s.readAsDataURL(t)}else{var u=yr.URL||yr.webkitURL,h=u.createObjectURL(t);n?n.location=h:location.href=h,n=null,setTimeout(function(){u.revokeObjectURL(h)},4e4)}});/**
445
+ * A class to parse color values
446
+ * @author Stoyan Stefanov <sstoo@gmail.com>
447
+ * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
448
+ * @license Use it if you like it
449
+ */function K_(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={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"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var r=[{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<r.length;n++){var i=r[n].re,a=r[n].process,o=i.exec(t);o&&(e=a(o),this.r=e[0],this.g=e[1],this.b=e[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),u=this.g.toString(16),h=this.b.toString(16);return s.length==1&&(s="0"+s),u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),"#"+s+u+h}}var K1=yr.atob.bind(yr),xw=yr.btoa.bind(yr);/**
450
+ * @license
451
+ * Joseph Myers does not specify a particular license for his work.
452
+ *
453
+ * Author: Joseph Myers
454
+ * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
455
+ *
456
+ * Modified by: Owen Leong
457
+ */function Iv(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];r=Fo(r,n,i,a,e[0],7,-680876936),a=Fo(a,r,n,i,e[1],12,-389564586),i=Fo(i,a,r,n,e[2],17,606105819),n=Fo(n,i,a,r,e[3],22,-1044525330),r=Fo(r,n,i,a,e[4],7,-176418897),a=Fo(a,r,n,i,e[5],12,1200080426),i=Fo(i,a,r,n,e[6],17,-1473231341),n=Fo(n,i,a,r,e[7],22,-45705983),r=Fo(r,n,i,a,e[8],7,1770035416),a=Fo(a,r,n,i,e[9],12,-1958414417),i=Fo(i,a,r,n,e[10],17,-42063),n=Fo(n,i,a,r,e[11],22,-1990404162),r=Fo(r,n,i,a,e[12],7,1804603682),a=Fo(a,r,n,i,e[13],12,-40341101),i=Fo(i,a,r,n,e[14],17,-1502002290),r=Bo(r,n=Fo(n,i,a,r,e[15],22,1236535329),i,a,e[1],5,-165796510),a=Bo(a,r,n,i,e[6],9,-1069501632),i=Bo(i,a,r,n,e[11],14,643717713),n=Bo(n,i,a,r,e[0],20,-373897302),r=Bo(r,n,i,a,e[5],5,-701558691),a=Bo(a,r,n,i,e[10],9,38016083),i=Bo(i,a,r,n,e[15],14,-660478335),n=Bo(n,i,a,r,e[4],20,-405537848),r=Bo(r,n,i,a,e[9],5,568446438),a=Bo(a,r,n,i,e[14],9,-1019803690),i=Bo(i,a,r,n,e[3],14,-187363961),n=Bo(n,i,a,r,e[8],20,1163531501),r=Bo(r,n,i,a,e[13],5,-1444681467),a=Bo(a,r,n,i,e[2],9,-51403784),i=Bo(i,a,r,n,e[7],14,1735328473),r=zo(r,n=Bo(n,i,a,r,e[12],20,-1926607734),i,a,e[5],4,-378558),a=zo(a,r,n,i,e[8],11,-2022574463),i=zo(i,a,r,n,e[11],16,1839030562),n=zo(n,i,a,r,e[14],23,-35309556),r=zo(r,n,i,a,e[1],4,-1530992060),a=zo(a,r,n,i,e[4],11,1272893353),i=zo(i,a,r,n,e[7],16,-155497632),n=zo(n,i,a,r,e[10],23,-1094730640),r=zo(r,n,i,a,e[13],4,681279174),a=zo(a,r,n,i,e[0],11,-358537222),i=zo(i,a,r,n,e[3],16,-722521979),n=zo(n,i,a,r,e[6],23,76029189),r=zo(r,n,i,a,e[9],4,-640364487),a=zo(a,r,n,i,e[12],11,-421815835),i=zo(i,a,r,n,e[15],16,530742520),r=qo(r,n=zo(n,i,a,r,e[2],23,-995338651),i,a,e[0],6,-198630844),a=qo(a,r,n,i,e[7],10,1126891415),i=qo(i,a,r,n,e[14],15,-1416354905),n=qo(n,i,a,r,e[5],21,-57434055),r=qo(r,n,i,a,e[12],6,1700485571),a=qo(a,r,n,i,e[3],10,-1894986606),i=qo(i,a,r,n,e[10],15,-1051523),n=qo(n,i,a,r,e[1],21,-2054922799),r=qo(r,n,i,a,e[8],6,1873313359),a=qo(a,r,n,i,e[15],10,-30611744),i=qo(i,a,r,n,e[6],15,-1560198380),n=qo(n,i,a,r,e[13],21,1309151649),r=qo(r,n,i,a,e[4],6,-145523070),a=qo(a,r,n,i,e[11],10,-1120210379),i=qo(i,a,r,n,e[2],15,718787259),n=qo(n,i,a,r,e[9],21,-343485551),t[0]=df(r,t[0]),t[1]=df(n,t[1]),t[2]=df(i,t[2]),t[3]=df(a,t[3])}function J0(t,e,r,n,i,a){return e=df(df(e,t),df(n,a)),df(e<<i|e>>>32-i,r)}function Fo(t,e,r,n,i,a,o){return J0(e&r|~e&n,t,e,i,a,o)}function Bo(t,e,r,n,i,a,o){return J0(e&n|r&~n,t,e,i,a,o)}function zo(t,e,r,n,i,a,o){return J0(e^r^n,t,e,i,a,o)}function qo(t,e,r,n,i,a,o){return J0(r^(e|~n),t,e,i,a,o)}function Z_(t){var e,r=t.length,n=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)Iv(n,SI(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(Iv(n,i),e=0;e<16;e++)i[e]=0;return i[14]=8*r,Iv(n,i),n}function SI(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}var Sw="0123456789abcdef".split("");function EI(t){for(var e="",r=0;r<4;r++)e+=Sw[t>>8*r+4&15]+Sw[t>>8*r&15];return e}function AI(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function Om(t){return Z_(t).map(AI).join("")}var kI=function(t){for(var e=0;e<t.length;e++)t[e]=EI(t[e]);return t.join("")}(Z_("hello"))!="5d41402abc4b2a76b9719d911017c592";function df(t,e){if(kI){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}return t+e&4294967295}/**
458
+ * @license
459
+ * FPDF is released under a permissive license: there is no usage restriction.
460
+ * You may embed it freely in your application (commercial or not), with or
461
+ * without modifications.
462
+ *
463
+ * Reference: http://www.fpdf.org/en/script/script37.php
464
+ */function Cm(t,e){var r,n,i,a;if(t!==r){for(var o=(i=t,a=1+(256/t.length|0),new Array(a+1).join(i)),s=[],u=0;u<256;u++)s[u]=u;var h=0;for(u=0;u<256;u++){var f=s[u];h=(h+f+o.charCodeAt(u))%256,s[u]=s[h],s[h]=f}r=t,n=s}else s=n;var v=e.length,g=0,p=0,y="";for(u=0;u<v;u++)p=(p+(f=s[g=(g+1)%256]))%256,s[g]=s[p],s[p]=f,o=s[(s[g]+s[p])%256],y+=String.fromCharCode(e.charCodeAt(u)^o);return y}/**
465
+ * @license
466
+ * Licensed under the MIT License.
467
+ * http://opensource.org/licenses/mit-license
468
+ * Author: Owen Leong (@owenl131)
469
+ * Date: 15 Oct 2020
470
+ * References:
471
+ * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
472
+ * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
473
+ * http://www.fpdf.org/en/script/script37.php
474
+ */var Ew={print:4,modify:8,copy:16,"annot-forms":32};function Xh(t,e,r,n){this.v=1,this.r=2;var i=192;t.forEach(function(s){if(Ew.perm!==void 0)throw new Error("Invalid permission: "+s);i+=Ew[s]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var a=(e+this.padding).substr(0,32),o=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=Om(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=Cm(this.encryptionKey,this.padding)}function Kh(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",r=t.length,n=0;n<r;n++){var i=t.charCodeAt(n);e+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):t[n]}return e}function Aw(t){if(Nn(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(r,n,i){if(i=i||!1,typeof r!="string"||typeof n!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(r)||(e[r]={});var a=Math.random().toString(35);return e[r][a]=[n,!!i],a},this.unsubscribe=function(r){for(var n in e)if(e[n][r])return delete e[n][r],Object.keys(e[n]).length===0&&delete e[n],!0;return!1},this.publish=function(r){if(e.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var a in e[r]){var o=e[r][a];try{o[0].apply(t,n)}catch(s){yr.console&&Yn.error("jsPDF PubSub Error",s.message,s)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function S0(t){if(!(this instanceof S0))return new S0(t);var e="opacity,stroke-opacity".split(",");for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)>=0&&(this[r]=t[r]);this.id="",this.objectNumber=-1}function Q_(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function Xf(t,e,r,n,i){if(!(this instanceof Xf))return new Xf(t,e,r,n,i);this.type=t==="axial"?2:3,this.coords=e,this.colors=r,Q_.call(this,n,i)}function rd(t,e,r,n,i){if(!(this instanceof rd))return new rd(t,e,r,n,i);this.boundingBox=t,this.xStep=e,this.yStep=r,this.stream="",this.cloneIndex=0,Q_.call(this,n,i)}function tr(t){var e,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],i=arguments[2],a=arguments[3],o=[],s=1,u=16,h="S",f=null;Nn(t=t||{})==="object"&&(r=t.orientation,n=t.unit||n,i=t.format||i,a=t.compress||t.compressPdf||a,(f=t.encryption||null)!==null&&(f.userPassword=f.userPassword||"",f.ownerPassword=f.ownerPassword||"",f.userPermissions=f.userPermissions||[]),s=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(u=t.floatPrecision),h=t.defaultPathOperation||"S"),o=t.filters||(a===!0?["FlateEncode"]:o),n=n||"mm",r=(""+(r||"P")).toLowerCase();var v=t.putOnlyUsedFonts||!1,g={},p={internal:{},__private__:{}};p.__private__.PubSub=Aw;var y="1.3",_=p.__private__.getPdfVersion=function(){return y};p.__private__.setPdfVersion=function(H){y=H};var x={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]};p.__private__.getPageFormats=function(){return x};var b=p.__private__.getPageFormat=function(H){return x[H]};i=i||"a4";var E="compat",k="advanced",S=E;function A(){this.saveGraphicsState(),ge(new Zt(bt,0,0,-bt,0,vi()*bt).toString()+" cm"),this.setFontSize(this.getFontSize()/bt),h="n",S=k}function M(){this.restoreGraphicsState(),h="S",S=E}var C=p.__private__.combineFontStyleAndFontWeight=function(H,ce){if(H=="bold"&&ce=="normal"||H=="bold"&&ce==400||H=="normal"&&ce=="italic"||H=="bold"&&ce=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return ce&&(H=ce==400||ce==="normal"?H==="italic"?"italic":"normal":ce!=700&&ce!=="bold"||H!=="normal"?(ce==700?"bold":ce)+""+H:"bold"),H};p.advancedAPI=function(H){var ce=S===E;return ce&&A.call(this),typeof H!="function"||(H(this),ce&&M.call(this)),this},p.compatAPI=function(H){var ce=S===k;return ce&&M.call(this),typeof H!="function"||(H(this),ce&&A.call(this)),this},p.isAdvancedAPI=function(){return S===k};var I,F=function(H){if(S!==k)throw new Error(H+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},j=p.roundToPrecision=p.__private__.roundToPrecision=function(H,ce){var Ae=e||ce;if(isNaN(H)||isNaN(Ae))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return H.toFixed(Ae).replace(/0+$/,"")};I=p.hpf=p.__private__.hpf=typeof u=="number"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,u)}:u==="smart"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,H>-1&&H<1?16:5)}:function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,16)};var O=p.f2=p.__private__.f2=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f2");return j(H,2)},T=p.__private__.f3=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f3");return j(H,3)},$=p.scale=p.__private__.scale=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.scale");return S===E?H*bt:S===k?H:void 0},q=function(H){return $(function(ce){return S===E?vi()-ce:S===k?ce:void 0}(H))};p.__private__.setPrecision=p.setPrecision=function(H){typeof parseInt(H,10)=="number"&&(e=parseInt(H,10))};var J,ae="00000000000000000000000000000000",ie=p.__private__.getFileId=function(){return ae},Z=p.__private__.setFileId=function(H){return ae=H!==void 0&&/^[a-fA-F0-9]{32}$/.test(H)?H.toUpperCase():ae.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),f!==null&&(Zn=new Xh(f.userPermissions,f.userPassword,f.ownerPassword,ae)),ae};p.setFileId=function(H){return Z(H),this},p.getFileId=function(){return ie()};var te=p.__private__.convertDateToPDFDate=function(H){var ce=H.getTimezoneOffset(),Ae=ce<0?"+":"-",De=Math.floor(Math.abs(ce/60)),Ge=Math.abs(ce%60),at=[Ae,X(De),"'",X(Ge),"'"].join("");return["D:",H.getFullYear(),X(H.getMonth()+1),X(H.getDate()),X(H.getHours()),X(H.getMinutes()),X(H.getSeconds()),at].join("")},V=p.__private__.convertPDFDateToDate=function(H){var ce=parseInt(H.substr(2,4),10),Ae=parseInt(H.substr(6,2),10)-1,De=parseInt(H.substr(8,2),10),Ge=parseInt(H.substr(10,2),10),at=parseInt(H.substr(12,2),10),ct=parseInt(H.substr(14,2),10);return new Date(ce,Ae,De,Ge,at,ct,0)},B=p.__private__.setCreationDate=function(H){var ce;if(H===void 0&&(H=new Date),H instanceof Date)ce=te(H);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(H))throw new Error("Invalid argument passed to jsPDF.setCreationDate");ce=H}return J=ce},D=p.__private__.getCreationDate=function(H){var ce=J;return H==="jsDate"&&(ce=V(J)),ce};p.setCreationDate=function(H){return B(H),this},p.getCreationDate=function(H){return D(H)};var U,X=p.__private__.padd2=function(H){return("0"+parseInt(H)).slice(-2)},ee=p.__private__.padd2Hex=function(H){return("00"+(H=H.toString())).substr(H.length)},K=0,oe=[],me=[],de=0,ye=[],Te=[],Ce=!1,Ie=me;p.__private__.setCustomOutputDestination=function(H){Ce=!0,Ie=H};var Ee=function(H){Ce||(Ie=H)};p.__private__.resetCustomOutputDestination=function(){Ce=!1,Ie=me};var ge=p.__private__.out=function(H){return H=H.toString(),de+=H.length+1,Ie.push(H),Ie},Re=p.__private__.write=function(H){return ge(arguments.length===1?H.toString():Array.prototype.join.call(arguments," "))},Be=p.__private__.getArrayBuffer=function(H){for(var ce=H.length,Ae=new ArrayBuffer(ce),De=new Uint8Array(Ae);ce--;)De[ce]=H.charCodeAt(ce);return Ae},Oe=[["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]];p.__private__.getStandardFonts=function(){return Oe};var fe=t.fontSize||16;p.__private__.setFontSize=p.setFontSize=function(H){return fe=S===k?H/bt:H,this};var Le,Ne=p.__private__.getFontSize=p.getFontSize=function(){return S===E?fe:fe*bt},ue=t.R2L||!1;p.__private__.setR2L=p.setR2L=function(H){return ue=H,this},p.__private__.getR2L=p.getR2L=function(){return ue};var ke,Pe=p.__private__.setZoomMode=function(H){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(H))Le=H;else if(isNaN(H)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(H)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+H+'" is not recognized.');Le=H}else Le=parseInt(H,10)};p.__private__.getZoomMode=function(){return Le};var Ue,st=p.__private__.setPageMode=function(H){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(H)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+H+'" is not recognized.');ke=H};p.__private__.getPageMode=function(){return ke};var dt=p.__private__.setLayoutMode=function(H){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(H)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+H+'" is not recognized.');Ue=H};p.__private__.getLayoutMode=function(){return Ue},p.__private__.setDisplayMode=p.setDisplayMode=function(H,ce,Ae){return Pe(H),dt(ce),st(Ae),this};var pt={title:"",subject:"",author:"",keywords:"",creator:""};p.__private__.getDocumentProperty=function(H){if(Object.keys(pt).indexOf(H)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return pt[H]},p.__private__.getDocumentProperties=function(){return pt},p.__private__.setDocumentProperties=p.setProperties=p.setDocumentProperties=function(H){for(var ce in pt)pt.hasOwnProperty(ce)&&H[ce]&&(pt[ce]=H[ce]);return this},p.__private__.setDocumentProperty=function(H,ce){if(Object.keys(pt).indexOf(H)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return pt[H]=ce};var xt,bt,At,Br,_r,It={},Jt={},Ve=[],qe={},Nt={},Ct={},ir={},Ut=null,xr=0,er=[],pr=new Aw(p),Fi=t.hotfixes||[],oi={},Ei={},Sn=[],Zt=function H(ce,Ae,De,Ge,at,ct){if(!(this instanceof H))return new H(ce,Ae,De,Ge,at,ct);isNaN(ce)&&(ce=1),isNaN(Ae)&&(Ae=0),isNaN(De)&&(De=0),isNaN(Ge)&&(Ge=1),isNaN(at)&&(at=0),isNaN(ct)&&(ct=0),this._matrix=[ce,Ae,De,Ge,at,ct]};Object.defineProperty(Zt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Zt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Zt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Zt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Zt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Zt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Zt.prototype,"a",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Zt.prototype,"b",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Zt.prototype,"c",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Zt.prototype,"d",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Zt.prototype,"e",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Zt.prototype,"f",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Zt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Zt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Zt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Zt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Zt.prototype.join=function(H){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(I).join(H)},Zt.prototype.multiply=function(H){var ce=H.sx*this.sx+H.shy*this.shx,Ae=H.sx*this.shy+H.shy*this.sy,De=H.shx*this.sx+H.sy*this.shx,Ge=H.shx*this.shy+H.sy*this.sy,at=H.tx*this.sx+H.ty*this.shx+this.tx,ct=H.tx*this.shy+H.ty*this.sy+this.ty;return new Zt(ce,Ae,De,Ge,at,ct)},Zt.prototype.decompose=function(){var H=this.sx,ce=this.shy,Ae=this.shx,De=this.sy,Ge=this.tx,at=this.ty,ct=Math.sqrt(H*H+ce*ce),Dt=(H/=ct)*Ae+(ce/=ct)*De;Ae-=H*Dt,De-=ce*Dt;var jt=Math.sqrt(Ae*Ae+De*De);return Dt/=jt,H*(De/=jt)<ce*(Ae/=jt)&&(H=-H,ce=-ce,Dt=-Dt,ct=-ct),{scale:new Zt(ct,0,0,jt,0,0),translate:new Zt(1,0,0,1,Ge,at),rotate:new Zt(H,ce,-ce,H,0,0),skew:new Zt(1,0,Dt,1,0,0)}},Zt.prototype.toString=function(H){return this.join(" ")},Zt.prototype.inversed=function(){var H=this.sx,ce=this.shy,Ae=this.shx,De=this.sy,Ge=this.tx,at=this.ty,ct=1/(H*De-ce*Ae),Dt=De*ct,jt=-ce*ct,cr=-Ae*ct,fr=H*ct;return new Zt(Dt,jt,cr,fr,-Dt*Ge-cr*at,-jt*Ge-fr*at)},Zt.prototype.applyToPoint=function(H){var ce=H.x*this.sx+H.y*this.shx+this.tx,Ae=H.x*this.shy+H.y*this.sy+this.ty;return new Ao(ce,Ae)},Zt.prototype.applyToRectangle=function(H){var ce=this.applyToPoint(H),Ae=this.applyToPoint(new Ao(H.x+H.w,H.y+H.h));return new hl(ce.x,ce.y,Ae.x-ce.x,Ae.y-ce.y)},Zt.prototype.clone=function(){var H=this.sx,ce=this.shy,Ae=this.shx,De=this.sy,Ge=this.tx,at=this.ty;return new Zt(H,ce,Ae,De,Ge,at)},p.Matrix=Zt;var ca=p.matrixMult=function(H,ce){return ce.multiply(H)},Fa=new Zt(1,0,0,1,0,0);p.unitMatrix=p.identityMatrix=Fa;var Kn=function(H,ce){if(!Nt[H]){var Ae=(ce instanceof Xf?"Sh":"P")+(Object.keys(qe).length+1).toString(10);ce.id=Ae,Nt[H]=Ae,qe[Ae]=ce,pr.publish("addPattern",ce)}};p.ShadingPattern=Xf,p.TilingPattern=rd,p.addShadingPattern=function(H,ce){return F("addShadingPattern()"),Kn(H,ce),this},p.beginTilingPattern=function(H){F("beginTilingPattern()"),li(H.boundingBox[0],H.boundingBox[1],H.boundingBox[2]-H.boundingBox[0],H.boundingBox[3]-H.boundingBox[1],H.matrix)},p.endTilingPattern=function(H,ce){F("endTilingPattern()"),ce.stream=Te[U].join(`
475
+ `),Kn(H,ce),pr.publish("endTilingPattern",ce),Sn.pop().restore()};var Yi,zr=p.__private__.newObject=function(){var H=En();return Rn(H,!0),H},En=p.__private__.newObjectDeferred=function(){return K++,oe[K]=function(){return de},K},Rn=function(H,ce){return ce=typeof ce=="boolean"&&ce,oe[H]=de,ce&&ge(H+" 0 obj"),H},Sa=p.__private__.newAdditionalObject=function(){var H={objId:En(),content:""};return ye.push(H),H},Uo=En(),Ea=En(),eo=p.__private__.decodeColorString=function(H){var ce=H.split(" ");if(ce.length!==2||ce[1]!=="g"&&ce[1]!=="G")ce.length!==5||ce[4]!=="k"&&ce[4]!=="K"||(ce=[(1-ce[0])*(1-ce[3]),(1-ce[1])*(1-ce[3]),(1-ce[2])*(1-ce[3]),"r"]);else{var Ae=parseFloat(ce[0]);ce=[Ae,Ae,Ae,"r"]}for(var De="#",Ge=0;Ge<3;Ge++)De+=("0"+Math.floor(255*parseFloat(ce[Ge])).toString(16)).slice(-2);return De},si=p.__private__.encodeColorString=function(H){var ce;typeof H=="string"&&(H={ch1:H});var Ae=H.ch1,De=H.ch2,Ge=H.ch3,at=H.ch4,ct=H.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Ae=="string"&&Ae.charAt(0)!=="#"){var Dt=new K_(Ae);if(Dt.ok)Ae=Dt.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 jt=parseInt(Ae.substr(1),16);Ae=jt>>16&255,De=jt>>8&255,Ge=255&jt}if(De===void 0||at===void 0&&Ae===De&&De===Ge)ce=typeof Ae=="string"?Ae+" "+ct[0]:H.precision===2?O(Ae/255)+" "+ct[0]:T(Ae/255)+" "+ct[0];else if(at===void 0||Nn(at)==="object"){if(at&&!isNaN(at.a)&&at.a===0)return["1.","1.","1.",ct[1]].join(" ");ce=typeof Ae=="string"?[Ae,De,Ge,ct[1]].join(" "):H.precision===2?[O(Ae/255),O(De/255),O(Ge/255),ct[1]].join(" "):[T(Ae/255),T(De/255),T(Ge/255),ct[1]].join(" ")}else ce=typeof Ae=="string"?[Ae,De,Ge,at,ct[2]].join(" "):H.precision===2?[O(Ae),O(De),O(Ge),O(at),ct[2]].join(" "):[T(Ae),T(De),T(Ge),T(at),ct[2]].join(" ");return ce},Aa=p.__private__.getFilters=function(){return o},ka=p.__private__.putStream=function(H){var ce=(H=H||{}).data||"",Ae=H.filters||Aa(),De=H.alreadyAppliedFilters||[],Ge=H.addLength1||!1,at=ce.length,ct=H.objectId,Dt=function(mi){return mi};if(f!==null&&ct===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");f!==null&&(Dt=Zn.encryptor(ct,0));var jt={};Ae===!0&&(Ae=["FlateEncode"]);var cr=H.additionalKeyValues||[],fr=(jt=tr.API.processDataByFilters!==void 0?tr.API.processDataByFilters(ce,Ae):{data:ce,reverseChain:[]}).reverseChain+(Array.isArray(De)?De.join(" "):De.toString());if(jt.data.length!==0&&(cr.push({key:"Length",value:jt.data.length}),Ge===!0&&cr.push({key:"Length1",value:at})),fr.length!=0)if(fr.split("/").length-1==1)cr.push({key:"Filter",value:fr});else{cr.push({key:"Filter",value:"["+fr+"]"});for(var qr=0;qr<cr.length;qr+=1)if(cr[qr].key==="DecodeParms"){for(var kn=[],ui=0;ui<jt.reverseChain.split("/").length-1;ui+=1)kn.push("null");kn.push(cr[qr].value),cr[qr].value="["+kn.join(" ")+"]"}}ge("<<");for(var on=0;on<cr.length;on++)ge("/"+cr[on].key+" "+cr[on].value);ge(">>"),jt.data.length!==0&&(ge("stream"),ge(Dt(jt.data)),ge("endstream"))},Ho=p.__private__.putPage=function(H){var ce=H.number,Ae=H.data,De=H.objId,Ge=H.contentsObjId;Rn(De,!0),ge("<</Type /Page"),ge("/Parent "+H.rootDictionaryObjId+" 0 R"),ge("/Resources "+H.resourceDictionaryObjId+" 0 R"),ge("/MediaBox ["+parseFloat(I(H.mediaBox.bottomLeftX))+" "+parseFloat(I(H.mediaBox.bottomLeftY))+" "+I(H.mediaBox.topRightX)+" "+I(H.mediaBox.topRightY)+"]"),H.cropBox!==null&&ge("/CropBox ["+I(H.cropBox.bottomLeftX)+" "+I(H.cropBox.bottomLeftY)+" "+I(H.cropBox.topRightX)+" "+I(H.cropBox.topRightY)+"]"),H.bleedBox!==null&&ge("/BleedBox ["+I(H.bleedBox.bottomLeftX)+" "+I(H.bleedBox.bottomLeftY)+" "+I(H.bleedBox.topRightX)+" "+I(H.bleedBox.topRightY)+"]"),H.trimBox!==null&&ge("/TrimBox ["+I(H.trimBox.bottomLeftX)+" "+I(H.trimBox.bottomLeftY)+" "+I(H.trimBox.topRightX)+" "+I(H.trimBox.topRightY)+"]"),H.artBox!==null&&ge("/ArtBox ["+I(H.artBox.bottomLeftX)+" "+I(H.artBox.bottomLeftY)+" "+I(H.artBox.topRightX)+" "+I(H.artBox.topRightY)+"]"),typeof H.userUnit=="number"&&H.userUnit!==1&&ge("/UserUnit "+H.userUnit),pr.publish("putPage",{objId:De,pageContext:er[ce],pageNumber:ce,page:Ae}),ge("/Contents "+Ge+" 0 R"),ge(">>"),ge("endobj");var at=Ae.join(`
476
+ `);return S===k&&(at+=`
477
+ Q`),Rn(Ge,!0),ka({data:at,filters:Aa(),objectId:Ge}),ge("endobj"),De},Bi=p.__private__.putPages=function(){var H,ce,Ae=[];for(H=1;H<=xr;H++)er[H].objId=En(),er[H].contentsObjId=En();for(H=1;H<=xr;H++)Ae.push(Ho({number:H,data:Te[H],objId:er[H].objId,contentsObjId:er[H].contentsObjId,mediaBox:er[H].mediaBox,cropBox:er[H].cropBox,bleedBox:er[H].bleedBox,trimBox:er[H].trimBox,artBox:er[H].artBox,userUnit:er[H].userUnit,rootDictionaryObjId:Uo,resourceDictionaryObjId:Ea}));Rn(Uo,!0),ge("<</Type /Pages");var De="/Kids [";for(ce=0;ce<xr;ce++)De+=Ae[ce]+" 0 R ";ge(De+"]"),ge("/Count "+xr),ge(">>"),ge("endobj"),pr.publish("postPutPages")},to=function(H){pr.publish("putFont",{font:H,out:ge,newObject:zr,putStream:ka}),H.isAlreadyPutted!==!0&&(H.objectNumber=zr(),ge("<<"),ge("/Type /Font"),ge("/BaseFont /"+Kh(H.postScriptName)),ge("/Subtype /Type1"),typeof H.encoding=="string"&&ge("/Encoding /"+H.encoding),ge("/FirstChar 32"),ge("/LastChar 255"),ge(">>"),ge("endobj"))},Ds=function(H){H.objectNumber=zr();var ce=[];ce.push({key:"Type",value:"/XObject"}),ce.push({key:"Subtype",value:"/Form"}),ce.push({key:"BBox",value:"["+[I(H.x),I(H.y),I(H.x+H.width),I(H.y+H.height)].join(" ")+"]"}),ce.push({key:"Matrix",value:"["+H.matrix.toString()+"]"});var Ae=H.pages[1].join(`
478
+ `);ka({data:Ae,additionalKeyValues:ce,objectId:H.objectNumber}),ge("endobj")},rs=function(H,ce){ce||(ce=21);var Ae=zr(),De=function(ct,Dt){var jt,cr=[],fr=1/(Dt-1);for(jt=0;jt<1;jt+=fr)cr.push(jt);if(cr.push(1),ct[0].offset!=0){var qr={offset:0,color:ct[0].color};ct.unshift(qr)}if(ct[ct.length-1].offset!=1){var kn={offset:1,color:ct[ct.length-1].color};ct.push(kn)}for(var ui="",on=0,mi=0;mi<cr.length;mi++){for(jt=cr[mi];jt>ct[on+1].offset;)on++;var _n=ct[on].offset,ki=(jt-_n)/(ct[on+1].offset-_n),Po=ct[on].color,Qi=ct[on+1].color;ui+=ee(Math.round((1-ki)*Po[0]+ki*Qi[0]).toString(16))+ee(Math.round((1-ki)*Po[1]+ki*Qi[1]).toString(16))+ee(Math.round((1-ki)*Po[2]+ki*Qi[2]).toString(16))}return ui.trim()}(H.colors,ce),Ge=[];Ge.push({key:"FunctionType",value:"0"}),Ge.push({key:"Domain",value:"[0.0 1.0]"}),Ge.push({key:"Size",value:"["+ce+"]"}),Ge.push({key:"BitsPerSample",value:"8"}),Ge.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ge.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ka({data:De,additionalKeyValues:Ge,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Ae}),ge("endobj"),H.objectNumber=zr(),ge("<< /ShadingType "+H.type),ge("/ColorSpace /DeviceRGB");var at="/Coords ["+I(parseFloat(H.coords[0]))+" "+I(parseFloat(H.coords[1]))+" ";H.type===2?at+=I(parseFloat(H.coords[2]))+" "+I(parseFloat(H.coords[3])):at+=I(parseFloat(H.coords[2]))+" "+I(parseFloat(H.coords[3]))+" "+I(parseFloat(H.coords[4]))+" "+I(parseFloat(H.coords[5])),ge(at+="]"),H.matrix&&ge("/Matrix ["+H.matrix.toString()+"]"),ge("/Function "+Ae+" 0 R"),ge("/Extend [true true]"),ge(">>"),ge("endobj")},su=function(H,ce){var Ae=En(),De=zr();ce.push({resourcesOid:Ae,objectOid:De}),H.objectNumber=De;var Ge=[];Ge.push({key:"Type",value:"/Pattern"}),Ge.push({key:"PatternType",value:"1"}),Ge.push({key:"PaintType",value:"1"}),Ge.push({key:"TilingType",value:"1"}),Ge.push({key:"BBox",value:"["+H.boundingBox.map(I).join(" ")+"]"}),Ge.push({key:"XStep",value:I(H.xStep)}),Ge.push({key:"YStep",value:I(H.yStep)}),Ge.push({key:"Resources",value:Ae+" 0 R"}),H.matrix&&Ge.push({key:"Matrix",value:"["+H.matrix.toString()+"]"}),ka({data:H.stream,additionalKeyValues:Ge,objectId:H.objectNumber}),ge("endobj")},Lf=function(H){for(var ce in H.objectNumber=zr(),ge("<<"),H)switch(ce){case"opacity":ge("/ca "+O(H[ce]));break;case"stroke-opacity":ge("/CA "+O(H[ce]))}ge(">>"),ge("endobj")},An=function(H){Rn(H.resourcesOid,!0),ge("<<"),ge("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var ce in ge("/Font <<"),It)It.hasOwnProperty(ce)&&(v===!1||v===!0&&g.hasOwnProperty(ce))&&ge("/"+ce+" "+It[ce].objectNumber+" 0 R");ge(">>")}(),function(){if(Object.keys(qe).length>0){for(var ce in ge("/Shading <<"),qe)qe.hasOwnProperty(ce)&&qe[ce]instanceof Xf&&qe[ce].objectNumber>=0&&ge("/"+ce+" "+qe[ce].objectNumber+" 0 R");pr.publish("putShadingPatternDict"),ge(">>")}}(),function(ce){if(Object.keys(qe).length>0){for(var Ae in ge("/Pattern <<"),qe)qe.hasOwnProperty(Ae)&&qe[Ae]instanceof p.TilingPattern&&qe[Ae].objectNumber>=0&&qe[Ae].objectNumber<ce&&ge("/"+Ae+" "+qe[Ae].objectNumber+" 0 R");pr.publish("putTilingPatternDict"),ge(">>")}}(H.objectOid),function(){if(Object.keys(Ct).length>0){var ce;for(ce in ge("/ExtGState <<"),Ct)Ct.hasOwnProperty(ce)&&Ct[ce].objectNumber>=0&&ge("/"+ce+" "+Ct[ce].objectNumber+" 0 R");pr.publish("putGStateDict"),ge(">>")}}(),function(){for(var ce in ge("/XObject <<"),oi)oi.hasOwnProperty(ce)&&oi[ce].objectNumber>=0&&ge("/"+ce+" "+oi[ce].objectNumber+" 0 R");pr.publish("putXobjectDict"),ge(">>")}(),ge(">>"),ge("endobj")},lu=function(H){Jt[H.fontName]=Jt[H.fontName]||{},Jt[H.fontName][H.fontStyle]=H.id},ns=function(H,ce,Ae,De,Ge){var at={id:"F"+(Object.keys(It).length+1).toString(10),postScriptName:H,fontName:ce,fontStyle:Ae,encoding:De,isStandardFont:Ge||!1,metadata:{}};return pr.publish("addFont",{font:at,instance:this}),It[at.id]=at,lu(at),at.id},Pa=p.__private__.pdfEscape=p.pdfEscape=function(H,ce){return function(Ae,De){var Ge,at,ct,Dt,jt,cr,fr,qr,kn;if(ct=(De=De||{}).sourceEncoding||"Unicode",jt=De.outputEncoding,(De.autoencode||jt)&&It[xt].metadata&&It[xt].metadata[ct]&&It[xt].metadata[ct].encoding&&(Dt=It[xt].metadata[ct].encoding,!jt&&It[xt].encoding&&(jt=It[xt].encoding),!jt&&Dt.codePages&&(jt=Dt.codePages[0]),typeof jt=="string"&&(jt=Dt[jt]),jt)){for(fr=!1,cr=[],Ge=0,at=Ae.length;Ge<at;Ge++)(qr=jt[Ae.charCodeAt(Ge)])?cr.push(String.fromCharCode(qr)):cr.push(Ae[Ge]),cr[Ge].charCodeAt(0)>>8&&(fr=!0);Ae=cr.join("")}for(Ge=Ae.length;fr===void 0&&Ge!==0;)Ae.charCodeAt(Ge-1)>>8&&(fr=!0),Ge--;if(!fr)return Ae;for(cr=De.noBOM?[]:[254,255],Ge=0,at=Ae.length;Ge<at;Ge++){if((kn=(qr=Ae.charCodeAt(Ge))>>8)>>8)throw new Error("Character at position "+Ge+" of string '"+Ae+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");cr.push(kn),cr.push(qr-(kn<<8))}return String.fromCharCode.apply(void 0,cr)}(H,ce).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},is=p.__private__.beginPage=function(H){Te[++xr]=[],er[xr]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(H[0]),topRightY:Number(H[1])}},_o(xr),Ee(Te[U])},Sc=function(H,ce){var Ae,De,Ge;switch(r=ce||r,typeof H=="string"&&(Ae=b(H.toLowerCase()),Array.isArray(Ae)&&(De=Ae[0],Ge=Ae[1])),Array.isArray(H)&&(De=H[0]*bt,Ge=H[1]*bt),isNaN(De)&&(De=i[0],Ge=i[1]),(De>14400||Ge>14400)&&(Yn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),De=Math.min(14400,De),Ge=Math.min(14400,Ge)),i=[De,Ge],r.substr(0,1)){case"l":Ge>De&&(i=[Ge,De]);break;case"p":De>Ge&&(i=[Ge,De])}is(i),fl(qa),ge(Fs),Ca!==0&&ge(Ca+" J"),ao!==0&&ge(ao+" j"),pr.publish("addPage",{pageNumber:xr})},sl=function(H){H>0&&H<=xr&&(Te.splice(H,1),er.splice(H,1),xr--,U>xr&&(U=xr),this.setPage(U))},_o=function(H){H>0&&H<=xr&&(U=H)},gi=p.__private__.getNumberOfPages=p.getNumberOfPages=function(){return Te.length-1},cn=function(H,ce,Ae){var De,Ge=void 0;return Ae=Ae||{},H=H!==void 0?H:It[xt].fontName,ce=ce!==void 0?ce:It[xt].fontStyle,De=H.toLowerCase(),Jt[De]!==void 0&&Jt[De][ce]!==void 0?Ge=Jt[De][ce]:Jt[H]!==void 0&&Jt[H][ce]!==void 0?Ge=Jt[H][ce]:Ae.disableWarning===!1&&Yn.warn("Unable to look up font label for font '"+H+"', '"+ce+"'. Refer to getFontList() for available fonts."),Ge||Ae.noFallback||(Ge=Jt.times[ce])==null&&(Ge=Jt.times.normal),Ge},Sr=p.__private__.putInfo=function(){var H=zr(),ce=function(De){return De};for(var Ae in f!==null&&(ce=Zn.encryptor(H,0)),ge("<<"),ge("/Producer ("+Pa(ce("jsPDF "+tr.version))+")"),pt)pt.hasOwnProperty(Ae)&&pt[Ae]&&ge("/"+Ae.substr(0,1).toUpperCase()+Ae.substr(1)+" ("+Pa(ce(pt[Ae]))+")");ge("/CreationDate ("+Pa(ce(J))+")"),ge(">>"),ge("endobj")},as=p.__private__.putCatalog=function(H){var ce=(H=H||{}).rootDictionaryObjId||Uo;switch(zr(),ge("<<"),ge("/Type /Catalog"),ge("/Pages "+ce+" 0 R"),Le||(Le="fullwidth"),Le){case"fullwidth":ge("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ge("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ge("/OpenAction [3 0 R /Fit]");break;case"original":ge("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Ae=""+Le;Ae.substr(Ae.length-1)==="%"&&(Le=parseInt(Le)/100),typeof Le=="number"&&ge("/OpenAction [3 0 R /XYZ null null "+O(Le)+"]")}switch(Ue||(Ue="continuous"),Ue){case"continuous":ge("/PageLayout /OneColumn");break;case"single":ge("/PageLayout /SinglePage");break;case"two":case"twoleft":ge("/PageLayout /TwoColumnLeft");break;case"tworight":ge("/PageLayout /TwoColumnRight")}ke&&ge("/PageMode /"+ke),pr.publish("putCatalog"),ge(">>"),ge("endobj")},Tr=p.__private__.putTrailer=function(){ge("trailer"),ge("<<"),ge("/Size "+(K+1)),ge("/Root "+K+" 0 R"),ge("/Info "+(K-1)+" 0 R"),f!==null&&ge("/Encrypt "+Zn.oid+" 0 R"),ge("/ID [ <"+ae+"> <"+ae+"> ]"),ge(">>")},Xi=p.__private__.putHeader=function(){ge("%PDF-"+y),ge("%ºß¬à")},ro=p.__private__.putXRef=function(){var H="0000000000";ge("xref"),ge("0 "+(K+1)),ge("0000000000 65535 f ");for(var ce=1;ce<=K;ce++)typeof oe[ce]=="function"?ge((H+oe[ce]()).slice(-10)+" 00000 n "):oe[ce]!==void 0?ge((H+oe[ce]).slice(-10)+" 00000 n "):ge("0000000000 00000 n ")},Ki=p.__private__.buildDocument=function(){var H;K=0,de=0,me=[],oe=[],ye=[],Uo=En(),Ea=En(),Ee(me),pr.publish("buildDocument"),Xi(),Bi(),function(){pr.publish("putAdditionalObjects");for(var Ae=0;Ae<ye.length;Ae++){var De=ye[Ae];Rn(De.objId,!0),ge(De.content),ge("endobj")}pr.publish("postPutAdditionalObjects")}(),H=[],function(){for(var Ae in It)It.hasOwnProperty(Ae)&&(v===!1||v===!0&&g.hasOwnProperty(Ae))&&to(It[Ae])}(),function(){var Ae;for(Ae in Ct)Ct.hasOwnProperty(Ae)&&Lf(Ct[Ae])}(),function(){for(var Ae in oi)oi.hasOwnProperty(Ae)&&Ds(oi[Ae])}(),function(Ae){var De;for(De in qe)qe.hasOwnProperty(De)&&(qe[De]instanceof Xf?rs(qe[De]):qe[De]instanceof rd&&su(qe[De],Ae))}(H),pr.publish("putResources"),H.forEach(An),An({resourcesOid:Ea,objectOid:Number.MAX_SAFE_INTEGER}),pr.publish("postPutResources"),f!==null&&(Zn.oid=zr(),ge("<<"),ge("/Filter /Standard"),ge("/V "+Zn.v),ge("/R "+Zn.r),ge("/U <"+Zn.toHexString(Zn.U)+">"),ge("/O <"+Zn.toHexString(Zn.O)+">"),ge("/P "+Zn.P),ge(">>"),ge("endobj")),Sr(),as();var ce=de;return ro(),Tr(),ge("startxref"),ge(""+ce),ge("%%EOF"),Ee(Te[U]),me.join(`
479
+ `)},Mn=p.__private__.getBlob=function(H){return new Blob([Be(H)],{type:"application/pdf"})},Zi=p.output=p.__private__.output=(Yi=function(H,ce){switch(typeof(ce=ce||{})=="string"?ce={filename:ce}:ce.filename=ce.filename||"generated.pdf",H){case void 0:return Ki();case"save":p.save(ce.filename);break;case"arraybuffer":return Be(Ki());case"blob":return Mn(Ki());case"bloburi":case"bloburl":if(yr.URL!==void 0&&typeof yr.URL.createObjectURL=="function")return yr.URL&&yr.URL.createObjectURL(Mn(Ki()))||void 0;Yn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Ae="",De=Ki();try{Ae=xw(De)}catch{Ae=xw(unescape(encodeURIComponent(De)))}return"data:application/pdf;filename="+ce.filename+";base64,"+Ae;case"pdfobjectnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var Ge="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",at=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';ce.pdfObjectUrl&&(Ge=ce.pdfObjectUrl,at="");var ct='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Ge+'"'+at+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(ce)+");<\/script></body></html>",Dt=yr.open();return Dt!==null&&Dt.document.write(ct),Dt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var jt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(ce.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+ce.filename+'" width="500px" height="400px" /></body></html>',cr=yr.open();if(cr!==null){cr.document.write(jt);var fr=this;cr.document.documentElement.querySelector("#pdfViewer").onload=function(){cr.document.title=ce.filename,cr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(fr.output("bloburl"))}}return cr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(yr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var qr='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",ce)+'"></iframe></body></html>',kn=yr.open();if(kn!==null&&(kn.document.write(qr),kn.document.title=ce.filename),kn||typeof safari>"u")return kn;break;case"datauri":case"dataurl":return yr.document.location.href=this.output("datauristring",ce);default:return null}},Yi.foo=function(){try{return Yi.apply(this,arguments)}catch(Ae){var H=Ae.stack||"";~H.indexOf(" at ")&&(H=H.split(" at ")[1]);var ce="Error in function "+H.split(`
480
+ `)[0].split("<")[0]+": "+Ae.message;if(!yr.console)throw new Error(ce);yr.console.error(ce,Ae),yr.alert&&alert(ce)}},Yi.foo.bar=Yi,Yi.foo),ll=function(H){return Array.isArray(Fi)===!0&&Fi.indexOf(H)>-1};switch(n){case"pt":bt=1;break;case"mm":bt=72/25.4;break;case"cm":bt=72/2.54;break;case"in":bt=72;break;case"px":bt=ll("px_scaling")==1?.75:96/72;break;case"pc":case"em":bt=12;break;case"ex":bt=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);bt=n}var Zn=null;B(),Z();var os=p.__private__.getPageInfo=p.getPageInfo=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:er[H].objId,pageNumber:H,pageContext:er[H]}},Wu=p.__private__.getPageInfoByObjId=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var ce in er)if(er[ce].objId===H)break;return os(ce)},Oa=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:er[U].objId,pageNumber:U,pageContext:er[U]}};p.addPage=function(){return Sc.apply(this,arguments),this},p.setPage=function(){return _o.apply(this,arguments),Ee.call(this,Te[U]),this},p.insertPage=function(H){return this.addPage(),this.movePage(U,H),this},p.movePage=function(H,ce){var Ae,De;if(H>ce){Ae=Te[H],De=er[H];for(var Ge=H;Ge>ce;Ge--)Te[Ge]=Te[Ge-1],er[Ge]=er[Ge-1];Te[ce]=Ae,er[ce]=De,this.setPage(ce)}else if(H<ce){Ae=Te[H],De=er[H];for(var at=H;at<ce;at++)Te[at]=Te[at+1],er[at]=er[at+1];Te[ce]=Ae,er[ce]=De,this.setPage(ce)}return this},p.deletePage=function(){return sl.apply(this,arguments),this},p.__private__.text=p.text=function(H,ce,Ae,De,Ge){var at,ct,Dt,jt,cr,fr,qr,kn,ui,on=(De=De||{}).scope||this;if(typeof H=="number"&&typeof ce=="number"&&(typeof Ae=="string"||Array.isArray(Ae))){var mi=Ae;Ae=ce,ce=H,H=mi}if(arguments[3]instanceof Zt==0?(Dt=arguments[4],jt=arguments[5],Nn(qr=arguments[3])==="object"&&qr!==null||(typeof Dt=="string"&&(jt=Dt,Dt=null),typeof qr=="string"&&(jt=qr,qr=null),typeof qr=="number"&&(Dt=qr,qr=null),De={flags:qr,angle:Dt,align:jt})):(F("The transform parameter of text() with a Matrix value"),ui=Ge),isNaN(ce)||isNaN(Ae)||H==null)throw new Error("Invalid arguments passed to jsPDF.text");if(H.length===0)return on;var _n,ki="",Po=typeof De.lineHeightFactor=="number"?De.lineHeightFactor:za,Qi=on.internal.scaleFactor;function Oc(Cr){return Cr=Cr.split(" ").join(Array(De.TabLen||9).join(" ")),Pa(Cr,qr)}function Oo(Cr){for(var ar,Er=Cr.concat(),Lr=[],Va=Er.length;Va--;)typeof(ar=Er.shift())=="string"?Lr.push(ar):Array.isArray(Cr)&&(ar.length===1||ar[1]===void 0&&ar[2]===void 0)?Lr.push(ar[0]):Lr.push([ar[0],ar[1],ar[2]]);return Lr}function cs(Cr,ar){var Er;if(typeof Cr=="string")Er=ar(Cr)[0];else if(Array.isArray(Cr)){for(var Lr,Va,Us=Cr.concat(),ms=[],Hs=Us.length;Hs--;)typeof(Lr=Us.shift())=="string"?ms.push(ar(Lr)[0]):Array.isArray(Lr)&&typeof Lr[0]=="string"&&(Va=ar(Lr[0],Lr[1],Lr[2]),ms.push([Va[0],Va[1],Va[2]]));Er=ms}return Er}var Bs=!1,pl=!0;if(typeof H=="string")Bs=!0;else if(Array.isArray(H)){var oo=H.concat();ct=[];for(var gl,Pi=oo.length;Pi--;)(typeof(gl=oo.shift())!="string"||Array.isArray(gl)&&typeof gl[0]!="string")&&(pl=!1);Bs=pl}if(Bs===!1)throw new Error('Type of text must be string or Array. "'+H+'" is not recognized.');typeof H=="string"&&(H=H.match(/[\r?\n]/)?H.split(/\r\n|\r|\n/g):[H]);var fs=fe/on.internal.scaleFactor,Co=fs*(Po-1);switch(De.baseline){case"bottom":Ae-=Co;break;case"top":Ae+=fs-Co;break;case"hanging":Ae+=fs-2*Co;break;case"middle":Ae+=fs/2-Co}if((fr=De.maxWidth||0)>0&&(typeof H=="string"?H=on.splitTextToSize(H,fr):Object.prototype.toString.call(H)==="[object Array]"&&(H=H.reduce(function(Cr,ar){return Cr.concat(on.splitTextToSize(ar,fr))},[]))),at={text:H,x:ce,y:Ae,options:De,mutex:{pdfEscape:Pa,activeFontKey:xt,fonts:It,activeFontSize:fe}},pr.publish("preProcessText",at),H=at.text,Dt=(De=at.options).angle,ui instanceof Zt==0&&Dt&&typeof Dt=="number"){Dt*=Math.PI/180,De.rotationDirection===0&&(Dt=-Dt),S===k&&(Dt=-Dt);var Rl=Math.cos(Dt),Ml=Math.sin(Dt);ui=new Zt(Rl,Ml,-Ml,Rl,0,0)}else Dt&&Dt instanceof Zt&&(ui=Dt);S!==k||ui||(ui=Fa),(cr=De.charSpace||$o)!==void 0&&(ki+=I($(cr))+` Tc
481
+ `,this.setCharSpace(this.getCharSpace()||0)),(kn=De.horizontalScale)!==void 0&&(ki+=I(100*kn)+` Tz
482
+ `),De.lang;var zn=-1,so=De.renderingMode!==void 0?De.renderingMode:De.stroke,Lo=on.internal.getCurrentPageInfo().pageContext;switch(so){case 0:case!1:case"fill":zn=0;break;case 1:case!0:case"stroke":zn=1;break;case 2:case"fillThenStroke":zn=2;break;case 3:case"invisible":zn=3;break;case 4:case"fillAndAddForClipping":zn=4;break;case 5:case"strokeAndAddPathForClipping":zn=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":zn=6;break;case 7:case"addToPathForClipping":zn=7}var zs=Lo.usedRenderingMode!==void 0?Lo.usedRenderingMode:-1;zn!==-1?ki+=zn+` Tr
483
+ `:zs!==-1&&(ki+=`0 Tr
484
+ `),zn!==-1&&(Lo.usedRenderingMode=zn),jt=De.align||"left";var In,Ga=fe*Po,vl=on.internal.pageSize.getWidth(),Il=It[xt];cr=De.charSpace||$o,fr=De.maxWidth||0,qr=Object.assign({autoencode:!0,noBOM:!0},De.flags);var zi=[],Oi=function(Cr){return on.getStringUnitWidth(Cr,{font:Il,charSpace:cr,fontSize:fe,doKerning:!1})*fe/Qi};if(Object.prototype.toString.call(H)==="[object Array]"){var Na;ct=Oo(H),jt!=="left"&&(In=ct.map(Oi));var Wa,ha=0;if(jt==="right"){ce-=In[0],H=[],Pi=ct.length;for(var Ji=0;Ji<Pi;Ji++)Ji===0?(Wa=io(ce),Na=wn(Ae)):(Wa=$(ha-In[Ji]),Na=-Ga),H.push([ct[Ji],Wa,Na]),ha=In[Ji]}else if(jt==="center"){ce-=In[0]/2,H=[],Pi=ct.length;for(var No=0;No<Pi;No++)No===0?(Wa=io(ce),Na=wn(Ae)):(Wa=$((ha-In[No])/2),Na=-Ga),H.push([ct[No],Wa,Na]),ha=In[No]}else if(jt==="left"){H=[],Pi=ct.length;for(var hs=0;hs<Pi;hs++)H.push(ct[hs])}else if(jt==="justify"&&Il.encoding==="Identity-H"){H=[],Pi=ct.length,fr=fr!==0?fr:vl;for(var lo=0,Jn=0;Jn<Pi;Jn++)if(Na=Jn===0?wn(Ae):-Ga,Wa=Jn===0?io(ce):lo,Jn<Pi-1){var Go=$((fr-In[Jn])/(ct[Jn].split(" ").length-1)),ci=ct[Jn].split(" ");H.push([ci[0]+" ",Wa,Na]),lo=0;for(var Ta=1;Ta<ci.length;Ta++){var To=(Oi(ci[Ta-1]+" "+ci[Ta])-Oi(ci[Ta]))*Qi+Go;Ta==ci.length-1?H.push([ci[Ta],To,0]):H.push([ci[Ta]+" ",To,0]),lo-=To}}else H.push([ct[Jn],Wa,Na]);H.push(["",lo,0])}else{if(jt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(H=[],Pi=ct.length,fr=fr!==0?fr:vl,Jn=0;Jn<Pi;Jn++){Na=Jn===0?wn(Ae):-Ga,Wa=Jn===0?io(ce):0;var da=ct[Jn].split(" ").length-1,ml=da>0?(fr-In[Jn])/da:0;Jn<Pi-1?zi.push(I($(ml))):zi.push(0),H.push([ct[Jn],Wa,Na])}}}(typeof De.R2L=="boolean"?De.R2L:ue)===!0&&(H=cs(H,function(Cr,ar,Er){return[Cr.split("").reverse().join(""),ar,Er]})),at={text:H,x:ce,y:Ae,options:De,mutex:{pdfEscape:Pa,activeFontKey:xt,fonts:It,activeFontSize:fe}},pr.publish("postProcessText",at),H=at.text,_n=at.mutex.isHex||!1;var Wo=It[xt].encoding;Wo!=="WinAnsiEncoding"&&Wo!=="StandardEncoding"||(H=cs(H,function(Cr,ar,Er){return[Oc(Cr),ar,Er]})),ct=Oo(H),H=[];for(var ds,ps,Jr,gs=Array.isArray(ct[0])?1:0,vs="",qs=function(Cr,ar,Er){var Lr="";return Er instanceof Zt?(Er=typeof De.angle=="number"?ca(Er,new Zt(1,0,0,1,Cr,ar)):ca(new Zt(1,0,0,1,Cr,ar),Er),S===k&&(Er=ca(new Zt(1,0,0,-1,0,0),Er)),Lr=Er.join(" ")+` Tm
485
+ `):Lr=I(Cr)+" "+I(ar)+` Td
486
+ `,Lr},Pn=0;Pn<ct.length;Pn++){switch(vs="",gs){case 1:Jr=(_n?"<":"(")+ct[Pn][0]+(_n?">":")"),ds=parseFloat(ct[Pn][1]),ps=parseFloat(ct[Pn][2]);break;case 0:Jr=(_n?"<":"(")+ct[Pn]+(_n?">":")"),ds=io(ce),ps=wn(Ae)}zi!==void 0&&zi[Pn]!==void 0&&(vs=zi[Pn]+` Tw
487
+ `),Pn===0?H.push(vs+qs(ds,ps,ui)+Jr):gs===0?H.push(vs+Jr):gs===1&&H.push(vs+qs(ds,ps,ui)+Jr)}H=gs===0?H.join(` Tj
488
+ T* `):H.join(` Tj
489
+ `),H+=` Tj
490
+ `;var pa=`BT
491
+ /`;return pa+=xt+" "+fe+` Tf
492
+ `,pa+=I(fe*Po)+` TL
493
+ `,pa+=Ua+`
494
+ `,pa+=ki,pa+=H,ge(pa+="ET"),g[xt]=!0,on};var Nl=p.__private__.clip=p.clip=function(H){return ge(H==="evenodd"?"W*":"W"),this};p.clipEvenOdd=function(){return Nl("evenodd")},p.__private__.discardPath=p.discardPath=function(){return ge("n"),this};var ss=p.__private__.isValidStyle=function(H){var ce=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(H)!==-1&&(ce=!0),ce};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(H){return ss(H)&&(h=H),this};var uu=p.__private__.getStyle=p.getStyle=function(H){var ce=h;switch(H){case"D":case"S":ce="S";break;case"F":ce="f";break;case"FD":case"DF":ce="B";break;case"f":case"f*":case"B":case"B*":ce=H}return ce},Rr=p.close=function(){return ge("h"),this};p.stroke=function(){return ge("S"),this},p.fill=function(H){return xo("f",H),this},p.fillEvenOdd=function(H){return xo("f*",H),this},p.fillStroke=function(H){return xo("B",H),this},p.fillStrokeEvenOdd=function(H){return xo("B*",H),this};var xo=function(H,ce){Nn(ce)==="object"?Ec(ce,H):ge(H)},ls=function(H){H===null||S===k&&H===void 0||(H=uu(H),ge(H))};function ul(H,ce,Ae,De,Ge){var at=new rd(ce||this.boundingBox,Ae||this.xStep,De||this.yStep,this.gState,Ge||this.matrix);at.stream=this.stream;var ct=H+"$$"+this.cloneIndex+++"$$";return Kn(ct,at),at}var Ec=function(H,ce){var Ae=Nt[H.key],De=qe[Ae];if(De instanceof Xf)ge("q"),ge(Ac(ce)),De.gState&&p.setGState(De.gState),ge(H.matrix.toString()+" cm"),ge("/"+Ae+" sh"),ge("Q");else if(De instanceof rd){var Ge=new Zt(1,0,0,-1,0,vi());H.matrix&&(Ge=Ge.multiply(H.matrix||Fa),Ae=ul.call(De,H.key,H.boundingBox,H.xStep,H.yStep,Ge).id),ge("q"),ge("/Pattern cs"),ge("/"+Ae+" scn"),De.gState&&p.setGState(De.gState),ge(ce),ge("Q")}},Ac=function(H){switch(H){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},cl=p.moveTo=function(H,ce){return ge(I($(H))+" "+I(q(ce))+" m"),this},us=p.lineTo=function(H,ce){return ge(I($(H))+" "+I(q(ce))+" l"),this},no=p.curveTo=function(H,ce,Ae,De,Ge,at){return ge([I($(H)),I(q(ce)),I($(Ae)),I(q(De)),I($(Ge)),I(q(at)),"c"].join(" ")),this};p.__private__.line=p.line=function(H,ce,Ae,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(Ae)||isNaN(De)||!ss(Ge))throw new Error("Invalid arguments passed to jsPDF.line");return S===E?this.lines([[Ae-H,De-ce]],H,ce,[1,1],Ge||"S"):this.lines([[Ae-H,De-ce]],H,ce,[1,1]).stroke()},p.__private__.lines=p.lines=function(H,ce,Ae,De,Ge,at){var ct,Dt,jt,cr,fr,qr,kn,ui,on,mi,_n,ki;if(typeof H=="number"&&(ki=Ae,Ae=ce,ce=H,H=ki),De=De||[1,1],at=at||!1,isNaN(ce)||isNaN(Ae)||!Array.isArray(H)||!Array.isArray(De)||!ss(Ge)||typeof at!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(cl(ce,Ae),ct=De[0],Dt=De[1],cr=H.length,mi=ce,_n=Ae,jt=0;jt<cr;jt++)(fr=H[jt]).length===2?(mi=fr[0]*ct+mi,_n=fr[1]*Dt+_n,us(mi,_n)):(qr=fr[0]*ct+mi,kn=fr[1]*Dt+_n,ui=fr[2]*ct+mi,on=fr[3]*Dt+_n,mi=fr[4]*ct+mi,_n=fr[5]*Dt+_n,no(qr,kn,ui,on,mi,_n));return at&&Rr(),ls(Ge),this},p.path=function(H){for(var ce=0;ce<H.length;ce++){var Ae=H[ce],De=Ae.c;switch(Ae.op){case"m":cl(De[0],De[1]);break;case"l":us(De[0],De[1]);break;case"c":no.apply(this,De);break;case"h":Rr()}}return this},p.__private__.rect=p.rect=function(H,ce,Ae,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(Ae)||isNaN(De)||!ss(Ge))throw new Error("Invalid arguments passed to jsPDF.rect");return S===E&&(De=-De),ge([I($(H)),I(q(ce)),I($(Ae)),I($(De)),"re"].join(" ")),ls(Ge),this},p.__private__.triangle=p.triangle=function(H,ce,Ae,De,Ge,at,ct){if(isNaN(H)||isNaN(ce)||isNaN(Ae)||isNaN(De)||isNaN(Ge)||isNaN(at)||!ss(ct))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Ae-H,De-ce],[Ge-Ae,at-De],[H-Ge,ce-at]],H,ce,[1,1],ct,!0),this},p.__private__.roundedRect=p.roundedRect=function(H,ce,Ae,De,Ge,at,ct){if(isNaN(H)||isNaN(ce)||isNaN(Ae)||isNaN(De)||isNaN(Ge)||isNaN(at)||!ss(ct))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Dt=4/3*(Math.SQRT2-1);return Ge=Math.min(Ge,.5*Ae),at=Math.min(at,.5*De),this.lines([[Ae-2*Ge,0],[Ge*Dt,0,Ge,at-at*Dt,Ge,at],[0,De-2*at],[0,at*Dt,-Ge*Dt,at,-Ge,at],[2*Ge-Ae,0],[-Ge*Dt,0,-Ge,-at*Dt,-Ge,-at],[0,2*at-De],[0,-at*Dt,Ge*Dt,-at,Ge,-at]],H+Ge,ce,[1,1],ct,!0),this},p.__private__.ellipse=p.ellipse=function(H,ce,Ae,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(Ae)||isNaN(De)||!ss(Ge))throw new Error("Invalid arguments passed to jsPDF.ellipse");var at=4/3*(Math.SQRT2-1)*Ae,ct=4/3*(Math.SQRT2-1)*De;return cl(H+Ae,ce),no(H+Ae,ce-ct,H+at,ce-De,H,ce-De),no(H-at,ce-De,H-Ae,ce-ct,H-Ae,ce),no(H-Ae,ce+ct,H-at,ce+De,H,ce+De),no(H+at,ce+De,H+Ae,ce+ct,H+Ae,ce),ls(Ge),this},p.__private__.circle=p.circle=function(H,ce,Ae,De){if(isNaN(H)||isNaN(ce)||isNaN(Ae)||!ss(De))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(H,ce,Ae,Ae,De)},p.setFont=function(H,ce,Ae){return Ae&&(ce=C(ce,Ae)),xt=cn(H,ce,{disableWarning:!1}),this};var Ba=p.__private__.getFont=p.getFont=function(){return It[cn.apply(p,arguments)]};p.__private__.getFontList=p.getFontList=function(){var H,ce,Ae={};for(H in Jt)if(Jt.hasOwnProperty(H))for(ce in Ae[H]=[],Jt[H])Jt[H].hasOwnProperty(ce)&&Ae[H].push(ce);return Ae},p.addFont=function(H,ce,Ae,De,Ge){var at=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&at.indexOf(arguments[3])!==-1?Ge=arguments[3]:arguments[3]&&at.indexOf(arguments[3])==-1&&(Ae=C(Ae,De)),ns.call(this,H,ce,Ae,Ge=Ge||"Identity-H")};var za,qa=t.lineWidth||.200025,Pt=p.__private__.getLineWidth=p.getLineWidth=function(){return qa},fl=p.__private__.setLineWidth=p.setLineWidth=function(H){return qa=H,ge(I($(H))+" w"),this};p.__private__.setLineDash=tr.API.setLineDash=tr.API.setLineDashPattern=function(H,ce){if(H=H||[],ce=ce||0,isNaN(ce)||!Array.isArray(H))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return H=H.map(function(Ae){return I($(Ae))}).join(" "),ce=I($(ce)),ge("["+H+"] "+ce+" d"),this};var So=p.__private__.getLineHeight=p.getLineHeight=function(){return fe*za};p.__private__.getLineHeight=p.getLineHeight=function(){return fe*za};var kc=p.__private__.setLineHeightFactor=p.setLineHeightFactor=function(H){return typeof(H=H||1.15)=="number"&&(za=H),this},Pc=p.__private__.getLineHeightFactor=p.getLineHeightFactor=function(){return za};kc(t.lineHeight);var io=p.__private__.getHorizontalCoordinate=function(H){return $(H)},wn=p.__private__.getVerticalCoordinate=function(H){return S===k?H:er[U].mediaBox.topRightY-er[U].mediaBox.bottomLeftY-$(H)},cu=p.__private__.getHorizontalCoordinateString=p.getHorizontalCoordinateString=function(H){return I(io(H))},fu=p.__private__.getVerticalCoordinateString=p.getVerticalCoordinateString=function(H){return I(wn(H))},Fs=t.strokeColor||"0 G";p.__private__.getStrokeColor=p.getDrawColor=function(){return eo(Fs)},p.__private__.setStrokeColor=p.setDrawColor=function(H,ce,Ae,De){return Fs=si({ch1:H,ch2:ce,ch3:Ae,ch4:De,pdfColorType:"draw",precision:2}),ge(Fs),this};var Vu=t.fillColor||"0 g";p.__private__.getFillColor=p.getFillColor=function(){return eo(Vu)},p.__private__.setFillColor=p.setFillColor=function(H,ce,Ae,De){return Vu=si({ch1:H,ch2:ce,ch3:Ae,ch4:De,pdfColorType:"fill",precision:2}),ge(Vu),this};var Ua=t.textColor||"0 g",Ai=p.__private__.getTextColor=p.getTextColor=function(){return eo(Ua)};p.__private__.setTextColor=p.setTextColor=function(H,ce,Ae,De){return Ua=si({ch1:H,ch2:ce,ch3:Ae,ch4:De,pdfColorType:"text",precision:3}),this};var $o=t.charSpace,hu=p.__private__.getCharSpace=p.getCharSpace=function(){return parseFloat($o||0)};p.__private__.setCharSpace=p.setCharSpace=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return $o=H,this};var Ca=0;p.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},p.__private__.setLineCap=p.setLineCap=function(H){var ce=p.CapJoinStyles[H];if(ce===void 0)throw new Error("Line cap style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ca=ce,ge(ce+" J"),this};var ao=0;p.__private__.setLineJoin=p.setLineJoin=function(H){var ce=p.CapJoinStyles[H];if(ce===void 0)throw new Error("Line join style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return ao=ce,ge(ce+" j"),this},p.__private__.setLineMiterLimit=p.__private__.setMiterLimit=p.setLineMiterLimit=p.setMiterLimit=function(H){if(H=H||0,isNaN(H))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ge(I($(H))+" M"),this},p.GState=S0,p.setGState=function(H){(H=typeof H=="string"?Ct[ir[H]]:Eo(null,H)).equals(Ut)||(ge("/"+H.id+" gs"),Ut=H)};var Eo=function(H,ce){if(!H||!ir[H]){var Ae=!1;for(var De in Ct)if(Ct.hasOwnProperty(De)&&Ct[De].equals(ce)){Ae=!0;break}if(Ae)ce=Ct[De];else{var Ge="GS"+(Object.keys(Ct).length+1).toString(10);Ct[Ge]=ce,ce.id=Ge}return H&&(ir[H]=ce.id),pr.publish("addGState",ce),ce}};p.addGState=function(H,ce){return Eo(H,ce),this},p.saveGraphicsState=function(){return ge("q"),Ve.push({key:xt,size:fe,color:Ua}),this},p.restoreGraphicsState=function(){ge("Q");var H=Ve.pop();return xt=H.key,fe=H.size,Ua=H.color,Ut=null,this},p.setCurrentTransformationMatrix=function(H){return ge(H.toString()+" cm"),this},p.comment=function(H){return ge("#"+H),this};var Ao=function(H,ce){var Ae=H||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Ae},set:function(at){isNaN(at)||(Ae=parseFloat(at))}});var De=ce||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return De},set:function(at){isNaN(at)||(De=parseFloat(at))}});var Ge="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Ge},set:function(at){Ge=at.toString()}}),this},hl=function(H,ce,Ae,De){Ao.call(this,H,ce),this.type="rect";var Ge=Ae||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Ge},set:function(ct){isNaN(ct)||(Ge=parseFloat(ct))}});var at=De||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return at},set:function(ct){isNaN(ct)||(at=parseFloat(ct))}}),this},Tl=function(){this.page=xr,this.currentPage=U,this.pages=Te.slice(0),this.pagesContext=er.slice(0),this.x=At,this.y=Br,this.matrix=_r,this.width=ko(U),this.height=La(U),this.outputDestination=Ie,this.id="",this.objectNumber=-1};Tl.prototype.restore=function(){xr=this.page,U=this.currentPage,er=this.pagesContext,Te=this.pages,At=this.x,Br=this.y,_r=this.matrix,dl(U,this.width),Bn(U,this.height),Ie=this.outputDestination};var li=function(H,ce,Ae,De,Ge){Sn.push(new Tl),xr=U=0,Te=[],At=H,Br=ce,_r=Ge,is([Ae,De])};for(var Ha in p.beginFormObject=function(H,ce,Ae,De,Ge){return li(H,ce,Ae,De,Ge),this},p.endFormObject=function(H){return function(ce){if(Ei[ce])Sn.pop().restore();else{var Ae=new Tl,De="Xo"+(Object.keys(oi).length+1).toString(10);Ae.id=De,Ei[ce]=De,oi[De]=Ae,pr.publish("addFormObject",Ae),Sn.pop().restore()}}(H),this},p.doFormObject=function(H,ce){var Ae=oi[Ei[H]];return ge("q"),ge(ce.toString()+" cm"),ge("/"+Ae.id+" Do"),ge("Q"),this},p.getFormObject=function(H){var ce=oi[Ei[H]];return{x:ce.x,y:ce.y,width:ce.width,height:ce.height,matrix:ce.matrix}},p.save=function(H,ce){return H=H||"generated.pdf",(ce=ce||{}).returnPromise=ce.returnPromise||!1,ce.returnPromise===!1?(Yf(Mn(Ki()),H),typeof Yf.unload=="function"&&yr.setTimeout&&setTimeout(Yf.unload,911),this):new Promise(function(Ae,De){try{var Ge=Yf(Mn(Ki()),H);typeof Yf.unload=="function"&&yr.setTimeout&&setTimeout(Yf.unload,911),Ae(Ge)}catch(at){De(at.message)}})},tr.API)tr.API.hasOwnProperty(Ha)&&(Ha==="events"&&tr.API.events.length?function(H,ce){var Ae,De,Ge;for(Ge=ce.length-1;Ge!==-1;Ge--)Ae=ce[Ge][0],De=ce[Ge][1],H.subscribe.apply(H,[Ae].concat(typeof De=="function"?[De]:De))}(pr,tr.API.events):p[Ha]=tr.API[Ha]);function ko(H){return er[H].mediaBox.topRightX-er[H].mediaBox.bottomLeftX}function dl(H,ce){er[H].mediaBox.topRightX=ce+er[H].mediaBox.bottomLeftX}function La(H){return er[H].mediaBox.topRightY-er[H].mediaBox.bottomLeftY}function Bn(H,ce){er[H].mediaBox.topRightY=ce+er[H].mediaBox.bottomLeftY}var fa=p.getPageWidth=function(H){return ko(H=H||U)/bt},Qn=p.setPageWidth=function(H,ce){dl(H,ce*bt)},vi=p.getPageHeight=function(H){return La(H=H||U)/bt},$a=p.setPageHeight=function(H,ce){Bn(H,ce*bt)};return p.internal={pdfEscape:Pa,getStyle:uu,getFont:Ba,getFontSize:Ne,getCharSpace:hu,getTextColor:Ai,getLineHeight:So,getLineHeightFactor:Pc,getLineWidth:Pt,write:Re,getHorizontalCoordinate:io,getVerticalCoordinate:wn,getCoordinateString:cu,getVerticalCoordinateString:fu,collections:{},newObject:zr,newAdditionalObject:Sa,newObjectDeferred:En,newObjectDeferredBegin:Rn,getFilters:Aa,putStream:ka,events:pr,scaleFactor:bt,pageSize:{getWidth:function(){return fa(U)},setWidth:function(H){Qn(U,H)},getHeight:function(){return vi(U)},setHeight:function(H){$a(U,H)}},encryptionOptions:f,encryption:Zn,getEncryptor:function(H){return f!==null?Zn.encryptor(H,0):function(ce){return ce}},output:Zi,getNumberOfPages:gi,pages:Te,out:ge,f2:O,f3:T,getPageInfo:os,getPageInfoByObjId:Wu,getCurrentPageInfo:Oa,getPDFVersion:_,Point:Ao,Rectangle:hl,Matrix:Zt,hasHotfix:ll},Object.defineProperty(p.internal.pageSize,"width",{get:function(){return fa(U)},set:function(H){Qn(U,H)},enumerable:!0,configurable:!0}),Object.defineProperty(p.internal.pageSize,"height",{get:function(){return vi(U)},set:function(H){$a(U,H)},enumerable:!0,configurable:!0}),(function(H){for(var ce=0,Ae=Oe.length;ce<Ae;ce++){var De=ns.call(this,H[ce][0],H[ce][1],H[ce][2],Oe[ce][3],!0);v===!1&&(g[De]=!0);var Ge=H[ce][0].split("-");lu({id:De,fontName:Ge[0],fontStyle:Ge[1]||""})}pr.publish("addFonts",{fonts:It,dictionary:Jt})}).call(p,Oe),xt="F1",Sc(i,r),pr.publish("initialized"),p}Xh.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},Xh.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Xh.prototype.hexToBytes=function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(String.fromCharCode(parseInt(t.substr(r,2),16)));return e.join("")},Xh.prototype.processOwnerPassword=function(t,e){return Cm(Om(e).substr(0,5),t)},Xh.prototype.encryptor=function(t,e){var r=Om(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(n){return Cm(r,n)}},S0.prototype.equals=function(t){var e,r="id,objectNumber,equals";if(!t||Nn(t)!==Nn(this))return!1;var n=0;for(e in this)if(!(r.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;n++}for(e in t)t.hasOwnProperty(e)&&r.indexOf(e)<0&&n--;return n===0},tr.API={events:[]},tr.version="3.0.3";var Wi=tr.API,_y=1,xh=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Gh=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},kr=function(t){return t.toFixed(2)},nf=function(t){return t.toFixed(5)};Wi.__acroform__={};var js=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},kw=function(t){return t*_y},Cu=function(t){var e=new ex,r=Yt.internal.getHeight(t)||0,n=Yt.internal.getWidth(t)||0;return e.BBox=[0,0,Number(kr(n)),Number(kr(r))],e},PI=Wi.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},OI=Wi.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},CI=Wi.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},sa=Wi.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return CI(t,e-1)},la=Wi.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return PI(t,e-1)},ua=Wi.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return OI(t,e-1)},LI=Wi.__acroform__.calculateCoordinates=function(t,e){var r=e.internal.getHorizontalCoordinate,n=e.internal.getVerticalCoordinate,i=t[0],a=t[1],o=t[2],s=t[3],u={};return u.lowerLeft_X=r(i)||0,u.lowerLeft_Y=n(a+s)||0,u.upperRight_X=r(i+o)||0,u.upperRight_Y=n(a)||0,[Number(kr(u.lowerLeft_X)),Number(kr(u.lowerLeft_Y)),Number(kr(u.upperRight_X)),Number(kr(u.upperRight_Y))]},NI=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],r=t._V||t.DV,n=Lm(t,r),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+i+" "+kr(n.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(n.text),e.push("ET"),e.push("Q"),e.push("EMC");var a=Cu(t);return a.scope=t.scope,a.stream=e.join(`
495
+ `),a}},Lm=function(t,e){var r=t.fontSize===0?t.maxFontSize:t.fontSize,n={text:"",fontSize:""},i=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");i=t.multiline?i.map(function(O){return O.split(`
496
+ `)}):i.map(function(O){return[O]});var a=r,o=Yt.internal.getHeight(t)||0;o=o<0?-o:o;var s=Yt.internal.getWidth(t)||0;s=s<0?-s:s;var u=function(O,T,$){if(O+1<i.length){var q=T+" "+i[O+1][0];return j1(q,t,$).width<=s-4}return!1};a++;e:for(;a>0;){e="",a--;var h,f,v=j1("3",t,a).height,g=t.multiline?o-a:(o-v)/2,p=g+=2,y=0,_=0,x=0;if(a<=0){e=`(...) Tj
497
+ `,e+="% Width of Text: "+j1(e,t,a=12).width+", FieldWidth:"+s+`
498
+ `;break}for(var b="",E=0,k=0;k<i.length;k++)if(i.hasOwnProperty(k)){var S=!1;if(i[k].length!==1&&x!==i[k].length-1){if((v+2)*(E+2)+2>o)continue e;b+=i[k][x],S=!0,_=k,k--}else{b=(b+=i[k][x]+" ").substr(b.length-1)==" "?b.substr(0,b.length-1):b;var A=parseInt(k),M=u(A,b,a),C=k>=i.length-1;if(M&&!C){b+=" ",x=0;continue}if(M||C){if(C)_=A;else if(t.multiline&&(v+2)*(E+2)+2>o)continue e}else{if(!t.multiline||(v+2)*(E+2)+2>o)continue e;_=A}}for(var I="",F=y;F<=_;F++){var j=i[F];if(t.multiline){if(F===_){I+=j[x]+" ",x=(x+1)%j.length;continue}if(F===y){I+=j[j.length-1]+" ";continue}}I+=j[0]+" "}switch(I=I.substr(I.length-1)==" "?I.substr(0,I.length-1):I,f=j1(I,t,a).width,t.textAlign){case"right":h=s-f-2;break;case"center":h=(s-f)/2;break;default:h=2}e+=kr(h)+" "+kr(p)+` Td
499
+ `,e+="("+xh(I)+`) Tj
500
+ `,e+=-kr(h)+` 0 Td
501
+ `,p=-(a+2),f=0,y=S?_:_+1,E++,b=""}break}return n.text=e,n.fontSize=a,n},j1=function(t,e,r){var n=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:e.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:i}},TI={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},RI=function(t,e){var r={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(r)},MI=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if(au.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(TI)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");_y=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new tx,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(r){r.internal.events.unsubscribe(r.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete r.internal.acroformPlugin.acroFormDictionaryRoot._eventID,r.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(r){r.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=r.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in n)if(n.hasOwnProperty(i)){var a=n[i];a.objId=void 0,a.hasAnnotation&&RI(a,r)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(r){if(r.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");r.internal.write("/AcroForm "+r.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(r){(function(n,i){var a=!n;for(var o in n||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(o)){var s=n[o],u=[],h=s.Rect;if(s.Rect&&(s.Rect=LI(s.Rect,i)),i.internal.newObjectDeferredBegin(s.objId,!0),s.DA=Yt.createDefaultAppearanceStream(s),Nn(s)==="object"&&typeof s.getKeyValueListForStream=="function"&&(u=s.getKeyValueListForStream()),s.Rect=h,s.hasAppearanceStream&&!s.appearanceStreamContent){var f=NI(s);u.push({key:"AP",value:"<</N "+f+">>"}),i.internal.acroformPlugin.xForms.push(f)}if(s.appearanceStreamContent){var v="";for(var g in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(g)){var p=s.appearanceStreamContent[g];if(v+="/"+g+" ",v+="<<",Object.keys(p).length>=1||Array.isArray(p)){for(var o in p)if(p.hasOwnProperty(o)){var y=p[o];typeof y=="function"&&(y=y.call(i,s)),v+="/"+o+" "+y+" ",i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y)}}else typeof(y=p)=="function"&&(y=y.call(i,s)),v+="/"+o+" "+y,i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y);v+=">>"}u.push({key:"AP",value:`<<
502
+ `+v+">>"})}i.internal.putStream({additionalKeyValues:u,objectId:s.objId}),i.internal.out("endobj")}a&&function(_,x){for(var b in _)if(_.hasOwnProperty(b)){var E=b,k=_[b];x.internal.newObjectDeferredBegin(k.objId,!0),Nn(k)==="object"&&typeof k.putStream=="function"&&k.putStream(),delete _[E]}}(i.internal.acroformPlugin.xForms,i)})(r,t)}),t.internal.acroformPlugin.isInitialized=!0}},J_=Wi.__acroform__.arrayToPdfArray=function(t,e,r){var n=function(o){return o};if(Array.isArray(t)){for(var i="[",a=0;a<t.length;a++)switch(a!==0&&(i+=" "),Nn(t[a])){case"boolean":case"number":case"object":i+=t[a].toString();break;case"string":t[a].substr(0,1)!=="/"?(e!==void 0&&r&&(n=r.internal.getEncryptor(e)),i+="("+xh(n(t[a].toString()))+")"):i+=t[a].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},jv=function(t,e,r){var n=function(i){return i};return e!==void 0&&r&&(n=r.internal.getEncryptor(e)),(t=t||"").toString(),"("+xh(n(t))+")"},Ru=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(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Ru.prototype.toString=function(){return this.objId+" 0 R"},Ru.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},Ru.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var r in e)if(Object.getOwnPropertyDescriptor(this,e[r]).configurable===!1){var n=e[r],i=this[n];i&&(Array.isArray(i)?t.push({key:n,value:J_(i,this.objId,this.scope)}):i instanceof Ru?(i.scope=this.scope,t.push({key:n,value:i.objId+" 0 R"})):typeof i!="function"&&t.push({key:n,value:i}))}return t};var ex=function(){Ru.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 t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(r){t=r.trim()},get:function(){return t||null}})};js(ex,Ru);var tx=function(){Ru.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+xh(r(t))+")"}},set:function(r){t=r}})};js(tx,Ru);var au=function t(){Ru.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute F supplied.');e=b}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!sa(e,3)},set:function(b){b?this.F=la(e,3):this.F=ua(e,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute Ff supplied.');r=b}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(b){n=b!==void 0?b:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(b){n[0]=b}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(b){n[1]=b}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(b){n[2]=b}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(b){n[3]=b}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(b){switch(b){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=b;break;default:throw new Error('Invalid value "'+b+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof E0)return;a="FieldObject"+t.FieldNum++}var b=function(E){return E};return this.scope&&(b=this.scope.internal.getEncryptor(this.objId)),"("+xh(b(a))+")"},set:function(b){a=b.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(b){a=b}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(b){o=b}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(b){s=b}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(b){u=b}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return h===void 0?50/_y:h},set:function(b){h=b}});var f="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return f},set:function(b){f=b}});var v="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!v||this instanceof E0||this instanceof nh))return jv(v,this.objId,this.scope)},set:function(b){b=b.toString(),v=b}});var g=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(g)return this instanceof Ja==0?jv(g,this.objId,this.scope):g},set:function(b){b=b.toString(),g=this instanceof Ja==0?b.substr(0,1)==="("?Gh(b.substr(1,b.length-2)):Gh(b):b}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ja==1?Gh(g.substr(1,g.length-1)):g},set:function(b){b=b.toString(),g=this instanceof Ja==1?"/"+b:b}});var p=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(p)return p},set:function(b){this.V=b}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof Ja==0?jv(p,this.objId,this.scope):p},set:function(b){b=b.toString(),p=this instanceof Ja==0?b.substr(0,1)==="("?Gh(b.substr(1,b.length-2)):Gh(b):b}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ja==1?Gh(p.substr(1,p.length-1)):p},set:function(b){b=b.toString(),p=this instanceof Ja==1?"/"+b:b}}),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 y,_=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return _},set:function(b){b=!!b,_=b}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(y)return y},set:function(b){y=b}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,1)},set:function(b){b?this.Ff=la(this.Ff,1):this.Ff=ua(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,2)},set:function(b){b?this.Ff=la(this.Ff,2):this.Ff=ua(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,3)},set:function(b){b?this.Ff=la(this.Ff,3):this.Ff=ua(this.Ff,3)}});var x=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(x!==null)return x},set:function(b){if([0,1,2].indexOf(b)===-1)throw new Error('Invalid value "'+b+'" for attribute Q supplied.');x=b}}),Object.defineProperty(this,"textAlign",{get:function(){var b;switch(x){case 0:default:b="left";break;case 1:b="center";break;case 2:b="right"}return b},configurable:!0,enumerable:!0,set:function(b){switch(b){case"right":case 2:x=2;break;case"center":case 1:x=1;break;default:x=0}}})};js(au,Ru);var nd=function(){au.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(r){t=r}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return J_(e,this.objId,this.scope)},set:function(r){var n,i;i=[],typeof(n=r)=="string"&&(i=function(a,o,s){s||(s=1);for(var u,h=[];u=o.exec(a);)h.push(u[s]);return h}(n,/\((.*?)\)/g)),e=i}}),this.getOptions=function(){return e},this.setOptions=function(r){e=r,this.sort&&e.sort()},this.addOption=function(r){r=(r=r||"").toString(),e.push(r),this.sort&&e.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();e.indexOf(r)!==-1&&(e.splice(e.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,18)},set:function(r){r?this.Ff=la(this.Ff,18):this.Ff=ua(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=la(this.Ff,19):this.Ff=ua(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,20)},set:function(r){r?(this.Ff=la(this.Ff,20),e.sort()):this.Ff=ua(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,22)},set:function(r){r?this.Ff=la(this.Ff,22):this.Ff=ua(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,23)},set:function(r){r?this.Ff=la(this.Ff,23):this.Ff=ua(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,27)},set:function(r){r?this.Ff=la(this.Ff,27):this.Ff=ua(this.Ff,27)}}),this.hasAppearanceStream=!1};js(nd,au);var id=function(){nd.call(this),this.fontName="helvetica",this.combo=!1};js(id,nd);var ad=function(){id.call(this),this.combo=!0};js(ad,id);var Z1=function(){ad.call(this),this.edit=!0};js(Z1,ad);var Ja=function(){au.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,15)},set:function(r){r?this.Ff=la(this.Ff,15):this.Ff=ua(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,16)},set:function(r){r?this.Ff=la(this.Ff,16):this.Ff=ua(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,17)},set:function(r){r?this.Ff=la(this.Ff,17):this.Ff=ua(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,26)},set:function(r){r?this.Ff=la(this.Ff,26):this.Ff=ua(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(a){return a};if(this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var n,i=[];for(n in i.push("<<"),e)i.push("/"+n+" ("+xh(r(e[n]))+")");return i.push(">>"),i.join(`
503
+ `)}},set:function(r){Nn(r)==="object"&&(e=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(r){typeof r=="string"&&(e.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(r){t="/"+r}})};js(Ja,au);var Q1=function(){Ja.call(this),this.pushButton=!0};js(Q1,Ja);var od=function(){Ja.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};js(od,Ja);var E0=function(){var t,e;au.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(i){e=i}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(s){return s};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var a,o=[];for(a in o.push("<<"),n)o.push("/"+a+" ("+xh(i(n[a]))+")");return o.push(">>"),o.join(`
504
+ `)},set:function(i){Nn(i)==="object"&&(n=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(i){typeof i=="string"&&(n.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(i){r=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(i){r="/"+i}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Yt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};js(E0,au),od.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var r=this.Kids[e];r.appearanceStreamContent=t.createAppearanceStream(r.optionName),r.caption=t.getCA()}},od.prototype.createOption=function(t){var e=new E0;return e.Parent=this,e.optionName=t,this.Kids.push(e),II.call(this.scope,e),e};var J1=function(){Ja.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Yt.CheckBox.createAppearanceStream()};js(J1,Ja);var nh=function(){au.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,13)},set:function(e){e?this.Ff=la(this.Ff,13):this.Ff=ua(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,21)},set:function(e){e?this.Ff=la(this.Ff,21):this.Ff=ua(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,23)},set:function(e){e?this.Ff=la(this.Ff,23):this.Ff=ua(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,24)},set:function(e){e?this.Ff=la(this.Ff,24):this.Ff=ua(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,25)},set:function(e){e?this.Ff=la(this.Ff,25):this.Ff=ua(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,26)},set:function(e){e?this.Ff=la(this.Ff,26):this.Ff=ua(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};js(nh,au);var e0=function(){nh.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,14)},set:function(t){t?this.Ff=la(this.Ff,14):this.Ff=ua(this.Ff,14)}}),this.password=!0};js(e0,nh);var Yt={CheckBox:{createAppearanceStream:function(){return{N:{On:Yt.CheckBox.YesNormal},D:{On:Yt.CheckBox.YesPushDown,Off:Yt.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=Cu(t);e.scope=t.scope;var r=[],n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),a=Lm(t,t.caption);return r.push("0.749023 g"),r.push("0 0 "+kr(Yt.internal.getWidth(t))+" "+kr(Yt.internal.getHeight(t))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+kr(a.fontSize)+" Tf "+i),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join(`
505
+ `),e},YesNormal:function(t){var e=Cu(t);e.scope=t.scope;var r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color),i=[],a=Yt.internal.getHeight(t),o=Yt.internal.getWidth(t),s=Lm(t,t.caption);return i.push("1 g"),i.push("0 0 "+kr(o)+" "+kr(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+kr(o-1)+" "+kr(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+r+" "+kr(s.fontSize)+" Tf "+n),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join(`
506
+ `),e},OffPushDown:function(t){var e=Cu(t);e.scope=t.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+kr(Yt.internal.getWidth(t))+" "+kr(Yt.internal.getHeight(t))+" re"),r.push("f"),e.stream=r.join(`
507
+ `),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Yt.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Yt.RadioButton.Circle.YesNormal,e.D[t]=Yt.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=Cu(t);e.scope=t.scope;var r=[],n=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Yt.internal.Bezier_C,a=Number((n*i).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+nf(Yt.internal.getWidth(t)/2)+" "+nf(Yt.internal.getHeight(t)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+a+" "+a+" "+n+" 0 "+n+" c"),r.push("-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c"),r.push("-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c"),r.push(a+" -"+n+" "+n+" -"+a+" "+n+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(`
508
+ `),e},YesPushDown:function(t){var e=Cu(t);e.scope=t.scope;var r=[],n=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Yt.internal.Bezier_C).toFixed(5)),o=Number((n*Yt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+nf(Yt.internal.getWidth(t)/2)+" "+nf(Yt.internal.getHeight(t)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),r.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),r.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),r.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+nf(Yt.internal.getWidth(t)/2)+" "+nf(Yt.internal.getHeight(t)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+o+" "+o+" "+n+" 0 "+n+" c"),r.push("-"+o+" "+n+" -"+n+" "+o+" -"+n+" 0 c"),r.push("-"+n+" -"+o+" -"+o+" -"+n+" 0 -"+n+" c"),r.push(o+" -"+n+" "+n+" -"+o+" "+n+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(`
509
+ `),e},OffPushDown:function(t){var e=Cu(t);e.scope=t.scope;var r=[],n=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Yt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+nf(Yt.internal.getWidth(t)/2)+" "+nf(Yt.internal.getHeight(t)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),r.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),r.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),r.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(`
510
+ `),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Yt.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Yt.RadioButton.Cross.YesNormal,e.D[t]=Yt.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=Cu(t);e.scope=t.scope;var r=[],n=Yt.internal.calculateCross(t);return r.push("q"),r.push("1 1 "+kr(Yt.internal.getWidth(t)-2)+" "+kr(Yt.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(kr(n.x1.x)+" "+kr(n.x1.y)+" m"),r.push(kr(n.x2.x)+" "+kr(n.x2.y)+" l"),r.push(kr(n.x4.x)+" "+kr(n.x4.y)+" m"),r.push(kr(n.x3.x)+" "+kr(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(`
511
+ `),e},YesPushDown:function(t){var e=Cu(t);e.scope=t.scope;var r=Yt.internal.calculateCross(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+kr(Yt.internal.getWidth(t))+" "+kr(Yt.internal.getHeight(t))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+kr(Yt.internal.getWidth(t)-2)+" "+kr(Yt.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(kr(r.x1.x)+" "+kr(r.x1.y)+" m"),n.push(kr(r.x2.x)+" "+kr(r.x2.y)+" l"),n.push(kr(r.x4.x)+" "+kr(r.x4.y)+" m"),n.push(kr(r.x3.x)+" "+kr(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(`
512
+ `),e},OffPushDown:function(t){var e=Cu(t);e.scope=t.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+kr(Yt.internal.getWidth(t))+" "+kr(Yt.internal.getHeight(t))+" re"),r.push("f"),e.stream=r.join(`
513
+ `),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+r}};Yt.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Yt.internal.getWidth(t),r=Yt.internal.getHeight(t),n=Math.min(e,r);return{x1:{x:(e-n)/2,y:(r-n)/2+n},x2:{x:(e-n)/2+n,y:(r-n)/2},x3:{x:(e-n)/2,y:(r-n)/2},x4:{x:(e-n)/2+n,y:(r-n)/2+n}}}},Yt.internal.getWidth=function(t){var e=0;return Nn(t)==="object"&&(e=kw(t.Rect[2])),e},Yt.internal.getHeight=function(t){var e=0;return Nn(t)==="object"&&(e=kw(t.Rect[3])),e};var II=Wi.addField=function(t){if(MI(this,t),!(t instanceof au))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};Wi.AcroFormChoiceField=nd,Wi.AcroFormListBox=id,Wi.AcroFormComboBox=ad,Wi.AcroFormEditBox=Z1,Wi.AcroFormButton=Ja,Wi.AcroFormPushButton=Q1,Wi.AcroFormRadioButton=od,Wi.AcroFormCheckBox=J1,Wi.AcroFormTextField=nh,Wi.AcroFormPasswordField=e0,Wi.AcroFormAppearance=Yt,Wi.AcroForm={ChoiceField:nd,ListBox:id,ComboBox:ad,EditBox:Z1,Button:Ja,PushButton:Q1,RadioButton:od,CheckBox:J1,TextField:nh,PasswordField:e0,Appearance:Yt},tr.AcroForm={ChoiceField:nd,ListBox:id,ComboBox:ad,EditBox:Z1,Button:Ja,PushButton:Q1,RadioButton:od,CheckBox:J1,TextField:nh,PasswordField:e0,Appearance:Yt};tr.AcroForm;function rx(t){return t.reduce(function(e,r,n){return e[r]=n,e},{})}(function(t){var e="addImage_";t.__addimage__={};var r="UNKNOWN",n={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]]},i=t.__addimage__.getImageFileTypeByImageData=function(O,T){var $,q,J,ae,ie,Z=r;if((T=T||r)==="RGBA"||O.data!==void 0&&O.data instanceof Uint8ClampedArray&&"height"in O&&"width"in O)return"RGBA";if(M(O))for(ie in n)for(J=n[ie],$=0;$<J.length;$+=1){for(ae=!0,q=0;q<J[$].length;q+=1)if(J[$][q]!==void 0&&J[$][q]!==O[q]){ae=!1;break}if(ae===!0){Z=ie;break}}else for(ie in n)for(J=n[ie],$=0;$<J.length;$+=1){for(ae=!0,q=0;q<J[$].length;q+=1)if(J[$][q]!==void 0&&J[$][q]!==O.charCodeAt(q)){ae=!1;break}if(ae===!0){Z=ie;break}}return Z===r&&T!==r&&(Z=T),Z},a=function O(T){for(var $=this.internal.write,q=this.internal.putStream,J=(0,this.internal.getFilters)();J.indexOf("FlateEncode")!==-1;)J.splice(J.indexOf("FlateEncode"),1);T.objectId=this.internal.newObject();var ae=[];if(ae.push({key:"Type",value:"/XObject"}),ae.push({key:"Subtype",value:"/Image"}),ae.push({key:"Width",value:T.width}),ae.push({key:"Height",value:T.height}),T.colorSpace===b.INDEXED?ae.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(T.palette.length/3-1)+" "+("sMask"in T&&T.sMask!==void 0?T.objectId+2:T.objectId+1)+" 0 R]"}):(ae.push({key:"ColorSpace",value:"/"+T.colorSpace}),T.colorSpace===b.DEVICE_CMYK&&ae.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),ae.push({key:"BitsPerComponent",value:T.bitsPerComponent}),"decodeParameters"in T&&T.decodeParameters!==void 0&&ae.push({key:"DecodeParms",value:"<<"+T.decodeParameters+">>"}),"transparency"in T&&Array.isArray(T.transparency)&&T.transparency.length>0){for(var ie="",Z=0,te=T.transparency.length;Z<te;Z++)ie+=T.transparency[Z]+" "+T.transparency[Z]+" ";ae.push({key:"Mask",value:"["+ie+"]"})}T.sMask!==void 0&&ae.push({key:"SMask",value:T.objectId+1+" 0 R"});var V=T.filter!==void 0?["/"+T.filter]:void 0;if(q({data:T.data,additionalKeyValues:ae,alreadyAppliedFilters:V,objectId:T.objectId}),$("endobj"),"sMask"in T&&T.sMask!==void 0){var B,D=(B=T.sMaskBitsPerComponent)!==null&&B!==void 0?B:T.bitsPerComponent,U={width:T.width,height:T.height,colorSpace:"DeviceGray",bitsPerComponent:D,data:T.sMask};"filter"in T&&(U.decodeParameters="/Predictor ".concat(T.predictor," /Colors 1 /BitsPerComponent ").concat(D," /Columns ").concat(T.width),U.filter=T.filter),O.call(this,U)}if(T.colorSpace===b.INDEXED){var X=this.internal.newObject();q({data:I(new Uint8Array(T.palette)),objectId:X}),$("endobj")}},o=function(){var O=this.internal.collections[e+"images"];for(var T in O)a.call(this,O[T])},s=function(){var O,T=this.internal.collections[e+"images"],$=this.internal.write;for(var q in T)$("/I"+(O=T[q]).index,O.objectId,"0","R")},u=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",s))},h=function(){var O=this.internal.collections[e+"images"];return u.call(this),O},f=function(){return Object.keys(this.internal.collections[e+"images"]).length},v=function(O){return typeof t["process"+O.toUpperCase()]=="function"},g=function(O){return Nn(O)==="object"&&O.nodeType===1},p=function(O,T){if(O.nodeName==="IMG"&&O.hasAttribute("src")){var $=""+O.getAttribute("src");if($.indexOf("data:image/")===0)return K1(unescape($).split("base64,").pop());var q=t.loadFile($,!0);if(q!==void 0)return q}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 J;switch(T){case"PNG":J="image/png";break;case"WEBP":J="image/webp";break;default:J="image/jpeg"}return K1(O.toDataURL(J,1).split("base64,").pop())}},y=function(O){var T=this.internal.collections[e+"images"];if(T){for(var $ in T)if(O===T[$].alias)return T[$]}},_=function(O,T,$){return O||T||(O=-96,T=-96),O<0&&(O=-1*$.width*72/O/this.internal.scaleFactor),T<0&&(T=-1*$.height*72/T/this.internal.scaleFactor),O===0&&(O=T*$.width/$.height),T===0&&(T=O*$.height/$.width),[O,T]},x=function(O,T,$,q,J,ae){var ie=_.call(this,$,q,J),Z=this.internal.getCoordinateString,te=this.internal.getVerticalCoordinateString,V=h.call(this);if($=ie[0],q=ie[1],V[J.index]=J,ae){ae*=Math.PI/180;var B=Math.cos(ae),D=Math.sin(ae),U=function(ee){return ee.toFixed(4)},X=[U(B),U(D),U(-1*D),U(B),0,0,"cm"]}this.internal.write("q"),ae?(this.internal.write([1,"0","0",1,Z(O),te(T+q),"cm"].join(" ")),this.internal.write(X.join(" ")),this.internal.write([Z($),"0","0",Z(q),"0","0","cm"].join(" "))):this.internal.write([Z($),"0","0",Z(q),Z(O),te(T+q),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+J.index+" Do"),this.internal.write("Q")},b=t.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"};t.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 E=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},k=t.__addimage__.sHashCode=function(O){var T,$,q=0;if(typeof O=="string")for($=O.length,T=0;T<$;T++)q=(q<<5)-q+O.charCodeAt(T),q|=0;else if(M(O))for($=O.byteLength/2,T=0;T<$;T++)q=(q<<5)-q+O[T],q|=0;return q},S=t.__addimage__.validateStringAsBase64=function(O){(O=O||"").toString().trim();var T=!0;return O.length===0&&(T=!1),O.length%4!=0&&(T=!1),/^[A-Za-z0-9+/]+$/.test(O.substr(0,O.length-2))===!1&&(T=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(O.substr(-2))===!1&&(T=!1),T},A=t.__addimage__.extractImageFromDataUrl=function(O){if(O==null||!(O=O.trim()).startsWith("data:"))return null;var T=O.indexOf(",");return T<0?null:O.substring(0,T).trim().endsWith("base64")?O.substring(T+1):null};t.__addimage__.isArrayBuffer=function(O){return O instanceof ArrayBuffer};var M=t.__addimage__.isArrayBufferView=function(O){return O instanceof Int8Array||O instanceof Uint8Array||O instanceof Uint8ClampedArray||O instanceof Int16Array||O instanceof Uint16Array||O instanceof Int32Array||O instanceof Uint32Array||O instanceof Float32Array||O instanceof Float64Array},C=t.__addimage__.binaryStringToUint8Array=function(O){for(var T=O.length,$=new Uint8Array(T),q=0;q<T;q++)$[q]=O.charCodeAt(q);return $},I=t.__addimage__.arrayBufferToBinaryString=function(O){for(var T="",$=M(O)?O:new Uint8Array(O),q=0;q<$.length;q+=8192)T+=String.fromCharCode.apply(null,$.subarray(q,q+8192));return T};t.addImage=function(){var O,T,$,q,J,ae,ie,Z,te;if(typeof arguments[1]=="number"?(T=r,$=arguments[1],q=arguments[2],J=arguments[3],ae=arguments[4],ie=arguments[5],Z=arguments[6],te=arguments[7]):(T=arguments[1],$=arguments[2],q=arguments[3],J=arguments[4],ae=arguments[5],ie=arguments[6],Z=arguments[7],te=arguments[8]),Nn(O=arguments[0])==="object"&&!g(O)&&"imageData"in O){var V=O;O=V.imageData,T=V.format||T||r,$=V.x||$||0,q=V.y||q||0,J=V.w||V.width||J,ae=V.h||V.height||ae,ie=V.alias||ie,Z=V.compression||Z,te=V.rotation||V.angle||te}var B=this.internal.getFilters();if(Z===void 0&&B.indexOf("FlateEncode")!==-1&&(Z="SLOW"),isNaN($)||isNaN(q))throw new Error("Invalid coordinates passed to jsPDF.addImage");u.call(this);var D=F.call(this,O,T,ie,Z);return x.call(this,$,q,J,ae,D,te),this};var F=function(O,T,$,q){var J,ae,ie;if(typeof O=="string"&&i(O)===r){O=unescape(O);var Z=j(O,!1);(Z!==""||(Z=t.loadFile(O,!0))!==void 0)&&(O=Z)}if(g(O)&&(O=p(O,T)),T=i(O,T),!v(T))throw new Error("addImage does not support files of type '"+T+"', please ensure that a plugin for '"+T+"' support is added.");if(((ie=$)==null||ie.length===0)&&($=function(te){return typeof te=="string"||M(te)?k(te):M(te.data)?k(te.data):null}(O)),(J=y.call(this,$))||(O instanceof Uint8Array||T==="RGBA"||(ae=O,O=C(O)),J=this["process"+T.toUpperCase()](O,f.call(this),$,function(te){return te&&typeof te=="string"&&(te=te.toUpperCase()),te in t.image_compression?te:E.NONE}(q),ae)),!J)throw new Error("An unknown error occurred whilst processing the image.");return J},j=t.__addimage__.convertBase64ToBinaryString=function(O,T){T=typeof T!="boolean"||T;var $,q="";if(typeof O=="string"){var J;$=(J=A(O))!==null&&J!==void 0?J:O;try{q=K1($)}catch(ae){if(T)throw S($)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+ae.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return q};t.getImageProperties=function(O){var T,$,q="";if(g(O)&&(O=p(O)),typeof O=="string"&&i(O)===r&&((q=j(O,!1))===""&&(q=t.loadFile(O)||""),O=q),$=i(O),!v($))throw new Error("addImage does not support files of type '"+$+"', please ensure that a plugin for '"+$+"' support is added.");if(O instanceof Uint8Array||(O=C(O)),!(T=this["process"+$.toUpperCase()](O)))throw new Error("An unknown error occurred whilst processing the image");return T.fileType=$,T}})(tr.API),function(t){var e=function(r){if(r!==void 0&&r!="")return!0};tr.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(r){for(var n,i,a,o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(r.objId),h=r.pageContext.annotations,f=!1,v=0;v<h.length&&!f;v++)switch((n=h[v]).type){case"link":(e(n.options.url)||e(n.options.pageNumber))&&(f=!0);break;case"reference":case"text":case"freetext":f=!0}if(f!=0){this.internal.write("/Annots [");for(var g=0;g<h.length;g++){n=h[g];var p=this.internal.pdfEscape,y=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var _=this.internal.newAdditionalObject(),x=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(_.objId),E=n.title||"Note";a="<</Type /Annot /Subtype /Text "+(i="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+p(b(n.contents))+")",a+=" /Popup "+x.objId+" 0 R",a+=" /P "+u.objId+" 0 R",a+=" /T ("+p(b(E))+") >>",_.content=a;var k=_.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(i="/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 "+k,n.open&&(a+=" /Open true"),a+=" >>",x.content=a,this.internal.write(_.objId,"0 R",x.objId,"0 R");break;case"freetext":i="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var S=n.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+p(y(n.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+S+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(n.options.name){var A=this.annotations._nameMap[n.options.name];n.options.pageNumber=A.page,n.options.top=A.y}else n.options.top||(n.options.top=0);if(i="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",a="",n.options.url)a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+p(y(n.options.url))+") >>";else if(n.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+i+"/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":a+=" /Fit]";break;case"FitH":a+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,a+=" /FitV "+n.options.left+"]";break;default:var M=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),a+=" /XYZ "+n.options.left+" "+M+" "+n.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),t.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},t.link=function(r,n,i,a,o){var s=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:u(r),y:h(n),w:u(r+i),h:h(n+a)},options:o,type:"link"})},t.textWithLink=function(r,n,i,a){var o,s,u=this.getTextWidth(r),h=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){s=a.maxWidth;var f=this.splitTextToSize(r,s).length;o=Math.ceil(h*f)}else s=u,o=h;return this.text(r,n,i,a),i+=.2*h,a.align==="center"&&(n-=u/2),a.align==="right"&&(n-=u),this.link(n,i-h,s,o,a),u},t.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(tr.API),function(t){var e={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]},r={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},i=[1570,1571,1573,1575];t.__arabicParser__={};var a=t.__arabicParser__.isInArabicSubstitutionA=function(_){return e[_.charCodeAt(0)]!==void 0},o=t.__arabicParser__.isArabicLetter=function(_){return typeof _=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(_)},s=t.__arabicParser__.isArabicEndLetter=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length<=2},u=t.__arabicParser__.isArabicAlfLetter=function(_){return o(_)&&i.indexOf(_.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=1};var h=t.__arabicParser__.arabicLetterHasFinalForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=3};var f=t.__arabicParser__.arabicLetterHasMedialForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length==4},v=t.__arabicParser__.resolveLigatures=function(_){var x=0,b=r,E="",k=0;for(x=0;x<_.length;x+=1)b[_.charCodeAt(x)]!==void 0?(k++,typeof(b=b[_.charCodeAt(x)])=="number"&&(E+=String.fromCharCode(b),b=r,k=0),x===_.length-1&&(b=r,E+=_.charAt(x-(k-1)),x-=k-1,k=0)):(b=r,E+=_.charAt(x-k),x-=k,k=0);return E};t.__arabicParser__.isArabicDiacritic=function(_){return _!==void 0&&n[_.charCodeAt(0)]!==void 0};var g=t.__arabicParser__.getCorrectForm=function(_,x,b){return o(_)?a(_)===!1?-1:!h(_)||!o(x)&&!o(b)||!o(b)&&s(x)||s(_)&&!o(x)||s(_)&&u(x)||s(_)&&s(x)?0:f(_)&&o(x)&&!s(x)&&o(b)&&h(b)?3:s(_)||!o(b)?1:2:-1},p=function(_){var x=0,b=0,E=0,k="",S="",A="",M=(_=_||"").split("\\s+"),C=[];for(x=0;x<M.length;x+=1){for(C.push(""),b=0;b<M[x].length;b+=1)k=M[x][b],S=M[x][b-1],A=M[x][b+1],o(k)?(E=g(k,S,A),C[x]+=E!==-1?String.fromCharCode(e[k.charCodeAt(0)][E]):k):C[x]+=k;C[x]=v(C[x])}return C.join(" ")},y=t.__arabicParser__.processArabic=t.processArabic=function(){var _,x=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,b=[];if(Array.isArray(x)){var E=0;for(b=[],E=0;E<x.length;E+=1)Array.isArray(x[E])?b.push([p(x[E][0]),x[E][1],x[E][2]]):b.push([p(x[E])]);_=b}else _=p(x);return typeof arguments[0]=="string"?_:(arguments[0].text=_,arguments[0])};t.events.push(["preProcessText",y])}(tr.API),tr.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform",t.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=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 "+e+" 0 R")})),this},function(t){var e=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(s){r=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 i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(s){a=s}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(s){o=s}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(tr.API),function(t){var e={left:0,top:0,bottom:0,right:0},r=!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({},e),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(_){u=_}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(_){h=_}});var f=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return f},set:function(_){f=_}});var v=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return v},set:function(_){v=_}});var g=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return g},set:function(_){g=_}});var p=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return p},set:function(_){p=_}});var y=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return y},set:function(_){y=_}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(u){return n.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},t.getTextDimensions=function(u,h){n.call(this);var f=(h=h||{}).fontSize||this.getFontSize(),v=h.font||this.getFont(),g=h.scaleFactor||this.internal.scaleFactor,p=0,y=0,_=0,x=this;if(!Array.isArray(u)&&typeof u!="string"){if(typeof u!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");u=String(u)}var b=h.maxWidth;b>0?typeof u=="string"?u=this.splitTextToSize(u,b):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(k,S){return k.concat(x.splitTextToSize(S,b))},[])):u=Array.isArray(u)?u:[u];for(var E=0;E<u.length;E++)p<(_=this.getStringUnitWidth(u[E],{font:v})*f)&&(p=_);return p!==0&&(y=u.length),{w:p/=g,h:Math.max((y*f*this.getLineHeightFactor()-f*(this.getLineHeightFactor()-1))/g,0)}},t.cellAddPage=function(){n.call(this),this.addPage();var u=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new a(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=t.cell=function(){var u;u=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var h=this.internal.__cell__.lastCell,f=this.internal.__cell__.padding,v=this.internal.__cell__.margins||e,g=this.internal.__cell__.tableHeaderRow,p=this.internal.__cell__.printHeaders;return h.lineNumber!==void 0&&(h.lineNumber===u.lineNumber?(u.x=(h.x||0)+(h.width||0),u.y=h.y||0):h.y+h.height+u.height+v.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=v.top,p&&g&&(this.printHeaderRow(u.lineNumber,!0),u.y+=g[0].height)):u.y=h.y+h.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,r===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-f,u.y+f,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+f,{align:"center",baseline:"top",maxWidth:u.width-f-f}):this.text(u.text,u.x+f,u.y+f,{align:"left",baseline:"top",maxWidth:u.width-f-f})),this.internal.__cell__.lastCell=u,this};t.table=function(u,h,f,v,g){if(n.call(this),!f)throw new Error("No data for PDF table.");var p,y,_,x,b=[],E=[],k=[],S={},A={},M=[],C=[],I=(g=g||{}).autoSize||!1,F=g.printHeaders!==!1,j=g.css&&g.css["font-size"]!==void 0?16*g.css["font-size"]:g.fontSize||12,O=g.margins||Object.assign({width:this.getPageWidth()},e),T=typeof g.padding=="number"?g.padding:3,$=g.headerBackgroundColor||"#c8c8c8",q=g.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=F,this.internal.__cell__.margins=O,this.internal.__cell__.table_font_size=j,this.internal.__cell__.padding=T,this.internal.__cell__.headerBackgroundColor=$,this.internal.__cell__.headerTextColor=q,this.setFontSize(j),v==null)E=b=Object.keys(f[0]),k=b.map(function(){return"left"});else if(Array.isArray(v)&&Nn(v[0])==="object")for(b=v.map(function(V){return V.name}),E=v.map(function(V){return V.prompt||V.name||""}),k=v.map(function(V){return V.align||"left"}),p=0;p<v.length;p+=1)A[v[p].name]=.7499990551181103*v[p].width;else Array.isArray(v)&&typeof v[0]=="string"&&(E=b=v,k=b.map(function(){return"left"}));if(I||Array.isArray(v)&&typeof v[0]=="string")for(p=0;p<b.length;p+=1){for(S[x=b[p]]=f.map(function(V){return V[x]}),this.setFont(void 0,"bold"),M.push(this.getTextDimensions(E[p],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),y=S[x],this.setFont(void 0,"normal"),_=0;_<y.length;_+=1)M.push(this.getTextDimensions(y[_],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);A[x]=Math.max.apply(null,M)+T+T,M=[]}if(F){var J={};for(p=0;p<b.length;p+=1)J[b[p]]={},J[b[p]].text=E[p],J[b[p]].align=k[p];var ae=s.call(this,J,A);C=b.map(function(V){return new a(u,h,A[V],ae,J[V].text,void 0,J[V].align)}),this.setTableHeaderRow(C),this.printHeaderRow(1,!1)}var ie=v.reduce(function(V,B){return V[B.name]=B.align,V},{});for(p=0;p<f.length;p+=1){"rowStart"in g&&g.rowStart instanceof Function&&g.rowStart({row:p,data:f[p]},this);var Z=s.call(this,f[p],A);for(_=0;_<b.length;_+=1){var te=f[p][b[_]];"cellStart"in g&&g.cellStart instanceof Function&&g.cellStart({row:p,col:_,data:te},this),o.call(this,new a(u,h,A[b[_]],Z,te,p+2,ie[b[_]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=h,this};var s=function(u,h){var f=this.internal.__cell__.padding,v=this.internal.__cell__.table_font_size,g=this.internal.scaleFactor;return Object.keys(u).map(function(p){var y=u[p];return this.splitTextToSize(y.hasOwnProperty("text")?y.text:y,h[p]-f-f)},this).map(function(p){return this.getLineHeightFactor()*p.length*v/g+f+f},this).reduce(function(p,y){return Math.max(p,y)},0)};t.setTableHeaderRow=function(u){n.call(this),this.internal.__cell__.tableHeaderRow=u},t.printHeaderRow=function(u,h){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var f;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var v=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(v[0],v[1],v[2],v[3],void 0,-1)}this.setFont(void 0,"bold");for(var g=[],p=0;p<this.internal.__cell__.tableHeaderRow.length;p+=1){f=this.internal.__cell__.tableHeaderRow[p].clone(),h&&(f.y=this.internal.__cell__.margins.top||0,g.push(f)),f.lineNumber=u;var y=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,f),this.setTextColor(y)}g.length>0&&this.setTableHeaderRow(g),this.setFont(void 0,"normal"),r=!1}}(tr.API);var nx={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},ix=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Nm=rx(ix),ax=[100,200,300,400,500,600,700,800,900],jI=rx(ax);function Dv(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),r=function(a){return nx[a=a||"normal"]?a:"normal"}(t.style),n=function(a){return a?typeof a=="number"?a>=100&&a<=900&&a%100==0?a:400:/^\d00$/.test(a)?parseInt(a):a==="bold"?700:400:400}(t.weight),i=function(a){return typeof Nm[a=a||"normal"]=="number"?a:"normal"}(t.stretch);return{family:e,style:r,weight:n,stretch:i,src:t.src||[],ref:t.ref||{name:e,style:[i,r,n].join(" ")}}}function Pw(t,e,r,n){var i;for(i=r;i>=0&&i<e.length;i+=n)if(t[e[i]])return t[e[i]];for(i=r;i>=0&&i<e.length;i-=n)if(t[e[i]])return t[e[i]]}var DI={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Ow={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Cw(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function Lw(t){return t.trimLeft()}function FI(t,e){for(var r=0;r<t.length;){if(t.charAt(r)===e)return[t.substring(0,r),t.substring(r+1)];r+=1}return null}function BI(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var D1,Nw,Tw,Wh,F1,Rw,Mw,Iw,Fv=["times"];function jw(t,e,r,n,i){var a=4,o=Fw;switch(i){case tr.API.image_compression.FAST:a=1,o=Dw;break;case tr.API.image_compression.MEDIUM:a=6,o=Bw;break;case tr.API.image_compression.SLOW:a=9,o=zw}t=function(u,h,f,v){for(var g,p=u.length/h,y=new Uint8Array(u.length+p),_=[zI,Dw,Fw,Bw,zw],x=0;x<p;x+=1){var b=x*h,E=u.subarray(b,b+h);if(v)y.set(v(E,f,g),b+x);else{for(var k=_.length,S=[],A=0;A<k;A+=1)S[A]=_[A](E,f,g);var M=UI(S.concat());y.set(S[M],b+x)}g=E}return y}(t,e,Math.ceil(r*n/8),o);var s=Em(t,{level:a});return tr.API.__addimage__.arrayBufferToBinaryString(s)}function zI(t){var e=Array.apply([],t);return e.unshift(0),e}function Dw(t,e){var r=t.length,n=[];n[0]=1;for(var i=0;i<r;i+=1){var a=t[i-e]||0;n[i+1]=t[i]-a+256&255}return n}function Fw(t,e,r){var n=t.length,i=[];i[0]=2;for(var a=0;a<n;a+=1){var o=r&&r[a]||0;i[a+1]=t[a]-o+256&255}return i}function Bw(t,e,r){var n=t.length,i=[];i[0]=3;for(var a=0;a<n;a+=1){var o=t[a-e]||0,s=r&&r[a]||0;i[a+1]=t[a]+256-(o+s>>>1)&255}return i}function zw(t,e,r){var n=t.length,i=[];i[0]=4;for(var a=0;a<n;a+=1){var o=qI(t[a-e]||0,r&&r[a]||0,r&&r[a-e]||0);i[a+1]=t[a]-o+256&255}return i}function qI(t,e,r){if(t===e&&e===r)return t;var n=Math.abs(e-r),i=Math.abs(t-r),a=Math.abs(t+e-r-r);return n<=i&&n<=a?t:i<=a?e:r}function UI(t){var e=t.map(function(r){return r.reduce(function(n,i){return n+Math.abs(i)},0)});return e.indexOf(Math.min.apply(null,e))}function Bv(t,e,r){var n=e*r,i=Math.floor(n/8),a=16-(n-8*i+r),o=(1<<r)-1;return ox(t,i)>>a&o}function qw(t,e,r,n){var i=r*n,a=Math.floor(i/8),o=16-(i-8*a+n),s=(1<<n)-1,u=(e&s)<<o;(function(h,f,v){if(f+1<h.byteLength)h.setUint16(f,v,!1);else{var g=v>>8&255;h.setUint8(f,g)}})(t,a,ox(t,a)&~(s<<o)&65535|u)}function ox(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function HI(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var r=t[e++]|t[e++]<<8,n=t[e++]|t[e++]<<8,i=t[e++],a=i>>7,o=1<<1+(7&i);t[e++],t[e++];var s=null,u=null;a&&(s=e,u=o,e+=3*o);var h=!0,f=[],v=0,g=null,p=0,y=null;for(this.width=r,this.height=n;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,y=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((O=t[e++])>=0))throw Error("Invalid block size");if(O===0)break;e+=O}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var _=t[e++];v=t[e++]|t[e++]<<8,g=t[e++],1&_||(g=null),p=_>>2&7,e++;break;case 254:for(;;){if(!((O=t[e++])>=0))throw Error("Invalid block size");if(O===0)break;e+=O}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var x=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,E=t[e++]|t[e++]<<8,k=t[e++]|t[e++]<<8,S=t[e++],A=S>>6&1,M=1<<1+(7&S),C=s,I=u,F=!1;S>>7&&(F=!0,C=e,I=M,e+=3*M);var j=e;for(e++;;){var O;if(!((O=t[e++])>=0))throw Error("Invalid block size");if(O===0)break;e+=O}f.push({x,y:b,width:E,height:k,has_local_palette:F,palette_offset:C,palette_size:I,data_offset:j,data_length:e-j,transparent_index:g,interlaced:!!A,delay:v,disposal:p});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return y},this.frameInfo=function(T){if(T<0||T>=f.length)throw new Error("Frame index out of range.");return f[T]},this.decodeAndBlitFrameBGRA=function(T,$){var q=this.frameInfo(T),J=q.width*q.height,ae=new Uint8Array(J);Uw(t,q.data_offset,ae,J);var ie=q.palette_offset,Z=q.transparent_index;Z===null&&(Z=256);var te=q.width,V=r-te,B=te,D=4*(q.y*r+q.x),U=4*((q.y+q.height)*r+q.x),X=D,ee=4*V;q.interlaced===!0&&(ee+=4*r*7);for(var K=8,oe=0,me=ae.length;oe<me;++oe){var de=ae[oe];if(B===0&&(B=te,(X+=ee)>=U&&(ee=4*V+4*r*(K-1),X=D+(te+V)*(K<<1),K>>=1)),de===Z)X+=4;else{var ye=t[ie+3*de],Te=t[ie+3*de+1],Ce=t[ie+3*de+2];$[X++]=Ce,$[X++]=Te,$[X++]=ye,$[X++]=255}--B}},this.decodeAndBlitFrameRGBA=function(T,$){var q=this.frameInfo(T),J=q.width*q.height,ae=new Uint8Array(J);Uw(t,q.data_offset,ae,J);var ie=q.palette_offset,Z=q.transparent_index;Z===null&&(Z=256);var te=q.width,V=r-te,B=te,D=4*(q.y*r+q.x),U=4*((q.y+q.height)*r+q.x),X=D,ee=4*V;q.interlaced===!0&&(ee+=4*r*7);for(var K=8,oe=0,me=ae.length;oe<me;++oe){var de=ae[oe];if(B===0&&(B=te,(X+=ee)>=U&&(ee=4*V+4*r*(K-1),X=D+(te+V)*(K<<1),K>>=1)),de===Z)X+=4;else{var ye=t[ie+3*de],Te=t[ie+3*de+1],Ce=t[ie+3*de+2];$[X++]=ye,$[X++]=Te,$[X++]=Ce,$[X++]=255}--B}}}function Uw(t,e,r,n){for(var i=t[e++],a=1<<i,o=a+1,s=o+1,u=i+1,h=(1<<u)-1,f=0,v=0,g=0,p=t[e++],y=new Int32Array(4096),_=null;;){for(;f<16&&p!==0;)v|=t[e++]<<f,f+=8,p===1?p=t[e++]:--p;if(f<u)break;var x=v&h;if(v>>=u,f-=u,x!==a){if(x===o)break;for(var b=x<s?x:_,E=0,k=b;k>a;)k=y[k]>>8,++E;var S=k;if(g+E+(b!==x?1:0)>n)return void Yn.log("Warning, gif stream longer than expected.");r[g++]=S;var A=g+=E;for(b!==x&&(r[g++]=S),k=b;E--;)k=y[k],r[--A]=255&k,k>>=8;_!==null&&s<4096&&(y[s++]=_<<8|S,s>=h+1&&u<12&&(++u,h=h<<1|1)),_=x}else s=o+1,h=(1<<(u=i+1))-1,_=null}return g!==n&&Yn.log("Warning, gif stream shorter than expected."),r}/**
514
+ * @license
515
+ Copyright (c) 2008, Adobe Systems Incorporated
516
+ All rights reserved.
517
+
518
+ Redistribution and use in source and binary forms, with or without
519
+ modification, are permitted provided that the following conditions are
520
+ met:
521
+
522
+ * Redistributions of source code must retain the above copyright notice,
523
+ this list of conditions and the following disclaimer.
524
+
525
+ * Redistributions in binary form must reproduce the above copyright
526
+ notice, this list of conditions and the following disclaimer in the
527
+ documentation and/or other materials provided with the distribution.
528
+
529
+ * Neither the name of Adobe Systems Incorporated nor the names of its
530
+ contributors may be used to endorse or promote products derived from
531
+ this software without specific prior written permission.
532
+
533
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
534
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
535
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
536
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
537
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
538
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
539
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
540
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
541
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
542
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
543
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
544
+ */function zv(t){var e,r,n,i,a,o=Math.floor,s=new Array(64),u=new Array(64),h=new Array(64),f=new Array(64),v=new Array(65535),g=new Array(65535),p=new Array(64),y=new Array(64),_=[],x=0,b=7,E=new Array(64),k=new Array(64),S=new Array(64),A=new Array(256),M=new Array(2048),C=[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],I=[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],T=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],q=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],J=[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 ae(D,U){for(var X=0,ee=0,K=new Array,oe=1;oe<=16;oe++){for(var me=1;me<=D[oe];me++)K[U[ee]]=[],K[U[ee]][0]=X,K[U[ee]][1]=oe,ee++,X++;X*=2}return K}function ie(D){for(var U=D[0],X=D[1]-1;X>=0;)U&1<<X&&(x|=1<<b),X--,--b<0&&(x==255?(Z(255),Z(0)):Z(x),b=7,x=0)}function Z(D){_.push(D)}function te(D){Z(D>>8&255),Z(255&D)}function V(D,U,X,ee,K){for(var oe,me=K[0],de=K[240],ye=function(fe,Le){var Ne,ue,ke,Pe,Ue,st,dt,pt,xt,bt,At=0;for(xt=0;xt<8;++xt){Ne=fe[At],ue=fe[At+1],ke=fe[At+2],Pe=fe[At+3],Ue=fe[At+4],st=fe[At+5],dt=fe[At+6];var Br=Ne+(pt=fe[At+7]),_r=Ne-pt,It=ue+dt,Jt=ue-dt,Ve=ke+st,qe=ke-st,Nt=Pe+Ue,Ct=Pe-Ue,ir=Br+Nt,Ut=Br-Nt,xr=It+Ve,er=It-Ve;fe[At]=ir+xr,fe[At+4]=ir-xr;var pr=.707106781*(er+Ut);fe[At+2]=Ut+pr,fe[At+6]=Ut-pr;var Fi=.382683433*((ir=Ct+qe)-(er=Jt+_r)),oi=.5411961*ir+Fi,Ei=1.306562965*er+Fi,Sn=.707106781*(xr=qe+Jt),Zt=_r+Sn,ca=_r-Sn;fe[At+5]=ca+oi,fe[At+3]=ca-oi,fe[At+1]=Zt+Ei,fe[At+7]=Zt-Ei,At+=8}for(At=0,xt=0;xt<8;++xt){Ne=fe[At],ue=fe[At+8],ke=fe[At+16],Pe=fe[At+24],Ue=fe[At+32],st=fe[At+40],dt=fe[At+48];var Fa=Ne+(pt=fe[At+56]),Kn=Ne-pt,Yi=ue+dt,zr=ue-dt,En=ke+st,Rn=ke-st,Sa=Pe+Ue,Uo=Pe-Ue,Ea=Fa+Sa,eo=Fa-Sa,si=Yi+En,Aa=Yi-En;fe[At]=Ea+si,fe[At+32]=Ea-si;var ka=.707106781*(Aa+eo);fe[At+16]=eo+ka,fe[At+48]=eo-ka;var Ho=.382683433*((Ea=Uo+Rn)-(Aa=zr+Kn)),Bi=.5411961*Ea+Ho,to=1.306562965*Aa+Ho,Ds=.707106781*(si=Rn+zr),rs=Kn+Ds,su=Kn-Ds;fe[At+40]=su+Bi,fe[At+24]=su-Bi,fe[At+8]=rs+to,fe[At+56]=rs-to,At++}for(xt=0;xt<64;++xt)bt=fe[xt]*Le[xt],p[xt]=bt>0?bt+.5|0:bt-.5|0;return p}(D,U),Te=0;Te<64;++Te)y[C[Te]]=ye[Te];var Ce=y[0]-X;X=y[0],Ce==0?ie(ee[0]):(ie(ee[g[oe=32767+Ce]]),ie(v[oe]));for(var Ie=63;Ie>0&&y[Ie]==0;)Ie--;if(Ie==0)return ie(me),X;for(var Ee,ge=1;ge<=Ie;){for(var Re=ge;y[ge]==0&&ge<=Ie;)++ge;var Be=ge-Re;if(Be>=16){Ee=Be>>4;for(var Oe=1;Oe<=Ee;++Oe)ie(de);Be&=15}oe=32767+y[ge],ie(K[(Be<<4)+g[oe]]),ie(v[oe]),ge++}return Ie!=63&&ie(me),X}function B(D){D=Math.min(Math.max(D,1),100),a!=D&&(function(U){for(var X=[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],ee=0;ee<64;ee++){var K=o((X[ee]*U+50)/100);K=Math.min(Math.max(K,1),255),s[C[ee]]=K}for(var oe=[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],me=0;me<64;me++){var de=o((oe[me]*U+50)/100);de=Math.min(Math.max(de,1),255),u[C[me]]=de}for(var ye=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Te=0,Ce=0;Ce<8;Ce++)for(var Ie=0;Ie<8;Ie++)h[Te]=1/(s[C[Te]]*ye[Ce]*ye[Ie]*8),f[Te]=1/(u[C[Te]]*ye[Ce]*ye[Ie]*8),Te++}(D<50?Math.floor(5e3/D):Math.floor(200-2*D)),a=D)}this.encode=function(D,U){U&&B(U),_=new Array,x=0,b=7,te(65496),te(65504),te(16),Z(74),Z(70),Z(73),Z(70),Z(0),Z(1),Z(1),Z(0),te(1),te(1),Z(0),Z(0),function(){te(65499),te(132),Z(0);for(var ue=0;ue<64;ue++)Z(s[ue]);Z(1);for(var ke=0;ke<64;ke++)Z(u[ke])}(),function(ue,ke){te(65472),te(17),Z(8),te(ke),te(ue),Z(3),Z(1),Z(17),Z(0),Z(2),Z(17),Z(1),Z(3),Z(17),Z(1)}(D.width,D.height),function(){te(65476),te(418),Z(0);for(var ue=0;ue<16;ue++)Z(I[ue+1]);for(var ke=0;ke<=11;ke++)Z(F[ke]);Z(16);for(var Pe=0;Pe<16;Pe++)Z(j[Pe+1]);for(var Ue=0;Ue<=161;Ue++)Z(O[Ue]);Z(1);for(var st=0;st<16;st++)Z(T[st+1]);for(var dt=0;dt<=11;dt++)Z($[dt]);Z(17);for(var pt=0;pt<16;pt++)Z(q[pt+1]);for(var xt=0;xt<=161;xt++)Z(J[xt])}(),te(65498),te(12),Z(3),Z(1),Z(0),Z(2),Z(17),Z(3),Z(17),Z(0),Z(63),Z(0);var X=0,ee=0,K=0;x=0,b=7,this.encode.displayName="_encode_";for(var oe,me,de,ye,Te,Ce,Ie,Ee,ge,Re=D.data,Be=D.width,Oe=D.height,fe=4*Be,Le=0;Le<Oe;){for(oe=0;oe<fe;){for(Te=fe*Le+oe,Ie=-1,Ee=0,ge=0;ge<64;ge++)Ce=Te+(Ee=ge>>3)*fe+(Ie=4*(7&ge)),Le+Ee>=Oe&&(Ce-=fe*(Le+1+Ee-Oe)),oe+Ie>=fe&&(Ce-=oe+Ie-fe+4),me=Re[Ce++],de=Re[Ce++],ye=Re[Ce++],E[ge]=(M[me]+M[de+256|0]+M[ye+512|0]>>16)-128,k[ge]=(M[me+768|0]+M[de+1024|0]+M[ye+1280|0]>>16)-128,S[ge]=(M[me+1280|0]+M[de+1536|0]+M[ye+1792|0]>>16)-128;X=V(E,h,X,e,n),ee=V(k,f,ee,r,i),K=V(S,f,K,r,i),oe+=32}Le+=8}if(b>=0){var Ne=[];Ne[1]=b+1,Ne[0]=(1<<b+1)-1,ie(Ne)}return te(65497),new Uint8Array(_)},t=t||50,function(){for(var D=String.fromCharCode,U=0;U<256;U++)A[U]=D(U)}(),e=ae(I,F),r=ae(T,$),n=ae(j,O),i=ae(q,J),function(){for(var D=1,U=2,X=1;X<=15;X++){for(var ee=D;ee<U;ee++)g[32767+ee]=X,v[32767+ee]=[],v[32767+ee][1]=X,v[32767+ee][0]=ee;for(var K=-(U-1);K<=-D;K++)g[32767+K]=X,v[32767+K]=[],v[32767+K][1]=X,v[32767+K][0]=U-1+K;D<<=1,U<<=1}}(),function(){for(var D=0;D<256;D++)M[D]=19595*D,M[D+256|0]=38470*D,M[D+512|0]=7471*D+32768,M[D+768|0]=-11059*D,M[D+1024|0]=-21709*D,M[D+1280|0]=32768*D+8421375,M[D+1536|0]=-27439*D,M[D+1792|0]=-5329*D}(),B(t)}/**
545
+ * @license
546
+ * Copyright (c) 2017 Aras Abbasi
547
+ *
548
+ * Licensed under the MIT License.
549
+ * http://opensource.org/licenses/mit-license
550
+ */function Kl(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,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(t){function e(F){if(!F)throw Error("assert :P")}function r(F,j,O){for(var T=0;4>T;T++)if(F[j+T]!=O.charCodeAt(T))return!0;return!1}function n(F,j,O,T,$){for(var q=0;q<$;q++)F[j+q]=O[T+q]}function i(F,j,O,T){for(var $=0;$<T;$++)F[j+$]=O}function a(F){return new Int32Array(F)}function o(F,j){for(var O=[],T=0;T<F;T++)O.push(new j);return O}function s(F,j){var O=[];return function T($,q,J){for(var ae=J[q],ie=0;ie<ae&&($.push(J.length>q+1?[]:new j),!(J.length<q+1));ie++)T($[ie],q+1,J)}(O,0,F),O}var u=function(){var F=this;function j(P,R){for(var Y=1<<R-1>>>0;P&Y;)Y>>>=1;return Y?(P&Y-1)+Y:P}function O(P,R,Y,re,le){e(!(re%Y));do P[R+(re-=Y)]=le;while(0<re)}function T(P,R,Y,re,le){if(e(2328>=le),512>=le)var pe=a(512);else if((pe=a(le))==null)return 0;return function(ve,be,we,Se,Fe,Je){var xe,$e,Qe=be,lt=1<<we,Xe=a(16),ot=a(16);for(e(Fe!=0),e(Se!=null),e(ve!=null),e(0<we),$e=0;$e<Fe;++$e){if(15<Se[$e])return 0;++Xe[Se[$e]]}if(Xe[0]==Fe)return 0;for(ot[1]=0,xe=1;15>xe;++xe){if(Xe[xe]>1<<xe)return 0;ot[xe+1]=ot[xe]+Xe[xe]}for($e=0;$e<Fe;++$e)xe=Se[$e],0<Se[$e]&&(Je[ot[xe]++]=$e);if(ot[15]==1)return(Se=new $).g=0,Se.value=Je[0],O(ve,Qe,1,lt,Se),lt;var He,ft=-1,ht=lt-1,Wt=0,Bt=1,hr=1,zt=1<<we;for($e=0,xe=1,Fe=2;xe<=we;++xe,Fe<<=1){if(Bt+=hr<<=1,0>(hr-=Xe[xe]))return 0;for(;0<Xe[xe];--Xe[xe])(Se=new $).g=xe,Se.value=Je[$e++],O(ve,Qe+Wt,Fe,zt,Se),Wt=j(Wt,xe)}for(xe=we+1,Fe=2;15>=xe;++xe,Fe<<=1){if(Bt+=hr<<=1,0>(hr-=Xe[xe]))return 0;for(;0<Xe[xe];--Xe[xe]){if(Se=new $,(Wt&ht)!=ft){for(Qe+=zt,He=1<<(ft=xe)-we;15>ft&&!(0>=(He-=Xe[ft]));)++ft,He<<=1;lt+=zt=1<<(He=ft-we),ve[be+(ft=Wt&ht)].g=He+we,ve[be+ft].value=Qe-be-ft}Se.g=xe-we,Se.value=Je[$e++],O(ve,Qe+(Wt>>we),Fe,zt,Se),Wt=j(Wt,xe)}}return Bt!=2*ot[15]-1?0:lt}(P,R,Y,re,le,pe)}function $(){this.value=this.g=0}function q(){this.value=this.g=0}function J(){this.G=o(5,$),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Oi,q)}function ae(P,R,Y,re){e(P!=null),e(R!=null),e(2147483648>re),P.Ca=254,P.I=0,P.b=-8,P.Ka=0,P.oa=R,P.pa=Y,P.Jd=R,P.Yc=Y+re,P.Zc=4<=re?Y+re-4+1:Y,me(P)}function ie(P,R){for(var Y=0;0<R--;)Y|=ye(P,128)<<R;return Y}function Z(P,R){var Y=ie(P,R);return de(P)?-Y:Y}function te(P,R,Y,re){var le,pe=0;for(e(P!=null),e(R!=null),e(4294967288>re),P.Sb=re,P.Ra=0,P.u=0,P.h=0,4<re&&(re=4),le=0;le<re;++le)pe+=R[Y+le]<<8*le;P.Ra=pe,P.bb=re,P.oa=R,P.pa=Y}function V(P){for(;8<=P.u&&P.bb<P.Sb;)P.Ra>>>=8,P.Ra+=P.oa[P.pa+P.bb]<<ha-8>>>0,++P.bb,P.u-=8;ee(P)&&(P.h=1,P.u=0)}function B(P,R){if(e(0<=R),!P.h&&R<=Wa){var Y=X(P)&Na[R];return P.u+=R,V(P),Y}return P.h=1,P.u=0}function D(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function U(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function X(P){return P.Ra>>>(P.u&ha-1)>>>0}function ee(P){return e(P.bb<=P.Sb),P.h||P.bb==P.Sb&&P.u>ha}function K(P,R){P.u=R,P.h=ee(P)}function oe(P){P.u>=Ji&&(e(P.u>=Ji),V(P))}function me(P){e(P!=null&&P.oa!=null),P.pa<P.Zc?(P.I=(P.oa[P.pa++]|P.I<<8)>>>0,P.b+=8):(e(P!=null&&P.oa!=null),P.pa<P.Yc?(P.b+=8,P.I=P.oa[P.pa++]|P.I<<8):P.Ka?P.b=0:(P.I<<=8,P.b+=8,P.Ka=1))}function de(P){return ie(P,1)}function ye(P,R){var Y=P.Ca;0>P.b&&me(P);var re=P.b,le=Y*R>>>8,pe=(P.I>>>re>le)+0;for(pe?(Y-=le,P.I-=le+1<<re>>>0):Y=le+1,re=Y,le=0;256<=re;)le+=8,re>>=8;return re=7^le+No[re],P.b-=re,P.Ca=(Y<<re)-1,pe}function Te(P,R,Y){P[R+0]=Y>>24&255,P[R+1]=Y>>16&255,P[R+2]=Y>>8&255,P[R+3]=255&Y}function Ce(P,R){return P[R+0]|P[R+1]<<8}function Ie(P,R){return Ce(P,R)|P[R+2]<<16}function Ee(P,R){return Ce(P,R)|Ce(P,R+2)<<16}function ge(P,R){var Y=1<<R;return e(P!=null),e(0<R),P.X=a(Y),P.X==null?0:(P.Mb=32-R,P.Xa=R,1)}function Re(P,R){e(P!=null),e(R!=null),e(P.Xa==R.Xa),n(R.X,0,P.X,0,1<<R.Xa)}function Be(){this.X=[],this.Xa=this.Mb=0}function Oe(P,R,Y,re){e(Y!=null),e(re!=null);var le=Y[0],pe=re[0];return le==0&&(le=(P*pe+R/2)/R),pe==0&&(pe=(R*le+P/2)/P),0>=le||0>=pe?0:(Y[0]=le,re[0]=pe,1)}function fe(P,R){return P+(1<<R)-1>>>R}function Le(P,R){return((4278255360&P)+(4278255360&R)>>>0&4278255360)+((16711935&P)+(16711935&R)>>>0&16711935)>>>0}function Ne(P,R){F[R]=function(Y,re,le,pe,ve,be,we){var Se;for(Se=0;Se<ve;++Se){var Fe=F[P](be[we+Se-1],le,pe+Se);be[we+Se]=Le(Y[re+Se],Fe)}}}function ue(){this.ud=this.hd=this.jd=0}function ke(P,R){return((4278124286&(P^R))>>>1)+(P&R)>>>0}function Pe(P){return 0<=P&&256>P?P:0>P?0:255<P?255:void 0}function Ue(P,R){return Pe(P+(P-R+.5>>1))}function st(P,R,Y){return Math.abs(R-Y)-Math.abs(P-Y)}function dt(P,R,Y,re,le,pe,ve){for(re=pe[ve-1],Y=0;Y<le;++Y)pe[ve+Y]=re=Le(P[R+Y],re)}function pt(P,R,Y,re,le){var pe;for(pe=0;pe<Y;++pe){var ve=P[R+pe],be=ve>>8&255,we=16711935&(we=(we=16711935&ve)+((be<<16)+be));re[le+pe]=(4278255360&ve)+we>>>0}}function xt(P,R){R.jd=255&P,R.hd=P>>8&255,R.ud=P>>16&255}function bt(P,R,Y,re,le,pe){var ve;for(ve=0;ve<re;++ve){var be=R[Y+ve],we=be>>>8,Se=be,Fe=255&(Fe=(Fe=be>>>16)+((P.jd<<24>>24)*(we<<24>>24)>>>5));Se=255&(Se=(Se+=(P.hd<<24>>24)*(we<<24>>24)>>>5)+((P.ud<<24>>24)*(Fe<<24>>24)>>>5)),le[pe+ve]=(4278255360&be)+(Fe<<16)+Se}}function At(P,R,Y,re,le){F[R]=function(pe,ve,be,we,Se,Fe,Je,xe,$e){for(we=Je;we<xe;++we)for(Je=0;Je<$e;++Je)Se[Fe++]=le(be[re(pe[ve++])])},F[P]=function(pe,ve,be,we,Se,Fe,Je){var xe=8>>pe.b,$e=pe.Ea,Qe=pe.K[0],lt=pe.w;if(8>xe)for(pe=(1<<pe.b)-1,lt=(1<<xe)-1;ve<be;++ve){var Xe,ot=0;for(Xe=0;Xe<$e;++Xe)Xe&pe||(ot=re(we[Se++])),Fe[Je++]=le(Qe[ot&lt]),ot>>=xe}else F["VP8LMapColor"+Y](we,Se,Qe,lt,Fe,Je,ve,be,$e)}}function Br(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=P[R++];re[le++]=pe>>16&255,re[le++]=pe>>8&255,re[le++]=255&pe}}function _r(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=P[R++];re[le++]=pe>>16&255,re[le++]=pe>>8&255,re[le++]=255&pe,re[le++]=pe>>24&255}}function It(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=(ve=P[R++])>>16&240|ve>>12&15,ve=240&ve|ve>>28&15;re[le++]=pe,re[le++]=ve}}function Jt(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=(ve=P[R++])>>16&248|ve>>13&7,ve=ve>>5&224|ve>>3&31;re[le++]=pe,re[le++]=ve}}function Ve(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=P[R++];re[le++]=255&pe,re[le++]=pe>>8&255,re[le++]=pe>>16&255}}function qe(P,R,Y,re,le,pe){if(pe==0)for(Y=R+Y;R<Y;)Te(re,((pe=P[R++])[0]>>24|pe[1]>>8&65280|pe[2]<<8&16711680|pe[3]<<24)>>>0),le+=32;else n(re,le,P,R,Y)}function Nt(P,R){F[R][0]=F[P+"0"],F[R][1]=F[P+"1"],F[R][2]=F[P+"2"],F[R][3]=F[P+"3"],F[R][4]=F[P+"4"],F[R][5]=F[P+"5"],F[R][6]=F[P+"6"],F[R][7]=F[P+"7"],F[R][8]=F[P+"8"],F[R][9]=F[P+"9"],F[R][10]=F[P+"10"],F[R][11]=F[P+"11"],F[R][12]=F[P+"12"],F[R][13]=F[P+"13"],F[R][14]=F[P+"0"],F[R][15]=F[P+"0"]}function Ct(P){return P==zl||P==$s||P==gu||P==vu}function ir(){this.eb=[],this.size=this.A=this.fb=0}function Ut(){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 xr(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ir,this.f.kb=new Ut,this.sd=null}function er(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function pr(){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 Fi(P){return alert("todo:WebPSamplerProcessPlane"),P.T}function oi(P,R){var Y=P.T,re=R.ba.f.RGBA,le=re.eb,pe=re.fb+P.ka*re.A,ve=Ra[R.ba.S],be=P.y,we=P.O,Se=P.f,Fe=P.N,Je=P.ea,xe=P.W,$e=R.cc,Qe=R.dc,lt=R.Mc,Xe=R.Nc,ot=P.ka,He=P.ka+P.T,ft=P.U,ht=ft+1>>1;for(ot==0?ve(be,we,null,null,Se,Fe,Je,xe,Se,Fe,Je,xe,le,pe,null,null,ft):(ve(R.ec,R.fc,be,we,$e,Qe,lt,Xe,Se,Fe,Je,xe,le,pe-re.A,le,pe,ft),++Y);ot+2<He;ot+=2)$e=Se,Qe=Fe,lt=Je,Xe=xe,Fe+=P.Rc,xe+=P.Rc,pe+=2*re.A,ve(be,(we+=2*P.fa)-P.fa,be,we,$e,Qe,lt,Xe,Se,Fe,Je,xe,le,pe-re.A,le,pe,ft);return we+=P.fa,P.j+He<P.o?(n(R.ec,R.fc,be,we,ft),n(R.cc,R.dc,Se,Fe,ht),n(R.Mc,R.Nc,Je,xe,ht),Y--):1&He||ve(be,we,null,null,Se,Fe,Je,xe,Se,Fe,Je,xe,le,pe+re.A,null,null,ft),Y}function Ei(P,R,Y){var re=P.F,le=[P.J];if(re!=null){var pe=P.U,ve=R.ba.S,be=ve==pu||ve==gu;R=R.ba.f.RGBA;var we=[0],Se=P.ka;we[0]=P.T,P.Kb&&(Se==0?--we[0]:(--Se,le[0]-=P.width),P.j+P.ka+P.T==P.o&&(we[0]=P.o-P.j-Se));var Fe=R.eb;Se=R.fb+Se*R.A,P=jl(re,le[0],P.width,pe,we,Fe,Se+(be?0:3),R.A),e(Y==we),P&&Ct(ve)&&Vo(Fe,Se,be,pe,we,R.A)}return 0}function Sn(P){var R=P.ma,Y=R.ba.S,re=11>Y,le=Y==Xo||Y==Bl||Y==pu||Y==fn||Y==12||Ct(Y);if(R.memory=null,R.Ib=null,R.Jb=null,R.Nd=null,!vl(R.Oa,P,le?11:12))return 0;if(le&&Ct(Y)&&Oc(),P.da)alert("todo:use_scaling");else{if(re){if(R.Ib=Fi,P.Kb){if(Y=P.U+1>>1,R.memory=a(P.U+2*Y),R.memory==null)return 0;R.ec=R.memory,R.fc=0,R.cc=R.ec,R.dc=R.fc+P.U,R.Mc=R.cc,R.Nc=R.dc+Y,R.Ib=oi,Oc()}}else alert("todo:EmitYUV");le&&(R.Jb=Ei,re&&Po())}if(re&&!Ui){for(P=0;256>P;++P)va[P]=89858*(P-128)+Mo>>ys,ma[P]=-22014*(P-128)+Mo,Ul[P]=-45773*(P-128),wl[P]=113618*(P-128)+Mo>>ys;for(P=en;P<sn;++P)R=76283*(P-16)+Mo>>ys,wu[P-en]=zn(R,255),Mf[P-en]=zn(R+8>>4,15);Ui=1}return 1}function Zt(P){var R=P.ma,Y=P.U,re=P.T;return e(!(1&P.ka)),0>=Y||0>=re?0:(Y=R.Ib(P,R),R.Jb!=null&&R.Jb(P,R,Y),R.Dc+=Y,1)}function ca(P){P.ma.memory=null}function Fa(P,R,Y,re){return B(P,8)!=47?0:(R[0]=B(P,14)+1,Y[0]=B(P,14)+1,re[0]=B(P,1),B(P,3)!=0?0:!P.h)}function Kn(P,R){if(4>P)return P+1;var Y=P-2>>1;return(2+(1&P)<<Y)+B(R,Y)+1}function Yi(P,R){return 120<R?R-120:1<=(Y=((Y=Eh[R-1])>>4)*P+(8-(15&Y)))?Y:1;var Y}function zr(P,R,Y){var re=X(Y),le=P[R+=255&re].g-8;return 0<le&&(K(Y,Y.u+8),re=X(Y),R+=P[R].value,R+=re&(1<<le)-1),K(Y,Y.u+P[R].g),P[R].value}function En(P,R,Y){return Y.g+=P.g,Y.value+=P.value<<R>>>0,e(8>=Y.g),P.g}function Rn(P,R,Y){var re=P.xc;return e((R=re==0?0:P.vc[P.md*(Y>>re)+(R>>re)])<P.Wb),P.Ya[R]}function Sa(P,R,Y,re){var le=P.ab,pe=P.c*R,ve=P.C;R=ve+R;var be=Y,we=re;for(re=P.Ta,Y=P.Ua;0<le--;){var Se=P.gc[le],Fe=ve,Je=R,xe=be,$e=we,Qe=(we=re,be=Y,Se.Ea);switch(e(Fe<Je),e(Je<=Se.nc),Se.hc){case 2:Jn(xe,$e,(Je-Fe)*Qe,we,be);break;case 0:var lt=Fe,Xe=Je,ot=we,He=be,ft=(zt=Se).Ea;lt==0&&(hs(xe,$e,null,null,1,ot,He),dt(xe,$e+1,0,0,ft-1,ot,He+1),$e+=ft,He+=ft,++lt);for(var ht=1<<zt.b,Wt=ht-1,Bt=fe(ft,zt.b),hr=zt.K,zt=zt.w+(lt>>zt.b)*Bt;lt<Xe;){var Pr=hr,qn=zt,vr=1;for(lo(xe,$e,ot,He-ft,1,ot,He);vr<ft;){var Ft=(vr&~Wt)+ht;Ft>ft&&(Ft=ft),(0,da[Pr[qn++]>>8&15])(xe,$e+ +vr,ot,He+vr-ft,Ft-vr,ot,He+vr),vr=Ft}$e+=ft,He+=ft,++lt&Wt||(zt+=Bt)}Je!=Se.nc&&n(we,be-Qe,we,be+(Je-Fe-1)*Qe,Qe);break;case 1:for(Qe=xe,Xe=$e,ft=(xe=Se.Ea)-(He=xe&~(ot=($e=1<<Se.b)-1)),lt=fe(xe,Se.b),ht=Se.K,Se=Se.w+(Fe>>Se.b)*lt;Fe<Je;){for(Wt=ht,Bt=Se,hr=new ue,zt=Xe+He,Pr=Xe+xe;Xe<zt;)xt(Wt[Bt++],hr),ml(hr,Qe,Xe,$e,we,be),Xe+=$e,be+=$e;Xe<Pr&&(xt(Wt[Bt++],hr),ml(hr,Qe,Xe,ft,we,be),Xe+=ft,be+=ft),++Fe&ot||(Se+=lt)}break;case 3:if(xe==we&&$e==be&&0<Se.b){for(Xe=we,xe=Qe=be+(Je-Fe)*Qe-(He=(Je-Fe)*fe(Se.Ea,Se.b)),$e=we,ot=be,lt=[],He=(ft=He)-1;0<=He;--He)lt[He]=$e[ot+He];for(He=ft-1;0<=He;--He)Xe[xe+He]=lt[He];Go(Se,Fe,Je,we,Qe,we,be)}else Go(Se,Fe,Je,xe,$e,we,be)}be=re,we=Y}we!=Y&&n(re,Y,be,we,pe)}function Uo(P,R){var Y=P.V,re=P.Ba+P.c*P.C,le=R-P.C;if(e(R<=P.l.o),e(16>=le),0<le){var pe=P.l,ve=P.Ta,be=P.Ua,we=pe.width;if(Sa(P,le,Y,re),le=be=[be],e((Y=P.C)<(re=R)),e(pe.v<pe.va),re>pe.o&&(re=pe.o),Y<pe.j){var Se=pe.j-Y;Y=pe.j,le[0]+=Se*we}if(Y>=re?Y=0:(le[0]+=4*pe.v,pe.ka=Y-pe.j,pe.U=pe.va-pe.v,pe.T=re-Y,Y=1),Y){if(be=be[0],11>(Y=P.ca).S){var Fe=Y.f.RGBA,Je=(re=Y.S,le=pe.U,pe=pe.T,Se=Fe.eb,Fe.A),xe=pe;for(Fe=Fe.fb+P.Ma*Fe.A;0<xe--;){var $e=ve,Qe=be,lt=le,Xe=Se,ot=Fe;switch(re){case Fl:Wo($e,Qe,lt,Xe,ot);break;case Xo:ds($e,Qe,lt,Xe,ot);break;case zl:ds($e,Qe,lt,Xe,ot),Vo(Xe,ot,0,lt,1,0);break;case Nf:gs($e,Qe,lt,Xe,ot);break;case Bl:qe($e,Qe,lt,Xe,ot,1);break;case $s:qe($e,Qe,lt,Xe,ot,1),Vo(Xe,ot,0,lt,1,0);break;case pu:qe($e,Qe,lt,Xe,ot,0);break;case gu:qe($e,Qe,lt,Xe,ot,0),Vo(Xe,ot,1,lt,1,0);break;case fn:ps($e,Qe,lt,Xe,ot);break;case vu:ps($e,Qe,lt,Xe,ot),Xu(Xe,ot,lt,1,0);break;case Ku:Jr($e,Qe,lt,Xe,ot);break;default:e(0)}be+=we,Fe+=Je}P.Ma+=pe}else alert("todo:EmitRescaledRowsYUVA");e(P.Ma<=Y.height)}}P.C=R,e(P.C<=P.i)}function Ea(P){var R;if(0<P.ua)return 0;for(R=0;R<P.Wb;++R){var Y=P.Ya[R].G,re=P.Ya[R].H;if(0<Y[1][re[1]+0].g||0<Y[2][re[2]+0].g||0<Y[3][re[3]+0].g)return 0}return 1}function eo(P,R,Y,re,le,pe){if(P.Z!=0){var ve=P.qd,be=P.rd;for(e(ra[P.Z]!=null);R<Y;++R)ra[P.Z](ve,be,re,le,re,le,pe),ve=re,be=le,le+=pe;P.qd=ve,P.rd=be}}function si(P,R){var Y=P.l.ma,re=Y.Z==0||Y.Z==1?P.l.j:P.C;if(re=P.C<re?re:P.C,e(R<=P.l.o),R>re){var le=P.l.width,pe=Y.ca,ve=Y.tb+le*re,be=P.V,we=P.Ba+P.c*re,Se=P.gc;e(P.ab==1),e(Se[0].hc==3),Ta(Se[0],re,R,be,we,pe,ve),eo(Y,re,R,pe,ve,le)}P.C=P.Ma=R}function Aa(P,R,Y,re,le,pe,ve){var be=P.$/re,we=P.$%re,Se=P.m,Fe=P.s,Je=Y+P.$,xe=Je;le=Y+re*le;var $e=Y+re*pe,Qe=280+Fe.ua,lt=P.Pb?be:16777216,Xe=0<Fe.ua?Fe.Wa:null,ot=Fe.wc,He=Je<$e?Rn(Fe,we,be):null;e(P.C<pe),e($e<=le);var ft=!1;e:for(;;){for(;ft||Je<$e;){var ht=0;if(be>=lt){var Wt=Je-Y;e((lt=P).Pb),lt.wd=lt.m,lt.xd=Wt,0<lt.s.ua&&Re(lt.s.Wa,lt.s.vb),lt=be+Zu}if(we&ot||(He=Rn(Fe,we,be)),e(He!=null),He.Qb&&(R[Je]=He.qb,ft=!0),!ft)if(oe(Se),He.jc){ht=Se,Wt=R;var Bt=Je,hr=He.pd[X(ht)&Oi-1];e(He.jc),256>hr.g?(K(ht,ht.u+hr.g),Wt[Bt]=hr.value,ht=0):(K(ht,ht.u+hr.g-256),e(256<=hr.value),ht=hr.value),ht==0&&(ft=!0)}else ht=zr(He.G[0],He.H[0],Se);if(Se.h)break;if(ft||256>ht){if(!ft)if(He.nd)R[Je]=(He.qb|ht<<8)>>>0;else{if(oe(Se),ft=zr(He.G[1],He.H[1],Se),oe(Se),Wt=zr(He.G[2],He.H[2],Se),Bt=zr(He.G[3],He.H[3],Se),Se.h)break;R[Je]=(Bt<<24|ft<<16|ht<<8|Wt)>>>0}if(ft=!1,++Je,++we>=re&&(we=0,++be,ve!=null&&be<=pe&&!(be%16)&&ve(P,be),Xe!=null))for(;xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht}else if(280>ht){if(ht=Kn(ht-256,Se),Wt=zr(He.G[4],He.H[4],Se),oe(Se),Wt=Yi(re,Wt=Kn(Wt,Se)),Se.h)break;if(Je-Y<Wt||le-Je<ht)break e;for(Bt=0;Bt<ht;++Bt)R[Je+Bt]=R[Je+Bt-Wt];for(Je+=ht,we+=ht;we>=re;)we-=re,++be,ve!=null&&be<=pe&&!(be%16)&&ve(P,be);if(e(Je<=le),we&ot&&(He=Rn(Fe,we,be)),Xe!=null)for(;xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht}else{if(!(ht<Qe))break e;for(ft=ht-280,e(Xe!=null);xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht;ht=Je,e(!(ft>>>(Wt=Xe).Xa)),R[ht]=Wt.X[ft],ft=!0}ft||e(Se.h==ee(Se))}if(P.Pb&&Se.h&&Je<le)e(P.m.h),P.a=5,P.m=P.wd,P.$=P.xd,0<P.s.ua&&Re(P.s.vb,P.s.Wa);else{if(Se.h)break e;ve?.(P,be>pe?pe:be),P.a=0,P.$=Je-Y}return 1}return P.a=3,0}function ka(P){e(P!=null),P.vc=null,P.yc=null,P.Ya=null;var R=P.Wa;R!=null&&(R.X=null),P.vb=null,e(P!=null)}function Ho(){var P=new jt;return P==null?null:(P.a=0,P.xb=yu,Nt("Predictor","VP8LPredictors"),Nt("Predictor","VP8LPredictors_C"),Nt("PredictorAdd","VP8LPredictorsAdd"),Nt("PredictorAdd","VP8LPredictorsAdd_C"),Jn=pt,ml=bt,Wo=Br,ds=_r,ps=It,Jr=Jt,gs=Ve,F.VP8LMapColor32b=ci,F.VP8LMapColor8b=To,P)}function Bi(P,R,Y,re,le){var pe=1,ve=[P],be=[R],we=re.m,Se=re.s,Fe=null,Je=0;e:for(;;){if(Y)for(;pe&&B(we,1);){var xe=ve,$e=be,Qe=re,lt=1,Xe=Qe.m,ot=Qe.gc[Qe.ab],He=B(Xe,2);if(Qe.Oc&1<<He)pe=0;else{switch(Qe.Oc|=1<<He,ot.hc=He,ot.Ea=xe[0],ot.nc=$e[0],ot.K=[null],++Qe.ab,e(4>=Qe.ab),He){case 0:case 1:ot.b=B(Xe,3)+2,lt=Bi(fe(ot.Ea,ot.b),fe(ot.nc,ot.b),0,Qe,ot.K),ot.K=ot.K[0];break;case 3:var ft,ht=B(Xe,8)+1,Wt=16<ht?0:4<ht?1:2<ht?2:3;if(xe[0]=fe(ot.Ea,Wt),ot.b=Wt,ft=lt=Bi(ht,1,0,Qe,ot.K)){var Bt,hr=ht,zt=ot,Pr=1<<(8>>zt.b),qn=a(Pr);if(qn==null)ft=0;else{var vr=zt.K[0],Ft=zt.w;for(qn[0]=zt.K[0][0],Bt=1;Bt<1*hr;++Bt)qn[Bt]=Le(vr[Ft+Bt],qn[Bt-1]);for(;Bt<4*Pr;++Bt)qn[Bt]=0;zt.K[0]=null,zt.K[0]=qn,ft=1}}lt=ft;break;case 2:break;default:e(0)}pe=lt}}if(ve=ve[0],be=be[0],pe&&B(we,1)&&!(pe=1<=(Je=B(we,4))&&11>=Je)){re.a=3;break e}var St;if(St=pe)t:{var Un,Ht,dr,Mr=re,bi=ve,fi=be,Ur=Je,wi=Y,vn=Mr.m,jn=Mr.s,Nr=[null],$r=1,On=0,Gr=Tf[Ur];r:for(;;){if(wi&&B(vn,1)){var Cn=B(vn,3)+2,Ln=fe(bi,Cn),tn=fe(fi,Cn),Ti=Ln*tn;if(!Bi(Ln,tn,0,Mr,Nr))break r;for(Nr=Nr[0],jn.xc=Cn,Un=0;Un<Ti;++Un){var Yr=Nr[Un]>>8&65535;Nr[Un]=Yr,Yr>=$r&&($r=Yr+1)}}if(vn.h)break r;for(Ht=0;5>Ht;++Ht){var Xr=bl[Ht];!Ht&&0<Ur&&(Xr+=1<<Ur),On<Xr&&(On=Xr)}var ei=o($r*Gr,$),Ri=$r,ya=o(Ri,J);if(ya==null)var ti=null;else e(65536>=Ri),ti=ya;var Hn=a(On);if(ti==null||Hn==null||ei==null){Mr.a=1;break r}var ba=ei;for(Un=dr=0;Un<$r;++Un){var rn=ti[Un],Hi=rn.G,Wr=rn.H,sr=0,Ir=1,Ar=0;for(Ht=0;5>Ht;++Ht){Xr=bl[Ht],Hi[Ht]=ba,Wr[Ht]=dr,!Ht&&0<Ur&&(Xr+=1<<Ur);i:{var Dn,hi=Xr,Ko=Mr,hn=Hn,_u=ba,Vs=dr,dn=0,fo=Ko.m,$l=B(fo,1);if(i(hn,0,0,hi),$l){var wa=B(fo,1)+1,xu=B(fo,1),Su=B(fo,xu==0?1:8);hn[Su]=1,wa==2&&(hn[Su=B(fo,8)]=1);var $i=1}else{var ln=a(19),$n=B(fo,4)+4;if(19<$n){Ko.a=3;var Gn=0;break i}for(Dn=0;Dn<$n;++Dn)ln[Sd[Dn]]=B(fo,3);var ho=void 0,Io=void 0,po=Ko,Bc=ln,Wn=hi,Eu=hn,_l=0,go=po.m,xn=8,_i=o(128,$);n:for(;T(_i,0,7,Bc,19);){if(B(go,1)){var _a=2+2*B(go,3);if((ho=2+B(go,_a))>Wn)break n}else ho=Wn;for(Io=0;Io<Wn&&ho--;){oe(go);var na=_i[0+(127&X(go))];K(go,go.u+na.g);var Ys=na.value;if(16>Ys)Eu[Io++]=Ys,Ys!=0&&(xn=Ys);else{var zc=Ys==16,tc=Ys-16,Lh=Ic[tc],xs=B(go,mu[tc])+Lh;if(Io+xs>Wn)break n;for(var If=zc?xn:0;0<xs--;)Eu[Io++]=If}}_l=1;break n}_l||(po.a=3),$i=_l}($i=$i&&!fo.h)&&(dn=T(_u,Vs,8,hn,hi)),$i&&dn!=0?Gn=dn:(Ko.a=3,Gn=0)}if(Gn==0)break r;if(Ir&&Sh[Ht]==1&&(Ir=ba[dr].g==0),sr+=ba[dr].g,dr+=Gn,3>=Ht){var Gl,Au=Hn[0];for(Gl=1;Gl<Xr;++Gl)Hn[Gl]>Au&&(Au=Hn[Gl]);Ar+=Au}}if(rn.nd=Ir,rn.Qb=0,Ir&&(rn.qb=(Hi[3][Wr[3]+0].value<<24|Hi[1][Wr[1]+0].value<<16|Hi[2][Wr[2]+0].value)>>>0,sr==0&&256>Hi[0][Wr[0]+0].value&&(rn.Qb=1,rn.qb+=Hi[0][Wr[0]+0].value<<8)),rn.jc=!rn.Qb&&6>Ar,rn.jc){var Zo,Xa=rn;for(Zo=0;Zo<Oi;++Zo){var Ss=Zo,vo=Xa.pd[Ss],Es=Xa.G[0][Xa.H[0]+Ss];256<=Es.value?(vo.g=Es.g+256,vo.value=Es.value):(vo.g=0,vo.value=0,Ss>>=En(Es,8,vo),Ss>>=En(Xa.G[1][Xa.H[1]+Ss],16,vo),Ss>>=En(Xa.G[2][Xa.H[2]+Ss],0,vo),En(Xa.G[3][Xa.H[3]+Ss],24,vo))}}}jn.vc=Nr,jn.Wb=$r,jn.Ya=ti,jn.yc=ei,St=1;break t}St=0}if(!(pe=St)){re.a=3;break e}if(0<Je){if(Se.ua=1<<Je,!ge(Se.Wa,Je)){re.a=1,pe=0;break e}}else Se.ua=0;var qc=re,Uc=ve,jf=be,rc=qc.s,As=rc.xc;if(qc.c=Uc,qc.i=jf,rc.md=fe(Uc,As),rc.wc=As==0?-1:(1<<As)-1,Y){re.xb=Ro;break e}if((Fe=a(ve*be))==null){re.a=1,pe=0;break e}pe=(pe=Aa(re,Fe,0,ve,be,be,null))&&!we.h;break e}return pe?(le!=null?le[0]=Fe:(e(Fe==null),e(Y)),re.$=0,Y||ka(Se)):ka(Se),pe}function to(P,R){var Y=P.c*P.i,re=Y+R+16*R;return e(P.c<=R),P.V=a(re),P.V==null?(P.Ta=null,P.Ua=0,P.a=1,0):(P.Ta=P.V,P.Ua=P.Ba+Y+R,1)}function Ds(P,R){var Y=P.C,re=R-Y,le=P.V,pe=P.Ba+P.c*Y;for(e(R<=P.l.o);0<re;){var ve=16<re?16:re,be=P.l.ma,we=P.l.width,Se=we*ve,Fe=be.ca,Je=be.tb+we*Y,xe=P.Ta,$e=P.Ua;Sa(P,ve,le,pe),Cc(xe,$e,Fe,Je,Se),eo(be,Y,Y+ve,Fe,Je,we),re-=ve,le+=ve*P.c,Y+=ve}e(Y==R),P.C=P.Ma=R}function rs(){this.ub=this.yd=this.td=this.Rb=0}function su(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Lf(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function An(){this.Yb=function(){var P=[];return function R(Y,re,le){for(var pe=le[re],ve=0;ve<pe&&(Y.push(le.length>re+1?[]:0),!(le.length<re+1));ve++)R(Y[ve],re+1,le)}(P,0,[3,11]),P}()}function lu(){this.jb=a(3),this.Wc=s([4,8],An),this.Xc=s([4,17],An)}function ns(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Pa(){this.ld=this.La=this.dd=this.tc=0}function is(){this.Na=this.la=0}function Sc(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function sl(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function _o(){this.uc=this.M=this.Nb=0,this.wa=Array(new Pa),this.Y=0,this.ya=Array(new sl),this.aa=0,this.l=new Sr}function gi(){this.y=a(16),this.f=a(8),this.ea=a(8)}function cn(){this.cb=this.a=0,this.sc="",this.m=new D,this.Od=new rs,this.Kc=new su,this.ed=new ns,this.Qa=new Lf,this.Ic=this.$c=this.Aa=0,this.D=new _o,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,D),this.ia=0,this.pb=o(4,Sc),this.Pa=new lu,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new gi),this.Hd=0,this.rb=Array(new is),this.sb=0,this.wa=Array(new Pa),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 sl),this.L=this.aa=0,this.gd=s([4,2],Pa),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 Sr(){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 as(){var P=new cn;return P!=null&&(P.a=0,P.sc="OK",P.cb=0,P.Xb=0,ql||(ql=Ki)),P}function Tr(P,R,Y){return P.a==0&&(P.a=R,P.sc=Y,P.cb=0),0}function Xi(P,R,Y){return 3<=Y&&P[R+0]==157&&P[R+1]==1&&P[R+2]==42}function ro(P,R){if(P==null)return 0;if(P.a=0,P.sc="OK",R==null)return Tr(P,2,"null VP8Io passed to VP8GetHeaders()");var Y=R.data,re=R.w,le=R.ha;if(4>le)return Tr(P,7,"Truncated header.");var pe=Y[re+0]|Y[re+1]<<8|Y[re+2]<<16,ve=P.Od;if(ve.Rb=!(1&pe),ve.td=pe>>1&7,ve.yd=pe>>4&1,ve.ub=pe>>5,3<ve.td)return Tr(P,3,"Incorrect keyframe parameters.");if(!ve.yd)return Tr(P,4,"Frame not displayable.");re+=3,le-=3;var be=P.Kc;if(ve.Rb){if(7>le)return Tr(P,7,"cannot parse picture header");if(!Xi(Y,re,le))return Tr(P,3,"Bad code word");be.c=16383&(Y[re+4]<<8|Y[re+3]),be.Td=Y[re+4]>>6,be.i=16383&(Y[re+6]<<8|Y[re+5]),be.Ud=Y[re+6]>>6,re+=7,le-=7,P.za=be.c+15>>4,P.Ub=be.i+15>>4,R.width=be.c,R.height=be.i,R.Da=0,R.j=0,R.v=0,R.va=R.width,R.o=R.height,R.da=0,R.ib=R.width,R.hb=R.height,R.U=R.width,R.T=R.height,i((pe=P.Pa).jb,0,255,pe.jb.length),e((pe=P.Qa)!=null),pe.Cb=0,pe.Bb=0,pe.Fb=1,i(pe.Zb,0,0,pe.Zb.length),i(pe.Lb,0,0,pe.Lb)}if(ve.ub>le)return Tr(P,7,"bad partition length");ae(pe=P.m,Y,re,ve.ub),re+=ve.ub,le-=ve.ub,ve.Rb&&(be.Ld=de(pe),be.Kd=de(pe)),be=P.Qa;var we,Se=P.Pa;if(e(pe!=null),e(be!=null),be.Cb=de(pe),be.Cb){if(be.Bb=de(pe),de(pe)){for(be.Fb=de(pe),we=0;4>we;++we)be.Zb[we]=de(pe)?Z(pe,7):0;for(we=0;4>we;++we)be.Lb[we]=de(pe)?Z(pe,6):0}if(be.Bb)for(we=0;3>we;++we)Se.jb[we]=de(pe)?ie(pe,8):255}else be.Bb=0;if(pe.Ka)return Tr(P,3,"cannot parse segment header");if((be=P.ed).zd=de(pe),be.Tb=ie(pe,6),be.wb=ie(pe,3),be.Pc=de(pe),be.Pc&&de(pe)){for(Se=0;4>Se;++Se)de(pe)&&(be.vd[Se]=Z(pe,6));for(Se=0;4>Se;++Se)de(pe)&&(be.od[Se]=Z(pe,6))}if(P.L=be.Tb==0?0:be.zd?1:2,pe.Ka)return Tr(P,3,"cannot parse filter header");var Fe=le;if(le=we=re,re=we+Fe,be=Fe,P.Xb=(1<<ie(P.m,2))-1,Fe<3*(Se=P.Xb))Y=7;else{for(we+=3*Se,be-=3*Se,Fe=0;Fe<Se;++Fe){var Je=Y[le+0]|Y[le+1]<<8|Y[le+2]<<16;Je>be&&(Je=be),ae(P.Jc[+Fe],Y,we,Je),we+=Je,be-=Je,le+=3}ae(P.Jc[+Se],Y,we,be),Y=we<re?0:5}if(Y!=0)return Tr(P,Y,"cannot parse partitions");for(Y=ie(we=P.m,7),le=de(we)?Z(we,4):0,re=de(we)?Z(we,4):0,be=de(we)?Z(we,4):0,Se=de(we)?Z(we,4):0,we=de(we)?Z(we,4):0,Fe=P.Qa,Je=0;4>Je;++Je){if(Fe.Cb){var xe=Fe.Zb[Je];Fe.Fb||(xe+=Y)}else{if(0<Je){P.pb[Je]=P.pb[0];continue}xe=Y}var $e=P.pb[Je];$e.Sc[0]=Gs[zn(xe+le,127)],$e.Sc[1]=Qu[zn(xe+0,127)],$e.Eb[0]=2*Gs[zn(xe+re,127)],$e.Eb[1]=101581*Qu[zn(xe+be,127)]>>16,8>$e.Eb[1]&&($e.Eb[1]=8),$e.Qc[0]=Gs[zn(xe+Se,117)],$e.Qc[1]=Qu[zn(xe+we,127)],$e.lc=xe+we}if(!ve.Rb)return Tr(P,4,"Not a key frame.");for(de(pe),ve=P.Pa,Y=0;4>Y;++Y){for(le=0;8>le;++le)for(re=0;3>re;++re)for(be=0;11>be;++be)Se=ye(pe,kh[Y][le][re][be])?ie(pe,8):Ju[Y][le][re][be],ve.Wc[Y][le].Yb[re][be]=Se;for(le=0;17>le;++le)ve.Xc[Y][le]=ve.Wc[Y][Dc[le]]}return P.kc=de(pe),P.kc&&(P.Bd=ie(pe,8)),P.cb=1}function Ki(P,R,Y,re,le,pe,ve){var be=R[le].Yb[Y];for(Y=0;16>le;++le){if(!ye(P,be[Y+0]))return le;for(;!ye(P,be[Y+1]);)if(be=R[++le].Yb[0],Y=0,le==16)return 16;var we=R[le+1].Yb;if(ye(P,be[Y+2])){var Se=P,Fe=0;if(ye(Se,(xe=be)[(Je=Y)+3]))if(ye(Se,xe[Je+6])){for(be=0,Je=2*(Fe=ye(Se,xe[Je+8]))+(xe=ye(Se,xe[Je+9+Fe])),Fe=0,xe=Rf[Je];xe[be];++be)Fe+=Fe+ye(Se,xe[be]);Fe+=3+(8<<Je)}else ye(Se,xe[Je+7])?(Fe=7+2*ye(Se,165),Fe+=ye(Se,145)):Fe=5+ye(Se,159);else Fe=ye(Se,xe[Je+4])?3+ye(Se,xe[Je+5]):2;be=we[2]}else Fe=1,be=we[1];we=ve+co[le],0>(Se=P).b&&me(Se);var Je,xe=Se.b,$e=(Je=Se.Ca>>1)-(Se.I>>xe)>>31;--Se.b,Se.Ca+=$e,Se.Ca|=1,Se.I-=(Je+1&$e)<<xe,pe[we]=((Fe^$e)-$e)*re[(0<le)+0]}return 16}function Mn(P){var R=P.rb[P.sb-1];R.la=0,R.Na=0,i(P.zc,0,0,P.zc.length),P.ja=0}function Zi(P,R,Y,re,le){le=P[R+Y+32*re]+(le>>3),P[R+Y+32*re]=-256&le?0>le?0:255:le}function ll(P,R,Y,re,le,pe){Zi(P,R,0,Y,re+le),Zi(P,R,1,Y,re+pe),Zi(P,R,2,Y,re-pe),Zi(P,R,3,Y,re-le)}function Zn(P){return(20091*P>>16)+P}function os(P,R,Y,re){var le,pe=0,ve=a(16);for(le=0;4>le;++le){var be=P[R+0]+P[R+8],we=P[R+0]-P[R+8],Se=(35468*P[R+4]>>16)-Zn(P[R+12]),Fe=Zn(P[R+4])+(35468*P[R+12]>>16);ve[pe+0]=be+Fe,ve[pe+1]=we+Se,ve[pe+2]=we-Se,ve[pe+3]=be-Fe,pe+=4,R++}for(le=pe=0;4>le;++le)be=(P=ve[pe+0]+4)+ve[pe+8],we=P-ve[pe+8],Se=(35468*ve[pe+4]>>16)-Zn(ve[pe+12]),Zi(Y,re,0,0,be+(Fe=Zn(ve[pe+4])+(35468*ve[pe+12]>>16))),Zi(Y,re,1,0,we+Se),Zi(Y,re,2,0,we-Se),Zi(Y,re,3,0,be-Fe),pe++,re+=32}function Wu(P,R,Y,re){var le=P[R+0]+4,pe=35468*P[R+4]>>16,ve=Zn(P[R+4]),be=35468*P[R+1]>>16;ll(Y,re,0,le+ve,P=Zn(P[R+1]),be),ll(Y,re,1,le+pe,P,be),ll(Y,re,2,le-pe,P,be),ll(Y,re,3,le-ve,P,be)}function Oa(P,R,Y,re,le){os(P,R,Y,re),le&&os(P,R+16,Y,re+4)}function Nl(P,R,Y,re){qs(P,R+0,Y,re,1),qs(P,R+32,Y,re+128,1)}function ss(P,R,Y,re){var le;for(P=P[R+0]+4,le=0;4>le;++le)for(R=0;4>R;++R)Zi(Y,re,R,le,P)}function uu(P,R,Y,re){P[R+0]&&Cr(P,R+0,Y,re),P[R+16]&&Cr(P,R+16,Y,re+4),P[R+32]&&Cr(P,R+32,Y,re+128),P[R+48]&&Cr(P,R+48,Y,re+128+4)}function Rr(P,R,Y,re){var le,pe=a(16);for(le=0;4>le;++le){var ve=P[R+0+le]+P[R+12+le],be=P[R+4+le]+P[R+8+le],we=P[R+4+le]-P[R+8+le],Se=P[R+0+le]-P[R+12+le];pe[0+le]=ve+be,pe[8+le]=ve-be,pe[4+le]=Se+we,pe[12+le]=Se-we}for(le=0;4>le;++le)ve=(P=pe[0+4*le]+3)+pe[3+4*le],be=pe[1+4*le]+pe[2+4*le],we=pe[1+4*le]-pe[2+4*le],Se=P-pe[3+4*le],Y[re+0]=ve+be>>3,Y[re+16]=Se+we>>3,Y[re+32]=ve-be>>3,Y[re+48]=Se-we>>3,re+=64}function xo(P,R,Y){var re,le=R-32,pe=Li,ve=255-P[le-1];for(re=0;re<Y;++re){var be,we=pe,Se=ve+P[R-1];for(be=0;be<Y;++be)P[R+be]=we[Se+P[le+be]];R+=32}}function ls(P,R){xo(P,R,4)}function ul(P,R){xo(P,R,8)}function Ec(P,R){xo(P,R,16)}function Ac(P,R){var Y;for(Y=0;16>Y;++Y)n(P,R+32*Y,P,R-32,16)}function cl(P,R){var Y;for(Y=16;0<Y;--Y)i(P,R,P[R-1],16),R+=32}function us(P,R,Y){var re;for(re=0;16>re;++re)i(R,Y+32*re,P,16)}function no(P,R){var Y,re=16;for(Y=0;16>Y;++Y)re+=P[R-1+32*Y]+P[R+Y-32];us(re>>5,P,R)}function Ba(P,R){var Y,re=8;for(Y=0;16>Y;++Y)re+=P[R-1+32*Y];us(re>>4,P,R)}function za(P,R){var Y,re=8;for(Y=0;16>Y;++Y)re+=P[R+Y-32];us(re>>4,P,R)}function qa(P,R){us(128,P,R)}function Pt(P,R,Y){return P+2*R+Y+2>>2}function fl(P,R){var Y,re=R-32;for(re=new Uint8Array([Pt(P[re-1],P[re+0],P[re+1]),Pt(P[re+0],P[re+1],P[re+2]),Pt(P[re+1],P[re+2],P[re+3]),Pt(P[re+2],P[re+3],P[re+4])]),Y=0;4>Y;++Y)n(P,R+32*Y,re,0,re.length)}function So(P,R){var Y=P[R-1],re=P[R-1+32],le=P[R-1+64],pe=P[R-1+96];Te(P,R+0,16843009*Pt(P[R-1-32],Y,re)),Te(P,R+32,16843009*Pt(Y,re,le)),Te(P,R+64,16843009*Pt(re,le,pe)),Te(P,R+96,16843009*Pt(le,pe,pe))}function kc(P,R){var Y,re=4;for(Y=0;4>Y;++Y)re+=P[R+Y-32]+P[R-1+32*Y];for(re>>=3,Y=0;4>Y;++Y)i(P,R+32*Y,re,4)}function Pc(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1-32],ve=P[R+0-32],be=P[R+1-32],we=P[R+2-32],Se=P[R+3-32];P[R+0+96]=Pt(re,le,P[R-1+96]),P[R+1+96]=P[R+0+64]=Pt(Y,re,le),P[R+2+96]=P[R+1+64]=P[R+0+32]=Pt(pe,Y,re),P[R+3+96]=P[R+2+64]=P[R+1+32]=P[R+0+0]=Pt(ve,pe,Y),P[R+3+64]=P[R+2+32]=P[R+1+0]=Pt(be,ve,pe),P[R+3+32]=P[R+2+0]=Pt(we,be,ve),P[R+3+0]=Pt(Se,we,be)}function io(P,R){var Y=P[R+1-32],re=P[R+2-32],le=P[R+3-32],pe=P[R+4-32],ve=P[R+5-32],be=P[R+6-32],we=P[R+7-32];P[R+0+0]=Pt(P[R+0-32],Y,re),P[R+1+0]=P[R+0+32]=Pt(Y,re,le),P[R+2+0]=P[R+1+32]=P[R+0+64]=Pt(re,le,pe),P[R+3+0]=P[R+2+32]=P[R+1+64]=P[R+0+96]=Pt(le,pe,ve),P[R+3+32]=P[R+2+64]=P[R+1+96]=Pt(pe,ve,be),P[R+3+64]=P[R+2+96]=Pt(ve,be,we),P[R+3+96]=Pt(be,we,we)}function wn(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1-32],ve=P[R+0-32],be=P[R+1-32],we=P[R+2-32],Se=P[R+3-32];P[R+0+0]=P[R+1+64]=pe+ve+1>>1,P[R+1+0]=P[R+2+64]=ve+be+1>>1,P[R+2+0]=P[R+3+64]=be+we+1>>1,P[R+3+0]=we+Se+1>>1,P[R+0+96]=Pt(le,re,Y),P[R+0+64]=Pt(re,Y,pe),P[R+0+32]=P[R+1+96]=Pt(Y,pe,ve),P[R+1+32]=P[R+2+96]=Pt(pe,ve,be),P[R+2+32]=P[R+3+96]=Pt(ve,be,we),P[R+3+32]=Pt(be,we,Se)}function cu(P,R){var Y=P[R+0-32],re=P[R+1-32],le=P[R+2-32],pe=P[R+3-32],ve=P[R+4-32],be=P[R+5-32],we=P[R+6-32],Se=P[R+7-32];P[R+0+0]=Y+re+1>>1,P[R+1+0]=P[R+0+64]=re+le+1>>1,P[R+2+0]=P[R+1+64]=le+pe+1>>1,P[R+3+0]=P[R+2+64]=pe+ve+1>>1,P[R+0+32]=Pt(Y,re,le),P[R+1+32]=P[R+0+96]=Pt(re,le,pe),P[R+2+32]=P[R+1+96]=Pt(le,pe,ve),P[R+3+32]=P[R+2+96]=Pt(pe,ve,be),P[R+3+64]=Pt(ve,be,we),P[R+3+96]=Pt(be,we,Se)}function fu(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1+96];P[R+0+0]=Y+re+1>>1,P[R+2+0]=P[R+0+32]=re+le+1>>1,P[R+2+32]=P[R+0+64]=le+pe+1>>1,P[R+1+0]=Pt(Y,re,le),P[R+3+0]=P[R+1+32]=Pt(re,le,pe),P[R+3+32]=P[R+1+64]=Pt(le,pe,pe),P[R+3+64]=P[R+2+64]=P[R+0+96]=P[R+1+96]=P[R+2+96]=P[R+3+96]=pe}function Fs(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1+96],ve=P[R-1-32],be=P[R+0-32],we=P[R+1-32],Se=P[R+2-32];P[R+0+0]=P[R+2+32]=Y+ve+1>>1,P[R+0+32]=P[R+2+64]=re+Y+1>>1,P[R+0+64]=P[R+2+96]=le+re+1>>1,P[R+0+96]=pe+le+1>>1,P[R+3+0]=Pt(be,we,Se),P[R+2+0]=Pt(ve,be,we),P[R+1+0]=P[R+3+32]=Pt(Y,ve,be),P[R+1+32]=P[R+3+64]=Pt(re,Y,ve),P[R+1+64]=P[R+3+96]=Pt(le,re,Y),P[R+1+96]=Pt(pe,le,re)}function Vu(P,R){var Y;for(Y=0;8>Y;++Y)n(P,R+32*Y,P,R-32,8)}function Ua(P,R){var Y;for(Y=0;8>Y;++Y)i(P,R,P[R-1],8),R+=32}function Ai(P,R,Y){var re;for(re=0;8>re;++re)i(R,Y+32*re,P,8)}function $o(P,R){var Y,re=8;for(Y=0;8>Y;++Y)re+=P[R+Y-32]+P[R-1+32*Y];Ai(re>>4,P,R)}function hu(P,R){var Y,re=4;for(Y=0;8>Y;++Y)re+=P[R+Y-32];Ai(re>>3,P,R)}function Ca(P,R){var Y,re=4;for(Y=0;8>Y;++Y)re+=P[R-1+32*Y];Ai(re>>3,P,R)}function ao(P,R){Ai(128,P,R)}function Eo(P,R,Y){var re=P[R-Y],le=P[R+0],pe=3*(le-re)+Yo[1020+P[R-2*Y]-P[R+Y]],ve=Dl[112+(pe+4>>3)];P[R-Y]=Li[255+re+Dl[112+(pe+3>>3)]],P[R+0]=Li[255+le-ve]}function Ao(P,R,Y,re){var le=P[R+0],pe=P[R+Y];return uo[255+P[R-2*Y]-P[R-Y]]>re||uo[255+pe-le]>re}function hl(P,R,Y,re){return 4*uo[255+P[R-Y]-P[R+0]]+uo[255+P[R-2*Y]-P[R+Y]]<=re}function Tl(P,R,Y,re,le){var pe=P[R-3*Y],ve=P[R-2*Y],be=P[R-Y],we=P[R+0],Se=P[R+Y],Fe=P[R+2*Y],Je=P[R+3*Y];return 4*uo[255+be-we]+uo[255+ve-Se]>re?0:uo[255+P[R-4*Y]-pe]<=le&&uo[255+pe-ve]<=le&&uo[255+ve-be]<=le&&uo[255+Je-Fe]<=le&&uo[255+Fe-Se]<=le&&uo[255+Se-we]<=le}function li(P,R,Y,re){var le=2*re+1;for(re=0;16>re;++re)hl(P,R+re,Y,le)&&Eo(P,R+re,Y)}function Ha(P,R,Y,re){var le=2*re+1;for(re=0;16>re;++re)hl(P,R+re*Y,1,le)&&Eo(P,R+re*Y,1)}function ko(P,R,Y,re){var le;for(le=3;0<le;--le)li(P,R+=4*Y,Y,re)}function dl(P,R,Y,re){var le;for(le=3;0<le;--le)Ha(P,R+=4,Y,re)}function La(P,R,Y,re,le,pe,ve,be){for(pe=2*pe+1;0<le--;){if(Tl(P,R,Y,pe,ve))if(Ao(P,R,Y,be))Eo(P,R,Y);else{var we=P,Se=R,Fe=Y,Je=we[Se-2*Fe],xe=we[Se-Fe],$e=we[Se+0],Qe=we[Se+Fe],lt=we[Se+2*Fe],Xe=27*(He=Yo[1020+3*($e-xe)+Yo[1020+Je-Qe]])+63>>7,ot=18*He+63>>7,He=9*He+63>>7;we[Se-3*Fe]=Li[255+we[Se-3*Fe]+He],we[Se-2*Fe]=Li[255+Je+ot],we[Se-Fe]=Li[255+xe+Xe],we[Se+0]=Li[255+$e-Xe],we[Se+Fe]=Li[255+Qe-ot],we[Se+2*Fe]=Li[255+lt-He]}R+=re}}function Bn(P,R,Y,re,le,pe,ve,be){for(pe=2*pe+1;0<le--;){if(Tl(P,R,Y,pe,ve))if(Ao(P,R,Y,be))Eo(P,R,Y);else{var we=P,Se=R,Fe=Y,Je=we[Se-Fe],xe=we[Se+0],$e=we[Se+Fe],Qe=Dl[112+(4+(lt=3*(xe-Je))>>3)],lt=Dl[112+(lt+3>>3)],Xe=Qe+1>>1;we[Se-2*Fe]=Li[255+we[Se-2*Fe]+Xe],we[Se-Fe]=Li[255+Je+lt],we[Se+0]=Li[255+xe-Qe],we[Se+Fe]=Li[255+$e-Xe]}R+=re}}function fa(P,R,Y,re,le,pe){La(P,R,Y,1,16,re,le,pe)}function Qn(P,R,Y,re,le,pe){La(P,R,1,Y,16,re,le,pe)}function vi(P,R,Y,re,le,pe){var ve;for(ve=3;0<ve;--ve)Bn(P,R+=4*Y,Y,1,16,re,le,pe)}function $a(P,R,Y,re,le,pe){var ve;for(ve=3;0<ve;--ve)Bn(P,R+=4,1,Y,16,re,le,pe)}function H(P,R,Y,re,le,pe,ve,be){La(P,R,le,1,8,pe,ve,be),La(Y,re,le,1,8,pe,ve,be)}function ce(P,R,Y,re,le,pe,ve,be){La(P,R,1,le,8,pe,ve,be),La(Y,re,1,le,8,pe,ve,be)}function Ae(P,R,Y,re,le,pe,ve,be){Bn(P,R+4*le,le,1,8,pe,ve,be),Bn(Y,re+4*le,le,1,8,pe,ve,be)}function De(P,R,Y,re,le,pe,ve,be){Bn(P,R+4,1,le,8,pe,ve,be),Bn(Y,re+4,1,le,8,pe,ve,be)}function Ge(){this.ba=new xr,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new pr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function at(){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 ct(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Dt(){this.ua=0,this.Wa=new Be,this.vb=new Be,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new J,this.yc=new $}function jt(){this.xb=this.a=0,this.l=new Sr,this.ca=new xr,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new U,this.Pb=0,this.wd=new U,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Dt,this.ab=0,this.gc=o(4,ct),this.Oc=0}function cr(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Sr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function fr(P,R,Y,re,le,pe,ve){for(P=P==null?0:P[R+0],R=0;R<ve;++R)le[pe+R]=P+Y[re+R]&255,P=le[pe+R]}function qr(P,R,Y,re,le,pe,ve){var be;if(P==null)fr(null,null,Y,re,le,pe,ve);else for(be=0;be<ve;++be)le[pe+be]=P[R+be]+Y[re+be]&255}function kn(P,R,Y,re,le,pe,ve){if(P==null)fr(null,null,Y,re,le,pe,ve);else{var be,we=P[R+0],Se=we,Fe=we;for(be=0;be<ve;++be)Se=Fe+(we=P[R+be])-Se,Fe=Y[re+be]+(-256&Se?0>Se?0:255:Se)&255,Se=we,le[pe+be]=Fe}}function ui(P,R,Y,re){var le=R.width,pe=R.o;if(e(P!=null&&R!=null),0>Y||0>=re||Y+re>pe)return null;if(!P.Cc){if(P.ga==null){var ve;if(P.ga=new cr,(ve=P.ga==null)||(ve=R.width*R.o,e(P.Gb.length==0),P.Gb=a(ve),P.Uc=0,P.Gb==null?ve=0:(P.mb=P.Gb,P.nb=P.Uc,P.rc=null,ve=1),ve=!ve),!ve){ve=P.ga;var be=P.Fa,we=P.P,Se=P.qc,Fe=P.mb,Je=P.nb,xe=we+1,$e=Se-1,Qe=ve.l;if(e(be!=null&&Fe!=null&&R!=null),ra[0]=null,ra[1]=fr,ra[2]=qr,ra[3]=kn,ve.ca=Fe,ve.tb=Je,ve.c=R.width,ve.i=R.height,e(0<ve.c&&0<ve.i),1>=Se)R=0;else if(ve.$a=3&be[we+0],ve.Z=be[we+0]>>2&3,ve.Lc=be[we+0]>>4&3,we=be[we+0]>>6&3,0>ve.$a||1<ve.$a||4<=ve.Z||1<ve.Lc||we)R=0;else if(Qe.put=Zt,Qe.ac=Sn,Qe.bc=ca,Qe.ma=ve,Qe.width=R.width,Qe.height=R.height,Qe.Da=R.Da,Qe.v=R.v,Qe.va=R.va,Qe.j=R.j,Qe.o=R.o,ve.$a)e:{e(ve.$a==1),R=Ho();t:for(;;){if(R==null){R=0;break e}if(e(ve!=null),ve.mc=R,R.c=ve.c,R.i=ve.i,R.l=ve.l,R.l.ma=ve,R.l.width=ve.c,R.l.height=ve.i,R.a=0,te(R.m,be,xe,$e),!Bi(ve.c,ve.i,1,R,null)||(R.ab==1&&R.gc[0].hc==3&&Ea(R.s)?(ve.ic=1,be=R.c*R.i,R.Ta=null,R.Ua=0,R.V=a(be),R.Ba=0,R.V==null?(R.a=1,R=0):R=1):(ve.ic=0,R=to(R,ve.c)),!R))break t;R=1;break e}ve.mc=null,R=0}else R=$e>=ve.c*ve.i;ve=!R}if(ve)return null;P.ga.Lc!=1?P.Ga=0:re=pe-Y}e(P.ga!=null),e(Y+re<=pe);e:{if(R=(be=P.ga).c,pe=be.l.o,be.$a==0){if(xe=P.rc,$e=P.Vc,Qe=P.Fa,we=P.P+1+Y*R,Se=P.mb,Fe=P.nb+Y*R,e(we<=P.P+P.qc),be.Z!=0)for(e(ra[be.Z]!=null),ve=0;ve<re;++ve)ra[be.Z](xe,$e,Qe,we,Se,Fe,R),xe=Se,$e=Fe,Fe+=R,we+=R;else for(ve=0;ve<re;++ve)n(Se,Fe,Qe,we,R),xe=Se,$e=Fe,Fe+=R,we+=R;P.rc=xe,P.Vc=$e}else{if(e(be.mc!=null),R=Y+re,e((ve=be.mc)!=null),e(R<=ve.i),ve.C>=R)R=1;else if(be.ic||Po(),be.ic){be=ve.V,xe=ve.Ba,$e=ve.c;var lt=ve.i,Xe=(Qe=1,we=ve.$/$e,Se=ve.$%$e,Fe=ve.m,Je=ve.s,ve.$),ot=$e*lt,He=$e*R,ft=Je.wc,ht=Xe<He?Rn(Je,Se,we):null;e(Xe<=ot),e(R<=lt),e(Ea(Je));t:for(;;){for(;!Fe.h&&Xe<He;){if(Se&ft||(ht=Rn(Je,Se,we)),e(ht!=null),oe(Fe),256>(lt=zr(ht.G[0],ht.H[0],Fe)))be[xe+Xe]=lt,++Xe,++Se>=$e&&(Se=0,++we<=R&&!(we%16)&&si(ve,we));else{if(!(280>lt)){Qe=0;break t}lt=Kn(lt-256,Fe);var Wt,Bt=zr(ht.G[4],ht.H[4],Fe);if(oe(Fe),!(Xe>=(Bt=Yi($e,Bt=Kn(Bt,Fe)))&&ot-Xe>=lt)){Qe=0;break t}for(Wt=0;Wt<lt;++Wt)be[xe+Xe+Wt]=be[xe+Xe+Wt-Bt];for(Xe+=lt,Se+=lt;Se>=$e;)Se-=$e,++we<=R&&!(we%16)&&si(ve,we);Xe<He&&Se&ft&&(ht=Rn(Je,Se,we))}e(Fe.h==ee(Fe))}si(ve,we>R?R:we);break t}!Qe||Fe.h&&Xe<ot?(Qe=0,ve.a=Fe.h?5:3):ve.$=Xe,R=Qe}else R=Aa(ve,ve.V,ve.Ba,ve.c,ve.i,R,Ds);if(!R){re=0;break e}}Y+re>=pe&&(P.Cc=1),re=1}if(!re)return null;if(P.Cc&&((re=P.ga)!=null&&(re.mc=null),P.ga=null,0<P.Ga))return alert("todo:WebPDequantizeLevels"),null}return P.nb+Y*le}function on(P,R,Y,re,le,pe){for(;0<le--;){var ve,be=P,we=R+(Y?1:0),Se=P,Fe=R+(Y?0:3);for(ve=0;ve<re;++ve){var Je=Se[Fe+4*ve];Je!=255&&(Je*=32897,be[we+4*ve+0]=be[we+4*ve+0]*Je>>23,be[we+4*ve+1]=be[we+4*ve+1]*Je>>23,be[we+4*ve+2]=be[we+4*ve+2]*Je>>23)}R+=pe}}function mi(P,R,Y,re,le){for(;0<re--;){var pe;for(pe=0;pe<Y;++pe){var ve=P[R+2*pe+0],be=15&(Se=P[R+2*pe+1]),we=4369*be,Se=(240&Se|Se>>4)*we>>16;P[R+2*pe+0]=(240&ve|ve>>4)*we>>16&240|(15&ve|ve<<4)*we>>16>>4&15,P[R+2*pe+1]=240&Se|be}R+=le}}function _n(P,R,Y,re,le,pe,ve,be){var we,Se,Fe=255;for(Se=0;Se<le;++Se){for(we=0;we<re;++we){var Je=P[R+we];pe[ve+4*we]=Je,Fe&=Je}R+=Y,ve+=be}return Fe!=255}function ki(P,R,Y,re,le){var pe;for(pe=0;pe<le;++pe)Y[re+pe]=P[R+pe]>>8}function Po(){Vo=on,Xu=mi,jl=_n,Cc=ki}function Qi(P,R,Y){F[P]=function(re,le,pe,ve,be,we,Se,Fe,Je,xe,$e,Qe,lt,Xe,ot,He,ft){var ht,Wt=ft-1>>1,Bt=be[we+0]|Se[Fe+0]<<16,hr=Je[xe+0]|$e[Qe+0]<<16;e(re!=null);var zt=3*Bt+hr+131074>>2;for(R(re[le+0],255&zt,zt>>16,lt,Xe),pe!=null&&(zt=3*hr+Bt+131074>>2,R(pe[ve+0],255&zt,zt>>16,ot,He)),ht=1;ht<=Wt;++ht){var Pr=be[we+ht]|Se[Fe+ht]<<16,qn=Je[xe+ht]|$e[Qe+ht]<<16,vr=Bt+Pr+hr+qn+524296,Ft=vr+2*(Pr+hr)>>3;zt=Ft+Bt>>1,Bt=(vr=vr+2*(Bt+qn)>>3)+Pr>>1,R(re[le+2*ht-1],255&zt,zt>>16,lt,Xe+(2*ht-1)*Y),R(re[le+2*ht-0],255&Bt,Bt>>16,lt,Xe+(2*ht-0)*Y),pe!=null&&(zt=vr+hr>>1,Bt=Ft+qn>>1,R(pe[ve+2*ht-1],255&zt,zt>>16,ot,He+(2*ht-1)*Y),R(pe[ve+2*ht+0],255&Bt,Bt>>16,ot,He+(2*ht+0)*Y)),Bt=Pr,hr=qn}1&ft||(zt=3*Bt+hr+131074>>2,R(re[le+ft-1],255&zt,zt>>16,lt,Xe+(ft-1)*Y),pe!=null&&(zt=3*hr+Bt+131074>>2,R(pe[ve+ft-1],255&zt,zt>>16,ot,He+(ft-1)*Y)))}}function Oc(){Ra[Fl]=Ph,Ra[Xo]=Ws,Ra[Nf]=Oh,Ra[Bl]=bu,Ra[pu]=yi,Ra[fn]=Ni,Ra[Ku]=Fc,Ra[zl]=Ws,Ra[$s]=bu,Ra[gu]=yi,Ra[vu]=Ni}function Oo(P){return P&-16384?0>P?0:255:P>>bs}function cs(P,R){return Oo((19077*P>>8)+(26149*R>>8)-14234)}function Bs(P,R,Y){return Oo((19077*P>>8)-(6419*R>>8)-(13320*Y>>8)+8708)}function pl(P,R){return Oo((19077*P>>8)+(33050*R>>8)-17685)}function oo(P,R,Y,re,le){re[le+0]=cs(P,Y),re[le+1]=Bs(P,R,Y),re[le+2]=pl(P,R)}function gl(P,R,Y,re,le){re[le+0]=pl(P,R),re[le+1]=Bs(P,R,Y),re[le+2]=cs(P,Y)}function Pi(P,R,Y,re,le){var pe=Bs(P,R,Y);R=pe<<3&224|pl(P,R)>>3,re[le+0]=248&cs(P,Y)|pe>>5,re[le+1]=R}function fs(P,R,Y,re,le){var pe=240&pl(P,R)|15;re[le+0]=240&cs(P,Y)|Bs(P,R,Y)>>4,re[le+1]=pe}function Co(P,R,Y,re,le){re[le+0]=255,oo(P,R,Y,re,le+1)}function Rl(P,R,Y,re,le){gl(P,R,Y,re,le),re[le+3]=255}function Ml(P,R,Y,re,le){oo(P,R,Y,re,le),re[le+3]=255}function zn(P,R){return 0>P?0:P>R?R:P}function so(P,R,Y){F[P]=function(re,le,pe,ve,be,we,Se,Fe,Je){for(var xe=Fe+(-2&Je)*Y;Fe!=xe;)R(re[le+0],pe[ve+0],be[we+0],Se,Fe),R(re[le+1],pe[ve+0],be[we+0],Se,Fe+Y),le+=2,++ve,++we,Fe+=2*Y;1&Je&&R(re[le+0],pe[ve+0],be[we+0],Se,Fe)}}function Lo(P,R,Y){return Y==0?P==0?R==0?6:5:R==0?4:0:Y}function zs(P,R,Y,re,le){switch(P>>>30){case 3:qs(R,Y,re,le,0);break;case 2:Pn(R,Y,re,le);break;case 1:Cr(R,Y,re,le)}}function In(P,R){var Y,re,le=R.M,pe=R.Nb,ve=P.oc,be=P.pc+40,we=P.oc,Se=P.pc+584,Fe=P.oc,Je=P.pc+600;for(Y=0;16>Y;++Y)ve[be+32*Y-1]=129;for(Y=0;8>Y;++Y)we[Se+32*Y-1]=129,Fe[Je+32*Y-1]=129;for(0<le?ve[be-1-32]=we[Se-1-32]=Fe[Je-1-32]=129:(i(ve,be-32-1,127,21),i(we,Se-32-1,127,9),i(Fe,Je-32-1,127,9)),re=0;re<P.za;++re){var xe=R.ya[R.aa+re];if(0<re){for(Y=-1;16>Y;++Y)n(ve,be+32*Y-4,ve,be+32*Y+12,4);for(Y=-1;8>Y;++Y)n(we,Se+32*Y-4,we,Se+32*Y+4,4),n(Fe,Je+32*Y-4,Fe,Je+32*Y+4,4)}var $e=P.Gd,Qe=P.Hd+re,lt=xe.ad,Xe=xe.Hc;if(0<le&&(n(ve,be-32,$e[Qe].y,0,16),n(we,Se-32,$e[Qe].f,0,8),n(Fe,Je-32,$e[Qe].ea,0,8)),xe.Za){var ot=ve,He=be-32+16;for(0<le&&(re>=P.za-1?i(ot,He,$e[Qe].y[15],4):n(ot,He,$e[Qe+1].y,0,4)),Y=0;4>Y;Y++)ot[He+128+Y]=ot[He+256+Y]=ot[He+384+Y]=ot[He+0+Y];for(Y=0;16>Y;++Y,Xe<<=2)ot=ve,He=be+ec[Y],ta[xe.Ob[Y]](ot,He),zs(Xe,lt,16*+Y,ot,He)}else if(ot=Lo(re,le,xe.Ob[0]),ea[ot](ve,be),Xe!=0)for(Y=0;16>Y;++Y,Xe<<=2)zs(Xe,lt,16*+Y,ve,be+ec[Y]);for(Y=xe.Gc,ot=Lo(re,le,xe.Dd),ga[ot](we,Se),ga[ot](Fe,Je),Xe=lt,ot=we,He=Se,255&(xe=0|Y)&&(170&xe?pa(Xe,256,ot,He):ar(Xe,256,ot,He)),xe=Fe,Xe=Je,255&(Y>>=8)&&(170&Y?pa(lt,320,xe,Xe):ar(lt,320,xe,Xe)),le<P.Ub-1&&(n($e[Qe].y,0,ve,be+480,16),n($e[Qe].f,0,we,Se+224,8),n($e[Qe].ea,0,Fe,Je+224,8)),Y=8*pe*P.B,$e=P.sa,Qe=P.ta+16*re+16*pe*P.R,lt=P.qa,xe=P.ra+8*re+Y,Xe=P.Ha,ot=P.Ia+8*re+Y,Y=0;16>Y;++Y)n($e,Qe+Y*P.R,ve,be+32*Y,16);for(Y=0;8>Y;++Y)n(lt,xe+Y*P.B,we,Se+32*Y,8),n(Xe,ot+Y*P.B,Fe,Je+32*Y,8)}}function Ga(P,R,Y,re,le,pe,ve,be,we){var Se=[0],Fe=[0],Je=0,xe=we!=null?we.kd:0,$e=we??new at;if(P==null||12>Y)return 7;$e.data=P,$e.w=R,$e.ha=Y,R=[R],Y=[Y],$e.gb=[$e.gb];e:{var Qe=R,lt=Y,Xe=$e.gb;if(e(P!=null),e(lt!=null),e(Xe!=null),Xe[0]=0,12<=lt[0]&&!r(P,Qe[0],"RIFF")){if(r(P,Qe[0]+8,"WEBP")){Xe=3;break e}var ot=Ee(P,Qe[0]+4);if(12>ot||4294967286<ot){Xe=3;break e}if(xe&&ot>lt[0]-8){Xe=7;break e}Xe[0]=ot,Qe[0]+=12,lt[0]-=12}Xe=0}if(Xe!=0)return Xe;for(ot=0<$e.gb[0],Y=Y[0];;){e:{var He=P;lt=R,Xe=Y;var ft=Se,ht=Fe,Wt=Qe=[0];if((zt=Je=[Je])[0]=0,8>Xe[0])Xe=7;else{if(!r(He,lt[0],"VP8X")){if(Ee(He,lt[0]+4)!=10){Xe=3;break e}if(18>Xe[0]){Xe=7;break e}var Bt=Ee(He,lt[0]+8),hr=1+Ie(He,lt[0]+12);if(2147483648<=hr*(He=1+Ie(He,lt[0]+15))){Xe=3;break e}Wt!=null&&(Wt[0]=Bt),ft!=null&&(ft[0]=hr),ht!=null&&(ht[0]=He),lt[0]+=18,Xe[0]-=18,zt[0]=1}Xe=0}}if(Je=Je[0],Qe=Qe[0],Xe!=0)return Xe;if(lt=!!(2&Qe),!ot&&Je)return 3;if(pe!=null&&(pe[0]=!!(16&Qe)),ve!=null&&(ve[0]=lt),be!=null&&(be[0]=0),ve=Se[0],Qe=Fe[0],Je&&lt&&we==null){Xe=0;break}if(4>Y){Xe=7;break}if(ot&&Je||!ot&&!Je&&!r(P,R[0],"ALPH")){Y=[Y],$e.na=[$e.na],$e.P=[$e.P],$e.Sa=[$e.Sa];e:{Bt=P,Xe=R,ot=Y;var zt=$e.gb;ft=$e.na,ht=$e.P,Wt=$e.Sa,hr=22,e(Bt!=null),e(ot!=null),He=Xe[0];var Pr=ot[0];for(e(ft!=null),e(Wt!=null),ft[0]=null,ht[0]=null,Wt[0]=0;;){if(Xe[0]=He,ot[0]=Pr,8>Pr){Xe=7;break e}var qn=Ee(Bt,He+4);if(4294967286<qn){Xe=3;break e}var vr=8+qn+1&-2;if(hr+=vr,0<zt&&hr>zt){Xe=3;break e}if(!r(Bt,He,"VP8 ")||!r(Bt,He,"VP8L")){Xe=0;break e}if(Pr[0]<vr){Xe=7;break e}r(Bt,He,"ALPH")||(ft[0]=Bt,ht[0]=He+8,Wt[0]=qn),He+=vr,Pr-=vr}}if(Y=Y[0],$e.na=$e.na[0],$e.P=$e.P[0],$e.Sa=$e.Sa[0],Xe!=0)break}Y=[Y],$e.Ja=[$e.Ja],$e.xa=[$e.xa];e:if(zt=P,Xe=R,ot=Y,ft=$e.gb[0],ht=$e.Ja,Wt=$e.xa,Bt=Xe[0],He=!r(zt,Bt,"VP8 "),hr=!r(zt,Bt,"VP8L"),e(zt!=null),e(ot!=null),e(ht!=null),e(Wt!=null),8>ot[0])Xe=7;else{if(He||hr){if(zt=Ee(zt,Bt+4),12<=ft&&zt>ft-12){Xe=3;break e}if(xe&&zt>ot[0]-8){Xe=7;break e}ht[0]=zt,Xe[0]+=8,ot[0]-=8,Wt[0]=hr}else Wt[0]=5<=ot[0]&&zt[Bt+0]==47&&!(zt[Bt+4]>>5),ht[0]=ot[0];Xe=0}if(Y=Y[0],$e.Ja=$e.Ja[0],$e.xa=$e.xa[0],R=R[0],Xe!=0)break;if(4294967286<$e.Ja)return 3;if(be==null||lt||(be[0]=$e.xa?2:1),ve=[ve],Qe=[Qe],$e.xa){if(5>Y){Xe=7;break}be=ve,xe=Qe,lt=pe,P==null||5>Y?P=0:5<=Y&&P[R+0]==47&&!(P[R+4]>>5)?(ot=[0],zt=[0],ft=[0],te(ht=new U,P,R,Y),Fa(ht,ot,zt,ft)?(be!=null&&(be[0]=ot[0]),xe!=null&&(xe[0]=zt[0]),lt!=null&&(lt[0]=ft[0]),P=1):P=0):P=0}else{if(10>Y){Xe=7;break}be=Qe,P==null||10>Y||!Xi(P,R+3,Y-3)?P=0:(xe=P[R+0]|P[R+1]<<8|P[R+2]<<16,lt=16383&(P[R+7]<<8|P[R+6]),P=16383&(P[R+9]<<8|P[R+8]),1&xe||3<(xe>>1&7)||!(xe>>4&1)||xe>>5>=$e.Ja||!lt||!P?P=0:(ve&&(ve[0]=lt),be&&(be[0]=P),P=1))}if(!P||(ve=ve[0],Qe=Qe[0],Je&&(Se[0]!=ve||Fe[0]!=Qe)))return 3;we!=null&&(we[0]=$e,we.offset=R-we.w,e(4294967286>R-we.w),e(we.offset==we.ha-Y));break}return Xe==0||Xe==7&&Je&&we==null?(pe!=null&&(pe[0]|=$e.na!=null&&0<$e.na.length),re!=null&&(re[0]=ve),le!=null&&(le[0]=Qe),0):Xe}function vl(P,R,Y){var re=R.width,le=R.height,pe=0,ve=0,be=re,we=le;if(R.Da=P!=null&&0<P.Da,R.Da&&(be=P.cd,we=P.bd,pe=P.v,ve=P.j,11>Y||(pe&=-2,ve&=-2),0>pe||0>ve||0>=be||0>=we||pe+be>re||ve+we>le))return 0;if(R.v=pe,R.j=ve,R.va=pe+be,R.o=ve+we,R.U=be,R.T=we,R.da=P!=null&&0<P.da,R.da){if(!Oe(be,we,Y=[P.ib],pe=[P.hb]))return 0;R.ib=Y[0],R.hb=pe[0]}return R.ob=P!=null&&P.ob,R.Kb=P==null||!P.Sd,R.da&&(R.ob=R.ib<3*re/4&&R.hb<3*le/4,R.Kb=0),1}function Il(P){if(P==null)return 2;if(11>P.S){var R=P.f.RGBA;R.fb+=(P.height-1)*R.A,R.A=-R.A}else R=P.f.kb,P=P.height,R.O+=(P-1)*R.fa,R.fa=-R.fa,R.N+=(P-1>>1)*R.Ab,R.Ab=-R.Ab,R.W+=(P-1>>1)*R.Db,R.Db=-R.Db,R.F!=null&&(R.J+=(P-1)*R.lb,R.lb=-R.lb);return 0}function zi(P,R,Y,re){if(re==null||0>=P||0>=R)return 2;if(Y!=null){if(Y.Da){var le=Y.cd,pe=Y.bd,ve=-2&Y.v,be=-2&Y.j;if(0>ve||0>be||0>=le||0>=pe||ve+le>P||be+pe>R)return 2;P=le,R=pe}if(Y.da){if(!Oe(P,R,le=[Y.ib],pe=[Y.hb]))return 2;P=le[0],R=pe[0]}}re.width=P,re.height=R;e:{var we=re.width,Se=re.height;if(P=re.S,0>=we||0>=Se||!(P>=Fl&&13>P))P=2;else{if(0>=re.Rd&&re.sd==null){ve=pe=le=R=0;var Fe=(be=we*Hl[P])*Se;if(11>P||(pe=(Se+1)/2*(R=(we+1)/2),P==12&&(ve=(le=we)*Se)),(Se=a(Fe+2*pe+ve))==null){P=1;break e}re.sd=Se,11>P?((we=re.f.RGBA).eb=Se,we.fb=0,we.A=be,we.size=Fe):((we=re.f.kb).y=Se,we.O=0,we.fa=be,we.Fd=Fe,we.f=Se,we.N=0+Fe,we.Ab=R,we.Cd=pe,we.ea=Se,we.W=0+Fe+pe,we.Db=R,we.Ed=pe,P==12&&(we.F=Se,we.J=0+Fe+2*pe),we.Tc=ve,we.lb=le)}if(R=1,le=re.S,pe=re.width,ve=re.height,le>=Fl&&13>le)if(11>le)P=re.f.RGBA,R&=(be=Math.abs(P.A))*(ve-1)+pe<=P.size,R&=be>=pe*Hl[le],R&=P.eb!=null;else{P=re.f.kb,be=(pe+1)/2,Fe=(ve+1)/2,we=Math.abs(P.fa),Se=Math.abs(P.Ab);var Je=Math.abs(P.Db),xe=Math.abs(P.lb),$e=xe*(ve-1)+pe;R&=we*(ve-1)+pe<=P.Fd,R&=Se*(Fe-1)+be<=P.Cd,R=(R&=Je*(Fe-1)+be<=P.Ed)&we>=pe&Se>=be&Je>=be,R&=P.y!=null,R&=P.f!=null,R&=P.ea!=null,le==12&&(R&=xe>=pe,R&=$e<=P.Tc,R&=P.F!=null)}else R=0;P=R?0:2}}return P!=0||Y!=null&&Y.fd&&(P=Il(re)),P}var Oi=64,Na=[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],Wa=24,ha=32,Ji=8,No=[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];Ne("Predictor0","PredictorAdd0"),F.Predictor0=function(){return 4278190080},F.Predictor1=function(P){return P},F.Predictor2=function(P,R,Y){return R[Y+0]},F.Predictor3=function(P,R,Y){return R[Y+1]},F.Predictor4=function(P,R,Y){return R[Y-1]},F.Predictor5=function(P,R,Y){return ke(ke(P,R[Y+1]),R[Y+0])},F.Predictor6=function(P,R,Y){return ke(P,R[Y-1])},F.Predictor7=function(P,R,Y){return ke(P,R[Y+0])},F.Predictor8=function(P,R,Y){return ke(R[Y-1],R[Y+0])},F.Predictor9=function(P,R,Y){return ke(R[Y+0],R[Y+1])},F.Predictor10=function(P,R,Y){return ke(ke(P,R[Y-1]),ke(R[Y+0],R[Y+1]))},F.Predictor11=function(P,R,Y){var re=R[Y+0];return 0>=st(re>>24&255,P>>24&255,(R=R[Y-1])>>24&255)+st(re>>16&255,P>>16&255,R>>16&255)+st(re>>8&255,P>>8&255,R>>8&255)+st(255&re,255&P,255&R)?re:P},F.Predictor12=function(P,R,Y){var re=R[Y+0];return(Pe((P>>24&255)+(re>>24&255)-((R=R[Y-1])>>24&255))<<24|Pe((P>>16&255)+(re>>16&255)-(R>>16&255))<<16|Pe((P>>8&255)+(re>>8&255)-(R>>8&255))<<8|Pe((255&P)+(255&re)-(255&R)))>>>0},F.Predictor13=function(P,R,Y){var re=R[Y-1];return(Ue((P=ke(P,R[Y+0]))>>24&255,re>>24&255)<<24|Ue(P>>16&255,re>>16&255)<<16|Ue(P>>8&255,re>>8&255)<<8|Ue(255&P,255&re))>>>0};var hs=F.PredictorAdd0;F.PredictorAdd1=dt,Ne("Predictor2","PredictorAdd2"),Ne("Predictor3","PredictorAdd3"),Ne("Predictor4","PredictorAdd4"),Ne("Predictor5","PredictorAdd5"),Ne("Predictor6","PredictorAdd6"),Ne("Predictor7","PredictorAdd7"),Ne("Predictor8","PredictorAdd8"),Ne("Predictor9","PredictorAdd9"),Ne("Predictor10","PredictorAdd10"),Ne("Predictor11","PredictorAdd11"),Ne("Predictor12","PredictorAdd12"),Ne("Predictor13","PredictorAdd13");var lo=F.PredictorAdd2;At("ColorIndexInverseTransform","MapARGB","32b",function(P){return P>>8&255},function(P){return P}),At("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(P){return P},function(P){return P>>8&255});var Jn,Go=F.ColorIndexInverseTransform,ci=F.MapARGB,Ta=F.VP8LColorIndexInverseTransformAlpha,To=F.MapAlpha,da=F.VP8LPredictorsAdd=[];da.length=16,(F.VP8LPredictors=[]).length=16,(F.VP8LPredictorsAdd_C=[]).length=16,(F.VP8LPredictors_C=[]).length=16;var ml,Wo,ds,ps,Jr,gs,vs,qs,Pn,pa,Cr,ar,Er,Lr,Va,Us,ms,Hs,Ci,yl,du,Yu,Ya,qi,Vo,Xu,jl,Cc,Lc=a(511),Nc=a(2041),Tc=a(225),Rc=a(767),Mc=0,Yo=Nc,Dl=Tc,Li=Rc,uo=Lc,Fl=0,Xo=1,Nf=2,Bl=3,pu=4,fn=5,Ku=6,zl=7,$s=8,gu=9,vu=10,mu=[2,3,7],Ic=[3,3,11],bl=[280,256,256,256,40],Sh=[0,1,1,1,0],Sd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Eh=[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],Tf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Zu=8,Gs=[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],Qu=[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],ql=null,Rf=[[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]],co=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],jc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Ju=[[[[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]]]],Ah=[[[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]]],kh=[[[[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]]]],Dc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ea=[],ta=[],ga=[],Ro=1,yu=2,ra=[],Ra=[];Qi("UpsampleRgbLinePair",oo,3),Qi("UpsampleBgrLinePair",gl,3),Qi("UpsampleRgbaLinePair",Ml,4),Qi("UpsampleBgraLinePair",Rl,4),Qi("UpsampleArgbLinePair",Co,4),Qi("UpsampleRgba4444LinePair",fs,2),Qi("UpsampleRgb565LinePair",Pi,2);var Ph=F.UpsampleRgbLinePair,Oh=F.UpsampleBgrLinePair,Ws=F.UpsampleRgbaLinePair,bu=F.UpsampleBgraLinePair,yi=F.UpsampleArgbLinePair,Ni=F.UpsampleRgba4444LinePair,Fc=F.UpsampleRgb565LinePair,ys=16,Mo=1<<ys-1,en=-227,sn=482,bs=6,Ui=0,va=a(256),wl=a(256),Ul=a(256),ma=a(256),wu=a(sn-en),Mf=a(sn-en);so("YuvToRgbRow",oo,3),so("YuvToBgrRow",gl,3),so("YuvToRgbaRow",Ml,4),so("YuvToBgraRow",Rl,4),so("YuvToArgbRow",Co,4),so("YuvToRgba4444Row",fs,2),so("YuvToRgb565Row",Pi,2);var ec=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],ws=[0,2,8],Ch=[8,7,6,4,4,2,2,2,1,1,1,1],_s=1;this.WebPDecodeRGBA=function(P,R,Y,re,le){var pe=Xo,ve=new Ge,be=new xr;ve.ba=be,be.S=pe,be.width=[be.width],be.height=[be.height];var we=be.width,Se=be.height,Fe=new er;if(Fe==null||P==null)var Je=2;else e(Fe!=null),Je=Ga(P,R,Y,Fe.width,Fe.height,Fe.Pd,Fe.Qd,Fe.format,null);if(Je!=0?we=0:(we!=null&&(we[0]=Fe.width[0]),Se!=null&&(Se[0]=Fe.height[0]),we=1),we){be.width=be.width[0],be.height=be.height[0],re!=null&&(re[0]=be.width),le!=null&&(le[0]=be.height);e:{if(re=new Sr,(le=new at).data=P,le.w=R,le.ha=Y,le.kd=1,R=[0],e(le!=null),((P=Ga(le.data,le.w,le.ha,null,null,null,R,null,le))==0||P==7)&&R[0]&&(P=4),(R=P)==0){if(e(ve!=null),re.data=le.data,re.w=le.w+le.offset,re.ha=le.ha-le.offset,re.put=Zt,re.ac=Sn,re.bc=ca,re.ma=ve,le.xa){if((P=Ho())==null){ve=1;break e}if(function(xe,$e){var Qe=[0],lt=[0],Xe=[0];t:for(;;){if(xe==null)return 0;if($e==null)return xe.a=2,0;if(xe.l=$e,xe.a=0,te(xe.m,$e.data,$e.w,$e.ha),!Fa(xe.m,Qe,lt,Xe)){xe.a=3;break t}if(xe.xb=yu,$e.width=Qe[0],$e.height=lt[0],!Bi(Qe[0],lt[0],1,xe,null))break t;return 1}return e(xe.a!=0),0}(P,re)){if(re=(R=zi(re.width,re.height,ve.Oa,ve.ba))==0){t:{re=P;r:for(;;){if(re==null){re=0;break t}if(e(re.s.yc!=null),e(re.s.Ya!=null),e(0<re.s.Wb),e((Y=re.l)!=null),e((le=Y.ma)!=null),re.xb!=0){if(re.ca=le.ba,re.tb=le.tb,e(re.ca!=null),!vl(le.Oa,Y,Bl)){re.a=2;break r}if(!to(re,Y.width)||Y.da)break r;if((Y.da||Ct(re.ca.S))&&Po(),11>re.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),re.ca.f.kb.F!=null&&Po()),re.Pb&&0<re.s.ua&&re.s.vb.X==null&&!ge(re.s.vb,re.s.Wa.Xa)){re.a=1;break r}re.xb=0}if(!Aa(re,re.V,re.Ba,re.c,re.i,Y.o,Uo))break r;le.Dc=re.Ma,re=1;break t}e(re.a!=0),re=0}re=!re}re&&(R=P.a)}else R=P.a}else{if((P=new as)==null){ve=1;break e}if(P.Fa=le.na,P.P=le.P,P.qc=le.Sa,ro(P,re)){if((R=zi(re.width,re.height,ve.Oa,ve.ba))==0){if(P.Aa=0,Y=ve.Oa,e((le=P)!=null),Y!=null){if(0<(we=0>(we=Y.Md)?0:100<we?255:255*we/100)){for(Se=Fe=0;4>Se;++Se)12>(Je=le.pb[Se]).lc&&(Je.ia=we*Ch[0>Je.lc?0:Je.lc]>>3),Fe|=Je.ia;Fe&&(alert("todo:VP8InitRandom"),le.ia=1)}le.Ga=Y.Id,100<le.Ga?le.Ga=100:0>le.Ga&&(le.Ga=0)}(function(xe,$e){if(xe==null)return 0;if($e==null)return Tr(xe,2,"NULL VP8Io parameter in VP8Decode().");if(!xe.cb&&!ro(xe,$e))return 0;if(e(xe.cb),$e.ac==null||$e.ac($e)){$e.ob&&(xe.L=0);var Qe=ws[xe.L];if(xe.L==2?(xe.yb=0,xe.zb=0):(xe.yb=$e.v-Qe>>4,xe.zb=$e.j-Qe>>4,0>xe.yb&&(xe.yb=0),0>xe.zb&&(xe.zb=0)),xe.Va=$e.o+15+Qe>>4,xe.Hb=$e.va+15+Qe>>4,xe.Hb>xe.za&&(xe.Hb=xe.za),xe.Va>xe.Ub&&(xe.Va=xe.Ub),0<xe.L){var lt=xe.ed;for(Qe=0;4>Qe;++Qe){var Xe;if(xe.Qa.Cb){var ot=xe.Qa.Lb[Qe];xe.Qa.Fb||(ot+=lt.Tb)}else ot=lt.Tb;for(Xe=0;1>=Xe;++Xe){var He=xe.gd[Qe][Xe],ft=ot;if(lt.Pc&&(ft+=lt.vd[0],Xe&&(ft+=lt.od[0])),0<(ft=0>ft?0:63<ft?63:ft)){var ht=ft;0<lt.wb&&(ht=4<lt.wb?ht>>2:ht>>1)>9-lt.wb&&(ht=9-lt.wb),1>ht&&(ht=1),He.dd=ht,He.tc=2*ft+ht,He.ld=40<=ft?2:15<=ft?1:0}else He.tc=0;He.La=Xe}}}Qe=0}else Tr(xe,6,"Frame setup failed"),Qe=xe.a;if(Qe=Qe==0){if(Qe){xe.$c=0,0<xe.Aa||(xe.Ic=_s);t:{Qe=xe.Ic,lt=4*(ht=xe.za);var Wt=32*ht,Bt=ht+1,hr=0<xe.L?ht*(0<xe.Aa?2:1):0,zt=(xe.Aa==2?2:1)*ht;if((He=lt+832+(Xe=3*(16*Qe+ws[xe.L])/2*Wt)+(ot=xe.Fa!=null&&0<xe.Fa.length?xe.Kc.c*xe.Kc.i:0))!=He)Qe=0;else{if(He>xe.Vb){if(xe.Vb=0,xe.Ec=a(He),xe.Fc=0,xe.Ec==null){Qe=Tr(xe,1,"no memory during frame initialization.");break t}xe.Vb=He}He=xe.Ec,ft=xe.Fc,xe.Ac=He,xe.Bc=ft,ft+=lt,xe.Gd=o(Wt,gi),xe.Hd=0,xe.rb=o(Bt+1,is),xe.sb=1,xe.wa=hr?o(hr,Pa):null,xe.Y=0,xe.D.Nb=0,xe.D.wa=xe.wa,xe.D.Y=xe.Y,0<xe.Aa&&(xe.D.Y+=ht),e(!0),xe.oc=He,xe.pc=ft,ft+=832,xe.ya=o(zt,sl),xe.aa=0,xe.D.ya=xe.ya,xe.D.aa=xe.aa,xe.Aa==2&&(xe.D.aa+=ht),xe.R=16*ht,xe.B=8*ht,ht=(Wt=ws[xe.L])*xe.R,Wt=Wt/2*xe.B,xe.sa=He,xe.ta=ft+ht,xe.qa=xe.sa,xe.ra=xe.ta+16*Qe*xe.R+Wt,xe.Ha=xe.qa,xe.Ia=xe.ra+8*Qe*xe.B+Wt,xe.$c=0,ft+=Xe,xe.mb=ot?He:null,xe.nb=ot?ft:null,e(ft+ot<=xe.Fc+xe.Vb),Mn(xe),i(xe.Ac,xe.Bc,0,lt),Qe=1}}if(Qe){if($e.ka=0,$e.y=xe.sa,$e.O=xe.ta,$e.f=xe.qa,$e.N=xe.ra,$e.ea=xe.Ha,$e.Vd=xe.Ia,$e.fa=xe.R,$e.Rc=xe.B,$e.F=null,$e.J=0,!Mc){for(Qe=-255;255>=Qe;++Qe)Lc[255+Qe]=0>Qe?-Qe:Qe;for(Qe=-1020;1020>=Qe;++Qe)Nc[1020+Qe]=-128>Qe?-128:127<Qe?127:Qe;for(Qe=-112;112>=Qe;++Qe)Tc[112+Qe]=-16>Qe?-16:15<Qe?15:Qe;for(Qe=-255;510>=Qe;++Qe)Rc[255+Qe]=0>Qe?0:255<Qe?255:Qe;Mc=1}vs=Rr,qs=Oa,pa=Nl,Cr=ss,ar=uu,Pn=Wu,Er=fa,Lr=Qn,Va=H,Us=ce,ms=vi,Hs=$a,Ci=Ae,yl=De,du=li,Yu=Ha,Ya=ko,qi=dl,ta[0]=kc,ta[1]=ls,ta[2]=fl,ta[3]=So,ta[4]=Pc,ta[5]=wn,ta[6]=io,ta[7]=cu,ta[8]=Fs,ta[9]=fu,ea[0]=no,ea[1]=Ec,ea[2]=Ac,ea[3]=cl,ea[4]=Ba,ea[5]=za,ea[6]=qa,ga[0]=$o,ga[1]=ul,ga[2]=Vu,ga[3]=Ua,ga[4]=Ca,ga[5]=hu,ga[6]=ao,Qe=1}else Qe=0}Qe&&(Qe=function(Pr,qn){for(Pr.M=0;Pr.M<Pr.Va;++Pr.M){var vr,Ft=Pr.Jc[Pr.M&Pr.Xb],St=Pr.m,Un=Pr;for(vr=0;vr<Un.za;++vr){var Ht=St,dr=Un,Mr=dr.Ac,bi=dr.Bc+4*vr,fi=dr.zc,Ur=dr.ya[dr.aa+vr];if(dr.Qa.Bb?Ur.$b=ye(Ht,dr.Pa.jb[0])?2+ye(Ht,dr.Pa.jb[2]):ye(Ht,dr.Pa.jb[1]):Ur.$b=0,dr.kc&&(Ur.Ad=ye(Ht,dr.Bd)),Ur.Za=!ye(Ht,145)+0,Ur.Za){var wi=Ur.Ob,vn=0;for(dr=0;4>dr;++dr){var jn,Nr=fi[0+dr];for(jn=0;4>jn;++jn){Nr=Ah[Mr[bi+jn]][Nr];for(var $r=jc[ye(Ht,Nr[0])];0<$r;)$r=jc[2*$r+ye(Ht,Nr[$r])];Nr=-$r,Mr[bi+jn]=Nr}n(wi,vn,Mr,bi,4),vn+=4,fi[0+dr]=Nr}}else Nr=ye(Ht,156)?ye(Ht,128)?1:3:ye(Ht,163)?2:0,Ur.Ob[0]=Nr,i(Mr,bi,Nr,4),i(fi,0,Nr,4);Ur.Dd=ye(Ht,142)?ye(Ht,114)?ye(Ht,183)?1:3:2:0}if(Un.m.Ka)return Tr(Pr,7,"Premature end-of-partition0 encountered.");for(;Pr.ja<Pr.za;++Pr.ja){if(Un=Ft,Ht=(St=Pr).rb[St.sb-1],Mr=St.rb[St.sb+St.ja],vr=St.ya[St.aa+St.ja],bi=St.kc?vr.Ad:0)Ht.la=Mr.la=0,vr.Za||(Ht.Na=Mr.Na=0),vr.Hc=0,vr.Gc=0,vr.ia=0;else{var On,Gr;if(Ht=Mr,Mr=Un,bi=St.Pa.Xc,fi=St.ya[St.aa+St.ja],Ur=St.pb[fi.$b],dr=fi.ad,wi=0,vn=St.rb[St.sb-1],Nr=jn=0,i(dr,wi,0,384),fi.Za)var Cn=0,Ln=bi[3];else{$r=a(16);var tn=Ht.Na+vn.Na;if(tn=ql(Mr,bi[1],tn,Ur.Eb,0,$r,0),Ht.Na=vn.Na=(0<tn)+0,1<tn)vs($r,0,dr,wi);else{var Ti=$r[0]+3>>3;for($r=0;256>$r;$r+=16)dr[wi+$r]=Ti}Cn=1,Ln=bi[0]}var Yr=15&Ht.la,Xr=15&vn.la;for($r=0;4>$r;++$r){var ei=1&Xr;for(Ti=Gr=0;4>Ti;++Ti)Yr=Yr>>1|(ei=(tn=ql(Mr,Ln,tn=ei+(1&Yr),Ur.Sc,Cn,dr,wi))>Cn)<<7,Gr=Gr<<2|(3<tn?3:1<tn?2:dr[wi+0]!=0),wi+=16;Yr>>=4,Xr=Xr>>1|ei<<7,jn=(jn<<8|Gr)>>>0}for(Ln=Yr,Cn=Xr>>4,On=0;4>On;On+=2){for(Gr=0,Yr=Ht.la>>4+On,Xr=vn.la>>4+On,$r=0;2>$r;++$r){for(ei=1&Xr,Ti=0;2>Ti;++Ti)tn=ei+(1&Yr),Yr=Yr>>1|(ei=0<(tn=ql(Mr,bi[2],tn,Ur.Qc,0,dr,wi)))<<3,Gr=Gr<<2|(3<tn?3:1<tn?2:dr[wi+0]!=0),wi+=16;Yr>>=2,Xr=Xr>>1|ei<<5}Nr|=Gr<<4*On,Ln|=Yr<<4<<On,Cn|=(240&Xr)<<On}Ht.la=Ln,vn.la=Cn,fi.Hc=jn,fi.Gc=Nr,fi.ia=43690&Nr?0:Ur.ia,bi=!(jn|Nr)}if(0<St.L&&(St.wa[St.Y+St.ja]=St.gd[vr.$b][vr.Za],St.wa[St.Y+St.ja].La|=!bi),Un.Ka)return Tr(Pr,7,"Premature end-of-file encountered.")}if(Mn(Pr),St=qn,Un=1,vr=(Ft=Pr).D,Ht=0<Ft.L&&Ft.M>=Ft.zb&&Ft.M<=Ft.Va,Ft.Aa==0)t:{if(vr.M=Ft.M,vr.uc=Ht,In(Ft,vr),Un=1,vr=(Gr=Ft.D).Nb,Ht=(Nr=ws[Ft.L])*Ft.R,Mr=Nr/2*Ft.B,$r=16*vr*Ft.R,Ti=8*vr*Ft.B,bi=Ft.sa,fi=Ft.ta-Ht+$r,Ur=Ft.qa,dr=Ft.ra-Mr+Ti,wi=Ft.Ha,vn=Ft.Ia-Mr+Ti,Xr=(Yr=Gr.M)==0,jn=Yr>=Ft.Va-1,Ft.Aa==2&&In(Ft,Gr),Gr.uc)for(ei=(tn=Ft).D.M,e(tn.D.uc),Gr=tn.yb;Gr<tn.Hb;++Gr){Cn=Gr,Ln=ei;var Ri=(ya=(Ar=tn).D).Nb;On=Ar.R;var ya=ya.wa[ya.Y+Cn],ti=Ar.sa,Hn=Ar.ta+16*Ri*On+16*Cn,ba=ya.dd,rn=ya.tc;if(rn!=0)if(e(3<=rn),Ar.L==1)0<Cn&&Yu(ti,Hn,On,rn+4),ya.La&&qi(ti,Hn,On,rn),0<Ln&&du(ti,Hn,On,rn+4),ya.La&&Ya(ti,Hn,On,rn);else{var Hi=Ar.B,Wr=Ar.qa,sr=Ar.ra+8*Ri*Hi+8*Cn,Ir=Ar.Ha,Ar=Ar.Ia+8*Ri*Hi+8*Cn;Ri=ya.ld,0<Cn&&(Lr(ti,Hn,On,rn+4,ba,Ri),Us(Wr,sr,Ir,Ar,Hi,rn+4,ba,Ri)),ya.La&&(Hs(ti,Hn,On,rn,ba,Ri),yl(Wr,sr,Ir,Ar,Hi,rn,ba,Ri)),0<Ln&&(Er(ti,Hn,On,rn+4,ba,Ri),Va(Wr,sr,Ir,Ar,Hi,rn+4,ba,Ri)),ya.La&&(ms(ti,Hn,On,rn,ba,Ri),Ci(Wr,sr,Ir,Ar,Hi,rn,ba,Ri))}}if(Ft.ia&&alert("todo:DitherRow"),St.put!=null){if(Gr=16*Yr,Yr=16*(Yr+1),Xr?(St.y=Ft.sa,St.O=Ft.ta+$r,St.f=Ft.qa,St.N=Ft.ra+Ti,St.ea=Ft.Ha,St.W=Ft.Ia+Ti):(Gr-=Nr,St.y=bi,St.O=fi,St.f=Ur,St.N=dr,St.ea=wi,St.W=vn),jn||(Yr-=Nr),Yr>St.o&&(Yr=St.o),St.F=null,St.J=null,Ft.Fa!=null&&0<Ft.Fa.length&&Gr<Yr&&(St.J=ui(Ft,St,Gr,Yr-Gr),St.F=Ft.mb,St.F==null&&St.F.length==0)){Un=Tr(Ft,3,"Could not decode alpha data.");break t}Gr<St.j&&(Nr=St.j-Gr,Gr=St.j,e(!(1&Nr)),St.O+=Ft.R*Nr,St.N+=Ft.B*(Nr>>1),St.W+=Ft.B*(Nr>>1),St.F!=null&&(St.J+=St.width*Nr)),Gr<Yr&&(St.O+=St.v,St.N+=St.v>>1,St.W+=St.v>>1,St.F!=null&&(St.J+=St.v),St.ka=Gr-St.j,St.U=St.va-St.v,St.T=Yr-Gr,Un=St.put(St))}vr+1!=Ft.Ic||jn||(n(Ft.sa,Ft.ta-Ht,bi,fi+16*Ft.R,Ht),n(Ft.qa,Ft.ra-Mr,Ur,dr+8*Ft.B,Mr),n(Ft.Ha,Ft.Ia-Mr,wi,vn+8*Ft.B,Mr))}if(!Un)return Tr(Pr,6,"Output aborted.")}return 1}(xe,$e)),$e.bc!=null&&$e.bc($e),Qe&=1}return Qe?(xe.cb=0,Qe):0})(P,re)||(R=P.a)}}else R=P.a}R==0&&ve.Oa!=null&&ve.Oa.fd&&(R=Il(ve.ba))}ve=R}pe=ve!=0?null:11>pe?be.f.RGBA.eb:be.f.kb.y}else pe=null;return pe};var Hl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(F,j){for(var O="",T=0;T<4;T++)O+=String.fromCharCode(F[j++]);return O}function f(F,j){return F[j+0]|F[j+1]<<8}function v(F,j){return(F[j+0]|F[j+1]<<8|F[j+2]<<16)>>>0}function g(F,j){return(F[j+0]|F[j+1]<<8|F[j+2]<<16|F[j+3]<<24)>>>0}new u;var p=[0],y=[0],_=[],x=new u,b=t,E=function(F,j){var O={},T=0,$=!1,q=0,J=0;if(O.frames=[],!function(D,U){for(var X=0;X<4;X++)if(D[U+X]!="RIFF".charCodeAt(X))return!0;return!1}(F,j)){for(g(F,j+=4),j+=8;j<F.length;){var ae=h(F,j),ie=g(F,j+=4);j+=4;var Z=ie+(1&ie);switch(ae){case"VP8 ":case"VP8L":O.frames[T]===void 0&&(O.frames[T]={}),(B=O.frames[T]).src_off=$?J:j-8,B.src_size=q+ie+8,T++,$&&($=!1,q=0,J=0);break;case"VP8X":(B=O.header={}).feature_flags=F[j];var te=j+4;B.canvas_width=1+v(F,te),te+=3,B.canvas_height=1+v(F,te),te+=3;break;case"ALPH":$=!0,q=Z+8,J=j-8;break;case"ANIM":(B=O.header).bgcolor=g(F,j),te=j+4,B.loop_count=f(F,te),te+=2;break;case"ANMF":var V,B;(B=O.frames[T]={}).offset_x=2*v(F,j),j+=3,B.offset_y=2*v(F,j),j+=3,B.width=1+v(F,j),j+=3,B.height=1+v(F,j),j+=3,B.duration=v(F,j),j+=3,V=F[j++],B.dispose=1&V,B.blend=V>>1&1}ae!="ANMF"&&(j+=Z)}return O}}(b,0);E.response=b,E.rgbaoutput=!0,E.dataurl=!1;var k=E.header?E.header:null,S=E.frames?E.frames:null;if(k){k.loop_counter=k.loop_count,p=[k.canvas_height],y=[k.canvas_width];for(var A=0;A<S.length&&S[A].blend!=0;A++);}var M=S[0],C=x.WebPDecodeRGBA(b,M.src_off,M.src_size,y,p);M.rgba=C,M.imgwidth=y[0],M.imgheight=p[0];for(var I=0;I<y[0]*p[0]*4;I++)_[I]=C[I];return this.width=y,this.height=p,this.data=_,this}(function(t){var e,r,n,i,a,o,s,u,h,f=function(D){return D=D||{},this.isStrokeTransparent=D.isStrokeTransparent||!1,this.strokeOpacity=D.strokeOpacity||1,this.strokeStyle=D.strokeStyle||"#000000",this.fillStyle=D.fillStyle||"#000000",this.isFillTransparent=D.isFillTransparent||!1,this.fillOpacity=D.fillOpacity||1,this.font=D.font||"10px sans-serif",this.textBaseline=D.textBaseline||"alphabetic",this.textAlign=D.textAlign||"left",this.lineWidth=D.lineWidth||1,this.lineJoin=D.lineJoin||"miter",this.lineCap=D.lineCap||"butt",this.path=D.path||[],this.transform=D.transform!==void 0?D.transform.clone():new u,this.globalCompositeOperation=D.globalCompositeOperation||"normal",this.globalAlpha=D.globalAlpha||1,this.clip_path=D.clip_path||[],this.currentPoint=D.currentPoint||new o,this.miterLimit=D.miterLimit||10,this.lastPoint=D.lastPoint||new o,this.lineDashOffset=D.lineDashOffset||0,this.lineDash=D.lineDash||[],this.margin=D.margin||[0,0,0,0],this.prevPageLastElemOffset=D.prevPageLastElemOffset||0,this.ignoreClearRect=typeof D.ignoreClearRect!="boolean"||D.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new v(this),e=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,u=this.internal.Matrix,h=new f}]);var v=function(D){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var U=D;Object.defineProperty(this,"pdf",{get:function(){return U}});var X=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return X},set:function(Ee){X=!!Ee}});var ee=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ee},set:function(Ee){ee=!!Ee}});var K=0;Object.defineProperty(this,"posX",{get:function(){return K},set:function(Ee){isNaN(Ee)||(K=Ee)}});var oe=0;Object.defineProperty(this,"posY",{get:function(){return oe},set:function(Ee){isNaN(Ee)||(oe=Ee)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(Ee){var ge;typeof Ee=="number"?ge=[Ee,Ee,Ee,Ee]:((ge=new Array(4))[0]=Ee[0],ge[1]=Ee.length>=2?Ee[1]:ge[0],ge[2]=Ee.length>=3?Ee[2]:ge[0],ge[3]=Ee.length>=4?Ee[3]:ge[1]),h.margin=ge}});var me=!1;Object.defineProperty(this,"autoPaging",{get:function(){return me},set:function(Ee){me=Ee}});var de=0;Object.defineProperty(this,"lastBreak",{get:function(){return de},set:function(Ee){de=Ee}});var ye=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ye},set:function(Ee){ye=Ee}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(Ee){Ee instanceof f&&(h=Ee)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(Ee){h.path=Ee}});var Te=[];Object.defineProperty(this,"ctxStack",{get:function(){return Te},set:function(Ee){Te=Ee}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Ee){var ge;ge=g(Ee),this.ctx.fillStyle=ge.style,this.ctx.isFillTransparent=ge.a===0,this.ctx.fillOpacity=ge.a,this.pdf.setFillColor(ge.r,ge.g,ge.b,{a:ge.a}),this.pdf.setTextColor(ge.r,ge.g,ge.b,{a:ge.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Ee){var ge=g(Ee);this.ctx.strokeStyle=ge.style,this.ctx.isStrokeTransparent=ge.a===0,this.ctx.strokeOpacity=ge.a,ge.a===0?this.pdf.setDrawColor(255,255,255):(ge.a,this.pdf.setDrawColor(ge.r,ge.g,ge.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Ee){["butt","round","square"].indexOf(Ee)!==-1&&(this.ctx.lineCap=Ee,this.pdf.setLineCap(Ee))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Ee){isNaN(Ee)||(this.ctx.lineWidth=Ee,this.pdf.setLineWidth(Ee))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Ee){["bevel","round","miter"].indexOf(Ee)!==-1&&(this.ctx.lineJoin=Ee,this.pdf.setLineJoin(Ee))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Ee){isNaN(Ee)||(this.ctx.miterLimit=Ee,this.pdf.setMiterLimit(Ee))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Ee){this.ctx.textBaseline=Ee}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Ee){["right","end","center","left","start"].indexOf(Ee)!==-1&&(this.ctx.textAlign=Ee)}});var Ce=null,Ie=null;Object.defineProperty(this,"fontFaces",{get:function(){return Ie},set:function(Ee){Ce=null,Ie=Ee}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Ee){var ge;if(this.ctx.font=Ee,(ge=/^\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(Ee))!==null){var Re=ge[1];ge[2];var Be=ge[3],Oe=ge[4];ge[5];var fe=ge[6],Le=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Oe)[2];Oe=Math.floor(Le==="px"?parseFloat(Oe)*this.pdf.internal.scaleFactor:Le==="em"?parseFloat(Oe)*this.pdf.getFontSize():parseFloat(Oe)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Oe);var Ne=function(bt){var At,Br,_r=[],It=bt.trim();if(It==="")return Fv;if(It in Ow)return[Ow[It]];for(;It!=="";){switch(Br=null,At=(It=Lw(It)).charAt(0)){case'"':case"'":Br=FI(It.substring(1),At);break;default:Br=BI(It)}if(Br===null||(_r.push(Br[0]),(It=Lw(Br[1]))!==""&&It.charAt(0)!==","))return Fv;It=It.replace(/^,/,"")}return _r}(fe);if(this.fontFaces){var ue=function(bt,At){if(Ce===null){var Br=function(_r){var It=[];return Object.keys(_r).forEach(function(Jt){_r[Jt].forEach(function(Ve){var qe=null;switch(Ve){case"bold":qe={family:Jt,weight:"bold"};break;case"italic":qe={family:Jt,style:"italic"};break;case"bolditalic":qe={family:Jt,weight:"bold",style:"italic"};break;case"":case"normal":qe={family:Jt}}qe!==null&&(qe.ref={name:Jt,style:Ve},It.push(qe))})}),It}(bt.getFontList());Ce=function(_r){for(var It={},Jt=0;Jt<_r.length;++Jt){var Ve=Dv(_r[Jt]),qe=Ve.family,Nt=Ve.stretch,Ct=Ve.style,ir=Ve.weight;It[qe]=It[qe]||{},It[qe][Nt]=It[qe][Nt]||{},It[qe][Nt][Ct]=It[qe][Nt][Ct]||{},It[qe][Nt][Ct][ir]=Ve}return It}(Br.concat(At))}return Ce}(this.pdf,this.fontFaces),ke=Ne.map(function(bt){return{family:bt,stretch:"normal",weight:Be,style:Re}}),Pe=function(bt,At,Br){for(var _r=(Br=Br||{}).defaultFontFamily||"times",It=Object.assign({},DI,Br.genericFontFamilies||{}),Jt=null,Ve=null,qe=0;qe<At.length;++qe)if(It[(Jt=Dv(At[qe])).family]&&(Jt.family=It[Jt.family]),bt.hasOwnProperty(Jt.family)){Ve=bt[Jt.family];break}if(!(Ve=Ve||bt[_r]))throw new Error("Could not find a font-family for the rule '"+Cw(Jt)+"' and default family '"+_r+"'.");if(Ve=function(Nt,Ct){if(Ct[Nt])return Ct[Nt];var ir=Nm[Nt],Ut=ir<=Nm.normal?-1:1,xr=Pw(Ct,ix,ir,Ut);if(!xr)throw new Error("Could not find a matching font-stretch value for "+Nt);return xr}(Jt.stretch,Ve),Ve=function(Nt,Ct){if(Ct[Nt])return Ct[Nt];for(var ir=nx[Nt],Ut=0;Ut<ir.length;++Ut)if(Ct[ir[Ut]])return Ct[ir[Ut]];throw new Error("Could not find a matching font-style for "+Nt)}(Jt.style,Ve),!(Ve=function(Nt,Ct){if(Ct[Nt])return Ct[Nt];if(Nt===400&&Ct[500])return Ct[500];if(Nt===500&&Ct[400])return Ct[400];var ir=jI[Nt],Ut=Pw(Ct,ax,ir,Nt<400?-1:1);if(!Ut)throw new Error("Could not find a matching font-weight for value "+Nt);return Ut}(Jt.weight,Ve)))throw new Error("Failed to resolve a font for the rule '"+Cw(Jt)+"'.");return Ve}(ue,ke);this.pdf.setFont(Pe.ref.name,Pe.ref.style)}else{var Ue="";(Be==="bold"||parseInt(Be,10)>=700||Re==="bold")&&(Ue="bold"),Re==="italic"&&(Ue+="italic"),Ue.length===0&&(Ue="normal");for(var st="",dt={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"},pt=0;pt<Ne.length;pt++){if(this.pdf.internal.getFont(Ne[pt],Ue,{noFallback:!0,disableWarning:!0})!==void 0){st=Ne[pt];break}if(Ue==="bolditalic"&&this.pdf.internal.getFont(Ne[pt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)st=Ne[pt],Ue="bold";else if(this.pdf.internal.getFont(Ne[pt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){st=Ne[pt],Ue="normal";break}}if(st===""){for(var xt=0;xt<Ne.length;xt++)if(dt[Ne[xt]]){st=dt[Ne[xt]];break}}st=st===""?"Times":st,this.pdf.setFont(st,Ue)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Ee){this.ctx.globalCompositeOperation=Ee}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Ee){this.ctx.globalAlpha=Ee}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Ee){this.ctx.lineDashOffset=Ee,B.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Ee){this.ctx.lineDash=Ee,B.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Ee){this.ctx.ignoreClearRect=!!Ee}})};v.prototype.setLineDash=function(D){this.lineDash=D},v.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},v.prototype.fill=function(){S.call(this,"fill",!1)},v.prototype.stroke=function(){S.call(this,"stroke",!1)},v.prototype.beginPath=function(){this.path=[{type:"begin"}]},v.prototype.moveTo=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var X=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"mt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(D,U)},v.prototype.closePath=function(){var D=new o(0,0),U=0;for(U=this.path.length-1;U!==-1;U--)if(this.path[U].type==="begin"&&Nn(this.path[U+1])==="object"&&typeof this.path[U+1].x=="number"){D=new o(this.path[U+1].x,this.path[U+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(D.x,D.y)},v.prototype.lineTo=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var X=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"lt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(X.x,X.y)},v.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},v.prototype.quadraticCurveTo=function(D,U,X,ee){if(isNaN(X)||isNaN(ee)||isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var K=this.ctx.transform.applyToPoint(new o(X,ee)),oe=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"qct",x1:oe.x,y1:oe.y,x:K.x,y:K.y}),this.ctx.lastPoint=new o(K.x,K.y)},v.prototype.bezierCurveTo=function(D,U,X,ee,K,oe){if(isNaN(K)||isNaN(oe)||isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var me=this.ctx.transform.applyToPoint(new o(K,oe)),de=this.ctx.transform.applyToPoint(new o(D,U)),ye=this.ctx.transform.applyToPoint(new o(X,ee));this.path.push({type:"bct",x1:de.x,y1:de.y,x2:ye.x,y2:ye.y,x:me.x,y:me.y}),this.ctx.lastPoint=new o(me.x,me.y)},v.prototype.arc=function(D,U,X,ee,K,oe){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee)||isNaN(K))throw Yn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(oe=!!oe,!this.ctx.transform.isIdentity){var me=this.ctx.transform.applyToPoint(new o(D,U));D=me.x,U=me.y;var de=this.ctx.transform.applyToPoint(new o(0,X)),ye=this.ctx.transform.applyToPoint(new o(0,0));X=Math.sqrt(Math.pow(de.x-ye.x,2)+Math.pow(de.y-ye.y,2))}Math.abs(K-ee)>=2*Math.PI&&(ee=0,K=2*Math.PI),this.path.push({type:"arc",x:D,y:U,radius:X,startAngle:ee,endAngle:K,counterclockwise:oe})},v.prototype.arcTo=function(D,U,X,ee,K){throw new Error("arcTo not implemented.")},v.prototype.rect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(D,U),this.lineTo(D+X,U),this.lineTo(D+X,U+ee),this.lineTo(D,U+ee),this.lineTo(D,U),this.lineTo(D+X,U),this.lineTo(D,U)},v.prototype.fillRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!p.call(this)){var K={};this.lineCap!=="butt"&&(K.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(K.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(D,U,X,ee),this.fill(),K.hasOwnProperty("lineCap")&&(this.lineCap=K.lineCap),K.hasOwnProperty("lineJoin")&&(this.lineJoin=K.lineJoin)}},v.prototype.strokeRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");y.call(this)||(this.beginPath(),this.rect(D,U,X,ee),this.stroke())},v.prototype.clearRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(D,U,X,ee))},v.prototype.save=function(D){D=typeof D!="boolean"||D;for(var U=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("q");if(this.pdf.setPage(U),D){this.ctx.fontSize=this.pdf.internal.getFontSize();var ee=new f(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ee}},v.prototype.restore=function(D){D=typeof D!="boolean"||D;for(var U=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("Q");this.pdf.setPage(U),D&&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)},v.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var g=function(D){var U,X,ee,K;if(D.isCanvasGradient===!0&&(D=D.getColor()),!D)return{r:0,g:0,b:0,a:0,style:D};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(D))U=0,X=0,ee=0,K=0;else{var oe=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(D);if(oe!==null)U=parseInt(oe[1]),X=parseInt(oe[2]),ee=parseInt(oe[3]),K=1;else if((oe=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(D))!==null)U=parseInt(oe[1]),X=parseInt(oe[2]),ee=parseInt(oe[3]),K=parseFloat(oe[4]);else{if(K=1,typeof D=="string"&&D.charAt(0)!=="#"){var me=new K_(D);D=me.ok?me.toHex():"#000000"}D.length===4?(U=D.substring(1,2),U+=U,X=D.substring(2,3),X+=X,ee=D.substring(3,4),ee+=ee):(U=D.substring(1,3),X=D.substring(3,5),ee=D.substring(5,7)),U=parseInt(U,16),X=parseInt(X,16),ee=parseInt(ee,16)}}return{r:U,g:X,b:ee,a:K,style:D}},p=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},y=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};v.prototype.fillText=function(D,U,X,ee){if(isNaN(U)||isNaN(X)||typeof D!="string")throw Yn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ee=isNaN(ee)?void 0:ee,!p.call(this)){var K=Z(this.ctx.transform.rotation),oe=this.ctx.transform.scaleX;T.call(this,{text:D,x:U,y:X,scale:oe,angle:K,align:this.textAlign,maxWidth:ee})}},v.prototype.strokeText=function(D,U,X,ee){if(isNaN(U)||isNaN(X)||typeof D!="string")throw Yn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!y.call(this)){ee=isNaN(ee)?void 0:ee;var K=Z(this.ctx.transform.rotation),oe=this.ctx.transform.scaleX;T.call(this,{text:D,x:U,y:X,scale:oe,renderingMode:"stroke",angle:K,align:this.textAlign,maxWidth:ee})}},v.prototype.measureText=function(D){if(typeof D!="string")throw Yn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var U=this.pdf,X=this.pdf.internal.scaleFactor,ee=U.internal.getFontSize(),K=U.getStringUnitWidth(D)*ee/U.internal.scaleFactor;return new function(oe){var me=(oe=oe||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return me}}),this}({width:K*=Math.round(96*X/72*1e4)/1e4})},v.prototype.scale=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var X=new u(D,0,0,U,0,0);this.ctx.transform=this.ctx.transform.multiply(X)},v.prototype.rotate=function(D){if(isNaN(D))throw Yn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var U=new u(Math.cos(D),Math.sin(D),-Math.sin(D),Math.cos(D),0,0);this.ctx.transform=this.ctx.transform.multiply(U)},v.prototype.translate=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var X=new u(1,0,0,1,D,U);this.ctx.transform=this.ctx.transform.multiply(X)},v.prototype.transform=function(D,U,X,ee,K,oe){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee)||isNaN(K)||isNaN(oe))throw Yn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var me=new u(D,U,X,ee,K,oe);this.ctx.transform=this.ctx.transform.multiply(me)},v.prototype.setTransform=function(D,U,X,ee,K,oe){D=isNaN(D)?1:D,U=isNaN(U)?0:U,X=isNaN(X)?0:X,ee=isNaN(ee)?1:ee,K=isNaN(K)?0:K,oe=isNaN(oe)?0:oe,this.ctx.transform=new u(D,U,X,ee,K,oe)};var _=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};v.prototype.drawImage=function(D,U,X,ee,K,oe,me,de,ye){var Te=this.pdf.getImageProperties(D),Ce=1,Ie=1,Ee=1,ge=1;ee!==void 0&&de!==void 0&&(Ee=de/ee,ge=ye/K,Ce=Te.width/ee*de/ee,Ie=Te.height/K*ye/K),oe===void 0&&(oe=U,me=X,U=0,X=0),ee!==void 0&&de===void 0&&(de=ee,ye=K),ee===void 0&&de===void 0&&(de=Te.width,ye=Te.height);for(var Re,Be=this.ctx.transform.decompose(),Oe=Z(Be.rotate.shx),fe=new u,Le=(fe=(fe=(fe=fe.multiply(Be.translate)).multiply(Be.skew)).multiply(Be.scale)).applyToRectangle(new s(oe-U*Ee,me-X*ge,ee*Ce,K*Ie)),Ne=x.call(this,Le),ue=[],ke=0;ke<Ne.length;ke+=1)ue.indexOf(Ne[ke])===-1&&ue.push(Ne[ke]);if(k(ue),this.autoPaging)for(var Pe=ue[0],Ue=ue[ue.length-1],st=Pe;st<Ue+1;st++){this.pdf.setPage(st);var dt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],pt=st===1?this.posY+this.margin[0]:this.margin[0],xt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],bt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],At=st===1?0:xt+(st-2)*bt;if(this.ctx.clip_path.length!==0){var Br=this.path;Re=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(Re,this.posX+this.margin[3],-At+pt+this.ctx.prevPageLastElemOffset),A.call(this,"fill",!0),this.path=Br}var _r=JSON.parse(JSON.stringify(Le));_r=E([_r],this.posX+this.margin[3],-At+pt+this.ctx.prevPageLastElemOffset)[0];var It=(st>Pe||st<Ue)&&_.call(this);It&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],dt,bt,null).clip().discardPath()),this.pdf.addImage(D,"JPEG",_r.x,_r.y,_r.w,_r.h,null,null,Oe),It&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(D,"JPEG",Le.x,Le.y,Le.w,Le.h,null,null,Oe)};var x=function(D,U,X){var ee=[];U=U||this.pdf.internal.pageSize.width,X=X||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var K=this.posY+this.ctx.prevPageLastElemOffset;switch(D.type){default:case"mt":case"lt":ee.push(Math.floor((D.y+K)/X)+1);break;case"arc":ee.push(Math.floor((D.y+K-D.radius)/X)+1),ee.push(Math.floor((D.y+K+D.radius)/X)+1);break;case"qct":var oe=te(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x,D.y);ee.push(Math.floor((oe.y+K)/X)+1),ee.push(Math.floor((oe.y+oe.h+K)/X)+1);break;case"bct":var me=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x2,D.y2,D.x,D.y);ee.push(Math.floor((me.y+K)/X)+1),ee.push(Math.floor((me.y+me.h+K)/X)+1);break;case"rect":ee.push(Math.floor((D.y+K)/X)+1),ee.push(Math.floor((D.y+D.h+K)/X)+1)}for(var de=0;de<ee.length;de+=1)for(;this.pdf.internal.getNumberOfPages()<ee[de];)b.call(this);return ee},b=function(){var D=this.fillStyle,U=this.strokeStyle,X=this.font,ee=this.lineCap,K=this.lineWidth,oe=this.lineJoin;this.pdf.addPage(),this.fillStyle=D,this.strokeStyle=U,this.font=X,this.lineCap=ee,this.lineWidth=K,this.lineJoin=oe},E=function(D,U,X){for(var ee=0;ee<D.length;ee++)switch(D[ee].type){case"bct":D[ee].x2+=U,D[ee].y2+=X;case"qct":D[ee].x1+=U,D[ee].y1+=X;default:D[ee].x+=U,D[ee].y+=X}return D},k=function(D){return D.sort(function(U,X){return U-X})},S=function(D,U){for(var X,ee,K=this.fillStyle,oe=this.strokeStyle,me=this.lineCap,de=this.lineWidth,ye=Math.abs(de*this.ctx.transform.scaleX),Te=this.lineJoin,Ce=JSON.parse(JSON.stringify(this.path)),Ie=JSON.parse(JSON.stringify(this.path)),Ee=[],ge=0;ge<Ie.length;ge++)if(Ie[ge].x!==void 0)for(var Re=x.call(this,Ie[ge]),Be=0;Be<Re.length;Be+=1)Ee.indexOf(Re[Be])===-1&&Ee.push(Re[Be]);for(var Oe=0;Oe<Ee.length;Oe++)for(;this.pdf.internal.getNumberOfPages()<Ee[Oe];)b.call(this);if(k(Ee),this.autoPaging)for(var fe=Ee[0],Le=Ee[Ee.length-1],Ne=fe;Ne<Le+1;Ne++){this.pdf.setPage(Ne),this.fillStyle=K,this.strokeStyle=oe,this.lineCap=me,this.lineWidth=ye,this.lineJoin=Te;var ue=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ke=Ne===1?this.posY+this.margin[0]:this.margin[0],Pe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ue=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],st=Ne===1?0:Pe+(Ne-2)*Ue;if(this.ctx.clip_path.length!==0){var dt=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(X,this.posX+this.margin[3],-st+ke+this.ctx.prevPageLastElemOffset),A.call(this,D,!0),this.path=dt}if(ee=JSON.parse(JSON.stringify(Ce)),this.path=E(ee,this.posX+this.margin[3],-st+ke+this.ctx.prevPageLastElemOffset),U===!1||Ne===0){var pt=(Ne>fe||Ne<Le)&&_.call(this);pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ue,Ue,null).clip().discardPath()),A.call(this,D,U),pt&&this.pdf.restoreGraphicsState()}this.lineWidth=de}else this.lineWidth=ye,A.call(this,D,U),this.lineWidth=de;this.path=Ce},A=function(D,U){if((D!=="stroke"||U||!y.call(this))&&(D==="stroke"||U||!p.call(this))){for(var X,ee,K=[],oe=this.path,me=0;me<oe.length;me++){var de=oe[me];switch(de.type){case"begin":K.push({begin:!0});break;case"close":K.push({close:!0});break;case"mt":K.push({start:de,deltas:[],abs:[]});break;case"lt":var ye=K.length;if(oe[me-1]&&!isNaN(oe[me-1].x)&&(X=[de.x-oe[me-1].x,de.y-oe[me-1].y],ye>0)){for(;ye>=0;ye--)if(K[ye-1].close!==!0&&K[ye-1].begin!==!0){K[ye-1].deltas.push(X),K[ye-1].abs.push(de);break}}break;case"bct":X=[de.x1-oe[me-1].x,de.y1-oe[me-1].y,de.x2-oe[me-1].x,de.y2-oe[me-1].y,de.x-oe[me-1].x,de.y-oe[me-1].y],K[K.length-1].deltas.push(X);break;case"qct":var Te=oe[me-1].x+2/3*(de.x1-oe[me-1].x),Ce=oe[me-1].y+2/3*(de.y1-oe[me-1].y),Ie=de.x+2/3*(de.x1-de.x),Ee=de.y+2/3*(de.y1-de.y),ge=de.x,Re=de.y;X=[Te-oe[me-1].x,Ce-oe[me-1].y,Ie-oe[me-1].x,Ee-oe[me-1].y,ge-oe[me-1].x,Re-oe[me-1].y],K[K.length-1].deltas.push(X);break;case"arc":K.push({deltas:[],abs:[],arc:!0}),Array.isArray(K[K.length-1].abs)&&K[K.length-1].abs.push(de)}}ee=U?null:D==="stroke"?"stroke":"fill";for(var Be=!1,Oe=0;Oe<K.length;Oe++)if(K[Oe].arc)for(var fe=K[Oe].abs,Le=0;Le<fe.length;Le++){var Ne=fe[Le];Ne.type==="arc"?I.call(this,Ne.x,Ne.y,Ne.radius,Ne.startAngle,Ne.endAngle,Ne.counterclockwise,void 0,U,!Be):$.call(this,Ne.x,Ne.y),Be=!0}else if(K[Oe].close===!0)this.pdf.internal.out("h"),Be=!1;else if(K[Oe].begin!==!0){var ue=K[Oe].start.x,ke=K[Oe].start.y;q.call(this,K[Oe].deltas,ue,ke),Be=!0}ee&&F.call(this,ee),U&&j.call(this)}},M=function(D){var U=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,X=U*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return D-X;case"top":return D+U-X;case"hanging":return D+U-2*X;case"middle":return D+U/2-X;default:return D}},C=function(D){return D+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};v.prototype.createLinearGradient=function(){var D=function(){};return D.colorStops=[],D.addColorStop=function(U,X){this.colorStops.push([U,X])},D.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},D.isCanvasGradient=!0,D},v.prototype.createPattern=function(){return this.createLinearGradient()},v.prototype.createRadialGradient=function(){return this.createLinearGradient()};var I=function(D,U,X,ee,K,oe,me,de,ye){for(var Te=ae.call(this,X,ee,K,oe),Ce=0;Ce<Te.length;Ce++){var Ie=Te[Ce];Ce===0&&(ye?O.call(this,Ie.x1+D,Ie.y1+U):$.call(this,Ie.x1+D,Ie.y1+U)),J.call(this,D,U,Ie.x2,Ie.y2,Ie.x3,Ie.y3,Ie.x4,Ie.y4)}de?j.call(this):F.call(this,me)},F=function(D){switch(D){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(D,U){this.pdf.internal.out(r(D)+" "+n(U)+" m")},T=function(D){var U;switch(D.align){case"right":case"end":U="right";break;case"center":U="center";break;default:U="left"}var X=this.pdf.getTextDimensions(D.text),ee=M.call(this,D.y),K=C.call(this,ee)-X.h,oe=this.ctx.transform.applyToPoint(new o(D.x,ee)),me=this.ctx.transform.decompose(),de=new u;de=(de=(de=de.multiply(me.translate)).multiply(me.skew)).multiply(me.scale);for(var ye,Te,Ce,Ie=this.ctx.transform.applyToRectangle(new s(D.x,ee,X.w,X.h)),Ee=de.applyToRectangle(new s(D.x,K,X.w,X.h)),ge=x.call(this,Ee),Re=[],Be=0;Be<ge.length;Be+=1)Re.indexOf(ge[Be])===-1&&Re.push(ge[Be]);if(k(Re),this.autoPaging)for(var Oe=Re[0],fe=Re[Re.length-1],Le=Oe;Le<fe+1;Le++){this.pdf.setPage(Le);var Ne=Le===1?this.posY+this.margin[0]:this.margin[0],ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ke=this.pdf.internal.pageSize.height-this.margin[2],Pe=ke-this.margin[0],Ue=this.pdf.internal.pageSize.width-this.margin[1],st=Ue-this.margin[3],dt=Le===1?0:ue+(Le-2)*Pe;if(this.ctx.clip_path.length!==0){var pt=this.path;ye=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(ye,this.posX+this.margin[3],-1*dt+Ne),A.call(this,"fill",!0),this.path=pt}var xt=E([JSON.parse(JSON.stringify(Ee))],this.posX+this.margin[3],-dt+Ne+this.ctx.prevPageLastElemOffset)[0];D.scale>=.01&&(Te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Te*D.scale),Ce=this.lineWidth,this.lineWidth=Ce*D.scale);var bt=this.autoPaging!=="text";if(bt||xt.y+xt.h<=ke){if(bt||xt.y>=Ne&&xt.x<=Ue){var At=bt?D.text:this.pdf.splitTextToSize(D.text,D.maxWidth||Ue-xt.x)[0],Br=E([JSON.parse(JSON.stringify(Ie))],this.posX+this.margin[3],-dt+Ne+this.ctx.prevPageLastElemOffset)[0],_r=bt&&(Le>Oe||Le<fe)&&_.call(this);_r&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],st,Pe,null).clip().discardPath()),this.pdf.text(At,Br.x,Br.y,{angle:D.angle,align:U,renderingMode:D.renderingMode}),_r&&this.pdf.restoreGraphicsState()}}else xt.y<ke&&(this.ctx.prevPageLastElemOffset+=ke-xt.y);D.scale>=.01&&(this.pdf.setFontSize(Te),this.lineWidth=Ce)}else D.scale>=.01&&(Te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Te*D.scale),Ce=this.lineWidth,this.lineWidth=Ce*D.scale),this.pdf.text(D.text,oe.x+this.posX,oe.y+this.posY,{angle:D.angle,align:U,renderingMode:D.renderingMode,maxWidth:D.maxWidth}),D.scale>=.01&&(this.pdf.setFontSize(Te),this.lineWidth=Ce)},$=function(D,U,X,ee){X=X||0,ee=ee||0,this.pdf.internal.out(r(D+X)+" "+n(U+ee)+" l")},q=function(D,U,X){return this.pdf.lines(D,U,X,null,null)},J=function(D,U,X,ee,K,oe,me,de){this.pdf.internal.out([e(i(X+D)),e(a(ee+U)),e(i(K+D)),e(a(oe+U)),e(i(me+D)),e(a(de+U)),"c"].join(" "))},ae=function(D,U,X,ee){for(var K=2*Math.PI,oe=Math.PI/2;U>X;)U-=K;var me=Math.abs(X-U);me<K&&ee&&(me=K-me);for(var de=[],ye=ee?-1:1,Te=U;me>1e-5;){var Ce=Te+ye*Math.min(me,oe);de.push(ie.call(this,D,Te,Ce)),me-=Math.abs(Ce-Te),Te=Ce}return de},ie=function(D,U,X){var ee=(X-U)/2,K=D*Math.cos(ee),oe=D*Math.sin(ee),me=K,de=-oe,ye=me*me+de*de,Te=ye+me*K+de*oe,Ce=4/3*(Math.sqrt(2*ye*Te)-Te)/(me*oe-de*K),Ie=me-Ce*de,Ee=de+Ce*me,ge=Ie,Re=-Ee,Be=ee+U,Oe=Math.cos(Be),fe=Math.sin(Be);return{x1:D*Math.cos(U),y1:D*Math.sin(U),x2:Ie*Oe-Ee*fe,y2:Ie*fe+Ee*Oe,x3:ge*Oe-Re*fe,y3:ge*fe+Re*Oe,x4:D*Math.cos(X),y4:D*Math.sin(X)}},Z=function(D){return 180*D/Math.PI},te=function(D,U,X,ee,K,oe){var me=D+.5*(X-D),de=U+.5*(ee-U),ye=K+.5*(X-K),Te=oe+.5*(ee-oe),Ce=Math.min(D,K,me,ye),Ie=Math.max(D,K,me,ye),Ee=Math.min(U,oe,de,Te),ge=Math.max(U,oe,de,Te);return new s(Ce,Ee,Ie-Ce,ge-Ee)},V=function(D,U,X,ee,K,oe,me,de){var ye,Te,Ce,Ie,Ee,ge,Re,Be,Oe,fe,Le,Ne,ue,ke,Pe=X-D,Ue=ee-U,st=K-X,dt=oe-ee,pt=me-K,xt=de-oe;for(Te=0;Te<41;Te++)Oe=(Re=(Ce=D+(ye=Te/40)*Pe)+ye*((Ee=X+ye*st)-Ce))+ye*(Ee+ye*(K+ye*pt-Ee)-Re),fe=(Be=(Ie=U+ye*Ue)+ye*((ge=ee+ye*dt)-Ie))+ye*(ge+ye*(oe+ye*xt-ge)-Be),Te==0?(Le=Oe,Ne=fe,ue=Oe,ke=fe):(Le=Math.min(Le,Oe),Ne=Math.min(Ne,fe),ue=Math.max(ue,Oe),ke=Math.max(ke,fe));return new s(Math.round(Le),Math.round(Ne),Math.round(ue-Le),Math.round(ke-Ne))},B=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var D,U,X=(D=this.ctx.lineDash,U=this.ctx.lineDashOffset,JSON.stringify({lineDash:D,lineDashOffset:U}));this.prevLineDash!==X&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=X)}}})(tr.API),function(t){var e=function(o){var s,u,h,f,v,g,p,y,_,x;for(u=[],h=0,f=(o+=s="\0\0\0\0".slice(o.length%4||4)).length;f>h;h+=4)(v=(o.charCodeAt(h)<<24)+(o.charCodeAt(h+1)<<16)+(o.charCodeAt(h+2)<<8)+o.charCodeAt(h+3))!==0?(g=(v=((v=((v=((v=(v-(x=v%85))/85)-(_=v%85))/85)-(y=v%85))/85)-(p=v%85))/85)%85,u.push(g+33,p+33,y+33,_+33,x+33)):u.push(122);return function(b,E){for(var k=E;k>0;k--)b.pop()}(u,s.length),String.fromCharCode.apply(String,u)+"~>"},r=function(o){var s,u,h,f,v,g=String,p="length",y=255,_="charCodeAt",x="slice",b="replace";for(o[x](-2),o=o[x](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),h=[],f=0,v=(o+=s="uuuuu"[x](o[p]%5||5))[p];v>f;f+=5)u=52200625*(o[_](f)-33)+614125*(o[_](f+1)-33)+7225*(o[_](f+2)-33)+85*(o[_](f+3)-33)+(o[_](f+4)-33),h.push(y&u>>24,y&u>>16,y&u>>8,y&u);return function(E,k){for(var S=k;S>0;S--)E.pop()}(h,s[p]),g.fromCharCode.apply(g,h)},n=function(o){return o.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(o){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),s.test(o)===!1)return"";for(var u="",h=0;h<o.length;h+=2)u+=String.fromCharCode("0x"+(o[h]+o[h+1]));return u},a=function(o){for(var s=new Uint8Array(o.length),u=o.length;u--;)s[u]=o.charCodeAt(u);return(s=Em(s)).reduce(function(h,f){return h+String.fromCharCode(f)},"")};t.processDataByFilters=function(o,s){var u=0,h=o||"",f=[];for(typeof(s=s||[])=="string"&&(s=[s]),u=0;u<s.length;u+=1)switch(s[u]){case"ASCII85Decode":case"/ASCII85Decode":h=r(h),f.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":h=e(h),f.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":h=i(h),f.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":h=n(h),f.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":h=a(h),f.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[u]+'" is not implemented')}return{data:h,reverseChain:f.reverse().join(" ")}}}(tr.API),function(t){t.loadFile=function(e,r,n){return function(i,a,o){a=a!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=function(u,h,f){var v=new XMLHttpRequest,g=0,p=function(y){var _=y.length,x=[],b=String.fromCharCode;for(g=0;g<_;g+=1)x.push(b(255&y.charCodeAt(g)));return x.join("")};if(v.open("GET",u,!h),v.overrideMimeType("text/plain; charset=x-user-defined"),h===!1&&(v.onload=function(){v.status===200?f(p(this.responseText)):f(void 0)}),v.send(null),h&&v.status===200)return p(v.responseText)}(i,a,o)}catch{}return s}(e,r,n)},t.loadImageFile=t.loadFile}(tr.API),function(t){function e(){return(yr.html2canvas?Promise.resolve(yr.html2canvas):bv(()=>import("./html2canvas.esm-BfxBtG_O.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function r(){return(yr.DOMPurify?Promise.resolve(yr.DOMPurify):bv(()=>import("./purify.es-CQJ0hv7W.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var n=function(s){var u=Nn(s);return u==="undefined"?"undefined":u==="string"||s instanceof String?"string":u==="number"||s instanceof Number?"number":u==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":u==="object"?"object":"unknown"},i=function(s,u){var h=document.createElement(s);for(var f in u.className&&(h.className=u.className),u.innerHTML&&u.dompurify&&(h.innerHTML=u.dompurify.sanitize(u.innerHTML)),u.style)h.style[f]=u.style[f];return h},a=function s(u,h){for(var f=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),v=u.firstChild;v;v=v.nextSibling)h!==!0&&v.nodeType===1&&v.nodeName==="SCRIPT"||f.appendChild(s(v,h));return u.nodeType===1&&(u.nodeName==="CANVAS"?(f.width=u.width,f.height=u.height,f.getContext("2d").drawImage(u,0,0)):u.nodeName!=="TEXTAREA"&&u.nodeName!=="SELECT"||(f.value=u.value),f.addEventListener("load",function(){f.scrollTop=u.scrollTop,f.scrollLeft=u.scrollLeft},!0)),f},o=function s(u){var h=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),f=s.convert(Promise.resolve(),h);return(f=f.setProgress(1,s,1,[s])).set(u)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(s,u){return s.__proto__=u||o.prototype,s},o.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"}},o.prototype.from=function(s,u){return this.then(function(){switch(u=u||function(h){switch(n(h)){case"string":return"string";case"element":return h.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(s),u){case"string":return this.then(r).then(function(h){return this.set({src:i("div",{innerHTML:s,dompurify:h})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},o.prototype.to=function(s){switch(s){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.")}},o.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 s={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},u=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);u.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(u),this.prop.container.firstChild.appendChild(i("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"})},o.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(u){var h=Object.assign({},this.opt.html2canvas);return delete h.onrendered,u(this.prop.container,h)}).then(function(u){(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(u){var h=this.opt.jsPDF,f=this.opt.fontFaces,v=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,g=Object.assign({async:!0,allowTaint:!0,scale:v,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 g.onrendered,h.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,h.context2d.posX=this.opt.x,h.context2d.posY=this.opt.y,h.context2d.margin=this.opt.margin,h.context2d.fontFaces=f,f)for(var p=0;p<f.length;++p){var y=f[p],_=y.src.find(function(x){return x.format==="truetype"});_&&h.addFont(_.url,y.ref.name,y.ref.style)}return g.windowHeight=g.windowHeight||0,g.windowHeight=g.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):g.windowHeight,h.context2d.save(!0),u(this.prop.container,g)}).then(function(u){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(s,u,h){return(h=h||"pdf").toLowerCase()==="img"||h.toLowerCase()==="image"?this.outputImg(s,u):this.outputPdf(s,u)},o.prototype.outputPdf=function(s,u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,u)})},o.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){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 "'+s+'" is not supported.'}})},o.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(s){if(n(s)!=="object")return this;var u=Object.keys(s||{}).map(function(h){if(h in o.template.prop)return function(){this.prop[h]=s[h]};switch(h){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[h]=s[h]}}},this);return this.then(function(){return this.thenList(u)})},o.prototype.get=function(s,u){return this.then(function(){var h=s in o.template.prop?this.prop[s]:this.opt[s];return u?u(h):h})},o.prototype.setMargin=function(s){return this.then(function(){switch(n(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},o.prototype.setPageSize=function(s){function u(h,f){return Math.floor(h*f/72*96)}return this.then(function(){(s=s||tr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:u(s.inner.width,s.k),height:u(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},o.prototype.setProgress=function(s,u,h,f){return s!=null&&(this.progress.val=s),u!=null&&(this.progress.state=u),h!=null&&(this.progress.n=h),f!=null&&(this.progress.stack=f),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(s,u,h,f){return this.setProgress(s?this.progress.val+s:null,u||null,h?this.progress.n+h:null,f?this.progress.stack.concat(f):null)},o.prototype.then=function(s,u){var h=this;return this.thenCore(s,u,function(f,v){return h.updateProgress(null,null,1,[f]),Promise.prototype.then.call(this,function(g){return h.updateProgress(null,f),g}).then(f,v).then(function(g){return h.updateProgress(1),g})})},o.prototype.thenCore=function(s,u,h){h=h||Promise.prototype.then;var f=this;s&&(s=s.bind(f)),u&&(u=u.bind(f));var v=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?f:o.convert(Object.assign({},f),Promise.prototype),g=h.call(v,s,u);return o.convert(g,f.__proto__)},o.prototype.thenExternal=function(s,u){return Promise.prototype.then.call(this,s,u)},o.prototype.thenList=function(s){var u=this;return s.forEach(function(h){u=u.thenCore(h)}),u},o.prototype.catch=function(s){s&&(s=s.bind(this));var u=Promise.prototype.catch.call(this,s);return o.convert(u,this)},o.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},o.prototype.error=function(s){return this.then(function(){throw new Error(s)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,tr.getPageSize=function(s,u,h){if(Nn(s)==="object"){var f=s;s=f.orientation,u=f.unit||u,h=f.format||h}u=u||"mm",h=h||"a4",s=(""+(s||"P")).toLowerCase();var v,g=(""+h).toLowerCase(),p={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(u){case"pt":v=1;break;case"mm":v=72/25.4;break;case"cm":v=72/2.54;break;case"in":v=72;break;case"px":v=.75;break;case"pc":case"em":v=12;break;case"ex":v=6;break;default:throw"Invalid unit: "+u}var y,_=0,x=0;if(p.hasOwnProperty(g))_=p[g][1]/v,x=p[g][0]/v;else try{_=h[1],x=h[0]}catch{throw new Error("Invalid format: "+h)}if(s==="p"||s==="portrait")s="p",x>_&&(y=x,x=_,_=y);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",_>x&&(y=x,x=_,_=y)}return{width:x,height:_,unit:u,k:v,orientation:s}},t.html=function(s,u){(u=u||{}).callback=u.callback||function(){},u.html2canvas=u.html2canvas||{},u.html2canvas.canvas=u.html2canvas.canvas||this.canvas,u.jsPDF=u.jsPDF||this,u.fontFaces=u.fontFaces?u.fontFaces.map(Dv):null;var h=new o(u);return u.worker?h:h.from(s).doCallback()}}(tr.API),tr.API.addJS=function(t){return Tw=t,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"),Nw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Tw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){D1!==void 0&&Nw!==void 0&&this.internal.out("/Names <</JavaScript "+D1+" 0 R>>")}),this},function(t){var e;t.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),a=0;a<i.length;a++){var o=i[a],s=n.exec(o);if(s!=null){var u=s[1];r.internal.newObjectDeferredBegin(u,!1)}r.internal.write(o)}if(this.outline.createNamedDestinations){var h=this.internal.pages.length,f=[];for(a=0;a<h;a++){var v=r.internal.newObject();f.push(v);var g=r.internal.getPageInfo(a+1);r.internal.write("<< /D["+g.objId+" 0 R /XYZ null null null]>> endobj")}var p=r.internal.newObject();for(r.internal.write("<< /Names [ "),a=0;a<f.length;a++)r.internal.write("(page_"+(a+1)+")"+f[a]+" 0 R");r.internal.write(" ] >>","endobj"),e=r.internal.newObject(),r.internal.write("<< /Dests "+p+" 0 R"),r.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,a){var o={title:i,options:a,children:[]};return n==null&&(n=this.root),n.children.push(o),o},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var i=0;i<n.children.length;i++)this.genIds_r(n.children[i])},r.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()},r.outline.renderItems=function(n){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<n.children.length;a++){var o=n.children[a];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(n)),a>0&&this.line("/Prev "+this.makeRef(n.children[a-1])),a<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[a+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 u=r.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var h=0;h<n.children.length;h++)this.renderItems(n.children[h])},r.outline.line=function(n){this.ctx.val+=n+`\r
551
+ `},r.outline.makeRef=function(n){return n.id+" 0 R"},r.outline.makeString=function(n){return"("+r.internal.pdfEscape(n)+")"},r.outline.objStart=function(n){this.ctx.val+=`\r
552
+ `+n.id+` 0 obj\r
553
+ <<\r
554
+ `},r.outline.objEnd=function(){this.ctx.val+=`>> \r
555
+ endobj\r
556
+ `},r.outline.count_r=function(n,i){for(var a=0;a<i.children.length;a++)n.count++,this.count_r(n,i.children[a]);return n.count}}])}(tr.API),function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(r,n,i,a,o,s){var u,h=this.decode.DCT_DECODE,f=null;if(typeof r=="string"||this.__addimage__.isArrayBuffer(r)||this.__addimage__.isArrayBufferView(r)){switch(r=o||r,r=this.__addimage__.isArrayBuffer(r)?new Uint8Array(r):r,u=function(v){for(var g,p=256*v.charCodeAt(4)+v.charCodeAt(5),y=v.length,_={width:0,height:0,numcomponents:1},x=4;x<y;x+=2){if(x+=p,e.indexOf(v.charCodeAt(x+1))!==-1){g=256*v.charCodeAt(x+5)+v.charCodeAt(x+6),_={width:256*v.charCodeAt(x+7)+v.charCodeAt(x+8),height:g,numcomponents:v.charCodeAt(x+9)};break}p=256*v.charCodeAt(x+2)+v.charCodeAt(x+3)}return _}(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r),u.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}f={data:r,width:u.width,height:u.height,colorSpace:s,bitsPerComponent:8,filter:h,index:n,alias:i}}return f}}(tr.API),tr.API.processPNG=function(t,e,r,n){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var i,a=xI(t,{checkCrc:!0}),o=a.width,s=a.height,u=a.channels,h=a.palette,f=a.depth;i=h&&u===1?function(I){for(var F=I.width,j=I.height,O=I.data,T=I.palette,$=I.depth,q=!1,J=[],ae=[],ie=void 0,Z=!1,te=0,V=0;V<T.length;V++){var B=j4(T[V],4),D=B[0],U=B[1],X=B[2],ee=B[3];J.push(D,U,X),ee!=null&&(ee===0?(te++,ae.length<1&&ae.push(V)):ee<255&&(Z=!0))}if(Z||te>1){q=!0,ae=void 0;var K=F*j;ie=new Uint8Array(K);for(var oe=new DataView(O.buffer),me=0;me<K;me++){var de=Bv(oe,me,$),ye=j4(T[de],4)[3];ie[me]=ye}}else te===0&&(ae=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:q?8:void 0,colorBytes:O,alphaBytes:ie,needSMask:q,palette:J,mask:ae}}(a):u===2||u===4?function(I){for(var F=I.data,j=I.width,O=I.height,T=I.channels,$=I.depth,q=T===2?"DeviceGray":"DeviceRGB",J=T-1,ae=j*O,ie=J,Z=ae*ie,te=1*ae,V=Math.ceil(Z*$/8),B=Math.ceil(te*$/8),D=new Uint8Array(V),U=new Uint8Array(B),X=new DataView(F.buffer),ee=new DataView(D.buffer),K=new DataView(U.buffer),oe=!1,me=0;me<ae;me++){for(var de=me*T,ye=0;ye<ie;ye++)qw(ee,Bv(X,de+ye,$),me*ie+ye,$);var Te=Bv(X,de+ie,$);Te<(1<<$)-1&&(oe=!0),qw(K,Te,1*me,$)}return{colorSpace:q,colorsPerPixel:J,sMaskBitsPerComponent:oe?$:void 0,colorBytes:D,alphaBytes:U,needSMask:oe}}(a):function(I){var F=I.data,j=I.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:j,colorsPerPixel:j==="DeviceGray"?1:3,colorBytes:F instanceof Uint16Array?function(O){for(var T=O.length,$=new Uint8Array(2*T),q=new DataView($.buffer,$.byteOffset,$.byteLength),J=0;J<T;J++)q.setUint16(2*J,O[J],!1);return $}(F):F,needSMask:!1}}(a);var v,g,p,y=i,_=y.colorSpace,x=y.colorsPerPixel,b=y.sMaskBitsPerComponent,E=y.colorBytes,k=y.alphaBytes,S=y.needSMask,A=y.palette,M=y.mask,C=null;return n!==tr.API.image_compression.NONE&&typeof Em=="function"?(C=function(I){var F;switch(I){case tr.API.image_compression.FAST:F=11;break;case tr.API.image_compression.MEDIUM:F=13;break;case tr.API.image_compression.SLOW:F=14;break;default:F=12}return F}(n),v=this.decode.FLATE_DECODE,g="/Predictor ".concat(C," /Colors ").concat(x," /BitsPerComponent ").concat(f," /Columns ").concat(o),t=jw(E,Math.ceil(o*x*f/8),x,f,n),S&&(p=jw(k,Math.ceil(o*b/8),1,b,n))):(v=void 0,g=void 0,t=E,S&&(p=k)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(p&&this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),{alias:r,data:t,index:e,filter:v,decodeParameters:g,transparency:M,palette:A,sMask:p,predictor:C,width:o,height:s,bitsPerComponent:f,sMaskBitsPerComponent:b,colorSpace:_}}},function(t){t.processGIF89A=function(e,r,n,i){var a=new HI(e),o=a.width,s=a.height,u=[];a.decodeAndBlitFrameRGBA(0,u);var h={data:u,width:o,height:s},f=new zv(100).encode(h,100);return t.processJPEG.call(this,f,r,n,i)},t.processGIF87A=t.processGIF89A}(tr.API),Kl.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 t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:n,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Kl.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(r){Yn.log("bit decode error:"+r)}},Kl.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),r=e%4;for(t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var u=this.palette[a>>7-s&1];this.data[o+4*s]=u.blue,this.data[o+4*s+1]=u.green,this.data[o+4*s+2]=u.red,this.data[o+4*s+3]=255}r!==0&&(this.pos+=4-r)}},Kl.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<t;i++){var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*i*4,s=a>>4,u=15&a,h=this.palette[s];if(this.data[o]=h.blue,this.data[o+1]=h.green,this.data[o+2]=h.red,this.data[o+3]=255,2*i+1>=this.width)break;h=this.palette[u],this.data[o+4]=h.blue,this.data[o+4+1]=h.green,this.data[o+4+2]=h.red,this.data[o+4+3]=255}e!==0&&(this.pos+=4-e)}},Kl.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+4*n;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}t!==0&&(this.pos+=4-t)}},Kl.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,s=(a>>5&e)/e*255|0,u=(a>>10&e)/e*255|0,h=a>>15?255:0,f=n*this.width*4+4*i;this.data[f]=u,this.data[f+1]=s,this.data[f+2]=o,this.data[f+3]=h}this.pos+=t}},Kl.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&e)/e*255|0,u=(o>>5&r)/r*255|0,h=(o>>11)/e*255|0,f=i*this.width*4+4*a;this.data[f]=h,this.data[f+1]=u,this.data[f+2]=s,this.data[f+3]=255}this.pos+=t}},Kl.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*r;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=n,this.data[o+3]=255}this.pos+=this.width%4}},Kl.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*r;this.data[s]=a,this.data[s+1]=i,this.data[s+2]=n,this.data[s+3]=o}},Kl.prototype.getData=function(){return this.data},function(t){t.processBMP=function(e,r,n,i){var a=new Kl(e,!1),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new zv(100).encode(u,100);return t.processJPEG.call(this,h,r,n,i)}}(tr.API),Hw.prototype.getData=function(){return this.data},function(t){t.processWEBP=function(e,r,n,i){var a=new Hw(e),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new zv(100).encode(u,100);return t.processJPEG.call(this,h,r,n,i)}}(tr.API),tr.API.processRGBA=function(t,e,r){for(var n=t.data,i=n.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),s=0,u=0,h=0;h<i;h+=4){var f=n[h],v=n[h+1],g=n[h+2],p=n[h+3];a[s++]=f,a[s++]=v,a[s++]=g,o[u++]=p}var y=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:y,index:e,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},tr.API.setLanguage=function(t){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"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,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},Wh=tr.API,F1=Wh.getCharWidthsArray=function(t,e){var r,n,i=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),s=e.widths?e.widths:i.metadata.Unicode.widths,u=s.fof?s.fof:1,h=e.kerning?e.kerning:i.metadata.Unicode.kerning,f=h.fof?h.fof:1,v=e.doKerning!==!1,g=0,p=t.length,y=0,_=s[0]||u,x=[];for(r=0;r<p;r++)n=t.charCodeAt(r),typeof i.metadata.widthOfString=="function"?x.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(n))+o*(1e3/a)||0)/1e3):(g=v&&Nn(h[n])==="object"&&!isNaN(parseInt(h[n][y],10))?h[n][y]/f:0,x.push((s[n]||_)/u+g)),y=n;return x},Rw=Wh.getStringUnitWidth=function(t,e){var r=(e=e||{}).fontSize||this.internal.getFontSize(),n=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return Wh.processArabic&&(t=Wh.processArabic(t)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(t,r,i)/r:F1.apply(this,arguments).reduce(function(a,o){return a+o},0)},Mw=function(t,e,r,n){for(var i=[],a=0,o=t.length,s=0;a!==o&&s+e[a]<r;)s+=e[a],a++;i.push(t.slice(0,a));var u=a;for(s=0;a!==o;)s+e[a]>n&&(i.push(t.slice(u,a)),s=0,u=a),s+=e[a],a++;return u!==a&&i.push(t.slice(u,a)),i},Iw=function(t,e,r){r||(r={});var n,i,a,o,s,u,h,f=[],v=[f],g=r.textIndent||0,p=0,y=0,_=t.split(" "),x=F1.apply(this,[" ",r])[0];if(u=r.lineIndent===-1?_[0].length+2:r.lineIndent||0){var b=Array(u).join(" "),E=[];_.map(function(S){(S=S.split(/\s*\n/)).length>1?E=E.concat(S.map(function(A,M){return(M&&A.length?`
557
+ `:"")+A})):E.push(S[0])}),_=E,u=Rw.apply(this,[b,r])}for(a=0,o=_.length;a<o;a++){var k=0;if(n=_[a],u&&n[0]==`
558
+ `&&(n=n.substr(1),k=1),g+p+(y=(i=F1.apply(this,[n,r])).reduce(function(S,A){return S+A},0))>e||k){if(y>e){for(s=Mw.apply(this,[n,i,e-(g+p),e]),f.push(s.shift()),f=[s.pop()];s.length;)v.push([s.shift()]);y=i.slice(n.length-(f[0]?f[0].length:0)).reduce(function(S,A){return S+A},0)}else f=[n];v.push(f),g=y+u,p=x}else f.push(n),g+=p+y,p=x}return h=u?function(S,A){return(A?b:"")+S.join(" ")}:function(S){return S.join(" ")},v.map(h)},Wh.splitTextToSize=function(t,e,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),a=(function(f){if(f.widths&&f.kerning)return{widths:f.widths,kerning:f.kerning};var v=this.internal.getFont(f.fontName,f.fontStyle),g="Unicode";return v.metadata[g]?{widths:v.metadata[g].widths||{0:1},kerning:v.metadata[g].kerning||{}}:{font:v.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=1*this.internal.scaleFactor*e/i;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=r.lineIndent;var s,u,h=[];for(s=0,u=n.length;s<u;s++)h=h.concat(Iw.apply(this,[n[s],o,a]));return h},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",r="klmnopqrstuvwxyz",n={},i={},a=0;a<16;a++)n[r[a]]=e[a],i[e[a]]=r[a];var o=function(g){return"0x"+parseInt(g,10).toString(16)},s=t.__fontmetrics__.compress=function(g){var p,y,_,x,b=["{"];for(var E in g){if(p=g[E],isNaN(parseInt(E,10))?y="'"+E+"'":(E=parseInt(E,10),y=(y=o(E).slice(2)).slice(0,-1)+i[y.slice(-1)]),typeof p=="number")p<0?(_=o(p).slice(3),x="-"):(_=o(p).slice(2),x=""),_=x+_.slice(0,-1)+i[_.slice(-1)];else{if(Nn(p)!=="object")throw new Error("Don't know what to do with value type "+Nn(p)+".");_=s(p)}b.push(y+_)}return b.push("}"),b.join("")},u=t.__fontmetrics__.uncompress=function(g){if(typeof g!="string")throw new Error("Invalid argument passed to uncompress.");for(var p,y,_,x,b={},E=1,k=b,S=[],A="",M="",C=g.length-1,I=1;I<C;I+=1)(x=g[I])=="'"?p?(_=p.join(""),p=void 0):p=[]:p?p.push(x):x=="{"?(S.push([k,_]),k={},_=void 0):x=="}"?((y=S.pop())[0][y[1]]=k,_=void 0,k=y[0]):x=="-"?E=-1:_===void 0?n.hasOwnProperty(x)?(A+=n[x],_=parseInt(A,16)*E,E=1,A=""):A+=x:n.hasOwnProperty(x)?(M+=n[x],k[_]=parseInt(M,16)*E,E=1,_=void 0,M=""):M+=x;return b},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:u("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},f={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},v={Unicode:{"Courier-Oblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":u("{'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":u("{'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:u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":u("{'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:u("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:u("{'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":u("{'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:u("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":u("{'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":u("{'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":u("{'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}}}")}};t.events.push(["addFont",function(g){var p=g.font,y=v.Unicode[p.postScriptName];y&&(p.metadata.Unicode={},p.metadata.Unicode.widths=y.widths,p.metadata.Unicode.kerning=y.kerning);var _=f.Unicode[p.postScriptName];_&&(p.metadata.Unicode.encoding=_,p.encoding=_.codePages[0])}])}(tr.API),function(t){var e=function(r){for(var n=r.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=r.charCodeAt(a);return i};t.API.events.push(["addFont",function(r){var n=void 0,i=r.font,a=r.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(n=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?e(s):e(K1(s)),o.metadata=t.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,n)}}])}(tr),tr.API.addSvgAsImage=function(t,e,r,n,i,a,o,s){if(isNaN(e)||isNaN(r))throw Yn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(i))throw Yn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=n,u.height=i;var h=u.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,u.width,u.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},v=this;return(yr.canvg?Promise.resolve(yr.canvg):bv(()=>import("./index.es-CTG6a0ey.js"),[],import.meta.url)).catch(function(g){return Promise.reject(new Error("Could not load canvg: "+g))}).then(function(g){return g.default?g.default:g}).then(function(g){return g.fromString(h,t,f)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(g){return g.render(f)}).then(function(){v.addImage(u.toDataURL("image/jpeg",1),e,r,n,i,o,s)})},tr.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},tr.API.viewerPreferences=function(t,e){var r;t=t||{},e=e||!1;var n,i,a,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),u=[],h=0,f=0,v=0;function g(y,_){var x,b=!1;for(x=0;x<y.length;x+=1)y[x]===_&&(b=!0);return b}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var p=s.length;for(v=0;v<p;v+=1)r[s[v]].value=r[s[v]].defaultValue,r[s[v]].explicitSet=!1}if(Nn(t)==="object"){for(i in t)if(a=t[i],g(s,i)&&a!==void 0){if(r[i].type==="boolean"&&typeof a=="boolean")r[i].value=a;else if(r[i].type==="name"&&g(r[i].valueSet,a))r[i].value=a;else if(r[i].type==="integer"&&Number.isInteger(a))r[i].value=a;else if(r[i].type==="array"){for(h=0;h<a.length;h+=1)if(n=!0,a[h].length===1&&typeof a[h][0]=="number")u.push(String(a[h]-1));else if(a[h].length>1){for(f=0;f<a[h].length;f+=1)typeof a[h][f]!="number"&&(n=!1);n===!0&&u.push([a[h][0]-1,a[h][1]-1].join(" "))}r[i].value="["+u.join(" ")+"]"}else r[i].value=r[i].defaultValue;r[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var y,_=[];for(y in r)r[y].explicitSet===!0&&(r[y].type==="name"?_.push("/"+y+" /"+r[y].value):_.push("/"+y+" "+r[y].value));_.length!==0&&this.internal.write(`/ViewerPreferences
559
+ <<
560
+ `+_.join(`
561
+ `)+`
562
+ >>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},function(t){var e=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>',i=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),a=unescape(encodeURIComponent(n)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),s=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),h=a.length+o.length+s.length+i.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+h+" >>"),this.internal.write("stream"),this.internal.write(i+a+o+s+u),this.internal.write("endstream"),this.internal.write("endobj")},r=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};t.addMetadata=function(n,i){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",r),this.internal.events.subscribe("postPutResources",e)),this}}(tr.API),function(t){var e=t.API,r=e.pdfEscape16=function(a,o){for(var s,u=o.metadata.Unicode.widths,h=["","0","00","000","0000"],f=[""],v=0,g=a.length;v<g;++v){if(s=o.metadata.characterToGlyph(a.charCodeAt(v)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=a.charCodeAt(v),u.indexOf(s)==-1&&(u.push(s),u.push([parseInt(o.metadata.widthOfGlyph(s),10)])),s=="0")return f.join("");s=s.toString(16),f.push(h[4-s.length],s)}return f.join("")},n=function(a){var o,s,u,h,f,v,g;for(f=`/CIDInit /ProcSet findresource begin
563
+ 12 dict begin
564
+ begincmap
565
+ /CIDSystemInfo <<
566
+ /Registry (Adobe)
567
+ /Ordering (UCS)
568
+ /Supplement 0
569
+ >> def
570
+ /CMapName /Adobe-Identity-UCS def
571
+ /CMapType 2 def
572
+ 1 begincodespacerange
573
+ <0000><ffff>
574
+ endcodespacerange`,u=[],v=0,g=(s=Object.keys(a).sort(function(p,y){return p-y})).length;v<g;v++)o=s[v],u.length>=100&&(f+=`
575
+ `+u.length+` beginbfchar
576
+ `+u.join(`
577
+ `)+`
578
+ endbfchar`,u=[]),a[o]!==void 0&&a[o]!==null&&typeof a[o].toString=="function"&&(h=("0000"+a[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),u.push("<"+o+"><"+h+">"));return u.length&&(f+=`
579
+ `+u.length+` beginbfchar
580
+ `+u.join(`
581
+ `)+`
582
+ endbfchar
583
+ `),f+`endcmap
584
+ CMapName currentdict /CMap defineresource pop
585
+ end
586
+ end`};e.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,f=o.putStream;if(s.metadata instanceof t.API.TTFFont&&s.encoding==="Identity-H"){for(var v=s.metadata.Unicode.widths,g=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),p="",y=0;y<g.length;y++)p+=String.fromCharCode(g[y]);var _=h();f({data:p,addLength1:!0,objectId:_}),u("endobj");var x=h();f({data:n(s.metadata.toUnicode),addLength1:!0,objectId:x}),u("endobj");var b=h();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+Kh(s.fontName)),u("/FontFile2 "+_+" 0 R"),u("/FontBBox "+t.API.PDFObject.convert(s.metadata.bbox)),u("/Flags "+s.metadata.flags),u("/StemV "+s.metadata.stemV),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u(">>"),u("endobj");var E=h();u("<<"),u("/Type /Font"),u("/BaseFont /"+Kh(s.fontName)),u("/FontDescriptor "+b+" 0 R"),u("/W "+t.API.PDFObject.convert(v)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+s.encoding+")"),u(">>"),u(">>"),u("endobj"),s.objectNumber=h(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+x+" 0 R"),u("/BaseFont /"+Kh(s.fontName)),u("/Encoding /"+s.encoding),u("/DescendantFonts ["+E+" 0 R]"),u(">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]),e.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,f=o.putStream;if(s.metadata instanceof t.API.TTFFont&&s.encoding==="WinAnsiEncoding"){for(var v=s.metadata.rawData,g="",p=0;p<v.length;p++)g+=String.fromCharCode(v[p]);var y=h();f({data:g,addLength1:!0,objectId:y}),u("endobj");var _=h();f({data:n(s.metadata.toUnicode),addLength1:!0,objectId:_}),u("endobj");var x=h();u("<<"),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u("/StemV "+s.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+y+" 0 R"),u("/Flags 96"),u("/FontBBox "+t.API.PDFObject.convert(s.metadata.bbox)),u("/FontName /"+Kh(s.fontName)),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u(">>"),u("endobj"),s.objectNumber=h();for(var b=0;b<s.metadata.hmtx.widths.length;b++)s.metadata.hmtx.widths[b]=parseInt(s.metadata.hmtx.widths[b]*(1e3/s.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+_+" 0 R/BaseFont/"+Kh(s.fontName)+"/FontDescriptor "+x+" 0 R/Encoding/"+s.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(s.metadata.hmtx.widths)+">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]);var i=function(a){var o,s=a.text||"",u=a.x,h=a.y,f=a.options||{},v=a.mutex||{},g=v.pdfEscape,p=v.activeFontKey,y=v.fonts,_=p,x="",b=0,E="",k=y[_].encoding;if(y[_].encoding!=="Identity-H")return{text:s,x:u,y:h,options:f,mutex:v};for(E=s,_=p,Array.isArray(s)&&(E=s[0]),b=0;b<E.length;b+=1)y[_].metadata.hasOwnProperty("cmap")&&(o=y[_].metadata.cmap.unicode.codeMap[E[b].charCodeAt(0)]),o||E[b].charCodeAt(0)<256&&y[_].metadata.hasOwnProperty("Unicode")?x+=E[b]:x+="";var S="";return parseInt(_.slice(1))<14||k==="WinAnsiEncoding"?S=g(x,_).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):k==="Identity-H"&&(S=r(x,y[_])),v.isHex=!0,{text:S,x:u,y:h,options:f,mutex:v}};e.events.push(["postProcessText",function(a){var o=a.text||"",s=[],u={text:o,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(o)){var h=0;for(h=0;h<o.length;h+=1)Array.isArray(o[h])&&o[h].length===3?s.push([i(Object.assign({},u,{text:o[h][0]})).text,o[h][1],o[h][2]]):s.push(i(Object.assign({},u,{text:o[h]})).text);a.text=s}else a.text=i(Object.assign({},u,{text:o})).text}])}(tr),function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(r){return e.call(this),this.internal.vFS[r]!==void 0},t.addFileToVFS=function(r,n){return e.call(this),this.internal.vFS[r]=n,this},t.getFileFromVFS=function(r){return e.call(this),this.internal.vFS[r]!==void 0?this.internal.vFS[r]:null}}(tr.API),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(n){var i,a,o,s,u,h,f,v=e,g=[[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]],p=[[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]],y={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},_={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},x=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],b=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)$/),E=!1,k=0;this.__bidiEngine__={};var S=function(O){var T=O.charCodeAt(),$=T>>8,q=_[$];return q!==void 0?v[256*q+(255&T)]:$===252||$===253?"AL":b.test($)?"L":$===8?"R":"N"},A=function(O){for(var T,$=0;$<O.length;$++){if((T=S(O.charAt($)))==="L")return!1;if(T==="R")return!0}return!1},M=function(O,T,$,q){var J,ae,ie,Z,te=T[q];switch(te){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":E=!1;break;case"N":case"AN":break;case"EN":E&&(te="AN");break;case"AL":E=!0,te="R";break;case"WS":case"BN":te="N";break;case"CS":q<1||q+1>=T.length||(J=$[q-1])!=="EN"&&J!=="AN"||(ae=T[q+1])!=="EN"&&ae!=="AN"?te="N":E&&(ae="AN"),te=ae===J?ae:"N";break;case"ES":te=(J=q>0?$[q-1]:"B")==="EN"&&q+1<T.length&&T[q+1]==="EN"?"EN":"N";break;case"ET":if(q>0&&$[q-1]==="EN"){te="EN";break}if(E){te="N";break}for(ie=q+1,Z=T.length;ie<Z&&T[ie]==="ET";)ie++;te=ie<Z&&T[ie]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for(Z=T.length,ie=q+1;ie<Z&&T[ie]==="NSM";)ie++;if(ie<Z){var V=O[q],B=V>=1425&&V<=2303||V===64286;if(J=T[ie],B&&(J==="R"||J==="AL")){te="R";break}}}te=q<1||(J=T[q-1])==="B"?"N":$[q-1];break;case"B":E=!1,i=!0,te=k;break;case"S":a=!0,te="N"}return te},C=function(O,T,$){var q=O.split("");return $&&I(q,$,{hiLevel:k}),q.reverse(),T&&T.reverse(),q.join("")},I=function(O,T,$){var q,J,ae,ie,Z,te=-1,V=O.length,B=0,D=[],U=k?p:g,X=[];for(E=!1,i=!1,a=!1,J=0;J<V;J++)X[J]=S(O[J]);for(ae=0;ae<V;ae++){if(Z=B,D[ae]=M(O,X,D,ae),q=240&(B=U[Z][y[D[ae]]]),B&=15,T[ae]=ie=U[B][5],q>0)if(q===16){for(J=te;J<ae;J++)T[J]=1;te=-1}else te=-1;if(U[B][6])te===-1&&(te=ae);else if(te>-1){for(J=te;J<ae;J++)T[J]=ie;te=-1}X[ae]==="B"&&(T[ae]=0),$.hiLevel|=ie}a&&function(ee,K,oe){for(var me=0;me<oe;me++)if(ee[me]==="S"){K[me]=k;for(var de=me-1;de>=0&&ee[de]==="WS";de--)K[de]=k}}(X,T,V)},F=function(O,T,$,q,J){if(!(J.hiLevel<O)){if(O===1&&k===1&&!i)return T.reverse(),void($&&$.reverse());for(var ae,ie,Z,te,V=T.length,B=0;B<V;){if(q[B]>=O){for(Z=B+1;Z<V&&q[Z]>=O;)Z++;for(te=B,ie=Z-1;te<ie;te++,ie--)ae=T[te],T[te]=T[ie],T[ie]=ae,$&&(ae=$[te],$[te]=$[ie],$[ie]=ae);B=Z}B++}}},j=function(O,T,$){var q=O.split(""),J={hiLevel:k};return $||($=[]),I(q,$,J),function(ae,ie,Z){if(Z.hiLevel!==0&&f)for(var te,V=0;V<ae.length;V++)ie[V]===1&&(te=x.indexOf(ae[V]))>=0&&(ae[V]=x[te+1])}(q,$,J),F(2,q,T,$,J),F(1,q,T,$,J),q.join("")};return this.__bidiEngine__.doBidiReorder=function(O,T,$){if(function(J,ae){if(ae)for(var ie=0;ie<J.length;ie++)ae[ie]=ie;s===void 0&&(s=A(J)),h===void 0&&(h=A(J))}(O,T),o||!u||h)if(o&&u&&s^h)k=s?1:0,O=C(O,T,$);else if(!o&&u&&h)k=s?1:0,O=j(O,T,$),O=C(O,T);else if(!o||s||u||h){if(o&&!u&&s^h)O=C(O,T),s?(k=0,O=j(O,T,$)):(k=1,O=j(O,T,$),O=C(O,T));else if(o&&s&&!u&&h)k=1,O=j(O,T,$),O=C(O,T);else if(!o&&!u&&s^h){var q=f;s?(k=1,O=j(O,T,$),k=0,f=!1,O=j(O,T,$),f=q):(k=0,O=j(O,T,$),O=C(O,T),k=1,f=!1,O=j(O,T,$),f=q,O=C(O,T))}}else k=0,O=j(O,T,$);else k=s?1:0,O=j(O,T,$);return O},this.__bidiEngine__.setOptions=function(O){O&&(o=O.isInputVisual,u=O.isOutputVisual,s=O.isInputRtl,h=O.isOutputRtl,f=O.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var e=["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"],r=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(n){var i=n.text;n.x,n.y;var a=n.options||{};n.mutex,a.lang;var o=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,r.setOptions(a),Object.prototype.toString.call(i)==="[object Array]"){var s=0;for(o=[],s=0;s<i.length;s+=1)Object.prototype.toString.call(i[s])==="[object Array]"?o.push([r.doBidiReorder(i[s][0]),i[s][1],i[s][2]]):o.push([r.doBidiReorder(i[s])]);n.text=o}else n.text=r.doBidiReorder(i);r.setOptions({isInputVisual:!0})}])}(tr),tr.API.TTFFont=function(){function t(e){var r;if(this.rawData=e,r=this.contents=new wf(e),this.contents.pos=4,r.readString(4)==="ttcf")throw new Error("TTCF not supported.");r.pos=0,this.parse(),this.subset=new ij(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new $I(this.contents),this.head=new WI(this),this.name=new ZI(this),this.cmap=new sx(this),this.toUnicode={},this.hhea=new VI(this),this.maxp=new QI(this),this.hmtx=new JI(this),this.post=new XI(this),this.os2=new YI(this),this.loca=new nj(this),this.glyf=new ej(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]},t.prototype.registerTTF=function(){var e,r,n,i,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,s,u,h;for(h=[],o=0,s=(u=this.bbox).length;o<s;o++)e=u[o],h.push(Math.round(e*this.scaleFactor));return h}).call(this),this.stemV=0,this.post.exists?(n=255&(i=this.post.italic_angle),32768&(r=i>>16)&&(r=-(1+(65535^r))),this.italicAngle=+(r+"."+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=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===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")},t.prototype.characterToGlyph=function(e){var r;return((r=this.cmap.unicode)!=null?r.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*r},t.prototype.widthOfString=function(e,r,n){var i,a,o,s;for(o=0,a=0,s=(e=""+e).length;0<=s?a<s:a>s;a=0<=s?++a:--a)i=e.charCodeAt(a),o+=this.widthOfGlyph(this.characterToGlyph(i))+n*(1e3/r)||0;return o*(r/1e3)},t.prototype.lineHeight=function(e,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*e},t}();var ou,wf=function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var r,n;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(e){var r,n,i;for(i=[],r=0,n=e.length;0<=n?r<n:r>n;r=0<=n?++r:--r)i.push(this.writeByte(e.charCodeAt(r)));return i},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,r,n,i,a,o,s,u;return e=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte(),u=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^i)+16777216*(255^a)+65536*(255^o)+256*(255^s)+(255^u)+1):72057594037927940*e+281474976710656*r+1099511627776*n+4294967296*i+16777216*a+65536*o+256*s+u},t.prototype.writeLongLong=function(e){var r,n;return r=Math.floor(e/4294967296),n=4294967295&e,this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var r,n;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r.push(this.readByte());return r},t.prototype.write=function(e){var r,n,i,a;for(a=[],n=0,i=e.length;n<i;n++)r=e[n],a.push(this.writeByte(r));return a},t}(),$I=function(){var t;function e(r){var n,i,a;for(this.scalarType=r.readInt(),this.tableCount=r.readShort(),this.searchRange=r.readShort(),this.entrySelector=r.readShort(),this.rangeShift=r.readShort(),this.tables={},i=0,a=this.tableCount;0<=a?i<a:i>a;i=0<=a?++i:--i)n={tag:r.readString(4),checksum:r.readInt(),offset:r.readInt(),length:r.readInt()},this.tables[n.tag]=n}return e.prototype.encode=function(r){var n,i,a,o,s,u,h,f,v,g,p,y,_;for(_ in p=Object.keys(r).length,u=Math.log(2),v=16*Math.floor(Math.log(p)/u),o=Math.floor(v/u),f=16*p-v,(i=new wf).writeInt(this.scalarType),i.writeShort(p),i.writeShort(v),i.writeShort(o),i.writeShort(f),a=16*p,h=i.pos+a,s=null,y=[],r)for(g=r[_],i.writeString(_),i.writeInt(t(g)),i.writeInt(h),i.writeInt(g.length),y=y.concat(g),_==="head"&&(s=h),h+=g.length;h%4;)y.push(0),h++;return i.write(y),n=2981146554-t(i.data),i.pos=s+8,i.writeUInt32(n),i.data},t=function(r){var n,i,a,o;for(r=lx.call(r);r.length%4;)r.push(0);for(a=new wf(r),i=0,n=0,o=r.length;n<o;n=n+=4)i+=a.readUInt32();return 4294967295&i},e}(),GI={}.hasOwnProperty,Gu=function(t,e){for(var r in e)GI.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};ou=function(){function t(e){var r;this.file=e,r=this.file.directory.tables[this.tag],this.exists=!!r,r&&(this.offset=r.offset,this.length=r.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var WI=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var r;return(r=new wf).writeInt(this.version),r.writeInt(this.revision),r.writeInt(this.checkSumAdjustment),r.writeInt(this.magicNumber),r.writeShort(this.flags),r.writeShort(this.unitsPerEm),r.writeLongLong(this.created),r.writeLongLong(this.modified),r.writeShort(this.xMin),r.writeShort(this.yMin),r.writeShort(this.xMax),r.writeShort(this.yMax),r.writeShort(this.macStyle),r.writeShort(this.lowestRecPPEM),r.writeShort(this.fontDirectionHint),r.writeShort(e),r.writeShort(this.glyphDataFormat),r.data},t}(),$w=function(){function t(e,r){var n,i,a,o,s,u,h,f,v,g,p,y,_,x,b,E,k;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=r+e.readInt(),v=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.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(u=0;u<256;++u)this.codeMap[u]=e.readByte();break;case 4:for(p=e.readUInt16(),g=p/2,e.pos+=6,a=function(){var S,A;for(A=[],u=S=0;0<=g?S<g:S>g;u=0<=g?++S:--S)A.push(e.readUInt16());return A}(),e.pos+=2,_=function(){var S,A;for(A=[],u=S=0;0<=g?S<g:S>g;u=0<=g?++S:--S)A.push(e.readUInt16());return A}(),h=function(){var S,A;for(A=[],u=S=0;0<=g?S<g:S>g;u=0<=g?++S:--S)A.push(e.readUInt16());return A}(),f=function(){var S,A;for(A=[],u=S=0;0<=g?S<g:S>g;u=0<=g?++S:--S)A.push(e.readUInt16());return A}(),i=(this.length-e.pos+this.offset)/2,s=function(){var S,A;for(A=[],u=S=0;0<=i?S<i:S>i;u=0<=i?++S:--S)A.push(e.readUInt16());return A}(),u=b=0,k=a.length;b<k;u=++b)for(x=a[u],n=E=y=_[u];y<=x?E<=x:E>=x;n=y<=x?++E:--E)f[u]===0?o=n+h[u]:(o=s[f[u]/2+(n-y)-(g-u)]||0)!==0&&(o+=h[u]),this.codeMap[n]=65535&o}e.pos=v}return t.encode=function(e,r){var n,i,a,o,s,u,h,f,v,g,p,y,_,x,b,E,k,S,A,M,C,I,F,j,O,T,$,q,J,ae,ie,Z,te,V,B,D,U,X,ee,K,oe,me,de,ye,Te,Ce;switch(q=new wf,o=Object.keys(e).sort(function(Ie,Ee){return Ie-Ee}),r){case"macroman":for(_=0,x=function(){var Ie=[];for(y=0;y<256;++y)Ie.push(0);return Ie}(),E={0:0},a={},J=0,te=o.length;J<te;J++)E[de=e[i=o[J]]]==null&&(E[de]=++_),a[i]={old:e[i],new:E[e[i]]},x[i]=E[e[i]];return q.writeUInt16(1),q.writeUInt16(0),q.writeUInt32(12),q.writeUInt16(0),q.writeUInt16(262),q.writeUInt16(0),q.write(x),{charMap:a,subtable:q.data,maxGlyphID:_+1};case"unicode":for(T=[],v=[],k=0,E={},n={},b=h=null,ae=0,V=o.length;ae<V;ae++)E[A=e[i=o[ae]]]==null&&(E[A]=++k),n[i]={old:A,new:E[A]},s=E[A]-i,b!=null&&s===h||(b&&v.push(b),T.push(i),h=s),b=i;for(b&&v.push(b),v.push(65535),T.push(65535),j=2*(F=T.length),I=2*Math.pow(Math.log(F)/Math.LN2,2),g=Math.log(I/2)/Math.LN2,C=2*F-I,u=[],M=[],p=[],y=ie=0,B=T.length;ie<B;y=++ie){if(O=T[y],f=v[y],O===65535){u.push(0),M.push(0);break}if(O-($=n[O].new)>=32768)for(u.push(0),M.push(2*(p.length+F-y)),i=Z=O;O<=f?Z<=f:Z>=f;i=O<=f?++Z:--Z)p.push(n[i].new);else u.push($-O),M.push(0)}for(q.writeUInt16(3),q.writeUInt16(1),q.writeUInt32(12),q.writeUInt16(4),q.writeUInt16(16+8*F+2*p.length),q.writeUInt16(0),q.writeUInt16(j),q.writeUInt16(I),q.writeUInt16(g),q.writeUInt16(C),oe=0,D=v.length;oe<D;oe++)i=v[oe],q.writeUInt16(i);for(q.writeUInt16(0),me=0,U=T.length;me<U;me++)i=T[me],q.writeUInt16(i);for(ye=0,X=u.length;ye<X;ye++)s=u[ye],q.writeUInt16(s);for(Te=0,ee=M.length;Te<ee;Te++)S=M[Te],q.writeUInt16(S);for(Ce=0,K=p.length;Ce<K;Ce++)_=p[Ce],q.writeUInt16(_);return{charMap:n,subtable:q.data,maxGlyphID:k+1}}},t}(),sx=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="cmap",t.prototype.parse=function(e){var r,n,i;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=i?n<i:n>i;n=0<=i?++n:--n)r=new $w(e,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},t.encode=function(e,r){var n,i;return r==null&&(r="macroman"),n=$w.encode(e,r),(i=new wf).writeUInt16(0),i.writeUInt16(1),n.table=i.data.concat(n.subtable),n},t}(),VI=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t}(),YI=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var r,n;for(n=[],r=0;r<10;++r)n.push(e.readByte());return n}(),this.charRange=function(){var r,n;for(n=[],r=0;r<4;++r)n.push(e.readInt());return n}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var r,n;for(n=[],r=0;r<2;r=++r)n.push(e.readInt());return n}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t}(),XI=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="post",t.prototype.parse=function(e){var r,n,i;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var a;for(n=e.readUInt16(),this.glyphNameIndex=[],a=0;0<=n?a<n:a>n;a=0<=n?++a:--a)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],i=[];e.pos<this.offset+this.length;)r=e.readByte(),i.push(this.names.push(e.readString(r)));return i;case 151552:return n=e.readUInt16(),this.offsets=e.read(n);case 262144:return this.map=(function(){var o,s,u;for(u=[],a=o=0,s=this.file.maxp.numGlyphs;0<=s?o<s:o>s;a=0<=s?++o:--o)u.push(e.readUInt32());return u}).call(this)}},t}(),KI=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},ZI=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="name",t.prototype.parse=function(e){var r,n,i,a,o,s,u,h,f,v,g;for(e.pos=this.offset,e.readShort(),r=e.readShort(),s=e.readShort(),n=[],a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)n.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(u={},a=f=0,v=n.length;f<v;a=++f)i=n[a],e.pos=i.offset,h=e.readString(i.length),o=new KI(h,i),u[g=i.nameID]==null&&(u[g]=[]),u[i.nameID].push(o);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]},t}(),QI=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t}(),JI=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="hmtx",t.prototype.parse=function(e){var r,n,i,a,o,s,u;for(e.pos=this.offset,this.metrics=[],r=0,s=this.file.hhea.numberOfMetrics;0<=s?r<s:r>s;r=0<=s?++r:--r)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var h,f;for(f=[],r=h=0;0<=i?h<i:h>i;r=0<=i?++h:--h)f.push(e.readInt16());return f}(),this.widths=(function(){var h,f,v,g;for(g=[],h=0,f=(v=this.metrics).length;h<f;h++)a=v[h],g.push(a.advance);return g}).call(this),n=this.widths[this.widths.length-1],u=[],r=o=0;0<=i?o<i:o>i;r=0<=i?++o:--o)u.push(this.widths.push(n));return u},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t}(),lx=[].slice,ej=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var r,n,i,a,o,s,u,h,f,v;return e in this.cache?this.cache[e]:(a=this.file.loca,r=this.file.contents,n=a.indexOf(e),(i=a.lengthOf(e))===0?this.cache[e]=null:(r.pos=this.offset+n,o=(s=new wf(r.read(i))).readShort(),h=s.readShort(),v=s.readShort(),u=s.readShort(),f=s.readShort(),this.cache[e]=o===-1?new rj(s,h,v,u,f):new tj(s,o,h,v,u,f),this.cache[e]))},t.prototype.encode=function(e,r,n){var i,a,o,s,u;for(o=[],a=[],s=0,u=r.length;s<u;s++)i=e[r[s]],a.push(o.length),i&&(o=o.concat(i.encode(n)));return a.push(o.length),{table:o,offsets:a}},t}(),tj=function(){function t(e,r,n,i,a,o){this.raw=e,this.numberOfContours=r,this.xMin=n,this.yMin=i,this.xMax=a,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),rj=function(){function t(e,r,n,i,a){var o,s;for(this.raw=e,this.xMin=r,this.yMin=n,this.xMax=i,this.yMax=a,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 t.prototype.encode=function(){var e,r,n;for(r=new wf(lx.call(this.raw.data)),e=0,n=this.glyphIDs.length;e<n;++e)r.pos=this.glyphOffsets[e];return r.data},t}(),nj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Gu(t,ou),t.prototype.tag="loca",t.prototype.parse=function(e){var r,n;return e.pos=this.offset,r=this.file.head.indexToLocFormat,this.offsets=r===0?(function(){var i,a;for(a=[],n=0,i=this.length;n<i;n+=2)a.push(2*e.readUInt16());return a}).call(this):(function(){var i,a;for(a=[],n=0,i=this.length;n<i;n+=4)a.push(e.readUInt32());return a}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,r){for(var n=new Uint32Array(this.offsets.length),i=0,a=0,o=0;o<n.length;++o)if(n[o]=i,a<r.length&&r[a]==o){++a,n[o]=i;var s=this.offsets[o],u=this.offsets[o+1]-s;u>0&&(i+=u)}for(var h=new Array(4*n.length),f=0;f<n.length;++f)h[4*f+3]=255&n[f],h[4*f+2]=(65280&n[f])>>8,h[4*f+1]=(16711680&n[f])>>16,h[4*f]=(4278190080&n[f])>>24;return h},t}(),ij=function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,r,n,i,a;for(r in i=this.font.cmap.tables[0].codeMap,e={},a=this.subset)n=a[r],e[r]=i[n];return e},t.prototype.glyphsFor=function(e){var r,n,i,a,o,s,u;for(i={},o=0,s=e.length;o<s;o++)i[a=e[o]]=this.font.glyf.glyphFor(a);for(a in r=[],i)(n=i[a])!=null&&n.compound&&r.push.apply(r,n.glyphIDs);if(r.length>0)for(a in u=this.glyphsFor(r))n=u[a],i[a]=n;return i},t.prototype.encode=function(e,r){var n,i,a,o,s,u,h,f,v,g,p,y,_,x,b;for(i in n=sx.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(e),p={0:0},b=n.charMap)p[(u=b[i]).old]=u.new;for(y in g=n.maxGlyphID,o)y in p||(p[y]=g++);return f=function(E){var k,S;for(k in S={},E)S[E[k]]=k;return S}(p),v=Object.keys(f).sort(function(E,k){return E-k}),_=function(){var E,k,S;for(S=[],E=0,k=v.length;E<k;E++)s=v[E],S.push(f[s]);return S}(),a=this.font.glyf.encode(o,_,p),h=this.font.loca.encode(a.offsets,_),x={cmap:this.font.cmap.raw(),glyf:a.table,loca:h,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(r)},this.font.os2.exists&&(x["OS/2"]=this.font.os2.raw()),this.font.directory.encode(x)},t}();tr.API.PDFObject=function(){var t;function e(){}return t=function(r,n){return(Array(n+1).join("0")+r).slice(-n)},e.convert=function(r){var n,i,a,o;if(Array.isArray(r))return"["+function(){var s,u,h;for(h=[],s=0,u=r.length;s<u;s++)n=r[s],h.push(e.convert(n));return h}().join(" ")+"]";if(typeof r=="string")return"/"+r;if(r?.isString)return"("+r+")";if(r instanceof Date)return"(D:"+t(r.getUTCFullYear(),4)+t(r.getUTCMonth(),2)+t(r.getUTCDate(),2)+t(r.getUTCHours(),2)+t(r.getUTCMinutes(),2)+t(r.getUTCSeconds(),2)+"Z)";if({}.toString.call(r)==="[object Object]"){for(i in a=["<<"],r)o=r[i],a.push("/"+i+" "+e.convert(o));return a.push(">>"),a.join(`
587
+ `)}return""+r},e}();window.jspdf={jsPDF:tr};GP(!1);U8("change-font-size");const aj=new URLSearchParams(location.search).get("key"),ux=CT({key:aj});window.store=ux;window.config={addGlobalFont:QP,unstable_useHtmlTextRender:nO,unstable_setTextVerticalResizeEnabled:tO,unstable_setTextOverflow:U8,onLoadError:ZP,setAssetLoadTimeout:VP,setFontLoadTimeout:YP,unstable_setTextSplitAllowed:aO};const oj=Ww.createRoot(document.getElementById("root"));oj.render(se.createElement(pR,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:ux,components:{PageControls:()=>null,Tooltip:()=>null}}));export{Nn as _,t0 as c,ch as g};